User:SMcCandlish/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:SMcCandlish/common.css. |
//Testing – temporary "holding pen" for imported scripts to try out:
// From: https://mediawiki.org/wiki/User:Remember_the_dot/Syntax_highlighter#Ignoring_unclosed_br_and_hr_tags
// but docs warn "this will impact performance":
if (/(?:Talk|_talk:)/i.test(window.location.pathname)) {
syntaxHighlighterConfig = {
voidTags: ["br", "hr", "BR", "HR"],
timeout: 30,
};
} else {
syntaxHighlighterConfig = {
timeout: 30,
};
}
// RefRenamer. Doc: https://en.wikipedia.org/wiki/User:Nardog/RefRenamer
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/RefRenamer.js&action=raw&ctype=text/javascript');
// Reference_Organizer. Doc: https://en.wikipedia.org/wiki/User:Kaniivel/Reference_Organizer
// I'm using a fork of it, described here: https://en.wikipedia.org/wiki/User_talk:Kaniivel/Reference_Organizer#Forked_it
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Argenti_Aertheri/RefConsolidate_start.js&action=raw&ctype=text/javascript');
// Cat-a-Lot, tweaked for en.wikipedia; doc: https://commons.wikimedia.org/wiki/Help:Gadget-Cat-a-lot
mw.loader.load('https://en.wikipedia.org/wiki/User:%D7%A7%D7%99%D7%A4%D7%95%D7%93%D7%A0%D7%97%D7%A9/cat-a-lot.js'); // Backlink: [[User:קיפודנחש/cat-a-lot.js]]
// Adding reFill (fixes bare URL citations); doc: https://en.wikipedia.org/wiki/Wikipedia:ReFill
mw.loader.load('https://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript');
// https://en.wikipedia.org/wiki/User:DannyS712/AjaxRollbackSummary
// enable custom edit summaries for rollback:
mw.loader.load('User:DannyS712/AjaxRollbackSummary.js&action=raw&ctype=text/javascript');
//End testing.
// Improved "TidyCitations", for {{cite ...}} cleanup.
// Doc: https://en.wikipedia.org/wiki/User:SMcCandlish/TidyCitations
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:SMcCandlish/TidyCitations.js&action=raw&ctype=text/javascript');
// New "TidyRefs", for <ref> tag cleanup. Run after "TidyCitations".
// Doc: https://en.wikipedia.org/wiki/User:SMcCandlish/TidyRefs
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:SMcCandlish/TidyRefs.js&action=raw&ctype=text/javascript');
// Detect broken Harvard citations (docs at User:Trappist the monk/HarvErrors):
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Trappist the monk/HarvErrors.js&action=raw&ctype=text/javascript');
// Trappist's version is less blunt an instrument than Ucucha's original.
// Javascript Wiki Browser variant of WP:AWB; see WP:Joeytje50/JWB for deets:
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');
// Ohconfucius's "MOSNUM dates": https://en.wikipedia.org/wiki/User:Ohconfucius/script/MOSNUM dates
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:SMcCandlish/MOSNUMdates.js&action=raw&ctype=text/javascript');
// OhConfucius's "ENGVARB": https://en.wikipedia.org/wiki/User:Ohconfucius/EngvarB
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Ohconfucius/script/EngvarB.js&action=raw&ctype=text/javascript');
// Ohconfucius's "formatgeneral": https://en.wikipedia.org/wiki/User:Ohconfucius/script/formatgeneral
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Ohconfucius/script/formatgeneral.js&action=raw&ctype=text/javascript');
// Ohconfucius's "flagcruft": https://en.wikipedia.org/wiki/User:Ohconfucius/script/flagcruft
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Ohconfucius/script/flagcruft.js&action=raw&ctype=text/javascript');
// Ohconfucius's "Common Terms" delinker (also does some flagcruft cleanup): https://en.wikipedia.org/wiki/User:Ohconfucius/script/Common_Terms
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Ohconfucius/script/Common_Terms.js&action=raw&ctype=text/javascript');
// Highlight admin names – style tweaked in common.css
// - moved to https://meta.wikimedia.org/wiki/User:SMcCandlish/global.js
// Show some basic user info underneath usernames at the top of user and user talk pages
// - moved to https://meta.wikimedia.org/wiki/User:SMcCandlish/global.js
// Similar to the above but does it as icons to the side of the username; Not sure which I prefer:
// - moved to https://meta.wikimedia.org/wiki/User:SMcCandlish/global.js
// Turn on the "Other Projects Sidebar" features
// - moved to https://meta.wikimedia.org/wiki/User:SMcCandlish/global.js
// Copyvio Detector, in left sidebar
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Ahecht/Scripts/CVD.js&action=raw&bcache=1&maxage=86400&ctype=text/javascript' ); // doc: [[User:Ahecht/Scripts/CVD]]
// lintHint - gives WP:LINT (HTML errors) analysis tool in button at top right
// - Doc: https://en.wikipedia.org/wiki/User:PerfektesChaos/js/lintHint
// - Config: https://en.wikipedia.org/wiki/Special:BlankPage/preferencesGadgetOptions#lintHint
// - Test arbitrary code or pages: https://en.wikipedia.org/wiki/Special:BlankPage/lintHint
mw.loader.load( "https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/lintHint/r.js&action=raw&bcache=1&maxage=86400&ctype=text/javascript" );
// Cleanup links to disambiguation pages (run it at the DAB page in question)
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Qwertyytrewqqwerty/DisamAssist.js&action=raw&bcache=1&maxage=86400&ctype=text/javascript' );
// Highlight duplicate links within the same page; docs: User:Evad37/duplinks-alt
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Evad37/duplinks-alt.js&action=raw&ctype=text/javascript');
// Selectively roll back all of a vandal's edits
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Writ Keeper/Scripts/massRollback.js&action=raw&bcache=1&maxage=86400&ctype=text/javascript' );
// Get slightly more informative details about WikiData in watchlist entries:
// - moved to meta:User:SMcCandlish/global.js
// Do some markup to edits by blocked users:
// - moved to meta:User:SMcCandlish/global.js
// Remove ugly styles from buttons:
$(".oo-ui-buttonInputWidget").removeClass("oo-ui-buttonInputWidget");
$(".oo-ui-buttonElement-button").removeClass("oo-ui-buttonElement-button");
// and checkboxes:
$(".oo-ui-checkboxInputWidget").removeClass("oo-ui-checkboxInputWidget");
// remove inflated field margins:
$(".oo-ui-fieldLayout-header").removeClass("oo-ui-fieldLayout-header");
// Add [[WP:Reflinks]] launcher in the toolbox on left
$.when(mw.loader.using(['mediawiki.util']), $.ready).then(function () {
mw.util.addPortletLink(
"p-tb", // toolbox portlet
"http://dispenser.homenet.org/~dispenser/cgi-bin/webreflinks.py/" + mw.config.get('wgPageName')
+ "?client=script&citeweb=on&overwrite=&limit=20&lang=" + mw.config.get('wgContentLanguage'),
"Reflinks" // link label
)});
// Add a portlet to open user subpages to the personal toolbar, placed before the Preferences portlet:
// - This one will not work on sites that don't use English for "User:", etc.
mw.util.addPortletLink(
'p-personal',
'/wiki/Special:PrefixIndex/User:SMcCandlish',
'subpages',
'pt-subpages',
'Your subpages',
null,
'#pt-preferences'
);
// Install WP:AutoEd tools in "More" menu:
mw.loader.load( "https://en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/complete.js&action=raw&bcache=1&maxage=86400&ctype=text/javascript" );
//Automatically tick the "Move subpages" option when moving pages.
// - moved to meta:User:SMcCandlish/global.js
// Add link to watchlist template's /doc files:
// - moved to https://meta.wikimedia.org/wiki/User:SMcCandlish/global.js