The editors' meeting has been canceled for technical reasons.

MediaWiki:Vector.js

From Center of NeuroWiki
Revision as of 12:09, 25 October 2024 by Selfice (talk | contribs) (Created page with "→‎All JavaScript here will be loaded for users of the Vector skin: document.addEventListener('DOMContentLoaded', function() { // Example: Toggle sidebar visibility var toggleSidebar = document.createElement('button'); toggleSidebar.innerText = 'Menu'; toggleSidebar.style.position = 'fixed'; toggleSidebar.style.top = '10px'; toggleSidebar.style.left = '10px'; toggleSidebar.style.zIndex = 1000; toggleSidebar.addEventListener('click', fun...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.
/* All JavaScript here will be loaded for users of the Vector skin */
document.addEventListener('DOMContentLoaded', function() {
    // Example: Toggle sidebar visibility
    var toggleSidebar = document.createElement('button');
    toggleSidebar.innerText = 'Menu';
    toggleSidebar.style.position = 'fixed';
    toggleSidebar.style.top = '10px';
    toggleSidebar.style.left = '10px';
    toggleSidebar.style.zIndex = 1000;

    toggleSidebar.addEventListener('click', function() {
        var sidebar = document.getElementById('mw-panel');
        if (sidebar.style.display === 'none' || sidebar.style.display === '') {
            sidebar.style.display = 'block';
        } else {
            sidebar.style.display = 'none';
        }
    });

    document.body.appendChild(toggleSidebar);
});