User:PeterSymonds/monobook.js
From Wikipedia, the free encyclopedia
If a message on your talk page led you here, please be wary of who left it. Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. If this is a .js page, the code will be executed when previewing the page.
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.
addOnloadHook(function() { addPortletLink ('p-tb', wgArticlePath.replace(/\$1/,'Special:Newpages'), 'New pages'); }); // [[User:Lupin/popups.js]] importScript('User:Lupin/recent2.js'); //Please leave the following line //[[user:Where/easy db]], maintained by [[User:MER-C]] //Start db script addOnloadHook(function() { //check if called from deletion request if (document.title.indexOf("Editing ") != -1) { if (document.URL.lastIndexOf("&fakeaction=huff") == -1) return; // does the page exist? if (wgCurRevisionId == false) { alert("The page has already been deleted."); return; } if (document.URL.lastIndexOf("&reason=off") != -1) { var type = prompt("Enter criteria for speedy deletion, e.g. A1, G3"); if (type == null) return; var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{db-" + type.toLowerCase() + "}}\n" + t.value; f.wpSummary.value = "JS: Requesting speedy deletion ([[WP:CSD#" + type + "|CSD " + type.toUpperCase() + "]])"; f.wpSave.click(); return; } else if (document.URL.lastIndexOf("&reason=on") != -1) { var type = prompt("Enter reason for speedy deletion"); if (type == null) return; var f = document.editform, t = f.wpTextbox1; t.value = "{" + "{db|" + type + "}}\n" + t.value; f.wpSummary.value = "JS: Requesting speedy deletion"; f.wpSave.click(); return; } } if (wgCanonicalNamespace == "Special") return; addPortletLink("p-cactions", "javascript:easyDb(0)", "db (csd)", "ca-db0", "Request speedy deletion according to WP:CSD", ""); addPortletLink("p-cactions", "javascript:easyDb(1)", "db (reason)", "ca-db1", "Request speedy deletion with reason", ""); }); function easyDb(n) { var title = wgPageName.replace("&", "%26").replace("+", "%2B"); if (n == 0) location.assign("/w/index.php?&action=edit&fakeaction=huff&reason=off&title=" + title); if (n == 1) location.assign("/w/index.php?&action=edit&fakeaction=huff&reason=on&title=" + title); } //End db script // importScript('User:Mr.Z-man/refbuttons.js'); showbydefault = true; importScript('User:Mr.Z-man/patrollinks.js'); /**** afd helper ****/ importScript('User:Jnothman/afd_helper/script.js'); /* This is to keep track of who is using this extension: [[User:Jnothman/afd_helper/script.js]] */ // <nowiki>If you are editing a page, click the wikify button on your tab bar to add "{{Wikify|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}" to the top, set "Marked for wikification" as the edit summary, mark it as a minor edit, and submit.</nowiki> function doQwikify() { document.editform.wpTextbox1.value = '{' + '{' + 'Wikify|date=' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked for wikification'; document.editform.wpMinoredit.checked = true; document.editform.submit(); } addOnloadHook(function() { if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") { // wouldn't it make more sense to just check for wgCanonicalNamespace != "", or am I missing something? return; } if (document.editform) { addPortletLink("p-cactions", "javascript:doQwikify()", "wikify", "ca-wikify", "Mark for wikification", ""); } }); // by [[User:Raylu|raylu]] // // <nowiki>If you are editing a page, click the unref button on your tab bar to add "{{Unreferenced|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}" to the top, set "Marked as unreferenced" as the edit summary, mark it as a minor edit, and submit. function doQunref() { document.editform.wpTextbox1.value = '{' + '{' + 'Unreferenced|date=' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\n\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'Marked as unreferenced.'; document.editform.wpMinoredit.checked = true; document.editform.submit(); } addOnloadHook(function() { if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") { return; } if (document.editform) { addPortletLink("p-cactions", "javascript:doQunref()", "unref", "ca-unref", "Mark as unreferenced", ""); } }); // by [[User:Jj137|jj137]] // importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css'); importScript('User:S/tags.js'); {{subst:navpop}} // [[User:Ais523/votesymbols.js]] // Code for adding icons to !votes in AfDs, RfAs, etc.. Doesn't affect the page, just // shows the icons when this code is installed. // Please see [[:Image:Votesymbols.js-enhanced_SfD.png]] for copyright info on the images that are added. function lowerNoPunct(s) { return s.toLowerCase().split('.').join('').split(',').join('').split(':').join('').split(';').join('').split('+').join(''); } addOnloadHook(function() { if(wgNamespaceNumber==0) return; //avoid article space, generally speaking var vs= "http://upload.wikimedia.org/wikipedia/commons/thumb/9/94/Symbol_support_vote.svg/15px-Symbol_support_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Symbol_keep_vote.svg/15px-Symbol_keep_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/15px-Symbol_oppose_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Symbol_delete_vote.svg/15px-Symbol_delete_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Symbol_neutral_vote.svg/15px-Symbol_neutral_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Symbol_merge_vote.svg/15px-Symbol_merge_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Symbol_move_vote.svg/15px-Symbol_move_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Symbol_redirect_vote.svg/15px-Symbol_redirect_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Symbol_opinion_vote.svg/15px-Symbol_opinion_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Symbol_comment_vote.svg/15px-Symbol_comment_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Symbol_unsupport_vote.svg/15px-Symbol_unsupport_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Symbol_question.svg/15px-Symbol_question.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Symbol_divide_vote.svg/15px-Symbol_divide_vote.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Symbol_wait.svg/15px-Symbol_wait.svg.png#"+ "http://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Face-grin.svg/15px-Face-grin.svg.png"; var vt=vs.split("#"); var la=new Array(); la['support']=0; la['endorse']=0; la['keep']=1; la['oppose']=2; la['overturn']=2; la['object']=2; la['delete']=3; la['neutral']=4; la['merge']=5; la['upmerge']=5; la['move']=6; la['rename']=6; la['userfy']=6; la['transwiki']=6; la['redirect']=7; la['opinion']=8; la['relist']=8; la['subst']=8; la['salt']=8; la['change']=8; // Note that icon 8 on the list is often used for debate-specific !votes la['comment']=9; la['update']=9; la['note']=9; la['delist']=10; la['question']=11; la['split']=12; la['wait']=13; la['bjaodn']=14; var btc=document.body.getElementsByTagName("B"); i=btc.length; while(i--) { var j,k; j=btc[i].innerHTML.split("<").join(" ").split(">").join(" ").split("/").join(" ").split(" "); k=0; var x=""; while(k<j.length) { if(lowerNoPunct(j[k])=="don't"||lowerNoPunct(j[k])=='not' ||lowerNoPunct(j[k])=='no'||lowerNoPunct(j[k])=='without') break; var l=la[lowerNoPunct(j[k])]; if(l!=undefined) { x+="<IMG SRC='"+vt[l]+"' /> " } k++; } if(x!="") btc[i].innerHTML=x+btc[i].innerHTML; } }); // importScript('User:TheDJ/Gadget-HotCat.js'); importScript('User:Quarl/util.js'); importScript('User:Quarl/wikipage.js'); importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css'); importScript('Wikipedia:WikiProject Deletion sorting/delsort.js'); // [[User:Animum/reset.js]] by Animum // To include this in your monobook, add the following line to it (minus the "//"): // importScript('User:Animum/reset.js'); importScript('User:Animum/urlparameters.js'); importScript('User:Voice of All/Addtabs/monobook.js'); function resetSandbox() { if(UrlParameters["sandboxreset"] == '1' && wgPageName == "Wikipedia:Sandbox" && wgAction == "edit") { document.forms["editform"].elements["wpTextbox1"].value = "\{\{Please leave this line alone (sandbox heading)\}\}\n<!-- Hello! Feel free to try your formatting and editing skills below this line\. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. -->"; //Add the base text for the sandbox document.forms["editform"].elements["wpSummary"].value = "[[User:Animum/reset.js|JS EDIT]]: Reset the Sandbox"; //Make a descriptive edit summary document.forms["editform"].elements["wpWatchthis"].checked = false; //Chances are you already have the sandbox watchlisted document.forms["editform"].elements["wpMinoredit"].checked = true; //Make it a minor edit if(UrlParameters["indirect"] == '1') { //If you've clicked on the toolbox link window.setTimeout(function() { document.forms["editform"].elements["wpDiff"].click(); }, 200); //Load the diff if you are resetting it per the toolbox link var save = confirm("Save? (click \"OK\" to save; \"cancel\" to abort)"); // Do you want to make these changes? if(save == true) { window.setTimeout(function() { document.forms["editform"].elements["wpSave"].click(); }, 200); //Submit it! } else { location.href = "http://en.wikipedia.org/wiki/Wikipedia:Sandbox"; } // Go back two pages if you don't want to save it } else { window.setTimeout(function() { document.forms["editform"].elements["wpSave"].click(); }, 200); //Submit it! } } } addOnloadHook(function () { if(wgPageName == "Wikipedia:Sandbox") // If the page you are viewing is the sandbox { addPortletLink('p-cactions', 'http://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&action=edit&sandboxreset=1', 'reset', 'ca-reset', "Reset the Sandbox"); } if(wgPageName != "Wikipedia:Sandbox") // If the page you are viewing is NOT the sandbox { addToolboxLink("http://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&action=edit&sandboxreset=1&indirect=1", 'Reset the Sandbox', '', '', ''); } }); addOnloadHook(resetSandbox); importScript('Wikipedia:WikiProject_User_scripts/Scripts/Add_purge_to_tabs'); importScript('User:AzaToth/twinkle.js'); TwinkleConfig = { revertMaxRevisions : 50, userTalkPageMode : 'window', showSharedIPNotice : false, openTalkPage : [ 'agf', 'norm', 'vand' ], openTalkPageOnAutoRevert : false, summaryAd : " using [[WP:TWINKLE|TW]]", deletionSummaryAd : " using [[WP:TWINKLE|TW]]", protectionSummaryAd : " using [[WP:TWINKLE|TW]]", watchSpeedyPages : false, watchProdPages : false, openUserTalkPageOnSpeedyDelete : [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ], watchRevertedPages : [ 'agf', 'norm', 'vand', 'torev' ], markRevertedPagesAsMinor : [ 'agf', 'norm', 'vand', 'torev' ], deleteTalkPageOnDelete : false, watchWarnings : false, markAIVReportAsMinor : true, markSpeedyPagesAsMinor : true, offerReasonOnNormalRevert : true, orphanBacklinksOnSpeedyDelete : {orphan:true, exclude:['g6']} }; //this helps automate AfD closing by adding a 'close' tab to AfD debates //written by [[User:Johnleemk]] based on [[Wikipedia:WikiProject User scripts/Scripts/test-n.js]] by [[User:Celestianpower]] function autoafd_result() { var close = prompt("Result of debate?") var f = document.editform, t = f.wpTextbox1; t.value = t.value.split('{{REMOVE THIS TEMPLATE WHEN CLOSING THIS AfD').join('{{ns:0'); t.value = "{{subst:" + "at" + "}} '''" + close + "'''. " + "\~\~\~\~" + '\n' + '\n' + t.value; if (t.value.length > 0) t.value += '\n'; t.value += "{{subst:" + "ab" + "}}"; f.wpSummary.value = "Closing debate; result was " + close; } function autoafd_relist() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += "{{subst:" + "relist" + "|" + "\~\~\~\~\}\}"; f.wpSummary.value = "Relisting debate"; } function autoafd_add_afd_tabs() { // Only add for pages with the right string somewhere in the title if (document.title.indexOf("Editing Wikipedia:Articles for deletion/") != -1) { addPortletLink('p-cactions', 'javascript:autoafd_result()', "close"); addPortletLink('p-cactions', 'javascript:autoafd_relist()', "relist"); } } addOnloadHook(autoafd_add_afd_tabs); //end AfD closing script importScript('User:TheDJ/qui.js');

