Usuario:Lmorillas/googlesearch.js
De WikiEducator
Nota: después de guardar, quizás necesites refrescar la caché de tu navegador para ver los cambios.
- Firefox / Safari: Mantén presionada Mayús mientras pulsas el botón Actualizar, o presiona Ctrl+F5 o Ctrl+R (⌘+R en Mac)
- Google Chrome: presiona Ctrl+Shift+R (⌘+Mayús+R en Mac)
- Internet Explorer: mantén presionada Ctrl mientras pulsas Actualizar, o presiona Ctrl+F5
- Opera: vacía la caché en Herramientas → Preferencias
// Basado en ejemplo de Jim Tittsler: http://wikieducator.org/User:JimTittsler/googlesearch.js /* createGoogleSearch() */ addOnloadHook(function () { var g = document.getElementById('searchform'); var output = document.createElement('div'); output.innerHTML = '<form action="http://wikieducator.org/WikiEducator:Google_Search" id="cse-search-box"><div><input type="hidden" name="cx" value="008846155551583468489:ekh9ssqol8q" /><input type="hidden" name="cof" value="FORID:10" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" id="gcse" size="31" style="width:12.2em; font-size:95%" /><input type="submit" class="searchButton" name="sa" value="Search" /></div></form><script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>'; g.appendChild(output); if (skin == 'vector') { var p = document.getElementById('p-search'); p.style.marginTop = '-1.5em'; var s = document.styleSheets; for(i=s.length-1; i>=0; i--) { var rules = s[i].cssRules ? s[i].cssRules : s[i].rules; for(j=0; j<rules.length; j++) { if(rules[j].selectorText && rules[j].selectorText.toLowerCase().indexOf('#p-search form') != -1) { rules[j].style.margin='0.25em 0 0'; i = 0; break; } } } } }); /* showGoogleResults() */ addOnloadHook(function () { if (wgPageName == "WikiEducator:Google_Search") { var g = document.getElementsByTagName("head")[0]; var inlscript = document.createElement('script'); inlscript.type = 'text/javascript'; inlscript.innerHTML = 'var googleSearchIframeName = "cse-search-results";var googleSearchFormName = "cse-search-box";var googleSearchFrameWidth = 600;var googleSearchDomain = "www.google.com";var googleSearchPath = "/cse";'; g.appendChild(inlscript); var resscript = document.createElement('script'); resscript.type = 'text/javascript'; resscript.src = "http://www.google.com/afsonline/show_afs_search.js"; g.appendChild(resscript); g = document.getElementById('catlinks'); if (g) { g.style.display = 'none'; } } });