19,800
edits
(New page: →<pre>: //<source lang="JavaScript"> /** Change Special:Search to use a drop-down menu ******************************************************* * * Description: Change Special:Sea...) |
m (http->https) |
||
| (17 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
/** Change Special:Search to use a drop-down menu ******************************************************* | /** Change Special:Search to use a drop-down menu ******************************************************* | ||
* | * | ||
| Line 13: | Line 10: | ||
var opt = document.createElement('option'); | var opt = document.createElement('option'); | ||
opt.appendChild(document.createTextNode(site)); | opt.appendChild(document.createTextNode(site)); | ||
searchEngines.push([action, mainQ, addQ, addV]); | |||
return opt; | return opt; | ||
} | } | ||
var topline = document.getElementById('contentSub'); | |||
topline.style.color = "blue"; | |||
topline.innerText = "Not finding what you're looking for? Select Google from the dropdown menu below and try again."; | |||
if (document.forms['powersearch']) | if (document.forms['powersearch']) | ||
var searchForm = document.forms['powersearch']; | var searchForm = document.forms['powersearch']; | ||
| Line 36: | Line 35: | ||
searchForm.title.name = optSelected[2]; | searchForm.title.name = optSelected[2]; | ||
} | } | ||
selectBox.appendChild(createOption('MediaWiki | selectBox.appendChild(createOption('MediaWiki Search', mw.config.get('wgScriptPath') + '/index.php', 'search', 'title', 'Special:Search')); | ||
selectBox.appendChild(createOption('Google', ' | selectBox.appendChild(createOption('Google', 'https://www.google.com/search', 'q', 'sitesearch', 'wiki.oni2.net')); | ||
selectBox.appendChild(createOption('Yahoo', ' | selectBox.appendChild(createOption('Yahoo!', 'https://search.yahoo.com/search', 'p', 'vs', 'wiki.oni2.net')); | ||
selectBox.appendChild(createOption(' | selectBox.appendChild(createOption('Bing', 'https://www.bing.com/search', 'q', 'q1', 'site:https://wiki.oni2.net')); | ||
searchBox.style.marginLeft = '0px'; | searchBox.style.marginLeft = '0px'; | ||
if (document.getElementById('loadStatus')) { | if (document.getElementById('loadStatus')) { | ||
var lStat = document.getElementById('loadStatus'); | var lStat = document.getElementById('loadStatus'); | ||
} else { | } else { | ||
var lStat = searchForm. | var lStat = searchForm.title; | ||
if( typeof lStat == 'object' && typeof lStat.length === 'number' ) lStat = lStat[0]; | |||
} | } | ||
lStat.parentNode.insertBefore(selectBox, lStat); | lStat.parentNode.insertBefore(selectBox, lStat); | ||
| Line 52: | Line 50: | ||
var searchEngines = []; | var searchEngines = []; | ||
$(SpecialSearchEnhanced); | |||