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

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

bug in collectionoption stuff

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