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 20:23, 16 January 2014 (really...?). 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
importScript('User:Jackmcbarn/advancedtemplatesandbox.js'); // Linkback: [[User:Jackmcbarn/advancedtemplatesandbox.js]]
importScript('User:Dr pda/prosesize.js');
importScript('User:Mr.Z-man/closeAFD.js');
importScript('User:Anomie/previewtemplatelastmod.js'); // Linkback: [[User:Anomie/previewtemplatelastmod.js]]
window.LinkClassifierOnDemand = true; // not really, but we want to make our own onLoad hook
importScript('User:Anomie/linkclassifier.js'); // Linkback: [[User:Anomie/linkclassifier.js]]
$(document).ready(function() {
LinkClassifier.cats['soft-redirect'] = ['Category:Wikipedia soft redirects', 'Category:Protected soft redirects', 'Category:Redirects to Wiktionary'].sort();
LinkClassifier.onLoad();
});
importScript('User:Jackmcbarn/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