*/
if (mw.config.get('wgPageName') == "Speciale:Ricerca") {
jQuery(document).ready( SpecialSearchEnhancedfunction() ; {▼
var searchEngines = [];
▲ jQuery(document).ready(SpecialSearchEnhanced);
var createOption = function(site, action, mainQ, addQ, addV) {
}
var selectBoxopt = document.createElement(' selectoption'); ▼
opt.appendChild(document.createTextNode(site)); ▼
function SpecialSearchEnhanced() {
var createOption = function(site, searchEngines[searchEngines.length] = [action, mainQ, addQ, addV) {];
varreturn opt = document.createElement('option');
▲ opt.appendChild(document.createTextNode(site));
var searchForm = document.forms['powersearch '] || document.forms['search']; ▼
searchEngines[searchEngines.length] = [action, mainQ, addQ, addV];
var searchBox = searchForm.lsearchbox || return optsearchForm.search;
if (document.forms['powersearch'])
▲ var searchForm = document.forms['powersearch'];
if (document.forms['search'])
var searchForm = document.forms['search'];
var ifselectBox (searchForm= document.lsearchboxcreateElement('select') {;
var searchBoxselectBox.id = searchForm.lsearchbox'searchEngine';
searchForm.onsubmit }= elsefunction() {
var searchBoxoptSelected = searchFormsearchEngines[document.getElementById('searchEngine').searchselectedIndex];
searchForm.action = optSelected[0]; ▼
searchBox.name = optSelected[1]; ▼
searchForm.title. namevalue = optSelected[ 23]; ▼
▲ var searchForm .title.name = document.formsoptSelected[ 'search'2];
selectBox.appendChild(createOption('MediaWiki', mw.config.get('wgScriptPath') + '/index.php', 'search', 'title', 'Speciale:Ricerca')); ▼
▲ var selectBox = document.createElement('select');
selectBox.appendChild(createOption('Google', 'http://www.google.com/search', 'q', 'sitesearch', 'it.wikipedia.org')); ▼
selectBox.id = 'searchEngine';
selectBox.appendChild(createOption('Yahoo', 'http://search.yahoo.com/search', 'p', 'vs', 'it.wikipedia.org')); ▼
searchForm.onsubmit = function() {
selectBox.appendChild(createOption('Windows Live', 'http://search.live.com/results.aspx', 'q', 'q1', 'site:http://it.wikipedia.org')); ▼
var optSelected = searchEngines[document.getElementById('searchEngine').selectedIndex];
selectBox.appendChild(createOption('Wikiwix', 'http://it.wikiwix.com/', 'action', 'lang', 'it')); ▼
▲ searchForm.action = optSelected[0];
selectBox.appendChild(createOption('Exalead', 'http://www.exalead.com/wikipedia/results', 'q', 'language', 'it')); ▼
▲ searchBox.name = optSelected[1];
searchFormsearchBox.titlestyle.valuemarginLeft = optSelected[3]'0px';
▲ searchForm.title.name = optSelected[2];
// 'searchText' is the firt search text. 'powerSearchText' is the second, used only if the first is not existent (e.g.: not yet done any search) ▼
}
buttonSearch = document.getElementById('searchText') || document.getElementById('powerSearchText'); ▼
▲ selectBox.appendChild(createOption('MediaWiki', mw.config.get('wgScriptPath') + '/index.php', 'search', 'title', 'Speciale:Ricerca'));
▲ selectBox.appendChild(createOption('Google', 'http://www.google.com/search', 'q', 'sitesearch', 'it.wikipedia.org'));
▲ selectBox.appendChild(createOption('Yahoo', 'http://search.yahoo.com/search', 'p', 'vs', 'it.wikipedia.org'));
▲ selectBox.appendChild(createOption('Windows Live', 'http://search.live.com/results.aspx', 'q', 'q1', 'site:http://it.wikipedia.org'));
▲ selectBox.appendChild(createOption('Wikiwix', 'http://it.wikiwix.com/', 'action', 'lang', 'it'));
▲ selectBox.appendChild(createOption('Exalead', 'http://www.exalead.com/wikipedia/results', 'q', 'language', 'it'));
buttonSearch.parentNode.insertBefore(selectBox, buttonSearch.nextSibling); ▼
searchBox.style.marginLeft = '0px';
});
▲ // 'searchText' is the firt search text. 'powerSearchText' is the second, used only if the first is not existent (e.g.: not yet done any search)
buttonSearch=document.getElementById('searchText');
if (buttonSearch)
▲ buttonSearch.parentNode.insertBefore(selectBox, buttonSearch.nextSibling);
else
{
▲ buttonSearch=document.getElementById('powerSearchText');
buttonSearch.parentNode.insertBefore(selectBox, buttonSearch.nextSibling);
}
}
// Serve per far funzionare il Cassetto2 con IE6.
|