User:Orange Yoda/monobook.js

/* */ /* Deprecated, add new stuff to MediaWiki:Common.js */

/* tooltips and access keys */ ta = new Object; ta['pt-userpage'] = new Array('.','My user page'); ta['pt-anonuserpage'] = new Array('.','The user page for the ip you\'re editing as'); ta['pt-mytalk'] = new Array('n','My talk page'); ta['pt-anontalk'] = new Array('n','Discussion about edits from this ip address'); ta['pt-preferences'] = new Array('','My preferences'); ta['pt-watchlist'] = new Array('l','The list of pages you\'re monitoring for changes.'); ta['pt-mycontris'] = new Array('y','List of my contributions'); ta['pt-login'] = new Array('o','You are encouraged to log in, it is not mandatory however.'); ta['pt-anonlogin'] = new Array('o','You are encouraged to log in, it is not mandatory however.'); ta['pt-logout'] = new Array('o','Log out'); ta['ca-talk'] = new Array('t','Discussion about the content page'); ta['ca-edit'] = new Array('e','You can edit this page. Please use the preview button before saving.'); ta['ca-addsection'] = new Array('+','Add a comment to this discussion.'); ta['ca-viewsource'] = new Array('e','This page is protected. You can view its source.'); ta['ca-history'] = new Array('h','Past versions of this page.'); ta['ca-protect'] = new Array('=','Protect this page'); ta['ca-delete'] = new Array('d','Delete this page'); ta['ca-undelete'] = new Array('d','Restore the edits done to this page before it was deleted'); ta['ca-move'] = new Array('m','Move this page'); ta['ca-watch'] = new Array('w','Add this page to your watchlist'); ta['ca-unwatch'] = new Array('w','Remove this page from your watchlist'); ta['search'] = new Array('f','Search this wiki'); ta['p-logo'] = new Array('','Main Page'); ta['n-mainpage'] = new Array('z','Visit the Main Page'); ta['n-senate'] = new Array('s','Discuss Wookieepedia topics'); ta['n-portal'] = new Array('','About the project, what you can do, where to find things'); ta['n-currentevents'] = new Array('','Find background information on current events'); ta['n-recentchanges'] = new Array('r','The list of recent changes in the wiki'); ta['n-randompage'] = new Array('x','Load a random page'); ta['n-help'] = new Array('','The place to find out'); ta['n-FAQ'] = new Array('','Frequently Asked Questions'); ta['n-chat'] = new Array('','Join the IRC channel'); ta['n-sitesupport'] = new Array('','Support us'); ta['t-whatlinkshere'] = new Array('j','List of all wiki pages that link here'); ta['t-recentchangeslinked'] = new Array('k','Recent changes in pages linked from this page'); ta['feed-rss'] = new Array('','RSS feed for this page'); ta['feed-atom'] = new Array('','Atom feed for this page'); ta['t-contributions'] = new Array('','View the list of contributions of this user'); ta['t-emailuser'] = new Array('','Send a mail to this user'); ta['t-upload'] = new Array('u','Upload images or media files'); ta['t-specialpages'] = new Array('q','List of all special pages'); ta['ca-nstab-main'] = new Array('c','View the content page'); ta['ca-nstab-user'] = new Array('c','View the user page'); ta['ca-nstab-media'] = new Array('c','View the media page'); ta['ca-nstab-special'] = new Array('','This is a special page, you can\'t edit the page itself.'); ta['ca-nstab-wp'] = new Array('a','View the project page'); ta['ca-nstab-image'] = new Array('c','View the image page'); ta['ca-nstab-mediawiki'] = new Array('c','View the system message'); ta['ca-nstab-template'] = new Array('c','View the template'); ta['ca-nstab-help'] = new Array('c','View the help page'); ta['ca-nstab-category'] = new Array('c','View the category page');

// Search icons function replaceSearchIcon { $("#searchBody").find("form").wrapInner(' ') var innerDiv;

var searchbox = document.getElementById( 'searchBody' );

if( searchbox ) { innerDiv = searchbox.getElementsByTagName('div')[0]; var link = innerDiv.getElementsByTagName('a')[0];

if( link ) { innerDiv.removeChild( link ); }   	}

onSearchIconsArrival( innerDiv ); }

function rand( n ) { return Math.round( Math.random * n ); }

