User:Smalleditor/test/sources.js

// ********************************************************************************************* //This is a test (non-production) script, and may have untested errors. Please exercise due care should you decide to use it. // ********************************************************************************************* /************* mw.loader.load('https://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript'); function Ohc_linkspam { var txt=document.editform.wpTextbox1;
 * Regex menu framework
 * by m:user:Pathoschild 
 * - adds a sidebar menu of user-defined scripts.

txt.value=txt.value.replace(/([^>\*][ ]?)\[https?:\/\/[^\s\]]*[ ]([\w\d][^\]]*)\](?![ ]*[\n]+)/gi, '$1$2'); setreason('rem linkspam', 'append'); }

function Ohc_news_sources { var txt=document.editform.wpTextbox1;

// removing external links within publisher/journal/work fields txt.value=txt.value.replace(/(\|\s?(?:newspaper|work|journal|publisher)\s?\=\s?)\[https?:\/\/[^\s\]]*\s([\w\d][^\]]*)\]/gi, '$1$2'); txt.value=txt.value.replace(/(\|\s?(?:newspaper|work|journal|publisher)\s?\=\s?)www\.([\w\d][^\|\}]*)(?=[\|\}])/gi, '$1$2');

//		txt.value=txt.value.replace(/\{\{[ ]*cite /g, '{{Cite ');

txt.value=txt.value.replace(/\{\{wikinews(|2|cat|has|portal|table|-inline)(\|[^\}]+|)\}\}\s*/gi, ''); txt.value=txt.value.replace(/\*[ ]*\{\{Find a Grave\|\d{4}(\|[^\}]+|)\}\}\s*/gi, '');

//reflinks fixes //	txt.value=txt.value.replace(/&#\d{2,3}\;/g, ',');

//citation template fixes txt.value=txt.value.replace(/(?:\|[ ]*(?:first|agency|(?:co|)authors?|archive(?:url|date)|journal|publisher|newspaper|work|(?:access|)date|doi|month|year|location|format|first|language|last|publisher|authorlink|volume|issue|pages?))[ ]*=[\s]*(?=\}|\|)/gi, ''); //	txt.value=txt.value.replace(/(?:\|[ ]*(?:first|agency|(?:co|)authors?|archive(?:url|date)|journal|publisher|newspaper|work|(?:access|)date|doi|month|year|location|format|first|language|last|publisher|authorlink|volume|issue|pages?))[ ]*=[\s]*(\}|\|)/gi, '$1'); //repeat to catch neighbouring blank adjacent params //	txt.value=txt.value.replace(/(\|[ ]*(?:agency|author|journal|publisher|newspaper|work))[ ]*=[ ]*/gi, '$1='); //disabling white space removal as inconsequential txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?\'\'\[\[([^\]]{1,40})\]\]\'\')/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?\'\'([^\]]{1,40})\'\')/gi, '|work=$1'); txt.value=txt.value.replace(/(\|\s?title\s?\=\s?)["“]([^\|]+)["”](?=\s?[\|\}])/gi, '$1$2');

//	txt.value=txt.value.replace(/\[\[Time\s\(magazine\)\|(Time|Time Magazine)\]\]/g, 'Time'); //	txt.value=txt.value.replace(/\[\[Billboard\s\(magazine\)\|(Billboard|Billboard Magazine)\]\]/g, '$1'); txt.value=txt.value.replace(/(The |)Globe & Mail/g, 'The Globe and Mail');

