User:Annonnimus/global.js

importScriptPage('OasisToolbarButtons/code.js', 'dev');

function getPageType{ if(getUrlVars["action"] == "edit") return; var wikiNavUl = getWikiNavUl; var categoryDiv = document.getElementById('mw-normal-catlinks'); if(categoryDiv){ var categoryDiv_Links = categoryDiv.getElementsByTagName("a"); for (x in categoryDiv_Links){ switch(categoryDiv_Links[x].title){ case 'Category:Arena': //alert('Arena!'); addArenaMenu(wikiNavUl); return; break; case 'Category:Daggerfall': //alert('Daggerfall!'); addDaggerfallMenu(wikiNavUl); return; break; case 'Category:Morrowind': //alert('Morrowind!'); addMorrowindMenu(wikiNavUl); return; break; case 'Category:Oblivion': //alert('Oblivion!'); addOblivionMenu(wikiNavUl); return; break; }       }    } } function addArenaMenu(wikiNavUl){ var menu0 = ['/wiki/The_Elder_Scrolls:_Arena', 'Arena']; var menu1 = [ ['/wiki/Quests_in_Arena', 'Quests'], ['/wiki/Main_Quest_(Arena)', 'Main Quest'], ['/wiki/Side_Quests_(Arena)', 'Side Quests'] ];	var menu2 = [ ['/wiki/The_Elder_Scrolls:_Arena#Gameplay', 'World'], ['/wiki/Map_(Arena)', 'Map'], ['/wiki/Creatures_in_Arena', 'Creatures'], ['/wiki/Location_(Arena)', 'Locations'], ['/wiki/Races_(Arena)', 'Races'], ['/wiki/Attributes', 'Attributes'], ['/wiki/Magic_(Arena)', 'Magic'] ];	var menu3 = [ ['/wiki/Items (Arena)', 'Items'], ['/wiki/Artifacts_(Arena)', 'Artifacts'], ['/wiki/Spellbooks_(Arena)', 'Spellbooks'] ];	var menu4 = [ ['/wiki/Damage_(Arena)', 'Damage'], ['/wiki/Disease_(Arena)', 'Diseases'], ['/wiki/Curses_(Arena)', 'Curses'], ['/wiki/Potions_(Arena)', 'Potions'] ];	var menuItemsArray = [menu1, menu2, menu3, menu4]; addArrayToWikiaNavUl_TopLevel(menu0, menuItemsArray, wikiNavUl); } function addDaggerfallMenu(wikiNavUl){ var menu0 = ['/wiki/The_Elder_Scrolls_II:_Daggerfall', 'Daggerfall']; var menu1 = [ ['/wiki/Quests_(Daggerfall)', 'Quests'], ['/wiki/Main_Quest_(Daggerfall)', 'Main Quest'], ['/wiki/Dark_Brotherhood_(Daggerfall)#Quests', 'Dark Brotherhood'], ['/wiki/Fighters_Guild_(Daggerfall)', 'Fighters Guild'], ['/wiki/Knight_Orders', 'Knight Orders'] ];	var menu2 = [ ['/wiki/The_Elder_Scrolls_II:_Daggerfall#Game_world', 'Gameplay'], ['/wiki/Attributes', 'Attributes'], ['/wiki/Race', 'Races'], ['/wiki/Skills_(Daggerfall)', 'Skills'], ['/wiki/Category:Daggerfall:_Locations', 'Locations'], ['/wiki/Factions_(Daggerfall)', 'Factions'], ['/wiki/Reputation_(Daggerfall)', 'Reputation'], ['/wiki/Category:Daggerfall:_Creatures', 'Creatures'] ];	var menu3 = [ ['/wiki/Items_(Daggerfall)', 'Items'], ['/wiki/Artifact_(Daggerfall)', 'Artifacts'], ['/wiki/Category:Daggerfall:_Books', 'Books'] ];	var menu4 = [ ['/wiki/The_Elder_Scrolls_II:_Daggerfall#Game_world', 'Damage'], ['/wiki/Combat_(Daggerfall)', 'Combat'], ['/wiki/Disease_(Daggerfall)', 'Disease'], ['/wiki/Lycanthropy_(Daggerfall)', 'Lycanthropy'], ['/wiki/Vampirism_(Daggerfall)', 'Vampirism'], ['/wiki/Potions_(Daggerfall)', 'Potions'] ];	var menuItemsArray = [menu1, menu2, menu3, menu4]; addArrayToWikiaNavUl_TopLevel(menu0, menuItemsArray, wikiNavUl); }

function addMorrowindMenu(wikiNavUl){ var menu0 = ['/wiki/The_Elder_Scrolls_III:_Morrowind', 'Morrowind']; var menu1 = [ ['/wiki/Quests_in_Morrowind', 'Quests'], ['/wiki/Main_Quest_(Morrowind)', 'Main Quest'], ['/wiki/Fighters_Guild_(Morrowind)#Balmora_Missions', 'Fighters Guild'], ['/wiki/Mages_Guild_(Morrowind)#Quests', 'Mages Guild'], ['/wiki/Thieves_Guild_(Morrowind)#Thieves_Guild_Quests', 'Thieves Guild'] ];	var menu2 = [ ['/wiki/The_Elder_Scrolls_III:_Morrowind#Gameplay', 'Gameplay'], ['/wiki/Attributes', 'Attributes'], ['/wiki/Race', 'Races'], ['/wiki/Birthsigns_(Morrowind)', 'Birthsigns'], ['/wiki/Classes_(Morrowind)', 'Classes'], ['/wiki/Skills_(Morrowind)', 'Skills'], ['/wiki/Category:Morrowind:_Locations', 'Locations'], ['/wiki/Category:Morrowind:_Creatures', 'Creatures'] ];	var menu3 = [ ['/wiki/Category:Morrowind:_Items', 'Items'], ['/wiki/Weapons_(Morrowind)', 'Weapons'], ['/wiki/Artifacts_(Morrowind)', 'Artifacts'], ['/wiki/Category:Morrowind:_Books', 'Books'] ];	var menu4 = [ ['/wiki/The_Elder_Scrolls_III:_Morrowind', 'Expansions'], ['/wiki/The_Elder_Scrolls_III%3A_Tribunal', 'Tribunal'], ['/wiki/The_Elder_Scrolls_III:_Bloodmoon', 'Bloodmoon'] ];	var menuItemsArray = [menu1, menu2, menu3, menu4]; addArrayToWikiaNavUl_TopLevel(menu0, menuItemsArray, wikiNavUl); }

function addOblivionMenu(wikiNavUl){ var menu0 = ['/wiki/The_Elder_Scrolls_IV:_Oblivion', 'Oblivion']; var menu1 = [ ['/wiki/Category:Oblivion:_Quests', 'Quests'], ['/wiki/Main_Quest_(Oblivion)', 'Main Quest'], ['/wiki/Side_Quests_(Oblivion)', 'Side Quests'], ['/wiki/Dark_Brotherhood_(Oblivion)#Quests', 'Dark Brotherhood'], ['/wiki/Fighters_Guild_(Oblivion)#Quests', 'Fighters Guild'], ['/wiki/Mages_Guild_(Oblivion)#Quests', 'Mages Guild'] ['/wiki/Thieves_Guild_(Oblivion)#Quests', 'Thieves Guild'] ];	var menu2 = [ ['/wiki/The_Elder_Scrolls_IV:_Oblivion#Gameplay_Information', 'Gameplay'], ['/wiki/Attributes_(Oblivion)', 'Attributes'], ['/wiki/Race', 'Races'], ['/wiki/Birthsigns_(Oblivion)', 'Birthsigns'], ['/wiki/Classes_(Oblivion)', 'Classes'], ['/wiki/Skills_(Oblivion)', 'Skills'], ['/wiki/Category:Oblivion:_Locations', 'Locations'], ['/wiki/Category:Oblivion:_Creatures', 'Creatures'] ];	var menu3 = [ ['/wiki/Category:Oblivion:_Items', 'Items'], ['/wiki/Category:Artifacts_in_Oblivion', 'Artifacts'], ['/wiki/Category:Oblivion:_Armor', 'Armor'], ['/wiki/Category:Oblivion:_Weapons', 'Weapons'] ['/wiki/Category:Oblivion:_Books', 'Books'] ['/wiki/Category:Oblivion:_Ingredients', 'Ingredients'] ];	var menu4 = [ ['/wiki/The_Elder_Scrolls_IV:_Oblivion', 'Expansions'], ['/wiki/The_Elder_Scrolls_IV%3A_Shivering_Isles', 'Shivering Isles'], ['/wiki/Knights_of_the_Nine', 'Knights of the Nine'] ['/wiki/Official_Plug-ins', 'Plug-ins'] ];	var menuItemsArray = [menu1, menu2, menu3, menu4]; addArrayToWikiaNavUl_TopLevel(menu0, menuItemsArray, wikiNavUl); } function getUrlVars{ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++){ hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; }	return vars; } function fixWikiaMenu { if(getUrlVars["action"] == "edit") return; var wikiNavUl = getWikiNavUl; document.body.getElementsByTagName("nav")[1].style.width="630px";