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

Last change on this file since 2014 was 1950, checked in by sjboddie, 23 years ago

* empty log message *

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