Content deleted Content added
Ohconfucius (talk | contribs) rem dailymail.co.uk |
Ohconfucius (talk | contribs) line spacing |
||
(46 intermediate revisions by 4 users not shown) | |||
Line 1:
// <nowiki>
// *********************************************************************************************
Line 6 ⟶ 7:
// *********************************************************************************************
if (typeof importScriptURI !== 'undefined') { // not available on mobile.
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript');
importScript("User:Ohconfucius/script/MOSNUM_utils.js"); //needed for "'Accessed' ->
importScript("User:Ohconfucius/test/Sources_subscript1.js"); //convert ___domain names into article names
importScript("User:Ohconfucius/test/Sources_subscript2.js"); //Correctly casing titles and apply or rem italicisation
importScript("User:Ohconfucius/test/Sources_subscript3.js"); //link-fixing, dabbing etc
// importScript("User:Ohconfucius/script/foreigndates.js"); //link-fixing, dabbing etc
}
function Ohc_add_ref_tags() {
var txt=document.editform.wpTextbox1;
regex(/([^>\*\s])\s?(\[https?:\/\/[^\s\[\]]*\])(?![ ]*[<\-]+)/gi, '$1<ref>$2</ref>');
}
function Ohc_fill_pub_with_domain() {
var txt=document.editform.wpTextbox1;
//test
regex(/\s?(<ref>(?:[^<>]*\|\s*url\s*=|\[?)https?:\/\/((?:\w+\.)*\w+(?:\.(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|)))\/[^<>{}]+\|publisher=)(?=}}<\/ref>)/gi, "$1$2"); //capture ___domain name to add to publisher
regex(/(\|\s*(?:publisher|website)\s*\=\s*)w{3}\.(\w+\.(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))(?=\s*[|}])/gi, '$1$2');
regex(/(\|\s*publisher=)\s?\|\s?via\s*\=\s*(\w+)(?=\s*[|}])/gi, '$1$2');
// regex(/\|\s?via\s*\=\s*/gi, '|work=');
regex(/\s?[-–]\s?(?:The |)(\w+\.(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))\s?(\|\s*publisher\s*\=\s*)\1(?=}})/gi, '$2$1');
regex(/\s?[-–]\s?([^|]+)\s?(\|\s*publisher\s*\=\s*)(The )\1(?=}})/gi, '$2$3$1');
regex(/\|\s?first\s*\=[^|]*\|\s?last\s*\=(?:Editor|Group|Staff|Reporter|Writer)\s*(?=\|)/gi, '');
regex(/({{Navbox deaths}})(\n)/gi, '==References==$2{{Reflist}}$2$1$2');
regex(/(==References==\n{{Reflist}}\n)\n?\1/gi, '$1');
}
function Ohc_remove_urls() {
var txt=document.editform.wpTextbox1;
// warning-tagging template:Primary source inline
regex(/(<ref[^<>]*>[^<>]*\|[ ]*url ?= ?https?:\/\/(?:(?:www\.|mobile\.|)(?:blogger|blogspot|facebook|sites\.google|instagram|tiktok|twitter|wordpress|x)\.com|www\.formspring\.me)\/[^<>{]*<\/ref>)(?:\{\{Primary source inline\}\}|)/gi, '$1{{Primary source inline}}');
regex(/(<ref[^<>]*>[^<>]*\|[ ]*url ?= ?https?:\/\/(?:(?:www\.|)(?:myspace|findagrave)\.com)\/[^<>{]*<\/ref>)(?:\{\{Primary source inline\}\}|)/gi, '$1{{Primary source inline}}');
regex(/(<ref>\s*https?:\/\/(?:(?:www\.|)(?:blogger|blogspot|facebook|sites\.google|findagrave|instagram|myspace|tiktok|twitter|wordpress|x)\.com)\/[^\s\]<]*<\/ref>)(?:\{\{Primary source inline\}\}|)/gi, '$1{{Primary source inline}}');
regex(/(<ref>\s*\[https?:\/\/(?:(?:www\.|)(?:blogger|blogspot|facebook|sites\.google|findagrave|instagram|myspace|tiktok|twitter|wordpress|x)\.com)\/[^\s\]]*[ ]+[\w\d][^\]]*\]<\/ref>)(?:\{\{Primary source inline\}\}|)/gi, '$1{{Primary source inline}}');
// removing http links within publisher/journal/work fields
//
// regex(/(\|\s*title\s*\=)\s*Archived copy(?=\s?(?:[=|{]|\}\}))/gi, '$1 '); rem as creating CS1 errors
regex(/\s?<!--ACTUAL ARTICLE TITLE BELONGS HERE!(?: original text:|)[^>]*-->/gi, ' '); //rem error introduced by earlier version of this script; entirely strip title field
regex(/(\|\s*(?:author(?:link\d?|)|chapter|journal|magazine|newspaper|publisher|title|work|via)\s*\=\s*)https?:\/{2}(?:w{3}\.|)(?=\w)/gi, '$1'); //removes http:// and optionally www.
regex(/(\|\s*(?:author(?:link\d?|)|chapter|journal|magazine|newspaper|publisher|title|work|via)\s*\=\s*)(?:w{3}\.)(?=\w)/gi, '$1'); //removes www.
regex(/(\|\s*(?:author(?:link\d?|)|chapter|journal|magazine|newspaper|publisher|title|work|via)\s*\=\s*)(\w+(?:\.(?:com?|net|org|gov|\w{2}))(?:\.\w{2}|))(?:\/[^|}]*|)(?=\s*[\]|}])/gi, '$1$2'); //returns ___domain name
regex(/(>{{cit[^}]+\|\s?website\s*\=\s*)https?:\/{2}(?:w{3}\.|)(?=\w)/gi, '$1'); //leave only ___domain name
regex(/(>{{cit[^}]+\|\s?website\s*\=\s*)(?:w{3}\.)(?=\w)/gi, '$1'); //leave only ___domain name
// removing hyperlinks within publisher/journal/website/work fields
regex(/(\|\s*(?:chapter|journal|magazine|newspaper|publisher|title|work|via)\s*\=\s*)\[https?:\/\/[^\s\]]*\s([\w][^\]]*)\]/gi, '$1$2'); //leave only linked text
regex(/({{cit[^}]+\|\s?website\s*\=\s*)\[https?:\/\/[^\s\]]*\s([\w][^\]]*)\]/gi, '$1$2'); //citation templates: rem url whilst leaving only linked text within |website=
regex(/(\|\s*title\s*=\s*)(?:\w+(?:\.(?:com?|net|org|gov|\w{2}))(?:\.\w{2}|))(?:\/[^|}]+)(?:\/[^|}]+)\/([^|}]+)\/?(?=\s*[\]|}])/gi, '$1$2'); //returns terminal part of url
regex(/(\|\s*title\s*=\s*)(?:\w+(?:\.(?:com?|net|org|gov|\w{2}))(?:\.\w{2}|))(?:\/[^|}]+)\/([^|}]+)\/?(?=\s*[\]|}])/gi, '$1$2'); //returns terminal part of url
regex(/(\|\s*title\s*=\s*)(?:\w+(?:\.(?:com?|net|org|gov|\w{2}))(?:\.\w{2}|))\/([^|}]+)\/?(?=\s*[\]|}])/gi, '$1$2'); //returns terminal part of url
regex(/(\|\s*author(?:link\d?|)\s*\=\s*)\[https?:\/\/[^\s\]]*\s([\w][^\]]*)\]/gi, '$1$2');
regex(/(\|\s*author(?:link\d?|)\s*\=\s*)(?:https?:\/\/|)www\.[\w][^|}]*(?=[|}])/gi, '$1'); //rem outright (not a WL)
// removing references to other WP articles and 'external' WP links
regex(/<ref[^<>]*>[^<>]*\|[ ]*url ?= ?https?:\/\/
regex(/<ref>\s*https?:\/\/
regex(/<ref>\s*\[https?:\/\/
regex(/<ref(?: name=[^<>]|)>[^<>]*\|\s*url[ ]*=[ ]*https?:\/\/
regex(/\[https?:\/\/\w{2}\.wikipedia\.org\/w[^\s\]]*[ ]+([\w][^\]]*)\]/gi, ' [[$1]]');
//deprecated sources
regex(/<ref[^<>]*>[^<>]*\|[ ]*url ?= ?https?:\/\/(?:(?:\w+\.|)((?:the|)epochtimes|ntdtv)\.com)\/[^<>{]*<\/ref>/gi, '<!--rem deprecated source \($1\)-->');
regex(/<ref[^<>]*>[^<>]*\|[ ]*url ?= ?https?:\/\/(?:(?:\w+\.|)(thesun|dailymail)\.co\.uk)\/[^<>{]*<\/ref>/gi, '<!--rem deprecated source \($1\)-->');
regex(/(\|\s*url\s*\=\s*|\[)(https?:[^|{}#\s]+)(?:#[A-Za-z0-9\.]{12,13}|\?CMP=fb_gu)(?=[\s\[\]|{}<>])/gi, '$1$2'); //rem link tracking
regex(/(\|\s*url\s*\=\s*)(https?:[^|{}#\s]+\.html?)\?[^|}]{1,5}(?=[\s\[\]|{}<>])/gi, '$1$2'); //rem link tracking
regex(/(\|\s*url\s*\=\s*|\[)(https?:\/\/books\.google\.[^\/]+\/books\?id=\w{12}&pg=PA\d{1,3})&dq[^\s|}]+(?=\s?[|}])/gi, '$1$2'); //rem browser optimisation
}
Line 50 ⟶ 95:
// removing artefacts within fields
regex(/(\|\s
regex(/(\|\s
regex(/\|[ ]*last=(Reporter|staff)[ ]*\|[ ]*first=[^|\{\}]*(?=[\|{}])
regex(/\|[ ]*(?:first|last)=(?:staff |)(?:reporter|writer)[ ]*(?=[\|{}])
regex(/(\|\s*access-?
regex(/(\|\s*access-?
regex(/(\|\s*work\s*\=\s*)(?:article|interview|review) ?(?=[|}])/gi, '$1');
regex(/(\|\s*volume\s*\=\s*)vol(?:ume|\.?)[ ]*(\d)/gi, '$1$2');
regex(/(\|\s*pages?\s*\=\s*)(?:pages?|p[gp]?\.?)[ ]*(\d)/gi, '$1$2');
regex(/ [-–] (?:每日明報 daily news|東方日報)/gi, '');
regex(/(\.\.\. |)\{\{!\}\} 立場(報道|新聞)/gi, '');
regex(/(\|\s*title\s*\=\s*)Login ?(?=[|}])/gi, '$1'); //creating deliberate error (blank title) per Trappist
regex(/(\|\s*)(?:publisher|website|work)=(Newspapers\.com|Twitter|Vimeo|Youtube)(?:\.com|)(?=\s*[|}])/gi, '$1via=$2');
regex(/(\|\s*)(?:publisher|website|work)=(Amazon)(?:\.com|)(?:\.\w{2}|)(?=\s*[|}])/gi, '$1via=$2');
regex(/(\|\s*)(?:publisher|website|work)=(\[\[Twitter\|𝕏\]\])(?: *\(Formerly (?:Twitter|\[\[Twitter\]\]\)) *|)(?=\s*[|}])/gi, '$1via=$2');
regex(/(\|\s*publisher=)\|\s?via\s*\=\s*(\w+)(?=\s*[|}])/gi, '$1$2');
regex(/(?:-[ ]*Google Books[ ]*(?:\|[^}]*|)|)\|\s?publisher\s*\=\s*(Google Books)(?=[\s\.]*[|}])/g, '|via=$1');
//Remove COinS corrupting templates from CS1 citations
regex(/(\|\s
regex(/(\|\s
regex(/(\|\s
regex(/(\|\s*date\s*=\s*)(?:not? |non-|un)date[ds]?\s*(?=[|}
regex(/(\|\s*dead-?url=no?)(?=\s*[|}])/gi, '|url-status=dead'); //common cs1 error (deprecated parameter)
regex(/(\
//citation template fixes
// rem copyright assertion
regex(/(\|\s
regex(/(\|\s
regex(/(\|\s
regex(/(\|\s
// misused 'date' parameter
Line 83 ⟶ 138:
// rem toggles and redundant quote marks
regex(/(\|\s
regex(/(\|\s
regex(/(\|\s
regex(/(\|\s
regex(/(\|\s*publisher\s*\=\s*)\"([^\|\{\}]+)\"/gi, '$1$2'); //rem quote marks around publishers
// reordering 'work' and 'publisher' (first run - see second run in cleanup function)
regex(/(\|\s
regex(/(\|\s
/// removing identical/similar entries in 'work' and 'publisher', and in 'work' and 'website' (different default vs [post] cleanup rules)
Line 99 ⟶ 155:
regex(/\|\s?publisher\s*\=\s*([^=|}\[<>]*)(\|[^}<>]*|)\|\s?publisher\s*\=\s*(?:\1|\[\[\1\]\])\.?(?=\s*[|}])/g, '|publisher=$1$2'); //unlinked work
regex(/\|\s?publisher\s*\=\s*\[\[([^<|\]]*)\]\](\|[^}<>]*|)\|\s?publisher\s*\=\s*(?:\1|\[\[\1\]\])\.?(?=\s*[|}])/g, '|publisher=$1$2'); //unpiped work
regex(/\|\s?publisher\s*\=\s*(\[\[(?:[^<|\]]*)\|([^}<>]*)\]\])(\|[^}<>]*|)\|\s?publisher\s*\=\s*(\1|\2)\.?(?=\s*[|}])/g, '|publisher=$1$
// remove redundant parentheses and templates from dm and md dates (equivalents also exists in Mosnum script)
Line 105 ⟶ 161:
// rem corporate designation
regex(/(\|\s
// correcting yahoo! corporate designation
regex(/(\|\s
// rem unnecessary quote marks
regex(/(\|\s
regex(/(\|\s
// repl double 'in-title' quote marks with single quotes
regex(/(\|\s
// adjust for possibly incorrectly input title
regex(/(\|\s
// rem misplaced punctuation
Line 125 ⟶ 180:
// removing blank or redundant parameters
regex(/(?:\|[ ]*(?:
// regex(/(?:\|[ ]*(began|ended)[ ]*=[^}|]*)(?=[}|])/gi, ''); //disabled 18/06/20: false positive removal of associated (Start date) templates
regex(/(\|\s
//rem underlining within certain fields
regex(/(\|\s
//rem redundant top-level domains (.com, .net, .org), strip "www"
regex(/(\|\s
//rem duplicated publishers in separate fields (pre)
regex(/(?:[‒–—―]+||)\s*(?:The |)([^\|\}&]{3,})(?:\.com|)\s*(\|\s
regex(/(?:[‒–—―]+||)\s*([^\|\}&]{3,})(?:\.com|)\s*(\|\s
//'work' and its alias (pre)
regex(/(\|[ ]*?newspaper[ ]*=[^\|}]*(?:\|[^\{\}]*|))(?:\|[ ]*?work[ ]*=[^|}]*)(?=[|}
//rem linking within '___location' field
Line 147 ⟶ 202:
regex(/(\|[ ]*?(?:___location|place)=[ ]*?)\[\[(?:[^\|\]]+?\||)([\w\s\,]+?)\]\](?:(,? )\[\[(?:[^\|\]]+?\||)([\w\s\,]+?)\]\]|)(?=[ ]?[|}])/gi, '$1$2$3$4');
// removing english
regex(/[ ]?\{\{en[- ]icon\}\}/gi, "");
// regex(/\|[ ]*?language[ ]*?=[ ]*?en(?:-\w{2}|glish|)(?=\s*[}|])/gi, "");
// regex(/(\|[ ]*?language[ ]*?=[ ]*?)\{\{(\w{2})(?:[- ](?:icon|UK|GB|US)|)\}\}/gi, ""); // removing icon template from within "|language=" parameter
// eliminating time of day
regex(/(\|[ ]*author[ ]*=[ ]*)(?:posted|published)(?: by| on|)[\s:](?=\s*\w)/gi, "$1");
regex(/(\|[ ]*(?:date|
// eliminating days of the week
regex(/(\|[ ]*(?:date|
//'Accessed'/'Obtained' -> 'Retrieved'
ohc_regex(/(?:[\.,;][ ]*(?:url |link |last |)(?:Retrieved|Accessed|Obtained))(?: on(?:line|)|):? (@month|@dd|@yyyy)(?=\D)/gi, '. Retrieved $1');
ohc_regex(/(\w
// (disabling for persistent errors) ohc_regex(/(?:Retrieved|Accessed)(?: on(?:line|)|):? (@Month\s@DD,?\s@YYYY|@DD\s@Month\s@YYYY|@yyyy-@mm-@dd)(?=\D)/gi, 'Retrieved $1');
Line 178 ⟶ 232:
regex(/(\[\[)Daily Star \((?:British|UK)\)(?=\|)/gi, '$1Daily Star (United Kingdom)');
regex(/(\[\[Metro)(?: \(Associated Metro Limited\)| \(Associated Newspapers\)| \(London newspaper\)| \(free London newspaper\)| UK| newspaper London| newspaper UK)(?=\|)/gi, '$1 (British newspaper)');
regex(/(\[\[)(?:Calcutta Telegraph|The Telegraph \((?:
regex(/(\[\[)Dawn(?:, Karachi| newspaper|\.com| \((?:Newspaper|Pakistan)\))(?=\|)/gi, '$1Dawn (newspaper)');
regex(/(\[\[The Pioneer)(?:, Karachi| newspaper| \((?:indian newspaper)\))(?=\|)/gi, '$1 (Indian newspaper)');
Line 199 ⟶ 253:
//linked publishing houses
// removing publishers less well-known than their titles
regex(/(\|\s
regex(/(?:\|publisher=Turner Sports Interactive, Inc)\.? ?\|publisher=(NBA)(?= ?\|)/gi, '$1');
Line 209 ⟶ 263:
regex(/(?:\|\s?(newspaper|work|publisher)\s*\=\s*(ACP Magazines|The Herald and Weekly Times|John Fairfax (and Sons Ltd\.?|Holdings)|Fairfax(?: Media(?: Limited|)| Digital| newspapers|)))(?=[\s\.]*[|}])/gi, '');
regex(/(?:\|\s?(newspaper|work|publisher)\s*\=\s*\[\[(ACP Magazines|The Herald and Weekly Times|John Fairfax (and Sons Ltd\.?|Holdings)|Fairfax(?: Media(?: Limited|)| Digital| newspapers))\]\])(?=[\s\.]*[|}])/gi, '');
regex(/\| ?publisher ?= ?(?:Fandango Media|\[\[Fandango Media\]\]) ?/gi, '');
regex(/(?:\|\s?publisher\s*\=\s*(Alexander Lebedev|American Media|Associated Newspapers|Bauer (?:Consumer Media|Media Group)|Cond[eé] Nast(?: Publications|)|Daily Mail and General Trust|Devin Laz[ae]rine|Dow Jones & Company|Future plc|(Guardian|Telegraph) Media Group|(?:Guardian|Independent) News (?:and|&) Media(?: Limited| Ltd\.|)|Hachette Filipacchi Médias|Hearst (?:Corporation|Magazines(?: UK|))|Herald Media|IGN Entertainment|Imdb Inc\.?|InterMedia Partners|IDG|IPC Media|Lee Enterprises|Media ?News Group|Mediacorp|Mortimer Zuckerman|MTV Networks|News (?:Corporation|International|Limited)|Postmedia Network Inc\.?|Prometheus Global Media|Reed Business Information|Rovi Corporation|Trinity Mirror|Times Newspapers|Nielsen (?: Media Research|Business Media)|Viacom|Time(?: Warner ?|)))(,? Inc| LL[CP]| Ltd|Limited|)[\s\.]*(?=[|}])/gi, '');
regex(/\|\s?publisher\s*\=\s*(?:The |)(?:Deseret News Publishing|Dispatch Printing|E\. W\. Scripps|Evening Post Publishing|Forbes(?: Publishing|, Inc\.)|Gannett?|Independent News & Media|Irish Times Trust|(?:Jann Wenner|Wenner Media)|Johnson Publishing|Journal Communications|Mac Publishing|Media24|McClatchy|Nash holdings LLC|New York Times|Seattle Times|Star Tribune|Thomp?son(?:[- ]?Reuters)?(?: Corporation| Plc.?|)|Singapore Press Holdings|Torstar|Time Inc\.|Times (?:Group|Publishing)|Tribune|Vox Media|Washington Post|World Publishing|Ziff Davis Media)(?: Co(?:mpany|\.)?)?(?=[\s\.]*[|}])/g, '');
regex(/\|\s?publisher\s*\=\s*(?:Cox|Halifax|North Jersey|Sun-Times|Tampa|Herald|Stephens|WEHCO) Media(?: Group(?:,? Inc\.)?| Berhad)?(?=[\s\.]*[|}])/g, '');
// regex(/\|\s?publisher\s*\=\s*(?:\w+ )+(?:Media|Publishing|Publications)(?: Group(?:,? Inc\.)?| Berhad)(?=[\s\.]*[|}])/g, ''); //rem "Communications" - false positive for "Ministry of Economic Affairs and Communications" reported 28 May 2014
//duplicate above with links //("Corporation" excluded - false positive with Australian Broadcasting Corporation)
regex(/(?:\|\s?publisher\s*\=\s*\[\[(Alexander Lebedev|American Media|Associated Newspapers|Bauer (?:Consumer Media|Media Group)|Cond[eé] Nast(?: Publications|)|Daily Mail and General Trust|Devin Laz[ae]rine|Dow Jones & Company|Future plc|(Guardian|Telegraph) Media Group|(?:Guardian|Independent) News (?:and|&) Media
regex(/\|\s?publisher\s*\=\s*\[\[(?:The |)(?:Deseret News Publishing|Dispatch Printing|E\. W\. Scripps|Evening Post Publishing|Forbes(?: Publishing|, Inc\.)|Gannett?|Independent News & Media|Irish Times Trust|(?:Jann Wenner|Wenner Media)|Johnson Publishing|Journal Communications|Mac Publishing|McClatchy|Nash holdings LLC|New York Times|Seattle Times|Star Tribune|Thomp?son(?:[- ]?Reuters)?(?: Corporation| Plc.?|)|Singapore Press Holdings|Torstar|Time Inc\.|Times Publishing|Tribune|Vox Media|Washington Post|World Publishing|Ziff Davis Media)(?: Co(?:mpany|\.)?)?\]\](?=[\s\.]*[|}])/g, '');
regex(/\|\s?publisher\s*\=\s*\[\[(?:Cox|Halifax|North Jersey|Sun-Times|Tampa|Herald|Stephens|WEHCO
// regex(/\|\s?publisher\s*\=\s*\[\[(?:\w+ )+(?:Media|Publishing|Publications)(?: Group(?:,? Inc\.)?| Berhad)\]\](?=[\s\.]*[|}])/g, '');
regex(/\| ?publisher ?= ?Star Publications \(Malaysia\)|\[\[Star Publications \(Malaysia\)\]\] ?/gi, '');
regex(/\| ?publisher ?= ?(?:New Straits Times Press|\[\[New Straits Times Press\]\]) ?/gi, '');
regex(/(\|\s
}
Line 228 ⟶ 283:
var txt=document.editform.wpTextbox1;
// The following regexes for dab-links are in sets of four. If changing, please ensure all sets are changed )note (unique regex line for Empire film magazineadded 20/6/2021)
regex(/(=[ ]*(?:The ?|)[A-Z]\w*(?: [A-Z]\w*|)) \((South Africa)(?:n newspaper|)\)([ ]*[|}])/g, '$1|___location=$2$3');
regex(/(''(?:The ?|)[A-Z]\w*(?: [A-Z]\w*|)) \((South Africa)(?:n newspaper|)\)(''[\.,;])/g, '$1$3$2');
Line 237 ⟶ 289:
regex(/(\|)((?:The ?|)[A-Z]\w*(?: [A-Z]\w*|))(?: \((?:South Africa)(?:n newspaper|)\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*
regex(/(''
regex(/(
regex(/(\
regex(/(=[ ]*)(Apollo|Billboard|Brick|Campaign|Clash|Coda|Ebony|Esquire|Essence|Fanfare|Fast Company|Fortune|Glamour|Hello!|Life|Limelight|Maxim|Mojo|Mother Jones|New York|Nuts|Paste|People|Poetry|Q|Reason|Shape|Slate|Spin|Time(?: Out|)|Variety|Wired) \((?:magazine)\)(?=\s*[|}])/g, '$1$2'); //non-standard code
regex(/('')(Apollo|Billboard|Brick|Campaign|Clash|Coda|Ebony|Esquire|Essence|Fanfare|Fast Company|Fortune|Glamour|Hello!|Life|Limelight|Maxim|Mojo|Mother Jones|New York|Nuts|Paste|People|Poetry|Q|Reason|Shape|Slate|Spin|Time(?: Out|)|Variety|Wired) \(magazine\)(?='')/g, '$1$2'); //non-standard code
regex(/(\[\[(Apollo|Billboard|Brick|Campaign|Clash|Coda|Ebony|Esquire|Essence|Fanfare|Fast Company|Fortune|Glamour|Hello!|Life|Limelight|Maxim|Mojo|Mother Jones|New York|Nuts|Paste|People|Poetry|Q|Reason|Shape|Slate|Spin|Time(?: Out|)|Variety|Wired) \(magazine\))(?=\]\])/g, '$1|$2'); //non-standard code - tweaked to insert title per pipe trick
regex(/(\|)(Apollo|Billboard|Brick|Campaign|Clash|Coda|Ebony|Esquire|Essence|Fanfare|Fast Company|Fortune|Glamour|Hello!|Life|Limelight|Maxim|Mojo|Mother Jones|New York|Nuts|Paste|People|Poetry|Q|Reason|Shape|Slate|Spin|Time(?: Out|)|Variety|Wired)(?: \(magazine\))(?=\]\])/g, '$1$2');
regex(/(=[ ]*)(Empire) \((?:film magazine)\)(?=\s*[|}])/g, '$1$2'); //non-standard code
regex(/('')(Empire) \(film magazine\)(?='')/g, '$1$2'); //non-standard code
regex(/(''\[\[(Empire) \(film magazine\))(?=\]\]'')/g, '$1$2'); //non-standard code
regex(/(=[ ]*\[\[(Empire) \(film magazine\))(?=\]\][ ]*\|)/g, '$1|$2'); //non-standard code (unique regex added 20/6/2021)
regex(/(\|)(Empire)(?: \(film magazine\))(?=\]\])/g, '$1$2');
//Journals
regex(/(=[ ]*)(Science|Nature) \((?:journal)\)(?=\s*[|}])/g, '$1$2'); //non-standard code
regex(/('')(Science|Nature) \(journal\)(?='')/g, '$1$2'); //non-standard code
regex(/(''\[\[(Science|Nature) \(journal\))(?=\]\]'')/g, '$1|$2'); //non-standard code
regex(/(\|)(Science|Nature)(?: \(journal\))(?=\]\])/g, '$1$2');
regex(/(=[ ]*)(Quartz) \((?:publication)\)(?=\s*[|}])/g, '$1$2'); //non-standard code
regex(/('')(Quartz) \(publication\)(?='')/g, '$1$2'); //non-standard code
regex(/(''\[\[(Quartz) \(publication\))(?=\]\]'')/g, '$1|$2'); //non-standard code
regex(/(\|)(Quartz)(?: \(publication\))(?=\]\])/g, '$1$2');
regex(/(=[ ]*)(Salon) \((?:website)\)(?=\s*[|}])/g, '$1$2'); //non-standard code
regex(/('')(Salon) \(website\)(?='')/g, '$1$2'); //non-standard code
regex(/(''\[\[(Salon) \(website\))(?=\]\]'')/g, '$1|$2'); //non-standard code
regex(/(\|)(Salon)(?: \(website\))(?=\]\])/g, '$1$2');
regex(/(=[ ]*)(Stuff) \((?:company)\)(?=\s*[|}])/g, '$1$2'); //non-standard code
regex(/('')(Stuff) \(company\)(?='')/g, '$1$2'); //non-standard code
regex(/(''\[\[(Stuff) \(company\))(?=\]\]'')/g, '$1|$2'); //non-standard code
regex(/(\|)(Stuff)(?: \(company\))(?=\]\])/g, '$1$2');
regex(/(=[ ]*Daily News) \((New York)\)([ ]*[|}])/g, '$1|___location=$2$3');
Line 264 ⟶ 340:
regex(/(''(?:Daily Star)) \((United Kingdom)\)('')/g, '$1$3 ($2)');
regex(/(\|)(Daily Star)(?: \(United Kingdom\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*El Comercio) \((Equador|Peru|Spain)\)(\s*[|}])/g, '$1|___location=$2$3');
regex(/(''El Comercio) \((Equador|Peru|Spain)\)('')/g, '$1$3 ($2)');
regex(/(\|)(El Comercio)(?: \((?:Equador|Peru|Spain)\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*El Mundo) \((Columbia|Spain)\)(\s*[|}])/g, '$1|___location=$2$3');
regex(/(''El Mundo) \((Columbia|Spain)\)('')/g, '$1$3 ($2)');
Line 276 ⟶ 355:
regex(/(''The Herald) \((Glasgow)\)('')/g, '$1$3 ($2)');
regex(/(\|)(The Herald)(?: \(Glasgow\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Mercury) \((Hobart)\)(\s*[|}])/g, '$1|___location=$2$3');
regex(/(''The Mercury) \((Hobart)\)('')/g, '$1$3 ($2)');
regex(/(\|)(The Mercury)(?: \(Hobart\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Metro) \((British newspaper)\)(\s*[|}])/g, '$1|___location=UK$3');
regex(/(''Metro) \((British newspaper)\)('')/g, '$1$3 (UK)');
Line 294 ⟶ 376:
regex(/(''Panorama) \((Gibraltar)\)('')/g, '$1$3 ($2)');
regex(/(\|)(Panorama)(?: \(Gibraltar\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Público) \((Portugal)\)(\s*[|}])/g, '$1|___location=$2$3');
regex(/(''Público) \((Portugal)\)('')/g, '$1$3 ($2)');
regex(/(\|)(Público)(?: \(Portugal\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Público) \((Spain)\)(\s*[|}])/g, '$1|___location=$2$3');
regex(/(''Público) \((Spain)\)('')/g, '$1$3 ($2)');
regex(/(\|)(Público)(?: \(Spain\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Pioneer) \((Indian newspaper)\)(\s*[|}])/g, '$1|___location=India$3');
regex(/(''The Pioneer) \((Indian newspaper)\)('')/g, '$1$3 (India)');
Line 301 ⟶ 389:
regex(/(\|)(Sporting Life)(?: \(British newspaper\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Standard) \((Hong Kong|Kenya)\)(\s*[|}])/g, '$1|___location=$2$3');
regex(/(=[ ]*Today) \((Singapore newspaper)\)(\s*[|}])/g, '$1|___location=Singapore$3');
regex(/(''Today) \((Singapore newspaper)\)('')/g, '$1$3 (Singapore)');
regex(/(\|)(Today)(?: \(Singapore newspaper\))(\]\])/g, '$1$2$3');
regex(/(''The Standard) \((Hong Kong|Kenya)\)('')/g, '$1$3 ($2)');
regex(/(\|)(The Standard)(?: \((?:Hong Kong|Kenya)\))(\]\])/g, '$1$2$3');
Line 331 ⟶ 422:
regex(/(''(?:Il Giorno)) \((newspaper)\)('')/g, '$1$3 (Italy)');
regex(/(\|)(Il Giorno)(?: \(newspaper\))(\]\])/g, '$1$2$3');
regex(/(= ?(?:El Universal)) \((Caracas|Cartagena|Mexico City)\)(?=[ ]*[|}])/g, '$1|___location=$2');
regex(/(''(?:El Universal)) \((Caracas|Cartagena|Mexico City)\)(?='')/g, '$1 \($2\)');
regex(/(\|El Universal)(?: \(Caracas|Cartagena|Mexico City\))(\]\])/g, '$1$2');
regex(/(= ?(?:RT)) \((TV network)\)([ ]*[|}])/g, '$1|___location=Russia$3');
regex(/(\|)(RT)(?: \(TV network\))(\]\])/g, '$1$2$3');
regex(/((?:agency|author|journal|magazine|newspaper|periodical|website|work)[ ]*=[ ]*\[\[
// regex(/(=[ ]*\[\[)([^\[\]\(\)\|:]*)( \([^\[\]\(\)\|]*\))(\]\])/gi, '$1$2$3|$2$4'); //adding piping to parentheticals inside parameters //disabled 7/3/2020 false positives (e.g. [[Communist Party of India (Marxist)]])
regex(/(?:author|agency|publisher)(\s*\=\s*\[\[[^()|]+ \((?:newspaper|magazine)\)\|[^\[\]|]+\]\])/gi, 'work$1');
Line 342 ⟶ 438:
regex(/ – (?:Times of India|Rediff.com [\w]*)(?=[ ]?\|)/gi, '');
regex(/(?: +[‒–—―] *Times Of India|)(\]. +''The Times of India''\.)indiatimes\.com/gi, '$1');
regex(/(?: +[‒–—―] *([\w ]+))(\|\s
regex(/(\w''\.)indiatimes\.com/gi, '$1');
// regex(/\|[ ]?language[ ]?\=[ ]?English[ ]*?(?=[|}
regex(/- [\w]*\.com[ ]*\|/gi, '|');
regex(/(.) – Google [^ \]]*(\][\.,;]) Books\.google\.\w{2,3}(\.| )/gi, '$1$2Google Books$3');
regex(/(.) at Discogs(\][\.,;]) Discogs\.com(\.| )/gi, '$1$2Discogs$3');
regex(/(\|\s
regex(/\|\s?(?:publisher|website|work)(\s?\=MTV)\|\s?publisher\s*\=\s*(?:MTV Networks|Viacom)/gi, '|publisher$1=');
// regex(/\|\s?(?:publisher|website|work)\s*\=\s*(?:BBC|BBC News(?: Online|))\s*(\|[^}<>]*|)\|\s?publisher\s*\=\s*(?:BBC|BBC News(?: Online|)|British Broadcasting Corporation)(?=[\s\.]*[|}])/g, '|
// regex(/\|\s?(?:publisher|website|work)\s*\=\s*(BBC Sports?)\s*(\|[^}<>]*|)\|\s?publisher\s*\=\s*(?:BBC|BBC News(?: Online|)|British Broadcasting Corporation)(?=[\s\.]*[|}])/g, '|
// regex(/\|\s?publisher\s*\=\s*(BBC (?:Sports|News))\s*(?=\|[^}<>]*|)/g, '|work=\'\'$1\'\'');
regex(/\|\s?(?:publisher|website|work)\s*\=\s*(Metacritic|\[\[Metacritic\]\])\s*(\|[^}<>]*|)\|\s?publisher\s*\=\s*(CBS Interactive|\[\[CBS Interactive\]\])(?=[\s\.]*[|}])/g, '|publisher=$1$2');
//rem duplicated publishers in separate fields (post); rem preceding nbsp
regex(/\s? \s?(\|\s
regex(/(?:[‒–—―]+||)\s*(?:The |)([^\|\}&]{3,})(?:\.com|)\s*(\|\s
regex(/(?:[‒–—―]+||)\s*([^\|\}&]{3,})(?:\.com|)\s*(\|\s
//per [[Help:Citation Style 1#Elements not included]]
// toggling domains within |website= parameter
// regex(/(\|\s*(?:work|website)\s*\=\s*)(\w+\.(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))(?=\s*[|}])/gi, '$1\'\'$2\'\'');
// reordering 'work' and 'publisher'; reordering 'work' and 'website'
regex(/(\|\s
regex(/(\|\s
/// removing identical/similar entries in 'work' and 'publisher', and in 'work' and 'website'
Line 378 ⟶ 477:
regex(/\|\s?publisher\s*\=\s*(\[\[(?:[^<|\]]*)\|([^}<>]*)\]\])(\|[^}<>]*|)\|\s?publisher\s*\=\s*(\1|\2)\.?(?=\s*[|}])/g, '|publisher=$1$3'); //piped work
regex(/(\|\s*(?:newspaper|website|work)\s*\=\s*(?:[^=|}\[<>]*)(?:\|[^}<>]*|))\|\s?
regex(/(\|\s*(?:newspaper|website|work)\s*\=\s*\[\[([^<|\]]*)\]\](?:\|[^}<>]*|))\|\s?
regex(/(\|\s*(?:newspaper|website|work)\s*\=\s*(?:\[\[(?:[^<|\]]*)\|(?:[^}<>]*)\]\])(?:\|[^}<>]*|))\|\s?
regex(/(\|\s*(?:newspaper|website|work)\s*\=\s*(?:\[\[(?:[^<|\]]*)\|(?:[^}<>]*)\]\])(?:\|[^}<>]*|))\|\s?work\s*\=\s*(?:[^\[|}]*)(?=\s*[|}])/g, '$1'); //piped work x1
regex(/\|\s?___location\s*\=\s*New York(?: City|)\s*(\|[^}<>]*|)\|\s?___location\s*\=\s*(New York(?: City|)|USA)(?=[\s\.]*[|}])/g, '|___location=New York $1');
regex(/(
regex(/(\|[ ]*?publisher=[^=}]*)(?:\|[ ]*?publisher=[^=}]*)(?=[|}
// regex(/(\|[ ]*?work=[^=}]*)(?:\|[ ]*?work=[^=}]*)(?=[|}
regex(/(\|[ ]*?agency=[^=}]*)([^<}]*|)(?:\|[ ]*?agency=[^=}]*)(?=[|}])/gi, '$1$2');
//remove redundant parameter ('website' is an alias of 'work')
regex(/(\|\s*(?:newspaper|website|work)\s*\=\s*[^=}<>]*(?:\|[^}<>]*|))\|\s?(?:newspaper|website|work)\s*\=\s*[^\}|]+(?=\s*[|}])/g, '$1'); //universal work and aliases
//unwinding of unnecessary pipes
Line 401 ⟶ 501:
// removing artefacts (within citation templates)
// regex(/(\|[ ]*?author=)(?:(?:Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day,? ?)(?=[^\]\|\}]*\|)/gi, '$1'); //redundant/duplicated
regex(/(?:| (?:Daily|English|(?:Mail |)Online|Music|News|Indian Express))(?=\s*\|)+/gi, ''); //|=: Video Gaming & Real Talk - PS4, Xbox One, Switch, PC, Handheld, Retro
regex(/(?:(?:[ ]+|[ ]+HighBeam Research[ ]+[-–][ ]+FREE trial[ ]+|)\|publisher=Highbeam.com)/gi, '|via=Highbeam');
regex(/( | [\w, ]*?)(?=[ ]|)/gi, '');
regex(/( | Comment is free)/gi, '');
regex(/\|\s?title\s*\=\s*BBC (?:News|Sport)\s?(?:[-–]|| )\s?/gi, '|title=');
regex(/
regex(/
regex(/(?:[-–|]||)[ ]*(?:Entertainment|Football|(?:inter|)national|Latest|local|Music|UK|world|) News(?=[ ]?[&\|])/gi, '');
regex(/<!-- Bot generated title -->/gi, '');
regex(/(\|\s
regex(/(\|\s
regex(/(\|\s*website\s*\=\s*Play Legit):\s+[^|}]+?(?=[\|}])/gi, '$1');
regex(/(DOC|PDF)\) \./gi, '$1).');
Line 423 ⟶ 525:
// expanding/dating tags
// regex(/{{(?:cn|fact)}}/gi, '{{citation needed|date=
//dynamic columns for reflists; remove scroll bar
regex(/((?:[Rr]eferences|[Nn]otes)[ ]?={2,4}[\n\r])[\r\n\s]*<div (?:style|class)=[^>]*>([\S\s]*)<\/div>/g, '$1$2');
regex(/
// regex(/({{reflist)\|30em([^}]*}})/g, '$1$2');
// regex(/({{reflist)\|\d(?:\dem|)(}})/g, '$1$2'); //default
}
function Ohc_duplicatedcite() {
var txt=document.editform.wpTextbox1;
// disambiguating duplicated ref names
//strips down duplicated refs with doubled-up citation templates
regex(/(<ref name=[^/>"]*)>(\{\{[^\}]*\}\})([\s\S]*)\1>\2<\/ref>([\s\S]*)\1>\2<\/ref>([\s\S]*)\1>\2<\/ref>/gi, '$1>$2$3$1/>$4$1/>$5$1/>');
regex(/(<ref name=[^/>"]*)>(\{\{[^\}]*\}\})([\s\S]*)\1>\2<\/ref>([\s\S]*)\1>\2<\/ref>/gi, '$1>$2$3$1/>$4$1/>');
regex(/(<ref name=[^/>"]*)>(\{\{[^\}]*\}\})([\s\S]*)\1>\2<\/ref>/gi, '$1>$2$3$1/>');
regex(/(<ref name=[^/>"]*)><\/ref>/gi, '$1/>');
regex(/(<ref name=[^/>"]*)>([\s\S]*)\1>([^\{\}]*)\1>([^\{\}]*)/gi, '$1A>$2$1B>$3$1C>$4');
// regex(/(<ref name=[^/>"]*)>([\s\S]*)\1>/gi, '$1A>$2$1B>');
// regex(/(<ref name="[^/>]*)">([\s\S]*)\1>/gi, '$1A>$2$1B">');
}
Line 461 ⟶ 580:
// protect the rest (after purging urls inserted in ('website' or )'work' parameters)
regex(/((?:[\[=]\s*)(?:https?:|ftp:))([^\]\|\}]*)(\s*[\]|}])/gi, protect_function);
regex(/(
regex(/(\{\{(?:FAA-airport|harv\
regex(/(\|\s*(?:contribution|quote|title)\s*=)([^|}]+)([\|\}])/gi, protect_function);
//whitelisting -against changes made by generic regex in Ohc_sourcepub (e.g. Fast Company)
regex(/(\|\s*(?:journal|newspaper|periodical|website|work)\s*=\s*Fast )(Company\s*)([\|\}])/gi, protect_function);
}
function ohc_unprotect_urls()
Line 501 ⟶ 623:
Ohc_remove_urls();
Ohc_duplicatedcite();
ohc_protect_urls();
Ohc_sources_prep();
Ohc_unpipe();
Ohc_dab_news_sources();
Line 514 ⟶ 637:
Ohc_sources_cleanup();
ohc_unprotect_urls();
Ohc_Source_edit_summary();
}
function Ohc_noverify() {
var txt=document.editform.wpTextbox1;
// removing references to other WP articles and 'external' WP links
regex(/<ref[^<>]*>[^<>]*\|[ ]*url ?= ?https?:\/\/(?:\w{2}\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|findagrave|instagram|mailonline|myspace|twitter|x)\.com)\/[^<>]*<\/ref>/gi, '');
regex(/<ref>https?:\/\/(?:en\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|findagrave|instagram|mailonline|myspace|twitter|x)\.com)\/[^\s\]<]*<\/ref>/gi, '');
regex(/<ref>\[https?:\/\/(?:en\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|findagrave|instagram|mailonline|myspace|twitter|x)\.com)\/[^\s\]]*[ ]+[\w\d][^\]]*\]<\/ref>/gi, '');
regex(/\|[ ]*url[ ]*=[ ]*https?:\/\/(?:\w{2}\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|findagrave|instagram|mailonline|myspace|twitter|x)\.com)[^\s\|\{\}<]*(?=[ ]*[|}])/gi, '');
regex(/[ ]\[https?:\/\/en\.wikipedia\.org\/wiki\/[^\s\]]*[ ]+([\w][^\]]*)\]/gi, ' [[$1]]');
}
function ohc_ref_names() {
// give names to citations in templates that are without names
regex(/<ref>((?:[\w,\s\.&]+\"?\[)https?:\/\/(?:[^|</]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac)(?:\.[a-z]{2}|))\/(?:[^<>|{}]*\D|)(\d{6,12})[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_$3>$1"); //urls with non-date serial numbers
regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac)(?:\.[a-z]{2}|))\/(?:[^<>|{}]*\D|)(\d{6,12})[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_$3>$1"); //urls with non-date serial numbers
regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*([-\w]+)(?:\.[a-z]{2})\/[^<>|{}\d]*(\d{6,12})[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_$3>$1"); //urls with non-date serial numbers
regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*(reuters)\.com\/[^<>|{}\d]*(id\w{11})[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_$3>$1"); //reuters urls with non-date serial numbers
ohc_regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*([-\w]+)(?:\.[a-z]{2,3})\/[^<>|{}\d]*@YYYY[-\/]@MM[-\/]@DD\/(\w+)[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@ZD_$3>$1"); //urls with non-date serial numbers
ohc_regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*([-\w]+)(?:\.[a-z]{2,3})\/[^<>|{}\d]*@YYYY[-\/]@Mon[-\/]@DD\/(\w+)[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@ZD_$3>$1"); //urls with non-date serial numbers
ohc_regex(/<ref>([^<>]*\|\s*url\s*=https?:\/\/(?:[^|</]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))\/[^<>]*\|\s*date\s*=\s*@Day @Month @YYYY\s*[|}][^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@ZD>$1");
ohc_regex(/<ref>([^<>]*\|\s*url\s*=https?:\/\/(?:[^|</]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))\/[^<>]*\|\s*date\s*=\s*@Month @Day, @YYYY\s*[|}][^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@ZD>$1"); //this line may cause unwarranted substitution of "$5" by a comma (e.g. in 2019–20 Hong Kong protests)
ohc_regex(/<ref>([^<>]*\|\s*url\s*=https?:\/\/(?:[^|</]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))\/[^<>]*\|\s*date\s*=\s*=\s*@YYYY-@MM-@DD\s*[|}][^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@ZD>$1");
ohc_regex(/<ref>((?:[^<>]*\|\s*url\s*=|\[?)https?:\/\/(?:[^|<]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac|[a-z]{2})(?:\.[a-z]{2}|))\/[^<>|{}]+@YYYY[\/-]?@Month[\/-]?@Day[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@ZD>$1"); //urls with embedded dates
}
Line 525 ⟶ 678:
function addLinks() {
return mw.util.addPortletLink.apply(mw.util, arguments);
};
$( add('p-tb', '#', 'Add REFTAGS', 's-reftags', 'Insert missing ref tags', '', '') ).click(prevDef).click(Ohc_add_ref_tags);
$( add('p-tb', '#', 'CITE name', 's-citename', 'gives names to all citations', '', '') ).click(prevDef).click(ohc_ref_names);
$( add('p-tb', '#', 'Fill DOMAIN_NAME', 's-domainname', 'imports ___domain names to publisher field', '', '') ).click(prevDef).click(Ohc_fill_pub_with_domain);
$( add('p-tb', '#', 'Unlink source name', 's-unlink', 'Unlinks source', '', '') ).click(prevDef).click(Ohc_sourceunlink);
$( add('p-tb', '#', 'Fix SOURCES', 's-citefix', 'Run entire new module', '', '') ).click(prevDef).click(Ohc_ref_format_new);
Line 534 ⟶ 692:
$.when(
$.ready,
mw.loader.using( 'mediawiki.util' ),
/*************
*** Regex menu framework
*** by [[m:user:Pathoschild]] <http://meta.wikimedia.org/wiki/User:Pathoschild/Scripts/Regex_menu_framework>
*** - adds a sidebar menu of user-defined scripts.
*************/
$.ajax(
'//meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript',
{ dataType:'script', cache:true }
)
)
.then( addLinks );
}
// </nowiki>
|