મીડિયાવિકિ:Gadget-externalsearch.js
Appearance
નોંધ: પાનું પ્રકાશિત કર્યા પછી, તમારે તમારા બ્રાઉઝરની કૅશ બાયપાસ કરવાની આવશ્યકતા પડી શકે છે.
- ફાયરફોક્સ / સફારી: શીફ્ટ દબાવેલી રાખીને રિલોડ પર ક્લિક કરો, અથવા તો Ctrl-F5 કે Ctrl-R દબાવો (મેક પર ⌘-R)
- ગુગલ ક્રોમ: Ctrl-Shift-R દબાવો (મેક પર ⌘-Shift-R)
- ઈન્ટરનેટ એક્સપ્લોરર/એજ: Ctrl દબાવેલી રાખીને રિફ્રેશ પર ક્લિક કરો, અથવા Ctrl-F5 દબાવો
- Opera: Ctrl-F5 દબાવો
/** Change Special:Search to use a drop-down menu *******************************************************
*
* Description: Change Special:Search to use a drop-down menu, with the default being
* the internal MediaWiki engine
* Created and maintained by: [[User:Gracenotes]]
*/
function SpecialSearchEnhanced() {
var createOption = function(site, action, mainQ, addQ, addV) {
var opt = document.createElement('option');
opt.appendChild(document.createTextNode(site));
window.searchEngines.push([action, mainQ, addQ, addV]);
return opt;
}
if (document.forms.powersearch)
var searchForm = document.forms.powersearch;
if (document.forms.search)
var searchForm = document.forms.search;
if (searchForm.lsearchbox) {
var searchBox = searchForm.lsearchbox;
} else {
var searchBox = searchForm.search;
}
var selectBox = document.createElement('select');
selectBox.id = 'searchEngine';
searchForm.onsubmit = function() {
var optSelected = window.searchEngines[document.getElementById('searchEngine').selectedIndex];
searchForm.action = optSelected[0];
searchBox.name = optSelected[1];
searchForm.title.value = optSelected[3];
searchForm.title.name = optSelected[2];
}
selectBox.appendChild(createOption('हिन्दी विकिपीडिया', mw.config.get( 'wgScript' ), 'search', 'title', 'Special:Search'));
selectBox.appendChild(createOption('गूगल', 'http://www.google.com/search', 'q', 'sitesearch', 'hi.wikipedia.org'));
selectBox.appendChild(createOption('याहू', 'http://search.yahoo.com/search', 'p', 'vs', 'hi.wikipedia.org'));
selectBox.appendChild(createOption('बिंग', 'http://www.bing.com/search', 'q', 'q1', 'site:http://hi.wikipedia.org'));
selectBox.appendChild(createOption('विकिविक्स', 'http://www.wikiwix.com/', 'action', 'lang', 'hi'));
selectBox.appendChild(createOption('एक्सालीड', 'http://www.exalead.com/wikipedia/results', 'q', 'language', 'hi'));
selectBox.appendChild(createOption('वैश्विक विकिपीडिया लेख खोज', 'http://vs.aka-online.de/cgi-bin/globalwpsearch.pl', 'search', 'timeout', '120'));
searchBox.style.marginLeft = '0px';
if (document.getElementById('loadStatus')) {
var lStat = document.getElementById('loadStatus');
} else {
var lStat = searchForm.title;
if( typeof lStat === 'object' && typeof lStat.length === 'number' ) lStat = lStat[0];
}
lStat.parentNode.insertBefore(selectBox, lStat);
}
window.searchEngines = [];
// Script is specific to Special:Search
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search'){
$(SpecialSearchEnhanced);
}