User:WOSlinkerBot/linttask18.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/linttask18. |
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\=\"color\:blue\"\>\n\:\<center\>([\w\d •,]*)\<\/center\>\<\/span\>/gi,'<center style="color:blue">$1</center>');
myContent = myContent.replace(/\<sub\>\[\[User\:Thehotwheelsguy99\/Guestbook\|Sign\!\!\<\/sub\>\]\]/g,'<sub>[[User:Thehotwheelsguy99/Guestbook|Sign!!]]</sub>');
myContent = myContent.replace(/\<sup\>\[\[User talk\: ASDFGH \|talk\?\<\/sup\>\]\]/g,'<sup>[[User talk: ASDFGH |talk?]]</sup>');
myContent = myContent.replace(/\<span( style\=\"font-size\: 92\%\; line-height\: 1\.2em\;\>\n\* Czech Republic\:)/g,'<div $1');
myContent = myContent.replace(/\<span( style\=\"font-size\: 92\%\; line-height\: 1\.2em\;\>\n\* Albania\:)/g,'<div $1');
myContent = myContent.replace(/\<span( style\=\"font-size\: 92\%\; line-height\: 1\.2em\;\>\n\* Australia\:)/g,'<div $1');
myContent = myContent.replace(/(\* United States\: \[\[2018 National Women\'s Soccer League season\]\] started Mar 24 *\n)\<\/span\>/g,'$1</div>');
myContent = myContent.replace(/(\* Wales\: \[\[2017-18 Welsh Premier Women\'s Football League\]\] ends May 18 *\n)\<\/span\>/g,'$1</div>');
myContent = myContent.replace(/(\* United States\: \[\[20\d\d National Women\'s Soccer League season\]\] *\n)\<\/span\>/g,'$1</div>');
myContent = myContent.replace(/(\<span style\=\"font-size\: 92\%\; line-height\: 1em\;\>)\n(\[\[WP\:GNG\]\] takes precedence over \[\[WP\:NFOOTY\]\])/g,'$1$2');
myContent = myContent.replace(/\[\[Commons\:User\:ShakataGaNai\|\<span style\=\"color\:\#8B0000\"\>\'\'\'S\'\'\'hakata\'\'\'\<\/span\>\<span style\=\"color\:\#006400\"\>G\'\'\'a\<\/span\>\<span style\=\"color\:\#00008B\"\>\'\'\'N\'\'\'ai\<\/span\>\]\]/g,'[[Commons:User:ShakataGaNai|<span style="color:#8B0000">\'\'\'S\'\'\'hakata</span><span style="color:#006400">\'\'\'G\'\'\'a</span><span style="color:#00008B">\'\'\'N\'\'\'ai</span>]]');
myContent = myContent.replace(/(\<sup\> \[\[User talk\:Barberio\|talk\]\]\, \[\[Special\:Contributions\/Barberio\|contribs\]\] )\<\/sub\>/g,'$1</sup>');
myContent = myContent.replace(/\<span style\=\"font-family\: Trebuchet MS\"\>\[\[User talk\:Seadog\.M\.S\|\<font color\=\"Mediumblue\"\>\'\'\'Seadog\'\'\'\]\] \<\/font\>/g,'[[User talk:Seadog.M.S|<span style="font-family:Trebuchet MS;color:Mediumblue;">\'\'\'Seadog\'\'\'</span>]]');
myContent = myContent.replace(/\<font face\=\"Nasalization\" color\=\"\#003300\"\>\[\[User\:Tennekis\|Tennekis\]\]\<\/font\>/g,'[[User:Tennekis|<span style="font-family:Nasalization;color:#003300;">Tennekis</span>]]');
myContent = myContent.replace(/\<sup\>\[\[User talk\:Tennekis\|\(rant\)\<\/sup\>\]\]/g,'<sup>[[User talk:Tennekis|(rant)]]</sup>');
myContent = myContent.replace(/\<font color\=\"black\"\>\'\'\'\[\[User\:Ed\!\|Ed\!\]\]\<\/font\>\<sup\>\<font color\=\"black\"\>\[\[User talk\:Ed\!\|\(talk\)\]\]\'\'\'\<\/font\>\<\/sup\>/g,'\'\'\'[[User:Ed!|<span style="color:black">Ed!</span>]]<sup>[[User talk:Ed!|<span style="color:black">(talk)</span>]]</sup>\'\'\'');
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;
}
}
}
)}