[7343] | 1 | # this file must be UTF-8 encoded
|
---|
[128] | 2 | package query
|
---|
| 3 |
|
---|
[276] | 4 |
|
---|
[148] | 5 | #######################################################################
|
---|
[276] | 6 | # Macros whose values are set from within the server at runtime. These
|
---|
| 7 | # are here only for reference and to set default values if required.
|
---|
[148] | 8 | #######################################################################
|
---|
[128] | 9 |
|
---|
[276] | 10 | _quotedquery_ {}
|
---|
| 11 | _freqmsg_ {}
|
---|
[12382] | 12 | _stopwordsmsg_ {}
|
---|
[276] | 13 | _resultline_ {}
|
---|
| 14 | _thisfirst_ {}
|
---|
| 15 | _thislast_ {}
|
---|
| 16 | _nextfirst_ {}
|
---|
| 17 | _nextlast_ {}
|
---|
| 18 | _prevfirst_ {}
|
---|
| 19 | _prevlast_ {}
|
---|
[964] | 20 | _searchhistorylist_ {}
|
---|
[1923] | 21 | #_histvalue0_ to _histvalue19_
|
---|
| 22 | _advformlist_ {}
|
---|
| 23 | _regformlist_ {}
|
---|
[4765] | 24 | #_fqfselection_ {}
|
---|
[128] | 25 |
|
---|
[1923] | 26 |
|
---|
[148] | 27 | #######################################################################
|
---|
| 28 | # icons
|
---|
| 29 | #######################################################################
|
---|
[128] | 30 |
|
---|
[10948] | 31 | _queryresultsbar_ {
|
---|
| 32 | <div class="divbar">
|
---|
| 33 | <p class="navbar">_texthresults_</p>
|
---|
| 34 | </div>
|
---|
| 35 | }
|
---|
[128] | 36 |
|
---|
[11209] | 37 | _searchhistorybar_ {
|
---|
| 38 | <div class="divbar">
|
---|
| 39 | <p class="navbar">_texticonsearchhistorybar_</p>
|
---|
| 40 | </div>
|
---|
| 41 | }
|
---|
[1923] | 42 |
|
---|
[11209] | 43 |
|
---|
[276] | 44 | # _iconnext_ and _iconprev_ are overridden in this package as we
|
---|
| 45 | # don't want alt text here
|
---|
[12557] | 46 | _iconnext_{<img src="_httpiconmore_" width="_widthmore_" height="_heightmore_" border="0" align="top">}
|
---|
[1263] | 47 | _iconnext_ [v=1] {}
|
---|
[12557] | 48 | _iconprev_{<img src="_httpiconless_" width="_widthless_" height="_heightless_" border="0" align="top">}
|
---|
[1263] | 49 | _iconprev_ [v=1] {}
|
---|
[148] | 50 |
|
---|
[1923] | 51 | # the small squares for search history
|
---|
[2042] | 52 | ## " " ## handmade ## mstds ##
|
---|
| 53 | _httpiconmstdsqrof_ {_httpimg_/mstdsof.gif}
|
---|
| 54 | _httpiconmstdsqron_ {_httpimg_/mstdson.gif}
|
---|
[1923] | 55 | _widthmstdsqrx_ {13}
|
---|
| 56 | _heightmstdsqrx_ {13}
|
---|
| 57 |
|
---|
[148] | 58 | #######################################################################
|
---|
| 59 | # images
|
---|
| 60 | #######################################################################
|
---|
| 61 |
|
---|
[11156] | 62 | # _imagethispage_ set in nav_css/nav_ns4 macro files
|
---|
[148] | 63 |
|
---|
[1923] | 64 | #the buttons for the search history entries
|
---|
| 65 | # takes one arg - the entry number (0-num entries)
|
---|
[12557] | 66 | _imagehistbutton_ {<a href="_httpquery_" onMouseover="roll('histbutton_1_',1);" onMouseOut="roll('histbutton_1_',0);" onClick="inputQuery(histvalue_1_); return false;"><img name="histbutton_1_" src="_httpiconmstdsqrof_" onLoad="gbutton(this,'_httpiconmstdsqron_');" border="0" alt="_textusequery_" title="_textusequery_"></a>}
|
---|
[148] | 67 |
|
---|
[1923] | 68 |
|
---|
[148] | 69 | #######################################################################
|
---|
[1923] | 70 | # scripts (and some macros for the scripts)
|
---|
| 71 | #######################################################################
|
---|
| 72 |
|
---|
[4772] | 73 | _pagescriptextra_ {_If_("_cgiargqt_" eq "1", _formpagescriptextra_, _selectpagescriptextra_)
|
---|
[1923] | 74 | _If_("_cgiarghd_" ne "0",_historypagescriptextra_) }
|
---|
| 75 |
|
---|
[4772] | 76 | _selectpagescriptextra_{_If_("_cgiargqto_" eq "2", _formpagescriptextra_,_dummypagescriptextra_)}
|
---|
[10872] | 77 | _dummypagescriptextra_{function initialize() \{
|
---|
| 78 | \} }
|
---|
[1923] | 79 | _formpagescriptextra_ {
|
---|
| 80 | // query scripts generated by \_query:pagescriptextra\_
|
---|
| 81 |
|
---|
| 82 | _standardfunctions_
|
---|
| 83 | _formfunctions_
|
---|
| 84 | _searchfunctions_
|
---|
| 85 |
|
---|
| 86 | function getsearchargs () \{
|
---|
| 87 |
|
---|
| 88 | var args="";
|
---|
| 89 | args = "&fqa=0&fqv="+argfqv+"&fqf="+argfqf;
|
---|
[12768] | 90 | _If_(_cgiargb_,args += "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc;)
|
---|
[1923] | 91 |
|
---|
| 92 | return args;
|
---|
| 93 | \}
|
---|
| 94 |
|
---|
| 95 |
|
---|
| 96 |
|
---|
| 97 | function getqueryargs () \{
|
---|
| 98 | return "&fqa=1"+"&q="+argq+"&fqv="+argfqv+"&fqf="+argfqf+
|
---|
| 99 | "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc ;
|
---|
| 100 | \}
|
---|
| 101 |
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | _historypagescriptextra_{
|
---|
| 105 |
|
---|
| 106 | var histvalue0='_histvalue0_';
|
---|
| 107 | var histvalue1='_histvalue1_';
|
---|
| 108 | var histvalue2='_histvalue2_';
|
---|
| 109 | var histvalue3='_histvalue3_';
|
---|
| 110 | var histvalue4='_histvalue4_';
|
---|
| 111 | var histvalue5='_histvalue5_';
|
---|
| 112 | var histvalue6='_histvalue6_';
|
---|
| 113 | var histvalue7='_histvalue7_';
|
---|
| 114 | var histvalue8='_histvalue8_';
|
---|
| 115 | var histvalue9='_histvalue9_';
|
---|
| 116 | var histvalue10='_histvalue10_';
|
---|
| 117 | var histvalue11='_histvalue11_';
|
---|
| 118 | var histvalue12='_histvalue12_';
|
---|
| 119 | var histvalue13='_histvalue13_';
|
---|
| 120 | var histvalue14='_histvalue14_';
|
---|
| 121 | var histvalue15='_histvalue15_';
|
---|
| 122 | var histvalue16='_histvalue16_';
|
---|
| 123 | var histvalue17='_histvalue17_';
|
---|
| 124 | var histvalue18='_histvalue18_';
|
---|
| 125 | var histvalue19='_histvalue19_';
|
---|
| 126 |
|
---|
| 127 | function inputQuery(value) \{
|
---|
| 128 | if ("_cgiargqt_" == "0") \{ // text search
|
---|
| 129 | document.QueryForm.q.value += " "+value;
|
---|
[8151] | 130 | document.QueryForm.q.focus();
|
---|
[1923] | 131 | \}
|
---|
| 132 | else \{
|
---|
[12768] | 133 | if ("_cgiargb_" == "1") \{ // advanced query
|
---|
[1923] | 134 | document.QueryForm.q.value += " "+value;
|
---|
[8151] | 135 | document.QueryForm.q.focus();
|
---|
[1923] | 136 | updateq();
|
---|
| 137 | \}
|
---|
| 138 | else \{ // simple form search
|
---|
| 139 | // do something here, what??
|
---|
| 140 | \}
|
---|
| 141 | \}
|
---|
| 142 | \}
|
---|
| 143 |
|
---|
| 144 | }
|
---|
| 145 |
|
---|
| 146 | _standardfunctions_{
|
---|
| 147 |
|
---|
| 148 | function getstdargs() \{
|
---|
| 149 |
|
---|
| 150 | stdarg = "";
|
---|
[2744] | 151 | _If_(_gselection_,_getgarg_)
|
---|
[5618] | 152 | _If_(_jselection_,_getjarg_)
|
---|
[9668] | 153 | _If_(_nselection_,_getnarg_)
|
---|
[12780] | 154 | _If_(_sfselection_,_getsfarg_)
|
---|
| 155 | if (document.QueryForm.t != null) \{
|
---|
| 156 | value = document.QueryForm.t.options[document.QueryForm.t.selectedIndex].value;
|
---|
| 157 | if (value != "_cgiargt_") stdarg += "&t="+value;
|
---|
| 158 | \}
|
---|
[4813] | 159 | stdarg += "&r=1&hs=1";
|
---|
[1923] | 160 | return stdarg;
|
---|
| 161 | \}
|
---|
| 162 |
|
---|
| 163 | }
|
---|
| 164 |
|
---|
| 165 | _getgarg_{
|
---|
[4813] | 166 | if (document.QueryForm.g!= null) \{
|
---|
[1923] | 167 | value = document.QueryForm.g.options[document.QueryForm.g.selectedIndex].value;
|
---|
| 168 | if (value != "_cgiargg_") stdarg += "&g="+value;
|
---|
[4813] | 169 | \}
|
---|
[1923] | 170 | }
|
---|
| 171 |
|
---|
| 172 | _getjarg_{
|
---|
| 173 | value = document.QueryForm.j.options[document.QueryForm.j.selectedIndex].value;
|
---|
| 174 | if (value != "_cgiargj_") stdarg += "&j="+value;
|
---|
| 175 | }
|
---|
| 176 |
|
---|
[9668] | 177 | _getnarg_{
|
---|
| 178 | value = document.QueryForm.n.options[document.QueryForm.n.selectedIndex].value;
|
---|
| 179 | if (value != "_cgiargn_") stdarg += "&n="+value;
|
---|
| 180 | }
|
---|
[1923] | 181 |
|
---|
[12780] | 182 | _getsfarg_{
|
---|
| 183 | value = document.QueryForm.sf.options[document.QueryForm.sf.selectedIndex].value;
|
---|
| 184 | if (value != "_cgiargsf_") stdarg += "&sf="+value;
|
---|
| 185 | }
|
---|
| 186 |
|
---|
[1923] | 187 | _formfunctions_{
|
---|
| 188 |
|
---|
| 189 | argfqf="_cgiargfqf_";
|
---|
| 190 | argfqv="_cgiargfqv_";
|
---|
| 191 | argfqk="_cgiargfqk_";
|
---|
| 192 | argfqs="_cgiargfqs_";
|
---|
| 193 | argfqc="_cgiargfqc_";
|
---|
| 194 | argq = "";
|
---|
| 195 |
|
---|
| 196 | function initialize () \{
|
---|
| 197 |
|
---|
[12780] | 198 | if (document.QueryForm.fqf != null) \{initfqf(); \}
|
---|
| 199 | if (document.QueryForm.fqv != null) \{initfqv(); \}
|
---|
| 200 | if (document.QueryForm.fqs != null) \{initfqs(); \}
|
---|
| 201 | if (document.QueryForm.fqk != null) \{initfqk(); \}
|
---|
| 202 | if (document.QueryForm.fqc != null) \{initfqc(); \}
|
---|
| 203 | if (document.QueryForm.q != null) \{initq(); \}
|
---|
[1923] | 204 | \}
|
---|
| 205 |
|
---|
[12441] | 206 | // makes a form submit itself when enter is pressed in a text field
|
---|
| 207 | function entersubmit(event) \{
|
---|
| 208 |
|
---|
| 209 | if (window.event && window.event.keyCode == 13) \{
|
---|
| 210 | beginSearch();
|
---|
| 211 | \} else \{
|
---|
| 212 | if (event && event.which == 13) \{
|
---|
| 213 | beginSearch();
|
---|
| 214 | \} else \{
|
---|
| 215 | return true;
|
---|
| 216 | \}
|
---|
| 217 | \}
|
---|
| 218 | \}
|
---|
| 219 |
|
---|
[12780] | 220 |
|
---|
[1923] | 221 | // fqf - the field selection box
|
---|
| 222 | function initfqf() \{
|
---|
| 223 | var i;
|
---|
[7262] | 224 | fqf = argfqf.split(",");
|
---|
| 225 | num_opts = document.QueryForm.fqf[0].options.length; // assumes all have the same options
|
---|
[10661] | 226 | for (i=0; i<fqf.length && i<document.QueryForm.fqf.length; i++) \{
|
---|
| 227 | if (fqf[i] != "")\{
|
---|
[7262] | 228 | for (j=0;j<num_opts;j++) \{
|
---|
[10661] | 229 | if (fqf[i]== document.QueryForm.fqf[i].options[j].value) \{
|
---|
[1923] | 230 | document.QueryForm.fqf[i].options[j].selected = true;
|
---|
| 231 | break;
|
---|
| 232 | \}
|
---|
| 233 | \}
|
---|
[10661] | 234 | \}
|
---|
[1923] | 235 | \}
|
---|
| 236 | if (fqf.length < document.QueryForm.fqf.length) \{ // initialize remaining ones
|
---|
| 237 | for (i=fqf.length;i<document.QueryForm.fqf.length;i++) \{
|
---|
| 238 | var z=i;
|
---|
[7262] | 239 | while (z >= num_opts) \{
|
---|
| 240 | z = z-(num_opts);
|
---|
[3157] | 241 | \}
|
---|
[1923] | 242 | document.QueryForm.fqf[i].options[z].selected = true;
|
---|
| 243 |
|
---|
| 244 | \}
|
---|
| 245 | \}
|
---|
| 246 | updatefqf();
|
---|
| 247 |
|
---|
| 248 | \}
|
---|
| 249 |
|
---|
| 250 | function updatefqf() \{
|
---|
| 251 |
|
---|
| 252 | var i;
|
---|
| 253 | argfqf = "";
|
---|
| 254 | var j = document.QueryForm.fqf[0].selectedIndex;
|
---|
| 255 | argfqf += document.QueryForm.fqf[0].options[j].value;
|
---|
| 256 | for (i=1; i<document.QueryForm.fqf.length;i++) \{
|
---|
| 257 | j = document.QueryForm.fqf[i].selectedIndex;
|
---|
| 258 | argfqf += "," + document.QueryForm.fqf[i].options[j].value;
|
---|
| 259 | \}
|
---|
| 260 |
|
---|
| 261 | \}
|
---|
| 262 |
|
---|
| 263 |
|
---|
| 264 | function clearfqf() \{
|
---|
| 265 | var i;
|
---|
| 266 | for (i=0;i<document.QueryForm.fqf.length;i++) \{
|
---|
| 267 | var z = i;
|
---|
| 268 | if (i >= document.QueryForm.fqf[i].options.length) z = z-document.QueryForm.fqf[i].options.length;
|
---|
| 269 | document.QueryForm.fqf[i].options[z].selected = true;
|
---|
| 270 | \}
|
---|
| 271 | updatefqf();
|
---|
| 272 | \}
|
---|
| 273 |
|
---|
| 274 | // fqc - the boolean operator selection box
|
---|
| 275 | function initfqc() \{
|
---|
| 276 | var i,j;
|
---|
| 277 | fqc = argfqc.split(",");
|
---|
| 278 | if (_cgiargfqn_ == 2) \{ // there will only be one fqc element
|
---|
| 279 | for (j=0;j<document.QueryForm.fqc.options.length;j++) \{
|
---|
| 280 | if (fqc[0] == document.QueryForm.fqc.options[j].value) \{
|
---|
| 281 | document.QueryForm.fqc.options[j].selected = true;
|
---|
| 282 | break;
|
---|
| 283 | \}
|
---|
| 284 | \}
|
---|
| 285 | \}
|
---|
| 286 | else \{
|
---|
| 287 | for (i=0; i<fqc.length;i++) \{
|
---|
| 288 | for (j=0;j<document.QueryForm.fqc[i].options.length;j++) \{
|
---|
| 289 | if (fqc[i] == document.QueryForm.fqc[i].options[j].value) \{
|
---|
| 290 | document.QueryForm.fqc[i].options[j].selected = true;
|
---|
| 291 | break;
|
---|
| 292 | \}
|
---|
| 293 | \}
|
---|
| 294 | \}
|
---|
| 295 | \}
|
---|
| 296 | updatefqc();
|
---|
| 297 |
|
---|
| 298 | \}
|
---|
| 299 |
|
---|
| 300 | function updatefqc() \{
|
---|
| 301 |
|
---|
| 302 | var i,j;
|
---|
| 303 | argfqc = "";
|
---|
| 304 | if (_cgiargfqn_ == 2) \{
|
---|
| 305 | j = document.QueryForm.fqc.selectedIndex;
|
---|
| 306 | argfqc += document.QueryForm.fqc.options[j].value;
|
---|
| 307 | \}
|
---|
| 308 | else \{
|
---|
| 309 | j = document.QueryForm.fqc[0].selectedIndex;
|
---|
| 310 | argfqc += document.QueryForm.fqc[0].options[j].value;
|
---|
| 311 | for (i=1;i<document.QueryForm.fqc.length;i++) \{
|
---|
| 312 | j = document.QueryForm.fqc[i].selectedIndex;
|
---|
| 313 | argfqc += "," + document.QueryForm.fqc[i].options[j].value;
|
---|
| 314 | \}
|
---|
| 315 | \}
|
---|
| 316 |
|
---|
| 317 | \}
|
---|
| 318 |
|
---|
| 319 |
|
---|
| 320 | function clearfqc() \{
|
---|
| 321 |
|
---|
| 322 | var i;
|
---|
| 323 | if (_cgiargfqn_ == 2) \{
|
---|
| 324 | document.QueryForm.fqc.options[0].selected = true;
|
---|
| 325 | \}
|
---|
| 326 | else \{
|
---|
| 327 | for (i=0; i<document.QueryForm.fqc.length; i++) \{
|
---|
| 328 | document.QueryForm.fqc[i].options[0].selected = true;
|
---|
| 329 | \}
|
---|
| 330 | \}
|
---|
| 331 | updatefqc();
|
---|
| 332 | \}
|
---|
| 333 |
|
---|
| 334 | // fqv - the query word/phrase text box
|
---|
| 335 | function initfqv() \{
|
---|
| 336 | var i;
|
---|
| 337 | fqv= argfqv.split(",");
|
---|
[10661] | 338 | for (i=0; i<fqv.length && i<document.QueryForm.fqv.length; i++) \{
|
---|
[1923] | 339 | document.QueryForm.fqv[i].value = fqv[i];
|
---|
| 340 | \}
|
---|
| 341 | updatefqv();
|
---|
| 342 |
|
---|
| 343 |
|
---|
| 344 | \}
|
---|
| 345 |
|
---|
[4175] | 346 | //argfqv += escape(format(document.QueryForm.fqv[0].value));
|
---|
[1923] | 347 |
|
---|
[12441] | 348 | function updatefqv() \{
|
---|
[1923] | 349 | var i;
|
---|
| 350 | argfqv="";
|
---|
[4175] | 351 | argfqv += format(document.QueryForm.fqv[0].value);
|
---|
[1923] | 352 | for (i=1; i<document.QueryForm.fqv.length;i++) \{
|
---|
| 353 | argfqv += ",";
|
---|
[4175] | 354 | argfqv += format(document.QueryForm.fqv[i].value);
|
---|
[1923] | 355 | \}
|
---|
| 356 | \}
|
---|
| 357 |
|
---|
| 358 | function clearfqv() \{
|
---|
| 359 | var i;
|
---|
| 360 | for (i=0; i< document.QueryForm.fqv.length;i++) \{
|
---|
| 361 | document.QueryForm.fqv[i].value = "";
|
---|
| 362 | \}
|
---|
| 363 | updatefqv();
|
---|
| 364 | \}
|
---|
| 365 |
|
---|
| 366 | // fqs - the stemming checkboxes
|
---|
| 367 | function initfqs() \{
|
---|
| 368 |
|
---|
| 369 | var i;
|
---|
| 370 | fqs = argfqs.split(",");
|
---|
| 371 | for (i=0; i<fqs.length; i++) \{
|
---|
| 372 | if (fqs[i]=="1") \{
|
---|
| 373 | document.QueryForm.fqs[i].checked = true;
|
---|
| 374 | \}
|
---|
| 375 | \}
|
---|
| 376 | updatefqs();
|
---|
| 377 |
|
---|
| 378 | \}
|
---|
| 379 |
|
---|
| 380 | function updatefqs() \{
|
---|
| 381 | argfqs="";
|
---|
| 382 | if (document.QueryForm.fqs[0].checked) \{
|
---|
| 383 | argfqs += "1";
|
---|
| 384 | \}
|
---|
| 385 | else \{
|
---|
| 386 | argfqs += "0";
|
---|
| 387 | \}
|
---|
| 388 | var i;
|
---|
| 389 | for (i=1; i<document.QueryForm.fqs.length; i++) \{
|
---|
| 390 | if (document.QueryForm.fqs[i].checked) \{
|
---|
| 391 | argfqs += ",1";
|
---|
| 392 | \}
|
---|
| 393 | else \{
|
---|
| 394 | argfqs += ",0";
|
---|
| 395 | \}
|
---|
| 396 | \}
|
---|
| 397 | \}
|
---|
| 398 |
|
---|
| 399 |
|
---|
| 400 | function clearfqs() \{
|
---|
| 401 | var i;
|
---|
| 402 | for (i=0; i<document.QueryForm.fqs.length; i++) \{
|
---|
| 403 | document.QueryForm.fqs[i].checked = false;
|
---|
| 404 | \}
|
---|
| 405 | updatefqs();
|
---|
| 406 | \}
|
---|
| 407 |
|
---|
| 408 | // kqk - the casefolding checkboxes
|
---|
| 409 | function initfqk() \{
|
---|
| 410 | var i;
|
---|
| 411 | fqk = argfqk.split(",");
|
---|
| 412 | for (i=0; i<fqk.length; i++) \{
|
---|
| 413 | if (fqk[i]=="1") \{
|
---|
| 414 | document.QueryForm.fqk[i].checked = true;
|
---|
| 415 | \}
|
---|
| 416 | \}
|
---|
| 417 | updatefqk();
|
---|
| 418 |
|
---|
| 419 | \}
|
---|
| 420 |
|
---|
| 421 |
|
---|
| 422 | function updatefqk() \{
|
---|
| 423 | argfqk="";
|
---|
| 424 | if (document.QueryForm.fqk[0].checked) \{
|
---|
| 425 | argfqk += "1";
|
---|
| 426 | \}
|
---|
| 427 | else \{
|
---|
| 428 | argfqk += "0";
|
---|
| 429 | \}
|
---|
| 430 | var i;
|
---|
| 431 | for (i=1; i<document.QueryForm.fqk.length; i++) \{
|
---|
| 432 | if (document.QueryForm.fqk[i].checked) \{
|
---|
| 433 | argfqk += ",1";
|
---|
| 434 | \}
|
---|
| 435 | else \{
|
---|
| 436 | argfqk += ",0";
|
---|
| 437 | \}
|
---|
| 438 | \}
|
---|
| 439 | \}
|
---|
| 440 |
|
---|
| 441 | function clearfqk() \{
|
---|
| 442 | var i;
|
---|
| 443 | for (i=0; i<document.QueryForm.fqk.length; i++) \{
|
---|
| 444 | document.QueryForm.fqk[i].checked = false;
|
---|
| 445 | \}
|
---|
| 446 | updatefqk();
|
---|
| 447 | \}
|
---|
| 448 |
|
---|
| 449 | // q - the advanced query box
|
---|
| 450 | function initq() \{
|
---|
| 451 | updateq();
|
---|
| 452 | \}
|
---|
| 453 |
|
---|
| 454 | function updateq() \{
|
---|
[12441] | 455 |
|
---|
[1923] | 456 | argq = "";
|
---|
[4175] | 457 | argq += format(document.QueryForm.q.value);
|
---|
[1923] | 458 | \}
|
---|
| 459 |
|
---|
| 460 | function clearq() \{
|
---|
| 461 | document.QueryForm.q.value="";
|
---|
| 462 | \}
|
---|
| 463 |
|
---|
| 464 |
|
---|
| 465 | // convert commas and spaces to plus
|
---|
[4175] | 466 | // also convert other illegal characters to %xx codes
|
---|
[1923] | 467 | function format(string) \{
|
---|
| 468 | var str = "" + string;
|
---|
| 469 | var out = "", flag = 0;
|
---|
[4175] | 470 | var ch = "";
|
---|
[1923] | 471 | var j;
|
---|
| 472 | for (j = 0; j < str.length; j++) \{
|
---|
[4175] | 473 | ch=str.charAt(j);
|
---|
| 474 | if (ch == " "|| ch == ",") \{
|
---|
| 475 | if ( flag == 0) \{
|
---|
| 476 | out += "+";
|
---|
| 477 | flag=1;
|
---|
| 478 | \}
|
---|
| 479 | continue;
|
---|
[1923] | 480 | \}
|
---|
[4175] | 481 | if (ch == ";" || ch == ":" || ch == "/" || ch == "?" ||
|
---|
| 482 | ch == "@" || ch == "&" || ch == "=" || ch == "#") \{
|
---|
| 483 | out += escape(ch);
|
---|
| 484 | flag=0;
|
---|
| 485 | continue;
|
---|
| 486 | \}
|
---|
| 487 | out += str.charAt(j);
|
---|
| 488 | flag=0;
|
---|
[1923] | 489 | \}
|
---|
| 490 | return out;
|
---|
| 491 | \}
|
---|
| 492 |
|
---|
| 493 | }
|
---|
| 494 |
|
---|
| 495 | #_httpquery_ has a=q&e=compressedargs
|
---|
| 496 | #if adv form, need to set k=0 and s=0
|
---|
[12768] | 497 | _advformargs_{_If_(_cgiargb_,&k=0&s=0)}
|
---|
[1923] | 498 |
|
---|
| 499 | _searchfunctions_ {
|
---|
| 500 |
|
---|
| 501 | function beginSearch() \{
|
---|
| 502 | window.location="_httpquery_"+getstdargs()+"_advformargs_"+getsearchargs();
|
---|
| 503 | \}
|
---|
| 504 |
|
---|
| 505 | function runQuery() \{
|
---|
| 506 | window.location="_httpquery_"+getstdargs()+"_advformargs_"+getqueryargs();
|
---|
| 507 | \}
|
---|
| 508 |
|
---|
| 509 | function clearForm() \{
|
---|
| 510 | clearfqf();
|
---|
| 511 | clearfqv();
|
---|
| 512 |
|
---|
[12768] | 513 | if ("_cgiargb_" == "1") \{
|
---|
[1923] | 514 | clearfqk();
|
---|
| 515 | clearfqs();
|
---|
| 516 | clearfqc();
|
---|
| 517 | \}
|
---|
| 518 |
|
---|
| 519 | \}
|
---|
| 520 |
|
---|
| 521 | }
|
---|
| 522 |
|
---|
| 523 | #######################################################################
|
---|
| 524 | # headers
|
---|
| 525 | # these are overridden so we can put an onLoad event handler
|
---|
| 526 | # in the <body> tag of this page - for mgpp, form search pages
|
---|
| 527 | #######################################################################
|
---|
| 528 |
|
---|
| 529 | #copied from prefs
|
---|
| 530 |
|
---|
| 531 | _header_ {_cgihead_
|
---|
[10872] | 532 | _htmlhead_(class="bgimage" onLoad="initialize();")_startspacer__pagebanner_
|
---|
[1923] | 533 | }
|
---|
| 534 |
|
---|
| 535 | # this declaration ends up being the same as style=restrict, never mind
|
---|
| 536 | _header_[v=1] {_cgihead_
|
---|
| 537 | _htmlhead_(onLoad="initialize();")_pagebanner_
|
---|
| 538 | }
|
---|
| 539 |
|
---|
| 540 | #######################################################################
|
---|
[148] | 541 | # page content
|
---|
| 542 | #######################################################################
|
---|
| 543 |
|
---|
[1923] | 544 |
|
---|
[276] | 545 | _pagetitle_ {_If_(_cgiargq_,_textquerytitle_,_textnoquerytitle_)}
|
---|
[148] | 546 |
|
---|
[1923] | 547 |
|
---|
[276] | 548 | _content_ {
|
---|
[14972] | 549 |
|
---|
[7503] | 550 | _optnavigationbar_
|
---|
[10958] | 551 | <div class="document">
|
---|
| 552 | <div class="queryform">
|
---|
[1923] | 553 | _If_(_cgiargct_,_selectqueryform_,_queryform_)
|
---|
[10958] | 554 | </div>
|
---|
[12780] | 555 |
|
---|
[11209] | 556 | _If_(_searchhistorylist_,<center>_searchhistorybar_</center><br>
|
---|
[1923] | 557 | <center>
|
---|
[942] | 558 | _searchhistorylist_
|
---|
| 559 | </center>)
|
---|
[10948] | 560 | _If_(_cgiargq_,_queryresultsbar_
|
---|
[276] | 561 | <small>
|
---|
| 562 | _freqmsg_
|
---|
[12382] | 563 | _textpostprocess_
|
---|
[12389] | 564 | _If_(_stopwordsmsg_,(_stopwordsmsg_))</small><br />
|
---|
[128] | 565 | _resultline_
|
---|
[10872] | 566 | ,<div class="divbar"> </div>)
|
---|
[128] | 567 | }
|
---|
| 568 |
|
---|
[11990] | 569 | _selectqueryform_{_If_("_cgiargqt_" eq "1",_fieldqueryform_,_queryform_)}
|
---|
[1923] | 570 |
|
---|
[128] | 571 | _queryform_ {
|
---|
[4765] | 572 | <!-- query form (\_query:plainqueryform\_) -->
|
---|
[12557] | 573 | <form name="QueryForm" method="get" action="_gwcgi_">
|
---|
[10872] | 574 | <p>
|
---|
[12557] | 575 | <input type="hidden" name="a" value="q">
|
---|
| 576 | <input type="hidden" name="r" value="1">
|
---|
| 577 | <input type="hidden" name="hs" value="1">
|
---|
| 578 | <input type="hidden" name="e" value="_decodedcompressedoptions_">
|
---|
[2768] | 579 | _queryformcontent_
|
---|
[5634] | 580 | _optdatesearch_
|
---|
[10872] | 581 | </p>
|
---|
[2768] | 582 | </form>
|
---|
| 583 | <!-- end of query form -->
|
---|
| 584 | }
|
---|
| 585 |
|
---|
[12557] | 586 | _ifeellucky_ { <br><input type="checkbox" name="ifl">_textifeellucky_ }
|
---|
[7596] | 587 | _useifeellucky_ { } # Set this to _ifeellucky_ if you want this functionality available
|
---|
| 588 |
|
---|
[12780] | 589 | _allowformbreak_{</span> <span class="textselect">}
|
---|
| 590 |
|
---|
[10872] | 591 | _queryformcontent_{
|
---|
| 592 | <span class="textselect">
|
---|
| 593 | _textselect_
|
---|
| 594 | </span>
|
---|
| 595 |
|
---|
| 596 | <span class="querybox">
|
---|
[1923] | 597 | _If_(_cgiargqb_,_largequerybox_,_smallquerybox_)
|
---|
[7596] | 598 | _useifeellucky_
|
---|
[10872] | 599 | </span>
|
---|
[1923] | 600 | }
|
---|
| 601 |
|
---|
[5634] | 602 | # Automatically set by receptionist if config file switches
|
---|
| 603 | # date searching on
|
---|
| 604 | _optdatesearch_ { }
|
---|
| 605 |
|
---|
| 606 |
|
---|
[2768] | 607 | _datesearch_
|
---|
| 608 | {<table><tr><td>
|
---|
| 609 | <center>
|
---|
| 610 | _textstartdate_
|
---|
[12557] | 611 | <input type="text" name="ds" value="_cgiargds_" size="4" maxlength="4">
|
---|
[2768] | 612 | <select name="dsbc" value="_cgiargdsbc_" size="1">
|
---|
[12557] | 613 | <option value="0"_If_(_cgiargdsbc_,, selected)>_textad_
|
---|
| 614 | <option value="1"_If_(_cgiargdsbc_, selected)>_textbc_
|
---|
[2768] | 615 | </select>
|
---|
| 616 | _textenddate_
|
---|
[12557] | 617 | <input type="text" name="de" value="_cgiargde_" size="4" maxlength="4">
|
---|
[2768] | 618 | <select name="debc" size="1">
|
---|
[12557] | 619 | <option value="0" _If_(_cgiargdebc_,, selected)>_textad_
|
---|
| 620 | <option value="1" _If_(_cgiargdebc_, selected)>_textbc_
|
---|
[2768] | 621 | </select>
|
---|
| 622 | </center>
|
---|
[13433] | 623 | </td></tr>
|
---|
[2768] | 624 | <tr><td>
|
---|
| 625 | _textexplaineras_
|
---|
[13433] | 626 | </td></tr>
|
---|
[2768] | 627 | </table>
|
---|
| 628 | </center>
|
---|
| 629 | }
|
---|
| 630 |
|
---|
[12780] | 631 | _smallquerybox_ {<nobr><input type="text" name="q" value="_cgiargq_" size="50"> <input type="submit" value="_textbeginsearch_"></nobr>}
|
---|
[1923] | 632 |
|
---|
| 633 | _largequerybox_ {
|
---|
[12557] | 634 | <tr><td><textarea name="q" cols="63" rows="10">
|
---|
[1923] | 635 | _cgiargq_
|
---|
| 636 | </textarea></td></tr>
|
---|
[12557] | 637 | <tr align="right"><td><table>
|
---|
[1923] | 638 | <tr><td><input type="submit" value="_textbeginsearch_"></td>
|
---|
| 639 | </tr></table></td></tr>}
|
---|
| 640 |
|
---|
| 641 |
|
---|
| 642 | _fieldqueryform_ {
|
---|
[4784] | 643 | <noscript>
|
---|
[14109] | 644 | <p><b>_textnojsformwarning_</b></p>
|
---|
[4784] | 645 | </noscript>
|
---|
[1923] | 646 | <!-- field query form (\_query:fieldqueryform\_) -->
|
---|
[12557] | 647 | <form name="QueryForm" method="get" action="_gwcgi_">
|
---|
[4765] | 648 |
|
---|
[12780] | 649 | <table><tr><td align="left">
|
---|
[1923] | 650 | _textformselect_
|
---|
| 651 | </td></tr>
|
---|
[12780] | 652 | <tr><td>
|
---|
[12768] | 653 | _If_(_cgiargb_,_advancedforms_,_simpleforms_)
|
---|
[13433] | 654 | </td></tr>
|
---|
[1923] | 655 | </table>
|
---|
[12768] | 656 | _If_(_cgiargb_,<div class="divbar"> </div>
|
---|
[12780] | 657 | _advancedformextra_)
|
---|
[5634] | 658 |
|
---|
[128] | 659 | </form>
|
---|
[276] | 660 | <!-- end of query form -->
|
---|
[128] | 661 | }
|
---|
[148] | 662 |
|
---|
[1923] | 663 | _advancedforms_{
|
---|
[12780] | 664 | <table border="0" cellspacing="0" cellpadding="0" width="90%">
|
---|
| 665 | <tr><th></th><th align="left">_textwordphrase_</th>_If_("_cgiargct_" eq "1",<th colspan="2"><nobr>_textfoldstem_</nobr></th>)<th align="center"> _textinfield_</th></tr>
|
---|
[1923] | 666 | _advformlist_
|
---|
[12780] | 667 | <tr>
|
---|
| 668 | <td colspan="2" align="left"><input type="button" value="_textclearform_" onClick="clearForm();"></td>
|
---|
| 669 | <td colspan="3" align="right"><input type="button" value="_textbeginsearch_" onClick="beginSearch();"></td>
|
---|
| 670 | </tr>
|
---|
| 671 | </table>
|
---|
[1923] | 672 | }
|
---|
| 673 |
|
---|
| 674 | _advancedformextra_{
|
---|
| 675 | <table>
|
---|
[12780] | 676 | <tr><td align="left">_textadvquery_</td></tr>
|
---|
[12557] | 677 | <tr><td><textarea name="q" cols="57" rows="3" onChange="updateq();">_cgiargq_</textarea></td>
|
---|
| 678 | <td valign="bottom">
|
---|
[1923] | 679 | <input type="button" value="_textrunquery_" onClick="runQuery();"></td></tr>
|
---|
| 680 | </table>
|
---|
| 681 | }
|
---|
| 682 |
|
---|
| 683 | _simpleforms_{
|
---|
[12780] | 684 | <table border="0" cellspacing="0" cellpadding="0" width="90%">
|
---|
[12557] | 685 | <tr><th align="left">_textwordphrase_</th><th align="left"> _textinfield_</th></tr>
|
---|
[1923] | 686 | _regformlist_
|
---|
[12780] | 687 | <tr>
|
---|
| 688 | <td align="left"><input type="button" value="_textclearform_" onClick="clearForm();"></td>
|
---|
| 689 | <td align="right"><input type="button" value="_textbeginsearch_" onClick="beginSearch();"></td>
|
---|
[1923] | 690 | </tr>
|
---|
[12780] | 691 | </table>}
|
---|
[1923] | 692 |
|
---|
| 693 | _regformelement_{
|
---|
[12780] | 694 | <tr><td><input type="text" size="39" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
|
---|
| 695 | <td>_fqfselection_</td></tr>}
|
---|
[1923] | 696 |
|
---|
| 697 | #has no and/or/not selection box
|
---|
| 698 | _firstadvformelement_{
|
---|
[12780] | 699 | <tr><td></td><td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
|
---|
| 700 | _If_("_cgiargct_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>
|
---|
| 701 | <td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>)
|
---|
| 702 | <td align="right">_fqfselection_</td></tr>}
|
---|
[1923] | 703 |
|
---|
| 704 | _advformelement_{
|
---|
[12780] | 705 | <tr><td>_fqcselection_</td>
|
---|
[12557] | 706 | <td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
|
---|
[12780] | 707 | _If_("_cgiargct_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>
|
---|
| 708 | <td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>)
|
---|
| 709 | <td align="right">_fqfselection_</td></tr>}
|
---|
[1923] | 710 |
|
---|
[12780] | 711 |
|
---|
| 712 |
|
---|
[1923] | 713 | _fqcselection_ {
|
---|
| 714 | <select name="fqc" onChange="updatefqc();">
|
---|
| 715 | <option value="and">_textand_
|
---|
| 716 | <option value="or">_textor_
|
---|
| 717 | <option value="not">_textandnot_
|
---|
| 718 | </select>}
|
---|
| 719 |
|
---|
[11768] | 720 | _textselect_ {_If_(_cgiargb_,_chooseadvancedsearch_,_textsimplesearch_)}
|
---|
[12760] | 721 | _chooseadvancedsearch_ {_If_(_cgiargct_,_If_("_cgiargct_" eq "2",_textadvancedlucenesearch_,_textadvancedmgppsearch_),_textadvancedsearch_}
|
---|
[12780] | 722 | _textformselect_ {_If_(_cgiargb_,_chooseformadvancedsearch_,_textformsimplesearch_)}
|
---|
| 723 | _chooseformadvancedsearch_ {_If_("_cgiargct_" eq "1",_textformadvancedsearchmgpp_)_If_("_cgiargct_" eq "2",_textformadvancedsearchlucene_)}
|
---|
| 724 |
|
---|
[6541] | 725 | # mg uses hselection for index, mgpp uses fqfselection
|
---|
| 726 | _indexselection_{_If_(_cgiargct_,_fqfselection_,_hselection_)}
|
---|
[1289] | 727 |
|
---|
[276] | 728 | # we want to put the links to previous/next pages of results
|
---|
| 729 | # in the footer
|
---|
| 730 | _pagefooterextra_ {
|
---|
| 731 | <center>
|
---|
[12557] | 732 | <table cellspacing="0" cellpadding="0" width="_pagewidth_">
|
---|
[276] | 733 | <tr>
|
---|
[13424] | 734 | <td align="left">_If_(_prevfirst_,<a href="_httpquery_&r=_prevfirst_">_iconprev__textmatches__prevfirst_ - _prevlast_</a>)</td>
|
---|
| 735 | <td align="right">_If_(_nextfirst_,<a href="_httpquery_&r=_nextfirst_">_textmatches__nextfirst_ - _nextlast__iconnext_</a>)</td>
|
---|
[276] | 736 | </tr></table>
|
---|
| 737 | </center>
|
---|
[10958] | 738 |
|
---|
| 739 | </div> <!-- document -->
|
---|
[276] | 740 | }
|
---|
| 741 |
|
---|
[1289] | 742 | _querytypeselection_ {
|
---|
| 743 | <select name="t">
|
---|
[4765] | 744 | <option value="1"_If_(_cgiargt_, selected)>_If_(_cgiargb_,_textranked_,_textsome_)
|
---|
| 745 | <option value="0"_If_(_cgiargt_,, selected)>_If_(_cgiargb_,_textboolean_,_textall_)
|
---|
[1289] | 746 | </select>
|
---|
| 747 | }
|
---|
[1923] | 748 |
|
---|
[12181] | 749 |
|
---|
[11768] | 750 | _formquerytypesimpleselection_ {
|
---|
[1923] | 751 | <select name="t">
|
---|
[11768] | 752 | <option value="1"_If_(_cgiargt_, selected)>_textsome_
|
---|
| 753 | <option value="0"_If_(_cgiargt_,, selected)>_textall_
|
---|
[1923] | 754 | </select>
|
---|
| 755 | }
|
---|
| 756 |
|
---|
[11768] | 757 | _formquerytypeadvancedselection_ {
|
---|
| 758 | <select name="t">
|
---|
| 759 | <option value="1"_If_(_cgiargt_, selected)>_textranked_
|
---|
| 760 | <option value="0"_If_(_cgiargt_,, selected)>_textnatural_
|
---|
| 761 | </select>
|
---|
| 762 | }
|
---|
[1923] | 763 |
|
---|
[12181] | 764 | # this one is not used by english.dm any more. But I have added it back for the other languages that haven't updated the translations for their form search macros.
|
---|
| 765 | _formquerytypeselection_ {
|
---|
| 766 | <select name="t">
|
---|
[12768] | 767 | <option value="1"_If_(_cgiargt_, selected)>_If_(_cgiargb_,_textranked_,_textsome_)
|
---|
| 768 | <option value="0"_If_(_cgiargt_,, selected)>_If_(_cgiargb_,_textnatural_,_textall_)
|
---|
[12181] | 769 | </select>
|
---|
| 770 | }
|
---|
[11768] | 771 |
|
---|