User:WOSlinkerBot/linttask19.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:WOSlinkerBot/linttask19. |
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(/(\<span style\=\"font-family\: Verdana\"\>\[\[User\:Seadog\.M\.S\|\<font color\=\"Mediumblue\"\>\'\'\'Seadog\'\'\')(\]\]\<sup\>\[\[User talk\:Seadog\.M\.S\|Talk\]\]\<\/sup\>) *(\<\/font\>)/g,'$1$3$2');
myContent = myContent.replace(/(\<span style\=\"font-family\: Verdana\"\>\[\[User\:Seadog\.M\.S\|\<font color\=\"Mediumblue\"\>\'\'\'Seadog\'\'\'\<\/font\>\]\]\<sup\>\[\[User talk\:Seadog\.M\.S\|Talk\]\]\<\/sup\>)( \d\d\:\d\d)/g,'$1</span>$2');
myContent = myContent.replace(/(\<sup\> \[\[User\:Daisy18108\/Guestbook\|\<font color\=\"red\"\>Sign my Guestbook\!\<\/font\>)(\<\/sup\>)(\]\])/g,'$1$3$2');
myContent = myContent.replace(/(\Thank[ \w]*\. \<\!-- Template\:Huggle\/warn-\w*-\d --\>\<\!-- Template\:uw-\w*\d --\>\[\[User\:Donner60\|Donner60\]\] \(\[\[User talk\:Donner60\|talk\]\]\) \d\d\:\d\d\, \d* \w* \d\d\d\d\ \(UTC\))\n\:(\'\'If this is a \[\[Network address translation\|shared IP address\]\]\, and you did not make the edits\, consider \[\[Wikipedia\:Why create an account\?\|creating an account\]\] for yourself so you can avoid further irrelevant notices\.\'\'\<\!-- Template\:Shared IP advice --\>\<\/del\>)/g,'$1</del>\n:<del>$2');
myContent = myContent.replace(/(\Thank[ \w]*\. \<\!-- Template\:Huggle\/warn-\w*-\d --\>\<\!-- Template\:uw-\w*\d --\>\[\[User\:Donner60\|Donner60\]\] \(\[\[User talk\:Donner60\|talk\]\]\) \d\d\:\d\d\, \d* \w* \d\d\d\d\ \(UTC\))\n\:(\'\'If this is a \[\[Network address translation\|shared IP address\]\]\, and you did not make the edits\, consider \[\[Wikipedia\:Why create an account\?\|creating an account\]\] for yourself or \[\[Special\:UserLogin\|logging in with an existing account\]\] so you can avoid further irrelevant notices\.\'\'\<\!-- Template\:Shared IP advice --\>\<\/del\>)/g,'$1</del>\n:<del>$2');
myContent = myContent.replace(/\<sub\>\[\[Special\:Contributions\/Demi\|C\]\]\<\/sup\>/g,'<sub>[[Special:Contributions/Demi|C]]</sub>');
myContent = myContent.replace(/\<sup\>\[\[Ricers\|lol\<\/sup\>\]\]/g,'<sup>[[Ricers|lol]]</sup>');
myContent = myContent.replace(/\<sup\>\[\[User talk\:Why sigh\, cutie pie\?\|Refill\<\/sup\>\]\]/g,'<sup>[[User talk:Why sigh, cutie pie?|Refill]]</sup>');
myContent = myContent.replace(/\<sup\>\[\[User\:Empyrycal\|E\<\/sup\>\]\]/g,'<sup>[[User:Empyrycal|E]]</sup>');
myContent = myContent.replace(/(\<span style\=\"font-weight\: regular\; text-align\:center\; font-size\:14px\; font-family\: \'Helvetica Neue\'\, Helvetica\, Arial\, sans-serif\; display\:block\; width\:1000px\"\>)\n(\<center\>\n)(This monthly newsletter showcases the Wikipedia Education Program\. It focuses on sharing\: your ideas\, stories\, success and challenges\. Be sure to check out the \[\[outreach\:Education\/Newsletter\/\w*_\d*\|full version\]\]\, and \[\[Outreach\:Education\/Newsletter\/Archives\|past editions\]\]\. You can also volunteer to help publish the newsletter\. \[\[Outreach\:Education\/News\/Team\|Join the team\!\]\]\<\/span\>\n\<\/center\>)/g,'$2$1$3');
myContent = myContent.replace(/(\<center\>\n\<span style\=\"color\:white\; font-size\:24px\; font-family\:times new roman\; display\:block\; background\:\#339966\; width\:800px\;\"\>)\n(\{\{anchor\|back\}\} *)\n(\In This Issue) *(\n\<\/center\>)/g,'$1$2$3</span>$4');
myContent = myContent.replace(/(\|\<span style\=\"font-size\:16px\; font-family\:times new roman\"\>)\n\n(\[\[Outreach\:Education\/Newsletter\/\w* \d*\/Mobile Learning Week 2017\|Mobile Learning Week 2017\]\])\n(\<\/span\>\n)\<\/span\>\n/g,'$1$2$3');
myContent = myContent.replace(/(\<center\>\<span style\=\"font-family\: Arial\; font-size\: 12pt\"\>\<font size\=\"18\"\>\'\'\'\[\[Wikipedia\:WikiProject Nigeria\]\]\'\'\')(\<\/center\>)(\<\/font\>\<\/span\>)/g,'$1$3$2');
myContent = myContent.replace(/(\<u\>\'\'Welcoming New Volunteers\'\' \<\/u\>) \'\'\n/g,'$1\n');
myContent = myContent.replace(/(\<sup\>\[\[User_talk\:Bloodpack\| \<font color\=\"red\"\> \'\'argh\!\'\' \<\/font\>)(\<\/sup\>)(\]\])/g,'$1$3$2');
myContent = myContent.replace(/(\<div class\=\"user-block\"\>\[\[Image\:Stop_x_nuvola\.svg\|left\|35px\]\])\<span style\=\"font-size\: 105\%\;\"\>(Your account has been \'\'\'blocked indefinitely\'\'\' from editing Wikipedia because your username)/g,'$1$2');
myContent = myContent.replace(/(\<sup\>\[\[User talk\:methecooldude\|T\]\])\n/g,'$1</sup>\n');
myContent = myContent.replace(/(\<sup\>\'\'\[\[Special:Contributions\/Journalist\|C\.\]\]\/\[\[User talk\:Journalist\|Holla \@ me\]\]\'\')\<sup\>/g,'$1</sup>');
myContent = myContent.replace(/(\<sup\>\'\'\' \'\'\[\[Special\:Contributions\/Journalist\|\<sup\>\<span style\=\"color\:lime\"\>C\.\]\]\[\[Image\:Smilie\.gif\|30px\]\] \[\[User talk\:Journalist\|\<sup\>\<span style\=\"color\:lightseagreen\"\> Holla \@ me\!\]\]\'\' \'\'\')\<sup\>/g,'$1</sup>');
myContent = myContent.replace(/\{\{col-begin\}\}\n\n(\'\'Welcome\!\'\'\ \;My name is \[\[User\:)/g,'$1');
myContent = myContent.replace(/(\(UTC\)\n)\{\{col-end\}\}\n\<\/div\>\n(\|-\n\<\!-- ROW 1 --\>\n\<\!-- LEFT COLUMN --\>)/g,'$1$2');
myContent = myContent.replace(/\<span style\=\"cursor\:crosshair\;color\:green\"\>\n(\*\'\'\'\[\[Wikipedia)/g,'$1');
myContent = myContent.replace(/\]\](\<\/font\> \<sub\>)(\(spell my name backwards\)\'\'\' at\<\/sub\>)/g,']]\'\'\'$1\'\'\'$2');
myContent = myContent.replace(/(\[\[User_talk\:Fusionmix\|\<span style\=\"padding\:0px\;\"\>\<font style\=\"color\:\#000000\;background\:white\;\"\>\'\'\'It\'\'\'\<\/font\>)(\]\])/g,'$1</span>$2');
myContent = myContent.replace(/(\]\]\<span style\=\"padding\:0px\;\"\>\<font style\=\"color\:white\;background\:\#000000\;\"\>\'\'\'Up\'\'\'\<\/font\>\<\/span\>)(\<\/small\>)/g,'$1</span>$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/html5-misnesting|lint errors]]';
document.getElementById('wpMinoredit').checked = true;
}
}
}
)}