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

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

Added support for Cyrillic languages (windows codepage 1251) - yet to be
tested by anyone who understands any such language though ;)

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 10.7 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 + arghd + argb_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_arghdblank_ {arghd = "";}
138_arghdon_ {arghd = "&hd=1";}
139_arghdoff_{arghd = "&hd=0";}
140
141_pagescriptextra_ {
142// preferences scripts generated from \_preferences:pagescriptextra\_
143
144savedhrefs = new Object();
145
146argk = "";
147args = "";
148argm = "";
149argo = "";
150argb = "";
151arghd = "";
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 updateo () \{
180 value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value;
181 if (value != _cgiargo_) argo = "&r=1&o=" + value;
182 else argo = "";
183 updatehrefs();
184\}
185
186function updateb (value) \{
187 if (value != _cgiargb_) argb = "&b=" + value;
188 else argb = "";
189 updatehrefs();
190\}
191
192function updatehd () \{
193 if (document.PrefForm.hd.checked)
194 _If_("_cgiarghd_" eq "1",_arghdblank_,_arghdon_)
195 else
196 _If_("_cgiarghd_" ne "1",_arghdblank_,_arghdoff_)
197 updatehrefs();
198\}
199
200function updatel () \{
201 value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
202 location.href = location.href + "&l=" + value + getargs();
203\}
204
205function updatev () \{
206 value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
207 location.href = location.href + "&v=" + value + getargs();
208\}
209
210function updatew () \{
211 value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value;
212 location.href = location.href + "&nw=" + value + getargs();
213\}
214}
215
216#######################################################################
217# headers
218# these are overridden so we can put an onLoad event handler
219# in the <body> tag of this page
220#######################################################################
221
222
223_header_ {_cgihead_
224_htmlhead_(background="_httpiconchalk_" onLoad="initialize();")_startspacer__pagebanner_
225}
226
227# this declaration ends up being the same as style=restrict, never mind
228_header_[v=1] {_cgihead_
229_htmlhead_(onLoad="initialize();")_pagebanner_
230}
231
232
233#######################################################################
234# page content
235#######################################################################
236
237_pagetitle_ {_collectionname_: _textpreferences_}
238_imagethispage_ {_iconthispage_}
239
240_htmloptions_ {}
241
242_htmloptionson_ {
243<p>
244_fcoption_
245<p>
246_hloption_
247<p>
248_extlinkoption_
249_If_(_PreferenceDocsFromWeb_,<p>
250_intlinkoption_)
251}
252
253_caseoption_ {
254<input type=radio name=k value=1 onClick="updatek(1);"
255 _If_(_cgiargk_, checked)>_textignorecase_<br>
256<input type=radio name=k value=0 onClick="updatek(0);"
257 _If_(_cgiargk_,, checked)>_textmatchcase_
258}
259
260_caseoption_ [l=ar] {}
261
262_fcoption_ {
263<input type=checkbox name=fc onClick="updatefc();"_If_("_cgiargfc_" eq "1", checked)>
264_textfcoption_
265}
266
267_hloption_ {
268<input type=checkbox name=hl onClick="updatehl();"_If_("_cgiarghl_" eq "1", checked)>
269_texthloption_
270}
271
272_caseoption_ [l=zh] {}
273
274_stemoption_ {
275<input type=radio name=s value=1 onClick="updates(1);"
276 _If_(_cgiargs_, checked)>_textstem_<br>
277<input type=radio name=s value=0 onClick="updates(0);"
278 _If_(_cgiargs_,, checked)>_textnostem_
279}
280
281_stemoption_ [l=zh] {}
282
283_maxdocoption_ {
284<select name="m" onChange="updatem();">
285 <option value="50"_If_("_cgiargm_" eq "50", selected)>50
286 <option value="100"_If_("_cgiargm_" eq "100", selected)>100
287 <option value="200"_If_("_cgiargm_" eq "200", selected)>200
288</select>
289}
290
291_hitsperpageoption_ {
292<select name="o" onChange="updateo();">
293 <option value="10"_If_("_cgiargo_" eq "10", selected)>10
294 <option value="20"_If_("_cgiargo_" eq "20", selected)>20
295 <option value="50"_If_("_cgiargo_" eq "50", selected)>50
296 <option value="100")_If_("_cgiargo_" eq "100", selected)>_textall_
297</select>
298}
299
300_modeoption_ {
301<input type=radio name=b value=0 onClick="updateb(0);"
302 _If_(_cgiargb_,, checked)>_textsimplemode_<br>
303<input type=radio name=b value=1 onClick="updateb(1);"
304 _If_(_cgiargb_, checked)>_textadvancedmode_
305}
306
307_searchhistoryop_ {
308<input type=checkbox name="hd" onClick="updatehd();"
309 _If_("_cgiarghd_" eq "1", checked)>_texthistorydisplay_
310}
311
312_extlinkoption_ {
313_textextlink_
314<select name="el" onChange="updateel();">
315 <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
316 _textlinkinterm_
317 <option value="direct"_If_("_cgiargel_" eq "direct", selected)>
318 _textlinkdirect_
319</select>
320}
321
322_intlinkoption_ {
323_textintlink_
324<select name="il" onChange="updateil();">
325 <option value="l"_If_("_cgiargil_" eq "l", selected)>
326 _textdigitlib_
327 <option value="w"_If_("_cgiargil_" eq "w", selected)>
328 _textweb_
329</select>
330}
331
332_languageoption_ {}
333
334_enlanguageoption_ {<option value="en"_If_("_cgiargl_",, selected)_If_("_cgiargl_" eq "en", selected)>_textlangeng_}
335_delanguageoption_ {<option value="de"_If_("_cgiargl_" eq "de", selected)>_textlanggerman_}
336_frlanguageoption_ {<option value="fr"_If_("_cgiargl_" eq "fr", selected)>_textlangfrench_}
337_eslanguageoption_ {<option value="es"_If_("_cgiargl_" eq "es", selected)>_textlangspanish_}
338_milanguageoption_ {<option value="mi"_If_("_cgiargl_" eq "mi", selected)>_textlangmaori_}
339_zhlanguageoption_ {<option value="zh"_If_("_cgiargl_" eq "zh", selected)>_textlangchinese_}
340_arlanguageoption_ {<option value="ar"_If_("_cgiargl_" eq "ar", selected)>_textlangarabic_}
341_ptlanguageoption_ {<option value="pt"_If_("_cgiargl_" eq "pt", selected)>_textlangportuguese_}
342_nllanguageoption_ {<option value="nl"_If_("_cgiargl_" eq "nl", selected)>_textlangdutch_}
343
344_encodingoption_ {
345_textencoding_
346<select name="w" onChange="updatew();">
347 <option value="w" _If_("_cgiargw_" eq "w",selected)>Western (ISO-8859-1)
348 <option value="u" _If_("_cgiargw_" eq "u",selected)>UTF-8
349 <option value="g" _If_("_cgiargw_" eq "g",selected)>GBK
350 <option value="a" _If_("_cgiargw_" eq "a",selected)>Arabic (windows 1256)
351 <option value="c" _If_("_cgiargw_" eq "c",selected)>Cyrillic (windows 1251)
352</select>
353}
354
355_formatoption_ {
356_textformat_
357<select name="v" onChange="updatev();">
358 <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
359 <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
360</select>
361}
362
363_content_ {
364<center>
365_navigationbar_
366</center>
367<blockquote>
368
369<form name=PrefForm method=get action="_gwcgi_">
370
371<input type="hidden" name="e" value="_decodedcompressedoptions_">
372
373_If_(_collectionoption_,_collectionprefs_)
374_presentationprefs_
375_searchprefs_
376
377</blockquote>
378</form>
379}
380
381_searchprefs_ {
382<h3>_textsearchprefs_</h3>
383<p>
384_caseoption_
385
386<p>
387_stemoption_
388
389<p>
390_modeoption_
391
392<p>
393_searchhistoryop_
394
395<p>
396_textprefop_
397<br>_iconblankbar_
398}
399
400_collectionprefs_ {
401<h3>_textcollectionprefs_</h3>
402_collectionoption_
403<br>_iconblankbar_
404}
405
406_presentationprefs_ {
407<h3>_textpresentationprefs_</h3>
408_htmloptions_
409
410<p>
411_languageoption_
412
413<p>
414_encodingoption_
415
416<p>
417_formatoption_
418<br>_iconblankbar_
419}
420
421#######################################################################
422# icons
423#######################################################################
424
425_iconthispage_ {<img src="_httpiconhpref_" alt="_textpreferences_" width="_widthhpref_" height="_heighthpref_">}
Note: See TracBrowser for help on using the repository browser.