source: trunk/greenorg/macros/pref.dm@ 14007

Last change on this file since 14007 was 6778, checked in by mdewsnip, 20 years ago

Extra macros necessary to support the "PREFERENCES" button.

  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1package preferences
2
3# set within server
4
5# this macro will be set to _textprefschanged_ when the "set preferences"
6# button has been pressed
7_prefschanged_ {}
8
9
10#######################################################################
11# scripts
12#######################################################################
13
14_getargsfunction_ {
15function getargs () \{
16 return argk + args + argm + argo + argrd + arghd + argb + argqf + argqb + argfqn;
17\}
18}
19
20
21_pagescriptextra_ {
22// preferences scripts generated from \_preferences:pagescriptextra\_
23
24argk = "";
25args = "";
26argm = "";
27argo = "";
28argrd = "";
29arghd = "";
30argb = "";
31argqf = "";
32argqb = "";
33argfqn = "";
34
35_getargsfunction_
36
37function updatel () \{
38 value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
39 href = location.href;
40 if (href.match(/&l=[\\w\\-]+/)) href = href.replace(/&l=[\\w\\-]+/, "&l=" + value);
41 else href += "&l=" + value;
42 if (!location.href.match(/&nl=1$/)) href += "&nl=1";
43 location.href = href + getargs();
44\}
45
46function updatev () \{
47 value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
48 href = location.href;
49 if (href.match(/&v=\\d/)) href = href.replace(/&v=\\d/, "&v=" + value);
50 else href += "&v=" + value;
51 location.href = href + getargs();
52\}
53
54function updatew () \{
55 value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value;
56 href = location.href;
57 if (href.match(/&nw=[^&]+/)) href = href.replace(/&nw=[^&]+/, "&nw=" + value);
58 else href += "&nw=" + value;
59 if (!location.href.match(/&nl=0$/)) href += "&nl=0";
60 location.href = href + getargs();
61\}
62}
63
64
65# set from within pageaction
66_languageoption_ {}
67_encodingoption_ {}
68
69_formatoption_ {
70<td>_textformat_</td>
71<td><select name="v" onChange="updatev();">
72 <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
73 <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
74</select></td>
75}
Note: See TracBrowser for help on using the repository browser.