User:Kakarot/monobook.js

// Kak's Links, by User:Kakarot function addKakLinks { document.getElementById( 'p-navigation' ).innerHTML += ' '+  ' kak\'s links '+ ' '+ 'My Projects'+ 'My Rune Prices  (update) '+ 'User Birthday List'+ '<a href="javascript:ImageNaming">Moved Image</a></li>'+ ' '+  '<a href="/wiki/Special:Listusers">User List</a> <a href="/index.php?title=Special:ListUsers&limit=500"> (500) </a></li>'+ '<a href="/wiki/Guild Wars Wiki:Formatting">Guidelines</a></li>'+ '<a href="/wiki/Special:Prefixindex">Prefix Index</a></li>'+ '<a href="/wiki/Special:WantedPages">Wanted Pages</a></li>'+ ' <a href="/wiki/User:Kakarot/monobook.css">css</a> | <a href="/wiki/User:Kakarot/monobook.js">Add a new link</a> '+ '</ul> '; } addOnloadHook(addKakLinks);

/**** Guild Wars Wiki Image Naming Template * modified version (c) 2009 by User:Kakarot - original (c) 2008-2009 by SilentStorm */ function ImageNaming {      var pageRootName = wgTitle.substring( 0, ( ( wgTitle.indexOf( '/' ) > 0 ) ? wgTitle.indexOf( '/' ) : wgTitle.length ) ); var EdtBox = document.getElementById('wpTextbox1'); var HeadBox = document.getElementById('wpSummary'); var Header = 'User Guild image naming' var Code = ' ' + pageRootName + ' --~ '; HeadBox.value = Header; EdtBox.value = Code.substr(8,Code.length -9-8) + EdtBox.value; }

/**** Guild Wars Wiki Tools * (c) 2007 by Patrick Westerhoff [poke] */ var head = document.getElementsByTagName( 'head' )[0]; head.appendChild( document.createElement( 'script' ) ); head.lastChild.src = '/index.php?title=User:Poke/GuildWarsWikiTools.js&action=raw&ctype=text/javascript'; head.lastChild.type = 'text/javascript'; var gwwtPortletPos = 'p-search';

var gwwtLoadAfter = function { pTabs = new PortletArea( 'p-cactions' ); pPersonal = new PortletArea( 'p-personal' );

if ( wgNamespaceNumber == -1 && wgPageName == 'Special:RecentChanges' ) { pTabs.addItem( 'ca-patrol', 'patrol log', '/wiki/Special:Log/patrol', 'Show patrol log', '', document.getElementById('ca-sandbox') ); }

pTabs.addItem( 'ca-sandbox', 'sandbox', '/index.php?title=User:Kakarot/Sandbox/example&action=edit', 'Edit my sandbox' ); var ca_sandbox = document.getElementById( 'ca-sandbox' ); ca_sandbox.style.marginLeft = '1.6em'; pPersonal.addItem( 'pt-gwwdel', 'gww:del', '/wiki/Guild Wars Wiki:List of candidates for deletion', 'View candidates for deletion', '', document.getElementById('pt-userpage') ); pPersonal.addItem( 'pt-check', 'check log', '/wiki/Special:CheckUser/Log', 'Check user log', '', document.getElementById('pt-userpage') ); }

