MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tag: Manual revert |
No edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
mw.loader.using('jquery.makeCollapsible').then(function () { | |||
// Turn sidebar sections into collapsible groups | |||
$('#mw-panel .portal').each(function () { | |||
var $portal = $(this); | |||
if ($portal.find('ul').length) { | |||
$portal.addClass('collapsible'); | |||
$portal.makeCollapsible({ | |||
collapsed: true // start collapsed | |||
}); | |||
} | |||
}); | |||
}); | |||
/* | |||
mw.loader.using('jquery.makeCollapsible').done(function () { | mw.loader.using('jquery.makeCollapsible').done(function () { | ||
Line 9: | Line 24: | ||
$('.mw-collapsible').makeCollapsible(); | $('.mw-collapsible').makeCollapsible(); | ||
}); | }); | ||
*/ | |||
/* | /* |
Revision as of 17:27, 23 August 2025
/* Any JavaScript here will be loaded for all users on every page load. */ mw.loader.using('jquery.makeCollapsible').then(function () { // Turn sidebar sections into collapsible groups $('#mw-panel .portal').each(function () { var $portal = $(this); if ($portal.find('ul').length) { $portal.addClass('collapsible'); $portal.makeCollapsible({ collapsed: true // start collapsed }); } }); }); /* mw.loader.using('jquery.makeCollapsible').done(function () { // Target sidebar portlets (each "box" in the sidebar) $('#p-navigation, #p-tb, #p-Book-2, #p-wiki-navigation, #p-coll-print_export').addClass('mw-collapsible mw-collapsed'); // Auto-apply collapsible behavior $('.mw-collapsible').makeCollapsible(); }); */ /* mw.loader.using('jquery.makeCollapsible', function () { $('.portal').each(function () { var $header = $(this).find('h3'); // Add persistent text (only if not already present) if (!$header.find('.persistent-text').length) { $header.append('<span class="persistent-text"> [Info]</span>'); } }).makeCollapsible({ toggle: true }); }); */ /* // Ensure CollapsibleVector features are enabled mw.loader.using('jquery.makeCollapsible', function () { $('.portal').makeCollapsible({ toggle: true }); }); */