User:Mikevoir/common.js
Jump to navigation
Jump to search
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
importScript('MediaWiki:Wikimarks.js');
if (localStorage.getItem('ciw-theme')===null) {localStorage.setItem('ciw-theme', 'light');}
$('body').addClass('skin-vector-'+localStorage.getItem('ciw-theme'));
$('#p-personal .vector-menu-content-list')
.prepend(
$('<li id="pt-theme" class="mw-list-item active">')
.prepend($('<a class="theme-trigger" href="#"><span>Theme</span></a></li>'))
);
$('#p-personal .vector-menu-content-list').on('click', '#pt-theme, .theme-trigger', function() {
if (
localStorage.getItem('ciw-theme')===null||
localStorage.getItem('ciw-theme')==='dark'
) {localStorage.setItem('ciw-theme', 'light');}
else {localStorage.setItem('ciw-theme', 'light');}
$('body').toggleClass('skin-vector-dark skin-vector-light');
});