//returns 'work=' for traditional media; delinks and dabs location txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:(?:the |)(National Post|Le Devoir|Le Droit)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Canada'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:(?:the |)(Globe and Mail)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Canada'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:(?:the |)(Vancouver Sun)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:the )?((?:Sunday )?Times|Independent|Observer|Guardian|Scotsman|Spectator)(?:\]\])?(?=[\s\.]*[\|\}])/gi, '|work=The $1'); txt.value=txt.value.replace(/\|\s?(?:work|publisher|newspaper)\s?\=\s?\[\[(?:The |)Daily Telegraph(?:\|[^\]]*|)\]\](?=[\s\.]*[\|\}])/gi, '|work=The Daily Telegraph'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:the )?(Daily (?:Mail|Mirror|Express)|NME|New Musical Express|New Statesman)(?:\]\])?(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:The Sun|Daily Star) \((?:United Kingdom|newspaper)\)\|(The Sun|Daily Star)(?:\]\])?(?=[\s\.]*[\|\}])/gi, '|work=$1 '); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(apple daily|ming pao|The standard|south china morning post)(?:\]\])?(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?The standard\|[^\]]*(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=The Standard'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(The Age|Herald Sun)(?:(?:\]\])?))(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Australia'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(Asahi Shimbun|Yomiuri Shimbun)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Japan'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:the |)(Irish |Japan |Taipei |Taiwan )Times(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=The $1Times '); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(La Croix|Le Figaro|L'Humanité|Libération|Le Monde|Le Parisien|La Tribune|France Soir|Direct Matin|Direct Soir|L'Équipe|Le Canard enchaîné|Le Nouvel Observateur|L'Express|Le Point|Paris-Match|Télérama|Courrier International)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(Avvenire|Corriere della Sera|Il Fatto Quotidiano|Il Foglio|il Giornale|Il Giorno|il manifesto|Il Mattino|Il Messaggero|il Resto del Carlino|il Riformista|Il Secolo XIX|Il Tempo|La Nazione|la Repubblica|La Stampa|L'espresso|Corriere del Mezzogiorno)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(The |)(Deccan Herald|Deccan Chronicle|Times of India|Hindustan Times|Hindu|Indian Express|New Indian Express)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(The |)(Statesman|Daily News and Analysis|Economic Times|Tribune|Asian Age)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1$2 |location=India'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?)(?:\[\[The Telegraph \(Kolkata\)\|(The Telegraph)\]\])(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Kolkota, India'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?)(?:\[\[The Pioneer \(Indian newspaper\)\|(The Pioneer)\]\])(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=India'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:The |)((?:Indian|Financial) Express)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=The $1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(Blesk|Hospodářské noviny|Lidové noviny|Mladá fronta DNES|Právo|(?:The |)Prague Post)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Czech Republic');

txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?(the |)((sunday )?Times|daily (mail|mirror|express)|(?:London |)Evening Standard|independent|observer|guardian|NME|New Musical Express|New Statesman|Scotsman|Spectator|Daily Telegraph))(?=[\s\.]*[\|\}])/gi, '|work=$1$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:the |)jakarta post(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Jakarta Post$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:the |)jakarta globe(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Jakarta Globe$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:The |)Straits Times(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Straits Times |location=Singapore$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(China Times|Liberty Times|(?:The |)China Post|United Daily News)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1'); txt.value=txt.value.replace(/(?:\|\s?publisher(\s?\=\s?)(apple daily|ming pao))(?=[\s\.]*[\|\}])/gi, '|work$1$2'); txt.value=txt.value.replace(/(?:\|\s?publisher(\s?\=\s?\[\[The standard\|hk ?standard\]\]))(?=[\s\.]*[\|\}])/gi, '|work$1'); //	txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?the age)(?=[\s\.]*[\|\}])/gi, '|work$1The Age$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:nz |new zealand )herald(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The New Zealand Herald$2');

regex(/(\|publisher=)(Turner Sports Interactive, Inc)\.? ?\|(?:publisher|work)=(NBA)(?:\.com|) ?\|/gi, '$1$3/$2. |'); regex(/(\|(?:publisher|work)=)(NBA)(?:\.com|) ?\|publisher=(Turner Sports Interactive, Inc)\.? ?\|/gi, '$1$2/$3. |'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)([\w]+\.)nbcsports\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1NBC Sports$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)cricinfo\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1ESPNcricinfo$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)uefa\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1UEFA$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)nba\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1NBA$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)nfl\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1NFL$2');

