function lint_queryString(p) {
var re = RegExp('[&?]' + p + '=([^&]*)');
var matches;
if (matches = re.exec(document.location)) {
try {
return decodeURI(matches[1]);
} catch (e) { }
}
return null;
}
//Add a 'lint edit' tab
if(mw.config.get('wgArticleId') != 0 ) {
$( function lintEditButton() {
mw.util.addPortletLink('p-cactions',
mw.util.getUrl(null,{action:'edit',lintedit:true}),
'lint',
'p-lint',
'lint edit');
}
)}
if(mw.config.get('wgAction') == 'edit' && lint_queryString('lintedit') == 'true') {
$(function lint() {
var myContent = document.getElementById('wpTextbox1').value;
myContent = myContent.replace(/(\'\'\')(\<center\>\<u\>)([1-9]* new members\!\'\'\'\<\/u\>\<\/center\>)/g,'$2$1$3');
myContent = myContent.replace(/(\<big\>)\n(\'\'\'The \[\[Wikipedia\:WikiCup\|WikiCup\]\] Newsletter\'\'\'\<\/big\>)/g,'$1$2');
myContent = myContent.replace(/(\<big\>)\n(\'\'\'The \[\[User\:Garden\/WikiCup\|WikiCup\]\] Newsletter\'\'\'\<\/big\>)/g,'$1$2');
myContent = myContent.replace(/(\[\[User_talk\:IMatthew\|\<span style\=\"font-family\:Century Gothic\;color\:\#007BA7\"\>\<sup\>talk\<\/sup\>)(\]\])/g,'$1</span>$2');
myContent = myContent.replace(/(and \[\[User\:Thehelpfulone\|\<font color\=\"red\"\>\'\'\'The\'\'\'\<\/font\>\]\]\[\[User_talk\:Thehelpfulone\|\<font color\=\"black\"\> \'\'\'Helpful\'\'\'\<\/font\>\]\]\[\[Special\:Contributions\/Thehelpfulone\|\<font color\=\"red\"\> \'\'\'One\'\'\'\<\/font\>\]\]) *\<\/span\>\<\/font\>/g,'$1');
myContent = myContent.replace(/(\[\[Special\:Contributions\/Mufka\|\<sup\>\(c\))(\]\])(\<\/sup\>)/g,'$1$3$2');
myContent = myContent.replace(/\[\[Wikipedia\:Esperanza\|\<font color\=\"green\"\>E\]\]\<\/font\>/g,'[[Wikipedia:Esperanza|<span style="color:green">E</span>]]');
myContent = myContent.replace(/\[\[Wikipedia\:Esperanza\|\<font color\=\"green\"\>e\]\]\<\/font\>/g,'[[Wikipedia:Esperanza|<span style="color:green">e</span>]]');
myContent = myContent.replace(/\[\[Wikipedia\:Esperanza\|\<font color\=\"green\"\>\'\'\'e\'\'\'\]\]\<\/font\>/g,'[[Wikipedia:Esperanza|<span style="color:green">\'\'\'e\'\'\'</span>]]');
myContent = myContent.replace(/(\[\[User\:DBZROCKS\|\<font color\=\"orange\"\>\'\'\'\'\'DBZROCKS\'\'\'\'\')(\]\])(\<\/font\>)/g,'$1$3$2');
myContent = myContent.replace(/\[\[User\:Master_son\|\<span style\=\"font-variant\: small-caps\; color\:\#006600\;\"\>\'\'\'master\<\/span\>\<span style\=\"font-variant\: small-caps\; color\: \#aca607\;\"\> son\'\'\'\<\/span\>\]\]/g,'[[User:Master_son|\'\'\'\<span style="font-variant: small-caps; color:#006600;">master</span><span style="font-variant: small-caps; color: #aca607;"> son</span>\'\'\'\]]');
myContent = myContent.replace(/(\'\'\'\[\[User\:Martinphi\|\<span style\=\"color\:\#6c4408\;border\:1px dashed \#6c4408\;padding\:1px\;background\:\#ffffff\;\"\>Martin\<sup\>phi\<\/sup\>)(\]\]\'\'\')(\<\/span\>)/g,'$1$3$2');
myContent = myContent.replace(/(\[\[Special\:Contributions\/Two_Hearted_River\|\<font color\=\"firebrick\"\>fish)(\]\])(\<\/font\>)/g,'$1$3$2');
myContent = myContent.replace(/\<span style\=\"background\:\#006B54\; padding\:2px\"\>\'\'\'\[\[User\:Dough4872\|\<font color\=\"white\"\>Dough\<\/font\>\]\]\<\/span\>\<span style\=\"background\: \#FFD200\; padding\:2px\"\>\[\[User talk\:Dough4872\|\<font color\=\"black\"\>4872\<\/font\>\]\]\'\'\'\<\/span\>/g,'\'\'\'<span style="background:#006B54; padding:2px">[[User:Dough4872|<font color="white">Dough</font>]]</span><span style="background: #FFD200; padding:2px">[[User talk:Dough4872|<font color="black">4872</font>]]</span>\'\'\'');
myContent = myContent.replace(/(\<sub\>\[\[User talk\:FrB\.TG\|\<font color\=\"\#6E7F80\"\>talk\<\/font\>\]\])(\'\'\')(\<\/sub\>)/g,'$1$3$2');
myContent = myContent.replace(/(\[\[User\:Victor Lopes\|\<span style\=\"color\:black\"\>\'\'\'Victão Lopes\'\'\')(\]\])(\<\/span\>)/g,'$1$3$2');
myContent = myContent.replace(/(\[\[User talk\:Flyguy649\|\<sup\>talk)(\]\])(\<\/sup\>)/g,'$1$3$2');
myContent = myContent.replace(/(\[\[Special\:Contributions\/Flyguy649\|\<sub\>contribs)(\]\])(\<\/sub\>)/g,'$1$3$2');
myContent = myContent.replace(/(\'\'\'\'\'\[\[User\:TLSuda\|\<span style\=\"color\:\#886699\"\>TLSuda)(\]\]\'\'\'\'\')(\<\/span\>)/g,'$1$3$2');
myContent = myContent.replace(/(\'\'\[\[User\:JL 09\|\<span style\=\"color\:\#0070FF\;cursor\:move\;\"\>JL 09)(\]\]\'\')(\<\/span\>)/g,'$1$3$2');
myContent = myContent.replace(/(\<sub\>\'\'\[\[Special\:Contributions\/JL_09\|\<sub style\=\"color\:\#177245\;cursor\:help\;\"\>c\<\/sub\>\]\])(\<\/sub\>)(\'\')/g,'$1$3$2');
myContent = myContent.replace(/\[\[User\:Cliff smith\|\<font color\=\"blue\"\>\'\'\'\<font face\=\"georgia\"\>Cliff\'\'\' smith\<\/font\>\<\/font\>\]\]/g,'[[User:Cliff smith|<span style="color:blue;font-family:georgia;">\'\'\'Cliff\'\'\' smith</span>]]');
myContent = myContent.replace(/\[\[User talk\:Cliff smith\|\'\'\<font color\=\"black\"\>\<sup\>talk\<\/sup\>\<\/font\>\'\'\]\]/g,'[[User talk:Cliff smith|\'\'<sup style="color:black;">talk</sup>\'\']]');
myContent = myContent.replace(/(\<span style\=\"white-space\:nowrap\;\"\>)(\'\'\')(\~ \[ \[\[User\:ScottMHoward\|\<font color\=\"\#004400\"\>Scott M\. Howard\<\/font\>\]\] \] \~ \<\/span\>\<span style\=\"white-space\:nowrap\;\"\>\[ \[\[User talk\:ScottMHoward\|\<font color\=\"\#004400\"\>Talk\<\/font\>\]\] \]\:\[ \[\[Special\:Contributions\/ScottMHoward\|\<font color\=\"\#004400\"\>Contribs\<\/font\>\]\] \] \~)(\'\'\')(\<\/span\>)/g,'$2$1$3$5$4');
myContent = myContent.replace(/\[\[User\:Spinningspark\|\<font style\=\"background\:\#FFF090\;color\:\#00C000\"\>\'\'\'Sp\<font style\=\"background\:\#FFF0A0\;color\:\#80C000\"\>in\<font style\=\"color\:\#C08000\"\>ni\<\/font\>\<\/font\>\<font style\=\"color\:\#C00000\"\>ng\<\/font\>\<\/font\>\<font style\=\"color\:\#2820F0\"\>Spark\'\'\'\<\/font\>\]\]/g,'[[User:Spinningspark|\'\'\'<span style="background:#FFF090;color:#00C000">Sp<span style="background:#FFF0A0;color:#80C000">in<span style="color:#C08000">ni</span></span><span style="color:#C00000">ng</span></span><span style="color:#2820F0">Spark</span>\'\'\']]');
myContent = myContent.replace(/\[\[User\:Spinningspark\|\<font style\=\"background\:\#FFF090\;color\:\#00C000\"\>\'\'\'Sp\<font style\=\"background\:\#FFF0A0\;color\:\#80C000\"\>in\<font style\=\"color\:\#C08000\"\>ni\<\/font\>\<\/font\>\<font style\=\"color\:\#C00000\"\>ng\<\/font\>\<\/font\>\<font style\=\"color\:\#2820F0\"\>Spark\<\/font\>\'\'\'\]\]/g,'[[User:Spinningspark|\'\'\'<span style="background:#FFF090;color:#00C000">Sp<span style="background:#FFF0A0;color:#80C000">in<span style="color:#C08000">ni</span></span><span style="color:#C00000">ng</span></span><span style="color:#2820F0">Spark</span>\'\'\']]');
myContent = myContent.replace(/\[\[User\:Nordic Dragon\|\<font color\=\"White\"\>\'\'\'Nordic\'\'\'\]\]\<\/font\>/g,'[[User:Nordic Dragon|<span style="color:White">\'\'\'Nordic\'\'\'</span>]]');
myContent = myContent.replace(/\[\[User talk\:Nordic Dragon\|\<font color\=\"Black\"\>\'\'\'Dragon\'\'\'\]\]\<\/font\>/g,'[[User talk:Nordic Dragon|<span style="color:Black">\'\'\'Dragon\'\'\'</span>]]');
myContent = myContent.replace(/(\:\'\'The above discussion is preserved as an archive of the debate\. )\<font color\=red\>(\'\'\'Please do not modify it\.\'\'\')\<\/font\>( Subsequent comments should be made on the appropriate discussion page \(such as the article\'s talk page or in a \[\[Wikipedia\:Deletion review\|deletion review\]\]\)\. No further edits should be made to this page\.)(\<\/div\>)/g,'$1<span style="color:red\">$2</span>$3\'\'$4');
myContent = myContent.replace(/(\:\'\'The above discussion is preserved as an archive of the debate\. \<span style\=\"color\:red\"\>\'\'\'Please do not modify it\.\'\'\'\<\/span\> Subsequent comments should be made on the appropriate discussion page \(such as the \w*\'s talk page or in a \[\[Wikipedia\:Deletion review\|deletion review\]\]\)\. No further edits should be made to this page\.)(\<\/div\>)/g,'$1\'\'$2');
myContent = myContent.replace(/(\:\'\'The above discussion is preserved as an archive of the debate\. \<span style\=\"color\:red\"\>\'\'\'Please do not modify it\.\'\'\'\<\/span\> Subsequent comments should be made on the appropriate discussion page \(such as the \w*\'s \[\[Help\:Using talk pages\|talk page\]\] or in a \[\[Wikipedia\:Deletion review\|deletion review\]\]\)\. No further edits should be made to this page\.)(\<\/div\>)/g,'$1\'\'$2');
myContent = myContent.replace(/(\:\'\'The above discussion is preserved as an archive of the debate\. \<span style\=\"color\:red\"\>\'\'\'Please do not modify it\.\'\'\'\<\/span\> Subsequent comments should be made on the appropriate discussion page \(such as the article\'s talk page or in a \[\[Wikipedia\:Deletion review\|deletion review\]\]\)\. No further edits should be made to this page\.)( \<\!\-\-Template\:Afd bottom\-\-\>\<\/div\>)/g,'$1\'\'$2');
myContent = myContent.replace(/(\:\'\'The above discussion is preserved as an archive of the debate\. \<span style\=\"color\:red\"\>\'\'\'Please do not modify it\.\'\'\'\<\/span\> Subsequent comments should be made on the appropriate discussion page \(such as the article\'s \[\[Help\:Using talk pages\|talk page\]\] or in a \[\[Wikipedia\:Deletion review\|deletion review\]\]\)\. No further edits should be made to this page\.)( \<\!\-\-Template\:Afd bottom\-\-\>\<\/div\>)/g,'$1\'\'$2');
myContent = myContent.replace(/(\:\'\'The above discussion is preserved as an archive of the debate\. *\<span style\=\"color\:red\"\>\'\'\'Please do not modify it\.\'\'\'\<\/span\> No further edits should be made to this page\.)( \<\!\-\-Template\:Afd bottom\-\-\>\<\/div\>)/g,'$1\'\'$2');
if(document.getElementById('wpTextbox1').value != myContent) {
if(document.getElementById('wpTextbox1').value != myContent) {
document.getElementById('wpTextbox1').value=myContent;
document.getElementById('wpSummary').value='Fix misnested tag [[Special:LintErrors/misnested-tag|lint errors]]';
document.getElementById('wpMinoredit').checked = true;
}
}
}
)}