As an anonymous user, you can only add new data. If you would like to also modify existing data, please create an account and indicate your languages on your user page.

User:Ascánder/monobook.js

From OmegaWiki
Jump to: navigation, search

Note: After saving, 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: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences
/*********** Load buttons ***********/
/* Modified form my old wikipedia monobook.js - draft***/
window.onload = loadButtons;
 
function goSearch(i)
{
  urls = new Array(
    "http://www.omegawiki.org/index.php/Expression:+", 
    "http://google.com/search?q=site:en.wikipedia.org+", 
    "http://google.com/search?q=site:es.wikipedia.org+", 
    "http://google.com/search?q=site:fr.wikipedia.org+", 
    "http://google.com/search?q=site:en.wikinews.org+", 
    "http://google.com/search?q=site:es.wikinews.org+", 
    "http://search.yahoo.com/search?vs=en.wikipedia.org&va=", 
    "http://search.yahoo.com/search?vs=es.wikipedia.org&va=", 
    "http://search.yahoo.com/search?vs=fr.wikipedia.org&va=", 
    "http://google.com/search?q=site:commons.wikimedia.org+", 
    "http://google.com/search?q=site:meta.wikimedia.org+", 
    "http://google.com/search?q=site:enciclopedia.us.es+",
    "http://google.com/search?q=site:es.wiktionary.org+",
    "http://buscon.rae.es/draeI/SrvltGUIBusUsual?TIPO_HTML=2&TIPO_BUS=2&LEMA=",
    "http://www.google.com/search?q=site:citeseer.nj.nec.com+"
  );
 
  var text = document.getElementById("searchInput");
  //alert(text.value);
 
  window.open(urls[i] + escape(text.value), "new-tab");
}
 
function buttonCode(strCode)
{
  return '&nbsp;<input type="button" class="searchButton" '+strCode+' />';
}
 
function loadButtons()
{
var btSearch = '<br/>'; var i=0;
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="exp" title="Omegawiki"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:es" title="Wikipedia en alemán (google)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:fr" title="Wikipedia en francés (google)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:ne" title="Wikinews en inglés (google)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:no" title="Wikinonticias en castellano (google)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="y:en" title="Wikipedia en inglés (yahoo)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="y:es" title="Wikipedia en español (yahoo)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="y:fr" title="Wikipedia en francés (yahoo)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:co" title="La comuna (google)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:me" title="meta (google)"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:el" title="Enciclopedia Libre"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:wkc"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="DRAE" title="Diccionario de la Real Academia Española"');
btSearch += buttonCode('onclick="goSearch('+(i++)+')" value="g:Citeseer" title="Citeseer (google)"');
 
var buttons = '<div>';
 
/* Botón del mapa de la ayuda */
buttons += '<a class="mybutton" title="Mapa de la ayuda" href="http://es.wikipedia.org/wiki/Wikipedia:Mapa" style="text-decoration:none;" >?</a>';
 
/* Botón de la zona de pruebas */
buttons += '<a class="mybutton" title="Zona de pruebas"href="http://es.wikipedia.org/wiki/Wikipedia:Zona de pruebas">#</a>';
 
/* Botón para buscar en Wikipedia a través de Google */
/*
buttons += '<a class="mybutton" title="Buscar en Wikipedia a través de Google" href="http://www.google.com/search?q=&btnG=B%FAsqueda+en+Google.com&domains=http://es.wikipedia.org&sitesearch=http://es.wikipedia.org&ie=iso-8859-1&oe=iso-8859-1">G</a>';
*/
 
/* Botón WEI */
buttons += '<a class="mybutton" title="wei: selecciona antes el texto a resaltar" href="javascript:ponWEI()" style="background:yellow" ><code style="background:yellow">:\)</code></a>';
 
buttons += '</div>';
 
var toolbox = document.getElementById("p-navigation");
toolbox.innerHTML += '<h5>Mi botonera</h5>'+buttons;
 
var boxSearch = document.getElementById("searchform");
if (boxSearch)
  boxSearch.innerHTML += btSearch;
 
}
 
function ponWEI()
{insertTags('<code style="background:yellow">','</code>','');}
 
/*********** Fin botonera ************/