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

Last change on this file since 1946 was 1946, checked in by jmt14, 23 years ago

* empty log message *

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 11.4 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
68 for (i in savedccs)
69 if (savedccs[i] == 1) \{
70 argcc += "&cc=" + i;
71 changed = 1;
72 \}
73 if (changed == 1) argcc += "&r=1";
74
75 updatehrefs();
76\}
77}
78
79_standardfunctions_ {
80function initialize () \{
81 for (i = 0; i < document.links.length; i++)
82 savedhrefs[i] = document.links[i].href;
83\}
84}
85
86_getargsfunction_ {
87function getargs () \{
88 return argk + args + argm + argo + arghd + argrd + argb + argqb + argfqn_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
89\}
90}
91
92_ccsargs_ {+ argcc}
93_htmlargs_ {+ argel + argil + argfc + arghl}
94
95_htmlfunctions_ {argel = "";
96argil = "";
97argfc = "";
98arghl = "";
99
100function updateel () \{
101 value = document.PrefForm.el.options[document.PrefForm.el.selectedIndex].value;
102 if (value != "_cgiargel_") argel = "&el=" + value;
103 else argel = "";
104 updatehrefs();
105\}
106
107function updateil () \{
108 value = document.PrefForm.il.options[document.PrefForm.il.selectedIndex].value;
109 if (value != "_cgiargil_") argil = "&il=" + value;
110 else argil = "";
111 updatehrefs();
112\}
113
114function updatefc () \{
115 if (document.PrefForm.fc.checked)
116 _If_("_cgiargfc_" eq "1",_argfcblank_,_argfcon_)
117 else
118 _If_("_cgiargfc_" ne "1",_argfcblank_,_argfcoff_)
119 updatehrefs();
120\}
121
122function updatehl () \{
123 if (document.PrefForm.hl.checked)
124 _If_("_cgiarghl_" eq "1",_arghlblank_,_arghlon_)
125 else
126 _If_("_cgiarghl_" ne "1",_arghlblank_,_arghloff_)
127 updatehrefs();
128\}
129}
130
131_argfcblank_ {argfc = "";}
132_argfcon_ {argfc = "&fc=1&f=1";}
133_argfcoff_ {argfc = "&fc=0&f=0";}
134
135_arghlblank_ {arghl = "";}
136_arghlon_ {arghl = "&hl=1";}
137_arghloff_ {arghl = "&hl=0";}
138
139_arghdblank_ {arghd = "";}
140_arghdon_ {arghd = "&hd=1";}
141_arghdoff_{arghd = "&hd=0";}
142
143_argrdblank_ {argrd = "";}
144_argrdon_ {argrd = "&rd=1";}
145_argrdoff_{argrd = "&rd=0";}
146
147_pagescriptextra_ {
148// preferences scripts generated from \_preferences:pagescriptextra\_
149
150savedhrefs = new Object();
151
152argk = "";
153args = "";
154argm = "";
155argo = "";
156argb = "";
157arghd = "";
158argrd = "";
159argqb = "";
160argfqn = "";
161
162_If_(_collectionoption_,_ccsfunctions_,_standardfunctions_)
163_If_(_htmloptions_,_htmlfunctions_)
164_getargsfunction_
165function updatehrefs () \{
166 for (i = 0; i < document.links.length; i++)
167 document.links[i].href = savedhrefs[i] + getargs();
168\}
169
170function updatek (value) \{
171 if (value != _cgiargk_) argk = "&k=" + value;
172 else argk = "";
173 updatehrefs();
174\}
175
176function updates (value) \{
177 if (value != _cgiargs_) args = "&s=" + value;
178 else args = "";
179 updatehrefs();
180\}
181
182function updatem () \{
183 value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value;
184 if (value != _cgiargm_) argm = "&r=1&m=" + value;
185 else argm = "";
186 updatehrefs();
187\}
188
189function updateo () \{
190 value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value;
191 if (value != _cgiargo_) argo = "&r=1&o=" + value;
192 else argo = "";
193 updatehrefs();
194\}
195
196function updateb (value) \{
197 if (value != _cgiargb_) argb = "&b=" + value;
198 else argb = "";
199 updatehrefs();
200\}
201
202
203function updatehd() \{
204 arghd="";
205 if (document.PrefForm.hd[0].checked) \{
206 if ("_cgiarghd_" != "0") arghd = "&hd=0";
207 \}
208 else \{
209 value = document.PrefForm.hdn[document.PrefForm.hdn.selectedIndex].value;
210 if (_cgiarghd_ != value) arghd = "&hd="+value;
211 \}
212
213function updateqb(value) \{
214 if (value != _cgiargqb_) argqb = "&qb=" + value;
215 else argqb = "";
216\}
217
218function updaterd () \{
219 if (document.PrefForm.rd.checked)
220 _If_("_cgiargrd_" eq "1",_argrdblank_,_argrdon_)
221 else
222 _If_("_cgiargrd_" ne "1",_argrdblank_,_argrdoff_)
223 updatehrefs();
224\}
225
226function updatel () \{
227 value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
228 location.href = location.href + "&nl=1&l=" + value + getargs();
229\}
230
231function updatev () \{
232 value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
233 location.href = location.href + "&v=" + value + getargs();
234\}
235
236function updatew () \{
237 value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value;
238 location.href = location.href + "&nl=0&nw=" + value + getargs();
239 \}
240
241 function updateqt () \{
242 value = document.PrefForm.qt.options[document.PrefForm.qt.selectedIndex].value;
243 location.href = location.href + "&qt=" + value + getargs();
244\}
245
246}
247
248#######################################################################
249# headers
250# these are overridden so we can put an onLoad event handler
251# in the <body> tag of this page
252#######################################################################
253
254
255_header_ {_cgihead_
256_htmlhead_(background="_httpiconchalk_" onLoad="initialize();")_startspacer__pagebanner_
257}
258
259# this declaration ends up being the same as style=restrict, never mind
260_header_[v=1] {_cgihead_
261_htmlhead_(onLoad="initialize();")_pagebanner_
262}
263
264
265#######################################################################
266# page content
267#######################################################################
268
269_pagetitle_ {_collectionname_: _textpreferences_}
270_imagethispage_ {_iconthispage_}
271
272_htmloptions_ {}
273
274_htmloptionson_ {
275<p>
276<tr><td colspan=2>_fcoption_</td></tr>
277<p>
278<tr><td colspan=2>_hloption_</td></tr>
279<p>
280<tr>_extlinkoption_</tr>
281_If_(_PreferenceDocsFromWeb_,<p>
282<tr>_intlinkoption_</tr>)
283}
284
285#search pref options
286 _boxsizeoption_{
287 <td valign=baseline>_textqueryboxsize_</td>
288 <td><input type=radio name=qb value=0 onClick="updateqb(0);"
289 _If_(_cgiargqb_,, checked)>_textregbox_<br>
290 <input type=radio name=qb value=1 onClick="updateqb(1);"
291 _If_(_cgiargqb_, checked)>_textbigbox_</td>
292 }
293
294 _caseoption_ {
295 <td valign=baseline>_textcasediffs_</td>
296 <td><input type=radio name=k value=1 onClick="updatek(1);"
297 _If_(_cgiargk_, checked)>_textignorecase_<br>
298 <input type=radio name=k value=0 onClick="updatek(0);"
299 _If_(_cgiargk_,, checked)>_textmatchcase_</td>
300 }
301
302 _caseoption_ [l=ar] {}
303
304_fcoption_ {
305<input type=checkbox name=fc onClick="updatefc();"_If_("_cgiargfc_" eq "1", checked)>
306_textfcoption_
307}
308
309_hloption_ {
310<input type=checkbox name=hl onClick="updatehl();"_If_("_cgiarghl_" eq "1", checked)>
311_texthloption_
312}
313
314_caseoption_ [l=zh] {}
315
316_stemoption_ {
317<input type=radio name=s value=1 onClick="updates(1);"
318 _If_(_cgiargs_, checked)>_textstem_<br>
319<input type=radio name=s value=0 onClick="updates(0);"
320 _If_(_cgiargs_,, checked)>_textnostem_</td>
321}
322
323_stemoption_ [l=zh] {}
324
325_maxdocoption_ {
326<select name="m" onChange="updatem();">
327 <option value="50"_If_("_cgiargm_" eq "50", selected)>50
328 <option value="100"_If_("_cgiargm_" eq "100", selected)>100
329 <option value="200"_If_("_cgiargm_" eq "200", selected)>200
330</select>
331}
332
333_hitsperpageoption_ {
334<select name="o" onChange="updateo();">
335 <option value="10"_If_("_cgiargo_" eq "10", selected)>10
336 <option value="20"_If_("_cgiargo_" eq "20", selected)>20
337 <option value="50"_If_("_cgiargo_" eq "50", selected)>50
338 <option value="100")_If_("_cgiargo_" eq "100", selected)>_textall_
339</select>
340}
341
342modeoption_ {
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
351 _searchhistoryop_ {
352 <td valign=baseline>_textsearchhistory_</td>
353 <td><input type=radio name="hd" value=0 onClick="updatehd();"
354 _If_("_cgiarghd_" eq "0", checked)>_textnohistorydisplay_<br>
355 <input type=radio name="hd" value=1 onClick="updatehd();"
356 _If_("_cgiarghd_" eq "0",, checked)>_texthistorydisplay_</td>
357 }
358
359 _historynumrecords_{<select name="hdn" onChange="updatehd();">
360 <option value="5"_If_("_cgiarghd_" eq "5", selected)>5
361 <option value="10"_If_("_cgiarghd_" eq "10", selected)>10
362 <option value="15"_If_("_cgiarghd_" eq "15", selected)>15
363 <option value="20"_If_("_cgiarghd_" eq "20", selected)>20
364 </select>}
365
366_relateddocop_ {
367<input type=checkbox name="rd" onClick="updaterd();"
368 _If_("_cgiargrd_" eq "1", checked)>_textrelateddocdisplay_
369}
370
371_extlinkoption_ {
372<td>_textextlink_</td>
373< <td><select name="el" onChange="updateel();">
374
375 <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
376 _textlinkinterm_
377 <option value="direct"_If_("_cgiargel_" eq "direct", selected)>
378 _textlinkdirect_
379</select></td>
380}
381
382_intlinkoption_ {
383<td>_textintlink_</td>
384< <td><select name="il" onChange="updateil();">
385 <option value="l"_If_("_cgiargil_" eq "l", selected)>
386 _textdigitlib_
387 <option value="w"_If_("_cgiargil_" eq "w", selected)>
388 _textweb_
389</select></td>
390}
391
392_languageoption_ {}
393
394_encodingoption_ {}
395
396_formatoption_ {
397<td>_textformat_</td>
398 <td><select name="v" onChange="updatev();">
399 <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
400 <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
401</select></td>
402}
403
404_content_ {
405<center>
406_navigationbar_
407</center>
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_searchprefs_
417
418</blockquote>
419</form>
420}
421
422_searchprefs_ {
423<h3>_textsearchprefs_</h3>
424<p>
425_caseoption_
426
427<p>
428_stemoption_
429
430<p>
431_modeoption_
432
433<p>
434_searchhistoryop_
435
436<p>
437_relateddocop_
438
439<p>
440_textprefop_
441<br>_iconblankbar_
442}
443
444_collectionprefs_ {
445<h3>_textcollectionprefs_</h3>
446_collectionoption_
447<br>_iconblankbar_
448}
449
450_presentationprefs_ {
451<h3>_textpresentationprefs_</h3>
452_htmloptions_
453
454<p>
455_languageoption_
456
457<p>
458_encodingoption_
459
460<p>
461_formatoption_
462<br>_iconblankbar_
463}
464
465#######################################################################
466# icons
467#######################################################################
468
469_iconthispage_ {<img src="_httpiconhpref_" alt="_textpreferences_" width="_widthhpref_" height="_heighthpref_">}
470
471
472
473
474
475
476
477
478
479
Note: See TracBrowser for help on using the repository browser.