Jump to content

MediaWiki:Common.js: Difference between revisions

From The Shivo Library
Created page with "Any JavaScript here will be loaded for all users on every page load.: mw.loader.using('mediawiki.util').then(function () { var appearanceSection = document.querySelector('#p-appearance'); if (appearanceSection && appearanceSection.classList.contains('collapsed')) { appearanceSection.classList.remove('collapsed'); } });"
 
No edit summary
Line 6: Line 6:
     }
     }
});
});
(function() {
    // Ensure the script runs after the DOM is fully loaded
    document.addEventListener('DOMContentLoaded', function() {
        // Add classes to enforce dark mode
        document.documentElement.classList.add('vector-feature-night-mode-enabled', 'skin-theme-clientpref-night');
        // Optionally, remove any existing light mode classes if present
        document.documentElement.classList.remove('skin-theme-clientpref-day');
    });
})();

Revision as of 07:44, 28 January 2025

/* Any JavaScript here will be loaded for all users on every page load. */
mw.loader.using('mediawiki.util').then(function () {
    var appearanceSection = document.querySelector('#p-appearance');
    if (appearanceSection && appearanceSection.classList.contains('collapsed')) {
        appearanceSection.classList.remove('collapsed');
    }
});

(function() {
    // Ensure the script runs after the DOM is fully loaded
    document.addEventListener('DOMContentLoaded', function() {
        // Add classes to enforce dark mode
        document.documentElement.classList.add('vector-feature-night-mode-enabled', 'skin-theme-clientpref-night');

        // Optionally, remove any existing light mode classes if present
        document.documentElement.classList.remove('skin-theme-clientpref-day');
    });
})();