//EasySearch script. Original author: Sanbec from es:wiki and some minor improvements by Macy
//Importing CSS
document.write('<link rel="stylesheet" type="text/css" href="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Macy/monobook.css'
+ '&action=raw&ctype=text/css&dontcountme=s">');
//JavaScript source below:
switch (location.hostname)
{
case "es.wikipedia.org" :
function SearchModule()
{
var btSearch = '<div>';
btSearch += buttonCode('onclick="goSearch(0)" value="en:" title="Wikipedia en inglés"');
btSearch += buttonCode('onclick="goSearch(1)" value="de:" title="Wikipedia en alemán"');
btSearch += buttonCode('onclick="goSearch(2)" value="fr:" title="Wikipedia en francés"');
btSearch += buttonCode('onclick="goSearch(3)" value="C" title="Commons"');
btSearch += buttonCode('onclick="goSearch(4)" value="D" title="Wikcionario"');
btSearch += buttonCode('onclick="goSearch(5)" value="N" title="Wikinoticias"');
btSearch += buttonCode('onclick="goSearch(6)" value="SUL" title="Verificación de SUL"');
btSearch += buttonCode('onclick="goSearch(7)" value="M" title="Meta"');
btSearch += buttonCode('onclick="goSearch(8)" value="F" title="Flickr"');
btSearch += buttonCode('onclick="goSearch(9)" value="G" title="Google"');
btSearch += buttonCode('onclick="goSearch(10)" value="Y" title="Yahoo"');
btSearch += buttonCode('onclick="goSearch(11)" value="bg" title="Búsqueda global"');
btSearch += buttonCode('onclick="goSearch(12)" value="who" title="WHOIS"');
btSearch += buttonCode('onclick="goSearch(13)" value="ce" title="Contador de ediciones"');
btSearch += '</div>';
var boxSearch = document.getElementById("searchform");
if (boxSearch)
boxSearch.innerHTML += btSearch;
}
function goSearch(i)
{
urls = new Array(
"http://en.wikipedia.org/wiki/",
"http://de.wikipedia.org/wiki/",
"http://fr.wikipedia.org/wiki/",
"http://commons.wikimedia.org/wiki/",
"http://es.wiktionary.org/wiki/",
"http://es.wikinews.org/wiki/",
"http://toolserver.org/~vvv/sulutil.php?&user=",
"http://meta.wikimedia.org/wiki/",
"http://www.flickr.com/search/?l=commderiv&q=",
"http://www.google.com/search?hl=en&q=",
"http://search.yahoo.com/search?ei=UTF-8&;p=",
"http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?timeout=120&search=",
"http://samspade.org/whois/",
"http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=ewiki_p&user=",
"http://toolserver.org/~sql/rfap.php?user="
);
var text = document.getElementById("searchInput");
window.open(urls[i] + escape(text.value));
}
function buttonCode(strCode)
{
return ' <input type="button" class="searchButton" '+strCode+' />';
}
addOnloadHook(SearchModule);
}
switch (location.hostname)
{
case "en.wikipedia.org" :
function SearchModule()
{
var btSearch = '<div>';
btSearch += buttonCode('onclick="goSearch(0)" value="es:" title="Spanish Wikipedia"');
btSearch += buttonCode('onclick="goSearch(1)" value="de:" title="German Wikipedia"');
btSearch += buttonCode('onclick="goSearch(2)" value="fr:" title="French Wikipedia"');
btSearch += buttonCode('onclick="goSearch(3)" value="C" title="Commons"');
btSearch += buttonCode('onclick="goSearch(4)" value="D" title="Wiktionary"');
btSearch += buttonCode('onclick="goSearch(5)" value="N" title="Wikinews"');
btSearch += buttonCode('onclick="goSearch(6)" value="SUL" title="Verify SUL"');
btSearch += buttonCode('onclick="goSearch(7)" value="M" title="Meta"');
btSearch += buttonCode('onclick="goSearch(8)" value="F" title="Search Flickr"');
btSearch += buttonCode('onclick="goSearch(9)" value="G" title="Search Google"');
btSearch += buttonCode('onclick="goSearch(10)" value="Y" title="Search Yahoo"');
btSearch += buttonCode('onclick="goSearch(11)" value="gs" title="Global search"');
btSearch += buttonCode('onclick="goSearch(12)" value="who" title="WHOIS"');
btSearch += buttonCode('onclick="goSearch(13)" value="ec" title="Edit count"');
btSearch += buttonCode('onclick="goSearch(14)" value="rfa" title="RfA Stats"');
btSearch += buttonCode('onclick="goSearch(15)" value="esu" title="Edit summary usage"');
btSearch += '</div>';
var boxSearch = document.getElementById("searchform");
if (boxSearch)
boxSearch.innerHTML += btSearch;
}
function goSearch(i)
{
urls = new Array(
"http://es.wikipedia.org/wiki/",
"http://de.wikipedia.org/wiki/",
"http://fr.wikipedia.org/wiki/",
"http://commons.wikimedia.org/wiki/",
"http://en.wiktionary.org/wiki/",
"http://en.wikinews.org/wiki/",
"http://toolserver.org/~vvv/sulutil.php?&user=",
"http://meta.wikimedia.org/wiki/",
"http://www.flickr.com/search/?l=commderiv&q=",
"http://www.google.com/search?hl=en&q=",
"http://search.yahoo.com/search?ei=UTF-8&;p=",
"http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?timeout=120&search=",
"http://samspade.org/whois/",
"http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user=",
"http://toolserver.org/~sql/rfap.php?user=",
"http://toolserver.org/~mathbot/cgi-bin/wp/rfa/edit_summary.cgi?user="
);
var text = document.getElementById("searchInput");
window.open(urls[i] + escape(text.value));
}
function buttonCode(strCode)
{
return ' <input type="button" class="searchButton" '+strCode+' />';
}
addOnloadHook(SearchModule);
}