User:Super Sam/monobook.js

/* */

/* Thanks to User:Trilobite/Tools for the below tweaks! */

window.onload = Main; function Main { addtoolboxlinks; LivePreviewInstall; morelinks; }

/* Adds some useful links to the "toolbox" on the sidebar. */

function addlilink(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; }

function addtoolboxlinks { var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0]; addlilink(tb, 'http://s13.invisionfree.com/Fanstuff/', 'Forum',''); }   addlilink(tb, '/index.php/Special:Blockip', 'Block user', ''); addlilink(tb, '/index.php/Special:Ipblocklist', 'Blocked users', ''); addlilink(tb, '/index.php?title=Template:Main_Page/News_%26_Info&action=edit', 'News template',''); addlilink(tb, '/index.php/MediaWiki:Monobook.css', 'Monobook.css', ''); addlilink(tb, '/index.php/Category:To_Be_Deleted', 'To be deleted', ''); addlilink(tb, '/index.php?title=User_talk:Super Sam/sig&action=edit', 'Signature',''); }

/* Adds "LivePreview". */

wpUserName = 'Super Sam'; wpShowImages = true; mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js&action=raw&ctype=text/javascript');

/* Adds handy tabs on the delete page. */

function morelinks { var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; if(document.title.indexOf("Confirm delete - Delete") == 0) { addlilink(tabs, 'javascript:speedy("To be deleted")', 'tbd', ''); addlilink(tabs, 'javascript:speedy("Troll page")', 'tp', ''); addlilink(tabs, 'javascript:speedy("Page not needed anymore")', 'up', ''); addlilink(tabs, 'javascript:speedy("Talk page of a deleted article")', 'tp', ''); addlilink(tabs, 'javascript:speedy("Test page")', 'test', ''); addlilink(tabs, 'javascript:speedy("Unused image")', 'ui', ''); addlilink(tabs, 'javascript:speedy("Rule-breaking text adventure")', 'txt', ''); } }

function speedy (criterion) { var form = document.forms.deleteconfirm; form.wpReason.value = criterion; }

/* */