No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
mw.loader.load("https://ark.fandom.com/wiki/MediaWiki:Gadget-site.js?action=raw\u0026ctype=text/javascript"); |
mw.loader.load("https://ark.fandom.com/wiki/MediaWiki:Gadget-site.js?action=raw\u0026ctype=text/javascript"); |
||
+ | mw.loader.load('/load.php?debug=false&lang=en&modules=ext.Tabber&version=1ckquij', 'text/javascript', false); |
||
/************************************ |
/************************************ |
Revision as of 19:15, 23 September 2021
mw.loader.load("https://ark.fandom.com/wiki/MediaWiki:Gadget-site.js?action=raw\u0026ctype=text/javascript");
mw.loader.load('/load.php?debug=false&lang=en&modules=ext.Tabber&version=1ckquij', 'text/javascript', false);
/************************************
/* Main Page Mobile Collapse Script *
/************************************/
// Author: Shawn Bruckner
// Date: 2018-Jun-7
// License: CC-BY 3.0
// This script, paired with .mobilecollapsible styles in MediaWiki:Mobile.css, supports making .fpbox collapsible in the mobile view using both the standard
// 2 or 3-column responsive front pages.
// Making an .fpbox collapsible in mobile view involves the following:
// 1. Adding "mobilecollapsible" as another class alongside "fpbox".
// 2. Making sure there is a heading identified by the "fpheading" class.
// * Links inside headings can still work, but aren't recommended because they'll be easy to fat-finger while trying to collapse/expand the box.
// * The script allows multiple headings and automatically ignores any with the "nomobile" or "notoggle" class.
// * If there are still multiple headings after excluding those, only the first is turned into a collapsing toggle link.
// 3. Placing the area that should be hidden when collapsed inside a div or other block with the "fpbody" class.
// * It's usually best for this to be everything in the box *except* the heading.
// 4. Optionally add "expanded" next to "mobilecollapsible" to leave the box expanded by default.
var fpmobilecollapse = fpmobilecollapse || {
initialize : function() {
var index = 0;
$( '.fpbox.mobilecollapsible' ).each( function() {
var heading = $( this ).children( '.fpheading' ).not( '.nomobile, .notoggle' );
if ( heading.length > 0 && $( this ).children( '.fpbody' ).length > 0 ) {
$( this ).addClass( 'mobilecollapsible' + index );
heading.first().html( $( '<a class="togglecollapse" href="javascript:fpmobilecollapse.toggle( ' + index + ' )"></a>' ).html( heading.html() ) );
}
++index;
} );
},
toggle : function( index ) {
$( '.fpbox.mobilecollapsible' + index ).each( function() {
if ( $( this ).hasClass( 'collapsed' ) ) {
$( this ).removeClass( 'collapsed' );
$( this ).addClass( 'expanded' );
} else {
$( this ).removeClass( 'expanded' );
$( this ).addClass( 'collapsed' );
}
} );
}
}
window.fpmobilecollapse = fpmobilecollapse;
$( document ).ready( fpmobilecollapse.initialize );
/****************************************
/* End Main Page Mobile Collapse Script *
/****************************************/
RLQ.push(['jquery', function() {
$('.tabber .tabbertab').each(function () {
// add a pseudo-heading before each tabber using its label.
// note: FandomMobile has no styles for pseudo-headings.
$('<dl>')
.append($('<dt>')
.text($(this).attr('title'))
).insertBefore($(this));
});
}]);