MediaWiki:Timeless.js: Difference between revisions

From NBITTRPG Wiki
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..."
 
Tag: Replaced
 
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the Timeless skin */
/* 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();
});

Latest revision as of 04:22, 21 September 2026

/* All JavaScript here will be loaded for users of the Timeless skin */