//returns 'work=' for traditional media with websites txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)wired\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Wired$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:flightglobal\.com|Flight Global)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Flight International$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)playbill.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Playbill$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:variety.com|Variety \(magazine\)\|Variety)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Variety$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:vogue.com|Vogue \(magazine\)\|Vogue)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Vogue$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:vanityfair.com|Vanity Fair \(magazine\)\|Vanity Fair)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Vanity Fair$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)empireonline.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Empire$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)nme\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1NME$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)qthemusic\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Q$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)billboard\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Billboard$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)rollingstone.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Rolling Stone$2');

txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)abc\.(com\.au|net(?:\.au|))(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1ABC$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)abc(news\.go)?\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1ABC$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)cbc\.ca(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1CBC$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)boston.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Boston Globe$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)businessweek\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bloomberg BusinessWeek$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)chicagotribune\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Chicago Tribune$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)chinadaily\.com\.cn(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1China Daily$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)chinatimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1China Times |location=Taiwan (ROC)$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)libertytimes\.com\.tw(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Liberty Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)taipeitimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Taipei Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)udn\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1United Daily News$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[^\]]{0,40}people(?:daily|)\.com\.cn(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1People\'s Daily$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)straitstimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Straits Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)chron\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Houston Chronicle$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:dailymail.co\.uk|Mail Online)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Daily Mail$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)mirror.co\.uk(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Daily Mirror$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)denverpost\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Denver Post$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:(?:der|)spiegel\.de|spiegel online)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Der Spiegel$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)((?:die|)welt\.de|welt online)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Die Welt$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)economist\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Economist$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[^\[\|]{0,14}\.ew.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Entertainment Weekly$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[^\[\|]{0,14}forbes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Forbes$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)radiotimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Radio Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)ft.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Financial Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Guardian(?:\.co\.uk|\sUnlimited)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Guardian$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(Hello|OK)magazine\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1$2!$3'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)iht\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1International Herald Tribune$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[^\[]{0,9}independent\.co\.uk(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Independent$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)independent\.ie(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Irish Independent$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)irishtimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Irish Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[^\[]{0,9}latimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Los Angeles Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)lefigaro\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Figaro$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)lemonde\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Monde$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)liberation.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Libération$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)La-Croix\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1La Croix$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)LeParisien\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Parisien$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)LaTribune\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1La Tribune$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Lesechos\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Les Échos$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Strategies\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Stratégies$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)FranceSoir\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1France Soir$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)20Minutes\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$120 Minutes$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Lequipe\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1L\'Équipe$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Canardenchaîne\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Canard Enchaîné$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)NouvelObs\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Nouvel Observateur$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Lexpress\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1L\'Express$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)LePoint\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Point$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)marianne-en-ligne\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Marianne$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)parismatch\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Paris-Match$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Telerama\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Télérama$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Courrierinternational\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Courrier International$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)minute-hebdo\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Minute$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[^\[\|]{0,16}corriere\.it(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Corriere della Sera$2');

regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)asahi\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Asahi Shimbun$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)yomiuri\.co\.jp(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Yomiuri Shimbun$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[^\[\|]{0,14}japantimes\.co\.jp(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Japan Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)haaretz\.?(?:com|co\.il)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Haaretz$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[\|]{0,14}hurriyet(?:dailynews|)\.?com(?:\.tr|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Hurriyet Daily News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)thejakartapost\.(?:com|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Jakarta Post$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)thejakartaglobe\.(?:com|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Jakarta Globe$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)jpost\.(com|co\.il)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Jerusalem Post$2');

regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Telegraphindia.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Telegraph (Calcutta)$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[\|]{0,14}Timesofindia\.(?:indiatimes\.|)com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Times of India$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Hindustantimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Hindustan Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)express(?:india\.com| online)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Indian Express$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)financialexpress(?:\.com|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Financial Express$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:the)?hindu.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Hindu$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)deccanchronicle.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Deccan Chronicle$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Thestatesman.net(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Statesman$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)dailypioneer.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Pioneer$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)EconomicTimes.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Economic Times |location=India'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)tribuneindia.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Tribune |location=India'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)IndianExpress.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Indian Express$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)deccanherald.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Deccan Herald$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Expressbuzz.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The New Indian Express$2');

regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)sunstar.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Sun Star Cebu$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)philstar.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Philippine Star$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)malaya.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Malaya (newspaper)$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)balitapinoy.net(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Balita Pinoy$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)bantaybalita.150m.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bohol Bantay Balita$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)boholtimes.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bohol Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)bugso.tripod.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bugso$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)businessmirror.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Business Mirror$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)bworldonline.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1BusinessWorld$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)cebudailynews.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Cebu Daily News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)dagupan.compunch(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Sunday Punch$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)goldstar.sni.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Mindanao Gold Star Daily$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)inquirer.net(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Philippine Daily Inquirer$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)maguindanawn.ning.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Maguindanao Network$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)manilastandardtoday.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Manila Standard Today$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)manilatimes.net(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Manila Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)mb.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Manila Bulletin$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)mindanaotimes.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Mindanao Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)moroinfo.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Moro Information Agency$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)myph.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1myPH Online News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)newsflash.org(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Philippine Headline News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)philippinenews.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Philippine News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)pinoyparazzi.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Pinoy Parazzi$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)sagad-bugso.tripod.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Sagad sa Impormasyon$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)theboholchronicle.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bohol Chronicle$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)tribune.net.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Daily Tribune$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)visayandailystar.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Visayan Daily Star$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)zamboangatoday.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Zamboanga Today Online$2');

txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[\|]{0,14}blesk.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Blesk |location=Czech Republic'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[\|]{0,14}ihned.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Hospodářské noviny |location=Czech Republic'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[\|]{0,14}lidovky.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Lidové noviny |location=Czech Republic'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[\|]{0,14}idnes.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Mladá fronta DNES |location=Czech Republic'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?pravo.novinky.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Právo |location=Czech Republic'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?praguepost.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Prague Post ');

txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?mingpao.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Ming Pao '); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?newsday\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Newsday |location=New York'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?newsweek\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Newsweek'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?nydailynews\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Daily News |location=New York'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?nypost.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=New York Post'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\b\.]{0,20}nytimes.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The New York Times'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?people.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=People'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?scmp.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=South China Morning Post |location=Hong Kong'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}sfgate.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=San Francisco Chronicle'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}smh\.com\.au\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Sydney Morning Herald'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?spectator\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Spectator '); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}scotsman\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Scotsman '); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?thisis(?:london|money)\.co\.uk\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Evening Standard |location=London'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?sportsIllustrated\.cnn\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Sports Illustrated'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?standard\.com\.hk\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Standard |location=Hong Kong'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?thesun.co\.uk\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Sun '); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?suntimes\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Chicago Sun-Times '); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?telegraph\.co\.uk\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Daily Telegraph '); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?dailytelegraph\.com\.au\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Daily Telegraph |location=Australia'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?theage\.com\.au\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Age |location=Australia'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?theaustralian\.com\.au\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Australian'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?nzherald\.co\.nz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The New Zealand Herald'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?theglobeandmail\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Globe and Mail |location=Canada'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?nationalpost\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=National Post |location=Canada'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?vancouversun\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Vancouver Sun'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?thestar\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Toronto Star'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?torontosun\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Toronto Sun'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?time.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Time'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?([^\[]{0,14}Timesonline\.co(?:\.uk|m)|Times ?online)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Times '); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}usatoday\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=USA Today'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?washingtonpost\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Washington Post'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?washingtontimes\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Washington Times'); txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}wsj\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Wall Street Journal');

txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}un\.org\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=United Nations');

