Jump to content

User:Jackmcbarn/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jackmcbarn (talk | contribs) at 03:10, 11 October 2013 (more). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$('span.mw-rollback-link a').click(function(){return confirm("Rollback: Are you sure?")}); // Require confirmation for rollback
$('#wpTemplateSandboxTemplate').before("<span class=\"mw-templatesandbox-template\" id=\"wpTemplateSandboxTemplateLabel\"><label for=\"wpTemplateSandboxTemplate\">Template name:</label></span> ").after("<br />").replaceWith($('#wpTemplateSandboxTemplate').clone().attr({type: 'text', tabindex: $('#wpTemplateSandboxPage').attr('tabindex') - 0.5, size: 60, spellcheck: true})); // Allow changing the template being previewed with TemplateSandbox
importScript('User:Dr pda/prosesize.js');
importScript('User:Mr.Z-man/closeAFD.js');
importScript('User:Anomie/previewtemplatelastmod.js'); // Linkback: [[User:Anomie/previewtemplatelastmod.js]]
importScript('User:Anomie/linkclassifier.js'); // Linkback: [[User:Anomie/linkclassifier.js]]
importStylesheet('User:Jackmcbarn/linkclassifier.css');

// collapsible-nav gets added after we run, so this ugly mess is needed to kill it
// this needs done because [[gerrit:83590]] and [[gerrit:83591]] removed a preference that used to do it
(function(){
var observer = new MutationObserver(function(mutations) {
	$('.collapsible-nav').removeClass('collapsible-nav');
	$('#mw-panel > .portal').addClass('persistent'); // catch any added later
});
observer.observe(document.querySelector('#mw-panel'), { childList: true, attributes: true, attributeFilter: [ 'class' ] });
})();
$('#mw-panel > .portal').addClass('persistent'); // this needs to happen now or it's too late to stop some changes