23
edits
(Created page with "→All JavaScript here will be loaded for users of the Vector skin: const wikiStorage = window.localStorage; var darkMode = wikiStorage.getItem('darkMode'); if (darkMode == null) { window.localStorage.setItem('darkMode', 0); } var footerLinks = document.getElementById('footer-places'); var modeSwitch = document.createElement('li'); modeSwitch.setAttribute('id', 'footer-places-skin-mode'); modeSwitch.setAttribute('onclick', 'switchSkin()'); function switchSkinShared(...") |
|||
| (5 intermediate revisions by one other user not shown) | |||
| Line 6: | Line 6: | ||
} | } | ||
var | var toolLinksBase = document.getElementById('p-tb'); | ||
var | var toolLinks = toolLinksBase.getElementsByClassName('vector-menu-content-list'); | ||
modeSwitch.setAttribute('id', ' | var modeSwitchBase = document.createElement('li'); | ||
var modeSwitch = document.createElement('span'); | |||
modeSwitchBase.setAttribute('id', 'skin-mode'); | |||
modeSwitch.setAttribute('onclick', 'switchSkin()'); | modeSwitch.setAttribute('onclick', 'switchSkin()'); | ||
| Line 30: | Line 32: | ||
wikiStorage.setItem('darkMode', 0 ); | wikiStorage.setItem('darkMode', 0 ); | ||
} | } | ||
wikiStorage.getItem('darkMode'); | darkMode = wikiStorage.getItem('darkMode'); | ||
switchSkinShared(); | switchSkinShared(); | ||
} | } | ||
switchSkinShared(); | switchSkinShared(); | ||
modeSwitchBase.appendChild(modeSwitch); | |||
toolLinks[0].appendChild(modeSwitchBase); | |||