//returns 'work=' for traditional media not requiring location dab txt.value=txt.value.replace(/(?:\|\s?(?:publisher|work)\s?\=\s?\[\[(the )?(Billboard|Billboard Magazine|boston globe|chicago tribune|china daily|people.s daily|Houston chronicle|denver post|der spiegel|The economist|Entertainment Weekly|forbes(?:\smagazine|)|Financial Times|FT|(?:The |)Globe and Mail|(?:The |)Vancouver Sun|Guardian|Hello!|International Herald Tribune|iht|(?:los angeles|la) times|le figaro|le monde|lib[ée]ration|mojo|newsday|newsweek|nydailynews|new york(?: daily news| Post| Times|er)|Q magazine|rolling\sstone|scmp|south china morning post|(?:San Francisco|sf) Chronicle|Sports Illustrated|Sydney Morning Herald|smh|Chicago Sun.Times|the australian|Ottawa Citizen|Ottawa Sun|toronto (?:star|sun)|time magazine|time|usa today|washington (?:post|times)|Wall Street Journal)\]\])(?=[\s\.]*[\|\}])/gi, '|work=$1$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?((?:bloomberg |)business\s?week)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1');

txt.value=txt.value.replace(/(?:\|\s?(?:publisher)\s?\=\s?(the |)(Billboard|Billboard Magazine|boston globe|chicago tribune|china daily|people.s daily|Houston chronicle|denver post|der spiegel|The economist|Entertainment Weekly|forbes(?:\smagazine|)|Financial Times|FT|(?:The |)Globe and Mail|(?:The |)Vancouver Sun|(?:The |)Guardian|Hello!|International Herald Tribune|iht|(?:los angeles|la) times|le figaro|le monde|lib[ée]ration|mojo|newsday|newsweek|nydailynews|new york(?: daily news| Post| Times|er)|Q magazine|rolling\sstone|scmp|south china morning post|(?:San Francisco|sf) Chronicle|Sports Illustrated|Sydney Morning Herald|smh|Chicago Sun.Times|the australian|Ottawa Citizen|Ottawa Sun|toronto (?:star|sun)|time magazine|time|usa today|washington (?:post|times)|Wall Street Journal))(?=[\s\.]*[\|\}])/gi, '|work=$1$2');

//returns 'publisher=' for new media news magazines txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?(Huffington Post)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?(Digitalspy.co.uk)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=Digital Spy');

//returns 'publisher=' for electronic media txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?(bbc.co.uk)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|publisher=BBC'); //	txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}(bbc\.co\.uk)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=BBC'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?(?:\[\[)(bbc( sports?| news(?: online|)|))(?:\]\]))(?=[\s\.]*[\|\}])/gi, '|$1=$2'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?(bbc( sports?| news(?: online|)|)))(?=[\s\.]*[\|\}])/gi, '|$1=$2'); txt.value=txt.value.replace(/(=[ ]?BBC News)( online|\.com)(?=[\s\.]*[\|\}])/gi, '$1'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|publisher|work)\s?\=\[\[(Al\sjazeera( English)?|AMG|All\s?Music\s?Guide|Allmusic|Amazon\.com|(?:American|Australian|Canadian|British) Broadcasting Corporation|Bloomberg|Cable News Network|cnn|Fox News|Fox News Channel|Google|MSN|MTV|Myspace|mlb\.com|xinhua( news agency)?|Yahoo!?|You\s?Tube)\]\])(?=[\s\.]*[\|\}])/gi, '|publisher=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|newspaper)\s?\=(Al\sjazeera( English)?|AMG|All\s?Music\s?Guide|Allmusic|Amazon\.com|(?:American|Australian|Canadian|British) Broadcasting Corporation|Bloomberg[ ]*\||Cable News Network|cnn|(?:ESPN|)cricinfo|Fox News|Fox News Channel|Google|MSN|MTV|Myspace|mlb|UEFA|VH1|xinhua( news agency)?|Yahoo!?|You\s?Tube))(?:\.com)(?=[\s\.]*[\|\}])/gi, '|publisher=$1'); //	txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}(stuff\.co\.nz)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=$1');