/** *  All code below this comment is used for adding relevant, categorized pre-defined reasons on the deletion page. * @author Johan Sköld [ User:Galil ] **/ function addEvent(element, event, listener) { if (element.addEventListener) element.addEventListener(event, listener, false); else if (element.attachEvent) element.attachEvent('on'+event, listener); else element['on'+event] = listener; } function addList(id, label) { var wpReason = document.getElementById('wpReason'); if (wpReason) { var list = document.createElement('ul'); list.id = id; wpReason.parentNode.insertBefore(document.createTextNode(label), wpReason); wpReason.parentNode.insertBefore(list, wpReason); } } function addReason(listId, reason) { var wpReason = document.getElementById('wpReason'); if (wpReason) { var list = document.getElementById(listId); if (!list) throw new Error("List does not exist."); var link = document.createElement('a'); link.href = 'javas' + 'cript:void(0);'; addEvent(link, 'click', function { wpReason.value = reason; }); link.appendChild(document.createTextNode(reason.replace(/\[\]*\|([^\*)\]\]/, '$1'))); var item = document.createElement('li'); item.appendChild(link); list.appendChild(item); } } addEvent(window, 'load', function { 	if (/action=delete/i.test(document.location.search)) { 		/** 		 * This is where the magic happens. The format is quite easy to understand but if 		 *  you want help with it, feel free to ask me or poke as we both would probably be 		 *  able to help. 		 * 		 *  To add a list: 		 *      addList('list name', 'list label'); 		 *  		 *    * list name  = Unique name of the list. Can pretty much only contain letters, 		 *                   numbers, underscores and dashes. 		 *    * list label = Label of the list. This does not have to be unique. 		 * 		 *  To add a reason to a list: 		 *      addReason('list name', 'reason label'); 		 * 		 *    * list name    = The unique name of the list to add the reason to. 		 *    * reason label = The actual reason. This is used both as label for the link  		 *                     and inserted into the reason box. **/ 		addList('general', 'General speedy reasons'); addReason('general', 'G1: Purely vandalism'); addReason('general', 'G2: Test page'); addReason('general', 'G3: Sole editor\'s request'); addReason('general', 'G4: Housekeeping'); addReason('general', 'G5: Attack page'); addReason('general', 'G6: Recreation of deleted page'); addReason('general', 'G7: Decision or conditional enforcement by arbitration committee.'); // articles if (wgCanonicalNamespace == '') { addList('article', 'Article speedy reasons'); addReason('article', 'A1: No appropriate information'); addReason('article', 'A2: Missing of verifiable source for the information'); addReason('article', 'A3: Incontrovertibly unrelated to both GW and GWW'); } 		// images if (wgCanonicalNamespace == 'File') { addList('image', 'Image speedy reasons'); addReason('image', 'I1: Redundant image'); addReason('image', 'I1: Duplicate image'); addReason('image', 'I2: Corrupt or unviewable image'); } 		// categories if (wgCanonicalNamespace == 'Category') { addList('category', 'Category speedy reasons'); addReason('category', 'C1: Empty unused category'); } 		// users if (wgCanonicalNamespace == 'User' || (wgCanonicalNamespace == 'File' && /^User/i.test(wgTitle))) { addList('user', 'User speedy reasons'); addReason('user', 'U1: User requested deletion'); addReason('user', 'U2: Unregistered user'); addReason('user', 'U3: Violates the user space policy in content'); } 		// redirects addList('redirect', 'Redirect speedy reasons'); addReason('redirect', 'R1: Redirect to User namespace'); addReason('redirect', 'R1: Redirect to Guild namespace'); addReason('redirect', 'R1: Redirect to Talk namespace'); addReason('redirect', 'R2: Redundant redirect'); addReason('redirect', 'R3: Blatantly misleading redirect'); addReason('redirect', 'R4: Broken redirect'); // common reasons addList('common', 'Common deletion reasons'); addReason('common', 'Deletion uncontested after three days'); addReason('common', 'Associated page deleted'); addReason('common', 'Move remnant'); addReason('common', 'Copyright violation'); if (wgCanonicalNamespace == 'File') { addReason('common', 'Incorrect user image naming'); addReason('common', 'Incorrect user image naming and replaced'); addReason('common', 'Incorrect guild image naming'); addReason('common', 'Incorrect guild image naming and replaced'); addReason('common', 'Orphaned image'); addReason('common', 'Associated guild page deleted'); }                else if (wgCanonicalNamespace == 'Guild') { addReason('common', 'Guild cleanup not performed within 14 days - guild page policy'); } 	} }); /** *  End of "all code below this comment"!  **/