source: branches/New_Config_Format-branch/gsdl/macros/pref.dm@ 1279

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

merged changes to trunk into New_Config_Format branch

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 10.3 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_caseoption_ [l=ar] {}
256
257_fcoption_ {
258<input type=checkbox name=fc onClick="updatefc();"_If_("_cgiargfc_" eq "1", checked)>
259_textfcoption_
260}
261
262_hloption_ {
263<input type=checkbox name=hl onClick="updatehl();"_If_("_cgiarghl_" eq "1", checked)>
264_texthloption_
265}
266
267_caseoption_ [l=zh] {}
268
269_stemoption_ {
270<input type=radio name=s value=1 onClick="updates(1);"
271 _If_(_cgiargs_, checked)>_textstem_<br>
272<input type=radio name=s value=0 onClick="updates(0);"
273 _If_(_cgiargs_,, checked)>_textnostem_
274}
275
276_stemoption_ [l=zh] {}
277
278_maxdocoption_ {
279<select name="m" onChange="updatem();">
280 <option value="50"_If_("_cgiargm_" eq "50", selected)>50
281 <option value="100"_If_("_cgiargm_" eq "100", selected)>100
282 <option value="200"_If_("_cgiargm_" eq "200", selected)>200
283</select>
284}
285
286_hitsperpageoption_ {
287<select name="o" onChange="updateo();">
288 <option value="10"_If_("_cgiargo_" eq "10", selected)>10
289 <option value="20"_If_("_cgiargo_" eq "20", selected)>20
290 <option value="50"_If_("_cgiargo_" eq "50", selected)>50
291 <option value="100")_If_("_cgiargo_" eq "100", selected)>_textall_
292</select>
293}
294
295_modeoption_ {
296<input type=radio name=b value=0 onClick="updateb(0);"
297 _If_(_cgiargb_,, checked)>_textsimplemode_<br>
298<input type=radio name=b value=1 onClick="updateb(1);"
299 _If_(_cgiargb_, checked)>_textadvancedmode_
300}
301
302_searchhistoryop_ {
303<input type=checkbox name="hd" onClick="updatehd();"
304 _If_("_cgiarghd_" eq "1", checked)>_texthistorydisplay_
305}
306
307_extlinkoption_ {
308_textextlink_
309<select name="el" onChange="updateel();">
310 <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
311 _textlinkinterm_
312 <option value="direct"_If_("_cgiargel_" eq "direct", selected)>
313 _textlinkdirect_
314</select>
315}
316
317_intlinkoption_ {
318_textintlink_
319<select name="il" onChange="updateil();">
320 <option value="l"_If_("_cgiargil_" eq "l", selected)>
321 _textdigitlib_
322 <option value="w"_If_("_cgiargil_" eq "w", selected)>
323 _textweb_
324</select>
325}
326
327_languageoption_ {}
328
329_enlanguageoption_ {<option value="en"_If_("_cgiargl_",, selected)_If_("_cgiargl_" eq "en", selected)>_textlangeng_}
330_delanguageoption_ {<option value="de"_If_("_cgiargl_" eq "de", selected)>_textlanggerman_}
331_frlanguageoption_ {<option value="fr"_If_("_cgiargl_" eq "fr", selected)>_textlangfrench_}
332_eslanguageoption_ {<option value="es"_If_("_cgiargl_" eq "es", selected)>_textlangspanish_}
333_milanguageoption_ {<option value="mi"_If_("_cgiargl_" eq "mi", selected)>_textlangmaori_}
334_zhlanguageoption_ {<option value="zh"_If_("_cgiargl_" eq "zh", selected)>_textlangchinese_}
335_arlanguageoption_ {<option value="ar"_If_("_cgiargl_" eq "ar", selected)>_textlangarabic_}
336
337_encodingoption_ {
338_textencoding_
339<select name="w" onChange="updatew();">
340 <option value="w" _If_("_cgiargw_" eq "w",selected)>Western (ISO-8859-1)
341 <option value="u" _If_("_cgiargw_" eq "u",selected)>UTF-8
342 <option value="g" _If_("_cgiargw_" eq "g",selected)>GBK
343 <option value="a" _If_("_cgiargw_" eq "a",selected)>Arabic (windows 1256)
344</select>
345}
346
347_formatoption_ {
348_textformat_
349<select name="v" onChange="updatev();">
350 <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
351 <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
352</select>
353}
354
355_content_ {
356<center>
357_navigationbar_
358</center>
359<blockquote>
360
361<form name=PrefForm method=get action="_gwcgi_">
362
363<input type="hidden" name="e" value="_decodedcompressedoptions_">
364
365_If_(_collectionoption_,_collectionprefs_)
366_presentationprefs_
367_searchprefs_
368
369</blockquote>
370</form>
371}
372
373_searchprefs_ {
374<h3>_textsearchprefs_</h3>
375<p>
376_caseoption_
377
378<p>
379_stemoption_
380
381<p>
382_modeoption_
383
384<p>
385_searchhistoryop_
386
387<p>
388_textprefop_
389<br>_iconblankbar_
390}
391
392_collectionprefs_ {
393<h3>_textcollectionprefs_</h3>
394_collectionoption_
395<br>_iconblankbar_
396}
397
398_presentationprefs_ {
399<h3>_textpresentationprefs_</h3>
400_htmloptions_
401
402<p>
403_languageoption_
404
405<p>
406_encodingoption_
407
408<p>
409_formatoption_
410<br>_iconblankbar_
411}
412
413#######################################################################
414# icons
415#######################################################################
416
417_iconthispage_ {<img src="_httpiconhpref_" alt="_textpreferences_" width="_widthhpref_" height="_heighthpref_">}
418
419
420
421
422
423
424
425
Note: See TracBrowser for help on using the repository browser.