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

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

Removed a bunch of _width_ macros from language macro files as they're
no longer used.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 14.0 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 (",");
[1950]45 for (i = 0; i < a.length ;i++) \{
[876]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;
[1950]63
[876]64 var i;
65 argcc = "";
[1717]66 var changed = 0;
[876]67 for (i in savedccs)
[1950]68 if (savedccs[i] == 1) \{
69 argcc += "&cc=" + i;
70 changed = 1;
71 \}
[1717]72 if (changed == 1) argcc += "&r=1";
[876]73 updatehrefs();
74\}
75}
[276]76
[876]77_standardfunctions_ {
78function initialize () \{
79 for (i = 0; i < document.links.length; i++)
80 savedhrefs[i] = document.links[i].href;
[2114]81 // only add form search option if mgpp (ct arg) and javascript
82_If_("_cgiargct_" eq "1",var opt=new Option\("_textformsearch_"\, "1"\); document.PrefForm.qt.options[1]=opt;,//)_If_("_cgiargqt_" eq "1",opt.selected=1;)
[876]83\}
84}
[276]85
[876]86_getargsfunction_ {
87function getargs () \{
[1950]88 return argk + args + argm + argo + argrd + arghd + argb + argqb + argfqn_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
[876]89\}
90}
[276]91
[876]92_ccsargs_ {+ argcc}
93_htmlargs_ {+ argel + argil + argfc + arghl}
[276]94
[876]95_htmlfunctions_ {argel = "";
96argil = "";
97argfc = "";
98arghl = "";
[276]99
[876]100function updateel () \{
101 value = document.PrefForm.el.options[document.PrefForm.el.selectedIndex].value;
102 if (value != "_cgiargel_") argel = "&el=" + value;
103 else argel = "";
104 updatehrefs();
105\}
[276]106
[876]107function updateil () \{
108 value = document.PrefForm.il.options[document.PrefForm.il.selectedIndex].value;
109 if (value != "_cgiargil_") argil = "&il=" + value;
110 else argil = "";
111 updatehrefs();
112\}
[548]113
[876]114function updatefc () \{
115 if (document.PrefForm.fc.checked)
116 _If_("_cgiargfc_" eq "1",_argfcblank_,_argfcon_)
117 else
118 _If_("_cgiargfc_" ne "1",_argfcblank_,_argfcoff_)
119 updatehrefs();
120\}
[725]121
[876]122function updatehl () \{
123 if (document.PrefForm.hl.checked)
124 _If_("_cgiarghl_" eq "1",_arghlblank_,_arghlon_)
125 else
126 _If_("_cgiarghl_" ne "1",_arghlblank_,_arghloff_)
127 updatehrefs();
128\}
129}
[725]130
[876]131_argfcblank_ {argfc = "";}
132_argfcon_ {argfc = "&fc=1&f=1";}
133_argfcoff_ {argfc = "&fc=0&f=0";}
[276]134
[876]135_arghlblank_ {arghl = "";}
136_arghlon_ {arghl = "&hl=1";}
137_arghloff_ {arghl = "&hl=0";}
[591]138
[876]139_pagescriptextra_ {
140// preferences scripts generated from \_preferences:pagescriptextra\_
[591]141
[876]142savedhrefs = new Object();
143
144argk = "";
145args = "";
146argm = "";
[1950]147argrd = "";
[876]148argo = "";
149argb = "";
[942]150arghd = "";
[1922]151argqb = "";
152argfqn = "";
153
[901]154_If_(_collectionoption_,_ccsfunctions_,_standardfunctions_)
[876]155_If_(_htmloptions_,_htmlfunctions_)
156_getargsfunction_
157function updatehrefs () \{
158 for (i = 0; i < document.links.length; i++)
159 document.links[i].href = savedhrefs[i] + getargs();
160\}
161
162function updatek (value) \{
163 if (value != _cgiargk_) argk = "&k=" + value;
164 else argk = "";
165 updatehrefs();
166\}
167
168function updates (value) \{
169 if (value != _cgiargs_) args = "&s=" + value;
170 else args = "";
171 updatehrefs();
172\}
173
174function updatem () \{
175 value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value;
176 if (value != _cgiargm_) argm = "&r=1&m=" + value;
177 else argm = "";
178 updatehrefs();
179\}
180
[1950]181function updaterd () \{
182 if (document.PrefForm.rd.checked)
183 _If_("_cgiargrd_" eq "1",argrd="";,argrd="&rd=1";)
184 else
185 _If_("_cgiargrd_" ne "1",argrd="";,argrd="&rd=0";)
186 updatehrefs();
187\}
188
[876]189function updateo () \{
190 value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value;
191 if (value != _cgiargo_) argo = "&r=1&o=" + value;
192 else argo = "";
193 updatehrefs();
194\}
195
[1950]196function updatefqn () \{
197 value = document.PrefForm.fqn.options[document.PrefForm.fqn.selectedIndex].value;
198 if (value != _cgiargfqn_) argfqn = "&fqn=" + value;
199 else argfqn = "";
200 updatehrefs();
201\}
202
[876]203function updateb (value) \{
204 if (value != _cgiargb_) argb = "&b=" + value;
205 else argb = "";
206 updatehrefs();
207\}
208
[1922]209function updatehd() \{
[1950]210 arghd="";
211 if (document.PrefForm.hd[0].checked) \{
212 if ("_cgiarghd_" != "0") arghd = "&hd=0";
213 \}
214 else \{
215 value = document.PrefForm.hdn[document.PrefForm.hdn.selectedIndex].value;
216 if (_cgiarghd_ != value) arghd = "&hd="+value;
217 \}
218 updatehrefs();
219\}
[1946]220
221function updateqb(value) \{
[1950]222 if (value != _cgiargqb_) argqb = "&qb=" + value;
223 else argqb = "";
[1922]224 updatehrefs();
225\}
226
[876]227function updatel () \{
228 value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
[2265]229 href = location.href;
230 if (href.match(/&l=\\w\\w/)) href = href.replace(/&l=\\w\\w/, "&l=" + value);
231 else href += "&l=" + value;
232 if (!location.href.match(/&nl=1$/)) href += "&nl=1";
233 location.href = href + getargs();
[876]234\}
235
236function updatev () \{
237 value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
[2265]238 href = location.href;
239 if (href.match(/&v=\\d/)) href = href.replace(/&v=\\d/, "&v=" + value);
240 else href += "&v=" + value;
241 location.href = href + getargs();
[876]242\}
243
244function updatew () \{
245 value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value;
[2265]246 href = location.href;
247 if (href.match(/&nw=[^&]+/)) href = href.replace(/&nw=[^&]+/, "&nw=" + value);
248 else href += "&nw=" + value;
249 if (!location.href.match(/&nl=0$/)) href += "&nl=0";
250 location.href = href + getargs();
[876]251\}
[1922]252
[1950]253function updateqt () \{
254 value = document.PrefForm.qt.options[document.PrefForm.qt.selectedIndex].value;
255 location.href = location.href + "&qt=" + value + getargs();
256\}
[276]257}
258
[1950]259
[276]260#######################################################################
261# headers
262# these are overridden so we can put an onLoad event handler
263# in the <body> tag of this page
264#######################################################################
265
266
267_header_ {_cgihead_
268_htmlhead_(background="_httpiconchalk_" onLoad="initialize();")_startspacer__pagebanner_
269}
270
271# this declaration ends up being the same as style=restrict, never mind
[548]272_header_[v=1] {_cgihead_
[276]273_htmlhead_(onLoad="initialize();")_pagebanner_
274}
275
276
277#######################################################################
[148]278# page content
279#######################################################################
[128]280
[148]281_pagetitle_ {_collectionname_: _textpreferences_}
282_imagethispage_ {_iconthispage_}
283
[876]284_htmloptions_ {}
285
286_htmloptionson_ {
287<p>
[1922]288<tr><td colspan=2>_fcoption_</td></tr>
[876]289<p>
[1922]290<tr><td colspan=2>_hloption_</td></tr>
[876]291<p>
[1922]292<tr>_extlinkoption_</tr>
[876]293_If_(_PreferenceDocsFromWeb_,<p>
[1922]294<tr>_intlinkoption_</tr>)
[876]295}
296
297_fcoption_ {
298<input type=checkbox name=fc onClick="updatefc();"_If_("_cgiargfc_" eq "1", checked)>
299_textfcoption_
300}
301
302_hloption_ {
303<input type=checkbox name=hl onClick="updatehl();"_If_("_cgiarghl_" eq "1", checked)>
304_texthloption_
305}
306
[1950]307#search pref options
308_boxsizeoption_{
309<td valign=baseline>_textqueryboxsize_</td>
310<td><input type=radio name=qb value=0 onClick="updateqb(0);"
311 _If_(_cgiargqb_,, checked)>_textregbox_<br>
312<input type=radio name=qb value=1 onClick="updateqb(1);"
313 _If_(_cgiargqb_, checked)>_textbigbox_</td>
314}
315
316_caseoption_ {
317<td valign=baseline>_textcasediffs_</td>
318<td><input type=radio name=k value=1 onClick="updatek(1);"
319 _If_(_cgiargk_, checked)>_textignorecase_<br>
320<input type=radio name=k value=0 onClick="updatek(0);"
321 _If_(_cgiargk_,, checked)>_textmatchcase_</td>
322}
323
324_caseoption_ [l=ar] {}
[666]325_caseoption_ [l=zh] {}
326
[128]327_stemoption_ {
[1950]328<td valign=baseline>_textwordends_</td>
329<td><input type=radio name=s value=1 onClick="updates(1);"
[876]330 _If_(_cgiargs_, checked)>_textstem_<br>
[591]331<input type=radio name=s value=0 onClick="updates(0);"
[1922]332 _If_(_cgiargs_,, checked)>_textnostem_</td>
[128]333}
334
[666]335_stemoption_ [l=zh] {}
336
[1950]337
338_modeoption_ {
339<td valign=baseline>_textquerymode_</td>
340<td><input type=radio name=b value=0 onClick="updateb(0);"
341 _If_(_cgiargb_,, checked)>_textsimplemode_<br>
342<input type=radio name=b value=1 onClick="updateb(1);"
343 _If_(_cgiargb_, checked)>_textadvancedmode_</td>
344}
345
346
347_searchhistoryop_ {
348<td valign=baseline>_textsearchhistory_</td>
349<td><input type=radio name="hd" value=0 onClick="updatehd();"
350 _If_("_cgiarghd_" eq "0", checked)>_textnohistorydisplay_<br>
351<input type=radio name="hd" value=1 onClick="updatehd();"
352 _If_("_cgiarghd_" eq "0",, checked)>_texthistorydisplay_</td>
353}
354
355_relateddocop_ {
[2106]356<td colspan=2><nobr><input type=checkbox name="rd" value=1 onClick="updaterd();" _If_("_cgiargrd_" eq "1", checked)>
[1950]357Display related documents</nobr></td>
358}
359
360_historynumrecords_{<select name="hdn" onChange="updatehd();">
361 <option value="5"_If_("_cgiarghd_" eq "5", selected)>5
362 <option value="10"_If_("_cgiarghd_" eq "10", selected)>10
363 <option value="15"_If_("_cgiarghd_" eq "15", selected)>15
364 <option value="20"_If_("_cgiarghd_" eq "20", selected)>20
365</select>}
366
[128]367_maxdocoption_ {
[591]368<select name="m" onChange="updatem();">
[180]369 <option value="50"_If_("_cgiargm_" eq "50", selected)>50
370 <option value="100"_If_("_cgiargm_" eq "100", selected)>100
371 <option value="200"_If_("_cgiargm_" eq "200", selected)>200
[128]372</select>
373}
374
375_hitsperpageoption_ {
[591]376<select name="o" onChange="updateo();">
[180]377 <option value="10"_If_("_cgiargo_" eq "10", selected)>10
378 <option value="20"_If_("_cgiargo_" eq "20", selected)>20
379 <option value="50"_If_("_cgiargo_" eq "50", selected)>50
[876]380 <option value="100")_If_("_cgiargo_" eq "100", selected)>_textall_
[128]381</select>
382}
383
[725]384_extlinkoption_ {
[1922]385<td>_textextlink_</td>
[1950]386<td><select name="el" onChange="updateel();">
[725]387 <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
[876]388 _textlinkinterm_
[725]389 <option value="direct"_If_("_cgiargel_" eq "direct", selected)>
[876]390 _textlinkdirect_
[1922]391</select></td>
[725]392}
393
394_intlinkoption_ {
[1922]395<td>_textintlink_</td>
[1950]396<td><select name="il" onChange="updateil();">
[725]397 <option value="l"_If_("_cgiargil_" eq "l", selected)>
[876]398 _textdigitlib_
[725]399 <option value="w"_If_("_cgiargil_" eq "w", selected)>
[876]400 _textweb_
[1922]401</select></td>
[725]402}
403
[1950]404# set from within pageaction
[876]405_languageoption_ {}
[1856]406_encodingoption_ {}
[725]407
[276]408_formatoption_ {
[1922]409<td>_textformat_</td>
[1950]410<td><select name="v" onChange="updatev();">
[644]411 <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
412 <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
[1922]413</select></td>
[276]414}
415
[128]416_content_ {
[276]417<center>
418_navigationbar_
419</center>
[1950]420
[128]421<blockquote>
422
423<form name=PrefForm method=get action="_gwcgi_">
424
[876]425<input type="hidden" name="e" value="_decodedcompressedoptions_">
[128]426
[876]427_If_(_collectionoption_,_collectionprefs_)
428_presentationprefs_
[1950]429_If_("_cgiargct_" eq "1",_mgppsearchprefs_,_mgsearchprefs_)
[876]430
431</blockquote>
432</form>
433}
434
[1950]435#search prefs for mg collections
436_mgsearchprefs_ {
[876]437<h3>_textsearchprefs_</h3>
[1950]438<table>
439<tr>_boxsizeoption_</tr>
[128]440
[1950]441<tr>_caseoption_</tr>
[128]442
[1950]443<tr>_stemoption_</tr>
[548]444
[1950]445<tr>_modeoption_</tr>
[942]446
[1950]447<tr>_searchhistoryop_</tr>
[1922]448
[2299]449<!--
450Don't include this for now
[1950]451<tr>_relateddocop_</tr>
[2299]452-->
[1950]453
454<tr><td colspan=2>_textprefop_</td></tr>
455</table>
456</blockquote>
457_iconblankbar_
458<blockquote>
[876]459}
[725]460
[876]461_collectionprefs_ {
462<h3>_textcollectionprefs_</h3>
463_collectionoption_
[1950]464</blockquote>
465_iconblankbar_
466<blockquote>
[876]467}
[725]468
[876]469_presentationprefs_ {
470<h3>_textpresentationprefs_</h3>
[1950]471<table>_htmloptions_
[876]472
[1950]473_If_(_languageoption_,<tr><td>_textlanguage_</td><td>_languageoption_</td></tr>)
[276]474
[1950]475_If_(_encodingoption_,<tr><td>_textencoding_</td><td>_encodingoption_</td></tr>)
[591]476
[1950]477<tr>_formatoption_</tr></table>
478</blockquote>
479_iconblankbar_
480<blockquote>
[128]481}
[148]482
[1950]483#######################################################
484## new stuff for prefs for form vs text search - for mgpp collections
485_mgppsearchprefs_ {
486<h3>_textsearchprefs_</h3>
487<table>
488<tr>_searchtypeop_</tr>
[1922]489
[1950]490_If_(_cgiargqt_,_formsearchoptions_,_textsearchoptions_)
[1922]491
[1950]492<tr>_caseoption_</tr>
[1922]493
[1950]494<tr>_stemoption_</tr>
[1922]495
[1950]496<tr>_searchhistoryop_</tr>
[1922]497
[1950]498<tr><td colspan=2>_textprefop_</td></tr></table>
[2106]499<input type=submit value="Update settings"><!--non-javascript users only-->
[1950]500</blockquote>
501_iconblankbar_
502<blockquote>
503}
[1922]504
505
[1950]506_searchtypeop_ {
507<td>_texttypesearch_</td>
508<td><select name="qt" onChange="updateqt();">
509 <option value="0"_If_("_cgiargqt_" eq "0", selected)>_texttextsearch_
[2114]510<!-- textformsearch option done in initialize function -->
[1950]511</select></td>
512}
[1922]513
[1950]514_formsearchoptions_ {
515<tr>_formmodeoption_</tr>
516}
[1922]517
[1950]518_textsearchoptions_ {
519<tr>_boxsizeoption_</tr>
520<tr>_modeoption_</tr>
521}
[1922]522
[1950]523_formmodeoption_{
524<td valign=baseline>_textformtype_</td>
525<td><input type=radio name=b value=0 onClick="updateb(0);"
526 _If_(_cgiargb_,, checked)>_textsimple_<br>
527<input type=radio name=b value=1 onClick="updateb(1);"
528 _If_(_cgiargb_, checked)>_textadvanced_<br>
529_formnumoption_</td>
530}
[1922]531
[1950]532_formnumoption_ {_textwith_
533<select name="fqn" onChange="updatefqn();">
534 <option value="2"_If_("_cgiargfqn_" eq "2", selected)>2
535 <option value="4"_If_("_cgiargfqn_" eq "4", selected)>4
536 <option value="6"_If_("_cgiargfqn_" eq "6", selected)>6
537 <option value="8"_If_("_cgiargfqn_" eq "8", selected)>8
538</select>_textfields_</td>
539}
540
541
542#######################################################################
543# icons
544#######################################################################
545
546_iconthispage_ {<img src="_httpiconhpref_" alt="_textpreferences_" width="_widthhpref_" height="_heighthpref_">}
Note: See TracBrowser for help on using the repository browser.