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

Last change on this file since 1019 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
RevLine 
[128]1package preferences
2
[876]3# set within server
[128]4
[876]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
[148]14#######################################################################
[283]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
[548]22_javalinks_ {_imagehome__imagehelp_}
23_javalinks_ [v=1] {
[283]24_imagehome_<br>
25_imagehelp_<br>
26}
27
28
29#######################################################################
[276]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
[876]36_ccsfunctions_ {argcc = "";
37savedccs = new Object();
[276]38
[876]39function initialize () \{
40 for (i = 0; i < document.links.length; i++)
41 savedhrefs[i] = document.links[i].href;
[276]42
[876]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\}
[276]59
[876]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}
[276]71
[876]72_standardfunctions_ {
73function initialize () \{
74 for (i = 0; i < document.links.length; i++)
75 savedhrefs[i] = document.links[i].href;
76\}
77}
[276]78
[876]79_getargsfunction_ {
80function getargs () \{
[942]81 return argk + args + argm + argo + arghd + argb_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
[876]82\}
83}
[276]84
[876]85_ccsargs_ {+ argcc}
86_htmlargs_ {+ argel + argil + argfc + arghl}
[276]87
[876]88_htmlfunctions_ {argel = "";
89argil = "";
90argfc = "";
91arghl = "";
[276]92
[876]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\}
[276]99
[876]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\}
[548]106
[876]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\}
[725]114
[876]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}
[725]123
[876]124_argfcblank_ {argfc = "";}
125_argfcon_ {argfc = "&fc=1&f=1";}
126_argfcoff_ {argfc = "&fc=0&f=0";}
[276]127
[876]128_arghlblank_ {arghl = "";}
129_arghlon_ {arghl = "&hl=1";}
130_arghloff_ {arghl = "&hl=0";}
[591]131
[942]132_arghdblank_ {arghd = "";}
133_arghdon_ {arghd = "&hd=1";}
134_arghdoff_{arghd = "&hd=0";}
135
[876]136_pagescriptextra_ {
137// preferences scripts generated from \_preferences:pagescriptextra\_
[591]138
[876]139savedhrefs = new Object();
140
141argk = "";
142args = "";
143argm = "";
144argo = "";
145argb = "";
[942]146arghd = "";
[901]147_If_(_collectionoption_,_ccsfunctions_,_standardfunctions_)
[876]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
[942]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
[876]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\}
[276]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
[548]223_header_[v=1] {_cgihead_
[276]224_htmlhead_(onLoad="initialize();")_pagebanner_
225}
226
227
228#######################################################################
[148]229# page content
230#######################################################################
[128]231
[148]232_pagetitle_ {_collectionname_: _textpreferences_}
233_imagethispage_ {_iconthispage_}
234
[876]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
[128]248_caseoption_ {
[591]249<input type=radio name=k value=1 onClick="updatek(1);"
[180]250 _If_(_cgiargk_, checked)>_textignorecase_<br>
[591]251<input type=radio name=k value=0 onClick="updatek(0);"
[180]252 _If_(_cgiargk_,, checked)>_textmatchcase_
[128]253}
254
[876]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
[666]265_caseoption_ [l=zh] {}
266
[128]267_stemoption_ {
[591]268<input type=radio name=s value=1 onClick="updates(1);"
[876]269 _If_(_cgiargs_, checked)>_textstem_<br>
[591]270<input type=radio name=s value=0 onClick="updates(0);"
[876]271 _If_(_cgiargs_,, checked)>_textnostem_
[128]272}
273
[666]274_stemoption_ [l=zh] {}
275
[128]276_maxdocoption_ {
[591]277<select name="m" onChange="updatem();">
[180]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
[128]281</select>
282}
283
284_hitsperpageoption_ {
[591]285<select name="o" onChange="updateo();">
[180]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
[876]289 <option value="100")_If_("_cgiargo_" eq "100", selected)>_textall_
[128]290</select>
291}
292
[548]293_modeoption_ {
[591]294<input type=radio name=b value=0 onClick="updateb(0);"
[548]295 _If_(_cgiargb_,, checked)>_textsimplemode_<br>
[591]296<input type=radio name=b value=1 onClick="updateb(1);"
[548]297 _If_(_cgiargb_, checked)>_textadvancedmode_
298}
299
[942]300_searchhistoryop_ {
301<input type=checkbox name="hd" onClick="updatehd();"
302 _If_("_cgiarghd_" eq "1", checked)>_texthistorydisplay_
303}
304
[725]305_extlinkoption_ {
306_textextlink_
307<select name="el" onChange="updateel();">
308 <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
[876]309 _textlinkinterm_
[725]310 <option value="direct"_If_("_cgiargel_" eq "direct", selected)>
[876]311 _textlinkdirect_
[725]312</select>
313}
314
315_intlinkoption_ {
316_textintlink_
317<select name="il" onChange="updateil();">
318 <option value="l"_If_("_cgiargil_" eq "l", selected)>
[876]319 _textdigitlib_
[725]320 <option value="w"_If_("_cgiargil_" eq "w", selected)>
[876]321 _textweb_
[725]322</select>
323}
324
[876]325_languageoption_ {}
[725]326
[876]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_}
[276]330
[591]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
[276]340_formatoption_ {
341_textformat_
[591]342<select name="v" onChange="updatev();">
[644]343 <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
344 <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
[276]345</select>
346}
347
[128]348_content_ {
[276]349<center>
350_navigationbar_
351</center>
[128]352<blockquote>
353
354<form name=PrefForm method=get action="_gwcgi_">
355
[876]356<input type="hidden" name="e" value="_decodedcompressedoptions_">
[128]357
[876]358_If_(_collectionoption_,_collectionprefs_)
359_presentationprefs_
360_searchprefs_
361
362</blockquote>
363</form>
364}
365
366_searchprefs_ {
367<h3>_textsearchprefs_</h3>
[725]368<p>
369_caseoption_
[128]370
[725]371<p>
372_stemoption_
[128]373
374<p>
[548]375_modeoption_
376
377<p>
[942]378_searchhistoryop_
379
380<p>
[876]381_textprefop_
382<br>_iconblankbar_
383}
[725]384
[876]385_collectionprefs_ {
386<h3>_textcollectionprefs_</h3>
387_collectionoption_
388<br>_iconblankbar_
389}
[725]390
[876]391_presentationprefs_ {
392<h3>_textpresentationprefs_</h3>
393_htmloptions_
394
[725]395<p>
[276]396_languageoption_
397
398<p>
[591]399_encodingoption_
400
401<p>
[276]402_formatoption_
[876]403<br>_iconblankbar_
[128]404}
[148]405
406#######################################################################
407# icons
408#######################################################################
409
410_iconthispage_ {<img src="_httpiconhpref_" alt="_textpreferences_" width="_widthhpref_" height="_heighthpref_">}
411
412
413
414
[644]415
[666]416
417
[148]418
Note: See TracBrowser for help on using the repository browser.