Minecraft Wiki
Advertisement

Documentation may be created at User:SansUT1/common.js/doc.

Note: After saving, you have to bypass your browser's cache to see the changes.

Google Chrome, Firefox, Microsoft Edge, and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button.
For details and instructions about other browsers, see Wikipedia:Bypass your cache.

$(function() {
    if (mw.config.get('skin') !== 'fandomdesktop') return;
    var theme = mw.util.getParamValue('usetheme');
    if (['light','dark'].indexOf(theme) === -1) return;
    $.get(mw.util.wikiScript('wikia')+'?controller=ThemeApi&method=themeVariables&variant='+theme+'&cb='+(new Date().getTime())).done(function(data){
        var $s = $('#pcjThemeSwitch')[0] || $('<style>').attr('id','pcjThemeSwitch').appendTo('body');
        $($s).text(data);
        $('body').removeClass('theme-fandomdesktop-light theme-fandomdesktop-dark').addClass('theme-fandomdesktop-'+theme);
    });
});
Advertisement