User:Ohconfucius/script/flagcruft.js: Difference between revisions

Content deleted Content added
incorrect register
+ohc_flagwimbledon2
Line 296:
}
 
function ohc_flagwimbledonohc_flagwimbledon1(){
var txt=document.editform.wpTextbox1;
Line 305:
regex(/(\| ?RD[2-4]-team\d\d?=\'{0,3}){{flagicon\|(?:[^}]+)}} ?([^\n>{}]+<br ?\/?>)&nbsp;{{flagicon\|([^}]+)}} ?/gi, '$1$2'); //rem flag from table of all but first round
regex(/(\| ?RD[2-4]-team\d\d=\'{0,3}){{flagicon\|(?:[^}]+)}} ?/gi, '$1'); //rem flag from table of all but first round
regex(/{{flagicon\|([^}]+)}} ?(\'{0,3}\[\[(?:[^\]]+)\]\])/gi, '{{flagathlete|$2|$1}}'); //using template with country identifier (for Wimbledon articles)
 
// regex(/((?:country) *= *)\{\{flag\|([^\{\}]*)\}\} ?/gi, '$1$2');
 
}
 
function ohc_flagwimbledon2(){
var txt=document.editform.wpTextbox1;
//rem linking templates
 
regex(/(\'{0,3}){{nowrap\| ?({{flagicon\|([^}]+)}}[^\n]+)}}(?=\n)/gi, '$1$2'); //using template with country identifier (for Wimbledon articles)
regex(/{{nowrap\| ?(\'{0,3})({{flagicon\|([^}]+)}}[^\n]+)}}(?=\n)/gi, '$1$2'); //using template with country identifier (for Wimbledon articles)
regex(/(\| ?RD[3-4]-team\d\d?=\'{0,3}){{flagicon\|(?:[^}]+)}} ?([^\n>{}]+<br ?\/?>)&nbsp;{{flagicon\|([^}]+)}} ?/gi, '$1$2'); //rem flag from table of all but first round
regex(/(\| ?RD[3-4]-team\d\d=\'{0,3}){{flagicon\|(?:[^}]+)}} ?/gi, '$1'); //rem flag from table of all but first round
regex(/{{flagicon\|([^}]+)}} ?(\'{0,3}\[\[(?:[^\]]+)\]\])/gi, '{{flagathlete|$2|$1}}'); //using template with country identifier (for Wimbledon articles)
 
Line 329 ⟶ 344:
if(document.forms.editform) {
addPortletLink('p-tb', 'javascript:ohc_flagcruft_driver()', 'FLAGCRUFT', 'cruft', 'cruft', '', '');
addPortletLink('p-tb', 'javascript:ohc_flagwimbledonohc_flagwimbledon1()', 'FLAGWIMBLEDON', 'use template with country identifier', 'cruft', '', '');
addPortletLink('p-tb', 'javascript:ohc_flagwimbledon2()', 'FLAGWIMBLEDON', 'use template with country identifier', 'cruft', '', '');
addPortletLink('p-tb', 'javascript:Ohc_flag_to_country()', 'FLAG->COUNTRY', 'cruft', 'cruft', '', '');