User:Walking the blues/test.js: Difference between revisions
Appearance
Content deleted Content added
←Created page with '// PLEASE READ THE DOCUMENTATION at [coming soon] (click on the link above) before using. // This script de-links many everyday words which are commonly linked, inc...' |
reduce |
||
Line 1: | Line 1: | ||
// PLEASE READ THE DOCUMENTATION at [coming soon] (click on the link above) before using. |
|||
// This script de-links many everyday words which are commonly linked, including major countries, languages, and professions. The aim is to remove wikilinks from words which should never linked, or rarely so. Please refer to [[WP:Linking]] for rationale. |
|||
// Feedback and constructive criticism are welcome... |
// Feedback and constructive criticism are welcome... |
||
// As I am a scripting newbie, any technical advice on the 'hows and the wherefores' are especially welcome. |
// As I am a scripting newbie, any technical advice on the 'hows and the wherefores' are especially welcome. |
||
Line 7: | Line 4: | ||
//Please exercise due care should you decide to use it. |
//Please exercise due care should you decide to use it. |
||
function Ohc_allcountries() { |
|||
var txt=document.editform.wpTextbox1; |
|||
//recognised sovereign states and a few unrecognised ones |
|||
txt.value=txt.value.replace(/\[\[(Abkhazia|Afghanistan|Albania|Algeria|Andorra|Angola|Antigua and Barbuda|Argentina|Armenia|Australia|Austria|Azerbaijan|(?:The |)Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Belgium|Belize|Benin|Bhutan|Bolivia|Bosnia and Herzegovina|Botswana|Brazil|Brunei|Bulgaria|Burkina Faso|Burma|Burundi|Cambodia|Cameroon|Canada|Cape Verde|Central African Republic|Chad|Chile|(?:(?:People's |)Republic of |)China|Colombia|Comoros|(?:Democratic |)Republic of the Congo|Costa Rica|Côte d'Ivoire|Croatia|Cuba|Cyprus|Czech Republic|(?:Kingdom of |)Denmark|Djibouti|Dominica|Dominican Republic|East Timor|Ecuador|Egypt|El Salvador|Equatorial Guinea|Eritrea|Estonia|Ethiopia|Fiji|Finland|France|Gabon|Georgia|Germany|Ghana|Greece|Grenada|Guatemala|Guinea|Guinea-Bissau|Guyana|Haiti|Honduras|Hungary|Iceland|India|Indonesia|Iran|Iraq|(?:Republic of |)Ireland|Israel|Italy|Jamaica|Japan|Jordan|Kazakhstan|Kenya|Kiribati|North Korea|South Korea|Kosovo|Kuwait|Kyrgyzstan|Laos|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luxembourg|(?:Republic of |)Macedonia|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Marshall Islands|Mauritania|Mauritius|Mexico|(?:Federated States of |)Micronesia|Moldova|Monaco|Mongolia|Montenegro|Morocco|Mozambique|Nagorno-Karabakh|Namibia|Nauru|Nepal|(?:Kingdom of the |)Netherlands|Holland|New Zealand|Nicaragua|Niger|Nigeria|Northern Cyprus|Norway|Oman|Pakistan|Palau|Palestine|Panama|Papua New Guinea|Paraguay|Peru|Philippines|Poland|Portugal|Qatar|Romania|Russia|Rwanda|SADR|Saint Kitts and Nevis|Saint Lucia|Saint Vincent and the Grenadines|Samoa|San Marino|São Tomé and Príncipe|Saudi Arabia|Senegal|Serbia|Seychelles|Sierra Leone|Singapore|Slovakia|Slovenia|Solomon Islands|Somalia|Somaliland|South Africa|South Ossetia|Spain|Sri Lanka|Sudan|Suriname|Swaziland|Sweden|Switzerland|Syria|Taiwan|Tajikistan|Tanzania|Thailand|(?:The |)Gambia|Togo|Tonga|Transnistria|Trinidad and Tobago|Tunisia|Turkey|Turkmenistan|Tuvalu|Uganda|Ukraine|United Arab Emirates|United Kingdom|United States|Uruguay|Uzbekistan|Vanuatu|Vatican City|Venezuela|Vietnam|Yemen|Zambia|Zimbabwe|Republic of Abkhazia|Islamic Republic of Afghanistan|Republic of Albania|People's Democratic Republic of Algeria|Principality of Andorra|Republic of Angola|Argentine Republic|Republic of Armenia|Commonwealth of Australia|Republic of Austria|Republic of Azerbaijan|Commonwealth of The Bahamas|Kingdom of Bahrain|People's Republic of Bangladesh|Republic of Belarus|Kingdom of Belgium|Republic of Benin|Kingdom of Bhutan|Plurinational State of Bolivia|Republic of Botswana|Federative Republic of Brazil|State of Brunei, Abode of Peace|Republic of Bulgaria|Union of Myanmar|Republic of Burundi|Kingdom of Cambodia|Republic of Cameroon|Republic of Cape Verde|Republic of Chad|Republic of Chile|People's Republic of China|Republic of Colombia|Union of the Comoros|Republic of Costa Rica|Republic of Côte d'Ivoire (Ivory Coast)|Republic of Croatia|Republic of Cuba|Republic of Cyprus|Kingdom of Denmark|Republic of Djibouti|Commonwealth of Dominica|Democratic Republic of Timor-Leste|Republic of Ecuador|Arab Republic of Egypt|Republic of El Salvador|Republic of Equatorial Guinea|State of Eritrea|Republic of Estonia|Federal Democratic Republic of Ethiopia|Republic of the Fiji Islands|Republic of Finland|French Republic|Gabonese Republic|Federal Republic of Germany|Republic of Ghana|Hellenic Republic|Republic of Guatemala|Republic of Guinea|Republic of Guinea-Bissau|Co-operative Republic of Guyana|Republic of Haiti|Republic of Honduras|Republic of Hungary|Republic of Iceland|Republic of India|Republic of Indonesia|Islamic Republic of Iran|Republic of Iraq|State of Israel|Italian Republic|Hashemite Kingdom of Jordan|Republic of Kazakhstan|Republic of Kenya|Republic of Kiribati|Democratic People's Republic of Korea|Republic of Korea|Republic of Kosovo|State of Kuwait|Kyrgyz Republic|Lao People's Democratic Republic|Republic of Latvia|Lebanese Republic|Kingdom of Lesotho|Republic of Liberia|Great Socialist People's Libyan Arab Jamahiriya|Principality of Liechtenstein|Republic of Lithuania|Grand Duchy of Luxembourg|Republic of Macedonia|Republic of Madagascar|Republic of Malawi|Republic of Maldives|Republic of Mali|Republic of Malta|Republic of the Marshall Islands|Islamic Republic of Mauritania|Republic of Mauritius|United Mexican States|Federated States of Micronesia|Republic of Moldova|Principality of Monaco|Kingdom of Morocco|Republic of Mozambique|Nagorno-Karabakh Republic|Republic of Namibia|Republic of Nauru|Federal Democratic Republic of Nepal|Kingdom of the Netherlands|Republic of Nicaragua|Republic of Niger|Federal Republic of Nigeria|Turkish Republic of Northern Cyprus|Kingdom of Norway|Sultanate of Oman|Islamic Republic of Pakistan|Republic of Palau|Palestine|Republic of Panama|Independent State of Papua New Guinea|Republic of Paraguay|Republic of Peru|Republic of the Philippines|Republic of Poland|Portuguese Republic|State of Qatar|Russian Federation|Republic of Rwanda|Sahrawi Arab Democratic Republic|Federation of Saint Christopher and Nevis|Independent State of Samoa|Republic of San Marino|Democratic Republic of São Tomé and Príncipe|Kingdom of Saudi Arabia|Republic of Senegal|Republic of Serbia|Republic of Seychelles|Republic of Sierra Leone|Republic of Singapore|Slovak Republic|Republic of Slovenia|Republic of Somalia|Republic of Somaliland|Republic of South Africa|Republic of South Ossetia|Kingdom of Spain|Democratic Socialist Republic of Sri Lanka|Republic of the Sudan|Republic of Suriname|Kingdom of Swaziland|Kingdom of Sweden|Swiss Confederation|Syrian Arab Republic|Republic of China|Republic of Tajikistan|United Republic of Tanzania|Kingdom of Thailand|Republic of The Gambia|Togolese Republic|Kingdom of Tonga|Transnistrian Moldovan Republic (Pridnestrovie, Trans-Dniester)|Republic of Trinidad and Tobago|Republic of Tunisia|Republic of Turkey|Republic of Uganda|United Kingdom of Great Britain and Northern Ireland|United States of America|Eastern Republic of Uruguay|Republic of Uzbekistan|Republic of Vanuatu|State of the Vatican City|Bolivarian Republic of Venezuela|Socialist Republic of Vietnam|Republic of Yemen|Republic of Zambia|Republic of Zimbabwe)\]\]/gi, '$1'); |
|||
txt.value=txt.value.replace(/\[\[(?:Abkhazia|Afghanistan|Albania|Algeria|Andorra|Angola|Antigua and Barbuda|Argentina|Armenia|Australia|Austria|Azerbaijan|(?:The |)Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Belgium|Belize|Benin|Bhutan|Bolivia|Bosnia and Herzegovina|Botswana|Brazil|Brunei|Bulgaria|Burkina Faso|Burma|Burundi|Cambodia|Cameroon|Canada|Cape Verde|Central African Republic|Chad|Chile|(?:(?:People's |)Republic of |)China|Colombia|Comoros|(?:Democratic |)Republic of the Congo|Costa Rica|Côte d'Ivoire|Croatia|Cuba|Cyprus|Czech Republic|(?:Kingdom of |)Denmark|Djibouti|Dominica|Dominican Republic|East Timor|Ecuador|Egypt|El Salvador|Equatorial Guinea|Eritrea|Estonia|Ethiopia|Fiji|Finland|France|Gabon|Georgia \(country\)|Germany|Ghana|Greece|Grenada|Guatemala|Guinea|Guinea-Bissau|Guyana|Haiti|Honduras|Hungary|Iceland|India|Indonesia|Iran|Iraq|(?:Republic of |)Ireland|Israel|Italy|Jamaica|Japan|Jordan|Kazakhstan|Kenya|Kiribati|North Korea|South Korea|Kosovo|Kuwait|Kyrgyzstan|Laos|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luxembourg|(?:Republic of |)Macedonia|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Marshall Islands|Mauritania|Mauritius|Mexico|(?:Federated States of |)Micronesia|Moldova|Monaco|Mongolia|Montenegro|Morocco|Mozambique|Nagorno-Karabakh|Namibia|Nauru|Nepal|(?:Kingdom of the |)Netherlands|Holland|New Zealand|Nicaragua|Niger|Nigeria|Northern Cyprus|Norway|Oman|Pakistan|Palau|Palestine|Panama|Papua New Guinea|Paraguay|Peru|Philippines|Poland|Portugal|Qatar|Romania|Russia|Rwanda|SADR|Saint Kitts and Nevis|Saint Lucia|Saint Vincent and the Grenadines|Samoa|San Marino|São Tomé and Príncipe|Saudi Arabia|Senegal|Serbia|Seychelles|Sierra Leone|Singapore|Slovakia|Slovenia|Solomon Islands|Somalia|Somaliland|South Africa|South Ossetia|Spain|Sri Lanka|Sudan|Suriname|Swaziland|Sweden|Switzerland|Syria|Taiwan|Tajikistan|Tanzania|Thailand|(?:The |)Gambia|Togo|Tonga|Transnistria|Trinidad and Tobago|Tunisia|Turkey|Turkmenistan|Tuvalu|Uganda|Ukraine|United Arab Emirates|United Kingdom|United States|Uruguay|Uzbekistan|Vanuatu|Vatican City|Venezuela|Vietnam|Yemen|Zambia|Zimbabwe)\|([^\]]{4,39})\]\]/gi, '$1'); |
|||
//rem linking templates |
|||
// txt.value=txt.value.replace(/{{(English)}}/gi, '$1'); |
|||
// txt.value=txt.value.replace(/{{(AUS)}}/gi, '{{Flag icon|$1}} Australia'); |
|||
// txt.value=txt.value.replace(/{{(CAN)}}/gi, '{{Flag icon|$1}} Canada'); |
|||
// txt.value=txt.value.replace(/{{(CHN)}}/gi, '{{Flag icon|$1}} China'); |
|||
// txt.value=txt.value.replace(/{{(ENG)}}/gi, '{{Flag icon|$1}} England'); |
|||
// txt.value=txt.value.replace(/{{(FRA)}}/gi, '{{Flag icon|$1}} France'); |
|||
// txt.value=txt.value.replace(/{{(DEU|GER)}}/gi, '{{Flag icon|$1}} Germany'); |
|||
// txt.value=txt.value.replace(/{{(JPN)}}/gi, '{{Flag icon|$1}} Japan'); |
|||
// txt.value=txt.value.replace(/{{(RUS)}}/gi, '{{Flag icon|$1}} Russia'); |
|||
// txt.value=txt.value.replace(/{{(USA?|UK)}}/gi, '{{Flag icon|$1}} $1'); |
|||
// txt.value=txt.value.replace(/{{(EUR?)}}/g, '{{Flag icon|$1}} $1'); |
|||
// txt.value=txt.value.replace(/{{(?:flag\|)(AUS|Australia|CAN|Canada|CHN|China|ENG|England|FRA|France|DEU|GER|Germany|JPN|Japan|RUS|Russia|USA?|UK|United (Kingdom|States))}}/gi, '{{Flag icon|$1}} $1'); |
|||
txt.value=txt.value.replace(/{{(AFG|Afghanistan)}}/g, '{{Flag icon|$1}} Afghanistan'); |
|||
txt.value=txt.value.replace(/{{(ALB|Albania)}}/g, '{{Flag icon|$1}} Albania'); |
|||
txt.value=txt.value.replace(/{{(ARE|UAE|United Arab Emirates)}}/g, '{{Flag icon|$1}} United Arab Emirates'); |
|||
txt.value=txt.value.replace(/{{(ARG|Argentina)}}/g, '{{Flag icon|$1}} Argentina'); |
|||
txt.value=txt.value.replace(/{{(AUS|Australia)}}/g, '{{Flag icon|$1}} Australia'); |
|||
txt.value=txt.value.replace(/{{(AUT|Austria)}}/g, '{{Flag icon|$1}} Austria'); |
|||
txt.value=txt.value.replace(/{{(BEL|Belgum)}}/g, '{{Flag icon|$1}} Belgum'); |
|||
txt.value=txt.value.replace(/{{(BEN|Benin)}}/g, '{{Flag icon|$1}} Benin'); |
|||
txt.value=txt.value.replace(/{{(BIH|Bosnia and Herzegovina)}}/g, '{{Flag icon|$1}} Bosnia and Herzegovina'); |
|||
txt.value=txt.value.replace(/{{(BIR|Myanmar)}}/g, '{{Flag icon|$1}} Myanmar'); |
|||
txt.value=txt.value.replace(/{{(BOL|Bolivia)}}/g, '{{Flag icon|$1}} Bolivia'); |
|||
txt.value=txt.value.replace(/{{(BRA|Brazil)}}/g, '{{Flag icon|$1}} Brazil'); |
|||
txt.value=txt.value.replace(/{{(COL|Colombia)}}/g, '{{Flag icon|$1}} Colombia'); |
|||
txt.value=txt.value.replace(/{{(CHN|China)}}/g, '{{Flag icon|$1}} China'); |
|||
txt.value=txt.value.replace(/{{(CUB|Cuba)}}/g, '{{Flag icon|$1}} Cuba'); |
|||
txt.value=txt.value.replace(/{{(CZE|Czech Republic)}}/g, '{{Flag icon|$1}} Czech Republic'); |
|||
txt.value=txt.value.replace(/{{(DEN|DNK|Denmark)}}/g, '{{Flag icon|$1}} Denmark'); |
|||
txt.value=txt.value.replace(/{{(EGY|Egypt)}}/g, '{{Flag icon|$1}} Egypt'); |
|||
txt.value=txt.value.replace(/{{(ESP|Spain)}}/g, '{{Flag icon|$1}} Spain'); |
|||
txt.value=txt.value.replace(/{{(FIN|Finland)}}/g, '{{Flag icon|$1}} Finland'); |
|||
txt.value=txt.value.replace(/{{(FJI|Fiji)}}/g, '{{Flag icon|$1}} Fiji'); |
|||
txt.value=txt.value.replace(/{{(GAB|Gabon)}}/g, '{{Flag icon|$1}} Gabon'); |
|||
txt.value=txt.value.replace(/{{(GEO|Georga)}}/g, '{{Flag icon|$1}} Georga'); |
|||
txt.value=txt.value.replace(/{{(HUN|Hungary)}}/g, '{{Flag icon|$1}} Hungary'); |
|||
txt.value=txt.value.replace(/{{(IDN|Indonesia)}}/g, '{{Flag icon|$1}} Indonesia'); |
|||
txt.value=txt.value.replace(/{{(IND|India)}}/g, '{{Flag icon|$1}} India'); |
|||
txt.value=txt.value.replace(/{{(IRL|Ireland)}}/g, '{{Flag icon|$1}} Ireland'); |
|||
txt.value=txt.value.replace(/{{(IRN|Iran)}}/g, '{{Flag icon|$1}} Iran'); |
|||
txt.value=txt.value.replace(/{{(IRQ|Iraq)}}/g, '{{Flag icon|$1}} Iraq'); |
|||
txt.value=txt.value.replace(/{{(ISL|Iceland)}}/g, '{{Flag icon|$1}} Iceland'); |
|||
txt.value=txt.value.replace(/{{(ISR|Israel)}}/g, '{{Flag icon|$1}} Israel'); |
|||
txt.value=txt.value.replace(/{{(ITA|Italy)}}/g, '{{Flag icon|$1}} Italy'); |
|||
txt.value=txt.value.replace(/{{(JAM|Jamaica)}}/g, '{{Flag icon|$1}} Jamaica'); |
|||
txt.value=txt.value.replace(/{{(JOR|Jordan)}}/g, '{{Flag icon|$1}} Jordan'); |
|||
txt.value=txt.value.replace(/{{(KAZ|Kazakhstan)}}/g, '{{Flag icon|$1}} Kazakhstan'); |
|||
txt.value=txt.value.replace(/{{(KOR|South Korea)}}/g, '{{Flag icon|$1}} South Korea'); |
|||
txt.value=txt.value.replace(/{{(KOS|Kosovo)}}/g, '{{Flag icon|$1}} Kosovo'); |
|||
txt.value=txt.value.replace(/{{(LAO|Laos)}}/g, '{{Flag icon|$1}} Laos'); |
|||
txt.value=txt.value.replace(/{{(LBN|Lebanon)}}/g, '{{Flag icon|$1}} Lebanon'); |
|||
txt.value=txt.value.replace(/{{(LBR|Liberia)}}/g, '{{Flag icon|$1}} Liberia'); |
|||
txt.value=txt.value.replace(/{{(LBY|Libya)}}/g, '{{Flag icon|$1}} Libya'); |
|||
txt.value=txt.value.replace(/{{(LKA|Sri Lanka)}}/g, '{{Flag icon|$1}} Sri Lanka'); |
|||
txt.value=txt.value.replace(/{{(LSO|Lesotho)}}/g, '{{Flag icon|$1}} Lesotho'); |
|||
txt.value=txt.value.replace(/{{(LTU|Lithuania)}}/g, '{{Flag icon|$1}} Lithuania'); |
|||
txt.value=txt.value.replace(/{{(LUX|Luxembourg)}}/g, '{{Flag icon|$1}} Luxembourg'); |
|||
txt.value=txt.value.replace(/{{(LVA|Latvia)}}/g, '{{Flag icon|$1}} Latvia'); |
|||
txt.value=txt.value.replace(/{{(N[EL]D|Norway)}}/g, '{{Flag icon|$1}} Norway'); |
|||
txt.value=txt.value.replace(/{{(NOR|Norway)}}/g, '{{Flag icon|$1}} Norway'); |
|||
txt.value=txt.value.replace(/{{(NZL|New Zealand)}}/g, '{{Flag icon|$1}} New Zealand'); |
|||
txt.value=txt.value.replace(/{{(PAK|Pakistan)}}/g, '{{Flag icon|$1}} Pakistan'); |
|||
txt.value=txt.value.replace(/{{(PAN|Panama)}}/g, '{{Flag icon|$1}} Panama'); |
|||
txt.value=txt.value.replace(/{{(PHL|Philippines)}}/g, '{{Flag icon|$1}} Philippines'); |
|||
txt.value=txt.value.replace(/{{(POL|Poland)}}/g, '{{Flag icon|$1}} Poland'); |
|||
txt.value=txt.value.replace(/{{(POR|Portugal)}}/g, '{{Flag icon|$1}} Portugal'); |
|||
txt.value=txt.value.replace(/{{(PRC|People's Republic of China)}}/g, '{{Flag icon|$1}} People\'s Republic of China'); |
|||
txt.value=txt.value.replace(/{{(PRI|Puerto Rico)}}/g, '{{Flag icon|$1}} Puerto Rico'); |
|||
txt.value=txt.value.replace(/{{(ROM|Romania)}}/g, '{{Flag icon|$1}} Romania'); |
|||
txt.value=txt.value.replace(/{{(RSA|South Africa)}}/g, '{{Flag icon|$1}} South Africa'); |
|||
txt.value=txt.value.replace(/{{(RWA|Rwanda)}}/g, '{{Flag icon|$1}} Rwanda'); |
|||
txt.value=txt.value.replace(/{{(SCO|Scotland)}}/g, '{{Flag icon|$1}} Scotland'); |
|||
txt.value=txt.value.replace(/{{(SEN|Senegal)}}/g, '{{Flag icon|$1}} Senegal'); |
|||
txt.value=txt.value.replace(/{{(SGP|Singapore)}}/g, '{{Flag icon|$1}} Singapore'); |
|||
txt.value=txt.value.replace(/{{(SLO|SVN|Slovenia)}}/g, '{{Flag icon|$1}} Slovenia'); |
|||
txt.value=txt.value.replace(/{{(SRB|Serbia)}}/g, '{{Flag icon|$1}} Serbia'); |
|||
txt.value=txt.value.replace(/{{(SUI|CHE|Switzerland)}}/g, '{{Flag icon|$1}} Switzerland'); |
|||
txt.value=txt.value.replace(/{{(SVK|Slovakia)}}/g, '{{Flag icon|$1}} Slovakia'); |
|||
txt.value=txt.value.replace(/{{(SWE|Sweden)}}/g, '{{Flag icon|$1}} Sweden'); |
|||
txt.value=txt.value.replace(/{{(SYR|Syria)}}/g, '{{Flag icon|$1}} Syria'); |
|||
txt.value=txt.value.replace(/{{(TUR|Turkey)}}/g, '{{Flag icon|$1}} Turkey'); |
|||
txt.value=txt.value.replace(/{{(TWN|Taiwan)}}/g, '{{Flag icon|$1}} Taiwan'); |
|||
txt.value=txt.value.replace(/{{(UKR|Ukraine)}}/g, '{{Flag icon|$1}} Ukraine'); |
|||
txt.value=txt.value.replace(/{{(URU|Uruguay)}}/g, '{{Flag icon|$1}} Uruguay'); |
|||
txt.value=txt.value.replace(/{{(USA|United States of America)}}/g, '{{Flag icon|$1}} United States of America'); |
|||
txt.value=txt.value.replace(/{{(VEN|Venezuela)}}/g, '{{Flag icon|$1}} Venezuela'); |
|||
txt.value=txt.value.replace(/{{(WLS|Wales)}}/g, '{{Flag icon|$1}} Wales'); |
|||
txt.value=txt.value.replace(/{{(YEM|Yemen)}}/g, '{{Flag icon|$1}} Yemen'); |
|||
txt.value=txt.value.replace(/{{(YUG|Yugoslavia)}}/g, '{{Flag icon|$1}} Yugoslavia'); |
|||
txt.value=txt.value.replace(/{{(ZMB|Zambia)}}/g, '{{Flag icon|$1}} Zambia'); |
|||
txt.value=txt.value.replace(/{{(ZWE|Zimbabwe)}}/g, '{{Flag icon|$1}} Zimbabwe'); |
|||
// txt.value=txt.value.replace(/{{(?:flag\|)(AUS|Australia|CAN|Canada|CHN|China|ENG|England|FRA|France|DEU|GER|Germany|JPN|Japan|RUS|Russia|USA?|UK|United (Kingdom|States))}}/gi, '{{Flag icon|$1}} $1'); |
|||
Ohc_wellknowncountries() |
|||
txt.value=txt.value.replace(/{{(?:flag\|)([^\|\}]{4,39})}}/gi, '{{Flag icon|$1}} $1'); |
|||
} |
|||
function Ohc_wellknowncountries() { |
|||
var txt=document.editform.wpTextbox1; |
|||
txt.value=txt.value.replace(/\[\[(Arab|Arabic|Argentina|Argentinian|Australian?|Austrian?|Belgian|Belgium|Bra[sz]il|Bra[sz]ilian|British\sIsles|Canada|Canadian|Dutch|Korean?|People's\sRepublic\sof\sChina|Philippines|Czech\sRepublic|Czech|Danish|Denmark|Finland|Finnish|Greece|Greek|Hungary|Hungarian|Indian?|Ireland|Irish|Italy|Italian|Jewish|Mexican|Mexico|Middle\sEastern|(?:the\s|)Netherlands|Holland|New\sZealand|New\sZealander|Norway|Norwegian|Poland|Polish|Portugal|Portuguese|Queensland|Russian?|Scandinavian?|Scotland|Scottish|South\sAfrican?|South\sKorean?|Sweden|Swedish|Switzerland|Swiss|United States(?: of America)|U\.?S\.?|USA|Wales|Welsh|Western\sAustralian?|West\sGermany?)\]\]/gi, '$1'); |
|||
txt.value=txt.value.replace(/\[\[(?:Arab|Arabic|Argentina|Argentinian|Australian?|Austrian?|Belgian|Belgium|Bra[sz]il|Bra[sz]ilian|British\sIsles|Canada|Canadian|Dutch|Korean?|People's\sRepublic\sof\sChina|Philippines|Czech\sRepublic|Czech|Danish|Denmark|Finland|Finnish|Greece|Greek|Hungary|Hungarian|Indian?|Ireland|Irish|Italy|Italian|Jewish|Mexican|Mexico|Middle\sEastern|(?:the\s|)Netherlands|Holland|New\sZealand|New\sZealander|Norway|Norwegian|Poland|Polish|Portugal|Portuguese|Queensland|Russian?|Scandinavian?|Scotland|Scottish|South\sAfrican?|South\sKorean?|Sweden|Swedish|Switzerland|Swiss|United States(?: of America)|Wales|Welsh|Western\sAustralian?|West\sGermany?)\|(Arab|Arabic|Argentina|Argentinian|Australian?|Austrian?|Belgian|Belgium|Bra[sz]il|Bra[sz]ilian|British\sIsles|Canada|Canadian|Dutch|Korean?|People's\sRepublic\sof\sChina|Philippines|Czech\sRepublic|Czech|Danish|Denmark|Finland|Finnish|Greece|Greek|Hungary|Hungarian|Indian?|Ireland|Irish|Italy|Italian|Jewish|Mexican|Mexico|Middle\sEastern|(?:the\s|)Netherlands|Holland|New\sZealand|New\sZealander|Norway|Norwegian|Poland|Polish|Portugal|Portuguese|Queensland|Russian?|Scandinavian?|Scotland|Scottish|South\sAfrican?|South\sKorean?|Sweden|Swedish|Switzerland|Swiss|United States(?: of America)|U\.?S\.?|USA|American|Wales|Welsh|Western\sAustralian?|West\sGermany?)\]\]/gi, '$1'); |
|||
txt.value=txt.value.replace(/\[\[(?:Arab|Arabic|Argentinian|Australian|Austrian|Belgian|Belgium|Brazilian|British|Canadian|Dutch|Korean|Chinese|Philippines|Filipino|Czech|Danish|Finnish|Greek|Hungarian|Indian|Irish|Italian|Jewish|Mexican|Middle\sEastern|New\sZealand|Norwegian|Polish|Portuguese|Russian|Scandinavian|Scottish|South\sAfrican|South\sKorean|Swedish|Swiss|Welsh|Western\sAustralian|West\sGerman)\s\(?(?:language|people)\)?\|(Arab|Arabic|Argentina|Argentinian|Australian?|Austrian?|Belgian|Belgium|Bra[sz]il|Bra[sz]ilian|British\sIsles|Canada|Canadian|Dutch|Korean?|People's\sRepublic\sof\sChina|Philippines|Czech\sRepublic|Czech|Danish|Denmark|Finland|Finnish|Greece|Greek|Hungary|Hungarian|Indian?|Ireland|Irish|Italy|Italian|Jewish|Mexican|Mexico|Middle\sEastern|(?:the\s|)Netherlands|Holland|New\sZealand|New\sZealander|Norway|Norwegian|Poland|Polish|Portugal|Portuguese|Queensland|Russian?|Scandinavian?|Scotland|Scottish|South\sAfrican?|South\sKorean?|Sweden|Swedish|Switzerland|Swiss|Wales|Welsh|Western\sAustralian?|West\sGermany?)\]\]/gi, '$1'); |
|||
txt.value=txt.value.replace(/\[\[(?:(?:The |)Netherlands|Holland)\|(Dutch)\]\]/gi, '$1'); |
|||
txt.value=txt.value.replace(/\[\[Republic of Ireland\|(Ireland|Irish)\]\]/gi, '$1'); |
|||
//rem linking templates |
|||
txt.value=txt.value.replace(/{{(English)}}/gi, '$1'); |
|||
txt.value=txt.value.replace(/{{(AUS)}}/gi, '{{Flag icon|$1}} Australia'); |
|||
txt.value=txt.value.replace(/{{(CAN)}}/gi, '{{Flag icon|$1}} Canada'); |
|||
txt.value=txt.value.replace(/{{(CHN)}}/gi, '{{Flag icon|$1}} China'); |
|||
txt.value=txt.value.replace(/{{(ENG)}}/gi, '{{Flag icon|$1}} England'); |
|||
txt.value=txt.value.replace(/{{(FRA)}}/gi, '{{Flag icon|$1}} France'); |
|||
txt.value=txt.value.replace(/{{(DEU|GER)}}/gi, '{{Flag icon|$1}} Germany'); |
|||
txt.value=txt.value.replace(/{{(JPN)}}/gi, '{{Flag icon|$1}} Japan'); |
|||
txt.value=txt.value.replace(/{{(RUS)}}/gi, '{{Flag icon|$1}} Russia'); |
|||
txt.value=txt.value.replace(/{{(USA?|UK)}}/gi, '{{Flag icon|$1}} $1'); |
|||
txt.value=txt.value.replace(/{{(EUR?)}}/g, '{{Flag icon|$1}} $1'); |
|||
txt.value=txt.value.replace(/{{(?:flag\|)(AUS|Australia|CAN|Canada|CHN|China|ENG|England|FRA|France|DEU|GER|Germany|JPN|Japan|RUS|Russia|USA?|UK|United (Kingdom|States))}}/gi, '{{Flag icon|$1}} $1'); |
|||
} |
|||
function Ohc_USstates() { |
|||
var txt=document.editform.wpTextbox1; |
|||
txt.value=txt.value.replace(/\[\[(Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Florida||Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|West Virginia|Wisconsin|Wyoming)\]\]/gi, '$1$3'); |
|||
txt.value=txt.value.replace(/\[\[Georgia \(U.S. state\)\|(Georgia)\]\]/gi, '$1'); |
|||
txt.value=txt.value.replace(/\[\[Washington \(U.S. state\)\|(Washington)\]\]/gi, '$1'); |
|||
} |
|||
function Ohc_CommonTerms(){ |
function Ohc_CommonTerms(){ |
||
var txt=document.editform.wpTextbox1; |
var txt=document.editform.wpTextbox1; |
||
Line 574: | Line 426: | ||
txt.value=txt.value.replace(/\[\[(U\.?S\.?\sOpen|French Open|Australian Open)\]\]/gi, '$1'); |
txt.value=txt.value.replace(/\[\[(U\.?S\.?\sOpen|French Open|Australian Open)\]\]/gi, '$1'); |
||
} |
|||
function Ohc_countries() { |
|||
Ohc_allcountries(); |
|||
// Ohc_COMMON_edit_summary(); |
|||
} |
} |
||
Line 600: | Line 447: | ||
document.editform.wpDiff.click(); |
document.editform.wpDiff.click(); |
||
} |
} |
||
addOnloadHook(function () { |
addOnloadHook(function () { |
||
if(document.forms.editform) { |
if(document.forms.editform) { |
||
addPortletLink('p-tb', 'javascript:Ohc_COMMON()', ' |
addPortletLink('p-tb', 'javascript:Ohc_COMMON()', 'Blues test', 't-commonterms', 'Removes links to common terms', '', ''); |
||
// addPortletLink('p-tb', 'javascript:Ohc_allcountries()', 'Delink ALL countries', 't-countries', 'Removes links to country articles', '', ''); |
|||
// addPortletLink('p-tb', 'javascript:Ohc_USstates()', 'Unlink US states', 't-51 states', 'Removes links to US states', '', ''); |
|||
} |
} |
||
}); |
}); |
Revision as of 12:01, 8 January 2011
// Feedback and constructive criticism are welcome...
// As I am a scripting newbie, any technical advice on the 'hows and the wherefores' are especially welcome.
//Please exercise due care should you decide to use it.
function Ohc_CommonTerms(){
var txt=document.editform.wpTextbox1;
// Compound links
txt.value=txt.value.replace(/(\[\[UNESCO)\]\] \[\[(World Heritage Site\]\])/g, '$1 $2');
txt.value=txt.value.replace(/\[\[List of (?:football clubs in Germany|German football clubs)(\|German football (?:club|team))\]\]/gi, '[[football in Germany|German association football club]]');
// txt.value=txt.value.replace(/\[\[(Baden-Württemberg|Bavaria|Berlin|Brandenburg|Hamburg|Hesse|Ländereinführungsgesetz|Lower Saxony|Mecklenburg-Vorpommern|North Rhine-Westphalia|Rhineland-Palatinate|Saarland|Saxony|Saxony-Anhalt|Schleswig-Holstein|South Baden|Thuringia|Württemberg-Baden|Württemberg-Hohenzollern)\]\]/gi, '$1'); // unlinks German states - not for general use
// unlinks Italian states
txt.value=txt.value.replace(/\[\[(Lombardy|Campania|Lazio|Sicily|Veneto|Piedmont|Emilia-Romagna|Apulia|Tuscany|Calabria|Sardinia|Liguria|Marche|Abruzzo|Friuli-Venezia Giulia|Trentino-Alto Adige\/Südtirol|Umbria|Basilicata|Molise|Aosta Valley)\]\]/gi, '$1');
txt.value=txt.value.replace(/(?:\[\[|)(Australia|Austria|Brazil|Korea|India|New\sZealand|Russia|South\sAfrica|South\sKorea)(?:\]\]|)(n|ian|) (amateur |professional |)\[\[(?:football \(soccer\)|soccer|Association football)(?:\|football|)\]\] (club|\[\[(?:List of football clubs in (?:Australia|Austria|Brazil|Korea|India|New\sZealand|Russia|South\sAfrica|South\sKorea)|:Category:(Australia|Austria|Brazil|Korea|India|New\sZealand|Russia|South\sAfrica|South\sKorea)(n|ian|) football clubs)\|(?:club|team)\]\])/gi, '$3[[Football in $1|$1$2 association football]] club');
txt.value=txt.value.replace(/\[\[(Argentina|Australia|Austria|Belgium|Brazil|British\sIsles|Canada|the Netherlands|Korea|People's\sRepublic\sof\sChina|the Philippines|Czech\sRepublic|Denmark|Finland|England|France|Germany|Spain|Greece|Hungary|India|Ireland|Italy|Mexico|Holland|New\sZealand|Norway|Poland|Portugal|Russia|Scotland|South\sAfrica|South\sKorea|Sweden|Switzerland|Wales)\|(Argentinian|Australian|Austrian|Belgian|Belgium|Brazilian|British|Canadian|Dutch|Korean|Chinese|(?:Ph|F)ilipp?in[eo]|Czech|Danish|Finnish|English|French|German|Spanish|Greek|Hungarian|Indian|Irish|Italian|Mexican|Middle\sEastern|(:the\s|)Netherlands|Holland|New\sZealand|Norwegian|Polish|Portuguese|Russian|Scandinavian|Scottish|South\sAfrican|South\sKorean|Swedish|Swiss|Welsh)\]\] (professional |)\[\[(football \(soccer\)|soccer|Association football)(?:\|football|)\]\] (club|\[\[(?:List of football clubs in (?:Argentina|Australia|Austria|Belgium|Brazil|British\sIsles|Canada|the Netherlands|Korea|People's\sRepublic\sof\sChina|the Philippines|Czech\sRepublic|Denmark|Finland|England|France|Germany|Spain|Greece|Hungary|India|Ireland|Italy|Mexico|Holland|New\sZealand|Norway|Poland|Portugal|Russia|Scotland|South\sAfrica|South\sKorea|Sweden|Switzerland|Wales)|:Category:(?:Argentinian|Australian|Austrian|Belgian|Belgium|Brazilian|British|Canadian|Dutch|Korean|Chinese|(?:Ph|F)ilipp?in[eo]|Czech|Danish|Finnish|English|French|German|Spanish|Greek|Hungarian|Indian|Irish|Italian|Mexican|Middle\sEastern|(:the\s|)Netherlands|Holland|New\sZealand|Norwegian|Polish|Portuguese|Russian|Scandinavian|Scottish|South\sAfrican|South\sKorean|Swedish|Swiss|Welsh) football clubs)\|(?:club|team)\]\])/gi, '$3[[Football in $1|$2 association football]] club');
// US States piped
txt.value=txt.value.replace(/(\[\[([^\]]{1,20})\,\s(AL|AK|AZ|AR|CA|CO|CT|DE|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY|Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming)\|([^\]]{1,20})\]\]\,?\s)\[\[(Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Florida|(Georgia \(U.S. state\)\|Georgia)|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|(Washington \(U.S. state\)\|Washington)|West Virginia|Wisconsin|Wyoming)\]\]/gi, '$1$3');
//Canada
txt.value=txt.value.replace(/\[\[([^\]]{1,20})\,\s(AB|Alta\.?|B\.?C\.?|Man\.?|MB|N\.?B\.?|N\.?S\.?|Nfld\.?, Lab\.?|NL|ON|Ont\.?|P\.?E\.?I\.?|PE|QC|Que\.?, P\.?Q\.?|Sask\.?|SK|Alberta|British Columbia|Manitoba|New Brunswick|Newfoundland and Labrador|Nova Scotia|Ontario|Prince Edward Island|Quebec|Saskatchewan)\|([^\]]{1,20})\]\]\,?\s\[\[(Alberta|British Columbia|Manitoba|New Brunswick|Newfoundland and Labrador|Nova Scotia|Ontario|Prince Edward Island|Quebec|Saskatchewan)\]\]/gi, '[[$1, $2]]');
txt.value=txt.value.replace(/\[\[(Beijing|Berlin|Paris|Hong\sKong|London|Melbourne|Mexico\sCity|Moscow|New\sDelhi|Rome|Shanghai|Sydney|Tokyo)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(Chicago|Detroit|Los\sAngeles|Miami|New\sYork\sCity|San\sFrancisco|Washington\,?\sD\.?C\.?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(California|Florida|Hawai.?i|New\sYork|Texas)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(Paris, France)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(London, England)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:Los Angeles|San\sDiego|San\sFrancisco), (?:California|CA))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:(?:Los Angeles|San\sDiego|San\sFrancisco)(?:,\sCalifornia|,\sCA|))\|([^\]]{1,30})\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:New York City)\|([^\]]{3,30})\]\]/gi, '$1');
// txt.value=txt.value.replace(/(\[\[Vancouver)\]\], \[\[(British Columbia\]\])/gi, '$1, $2');
txt.value=txt.value.replace(/\[\[Sydney(?:\,\sNew South Wales|\,\sAustralia|)\|([^\]]{1,30})\]\]/gi, '$1');
//continents and regions
txt.value=txt.value.replace(/\[\[(Arctic\sOcean|Atlantic\sOcean|Indian\sOcean|Pacific|Pacific\sOcean)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:Asia|Africa|Americas?|Antartica|Europe|Australia|Oceania|Asia-Pacific|(?:Middle|Far) East)(?:a?n|ern|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:north-?(?:west|east|)|south-?(?:west|east|)|east|west|central)(?:ern | )(?:Asia|Africa|America|Atlantic|Europe|Australia|Oceania|Pacific|United States|Canada|China|Russia))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(Latin America)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:Asia|Africa|America|Arabia|Europe|Australia|Oceania|Asia-Pacific|(?:Middle|Far) East)\|([^\]]*)\]\]/gi, '$1');
// Country and language; city
txt.value=txt.value.replace(/\[\[(area|cit(?:y center|y centre|ies|y)|countr(?:y|ies)|count(?:y|ies)|district|parish|province|region|rural|suburb|town(?:ship|)|urban(?: area|)|village)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:rural|urban)(?: area|i[sz]ation|)\|((?:rural|urban)(i[sz]ed?|i[sz]ation|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[List of (?:countries|U.S. states)\|(country|states?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:US|U\.S\.) states?\|(state)\]\]/gi, '$1');
//top 7
txt.value=txt.value.replace(/\[\[(British|(?:People's Republic of |)China|Chinese|England|English|France|French|Germany?|Great\sBritain|Japan|Japanese|Spain|Spanish|United\sKingdom|U\.K\.|UK|United\sStates(\sof\sAmerica|)|US|U\.S\.|USA|U\.S\.A\.)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:(?:People's Republic of |)China|England|France|Germany|Great\sBritain|Japan|Spain|United\sKingdom|U\.K\.|UK|United\sStates(?:\sof\sAmerica|)|US|U\.S\.|USA|U\.S\.A\.)\|(British|Chinese|English|French|German|Japanese|Spanish|American|US)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:United\sStates(?:\sof\sAmerica|))\|(US|U\.S\.|USA|U\.S\.A\.)\]\]/gi, 'US');
txt.value=txt.value.replace(/\[\[(?:United\sKingdom(?:\sof\sGreat Britain and Northern Ireland|))\|(U\.K\.|UK)\]\]/gi, 'UK');
txt.value=txt.value.replace(/\[\[(?:Chinese|English|French|German|British|Japanese|Spanish|United\sKingdom|U\.K\.|UK|American)\s\(?(?:language|people)\)?\|([^\]]*)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:Chinese|English|French|German|British|Japanese|Spanish|American)\slanguage)\]\]/gi, '$1'); //unpiped
//time and seasons
txt.value=txt.value.replace(/\[\[Present\s\(time\)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(da[iy]|month|night|season(?:al|)|hour|minute|present|second|morning|afternoon|midnight|noon|week|year|decade|century)([ -]?end|ly|s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[((Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)days?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:(?:Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day)\|(Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)(\.|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(spring|summer|winter|autumn|fall)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[spring\s\(season\)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[autumn\|(fall)\]\]/gi, '$1');
// months
txt.value=txt.value.replace(/\[\[(Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.?|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:January|February|March|April|May|June|July|August|September|October|November|December)\|([^\]]{1,30})\]\]/gi, '$1');
// simple words and numbers
txt.value=txt.value.replace(/\[\[(\d{1,3}(,\d{3})*)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[([a-oq-z]\w[s\.]?)\]\]/g, '$1');
// proper nouns
txt.value=txt.value.replace(/\[\[(public holiday)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[Christmas\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(Christmas|Easter|Labour|May)( day| eve|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(New year('s day|'s eve|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:Broadway|West End)(\sTheatre|)|Hollywood|Hollywood, California)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:Broadway|West End) theatre\|(Broadway|West End)\]\]/g, '$1');
// people general, professions
txt.value=txt.value.replace(/\[\[(activis[mt]|arranger|art(?:ist|)|athlete|athletics|author|(?:auto|)biography|camera|cinema|civil\sserv(?:ant|ice)|comedian|composer|conducting|conductor|consul(?:ate|ar|tant|)|criminal|critic|cultur(?:e|al)|dance[rs]?|dancing|dentist|designer|dj|dis[ck] jockey|drawing|drummer|editor|editors?-in-chief|educator|embassy|fishing|group|guest star|hacker|journalis[mt]|librar(?:ian|ie|y)|mayor|model|music(?:al(?: theatre|theater|)|ian|)|multi-instrumentalist|offic(?:e|er|ial)|paint(?:er|ing|)|piano|pianist|photograph(?:er|y|)|playwright|police|politic(?:s|al|ian)|porn star|producer|professor|professional|prostitut(?:e|ion)|pseudonym|publisher|radio|(?:record )company|sailor|scien(?:ce|tist)|screen[ -]?writer|sculpt(?:or|ure)|soldier|solicitor|singer.songwriter|song|songwriter|songwriting|toy|tradition|trumpet|trumpeter|waiter|writ(?:er|ing))(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(baker|grocer)(ies|y|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(cable |satellite |terrestrial |)(tv|television)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(clothing|clothe?|cotton|leather|silk|nylon|dress|tailor|(?:neck|)tie|shirt|jacket|trouser|shoe|suit)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(captain|major|general|lieutenant|private(?: \(rank\)|))(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[musical theatre\|(music(?:al(?: theatre|theater|)s?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(beauty (?:competition|contest|pageant|queen))(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(game|contest|contestant|question|answer)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:paint|writ)ing\|(painter|writer)\]\]/gi, '$1');
//business & legal
txt.value=txt.value.replace(/\[\[(attorney|business(?:m[ae]n|person|e?)|CEO|chief executive officer|chair(?:m[ae]n|person)|director|entrepreneur|executive|judge|law|lawyer|legal|president|tax|taxation)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[businessperson\|(businessm[ae]n)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:private(?:ly held|) |public |listed |quoted |)(?:company|corporation))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:private(?:ly held|) |public |listed |quoted )company)\|(private|public|listed|quoted)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(chair \(official\)|chairman)\|(chair[^\]]*?)\]\]/gi, 'Chairman');
txt.value=txt.value.replace(/\[\[chief (?:executive|financial|operating) officer\|(C[EFO]O|C\.[EFO]\.O\.|chief executive)\]\]/gi, '$1');
// buildings structure and environment
txt.value=txt.value.replace(/\[\[(bath|bathroom|ceiling|fixture|fitting|kitchen|shower|toilet|wall)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(airport|architect(?:ure|)|churche?|fa[cç]ade|furniture|garden(?:ing|)|hospital|home|hotel|hous(?:e|ing)|museum|neighbou?rhood|park|roof|shop(?:ping mall|ping arcade|)|stadium|skyscraper|interior design(?:er|))(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[church \(building\)\|(church)(es|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(brick|building|composite|cement|concrete|environment|foundation|glass|steel|structure|wood)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(dam|port|bridge|metro( station|)|reservoir|road|street|traffic|tunnel|underground|(?:high|free|motor)way)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(central business district|down[ -]?town)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[central business district\|(CBD)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:bus|metro|railway|tube|underground)(?: stop| station)\|(station)\]\]/gi, '$1');
// txt.value=txt.value.replace(/\[\[(foobar)(s|)\]\]/gi, '$1$2');
// earth science nouns
txt.value=txt.value.replace(/\[\[(animal|insect|plant)(s|)\]\](?![ai])/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(fruit|meat|timber|livestock|milk|dairy(?: produce)|vegetables?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(fish|sheep|(?:hu|wo|)m[ae]n)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(bird|bull|cat|chicken|dog|cow|pig|horse|pet|lion|tiger|elephant|giraffe)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(beach|cave|earthquake|forest|hill|island|lagoon|land|lake|mountain|ocean|pond|river|sea|stream|tree)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(automobile|bicycle|boat|car|ferry|engine|motor(?:cycle)|ship|truck|tyre|van|wheel)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(equipment|instrument|machine|tool)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(breakfast|lunch|dinner|supper|food|beverage|biscuit|dessert|tea|chocolate|coffee|juice|apple|banana|carrot|lemon|pear|potatoe?|tomatoe?|onion|pork|beef|poultry)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(solid|liquid|gase?)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(name|number|word|letter|sentence)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(metal|min(?:ing|e|eral)|chrom(?:ium|e)|gold|iron|iron ore|nickel|alumin(?:a|i?um)|copper|diamond|mineral sands|coal|lead||oil|natural gas|silver)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(blog|(?:e-?|)mail|computer|personal\scomputer|PC|laptop|laptop\scomputer|(?:cell|cellular|mobile|portable|tele) ?phone|MP3(?: player|)|SMS|digital audio player|(?:computer |)(?:application|hardware|program|software|technology)|(?:computer |video |)game)(s|)\]\]/gi, '$1$2');
// economy
txt.value=txt.value.replace(/\[\[(bank(?:er|ing|s|)|capital|cargo|contracts?|(?:un|)employ(?:e[der]s?|ment)|finance|GDP|gross domestic product|inflation|insurance|investors?|joint ventures?|money|per capita(?: income|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[gross domestic product\|(GDP)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(alcohol|assault|club|colou?r|(?:television |tv |)commercial|confectionery|cosmetic|crime|down[ -]?town|electricity|fire|flower|gas(?:oline|)|heating|histor(?:ical|ian|y)|institute|Internet|inventor|job|magazine|mosque|(?:news|)paper|publicity||organi[sz](?:e|ation)|party|petrol|plastic|(?:air |)pollution|product|salary|school|smog|subsidiary|supermarket|synthesi[sz]er|synagog(?:ue|)|television|television network|temple|textile|theater|theatre|time(?:line|)|touris[mt]|wage|water|website)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(advertis(?:ing|ement)|brand|consumer|logo|market(?:ing|)|sign(?:age|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(agriculture|horticulture|meat|beef|pork|cereal|corn|lettuce|wheat|maize|rice|sugar|tobacco)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[orange \((?:colou?r|fruit)\)\|(oranges?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:tele|)communic(?:ation|ate))(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(airline|transport(?:ation|)|train|tram|)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(trad(e|ing)|shipping|railway|railroad)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[rail transport\|(rail|railways?|railroad)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[retailing\|(retail(?:er|ing|)|(?:retail |)shop)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[economics\|(economics?|economists?|economical)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[statistics\|(statistics?|statisticians?|statistical)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((economi|statisti)(cs?|cians?|sts?|cal))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(profit(?:able|ability|s|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((im|ex)(port(?:er|)s?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(factor(?:y|ies)|manufactur(?:er?|ing))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(coal min(e[rs]?|ing))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(farm(er|s|ing|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[farming\|(farm(er|s|ing|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[history\|(histor(?:ical|ian|ies|y))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(NGO|non-?(?:governmental|profit)(\sorgani[sz]ations?|))(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(charitable\sorgani[sz]ations?|charit(?:ies|y))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[non-?profit\sorgani[sz]ation\|(non-?profit\sorgani[sz]ations?|non-profit)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[non-?(?:governmental|profit)\sorgani[sz]ation\|(non-?(?:governmental|profit)\sorgani[sz]ation|NGO)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:charity \(practice\)|charitable\sorgani[sz]ation)\|(charitable\sorgani[sz]ations?|charit(?:able|ies|y))\]\]/gi, '$1');
// weather and climate
txt.value=txt.value.replace(/\[\[(cloud|ecolog(?:ical|ists?|y)|rain(?:fall|)|snow|storm|weather)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[ecology\|(ecologists?|ecological)\]\]/gi, '$1');
// measurements and perception
txt.value=txt.value.replace(/\[\[(add|addition|average|difference|mean|sum|total)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(acre|foot|feet|hectare|inch(?:es|)|in.|yard|(?:kilo|)(?:lit|met)(?:er|re)s?|(?:kilo|)gram|mile|pound)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(square.)(feet|inches|(kilo|)met(er|re)s)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:centi|kilo|milli|)met(?:er|re)(?:s|)\|([ckm]?m)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(?:centi|deci|hecto|milli|)lit(?:er|re)(?:s|)\|([cdHm]?l)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(stereo|mono)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[[Ss]tereophonic sound\|[Ss](tereo)\]\]/g, 'stereo');
txt.value=txt.value.replace(/\[\[monaural\|(mono)\]\]/gi, '$1');
// colours
// txt.value=txt.value.replace(/\[\[(royal.|navy.)(blue)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(light.|dark.|)(beige|black|brown|blue|crimson|gr[ae]y|green|maroon|orange|pink|purple|red|violet|white|yellow)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(royal.|navy.)(blue)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[[^\(\[\]]* \(colou?r\)\|([^\]]*)\]\]/gi, '$1');
// geo-politics
txt.value=txt.value.replace(/\[\[(emperor|empress|empire|imperial|monarchy?|king(?:dom|)|queen|prince(?:ess|)|(?:prime |)minister|members? of parliament|MP|general secretary|secretary(?: of state|)|govern(?:or|ment))(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:monarchy?|sovereign)\|(king(?:dom|)|queen)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[member of parliament\|(MP)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[Western world\|((?:The |)West(?:ern|erner|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:cabinet|minister) \(government\)\|(cabinet|minister)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:Illegal drug trade|drug traffic(?:king|))\|([^\]]*)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[capital (?:city|\(political\))\|(capital)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(north|south|east|west|left|rights?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(air.force|appeal|assassinat(?:ion|ed?)|bribe(?:ry|)|census|constitution|corruption|coup(?: d['’][ée]tat|)|crop|currenc(?:y|ie)|defection|dollar|drug|(?:general |)election|espionage|(?:central |local |municipal |)government|heroin|marine|coal|oil|parliament|petroleum|people|population(?: density|)|political party|(?:political |economic |super|)power|liberal|(?:capital|commun|fasc|liberal|national|social)is[mt]|republic|revolution|war|worker|world|pound|yen|yuan|euro)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(arm|colon|democrac|ecolog|econom|industr|militar|monarch|monopol|nav)(ies|y)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:colony|colonialism)\|(colon(?:ial|ialism|ies|y))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:capital|commun|fasc|liberal|national|social)ism\|((?:capital|commun|fasc|liberal|national|social)ists?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[political (?:corruption|party)\|(corrupt(?:ion|)|party)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[People of the United States\|(American)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:USA?|United States(?: of America|)|U\.S\.)\|([^\]]{8})\]\]/gi, 'US');
txt.value=txt.value.replace(/\[\[(USD|US$|U\.?S\.? dollars?|United States dollars?)\|([^\]]+?)\]\]/gi, 'US$');
txt.value=txt.value.replace(/\[\[((US|United States|U\.S\.)\sdollar|USD|US\$|\$)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:United Nations|UN|U\.N\.|UNO|U\.N\.O\.)\]\] \[\[(?:United Nations|U.N.) (General Assembly|Secretar(?:iat|y General)|Security Council)\]\]/g, '[[UN $1]]');
txt.value=txt.value.replace(/\[\[United Nations\|(UN|U\.N\.|UNO|U\.N\.O\.)\]\]/g, 'UN');
txt.value=txt.value.replace(/\[\[(United Nations|UN|U\.N\.|UNO|U\.N\.O\.)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(?:World War I|World War II)\|(World War One|World War Two|First World War|Second World War|WWII?|The Great War)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(?:World War I|World War II)\|(first|second)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(World War I|World War II|World War One|World War Two|First World War|Second World War|WWI|WWII)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[Olympic Games\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((summer |winter |)olympic(s|\sgames))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[European\sUnion\|(EU|E\.U\.)\]\]/g, 'EU');
txt.value=txt.value.replace(/\[\[(European\sUnion|EU|E\.U\.)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(President of the United States|United States President|U\.?S\.?\sPresident|President of the United States of America|United States President|POTUS)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[President of the United States\|([^\]]{5,30})\]\]/gi, '$1');
//sociology, race & education
txt.value=txt.value.replace(/\[\[(Mrs?|Dr|Rev|Sir)\.?\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(academic|class(?:room|)|campuse?|teacher|headmaster|student)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/(?:\[\[)(freshman)(?:\]\]) year/gi, 'first year');
txt.value=txt.value.replace(/(?:\[\[)(sophomore)(?:\]\]) year/gi, 'second year');
txt.value=txt.value.replace(/\[\[(educat(?:e[ds]?|ion|ional)|health[ -]?care|philanthrop(y|ic|ist))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(boy|girl|adolescen(?:ce|t)|teen(?:ager|)|sibling)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(foster[ -]?|god[ -]?|grand[ -]?|step[ -]?|)(family|father|mother|parent|sister|brother|sibling|husband|wife|son|daughter|cousin|child|children)(s|)\]\]/gi, '$1$2$3');
txt.value=txt.value.replace(/\[\[(father|mother|parent|sister|brother|son|daughter|cousin)(s|)(-in-law)\]\]/gi, '$1$2$3');
txt.value=txt.value.replace(/\[\[adolescence\|(adolescen(?:ce|t)|teen(?:ager|s|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((great[ -]?|)(aunt|uncle|niece|nephew)(s|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(African.Americans?)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[((fashion|gay|pop)\sicons?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[Native Americans in the United States\|(Native Americans?)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[professional [\w]*?\|(professional)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(celebrity|billionaire|class|conservati(sm|ve)|conservation(ist|)|poor|poverty(?: line|)|rich|millionaire|socialite)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(societ(al|y|ies))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(middle|social|upper|working)(.class)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(centrist|moderate|radical|extremist)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(left|right)(.wing(e[dr]|))\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(center|centre|extreme|far)(.)(left|right)\]\]/gi, '$1$2$3');
txt.value=txt.value.replace(/\[\[(?:social class)\|(middle|social|upper|working)(.class|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:social class)\|(class)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((elementary|high(?:er|)|nursery|primary|secondary|tertiary)\s(schools?|education)|certificate|under-?graduate|Bachelor of Arts|Bachelor of Sciences?|Doctor of Philosophy|college|diplomas?|doctorates?|universit(?:ies|y)|post-?graduate|Master['’]?s degree|honorary degree|Oxford University|Cambridge University)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[B\.?(A|S|Sc)\.?\]\]/gi, 'B$1');
txt.value=txt.value.replace(/\[\[Ph\.? ?D\.?\]\]/gi, 'PhD');
txt.value=txt.value.replace(/\[\[(?:(university|master\'?s|graduate|bachelor\'?s|post-?graduate|postgrad)\sdegree)\|degree\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:Bachelor of Arts|Bachelor of Sciences?|Bachelor[\'’]?s degree|Doctor of Philosophy|Master[\'’]?s degree|Master of Arts|Master of Sciences?)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:honoris causa)\|(honorary( degree|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(research(?:er|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[([^\]]{1,26})\,\s(Cambridge|Oxford|London)(\sUniversity|)\|([^\]]{1,26})\]\]\,?\s\[\[(Cambridge|Oxford|London)(\sUniversity|)\]\]/g, '[[$1, $2]]');
txt.value=txt.value.replace(/\[\[([^\]]{1,26})\,\s(Cambridge|Oxford|London)\|([^\]]{1,26})\]\]\,?\s(Cambridge|Oxford|London)(\sUniversity|)/g, '[[$1, $2]]');
txt.value=txt.value.replace(/\[\[(University of (Oxford|Cambridge)|Oxford University|Cambridge University)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(?:University of (?:Oxford|Cambridge))\|(Oxford|Oxford University|Cambridge|Cambridge University)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(Harvard|Yale)\]\]/g, '$1');
txt.value=txt.value.replace(/\[\[(?:Harvard|Harvard University|Yale|Yale University)\|((Harvard |Yale)|University of (Harvard |Yale))\]\]/g, '$1');
// lifestyle & religion
txt.value=txt.value.replace(/\[\[(alcohol(?:ic beverage|)|bar|beer|bread|brew(?:ery|ing|)|caf[eé]|cake|cheese|fast food|fat|nutrition|restaurant|smoking|wine)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[bar \((?:counter|establishment)\)\|(bar)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[tourism\|(touris[mt])\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(bible|clergy|clergym[ae]n|pastor|priest)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(alcohol(?:ism|ic|)|anniversary|birthday|exercise|gays?|god|homosexual|jesus|multi-?cultural|racis[mt]|religion|religious|travel|vegetarians?|vegetarianism)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[multiculturalism\|(multicultural)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[vegetarianism\|(vegetarians?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[christianity\|(christians?|christianity|christian\sethic|christian\sfaith)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(christianity|christians?|christian\sethic|christian\sfaith)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:roman\s|)catholic(?:\schurch|ism|)\|((?:roman\s|)catholic(?:\schurch|ism|s?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((catholic|protestant)(ism|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:roman\s|)catholic(?:\schurch|ism|s?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:jews|judaism)\|(jews?|jewish|judaism)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(jews?|jewish|judaism)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(birth|pregnancy|rape)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:marriage|divorce)\|([^\]]{1,15})\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:married and |)maiden names?\|(née)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(marriage(?: licen[cs]e| certificate|)|marry|marries|married|married\scouples?|maiden name|née|wedding)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(divorce[des]?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(burial|cemetery|funeral|grave(?:yard|)|memorial)(s|)\]\]/gi, '$1$2');
// biology, medical, crime
txt.value=txt.value.replace(/\[\[(male|female|doctor|nurse|patient|physician|volunteer)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(blood|skin)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(ankle|arm|brain|chest|elbow|ear|eye|face|finger|hand|hair|head|knee|leg|mouth|nose|pupil|throat|thumb|toe|waist|wrist)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(bacteri(?:um|a)|blind(?:ness|)|death|disease|epidemic|fung(?:us|i)|health|medication|medicine|viruse?)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[blindness\|(blind)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(arson|burglar(?:y|ie)|drug trafficking|forger(?:y|ie)|murder|robber(?:y|ie)|shooting|theft)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(arrest|trial|[bj]ail|execution|firing squad)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[Capital punishment\|(death(?: penalty|)|execut(?:ions?|ed?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[traffic\scollision\|(automobile\saccident|car\saccident|car\scrash|road\straffic\saccident|traffic\saccident)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(traffic\scollision|automobile\saccident|car\saccident|car\scrash|road\straffic\saccident|traffic\saccident)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(AIDS|HIV|bleed(?:ing|)|brain (damage|tumour)|(breast |lung |throat |)cancer|(?:clinical\s|)depression|coma|cough|fever|fractures?|(?:drug |)overdose|gunshot wounds?|headache|cardiac arrest|heart attack|injur(?:y|ies)|shock|stroke|suicide|surgery|vomit(?:ing|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:clinical\sdepression|depression\s\(mood\))\|(depression|depressed)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(clinical\sdepression|depression\s\(mood\)|depression|depressed)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[myocardial infarction\|(heart attack|cardiac arrest)\]\]/gi, '$1');
//music & media
txt.value=txt.value.replace(/\[\[((print |published |mass |broadcast |news |)media)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:media \(communication\)|print media|published media|mass media|broadcast media|news media|news media \(United States\))\|((mass.|)media)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(porn|pron|pornograph(y|ic))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[pornographic actor\|((porn |)(actors?|actress(es|)|stars?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[play \(theatre\)\|(plays?|theatrical|thesbian)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[act(?:ing|or)\|([^\[\]]*)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(actor|actresse?|movie.star|thesbian|(?:title|lead|leading) role)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[model\s\((?:art|person)\)\|(model|modell?ing)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[dis[ck]\sjockey\|([^\]]{1,15})\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[spin-off \(media\)\|(spin[ -]?off)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(animation|animated film|anim.|chat|chat.show|comedy|documentar(y|ies)|drama|entertainment|episode|pen.name|game.show|live.action|new|play|plot|prime[ -]?time|reality(?: show| tv| television)|science.fiction|sci-fi|soap|soap opera|sit.?com|situation comedy|stage|spin[ -]?off|stage.name|talk.show|variety show)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(([^\s:\|]*?)[\s-]documentary)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(documentary\s([\w]*?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(([^\s:\|]*?)[\s-]documentary\s([\w]*?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:documentary film|documentary \(film\)|documentary)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:Serial \(radio and television\)|serial)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((television|tv) (films?|movies?|pilots?|programs?|series|shows?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(pilot( episode|))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:Television pilot|Pilot \(television episode\))\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((radio|tv|television) (hosts?|personality|presenters?|stations?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:radio|tv|television) (?:hosts?|personality|presenters?|stations?)\|(hosts?|personalit(ies|y)|presenters?|stations?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(([^\W\s:\]]*?)[\s-]drama)\]\]/gi, '$1');
txt.value=txt.value.replace(/(\[\[)(Drama\s[Pp]refecture\]\])/g, '$1:$2');
txt.value=txt.value.replace(/\[\[(drama\s([\w]*?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(([^\W\s:\]]*?)[\s-]drama\s([\w]*?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:drama|dramatic programming)\|(drama series|drama films?|tv drama|television drama)\]\]/gi, '$1');
// rem piped music & media
txt.value=txt.value.replace(/\[\[animat(?:ion|ed|ed film)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:documentary|documentary film)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:sitcom|situation comedy)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:television\sprogram|tv program)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:talk|chat).show\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[([^\W\s:\]]*?\s?)(television series|television film?|television show?|tv series|television\sprogram|tv program|television\ssitcom|tv sitcom)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:television series|television film?|television show?|tv series|television\sprogram|tv program|television\ssitcom|tv sitcom)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:reality\stelevision|reality\sshow|reality\stv)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:rock\smusic|rock\s\(music\))\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[pop\smusic\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:singing|singer)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(soundtrack)(\salbum|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[solo \(music\)\|(solo)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(audio ?tape|cassette|DVD|LP|VHS|video|music video|compact\sdis[ck]|CD|C\.D\.|Compact Disc single|C\. D\. single|CD single)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[compact\sdis[ck]\|(?:CD|C\.D\.)(s|)\]\]/gi, 'CD$1');
txt.value=txt.value.replace(/\[\[(CDROM)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(albums?|album track|albums? \(music\)|record albums?)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:debut |double |live |music |record |self.titled debut |sophomore |studio |)album)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[((music|radio|recording|tv|television) studio)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:(?:music|radio|recording|tv|television) studio)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(Facebook|MTV|MySpace|Twitter|You\s?Tube)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(singing|singer|vocal|vocalist|Pop\ssinger|Female\svocals|Songstress|Clean\svocals|Singer\s\(music\)|Pop\ssinger)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(lead\svocalist|lead\svocals|lead\ssinger|front.m[ae]n)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(backing\svocalist|backing\svocals|backing\ssinger)(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/\[\[(?:(?:backing\s|lead\s|)(?:singer|vocalist|vocals))\|((?:backing\s|lead\s|)(?:singer|vocal(ist|))s?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(rock\smusic|rock|rock\smusician|rock\sgroup|rock\sstandard|rawk|rock\ssong|rock\santhem|rockmusic)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(pop\smusic|pop|pop\smusicians?|pop\sgroups?|pop\ssongs?|pop\smusic|pop\s\(music\)|popmusic|pop\smusic\s\(genre\)|new\spop)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:band\s\(music\)|group\s\(music\)|musical\sensemble)\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(musical\sensemble|group|band|rock\sbands?|Instrumental\sensemble|Rock\sgroups?|list\sof\smusical\sensembles|musical\sgroup|music\sband|music\sgroup|musical\sband|bar\sband|group\s\(music\)|musical\sensembles?|music\sensemble|band\s\(music\)|pop\sband)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(guitars?|guitarists?|guitar music|blues guitar|electric guitar|lead\sguitars?|rhythm\sguitars?|rock guitar)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:bass\s|electric\s|lead\s|rhythm\s|)guitar\|([^\]]+?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(bass|bassist|bass guitarists?|electric\sbass|metal\sbass|bass\s\(guitar\)|electric\sbass\sguitar|Alternate\sbass|bass\sguitars?|electric\sbass\sguitar|fretless\sbass\sguitar|base\sguitar|bass\sguitar\s\(instrument\))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[keyboard\sinstrument\|(keyboards?|keyboardists?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(keyboard\sinstruments?|keyboards?|keyboardists?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[drum ?kit\|(drums?|drumkits?|drumming|drummers?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(drum ?kit|drums?|drumkits?|drumming|drummers?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[percussion\sinstrument\|(percussions?|percussionists?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(percussion\sinstrument|percussions?|percussionists?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[wind\sinstrument\|(wind\sinstruments?|wind)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(wind\sinstruments?|wind)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[woodwind\sinstrument\|(woodwind\sinstruments?|woodwind)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(woodwind\sinstruments?|woodwind)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[violin\|(violinists?|violins?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(violins?|violinists?|violin music)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[cello\|(cellists?|cellos?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(cellos?|cellists?|cello music)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[fashion\sdesign\|(fashion\sdesigner|designers?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(fashion|fashion\sdesign|fashion\sdesigners?|designers?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(box office|concert)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[film\|(films?|filming|movies?|big\sscreen|motion pictures?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(films?|filming|movies?|big\sscreen|motion pictures?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[film\sdirector\|(film\sdirector|director)\]\]/gi, '$1');
// txt.value=txt.value.replace(/\[\[Television\sdirector\|(television\sdirector|tv director|director)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:film|television|tv|music|record|stage)\sdirect(?:ors?|ion)\|((film |television |tv |stage |music |record |)directors?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[music\sarranger\|(music\sarranger|arranger)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(music\sarranger|music\sarranger|arranger)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(film\sdirector|director)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((film|television|tv|theat(er|re|rical)|music|radio|record).(directors?|producers?|production|studios?))\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:executive|film|music|television|tv|radio|record)\sproducer\|(produc(er|tion))\]\]/gi, '$1');
// literary
txt.value=txt.value.replace(/\[\[poetry\|(poe[mt]s?|poetic)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(poetry|poe[mt]s?|poetic)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[hardcover\|(hard ?back|hard ?cover)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[((?:hard|paper)(?:back|cover))(s|)\]\]/gi, '$1$2');
txt.value=txt.value.replace(/Print \(Hard(back|cover) (&|and) Paperback\)/gi, 'Print (hardback & paperback)');
txt.value=txt.value.replace(/Print \(Hard(back|cover)\)/gi, 'Print (hard$1)');
txt.value=txt.value.replace(/\[\[(books?|essay|essayists?|non.fiction|humou?rist|novella|literature|fiction|screenplay|magazine|novels?|historical novels?|novell?ist|short story|comedy|comics?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[essay\|(essays?|essayists?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[comedy\|(comedy|comedies|comics?|comedians?|comediennes?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:novel|novella)\|(novels?|novellas?|novell?ists?)\]\]/gi, '$1');
// sport
txt.value=txt.value.replace(/\[(football \(soccer\)|soccer)\|/gi, '[association football|');
txt.value=txt.value.replace(/\[\[(athlete|athletics|badminton|baseball|basketball|football(ers?|\splayers?|)|golf|gymnast(ics|)|hiking|hunting|martial arts|run(ning|ners?|)|sailing|soccer|sports?|swimming|swimmer|table tennis|track and field|volleyball)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:track and field|athletics \(sport\))\|(track|field|athlet(?:ic|e)s?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(?:human swimming|swimming \(sport\))\|(swimming|swimmer|sw[aiu]ms?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[tennis\|(tennis|tennis\scourts?|tennis players?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(tennis|tennis\scourts?|tennis players?|grass courts?|clay courts?|hard courts?|grand\sslam)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[The Championships, Wimbledon\|(Wimbledon|Wimbledon championships?)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(The Championships, Wimbledon|Wimbledon|Wimbledon championships?)\]\]/gi, '$1');
// txt.value=txt.value.replace(/\[\[US Open\s\(tennis\)\|(U\.?S\.?\sOpen)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[Grand Slam\s\(tennis\)\|(Grand Slam)\]\]/gi, '$1');
txt.value=txt.value.replace(/\[\[(U\.?S\.?\sOpen|French Open|Australian Open)\]\]/gi, '$1');
}
function Ohc_COMMON() {
Ohc_CommonTerms();
Ohc_COMMON_edit_summary();
}
function Ohc_COMMON_edit_summary(){
// Add a tag to the summary box
var txt=document.editform.wpSummary;
var summary = "per [[wp:overlinking|overlinking]]";
if (txt.value.indexOf(summary) == -1) {
if (txt.value.match(/[^\*\/\s][^\/\s]?\s*$/)) {
txt.value += ", ";
}
txt.value += summary;
}
document.forms.editform.wpMinoredit.checked = true;
document.editform.wpDiff.click();
}
addOnloadHook(function () {
if(document.forms.editform) {
addPortletLink('p-tb', 'javascript:Ohc_COMMON()', 'Blues test', 't-commonterms', 'Removes links to common terms', '', '');
}
});