사용자:ChongDae/monobook.js
위키백과 ― 우리 모두의 백과사전.
참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 갱신해야 합니다. 모질라 / 파이어폭스 / 사파리: ‘시프트’ 키를 누르면서 ‘새로 고침’을 클릭하거나, Ctrl-F5를 입력; 컨커러: 단순히 '새로고침'을 클릭하거나 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]] */ if (wgPageName == "특수기능:Search") { var searchEngines = []; addOnloadHook(SpecialSearchEnhanced); } function SpecialSearchEnhanced() { var createOption = function(site, action, mainQ, addQ, addV) { var opt = document.createElement('option'); opt.appendChild(document.createTextNode(site)); searchEngines[searchEngines.length] = [action, mainQ, addQ, addV]; return opt; } var searchForm = document.forms['search']; var selectBox = document.createElement('select'); selectBox.id = 'searchEngine'; searchForm.onsubmit = function() { var optSelected = searchEngines[document.getElementById('searchEngine').selectedIndex]; searchForm.action = optSelected[0]; searchForm.lsearchbox.name = optSelected[1]; searchForm.title.value = optSelected[3]; searchForm.title.name = optSelected[2]; } selectBox.appendChild(createOption('MediaWiki 검색', wgScriptPath + '/index.php', 'search', 'title', 'Special:Search')); selectBox.appendChild(createOption('구글 검색 (ko)', 'http://www.google.com/search', 'q', 'sitesearch', 'ko.wikipedia.org')); selectBox.appendChild(createOption('구글 검색 (전체)', 'http://www.google.com/search', 'q', 'sitesearch', 'wikipedia.org')); selectBox.appendChild(createOption('Yahoo', 'http://search.yahoo.com/search', 'p', 'vs', 'en.wikipedia.org')); selectBox.appendChild(createOption('Windows Live', 'http://search.live.com/results.aspx', 'q', 'q1', 'site:http://en.wikipedia.org')); selectBox.appendChild(createOption('Wikiwix', 'http://www.wikiwix.com/', 'action', 'lang', 'en')); selectBox.appendChild(createOption('Exalead', 'http://www.exalead.com/wikipedia/results', 'q', 'language', 'en')); searchForm.lsearchbox.style.marginLeft = '0px'; var lStat = document.getElementById('loadStatus'); lStat.parentNode.insertBefore(selectBox, lStat); }