1 // JS specific to Special:Search
3 // change the search link to what user entered
4 function mwSearchHeaderClick(obj
){
5 var searchbox
= document
.getElementById("searchText");
6 if( searchbox
== null )
7 searchbox
= document
.getElementById("powerSearchText");
9 return; // should always have either normal or advanced search
11 var searchterm
= searchbox
.value
;
12 var parts
= obj
.href
.split("search=");
14 if( parts
[1].indexOf('&') >= 0 )
15 lastpart
= parts
[1].substring( parts
[1].indexOf('&') )
16 obj
.href
= parts
[0] + "search=" + encodeURIComponent(searchterm
) + lastpart
;
19 function mwToggleSearchCheckboxes( btn
) {
20 if( !document
.getElementById
) return;
22 var nsInputs
= document
.getElementById( 'powersearch' ).getElementsByTagName( 'input' );
23 var isChecked
= false;
25 for ( var i
= 0; i
< nsInputs
.length
; i
++ ) {
27 if ( ( nsInputs
[i
].type
== 'checkbox' ) && ( pattern
.test( nsInputs
[i
].name
) ) ) {
28 switch ( btn
.value
) {
30 if ( nsInputs
[i
].checked
) {
31 nsInputs
[i
].checked
= false;
35 if ( !nsInputs
[i
].checked
) {
36 nsInputs
[i
].checked
= true;