User:WOSlinker/testing.js

$('.editHelp').click(function {       var myContent = document.getElementById('wpTextbox1').value; /*        myContent = myContent.replace(/\n\\n\{\| *\n\|\- *\n/gi,'\n{| style="margin:1em auto; text-align:center;"\n');        myContent = myContent.replace(/\n\\n\{\| *\n/gi,'\n{| style="margin:1em auto; text-align:center;"\n');        myContent = myContent.replace(/\n\\n\{\| class\=\"wikitable\"*\n/gi,'\n{| class="wikitable" style="margin:1em auto; text-align:center;"\n');        myContent = myContent.replace(/\n\{\| *class\=\"wikitable\"*\n/gi,'\n{| class="wikitable" style="margin:1em auto; text-align:center;"\n');

myContent = myContent.replace(/\n\| *align\=center *\|/gi,'\n|'); myContent = myContent.replace(/\n\| *align\=\"center\" *\|/gi,'\n|'); myContent = myContent.replace(/(\n\| *colspan\=\d*) *align\=center *\|/gi,'$1|'); myContent = myContent.replace(/(\n\| *colspan\=\"\d*\") *align\=\"center\" *\|/gi,'$1|'); myContent = myContent.replace(/(\n\| *colspan\=\"\d*\") *style\=\"text-align\:center\;?\" *\|/gi,'$1|');

myContent = myContent.replace(/\n\|\- *align\=\"center\" *(bgcolor\=\")([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\") *\n/gi,'\n|- $1#$2\n'); myContent = myContent.replace(/\n\|\- *align\=\"center\" *(bgcolor\=\"\#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\") *\n/gi,'\n|- $1\n');

myContent = myContent.replace(/\n\|\- *align\=center *\n/gi,'\n|-\n');

myContent = myContent.replace(/\n\ *\n/gi,'\n'); myContent = myContent.replace(/\n\<\/center\> *\n/gi,'\n');

myContent = myContent.replace(/\/gi,''); myContent = myContent.replace(/\<\/center\>/gi,''); /*       myContent = myContent.replace(/\{\{col-start\}\}/gi,''); myContent = myContent.replace(/\{\{col-begin\}\}/gi,''); myContent = myContent.replace(/\{\{col-begin\|width\=\d*\%\}\}/gi,''); myContent = myContent.replace(/\{\{col-begin\|width\=auto\}\}/gi,''); myContent = myContent.replace(/\{\{col-begin-small\}\}/gi,''); myContent = myContent.replace(/\{\{col end\}\}/gi,''); myContent = myContent.replace(/\{\{col-end\}\}/gi,''); myContent = myContent.replace(/\n\{\{col-\d-of-\d\}\} *\n/gi,'\n'); myContent = myContent.replace(/\n\{\{col-break\}\} *\n/gi,'\n'); myContent = myContent.replace(/\n\{\{col-break\|width\=\d*\%\}\}\n/gi,'\n'); myContent = myContent.replace(/\n\{\{col-break\|gap\=[\d\w]*\}\}\n/gi,'\n'); myContent = myContent.replace(/\n\{\{col-\d\}\}\n/gi,'\n'); myContent = myContent.replace(/\{\{col-\d\}\}/gi,''); myContent = myContent.replace(/\{\{col-break\}\}/gi,''); myContent = myContent.replace(/\[\[User\:Monsieurdl\|\\\'\'\'Monsieur\dl\'\'\'\<\/font\>\<\/font\>\<\/font\>\<\/span\>\]\]/g,' \'\'\'Monsieur dl \'\'\' '); myContent = myContent.replace(/(\\[\[User talk\:Monsieurdl\|mon talk\]\]-\[\[Special\:Contributions\/Monsieurdl\|mon contribs\]\])\n(\<\/sup\>)/g,'$1$2');

if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value=myContent; document.getElementById('wpSummary').value='fix lint issues'; document.getElementById('wpMinoredit').checked = true; }

})