// silly legacy name :P // Please note that defining the array here prevents us from having to fetch the article // and so is much faster. Plus, JS files are cached, which makes it even faster. Yay! // --TOR  function onSearchIconsArrival( searchDiv ) { var lines = new Array(		"http://images.wikia.com/starwars/images/2/2e/Searchicon1.png DRK-1 Dark Eye probe droid",		"http://images.wikia.com/starwars/images/5/5e/Searchicon2.png Imperial probe droid",		"http://images.wikia.com/starwars/images/1/14/Searchicon7.png TIE fighter",		"http://images.wikia.com/starwars/images/f/f9/Searchicon26.png ASN-121",		"http://images.wikia.com/starwars/images/0/09/BrehaSearch.png Breha Organa",		"http://images.wikia.com/starwars/images/5/5c/OduminSearch.png Odumin",		"http://images.wikia.com/starwars/images/8/82/VaderSearch.png Darth Vader",		"http://images.wikia.com/starwars/images/8/8e/HanSearch.png Han Solo",		"http://images.wikia.com/starwars/images/1/16/Eclipse-search.png Eclipse (ship)",		"http://images.wikia.com/starwars/images/f/f9/LAATsearch.png Low Altitude Assault Transport/infantry",		"http://images.wikia.com/starwars/images/e/e9/Podracer-search.png Podracer", "http://images.wikia.com/starwars/images/7/7e/Sandcrawler-search.png Sandcrawler", "http://images.wikia.com/starwars/images/b/b1/LadyLuck-search.png Lady Luck", "http://images.wikia.com/starwars/images/e/ee/OG9-search.png OG-9 homing spider droid", "http://images.wikia.com/starwars/images/d/da/Sentinel-search.png Sentinel-class landing craft", "http://images.wikia.com/starwars/images/e/e2/SPHA-search.png Self-Propelled Heavy Artillery", "http://images.wikia.com/starwars/images/1/1f/Droideka-search.png Droideka", "http://images.wikia.com/starwars/images/b/b9/NihilusSearch.png Darth Nihilus", "http://images.wikia.com/starwars/images/c/c8/ClawcraftSearch.png Chiss Clawcraft", "http://images.wikia.com/starwars/images/b/b0/QuinlanSearch.png Quinlan Vos", "http://images.wikia.com/starwars/images/d/d9/AttonSearch.png Atton Rand", "http://images.wikia.com/starwars/images/f/f3/SearchSHolocron.png Sith Holocron", "http://images.wikia.com/starwars/images/b/bd/SearchReek.png Reek", "http://images.wikia.com/starwars/images/1/1b/SearchMalak.png Darth Malak", "http://images.wikia.com/starwars/images/1/13/SearchLightsaber.png Lightsaber", "http://images.wikia.com/starwars/images/a/af/SearchJN66.png JN-66", "http://images.wikia.com/starwars/images/4/41/SearchGrievous.png Grievous", "http://images.wikia.com/starwars/images/5/55/SearchBasilisk.png Basilisk war droid", "http://images.wikia.com/starwars/images/e/e0/SearchT3.png T3-M4", "http://images.wikia.com/starwars/images/0/0f/StormieSearch.png Stormtrooper", "http://images.wikia.com/starwars/images/c/c0/Jollytrooper-search.png Stormtrooper", "http://images.wikia.com/starwars/images/f/fc/Maulhorny-search.png Darth Maul", "http://images.wikia.com/starwars/images/3/37/Kueller-search.png Kueller", "http://images.wikia.com/starwars/images/1/1c/Searchdani.png Dani", "http://images.wikia.com/starwars/images/5/5e/Bothan-search.png Bothan", "http://images.wikia.com/starwars/images/f/f4/Electrobinocs-search.png Electrobinoculars", "http://images.wikia.com/starwars/images/1/15/Havoc-search.png Havoc", "http://images.wikia.com/starwars/images/c/c3/Ewing-search.png E-wing escort starfighter", "http://images.wikia.com/starwars/images/f/f1/Bwing-search.png B-wing starfighter", "http://images.wikia.com/starwars/images/3/34/Searchgeorge.png George Lucas", "http://images.wikia.com/starwars/images/8/81/Cloneph1-search.png Clone trooper", "http://images.wikia.com/starwars/images/b/bc/Bowcaster-search.png Bowcaster", "http://images.wikia.com/starwars/images/6/6c/WESTAR34-search.png WESTAR-34 blaster pistol", "http://images.wikia.com/starwars/images/9/95/NSPSSSDsearch.png Nagai expeditionary force", "http://images.wikia.com/starwars/images/c/c6/TIEIntSearch.png TIE Interceptor", "http://images.wikia.com/starwars/images/0/02/Search-spacer-aragones.png Spacer", "http://images.wikia.com/starwars/images/2/2a/Search-flower.png Veedo Vaocan", "http://images.wikia.com/starwars/images/8/83/MillenniumF.PNG Millennium Falcon", "http://images.wikia.com/starwars/images/6/64/CloudCarSearch.PNG Storm IV Twin-Pod cloud car", "http://images.wikia.com/starwars/images/6/62/Fordo-search.png Alpha-77", "http://images.wikia.com/starwars/images/1/1f/GonkSearch.PNG GNK power droid", "http://images.wikia.com/starwars/images/7/72/SearchHolocron.png Holocron", "http://images.wikia.com/starwars/images/c/cb/Bryar-search.png Bryar Pistol", "http://images.wikia.com/starwars/images/8/84/CadesBloodyBones-search.png Bloody Bones", "http://images.wikia.com/starwars/images/2/29/DH17-search.png DH-17 blaster pistol", "http://images.wikia.com/starwars/images/d/d5/Liberty-search.png Liberty", "http://images.wikia.com/starwars/images/4/4f/FreiTek-search.png FreiTek, Inc", "http://images.wikia.com/starwars/images/9/9f/Incom-search.png Incom Corporation", "http://images.wikia.com/starwars/images/1/1d/Jabbatat-search.png Desilijic", "http://images.wikia.com/starwars/images/f/ff/N1-search.png N-1 starfighter", "http://images.wikia.com/starwars/images/c/c2/CloneCmdr-search.png Clone trooper commander", "http://images.wikia.com/starwars/images/e/e9/Immobilizer-search.png Immobilizer 418 cruiser", "http://images.wikia.com/starwars/images/5/52/ISD-search.png Imperial I-class Star Destroyer", "http://images.wikia.com/starwars/images/0/00/Jabitha-search.png Jabitha (ship)", "http://images.wikia.com/starwars/images/b/b3/Jetclone-search.png Clone jet trooper", "http://images.wikia.com/starwars/images/0/0f/JK13-search.png JK-13 security droid", "http://images.wikia.com/starwars/images/e/e6/Speederbike-search.png 74-Z speeder bike", "http://images.wikia.com/starwars/images/7/72/Z95-search.png Z-95 Headhunter", "http://images.wikia.com/starwars/images/7/70/Jag-search.png Jagged Fel", "http://images.wikia.com/starwars/images/a/a3/Jsfkoon-search.png Delta-7 Aethersprite-class light interceptor", "http://images.wikia.com/starwars/images/5/52/Icon3XJ.png XJ-6 airspeeder", "http://images.wikia.com/starwars/images/8/8f/Icon3Tholme.png Tholme", "http://images.wikia.com/starwars/images/c/c0/Icon3Speeder.png Koro-2 Exodrive airspeeder", "http://images.wikia.com/starwars/images/c/cf/Icon3Ravager.png Ravager", "http://images.wikia.com/starwars/images/a/a7/Icon3Panaka.png Panaka", "http://images.wikia.com/starwars/images/9/95/Icon3Laigrek.png Laigrek", "http://images.wikia.com/starwars/images/1/17/Icon3Jon.png Jon (farmer)", "http://images.wikia.com/starwars/images/6/69/Icon3Jaina.png Jaina Solo", "http://images.wikia.com/starwars/images/a/a7/Icon3Corran.png Corran Horn", "http://images.wikia.com/starwars/images/3/3b/Icon3Cannok.png Cannok", "http://images.wikia.com/starwars/images/9/93/Icon3Atris.png Atris", "http://images.wikia.com/starwars/images/d/d9/Mandalorian-search.png Mandalorian", "http://images.wikia.com/starwars/images/8/8d/DL44-search.png DL-44 heavy blaster pistol", "http://images.wikia.com/starwars/images/a/ac/Clash-search.png Duel on Mustafar", "http://images.wikia.com/starwars/images/1/11/Emperor-search.png Palpatine", "http://images.wikia.com/starwars/images/d/dd/Hailfire-search.png IG-227 Hailfire-class droid tank", "http://images.wikia.com/starwars/images/0/0c/Jetpack-search.png JT-12 jetpack", "http://images.wikia.com/starwars/images/e/ec/Omas-search.png Cal Omas", "http://images.wikia.com/starwars/images/b/b7/Durge-search.png Durge", "http://images.wikia.com/starwars/images/e/e0/Bloodfin-search.png Bloodfin", "http://images.wikia.com/starwars/images/2/26/Varactyl-search.png Varactyl", "http://images.wikia.com/starwars/images/4/4c/Supbattledroid-search.png B2 super battle droid", "http://images.wikia.com/starwars/images/8/82/Quingun-search.png Quinlan Vos", "http://images.wikia.com/starwars/images/b/b9/Alex_search.png Alex Winger", "http://images.wikia.com/starwars/images/1/15/Hask_search.png Loka Hask", "http://images.wikia.com/starwars/images/0/09/Grunger_search.png Josef Grunger", "http://images.wikia.com/starwars/images/9/98/Corvette-search.png CR90 corvette", "http://images.wikia.com/starwars/images/9/99/Tarkin-search.png Wilhuff Tarkin", "http://images.wikia.com/starwars/images/6/69/Thrackan-search.png Thrackan Sal-Solo", "http://images.wikia.com/starwars/images/a/ac/Syal_search.png Syal Antilles Fel", "http://images.wikia.com/starwars/images/b/b2/Zsinj_search.png Zsinj", "http://images.wikia.com/starwars/images/2/29/Thon_search.png Thon", "http://images.wikia.com/starwars/images/0/01/Romeo_search.png Romeo Treblanc", "http://images.wikia.com/starwars/images/4/48/Kneesaa_search.png Kneesaa a Jari Kintaka", "http://images.wikia.com/starwars/images/5/5a/Melan_search.png Koth Melan", "http://images.wikia.com/starwars/images/e/e4/Aleema_search.png Aleema Keto", "http://images.wikia.com/starwars/images/0/0a/Satal_search.png Satal Keto", "http://images.wikia.com/starwars/images/e/e7/ArcaJeth_search.png Arca Jeth", "http://images.wikia.com/starwars/images/9/92/ExarKun_search.png Exar Kun", "http://images.wikia.com/starwars/images/4/4d/Han_search.png Han Solo", "http://images.wikia.com/starwars/images/6/61/SoontirFel_search.png Soontir Fel", "http://images.wikia.com/starwars/images/7/78/Wessel_search.png Redd Wessel", "http://images.wikia.com/starwars/images/9/90/Cracken_search.png Airen Cracken", "http://images.wikia.com/starwars/images/2/2f/Search_dunhaussen.png Dunhausen", "http://images.wikia.com/starwars/images/1/1e/Lowbacca_search.png Lowbacca", "http://images.wikia.com/starwars/images/2/2b/Wicket_moon_search.png Wicket Wystri Warrick", "http://images.wikia.com/starwars/images/d/df/Laboigg_search.png Laboi", "http://images.wikia.com/starwars/images/e/e6/Asha_search.png Asha", "http://images.wikia.com/starwars/images/b/b6/Rohlan-search.png Rohlan Dyre" );

