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(/\n\{\|(\n\*Check out some of these pages\:\n)/gi,'$1');
myContent = myContent.replace(/(\|Things to work on at Wikipedia\]\])\n\|\}(\n*\*If you have a question)/gi,'$1$2');
myContent = myContent.replace(/(\|Manual of Style\]\])\n\|\}(\n*\*If you have a question)/gi,'$1$2');
myContent = myContent.replace(/\nv(\{\{Episode list\n)/gi,'$1');
myContent = myContent.replace(/\
(\ Created by \[\[Sahibdin\]\] and nominated for Featured Media by \{\{noping\|TheMandarin\}\} \<\/small\>)\<\/table\>/gi,'$1');
myContent = myContent.replace(/\
\\(WikiProject India)\<\/center\>\<\/font\>\<\/span\>/gi,'$1');
myContent = myContent.replace(/(opt-out of future mailings\.<\/small>\}\}\n<\/div>\n)<\/div>(--\[\[User\:MediaWiki message delivery\|MediaWiki message delivery\]\])/gi,'$1$2');
myContent = myContent.replace(/\
(\ Created by \{\{noping\|Bellus Delphina\}\} \<\/small\>)\<\/table\>/gi,'$1');
myContent = myContent.replace(/\
\\(WikiProject India)\<\/font\>\<\/span\>\<\/center\>/gi,'$1');
myContent = myContent.replace(/(\=\= You are Invited to Bangla Wikipedia Photography Contest 2014\! \=\=\n*)\{\| width\=\"100\%\" cellpadding\=\"2\" cellspacing\=\"5\"\n(\
myContent = myContent.replace(/(\(UTC\)\<\/small\>\n)\|\}\n(\<\/div\>\n)/gi,'$1$2');
myContent = myContent.replace(/\
\n(\ \
\{\{underline\|\'\'\'\I\<\/big\>CHTHUS\'\'\'\}\}\<\/p\>\<\/div\>\n)\<\/table\>/gi,'$1');
myContent = myContent.replace(/\
\n(\\n\\{\{underline\|\'\'\'\I\<\/big\>CHTHUS\'\'\'\}\}\<\/p\>\<\/span\>\<\/center\>\n)\<\/table\>/gi,'$1');
myContent = myContent.replace(/(which drives a wedge into the world of false assurances\.\")(
\n)(~ \[\[Jacques Ellul\]\]\'\'\'<\/div>)/gi,'$1\'\'\'$2\'\'\'$3');
myContent = myContent.replace(/(and may it be sprinkled with love and friendship\.\'\')(
\n\'\'\'\'\'Best Wishes\!)/gi,'$1\'\'\'$2');
myContent = myContent.replace(/\{\| \|- \|\n(\[\[File\:Nuvola apps edu mathematics blue-p\.svg)/gi,'{|\n|$1');
myContent = myContent.replace(/(\)\n(\\=\=References\=\=\<\/nowiki\>)(\n\
\n)(\\{\{Reflist\}\}\<\/nowiki\>)\n(\<\/code\>)/gi,'$1$2$5$3$1$4$5');
myContent = myContent.replace(/(\)\n(\\{\{Refbegin\}\}\<\/nowiki\>)(\n\
\n)(\\*Press paste \(Ctrl\+V or Apple\+V\) after this asterisk, then remove the \[\<\/ref\> tags\<\/nowiki\>)\n\]
\n(\\{\{Refend\}\}\<\/nowiki\>)\n(\<\/code\>)\}\}/gi,'$1$2$6$3$1$4$6$3$1$5$6\n}}');
if(document.getElementById('wpTextbox1').value != myContent) {
if(document.getElementById('wpTextbox1').value != myContent) {
document.getElementById('wpTextbox1').value=myContent;
document.getElementById('wpSummary').value='Fix fostered content lint errors';
document.getElementById('wpMinoredit').checked = true;
}
}
}
)}