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

Last change on this file since 944 was 942, checked in by sjboddie, 24 years ago

* empty log message *

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