Jump to content

User:SMcCandlish/common.js

From Wikipedia, the free encyclopedia
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.
//Testing – temporary "holding pen" for imported scripts to try out:

/* From: http://medi.wiki.org/wiki/User:Remember_the_dot/Syntax_highlighter#Ignoring_unclosed_br_and_hr_tags
   but docs warn "this will impact performance": */
syntaxHighlighterConfig = {
    voidTags: ["br", "hr", "BR", "HR"],
};

/* Doc: http://en.wiki.x.io/wiki/User:SMcCandlish/TidyRefs */
mw.loader.load('//en.wiki.x.io/w/index.php?title=User:SMcCandlish/TidyRefs.js&action=raw&ctype=text/javascript');

/* Doc: http://en.wiki.x.io/wiki/User:Nardog/RefRenamer */
mw.loader.load('//en.wiki.x.io/w/index.php?title=User:Nardog/RefRenamer.js&action=raw&ctype=text/javascript');

/* Doc: http://en.wiki.x.io/wiki/User:Kaniivel/Reference_Organizer
I'm using a fork of it, described here: http://en.wiki.x.io/wiki/User_talk:Kaniivel/Reference_Organizer#Forked_it */
mw.loader.load('//en.wiki.x.io/w/index.php?title=User:Argenti_Aertheri/RefConsolidate_start.js&action=raw&ctype=text/javascript');

/* Trying this also from: mw:User:Remember_the_dot/Syntax_highlighter#Ignoring_unclosed_br_and_hr_tags */
syntaxHighlighterConfig = {
    timeout: 30,
};

/* Adding Cat-a-Lot, tweaked for en.wikipedia; doc: http://commons.wikimedia.org/wiki/Help:Gadget-Cat-a-lot */
mw.loader.load('http://en.wiki.x.io/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: http://en.wiki.x.io/wiki/Wikipedia:ReFill */
mw.loader.load('http://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript');

/* http://en.wiki.x.io/wiki/User:DannyS712/AjaxRollbackSummary
   enable custom edit summaries for rollback: */
mw.loader.load('User:DannyS712/AjaxRollbackSummary.js&action=raw&ctype=text/javascript'); 

//End testing.

// Javascript Wiki Browser variant of WP:AWB; see WP:Joeytje50/JWB for deets:
mw.loader.load('http://en.wiki.x.io/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');

// Detect broken Harvard citations (docs at User:Trappist the monk/HarvErrors):
mw.loader.load('http://en.wiki.x.io/w/index.php?title=User:Trappist the monk/HarvErrors.js&action=raw&ctype=text/javascript');
// Trappit's version is a less blunt an instrument than Ucucha's original.

// Ohconfucius's "MOSNUM dates": http://en.wiki.x.io/wiki/User:Ohconfucius/script/MOSNUM dates
mw.loader.load('http://en.wiki.x.io/w/index.php?title=User:SMcCandlish/MOSNUMdates.js&action=raw&ctype=text/javascript');
// OhConfucius's "ENGVARB": http://en.wiki.x.io/wiki/User:Ohconfucius/EngvarB
mw.loader.load('http://en.wiki.x.io/w/index.php?title=User:Ohconfucius/script/EngvarB.js&action=raw&ctype=text/javascript');
// Ohconfucius's "formatgeneral": http://en.wiki.x.io/wiki/User:Ohconfucius/script/formatgeneral
mw.loader.load('http://en.wiki.x.io/w/index.php?title=User:Ohconfucius/script/formatgeneral.js&action=raw&ctype=text/javascript');
// Ohconfucius's "flagcruft": http://en.wiki.x.io/wiki/User:Ohconfucius/script/flagcruft
mw.loader.load('http://en.wiki.x.io/w/index.php?title=User:Ohconfucius/script/flagcruft.js&action=raw&ctype=text/javascript');
// Ohconfucius's "Common Terms" delinker (also does some flagcruft cleanup): http://en.wiki.x.io/wiki/User:Ohconfucius/script/Common_Terms
mw.loader.load('http://en.wiki.x.io/w/index.php?title=User:Ohconfucius/script/Common_Terms.js&action=raw&ctype=text/javascript');

// "TidyCitations": http://en.wiki.x.io/wiki/User:SMcCandlish/TidyCitations
mw.loader.load('http://en.wiki.x.io/w/index.php?title=User:SMcCandlish/TidyCitations.js&action=raw&ctype=text/javascript');

// Highlight admin names – style tweaked in common.css
//  - moved to http://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 http://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 http://meta.wikimedia.org/wiki/User:SMcCandlish/global.js

// Turn on the "Other Projects Sidebar" features
//  - moved to http://meta.wikimedia.org/wiki/User:SMcCandlish/global.js

// Copyvio Detector, in left sidebar
mw.loader.load( 'http://en.wiki.x.io/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: http://en.wiki.x.io/wiki/User:PerfektesChaos/js/lintHint
// - Config: http://en.wiki.x.io/wiki/Special:BlankPage/preferencesGadgetOptions#lintHint
// - Test arbitrary code or pages: http://en.wiki.x.io/wiki/Special:BlankPage/lintHint
mw.loader.load( "http://en.wiki.x.io/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( 'http://en.wiki.x.io/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( 'http://en.wiki.x.io/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( 'http://en.wiki.x.io/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( "http://en.wiki.x.io/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 http://meta.wikimedia.org/wiki/User:SMcCandlish/global.js