User:Warwick/monobook.js
From Guild Wars Wiki
Jump to navigationJump to search
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
// preset summary descriptions for wikEd; must always be before the code that installs wikEd var wikEdComboPresetOptions = []; wikEdComboPresetOptions['summary'] = [ 'reply', 'wall of text', 'cleanup', 'minor cleanup', 'linkfix', 'fixing typos', 'adding del tag', 'adding copyvio tag', 'adding admin review tag', 'reverting vandalism', 'reverting blanking', 'reverting silliness' ]; // installs [http://en.wikipedia.org/wiki/User:Cacycle/wikEd wikEd], an in-browser text editor // with wiki syntax highlighting document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); /**** 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'; insertScript('MediaWiki:TemplateTools.js'); // ***** ADDITIONAL LINKS ***** function addBar() { document.getElementById('p-navigation').innerHTML += '</div>'+ '<div id=p-my wiki links=portlet>'+ '<h5>All Wiki Links</h5>'+ '<div class=pBody><ul>'+ '<li id=\><a href=\"/wiki/Category:Candidates for deletion">Deletion Candidates</a></li>'+ '<li id=\><a href=\"/wiki/Category:Candidates for banning">Banning Candidates</a></li>'+ '<li id=\><a href=\"/wiki/Special:Log">Logs</a></li>'+ '<li id=\><a href=\"/wiki/special:mypage">Userpage</a></li>'+ '<li id=\><a href=\"/wiki/special:mytalk">Usertalk</a></li>'+ '<li id=\><a href=\"/wiki/special:mypage/Mafia">Mafia</a></li>'+ '<li id=\><a href=\"/wiki/special:mypage/monobook.js">Monobook.js</a></li>'+ '<li id=\><a href=\"/wiki/special:mypage/monobook.css">Monobook.css</a></li>'+ '</ul></div></div>'; } //Close addBar() addOnloadHook(addBar); //Call addBar() on load //WikiSwap importScript('User:AT/wikiswap.js'); // <pre> var TOOLSCRIPTPATH = 'User:Warwick/'; function DocWriteJS(partialPage){ insertSubscript(partialPage); } // </pre> Loads up [[../DebugTools.js]] <pre> var DEBUGMODE = true; insertScript('MediaWiki:TemplateTools.js'); insertExternalCSS('http://www.wikia.com/index.php?title=User:Warwick/Sandbox/1.css&action=raw&ctype=text/css&smaxage=18000'); /* </pre> * Overwrites the original function in http://gw.gamewikis.org/skins/common/sorttable.js * with [[User:Warwick/sortable_mod.js]] . <pre> Commented out function sortableTables() { if (getElementsByClassName(document, "table", "sortable").length != 0) { insertSubscript('sortable_mod.js'); } } */ // </pre> /********************************************************************************************* == Switchbox tools == <pre> */ var overrideNamespaces; var cancelSearchswitch; function includeJS( page, onWikia, expand ) { document.write('<script type="text/javascript" src="' + ( onWikia ? 'http://'+onWikia+'.wikia.com' : '' ) + '/index.php?title=' + page + '&action=raw&ctype=text/javascript&dontcountme=s'+( expand == false ? '' : '&templates=expand' )+'"></script>'); } var mwGroups = new Array( { value: '', data: '(all)' }, { value: 'bot', data: 'Bots' }, { value: 'sysop', data: 'Sysops' }, { value: 'bureaucrat', data: 'Bureaucrats' } ); var mwNamespaces = new Array( { value: '0', data: '(Main)' }, { value: '1', data: 'Talk' }, { value: '2', data: 'User' }, { value: '3', data: 'User talk' }, { value: '4', data: 'GuildWiki' }, { value: '5', data: 'GuildWiki talk' }, { value: '6', data: 'Image' }, { value: '7', data: 'Image talk' }, { value: '8', data: 'MediaWiki' }, { value: '9', data: 'MediaWiki talk' }, { value: '10', data: 'Template' }, { value: '11', data: 'Template talk' }, { value: '12', data: 'Help' }, { value: '13', data: 'Help talk' }, { value: '14', data: 'Category' }, { value: '15', data: 'Category talk' }, { value: '100', data: 'Build' }, { value: '101', data: 'Build talk' } ); if( skin == 'monobook' && !cancelSearchswitch ) includeJS( 'MediaWiki:Searchswitch.js', 'anime' ); /* </pre> */ function addHTML (html) { if (document.all) document.body.insertAdjacentHTML('beforeEnd', html); else if (document.createRange) { var range = document.createRange(); range.setStartAfter(document.body.lastChild); var docFrag = range.createContextualFragment(html); document.body.appendChild(docFrag); } else if (document.layers) { var l = new Layer(window.innerWidth); l.document.open(); l.document.write(html); l.document.close(); l.top = document.height; document.height += l.document.height; l.visibility = 'show'; } } function topBar() { addHTML('<ul id="topnavbar"><li><a href="http://wiki.guildwars.com">Guild Wars Wiki</a></li>') addHTML('<li><a href="http://wiki.guildwars2.com">Guild Wars 2 Wiki</a></li>') addHTML('<li><a href="http://guildwars.wikia.com">GuildWiki</a></li>') addHTML('<li><a href="http://pvxwiki.com">PvX</a></li>') addHTML('</ul>'); } addOnloadHook(topBar); function getURL(uri) { var sizeOf = location.href.length; uri.dir = location.href.substring(0, sizeOf); uri.array = uri.dir.split("/"); var arraySize = uri.array.length; uri.pagename = ""; uri.namespace = new String(); for(var i = 3; i <= arraySize-1; i++) { if(i==arraySize-1){ uri.pagename = uri.pagename+uri.array[i]; } else { uri.pagename = uri.pagename+uri.array[i]+"/"; } } var isGWW = uri.array[2].indexOf("wiki.guildwars.com"); var isGWIKI = uri.array[2].indexOf("gw.gamewikis.org"); var isGW2W = uri.array[2].indexOf("wiki.guildwars2.com"); if (isGWW != -1 ) { uri.thisSite = "GWW" }; if (isGWIKI != -1 ) {uri.thisSite = "GWIKI" }; if (isGWIKI != -1 ) {uri.thisSite = "GW2W" }; return uri; } function addPortletLink(portlet, href, text, id, tooltip, accesskey, nextnode) { var node = document.getElementById(portlet); if ( !node ) return null; node = node.getElementsByTagName( "ul" )[0]; if ( !node ) return null; var link = document.createElement( "a" ); link.appendChild( document.createTextNode( text ) ); link.href = href; var item = document.createElement( "li" ); item.appendChild( link ); if ( id ) item.id = id; if ( accesskey ) { link.setAttribute( "accesskey", accesskey ); tooltip += " ["+accesskey+"]"; } if ( tooltip ) { link.setAttribute( "title", tooltip ); } if ( accesskey && tooltip ) { updateTooltipAccessKeys( new Array( link ) ); } if ( nextnode && nextnode.parentNode == node ) node.insertBefore( item, nextnode ); else node.appendChild( item ); // IE compatibility (?) return item; } function addTab(url, name, id, title, key) { return addPortletLink('p-cactions', url, name, id, title, key); }