Content deleted Content added
Ohconfucius (talk | contribs) bug fix Telegraph Calcutta |
Ohconfucius (talk | contribs) align to test script |
||
Line 24:
var txt=document.editform.wpTextbox1;
txt.value=txt.value.replace(/([^>\*][ ]?)\[https?:\/\/[^\s\]]*[ ](\'\'[\w\d][^\]]*\'\')\](?![ ]*[\n\-]+)/gi, '$1$2');
}
Line 49 ⟶ 50:
txt.value=txt.value.replace(/(\|\s?author(?:link\d?|)\s*\=\s*)www\.([\w\d][^\|\}]*)(?=[\|\}])/gi, '$1$2');
regex(/\|[ ]*last=Reporter[ ]*\|[ ]*first=[^\|\{\}]*(?=[\|{}])=/gi, '');
//citation template fixes
Line 65 ⟶ 66:
regex(/\|\s?date(\s?=\s?[12]\d{3}\s?[\|\}])/gi, '|year$1');
// rem toggles and redundant quote marks
txt.value=txt.value.replace(/(\|\s?(?:agency|author|newspaper|work|journal|publisher)\s*\=\s*)\'\'([^\|\}]+)\'\'(?=\s*[\}\|])/gi, '$1$2'); //without link
txt.value=txt.value.replace(/(\|\s?(?:agency|author|newspaper|work|journal|publisher)\s*\=\s*)\'\'(\[\[(?:[^\|]+\||)[^\|\]]+\]\])\'\'(?=\s*[\}\|])/gi, '$1$2'); //with link
txt.value=txt.value.replace(/(\|\s?title\s*\=\s*)\''([^\|\{\}]+)\''/gi, '$1$2'); //rem ' in titles
// rem corporate designation
Line 88 ⟶ 90:
//rem underlining within certain fields
txt.value=txt.value.replace(/(\|\s?(?:journal|newspaper|periodical|publisher|work)\s*\=\s*)<u>([^\|\}]*)<\/u>/gi, '$1');
//rem redundant top-level domains (.com, .net, .org)
txt.value=txt.value.replace(/(\|\s?(?:journal|newspaper|periodical|publisher|work)\s*\=\s*)(\[\[[^\[\]\}]*\]\])\.(?:biz|com|net|org|co\.uk)(?=\s*[\|\}])/gi, '$1$2');
//rem duplicated publishers in separate fields (pre)
Line 95 ⟶ 100:
regex(/(\|[ ]*?___location=[ ]*?)\[\[([^\|\]]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5');
regex(/(\|[ ]*?___location=[ ]*?)\[\[(?:[^\|\]]+?\|)([\w\s\,]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5');
regex(/\[\[(New York)\]\]/gi, '$1');▼
// removing english icon template
// eliminating time of day▼
regex(/[ ]?\{\{en[- ]icon\}\}/gi, "");
ohc_regex(/(\|[ ]*author[ ]*=[ ]*)(?:posted|published)(?: by| on|)[\s:](?=\s*\w)/gi, "$1");
regex(/(\|[ ]*(?:date|archivedate|accessdate|author)[ ]*=[ ]*)[0-2]?\d:[0-5]\d(?:[ ]| )(?:[ap]m ?|[ap]\.m\. |[A-Z]{1,2}T|UTC)[\.,]?[ ]?/gi, "$1");
Line 123 ⟶ 130:
regex(/(\[\[)(?:(?:British|English|London) Sun|Sun on Sunday|The Scottish Sun|(?:The |)Sun (?:\((?:British |)newspaper\)|\(tabloid\)|\(UK newspaper\)|\(UK\)|Newspaper|on Sunday|Online)|Thesun\.co\.uk)(\|)/gi, '$1The Sun \(United Kingdom\)$2');
regex(/(\[\[)Daily Star \((?:British|UK)\)(\|)/gi, '$1Daily Star \(United Kingdom\)$2');
regex(/(\[\[Metro)(?: \(Associated Metro Limited\)| \(Associated Newspapers\)| \(London newspaper\)| \(free London newspaper\)| UK| newspaper London| newspaper UK)(\|)/gi, '$1 \(British
regex(/(\[\[)(?:Calcutta Telegraph|The Telegraph \((?:kolkatt?a|India)\)|(?:The |)Telegraph India|Telegraphindia\.com)(\|)/gi, '$1The Telegraph \(Calcutta\)$2');
regex(/(\[\[)Dawn(?:, Karachi| newspaper|\.com| \((?:Newspaper|Pakistan)\))(\|)/gi, '$1Dawn \(newspaper\)$2');
Line 160 ⟶ 167:
regex(/(?:\|publisher=Turner Sports Interactive, Inc)\.? ?\|publisher=(NBA)(?= ?\|)/gi, '$1');
regex(/(\|publisher=NBA) ?\|publisher=(?:Turner Sports Interactive, Inc)\.?(?= ?\|)/gi, '$1');
// removing publishers for periodicals
txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s*\=\s*\[?\[?(?:Hachette Filipacchi Médias\|
txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s*\=\s*(John Fairfax (and Sons Ltd\.?|Holdings)|Fairfax(?: Media(?: Limited|)| Digital| newspapers|)))(?=[\s\.]*[\|\}])/gi, '');
txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s*\=\s*\[\[(John Fairfax (and Sons Ltd\.?|Holdings)|Fairfax(?: Media(?: Limited|)| Digital| newspapers))\]\])(?=[\s\.]*[\|\}])/gi, '');
txt.value=txt.value.replace(/(?:\|\s?publisher\s*\=\s*(Alexander Lebedev|American Media|Associated Newspapers|Cond[eé] Nast(?: Publications|)|Daily Mail and General Trust|Devin Laz[ae]rine|(Guardian|Telegraph) Media Group|(?:Guardian|Independent) News (?:and|&) Media|Hachette Filipacchi Médias|Hearst (?:Corporation|Magazines(?: UK|))|Herald Media|Imdb Inc\.?|InterMedia Partners|IDG|IPC Media|Lee Enterprises|Media ?News Group|Mortimer Zuckerman|MTV Networks|News (?:Corporation|International|Limited)|Prometheus Global Media|Reed Business Information|Rovi Corporation|Trinity Mirror|Times Newspapers
regex(/\|\s?publisher\s*\=\s*(?:The |)(?:Deseret News Publishing|Dispatch Printing|E. W. Scripps|Evening Post Publishing|Forbes Publishing|Gannett?|(?:Jann Wenner|Wenner Media)|Johnson Publishing|Journal Communications|McClatchy|New York Times|Seattle Times|Star Tribune|
regex(/\|\s?publisher\s*\=\s*(?:Cox|Halifax|North Jersey|Sun-Times|Tampa|Herald|Stephens|WEHCO) Media( Group(?:, Inc.)?)?(?=[\s\.]*[\|\}])/g, '');
//duplicate above with links
txt.value=txt.value.replace(/(?:\|\s?publisher\s*\=\s*\[\[(Alexander Lebedev|American Media|Associated Newspapers|Cond[eé] Nast(?: Publications|)|Daily Mail and General Trust|Devin Laz[ae]rine|(Guardian|Telegraph) Media Group|(?:Guardian|Independent) News (?:and|&) Media|Hachette Filipacchi Médias|Hearst (?:Corporation|Magazines(?: UK|))|Herald Media|Imdb Inc\.?|InterMedia Partners|IDG|IPC Media|Lee Enterprises|Media ?News Group|Mortimer Zuckerman|MTV Networks|News (?:Corporation|International|Limited)|Prometheus Global Media|Reed Business Information|Rovi Corporation|Trinity Mirror|Times Newspapers
regex(/\|\s?publisher\s*\=\s*\[\[(?:The |)(?:Deseret News Publishing|Dispatch Printing|E. W. Scripps|Evening Post Publishing|Forbes Publishing|Gannett?|(?:Jann Wenner|Wenner Media)|Johnson Publishing|Journal Communications|McClatchy|New York Times|Seattle Times|Star Tribune|
regex(/\|\s?publisher\s*\=\s*\[\[(?:Cox|Halifax|North Jersey|Sun-Times|Tampa|Herald|Stephens|WEHCO) Media( Group(?:, Inc.)?)?\]\](?=[\s\.]*[\|\}])/g, '');
Line 346 ⟶ 354:
regex(/( | (?:Football|Latest)(?: News|))(?=[ ]?[&\|])/gi, '');
regex(/(?:(?:[ ]+|[ ]+HighBeam Research[ ]+[-–][ ]+FREE trial[ ]+|)\|publisher=Highbeam.com)/gi, '');
regex(/( | [\w, ]*?)(?=[ ]|)/gi, '');
regex(/\|\s?title\s*\=\s*BBC (?:News|Sport)\s?(?:–|| )\s?/gi, '|title=');
Line 435 ⟶ 443:
regex(/((?:[\[=]\s*)(?:https?:|ftp:))([^\]\|\}]*)(\s*[\]\|\}])/gi, protect_function);
regex(/(\{\{cite ?book\s?\|)([^\}]+)(\})/gi, protect_function);
// regex(/([\|\{]\s*(?:file(?:name\d?|)|image\d?|image ___location\d?|img|pic|title|quote|chapter|journal|url|archiveurl|work|doi|club|at|volume|reporter)\s*=)([^\|\}⍍]*)([\|\}])/gi, protect_function);
// regex(/([\|\{]\s*(?:file(?:name\d?|)|image\d?|image ___location\d?|img|pic|title|quote|chapter|journal|url|archiveurl|work|doi|club|at|volume|reporter)\s*=)([^\|\}⍍]*)([\|\}])/gi, protect_function);
}
Line 464 ⟶ 475:
//Add a tag to the summary box
setoptions(minor='true');
setreason('per [[Help:Citation Style 1]] and [[Template:Citation]] by [[User:Ohconfucius/script|script]]', 'append');
doaction('diff');
|