3 var globalSearchBarFormChunk = null;
5 function SearchBarFormChunk() {
7 globalSearchBarFormChunk = this;
11 SearchBarFormChunk.prototype.init = function() {
12 debug("Initing searchBarFormchunk");
13 this.search_query = getById("mr_search_query");
14 this.search_type = getById("mr_search_type");
15 this.search_button = getById("mr_search_button");
16 this.searchRange = getById("search_range_select");
19 SearchBarFormChunk.prototype.resetPage = function() {
21 debug("pageReset on SearchBarFormChunk");
22 this.search_button.onclick = mrSearchSubmitForm;
23 this.search_query.onkeydown = mrSearchSubmitOnEnter;
24 this.search_type.onkeydown = mrSearchSubmitOnEnter;
26 if(paramObj.__mr_search_query)
27 this.search_query.value = paramObj.__mr_search_query;
29 if(paramObj.__mr_search_type)
30 this.search_type.value = paramObj.__mr_search_type;
32 try{ this.search_query.focus(); } catch(E) {}
34 for( var index in globalOrgTypes ) {
35 var otype = globalOrgTypes[index]
36 var select = new Option(otype.name(), otype.depth());
38 if( otype.depth() == globalSearchDepth )
39 select.selected = true;
41 this.searchRange.options[index] = select;
47 function mrSearchSubmitForm() {
48 var search_query = getById("mr_search_query").value;
49 var search_type = getById("mr_search_type").value;
51 debug("Submitting MR search via form");
54 "target", "mr_result",
55 "mr_search_type", search_type,
56 "mr_search_query", search_query,
62 /* forces the submission of the search */
63 function mrSearchSubmitOnEnter(evt) {
64 evt = (evt) ? evt : ((window.event) ? event : null); /* for mozilla and IE */
65 var obj = globalSearchBarFormChunk;
66 var code = grabCharCode(evt);
67 if(code==13||code==3) {