Line # Revision Author
1 3 ahitrov@rambler.ru <STYLE TYPE="text/css">
2 TABLE#tblCoolbar
3 {
4 background-color:threedface; padding:1px; color:menutext;
5 border-width:1px; border-style:solid;
6 border-color:threedhighlight threedshadow threedshadow threedhighlight;
7 }
8 .cbtn
9 {
10 height:18;
11 BORDER-LEFT: threedface 1px solid;
12 BORDER-RIGHT: threedface 1px solid;
13 BORDER-TOP: threedface 1px solid;
14 BORDER-BOTTOM: threedface 1px solid;
15 }
16 .txtbtn {font-family:tahoma; font-size:70%; color:menutext;}
17 </STYLE>
18
19 <script LANGUAGE="JavaScript">
20 var SuperTexts = new Array;
21 <%perl>
22
23 my $i = 0;
24
25
26 my @properties = $object->structure();
27
28 for (0..$#properties)
29 {
30 my $prop = $properties[$_];
31 if ($prop->{type} eq 'htmltext')
32 {
33 $m->out("SuperTexts[$i] = '$prop->{attr}';\n");
34 $i++;
35 }
36 }
37 </%perl>
38 function button_over(eButton)
39 {
40 eButton.style.backgroundColor = "#B5BDD6";
41 eButton.style.borderColor = "darkblue darkblue darkblue darkblue";
42 }
43 function button_out(eButton)
44 {
45 eButton.style.backgroundColor = "threedface";
46 eButton.style.borderColor = "threedface";
47 }
48 function button_down(eButton)
49 {
50 eButton.style.backgroundColor = "#8494B5";
51 eButton.style.borderColor = "darkblue darkblue darkblue darkblue";
52 }
53 function button_up(eButton)
54 {
55 eButton.style.backgroundColor = "#B5BDD6";
56 eButton.style.borderColor = "darkblue darkblue darkblue darkblue";
57 eButton = null;
58 }
59 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60
61 var isHTMLMode = new Array();
62 for (var i = 0; i < SuperTexts.length; i++)
63 {
64 isHTMLMode[SuperTexts[i]] = false;
65 }
66
67 function document.onreadystatechange()
68 {
69 for (var i = 0; i < SuperTexts.length; i++)
70 {
71 var fr = eval("fr_" + SuperTexts[i]);
72 fr.document.designMode="On";
73 }
74 document.form.focus();
75 }
76 function cmdExec(frname, cmd, opt)
77 {
78 if (isHTMLMode[frname]){alert("Please uncheck 'Edit HTML'");return;}
79 var fr = eval("fr_" + frname);
80 fr.document.execCommand(cmd,"",opt);
81 fr.focus();
82 }
83 function setMode(frname, bMode)
84 {
85 var fr = eval("fr_" + frname);
86 var sTmp;
87 isHTMLMode[frname] = bMode;
88 if (isHTMLMode[frname]){sTmp=fr.document.body.innerHTML;fr.document.body.innerText=sTmp;}
89 else {sTmp=fr.document.body.innerText;fr.document.body.innerHTML=sTmp;}
90 fr.focus();
91 }
92 function createLink(frname)
93 {
94 if (isHTMLMode[frname]){alert("Please uncheck 'Edit HTML'");return;}
95 cmdExec(frname, "CreateLink");
96 }
97 function insertImage(frname)
98 {
99 if (isHTMLMode[frname]){alert("Please uncheck 'Edit HTML'");return;}
100 var sImgSrc=prompt("Insert Image File (You can use your local image file) : ", "http://");
101 if(sImgSrc!=null) cmdExec(frname, "InsertImage",sImgSrc);
102 }
103 function Save()
104 {
105 // if (isHTMLMode){alert("Please uncheck 'Edit HTML'");return;}
106 for (var i = 0; i < SuperTexts.length; i++)
107 {
108 var tmp = eval("document.form." + SuperTexts[i]);
109 var fr = eval("fr_" + SuperTexts[i]);
110 tmp.value = fr.document.body.innerHTML;
111 }
112
113 document.form.submit();
114 }
115
116 function foreColor(frname)
117 {
118 var arr = showModalDialog("selcolor.html","","font-family:Verdana; font-size:12; dialogWidth:30em; dialogHeight:34em" );
119 if (arr != null) cmdExec(frname, "ForeColor",arr);
120 }
121
122 function w(s,w,h) {
123 window.open( s,"remote","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+(w+35)+",height="+(h+30)+"").focus();
124 }
125
126 function show_layer( name, xof, yof ) {
127 var layer = eval('document.all.span_' + name);
128 var rel = document.all['pos_' + name];
129 var x = rel.offsetLeft;
130 var y = rel.offsetTop;
131
132 while (rel.offsetParent != null) {
133 rel = rel.offsetParent;
134 x += rel.offsetLeft;
135 y += rel.offsetTop;
136 if (rel.tagName == 'BODY') break;
137 }
138 layer.style.left = x + (xof || 400);
139 layer.style.top = y + (yof || -50);
140 layer.style.visibility = 'visible';
141 }
142
143 function hide_layer(name) {
144 var layer = eval('document.all.span_' + name);
145 layer.style.visibility = 'hidden';
146 }
147
148
149 // object list javascripts
150
151
152
153 function already_added(opts, item)
154 {
155 var i = 0;
156 while ( i < opts.length)
157 {
158 if (opts[i].value == item.value || opts[i].text == item.text) return true;
159 i++;
160 }
161 return false;
162 }
163
164 function sel_wo_del(sobj, dobj)
165 {
166 // sobj = eval('iobjs.document.form.objs');
167 // dobj = document.dform.objs;
168 var i = 0;
169 while ( i < sobj.elements.length )
170 {
171 if (sobj.elements[i].checked)
172 {
173 var item = new Option();
174 item.value = sobj.elements[i].name;
175 item.text = sobj.elements[i].value;
176 if (!already_added(dobj.options, item)) dobj.options[dobj.options.length] = item;
177 sobj.elements[i].checked = null;
178 }
179 i++;
180 }
181 }
182
183 function del(sobj)
184 {
185 var i = 0;
186 while ( i < sobj.options.length )
187 {
188 if (sobj.options[i].selected && sobj.options[i].value != null)
189 sobj.options[i] = null;
190 i++;
191 }
192 }
193
194 </script>
195 <%ARGS>
196
197 $object => undef
198
199 </%ARGS>
200 <%INIT>
201
202 return undef unless ref($object);
203
204 </%INIT>