User:KnowledgeOfSelf/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.
importScript('User:Oxymoron83/blockadd.js'); importScript('User:DerHexer/rollback.js'); /* <pre><nowiki> */ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // KnowledgeOfSelf's monobook ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Helper tools ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Voice of All ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Addtabs/monobook.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Test-n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function testn(number) { var page = prompt("Vandalism to which article?") var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += "{{subst:test" + number + "-n|" + page + "}} ~~~~"; f.wpSummary.value = "Your edits to [[" + page + "]]" document.editform.wpWatchthis.checked = false; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Automatically check "anon only" in block field ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// addOnloadHook(function(){ var x; if (x=document.getElementById('wpAnonOnly')) {x.checked=true;} }); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add link ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) { if(key && title) { ta[id] = [key, title]; } else if(key) { ta[id] = [key, '']; } else if(title) { ta[id] = ['', title]; } } akeytt(); return li; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add toolbox link ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function addToolboxLink(url, name, id){ var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0]; addlilink(tb, url, name, id); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add tab ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function addTab(url, name, id, title, key){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; return addlilink(tabs, url, name, id, title, key) }; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add menu ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function addlimenu(tabs, name, id) { var na = document.createElement('a'); na.href = ''; var mn = document.createElement('ul'); na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.className = 'tabmenu'; li.appendChild(na); li.appendChild(mn); tabs.appendChild(li); return li; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Get page name ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function getPname() { z=document.getElementById("content").childNodes; for (var n=0;n<z.length;n++) { if (z[n].className=="firstHeading") return z[n].textContent; }; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Get tidy title ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function get_tidy_title() { var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href; editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit')); return editlk; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add link ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function addLink(where, url, name, id, title, key, after){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); var tabs = document.getElementById(where).getElementsByTagName('ul')[0]; if(after) { tabs.insertBefore(li,document.getElementById(after)); } else { tabs.appendChild(li); } if(id) { if(key && title) { ta[id] = [key, title]; } else if(key) { ta[id] = [key, '']; } else if(title) { ta[id] = ['', title];} } // re-render the title and accesskeys from existing code in wikibits.js akeytt(); return li; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Voice of All tools ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Master rollback ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Specialadmin/monobook.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); addOnloadHook(Dfn_js_con) function Dfn_js_con() { Mvaluejs_class = 'KOS'; Rvaluejs_class = 'KOS'; Uvaluejs_class = 'KOS'; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add tab tools (the actual tabs) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function edit_summary_watch(msg, summ, watch) { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += msg; f.wpSummary.value = summ; } function add_tabs() { var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0]; // Only add for pages with "Editing User talk:" somewhere in the title if (document.title.indexOf("Editing User talk:") != -1) { addlimenu(tabs, 'Talk messages', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch("{{subst:Welcome}} -- ~~~~", "Welcome to Wikipedia!", true, 1)','Welcome', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Anon}} -- ~~~~", "Welcome to Wikipedia!", true, 1)','Anon', ''); addlilink(talkm, 'javascript:testn(1)', 'Test1', ''); addlilink(talkm,'javascript:testn("1a")','Test1a', ''); addlilink(talkm,'javascript:testn(2)','Test2', ''); addlilink(talkm,'javascript:testn("2a")','Test2a', ''); addlilink(talkm,'javascript:testn(3)','Test3', ''); addlilink(talkm,'javascript:testn("3a")','Test3a', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Test4}} -- ~~~~", "Last warning", false, 1)','Test4', ''); addlilink(talkm,'javascript:testn("4a")','Test4a', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:anonblock}} -- ~~~~", "You have been blocked", false, 1)','anonblock', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:sockblock}} -- ~~~~", "You have been blocked", false, 1)','sockblock', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:SSPblock}}", "You have been blocked", false, 1)','ipsockblock', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Test6}} -- ~~~~", "You have been blocked", false, 1)','Test6', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Test7}} -- ~~~~", "You have been blocked", false, 1)','Test7', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Test1article}} -- ~~~~", "warning", false, 1)','Test1-art', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Test2article}} -- ~~~~", "second warning", false, 1)','Test2-art', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Test3article}} -- ~~~~", "third warning", false, 1)','Test3-art', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Test4article}} -- ~~~~", "last warning", false, 1)','Test4-art', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:usernameblock}} -- ~~~~", "You have been blocked", false, 1)','usernameblock', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:bv}} -- ~~~~", "Vandalism", false, 1)','BV', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:Vanity|}} -- ~~~~", "About the page you created", false, 1)','Vanity', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:rvfd|}} -- ~~~~", "{{rvfd}}", false, 1)','rvfd', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:blanking}} -- ~~~~", "Blanking pages", false, 1)','blanking', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:blanking2}} -- ~~~~", "Blanking pages", false, 1)','blanking 2', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:blanking3}} -- ~~~~", "Blanking pages", false, 1)','blanking 3', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:blanking4}} -- ~~~~", "Blanking pages", false, 1)','blanking 4', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:npa2}} -- ~~~~", "no personal attacks", false, 1)','npa 2', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:npa3}} -- ~~~~", "no personal attacks", false, 1)','npa 3', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:npa4}} -- ~~~~", "no personal attacks", false, 1)','npa 4', ''); addlilink(talkm,'javascript:edit_summary_watch("{{subst:npa5}} -- ~~~~", "blocked for personal attacks", false, 1)','npa 5', ''); addlilink(talkm,'javascript:edit_summary_watch("{{nothanks-sd|pg=page name|url=url of source}} -- ~~~~", "{{nothanks-sd}}", false, 1)','nothanks-sd', ''); } if (document.title.indexOf("Editing User:") != -1) { addlimenu(tabs, 'userpage tags', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch("{{subst:ibu}}", "blocked", false, 1)',"indefinite"); addlilink(talkm,'javascript:edit_summary_watch("{{indefblocked-username}}", "username block", false, 1)',"username"); addlilink(talkm,'javascript:edit_summary_watch("{{indefblocked-vandalism}}", "blocked", false, 1)',"vandalism"); addlilink(talkm,'javascript:edit_summary_watch("{{indef-latin}}", "username block", false, 1)',"non-latin"); addlilink(talkm,'javascript:edit_summary_watch("{{pageblankvandal}}", "pageblankvandal", false, 1)',"page blank"); addlilink(talkm,'javascript:edit_summary_watch("{{pagemovevandal}}", "pagemovevandal", false, 1)',"page move"); } if (document.title.indexOf("Editing Image:") == 0) { addlilink(tabs, 'javascript:edit_summary_watch("{{subst:nld}}", "no licence", false, 1)',"licence"); } if (document.title.indexOf("Editing User:") == 0) { addlilink(tabs, 'javascript:testv(1)',""); } if (document.title.indexOf("Editing User talk:") == 0) { addlilink(tabs, 'javascript:testv(1)',""); } if (document.title.indexOf("Editing Wikipedia:Articles for deletion") == 0) { addlilink(tabs, 'javascript:closeafd(prompt("Result"), (prompt("Additional comments")))', 'Result'); } if (document.title.indexOf("Editing User:KnowledgeOfSelf/status") == 0) { addlimenu(tabs, 'c/s', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch3("{{User:KnowledgeOfSelf/Status2|in}}", "changing status (in)", true, 1)',"i"); addlilink(talkm,'javascript:edit_summary_watch3("{{User:KnowledgeOfSelf/Status2|out}}", "changing status (out)", true, 1)',"o"); addlilink(talkm,'javascript:edit_summary_watch3("{{User:KnowledgeOfSelf/Status2|around}}", "changing status (around)", true, 1)',"a"); addlilink(talkm,'javascript:edit_summary_watch3("{{User:KnowledgeOfSelf/Status2|busy}}", "changing status (busy)", true, 1)',"b"); } if (document.title.indexOf("Editing Wikipedia:Administrator intervention against vandalism") == 0) { addlimenu(tabs, 'admin intervention against vandalism', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch2("blocked, list empty", true, 1)',"blocked, empty"); addlilink(talkm,'javascript:edit_summary_watch2("blocked, list not empty", true, 1)',"blocked, not empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, content dispute, list empty", true, 1)',"content dispute, empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, content dispute, list not empty", true, 1)',"content dispute, not empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, has not vandalised since final warning", list empty", true, 1)',"no edit since warning, empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, has not vandalised since final warning", true, 1)',"no edit since warning, not empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, has not been sufficiently warned", list empty", true, 1)',"not sufficiently warned, empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, has not been sufficiently warned", true, 1)',"not sufficiently warned, not empty"); } if (document.title.indexOf("Editing Category") == 0) { addlimenu(tabs, 'cat', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch2("renaming of category per [[Wikipedia:Categories for discussion]]", true, 1)',"!"); } if (document.title.indexOf("Editing") == 0) { addlimenu(tabs, 'protected', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:protected()',"dispute"); addlilink(talkm,'javascript:vprotected()',"vprotect"); addlilink(talkm,'javascript:sprotected()',"sprotect"); addlilink(talkm,'javascript:deletedpage()',"deleted"); } if (document.title.indexOf("Block user") == 0) { addlilink(tabs, 'javascript:blockuser("vandalism from this IP range, sorry. please see [[Wikipedia:Advice to AOL users]] if you have been impacted by this block.", "90 minutes")', "range"); addlilink(tabs, 'javascript:blockuser("three revert rule violation", "24 hours")', "3RR"); addlilink(tabs, 'javascript:blockuser("vandalism", "15 minutes")', "15 mins"); addlilink(tabs, 'javascript:blockuser("vandalism", "3 hours")', "3 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "24 hours")', "24 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "48 hours")', "48 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "96 hours")', "96 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "192 hours")', "192 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "indefinite")', "indefinite"); addlilink(tabs, 'javascript:blockuser("inappropriate username", "indefinite")', "username"); } if (document.title.indexOf("Unblock user") == 0) { addlilink(tabs, 'javascript:unblockuser("temporarily removing block to change duration")', "change duration"); addlilink(tabs, 'javascript:unblockuser("unblock requested (via email)")', "email"); addlilink(tabs, 'javascript:unblockuser("blocked mistakenly")', "mistake"); addlilink(tabs, 'javascript:unblockuser("collateral damage")', "collateral"); addlilink(tabs, 'javascript:unblockuser("release autoblock")', "autoblock"); } if (document.title.indexOf("Confirm delete") == 0) { addlilink(tabs, 'javascript:afddelete()',"afd"); addlilink(tabs, 'javascript:cfddelete()',"cfd"); } if (document.title.indexOf("Editing Talk:") == 0) { addlilink(tabs, 'javascript:afdresult()',"afd"); } } if (window.addEventListener) window.addEventListener("load", add_tabs, false); else if (window.attachEvent) window.attachEvent("onload", add_tabs); function addtab(tabs, url, name, id){ var na = document.createElement('a'); na.href = url; na.id = id; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); li.appendChild(na); tabs.appendChild(li); return li; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // End ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* </nowiki></pre> */