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

Last change on this file since 276 was 276, checked in by sjboddie, 25 years ago

lots of changes to all macro files

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 6.3 KB
Line 
1package preferences
2
3
4#######################################################################
5# scripts
6# note that changing either the "m" or the "o" argument
7# from the preferences page necessitates reseting the "r"
8# argument to 1
9#######################################################################
10
11_pagescriptextra_ {
12// preferences scripts generated from \_preferences:pagescriptextra\_
13
14 savedhrefs = new Object();
15
16 k\_arg = "";
17 s\_arg = "";
18 m\_arg = "";
19 o\_arg = "";
20
21 function initialize () \{
22 for (i = 0; i < document.links.length; i++)
23 savedhrefs[i] = document.links[i].href;
24 \}
25
26 function update\_hrefs () \{
27 for (i = 0; i < document.links.length; i++)
28 document.links[i].href = savedhrefs[i] + k\_arg + s\_arg + m\_arg + o\_arg;
29 \}
30
31 function k\_update (value) \{
32 if (value != _cgiargk_) k\_arg = "&k=" + value;
33 else k\_arg = "";
34 update\_hrefs();
35 \}
36
37 function s\_update (value) \{
38 if (value != _cgiargs_) s\_arg = "&s=" + value;
39 else s\_arg = "";
40 update\_hrefs();
41 \}
42
43 function m\_update () \{
44 value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value;
45 if (value != _cgiargm_) m\_arg = "&r=1&m=" + value;
46 else m\_arg = "";
47 update\_hrefs();
48 \}
49
50 function o\_update () \{
51 value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value;
52 if (value != _cgiargo_) o\_arg = "&r=1&o=" + value;
53 else o\_arg = "";
54 update\_hrefs();
55 \}
56
57 function l\_update () \{
58 value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
59 location.href = location.href + k\_arg + s\_arg + m\_arg + o\_arg + "&l=" + value;
60 \}
61
62 function v\_update () \{
63 value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
64 location.href = location.href + k\_arg + s\_arg + m\_arg + o\_arg + "&v=" + value;
65 \}
66}
67
68#######################################################################
69# headers
70# these are overridden so we can put an onLoad event handler
71# in the <body> tag of this page
72#######################################################################
73
74
75_header_ {_cgihead_
76_htmlhead_(background="_httpiconchalk_" onLoad="initialize();")_startspacer__pagebanner_
77}
78
79# this declaration ends up being the same as style=restrict, never mind
80_header_[version=text] {_cgihead_
81_htmlhead_(onLoad="initialize();")_pagebanner_
82}
83
84# style=restrict lacks the sidestripe, version links and
85# language links
86_header_[style=restrict] {_cgihead_
87_htmlhead_(onLoad="initialize();")_pagebanner_
88}
89
90
91#######################################################################
92# page content
93#######################################################################
94
95_pagetitle_ {_collectionname_: _textpreferences_}
96_imagethispage_ {_iconthispage_}
97
98_caseoption_ {
99<input type=radio name=k value=1 onClick="k\_update(1);"
100 _If_(_cgiargk_, checked)>_textignorecase_<br>
101<input type=radio name=k value=0 onClick="k\_update(0);"
102 _If_(_cgiargk_,, checked)>_textmatchcase_
103}
104
105_stemoption_ {
106<input type=radio name=s value=1 onClick="s\_update(1);"
107 _If_(_cgiargs_, checked)>_textstem_<br>
108<input type=radio name=s value=0 onClick="s\_update(0);"
109 _If_(_cgiargs_,, checked)>_textnostem_
110}
111
112_maxdocoption_ {
113<select name="m" onChange="m\_update();">
114 <option value="50"_If_("_cgiargm_" eq "50", selected)>50
115 <option value="100"_If_("_cgiargm_" eq "100", selected)>100
116 <option value="200"_If_("_cgiargm_" eq "200", selected)>200
117 <option value="500"_If_("_cgiargm_" eq "500", selected)>500
118</select>
119}
120
121_hitsperpageoption_ {
122<select name="o" onChange="o\_update();">
123 <option value="10"_If_("_cgiargo_" eq "10", selected)>10
124 <option value="20"_If_("_cgiargo_" eq "20", selected)>20
125 <option value="50"_If_("_cgiargo_" eq "50", selected)>50
126 <option value="100")_If_("_cgiargo_" eq "100", selected)>100
127 <option value="500"_If_("_cgiargo_" eq "500", selected)>all
128</select>
129}
130
131_languageoption_ {
132_textlanguage_
133<select name="l" onChange="l\_update();">
134 <option value="en"_If_("_cgiargl_",, selected)_If_("_cgiargl_" eq "en", selected)>English
135 <option value="mi"_If_("_cgiargl_" eq "mi", selected)>Maori
136</select>
137}
138
139_formatoption_ {
140_textformat_
141<select name="v" onChange="v\_update();">
142 <option value="0"_If_("_cgiargv_" eq "0", selected)>Graphical
143 <option value="1"_If_("_cgiargv_" eq "1", selected)>Textual
144</select>
145}
146
147_content_ {
148<center>
149_navigationbar_
150</center>
151<blockquote>
152
153<form name=PrefForm method=get action="_gwcgi_">
154
155<input type="hidden" name="e" value="_compressedoptions_">
156
157<p>_caseoption_
158
159<p>_stemoption_
160
161<p>
162_textprefop_
163
164<p>
165_languageoption_
166
167<p>
168_formatoption_
169
170</blockquote>
171</form>
172}
173
174
175#######################################################################
176# https
177#######################################################################
178
179_httpiconhpref_ {_httpimg_/h\_pref.gif}
180_httpiconhpref_ [language=mi] {_httpimg_/mh\_pref.gif}
181_widthhpref_ {200}
182_widthhpref_ [language=mi] {220}
183_heighthpref_ {57}
184
185
186#######################################################################
187# icons
188#######################################################################
189
190_iconthispage_ {<img src="_httpiconhpref_" alt="_textpreferences_" width="_widthhpref_" height="_heighthpref_">}
191_iconthispage_ [language=mi] {<img src="_httpimg_/mh\_pref.gif" alt="" width="220" height="57">}
192
193
194#######################################################################
195# english macros
196#######################################################################
197
198_textpreferences_ {Preferences}
199_textignorecase_ { ignore case differences}
200_textmatchcase_ { upper/lower case must match}
201_textstem_ { ignore word endings}
202_textnostem_ { whole word must match}
203_textprefop_ {Return up to _maxdocoption_ hits with _hitsperpageoption_ hits per page.}
204_textlanguage_ {Interface language: }
205_textformat_ {Interface format: }
206
207#######################################################################
208# maori macros
209#######################################################################
210
211_textpreferences_ [language=mi] {Whiriwhiringa}
212_textignorecase_ [language=mi] { hei aha te p&uuml; matua me te p&uuml; iti}
213_textmatchcase_ [language=mi] { me tika te p&uuml; matua me te p&uuml; iti}
214_textstem_ [language=mi] { hei aha te k&uuml;muri}
215_textnostem_ [language=mi] { me tika te k&uuml;muri}
216_textprefop_ [language=mi] {Whakahokia mai te _maxdocoption_ kupu, &auml;, kia _hitsperpageoption_ kupu ki ia wh&auml;rangi.}
217
218
219
220
221
222
Note: See TracBrowser for help on using the repository browser.