User:Ohconfucius/test/Sources subscript1.js: Difference between revisions

Content deleted Content added
more than one space
some changes suggested by JSHint
Line 73:
'(?:dailystar(?:\\.co\\.uk|)|the Daily Star)': 'Daily Star',
'thesun(?:\\.co\\.uk|)': 'The Sun',
'(?:thisis(?:london|money)\\.co\\.uk\|this is london)': 'Evening Standard |___location=London',
'(?:irish ?|)independent\\.ie': 'The Irish Independent',
'irish ?times(?:\\.com|\\.ie|)': 'The Irish Times',
Line 265:
'(?:Medicalnewstoday(?:\\.com|))': 'Medical News Today',
'(?:publishersweekly(?:\\.com|))': 'Publishers Weekly',
'(?:ad(?:vertising|\\s|)age(?:\\.com|))': 'Advertising Age',
'(?:bmj(?:\\.com|))': 'BMJ',
'(?:thelancet(?:\\.com|))': 'The Lancet',
Line 368:
//Other language magazines
'spiegel(?:\\.de|)': 'Der Spiegel',
'wiwo(?:\\.de|)': 'Wirtschaftswoche',
};
// source names to 'wikiname' - unlinked
Line 379:
var txt="";
try {
var re = new RegExp('((?:author|agency|journal|newspaper|periodical|publisher|work)[ ]*=[ ]*)(?:[\\w\\.]+\\.|)' + word + '(?: online|)([\\s\\.]*[\\|\\}])', 'gi');
regex(re, newWord);
// source names to 'wikiname', without delinking - linked (simple, without pipes)
var re = new RegExp('((?:author|agency|journal|newspaper|periodical|publisher|work)[ ]*=[ ]*\\[\\[)(?:[\\w\\.]+\\.|)' + word + '(?: online|)(\\]\\][\\s\\.]*[\\|\\}])', 'gi');
// source names to 'wikiname', without delinking - linked (with pipes)
var re = new RegExp('((?:author|agency|journal|newspaper|periodical|publisher|work)[ ]*=[ ]*\\[\\[(?:[^\\|\\]]*\\||))(?:[\\w\\.]+\\.|)' + word + '(?: online|)(\\]\\][\\s\\.]*[\\|\\}])', 'gi');
regex(re, newWord);
// source names to 'wikiname' - unlinked; outside citation templates
var re = new RegExp('(<ref[^>]*>[^<]+?\\s\'\')' + word + '(?: online|)(\'\'[^<]*?<\\/ref>)', 'gi');
regex(re, newWord);
 
// source names to italicised 'wikiname' - unlinked; outside citation templates
var re = new RegExp('(<ref[^>]*>[^<]+?[\\]\\.,;]\\s+)' + word + '(?: online|)([^\\]<]*?<\\/ref>)', 'gi') ;
regex(re, newWord2); //NOTE: adaptation to italicise is built into 'newWord2'
// source names to italicised 'wikiname' - linked, unpiped; outside citation templates
var re = new RegExp('(<ref[^>]*>[^<]+?[\\]\\.,;]\\s+)\\[\\[' + word + '(?: online|)\\]\\]([^<]*?<\\/ref>)', 'gi');
regex(re, newWord3); //NOTE: adaptation to italicise linked is built into 'newWord3'
}
catch(err) {
Line 413:
'pr ?newswire(?:\\.com|)': 'PR Newswire',
'(?:rian(?:\\.com|\\.ru|)|RIA ?Novosti)': 'RIA Novosti',
'xinhua(?:\\.com|\\.com\\.cn|)': 'Xinhua News Agency',
};
var word, newWord;
Line 423:
try {
// source names that are agencies - linked –>unlinked
var re = new RegExp('(?:author|agency|journal|newspaper|periodical|publisher|work)([ ]*=[ ]*\\[\\[)(?:[\\w\\.]+\\.|)' + word + '(\\]\\][\\s\\.]*[\\|\\}])', 'gi');
regex( re, newWord );
 
// source names that are agencies - unlinked
var re = new RegExp('(?:author|agency|journal|newspaper|periodical|publisher|work)([ ]*=[ ]*)(?:[\\w\\.]+\\.|)' + word + '([\\s\\.]*[\\|\\}])', 'gi');
regex( re, newWord );
 
Line 442:
//Broadcasters
'abc(?:\\.go|)\\.com': 'American Broadcasting Company',
'abc\\.(?:com\\.au|net(?:\\.au|))': 'Australian Broadcasting Corporation',
'abcnews(?:\\.com|)': 'ABC News',
'aljazeera(?:\\.com|)': 'Al Jazeera',
Line 452:
'cnbc\\.com': 'CNBC',
'cbs\\.com': 'CBS',
'espn(?:\.go|)\\.com': 'ESPN',
'(?:espn ?|)cricinfo(?:\\.com|)': 'ESPNcricinfo',
'foxnews\\.com': 'Fox News',
Line 468 ⟶ 467:
'mtv\\.com(?:\\.\\w{2,3}|)': 'MTV',
'rediff\\.com': 'Rediff.com',
'vh1\\.com': 'VH1',
};
// Broadcasters
Line 479 ⟶ 478:
try {
// Broadcasters - linked
var re = new RegExp('(?:author|agency|journal|newspaper|periodical|publisher|work)([ ]*=[ ]*\\[\\[)(?:[\\w\\.]+\\.|)' + word + '(\\]\\][\\s\\.]*[\\|\\}])', 'gi');
// Broadcasters - unlinked
var re = new RegExp('(?:author|agency|journal|newspaper|periodical|publisher|work)([ ]*=[ ]*)(?:[\\w\\.]+\\.|)' + word + '([\\s\\.]*[\\|\\}])', 'gi');
regex(re, newWord);
}
catch(err) {