User:AndonicO/monobook.js
From Wikipedia, the free encyclopedia
If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
// Begin [[User:Lupin/popups.js]] script document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); function inc (file) { var lt = String.fromCharCode(60); var gt = String.fromCharCode(62); if (file.indexOf(".js") > -1) { document.writeln(lt+'script type="text/javascript" src="/w/index.php?title='+file+'&action=raw&ctype=text/javascript&dontcountme=s"'+gt+lt+'/script'+gt); } else if (file.indexOf(".css") > -1) { document.writeln(lt+'link rel="stylesheet" type="text/css" href="/w/index.php?title='+file+'&action=raw&ctype=text/css" /'+gt); } } // End Lupin/popups.js script // Begin script var tfawpajax; // From [[WP:US]] mainpage (wpajax renamed to tfawpajax) tfawpajax={ download:function(bundle) { // mandatory: bundle.url // optional: bundle.onSuccess (xmlhttprequest, bundle) // optional: bundle.onFailure (xmlhttprequest, bundle) // optional: bundle.otherStuff OK too, passed to onSuccess and onFailure var x = window.XMLHttpRequest ? new XMLHttpRequest() : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false; if (x) { x.onreadystatechange=function() { x.readyState==4 && tfawpajax.downloadComplete(x,bundle); }; x.open("GET",bundle.url,true); x.send(null); } return x; }, downloadComplete:function(x,bundle) { x.status==200 && ( bundle.onSuccess && bundle.onSuccess(x,bundle) || true ) || ( bundle.onFailure && bundle.onFailure(x,bundle) || alert(x.statusText + ': ' + bundle.url)); } }; // Example: // function dlComplete(xmlreq, data) { // alert(data.message + xmlreq.responseText); // } // tfawpajax.download({url:'http://en.wikipedia.org/w/index.php?title=Thresher&action=raw', // onSuccess: dlComplete, message: "Here's what we got:\n\n" }); // End of [[WP:US]] quote function WatchTFA(xmlreq, data) { var tfaname=xmlreq.responseText.match(/\[\[([^[]*)\|more\.\.\.\]\]/)[1]; location.href='http://en.wikipedia.org/w/index.php?title='+encodeURI(tfaname)+'&action=watch'; } function IdentifyTFA() { var d=new Date(); var mn=new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); tfawpajax.download({url:'http://en.wikipedia.org/w/index.php?title='+ 'Wikipedia:Today%27s_featured_article/'+mn[d.getMonth()]+ '_'+d.getDate()+'%2C_2007&action=raw',onSuccess:WatchTFA}); } addOnloadHook(function(){ addPortletLink('p-tb','javascript:IdentifyTFA()','Watch TFA','t-watchtfa', "Watch today's Featured Article",'',null); }); // End script // Begin [[User:AndyZ/peerreviewer.js]] script document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:AndyZ/peerreviewer.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></s'+'cript>'); function inc (file) { var lt = String.fromCharCode(60); var gt = String.fromCharCode(62); document.writeln(lt+'script type="text/javascript" src="/w/index.php?title='+file+'&action=raw&ctype=text/javascript&dontcountme=s"'+gt+lt+'/script'+gt); } // End AndyZ/peerreviewer.js script // Begin script inc("User:Lightdarkness/aiv.js"); // End script // Begin [[User:Steel359/protection.js]] script // <pre><nowiki> importScript('User:Steel359/^demon.js'); function addLink(where, url, name, id, title, key, after) { // addLink() accepts either an id or a DOM node, addPortletLink() only takes a node if (after && !after.cloneNode) after = document.getElementById(after); return addPortletLink(where, url, name, id, title, key, after); } if (document.title.indexOf("Editing Wikipedia:Requests for page protection (section)") != -1) { function fullprot_tag() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|p}} ~~" + "~~"; f.wpSummary.value += "Protected. "; } // Break function fullprotexp_tag() { var expfull = prompt( "The page protection will expire in..." ); if( !expfull ) { return; } else { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|p|" + expfull + "}} ~~" + "~~"; f.wpSummary.value += "Protected. "; } } // Break function semiprot_tag() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|s}} ~~" + "~~"; f.wpSummary.value += "Protected. "; } // Break function semiprotexp_tag() { var expsemi = prompt( "The page protection will expire in..." ); if( !expsemi ) { return; } else { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|s|" + expsemi + "}} ~~" + "~~"; f.wpSummary.value += "Protected. "; } } // Break function moveprot_tag() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|m}} ~~" + "~~"; f.wpSummary.value += "Protected. "; } // Break function declinedprot_tag() { var declinereason = prompt( "Reason? (Optional)" ); if( !declinereason ) { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|d}} ~~" + "~~"; f.wpSummary.value += "Declined. "; } else { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|d}}, " + declinereason + " ~~" + "~~"; f.wpSummary.value += "Declined. "; } } // Break function neaprot_tag() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|nea}} ~~" + "~~"; f.wpSummary.value += "Declined. "; } // Break function faprot_tag() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|fa}} ~~" + "~~"; f.wpSummary.value += "Declined. "; } // Break function userprot_tag() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|b}} ~~" + "~~"; f.wpSummary.value += "Blocked. "; } // Break function unprot_tag() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|u}} ~~" + "~~"; f.wpSummary.value += "Unprotected. "; } // Break function doneprot_tag() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|do}} ~~" + "~~"; f.wpSummary.value += "Done. "; } // Break function note_tag() { var notereason = prompt ("Note:"); if ( !notereason) { return; } else { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value +=":{" + "{RFPP|n}} " + notereason + " ~~" + "~~"; f.wpSummary.value += "Note. "; } } function prot_tagging() { addPortletLink('p-navigation', 'javascript:fullprot_tag()', "(Fully protected)"); addPortletLink('p-navigation', 'javascript:fullprotexp_tag()', "(Full) \+ expiry"); addPortletLink('p-navigation', 'javascript:semiprot_tag()', "(Semi-protected)"); addPortletLink('p-navigation', 'javascript:semiprotexp_tag()', "(Semi) \+ expiry"); addPortletLink('p-navigation', 'javascript:moveprot_tag()', "(Move protected)"); addPortletLink('p-navigation', 'javascript:declinedprot_tag()', "(Declined)"); addPortletLink('p-navigation', 'javascript:neaprot_tag()', "(Declined nact)"); addPortletLink('p-navigation', 'javascript:faprot_tag()', "(Declined fa)"); addPortletLink('p-navigation', 'javascript:userprot_tag()', "(User blocked)"); addPortletLink('p-navigation', 'javascript:unprot_tag()', "(Unprotected)"); addPortletLink('p-navigation', 'javascript:doneprot_tag()', "(Done)"); addPortletLink('p-navigation', 'javascript:note_tag()', "(Note)"); } addOnloadHook(prot_tagging); importStylesheet('User:Steel359/protection2.css'); // End if }; // --------------------------------------------------------------------------------------------------------------- // Protection tags function queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } } return null; }; function misc_tagging() { addPortletLink('p-tb', wgServer + '/wiki/Wikipedia:Requests for page protection', "WP:RFPP"); } addOnloadHook(misc_tagging); // ---------------------------------------------------------- // pp-dispute addOnloadHook(function (){ if(queryString("jsaction")=="pp-dispute") { var fulldisputeexp = prompt( "Expiry time? (Optional)" ); if ( fulldisputeexp == null ) { return; } else if ( fulldisputeexp == '' ) { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-dispute}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } else { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-dispute|expiry={" + "{subst:#time:F j, Y|\+" + fulldisputeexp + "}}}}" + '\n' + t.value; f.wpSummary.value = " Added template. "; } document.forms[0].wpSave.click(); } }); // pp-vandalism addOnloadHook(function (){ if(queryString("jsaction")=="pp-vandalism") { var fullvandalexp = prompt ("Expiry time? (Optional)"); if ( fullvandalexp == null ) { return; } else if ( fullvandalexp == '' ) { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-vandalism}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-vandalism|expiry={" + "{subst:#time:F j, Y|\+" + fullvandalexp + "}}}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } document.forms[0].wpSave.click(); } }); // pp-usertalk addOnloadHook(function (){ if(queryString("jsaction")=="pp-usertalk") { var fulltalkexp = prompt ("Expiry time? (Optional)"); if ( fulltalkexp == null ) { return; } else if ( fulltalkexp == '' ) { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-usertalk}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } else { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-usertalk|expiry={" + "{subst:#time:F j, Y|\+" + fulltalkexp + "}}}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } document.forms[0].wpSave.click(); } }); // pp-protected (other) addOnloadHook(function (){ if(queryString("jsaction")=="pp-protected") { var fullreason = prompt ( "This page is currently protected from editing because... (Optional)" ); if ( fullreason == null ) { return; } else if ( fullreason == '' ) { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-protected}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } else { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-protected|reason=" + fullreason + "}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } var fullotherexp = prompt ( "Expiry time? (Optional)"); if ( fullotherexp == null ) { return; } else if ( fullotherexp == '' ) { document.forms[0].wpSave.click(); } else { var f = document.editform, t = f.wpTextbox1; t.value = t.value.split('{'+'{pp-protected').join('{'+'{pp-protected|expiry={{subst:#time:F j, Y|\+' + fullotherexp + "}}" ); document.forms[0].wpSave.click(); } } }); // pp-small=yes addOnloadHook(function (){ if(queryString("jsaction")=="pp-small") { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-protected|small=yes}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; document.forms[0].wpSave.click(); } }); // pp-semi-vandalism addOnloadHook(function (){ if(queryString("jsaction")=="pp-semi-vandalism") { var semivandalexp = prompt( "Expiry time? (Optional)" ); if ( semivandalexp == null ) { return; } else if ( semivandalexp == '' ) { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-vandalism}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } else { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-vandalism|expiry={" + "{subst:#time:F j, Y|\+" + semivandalexp + "}}}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } document.forms[0].wpSave.click(); } }); // pp-semi-usertalk addOnloadHook(function (){ if(queryString("jsaction")=="pp-semi-usertalk") { var semitalkexp = prompt ("Expiry time? (Optional)"); if ( semitalkexp == null ) { return; } else if ( semitalkexp == '' ) { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-usertalk}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } else { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-usertalk|expiry={" + "{subst:#time:F j, Y|\+" + semitalkexp + "}}}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } document.forms[0].wpSave.click(); } }); // pp-semi-socks addOnloadHook(function (){ if(queryString("jsaction")=="pp-semi-sock") { var semisockexp = prompt( "Expiry time? (Optional)" ); if ( semisockexp == null ) { return; } else if ( semisockexp == '' ) { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-sock}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } else { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-sock|expiry={" + "{subst:#time:F j, Y|\+" + semisockexp + "}}}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } document.forms[0].wpSave.click(); } }); // pp-semi-protected (other) addOnloadHook(function (){ if(queryString("jsaction")=="pp-semi-protected") { var semireason = prompt ( "Editing of this article by unregistered or newly registered users is currently disabled because... (Optional)" ); if ( semireason == null ) { return; } else if ( semireason == '' ) { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-protected}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } else { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-protected|reason=" + semireason + "}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; } var semiotherexp = prompt ( "Expiry time? (Optional)"); if ( semiotherexp == null ) { return; } else if ( semiotherexp == '' ) { document.forms[0].wpSave.click(); } else { var f = document.editform, t = f.wpTextbox1; t.value = t.value.split('{'+'{pp-semi-protected').join('{'+'{pp-semi-protected|expiry={{subst:#time:F j, Y|\+' + semiotherexp + "}}" ); document.forms[0].wpSave.click(); } } }); // pp-semi-small=yes addOnloadHook(function (){ if(queryString("jsaction")=="pp-semi-small") { var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{pp-semi-protected|small=yes}}" + '\n' + t.value; f.wpSummary.value = "Added template. "; document.forms[0].wpSave.click(); } }); // Unprotection addOnloadHook(function (){ if(queryString("jsaction")=="unprotected") { var f = document.editform, t = f.wpTextbox1; var pp = RegExp("\{\{pp-.*?\}\}.*?\n"); t.value = t.value.split(pp).join(''); f.wpSummary.value = "Removed template. "; var unprotconfirm = confirm( "This script removes new style protection templates (eg, {"+"{pp-whatever}}), but not the older versions." + "\n" + "If an old style protection template is still present (eg, {"+"{sprotect}}), hit cancel to remove it manually, otherwise hit OK to save the page." ); if( !unprotconfirm ) { return; } else { document.forms[0].wpSave.click(); } } }); // --------------------------------------------------------------------------------------------------------- if ( wgNamespaceNumber > -1 ) { function mylinks() { var boxclone = document.createElement("div"); boxclone.id = 'p-navclone'; boxclone.setAttribute("class","portlet"); boxclone.style.marginTop = "7px"; boxclone.style.marginBottom = "1px"; var titolo = document.createElement("h5"); titolo.innerHTML = "protection tags"; boxclone.appendChild(titolo); var corpo = document.createElement("div"); corpo.setAttribute("class","pBody"); var list_ul = document.createElement("ul"); var list_b = document.createElement("li"); list_b.id = 'v-dispute'; var link_b = document.createElement("a"); link_b.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-dispute'; link_b.innerHTML = 'Full (dispute)'; list_b.appendChild(link_b); list_ul.appendChild(list_b); var list_e = document.createElement("li"); list_e.id = 'v-vandalism'; var link_e = document.createElement("a"); link_e.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-vandalism'; link_e.innerHTML = 'Full (vandalism)'; list_e.appendChild(link_e); list_ul.appendChild(list_e); var list_e = document.createElement("li"); list_e.id = 'v-usertalk'; var link_e = document.createElement("a"); link_e.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-usertalk'; link_e.innerHTML = 'Full (unblockabuse)'; list_e.appendChild(link_e); list_ul.appendChild(list_e); var list_j = document.createElement("li"); list_j.id = 'v-protected'; var link_j = document.createElement("a"); link_j.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-protected'; link_j.innerHTML = 'Full (other)'; list_j.appendChild(link_j); list_ul.appendChild(list_j); var list_j = document.createElement("li"); list_j.id = 'v-small'; var link_j = document.createElement("a"); link_j.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-small'; link_j.innerHTML = 'Full (small=yes)'; list_j.appendChild(link_j); list_ul.appendChild(list_j); var list_k = document.createElement("li"); list_k.id = 'v-s-vandalism'; var link_k = document.createElement("a"); link_k.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-semi-vandalism'; link_k.innerHTML = 'Semi (vandalism)'; list_k.appendChild(link_k); list_ul.appendChild(list_k); var list_e = document.createElement("li"); list_e.id = 'v-s-usertalk'; var link_e = document.createElement("a"); link_e.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-semi-usertalk'; link_e.innerHTML = 'Semi (unblockabuse)'; list_e.appendChild(link_e); list_ul.appendChild(list_e); var list_l = document.createElement("li"); list_l.id = 'v-s-socks'; var link_l = document.createElement("a"); link_l.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-semi-sock'; link_l.innerHTML = 'Semi (sock problems)'; list_l.appendChild(link_l); list_ul.appendChild(list_l); var list_l = document.createElement("li"); list_l.id = 'v-s-protected'; var link_l = document.createElement("a"); link_l.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-semi-protected'; link_l.innerHTML = 'Semi (other)'; list_l.appendChild(link_l); list_ul.appendChild(list_l); var list_j = document.createElement("li"); list_j.id = 'v-small'; var link_j = document.createElement("a"); link_j.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=pp-semi-small'; link_j.innerHTML = 'Semi (small=yes)'; list_j.appendChild(link_j); list_ul.appendChild(list_j); var list_l = document.createElement("li"); list_l.id = 'v-unprot'; var link_l = document.createElement("a"); link_l.href = wgServer + '/wiki/' + wgPageName + '?action=edit&jsaction=unprotected'; link_l.innerHTML = 'Unprotected'; list_l.appendChild(link_l); list_ul.appendChild(list_l); corpo.appendChild(list_ul); boxclone.appendChild(corpo); document.getElementById("p-tb").appendChild(boxclone); } if (window.addEventListener) window.addEventListener("load",mylinks,false); else if (window.attachEvent) window.attachEvent("onload",mylinks); }; // </nowiki></pre> // End script