MediaWiki:Timeless.js

From NBITTRPG Wiki
Revision as of 04:11, 21 September 2026 by CStatic (talk | contribs) (Created page with "All JavaScript here will be loaded for users of the Timeless skin: COLLAPSIBLE SIDEBAR HEADERS: var showTheseMenus = ['navigation']; $('#site-navigation > .sidebar-inner > .mw-portlet > .mw-portlet-body').addClass('collapse'); $(showTheseMenus.map(function (menuId) { return '#p-'+menuId; }).join(',')) .find('> .mw-portlet-body') .addClass('show'); $('#site-navigation > .sidebar-inner > .mw-portlet[id^=\'p-^\'] > h3') .text(function () { return $(t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* All JavaScript here will be loaded for users of the Timeless skin */

/* COLLAPSIBLE SIDEBAR HEADERS */
var showTheseMenus = ['navigation'];

$('#site-navigation > .sidebar-inner > .mw-portlet > .mw-portlet-body').addClass('collapse');
$(showTheseMenus.map(function (menuId) { return '#p-'+menuId; }).join(','))
    .find('> .mw-portlet-body')
    .addClass('show');
$('#site-navigation > .sidebar-inner > .mw-portlet[id^=\'p-^\'] > h3')
    .text(function () { return $(this).text().replace(/^\^/, ''); });
$('#site-navigation > .sidebar-inner > .mw-portlet[id^=\'p-^\'] > .mw-portlet-body')
    .addClass('show');
$('#site-navigation > .sidebar-inner > .mw-portlet > h3').append( $('<div>').addClass('menu-btn') );
$('#site-navigation > .sidebar-inner > .mw-portlet > h3').on('click', function (event) {
	$(this).next().toggleClass('show');
    event.preventDefault();
	event.stopPropagation();
});