var line = lines[rand( lines.length - 1 )]; var pos = line.indexOf(' ');

var link = document.createElement( 'div' ); link.id = 'search-icon-wrapper'; var img = document.createElement( 'img' ); img.alt = 'Search'; img.src = ( pos == -1 ) ? line : line.substring( 0, pos ); link.appendChild( img );

searchDiv.insertBefore( link, searchDiv.firstChild );

var div = document.createElement( 'div' ); div.id = 'search-popup'; div.style.display = 'none'; var ul = document.createElement( 'ul' );

var li; var a;

li = document.createElement( 'li' ); a = document.createElement( 'a' ); a.href = wgScriptPath + '/index.php?title=Special:Search&adv=1'; a.appendChild( document.createTextNode( 'Advanced search' ) ); li.appendChild( a ); ul.appendChild( li );

li = document.createElement( 'li' ); a = document.createElement( 'a' ); a.href = ( pos == -1 ) ? 'javascript:emptySearchDesc' : '/wiki/' + line.substring( pos + 1 ); a.appendChild( document.createTextNode( "What's this? (" + ( ( pos == -1 ) ? 'NO DESCRIPTION' : line.substring( pos + 1 ) ) + ')' ) ); li.appendChild( a ); ul.appendChild( li );

li = document.createElement( 'li' ); a = document.createElement( 'a' ); a.href = 'javascript:closeSearchPopup'; a.appendChild( document.createTextNode( 'Close' ) ); li.appendChild( a ); ul.appendChild( li );

var container = document.getElementById( 'globalWrapper' ); if( !container ) { container = document.getElementById( 'container' ); }

div.appendChild( ul ); container.appendChild( div );

link.onclick = openSearchPopup; }

function openSearchPopup( event ) { var div = document.getElementById( 'search-popup' ); var e = event || window.event;

div.style.display = ( div.style.display == 'none' ) ? 'block' : 'none'; div.style.left = e.clientX + 'px'; div.style.top = ( e.clientY + document.documentElement.scrollTop ) + 'px'; }

function closeSearchPopup { document.getElementById( 'search-popup' ).style.display = 'none'; }

function emptySearchDesc { alert( 'No description exists for this search icon. Please contact the administrators to resolve this problem.' ); }

addOnloadHook( replaceSearchIcon );

/* */