//Television media and networks txt.value=txt.value.replace(/(?:\|\s?(publisher|station)\s?\=\[\[(BBC (?:One|Two|Three|Four|Five|Six)|Channel [45])\]\])(?=[\s\.]*[\|\}])/gi, '|$1=$2 '); txt.value=txt.value.replace(/(?:\|\s?(publisher|station)\s?\=\[\[(?:Channel Five \(UK\)\||)(Channel Five|Channel 5)\]\])(?=[\s\.]*[\|\}])/gi, '|$1=Channel 5 '); txt.value=txt.value.replace(/(?:\|\s?(publisher|station)\s?\=\[\[(Network Ten)\]\])(?=[\s\.]*[\|\}])/gi, '|$1=$2 |location=Australia'); txt.value=txt.value.replace(/(?:\|\s?(publisher|station)\s?\=\[\[(?:Ten|Eleven) \(TV channel\)\|(Ten|Eleven)\]\])(?=[\s\.]*[\|\}])/gi, '|$1=$2 |location=Australia');

//returns 'publisher=' for electronic media stripped of domain suffices txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?ap\.org\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Associated Press'); txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?afp\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Agence France-Presse'); txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?reuters\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Reuters'); txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?kyodonews\.jp\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Kyodo News'); txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?xinhuanet\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Xinhua News Agency '); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?aljazeera\.(com|net)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Aljazeera'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?bloomberg\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Bloomberg'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}cnn\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=CNN'); txt.value=txt.value.replace(/(?:– ESPN )?(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}espn(\.go)?.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=ESPN'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?foxnews\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Fox News'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?huffingtonpost\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Huffington Post'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?msnbc\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=MSNBC'); txt.value=txt.value.replace(/(?:– Google Books )?(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?books.google\.com?(?:\.\w{2,3}|)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Google Books'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?[^\[]{0,14}google\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Google');

txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?(mtv|twitter|vh1|youtube)\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=\'\'$2\'\''); regex(/(\|(?:newspaper|work|publisher)=)[ ]*[Yy]outube/g, '|publisher=YouTube');

txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?((?:[\w]*\.|)Europa\.eu|Europa \(web portal\)\|Europa)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=\'\'Europa (web portal)\'\'');

txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|publisher|work)\s?\=\s?(?:\[\[)(AF?P\b|Associated Press|Agence France-Presse|Kyodo ?News|Reuters)(?:\]\]))(?=[\s\.]*[\|\}])/g, '|agency=$1'); txt.value=txt.value.replace(/\[\[(?:(?:Associated Press|Agence France-Presse)\||)(ABC|AP|AFP)\]\]/g, '$1'); txt.value=txt.value.replace(/\|\s?(?:newspaper|publisher|work)\s?\=\s?(AF?P\b|Associated Press|Agence France-Presse)(?=[\s\.]*[\|\}])/g, '|agency=$1');

//rem linking within locations field regex(/(\|[ ]*?location=[ ]*?)\[\[([^\|\]]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5'); regex(/(\|[ ]*?location=[ ]*?)\[\[(?:[^\|\]]+?\|)([\w\s\,]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5');

// removing redundancies txt.value=txt.value.replace(/\|[ ]?language[ ]?\=[ ]?English[ ]*?(?=[\|\}])/gi, ''); //note: adjusted for false positive in infoboxes books txt.value=txt.value.replace(/- [\w]*\.com[ ]*\|/gi, '|'); txt.value=txt.value.replace(/(.) – Google [^ \]]*\]\. Books\.google\.\w{2,3}(\.| )/gi, ']. $1Google Books$2'); txt.value=txt.value.replace(/(.) at Discogs\]\. Discogs\.com(\.| )/gi, ']. $1Discogs$2');

