MediaWiki:Common.js
El Kitakujo
(Malsamoj inter versioj)
Kiel registrite je 03:03, 28. Mar 2007
/* Ĉiu ajn JavaScriptaĵo ĉi tie estos ŝarĝita por ĉiu uzanto sur ĉiu paĝo. == Serĉiloj == * Plibonigo de la serĉpaĝo v3 * Aŭtoro : Marc Mongenet * Sub permesilo licence GFDL & GPL<nowiki> */ function SpecialSearchEnhanced3() { function SearchForm(search_action_url, engine_url, engine_name, logo_url, search_field_name, search_field_value, site_field_name, site_field_value) { var span = document.createElement("div"); span.style.marginRight = "1em"; span.style.width="100%"; span.style.whiteSpace = "nowrap"; var form = document.createElement("form"); form.method = "get"; form.action = search_action_url; form.style.display = "inline"; span.appendChild(form); var input = document.createElement("input"); input.type = "hidden"; input.name = search_field_name; form.appendChild(input); var site = document.createElement("input"); site.type = "hidden"; site.name = site_field_name; site.value = site_field_value; form.appendChild(site); var submit = document.createElement("input"); submit.type = "submit"; submit.value = "Recherche"; form.appendChild(submit); form.onsubmit = function() { input.value = document.getElementById("lsearchbox").value; } var a = document.createElement("a"); a.href = engine_url; span.appendChild(a); var img = document.createElement("img"); img.src = logo_url; img.alt = engine_name; img.style.borderWidth = "0"; img.style.padding = "5px"; a.appendChild(img); return span; } if (typeof SpecialSearchEnhanced3Disabled != 'undefined') return; if (wgPageName != "Special:Search") return; var mainNode = document.getElementsByTagName("form"); if (!mainNode) return; mainNode = mainNode[0]; mainNode.appendChild(document.createElement("center")); mainNode = mainNode.lastChild; var searchValue = document.getElementById("lsearchbox").value; var engine; engine = SearchForm("http://partner.exalead.fr/search", "http://www.exalead.fr/", "Exalead", "http://www.wikipedia.fr/exalead.gif", "q", searchValue, "site", "eo.wikipedia.org"); mainNode.appendChild(engine); engine = SearchForm("http://www.google.fr/search", "http://www.google.fr/", "Google", "http://www.google.com/logos/Logo_25wht.gif", "q", searchValue, "as_sitesearch", "eo.wikipedia.org"); mainNode.appendChild(engine); engine = SearchForm("http://www.wikipediasearch.net/index.php", "http://www.wikipediasearch.net", "Wikipedia Search", "http://www.wikipediasearch.net/logo_mini.png", "action", searchValue, "lang", "eo"); mainNode.appendChild(engine); engine = SearchForm("http://search.live.com/results.aspx", "http://search.live.com/", "Live", "http://search.live.com/s/affillogoLive.gif", "q", searchValue, "q1", "site:http://eo.wikipedia.org"); mainNode.appendChild(engine); engine = SearchForm("http://fr.search.yahoo.com/search", "http://fr.search.yahoo.com/", "Yahoo!", "http://us.yimg.com/i/yahootogo/y88red2.gif", "p", searchValue, "vs", "eo.wikipedia.org"); mainNode.appendChild(engine); } addOnloadHook(SpecialSearchEnhanced3); /* Fino de la serĉpaĝo */