User:Mikevoir/common.js: Difference between revisions

From Coral Island Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
importScript('MediaWiki:Wikimarks.js');
// Load JS
if (localStorage.getItem('ciw-theme')===null) {localStorage.setItem('ciw-theme', 'light');}
[
$('body').addClass('skin-vector-'+localStorage.getItem('ciw-theme'));
'Wikimarks.js', // Improvements to Special:Upload
$('#p-personal .vector-menu-content-list')
]
.prepend(
.forEach(function(src){
$('<li id="pt-theme" class="mw-list-item active">')
importScript('MediaWiki:'+src);
.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');
});
});
// empty space for readability

Latest revision as of 03:05, 19 July 2024

// Load JS
[
	'Wikimarks.js',		// Improvements to Special:Upload
]
.forEach(function(src){
	importScript('MediaWiki:'+src);
});






// empty space for readability