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

Content deleted Content added
m syntax error
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 317:
setreason('More appropriate flag', 'appendonce');
}
function Ohc_US_states_driver(){
//Add a tag to the summary box
// regex(/(\|[ ]*)(\{\{\s*[Ff]lag(?:icon|)\|(?:[^{}]+|)\}\})[ ]*(\{\{\s*flag(?:icon|)\|(?:[^{}]+|)\}\})[ ]*(\[\[[-–'é\w ]+\|)((?:1\d\d|20[0-2])\d\]\])/gi, '$1$4$2/$3 $5'); // curing Easter egg
// regex(/(\{\{\s*[Ff]lag(?:icon|)\|(?:[^{}]+|)\}\})[ ]*((?:\'\'\'?|)\[\[[-–'é\w ]+\|)((?:1\d\d|20[0-2])\d\]\])/gi, '$2$1 $3'); // curing Easter egg
regex(/{{[Ff]lagicon\|([^}(|]+)(?: \((?:U\. ?S\. |US |)state\)(?:\|\d+|))}}\s*(\'{0,3})\s*(?:\[\[[^\]]+\]\])\s*(\'{0,3})/gi, '$2$1$3'); //using template for List of presidential trips
regex(/\{\{Flag\|[^|]+\|(?:\s*name=\s*)([^\}]+)\}\}/gi, '$1');
regex(/\{\{Flagicon\|[^}(|]+(?:\|\d+|)\}\}\s*(\'{0,3})\s*\[\[([\w\s]+)\]\]\s*(\'{0,3})/gi, '$1$2$3');
regex(/\{\{(?:[Ff]lag(?:country|u?)\|\s*([^{}|]*)(?:\|\d{4}|))\}\}/gi, '$1');
 
regex(/\{\{(?:[Ff]lag(?:country|u?)\|\s*([^{}|]*)(?:\|\d{4}|))\}\}/gi, '$1');
// regex(/\{\{(?:[Ff]lag(?:country|u?)\|\s*([^{}|]*))\}\}/
//
// \{\{Flagicon\|[^\}]+(?:\|\d+|)\}\}\s*(\'{0,3})\s*\[\[([^{}'|]*\||)([\w\s]+)\]\]\s*(\'{0,3})
// \{\{Flagicon\|[^}(|]+(?:\|\d+|)\}\}\s*(\'{0,3})\s*\[\[Georgia \(U.S. state\)\|(Georgia)\]\]''
regex(/\[\[(Mar-a-Lago)\]\]/gi, '$1');
regex(/\[\[(?:(?:West |)Palm Beach), Florida\|([A-Za-z\s]+)\]\]/gi, '$1');
setreason('per [[MOS:FLAGRELEVANCE]]', 'appendonce');
}
 
function ohc_strip_flagicon(){
//Add a tag to the summary box
regex(/\{\{(?:[Ff]lag(?: ?icon)\|\s*([^{}|]*)(?:\|\d{4}|))\}\}\s*/gi, '');
regex(/(\! width=)550(\|Details)/gi, '$1700$2');
 
setreason('per [[MOS:FLAGRELEVANCE]]', 'appendonce');
}
 
function ohc_flagcruft_driver(){
//Add a tag to the summary box
Line 326 ⟶ 353:
if(document.forms.editform) {
mw.util.addPortletLink('p-tb', 'javascript:ohc_flagcruft_driver()', 'FLAGCRUFT', 'cruft', 'cruft', '', '');
// mw.util.addPortletLink('p-tb', 'javascript:ohc_flagwimbledon1Ohc_US_states_driver()', 'FLAGWIMBLEDONFLAGRELEVANCE', 'use template with country identifierflagcruft_states', 'cruft', '', '');
// mw.util.addPortletLink('p-tb', 'javascript:ohc_flagwimbledon2ohc_strip_flagicon()', 'FLAGWIMBLEDONNoFLAGICON', 'use template with country identifierflagcruft_states', 'cruft', '', '');
 
mw.util.addPortletLink('p-tb', 'javascript:Ohc_flag_to_country()', 'FLAG->COUNTRY', 'cruft', 'cruft', '', '');
mw.util.addPortletLink('p-tb', 'javascript:Ohc_flagicon_to_flagathlete()', 'FLAGICON->FLAGATHLETE', 'cruft', 'cruft', '', '');