txt.value=txt.value.replace(/\|\s?publisher\s?\=\s?(?:BBC|BBC News(?: Online|))\s*(\|[^}]*|)\|\s?publisher\s?\=\s?(?:BBC|BBC News(?: Online|)|British Broadcasting Corporation)(?=[\s\.]*[\|\}])/g, '|publisher=BBC News $1'); txt.value=txt.value.replace(/\|\s?publisher\s?\=\s?(BBC Sports?)\s*(\|[^}]*|)\|\s?publisher\s?\=\s?(?:BBC|BBC News(?: Online|)|British Broadcasting Corporation)(?=[\s\.]*[\|\}])/g, '|publisher=$1$2'); txt.value=txt.value.replace(/-[ ]*Google Books[ ]*(\|[^}]*|)\|\s?publisher\s?\=\s?Google Books(?=[\s\.]*[\|\}])/g, '|publisher=Google Books $1'); txt.value=txt.value.replace(/\|\s?publisher\s?\=\s?CNN\s?(\|[^}]*|)\|\s?publisher\s?\=\s?CNN(?=[\s\.]*[\|\}])/g, '|publisher=CNN $1'); regex(/(\|publisher=)(Turner Sports Interactive, Inc)\.? ?\|publisher=(NBA) ?\|/gi, '$1$3./$2 |'); regex(/(\|publisher=)(NBA) ?\|publisher=(Turner Sports Interactive, Inc)\.? ?\|/gi, '$1$3./$2 |'); txt.value=txt.value.replace(/\|\s?location\s?\=\s?New York(?: City|)\s*(\|[^}]*|)\|\s?location\s?\=\s?(New York(?: City|)|USA)(?=[\s\.]*[\|\}])/g, '|location=New York $1');

regex(/(?:\|[ ]*?location=[^\[\]\|]*)(\|[ ]*?location=[^\[\]\|\}]*)(?=[\|\}])+/gi, '$1'); regex(/(\|[ ]*?publisher=[^\[\]\|]*)(?:\|[ ]*?publisher=[^\[\]\|\}]*)(?=[\|\}])+/gi, '$1'); regex(/(\|[ ]*?work=[^\[\]\|]*)(?:\|[ ]*?work=[^\[\]\|\}]*)(?=[\|\}])+/gi, '$1');

regex(/(\|[ ]*?author=)(?:(?:Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day,? ?)(?=[^\]\|\}]*\|)/gi, '$1');

//rem underlinings within certain fields txt.value=txt.value.replace(/(\|\s?(?:journal|newspaper|periodical|publisher|work)\s?\=\s?) ([^\|\}]*)<\/u>(?=[\s\.]*[\|\}])/gi, '$1'); }

function Ohc_publishers { var txt=document.editform.wpTextbox1;

//linked publishing houses txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?Hachette Filipacchi Médias\|(Hachette Filipacchi) \(UK\) Ltd\]?\]?)(?=[\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?(\[\[|)(Associated Newspapers|Condé Nast Publications|Fairfax Media|Gannett Company|(Guardian|Telegraph) Media Group|(?:Guardian|Independent) News (?:and|&) Media|Imdb Inc\.?|IDG|IPC Media|MTV Networks|(The |)(?:Washington Post|(?:New York|Seattle) Times) Company|News (?:Corporation|International|Limited)|Prometheus Global Media|Tribune Company|Trinity Mirror|Times Newspapers (?:Limited|Ltd.?)|Nielsen (?: Media Research|Business Media(, Inc\.?|))|Rovi Corporation|Viacom|Time (?:Warner ?|)Inc\.?)(\]\]|))(?=[\s\.]*[\|\}])/gi, '');

}

function Ohc_Source_edit_summary{ //Add a tag to the summary box setoptions(minor='true'); setreason('per WP:MOSTEXT', 'append'); doaction('diff'); }

function Ohc_ref_format { var txt=document.editform.wpTextbox1;

Ohc_news_sources; Ohc_Source_edit_summary; }

addOnloadHook(function { if(document.forms.editform) { //  mw.util.addPortletLink('p-tb', 'javascript:function_name', 'Button name', 't-dmy', 'Hover text', , );

mw.util.addPortletLink('p-tb', 'javascript:Ohc_linkspam', 'Linkspam', 'rm-linkspam', 'removes linkspam in running text', , ); mw.util.addPortletLink('p-tb', 'javascript:Ohc_ref_format', 'Fix news sources', 't-citefix', 'format citations', , ); mw.util.addPortletLink('p-tb', 'javascript:Ohc_publishers', 'Rem publishers', 't-citefix', 'Removing certain publishers fields', , ); } });