User:WOSlinkerBot/linttask14.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/linttask14. |
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 class\=\"plainlinks\"\>)\n(The First WikiConference India is being organized in Mumbai and will take place on 18-20 November 2011\.\<br\> You can see our )\[http\:\/\/meta\.wikimedia\.org\/wiki\/WikiConference_India_2011 Official website\](\, the \[http\:\/\/www\.facebook\.com\/event\.php\?eid\=183138458406482 Facebook event\] and our \[https\:\/\/spreadsheets\.google\.com\/spreadsheet\/viewform\?hl\=en_US\&formkey\=dGNxSzAxUndoOHRGamdDSTFMVGNrd3c6MA\#gid\=0 Scholarship form\]\.)(\n\nBut the activities start now with the )\[http\:\/\/meta\.wikimedia\.org\/wiki\/WikiConference_India_2011\/Wiki_Outreach 100 day long WikiOutreach\]\.\n\<\/span\>/g,'$1$2[[m:WikiConference_India_2011|Official website]]$3</span>$4[[m:WikiConference_India_2011/Wiki_Outreach|100 day long WikiOutreach]].');
myContent = myContent.replace(/(\:\#E3F0F4\" \>\n)(\{\| style\=\"border\:1px black solid\; padding\:2em\; border-collapse\:collapse\; width\:100\%\;\"\n)\|-\n(\[\[File\:WCI_banner\.png\|800px\|center\|link\=\:meta\:WikiConference_India_2011\]\]\<br\/\>\n)/g,'$1$3$2');
if(document.getElementById('wpTextbox1').value != myContent) {
if(document.getElementById('wpTextbox1').value != myContent) {
document.getElementById('wpTextbox1').value=myContent;
document.getElementById('wpSummary').value='Fix [[Special:LintErrors/html5-misnesting|lint errors]] with span';
document.getElementById('wpMinoredit').checked = true;
}
}
}
)}