source: trunk/gsdl/macros/pref.dm@ 7345

Last change on this file since 7345 was 7343, checked in by jrm21, 20 years ago

added a comment at the start of all macro files about using UTF-8

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 14.4 KB
Line 
1# this file must be UTF-8 encoded
2
3package preferences
4
5# set within server
6
7# collectionoption is only set when cross-collection searching is turned on
8_collectionoption_ {}
9
10# this macro will be set to "1" when the "source docs retrived from dl/web
11# button is required - i.e. whenever PreferenceDocsFromWeb isn't set to false
12# in collect.cfg
13_PreferenceDocsFromWeb_ {}
14
15# this macro will be set to _textprefschanged_ when the "set preferences"
16# button has been pressed
17_prefschanged_ {}
18
19#######################################################################
20# java images/scripts
21#######################################################################
22
23# the _javalinks_ macros are the flashy image links at the top right of
24# the page. this is overridden here as we don't want a 'preferences'
25# link on this page
26
27_javalinks_ {_imagehome__imagehelp_}
28_javalinks_ [v=1] {
29_imagehome_<br>
30_imagehelp_<br>
31}
32
33
34#######################################################################
35# scripts
36# note that changing either the "m" or the "o" argument
37# from the preferences page necessitates reseting the "r"
38# argument to 1
39#######################################################################
40
41_ccsfunctions_ {argcc = "";
42savedccs = new Object();
43
44function initialize () \{
45 for (i = 0; i < document.links.length; i++)
46 savedhrefs[i] = document.links[i].href;
47
48 s = "_cgiargcc_";
49 a = s.split (",");
50 for (i = 0; i < a.length ;i++) \{
51 for (j = 0; j < document.PrefForm.cc.length; j++) \{
52 if (a[i] == document.PrefForm.elements["cc"][j].value) \{
53 document.PrefForm.elements["cc"][j].checked = true;
54 savedccs[a[i]] = 1;
55 argcc = argcc + "&cc=" + a[i];
56 break;
57 \} else \{
58 savedccs[a[i]] = 0;
59 \}
60 \}
61 \}
62 updatehrefs();
63\}
64
65function updatecc (collection) \{
66 if (savedccs[collection] == 1) savedccs[collection] = 0;
67 else savedccs[collection] = 1;
68
69 var i;
70 argcc = "";
71 var changed = 0;
72 for (i in savedccs)
73 if (savedccs[i] == 1) \{
74 argcc += "&cc=" + i;
75 changed = 1;
76 \}
77 if (changed == 1) argcc += "&r=1";
78 updatehrefs();
79\}
80}
81
82_standardfunctions_ {
83function initialize () \{
84 for (i = 0; i < document.links.length; i++)
85 savedhrefs[i] = document.links[i].href;
86
87\}
88
89}
90
91_getargsfunction_ {
92function getargs () \{
93 return argk + args + argm + argo + argrd + arghd + argb + argqf + argqb + argfqn_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
94\}
95}
96
97_ccsargs_ {+ argcc}
98_htmlargs_ {+ argel + argil + argfc + arghl}
99
100_htmlfunctions_ {argel = "";
101argil = "";
102argfc = "";
103arghl = "";
104
105function updateel () \{
106 value = document.PrefForm.el.options[document.PrefForm.el.selectedIndex].value;
107 if (value != "_cgiargel_") argel = "&el=" + value;
108 else argel = "";
109 updatehrefs();
110\}
111
112function updateil () \{
113 value = document.PrefForm.il.options[document.PrefForm.il.selectedIndex].value;
114 if (value != "_cgiargil_") argil = "&il=" + value;
115 else argil = "";
116 updatehrefs();
117\}
118
119function updatefc(value) \{
120 if (value != _cgiargfc_) argfc = "&fc=" + value + "&f=" + value;
121 else argfc = "";
122 updatehrefs();
123\}
124
125function updatehl(value) \{
126 if (value != _cgiarghl_) arghl = "&hl=" + value;
127 else arghl = "";
128 updatehrefs();
129\}
130}
131
132_pagescriptextra_ {
133// preferences scripts generated from \_preferences:pagescriptextra\_
134
135savedhrefs = new Object();
136
137argk = "";
138args = "";
139argm = "";
140argrd = "";
141argo = "";
142argb = "";
143argqf = "";
144arghd = "";
145argqb = "";
146argfqn = "";
147
148_If_(_collectionoption_,_ccsfunctions_,_standardfunctions_)
149_If_(_htmloptions_,_htmlfunctions_)
150_getargsfunction_
151function updatehrefs () \{
152 for (i = 0; i < document.links.length; i++)
153 document.links[i].href = savedhrefs[i] + getargs();
154\}
155
156function updatek (value) \{
157 if (value != _cgiargk_) argk = "&k=" + value;
158 else argk = "";
159 updatehrefs();
160\}
161
162function updates (value) \{
163 if (value != _cgiargs_) args = "&s=" + value;
164 else args = "";
165 updatehrefs();
166\}
167
168function updatem () \{
169 value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value;
170 if (value != _cgiargm_) argm = "&r=1&m=" + value;
171 else argm = "";
172 updatehrefs();
173\}
174
175function updaterd () \{
176 if (document.PrefForm.rd.checked)
177 _If_("_cgiargrd_" eq "1",argrd="";,argrd="&rd=1";)
178 else
179 _If_("_cgiargrd_" ne "1",argrd="";,argrd="&rd=0";)
180 updatehrefs();
181\}
182
183function updateo () \{
184 value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value;
185 if (value != _cgiargo_) argo = "&r=1&o=" + value;
186 else argo = "";
187 updatehrefs();
188\}
189
190function updatefqn () \{
191 value = document.PrefForm.fqn.options[document.PrefForm.fqn.selectedIndex].value;
192 if (value != _cgiargfqn_) argfqn = "&fqn=" + value;
193 else argfqn = "";
194 updatehrefs();
195\}
196
197function updateb (value) \{
198 if (value != _cgiargb_) argb = "&b=" + value;
199 else argb = "";
200 updatehrefs();
201\}
202function updateqf (value) \{
203 if (value != _cgiargqf_) argqf = "&qf=" + value;
204 else argqf = "";
205 updatehrefs();
206\}
207
208function updatehd() \{
209 arghd="";
210 if (document.PrefForm.hd[0].checked) \{
211 if ("_cgiarghd_" != "0") arghd = "&hd=0";
212 \}
213 else \{
214 value = document.PrefForm.hdn[document.PrefForm.hdn.selectedIndex].value;
215 if (_cgiarghd_ != value) arghd = "&hd="+value;
216 \}
217 updatehrefs();
218\}
219
220function updateqb(value) \{
221 if (value != _cgiargqb_) argqb = "&qb=" + value;
222 else argqb = "";
223 updatehrefs();
224\}
225
226function updatel () \{
227 value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
228 href = location.href;
229 if (href.match(/&l=[\\w\\-]+/)) href = href.replace(/&l=[\\w\\-]+/, "&l=" + value);
230 else href += "&l=" + value;
231 if (!location.href.match(/&nl=1$/)) href += "&nl=1";
232 location.href = href + getargs();
233\}
234
235function updatev () \{
236 value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
237 href = location.href;
238 if (href.match(/&v=\\d/)) href = href.replace(/&v=\\d/, "&v=" + value);
239 else href += "&v=" + value;
240 location.href = href + getargs();
241\}
242
243function updatew () \{
244 value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value;
245 href = location.href;
246 if (href.match(/&nw=[^&]+/)) href = href.replace(/&nw=[^&]+/, "&nw=" + value);
247 else href += "&nw=" + value;
248 if (!location.href.match(/&nl=0$/)) href += "&nl=0";
249 location.href = href + getargs();
250\}
251
252function updateqt (value) \{
253 if (value != _cgiargqt_) location.href = location.href + "&qt=" + value + getargs();
254\}
255}
256
257
258#######################################################################
259# headers
260# these are overridden so we can put an onLoad event handler
261# in the <body> tag of this page
262#######################################################################
263
264
265_header_ {_cgihead_
266_htmlhead_(background="_httpiconchalk_" onLoad="initialize();")_startspacer__pagebanner_
267}
268
269# this declaration ends up being the same as style=restrict, never mind
270_header_[v=1] {_cgihead_
271_htmlhead_(onLoad="initialize();")_pagebanner_
272}
273
274
275#######################################################################
276# page content
277#######################################################################
278
279_pagetitle_ {_collectionname_: _textpreferences_}
280_imagethispage_ {_iconthispage_}
281
282_htmloptions_ {}
283
284_htmloptionson_ {
285<p>
286<tr>_fcoption_</tr>
287<p>
288<tr>_hloption_</tr>
289<p>
290<tr>_extlinkoption_</tr>
291_If_(_PreferenceDocsFromWeb_,<p>
292<tr>_intlinkoption_</tr>)
293}
294
295_fcoption_ {
296<td valign=baseline>Document page layout</td>
297<td><input type=radio name=fc value=1 onClick="updatefc(1);"
298 _If_(_cgiargfc_, checked)>navigation bar at top<br>
299<input type=radio name=fc value=0 onClick="updatefc(0);"
300 _If_(_cgiargfc_,, checked)>no navigation bar</td>
301}
302
303_hloption_ {
304<td valign=baseline>Search term highlighting</td>
305<td><input type=radio name=hl value=1 onClick="updatehl(1);"
306 _If_(_cgiarghl_, checked)>highlight search terms<br>
307<input type=radio name=hl value=0 onClick="updatehl(0);"
308 _If_(_cgiarghl_,, checked)>don't highlight search terms</td>
309}
310
311#search pref options
312_boxsizeoption_{
313<td valign=baseline>_textqueryboxsize_</td>
314<td><input type=radio name=qb value=0 onClick="updateqb(0);"
315 _If_(_cgiargqb_,, checked)>_textregbox_<br>
316<input type=radio name=qb value=1 onClick="updateqb(1);"
317 _If_(_cgiargqb_, checked)>_textbigbox_</td>
318}
319
320_caseoption_ {
321<td valign=baseline>_textcasediffs_</td>
322<td><input type=radio name=k value=1 onClick="updatek(1);"
323 _If_(_cgiargk_, checked)>_textignorecase_<br>
324<input type=radio name=k value=0 onClick="updatek(0);"
325 _If_(_cgiargk_,, checked)>_textmatchcase_</td>
326}
327
328_caseoption_ [l=ar] {}
329_caseoption_ [l=zh] {}
330
331_stemoption_ {
332<td valign=baseline>_textwordends_</td>
333<td><input type=radio name=s value=1 onClick="updates(1);"
334 _If_(_cgiargs_, checked)>_textstem_<br>
335<input type=radio name=s value=0 onClick="updates(0);"
336 _If_(_cgiargs_,, checked)>_textnostem_</td>
337}
338
339_stemoption_ [l=zh] {}
340
341
342_modeoption_ {
343<td valign=baseline>_textquerymode_</td>
344<td><input type=radio name=b value=0 onClick="updateb(0);"
345 _If_(_cgiargb_,, checked)>_textsimplemode_<br>
346<input type=radio name=b value=1 onClick="updateb(1);"
347 _If_(_cgiargb_, checked)>_textadvancedmode_</td>
348}
349
350_formmodeoption_{
351<td valign=baseline>_textformtype_</td>
352<td><input type=radio name=qf value=0 onClick="updateqf(0);"
353 _If_(_cgiargf_,, checked)>_textsimple_<br>
354<input type=radio name=qf value=1 onClick="updateqf(1);"
355 _If_(_cgiargqf_, checked)>_textadvanced_</td>
356}
357
358_formnumfieldoption_ {<td></td><td>_textwith_
359<select name="fqn" onChange="updatefqn();">
360 <option value="2"_If_("_cgiargfqn_" eq "2", selected)>2
361 <option value="4"_If_("_cgiargfqn_" eq "4", selected)>4
362 <option value="6"_If_("_cgiargfqn_" eq "6", selected)>6
363 <option value="8"_If_("_cgiargfqn_" eq "8", selected)>8
364</select>_textfields_</td>
365}
366
367_searchhistoryop_ {
368<td valign=baseline>_textsearchhistory_</td>
369<td><input type=radio name="hd" value=0 onClick="updatehd();"
370 _If_("_cgiarghd_" eq "0", checked)>_textnohistorydisplay_<br>
371<input type=radio name="hd" value=1 onClick="updatehd();"
372 _If_("_cgiarghd_" eq "0",, checked)>_texthistorydisplay_</td>
373}
374
375_relateddocop_ {
376<td colspan=2><nobr><input type=checkbox name="rd" value=1 onClick="updaterd();" _If_("_cgiargrd_" eq "1", checked)>
377Display related documents</nobr></td>
378}
379
380_historynumrecords_{<select name="hdn" onChange="updatehd();">
381 <option value="5"_If_("_cgiarghd_" eq "5", selected)>5
382 <option value="10"_If_("_cgiarghd_" eq "10", selected)>10
383 <option value="15"_If_("_cgiarghd_" eq "15", selected)>15
384 <option value="20"_If_("_cgiarghd_" eq "20", selected)>20
385</select>}
386
387_maxdocoption_ {
388<select name="m" onChange="updatem();">
389 <option value="50"_If_("_cgiargm_" eq "50", selected)>50
390 <option value="100"_If_("_cgiargm_" eq "100", selected)>100
391 <option value="200"_If_("_cgiargm_" eq "200", selected)>200
392</select>
393}
394
395_hitsperpageoption_ {
396<select name="o" onChange="updateo();">
397 <option value="10"_If_("_cgiargo_" eq "10", selected)>10
398 <option value="20"_If_("_cgiargo_" eq "20", selected)>20
399 <option value="50"_If_("_cgiargo_" eq "50", selected)>50
400 <option value="100")_If_("_cgiargo_" eq "100", selected)>_textall_
401</select>
402}
403
404_extlinkoption_ {
405<td>_textextlink_</td>
406<td><select name="el" onChange="updateel();">
407 <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
408 _textlinkinterm_
409 <option value="direct"_If_("_cgiargel_" eq "direct", selected)>
410 _textlinkdirect_
411</select></td>
412}
413
414_intlinkoption_ {
415<td>_textintlink_</td>
416<td><select name="il" onChange="updateil();">
417 <option value="l"_If_("_cgiargil_" eq "l", selected)>
418 _textdigitlib_
419 <option value="w"_If_("_cgiargil_" eq "w", selected)>
420 _textweb_
421</select></td>
422}
423
424# set from within pageaction
425_languageoption_ {}
426_encodingoption_ {}
427
428_formatoption_ {
429<td>_textformat_</td>
430<td><select name="v" onChange="updatev();">
431 <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
432 <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
433</select></td>
434}
435
436_content_ {
437<center>
438_navigationbar_
439</center>
440_If_(_prefschanged_,<p>_prefschanged_<br><center>_iconblankbar_</center>)
441
442<blockquote>
443
444<form name=PrefForm method=get action="_gwcgi_">
445
446<input type="hidden" name="e" value="_decodedcompressedoptions_">
447
448_If_(_collectionoption_,_collectionprefs_)
449_presentationprefs_
450_searchprefs_
451</blockquote>
452</form>
453}
454
455#search prefs
456_searchprefs_ {
457<center><table border=0 cellpadding=0 cellspacing=0 width=_pagewidth_><tr>
458<td><h3>_textsearchprefs_</h3></td>
459<td align=right><input type=submit name="bp" value="_textsetprefs_"></td>
460</tr></table></center>
461
462<table>
463_querytypedependantoptions_
464
465<tr>_caseoption_</tr>
466
467<tr>_stemoption_</tr>
468
469<tr>_searchhistoryop_</tr>
470
471<!--
472Don't include this for now
473<tr>_relateddocop_</tr>
474-->
475
476<tr><td colspan=2>_textprefop_</td></tr>
477</table>
478</blockquote>
479_iconblankbar_
480<blockquote>
481}
482
483_querytypedependantoptions_ {
484_If_("_cgiargct_" eq "0", _plainqueryoptions_,_mgppqueryoptions_)
485}
486
487_mgppqueryoptions_{
488 _If_("_cgiargqto_" eq "1", _plainqueryoptions_)
489 _If_("_cgiargqto_" eq "2", _formqueryoptions_)
490 _If_("_cgiargqto_" eq "3", _dualqueryoptions_)
491}
492
493#query options for mg colls and mgpp colls with only plain searching
494_plainqueryoptions_ {
495<tr>_modeoption_</tr>
496
497<tr>_boxsizeoption_</tr>
498}
499
500#query options for mgpp colls with only form searching
501_formqueryoptions_ {
502<noscript><tr><td colspan=2><b>_query:textnojsformwarning_</b></td></tr></noscript>
503<tr>_formmodeoption_</tr>
504<tr>_formnumfieldoption_</tr>
505}
506
507#query options for mgpp colls with both types of search available
508_dualqueryoptions_ {
509<tr><td colspan=2><input type=radio name=qt value=0 onClick="updateqt(0);" _If_(_cgiargqt_,, checked)>_textplainsearch_</td></tr>
510<tr><td></td><td><table>_plainqueryoptions_</table></td></tr>
511<tr><td colspan=2><input type=radio name=qt value=1 onClick="updateqt(1);" _If_(_cgiargqt_,checked)>_textformsearch_</td></tr>
512<tr><td></td><td><table>_formqueryoptions_</table></td></tr>
513}
514
515_collectionprefs_ {
516<h3>_textcollectionprefs_</h3>
517_collectionoption_
518</blockquote>
519_iconblankbar_
520<blockquote>
521}
522
523_presentationprefs_ {
524<h3>_textpresentationprefs_</h3>
525<table>_htmloptions_
526
527_If_(_languageoption_,<tr><td>_textlanguage_</td><td>_languageoption_</td></tr>)
528
529_If_(_encodingoption_,<tr><td>_textencoding_</td><td>_encodingoption_</td></tr>)
530
531<tr>_formatoption_</tr></table>
532</blockquote>
533_iconblankbar_
534<blockquote>
535}
536
537
538#######################################################################
539# icons
540#######################################################################
541
542_iconthispage_ {<img src="_httpiconhpref_" alt="_textpreferences_" title="_textpreferences_" width="_widthhpref_" height="_heighthpref_">}
Note: See TracBrowser for help on using the repository browser.