13,904
edits
No edit summary |
mNo edit summary |
||
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for users of the mobile site */ | /* Any JavaScript here will be loaded for users of the mobile site */ | ||
/* Expand single talk section */ | |||
$(function() { | |||
setTimeout(function() { | |||
if ($('.ns-talk .collapsible-heading').length === 1) | |||
$('.collapsible-heading:not(.open-block)').click(); | |||
}, 100); | |||
}); | |||
/* Collapse boxes on smaller devices */ | /* Collapse boxes on smaller devices */ | ||
Line 9: | Line 17: | ||
} | } | ||
mw.hook('wikipage.collapsibleContent').add(mwMobileCollapse); | mw.hook('wikipage.collapsibleContent').add(mwMobileCollapse); | ||
/* Add mobile options toolbox link on Timeless */ | |||
$(function() { | |||
if (mw.config.get('skin') === 'timeless') { | |||
var optionsLink = '/Special:MobileOptions'; | |||
var optionsDesc = 'Settings for the mobile site'; | |||
mw.util.addPortletLink('p-tb', optionsLink, 'Mobile options', 't-options', optionsDesc); | |||
} | |||
}); | |||
/* Move navboxes to dedicated section */ | /* Move navboxes to dedicated section */ | ||
$(function() { | $(function() { | ||
if ($('.navbox-section').length) { | if ($('.navbox-section').length) { | ||
if ($.trim($('section:nth-last-of-type(2) .succession-box').first().prev().text()) == '') | |||
$('section:nth-last-of-type(2) .succession-box').first().prev().css('display', 'none'); | |||
if ($('section:nth-last-of-type(2) > *:not(.succession-box):not(.mw-empty-elt)').length > 0) | |||
$('section:nth-last-of-type(2) > .succession-box').detach().appendTo('.navbox-section'); | |||
if ($('section:nth-last-of-type(2) > *:not(.navbox):not(.mw-empty-elt)').length > 0 | if ($('section:nth-last-of-type(2) > *:not(.navbox):not(.mw-empty-elt)').length > 0 | ||
|| $('.section-heading:nth-last-of-type(2) > .mw-headline#References').length > 0 | || $('.section-heading:nth-last-of-type(2) > .mw-headline#References').length > 0 | ||
Line 22: | Line 43: | ||
} | } | ||
} | } | ||
}); | }); |