Usuari:Llull/monobook.js
De Viquipèdia
Notau: Després de desar, heu de posar al dia la memòria cau del vostre navegador per veure els canvis: Mozilla: pitgeu reload(or ctrl-r), IE / Opera: ctrl-f5, Safari: cmd-r, Konqueror ctrl-r.
/*********** Inici de la botonera ***********/ window.onload = loadButtons; function goSearch(i) { urls = new Array( "http://en.wikipedia.org/wiki/", "", "http://es.wikipedia.org/wiki/", "", "http://ast.wikipedia.org/wiki/", "", "http://an.wikipedia.org/wiki/", "", "http://ca.wiktionary.org/wiki/", "", "http://www.googlecat.com/search?q=", "" ); var text = document.getElementById("searchInput"); if(i==8) subdir=text.value.substr(0,2)+"/"; else subdir=""; window.open(urls[i*2] + escape(text.subdir) +escape(text.value) + urls[i*2+1]); } function buttonCode(strCode) { return ' <input type="button" class="searchButton" '+strCode+' />'; } function loadButtons() { var btSearch = '<br/>'; btSearch += buttonCode('onclick="goSearch(0)" value="EN" title="Viquipèdia en anglès"'); btSearch += buttonCode('onclick="goSearch(1)" value="ES" title="Viquipèdia en castellà"'); btSearch += buttonCode('onclick="goSearch(2)" value="AST" title="Viquipèdia en asturià"'); btSearch += buttonCode('onclick="goSearch(3)" value="AN" title="Viquipèdia en aragonès"'); btSearch += buttonCode('onclick="goSearch(4)" value="Viccionari" title="Viccionari en català"'); btSearch += buttonCode('onclick="goSearch(5)" value="Google" title="Recerca directa en el Google"'); var buttons = '<div>'; /* Botó de la pàgina de proves */ buttons += '<a class="mybutton" title="Zona de pruebas"href="http://ca.wikipedia.org/wiki/Viquipèdia:Pàgina de proves"># </a>'; /* Botó per cercar a la Viquipèdia a través del Google */ buttons += '<a class="mybutton" title="Per cercar a la Viquipèdia a travès del Google" href="http://www.google.com/search?q=&btnG=B%FAsqueda+ca+Google.com&domains=http://ca.wikipedia.org&sitesearch=http://ca.wikipedia.org&ie=iso-8859-1&oe=iso-8859-1">G </a>'; /* Botó RIALLA */ buttons += '<a class="mybutton" title="Rialla: cal seleccionar abans el text a ressaltar" href="javascript:posRIALLA()" style="background:yellow" ><code style="background:yellow">:\) </code></a>'; /* Botons d'enllaços */ buttons += '<a class="mybutton" title="Enllaç: cal seleccionar abans el text a enllaçar" href="javascript:posENLLACAT()" style="background:green" >[[]]</a>'; buttons += '</div>'; var toolbox = document.getElementById("p-nav"); toolbox.innerHTML += '<h5>La meva botonera</h5>'+buttons; var boxSearch = document.getElementById("searchform"); if (boxSearch) boxSearch.innerHTML += btSearch; } function posRIALLA() {insertTags('<code style="background:yellow">','</code>','');} function posENLLACAT() {insertTags('[[',']]','');} /*********** Fi de la botonera ************/