User:Jackmcbarn/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:Jackmcbarn/common.css. |
$('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