1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
|
---|
2 | <!--
|
---|
3 | launchZCS.jsp
|
---|
4 | * ***** BEGIN LICENSE BLOCK *****
|
---|
5 | * Zimbra Collaboration Suite Web Client
|
---|
6 | * Copyright (C) 2007, 2008, 2009, 2010 Zimbra, Inc.
|
---|
7 | *
|
---|
8 | * The contents of this file are subject to the Zimbra Public License
|
---|
9 | * Version 1.3 ("License"); you may not use this file except in
|
---|
10 | * compliance with the License. You may obtain a copy of the License at
|
---|
11 | * http://www.zimbra.com/license.
|
---|
12 | *
|
---|
13 | * Software distributed under the License is distributed on an "AS IS"
|
---|
14 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
---|
15 | * ***** END LICENSE BLOCK *****
|
---|
16 | -->
|
---|
17 |
|
---|
18 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
---|
19 |
|
---|
20 | <title>XFINITY Connect</title>
|
---|
21 | <link href="/zimbra/css/images,common,dwt,msgview,login,zm,spellcheck,wiki,skin.css?v=110527090709&debug=&skin=velodrome2&locale=en_US" rel="stylesheet" type="text/css">
|
---|
22 |
|
---|
23 | <link rel="SHORTCUT ICON" href="/zimbra/img/logo/favicon.ico">
|
---|
24 | <script>
|
---|
25 | appContextPath = "/zimbra";
|
---|
26 | appCurrentSkin = "velodrome2";
|
---|
27 | appExtension = ".zgz";
|
---|
28 | appDevMode = false;
|
---|
29 |
|
---|
30 | function purl(name, temp_string ) {
|
---|
31 | name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
---|
32 | var regexS = "[\\?&]"+name+"=([^&#]*)";
|
---|
33 | var regex = new RegExp( regexS );
|
---|
34 | var results = regex.exec( temp_string );
|
---|
35 | if( results == null )
|
---|
36 | return "";
|
---|
37 | else
|
---|
38 | return results[1];
|
---|
39 | }
|
---|
40 |
|
---|
41 | function update_prefs_cookie ( old_cookie_name, new_cookie_name ) {
|
---|
42 |
|
---|
43 | var results_new = document.cookie.match ( '(^|;) ?' + new_cookie_name + '=([^;]*)(;|$)' );
|
---|
44 |
|
---|
45 | if (results_new) {
|
---|
46 |
|
---|
47 | var results_old = document.cookie.match ( '(^|;) ?' + old_cookie_name + '=([^;]*)(;|$)' );
|
---|
48 | if (results_old) {
|
---|
49 | var old_cookie_temp = unescape(results_old[2]);
|
---|
50 | old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_user_guid=\"\""),"");
|
---|
51 | old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_user_guid="),"");
|
---|
52 | old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip=\"\""),"");
|
---|
53 | old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip=%22%22"),"");
|
---|
54 | old_cookie_temp = old_cookie_temp.replace(old_cookie_temp.match("&adt_zip="),"");
|
---|
55 | }
|
---|
56 | else {
|
---|
57 | var old_cookie_temp = "";
|
---|
58 | }
|
---|
59 |
|
---|
60 | var adt_zip = purl("zip", (unescape(results_new[2])));
|
---|
61 | var ad_user_guid = purl("tid", (unescape(results_new[2])));
|
---|
62 |
|
---|
63 | //Delete old cookie
|
---|
64 | document.cookie = old_cookie_name + '=""; path=/; domain=.comcast.net; expires=Thu, 01-Jan-1970 00:00:01 GMT';
|
---|
65 |
|
---|
66 | //Re-write new cookie
|
---|
67 | if (old_cookie_temp) {
|
---|
68 | old_cookie_temp += "&adt_zip=\"" + adt_zip + "\"&adt_user_guid=\"" + ad_user_guid + "\"";
|
---|
69 | }
|
---|
70 | else {
|
---|
71 | old_cookie_temp = "adt_zip=\"" + adt_zip + "\"&adt_user_guid=\"" + ad_user_guid + "\"";
|
---|
72 | }
|
---|
73 |
|
---|
74 | var d = new Date();
|
---|
75 | d.setDate(d.getDate()+1000)
|
---|
76 | var cd = d.toGMTString();
|
---|
77 |
|
---|
78 | document.cookie = old_cookie_name + '=' + old_cookie_temp+'; path=/; domain=.comcast.net; expires='+cd;
|
---|
79 | var zip_array = new Array("zip", adt_zip);
|
---|
80 | return zip_array;
|
---|
81 | }
|
---|
82 | else {
|
---|
83 | return null;
|
---|
84 | }
|
---|
85 | }
|
---|
86 | </script>
|
---|
87 |
|
---|
88 | <script type="text/javascript">
|
---|
89 | // <![CDATA[
|
---|
90 | var f_ADTARGET_ZIP = (function() {
|
---|
91 | var zip_matches = document.cookie.match(/adt_zip=\"(.*?)\"/);
|
---|
92 | if(!zip_matches)
|
---|
93 | zip_matches = document.cookie.match(/adt_zip=%22(.*?)%22/);
|
---|
94 | if (!zip_matches)
|
---|
95 | zip_matches = update_prefs_cookie("prefs", "MYPORTAL");
|
---|
96 | var flag_matches = document.cookie.match(/adt_optout_flag=(true|false)/);
|
---|
97 | if(flag_matches && flag_matches[1]=="true") {
|
---|
98 | return "US:UNKNOWN";
|
---|
99 | } else {
|
---|
100 | if(zip_matches) {
|
---|
101 | return "US:"+zip_matches[1];
|
---|
102 | } else return "US:UNKNOWN";
|
---|
103 | }
|
---|
104 | })();
|
---|
105 | document['f_ADTARGET_ZIP'] = f_ADTARGET_ZIP;
|
---|
106 | // ]]>
|
---|
107 | </script>
|
---|
108 | <noscript></noscript>
|
---|
109 | <script>
|
---|
110 | /* Copyright (C) 2005-2009 Zimbra Inc. http://www.zimbra.com/ */
|
---|
111 | if(AjxPackage.define("Startup2")){
|
---|
112 | if(AjxPackage.define("ajax.net.AjxInclude")){
|
---|
113 | AjxInclude=function(i,n,o,a){
|
---|
114 | var t=document.getElementsByTagName("head")[0];
|
---|
115 | function e(h){
|
---|
116 | if(AjxEnv.isIE&&h&&!/loaded|complete/.test(h.readyState)){
|
---|
117 | return
|
---|
118 | }
|
---|
119 | if(h){
|
---|
120 | h[AjxInclude.eventName]=null
|
---|
121 | }
|
---|
122 | var s=AjxInclude.dwhack_scripts.length>0?AjxInclude.dwhack_scripts:i;
|
---|
123 | window.status="";
|
---|
124 | if(s.length>0){
|
---|
125 | var c=s.shift();
|
---|
126 | var d=c;
|
---|
127 | if(!/^((https?|ftps?):\x2f\x2f|\x2f)/.test(c)){
|
---|
128 | if(n){
|
---|
129 | c=n+c
|
---|
130 | }
|
---|
131 | if(cacheKillerVersion){
|
---|
132 | c+="?v="+cacheKillerVersion
|
---|
133 | }}else{
|
---|
134 | if(a&&c.indexOf("/")!=0){
|
---|
135 | c=a+AjxStringUtil.urlEncode(c)
|
---|
136 | }}
|
---|
137 | var h=document.createElement("script");
|
---|
138 | var l=AjxCallback.simpleClosure(e,null,h);
|
---|
139 | if(AjxEnv.isIE){
|
---|
140 | h.attachEvent("onreadystatechange",l);
|
---|
141 | h.attachEvent("onerror",l)
|
---|
142 | }else{
|
---|
143 | h.addEventListener("load",l,true);
|
---|
144 | h.addEventListener("error",l,true)
|
---|
145 | }
|
---|
146 | h.type="text/javascript";
|
---|
147 | h.src=c;
|
---|
148 | window.status="Loading script: "+d;
|
---|
149 | t.appendChild(h)
|
---|
150 | }else{
|
---|
151 | if(i.length==0){
|
---|
152 | h=null;
|
---|
153 | t=null;
|
---|
154 | if(o){
|
---|
155 | o.run()
|
---|
156 | }}}}
|
---|
157 | e(null)
|
---|
158 | };
|
---|
159 | AjxInclude.dwhack_scripts=[];
|
---|
160 | document.write=document.writeln=function(){
|
---|
161 | var e=[];
|
---|
162 | for(var t=0;
|
---|
163 | t<arguments.length;
|
---|
164 | ++t){
|
---|
165 | e[t]=arguments[t]
|
---|
166 | }
|
---|
167 | var o=e.join("");
|
---|
168 | if(/<script[^>]+src=([\x22\x27])(.*?)\1/i.test(o)){
|
---|
169 | AjxInclude.dwhack_scripts.push(RegExp.$2)
|
---|
170 | }};
|
---|
171 | if(AjxEnv.isIE){
|
---|
172 | AjxInclude._removeWriteln=function(){
|
---|
173 | document.write=document.writeln=null;
|
---|
174 | window.detachEvent("onunload",AjxInclude._removeWriteln)
|
---|
175 | };
|
---|
176 | window.attachEvent("onunload",AjxInclude._removeWriteln)
|
---|
177 | }}
|
---|
178 | if(AjxPackage.define("ajax.util.AjxDateUtil")){
|
---|
179 | AjxDateUtil=function(){};
|
---|
180 | AjxDateUtil.YEAR=1;
|
---|
181 | AjxDateUtil.MONTH=2;
|
---|
182 | AjxDateUtil.WEEK=3;
|
---|
183 | AjxDateUtil.DAY=4;
|
---|
184 | AjxDateUtil.TWO_WEEKS=5;
|
---|
185 | AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES=900000;
|
---|
186 | AjxDateUtil.MSEC_PER_HALF_HOUR=1800000;
|
---|
187 | AjxDateUtil.MSEC_PER_HOUR=3600000;
|
---|
188 | AjxDateUtil.MSEC_PER_DAY=24*AjxDateUtil.MSEC_PER_HOUR;
|
---|
189 | AjxDateUtil.WEEKDAY_SHORT=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.SHORT];
|
---|
190 | AjxDateUtil.WEEKDAY_MEDIUM=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.MEDIUM];
|
---|
191 | AjxDateUtil.WEEKDAY_LONG=AjxDateFormat.WeekdaySegment.WEEKDAYS[AjxDateFormat.LONG];
|
---|
192 | AjxDateUtil.MONTH_SHORT=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.SHORT];
|
---|
193 | AjxDateUtil.MONTH_MEDIUM=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.MEDIUM];
|
---|
194 | AjxDateUtil.MONTH_LONG=AjxDateFormat.MonthSegment.MONTHS[AjxDateFormat.LONG];
|
---|
195 | AjxDateUtil._daysPerMonth={
|
---|
196 | 0:31,1:29,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31};
|
---|
197 | AjxDateUtil.WEEK_ONE_JAN_DATE=1;
|
---|
198 | AjxDateUtil._init=function(){
|
---|
199 | AjxDateUtil._dateFormat=AjxDateFormat.getDateInstance(AjxDateFormat.SHORT).clone();
|
---|
200 | var e=AjxDateUtil._dateFormat.getSegments();
|
---|
201 | for(var t=0;
|
---|
202 | t<e.length;
|
---|
203 | t++){
|
---|
204 | if(e[t] instanceof AjxDateFormat.YearSegment){
|
---|
205 | e[t]=new AjxDateFormat.YearSegment(AjxDateUtil._dateFormat,"yyyy")
|
---|
206 | }}
|
---|
207 | AjxDateUtil._dateTimeFormat=new AjxDateFormat(AjxDateUtil._dateFormat.toPattern()+" "+AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT));
|
---|
208 | AjxDateUtil._dateFormatNoYear=new AjxDateFormat(AjxMsg.formatDateMediumNoYear)
|
---|
209 | };
|
---|
210 | AjxDateUtil._init();
|
---|
211 | AjxDateUtil.validDate=function(o,e,i){
|
---|
212 | var t=new Date(o,e,i);
|
---|
213 | var a=o>999?t.getFullYear():t.getYear();
|
---|
214 | return t.getMonth()==e&&t.getDate()==i&&a==o
|
---|
215 | };
|
---|
216 | AjxDateUtil.daysInMonth=function(a,e){
|
---|
217 | var t=new Date(a,e,1,12);
|
---|
218 | t.setMonth(t.getMonth()+1);
|
---|
219 | t.setDate(t.getDate()-1);
|
---|
220 | return t.getDate()
|
---|
221 | };
|
---|
222 | AjxDateUtil.isLeapYear=function(e){
|
---|
223 | return(new Date(e,1,29)).getMonth()==1
|
---|
224 | };
|
---|
225 | AjxDateUtil.isLocale24Hour=function(){
|
---|
226 | var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
|
---|
227 | var e=t._segments.length;
|
---|
228 | for(var a=0;
|
---|
229 | a<e;
|
---|
230 | a++){
|
---|
231 | if(t._segments[a]._s=="a"){
|
---|
232 | return false
|
---|
233 | }}
|
---|
234 | return true
|
---|
235 | };
|
---|
236 | AjxDateUtil.roll=function(t,a,o){
|
---|
237 | var i=t.getDate();
|
---|
238 | if(a==AjxDateUtil.MONTH){
|
---|
239 | t.setDate(1);
|
---|
240 | t.setMonth(t.getMonth()+o);
|
---|
241 | var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
|
---|
242 | t.setDate(Math.min(i,e))
|
---|
243 | }else{
|
---|
244 | if(a==AjxDateUtil.YEAR){
|
---|
245 | t.setDate(1);
|
---|
246 | t.setFullYear(t.getFullYear()+o);
|
---|
247 | var e=AjxDateUtil.daysInMonth(t.getFullYear(),t.getMonth());
|
---|
248 | t.setDate(Math.min(i,e))
|
---|
249 | }else{
|
---|
250 | if(a==AjxDateUtil.WEEK){
|
---|
251 | t.setDate(t.getDate()+7*o)
|
---|
252 | }else{
|
---|
253 | if(a==AjxDateUtil.DAY){
|
---|
254 | t.setDate(t.getDate()+o)
|
---|
255 | }else{
|
---|
256 | if(a==AjxDateUtil.TWO_WEEKS){
|
---|
257 | t.setDate(t.getDate()+14*o)
|
---|
258 | }else{
|
---|
259 | return t
|
---|
260 | }}}}}
|
---|
261 | return t
|
---|
262 | };
|
---|
263 | AjxDateUtil.isDayShifted=function(e){
|
---|
264 | var t=new Date(e.getTime());
|
---|
265 | t.setDate(t.getDate()+1);
|
---|
266 | t.setHours(0,0,0,0);
|
---|
267 | return t.getTime()==e.getTime()
|
---|
268 | };
|
---|
269 | AjxDateUtil.rollToNextDay=function(e){
|
---|
270 | e.setHours(0,0,0,0);
|
---|
271 | e.setTime(e.getTime()+AjxDateUtil.MSEC_PER_DAY)
|
---|
272 | };
|
---|
273 | AjxDateUtil.computeDateDelta=function(e){
|
---|
274 | var t=(new Date()).getTime()-e;
|
---|
275 | var a=AjxDateUtil.computeDuration(t);
|
---|
276 | return a?(a+" "+AjxMsg.ago):null
|
---|
277 | };
|
---|
278 | AjxDateUtil.computeDuration=function(a,l){
|
---|
279 | if(a<0){
|
---|
280 | return null
|
---|
281 | }
|
---|
282 | var o=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*365));
|
---|
283 | if(o!=0){
|
---|
284 | a-=o*AjxDateUtil.MSEC_PER_DAY*365
|
---|
285 | }
|
---|
286 | var t=Math.floor(a/(AjxDateUtil.MSEC_PER_DAY*30.42));
|
---|
287 | if(t>0){
|
---|
288 | a-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
|
---|
289 | }
|
---|
290 | var h=Math.floor(a/AjxDateUtil.MSEC_PER_DAY);
|
---|
291 | if(h>0){
|
---|
292 | a-=h*AjxDateUtil.MSEC_PER_DAY
|
---|
293 | }
|
---|
294 | var n=Math.floor(a/AjxDateUtil.MSEC_PER_HOUR);
|
---|
295 | if(n>0){
|
---|
296 | a-=n*AjxDateUtil.MSEC_PER_HOUR
|
---|
297 | }
|
---|
298 | var e=Math.floor(a/60000);
|
---|
299 | if(e>0){
|
---|
300 | a-=e*60000
|
---|
301 | }
|
---|
302 | var i=Math.floor(a/1000);
|
---|
303 | var s=l?AjxDurationFormatConcise:AjxDurationFormatVerbose;
|
---|
304 | if(o>0){
|
---|
305 | return s.formatYears(o,t)
|
---|
306 | }else{
|
---|
307 | if(t>0){
|
---|
308 | return s.formatMonths(t,h)
|
---|
309 | }else{
|
---|
310 | if(h>0){
|
---|
311 | return s.formatDays(h,n)
|
---|
312 | }else{
|
---|
313 | if(n>0){
|
---|
314 | return s.formatHours(n,e)
|
---|
315 | }else{
|
---|
316 | if(e>0){
|
---|
317 | return s.formatMinutes(e,i)
|
---|
318 | }else{
|
---|
319 | return s.formatSeconds(i)
|
---|
320 | }}}}}};
|
---|
321 | AjxDateUtil.simpleComputeDateStr=function(t,a){
|
---|
322 | var e=AjxDateUtil._dateFormat.format(t);
|
---|
323 | return a?a+e:e
|
---|
324 | };
|
---|
325 | AjxDateUtil.simpleParseDateStr=function(e){
|
---|
326 | return AjxDateUtil._dateFormat.parse(e)
|
---|
327 | };
|
---|
328 | AjxDateUtil.simpleComputeDateTimeStr=function(t,a){
|
---|
329 | var e=AjxDateUtil._dateTimeFormat.format(t);
|
---|
330 | return a?a+e:e
|
---|
331 | };
|
---|
332 | AjxDateUtil.simpleParseDateTimeStr=function(e){
|
---|
333 | return AjxDateUtil._dateTimeFormat.parse(e)
|
---|
334 | };
|
---|
335 | AjxDateUtil.longComputeDateStr=function(e){
|
---|
336 | var t=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
|
---|
337 | return t.format(e)
|
---|
338 | };
|
---|
339 | AjxDateUtil.computeDateStr=function(a,t){
|
---|
340 | if(t==null){
|
---|
341 | return""
|
---|
342 | }
|
---|
343 | var e=new Date(t);
|
---|
344 | if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
|
---|
345 | return AjxDateUtil.computeTimeString(e)
|
---|
346 | }
|
---|
347 | if(a.getFullYear()==e.getFullYear()){
|
---|
348 | return AjxDateUtil._dateFormatNoYear.format(e)
|
---|
349 | }
|
---|
350 | return AjxDateUtil.simpleComputeDateStr(e)
|
---|
351 | };
|
---|
352 | AjxDateUtil.computeWordyDateStr=function(a,t){
|
---|
353 | if(t==null){
|
---|
354 | return""
|
---|
355 | }
|
---|
356 | var e=new Date(t);
|
---|
357 | if(a.getTime()-t<AjxDateUtil.MSEC_PER_DAY&&a.getDay()==e.getDay()){
|
---|
358 | if(!AjxDateUtil._wordyDateToday){
|
---|
359 | AjxDateUtil._wordyDateToday=new AjxDateFormat(AjxMsg.formatWordyDateToday)
|
---|
360 | }
|
---|
361 | return AjxDateUtil._wordyDateToday.format(e)
|
---|
362 | }else{
|
---|
363 | if((a.getTime()-t)<(2*AjxDateUtil.MSEC_PER_DAY)&&(a.getDay()-1)==e.getDay()){
|
---|
364 | if(!AjxDateUtil._wordyDateYesterday){
|
---|
365 | AjxDateUtil._wordyDateYesterday=new AjxDateFormat(AjxMsg.formatWordyDateYesterday)
|
---|
366 | }
|
---|
367 | return AjxDateUtil._wordyDateYesterday.format(e)
|
---|
368 | }else{
|
---|
369 | if(!AjxDateUtil._wordyDate){
|
---|
370 | AjxDateUtil._wordyDate=new AjxDateFormat(AjxMsg.formatWordyDate)
|
---|
371 | }
|
---|
372 | return AjxDateUtil._wordyDate.format(e)
|
---|
373 | }}};
|
---|
374 | AjxDateUtil.computeTimeString=function(e){
|
---|
375 | var t=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
|
---|
376 | return t.format(e)
|
---|
377 | };
|
---|
378 | AjxDateUtil.computeDateTimeString=function(e){
|
---|
379 | var t=AjxDateFormat.getDateTimeInstance(AjxDateFormat.LONG);
|
---|
380 | return t.format(e)
|
---|
381 | };
|
---|
382 | AjxDateUtil._getHoursStr=function(t,a,e){
|
---|
383 | var i=t.getHours();
|
---|
384 | if(!e){
|
---|
385 | i%=12;
|
---|
386 | if(i==0){
|
---|
387 | i=12
|
---|
388 | }}
|
---|
389 | return a?AjxDateUtil._pad(i):i
|
---|
390 | };
|
---|
391 | AjxDateUtil._getMinutesStr=function(e){
|
---|
392 | return AjxDateUtil._pad(e.getMinutes())
|
---|
393 | };
|
---|
394 | AjxDateUtil._getSecondsStr=function(e){
|
---|
395 | return AjxDateUtil._pad(e.getSeconds())
|
---|
396 | };
|
---|
397 | AjxDateUtil._getAMPM=function(t,a){
|
---|
398 | var e=t.getHours();
|
---|
399 | return(e<12)?(a?"AM":"am"):(a?"PM":"pm")
|
---|
400 | };
|
---|
401 | AjxDateUtil._getMonthName=function(e,t){
|
---|
402 | return t?AjxDateUtil.MONTH_MEDIUM[e.getMonth()]:AjxDateUtil.MONTH_LONG[e.getMonth()]
|
---|
403 | };
|
---|
404 | AjxDateUtil._getMonth=function(e,a){
|
---|
405 | var t=e.getMonth()+1;
|
---|
406 | if(a){
|
---|
407 | return AjxDateUtil._pad(t)
|
---|
408 | }else{
|
---|
409 | return t
|
---|
410 | }};
|
---|
411 | AjxDateUtil._getDate=function(e,t){
|
---|
412 | var a=e.getDate();
|
---|
413 | return t?AjxDateUtil._pad(a):a
|
---|
414 | };
|
---|
415 | AjxDateUtil._getWeekday=function(e){
|
---|
416 | var t=e.getDay();
|
---|
417 | return AjxDateUtil.WEEKDAY_LONG[t]
|
---|
418 | };
|
---|
419 | AjxDateUtil._getWeekdayMedium=function(e){
|
---|
420 | var t=e.getDay();
|
---|
421 | return AjxDateUtil.WEEKDAY_MEDIUM[t]
|
---|
422 | };
|
---|
423 | AjxDateUtil._getFullYear=function(e){
|
---|
424 | return e.getFullYear()
|
---|
425 | };
|
---|
426 | AjxDateUtil.getFirstDayOfWeek=function(i,e){
|
---|
427 | e=e||0;
|
---|
428 | var t=i.getDay();
|
---|
429 | var a=(t-e+7)%7;
|
---|
430 | i.setDate(i.getDate()-a);
|
---|
431 | return i
|
---|
432 | };
|
---|
433 | AjxDateUtil.getWeekNumber=function(g,c,x,w){
|
---|
434 | c=c||0;
|
---|
435 | x=x||AjxDateUtil.WEEK_ONE_JAN_DATE;
|
---|
436 | g=g||new Date();
|
---|
437 | g.setHours(12,0,0,0);
|
---|
438 | var o=g,k,h;
|
---|
439 | if(o.getDay()===c){
|
---|
440 | k=o
|
---|
441 | }else{
|
---|
442 | k=AjxDateUtil.getFirstDayOfWeek(o,c)
|
---|
443 | }
|
---|
444 | var u=k.getFullYear(),l=k.getTime();
|
---|
445 | h=new Date(k.getTime()+6*AjxDateUtil.MSEC_PER_DAY);
|
---|
446 | var e;
|
---|
447 | if(!w){
|
---|
448 | if(u!==h.getFullYear()&&h.getDate()>=x){
|
---|
449 | e=1
|
---|
450 | }else{
|
---|
451 | var n=(new Date(u,0,x));
|
---|
452 | n.setHours(12,0,0,0);
|
---|
453 | var i=AjxDateUtil.getFirstDayOfWeek(n,c);
|
---|
454 | var f=Math.round((o.getTime()-i.getTime())/AjxDateUtil.MSEC_PER_DAY);
|
---|
455 | var t=f%7;
|
---|
456 | var v=(f-t)/7;
|
---|
457 | e=v+1
|
---|
458 | }
|
---|
459 | return e
|
---|
460 | }else{
|
---|
461 | var y=new Date(g.getFullYear(),0,1);
|
---|
462 | var m=y.getDay()-1;
|
---|
463 | m=(m>=0?m:m+7);
|
---|
464 | var a=Math.floor((g.getTime()-y.getTime()-(g.getTimezoneOffset()-y.getTimezoneOffset())*60000)/AjxDateUtil.MSEC_PER_DAY)+1;
|
---|
465 | if(m<4){
|
---|
466 | e=Math.floor((a+m-1)/7)+1;
|
---|
467 | if(e>52){
|
---|
468 | var b=new Date(g.getFullYear()+1,0,1);
|
---|
469 | var p=b.getDay()-1;
|
---|
470 | p=p>=0?p:p+7;
|
---|
471 | e=p<4?1:53
|
---|
472 | }}else{
|
---|
473 | e=Math.floor((a+m-1)/7);
|
---|
474 | if(e==0){
|
---|
475 | var s=new Date(g.getFullYear()-1,0,1);
|
---|
476 | var d=s.getDay()-1;
|
---|
477 | d=(d>=0?d:d+7);
|
---|
478 | e=(d==3||(AjxDateUtil.isLeapYear(s.getFullYear())&&d==2))?53:52
|
---|
479 | }}
|
---|
480 | return e
|
---|
481 | }};
|
---|
482 | AjxDateUtil.getTimeStr=function(e,a){
|
---|
483 | var t=a;
|
---|
484 | t=t.replace(/%d/g,AjxDateUtil._getDate(e,true));
|
---|
485 | t=t.replace(/%D/g,AjxDateUtil._getDate(e,false));
|
---|
486 | t=t.replace(/%w/g,AjxDateUtil._getWeekday(e));
|
---|
487 | t=t.replace(/%M/g,AjxDateUtil._getMonthName(e));
|
---|
488 | t=t.replace(/%t/g,AjxDateUtil._getMonthName(e,true));
|
---|
489 | t=t.replace(/%n/g,AjxDateUtil._getMonth(e,true));
|
---|
490 | t=t.replace(/%Y/g,AjxDateUtil._getFullYear(e));
|
---|
491 | t=t.replace(/%h/g,AjxDateUtil._getHoursStr(e,false,false));
|
---|
492 | t=t.replace(/%H/g,AjxDateUtil._getHoursStr(e,true,false));
|
---|
493 | t=t.replace(/%m/g,AjxDateUtil._getMinutesStr(e));
|
---|
494 | t=t.replace(/%s/g,AjxDateUtil._getSecondsStr(e));
|
---|
495 | t=t.replace(/%P/g,AjxDateUtil._getAMPM(e,true));
|
---|
496 | t=t.replace(/%p/g,AjxDateUtil._getAMPM(e,false));
|
---|
497 | return t
|
---|
498 | };
|
---|
499 | AjxDateUtil.getRoundedMins=function(e,a){
|
---|
500 | var t=e.getMinutes();
|
---|
501 | if(t!=0&&a){
|
---|
502 | t=(Math.ceil((t/a)))*a
|
---|
503 | }
|
---|
504 | return t
|
---|
505 | };
|
---|
506 | AjxDateUtil.roundTimeMins=function(t,i){
|
---|
507 | var a=t.getMinutes();
|
---|
508 | var e=t.getHours();
|
---|
509 | if(a!=0&&i){
|
---|
510 | a=(Math.ceil((a/i)))*i;
|
---|
511 | if(a==60){
|
---|
512 | a=0;
|
---|
513 | e++
|
---|
514 | }
|
---|
515 | t.setMinutes(a);
|
---|
516 | t.setHours(e)
|
---|
517 | }
|
---|
518 | return t
|
---|
519 | };
|
---|
520 | AjxDateUtil.isInRange=function(i,t,a,e){
|
---|
521 | return(i<e&&t>a)
|
---|
522 | };
|
---|
523 | AjxDateUtil.getSimpleDateFormat=function(){
|
---|
524 | return AjxDateUtil._dateFormat
|
---|
525 | };
|
---|
526 | AjxDateUtil.getServerDate=function(e){
|
---|
527 | if(!AjxDateUtil._serverDateFormatter){
|
---|
528 | AjxDateUtil._serverDateFormatter=new AjxDateFormat("yyyyMMdd")
|
---|
529 | }
|
---|
530 | return AjxDateUtil._serverDateFormatter.format(e)
|
---|
531 | };
|
---|
532 | AjxDateUtil.getServerDateTime=function(t,i){
|
---|
533 | var e=t;
|
---|
534 | var a=null;
|
---|
535 | if(i){
|
---|
536 | if(!AjxDateUtil._serverDateTimeFormatterUTC){
|
---|
537 | AjxDateUtil._serverDateTimeFormatterUTC=new AjxDateFormat("yyyyMMdd'T'HHmmss'Z'")
|
---|
538 | }
|
---|
539 | a=AjxDateUtil._serverDateTimeFormatterUTC;
|
---|
540 | e=new Date(t.getTime());
|
---|
541 | e.setMinutes(e.getMinutes()+e.getTimezoneOffset())
|
---|
542 | }else{
|
---|
543 | if(!AjxDateUtil._serverDateTimeFormatter){
|
---|
544 | AjxDateUtil._serverDateTimeFormatter=new AjxDateFormat("yyyyMMdd'T'HHmmss")
|
---|
545 | }
|
---|
546 | a=AjxDateUtil._serverDateTimeFormatter
|
---|
547 | }
|
---|
548 | return a.format(e)
|
---|
549 | };
|
---|
550 | AjxDateUtil.parseServerTime=function(i,e){
|
---|
551 | if(i.charAt(8)=="T"){
|
---|
552 | var a=parseInt(i.substr(9,2),10);
|
---|
553 | var o=parseInt(i.substr(11,2),10);
|
---|
554 | var t=parseInt(i.substr(13,2),10);
|
---|
555 | if(i.charAt(15)=="Z"){
|
---|
556 | o+=AjxTimezone.getOffset(AjxTimezone.DEFAULT,e)
|
---|
557 | }
|
---|
558 | e.setHours(a,o,t,0)
|
---|
559 | }
|
---|
560 | return e
|
---|
561 | };
|
---|
562 | AjxDateUtil.parseISO8601Date=function(o){
|
---|
563 | var t=AjxDateUtil.__ISO8601_formats;
|
---|
564 | if(!t){
|
---|
565 | t=AjxDateUtil.__ISO8601_formats=[new AjxDateUtil.TZDFormat("yyyy-MM-dd'T'HH:mm:ss.SZ"),new AjxDateUtil.TZDFormat("yyyy-MM-dd'T'HH:mm:ssZ"),new AjxDateUtil.TZDFormat("yyyy-MM-dd'T'HH:mmZ"),new AjxDateFormat("yyyy-MM-dd"),new AjxDateFormat("yyyy-MM"),new AjxDateFormat("yyyy")]
|
---|
566 | }
|
---|
567 | for(var a=0;
|
---|
568 | a<t.length;
|
---|
569 | a++){
|
---|
570 | var e=t[a].parse(o);
|
---|
571 | if(e){
|
---|
572 | return e
|
---|
573 | }}
|
---|
574 | return null
|
---|
575 | };
|
---|
576 | AjxDateUtil.TZDFormat=function(o){
|
---|
577 | if(arguments.length==0){
|
---|
578 | return
|
---|
579 | }
|
---|
580 | AjxDateFormat.apply(this,arguments);
|
---|
581 | var e=this._segments||[];
|
---|
582 | for(var t=0;
|
---|
583 | t<e.length;
|
---|
584 | t++){
|
---|
585 | var a=e[t];
|
---|
586 | if(a instanceof AjxDateFormat.TimezoneSegment){
|
---|
587 | e[t]=new AjxDateUtil.TZDSegment(a.toSubPattern())
|
---|
588 | }}};
|
---|
589 | AjxDateUtil.TZDFormat.prototype=new AjxDateFormat;
|
---|
590 | AjxDateUtil.TZDFormat.prototype.constructor=AjxDateUtil.TZDFormat;
|
---|
591 | AjxDateUtil.TZDFormat.prototype.toString=function(){
|
---|
592 | return"TZDFormat"
|
---|
593 | };
|
---|
594 | AjxDateUtil.TZDSegment=function(e){
|
---|
595 | if(arguments.length==0){
|
---|
596 | return
|
---|
597 | }
|
---|
598 | AjxDateFormat.TimezoneSegment.apply(this,arguments)
|
---|
599 | };
|
---|
600 | AjxDateUtil.TZDSegment.prototype=new AjxDateFormat.TimezoneSegment;
|
---|
601 | AjxDateUtil.TZDSegment.prototype.constructor=AjxDateUtil.TZDSegment;
|
---|
602 | AjxDateUtil.TZDSegment.prototype.toString=function(){
|
---|
603 | return"TZDSegment"
|
---|
604 | };
|
---|
605 | AjxDateUtil.TZDSegment.prototype.parse=function(c,n,a){
|
---|
606 | var e=/^(Z)|^(\+|\-)(\d\d):(\d\d)/.exec(n.substr(a));
|
---|
607 | if(e){
|
---|
608 | var l=new Date().getTimezoneOffset();
|
---|
609 | if(e[1]){
|
---|
610 | c.timezone=l
|
---|
611 | }else{
|
---|
612 | var t=parseInt(e[3],10),h=parseInt(e[4],10);
|
---|
613 | c.timezone=t*60+h;
|
---|
614 | if(e[2]!="-"){
|
---|
615 | c.timezone*=-1
|
---|
616 | }
|
---|
617 | c.timezone-=l
|
---|
618 | }}
|
---|
619 | return a+(e?e[0].length:0)
|
---|
620 | };
|
---|
621 | AjxDateUtil.parseServerDateTime=function(t){
|
---|
622 | if(t==null){
|
---|
623 | return null
|
---|
624 | }
|
---|
625 | var a=new Date();
|
---|
626 | var o=parseInt(t.substr(0,4),10);
|
---|
627 | var i=parseInt(t.substr(4,2),10);
|
---|
628 | var e=parseInt(t.substr(6,2),10);
|
---|
629 | a.setFullYear(o);
|
---|
630 | a.setMonth(i-1);
|
---|
631 | a.setMonth(i-1);
|
---|
632 | a.setDate(e);
|
---|
633 | AjxDateUtil.parseServerTime(t,a);
|
---|
634 | return a
|
---|
635 | };
|
---|
636 | AjxDateUtil._pad=function(e){
|
---|
637 | return e<10?("0"+e):e
|
---|
638 | };
|
---|
639 | AjxDurationFormatVerbose=function(){};
|
---|
640 | AjxDurationFormatVerbose.formatYears=function(a,e){
|
---|
641 | var t=a+" ";
|
---|
642 | t+=(a>1)?AjxMsg.years:AjxMsg.year;
|
---|
643 | if(a<=3&&e>0){
|
---|
644 | t+=" "+e;
|
---|
645 | t+=" "+((e>1)?AjxMsg.months:AjxMsg.months)
|
---|
646 | }
|
---|
647 | return t
|
---|
648 | };
|
---|
649 | AjxDurationFormatVerbose.formatMonths=function(e,a){
|
---|
650 | var t=e+" ";
|
---|
651 | t+=(e>1)?AjxMsg.months:AjxMsg.month;
|
---|
652 | if(e<=3&&a>0){
|
---|
653 | t+=" "+a;
|
---|
654 | t+=" "+((a>1)?AjxMsg.days:AjxMsg.day)
|
---|
655 | }
|
---|
656 | return t
|
---|
657 | };
|
---|
658 | AjxDurationFormatVerbose.formatDays=function(a,e){
|
---|
659 | var t=a+" ";
|
---|
660 | t+=(a>1)?AjxMsg.days:AjxMsg.day;
|
---|
661 | if(a<=2&&e>0){
|
---|
662 | t+=" "+e;
|
---|
663 | t+=" "+((e>1)?AjxMsg.hours:AjxMsg.hour)
|
---|
664 | }
|
---|
665 | return t
|
---|
666 | };
|
---|
667 | AjxDurationFormatVerbose.formatHours=function(e,a){
|
---|
668 | var t=e+" ";
|
---|
669 | t+=(e>1)?AjxMsg.hours:AjxMsg.hour;
|
---|
670 | if(e<5&&a>0){
|
---|
671 | t+=" "+a;
|
---|
672 | t+=" "+((a>1)?AjxMsg.minutes:AjxMsg.minute)
|
---|
673 | }
|
---|
674 | return t
|
---|
675 | };
|
---|
676 | AjxDurationFormatVerbose.formatMinutes=function(a,t){
|
---|
677 | var e=a+" ";
|
---|
678 | e+=((a>1)?AjxMsg.minutes:AjxMsg.minute);
|
---|
679 | if(a<5&&t>0){
|
---|
680 | e+=" "+t;
|
---|
681 | e+=" "+((t>1)?AjxMsg.seconds:AjxMsg.second)
|
---|
682 | }
|
---|
683 | return e
|
---|
684 | };
|
---|
685 | AjxDurationFormatVerbose.formatSeconds=function(e){
|
---|
686 | return(e+" "+((e>1)?AjxMsg.seconds:AjxMsg.second))
|
---|
687 | };
|
---|
688 | AjxDurationFormatConcise=function(){};
|
---|
689 | AjxDurationFormatConcise.formatYears=function(t,e){
|
---|
690 | return this._format(t,e)
|
---|
691 | };
|
---|
692 | AjxDurationFormatConcise.formatMonths=function(e,t){
|
---|
693 | return this._format(e,t)
|
---|
694 | };
|
---|
695 | AjxDurationFormatConcise.formatDays=function(t,e){
|
---|
696 | return this._format(t,e)
|
---|
697 | };
|
---|
698 | AjxDurationFormatConcise.formatHours=function(e,t){
|
---|
699 | return this._format(e,t)
|
---|
700 | };
|
---|
701 | AjxDurationFormatConcise.formatMinutes=function(t,e){
|
---|
702 | return this._format(t,e)
|
---|
703 | };
|
---|
704 | AjxDurationFormatConcise.formatSeconds=function(e){
|
---|
705 | return this._format(0,e)
|
---|
706 | };
|
---|
707 | AjxDurationFormatConcise._format=function(o,t){
|
---|
708 | var n=0;
|
---|
709 | var e=[];
|
---|
710 | e[n++]=o;
|
---|
711 | e[n++]=":";
|
---|
712 | if(t<10){
|
---|
713 | e[n++]="0"
|
---|
714 | }
|
---|
715 | e[n++]=t;
|
---|
716 | return e.join("")
|
---|
717 | };
|
---|
718 | AjxDateUtil.SUNDAY=0;
|
---|
719 | AjxDateUtil.MONDAY=1;
|
---|
720 | AjxDateUtil.TUESDAY=2;
|
---|
721 | AjxDateUtil.WEDNESDAY=3;
|
---|
722 | AjxDateUtil.THURSDAY=4;
|
---|
723 | AjxDateUtil.FRIDAY=5;
|
---|
724 | AjxDateUtil.SATURDAY=6;
|
---|
725 | AjxDateUtil.getDateForNextDay=function(t,n,o){
|
---|
726 | o=o||1;
|
---|
727 | var a=new Date(t);
|
---|
728 | for(var e=0;
|
---|
729 | e<o;
|
---|
730 | e++){
|
---|
731 | a=AjxDateUtil._getDateForNextWeekday(a,n);
|
---|
732 | if(e<o-1){
|
---|
733 | a.setDate(a.getDate()+1)
|
---|
734 | }}
|
---|
735 | return a
|
---|
736 | };
|
---|
737 | AjxDateUtil.getDateForNextWorkWeekDay=function(t,o){
|
---|
738 | o=o?o:1;
|
---|
739 | var a=new Date(t);
|
---|
740 | for(var e=0;
|
---|
741 | e<o;
|
---|
742 | e++){
|
---|
743 | a=AjxDateUtil._getDateForNextWorkWeekday(a);
|
---|
744 | if(e<o-1){
|
---|
745 | a.setDate(a.getDate()+1)
|
---|
746 | }}
|
---|
747 | return a
|
---|
748 | };
|
---|
749 | AjxDateUtil.getDateForThisDay=function(e,a,t){
|
---|
750 | if(t<0){
|
---|
751 | return AjxDateUtil.getDateForPrevDay(e,a,-t)
|
---|
752 | }else{
|
---|
753 | return AjxDateUtil.getDateForNextDay(e,a,t)
|
---|
754 | }};
|
---|
755 | AjxDateUtil.getDateForThisWorkWeekDay=function(e,t){
|
---|
756 | if(t<0){
|
---|
757 | return AjxDateUtil.getDateForPrevWorkWeekDay(e,-t)
|
---|
758 | }else{
|
---|
759 | return AjxDateUtil.getDateForNextWorkWeekDay(e,t)
|
---|
760 | }};
|
---|
761 | AjxDateUtil.getDateForPrevDay=function(t,n,o){
|
---|
762 | o=o||1;
|
---|
763 | var a=new Date(t);
|
---|
764 | for(var e=0;
|
---|
765 | e<o;
|
---|
766 | e++){
|
---|
767 | a=AjxDateUtil._getDateForPrevWeekday(a,n);
|
---|
768 | if(e<o-1){
|
---|
769 | a.setDate(a.getDate()-1)
|
---|
770 | }}
|
---|
771 | return a
|
---|
772 | };
|
---|
773 | AjxDateUtil.getDateForPrevWorkWeekDay=function(t,o){
|
---|
774 | o=o||1;
|
---|
775 | var a=new Date(t);
|
---|
776 | for(var e=0;
|
---|
777 | e<o;
|
---|
778 | e++){
|
---|
779 | a=AjxDateUtil._getDateForPrevWorkWeekday(a);
|
---|
780 | if(e<o-1){
|
---|
781 | a.setDate(a.getDate()-1)
|
---|
782 | }}
|
---|
783 | return a
|
---|
784 | };
|
---|
785 | AjxDateUtil._getDateForNextWeekday=function(a,o){
|
---|
786 | var e=new Date(a);
|
---|
787 | var t=a.getDay();
|
---|
788 | if(t==o){
|
---|
789 | return e
|
---|
790 | }
|
---|
791 | var i=(o-t);
|
---|
792 | if(i>0){
|
---|
793 | e.setDate(a.getDate()+i)
|
---|
794 | }else{
|
---|
795 | e.setDate(a.getDate()+(7+i))
|
---|
796 | }
|
---|
797 | return e
|
---|
798 | };
|
---|
799 | AjxDateUtil._getDateForNextWorkWeekday=function(a){
|
---|
800 | var e=new Date(a);
|
---|
801 | var t=a.getDay();
|
---|
802 | if(t==AjxDateUtil.SUNDAY){
|
---|
803 | e.setDate(a.getDate()+1)
|
---|
804 | }else{
|
---|
805 | if(t==AjxDateUtil.SATURDAY){
|
---|
806 | e.setDate(a.getDate()+2)
|
---|
807 | }}
|
---|
808 | return e
|
---|
809 | };
|
---|
810 | AjxDateUtil._getDateForPrevWeekday=function(a,o){
|
---|
811 | var e=new Date(a);
|
---|
812 | var t=a.getDay();
|
---|
813 | if(t==o){
|
---|
814 | return e
|
---|
815 | }
|
---|
816 | var i=(t-o);
|
---|
817 | if(i>0){
|
---|
818 | e.setDate(a.getDate()-i)
|
---|
819 | }else{
|
---|
820 | e.setDate(a.getDate()-(7+i))
|
---|
821 | }
|
---|
822 | return e
|
---|
823 | };
|
---|
824 | AjxDateUtil._getDateForPrevWorkWeekday=function(a){
|
---|
825 | var e=new Date(a);
|
---|
826 | var t=a.getDay();
|
---|
827 | if(t==AjxDateUtil.SUNDAY){
|
---|
828 | e.setDate(a.getDate()-2)
|
---|
829 | }else{
|
---|
830 | if(t==AjxDateUtil.SATURDAY){
|
---|
831 | e.setDate(a.getDate()-1)
|
---|
832 | }}
|
---|
833 | return e
|
---|
834 | };
|
---|
835 | AjxDateUtil.calculate=function(f,n){
|
---|
836 | if(!AjxDateUtil.__calculate_initialized){
|
---|
837 | AjxDateUtil.__calculate_initialized=true;
|
---|
838 | AjxDateUtil.__calculate_init()
|
---|
839 | }
|
---|
840 | var e=n||new Date;
|
---|
841 | f=f.replace(/^\s*|\s*$/,"").replace(/\s*=\s*/g,"=").replace(/\s*,\s*/g,",");
|
---|
842 | var p=f.split(/\s+/g);
|
---|
843 | var y,h,o,l,u,d,g,t;
|
---|
844 | for(var c=0;
|
---|
845 | c<p.length;
|
---|
846 | c++){
|
---|
847 | y=p[c];
|
---|
848 | if(y.match(AjxDateUtil.RE_COMMENT)){
|
---|
849 | break
|
---|
850 | }
|
---|
851 | if(y.match(AjxDateUtil.RE_NOW)){
|
---|
852 | n=new Date(e.getTime());
|
---|
853 | continue
|
---|
854 | }
|
---|
855 | if(h=y.match(AjxDateUtil.RE_ADD_NUMBER)){
|
---|
856 | o=h[1];
|
---|
857 | l=AjxDateUtil.__calculate_parseInt(h[2]);
|
---|
858 | u=p[++c];
|
---|
859 | d=o=="+"?l:l*-1;
|
---|
860 | AjxDateUtil.__calculate_add(n,u,d);
|
---|
861 | continue
|
---|
862 | }
|
---|
863 | if(h=y.match(AjxDateUtil.RE_SET)){
|
---|
864 | AjxDateUtil.__calculate_set(n,h[1],h[2]);
|
---|
865 | continue
|
---|
866 | }
|
---|
867 | n=AjxDateFormat.parse("yyyyy-MM-dd",y);
|
---|
868 | if(!n&&(n=AjxDateFormat.parse("yyyy-MM-dd'T'hh:mm:ss'Z'",y))){
|
---|
869 | n.setMinutes(n.getMinutes()-n.getTimezoneOffset())
|
---|
870 | }
|
---|
871 | if(!n){
|
---|
872 | n=AjxDateFormat.parse("yyyy-MM-dd'T'HH:mm:ss",y)
|
---|
873 | }
|
---|
874 | if(!n){
|
---|
875 | throw'invalid date pattern: "'+y+'"'
|
---|
876 | }}
|
---|
877 | return n
|
---|
878 | };
|
---|
879 | AjxDateUtil.S_DAYNAME=[AjxMsg["calc.dayname.sunday"],AjxMsg["calc.dayname.monday"],AjxMsg["calc.dayname.tuesday"],AjxMsg["calc.dayname.wednesday"],AjxMsg["calc.dayname.thursday"],AjxMsg["calc.dayname.friday"],AjxMsg["calc.dayname.saturday"]].join("|");
|
---|
880 | AjxDateUtil.S_MONTHNAME=[AjxMsg["calc.monthname.january"],AjxMsg["calc.monthname.february"],AjxMsg["calc.monthname.march"],AjxMsg["calc.monthname.april"],AjxMsg["calc.monthname.may"],AjxMsg["calc.monthname.june"],AjxMsg["calc.monthname.july"],AjxMsg["calc.monthname.august"],AjxMsg["calc.monthname.september"],AjxMsg["calc.monthname.october"],AjxMsg["calc.monthname.november"],AjxMsg["calc.monthname.december"]].join("|");
|
---|
881 | AjxDateUtil.S_WEEKORD=[AjxMsg["calc.ordinal.first"],AjxMsg["calc.ordinal.second"],AjxMsg["calc.ordinal.third"],AjxMsg["calc.ordinal.fourth"],AjxMsg["calc.ordinal.fifth"],AjxMsg["calc.ordinal.last"]].join("|");
|
---|
882 | AjxDateUtil.WEEKORD_RE=[new RegExp("(first|"+AjxMsg["calc.ordinal.first"]+")","i"),new RegExp("(second|"+AjxMsg["calc.ordinal.second"]+")","i"),new RegExp("(third|"+AjxMsg["calc.ordinal.third"]+")","i"),new RegExp("(fourth|"+AjxMsg["calc.ordinal.fourth"]+")","i"),new RegExp("(last|"+AjxMsg["calc.ordinal.last"]+")","i")];
|
---|
883 | AjxMsg["calc.now"]="now";
|
---|
884 | AjxMsg["calc.date"]="date";
|
---|
885 | AjxMsg["calc.duration.year"]="year|years";
|
---|
886 | AjxMsg["calc.duration.month"]="mon|mons|month|months";
|
---|
887 | AjxMsg["calc.duration.day"]="day|days";
|
---|
888 | AjxMsg["calc.duration.hour"]="hour|hours";
|
---|
889 | AjxMsg["calc.duration.minute"]="min|mins|minute|minutes";
|
---|
890 | AjxMsg["calc.duration.week"]="week";
|
---|
891 | AjxMsg["calc.duration.second"]="sec|secs|second|seconds";
|
---|
892 | AjxMsg["calc.duration.millisecond"]="milli|millis|millisecond|milliseconds";
|
---|
893 | AjxDateUtil.S_DURATION=[AjxMsg["calc.duration.year"],AjxMsg["calc.duration.month"],AjxMsg["calc.duration.week"],AjxMsg["calc.duration.day"],AjxMsg["calc.duration.hour"],AjxMsg["calc.duration.minute"],AjxMsg["calc.duration.second"],AjxMsg["calc.duration.millisecond"]].join("|");
|
---|
894 | AjxDateUtil.__calculate_init=function(){
|
---|
895 | AjxDateUtil.WEEKDAYS={};
|
---|
896 | var t=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];
|
---|
897 | for(var o=0;
|
---|
898 | o<t.length;
|
---|
899 | o++){
|
---|
900 | var n=AjxMsg["calc.dayname."+t[o]].split("|");
|
---|
901 | for(var a=0;
|
---|
902 | a<n.length;
|
---|
903 | a++){
|
---|
904 | AjxDateUtil.WEEKDAYS[n[a].toLowerCase()]=o
|
---|
905 | }}
|
---|
906 | AjxDateUtil.MONTHNAME2MONTHNUM={};
|
---|
907 | var e=["january","february","march","april","may","june","july","august","september","october","november","december"];
|
---|
908 | for(var o=0;
|
---|
909 | o<e.length;
|
---|
910 | o++){
|
---|
911 | var s=AjxMsg["calc.monthname."+e[o]].split("|");
|
---|
912 | for(var a=0;
|
---|
913 | a<s.length;
|
---|
914 | a++){
|
---|
915 | AjxDateUtil.MONTHNAME2MONTHNUM[s[a].toLowerCase()]=o
|
---|
916 | }}
|
---|
917 | AjxDateUtil.RE_YEAR=new RegExp("^("+AjxMsg["calc.duration.year"]+")$","i");
|
---|
918 | AjxDateUtil.RE_MONTH=new RegExp("^("+AjxMsg["calc.duration.month"]+")$","i");
|
---|
919 | AjxDateUtil.RE_WEEK=new RegExp("^("+AjxMsg["calc.duration.week"]+")$","i");
|
---|
920 | AjxDateUtil.RE_DAY=new RegExp("^("+AjxMsg["calc.duration.day"]+")$","i");
|
---|
921 | AjxDateUtil.RE_HOUR=new RegExp("^("+AjxMsg["calc.duration.hour"]+")$","i");
|
---|
922 | AjxDateUtil.RE_MINUTE=new RegExp("^("+AjxMsg["calc.duration.minute"]+")$","i");
|
---|
923 | AjxDateUtil.RE_SECOND=new RegExp("^("+AjxMsg["calc.duration.second"]+")$","i");
|
---|
924 | AjxDateUtil.RE_MILLISECOND=new RegExp("^("+AjxMsg["calc.duration.millisecond"]+")$","i");
|
---|
925 | AjxDateUtil.RE_DATE=new RegExp("^("+AjxMsg["calc.date"]+")$","i");
|
---|
926 | AjxDateUtil.RE_DAYNAME=new RegExp("^("+AjxDateUtil.S_DAYNAME+")$","i");
|
---|
927 | AjxDateUtil.RE_MONTHNAME=new RegExp("^("+AjxDateUtil.S_MONTHNAME+")$","i");
|
---|
928 | AjxDateUtil.RE_WEEKORD=new RegExp("^("+AjxDateUtil.S_WEEKORD+")$","i");
|
---|
929 | AjxDateUtil.RE_COMMENT=/^#/;
|
---|
930 | AjxDateUtil.RE_NOW=new RegExp("^("+AjxMsg["calc.now"]+")$","i");
|
---|
931 | AjxDateUtil.RE_ADD_NUMBER=new RegExp("^([+\\-])(\\d+)$","i");
|
---|
932 | AjxDateUtil.RE_SET=new RegExp("^("+AjxDateUtil.S_DURATION+"|"+AjxMsg["calc.date"]+")=(.*)$","i")
|
---|
933 | };
|
---|
934 | AjxDateUtil.__calculate_normalizeFullWidthDigit=function(t){
|
---|
935 | var e="0".charCodeAt(0)+t.charCodeAt(0)-"\uff10".charCodeAt(0);
|
---|
936 | return String.fromCharCode(e)
|
---|
937 | };
|
---|
938 | AjxDateUtil.__calculate_replaceFullWidthDigit=function(e,t){
|
---|
939 | return AjxDateUtil.__calculate_normalizeFullWidthDigit(t)
|
---|
940 | };
|
---|
941 | AjxDateUtil.__calculate_parseInt=function(e){
|
---|
942 | e=e.replace(/([\uFF10-\uFF19])/g,AjxDateUtil.__calculate_normalizeFullWidthDigit);
|
---|
943 | return parseInt(e,10)
|
---|
944 | };
|
---|
945 | AjxDateUtil.__calculate_add=function(a,o,i){
|
---|
946 | if(o.match(AjxDateUtil.RE_YEAR)){
|
---|
947 | a.setFullYear(a.getFullYear()+i);
|
---|
948 | return
|
---|
949 | }
|
---|
950 | if(o.match(AjxDateUtil.RE_MONTH)){
|
---|
951 | var n=a.getMonth();
|
---|
952 | a.setMonth(n+i);
|
---|
953 | if(Math.abs(n+i)%12!=a.getMonth()){
|
---|
954 | a.setDate(0)
|
---|
955 | }
|
---|
956 | return
|
---|
957 | }
|
---|
958 | if(o.match(AjxDateUtil.RE_WEEK)){
|
---|
959 | a.setDate(a.getDate()+i*7);
|
---|
960 | return
|
---|
961 | }
|
---|
962 | if(o.match(AjxDateUtil.RE_DAY)){
|
---|
963 | a.setDate(a.getDate()+i);
|
---|
964 | return
|
---|
965 | }
|
---|
966 | if(o.match(AjxDateUtil.RE_HOUR)){
|
---|
967 | a.setHours(a.getHours()+i);
|
---|
968 | return
|
---|
969 | }
|
---|
970 | if(o.match(AjxDateUtil.RE_MINUTE)){
|
---|
971 | a.setMinutes(a.getMinutes()+i);
|
---|
972 | return
|
---|
973 | }
|
---|
974 | if(o.match(AjxDateUtil.RE_SECOND)){
|
---|
975 | a.setSeconds(a.getSeconds()+i);
|
---|
976 | return
|
---|
977 | }
|
---|
978 | if(o.match(AjxDateUtil.RE_MILLISECOND)){
|
---|
979 | a.setMilliseconds(a.getMilliseconds()+i);
|
---|
980 | return
|
---|
981 | }
|
---|
982 | if(o.match(AjxDateUtil.RE_MONTHNAME)){
|
---|
983 | var e=AjxDateUtil.MONTHNAME2MONTHNUM[o.toLowerCase()];
|
---|
984 | if(e<a.getMonth()){
|
---|
985 | i+=i>0?0:1
|
---|
986 | }else{
|
---|
987 | if(e>a.getMonth()){
|
---|
988 | i+=i>0?-1:0
|
---|
989 | }}
|
---|
990 | a.setFullYear(a.getFullYear()+i,e,1);
|
---|
991 | return
|
---|
992 | }
|
---|
993 | if(o.match(AjxDateUtil.RE_DAYNAME)){
|
---|
994 | var t=AjxDateUtil.WEEKDAYS[o.toLowerCase()];
|
---|
995 | if(t<a.getDay()){
|
---|
996 | i+=i>0?0:1
|
---|
997 | }else{
|
---|
998 | if(t>a.getDay()){
|
---|
999 | i+=i>0?-1:0
|
---|
1000 | }}
|
---|
1001 | a.setDate(a.getDate()+(t-a.getDay())+7*i);
|
---|
1002 | return
|
---|
1003 | }
|
---|
1004 | throw"unknown type: "+o
|
---|
1005 | };
|
---|
1006 | AjxDateUtil.__calculate_add_ordinal=function(){
|
---|
1007 | throw"TODO: not implemented"
|
---|
1008 | };
|
---|
1009 | AjxDateUtil.__calculate_set=function(i,h,c){
|
---|
1010 | var n=c.split(/,/);
|
---|
1011 | if(h.match(AjxDateUtil.RE_YEAR)){
|
---|
1012 | n[0]=AjxDateUtil.__calculate_fullYear(n[0]);
|
---|
1013 | if(n[1]!=null){
|
---|
1014 | n[1]=AjxDateUtil.__calculate_month(n[1])
|
---|
1015 | }
|
---|
1016 | if(n[2]!=null){
|
---|
1017 | n[2]=parseInt(n[2],10)
|
---|
1018 | }
|
---|
1019 | i.setFullYear.apply(i,n);
|
---|
1020 | return
|
---|
1021 | }
|
---|
1022 | if(h.match(AjxDateUtil.RE_MONTH)){
|
---|
1023 | n[0]=AjxDateUtil.__calculate_month(n[0]);
|
---|
1024 | if(n[1]!=null){
|
---|
1025 | n[1]=parseInt(n[1],10)
|
---|
1026 | }
|
---|
1027 | i.setMonth.apply(i,n);
|
---|
1028 | return
|
---|
1029 | }
|
---|
1030 | if(h.match(AjxDateUtil.RE_WEEK)){
|
---|
1031 | var t=AjxDateUtil.__calculate_week(n[0]);
|
---|
1032 | var l=n[1]?AjxDateUtil.__calculate_day(n[1]):i.getDay();
|
---|
1033 | var o;
|
---|
1034 | if(t!=-1){
|
---|
1035 | var e=new Date(i.getFullYear(),i.getMonth(),1,12,0,0,0);
|
---|
1036 | var a=e.getDay();
|
---|
1037 | var d=a-l;
|
---|
1038 | o=new Date(e.getTime());
|
---|
1039 | o.setDate(1-d);
|
---|
1040 | if(d>0){
|
---|
1041 | o.setDate(o.getDate()+7)
|
---|
1042 | }
|
---|
1043 | o.setDate(o.getDate()+7*t)
|
---|
1044 | }else{
|
---|
1045 | var s=new Date(i.getFullYear(),i.getMonth()+1,0,12,0,0,0);
|
---|
1046 | o=new Date(s.getTime());
|
---|
1047 | o.setDate(o.getDate()-(o.getDay()-l));
|
---|
1048 | if(o.getMonth()!=s.getMonth()){
|
---|
1049 | o.setDate(o.getDate()-7)
|
---|
1050 | }}
|
---|
1051 | if(o&&(i.getMonth()==o.getMonth())){
|
---|
1052 | i.setTime(o.getTime())
|
---|
1053 | }
|
---|
1054 | return
|
---|
1055 | }
|
---|
1056 | if(h.match(AjxDateUtil.RE_DATE)){
|
---|
1057 | n[0]=parseInt(n[0],10);
|
---|
1058 | i.setDate.apply(i,n);
|
---|
1059 | return
|
---|
1060 | }
|
---|
1061 | if(h.match(AjxDateUtil.RE_HOUR)){
|
---|
1062 | n[0]=parseInt(n[0],10);
|
---|
1063 | if(n[1]!=null){
|
---|
1064 | n[1]=parseInt(n[1],10)
|
---|
1065 | }
|
---|
1066 | if(n[2]!=null){
|
---|
1067 | n[2]=parseInt(n[2],10)
|
---|
1068 | }
|
---|
1069 | if(n[3]!=null){
|
---|
1070 | n[3]=parseInt(n[3],10)
|
---|
1071 | }
|
---|
1072 | i.setHours.apply(i,n);
|
---|
1073 | return
|
---|
1074 | }
|
---|
1075 | if(h.match(AjxDateUtil.RE_MINUTE)){
|
---|
1076 | n[0]=parseInt(n[0],10);
|
---|
1077 | if(n[1]!=null){
|
---|
1078 | n[1]=parseInt(n[1],10)
|
---|
1079 | }
|
---|
1080 | if(n[2]!=null){
|
---|
1081 | n[2]=parseInt(n[2],10)
|
---|
1082 | }
|
---|
1083 | i.setMinutes.apply(i,n);
|
---|
1084 | return
|
---|
1085 | }
|
---|
1086 | if(h.match(AjxDateUtil.RE_SECOND)){
|
---|
1087 | n[0]=parseInt(n[0],10);
|
---|
1088 | if(n[1]!=null){
|
---|
1089 | n[1]=parseInt(n[1],10)
|
---|
1090 | }
|
---|
1091 | i.setSeconds.apply(i,n);
|
---|
1092 | return
|
---|
1093 | }
|
---|
1094 | if(h.match(AjxDateUtil.RE_MILLISECOND)){
|
---|
1095 | i.setMilliseconds.apply(i,n);
|
---|
1096 | return
|
---|
1097 | }
|
---|
1098 | throw"unknown type: "+h
|
---|
1099 | };
|
---|
1100 | AjxDateUtil.__calculate_fullYear=function(e){
|
---|
1101 | if(e.length==2){
|
---|
1102 | var t=new Date;
|
---|
1103 | t.setYear(parseInt(e,10));
|
---|
1104 | e=String(t.getFullYear()).substr(0,2)+e
|
---|
1105 | }
|
---|
1106 | return parseInt(e,10)
|
---|
1107 | };
|
---|
1108 | AjxDateUtil.__calculate_month=function(t){
|
---|
1109 | var e=AjxDateUtil.MONTHNAME2MONTHNUM[t.toLowerCase()];
|
---|
1110 | return e!=null?e:parseInt(t,10)-1
|
---|
1111 | };
|
---|
1112 | AjxDateUtil.__calculate_week=function(t){
|
---|
1113 | for(var e=0;
|
---|
1114 | e<AjxDateUtil.WEEKORD_RE.length;
|
---|
1115 | e++){
|
---|
1116 | if(t.match(AjxDateUtil.WEEKORD_RE[e])){
|
---|
1117 | if(e==AjxDateUtil.WEEKORD_RE.length-1){
|
---|
1118 | return -1
|
---|
1119 | }
|
---|
1120 | return e
|
---|
1121 | }}
|
---|
1122 | return 0
|
---|
1123 | };
|
---|
1124 | AjxDateUtil.__calculate_day=function(t){
|
---|
1125 | var e=AjxDateUtil.WEEKDAYS[t.toLowerCase()];
|
---|
1126 | return e!=null?e:parseInt(t,10)
|
---|
1127 | }
|
---|
1128 | }
|
---|
1129 | if(AjxPackage.define("ajax.util.AjxSelectionManager")){
|
---|
1130 | AjxSelectionManager=function(e){
|
---|
1131 | this._owner=e
|
---|
1132 | };
|
---|
1133 | AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS=0;
|
---|
1134 | AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS=1;
|
---|
1135 | AjxSelectionManager.SELECT_TO_ANCHOR=2;
|
---|
1136 | AjxSelectionManager.DESELECT_ALL=3;
|
---|
1137 | AjxSelectionManager.SELECT_ALL=4;
|
---|
1138 | AjxSelectionManager.prototype.getItems=function(){
|
---|
1139 | if(this._selectedItems==null){
|
---|
1140 | this._selectedItems=this._createItemsCollection()
|
---|
1141 | }
|
---|
1142 | return this._selectedItems
|
---|
1143 | };
|
---|
1144 | AjxSelectionManager.prototype.getLength=function(){
|
---|
1145 | return this.getItems().length
|
---|
1146 | };
|
---|
1147 | AjxSelectionManager.prototype.getAnchor=function(){
|
---|
1148 | if(this._anchor==null){
|
---|
1149 | var e=this.getItems();
|
---|
1150 | if(e.length>0){
|
---|
1151 | this._anchor=e[0]
|
---|
1152 | }}
|
---|
1153 | return this._anchor
|
---|
1154 | };
|
---|
1155 | AjxSelectionManager.prototype.getCursor=function(){
|
---|
1156 | if(this._cursor==null){
|
---|
1157 | this._cursor=this.getAnchor()
|
---|
1158 | }
|
---|
1159 | return this._cursor
|
---|
1160 | };
|
---|
1161 | AjxSelectionManager.prototype.isSelected=function(e){
|
---|
1162 | return this.getItems().binarySearch(e)!=-1
|
---|
1163 | };
|
---|
1164 | AjxSelectionManager.prototype.selectOneItem=function(e){
|
---|
1165 | this.select(e,AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS)
|
---|
1166 | };
|
---|
1167 | AjxSelectionManager.prototype.toggleItem=function(e){
|
---|
1168 | this.select(e,AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS)
|
---|
1169 | };
|
---|
1170 | AjxSelectionManager.prototype.selectFromAnchorToItem=function(e){
|
---|
1171 | this.select(e,AjxSelectionManager.SELECT_TO_ANCHOR)
|
---|
1172 | };
|
---|
1173 | AjxSelectionManager.prototype.deselectAll=function(){
|
---|
1174 | this.select(null,AjxSelectionManager.DESELECT_ALL)
|
---|
1175 | };
|
---|
1176 | AjxSelectionManager.prototype.selectAll=function(){
|
---|
1177 | this.select(null,AjxSelectionManager.SELECT_ALL)
|
---|
1178 | };
|
---|
1179 | AjxSelectionManager.prototype.select=function(p,s){
|
---|
1180 | this._setAnchorAndCursor(p,s);
|
---|
1181 | var f=this._selectedItems;
|
---|
1182 | var n=(f==null)?0:f.length;
|
---|
1183 | this._selectedItems=null;
|
---|
1184 | this._selectedItems=this._createItemsCollection();
|
---|
1185 | var e=this._owner.getItemCount();
|
---|
1186 | var m=false;
|
---|
1187 | var o=false;
|
---|
1188 | var d=false;
|
---|
1189 | for(var l=0;
|
---|
1190 | l<e;
|
---|
1191 | ++l){
|
---|
1192 | var c=this._owner.getItem(l);
|
---|
1193 | var u=this._isItemOldSelection(c,f);
|
---|
1194 | var t=u;
|
---|
1195 | switch(s){
|
---|
1196 | case AjxSelectionManager.SELECT_TO_ANCHOR:if(this._anchor==null){
|
---|
1197 | this._anchor=c
|
---|
1198 | }
|
---|
1199 | var a=(c==this._anchor||c==p);
|
---|
1200 | var h=false;
|
---|
1201 | if(!d&&a){
|
---|
1202 | d=true;
|
---|
1203 | h=true
|
---|
1204 | }
|
---|
1205 | t=d;
|
---|
1206 | if((!h||this._anchor==p)&&d&&a){
|
---|
1207 | d=false
|
---|
1208 | }
|
---|
1209 | break;
|
---|
1210 | case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:t=(c==p);
|
---|
1211 | break;
|
---|
1212 | case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:if(c==p){
|
---|
1213 | t=!u
|
---|
1214 | }
|
---|
1215 | break;
|
---|
1216 | case AjxSelectionManager.DESELECT_ALL:t=false;
|
---|
1217 | break;
|
---|
1218 | case AjxSelectionManager.SELECT_ALL:t=true;
|
---|
1219 | break
|
---|
1220 | }
|
---|
1221 | if(t){
|
---|
1222 | this._selectedItems.add(c);
|
---|
1223 | m=(this._selectedItems.length>1)
|
---|
1224 | }
|
---|
1225 | if(t!=u){
|
---|
1226 | if(this._owner.itemSelectionChanged!=null){
|
---|
1227 | this._owner.itemSelectionChanged(c,l,t)
|
---|
1228 | }
|
---|
1229 | o=true
|
---|
1230 | }}
|
---|
1231 | o=o||(n!=this._selectedItems.length);
|
---|
1232 | if(m){
|
---|
1233 | this._selectedItems.sort()
|
---|
1234 | }
|
---|
1235 | if(o&&this._owner.selectionChanged!=null){
|
---|
1236 | this._owner.selectionChanged(p)
|
---|
1237 | }};
|
---|
1238 | AjxSelectionManager.prototype.removeItem=function(t){
|
---|
1239 | if(this._selectedItems){
|
---|
1240 | var e=this._selectedItems.binarySearch(t);
|
---|
1241 | if(e>-1){
|
---|
1242 | this._selectedItems.removeAt(e)
|
---|
1243 | }}};
|
---|
1244 | AjxSelectionManager.prototype._createItemsCollection=function(){
|
---|
1245 | return new AjxVector()
|
---|
1246 | };
|
---|
1247 | AjxSelectionManager.prototype._isItemOldSelection=function(t,i){
|
---|
1248 | var e=false;
|
---|
1249 | if(i){
|
---|
1250 | var a=i.binarySearch(t);
|
---|
1251 | if(a>-1){
|
---|
1252 | i.removeAt(a)
|
---|
1253 | }
|
---|
1254 | e=(a!=-1)
|
---|
1255 | }
|
---|
1256 | return e
|
---|
1257 | };
|
---|
1258 | AjxSelectionManager.prototype._setAnchorAndCursor=function(e,t){
|
---|
1259 | switch(t){
|
---|
1260 | case AjxSelectionManager.SELECT_TO_ANCHOR:this._cursor=e;
|
---|
1261 | break;
|
---|
1262 | case AjxSelectionManager.SELECT_ONE_CLEAR_OTHERS:this._anchor=e;
|
---|
1263 | this._cursor=e;
|
---|
1264 | break;
|
---|
1265 | case AjxSelectionManager.TOGGLE_ONE_LEAVE_OTHERS:this._anchor=e;
|
---|
1266 | this._cursor=e;
|
---|
1267 | break;
|
---|
1268 | case AjxSelectionManager.DESELECT_ALL:this._anchor=null;
|
---|
1269 | this._cursor=null;
|
---|
1270 | break;
|
---|
1271 | case AjxSelectionManager.SELECT_ALL:return
|
---|
1272 | }}
|
---|
1273 | }
|
---|
1274 | if(AjxPackage.define("ajax.net.AjxPost")){
|
---|
1275 | AjxPost=function(e){
|
---|
1276 | this._callback=null;
|
---|
1277 | this._iframeId=e
|
---|
1278 | };
|
---|
1279 | AjxPost._reqIds=0;
|
---|
1280 | AjxPost._outStandingRequests=new Object();
|
---|
1281 | AjxPost.SC_CONTINUE=100;
|
---|
1282 | AjxPost.SC_OK=200;
|
---|
1283 | AjxPost.SC_ACCEPTED=202;
|
---|
1284 | AjxPost.SC_NO_CONTENT=204;
|
---|
1285 | AjxPost.SC_BAD_REQUEST=400;
|
---|
1286 | AjxPost.SC_UNAUTHORIZED=401;
|
---|
1287 | AjxPost.SC_REQUEST_TIMEOUT=408;
|
---|
1288 | AjxPost.SC_CONFLICT=409;
|
---|
1289 | AjxPost.SC_REQUEST_ENTITY_TOO_LARGE=413;
|
---|
1290 | AjxPost.SC_INTERNAL_SERVER_ERROR=500;
|
---|
1291 | AjxPost.SC_BAD_GATEWAY=502;
|
---|
1292 | AjxPost.SC_SERVICE_UNAVAILABLE=503;
|
---|
1293 | AjxPost.prototype.execute=function(d,e,c){
|
---|
1294 | var u=e.getElementsByTagName("input");
|
---|
1295 | var n=new Array();
|
---|
1296 | for(var a=0;
|
---|
1297 | a<u.length;
|
---|
1298 | a++){
|
---|
1299 | var m=u[a];
|
---|
1300 | if(m.type=="file"){
|
---|
1301 | n.push(m);
|
---|
1302 | continue
|
---|
1303 | }
|
---|
1304 | if(m.name&&m.name.match(/^filename\d+$/)){
|
---|
1305 | m.parentNode.removeChild(m);
|
---|
1306 | a--;
|
---|
1307 | continue
|
---|
1308 | }}
|
---|
1309 | for(var a=0;
|
---|
1310 | a<n.length;
|
---|
1311 | a++){
|
---|
1312 | var o=document.createElement("input");
|
---|
1313 | o.type="hidden";
|
---|
1314 | o.name="filename"+(a+1);
|
---|
1315 | o.value=n[a].value;
|
---|
1316 | n[a].parentNode.insertBefore(o,n[a])
|
---|
1317 | }
|
---|
1318 | e.target=this._iframeId;
|
---|
1319 | this._callback=d;
|
---|
1320 | var l=new AjxPostRequest(e);
|
---|
1321 | var t=new AjxTimedAction(this,this._onFailure,[l.id]);
|
---|
1322 | var h=c?c:5000;
|
---|
1323 | AjxPost._outStandingRequests[l.id]=l;
|
---|
1324 | try{
|
---|
1325 | l.send(t,h)
|
---|
1326 | }
|
---|
1327 | catch(s){
|
---|
1328 | if(AjxEnv.isIE){
|
---|
1329 | if(s.number==-2147024891){
|
---|
1330 | throw new AjxException(ZmMsg.uploadErrorAccessDenied,s.number)
|
---|
1331 | }}
|
---|
1332 | throw s
|
---|
1333 | }};
|
---|
1334 | AjxPost.prototype._onFailure=function(t){
|
---|
1335 | var e=AjxPost._outStandingRequests[t];
|
---|
1336 | e.cancel();
|
---|
1337 | delete AjxPost._outStandingRequests[t];
|
---|
1338 | if(this._callback){
|
---|
1339 | this._callback.run([404]);
|
---|
1340 | this._callback=null
|
---|
1341 | }};
|
---|
1342 | AjxPost.prototype.loaded=function(e,a,i){
|
---|
1343 | var t=AjxPost._outStandingRequests[a];
|
---|
1344 | if(t&&!t.hasBeenCancelled()){
|
---|
1345 | t.cancelTimeout()
|
---|
1346 | }
|
---|
1347 | delete AjxPost._outStandingRequests[a];
|
---|
1348 | if(this._callback){
|
---|
1349 | this._callback.run(e,i);
|
---|
1350 | this._callback=null
|
---|
1351 | }};
|
---|
1352 | AjxPostRequest=function(t){
|
---|
1353 | this.id=AjxPost._reqIds++;
|
---|
1354 | this._cancelled=false;
|
---|
1355 | this._form=t;
|
---|
1356 | var e=t.elements.namedItem("requestId");
|
---|
1357 | if(!e){
|
---|
1358 | e=t.ownerDocument.createElement("input");
|
---|
1359 | e.type="hidden";
|
---|
1360 | e.name="requestId"
|
---|
1361 | }
|
---|
1362 | e.value=this.id;
|
---|
1363 | t.appendChild(e)
|
---|
1364 | };
|
---|
1365 | AjxPostRequest.prototype.send=function(t,e){
|
---|
1366 | this._form.submit()
|
---|
1367 | };
|
---|
1368 | AjxPostRequest.prototype.hasBeenCancelled=function(){
|
---|
1369 | return this._cancelled
|
---|
1370 | };
|
---|
1371 | AjxPostRequest.prototype.cancelTimeout=function(){
|
---|
1372 | AjxTimedAction.cancelAction(this._timeoutId)
|
---|
1373 | };
|
---|
1374 | AjxPostRequest.prototype.cancel=function(){
|
---|
1375 | this._cancelled=true
|
---|
1376 | }
|
---|
1377 | }
|
---|
1378 | if(AjxPackage.define("ajax.util.AjxBuffer")){
|
---|
1379 | AjxBuffer=function(){
|
---|
1380 | this.clear();
|
---|
1381 | if(arguments.length>0){
|
---|
1382 | arguments.join=this.buffer.join;
|
---|
1383 | this.buffer[this.buffer.length]=arguments.join("")
|
---|
1384 | }};
|
---|
1385 | AjxBuffer.prototype.toString=function(){
|
---|
1386 | return this.buffer.join("")
|
---|
1387 | };
|
---|
1388 | AjxBuffer.prototype.join=function(e){
|
---|
1389 | if(e==null){
|
---|
1390 | e=""
|
---|
1391 | }
|
---|
1392 | return this.buffer.join(e)
|
---|
1393 | };
|
---|
1394 | AjxBuffer.prototype.append=function(){
|
---|
1395 | arguments.join=this.buffer.join;
|
---|
1396 | this.buffer[this.buffer.length]=arguments.join("")
|
---|
1397 | };
|
---|
1398 | AjxBuffer.prototype.join=function(e){
|
---|
1399 | return this.buffer.join(e)
|
---|
1400 | };
|
---|
1401 | AjxBuffer.prototype.set=function(e){
|
---|
1402 | this.buffer=[e]
|
---|
1403 | };
|
---|
1404 | AjxBuffer.prototype.clear=function(){
|
---|
1405 | this.buffer=[]
|
---|
1406 | };
|
---|
1407 | AjxBuffer.concat=function(){
|
---|
1408 | arguments.join=Array.prototype.join;
|
---|
1409 | return arguments.join("")
|
---|
1410 | };
|
---|
1411 | AjxBuffer.append=AjxBuffer.concat
|
---|
1412 | }
|
---|
1413 | if(AjxPackage.define("ajax.xslt.AjxXslt")){
|
---|
1414 | AjxXslt=function(){
|
---|
1415 | var o=AjxXmlDoc.create();
|
---|
1416 | if(AjxEnv.isIE){
|
---|
1417 | var n=null;
|
---|
1418 | var e=["MSXML2.FreeThreadedDOMDocument.5.0","MSXML2.FreeThreadedDOMDocument.3.0"];
|
---|
1419 | for(var a=0;
|
---|
1420 | a<e.length;
|
---|
1421 | a++){
|
---|
1422 | try{
|
---|
1423 | n=new ActiveXObject(e[a]);
|
---|
1424 | break
|
---|
1425 | }
|
---|
1426 | catch(t){}}
|
---|
1427 | if(!n){
|
---|
1428 | throw new AjxException("FreeThreadedDOMDocument",AjxException.UNSUPPORTED,"AjxXslt")
|
---|
1429 | }
|
---|
1430 | n.async=false;
|
---|
1431 | o._doc=n
|
---|
1432 | }
|
---|
1433 | this._doc=o
|
---|
1434 | };
|
---|
1435 | AjxXslt.prototype.toString=function(){
|
---|
1436 | return"AjxXslt"
|
---|
1437 | };
|
---|
1438 | AjxXslt.createFromUrl=function(e){
|
---|
1439 | var t=new AjxXslt();
|
---|
1440 | t.loadUrl(e);
|
---|
1441 | return t
|
---|
1442 | };
|
---|
1443 | AjxXslt.createFromString=function(t){
|
---|
1444 | var e=new AjxXslt();
|
---|
1445 | e._doc.loadFromString(t);
|
---|
1446 | e.createProcessor();
|
---|
1447 | return e
|
---|
1448 | };
|
---|
1449 | AjxXslt.prototype.createProcessor=function(){
|
---|
1450 | var s=this._doc.getDoc();
|
---|
1451 | if(AjxEnv.isNav){
|
---|
1452 | this._processor=new XSLTProcessor();
|
---|
1453 | this._processor.importStylesheet(s)
|
---|
1454 | }else{
|
---|
1455 | if(AjxEnv.isIE){
|
---|
1456 | var n=s.parseError;
|
---|
1457 | if(n.errorCode!=0){
|
---|
1458 | throw new AjxException(n.reason,AjxException.INVALID_PARAM,"AjxXslt.createProcessor")
|
---|
1459 | }
|
---|
1460 | var e=null;
|
---|
1461 | var t=["MSXML2.XSLTemplate.5.0","MSXML2.XSLTemplate.3.0"];
|
---|
1462 | for(var o=0;
|
---|
1463 | o<t.length;
|
---|
1464 | o++){
|
---|
1465 | try{
|
---|
1466 | e=new ActiveXObject(t[o]);
|
---|
1467 | break
|
---|
1468 | }
|
---|
1469 | catch(a){}}
|
---|
1470 | if(!e){
|
---|
1471 | throw new AjxException("XSLTemplate",AjxException.UNSUPPORTED,"AjxXslt.createProcessor")
|
---|
1472 | }
|
---|
1473 | this._processor=e;
|
---|
1474 | this._processor.stylesheet=s
|
---|
1475 | }}};
|
---|
1476 | AjxXslt._finishedLoading=function(){
|
---|
1477 | var e=this._xslt;
|
---|
1478 | e.createProcessor()
|
---|
1479 | };
|
---|
1480 | AjxXslt.prototype.loadUrl=function(e){
|
---|
1481 | var a=this._doc;
|
---|
1482 | if(AjxEnv.isNav){
|
---|
1483 | var t=a.getDoc();
|
---|
1484 | t._xslt=this;
|
---|
1485 | t.addEventListener("load",AjxXslt._finishedLoading,false)
|
---|
1486 | }
|
---|
1487 | a.loadFromUrl(e);
|
---|
1488 | if(AjxEnv.isIE){
|
---|
1489 | this.createProcessor()
|
---|
1490 | }};
|
---|
1491 | AjxXslt.prototype.transformToDom=function(a){
|
---|
1492 | var e;
|
---|
1493 | if(AjxEnv.isIE){
|
---|
1494 | e=this.transformIE(a)
|
---|
1495 | }else{
|
---|
1496 | if(AjxEnv.isNav){
|
---|
1497 | return this.transformNav(a)
|
---|
1498 | }else{
|
---|
1499 | return a
|
---|
1500 | }}
|
---|
1501 | var t=AjxXmlDoc.createFromXml(e);
|
---|
1502 | return t.getDoc()
|
---|
1503 | };
|
---|
1504 | AjxXslt.prototype.transformToString=function(a){
|
---|
1505 | var e;
|
---|
1506 | if(AjxEnv.isIE){
|
---|
1507 | return this.transformIE(a)
|
---|
1508 | }else{
|
---|
1509 | if(AjxEnv.isNav){
|
---|
1510 | e=this.transformNav(a)
|
---|
1511 | }else{
|
---|
1512 | return a.documentElement.innerHTML
|
---|
1513 | }}
|
---|
1514 | if(!e||!e.documentElement){
|
---|
1515 | throw new AjxException("XSL transformation failed.",AjxException.INVALID_PARAM,"AjxXslt.transformToString")
|
---|
1516 | }
|
---|
1517 | var t=e.documentElement;
|
---|
1518 | if((t instanceof HTMLElement)||(t instanceof HTMLHtmlElement)){
|
---|
1519 | return t.innerHTML
|
---|
1520 | }else{
|
---|
1521 | if(t instanceof Element){
|
---|
1522 | return AjxXmlDoc.replaceInvalidChars(t.xml)
|
---|
1523 | }}
|
---|
1524 | return a.documentElement.innerHTML
|
---|
1525 | };
|
---|
1526 | AjxXslt.prototype.transformIE=function(t){
|
---|
1527 | try{
|
---|
1528 | var a=this._processor.createProcessor();
|
---|
1529 | a.input=t;
|
---|
1530 | a.transform();
|
---|
1531 | return a.output
|
---|
1532 | }
|
---|
1533 | catch(e){
|
---|
1534 | throw new AjxException(e.description,AjxException.INVALID_PARAM,"AjxXslt.transformIE")
|
---|
1535 | }};
|
---|
1536 | AjxXslt.prototype.transformNav=function(e){
|
---|
1537 | return this._processor.transformToDocument(e)
|
---|
1538 | };
|
---|
1539 | AjxXslt.prototype.transformNav2=function(e){
|
---|
1540 | this._fragment=document.implementation.createDocument("","",null);
|
---|
1541 | return this._processor.transformToFragment(e,this._fragment)
|
---|
1542 | }
|
---|
1543 | }
|
---|
1544 | if(AjxPackage.define("ajax.util.AjxSHA1")){
|
---|
1545 | var AjxSHA1=function(){
|
---|
1546 | var p=0;
|
---|
1547 | var v="";
|
---|
1548 | var a=8;
|
---|
1549 | function c(k){
|
---|
1550 | return l(o(w(k),k.length*a))
|
---|
1551 | }
|
---|
1552 | function h(k){
|
---|
1553 | return m(o(w(k),k.length*a))
|
---|
1554 | }
|
---|
1555 | function i(k){
|
---|
1556 | return y(o(w(k),k.length*a))
|
---|
1557 | }
|
---|
1558 | function t(k,x){
|
---|
1559 | return l(n(k,x))
|
---|
1560 | }
|
---|
1561 | function s(k,x){
|
---|
1562 | return m(n(k,x))
|
---|
1563 | }
|
---|
1564 | function u(k,x){
|
---|
1565 | return y(n(k,x))
|
---|
1566 | }
|
---|
1567 | function e(){
|
---|
1568 | return c("abc")=="a9993e364706816aba3e25717850c26c9cd0d89d"
|
---|
1569 | }
|
---|
1570 | function o(R,B){
|
---|
1571 | R[B>>5]|=128<<(24-B%32);
|
---|
1572 | R[((B+64>>9)<<4)+15]=B;
|
---|
1573 | var H=Array(80);
|
---|
1574 | var M=1732584193;
|
---|
1575 | var F=-271733879;
|
---|
1576 | var S=-1732584194;
|
---|
1577 | var D=271733878;
|
---|
1578 | var C=-1009589776;
|
---|
1579 | for(var O=0;
|
---|
1580 | O<R.length;
|
---|
1581 | O+=16){
|
---|
1582 | var W=M;
|
---|
1583 | var A=F;
|
---|
1584 | var T=S;
|
---|
1585 | var z=D;
|
---|
1586 | var k=C;
|
---|
1587 | for(var q=0;
|
---|
1588 | q<80;
|
---|
1589 | q++){
|
---|
1590 | if(q<16){
|
---|
1591 | H[q]=R[O+q]
|
---|
1592 | }else{
|
---|
1593 | H[q]=f(H[q-3]^H[q-8]^H[q-14]^H[q-16],1)
|
---|
1594 | }
|
---|
1595 | var I=g(g(f(M,5),b(q,F,S,D)),g(g(C,H[q]),d(q)));
|
---|
1596 | C=D;
|
---|
1597 | D=S;
|
---|
1598 | S=f(F,30);
|
---|
1599 | F=M;
|
---|
1600 | M=I
|
---|
1601 | }
|
---|
1602 | M=g(M,W);
|
---|
1603 | F=g(F,A);
|
---|
1604 | S=g(S,T);
|
---|
1605 | D=g(D,z);
|
---|
1606 | C=g(C,k)
|
---|
1607 | }
|
---|
1608 | return Array(M,F,S,D,C)
|
---|
1609 | }
|
---|
1610 | function b(x,k,j,q){
|
---|
1611 | if(x<20){
|
---|
1612 | return(k&j)|((~k)&q)
|
---|
1613 | }
|
---|
1614 | if(x<40){
|
---|
1615 | return k^j^q
|
---|
1616 | }
|
---|
1617 | if(x<60){
|
---|
1618 | return(k&j)|(k&q)|(j&q)
|
---|
1619 | }
|
---|
1620 | return k^j^q
|
---|
1621 | }
|
---|
1622 | function d(k){
|
---|
1623 | return(k<20)?1518500249:(k<40)?1859775393:(k<60)?-1894007588:-899497514
|
---|
1624 | }
|
---|
1625 | function n(q,T){
|
---|
1626 | var z=w(q);
|
---|
1627 | if(z.length>16){
|
---|
1628 | z=o(z,q.length*a)
|
---|
1629 | }
|
---|
1630 | var k=Array(16),j=Array(16);
|
---|
1631 | for(var x=0;
|
---|
1632 | x<16;
|
---|
1633 | x++){
|
---|
1634 | k[x]=z[x]^909522486;
|
---|
1635 | j[x]=z[x]^1549556828
|
---|
1636 | }
|
---|
1637 | var O=o(k.concat(w(T)),512+T.length*a);
|
---|
1638 | return o(j.concat(O),512+160)
|
---|
1639 | }
|
---|
1640 | function g(k,z){
|
---|
1641 | var j=(k&65535)+(z&65535);
|
---|
1642 | var q=(k>>16)+(z>>16)+(j>>16);
|
---|
1643 | return(q<<16)|(j&65535)
|
---|
1644 | }
|
---|
1645 | function f(k,x){
|
---|
1646 | return(k<<x)|(k>>>(32-x))
|
---|
1647 | }
|
---|
1648 | function w(j){
|
---|
1649 | var q=Array();
|
---|
1650 | var k=(1<<a)-1;
|
---|
1651 | for(var x=0;
|
---|
1652 | x<j.length*a;
|
---|
1653 | x+=a){
|
---|
1654 | q[x>>5]|=(j.charCodeAt(x/a)&k)<<(32-a-x%32)
|
---|
1655 | }
|
---|
1656 | return q
|
---|
1657 | }
|
---|
1658 | function y(q){
|
---|
1659 | var j="";
|
---|
1660 | var k=(1<<a)-1;
|
---|
1661 | for(var x=0;
|
---|
1662 | x<q.length*32;
|
---|
1663 | x+=a){
|
---|
1664 | j+=String.fromCharCode((q[x>>5]>>>(32-a-x%32))&k)
|
---|
1665 | }
|
---|
1666 | return j
|
---|
1667 | }
|
---|
1668 | function l(q){
|
---|
1669 | var x=p?"0123456789ABCDEF":"0123456789abcdef";
|
---|
1670 | var j="";
|
---|
1671 | for(var k=0;
|
---|
1672 | k<q.length*4;
|
---|
1673 | k++){
|
---|
1674 | j+=x.charAt((q[k>>2]>>((3-k%4)*8+4))&15)+x.charAt((q[k>>2]>>((3-k%4)*8))&15)
|
---|
1675 | }
|
---|
1676 | return j
|
---|
1677 | }
|
---|
1678 | function m(z){
|
---|
1679 | var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
---|
1680 | var O="";
|
---|
1681 | for(var x=0;
|
---|
1682 | x<z.length*4;
|
---|
1683 | x+=3){
|
---|
1684 | var T=(((z[x>>2]>>8*(3-x%4))&255)<<16)|(((z[x+1>>2]>>8*(3-(x+1)%4))&255)<<8)|((z[x+2>>2]>>8*(3-(x+2)%4))&255);
|
---|
1685 | for(var k=0;
|
---|
1686 | k<4;
|
---|
1687 | k++){
|
---|
1688 | if(x*8+k*6>z.length*32){
|
---|
1689 | O+=v
|
---|
1690 | }else{
|
---|
1691 | O+=q.charAt((T>>6*(3-k))&63)
|
---|
1692 | }}}
|
---|
1693 | return O
|
---|
1694 | }
|
---|
1695 | this.hex_sha1=c;
|
---|
1696 | this.b64_sha1=h;
|
---|
1697 | this.str_sha1=i;
|
---|
1698 | this.hex_hmac_sha1=t;
|
---|
1699 | this.b64_hmac_sha1=s;
|
---|
1700 | this.str_hmac_sha1=u;
|
---|
1701 | this.sha1_vm_test=e
|
---|
1702 | };
|
---|
1703 | AjxSHA1=new AjxSHA1()
|
---|
1704 | }
|
---|
1705 | if(AjxPackage.define("ajax.dwt.core.DwtDraggable")){
|
---|
1706 | DwtDraggable=function(){};
|
---|
1707 | DwtDraggable.dragEl=null;
|
---|
1708 | DwtDraggable.init=function(i,m,n,t,o,e,h,d,u,l,s,c,a){
|
---|
1709 | i.onmousedown=DwtDraggable.__start;
|
---|
1710 | i.__hMode=l?false:true;
|
---|
1711 | i.__vMode=s?false:true;
|
---|
1712 | i.__root=(m&&m!=null)?m:i;
|
---|
1713 | if(i.__hMode&&isNaN(parseInt(i.__root.style.left))){
|
---|
1714 | i.__root.style.left="0px"
|
---|
1715 | }
|
---|
1716 | if(i.__vMode&&isNaN(parseInt(i.__root.style.top))){
|
---|
1717 | i.__root.style.top="0px"
|
---|
1718 | }
|
---|
1719 | if(!i.__hMode&&isNaN(parseInt(i.__root.style.right))){
|
---|
1720 | i.__root.style.right="0px"
|
---|
1721 | }
|
---|
1722 | if(!i.__vMode&&isNaN(parseInt(i.__root.style.bottom))){
|
---|
1723 | i.__root.style.bottom="0px"
|
---|
1724 | }
|
---|
1725 | i.__minX=(typeof n!="undefined")?n:null;
|
---|
1726 | i.__minY=(typeof o!="undefined")?o:null;
|
---|
1727 | i.__maxX=(typeof t!="undefined")?t:null;
|
---|
1728 | i.__maxY=(typeof e!="undefined")?e:null;
|
---|
1729 | i.__xMapper=c?c:null;
|
---|
1730 | i.__yMapper=a?a:null;
|
---|
1731 | i.__root.onDragStart=h;
|
---|
1732 | i.__root.onDragEnd=u;
|
---|
1733 | i.__root.onDrag=d
|
---|
1734 | };
|
---|
1735 | DwtDraggable.setDragBoundaries=function(t,e,i,o,a){
|
---|
1736 | if(t!=null){
|
---|
1737 | if(e!=null){
|
---|
1738 | t.__minX=e
|
---|
1739 | }
|
---|
1740 | if(i!=null){
|
---|
1741 | t.__maxX=i
|
---|
1742 | }
|
---|
1743 | if(o!=null){
|
---|
1744 | t.__minY=o
|
---|
1745 | }
|
---|
1746 | if(a!=null){
|
---|
1747 | t.__maxY=a
|
---|
1748 | }}};
|
---|
1749 | DwtDraggable.__start=function(i){
|
---|
1750 | var a=DwtDraggable.dragEl=this;
|
---|
1751 | i=DwtDraggable.__fixE(i);
|
---|
1752 | var t=parseInt(a.__hMode?a.__root.style.left:a.__root.style.right);
|
---|
1753 | var o=parseInt(a.__vMode?a.__root.style.top:a.__root.style.bottom);
|
---|
1754 | if(a.__root.onDragStart){
|
---|
1755 | a.__root.onDragStart.run([t,o])
|
---|
1756 | }
|
---|
1757 | a.__lastMouseX=i.clientX;
|
---|
1758 | a.__lastMouseY=i.clientY;
|
---|
1759 | if(a.__hMode){
|
---|
1760 | if(a.__minX!=null){
|
---|
1761 | a.__minMouseX=i.clientX-t+a.__minX
|
---|
1762 | }
|
---|
1763 | if(a.__maxX!=null){
|
---|
1764 | a.__maxMouseX=a.__minMouseX+a.__maxX-a.__minX
|
---|
1765 | }}else{
|
---|
1766 | if(a.__minX!=null){
|
---|
1767 | a.__maxMouseX=-a.__minX+i.clientX+t
|
---|
1768 | }
|
---|
1769 | if(a.__maxX!=null){
|
---|
1770 | a.__minMouseX=-a.__maxX+i.clientX+t
|
---|
1771 | }}
|
---|
1772 | if(a.__vMode){
|
---|
1773 | if(a.__minY!=null){
|
---|
1774 | a.__minMouseY=i.clientY-o+a.__minY
|
---|
1775 | }
|
---|
1776 | if(a.__maxY!=null){
|
---|
1777 | a.__maxMouseY=a.__minMouseY+a.__maxY-a.__minY
|
---|
1778 | }}else{
|
---|
1779 | if(a.__minY!=null){
|
---|
1780 | a.__maxMouseY=-a.__minY+i.clientY+o
|
---|
1781 | }
|
---|
1782 | if(a.__maxY!=null){
|
---|
1783 | a.__minMouseY=-a.__maxY+i.clientY+o
|
---|
1784 | }}
|
---|
1785 | document.onmousemove=DwtDraggable.__drag;
|
---|
1786 | document.onmouseup=DwtDraggable.__end;
|
---|
1787 | return false
|
---|
1788 | };
|
---|
1789 | DwtDraggable.__drag=function(s){
|
---|
1790 | s=DwtDraggable.__fixE(s);
|
---|
1791 | var i=DwtDraggable.dragEl;
|
---|
1792 | var o=s.clientY;
|
---|
1793 | var n=s.clientX;
|
---|
1794 | var a=parseInt(i.__hMode?i.__root.style.left:i.__root.style.right);
|
---|
1795 | var l=parseInt(i.__vMode?i.__root.style.top:i.__root.style.bottom);
|
---|
1796 | var t,h;
|
---|
1797 | if(!i.__xMapper){
|
---|
1798 | if(i.__minX!=null){
|
---|
1799 | n=i.__hMode?Math.max(n,i.__minMouseX):Math.min(n,i.__maxMouseX)
|
---|
1800 | }
|
---|
1801 | if(i.__maxX!=null){
|
---|
1802 | n=i.__hMode?Math.min(n,i.__maxMouseX):Math.max(n,i.__minMouseX)
|
---|
1803 | }
|
---|
1804 | t=a+((n-i.__lastMouseX)*(i.__hMode?1:-1))
|
---|
1805 | }else{
|
---|
1806 | t=i.__xMapper(a,n)
|
---|
1807 | }
|
---|
1808 | if(!i.__yMapper){
|
---|
1809 | if(i.__minY!=null){
|
---|
1810 | o=i.__vMode?Math.max(o,i.__minMouseY):Math.min(o,i.__maxMouseY)
|
---|
1811 | }
|
---|
1812 | if(i.__maxY!=null){
|
---|
1813 | o=i.__vMode?Math.min(o,i.__maxMouseY):Math.max(o,i.__minMouseY)
|
---|
1814 | }
|
---|
1815 | h=l+((o-i.__lastMouseY)*(i.__vMode?1:-1))
|
---|
1816 | }else{
|
---|
1817 | h=i.__yMapper(l,o)
|
---|
1818 | }
|
---|
1819 | DwtDraggable.dragEl.__root.style[i.__hMode?"left":"right"]=t+"px";
|
---|
1820 | DwtDraggable.dragEl.__root.style[i.__vMode?"top":"bottom"]=h+"px";
|
---|
1821 | DwtDraggable.dragEl.__lastMouseX=n;
|
---|
1822 | DwtDraggable.dragEl.__lastMouseY=o;
|
---|
1823 | if(DwtDraggable.dragEl.__root.onDrag){
|
---|
1824 | DwtDraggable.dragEl.__root.onDrag.run([t,h])
|
---|
1825 | }
|
---|
1826 | return false
|
---|
1827 | };
|
---|
1828 | DwtDraggable.__end=function(){
|
---|
1829 | document.onmousemove=null;
|
---|
1830 | document.onmouseup=null;
|
---|
1831 | if(DwtDraggable.dragEl.__root.onDragEnd){
|
---|
1832 | DwtDraggable.dragEl.__root.onDragEnd.run([parseInt(DwtDraggable.dragEl.__root.style[DwtDraggable.dragEl.__hMode?"left":"right"]),parseInt(DwtDraggable.dragEl.__root.style[DwtDraggable.dragEl.__vMode?"top":"bottom"])])
|
---|
1833 | }
|
---|
1834 | DwtDraggable.dragEl=null
|
---|
1835 | };
|
---|
1836 | DwtDraggable.__fixE=function(t){
|
---|
1837 | if(typeof t=="undefined"){
|
---|
1838 | t=window.event
|
---|
1839 | }
|
---|
1840 | if(typeof t.layerX=="undefined"){
|
---|
1841 | t.layerX=t.offsetX
|
---|
1842 | }
|
---|
1843 | if(typeof t.layerY=="undefined"){
|
---|
1844 | t.layerY=t.offsetY
|
---|
1845 | }
|
---|
1846 | return t
|
---|
1847 | }
|
---|
1848 | }
|
---|
1849 | if(AjxPackage.define("ajax.dwt.core.DwtDragTracker")){
|
---|
1850 | DwtDragTracker=function(){};
|
---|
1851 | DwtDragTracker.init=function(o,t,s,n,l,e,a){
|
---|
1852 | var h=o._dragTrackerContext={};
|
---|
1853 | var i=o.getHtmlElement();
|
---|
1854 | if(t){
|
---|
1855 | i.style.cursor=t
|
---|
1856 | }
|
---|
1857 | h.style=t;
|
---|
1858 | h.threshX=(s>0)?s:1;
|
---|
1859 | h.threshY=(n>0)?n:1;
|
---|
1860 | h.data={
|
---|
1861 | delta:{}
|
---|
1862 | ,userData:a};
|
---|
1863 | h.captureObj=new DwtMouseEventCapture({
|
---|
1864 | targetObj:o,mouseOverHdlr:DwtDragTracker._mouseOverHdlr,mouseDownHdlr:DwtDragTracker._mouseDownHdlr,mouseMoveHdlr:DwtDragTracker._mouseMoveHdlr,mouseUpHdlr:DwtDragTracker._mouseUpHdlr,mouseOutHdlr:DwtDragTracker._mouseOutHdlr}
|
---|
1865 | );
|
---|
1866 | o.setHandler(DwtEvent.ONMOUSEDOWN,DwtDragTracker._mouseDownHdlr);
|
---|
1867 | o.setHandler(DwtEvent.ONMOUSEOVER,DwtDragTracker._mouseOverHdlr);
|
---|
1868 | o.setHandler(DwtEvent.ONMOUSEOUT,DwtDragTracker._mouseOutHdlr);
|
---|
1869 | h.callbackFunc=l;
|
---|
1870 | h.callbackObj=e
|
---|
1871 | };
|
---|
1872 | DwtDragTracker.STYLE_NONE="auto";
|
---|
1873 | DwtDragTracker.STYLE_MOVE="move";
|
---|
1874 | DwtDragTracker.STYLE_RESIZE_NORTHWEST="nw-resize";
|
---|
1875 | DwtDragTracker.STYLE_RESIZE_NORTH="n-resize";
|
---|
1876 | DwtDragTracker.STYLE_RESIZE_NORTHEAST="ne-resize";
|
---|
1877 | DwtDragTracker.STYLE_RESIZE_WEST="w-resize";
|
---|
1878 | DwtDragTracker.STYLE_RESIZE_EAST="e-resize";
|
---|
1879 | DwtDragTracker.STYLE_RESIZE_SOUTHWEST="sw-resize";
|
---|
1880 | DwtDragTracker.STYLE_RESIZE_SOUTH="s-resize";
|
---|
1881 | DwtDragTracker.STYLE_RESIZE_SOUTHEAST="se-resize";
|
---|
1882 | DwtDragTracker.STATE_START=1;
|
---|
1883 | DwtDragTracker.STATE_DRAGGING=2;
|
---|
1884 | DwtDragTracker.STATE_END=3;
|
---|
1885 | DwtDragTracker._mouseOverHdlr=function(t){
|
---|
1886 | var e=DwtShell.mouseEvent;
|
---|
1887 | e.setFromDhtmlEvent(t);
|
---|
1888 | e._stopPropagation=true;
|
---|
1889 | e._returnValue=false;
|
---|
1890 | e.setToDhtmlEvent(t);
|
---|
1891 | return false
|
---|
1892 | };
|
---|
1893 | DwtDragTracker._mouseDownHdlr=function(a){
|
---|
1894 | var t=DwtShell.mouseEvent;
|
---|
1895 | t.setFromDhtmlEvent(a,true);
|
---|
1896 | if(t.button!=DwtMouseEvent.LEFT){
|
---|
1897 | DwtUiEvent.setBehaviour(a,true,false);
|
---|
1898 | return false
|
---|
1899 | }
|
---|
1900 | var i=t.dwtObj;
|
---|
1901 | if(i&&i._dragTrackerContext){
|
---|
1902 | var e=i._dragTrackerContext;
|
---|
1903 | if(e.callbackFunc!=null){
|
---|
1904 | e.oldCapture=DwtMouseEventCapture.getCaptureObj();
|
---|
1905 | if(e.oldCapture){
|
---|
1906 | e.oldCapture.release()
|
---|
1907 | }
|
---|
1908 | e.captureObj.capture();
|
---|
1909 | e.data.startDoc={
|
---|
1910 | x:t.docX,y:t.docY};
|
---|
1911 | e.data.state=DwtDragTracker.STATE_START;
|
---|
1912 | DwtDragTracker._doCallback(e,t)
|
---|
1913 | }}
|
---|
1914 | t._stopPropagation=true;
|
---|
1915 | t._returnValue=false;
|
---|
1916 | t.setToDhtmlEvent(a);
|
---|
1917 | return false
|
---|
1918 | };
|
---|
1919 | DwtDragTracker._doCallback=function(e,t){
|
---|
1920 | e.data.mouseEv=t;
|
---|
1921 | if(e.callbackObj!=null){
|
---|
1922 | e.callbackFunc.call(e.callbackObj,e.data)
|
---|
1923 | }else{
|
---|
1924 | e.callbackFunc(e.data)
|
---|
1925 | }
|
---|
1926 | e.data.mouseEv=null
|
---|
1927 | };
|
---|
1928 | DwtDragTracker._mouseMoveHdlr=function(a){
|
---|
1929 | var t=DwtShell.mouseEvent;
|
---|
1930 | t.setFromDhtmlEvent(a);
|
---|
1931 | var o=DwtMouseEventCapture.getTargetObj();
|
---|
1932 | var e=o._dragTrackerContext;
|
---|
1933 | var i=e.data;
|
---|
1934 | i.delta.x=t.docX-i.startDoc.x;
|
---|
1935 | i.delta.y=t.docY-i.startDoc.y;
|
---|
1936 | if(Math.abs(i.delta.x)>=e.threshX||Math.abs(i.delta.y)>=e.threshY){
|
---|
1937 | i.prevState=i.state;
|
---|
1938 | i.state=DwtDragTracker.STATE_DRAGGING;
|
---|
1939 | DwtDragTracker._doCallback(e,t)
|
---|
1940 | }
|
---|
1941 | t._stopPropagation=true;
|
---|
1942 | t._returnValue=false;
|
---|
1943 | t.setToDhtmlEvent(a);
|
---|
1944 | return false
|
---|
1945 | };
|
---|
1946 | DwtDragTracker._mouseUpHdlr=function(a){
|
---|
1947 | var t=DwtShell.mouseEvent;
|
---|
1948 | t.setFromDhtmlEvent(a);
|
---|
1949 | if(t.button!=DwtMouseEvent.LEFT){
|
---|
1950 | DwtUiEvent.setBehaviour(a,true,false);
|
---|
1951 | return false
|
---|
1952 | }
|
---|
1953 | var e=DwtMouseEventCapture.getTargetObj()._dragTrackerContext;
|
---|
1954 | if(e){
|
---|
1955 | if(e.callbackFunc!=null){
|
---|
1956 | DwtMouseEventCapture.getCaptureObj().release()
|
---|
1957 | }
|
---|
1958 | if(e.oldCapture){
|
---|
1959 | e.oldCapture.capture();
|
---|
1960 | e.oldCapture=null
|
---|
1961 | }
|
---|
1962 | e.data.state=DwtDragTracker.STATE_END;
|
---|
1963 | DwtDragTracker._doCallback(e,t)
|
---|
1964 | }
|
---|
1965 | t._stopPropagation=true;
|
---|
1966 | t._returnValue=false;
|
---|
1967 | t.setToDhtmlEvent(a);
|
---|
1968 | return false
|
---|
1969 | };
|
---|
1970 | DwtDragTracker._mouseOutHdlr=function(t){
|
---|
1971 | var e=DwtShell.mouseEvent;
|
---|
1972 | e.setFromDhtmlEvent(t);
|
---|
1973 | e._stopPropagation=true;
|
---|
1974 | e._returnValue=false;
|
---|
1975 | e.setToDhtmlEvent(t);
|
---|
1976 | return false
|
---|
1977 | }
|
---|
1978 | }
|
---|
1979 | if(AjxPackage.define("ajax.dwt.events.DwtDateRangeEvent")){
|
---|
1980 | DwtDateRangeEvent=function(e){
|
---|
1981 | if(arguments.length==0){
|
---|
1982 | return
|
---|
1983 | }
|
---|
1984 | DwtEvent.call(this,true);
|
---|
1985 | this.reset()
|
---|
1986 | };
|
---|
1987 | DwtDateRangeEvent.prototype=new DwtEvent;
|
---|
1988 | DwtDateRangeEvent.prototype.constructor=DwtDateRangeEvent;
|
---|
1989 | DwtDateRangeEvent.prototype.toString=function(){
|
---|
1990 | return"DwtDateRangeEvent"
|
---|
1991 | };
|
---|
1992 | DwtDateRangeEvent.prototype.reset=function(){
|
---|
1993 | this.start=null;
|
---|
1994 | this.end=null
|
---|
1995 | }
|
---|
1996 | }
|
---|
1997 | if(AjxPackage.define("ajax.dwt.widgets.DwtColorPicker")){
|
---|
1998 | DwtColorPicker=function(a,t,e,i,o){
|
---|
1999 | if(arguments.length==0){
|
---|
2000 | return
|
---|
2001 | }
|
---|
2002 | t=t||"DwtColorPicker";
|
---|
2003 | DwtControl.call(this,{
|
---|
2004 | parent:a,className:t,posStyle:e}
|
---|
2005 | );
|
---|
2006 | this._noFillLabel=i;
|
---|
2007 | this._allowColorInput=o;
|
---|
2008 | this._createColorTable();
|
---|
2009 | this._registerEventHdlrs()
|
---|
2010 | };
|
---|
2011 | DwtColorPicker.prototype=new DwtControl;
|
---|
2012 | DwtColorPicker.prototype.constructor=DwtColorPicker;
|
---|
2013 | DwtColorPicker._RGB_RE=/rgb\(([0-9]{1,3}), ([0-9]{1,3}), ([0-9]{1,3})\)/;
|
---|
2014 | DwtColorPicker._HEX_RE=/\#([0-9FCfc]{2})([0-9FCfc]{2})([0-9FCfc]{2})/;
|
---|
2015 | DwtColorPicker._HEX_COMPLETE_RE=/\#([0-9ABCDEFabcdef]{2})([0-9ABCDEFabcdef]{2})([0-9ABCDEFabcdef]{2})/;
|
---|
2016 | DwtColorPicker.prototype.toString=function(){
|
---|
2017 | return"DwtColorPicker"
|
---|
2018 | };
|
---|
2019 | DwtColorPicker.prototype.addSelectionListener=function(e){
|
---|
2020 | this.addListener(DwtEvent.SELECTION,e)
|
---|
2021 | };
|
---|
2022 | DwtColorPicker.prototype.removeSelectionListener=function(e){
|
---|
2023 | this.removeListener(DwtEvent.SELECTION,e)
|
---|
2024 | };
|
---|
2025 | DwtColorPicker.prototype.dispose=function(){
|
---|
2026 | if(this._disposed){
|
---|
2027 | return
|
---|
2028 | }
|
---|
2029 | DwtControl.prototype.dispose.call(this)
|
---|
2030 | };
|
---|
2031 | DwtColorPicker.prototype._registerEventHdlrs=function(){
|
---|
2032 | var s=this.getHtmlElement().firstChild;
|
---|
2033 | var h=s.rows;
|
---|
2034 | var l=h.length;
|
---|
2035 | for(var o=0;
|
---|
2036 | o<l;
|
---|
2037 | o++){
|
---|
2038 | var a=h[o].cells;
|
---|
2039 | var n=a.length;
|
---|
2040 | for(var t=0;
|
---|
2041 | t<n;
|
---|
2042 | t++){
|
---|
2043 | var e=a[t];
|
---|
2044 | if(h[o].className=="ColorInput"){
|
---|
2045 | if(e.className=="ColorInputField"){}else{
|
---|
2046 | if(e.className=="SetInputColor"){
|
---|
2047 | Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
|
---|
2048 | Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr)
|
---|
2049 | }}}else{
|
---|
2050 | Dwt.setHandler(e,DwtEvent.ONMOUSEDOWN,DwtColorPicker._mouseDownHdlr);
|
---|
2051 | Dwt.setHandler(e,DwtEvent.ONMOUSEUP,DwtColorPicker._mouseUpHdlr);
|
---|
2052 | if(!AjxEnv.isIE){
|
---|
2053 | Dwt.setHandler(e,DwtEvent.ONMOUSEOVER,DwtColorPicker._mouseOverHdlr);
|
---|
2054 | Dwt.setHandler(e,DwtEvent.ONMOUSEOUT,DwtColorPicker._mouseOutHdlr)
|
---|
2055 | }else{
|
---|
2056 | Dwt.setHandler(e,DwtEvent.ONMOUSEENTER,DwtColorPicker._mouseOverHdlr);
|
---|
2057 | Dwt.setHandler(e,DwtEvent.ONMOUSELEAVE,DwtColorPicker._mouseOutHdlr)
|
---|
2058 | }
|
---|
2059 | if(e.className!="NoFill"){
|
---|
2060 | e.style.border="2px outset "+e.style.backgroundColor
|
---|
2061 | }}}}};
|
---|
2062 | DwtColorPicker.prototype._createColorTable=function(){
|
---|
2063 | this._tdId=Dwt.getNextId();
|
---|
2064 | var t=new Array(150);
|
---|
2065 | var e=0;
|
---|
2066 | t[e++]="<table cellpadding='0' cellspacing='0' border='0' align='center'>";
|
---|
2067 | if(this._noFillLabel){
|
---|
2068 | t[e++]="<tr><td colspan='10' class='NoFill'>"+this._noFillLabel+"</td></tr>"
|
---|
2069 | }
|
---|
2070 | t[e++]="<tr>";
|
---|
2071 | t[e++]="<td id='"+this._tdId+"#FFFFFF' style='background-color:#FFFFFF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2072 | t[e++]="<td id='"+this._tdId+"#FFCCCC' style='background-color:#FFCCCC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2073 | t[e++]="<td id='"+this._tdId+"#FFCC99' style='background-color:#FFCC99' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2074 | t[e++]="<td id='"+this._tdId+"#FFFF99' style='background-color:#FFFF99' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2075 | t[e++]="<td id='"+this._tdId+"#FFFFCC' style='background-color:#FFFFCC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2076 | t[e++]="<td id='"+this._tdId+"#99FF99' style='background-color:#99FF99' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2077 | t[e++]="<td id='"+this._tdId+"#99FFFF' style='background-color:#99FFFF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2078 | t[e++]="<td id='"+this._tdId+"#CCFFFF' style='background-color:#CCFFFF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2079 | t[e++]="<td id='"+this._tdId+"#CCCCFF' style='background-color:#CCCCFF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2080 | t[e++]="<td id='"+this._tdId+"#FFCCFF' style='background-color:#FFCCFF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2081 | t[e++]="</tr><tr>";
|
---|
2082 | t[e++]="<td id='"+this._tdId+"#CCCCCC' style='background-color:#CCCCCC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2083 | t[e++]="<td id='"+this._tdId+"#FF6666' style='background-color:#FF6666' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2084 | t[e++]="<td id='"+this._tdId+"#FF9966' style='background-color:#FF9966' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2085 | t[e++]="<td id='"+this._tdId+"#FFFF66' style='background-color:#FFFF66' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2086 | t[e++]="<td id='"+this._tdId+"#FFFF33' style='background-color:#FFFF33' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2087 | t[e++]="<td id='"+this._tdId+"#66FF99' style='background-color:#66FF99' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2088 | t[e++]="<td id='"+this._tdId+"#33FFFF' style='background-color:#33FFFF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2089 | t[e++]="<td id='"+this._tdId+"#66FFFF' style='background-color:#66FFFF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2090 | t[e++]="<td id='"+this._tdId+"#9999FF' style='background-color:#9999FF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2091 | t[e++]="<td id='"+this._tdId+"#FF99FF' style='background-color:#FF99FF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2092 | t[e++]="</tr><tr>";
|
---|
2093 | t[e++]="<td id='"+this._tdId+"#C0C0C0' style='background-color:#C0C0C0' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2094 | t[e++]="<td id='"+this._tdId+"#FF0000' style='background-color:#FF0000' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2095 | t[e++]="<td id='"+this._tdId+"#FF9900' style='background-color:#FF9900' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2096 | t[e++]="<td id='"+this._tdId+"#FFCC66' style='background-color:#FFCC66' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2097 | t[e++]="<td id='"+this._tdId+"#FFFF00' style='background-color:#FFFF00' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2098 | t[e++]="<td id='"+this._tdId+"#33FF33' style='background-color:#33FF33' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2099 | t[e++]="<td id='"+this._tdId+"#66CCCC' style='background-color:#66CCCC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2100 | t[e++]="<td id='"+this._tdId+"#33CCFF' style='background-color:#33CCFF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2101 | t[e++]="<td id='"+this._tdId+"#6666CC' style='background-color:#6666CC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2102 | t[e++]="<td id='"+this._tdId+"#CC66CC' style='background-color:#CC66CC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2103 | t[e++]="</tr><tr>";
|
---|
2104 | t[e++]="<td id='"+this._tdId+"#999999' style='background-color:#999999' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2105 | t[e++]="<td id='"+this._tdId+"#CC0000' style='background-color:#CC0000' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2106 | t[e++]="<td id='"+this._tdId+"#FF6600' style='background-color:#FF6600' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2107 | t[e++]="<td id='"+this._tdId+"#FFCC33' style='background-color:#FFCC33' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2108 | t[e++]="<td id='"+this._tdId+"#FFCC00' style='background-color:#FFCC00' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2109 | t[e++]="<td id='"+this._tdId+"#33CC00' style='background-color:#33CC00' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2110 | t[e++]="<td id='"+this._tdId+"#00CCCC' style='background-color:#00CCCC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2111 | t[e++]="<td id='"+this._tdId+"#3366FF' style='background-color:#3366FF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2112 | t[e++]="<td id='"+this._tdId+"#6633FF' style='background-color:#6633FF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2113 | t[e++]="<td id='"+this._tdId+"#CC33CC' style='background-color:#CC33CC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2114 | t[e++]="</tr><tr>";
|
---|
2115 | t[e++]="<td id='"+this._tdId+"#666666' style='background-color:#666666' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2116 | t[e++]="<td id='"+this._tdId+"#990000' style='background-color:#990000' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2117 | t[e++]="<td id='"+this._tdId+"#CC6600' style='background-color:#CC6600' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2118 | t[e++]="<td id='"+this._tdId+"#CC9933' style='background-color:#CC9933' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2119 | t[e++]="<td id='"+this._tdId+"#999900' style='background-color:#999900' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2120 | t[e++]="<td id='"+this._tdId+"#009900' style='background-color:#009900' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2121 | t[e++]="<td id='"+this._tdId+"#339999' style='background-color:#339999' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2122 | t[e++]="<td id='"+this._tdId+"#3333FF' style='background-color:#3333FF' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2123 | t[e++]="<td id='"+this._tdId+"#6600CC' style='background-color:#6600CC' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2124 | t[e++]="<td id='"+this._tdId+"#993399' style='background-color:#993399' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2125 | t[e++]="</tr><tr>";
|
---|
2126 | t[e++]="<td id='"+this._tdId+"#333333' style='background-color:#333333' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2127 | t[e++]="<td id='"+this._tdId+"#660000' style='background-color:#660000' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2128 | t[e++]="<td id='"+this._tdId+"#993300' style='background-color:#993300' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2129 | t[e++]="<td id='"+this._tdId+"#996633' style='background-color:#996633' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2130 | t[e++]="<td id='"+this._tdId+"#666600' style='background-color:#666600' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2131 | t[e++]="<td id='"+this._tdId+"#006600' style='background-color:#006600' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2132 | t[e++]="<td id='"+this._tdId+"#336666' style='background-color:#336666' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2133 | t[e++]="<td id='"+this._tdId+"#000099' style='background-color:#000099' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2134 | t[e++]="<td id='"+this._tdId+"#333399' style='background-color:#333399' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2135 | t[e++]="<td id='"+this._tdId+"#663366' style='background-color:#663366' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2136 | t[e++]="</tr><tr>";
|
---|
2137 | t[e++]="<td id='"+this._tdId+"#000000' style='background-color:#000000' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2138 | t[e++]="<td id='"+this._tdId+"#330000' style='background-color:#330000' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2139 | t[e++]="<td id='"+this._tdId+"#663300' style='background-color:#663300' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2140 | t[e++]="<td id='"+this._tdId+"#663333' style='background-color:#663333' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2141 | t[e++]="<td id='"+this._tdId+"#333300' style='background-color:#333300' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2142 | t[e++]="<td id='"+this._tdId+"#003300' style='background-color:#003300' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2143 | t[e++]="<td id='"+this._tdId+"#003333' style='background-color:#003333' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2144 | t[e++]="<td id='"+this._tdId+"#000066' style='background-color:#000066' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2145 | t[e++]="<td id='"+this._tdId+"#330099' style='background-color:#330099' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2146 | t[e++]="<td id='"+this._tdId+"#330033' style='background-color:#330033' width='12' height='14'><img height='1' width='1'/></td>";
|
---|
2147 | if(this._allowColorInput){
|
---|
2148 | t[e++]="<tr><td></td></tr></tr><tr class='ColorInput'>";
|
---|
2149 | t[e++]="<td colspan=6 id='"+this._tdId+".ColorInputField' class='ColorInputField'><input type=text size=15 maxlength=6 ></input></td><td colspan=4 id='"+this._tdId+".SetInputColor' class='SetInputColor'>"+AjxMsg.setColor+"</td>"
|
---|
2150 | }
|
---|
2151 | t[e++]="</tr></table>";
|
---|
2152 | this.getHtmlElement().innerHTML=t.join("")
|
---|
2153 | };
|
---|
2154 | DwtColorPicker._mouseOverHdlr=function(a){
|
---|
2155 | var t=DwtShell.mouseEvent;
|
---|
2156 | t.setFromDhtmlEvent(a,true);
|
---|
2157 | var i=t.target;
|
---|
2158 | if(i.nodeName.toLowerCase()=="img"){
|
---|
2159 | i=i.parentNode
|
---|
2160 | }
|
---|
2161 | if(t.dwtObj._downTdId==i.id){
|
---|
2162 | var e=i.style.backgroundColor;
|
---|
2163 | i.style.backgroundColor=t.dwtObj._swappedColor;
|
---|
2164 | t.dwtObj._swappedColor=e;
|
---|
2165 | i.style.borderStyle="inset";
|
---|
2166 | i.style.borderColor=e
|
---|
2167 | }
|
---|
2168 | this._stopPropagation=true;
|
---|
2169 | this._returnValue=false;
|
---|
2170 | t.setToDhtmlEvent(a);
|
---|
2171 | return false
|
---|
2172 | };
|
---|
2173 | DwtColorPicker._mouseOutHdlr=function(a){
|
---|
2174 | var t=DwtShell.mouseEvent;
|
---|
2175 | t.setFromDhtmlEvent(a,true);
|
---|
2176 | var i=t.target;
|
---|
2177 | if(i.nodeName.toLowerCase()=="img"){
|
---|
2178 | i=i.parentNode
|
---|
2179 | }
|
---|
2180 | if(t.dwtObj._downTdId==i.id){
|
---|
2181 | var e=i.style.backgroundColor;
|
---|
2182 | i.style.backgroundColor=t.dwtObj._swappedColor;
|
---|
2183 | t.dwtObj._swappedColor=e;
|
---|
2184 | i.style.borderStyle="outset";
|
---|
2185 | i.style.borderColor=e;
|
---|
2186 | t.dwtObj._downTdId=null
|
---|
2187 | }
|
---|
2188 | this._stopPropagation=true;
|
---|
2189 | this._returnValue=false;
|
---|
2190 | t.setToDhtmlEvent(a);
|
---|
2191 | return false
|
---|
2192 | };
|
---|
2193 | DwtColorPicker._mouseDownHdlr=function(s){
|
---|
2194 | var n=DwtShell.mouseEvent;
|
---|
2195 | n.setFromDhtmlEvent(s,true);
|
---|
2196 | var h=n.target;
|
---|
2197 | if(h.nodeName.toLowerCase()=="img"){
|
---|
2198 | h=h.parentNode
|
---|
2199 | }
|
---|
2200 | var a=n.target.style.backgroundColor;
|
---|
2201 | var t;
|
---|
2202 | var o,i,e;
|
---|
2203 | n.dwtObj._downTdId=h.id;
|
---|
2204 | n.dwtObj._swappedColor=a;
|
---|
2205 | h.style.borderStyle="inset";
|
---|
2206 | if((h.className!="NoFill")&&(h.className!="SetInputColor")){
|
---|
2207 | if(a.substr(0,1)=="#"){
|
---|
2208 | t=a.match(DwtColorPicker._HEX_RE);
|
---|
2209 | t[1]=DwtColorPicker._hexConv(t[1]);
|
---|
2210 | t[2]=DwtColorPicker._hexConv(t[2]);
|
---|
2211 | t[3]=DwtColorPicker._hexConv(t[3])
|
---|
2212 | }else{
|
---|
2213 | t=a.match(DwtColorPicker._RGB_RE)
|
---|
2214 | }
|
---|
2215 | o=Math.max(Math.floor(t[1]-(t[1]*0.25)),0);
|
---|
2216 | i=Math.max(Math.floor(t[2]-(t[2]*0.25)),0);
|
---|
2217 | e=Math.max(Math.floor(t[3]-(t[3]*0.25)),0);
|
---|
2218 | a="rgb("+o+","+i+","+e+")";
|
---|
2219 | h.style.backgroundColor=a
|
---|
2220 | }
|
---|
2221 | n._stopPropagation=true;
|
---|
2222 | n._returnValue=false;
|
---|
2223 | n.setToDhtmlEvent(s);
|
---|
2224 | return false
|
---|
2225 | };
|
---|
2226 | DwtColorPicker._hexConv=function(e){
|
---|
2227 | if(e=="00"){
|
---|
2228 | return 0
|
---|
2229 | }else{
|
---|
2230 | if(e=="33"){
|
---|
2231 | return 51
|
---|
2232 | }else{
|
---|
2233 | if(e=="66"){
|
---|
2234 | return 102
|
---|
2235 | }else{
|
---|
2236 | if(e=="99"){
|
---|
2237 | return 153
|
---|
2238 | }else{
|
---|
2239 | if(e.toUpperCase()=="CC"){
|
---|
2240 | return 204
|
---|
2241 | }else{
|
---|
2242 | if(e.toUpperCase()=="FF"){
|
---|
2243 | return 255
|
---|
2244 | }else{
|
---|
2245 | if(e.toUpperCase()=="C0"){
|
---|
2246 | return 192
|
---|
2247 | }}}}}}}};
|
---|
2248 | DwtColorPicker._mouseUpHdlr=function(a){
|
---|
2249 | var t=DwtShell.mouseEvent;
|
---|
2250 | t.setFromDhtmlEvent(a,true);
|
---|
2251 | var e=t.dwtObj;
|
---|
2252 | var o=t.target;
|
---|
2253 | if(o.nodeName.toLowerCase()=="img"){
|
---|
2254 | o=o.parentNode
|
---|
2255 | }
|
---|
2256 | if(e._downTdId==o.id){
|
---|
2257 | o.style.borderStyle="outset";
|
---|
2258 | o.style.borderColor=t.dwtObj._swappedColor;
|
---|
2259 | o.style.backgroundColor=t.dwtObj._swappedColor
|
---|
2260 | }
|
---|
2261 | if(e._downTdId==o.id){
|
---|
2262 | if(e.parent instanceof DwtMenu){
|
---|
2263 | DwtMenu.closeActiveMenu()
|
---|
2264 | }
|
---|
2265 | if(e.isListenerRegistered(DwtEvent.SELECTION)){
|
---|
2266 | var i=DwtShell.selectionEvent;
|
---|
2267 | DwtUiEvent.copy(i,t);
|
---|
2268 | i.item=e;
|
---|
2269 | if(o.id==(e._tdId+".SetInputColor")){
|
---|
2270 | i.detail=e.getInputColor()
|
---|
2271 | }else{
|
---|
2272 | i.detail=t.target.id.substr(t.target.id.indexOf("#"))
|
---|
2273 | }
|
---|
2274 | e.notifyListeners(DwtEvent.SELECTION,i)
|
---|
2275 | }}
|
---|
2276 | e._downTdId=null;
|
---|
2277 | t._stopPropagation=true;
|
---|
2278 | t._returnValue=false;
|
---|
2279 | t.setToDhtmlEvent(a);
|
---|
2280 | return false
|
---|
2281 | };
|
---|
2282 | DwtColorPicker.prototype.getInputColor=function(){
|
---|
2283 | var e=document.getElementById(this._tdId+".ColorInputField").firstChild;
|
---|
2284 | var t="#"+e.value;
|
---|
2285 | if(t.match(DwtColorPicker._HEX_COMPLETE_RE)!=null){
|
---|
2286 | return t
|
---|
2287 | }else{
|
---|
2288 | return""
|
---|
2289 | }}
|
---|
2290 | }
|
---|
2291 | if(AjxPackage.define("ajax.dwt.widgets.DwtCheckbox")){
|
---|
2292 | DwtCheckbox=function(e){
|
---|
2293 | if(arguments.length==0){
|
---|
2294 | return
|
---|
2295 | }
|
---|
2296 | e=Dwt.getParams(arguments,DwtCheckbox.PARAMS);
|
---|
2297 | e.className=e.className||"DwtCheckbox";
|
---|
2298 | DwtControl.call(this,e);
|
---|
2299 | this._textPosition=DwtCheckbox.DEFAULT_POSITION;
|
---|
2300 | this._initName=e.name;
|
---|
2301 | this._initValue=e.value;
|
---|
2302 | this._initChecked=e.checked;
|
---|
2303 | this._createHtml()
|
---|
2304 | };
|
---|
2305 | DwtCheckbox.prototype=new DwtControl;
|
---|
2306 | DwtCheckbox.prototype.constructor=DwtCheckbox;
|
---|
2307 | DwtCheckbox.prototype.toString=function(){
|
---|
2308 | return"DwtCheckbox"
|
---|
2309 | };
|
---|
2310 | DwtCheckbox.PARAMS=["parent","style","name","checked","className","posStyle","id","index","value"];
|
---|
2311 | DwtCheckbox.TEXT_LEFT="left";
|
---|
2312 | DwtCheckbox.TEXT_RIGHT="right";
|
---|
2313 | DwtCheckbox.DEFAULT_POSITION=DwtCheckbox.TEXT_RIGHT;
|
---|
2314 | DwtCheckbox.prototype.TEMPLATE="dwt.Widgets#DwtCheckbox";
|
---|
2315 | DwtCheckbox.prototype.getTabGroupMember=function(){
|
---|
2316 | return this._inputEl
|
---|
2317 | };
|
---|
2318 | DwtCheckbox.prototype.focus=function(){
|
---|
2319 | if(this._inputEl){
|
---|
2320 | this._inputEl.focus();
|
---|
2321 | DwtShell.getShell(window).getKeyboardMgr().grabFocus(this.getTabGroupMember())
|
---|
2322 | }};
|
---|
2323 | DwtCheckbox.prototype.blur=function(){
|
---|
2324 | if(this._inputEl){
|
---|
2325 | this._inputEl.blur()
|
---|
2326 | }};
|
---|
2327 | DwtCheckbox.prototype.addSelectionListener=function(e){
|
---|
2328 | this.addListener(DwtEvent.SELECTION,e)
|
---|
2329 | };
|
---|
2330 | DwtCheckbox.prototype.removeSelectionListener=function(e){
|
---|
2331 | this.removeListener(DwtEvent.SELECTION,e)
|
---|
2332 | };
|
---|
2333 | DwtCheckbox.prototype.setEnabled=function(e){
|
---|
2334 | if(e!=this._enabled){
|
---|
2335 | DwtControl.prototype.setEnabled.call(this,e);
|
---|
2336 | this._inputEl.disabled=!e;
|
---|
2337 | var t=e?"Text":"DisabledText";
|
---|
2338 | if(this._textElLeft){
|
---|
2339 | this._textElLeft.className=t
|
---|
2340 | }
|
---|
2341 | if(this._textElRight){
|
---|
2342 | this._textElRight.className=t
|
---|
2343 | }}};
|
---|
2344 | DwtCheckbox.prototype.setSelected=function(e){
|
---|
2345 | if(this._inputEl&&this._inputEl.checked!=e){
|
---|
2346 | this._inputEl.checked=e
|
---|
2347 | }};
|
---|
2348 | DwtCheckbox.prototype.isSelected=function(){
|
---|
2349 | return this._inputEl&&this._inputEl.checked
|
---|
2350 | };
|
---|
2351 | DwtCheckbox.prototype.setText=function(e){
|
---|
2352 | if(this._textEl&&this._text!=e){
|
---|
2353 | this._text=e;
|
---|
2354 | this._textEl.innerHTML=e||""
|
---|
2355 | }};
|
---|
2356 | DwtCheckbox.prototype.getText=function(){
|
---|
2357 | return this._text
|
---|
2358 | };
|
---|
2359 | DwtCheckbox.prototype.setTextPosition=function(e){
|
---|
2360 | this._textEl=e==DwtCheckbox.TEXT_LEFT?this._textElLeft:this._textElRight;
|
---|
2361 | if(this._textPosition!=e){
|
---|
2362 | this._textPosition=e;
|
---|
2363 | if(this._textElLeft){
|
---|
2364 | this._textElLeft.innerHTML=""
|
---|
2365 | }
|
---|
2366 | if(this._textElRight){
|
---|
2367 | this._textElRight.innerHTML=""
|
---|
2368 | }
|
---|
2369 | this.setText(this._text)
|
---|
2370 | }};
|
---|
2371 | DwtCheckbox.prototype.getTextPosition=function(){
|
---|
2372 | return this._textPosition
|
---|
2373 | };
|
---|
2374 | DwtCheckbox.prototype.setValue=function(t){
|
---|
2375 | var e=this._inputEl||this;
|
---|
2376 | if(e.value!==t){
|
---|
2377 | e.value=t
|
---|
2378 | }};
|
---|
2379 | DwtCheckbox.prototype.getValue=function(){
|
---|
2380 | var e=this._inputEl||this;
|
---|
2381 | return e.value!=null?e.value:this.getText()
|
---|
2382 | };
|
---|
2383 | DwtCheckbox.prototype.getInputElement=function(){
|
---|
2384 | return this._inputEl
|
---|
2385 | };
|
---|
2386 | DwtCheckbox.prototype._replaceElementHook=function(t,a,e,i){
|
---|
2387 | a=this.getInputElement();
|
---|
2388 | DwtControl.prototype._replaceElementHook.call(this,t,a,e,i);
|
---|
2389 | if(t.id){
|
---|
2390 | this.setHtmlElementId(t.id+"_control");
|
---|
2391 | a.id=t.id;
|
---|
2392 | if(this._textEl){
|
---|
2393 | this._textEl.setAttribute("for",t.id)
|
---|
2394 | }}};
|
---|
2395 | DwtCheckbox.prototype._createHtml=function(e){
|
---|
2396 | var t={
|
---|
2397 | id:this._htmlElId};
|
---|
2398 | this._createHtmlFromTemplate(e||this.TEMPLATE,t)
|
---|
2399 | };
|
---|
2400 | DwtCheckbox.prototype._createHtmlFromTemplate=function(t,a){
|
---|
2401 | a.name=this._initName||this._htmlElId;
|
---|
2402 | a.value=this._initValue;
|
---|
2403 | a.checked=Boolean(this._initChecked)?"checked":"";
|
---|
2404 | DwtControl.prototype._createHtmlFromTemplate.call(this,t,a);
|
---|
2405 | this._inputEl=document.getElementById(a.id+"_input");
|
---|
2406 | if(this._inputEl){
|
---|
2407 | var e=DwtShell.getShell(window).getKeyboardMgr();
|
---|
2408 | var i=AjxCallback.simpleClosure(e.grabFocus,e,this.getTabGroupMember());
|
---|
2409 | Dwt.setHandler(this._inputEl,DwtEvent.ONFOCUS,i);
|
---|
2410 | Dwt.setHandler(this._inputEl,DwtEvent.ONCLICK,DwtCheckbox.__handleClick)
|
---|
2411 | }
|
---|
2412 | this._textElLeft=document.getElementById(a.id+"_text_left");
|
---|
2413 | this._textElRight=document.getElementById(a.id+"_text_right");
|
---|
2414 | this.setTextPosition(this._textPosition)
|
---|
2415 | };
|
---|
2416 | DwtCheckbox.__handleClick=function(e){
|
---|
2417 | var t=DwtUiEvent.getEvent(e);
|
---|
2418 | var o=DwtUiEvent.getTarget(t);
|
---|
2419 | var i=DwtShell.selectionEvent;
|
---|
2420 | DwtUiEvent.copy(i,t);
|
---|
2421 | i.item=this;
|
---|
2422 | i.detail=o.checked;
|
---|
2423 | var a=DwtControl.findControl(o);
|
---|
2424 | a.setSelected(o.checked);
|
---|
2425 | a.notifyListeners(DwtEvent.SELECTION,i)
|
---|
2426 | }
|
---|
2427 | }
|
---|
2428 | if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButton")){
|
---|
2429 | DwtRadioButton=function(e){
|
---|
2430 | if(arguments.length==0){
|
---|
2431 | return
|
---|
2432 | }
|
---|
2433 | e=Dwt.getParams(arguments,DwtRadioButton.PARAMS);
|
---|
2434 | e.className=e.className||"DwtRadioButton";
|
---|
2435 | DwtCheckbox.call(this,e)
|
---|
2436 | };
|
---|
2437 | DwtRadioButton.PARAMS=DwtCheckbox.PARAMS;
|
---|
2438 | DwtRadioButton.prototype=new DwtCheckbox;
|
---|
2439 | DwtRadioButton.prototype.constructor=DwtRadioButton;
|
---|
2440 | DwtRadioButton.prototype.toString=function(){
|
---|
2441 | return"DwtRadioButton"
|
---|
2442 | };
|
---|
2443 | DwtRadioButton.prototype.TEMPLATE="dwt.Widgets#DwtRadioButton"
|
---|
2444 | }
|
---|
2445 | if(AjxPackage.define("ajax.dwt.widgets.DwtMessageDialog")){
|
---|
2446 | DwtMessageDialog=function(e){
|
---|
2447 | if(arguments.length==0){
|
---|
2448 | return
|
---|
2449 | }
|
---|
2450 | e=Dwt.getParams(arguments,DwtMessageDialog.PARAMS);
|
---|
2451 | this._msgCellId=Dwt.getNextId();
|
---|
2452 | e.standardButtons=e.buttons||[DwtDialog.OK_BUTTON];
|
---|
2453 | DwtDialog.call(this,e);
|
---|
2454 | this.setContent(this._contentHtml());
|
---|
2455 | this._msgCell=document.getElementById(this._msgCellId);
|
---|
2456 | this.addEnterListener(new AjxListener(this,this._enterListener))
|
---|
2457 | };
|
---|
2458 | DwtMessageDialog.PARAMS=["parent","className","buttons","extraButtons"];
|
---|
2459 | DwtMessageDialog.prototype=new DwtDialog;
|
---|
2460 | DwtMessageDialog.prototype.constructor=DwtMessageDialog;
|
---|
2461 | DwtMessageDialog.CRITICAL_STYLE=1;
|
---|
2462 | DwtMessageDialog.INFO_STYLE=2;
|
---|
2463 | DwtMessageDialog.WARNING_STYLE=3;
|
---|
2464 | DwtMessageDialog.TITLE={};
|
---|
2465 | DwtMessageDialog.TITLE[DwtMessageDialog.CRITICAL_STYLE]=AjxMsg.criticalMsg;
|
---|
2466 | DwtMessageDialog.TITLE[DwtMessageDialog.INFO_STYLE]=AjxMsg.infoMsg;
|
---|
2467 | DwtMessageDialog.TITLE[DwtMessageDialog.WARNING_STYLE]=AjxMsg.warningMsg;
|
---|
2468 | DwtMessageDialog.ICON={};
|
---|
2469 | DwtMessageDialog.ICON[DwtMessageDialog.CRITICAL_STYLE]="Critical_32";
|
---|
2470 | DwtMessageDialog.ICON[DwtMessageDialog.INFO_STYLE]="Information_32";
|
---|
2471 | DwtMessageDialog.ICON[DwtMessageDialog.WARNING_STYLE]="Warning_32";
|
---|
2472 | DwtMessageDialog.prototype.toString=function(){
|
---|
2473 | return"DwtMessageDialog"
|
---|
2474 | };
|
---|
2475 | DwtMessageDialog.prototype.setMessage=function(a,o,n){
|
---|
2476 | o=o||DwtMessageDialog.INFO_STYLE;
|
---|
2477 | n=n||DwtMessageDialog.TITLE[o];
|
---|
2478 | this.setTitle(n);
|
---|
2479 | if(a){
|
---|
2480 | var t=[];
|
---|
2481 | var e=0;
|
---|
2482 | t[e++]="<table cellspacing=0 cellpadding=0 border=0><tr><td valign='top'>";
|
---|
2483 | t[e++]=AjxImg.getImageHtml(DwtMessageDialog.ICON[o]);
|
---|
2484 | t[e++]="</td><td class='DwtMsgArea'>";
|
---|
2485 | t[e++]=a;
|
---|
2486 | t[e++]="</td></tr></table>";
|
---|
2487 | this._msgCell.innerHTML=t.join("")
|
---|
2488 | }else{
|
---|
2489 | this._msgCell.innerHTML=""
|
---|
2490 | }};
|
---|
2491 | DwtMessageDialog.prototype.setSize=function(t,e){
|
---|
2492 | var a=document.getElementById(this._msgCellId);
|
---|
2493 | if(a&&(t||e)){
|
---|
2494 | Dwt.setSize(a,t,e)
|
---|
2495 | }};
|
---|
2496 | DwtMessageDialog.prototype.reset=function(){
|
---|
2497 | this._msgCell.innerHTML="";
|
---|
2498 | DwtDialog.prototype.reset.call(this)
|
---|
2499 | };
|
---|
2500 | DwtMessageDialog.prototype.handleKeyAction=function(e,t){
|
---|
2501 | if((e==DwtKeyMap.CANCEL)&&!this._button[DwtDialog.CANCEL_BUTTON]){
|
---|
2502 | e=DwtKeyMap.ENTER
|
---|
2503 | }
|
---|
2504 | switch(e){
|
---|
2505 | case DwtKeyMap.CANCEL:this._runCallbackForButtonId(DwtDialog.CANCEL_BUTTON);
|
---|
2506 | break;
|
---|
2507 | default:DwtDialog.prototype.handleKeyAction.call(this,e,t);
|
---|
2508 | break
|
---|
2509 | }
|
---|
2510 | return true
|
---|
2511 | };
|
---|
2512 | DwtMessageDialog.prototype._contentHtml=function(){
|
---|
2513 | return"<div id='"+this._msgCellId+"' class='DwtMsgDialog'></div>"
|
---|
2514 | };
|
---|
2515 | DwtMessageDialog.prototype._enterListener=function(e){
|
---|
2516 | this._runEnterCallback()
|
---|
2517 | }
|
---|
2518 | }
|
---|
2519 | if(AjxPackage.define("ajax.dwt.widgets.DwtHtmlEditor")){
|
---|
2520 | DwtHtmlEditor=function(e){
|
---|
2521 | if(arguments.length==0){
|
---|
2522 | return
|
---|
2523 | }
|
---|
2524 | e=Dwt.getParams(arguments,DwtHtmlEditor.PARAMS);
|
---|
2525 | this.setBlankIframeSrc(e.blankIframeSrc);
|
---|
2526 | e.className=e.className||"DwtHtmlEditor";
|
---|
2527 | DwtComposite.call(this,e);
|
---|
2528 | this._mode=(e.mode==DwtHtmlEditor.HTML&&this.isHtmlEditingSupported())?e.mode:DwtHtmlEditor.TEXT;
|
---|
2529 | this.__eventClosure=AjxCallback.simpleClosure(this.__eventClosure,this);
|
---|
2530 | this._pendingContent=e.content||"";
|
---|
2531 | this._htmlModeInited=false;
|
---|
2532 | this._initialize()
|
---|
2533 | };
|
---|
2534 | DwtHtmlEditor.PARAMS=["parent","className","posStyle","content","mode","blankIframeSrc"];
|
---|
2535 | DwtHtmlEditor.prototype=new DwtComposite();
|
---|
2536 | DwtHtmlEditor.prototype.constructor=DwtHtmlEditor;
|
---|
2537 | DwtHtmlEditor.HTML="text/html";
|
---|
2538 | DwtHtmlEditor.TEXT="text/plain";
|
---|
2539 | DwtHtmlEditor.H1=1;
|
---|
2540 | DwtHtmlEditor.H2=2;
|
---|
2541 | DwtHtmlEditor.H3=3;
|
---|
2542 | DwtHtmlEditor.H4=4;
|
---|
2543 | DwtHtmlEditor.H5=5;
|
---|
2544 | DwtHtmlEditor.H6=6;
|
---|
2545 | DwtHtmlEditor.PARAGRAPH=7;
|
---|
2546 | DwtHtmlEditor.ADDRESS=8;
|
---|
2547 | DwtHtmlEditor.PREFORMATTED=9;
|
---|
2548 | DwtHtmlEditor._STYLES=["","<h1>","<h2>","<h3>","<h4>","<h5>","<h6>","<p>","<address>","<pre>"];
|
---|
2549 | DwtHtmlEditor.BOLD_STYLE="bold";
|
---|
2550 | DwtHtmlEditor.ITALIC_STYLE="italic";
|
---|
2551 | DwtHtmlEditor.UNDERLINE_STYLE="underline";
|
---|
2552 | DwtHtmlEditor.STRIKETHRU_STYLE="strikethrough";
|
---|
2553 | DwtHtmlEditor.SUBSCRIPT_STYLE="subscript";
|
---|
2554 | DwtHtmlEditor.SUPERSCRIPT_STYLE="superscript";
|
---|
2555 | DwtHtmlEditor.JUSTIFY_LEFT="justifyleft";
|
---|
2556 | DwtHtmlEditor.JUSTIFY_CENTER="justifycenter";
|
---|
2557 | DwtHtmlEditor.JUSTIFY_RIGHT="justifyright";
|
---|
2558 | DwtHtmlEditor.JUSTIFY_FULL="justifyfull";
|
---|
2559 | DwtHtmlEditor.OUTDENT="outdent";
|
---|
2560 | DwtHtmlEditor.INDENT="indent";
|
---|
2561 | DwtHtmlEditor.HORIZ_RULE="inserthorizontalrule";
|
---|
2562 | DwtHtmlEditor.ORDERED_LIST="insertorderedlist";
|
---|
2563 | DwtHtmlEditor.UNORDERED_LIST="insertunorderedlist";
|
---|
2564 | DwtHtmlEditor.IMAGE="insertimage";
|
---|
2565 | DwtHtmlEditor.BORDER_TOP=0;
|
---|
2566 | DwtHtmlEditor.BORDER_MIDDLE=1;
|
---|
2567 | DwtHtmlEditor.BORDER_BOTTOM=2;
|
---|
2568 | DwtHtmlEditor.BORDER_LEFT=3;
|
---|
2569 | DwtHtmlEditor.BORDER_CENTER=4;
|
---|
2570 | DwtHtmlEditor.BORDER_RIGHT=5;
|
---|
2571 | DwtHtmlEditor._H1_RE=/Heading 1|h1/;
|
---|
2572 | DwtHtmlEditor._H2_RE=/Heading 2|h2/;
|
---|
2573 | DwtHtmlEditor._H3_RE=/Heading 2|h3/;
|
---|
2574 | DwtHtmlEditor._H4_RE=/Heading 2|h4/;
|
---|
2575 | DwtHtmlEditor._H5_RE=/Heading 2|h5/;
|
---|
2576 | DwtHtmlEditor._H6_RE=/Heading 2|h6/;
|
---|
2577 | DwtHtmlEditor._PARAGRAPH_RE=/Normal|p/;
|
---|
2578 | DwtHtmlEditor._ADDRESS_RE=/Address|address/;
|
---|
2579 | DwtHtmlEditor._PREFORMATTED_RE=/Formatted|pre/;
|
---|
2580 | DwtHtmlEditor._FONT_NAME="fontname";
|
---|
2581 | DwtHtmlEditor._FONT_SIZE="fontsize";
|
---|
2582 | DwtHtmlEditor._FONT_COLOR="forecolor";
|
---|
2583 | DwtHtmlEditor._FONT_HILITE="hilitecolor";
|
---|
2584 | DwtHtmlEditor._FONT_HILITE_IE="backcolor";
|
---|
2585 | DwtHtmlEditor._FORMAT_BLOCK="formatblock";
|
---|
2586 | DwtHtmlEditor._INITDELAY=50;
|
---|
2587 | DwtHtmlEditor.FONT_SIZE_VALUES=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
|
---|
2588 | DwtHtmlEditor._BLOCK_ELEMENTS={
|
---|
2589 | address:1,body:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,iframe:1,li:1,ol:1,p:1,pre:1,quote:1,table:1,tbody:1,td:1,textarea:1,tfoot:1,thead:1,tr:1,ul:1};
|
---|
2590 | DwtHtmlEditor._ACTION_CODE_TO_CMD={};
|
---|
2591 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_BOLD]=DwtHtmlEditor.BOLD_STYLE;
|
---|
2592 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_ITALIC]=DwtHtmlEditor.ITALIC_STYLE;
|
---|
2593 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_UNDERLINE]=DwtHtmlEditor.UNDERLINE_STYLE;
|
---|
2594 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.TEXT_STRIKETHRU]=DwtHtmlEditor.STRIKETHRU_STYLE;
|
---|
2595 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_LEFT]=DwtHtmlEditor.JUSTIFY_LEFT;
|
---|
2596 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_CENTER]=DwtHtmlEditor.JUSTIFY_CENTER;
|
---|
2597 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.JUSTIFY_RIGHT]=DwtHtmlEditor.JUSTIFY_RIGHT;
|
---|
2598 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER1]=DwtHtmlEditor._STYLES[1];
|
---|
2599 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER2]=DwtHtmlEditor._STYLES[2];
|
---|
2600 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER3]=DwtHtmlEditor._STYLES[3];
|
---|
2601 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER4]=DwtHtmlEditor._STYLES[4];
|
---|
2602 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER5]=DwtHtmlEditor._STYLES[5];
|
---|
2603 | DwtHtmlEditor._ACTION_CODE_TO_CMD[DwtKeyMap.HEADER6]=DwtHtmlEditor._STYLES[6];
|
---|
2604 | DwtHtmlEditor.INIT_HTML=["<html><head><title>ZWC</title></head><body><p>",AjxEnv.isGeckoBased?"<br type='_moz' />":"","</p></body></html>"].join("");
|
---|
2605 | DwtHtmlEditor.prototype.focus=function(){
|
---|
2606 | if(!AjxEnv.isIE&&this._mode==DwtHtmlEditor.TEXT){
|
---|
2607 | document.getElementById(this._textAreaId).focus()
|
---|
2608 | }else{
|
---|
2609 | try{
|
---|
2610 | if(!this._htmlModeInited){
|
---|
2611 | setTimeout(AjxCallback.simpleClosure(this.focus,this),DwtHtmlEditor._INITDELAY);
|
---|
2612 | return
|
---|
2613 | }
|
---|
2614 | if(AjxEnv.isSafari){
|
---|
2615 | document.getElementById(this._iFrameId).focus()
|
---|
2616 | }else{
|
---|
2617 | this._getIframeWin().focus()
|
---|
2618 | }
|
---|
2619 | if(AjxEnv.isIE){
|
---|
2620 | if(this._currInsPt){
|
---|
2621 | if(this._currInsPt.text.length<=1){
|
---|
2622 | this._currInsPt.collapse(false)
|
---|
2623 | }
|
---|
2624 | this._currInsPt.select()
|
---|
2625 | }}}
|
---|
2626 | catch(e){}}};
|
---|
2627 | DwtHtmlEditor.prototype.moveCaretToTop=function(){
|
---|
2628 | var a=document.activeElement;
|
---|
2629 | if(this._mode==DwtHtmlEditor.TEXT){
|
---|
2630 | var t=document.getElementById(this._textAreaId);
|
---|
2631 | if(t.createTextRange){
|
---|
2632 | var e=t.createTextRange();
|
---|
2633 | e.collapse(true);
|
---|
2634 | e.select()
|
---|
2635 | }else{
|
---|
2636 | if(t.setSelectionRange){
|
---|
2637 | t.setSelectionRange(0,0)
|
---|
2638 | }}}else{
|
---|
2639 | this._moveCaretToTopHtml(true)
|
---|
2640 | }
|
---|
2641 | if(a){
|
---|
2642 | a.focus()
|
---|
2643 | }};
|
---|
2644 | DwtHtmlEditor.prototype._moveCaretToTopHtml=function(t){
|
---|
2645 | var e=this._getIframeDoc().body;
|
---|
2646 | var o=false;
|
---|
2647 | if(AjxEnv.isIE){
|
---|
2648 | if(e){
|
---|
2649 | e.createTextRange().collapse(true);
|
---|
2650 | o=true
|
---|
2651 | }}else{
|
---|
2652 | var a=this._getSelection();
|
---|
2653 | if(a){
|
---|
2654 | a.collapse(e,0);
|
---|
2655 | o=true
|
---|
2656 | }}
|
---|
2657 | if(!o&&t){
|
---|
2658 | var i=new AjxTimedAction(this,this._moveCaretToTopHtml);
|
---|
2659 | AjxTimedAction.scheduleAction(i,DwtHtmlEditor._INITDELAY+1)
|
---|
2660 | }};
|
---|
2661 | DwtHtmlEditor.prototype.addStateChangeListener=function(e){
|
---|
2662 | this.addListener(DwtEvent.STATE_CHANGE,e)
|
---|
2663 | };
|
---|
2664 | DwtHtmlEditor.prototype.removeStateChangeListener=function(e){
|
---|
2665 | this.removeListener(DwtEvent.STATE_CHANGE,e)
|
---|
2666 | };
|
---|
2667 | DwtHtmlEditor.prototype.clear=function(){
|
---|
2668 | this.setContent("")
|
---|
2669 | };
|
---|
2670 | DwtHtmlEditor.prototype.enable=function(e){
|
---|
2671 | if(this._textAreaId!=null){
|
---|
2672 | document.getElementById(this._textAreaId).disabled=!e
|
---|
2673 | }
|
---|
2674 | if(this._iFrameId!=null){
|
---|
2675 | document.getElementById(this._iFrameId).disabled=!e
|
---|
2676 | }};
|
---|
2677 | DwtHtmlEditor.prototype.setBlankIframeSrc=function(e){
|
---|
2678 | this._blankIframeSrc=e
|
---|
2679 | };
|
---|
2680 | DwtHtmlEditor.prototype.isHtmlEditingSupported=function(){
|
---|
2681 | return(!!(AjxEnv.isGeckoBased||AjxEnv.isIE||AjxEnv.isSafari3up))
|
---|
2682 | };
|
---|
2683 | DwtHtmlEditor.prototype.getContent=function(){
|
---|
2684 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
2685 | var a=this._getIframeDoc();
|
---|
2686 | var e=a&&a.body?(this._getIframeDoc().body.innerHTML):"";
|
---|
2687 | return this._embedHtmlContent(e)
|
---|
2688 | }else{
|
---|
2689 | var t=document.getElementById(this._textAreaId);
|
---|
2690 | return t&&t.value
|
---|
2691 | }};
|
---|
2692 | DwtHtmlEditor.prototype._embedHtmlContent=function(e){
|
---|
2693 | return["<html><body>",e,"</body></html>"].join("")
|
---|
2694 | };
|
---|
2695 | DwtHtmlEditor.prototype.setContent=function(e){
|
---|
2696 | if(AjxEnv.isIE){
|
---|
2697 | this._currInsPt=null
|
---|
2698 | }
|
---|
2699 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
2700 | this._pendingContent=e||"";
|
---|
2701 | if(this._htmlModeInited){
|
---|
2702 | this._setContentOnTimer()
|
---|
2703 | }}else{
|
---|
2704 | document.getElementById(this._textAreaId).value=(e||"")
|
---|
2705 | }};
|
---|
2706 | DwtHtmlEditor.prototype.insertElement=function(e){
|
---|
2707 | this._execCommand(e)
|
---|
2708 | };
|
---|
2709 | DwtHtmlEditor.prototype.insertText=function(a,e){
|
---|
2710 | var t=this._getIframeDoc().createTextNode(a);
|
---|
2711 | this._insertNodeAtSelection(t,e)
|
---|
2712 | };
|
---|
2713 | DwtHtmlEditor.prototype.insertImage=function(n,s,a,e){
|
---|
2714 | if(s){
|
---|
2715 | var i=this._getIframeDoc();
|
---|
2716 | var t=i.createElement("img");
|
---|
2717 | t.src=n;
|
---|
2718 | if(a){
|
---|
2719 | t.width=a
|
---|
2720 | }else{
|
---|
2721 | t.removeAttribute("width")
|
---|
2722 | }
|
---|
2723 | if(e){
|
---|
2724 | t.height=e
|
---|
2725 | }else{
|
---|
2726 | t.removeAttribute("height")
|
---|
2727 | }
|
---|
2728 | var o=i.createDocumentFragment();
|
---|
2729 | o.appendChild(t);
|
---|
2730 | this._insertNodeAtSelection(o)
|
---|
2731 | }else{
|
---|
2732 | this._execCommand(DwtHtmlEditor.IMAGE,n)
|
---|
2733 | }};
|
---|
2734 | DwtHtmlEditor.prototype.insertTable=function(b,m,a,t,l,u){
|
---|
2735 | if(this._mode!=DwtHtmlEditor.HTML){
|
---|
2736 | return
|
---|
2737 | }
|
---|
2738 | var g=this._getIframeDoc();
|
---|
2739 | var y=g.createElement("table");
|
---|
2740 | y.style.borderRight="1px solid #000";
|
---|
2741 | y.style.borderLeft="1px solid #000";
|
---|
2742 | y.style.borderTop="1px solid #000";
|
---|
2743 | y.style.borderBottom="1px solid #000";
|
---|
2744 | if(a!=null){
|
---|
2745 | y.style.width=a
|
---|
2746 | }else{
|
---|
2747 | y.style.width="100%"
|
---|
2748 | }
|
---|
2749 | y.style.textAlign="left";
|
---|
2750 | y.style.verticalAlign="middle";
|
---|
2751 | if(u!=null){
|
---|
2752 | y.align=u.toLowerCase()
|
---|
2753 | }
|
---|
2754 | if(t!=null){
|
---|
2755 | y.cellSpacing=t
|
---|
2756 | }else{
|
---|
2757 | y.cellSpacing=0
|
---|
2758 | }
|
---|
2759 | if(l!=null){
|
---|
2760 | y.cellPadding=l
|
---|
2761 | }else{
|
---|
2762 | y.cellPadding=0
|
---|
2763 | }
|
---|
2764 | if(!AjxEnv.isIE){
|
---|
2765 | y.style.border="1px solid #000"
|
---|
2766 | }
|
---|
2767 | y.style.borderCollapse="collapse";
|
---|
2768 | var c;
|
---|
2769 | c=Math.floor(100/m)+"%";
|
---|
2770 | var h=g.createElement("tbody");
|
---|
2771 | y.appendChild(h);
|
---|
2772 | for(var s=0;
|
---|
2773 | s<b;
|
---|
2774 | s++){
|
---|
2775 | var d=g.createElement("tr");
|
---|
2776 | h.appendChild(d);
|
---|
2777 | for(var n=0;
|
---|
2778 | n<m;
|
---|
2779 | n++){
|
---|
2780 | var o=g.createElement("td");
|
---|
2781 | if(s==0&&c){
|
---|
2782 | o.style.width=c
|
---|
2783 | }
|
---|
2784 | if(AjxEnv.isGeckoBased){
|
---|
2785 | o.appendChild(g.createElement("br"))
|
---|
2786 | }else{
|
---|
2787 | if(AjxEnv.isIE){
|
---|
2788 | o.innerHTML=" "
|
---|
2789 | }}
|
---|
2790 | if(AjxEnv.isIE){
|
---|
2791 | o.style.border="1px solid #000"
|
---|
2792 | }else{
|
---|
2793 | o.style.borderTop=o.style.borderLeft="1px solid #000"
|
---|
2794 | }
|
---|
2795 | d.appendChild(o)
|
---|
2796 | }}
|
---|
2797 | var e=g.createElement("br");
|
---|
2798 | var f=g.createDocumentFragment();
|
---|
2799 | f.appendChild(e);
|
---|
2800 | f.appendChild(y);
|
---|
2801 | f.appendChild(e.cloneNode(true));
|
---|
2802 | this._insertNodeAtSelection(f);
|
---|
2803 | this.selectNodeContents(y.rows[0].cells[0],true);
|
---|
2804 | return y
|
---|
2805 | };
|
---|
2806 | DwtHtmlEditor.prototype.applyTableProperties=function(d,l){
|
---|
2807 | var c=this._getIframeDoc();
|
---|
2808 | var h=[];
|
---|
2809 | for(var s in l){
|
---|
2810 | var e=AjxStringUtil.trim(l[s].toString());
|
---|
2811 | var t=e!="";
|
---|
2812 | switch(s){
|
---|
2813 | case"caption":var u=d.getElementsByTagName("caption");
|
---|
2814 | u=u.length>0?u[0]:null;
|
---|
2815 | if(t&&!u){
|
---|
2816 | u=c.createElement("caption");
|
---|
2817 | d.insertBefore(u,d.firstChild)
|
---|
2818 | }
|
---|
2819 | if(!t&&u){
|
---|
2820 | u.parentNode.removeChild(u)
|
---|
2821 | }
|
---|
2822 | if(u){
|
---|
2823 | u.innerHTML=e
|
---|
2824 | }
|
---|
2825 | break;
|
---|
2826 | case"summary":case"align":case"cellSpacing":case"cellPadding":if(!t){
|
---|
2827 | d.removeAttribute(s,0)
|
---|
2828 | }else{
|
---|
2829 | d[s]=e
|
---|
2830 | }
|
---|
2831 | break;
|
---|
2832 | case"borderWidth":case"borderStyle":case"borderColor":d.style[s]=e;
|
---|
2833 | h.push([s,e]);
|
---|
2834 | break;
|
---|
2835 | default:d.style[s]=e;
|
---|
2836 | break
|
---|
2837 | }}
|
---|
2838 | if(h.length>0){
|
---|
2839 | var n=d.getElementsByTagName("td");
|
---|
2840 | for(var s=n.length;
|
---|
2841 | --s>=0;
|
---|
2842 | ){
|
---|
2843 | var a=n[s];
|
---|
2844 | for(var o=h.length;
|
---|
2845 | --o>=0;
|
---|
2846 | ){
|
---|
2847 | a.style[h[o][0]]=h[o][1]
|
---|
2848 | }}}
|
---|
2849 | if(AjxEnv.isGeckoBased){
|
---|
2850 | this._forceRedraw()
|
---|
2851 | }};
|
---|
2852 | DwtHtmlEditor.prototype.applyCellProperties=function(d,u,n){
|
---|
2853 | var s=true;
|
---|
2854 | for(var a=u.length;
|
---|
2855 | --a>=0;
|
---|
2856 | ){
|
---|
2857 | var m=u[a];
|
---|
2858 | var o=(a==0);
|
---|
2859 | var c=true;
|
---|
2860 | for(var t=m.length;
|
---|
2861 | --t>=0;
|
---|
2862 | ){
|
---|
2863 | var l=(t==0);
|
---|
2864 | var e=m[t];
|
---|
2865 | if(n.backgroundColor!=null){
|
---|
2866 | e.style.backgroundColor=n.backgroundColor
|
---|
2867 | }
|
---|
2868 | if(n.color!=null){
|
---|
2869 | e.style.color=n.color
|
---|
2870 | }
|
---|
2871 | if(n.textAlign!=null){
|
---|
2872 | e.style.textAlign=n.textAlign
|
---|
2873 | }
|
---|
2874 | if(n.verticalAlign!=null){
|
---|
2875 | e.style.verticalAlign=n.verticalAlign
|
---|
2876 | }
|
---|
2877 | if(n.width!=null){
|
---|
2878 | if(n.width){
|
---|
2879 | e.style.width=n.width+"px"
|
---|
2880 | }else{
|
---|
2881 | e.style.width=""
|
---|
2882 | }}
|
---|
2883 | if(n.height!=null){
|
---|
2884 | if(n.height){
|
---|
2885 | e.style.height=n.height+"px"
|
---|
2886 | }else{
|
---|
2887 | e.style.height=""
|
---|
2888 | }}
|
---|
2889 | if(n.vertPadding!=null){
|
---|
2890 | if(n.vertPadding){
|
---|
2891 | e.style.paddingTop=e.style.paddingBottom=n.vertPadding+"px"
|
---|
2892 | }else{
|
---|
2893 | e.style.paddingTop=e.style.paddingBottom=""
|
---|
2894 | }}
|
---|
2895 | if(n.horizPadding!=null){
|
---|
2896 | if(n.horizPadding){
|
---|
2897 | e.style.paddingLeft=e.style.paddingRight=n.horizPadding+"px"
|
---|
2898 | }else{
|
---|
2899 | e.style.paddingLeft=e.style.paddingRight=""
|
---|
2900 | }}
|
---|
2901 | var i=n.borders,h;
|
---|
2902 | h=i[DwtHtmlEditor.BORDER_TOP];
|
---|
2903 | if(h!=null&&o){
|
---|
2904 | e.style.borderTop=h.width+" "+h.style+" "+h.color
|
---|
2905 | }
|
---|
2906 | h=i[DwtHtmlEditor.BORDER_MIDDLE];
|
---|
2907 | if(h!=null){
|
---|
2908 | h=h.width+" "+h.style+" "+h.color;
|
---|
2909 | if(!s){
|
---|
2910 | e.style.borderBottom=h
|
---|
2911 | }
|
---|
2912 | if(!o){
|
---|
2913 | e.style.borderTop=h
|
---|
2914 | }}
|
---|
2915 | h=i[DwtHtmlEditor.BORDER_BOTTOM];
|
---|
2916 | if(h!=null&&s){
|
---|
2917 | e.style.borderBottom=h.width+" "+h.style+" "+h.color
|
---|
2918 | }
|
---|
2919 | h=i[DwtHtmlEditor.BORDER_LEFT];
|
---|
2920 | if(h!=null&&l){
|
---|
2921 | e.style.borderLeft=h.width+" "+h.style+" "+h.color
|
---|
2922 | }
|
---|
2923 | h=i[DwtHtmlEditor.BORDER_CENTER];
|
---|
2924 | if(h!=null){
|
---|
2925 | h=h.width+" "+h.style+" "+h.color;
|
---|
2926 | if(!c){
|
---|
2927 | e.style.borderRight=h
|
---|
2928 | }
|
---|
2929 | if(!l){
|
---|
2930 | e.style.borderLeft=h
|
---|
2931 | }}
|
---|
2932 | h=i[DwtHtmlEditor.BORDER_RIGHT];
|
---|
2933 | if(h!=null&&c){
|
---|
2934 | e.style.borderRight=h.width+" "+h.style+" "+h.color
|
---|
2935 | }
|
---|
2936 | c=false
|
---|
2937 | }
|
---|
2938 | s=false
|
---|
2939 | }
|
---|
2940 | if(AjxEnv.isGeckoBased){
|
---|
2941 | this._forceRedraw()
|
---|
2942 | }};
|
---|
2943 | DwtHtmlEditor.prototype._insertHTML=function(a){
|
---|
2944 | var i=this._getSelection();
|
---|
2945 | var e=this._createRange(i);
|
---|
2946 | if(AjxEnv.isIE){
|
---|
2947 | if(this.insertRange){
|
---|
2948 | this.insertRange.pasteHTML(a)
|
---|
2949 | }else{
|
---|
2950 | e.pasteHTML(a)
|
---|
2951 | }}else{
|
---|
2952 | var n=this._getIframeDoc();
|
---|
2953 | var t=n.createDocumentFragment();
|
---|
2954 | var o=n.createElement("div");
|
---|
2955 | o.innerHTML=a;
|
---|
2956 | while(o.firstChild){
|
---|
2957 | t.appendChild(o.firstChild)
|
---|
2958 | }
|
---|
2959 | this._insertNodeAtSelection(t)
|
---|
2960 | }};
|
---|
2961 | DwtHtmlEditor.prototype._insertNodeAtSelection=function(n,t){
|
---|
2962 | this.focus();
|
---|
2963 | if(!AjxEnv.isIE){
|
---|
2964 | var a=this._getRange();
|
---|
2965 | var s=this._getIframeWin().getSelection();
|
---|
2966 | s.removeAllRanges();
|
---|
2967 | try{
|
---|
2968 | a.deleteContents();
|
---|
2969 | a.insertNode(n);
|
---|
2970 | a.selectNode(n);
|
---|
2971 | if(t){
|
---|
2972 | s.addRange(a)
|
---|
2973 | }}
|
---|
2974 | catch(h){}}else{
|
---|
2975 | var s=this._getRange();
|
---|
2976 | var a=s.createRange();
|
---|
2977 | var l="FOO-"+Dwt.getNextId();
|
---|
2978 | try{
|
---|
2979 | a.pasteHTML("<span id='"+l+"'></span>")
|
---|
2980 | }
|
---|
2981 | catch(i){
|
---|
2982 | a.collapse(false);
|
---|
2983 | a.pasteHTML("<span id='"+l+"'></span>")
|
---|
2984 | }
|
---|
2985 | var o=this._getIframeDoc().getElementById(l);
|
---|
2986 | o.parentNode.insertBefore(n,o);
|
---|
2987 | o.parentNode.removeChild(o)
|
---|
2988 | }};
|
---|
2989 | DwtHtmlEditor.prototype.isHtmlModeInited=function(){
|
---|
2990 | return this._htmlModeInited
|
---|
2991 | };
|
---|
2992 | DwtHtmlEditor.prototype.setMode=function(n,i){
|
---|
2993 | if(n==this._mode||(n!=DwtHtmlEditor.HTML&&n!=DwtHtmlEditor.TEXT)){
|
---|
2994 | return
|
---|
2995 | }
|
---|
2996 | var t=this._getIframeDoc();
|
---|
2997 | this._mode=n;
|
---|
2998 | if(n==DwtHtmlEditor.HTML){
|
---|
2999 | var o=document.getElementById(this._textAreaId);
|
---|
3000 | var e;
|
---|
3001 | if(this._iFrameId){
|
---|
3002 | t.body.innerHTML=i?AjxStringUtil.convertToHtml(o.value):o.value;
|
---|
3003 | e=document.getElementById(this._iFrameId)
|
---|
3004 | }else{
|
---|
3005 | var a=i?AjxStringUtil.convertToHtml(o.value):o.value;
|
---|
3006 | e=this._initHtmlMode(a)
|
---|
3007 | }
|
---|
3008 | Dwt.setVisible(o,false);
|
---|
3009 | Dwt.setVisible(e,true);
|
---|
3010 | if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
|
---|
3011 | this._enableDesignMode(t)
|
---|
3012 | }}else{
|
---|
3013 | var o=this._textAreaId?document.getElementById(this._textAreaId):this._initTextMode(true);
|
---|
3014 | o.value=i?this._convertHtml2Text():t.innerHTML;
|
---|
3015 | Dwt.setVisible(document.getElementById(this._iFrameId),false);
|
---|
3016 | Dwt.setVisible(o,true)
|
---|
3017 | }};
|
---|
3018 | DwtHtmlEditor.prototype.getMode=function(){
|
---|
3019 | return this._mode
|
---|
3020 | };
|
---|
3021 | DwtHtmlEditor.prototype.setFont=function(o,i,a,e,t){
|
---|
3022 | if(o){
|
---|
3023 | this._execCommand(DwtHtmlEditor._FONT_NAME,o)
|
---|
3024 | }
|
---|
3025 | if(i){
|
---|
3026 | this._execCommand(i)
|
---|
3027 | }
|
---|
3028 | if(a){
|
---|
3029 | this._execCommand(DwtHtmlEditor._FONT_SIZE,a)
|
---|
3030 | }
|
---|
3031 | if(e){
|
---|
3032 | this._execCommand(DwtHtmlEditor._FONT_COLOR,e)
|
---|
3033 | }
|
---|
3034 | if(t){
|
---|
3035 | this._execCommand((AjxEnv.isIE)?DwtHtmlEditor._FONT_HILITE_IE:DwtHtmlEditor._FONT_HILITE,t)
|
---|
3036 | }};
|
---|
3037 | DwtHtmlEditor.prototype.setJustification=function(e){
|
---|
3038 | this._execCommand(e)
|
---|
3039 | };
|
---|
3040 | DwtHtmlEditor.prototype.setIndent=function(e){
|
---|
3041 | this._execCommand(e)
|
---|
3042 | };
|
---|
3043 | DwtHtmlEditor.prototype.setStyle=function(e){
|
---|
3044 | this._execCommand(DwtHtmlEditor._FORMAT_BLOCK,DwtHtmlEditor._STYLES[e])
|
---|
3045 | };
|
---|
3046 | DwtHtmlEditor.prototype.setSize=function(a,t){
|
---|
3047 | DwtComposite.prototype.setSize.call(this,a,t);
|
---|
3048 | var i=this.getHtmlElement();
|
---|
3049 | if(this._iFrameId!=null){
|
---|
3050 | var e=document.getElementById(this._iFrameId);
|
---|
3051 | e.width=i.style.width;
|
---|
3052 | e.height=i.style.height
|
---|
3053 | }else{
|
---|
3054 | var o=document.getElementById(this._textAreaId);
|
---|
3055 | o.style.width=i.style.width;
|
---|
3056 | o.style.height=i.style.height
|
---|
3057 | }};
|
---|
3058 | DwtHtmlEditor.prototype.getIframe=function(){
|
---|
3059 | return document.getElementById(this._iFrameId)
|
---|
3060 | };
|
---|
3061 | DwtHtmlEditor.prototype.getInputElement=function(){
|
---|
3062 | var e=(this._mode==DwtHtmlEditor.HTML)?this._iFrameId:this._textAreaId;
|
---|
3063 | return document.getElementById(e)
|
---|
3064 | };
|
---|
3065 | DwtHtmlEditor.prototype._initialize=function(){
|
---|
3066 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
3067 | this._initHtmlMode(this._pendingContent)
|
---|
3068 | }else{
|
---|
3069 | this._initTextMode()
|
---|
3070 | }};
|
---|
3071 | DwtHtmlEditor.prototype.TEXTAREA_CLASSNAME="DwtHtmlEditorTextArea";
|
---|
3072 | DwtHtmlEditor.prototype._initTextMode=function(t){
|
---|
3073 | var e=this.getHtmlElement();
|
---|
3074 | this._textAreaId="textarea_"+Dwt.getNextId();
|
---|
3075 | var a=document.createElement("textarea");
|
---|
3076 | a.className=this.TEXTAREA_CLASSNAME;
|
---|
3077 | a.id=this._textAreaId;
|
---|
3078 | e.appendChild(a);
|
---|
3079 | if(!t){
|
---|
3080 | a.value=this._pendingContent;
|
---|
3081 | this._pendingContent=null
|
---|
3082 | }
|
---|
3083 | return a
|
---|
3084 | };
|
---|
3085 | DwtHtmlEditor.prototype._initHtmlMode=function(a){
|
---|
3086 | this._pendingContent=a||"";
|
---|
3087 | this._keyEvent=new DwtKeyEvent();
|
---|
3088 | this._stateEvent=new DwtHtmlEditorStateEvent();
|
---|
3089 | this._stateEvent.dwtObj=this;
|
---|
3090 | this._updateStateAction=new AjxTimedAction(this,this._updateState);
|
---|
3091 | var i=this.getHtmlElement();
|
---|
3092 | this._iFrameId="iframe_"+Dwt.getNextId();
|
---|
3093 | var t=document.createElement("iframe");
|
---|
3094 | t.id=this._iFrameId;
|
---|
3095 | t.className="DwtHtmlEditorIFrame";
|
---|
3096 | t.setAttribute("border","0",false);
|
---|
3097 | t.setAttribute("frameborder","0",false);
|
---|
3098 | t.setAttribute("vspace","0",false);
|
---|
3099 | t.setAttribute("autocomplete","off",false);
|
---|
3100 | var e=AjxCallback.simpleClosure(this._finishHtmlModeInit,this);
|
---|
3101 | setTimeout(e,DwtHtmlEditor._INITDELAY);
|
---|
3102 | t.src=this._blankIframeSrc||"";
|
---|
3103 | i.appendChild(t);
|
---|
3104 | return t
|
---|
3105 | };
|
---|
3106 | DwtHtmlEditor.prototype._finishHtmlModeInit=function(){
|
---|
3107 | var a=this._getIframeDoc();
|
---|
3108 | try{
|
---|
3109 | if(AjxEnv.isSafari&&a.body==null){
|
---|
3110 | a.open();
|
---|
3111 | a.write("<html><head></head><body></body></html>");
|
---|
3112 | a.close()
|
---|
3113 | }}
|
---|
3114 | catch(t){
|
---|
3115 | return
|
---|
3116 | }
|
---|
3117 | if(AjxEnv.isGeckoBased){
|
---|
3118 | a.open();
|
---|
3119 | a.write(DwtHtmlEditor.INIT_HTML);
|
---|
3120 | a.close()
|
---|
3121 | }
|
---|
3122 | function e(i){
|
---|
3123 | this._enableDesignMode(i);
|
---|
3124 | this._setContentOnTimer();
|
---|
3125 | this._updateState();
|
---|
3126 | this._htmlModeInited=true;
|
---|
3127 | this._registerEditorEventHandlers(document.getElementById(this._iFrameId),i)
|
---|
3128 | }
|
---|
3129 | if(AjxEnv.isIE||AjxEnv.isChrome){
|
---|
3130 | setTimeout(AjxCallback.simpleClosure(e,this,a),DwtHtmlEditor._INITDELAY)
|
---|
3131 | }else{
|
---|
3132 | e.call(this,a)
|
---|
3133 | }};
|
---|
3134 | DwtHtmlEditor.prototype._focus=function(){
|
---|
3135 | this.focus()
|
---|
3136 | };
|
---|
3137 | DwtHtmlEditor.prototype._getIframeDoc=function(){
|
---|
3138 | return this._iFrameId?Dwt.getIframeDoc(document.getElementById(this._iFrameId)):null
|
---|
3139 | };
|
---|
3140 | DwtHtmlEditor.prototype._getIframeWin=function(){
|
---|
3141 | return Dwt.getIframeWindow(document.getElementById(this._iFrameId))
|
---|
3142 | };
|
---|
3143 | DwtHtmlEditor.prototype._getParentElement=function(){
|
---|
3144 | if(AjxEnv.isIE){
|
---|
3145 | var n=this._getIframeDoc();
|
---|
3146 | var a=n.selection;
|
---|
3147 | var t=a.createRange();
|
---|
3148 | if(a.type=="None"||a.type=="Text"){
|
---|
3149 | return a.createRange().parentElement()
|
---|
3150 | }
|
---|
3151 | if(a.type=="Control"){
|
---|
3152 | return a.createRange().item(0)
|
---|
3153 | }
|
---|
3154 | return n.body
|
---|
3155 | }else{
|
---|
3156 | try{
|
---|
3157 | var t=this._getRange();
|
---|
3158 | var o=t.commonAncestorContainer;
|
---|
3159 | if(!t.collapsed&&t.startContainer==t.endContainer&&t.startOffset-t.endOffset<=1&&t.startContainer.hasChildNodes()){
|
---|
3160 | o=t.startContainer.childNodes[t.startOffset]
|
---|
3161 | }
|
---|
3162 | while(o.nodeType==3){
|
---|
3163 | o=o.parentNode
|
---|
3164 | }
|
---|
3165 | return o
|
---|
3166 | }
|
---|
3167 | catch(i){
|
---|
3168 | return null
|
---|
3169 | }}};
|
---|
3170 | DwtHtmlEditor.prototype.getNearestElement=function(t){
|
---|
3171 | try{
|
---|
3172 | var a=this._getParentElement();
|
---|
3173 | t=t.toLowerCase();
|
---|
3174 | while(a&&a.nodeName.toLowerCase()!=t){
|
---|
3175 | a=a.parentNode
|
---|
3176 | }
|
---|
3177 | return a
|
---|
3178 | }
|
---|
3179 | catch(e){
|
---|
3180 | return null
|
---|
3181 | }};
|
---|
3182 | DwtHtmlEditor.prototype.selectNodeContents=function(a,n,e){
|
---|
3183 | var t;
|
---|
3184 | var o=(typeof n=="boolean");
|
---|
3185 | if(AjxEnv.isIE){
|
---|
3186 | t=this._getIframeDoc().body.createTextRange();
|
---|
3187 | t.moveToElementText(a);
|
---|
3188 | (o)&&t.collapse(n);
|
---|
3189 | t.select()
|
---|
3190 | }else{
|
---|
3191 | var i=this._getSelection();
|
---|
3192 | t=this._getIframeDoc().createRange();
|
---|
3193 | if(e){
|
---|
3194 | t.selectNode(a)
|
---|
3195 | }else{
|
---|
3196 | t.selectNodeContents(a)
|
---|
3197 | }
|
---|
3198 | (o)&&t.collapse(n);
|
---|
3199 | i.removeAllRanges();
|
---|
3200 | i.addRange(t)
|
---|
3201 | }};
|
---|
3202 | DwtHtmlEditor.prototype._forceRedraw=function(){
|
---|
3203 | var e=this._getIframeDoc().body;
|
---|
3204 | e.style.display="none";
|
---|
3205 | var t=this;
|
---|
3206 | setTimeout(function(){
|
---|
3207 | e.style.display="";
|
---|
3208 | t.focus();
|
---|
3209 | t=null
|
---|
3210 | }
|
---|
3211 | ,10)
|
---|
3212 | };
|
---|
3213 | DwtHtmlEditor.prototype.getSelectedCells=function(){
|
---|
3214 | var l=null;
|
---|
3215 | var e=this._getSelection();
|
---|
3216 | var s,n=0;
|
---|
3217 | var a=1000;
|
---|
3218 | var d=[];
|
---|
3219 | var c=null;
|
---|
3220 | if(!AjxEnv.isIE){
|
---|
3221 | try{
|
---|
3222 | for(n=0;
|
---|
3223 | s=e.getRangeAt(n)&&n<a;
|
---|
3224 | n++){
|
---|
3225 | var t=s.startContainer.childNodes[s.startOffset];
|
---|
3226 | if(t){
|
---|
3227 | if(t.parentNode!=c){
|
---|
3228 | c=t.parentNode;
|
---|
3229 | l&&d.push(l);
|
---|
3230 | l=[]
|
---|
3231 | }
|
---|
3232 | if(t.tagName&&/^td$/i.test(t.tagName)){
|
---|
3233 | l.push(t)
|
---|
3234 | }}}}
|
---|
3235 | catch(h){}
|
---|
3236 | d.push(l)
|
---|
3237 | }else{
|
---|
3238 | s=e.createRange();
|
---|
3239 | var o=s.duplicate();
|
---|
3240 | s.collapse(true);
|
---|
3241 | for(n=0;
|
---|
3242 | o.compareEndPoints("EndToStart",s)>=0&&n<a;
|
---|
3243 | n++){
|
---|
3244 | var t=s.parentElement();
|
---|
3245 | while(t&&t.nodeName.toLowerCase()!="td"){
|
---|
3246 | t=t.parentNode
|
---|
3247 | }
|
---|
3248 | if(t){
|
---|
3249 | if(t.parentNode!=c){
|
---|
3250 | c=t.parentNode;
|
---|
3251 | l&&d.push(l);
|
---|
3252 | l=[]
|
---|
3253 | }
|
---|
3254 | l.push(t);
|
---|
3255 | s.moveToElementText(t);
|
---|
3256 | s.collapse(false)
|
---|
3257 | }
|
---|
3258 | if(s.move("character",1)==0){
|
---|
3259 | break
|
---|
3260 | }}
|
---|
3261 | o.select();
|
---|
3262 | d.push(l)
|
---|
3263 | }
|
---|
3264 | if(d.length==0||!d[0]||d[0].length==0){
|
---|
3265 | l=this.getNearestElement("td");
|
---|
3266 | if(l){
|
---|
3267 | d=[[l]]
|
---|
3268 | }}
|
---|
3269 | return d
|
---|
3270 | };
|
---|
3271 | DwtHtmlEditor.prototype._splitCells=function(n){
|
---|
3272 | var i=n;
|
---|
3273 | while(i&&i.nodeName.toLowerCase()!="table"){
|
---|
3274 | i=i.parentNode
|
---|
3275 | }
|
---|
3276 | var e=AjxEnv.isGeckoBased?"<br />":"";
|
---|
3277 | function t(m){
|
---|
3278 | var u=m.rowSpan;
|
---|
3279 | var d=m.colSpan;
|
---|
3280 | m.rowSpan=1;
|
---|
3281 | tr=m.parentNode;
|
---|
3282 | var l=tr.rowIndex;
|
---|
3283 | var s=tr.parentNode.rows;
|
---|
3284 | var h=m.cellIndex;
|
---|
3285 | while(--u>0){
|
---|
3286 | tr=s[++l];
|
---|
3287 | var c=m.cloneNode(false);
|
---|
3288 | c.removeAttribute("rowspan");
|
---|
3289 | c.colSpan=m.colSpan;
|
---|
3290 | c.innerHTML=e;
|
---|
3291 | tr.insertBefore(c,tr.cells[h])
|
---|
3292 | }}
|
---|
3293 | function o(c){
|
---|
3294 | var l=c.colSpan;
|
---|
3295 | c.colSpan=1;
|
---|
3296 | tr=c.parentNode;
|
---|
3297 | var h=c.nextSibling;
|
---|
3298 | while(--l>0){
|
---|
3299 | var s=c.cloneNode(false);
|
---|
3300 | s.removeAttribute("colspan");
|
---|
3301 | s.rowSpan=c.rowSpan;
|
---|
3302 | s.innerHTML=e;
|
---|
3303 | tr.insertBefore(s,h)
|
---|
3304 | }}
|
---|
3305 | function a(c){
|
---|
3306 | var l=c.colSpan;
|
---|
3307 | o(c);
|
---|
3308 | var s=c.parentNode.cells;
|
---|
3309 | var h=c.cellIndex;
|
---|
3310 | while(l-->0){
|
---|
3311 | t(s[h++])
|
---|
3312 | }}
|
---|
3313 | a(n)
|
---|
3314 | };
|
---|
3315 | DwtHtmlEditor.prototype.doTableOperation=function(e,a){
|
---|
3316 | var d=a.table||this.getNearestElement("table");
|
---|
3317 | var t=a.td||this.getNearestElement("td");
|
---|
3318 | var l,c,h;
|
---|
3319 | if(t){
|
---|
3320 | l=t.cellIndex;
|
---|
3321 | h=t.parentNode;
|
---|
3322 | c=h.rowIndex
|
---|
3323 | }else{
|
---|
3324 | l=0;
|
---|
3325 | h=this.getNearestElement("tr");
|
---|
3326 | if(h){
|
---|
3327 | c=h.rowIndex
|
---|
3328 | }}
|
---|
3329 | var u=a.cells;
|
---|
3330 | while(true){
|
---|
3331 | switch(e){
|
---|
3332 | case"insertRowAbove":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t));
|
---|
3333 | break;
|
---|
3334 | case"insertRowUnder":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertRow(t,true));
|
---|
3335 | break;
|
---|
3336 | case"insertColumnBefore":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t));
|
---|
3337 | break;
|
---|
3338 | case"insertColumnAfter":DwtHtmlEditor.table_fixCells(DwtHtmlEditor.table_insertCol(t,true));
|
---|
3339 | break;
|
---|
3340 | case"deleteRow":for(var n=0;
|
---|
3341 | n<u.length;
|
---|
3342 | ++n){
|
---|
3343 | var t=DwtHtmlEditor.table_deleteRow(u[n][0]);
|
---|
3344 | if(t){
|
---|
3345 | this.selectNodeContents(t,true);
|
---|
3346 | this.focus()
|
---|
3347 | }}
|
---|
3348 | break;
|
---|
3349 | case"deleteColumn":for(var n=0;
|
---|
3350 | n<u[0].length;
|
---|
3351 | ++n){
|
---|
3352 | var t=DwtHtmlEditor.table_deleteCol(u[0][n]);
|
---|
3353 | if(t){
|
---|
3354 | this.selectNodeContents(t,true);
|
---|
3355 | this.focus()
|
---|
3356 | }}
|
---|
3357 | break;
|
---|
3358 | case"mergeCells":t=u[0][0];
|
---|
3359 | var s=[t.innerHTML.replace(/<br>$/i,"")];
|
---|
3360 | for(var n=0;
|
---|
3361 | n<u.length;
|
---|
3362 | ++n){
|
---|
3363 | var m=u[n];
|
---|
3364 | for(var o=0;
|
---|
3365 | o<m.length;
|
---|
3366 | ++o){
|
---|
3367 | if(n||o){
|
---|
3368 | s.push(m[o].innerHTML.replace(/<br>$/i,""));
|
---|
3369 | m[o].parentNode.removeChild(m[o])
|
---|
3370 | }}}
|
---|
3371 | t.colSpan=u[0].length;
|
---|
3372 | t.rowSpan=u.length;
|
---|
3373 | s=s.join(" ");
|
---|
3374 | if(AjxEnv.isGeckoBased){
|
---|
3375 | s+="<br/>"
|
---|
3376 | }
|
---|
3377 | t.innerHTML=s;
|
---|
3378 | this.selectNodeContents(t,true);
|
---|
3379 | break;
|
---|
3380 | case"splitCells":this._splitCells(t);
|
---|
3381 | break;
|
---|
3382 | case"deleteTable":if(!AjxEnv.isIE){
|
---|
3383 | this.selectNodeContents(d,null,true);
|
---|
3384 | this.deleteSelectedNodes()
|
---|
3385 | }else{
|
---|
3386 | d.parentNode.removeChild(d)
|
---|
3387 | }
|
---|
3388 | break
|
---|
3389 | }
|
---|
3390 | break
|
---|
3391 | }
|
---|
3392 | if(AjxEnv.isGeckoBased){
|
---|
3393 | this._forceRedraw()
|
---|
3394 | }
|
---|
3395 | this._updateState()
|
---|
3396 | };
|
---|
3397 | DwtHtmlEditor.prototype._getRange=function(){
|
---|
3398 | var i=this._getIframeDoc();
|
---|
3399 | if(AjxEnv.isIE){
|
---|
3400 | return i.selection
|
---|
3401 | }else{
|
---|
3402 | this.focus();
|
---|
3403 | var t=this._getIframeWin().getSelection();
|
---|
3404 | if(t!=null){
|
---|
3405 | try{
|
---|
3406 | return t.getRangeAt(0)
|
---|
3407 | }
|
---|
3408 | catch(a){
|
---|
3409 | return i.createRange()
|
---|
3410 | }}else{
|
---|
3411 | return i.createRange()
|
---|
3412 | }}};
|
---|
3413 | DwtHtmlEditor.prototype._createRange=function(t){
|
---|
3414 | var i=this._getIframeDoc();
|
---|
3415 | if(AjxEnv.isIE){
|
---|
3416 | return t.createRange()
|
---|
3417 | }else{
|
---|
3418 | this.focus();
|
---|
3419 | if(t!=null){
|
---|
3420 | try{
|
---|
3421 | return t.getRangeAt(0)
|
---|
3422 | }
|
---|
3423 | catch(a){
|
---|
3424 | return i.createRange()
|
---|
3425 | }}else{
|
---|
3426 | return i.createRange()
|
---|
3427 | }}};
|
---|
3428 | DwtHtmlEditor.prototype.deleteSelectedNodes=function(){
|
---|
3429 | var e=this._getSelection();
|
---|
3430 | if(AjxEnv.isGeckoBased){
|
---|
3431 | e.deleteFromDocument()
|
---|
3432 | }else{
|
---|
3433 | e.clear()
|
---|
3434 | }};
|
---|
3435 | DwtHtmlEditor.prototype._getSelection=function(){
|
---|
3436 | if(AjxEnv.isIE){
|
---|
3437 | return this._getIframeDoc().selection
|
---|
3438 | }else{
|
---|
3439 | return this._getIframeWin().getSelection()
|
---|
3440 | }};
|
---|
3441 | DwtHtmlEditor.prototype.__eventClosure=function(e){
|
---|
3442 | return this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:e)
|
---|
3443 | };
|
---|
3444 | DwtHtmlEditor.prototype._registerEditorEventHandlers=function(e,o){
|
---|
3445 | var a=["mouseup","drag","mousedown","keydown"];
|
---|
3446 | if(!AjxEnv.isIE7up){
|
---|
3447 | a.push("keypress")
|
---|
3448 | }
|
---|
3449 | for(var t=0;
|
---|
3450 | t<a.length;
|
---|
3451 | ++t){
|
---|
3452 | this._registerEditorEventHandler(o,a[t])
|
---|
3453 | }};
|
---|
3454 | DwtHtmlEditor.prototype._registerEditorEventHandler=function(t,e){
|
---|
3455 | if(AjxEnv.isIE){
|
---|
3456 | t.attachEvent("on"+e,this.__eventClosure)
|
---|
3457 | }else{
|
---|
3458 | t.addEventListener(e,this.__eventClosure,true)
|
---|
3459 | }};
|
---|
3460 | DwtHtmlEditor.prototype._unregisterEditorEventHandler=function(t,e){
|
---|
3461 | if(AjxEnv.isIE){
|
---|
3462 | t.detachEvent("on"+e,this.__eventClosure)
|
---|
3463 | }else{
|
---|
3464 | t.removeEventListener(e,this.__eventClosure,true)
|
---|
3465 | }};
|
---|
3466 | DwtHtmlEditor.prototype._handleEditorEvent=function(d){
|
---|
3467 | var i=true;
|
---|
3468 | if(d.type=="mousedown"){
|
---|
3469 | DwtMenu._outsideMouseDownListener(d)
|
---|
3470 | }
|
---|
3471 | if(d.type=="mouseup"){
|
---|
3472 | var t=DwtShell.getShell(window).getKeyboardMgr();
|
---|
3473 | if(AjxEnv.isIE){
|
---|
3474 | t.__focusObj=this
|
---|
3475 | }else{
|
---|
3476 | t.grabFocus(this)
|
---|
3477 | }}
|
---|
3478 | if(d.type=="contextmenu"){
|
---|
3479 | var m=DwtShell.mouseEvent;
|
---|
3480 | m.setFromDhtmlEvent(d);
|
---|
3481 | var c=Dwt.getLocation(document.getElementById(this._iFrameId));
|
---|
3482 | if(!AjxEnv.isIE){
|
---|
3483 | var u=this._getIframeDoc();
|
---|
3484 | var n=u.documentElement.scrollLeft||u.body.scrollLeft;
|
---|
3485 | var p=u.documentElement.scrollTop||u.body.scrollTop;
|
---|
3486 | c.x-=n;
|
---|
3487 | c.y-=p
|
---|
3488 | }
|
---|
3489 | m.docX+=c.x;
|
---|
3490 | m.docY+=c.y;
|
---|
3491 | DwtControl.__mouseEvent(d,DwtEvent.ONCONTEXTMENU,this,m);
|
---|
3492 | i=m._returnValue
|
---|
3493 | }
|
---|
3494 | var o=null;
|
---|
3495 | if(DwtKeyEvent.isKeyPressEvent(d)){
|
---|
3496 | var h=this._keyEvent;
|
---|
3497 | h.setFromDhtmlEvent(d);
|
---|
3498 | if(AjxEnv.isGeckoBased&&d.keyCode==13){
|
---|
3499 | this._stateEvent._ignoreCommandState=true;
|
---|
3500 | var e=this._getRange(),a=e.startContainer,l=/^h[1-6]$/i;
|
---|
3501 | if((a.nodeType==3&&l.test(a.parentNode.tagName))||l.test(a.tagName)){
|
---|
3502 | var f=this;
|
---|
3503 | setTimeout(function(){
|
---|
3504 | var y=f._getIframeDoc();
|
---|
3505 | y.body.style.display="none";
|
---|
3506 | y.body.style.display="";
|
---|
3507 | var g=f._getSelection();
|
---|
3508 | g.removeAllRanges();
|
---|
3509 | g.addRange(e)
|
---|
3510 | }
|
---|
3511 | ,5)
|
---|
3512 | }}}
|
---|
3513 | if(d.type=="keydown"){
|
---|
3514 | if(d.keyCode==9){
|
---|
3515 | if(AjxEnv.isIE){
|
---|
3516 | this._handleIETabKey(!d.shiftKey);
|
---|
3517 | h._stopPropagation=true;
|
---|
3518 | h._returnValue=false;
|
---|
3519 | h.setToDhtmlEvent(d);
|
---|
3520 | i=false
|
---|
3521 | }}else{
|
---|
3522 | if(DwtKeyboardMgr.isPossibleInputShortcut(d)){
|
---|
3523 | i=DwtKeyboardMgr.__keyDownHdlr(d)
|
---|
3524 | }}}
|
---|
3525 | if(AjxEnv.isIE){
|
---|
3526 | var s=this._getIframeDoc();
|
---|
3527 | this._currInsPt=s.selection.createRange();
|
---|
3528 | if(s.selection.type=="None"){
|
---|
3529 | this._currInsPt.collapse(false)
|
---|
3530 | }}
|
---|
3531 | if(this._stateUpdateActionId!=null){
|
---|
3532 | AjxTimedAction.cancelAction(this._stateUpdateActionId)
|
---|
3533 | }
|
---|
3534 | this._stateUpdateActionId=AjxTimedAction.scheduleAction(this._updateStateAction,100);
|
---|
3535 | if(window.DwtIdleTimer){
|
---|
3536 | DwtIdleTimer.resetIdle()
|
---|
3537 | }
|
---|
3538 | return i
|
---|
3539 | };
|
---|
3540 | DwtHtmlEditor.prototype.getKeyMapName=function(){
|
---|
3541 | return"DwtHtmlEditor"
|
---|
3542 | };
|
---|
3543 | DwtHtmlEditor.prototype.handleKeyAction=function(t,a){
|
---|
3544 | var o="",i="";
|
---|
3545 | if(t==DwtKeyMap.SWITCH_MODE){
|
---|
3546 | try{
|
---|
3547 | this.setMode((this._mode==DwtHtmlEditor.HTML)?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML,true)
|
---|
3548 | }
|
---|
3549 | catch(n){}}else{
|
---|
3550 | if(t.indexOf("Header")==0){
|
---|
3551 | o=DwtHtmlEditor._FORMAT_BLOCK;
|
---|
3552 | i=DwtHtmlEditor._ACTION_CODE_TO_CMD[t]
|
---|
3553 | }else{
|
---|
3554 | o=DwtHtmlEditor._ACTION_CODE_TO_CMD[t]
|
---|
3555 | }}
|
---|
3556 | if(o){
|
---|
3557 | this._execCommand(o,i);
|
---|
3558 | return true
|
---|
3559 | }
|
---|
3560 | return false
|
---|
3561 | };
|
---|
3562 | DwtHtmlEditor.prototype._handleIETabKey=function(n){
|
---|
3563 | var l=this._getIframeDoc();
|
---|
3564 | var i=this._getParentElement();
|
---|
3565 | var c=i.parentNode;
|
---|
3566 | var d=i.tagName.toLowerCase();
|
---|
3567 | if(d=="p"||d=="body"){
|
---|
3568 | if(n){
|
---|
3569 | this._insertHTML(" ")
|
---|
3570 | }}else{
|
---|
3571 | if(d=="li"){
|
---|
3572 | this._execCommand((n)?"Indent":"Outdent","")
|
---|
3573 | }else{
|
---|
3574 | try{
|
---|
3575 | var t=this._getAllAncestors();
|
---|
3576 | var s=this._locateNode(t,"td");
|
---|
3577 | if(s!=null){
|
---|
3578 | i=s;
|
---|
3579 | c=i.parentNode;
|
---|
3580 | d=i.tagName.toLowerCase();
|
---|
3581 | if(d=="td"){
|
---|
3582 | var e=(n?i.nextSibling:i.previousSibling);
|
---|
3583 | if(e!=null){
|
---|
3584 | this._setCursor(e)
|
---|
3585 | }else{
|
---|
3586 | e=(n)?c.nextSibling:c.previousSibling;
|
---|
3587 | if(e==null){
|
---|
3588 | if(!n){
|
---|
3589 | return
|
---|
3590 | }
|
---|
3591 | DwtHtmlEditor.table_insertRow(i,n);
|
---|
3592 | e=c.nextSibling
|
---|
3593 | }
|
---|
3594 | if(e!=null){
|
---|
3595 | var o=e.childNodes;
|
---|
3596 | if(o!=null&&o.length>0){
|
---|
3597 | var a=(n)?(0):(o.length-1);
|
---|
3598 | this._setCursor(o[a])
|
---|
3599 | }}}}}}
|
---|
3600 | catch(h){}}}};
|
---|
3601 | DwtHtmlEditor.prototype._setCursor=function(a){
|
---|
3602 | var n=this._getIframeDoc();
|
---|
3603 | var e=n.body;
|
---|
3604 | var t;
|
---|
3605 | if(AjxEnv.isIE){
|
---|
3606 | t=e.createTextRange();
|
---|
3607 | t.moveToElementText(a);
|
---|
3608 | t.collapse(0);
|
---|
3609 | t.select()
|
---|
3610 | }else{
|
---|
3611 | t=n.createRange();
|
---|
3612 | t.selectNodeContents(a);
|
---|
3613 | t.collapse(false);
|
---|
3614 | var o=this._getIframeWin().contentWindow;
|
---|
3615 | var i=o.getSelection();
|
---|
3616 | i.addRange(t);
|
---|
3617 | i.collapseToEnd()
|
---|
3618 | }};
|
---|
3619 | DwtHtmlEditor.prototype._locateNode=function(t,e){
|
---|
3620 | if(t&&e){
|
---|
3621 | for(var a=0;
|
---|
3622 | a<t.length;
|
---|
3623 | a++){
|
---|
3624 | if(t[a].tagName.toLowerCase()==e.toLowerCase()){
|
---|
3625 | return t[a]
|
---|
3626 | }}}
|
---|
3627 | return null
|
---|
3628 | };
|
---|
3629 | DwtHtmlEditor.prototype._getAllAncestors=function(){
|
---|
3630 | var a=this._getParentElement();
|
---|
3631 | var e=[];
|
---|
3632 | while(a&&(a.nodeType==1)&&(a.tagName.toLowerCase()!="body")){
|
---|
3633 | e.push(a);
|
---|
3634 | a=a.parentNode
|
---|
3635 | }
|
---|
3636 | var t=this._getIframeDoc();
|
---|
3637 | if(t.body!=null){
|
---|
3638 | e.push(t.body)
|
---|
3639 | }
|
---|
3640 | return e
|
---|
3641 | };
|
---|
3642 | DwtHtmlEditor.prototype._updateState=function(){
|
---|
3643 | if(this._mode!=DwtHtmlEditor.HTML){
|
---|
3644 | return
|
---|
3645 | }
|
---|
3646 | this._stateUpdateActionId=null;
|
---|
3647 | var a=this._stateEvent;
|
---|
3648 | if(!a._ignoreCommandState){
|
---|
3649 | a.reset()
|
---|
3650 | }
|
---|
3651 | var o=this._getIframeDoc();
|
---|
3652 | try{
|
---|
3653 | if(!a._ignoreCommandState){
|
---|
3654 | a.isBold=o.queryCommandState(DwtHtmlEditor.BOLD_STYLE);
|
---|
3655 | a.isItalic=o.queryCommandState(DwtHtmlEditor.ITALIC_STYLE);
|
---|
3656 | a.isUnderline=o.queryCommandState(DwtHtmlEditor.UNDERLINE_STYLE);
|
---|
3657 | a.isStrikeThru=o.queryCommandState(DwtHtmlEditor.STRIKETHRU_STYLE);
|
---|
3658 | a.isSuperscript=o.queryCommandState(DwtHtmlEditor.SUPERSCRIPT_STYLE);
|
---|
3659 | a.isSubscript=o.queryCommandState(DwtHtmlEditor.SUBSCRIPT_STYLE);
|
---|
3660 | a.isOrderedList=o.queryCommandState(DwtHtmlEditor.ORDERED_LIST);
|
---|
3661 | a.isUnorderedList=o.queryCommandState(DwtHtmlEditor.UNORDERED_LIST)
|
---|
3662 | }else{
|
---|
3663 | a._ignoreCommandState=null
|
---|
3664 | }
|
---|
3665 | a.fontFamily=o.queryCommandValue(DwtHtmlEditor._FONT_NAME);
|
---|
3666 | var i=o.queryCommandValue(DwtHtmlEditor._FONT_SIZE);
|
---|
3667 | if(i==""){
|
---|
3668 | i=(DwtHtmlEditor.FONT_SIZE_VALUES.indexOf(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE))+1)
|
---|
3669 | }else{
|
---|
3670 | if(/\d+px/.test(i)){
|
---|
3671 | i=Math.ceil(0.75*parseInt(i))+"pt"
|
---|
3672 | }}
|
---|
3673 | if(/\d+pt/.test(i)){
|
---|
3674 | i=(DwtHtmlEditor.FONT_SIZE_VALUES.indexOf(i)+1)
|
---|
3675 | }
|
---|
3676 | a.fontSize=i;
|
---|
3677 | a.backgroundColor=o.queryCommandValue((AjxEnv.isIE)?"backcolor":"hilitecolor");
|
---|
3678 | a.color=o.queryCommandValue("forecolor");
|
---|
3679 | if(AjxEnv.isIE){
|
---|
3680 | a.backgroundColor="#"+DwtButtonColorPicker.toHex(a.backgroundColor,6).replace(/(..)(..)(..)/,"$3$2$1");
|
---|
3681 | a.color="#"+DwtButtonColorPicker.toHex(a.color,6).replace(/(..)(..)(..)/,"$3$2$1")
|
---|
3682 | }
|
---|
3683 | a.justification=null;
|
---|
3684 | a.direction=null;
|
---|
3685 | var t=o.queryCommandValue(DwtHtmlEditor._FORMAT_BLOCK);
|
---|
3686 | if(t){
|
---|
3687 | if(t.search(DwtHtmlEditor._H1_RE)!=-1){
|
---|
3688 | a.style=DwtHtmlEditor.H1
|
---|
3689 | }else{
|
---|
3690 | if(t.search(DwtHtmlEditor._H2_RE)!=-1){
|
---|
3691 | a.style=DwtHtmlEditor.H2
|
---|
3692 | }else{
|
---|
3693 | if(t.search(DwtHtmlEditor._H3_RE)!=-1){
|
---|
3694 | a.style=DwtHtmlEditor.H3
|
---|
3695 | }else{
|
---|
3696 | if(t.search(DwtHtmlEditor._H4_RE)!=-1){
|
---|
3697 | a.style=DwtHtmlEditor.H4
|
---|
3698 | }else{
|
---|
3699 | if(t.search(DwtHtmlEditor._H5_RE)!=-1){
|
---|
3700 | a.style=DwtHtmlEditor.H5
|
---|
3701 | }else{
|
---|
3702 | if(t.search(DwtHtmlEditor._H6_RE)!=-1){
|
---|
3703 | a.style=DwtHtmlEditor.H6
|
---|
3704 | }else{
|
---|
3705 | if(t.search(DwtHtmlEditor._PARAGRAPH_RE)!=-1){
|
---|
3706 | a.style=DwtHtmlEditor.PARAGRAPH
|
---|
3707 | }else{
|
---|
3708 | if(t.search(DwtHtmlEditor._ADDRESS_RE)!=-1){
|
---|
3709 | a.style=DwtHtmlEditor.ADDRESS
|
---|
3710 | }else{
|
---|
3711 | if(t.search(DwtHtmlEditor._PREFORMATTED_RE)!=-1){
|
---|
3712 | a.style=DwtHtmlEditor.PREFORMATTED
|
---|
3713 | }}}}}}}}}}
|
---|
3714 | if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_LEFT)){
|
---|
3715 | a.justification=DwtHtmlEditor.JUSTIFY_LEFT
|
---|
3716 | }else{
|
---|
3717 | if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_CENTER)){
|
---|
3718 | a.justification=DwtHtmlEditor.JUSTIFY_CENTER
|
---|
3719 | }else{
|
---|
3720 | if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_RIGHT)){
|
---|
3721 | a.justification=DwtHtmlEditor.JUSTIFY_RIGHT
|
---|
3722 | }else{
|
---|
3723 | if(o.queryCommandState(DwtHtmlEditor.JUSTIFY_FULL)){
|
---|
3724 | a.justification=DwtHtmlEditor.JUSTIFY_FULL
|
---|
3725 | }}}}
|
---|
3726 | if(this.isListenerRegistered(DwtEvent.STATE_CHANGE)){
|
---|
3727 | this.notifyListeners(DwtEvent.STATE_CHANGE,a)
|
---|
3728 | }}
|
---|
3729 | catch(e){
|
---|
3730 | if(AjxEnv.isGeckoBased){
|
---|
3731 | this._enableDesignMode(o)
|
---|
3732 | }}};
|
---|
3733 | DwtHtmlEditor.prototype._enableDesignMode=function(a){
|
---|
3734 | if(!a){
|
---|
3735 | return
|
---|
3736 | }
|
---|
3737 | try{
|
---|
3738 | Dwt.enableDesignMode(a,true);
|
---|
3739 | if(AjxEnv.isGeckoBased&&(AjxEnv.isLinux||AjxEnv.isMac)){
|
---|
3740 | this._registerEditorEventHandlers(document.getElementById(this._iFrameId),a)
|
---|
3741 | }}
|
---|
3742 | catch(t){
|
---|
3743 | if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
|
---|
3744 | var e=new AjxTimedAction(this,this._enableDesignMode,[a]);
|
---|
3745 | AjxTimedAction.scheduleAction(e,10);
|
---|
3746 | return true
|
---|
3747 | }else{
|
---|
3748 | return false
|
---|
3749 | }}};
|
---|
3750 | DwtHtmlEditor.prototype._onContentInitialized=function(){
|
---|
3751 | this._pendingContent=null
|
---|
3752 | };
|
---|
3753 | DwtHtmlEditor.prototype._setContentOnTimer=function(){
|
---|
3754 | var a=this._getIframeDoc();
|
---|
3755 | try{
|
---|
3756 | if(this._pendingContent!=null){
|
---|
3757 | a.body.innerHTML=this._pendingContent
|
---|
3758 | }
|
---|
3759 | if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
|
---|
3760 | this._enableDesignMode(a)
|
---|
3761 | }
|
---|
3762 | this._onContentInitialized()
|
---|
3763 | }
|
---|
3764 | catch(t){
|
---|
3765 | var e=new AjxTimedAction(this,this._setContentOnTimer);
|
---|
3766 | AjxTimedAction.scheduleAction(e,10);
|
---|
3767 | return true
|
---|
3768 | }};
|
---|
3769 | DwtHtmlEditor.prototype._execCommand=function(i,t){
|
---|
3770 | if(this._mode!=DwtHtmlEditor.HTML){
|
---|
3771 | return
|
---|
3772 | }
|
---|
3773 | try{
|
---|
3774 | this.focus();
|
---|
3775 | this._getIframeDoc().execCommand(i,false,t)
|
---|
3776 | }
|
---|
3777 | catch(a){
|
---|
3778 | this._enableDesignMode(this._getIframeDoc())
|
---|
3779 | }
|
---|
3780 | this._updateState()
|
---|
3781 | };
|
---|
3782 | DwtHtmlEditor.prototype._convertHtml2Text=function(e){
|
---|
3783 | var t=this._getIframeDoc();
|
---|
3784 | return(t&&t.body)?AjxStringUtil.convertHtml2Text(t.body,e):""
|
---|
3785 | };
|
---|
3786 | DwtHtmlEditor.prototype.insertLink=function(o){
|
---|
3787 | var d=this._getIframeDoc();
|
---|
3788 | var h=(AjxEnv.isIE&&d&&d.body)?(d.body.innerHTML):"";
|
---|
3789 | if(AjxEnv.isIE&&h==""){
|
---|
3790 | var c=d.createElement("a");
|
---|
3791 | c.href=o.url;
|
---|
3792 | if(o.title){
|
---|
3793 | c.title=o.title
|
---|
3794 | }
|
---|
3795 | var s=d.createTextNode(o.text);
|
---|
3796 | c.appendChild(s);
|
---|
3797 | d.body.appendChild(c);
|
---|
3798 | return c
|
---|
3799 | }else{
|
---|
3800 | var e="javascript:"+Dwt.getNextId();
|
---|
3801 | if(AjxEnv.isIE){
|
---|
3802 | var t=this._getIframeDoc().createElement("a");
|
---|
3803 | t.href=e;
|
---|
3804 | if(o.text){
|
---|
3805 | t.innerHTML=o.text
|
---|
3806 | }
|
---|
3807 | this._insertNodeAtSelection(t,false);
|
---|
3808 | this.selectNodeContents(t)
|
---|
3809 | }else{
|
---|
3810 | if(o.text){
|
---|
3811 | this.insertText(o.text,true)
|
---|
3812 | }
|
---|
3813 | this._execCommand("createlink",e)
|
---|
3814 | }
|
---|
3815 | var c=d.getElementsByTagName("a");
|
---|
3816 | var l;
|
---|
3817 | for(var n=c.length;
|
---|
3818 | --n>=0;
|
---|
3819 | ){
|
---|
3820 | if(c[n].href==e){
|
---|
3821 | l=c[n];
|
---|
3822 | break
|
---|
3823 | }}
|
---|
3824 | if(l){
|
---|
3825 | l.href=o.url;
|
---|
3826 | if(o.title){
|
---|
3827 | l.title=o.title
|
---|
3828 | }}
|
---|
3829 | return l
|
---|
3830 | }};
|
---|
3831 | DwtHtmlEditor.prototype.getLinkProps=function(){
|
---|
3832 | var e=this.getNearestElement("a");
|
---|
3833 | if(e){
|
---|
3834 | this.selectNodeContents(e)
|
---|
3835 | }
|
---|
3836 | var t=this._getRange();
|
---|
3837 | var i={
|
---|
3838 | text:AjxEnv.isIE?t.text:t.toString()};
|
---|
3839 | if(e){
|
---|
3840 | i.url=e.href;
|
---|
3841 | i.title=e.title
|
---|
3842 | }
|
---|
3843 | return i
|
---|
3844 | };
|
---|
3845 | DwtHtmlEditor.table_analyzeCells=function(c){
|
---|
3846 | var d=c.parentNode.parentNode;
|
---|
3847 | while(d&&!/table/i.test(d.tagName)){
|
---|
3848 | d=d.parentNode
|
---|
3849 | }
|
---|
3850 | var l={};
|
---|
3851 | var m=d.rows;
|
---|
3852 | for(var n=0;
|
---|
3853 | n<m.length;
|
---|
3854 | ++n){
|
---|
3855 | var u=m[n].cells;
|
---|
3856 | var h=0;
|
---|
3857 | for(var a=0;
|
---|
3858 | a<u.length;
|
---|
3859 | ){
|
---|
3860 | var e=u[a];
|
---|
3861 | var s=e.colSpan||1;
|
---|
3862 | var t=(e.rowSpan||1)-1;
|
---|
3863 | var o=l[h];
|
---|
3864 | if(o){
|
---|
3865 | if(--o.rs==0){
|
---|
3866 | l[h]=null
|
---|
3867 | }
|
---|
3868 | h+=o.cs
|
---|
3869 | }
|
---|
3870 | e.ZmIndex=h;
|
---|
3871 | if(++a<u.length){
|
---|
3872 | if(t){
|
---|
3873 | l[h]={
|
---|
3874 | cs:s,rs:t}
|
---|
3875 | }
|
---|
3876 | h+=s
|
---|
3877 | }}}
|
---|
3878 | return d
|
---|
3879 | };
|
---|
3880 | DwtHtmlEditor.table_getCellAt=function(h,s){
|
---|
3881 | var c=h.cells;
|
---|
3882 | var l=null,o=null;
|
---|
3883 | for(var a=0;
|
---|
3884 | a<c.length;
|
---|
3885 | ++a){
|
---|
3886 | var e=c[a];
|
---|
3887 | var n=(e.colSpan||1)-1;
|
---|
3888 | if(e.ZmIndex<=s&&e.ZmIndex+n>=s){
|
---|
3889 | var t=(e.rowSpan||1)-1;
|
---|
3890 | return{
|
---|
3891 | td:e,cs:n,rs:t}
|
---|
3892 | }else{
|
---|
3893 | if(e.ZmIndex<s){
|
---|
3894 | l=e
|
---|
3895 | }else{
|
---|
3896 | if(e.ZmIndex+n>s&&!o){
|
---|
3897 | o=e
|
---|
3898 | }}}}
|
---|
3899 | return{
|
---|
3900 | last:l,next:o}
|
---|
3901 | };
|
---|
3902 | DwtHtmlEditor.table_getPrevCellAt=function(n,e){
|
---|
3903 | var a=n.parentNode;
|
---|
3904 | while(a&&!/table/i.test(a.tagName)){
|
---|
3905 | a=a.parentNode
|
---|
3906 | }
|
---|
3907 | var o=a.rows;
|
---|
3908 | for(var t=n.rowIndex;
|
---|
3909 | --t>=0;
|
---|
3910 | ){
|
---|
3911 | var s=DwtHtmlEditor.table_getCellAt(o[t],e);
|
---|
3912 | if(s.td){
|
---|
3913 | s.dist=n.rowIndex-t;
|
---|
3914 | return s
|
---|
3915 | }}
|
---|
3916 | return null
|
---|
3917 | };
|
---|
3918 | DwtHtmlEditor.table_fixCells=function(e){
|
---|
3919 | for(var t=0;
|
---|
3920 | t<e.length;
|
---|
3921 | ++t){
|
---|
3922 | var a=e[t];
|
---|
3923 | if(AjxEnv.isIE){
|
---|
3924 | a.innerHTML=" "
|
---|
3925 | }else{
|
---|
3926 | if(AjxEnv.isGeckoBased){
|
---|
3927 | a.innerHTML="<br/>"
|
---|
3928 | }}}};
|
---|
3929 | DwtHtmlEditor.table_insertCol=function(n,t){
|
---|
3930 | var u=DwtHtmlEditor.table_analyzeCells(n);
|
---|
3931 | var m=u.rows;
|
---|
3932 | var c=n.ZmIndex;
|
---|
3933 | if(t){
|
---|
3934 | c+=n.colSpan-1
|
---|
3935 | }
|
---|
3936 | var l=[];
|
---|
3937 | var s=0;
|
---|
3938 | for(var h=0;
|
---|
3939 | h<m.length;
|
---|
3940 | ++h){
|
---|
3941 | var d=m[h];
|
---|
3942 | var a=DwtHtmlEditor.table_getCellAt(d,c);
|
---|
3943 | var o=a.td;
|
---|
3944 | var e=null;
|
---|
3945 | if(o){
|
---|
3946 | if(o.ZmIndex==c&&!t){
|
---|
3947 | e=d.insertCell(o.cellIndex)
|
---|
3948 | }else{
|
---|
3949 | if(o.ZmIndex+a.cs==c&&t){
|
---|
3950 | e=d.insertCell(o.cellIndex+1)
|
---|
3951 | }}
|
---|
3952 | if(e){
|
---|
3953 | s=a.rs
|
---|
3954 | }else{
|
---|
3955 | o.colSpan=a.cs+2
|
---|
3956 | }}else{
|
---|
3957 | if(s>0){
|
---|
3958 | if(a.last){
|
---|
3959 | e=d.insertCell(a.last.cellIndex+1)
|
---|
3960 | }else{
|
---|
3961 | if(a.next){
|
---|
3962 | e=d.insertCell(a.next.cellIndex)
|
---|
3963 | }}
|
---|
3964 | --s
|
---|
3965 | }}
|
---|
3966 | if(e){
|
---|
3967 | l.push(e)
|
---|
3968 | }}
|
---|
3969 | return l
|
---|
3970 | };
|
---|
3971 | DwtHtmlEditor.table_insertRow=function(o,t){
|
---|
3972 | var c=o.parentNode;
|
---|
3973 | var f=DwtHtmlEditor.table_analyzeCells(o);
|
---|
3974 | var l=c.rowIndex;
|
---|
3975 | if(t){
|
---|
3976 | l+=o.rowSpan;
|
---|
3977 | c=f.rows[l-1]
|
---|
3978 | }
|
---|
3979 | o=f.rows[0].cells[f.rows[0].cells.length-1];
|
---|
3980 | var d=o.ZmIndex+o.colSpan;
|
---|
3981 | var u=f.insertRow(l);
|
---|
3982 | var h=[];
|
---|
3983 | var m=c.cells;
|
---|
3984 | var e;
|
---|
3985 | for(var s=0;
|
---|
3986 | s<d;
|
---|
3987 | ++s){
|
---|
3988 | var a=DwtHtmlEditor.table_getCellAt(c,s);
|
---|
3989 | if(a.td){
|
---|
3990 | if(!t||!a.rs){
|
---|
3991 | for(var n=0;
|
---|
3992 | n<=a.cs;
|
---|
3993 | ++n){
|
---|
3994 | h.push(u.insertCell(-1))
|
---|
3995 | }}else{
|
---|
3996 | if(a.rs){
|
---|
3997 | a.td.rowSpan=a.rs+2
|
---|
3998 | }}}else{
|
---|
3999 | a=DwtHtmlEditor.table_getPrevCellAt(c,s);
|
---|
4000 | if(t&&a.rs==a.dist){
|
---|
4001 | for(var n=0;
|
---|
4002 | n<=a.cs;
|
---|
4003 | ++n){
|
---|
4004 | h.push(u.insertCell(-1))
|
---|
4005 | }}else{
|
---|
4006 | a.td.rowSpan=a.rs+2
|
---|
4007 | }}
|
---|
4008 | s+=a.cs
|
---|
4009 | }
|
---|
4010 | return h
|
---|
4011 | };
|
---|
4012 | DwtHtmlEditor.table_deleteCol=function(a){
|
---|
4013 | if(!a){
|
---|
4014 | return
|
---|
4015 | }
|
---|
4016 | var c=DwtHtmlEditor.table_analyzeCells(a);
|
---|
4017 | var d=c.rows;
|
---|
4018 | var n=a.ZmIndex;
|
---|
4019 | var l=a.parentNode;
|
---|
4020 | var s;
|
---|
4021 | try{
|
---|
4022 | s=l.cells[a.cellIndex+1];
|
---|
4023 | if(!s){
|
---|
4024 | s=l.cells[a.cellIndex-1]
|
---|
4025 | }}
|
---|
4026 | catch(h){
|
---|
4027 | s=null
|
---|
4028 | }
|
---|
4029 | var e=[];
|
---|
4030 | for(var o=0;
|
---|
4031 | o<d.length;
|
---|
4032 | ++o){
|
---|
4033 | var l=d[o];
|
---|
4034 | var t=DwtHtmlEditor.table_getCellAt(l,n);
|
---|
4035 | if(t.td){
|
---|
4036 | if(t.cs){
|
---|
4037 | t.td.colSpan=t.cs
|
---|
4038 | }else{
|
---|
4039 | l.removeChild(t.td);
|
---|
4040 | if(l.cells.length==0){
|
---|
4041 | e.push(l)
|
---|
4042 | }}
|
---|
4043 | o+=t.rs
|
---|
4044 | }}
|
---|
4045 | for(var o=e.length;
|
---|
4046 | --o>=0;
|
---|
4047 | ){
|
---|
4048 | l=e[o];
|
---|
4049 | l.parentNode.removeChild(l)
|
---|
4050 | }
|
---|
4051 | if(c.rows.length==0){
|
---|
4052 | c.parentNode.removeChild(c)
|
---|
4053 | }
|
---|
4054 | return s
|
---|
4055 | };
|
---|
4056 | DwtHtmlEditor.table_deleteRow=function(t){
|
---|
4057 | if(!t){
|
---|
4058 | return
|
---|
4059 | }
|
---|
4060 | var s=t.parentNode;
|
---|
4061 | var c=DwtHtmlEditor.table_analyzeCells(t);
|
---|
4062 | t=c.rows[0].cells[c.rows[0].cells.length-1];
|
---|
4063 | var h=t.ZmIndex+t.colSpan;
|
---|
4064 | var l;
|
---|
4065 | for(var a=h;
|
---|
4066 | --a>=0;
|
---|
4067 | ){
|
---|
4068 | var e=DwtHtmlEditor.table_getCellAt(s,a);
|
---|
4069 | if(e.td){
|
---|
4070 | if(e.rs){
|
---|
4071 | l=c.rows[s.rowIndex+1];
|
---|
4072 | var o=DwtHtmlEditor.table_getCellAt(l,a);
|
---|
4073 | t=null;
|
---|
4074 | if(o.last){
|
---|
4075 | t=l.insertCell(o.last.cellIndex+1)
|
---|
4076 | }else{
|
---|
4077 | if(o.next){
|
---|
4078 | t=l.insertCell(o.next.cellIndex)
|
---|
4079 | }}
|
---|
4080 | if(t){
|
---|
4081 | if(e.cs>0){
|
---|
4082 | t.colSpan=e.cs+1
|
---|
4083 | }
|
---|
4084 | if(e.rs>1){
|
---|
4085 | t.rowSpan=e.rs
|
---|
4086 | }}}
|
---|
4087 | s.removeChild(e.td)
|
---|
4088 | }else{
|
---|
4089 | e=DwtHtmlEditor.table_getPrevCellAt(s,a);
|
---|
4090 | if(e){
|
---|
4091 | if(e.rs){
|
---|
4092 | e.td.rowSpan=e.rs;
|
---|
4093 | a-=e.cs
|
---|
4094 | }}}}
|
---|
4095 | try{
|
---|
4096 | l=c.rows[s.rowIndex+1];
|
---|
4097 | if(!l){
|
---|
4098 | l=c.rows[s.rowIndex-1]
|
---|
4099 | }}
|
---|
4100 | catch(n){
|
---|
4101 | l=null
|
---|
4102 | }
|
---|
4103 | s.parentNode.removeChild(s);
|
---|
4104 | if(c.rows.length==0){
|
---|
4105 | c.parentNode.removeChild(c)
|
---|
4106 | }
|
---|
4107 | if(l){
|
---|
4108 | return l.cells[0]
|
---|
4109 | }};
|
---|
4110 | DwtHtmlEditor.prototype.searchnReplace=function(a){
|
---|
4111 | var o=this._getIframeWin();
|
---|
4112 | o.focus();
|
---|
4113 | var h=this._getIframeDoc();
|
---|
4114 | var i=h.body;
|
---|
4115 | var n=this._getSelectedText();
|
---|
4116 | if(i.innerHTML==""){
|
---|
4117 | return true
|
---|
4118 | }
|
---|
4119 | str1=a.searchstring;
|
---|
4120 | str2=n;
|
---|
4121 | if(a.replacemode=="current"){
|
---|
4122 | str1=str1.toString();
|
---|
4123 | str2=str2.toString();
|
---|
4124 | if(!a.casesensitive){
|
---|
4125 | str1=str1.toLowerCase();
|
---|
4126 | str2=str2.toLowerCase()
|
---|
4127 | }
|
---|
4128 | if(str1==str2){
|
---|
4129 | this.replaceSel(a.searchstring,a.replacestring);
|
---|
4130 | a.replacemode="none"
|
---|
4131 | }}
|
---|
4132 | if(AjxEnv.isIE){
|
---|
4133 | var e=this.lastSearchRng?this.lastSearchRng:this.range_findnreplace;
|
---|
4134 | var t=0;
|
---|
4135 | if(a.wholeword){
|
---|
4136 | t=t|2
|
---|
4137 | }
|
---|
4138 | if(a.casesensitive){
|
---|
4139 | t=t|4
|
---|
4140 | }
|
---|
4141 | if(!e.findText){
|
---|
4142 | alert("This operation is currently not supported by this browser.");
|
---|
4143 | return true
|
---|
4144 | }
|
---|
4145 | if(a.replacemode=="all"){
|
---|
4146 | if(AjxEnv.isIE){
|
---|
4147 | this.focus()
|
---|
4148 | }
|
---|
4149 | var s=new RegExp(a.searchstring,((a.casesensitive)?"":"i")+"g");
|
---|
4150 | var l=this.replaceNodeContent(i,s,a.replacestring,"all",0);
|
---|
4151 | return true
|
---|
4152 | }
|
---|
4153 | if(e.findText(a.searchstring,a.backwards?-1:1,t)){
|
---|
4154 | e.scrollIntoView();
|
---|
4155 | e.select();
|
---|
4156 | e.collapse(a.backwards);
|
---|
4157 | this.lastSearchRng=e;
|
---|
4158 | if(AjxEnv.isIE&&(a.replacemode=="current")){
|
---|
4159 | this.replaceSel(a.searchstring,a.replacestring)
|
---|
4160 | }}else{
|
---|
4161 | rng1=i.createTextRange();
|
---|
4162 | rng1.findText(a.searchstring,a.backwards?-1:1,t);
|
---|
4163 | rng1.scrollIntoView();
|
---|
4164 | if(rng1.text.toLowerCase()==a.searchstring.toLowerCase()){
|
---|
4165 | rng1.select()
|
---|
4166 | }
|
---|
4167 | rng1.collapse(false);
|
---|
4168 | this.lastSearchRng=rng1;
|
---|
4169 | if(AjxEnv.isIE&&(a.replacemode=="current")){
|
---|
4170 | this.replaceSel(a.searchstring,a.replacestring)
|
---|
4171 | }}}else{
|
---|
4172 | if(a.replacemode=="all"){
|
---|
4173 | var s=new RegExp(a.searchstring,(a.casesensitive?"":"i")+"g");
|
---|
4174 | var l=this.replaceNodeContent(i,s,a.replacestring,"all",0);
|
---|
4175 | return true
|
---|
4176 | }
|
---|
4177 | if(!o.find(a.searchstring,a.casesensitive,a.backwards,a.wrap,a.wholeword,false,false)){
|
---|
4178 | while(o.find(a.searchstring,a.casesensitive,true,a.wrap,a.wholeword,false,false)){}}}};
|
---|
4179 | DwtHtmlEditor.prototype.replaceSel=function(e,n){
|
---|
4180 | if(n==null){
|
---|
4181 | return
|
---|
4182 | }
|
---|
4183 | var o=this._getIframeWin();
|
---|
4184 | var i=o.document;
|
---|
4185 | var t;
|
---|
4186 | if(!AjxEnv.isIE){
|
---|
4187 | var a=o.getSelection();
|
---|
4188 | t=a.getRangeAt(0)
|
---|
4189 | }else{
|
---|
4190 | t=o.document.selection.createRange()
|
---|
4191 | }
|
---|
4192 | if(!AjxEnv.isIE){
|
---|
4193 | if(n.indexOf(e)==-1){
|
---|
4194 | t.deleteContents();
|
---|
4195 | t.insertNode(t.createContextualFragment(n));
|
---|
4196 | t.collapse(false)
|
---|
4197 | }}else{
|
---|
4198 | if(t.item){
|
---|
4199 | t.item(0).outerHTML=n
|
---|
4200 | }else{
|
---|
4201 | t.pasteHTML(n)
|
---|
4202 | }}};
|
---|
4203 | DwtHtmlEditor.prototype._getSelectedText=function(){
|
---|
4204 | var a=this._getIframeWin();
|
---|
4205 | var t=this._getIframeDoc();
|
---|
4206 | var e="";
|
---|
4207 | if(a.getSelection){
|
---|
4208 | e=a.getSelection()
|
---|
4209 | }else{
|
---|
4210 | if(t.getSelection){
|
---|
4211 | e=t.getSelection()
|
---|
4212 | }else{
|
---|
4213 | if(t.selection){
|
---|
4214 | e=t.selection.createRange().text
|
---|
4215 | }}}
|
---|
4216 | return e
|
---|
4217 | };
|
---|
4218 | DwtHtmlEditor.prototype.replaceNodeContent=function(a,h,o,l,t){
|
---|
4219 | for(var n=0;
|
---|
4220 | n<a.childNodes.length;
|
---|
4221 | n++){
|
---|
4222 | var s=a.childNodes[n];
|
---|
4223 | if(s.nodeType==3){
|
---|
4224 | var e=s.nodeValue.replace(h,o);
|
---|
4225 | if(s.nodeValue!=e){
|
---|
4226 | s.nodeValue=e;
|
---|
4227 | t++;
|
---|
4228 | if(l!="all"){
|
---|
4229 | return t
|
---|
4230 | }}}
|
---|
4231 | this.replaceNodeContent(s,h,o,l,t);
|
---|
4232 | if((l!="all")&&(t>0)){
|
---|
4233 | return t
|
---|
4234 | }}
|
---|
4235 | return t
|
---|
4236 | }
|
---|
4237 | }
|
---|
4238 | if(AjxPackage.define("ajax.dwt.widgets.DwtPasswordField")){
|
---|
4239 | DwtPasswordField=function(e){
|
---|
4240 | if(arguments.length==0){
|
---|
4241 | return
|
---|
4242 | }
|
---|
4243 | e=e||{
|
---|
4244 | parent:DwtShell.getShell(window)};
|
---|
4245 | e.type=DwtInputField.PASSWORD;
|
---|
4246 | DwtInputField.call(this,e);
|
---|
4247 | this._tabGroup=new DwtTabGroup(this._htmlElId);
|
---|
4248 | this._createHtml()
|
---|
4249 | };
|
---|
4250 | DwtPasswordField.prototype=new DwtInputField;
|
---|
4251 | DwtPasswordField.prototype.constructor=DwtPasswordField;
|
---|
4252 | DwtPasswordField.prototype.TEMPLATE="dwt.Widgets#DwtPasswordField";
|
---|
4253 | DwtPasswordField.prototype.getTabGroupMember=function(){
|
---|
4254 | return this._tabGroup
|
---|
4255 | };
|
---|
4256 | DwtPasswordField.prototype.setShowPassword=function(e){
|
---|
4257 | this._showCheckbox.setSelected(e);
|
---|
4258 | this.setInputType(e?DwtInputField.STRING:DwtInputField.PASSWORD)
|
---|
4259 | };
|
---|
4260 | DwtPasswordField.prototype._createHtml=function(e){
|
---|
4261 | var t={
|
---|
4262 | id:this._htmlElId};
|
---|
4263 | this._createHtmlFromTemplate(e||this.TEMPLATE,t)
|
---|
4264 | };
|
---|
4265 | DwtPasswordField.prototype._createHtmlFromTemplate=function(a,o){
|
---|
4266 | this._tabGroup.removeAllMembers();
|
---|
4267 | var e=document.createDocumentFragment();
|
---|
4268 | var s=this.getHtmlElement().firstChild;
|
---|
4269 | while(s){
|
---|
4270 | var i=s.nextSibling;
|
---|
4271 | e.appendChild(s);
|
---|
4272 | s=i
|
---|
4273 | }
|
---|
4274 | DwtInputField.prototype._createHtmlFromTemplate.apply(this,arguments);
|
---|
4275 | var n=document.getElementById(o.id+"_input");
|
---|
4276 | n.appendChild(e);
|
---|
4277 | this._tabGroup.addMember(this.getInputElement());
|
---|
4278 | var t=document.getElementById(o.id+"_show_password");
|
---|
4279 | if(t){
|
---|
4280 | this._showCheckbox=new DwtCheckbox({
|
---|
4281 | parent:this}
|
---|
4282 | );
|
---|
4283 | this._showCheckbox.setText(AjxMsg.showPassword);
|
---|
4284 | this._showCheckbox.addSelectionListener(new AjxListener(this,this._handleShowCheckbox));
|
---|
4285 | this._showCheckbox.replaceElement(t);
|
---|
4286 | this._tabGroup.addMember(this._showCheckbox)
|
---|
4287 | }};
|
---|
4288 | DwtPasswordField.prototype._handleShowCheckbox=function(e){
|
---|
4289 | this.setShowPassword(e.detail)
|
---|
4290 | }
|
---|
4291 | }
|
---|
4292 | if(AjxPackage.define("ajax.dwt.widgets.DwtCalendar")){
|
---|
4293 | DwtCalendar=function(e){
|
---|
4294 | if(arguments.length==0){
|
---|
4295 | return
|
---|
4296 | }
|
---|
4297 | e=Dwt.getParams(arguments,DwtCalendar.PARAMS);
|
---|
4298 | e.className=e.className||"DwtCalendar";
|
---|
4299 | DwtComposite.call(this,e);
|
---|
4300 | this._skipNotifyOnPage=false;
|
---|
4301 | this._hidePrevNextMo=e.hidePrevNextMo;
|
---|
4302 | this._readOnly=e.readOnly;
|
---|
4303 | this._showWeekNumber=e.showWeekNumber;
|
---|
4304 | this._uuid=Dwt.getNextId();
|
---|
4305 | var t=this._origDayClassName=e.className+"Day";
|
---|
4306 | this._todayClassName=" "+e.className+"Day-today";
|
---|
4307 | this._selectedDayClassName=" "+t+"-"+DwtCssStyle.SELECTED;
|
---|
4308 | this._hoveredDayClassName=" "+t+"-"+DwtCssStyle.HOVER;
|
---|
4309 | this._activeDayClassName=" "+t+"-"+DwtCssStyle.ACTIVE;
|
---|
4310 | this._hiliteClassName=" "+t+"-hilited";
|
---|
4311 | this._greyClassName=" "+t+"-grey";
|
---|
4312 | if(!this._readOnly){
|
---|
4313 | this._installListeners()
|
---|
4314 | }
|
---|
4315 | this._selectionMode=DwtCalendar.DAY;
|
---|
4316 | this._init();
|
---|
4317 | this._weekDays=new Array(7);
|
---|
4318 | this._workingDays=e.workingDays||DwtCalendar._DEF_WORKING_DAYS;
|
---|
4319 | this._useISO8601WeekNo=e.useISO8601WeekNo;
|
---|
4320 | this.setFirstDayOfWeek(e.firstDayOfWeek||DwtCalendar.SUN);
|
---|
4321 | this._forceRollOver=(e.forceRollOver!==false)
|
---|
4322 | };
|
---|
4323 | DwtCalendar.PARAMS=["parent","className","posStyle","firstDayOfWeek","forceRollOver","workingDaysArray","hidePrevNextMo","readOnly"];
|
---|
4324 | DwtCalendar.prototype=new DwtComposite;
|
---|
4325 | DwtCalendar.prototype.constructor=DwtCalendar;
|
---|
4326 | DwtCalendar.SUN=0;
|
---|
4327 | DwtCalendar.MON=1;
|
---|
4328 | DwtCalendar.TUE=2;
|
---|
4329 | DwtCalendar.WED=3;
|
---|
4330 | DwtCalendar.THU=4;
|
---|
4331 | DwtCalendar.FRI=5;
|
---|
4332 | DwtCalendar.SAT=6;
|
---|
4333 | DwtCalendar.DAY=1;
|
---|
4334 | DwtCalendar.WEEK=2;
|
---|
4335 | DwtCalendar.WORK_WEEK=3;
|
---|
4336 | DwtCalendar.MONTH=4;
|
---|
4337 | DwtCalendar.RANGE_CHANGE="DwtCalendar.RANGE_CHANGE";
|
---|
4338 | DwtCalendar._FULL_WEEK=[1,1,1,1,1,1,1];
|
---|
4339 | DwtCalendar._DEF_WORKING_DAYS=[0,1,1,1,1,1,0];
|
---|
4340 | DwtCalendar._DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];
|
---|
4341 | DwtCalendar._NO_MONTH=-2;
|
---|
4342 | DwtCalendar._PREV_MONTH=-1;
|
---|
4343 | DwtCalendar._THIS_MONTH=0;
|
---|
4344 | DwtCalendar._NEXT_MONTH=1;
|
---|
4345 | DwtCalendar._NORMAL=1;
|
---|
4346 | DwtCalendar._HOVERED=2;
|
---|
4347 | DwtCalendar._ACTIVE=3;
|
---|
4348 | DwtCalendar._SELECTED=4;
|
---|
4349 | DwtCalendar._DESELECTED=5;
|
---|
4350 | DwtCalendar.DATE_SELECTED=1;
|
---|
4351 | DwtCalendar.DATE_DESELECTED=2;
|
---|
4352 | DwtCalendar.DATE_DBL_CLICKED=3;
|
---|
4353 | DwtCalendar._LAST_DAY_CELL_IDX=41;
|
---|
4354 | DwtCalendar._BUTTON_CLASS="DwtCalendarButton";
|
---|
4355 | DwtCalendar._BUTTON_HOVERED_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.HOVER;
|
---|
4356 | DwtCalendar._BUTTON_ACTIVE_CLASS=DwtCalendar._BUTTON_CLASS+"-"+DwtCssStyle.ACTIVE;
|
---|
4357 | DwtCalendar._TITLE_CLASS="DwtCalendarTitle";
|
---|
4358 | DwtCalendar._TITLE_HOVERED_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.HOVER;
|
---|
4359 | DwtCalendar._TITLE_ACTIVE_CLASS=DwtCalendar._TITLE_CLASS+"-"+DwtCssStyle.ACTIVE;
|
---|
4360 | DwtCalendar.prototype.toString=function(){
|
---|
4361 | return"DwtCalendar"
|
---|
4362 | };
|
---|
4363 | DwtCalendar.prototype.addSelectionListener=function(e){
|
---|
4364 | this.addListener(DwtEvent.SELECTION,e)
|
---|
4365 | };
|
---|
4366 | DwtCalendar.prototype.removeSelectionListener=function(e){
|
---|
4367 | this.removeListener(DwtEvent.SELECTION,e)
|
---|
4368 | };
|
---|
4369 | DwtCalendar.prototype.addActionListener=function(e){
|
---|
4370 | this.addListener(DwtEvent.ACTION,e)
|
---|
4371 | };
|
---|
4372 | DwtCalendar.prototype.removeActionListener=function(e){
|
---|
4373 | this.removeListener(DwtEvent.ACTION,e)
|
---|
4374 | };
|
---|
4375 | DwtCalendar.prototype.addDateRangeListener=function(e){
|
---|
4376 | this.addListener(DwtEvent.DATE_RANGE,e)
|
---|
4377 | };
|
---|
4378 | DwtCalendar.prototype.removeDateRangeListener=function(e){
|
---|
4379 | this.removeListener(DwtEvent.DATE_RANGE,e)
|
---|
4380 | };
|
---|
4381 | DwtCalendar.prototype.setSkipNotifyOnPage=function(e){
|
---|
4382 | this._skipNotifyOnPage=e
|
---|
4383 | };
|
---|
4384 | DwtCalendar.prototype.getSkipNotifyOnPage=function(){
|
---|
4385 | return this._skipNotifyOnPage
|
---|
4386 | };
|
---|
4387 | DwtCalendar.prototype.setDate=function(i,s,a,t){
|
---|
4388 | a=(a==null)?this._forceRollOver:a;
|
---|
4389 | var c=new Date(i.getTime());
|
---|
4390 | var o=this._date;
|
---|
4391 | var n=false;
|
---|
4392 | var u=false;
|
---|
4393 | var e;
|
---|
4394 | if(this._date2CellId!=null){
|
---|
4395 | var l=(c.getFullYear()*10000)+(c.getMonth()*100)+c.getDate();
|
---|
4396 | var e=this._date2CellId[l];
|
---|
4397 | if(e){
|
---|
4398 | if(e==this._selectedCellId){
|
---|
4399 | u=true
|
---|
4400 | }
|
---|
4401 | var d=document.getElementById(e);
|
---|
4402 | if(d._dayType==DwtCalendar._THIS_MONTH){
|
---|
4403 | u=true
|
---|
4404 | }else{
|
---|
4405 | if(a){
|
---|
4406 | u=n=true
|
---|
4407 | }else{
|
---|
4408 | u=true
|
---|
4409 | }}}else{
|
---|
4410 | u=n=true
|
---|
4411 | }}else{
|
---|
4412 | u=n=true
|
---|
4413 | }
|
---|
4414 | if(u){
|
---|
4415 | if(this._date){
|
---|
4416 | if(AjxDateUtil.isDayShifted(c)){
|
---|
4417 | AjxDateUtil.rollToNextDay(c)
|
---|
4418 | }
|
---|
4419 | c.setHours(this._date.getHours(),this._date.getMinutes(),this._date.getSeconds(),0)
|
---|
4420 | }
|
---|
4421 | this._date=c;
|
---|
4422 | if(!n&&!this._readOnly){
|
---|
4423 | this._setSelectedDate();
|
---|
4424 | this._setToday()
|
---|
4425 | }}
|
---|
4426 | if(n){
|
---|
4427 | this._layout()
|
---|
4428 | }
|
---|
4429 | if(u&&!s){
|
---|
4430 | var h=t?DwtCalendar.DATE_DBL_CLICKED:DwtCalendar.DATE_SELECTED;
|
---|
4431 | this._notifyListeners(DwtEvent.SELECTION,h,this._date)
|
---|
4432 | }
|
---|
4433 | return true
|
---|
4434 | };
|
---|
4435 | DwtCalendar.prototype.isSelected=function(t){
|
---|
4436 | if(t==this._selectedDayElId){
|
---|
4437 | return true
|
---|
4438 | }else{
|
---|
4439 | if(this._selectionMode!=DwtCalendar.DAY){
|
---|
4440 | var e=this._getDayCellIndex(t);
|
---|
4441 | if(Math.floor(e/7)==Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)&&this._currWorkingDays[e%7]){
|
---|
4442 | return true
|
---|
4443 | }}}
|
---|
4444 | return false
|
---|
4445 | };
|
---|
4446 | DwtCalendar.prototype.getForceRollOver=function(){
|
---|
4447 | return this._forceRollOver
|
---|
4448 | };
|
---|
4449 | DwtCalendar.prototype.setForceRollOver=function(e){
|
---|
4450 | if(e==null){
|
---|
4451 | return
|
---|
4452 | }
|
---|
4453 | if(this._forceRollOver!=e){
|
---|
4454 | this._forceRollOver=e;
|
---|
4455 | this._layout()
|
---|
4456 | }};
|
---|
4457 | DwtCalendar.prototype.getSelectionMode=function(){
|
---|
4458 | return this._selectionMode
|
---|
4459 | };
|
---|
4460 | DwtCalendar.prototype.setSelectionMode=function(e){
|
---|
4461 | if(this._selectionMode==e){
|
---|
4462 | return
|
---|
4463 | }
|
---|
4464 | this._selectionMode=e;
|
---|
4465 | if(e==DwtCalendar.WEEK){
|
---|
4466 | this._currWorkingDays=DwtCalendar._FULL_WEEK
|
---|
4467 | }else{
|
---|
4468 | if(e==DwtCalendar.WORK_WEEK){
|
---|
4469 | this._currWorkingDays=this._workingDays
|
---|
4470 | }}
|
---|
4471 | this._layout()
|
---|
4472 | };
|
---|
4473 | DwtCalendar.prototype.setWorkingWeek=function(e){
|
---|
4474 | this._workingDays=this._currWorkingDays=e;
|
---|
4475 | if(this._selectionMode==DwtCalendar.WORK_WEEK){
|
---|
4476 | this._layout()
|
---|
4477 | }};
|
---|
4478 | DwtCalendar.prototype.setHilite=function(s,a,t){
|
---|
4479 | if(this._date2CellId==null){
|
---|
4480 | return
|
---|
4481 | }
|
---|
4482 | var e;
|
---|
4483 | var h;
|
---|
4484 | if(t){
|
---|
4485 | for(h in this._date2CellId){
|
---|
4486 | e=document.getElementById(this._date2CellId[h]);
|
---|
4487 | if(e._isHilited){
|
---|
4488 | e._isHilited=false;
|
---|
4489 | this._setClassName(e,DwtCalendar._NORMAL)
|
---|
4490 | }}}
|
---|
4491 | var n;
|
---|
4492 | for(var o in s){
|
---|
4493 | h=s[o];
|
---|
4494 | n=this._date2CellId[h.getFullYear()*10000+h.getMonth()*100+h.getDate()];
|
---|
4495 | if(n){
|
---|
4496 | e=document.getElementById(n);
|
---|
4497 | if(e._isHilited!=a){
|
---|
4498 | e._isHilited=a;
|
---|
4499 | this._setClassName(e,DwtCalendar._NORMAL)
|
---|
4500 | }}}};
|
---|
4501 | DwtCalendar.prototype.getDate=function(){
|
---|
4502 | return this._date
|
---|
4503 | };
|
---|
4504 | DwtCalendar.prototype.setFirstDayOfWeek=function(e){
|
---|
4505 | for(var a=0;
|
---|
4506 | a<7;
|
---|
4507 | a++){
|
---|
4508 | this._weekDays[a]=(a<e)?(6-(e-a-1)):(a-e);
|
---|
4509 | var t=document.getElementById(this._getDOWCellId(a));
|
---|
4510 | t.innerHTML=AjxDateUtil.WEEKDAY_SHORT[(e+a)%7]
|
---|
4511 | }
|
---|
4512 | this._firstDayOfWeek=e;
|
---|
4513 | this._layout()
|
---|
4514 | };
|
---|
4515 | DwtCalendar.prototype.getDateRange=function(){
|
---|
4516 | return this._range
|
---|
4517 | };
|
---|
4518 | DwtCalendar.prototype._getDayCellId=function(e){
|
---|
4519 | return("c:"+e+":"+this._uuid)
|
---|
4520 | };
|
---|
4521 | DwtCalendar.prototype._getDayCellIndex=function(e){
|
---|
4522 | return e.substring(2,e.indexOf(":",3))
|
---|
4523 | };
|
---|
4524 | DwtCalendar.prototype._getDOWCellId=function(e){
|
---|
4525 | return("w:"+e+":"+this._uuid)
|
---|
4526 | };
|
---|
4527 | DwtCalendar.prototype._getWeekNumberCellId=function(e){
|
---|
4528 | return("k:"+e+":"+this._uuid)
|
---|
4529 | };
|
---|
4530 | DwtCalendar.prototype._getDaysInMonth=function(t,e){
|
---|
4531 | if(t!=1){
|
---|
4532 | return DwtCalendar._DAYS_IN_MONTH[t]
|
---|
4533 | }
|
---|
4534 | if(e%4!=0||(e%100==0&&e%400!=0)){
|
---|
4535 | return 28
|
---|
4536 | }
|
---|
4537 | return 29
|
---|
4538 | };
|
---|
4539 | DwtCalendar.prototype._installListeners=function(){
|
---|
4540 | this._setMouseEventHdlrs();
|
---|
4541 | this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
|
---|
4542 | this.addListener(DwtEvent.ONMOUSEOUT,new AjxListener(this,this._mouseOutListener));
|
---|
4543 | this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
|
---|
4544 | this.addListener(DwtEvent.ONMOUSEUP,new AjxListener(this,this._mouseUpListener));
|
---|
4545 | this.addListener(DwtEvent.ONDBLCLICK,new AjxListener(this,this._doubleClickListener))
|
---|
4546 | };
|
---|
4547 | DwtCalendar.prototype._notifyListeners=function(e,a,t,i){
|
---|
4548 | if(!this.isListenerRegistered(e)){
|
---|
4549 | return
|
---|
4550 | }
|
---|
4551 | var o=DwtShell.selectionEvent;
|
---|
4552 | if(i){
|
---|
4553 | DwtUiEvent.copy(o,i)
|
---|
4554 | }else{
|
---|
4555 | o.reset()
|
---|
4556 | }
|
---|
4557 | o.item=this;
|
---|
4558 | o.detail=t;
|
---|
4559 | o.type=a;
|
---|
4560 | this.notifyListeners(e,o)
|
---|
4561 | };
|
---|
4562 | DwtCalendar.prototype._layout=function(){
|
---|
4563 | if(this._date==null){
|
---|
4564 | return false
|
---|
4565 | }
|
---|
4566 | if(!this._calWidgetInited){
|
---|
4567 | this._init()
|
---|
4568 | }
|
---|
4569 | var g=new Date(this._date.getTime());
|
---|
4570 | g.setDate(1);
|
---|
4571 | var s=g.getFullYear();
|
---|
4572 | var y=g.getMonth();
|
---|
4573 | var n=g.getDay();
|
---|
4574 | var a=this._getDaysInMonth(y,s);
|
---|
4575 | var c=1;
|
---|
4576 | var b=1;
|
---|
4577 | this._date2CellId=new Object();
|
---|
4578 | this._selectedDayElId=null;
|
---|
4579 | var o,u,w,p,e;
|
---|
4580 | if(!this._hidePrevNextMo){
|
---|
4581 | if(y!=0){
|
---|
4582 | o=this._getDaysInMonth(y-1,s)-this._weekDays[n]+1;
|
---|
4583 | u=s;
|
---|
4584 | w=y-1;
|
---|
4585 | if(y!=11){
|
---|
4586 | p=y+1;
|
---|
4587 | e=s
|
---|
4588 | }else{
|
---|
4589 | p=0;
|
---|
4590 | e=s+1
|
---|
4591 | }}else{
|
---|
4592 | o=this._getDaysInMonth(11,s-1)-this._weekDays[n]+1;
|
---|
4593 | u=s-1;
|
---|
4594 | w=11;
|
---|
4595 | p=1;
|
---|
4596 | e=s
|
---|
4597 | }}
|
---|
4598 | for(var d=0;
|
---|
4599 | d<6;
|
---|
4600 | d++){
|
---|
4601 | for(var l=0;
|
---|
4602 | l<7;
|
---|
4603 | l++){
|
---|
4604 | var f=document.getElementById(this._getDayCellId(d*7+l));
|
---|
4605 | if(f._isHilited==null){
|
---|
4606 | f._isHilited=false
|
---|
4607 | }
|
---|
4608 | if(c<=a){
|
---|
4609 | if(d!=0||l>=this._weekDays[n]){
|
---|
4610 | this._date2CellId[(s*10000)+(y*100)+c]=f.id;
|
---|
4611 | f._day=c;
|
---|
4612 | f._month=y;
|
---|
4613 | f._year=s;
|
---|
4614 | f.innerHTML=c++;
|
---|
4615 | f._dayType=DwtCalendar._THIS_MONTH;
|
---|
4616 | if(this._readOnly){
|
---|
4617 | f.style.fontFamily="Arial";
|
---|
4618 | f.style.fontSize="10px"
|
---|
4619 | }}else{
|
---|
4620 | if(this._hidePrevNextMo){
|
---|
4621 | f.innerHTML=""
|
---|
4622 | }else{
|
---|
4623 | this._date2CellId[(u*10000)+(w*100)+o]=f.id;
|
---|
4624 | f._day=o;
|
---|
4625 | f._month=w;
|
---|
4626 | f._year=u;
|
---|
4627 | f.innerHTML=o++;
|
---|
4628 | f._dayType=DwtCalendar._PREV_MONTH
|
---|
4629 | }}}else{
|
---|
4630 | if(!this._hidePrevNextMo){
|
---|
4631 | this._date2CellId[(e*10000)+(p*100)+b]=f.id;
|
---|
4632 | f._day=b;
|
---|
4633 | f._month=p;
|
---|
4634 | f._year=e;
|
---|
4635 | f.innerHTML=b++;
|
---|
4636 | f._dayType=DwtCalendar._NEXT_MONTH
|
---|
4637 | }}
|
---|
4638 | this._setClassName(f,DwtCalendar._NORMAL)
|
---|
4639 | }
|
---|
4640 | if(this._showWeekNumber){
|
---|
4641 | var h=this._getWeekNumberCellId("kw"+d*7);
|
---|
4642 | var m=document.getElementById(h);
|
---|
4643 | if(m){
|
---|
4644 | var t=document.getElementById(this._getDayCellId(d*7));
|
---|
4645 | m.innerHTML=AjxDateUtil.getWeekNumber(new Date(t._year,t._month,t._day),this._firstDayOfWeek,null,this._useISO8601WeekNo)
|
---|
4646 | }}}
|
---|
4647 | this._setTitle(y,s);
|
---|
4648 | if(!this._readOnly){
|
---|
4649 | this._setSelectedDate();
|
---|
4650 | this._setToday()
|
---|
4651 | }
|
---|
4652 | this._setRange()
|
---|
4653 | };
|
---|
4654 | DwtCalendar.prototype._setRange=function(){
|
---|
4655 | var e=document.getElementById(this._getDayCellId(0));
|
---|
4656 | var i=new Date(e._year,e._month,e._day,0,0,0,0);
|
---|
4657 | e=document.getElementById(this._getDayCellId(DwtCalendar._LAST_DAY_CELL_IDX));
|
---|
4658 | var a=this._getDaysInMonth(e._month,e._year);
|
---|
4659 | var t;
|
---|
4660 | if(e._day<a){
|
---|
4661 | t=new Date(e._year,e._month,e._day+1,0,0,0,0)
|
---|
4662 | }else{
|
---|
4663 | if(e._month<11){
|
---|
4664 | t=new Date(e._year,e._month+1,1,0,0,0,0)
|
---|
4665 | }else{
|
---|
4666 | t=new Date(e._year+1,0,1,0,0,0,0)
|
---|
4667 | }}
|
---|
4668 | if(this._range==null){
|
---|
4669 | this._range={}
|
---|
4670 | }else{
|
---|
4671 | if(this._range.start.getTime()==i.getTime()&&this._range.end.getTime()==t.getTime()){
|
---|
4672 | return false
|
---|
4673 | }}
|
---|
4674 | this._range.start=i;
|
---|
4675 | this._range.end=t;
|
---|
4676 | if(!this.isListenerRegistered(DwtEvent.DATE_RANGE)){
|
---|
4677 | return
|
---|
4678 | }
|
---|
4679 | if(!this._dateRangeEvent){
|
---|
4680 | this._dateRangeEvent=new DwtDateRangeEvent(true)
|
---|
4681 | }
|
---|
4682 | this._dateRangeEvent.item=this;
|
---|
4683 | this._dateRangeEvent.start=i;
|
---|
4684 | this._dateRangeEvent.end=t;
|
---|
4685 | this.notifyListeners(DwtEvent.DATE_RANGE,this._dateRangeEvent)
|
---|
4686 | };
|
---|
4687 | DwtCalendar.prototype._setToday=function(){
|
---|
4688 | var e;
|
---|
4689 | var t=new Date();
|
---|
4690 | var a=t.getDate();
|
---|
4691 | if(!this._todayDay||this._todayDay!=a){
|
---|
4692 | if(this._todayCellId!=null){
|
---|
4693 | e=document.getElementById(this._todayCellId);
|
---|
4694 | e._isToday=false;
|
---|
4695 | this._setClassName(e,DwtCalendar._NORMAL)
|
---|
4696 | }
|
---|
4697 | this._todayCellId=this._date2CellId[(t.getFullYear()*10000)+(t.getMonth()*100)+a];
|
---|
4698 | if(this._todayCellId!=null){
|
---|
4699 | e=document.getElementById(this._todayCellId);
|
---|
4700 | e._isToday=true;
|
---|
4701 | this._setClassName(e,DwtCalendar._NORMAL)
|
---|
4702 | }}};
|
---|
4703 | DwtCalendar.prototype._setSelectedDate=function(){
|
---|
4704 | var t=this._date.getDate();
|
---|
4705 | var o=this._date.getMonth();
|
---|
4706 | var a=this._date.getFullYear();
|
---|
4707 | var e;
|
---|
4708 | if(this._selectedDayElId){
|
---|
4709 | e=document.getElementById(this._selectedDayElId);
|
---|
4710 | this._setClassName(e,DwtCalendar._DESELECTED)
|
---|
4711 | }
|
---|
4712 | var i=this._date2CellId[(a*10000)+(o*100)+t];
|
---|
4713 | e=document.getElementById(i);
|
---|
4714 | this._selectedDayElId=i;
|
---|
4715 | this._setClassName(e,DwtCalendar._SELECTED)
|
---|
4716 | };
|
---|
4717 | DwtCalendar.prototype._setCellClassName=function(t,a,i){
|
---|
4718 | if(t._dayType!=DwtCalendar._THIS_MONTH){
|
---|
4719 | a+=this._greyClassName
|
---|
4720 | }
|
---|
4721 | if(this._selectionMode==DwtCalendar.DAY&&t.id==this._selectedDayElId&&i!=DwtCalendar._DESELECTED){
|
---|
4722 | a+=this._selectedDayClassName
|
---|
4723 | }else{
|
---|
4724 | if(this._selectionMode!=DwtCalendar.DAY&&i!=DwtCalendar._DESELECTED&&this._selectedDayElId!=null){
|
---|
4725 | var e=this._getDayCellIndex(t.id);
|
---|
4726 | if(Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)==Math.floor(e/7)&&this._currWorkingDays[e%7]){
|
---|
4727 | a+=this._selectedDayClassName
|
---|
4728 | }}}
|
---|
4729 | if(t._isHilited){
|
---|
4730 | a+=this._hiliteClassName
|
---|
4731 | }
|
---|
4732 | if(t._isToday){
|
---|
4733 | a+=this._todayClassName
|
---|
4734 | }
|
---|
4735 | return a
|
---|
4736 | };
|
---|
4737 | DwtCalendar.prototype._setClassName=function(e,s){
|
---|
4738 | var a="";
|
---|
4739 | if(s==DwtCalendar._NORMAL){
|
---|
4740 | a=this._origDayClassName
|
---|
4741 | }else{
|
---|
4742 | if(s==DwtCalendar._HOVERED){
|
---|
4743 | a=this._hoveredDayClassName
|
---|
4744 | }else{
|
---|
4745 | if(s==DwtCalendar._ACTIVE){
|
---|
4746 | a=this._activeDayClassName
|
---|
4747 | }else{
|
---|
4748 | if(s==DwtCalendar._DESELECTED&&this._selectionMode==DwtCalendar.DAY){
|
---|
4749 | a=this._origDayClassName
|
---|
4750 | }else{
|
---|
4751 | if(this._selectionMode!=DwtCalendar.DAY&&(s==DwtCalendar._SELECTED||s==DwtCalendar._DESELECTED)){
|
---|
4752 | var n=Math.floor(this._getDayCellIndex(this._selectedDayElId)/7)*7;
|
---|
4753 | for(var t=0;
|
---|
4754 | t<7;
|
---|
4755 | t++){
|
---|
4756 | a=this._origDayClassName;
|
---|
4757 | var o=document.getElementById(this._getDayCellId(n++));
|
---|
4758 | o.className=this._setCellClassName(o,a,s)
|
---|
4759 | }
|
---|
4760 | return
|
---|
4761 | }}}}}
|
---|
4762 | e.className=this._setCellClassName(e,a,s)
|
---|
4763 | };
|
---|
4764 | DwtCalendar.prototype._setTitle=function(o,i){
|
---|
4765 | var e=document.getElementById(this._monthCell);
|
---|
4766 | var a=DwtCalendar.getMonthFormatter();
|
---|
4767 | var t=new Date(i,o);
|
---|
4768 | e.innerHTML=a.format(t)
|
---|
4769 | };
|
---|
4770 | DwtCalendar.prototype._init=function(){
|
---|
4771 | var o=new Array(100);
|
---|
4772 | var e=0;
|
---|
4773 | this._monthCell="t:"+this._uuid;
|
---|
4774 | o[e++]="<table width=100% cellspacing='0' cellpadding='0' style='border-collapse:collapse;'>";
|
---|
4775 | o[e++]="<tr><td class=DwtCalendarTitlebar>";
|
---|
4776 | o[e++]="<table width='100%' cellspacing='0' cellpadding='0'>";
|
---|
4777 | o[e++]="<tr>";
|
---|
4778 | o[e++]="<td class='";
|
---|
4779 | o[e++]=DwtCalendar._BUTTON_CLASS;
|
---|
4780 | o[e++]="' id='b:py:";
|
---|
4781 | o[e++]=this._uuid;
|
---|
4782 | o[e++]="'>";
|
---|
4783 | o[e++]=AjxImg.getImageHtml("FastRevArrowSmall",null,["id='b:py:img:",this._uuid,"'"].join(""));
|
---|
4784 | o[e++]="</td>";
|
---|
4785 | o[e++]="<td class='";
|
---|
4786 | o[e++]=DwtCalendar._BUTTON_CLASS;
|
---|
4787 | o[e++]="' id='b:pm:";
|
---|
4788 | o[e++]=this._uuid;
|
---|
4789 | o[e++]="'>";
|
---|
4790 | o[e++]=AjxImg.getImageHtml("RevArrowSmall",null,["id='b:pm:img:",this._uuid,"'"].join(""));
|
---|
4791 | o[e++]="</td>";
|
---|
4792 | o[e++]="<td align='center' class='DwtCalendarTitleCell' nowrap'><span class='";
|
---|
4793 | o[e++]=DwtCalendar._TITLE_CLASS;
|
---|
4794 | o[e++]="' id='";
|
---|
4795 | o[e++]=this._monthCell;
|
---|
4796 | o[e++]="'> </span></td>";
|
---|
4797 | o[e++]="<td class='";
|
---|
4798 | o[e++]=DwtCalendar._BUTTON_CLASS;
|
---|
4799 | o[e++]="' id='b:nm:";
|
---|
4800 | o[e++]=this._uuid;
|
---|
4801 | o[e++]="'>";
|
---|
4802 | o[e++]=AjxImg.getImageHtml("FwdArrowSmall",null,["id='b:nm:img:",this._uuid,"'"].join(""));
|
---|
4803 | o[e++]="</td>";
|
---|
4804 | o[e++]="<td class='";
|
---|
4805 | o[e++]=DwtCalendar._BUTTON_CLASS;
|
---|
4806 | o[e++]="' id='b:ny:";
|
---|
4807 | o[e++]=this._uuid;
|
---|
4808 | o[e++]="'>";
|
---|
4809 | o[e++]=AjxImg.getImageHtml("FastFwdArrowSmall",null,["id='b:ny:img:",this._uuid,"'"].join(""));
|
---|
4810 | o[e++]="</td>";
|
---|
4811 | o[e++]="</tr>";
|
---|
4812 | o[e++]="</table>";
|
---|
4813 | o[e++]="</td></tr>";
|
---|
4814 | o[e++]="<tr><td>";
|
---|
4815 | o[e++]="<table cellspacing='0' cellpadding='1' width='100%'>";
|
---|
4816 | o[e++]="<tr>";
|
---|
4817 | if(this._showWeekNumber){
|
---|
4818 | o[e++]="<td class='DwtCalendarWeekNoTitle' width='14%' id='";
|
---|
4819 | o[e++]=this._getWeekNumberCellId("kw");
|
---|
4820 | o[e++]="'>";
|
---|
4821 | o[e++]=AjxMsg.calendarWeekTitle;
|
---|
4822 | o[e++]="</td>"
|
---|
4823 | }
|
---|
4824 | for(var a=0;
|
---|
4825 | a<7;
|
---|
4826 | a++){
|
---|
4827 | o[e++]="<td class='DwtCalendarDow' width='";
|
---|
4828 | o[e++]=(a<5?"14%":"15%");
|
---|
4829 | o[e++]="' id='";
|
---|
4830 | o[e++]=this._getDOWCellId(a);
|
---|
4831 | o[e++]="'> </td>"
|
---|
4832 | }
|
---|
4833 | o[e++]="</tr>";
|
---|
4834 | for(var a=0;
|
---|
4835 | a<6;
|
---|
4836 | a++){
|
---|
4837 | o[e++]=(AjxEnv.isLinux||AjxEnv.isMac)?"<tr style='line-height:12px'>":"<tr>";
|
---|
4838 | if(this._showWeekNumber){
|
---|
4839 | o[e++]="<td class='DwtCalendarWeekNo' id='"+this._getWeekNumberCellId("kw"+a*7)+"'> </td>"
|
---|
4840 | }
|
---|
4841 | for(var t=0;
|
---|
4842 | t<7;
|
---|
4843 | t++){
|
---|
4844 | o[e++]="<td id='";
|
---|
4845 | o[e++]=this._getDayCellId(a*7+t);
|
---|
4846 | o[e++]="'> </td>"
|
---|
4847 | }
|
---|
4848 | o[e++]="</tr>"
|
---|
4849 | }
|
---|
4850 | o[e++]="</td></tr></table></table>";
|
---|
4851 | this.getHtmlElement().innerHTML=o.join("");
|
---|
4852 | if(!this._readOnly){
|
---|
4853 | document.getElementById("b:py:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastRevArrowSmall");
|
---|
4854 | document.getElementById("b:pm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("RevArrowSmall");
|
---|
4855 | document.getElementById("b:nm:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FwdArrowSmall");
|
---|
4856 | document.getElementById("b:ny:img:"+this._uuid)._origClassName=AjxImg.getClassForImage("FastFwdArrowSmall")
|
---|
4857 | }
|
---|
4858 | this._calWidgetInited=true
|
---|
4859 | };
|
---|
4860 | DwtCalendar.prototype.setMouseOverDayCallback=function(e){
|
---|
4861 | this._mouseOverDayCB=e
|
---|
4862 | };
|
---|
4863 | DwtCalendar.prototype.setMouseOutDayCallback=function(e){
|
---|
4864 | this._mouseOutDayCB=e
|
---|
4865 | };
|
---|
4866 | DwtCalendar.prototype.getDndDate=function(){
|
---|
4867 | var e=this._lastDndCell;
|
---|
4868 | if(e){
|
---|
4869 | return new Date(e._year,e._month,e._day)
|
---|
4870 | }
|
---|
4871 | return null
|
---|
4872 | };
|
---|
4873 | DwtCalendar._tmpDate=new Date();
|
---|
4874 | DwtCalendar._tmpDate.setHours(0,0,0,0);
|
---|
4875 | DwtCalendar.prototype._mouseOverListener=function(t){
|
---|
4876 | var a=t.target;
|
---|
4877 | if(a.id.charAt(0)=="c"){
|
---|
4878 | this._setClassName(a,DwtCalendar._HOVERED);
|
---|
4879 | if(this._mouseOverDayCB){
|
---|
4880 | DwtCalendar._tmpDate.setFullYear(a._year,a._month,a._day);
|
---|
4881 | this._mouseOverDayCB.run(this,DwtCalendar._tmpDate)
|
---|
4882 | }}else{
|
---|
4883 | if(a.id.charAt(0)=="t"){
|
---|
4884 | return
|
---|
4885 | }else{
|
---|
4886 | if(a.id.charAt(0)=="b"){
|
---|
4887 | var e;
|
---|
4888 | if(a.firstChild==null){
|
---|
4889 | e=a;
|
---|
4890 | AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS
|
---|
4891 | }else{
|
---|
4892 | a.className=DwtCalendar._BUTTON_HOVERED_CLASS;
|
---|
4893 | e=AjxImg.getImageElement(a)
|
---|
4894 | }
|
---|
4895 | e.className=e._origClassName
|
---|
4896 | }}}
|
---|
4897 | t._stopPropagation=true
|
---|
4898 | };
|
---|
4899 | DwtCalendar.prototype._mouseOutListener=function(t){
|
---|
4900 | this.setToolTipContent(null);
|
---|
4901 | var a=t.target;
|
---|
4902 | if(a.id.charAt(0)=="c"){
|
---|
4903 | this._setClassName(a,DwtCalendar._NORMAL);
|
---|
4904 | if(this._mouseOutDayCB){
|
---|
4905 | this._mouseOutDayCB.run(this)
|
---|
4906 | }}else{
|
---|
4907 | if(a.id.charAt(0)=="b"){
|
---|
4908 | var e;
|
---|
4909 | a.className=DwtCalendar._BUTTON_CLASS;
|
---|
4910 | if(a.firstChild==null){
|
---|
4911 | e=a;
|
---|
4912 | AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_CLASS
|
---|
4913 | }else{
|
---|
4914 | a.className=DwtCalendar._BUTTON_CLASS;
|
---|
4915 | e=AjxImg.getImageElement(a)
|
---|
4916 | }
|
---|
4917 | e.className=e._origClassName
|
---|
4918 | }}};
|
---|
4919 | DwtCalendar.prototype._mouseDownListener=function(t){
|
---|
4920 | if(t.button==DwtMouseEvent.LEFT){
|
---|
4921 | var a=t.target;
|
---|
4922 | if(a.id.charAt(0)=="c"){
|
---|
4923 | this._setClassName(a,DwtCalendar._ACTIVE)
|
---|
4924 | }else{
|
---|
4925 | if(a.id.charAt(0)=="t"){
|
---|
4926 | a.className=DwtCalendar._TITLE_ACTIVE_CLASS
|
---|
4927 | }else{
|
---|
4928 | if(a.id.charAt(0)=="b"){
|
---|
4929 | var e;
|
---|
4930 | if(a.firstChild==null){
|
---|
4931 | e=a;
|
---|
4932 | AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_ACTIVE_CLASS
|
---|
4933 | }else{
|
---|
4934 | a.className=DwtCalendar._BUTTON_ACTIVE_CLASS;
|
---|
4935 | e=AjxImg.getImageElement(a)
|
---|
4936 | }
|
---|
4937 | e.className=e._origClassName
|
---|
4938 | }else{
|
---|
4939 | if(a.id.charAt(0)=="w"){}}}}}};
|
---|
4940 | DwtCalendar.prototype._mouseUpListener=function(t){
|
---|
4941 | var a=t.target;
|
---|
4942 | if(t.button==DwtMouseEvent.LEFT){
|
---|
4943 | if(a.id.charAt(0)=="c"){
|
---|
4944 | if(this.parent instanceof DwtMenu){
|
---|
4945 | DwtMenu.closeActiveMenu()
|
---|
4946 | }
|
---|
4947 | if(this.setDate(new Date(a._year,a._month,a._day))){
|
---|
4948 | return
|
---|
4949 | }
|
---|
4950 | this._setClassName(a,DwtCalendar._HOVERED)
|
---|
4951 | }else{
|
---|
4952 | if(a.id.charAt(0)=="b"){
|
---|
4953 | var e;
|
---|
4954 | if(a.firstChild==null){
|
---|
4955 | e=a;
|
---|
4956 | AjxImg.getParentElement(a).className=DwtCalendar._BUTTON_HOVERED_CLASS
|
---|
4957 | }else{
|
---|
4958 | a.className=DwtCalendar._BUTTON_HOVERED_CLASS;
|
---|
4959 | e=AjxImg.getImageElement(a)
|
---|
4960 | }
|
---|
4961 | e.className=e._origClassName;
|
---|
4962 | if(e.id.indexOf("py")!=-1){
|
---|
4963 | this._prevYear()
|
---|
4964 | }else{
|
---|
4965 | if(e.id.indexOf("pm")!=-1){
|
---|
4966 | this._prevMonth()
|
---|
4967 | }else{
|
---|
4968 | if(e.id.indexOf("nm")!=-1){
|
---|
4969 | this._nextMonth()
|
---|
4970 | }else{
|
---|
4971 | this._nextYear()
|
---|
4972 | }}}}else{
|
---|
4973 | if(a.id.charAt(0)=="t"){
|
---|
4974 | a.className=DwtCalendar._TITLE_HOVERED_CLASS;
|
---|
4975 | this.setDate(new Date(),this._skipNotifyOnPage);
|
---|
4976 | if(this.parent instanceof DwtMenu){
|
---|
4977 | DwtMenu.closeActiveMenu()
|
---|
4978 | }}}}}else{
|
---|
4979 | if(t.button==DwtMouseEvent.RIGHT&&a.id.charAt(0)=="c"){
|
---|
4980 | this._notifyListeners(DwtEvent.ACTION,0,new Date(a._year,a._month,a._day),t)
|
---|
4981 | }}};
|
---|
4982 | DwtCalendar.prototype._doubleClickListener=function(e){
|
---|
4983 | var t=e.target;
|
---|
4984 | if(this._selectionEvent){
|
---|
4985 | this._selectionEvent.type=DwtCalendar.DATE_DBL_CLICKED
|
---|
4986 | }
|
---|
4987 | if(t.id.charAt(0)=="c"){
|
---|
4988 | if(this.parent instanceof DwtMenu){
|
---|
4989 | DwtMenu.closeActiveMenu()
|
---|
4990 | }
|
---|
4991 | this.setDate(new Date(t._year,t._month,t._day),false,false,true)
|
---|
4992 | }};
|
---|
4993 | DwtCalendar.prototype._prevMonth=function(e){
|
---|
4994 | var t=new Date(this._date.getTime());
|
---|
4995 | this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,-1),this._skipNotifyOnPage)
|
---|
4996 | };
|
---|
4997 | DwtCalendar.prototype._nextMonth=function(e){
|
---|
4998 | var t=new Date(this._date.getTime());
|
---|
4999 | this.setDate(AjxDateUtil.roll(t,AjxDateUtil.MONTH,1),this._skipNotifyOnPage)
|
---|
5000 | };
|
---|
5001 | DwtCalendar.prototype._prevYear=function(e){
|
---|
5002 | var t=new Date(this._date.getTime());
|
---|
5003 | this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,-1),this._skipNotifyOnPage)
|
---|
5004 | };
|
---|
5005 | DwtCalendar.prototype._nextYear=function(e){
|
---|
5006 | var t=new Date(this._date.getTime());
|
---|
5007 | this.setDate(AjxDateUtil.roll(t,AjxDateUtil.YEAR,1),this._skipNotifyOnPage)
|
---|
5008 | };
|
---|
5009 | DwtCalendar.getDateFormatter=function(){
|
---|
5010 | if(!DwtCalendar._dateFormatter){
|
---|
5011 | DwtCalendar._dateFormatter=new AjxDateFormat(AjxMsg.formatCalDate)
|
---|
5012 | }
|
---|
5013 | return DwtCalendar._dateFormatter
|
---|
5014 | };
|
---|
5015 | DwtCalendar.getDateLongFormatter=function(){
|
---|
5016 | if(!DwtCalendar._dateLongFormatter){
|
---|
5017 | DwtCalendar._dateLongFormatter=new AjxDateFormat(AjxMsg.formatCalDateLong)
|
---|
5018 | }
|
---|
5019 | return DwtCalendar._dateLongFormatter
|
---|
5020 | };
|
---|
5021 | DwtCalendar.getDateFullFormatter=function(){
|
---|
5022 | if(!DwtCalendar._dateFullFormatter){
|
---|
5023 | DwtCalendar._dateFullFormatter=new AjxDateFormat(AjxMsg.formatCalDateFull)
|
---|
5024 | }
|
---|
5025 | return DwtCalendar._dateFullFormatter
|
---|
5026 | };
|
---|
5027 | DwtCalendar.getHourFormatter=function(){
|
---|
5028 | if(!DwtCalendar._hourFormatter){
|
---|
5029 | DwtCalendar._hourFormatter=new AjxMessageFormat(AjxMsg.formatCalHour)
|
---|
5030 | }
|
---|
5031 | return DwtCalendar._hourFormatter
|
---|
5032 | };
|
---|
5033 | DwtCalendar.getDayFormatter=function(){
|
---|
5034 | if(!DwtCalendar._dayFormatter){
|
---|
5035 | DwtCalendar._dayFormatter=new AjxDateFormat(AjxMsg.formatCalDay)
|
---|
5036 | }
|
---|
5037 | return DwtCalendar._dayFormatter
|
---|
5038 | };
|
---|
5039 | DwtCalendar.getMonthFormatter=function(){
|
---|
5040 | if(!DwtCalendar._monthFormatter){
|
---|
5041 | DwtCalendar._monthFormatter=new AjxDateFormat(AjxMsg.formatCalMonth)
|
---|
5042 | }
|
---|
5043 | return DwtCalendar._monthFormatter
|
---|
5044 | };
|
---|
5045 | DwtCalendar.getShortMonthFormatter=function(){
|
---|
5046 | if(!DwtCalendar._shortMonthFormatter){
|
---|
5047 | DwtCalendar._shortMonthFormatter=new AjxDateFormat(AjxMsg.formatShortCalMonth)
|
---|
5048 | }
|
---|
5049 | return DwtCalendar._shortMonthFormatter
|
---|
5050 | };
|
---|
5051 | DwtCalendar.prototype._dragEnter=function(e){};
|
---|
5052 | DwtCalendar.prototype._dragHover=function(e){};
|
---|
5053 | DwtCalendar.prototype._dragOver=function(e){
|
---|
5054 | var t=e.target;
|
---|
5055 | if(t.id.charAt(0)=="c"){
|
---|
5056 | this._setClassName(t,DwtCalendar._HOVERED);
|
---|
5057 | this._lastDndCell=t
|
---|
5058 | }else{
|
---|
5059 | this._lastDndCell=null
|
---|
5060 | }};
|
---|
5061 | DwtCalendar.prototype._dragLeave=function(e){}
|
---|
5062 | }
|
---|
5063 | if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyPage")){
|
---|
5064 | DwtPropertyPage=function(e){
|
---|
5065 | if(arguments.length==0){
|
---|
5066 | return
|
---|
5067 | }
|
---|
5068 | e=Dwt.getParams(arguments,DwtPropertyPage.PARAMS);
|
---|
5069 | e.className=e.className||"DwtPropertyPage";
|
---|
5070 | DwtComposite.call(this,e);
|
---|
5071 | this._fieldIds=new Object();
|
---|
5072 | this._fildDivIds=new Object();
|
---|
5073 | this._isDirty=false
|
---|
5074 | };
|
---|
5075 | DwtPropertyPage.prototype=new DwtComposite;
|
---|
5076 | DwtPropertyPage.prototype.constructor=DwtPropertyPage;
|
---|
5077 | DwtPropertyPage.prototype.toString=function(){
|
---|
5078 | return"DwtPropertyPage"
|
---|
5079 | };
|
---|
5080 | DwtPropertyPage.PARAMS=DwtComposite.PARAMS;
|
---|
5081 | DwtPropertyPage.prototype.setDirty=function(e){
|
---|
5082 | this._isDirty=e
|
---|
5083 | };
|
---|
5084 | DwtPropertyPage.prototype.isDirty=function(){
|
---|
5085 | return this._isDirty
|
---|
5086 | };
|
---|
5087 | DwtPropertyPage.prototype._installOnKeyUpHandler=function(i,t){
|
---|
5088 | if(!i){
|
---|
5089 | return
|
---|
5090 | }
|
---|
5091 | var a=null;
|
---|
5092 | a=document.getElementById(this._fieldIds[i]);
|
---|
5093 | if(a){
|
---|
5094 | Dwt.setHandler(a,DwtEvent.ONKEYUP,t?t:this._onKeyUp);
|
---|
5095 | a._view=this;
|
---|
5096 | a._field=i
|
---|
5097 | }};
|
---|
5098 | DwtPropertyPage.prototype._installOnClickHandler=function(i,t){
|
---|
5099 | if(!i){
|
---|
5100 | return
|
---|
5101 | }
|
---|
5102 | var a=document.getElementById(this._fieldIds[i]);
|
---|
5103 | if(a){
|
---|
5104 | Dwt.setHandler(a,DwtEvent.ONCLICK,t?t:this._onClick);
|
---|
5105 | a._view=this;
|
---|
5106 | a._field=i
|
---|
5107 | }};
|
---|
5108 | DwtPropertyPage.prototype._onClick=function(e){
|
---|
5109 | this._view.setDirty(true);
|
---|
5110 | return true
|
---|
5111 | };
|
---|
5112 | DwtPropertyPage.prototype._onKeyUp=function(e){
|
---|
5113 | this._view.setDirty(true);
|
---|
5114 | return true
|
---|
5115 | };
|
---|
5116 | DwtPropertyPage.prototype._installOnChangeHandler=function(i,t){
|
---|
5117 | if(!i){
|
---|
5118 | return
|
---|
5119 | }
|
---|
5120 | var a=null;
|
---|
5121 | a=document.getElementById(this._fieldIds[i]);
|
---|
5122 | if(a){
|
---|
5123 | Dwt.setHandler(a,DwtEvent.ONCHANGE,t?t:this._onChange);
|
---|
5124 | a._view=this;
|
---|
5125 | a._field=i
|
---|
5126 | }};
|
---|
5127 | DwtPropertyPage._onChange=function(e){
|
---|
5128 | this._view.setDirty(true);
|
---|
5129 | return true
|
---|
5130 | };
|
---|
5131 | DwtPropertyPage.prototype._onChange2=function(e){
|
---|
5132 | this.setDirty(true);
|
---|
5133 | return true
|
---|
5134 | };
|
---|
5135 | DwtPropertyPage.prototype._addDwtSelectEntryRow=function(o,n,a,e,i){
|
---|
5136 | var t="30ex";
|
---|
5137 | if(i){
|
---|
5138 | t=i
|
---|
5139 | }
|
---|
5140 | a[e++]="<tr valign='center'>";
|
---|
5141 | e=this._addDwtSelectEntryCell(o,n,a,e,t);
|
---|
5142 | a[e++]="</tr>";
|
---|
5143 | return e
|
---|
5144 | };
|
---|
5145 | DwtPropertyPage.prototype._addDwtSelectEntryCell=function(a,i,t,e,n){
|
---|
5146 | var o=Dwt.getNextId();
|
---|
5147 | this._fieldIds[a]=o;
|
---|
5148 | if(i){
|
---|
5149 | t[e++]="<td align='left' style='width:"+n+"'>";
|
---|
5150 | t[e++]=AjxStringUtil.htmlEncode(i)+":";
|
---|
5151 | t[e++]="</td>"
|
---|
5152 | }
|
---|
5153 | t[e++]="<td align='left'>";
|
---|
5154 | t[e++]="<div id='"+o+"'></div></td>";
|
---|
5155 | return e
|
---|
5156 | };
|
---|
5157 | DwtPropertyPage.prototype._addBoolEntryRow=function(a,i,t,e,o){
|
---|
5158 | t[e++]="<tr valign='center'>";
|
---|
5159 | e=this._addBoolEntryCell(a,i,t,e,o);
|
---|
5160 | t[e++]="</tr>";
|
---|
5161 | return e
|
---|
5162 | };
|
---|
5163 | DwtPropertyPage.prototype._addBoolEntryCell=function(i,o,t,e,s){
|
---|
5164 | var n=Dwt.getNextId();
|
---|
5165 | this._fieldIds[i]=n;
|
---|
5166 | var a="20ex";
|
---|
5167 | if(s){
|
---|
5168 | a=s
|
---|
5169 | }
|
---|
5170 | if(o){
|
---|
5171 | t[e++]="<td style='width:"+a+";' align='left'>";
|
---|
5172 | t[e++]=AjxStringUtil.htmlEncode(o)+":";
|
---|
5173 | t[e++]="</td>"
|
---|
5174 | }
|
---|
5175 | t[e++]="<td align='left'>";
|
---|
5176 | t[e++]="<input type='checkbox' id='"+n+"'>";
|
---|
5177 | t[e++]="</td>";
|
---|
5178 | return e
|
---|
5179 | };
|
---|
5180 | DwtPropertyPage.prototype._addTextAreaEntryRow=function(i,o,t,e,s){
|
---|
5181 | var a="on";
|
---|
5182 | if(s){
|
---|
5183 | a="off"
|
---|
5184 | }
|
---|
5185 | var n=Dwt.getNextId();
|
---|
5186 | this._fieldIds[i]=n;
|
---|
5187 | t[e++]="<tr valign='center'>";
|
---|
5188 | t[e++]="<td align='left' style='width:60ex;'>";
|
---|
5189 | t[e++]=AjxStringUtil.htmlEncode(o)+":";
|
---|
5190 | t[e++]="</td></tr>";
|
---|
5191 | t[e++]="<tr valign='center'><td align='left' style='width:60ex;'><textarea wrap='"+a+"' rows='8' cols ='60' id='";
|
---|
5192 | t[e++]=n;
|
---|
5193 | t[e++]="'/></textarea></td></tr>";
|
---|
5194 | return e
|
---|
5195 | };
|
---|
5196 | DwtPropertyPage.prototype._addEntryRow=function(s,n,t,l,i,o,e,h,a){
|
---|
5197 | t[l++]="<tr valign='center'>";
|
---|
5198 | l=this._addEntryCell(s,n,t,l,i,o,e,h,a);
|
---|
5199 | t[l++]="</tr>";
|
---|
5200 | return l
|
---|
5201 | };
|
---|
5202 | DwtPropertyPage.prototype._addEntryCell=function(l,h,i,d,n,s,t,c,o){
|
---|
5203 | if(n==null){
|
---|
5204 | n="text"
|
---|
5205 | }
|
---|
5206 | if(s==null){
|
---|
5207 | s=35
|
---|
5208 | }
|
---|
5209 | var a="20ex";
|
---|
5210 | if(c){
|
---|
5211 | a=c
|
---|
5212 | }
|
---|
5213 | var e=Dwt.getNextId();
|
---|
5214 | this._fieldIds[l]=e;
|
---|
5215 | if(h){
|
---|
5216 | i[d++]="<td align='left' style='width:"+a+";'>";
|
---|
5217 | i[d++]=AjxStringUtil.htmlEncode(h)+":";
|
---|
5218 | i[d++]="</td>"
|
---|
5219 | }
|
---|
5220 | i[d++]="<td ";
|
---|
5221 | if(o){
|
---|
5222 | i[d++]="class='redAsteric' "
|
---|
5223 | }
|
---|
5224 | i[d++]=" align='left'><input autocomplete='off' size='"+s+"' type='"+n+"' id='";
|
---|
5225 | i[d++]=e;
|
---|
5226 | i[d++]="'";
|
---|
5227 | if(o){
|
---|
5228 | i[d++]="/>*"
|
---|
5229 | }else{
|
---|
5230 | i[d++]="/> "
|
---|
5231 | }
|
---|
5232 | if(t!=null){
|
---|
5233 | i[d++]=t
|
---|
5234 | }
|
---|
5235 | i[d++]="</td>";
|
---|
5236 | return d
|
---|
5237 | };
|
---|
5238 | DwtPropertyPage.prototype._createHTML=function(){}
|
---|
5239 | }
|
---|
5240 | if(AjxPackage.define("ajax.dwt.widgets.DwtTabView")){
|
---|
5241 | DwtTabView=function(t){
|
---|
5242 | if(arguments.length==0){
|
---|
5243 | return
|
---|
5244 | }
|
---|
5245 | t=Dwt.getParams(arguments,DwtListView.PARAMS);
|
---|
5246 | t.className=t.className||"ZTabView";
|
---|
5247 | t.posStyle=t.posStyle||DwtControl.ABSOLUTE_STYLE;
|
---|
5248 | DwtComposite.call(this,t);
|
---|
5249 | this._stateChangeEv=new DwtEvent(true);
|
---|
5250 | this._stateChangeEv.item=this;
|
---|
5251 | this._tabs=[];
|
---|
5252 | this._tabIx=1;
|
---|
5253 | this._createHtml();
|
---|
5254 | var e=[this.toString(),this._htmlElId].join("-");
|
---|
5255 | this._tabGroup=new DwtTabGroup(e);
|
---|
5256 | this._tabGroup.addMember(this._tabBar)
|
---|
5257 | };
|
---|
5258 | DwtTabView.PARAMS=["parent","className","posStyle"];
|
---|
5259 | DwtTabView.prototype=new DwtComposite;
|
---|
5260 | DwtTabView.prototype.constructor=DwtTabView;
|
---|
5261 | DwtTabView.Z_ACTIVE_TAB=Dwt.Z_VIEW+10;
|
---|
5262 | DwtTabView.Z_HIDDEN_TAB=Dwt.Z_HIDDEN;
|
---|
5263 | DwtTabView.Z_TAB_PANEL=Dwt.Z_VIEW+20;
|
---|
5264 | DwtTabView.Z_CURTAIN=Dwt.Z_CURTAIN;
|
---|
5265 | DwtTabView.prototype.TEMPLATE="dwt.Widgets#ZTabView";
|
---|
5266 | DwtTabView.prototype.toString=function(){
|
---|
5267 | return"DwtTabView"
|
---|
5268 | };
|
---|
5269 | DwtTabView.prototype.addStateChangeListener=function(e){
|
---|
5270 | this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e)
|
---|
5271 | };
|
---|
5272 | DwtTabView.prototype.removeStateChangeListener=function(e){
|
---|
5273 | this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e)
|
---|
5274 | };
|
---|
5275 | DwtTabView.prototype.getTabGroupMember=function(){
|
---|
5276 | return this._tabGroup
|
---|
5277 | };
|
---|
5278 | DwtTabView.prototype.addTab=function(o,i,t,e){
|
---|
5279 | var a=this._tabIx++;
|
---|
5280 | this._tabs[a]={
|
---|
5281 | title:o,button:this._tabBar.addButton(a,o,t,e)};
|
---|
5282 | this.setTabView(a,i);
|
---|
5283 | if(a==1){
|
---|
5284 | if(i instanceof AjxCallback){
|
---|
5285 | i=i.run(a)
|
---|
5286 | }
|
---|
5287 | if(i){
|
---|
5288 | i.showMe()
|
---|
5289 | }
|
---|
5290 | this._currentTabKey=a;
|
---|
5291 | this.switchToTab(a)
|
---|
5292 | }else{
|
---|
5293 | if(i&&!(i instanceof AjxCallback)){
|
---|
5294 | i.hideMe();
|
---|
5295 | Dwt.setVisible(i.getHtmlElement(),false)
|
---|
5296 | }}
|
---|
5297 | this._tabBar.addSelectionListener(a,new AjxListener(this,DwtTabView.prototype._tabButtonListener));
|
---|
5298 | return a
|
---|
5299 | };
|
---|
5300 | DwtTabView.prototype.enable=function(e){
|
---|
5301 | for(var a in this._tabs){
|
---|
5302 | var t=this._tabs[a].button;
|
---|
5303 | if(t){
|
---|
5304 | t.setEnabled(e)
|
---|
5305 | }}};
|
---|
5306 | DwtTabView.prototype.getCurrentTab=function(){
|
---|
5307 | return this._currentTabKey
|
---|
5308 | };
|
---|
5309 | DwtTabView.prototype.getNumTabs=function(){
|
---|
5310 | return(this._tabs.length-1)
|
---|
5311 | };
|
---|
5312 | DwtTabView.prototype.getTab=function(e){
|
---|
5313 | return(this._tabs&&this._tabs[e])?this._tabs[e]:null
|
---|
5314 | };
|
---|
5315 | DwtTabView.prototype.getTabBar=function(){
|
---|
5316 | return this._tabBar
|
---|
5317 | };
|
---|
5318 | DwtTabView.prototype.getTabTitle=function(e){
|
---|
5319 | return(this._tabs&&this._tabs[e])?this._tabs[e]["title"]:null
|
---|
5320 | };
|
---|
5321 | DwtTabView.prototype.getTabButton=function(e){
|
---|
5322 | return(this._tabs&&this._tabs[e])?this._tabs[e]["button"]:null
|
---|
5323 | };
|
---|
5324 | DwtTabView.prototype.setTabView=function(i,a){
|
---|
5325 | var t=this.getTab(i);
|
---|
5326 | t.view=a;
|
---|
5327 | if(a&&!(a instanceof AjxCallback)){
|
---|
5328 | this._pageEl.appendChild(a.getHtmlElement());
|
---|
5329 | a._tabKey=i;
|
---|
5330 | if(i==this._currentTabKey){
|
---|
5331 | var e=a.getTabGroupMember();
|
---|
5332 | this._tabGroup.replaceMember(t.tabGroup,e);
|
---|
5333 | t.tabGroup=e
|
---|
5334 | }}};
|
---|
5335 | DwtTabView.prototype.getTabView=function(i){
|
---|
5336 | var a=this.getTab(i);
|
---|
5337 | var t=a&&a.view;
|
---|
5338 | if(t instanceof AjxCallback){
|
---|
5339 | var o=t;
|
---|
5340 | t=o.run(i);
|
---|
5341 | this.setTabView(i,t);
|
---|
5342 | var e=this._getTabSize();
|
---|
5343 | t.setSize(e.x,e.y)
|
---|
5344 | }
|
---|
5345 | return t
|
---|
5346 | };
|
---|
5347 | DwtTabView.prototype.switchToTab=function(a){
|
---|
5348 | var t=this.getTab(a);
|
---|
5349 | if(t){
|
---|
5350 | var e=this.getTab(this._currentTabKey);
|
---|
5351 | if(e){
|
---|
5352 | this._tabGroup.removeMember(e.tabGroup)
|
---|
5353 | }
|
---|
5354 | this._showTab(a);
|
---|
5355 | this._tabBar.openTab(a);
|
---|
5356 | if(!t.tabGroup&&t.view){
|
---|
5357 | t.tabGroup=t.view.getTabGroupMember()
|
---|
5358 | }
|
---|
5359 | this._tabGroup.addMember(t.tabGroup);
|
---|
5360 | if(this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
|
---|
5361 | this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
|
---|
5362 | }}};
|
---|
5363 | DwtTabView.prototype.setBounds=function(t,i,a,e){
|
---|
5364 | DwtComposite.prototype.setBounds.call(this,t,i,a,e);
|
---|
5365 | this._resetTabSizes(a,e)
|
---|
5366 | };
|
---|
5367 | DwtTabView.prototype.getActiveView=function(){
|
---|
5368 | return this._tabs[this._currentTabKey].view
|
---|
5369 | };
|
---|
5370 | DwtTabView.prototype.getKeyMapName=function(){
|
---|
5371 | return"DwtTabView"
|
---|
5372 | };
|
---|
5373 | DwtTabView.prototype.resetKeyBindings=function(){
|
---|
5374 | var t=this.shell.getKeyboardMgr();
|
---|
5375 | if(t.isEnabled()){
|
---|
5376 | var n=t.__keyMapMgr;
|
---|
5377 | if(!n){
|
---|
5378 | return
|
---|
5379 | }
|
---|
5380 | var o=this.getNumTabs();
|
---|
5381 | var h=n.getKeySequences("DwtTabView","GoToTab");
|
---|
5382 | for(var e=0;
|
---|
5383 | e<h.length;
|
---|
5384 | e++){
|
---|
5385 | var l=h[e];
|
---|
5386 | for(var a=1;
|
---|
5387 | a<=o;
|
---|
5388 | a++){
|
---|
5389 | var s=48+a;
|
---|
5390 | var c=l.replace(/NNN/,s);
|
---|
5391 | n.setMapping("DwtTabView",c,"GoToTab"+a)
|
---|
5392 | }}
|
---|
5393 | n.reloadMap("DwtTabView")
|
---|
5394 | }};
|
---|
5395 | DwtTabView.prototype.handleKeyAction=function(i){
|
---|
5396 | switch(i){
|
---|
5397 | case DwtKeyMap.NEXT_TAB:var a=this.getCurrentTab();
|
---|
5398 | if(a<this.getNumTabs()){
|
---|
5399 | this.switchToTab(a+1)
|
---|
5400 | }
|
---|
5401 | break;
|
---|
5402 | case DwtKeyMap.PREV_TAB:var a=this.getCurrentTab();
|
---|
5403 | if(a>1){
|
---|
5404 | this.switchToTab(a-1)
|
---|
5405 | }
|
---|
5406 | break;
|
---|
5407 | default:var t=i.match(DwtKeyMap.GOTO_TAB_RE);
|
---|
5408 | if(t&&t.length){
|
---|
5409 | var e=t[1];
|
---|
5410 | if((e<=this.getNumTabs())&&(e!=this.getCurrentTab())){
|
---|
5411 | this.switchToTab(e)
|
---|
5412 | }}else{
|
---|
5413 | return false
|
---|
5414 | }}
|
---|
5415 | return true
|
---|
5416 | };
|
---|
5417 | DwtTabView.prototype._resetTabSizes=function(a,e){
|
---|
5418 | if(this._tabs&&this._tabs.length){
|
---|
5419 | for(var o in this._tabs){
|
---|
5420 | var t=this._tabs[o].view;
|
---|
5421 | if(t&&!(t instanceof AjxCallback)){
|
---|
5422 | var i;
|
---|
5423 | i=i||e-Dwt.getSize(this._tabBarEl).y;
|
---|
5424 | t.resetSize(a,i)
|
---|
5425 | }}}};
|
---|
5426 | DwtTabView.prototype._getTabSize=function(){
|
---|
5427 | var t=this.getSize();
|
---|
5428 | var a=t.x||this.getHtmlElement().clientWidth;
|
---|
5429 | var e=t.y||this.getHtmlElement().clientHeight;
|
---|
5430 | var i=this._tabBar.getSize();
|
---|
5431 | var o=i.y||this._tabBar.getHtmlElement().clientHeight;
|
---|
5432 | return new DwtPoint(a,(e-o))
|
---|
5433 | };
|
---|
5434 | DwtTabView.prototype._createHtml=function(e){
|
---|
5435 | this._createHtmlFromTemplate(e||this.TEMPLATE,{
|
---|
5436 | id:this._htmlElId}
|
---|
5437 | )
|
---|
5438 | };
|
---|
5439 | DwtTabView.prototype._createHtmlFromTemplate=function(e,t){
|
---|
5440 | DwtComposite.prototype._createHtmlFromTemplate.call(this,e,t);
|
---|
5441 | this._tabBarEl=document.getElementById(t.id+"_tabbar");
|
---|
5442 | this._tabBar=new DwtTabBar(this);
|
---|
5443 | this._tabBar.reparentHtmlElement(this._tabBarEl);
|
---|
5444 | this._pageEl=document.getElementById(t.id+"_page")
|
---|
5445 | };
|
---|
5446 | DwtTabView.prototype._showTab=function(t){
|
---|
5447 | if(this._tabs&&this._tabs[t]){
|
---|
5448 | this._currentTabKey=t;
|
---|
5449 | this._hideAllTabs();
|
---|
5450 | var e=this.getTabView(t);
|
---|
5451 | if(e){
|
---|
5452 | e.setVisible(true);
|
---|
5453 | e.showMe()
|
---|
5454 | }}};
|
---|
5455 | DwtTabView.prototype._hideAllTabs=function(){
|
---|
5456 | if(this._tabs&&this._tabs.length){
|
---|
5457 | for(var t in this._tabs){
|
---|
5458 | var e=this._tabs[t].view;
|
---|
5459 | if(e&&!(e instanceof AjxCallback)){
|
---|
5460 | e.hideMe();
|
---|
5461 | Dwt.setVisible(e.getHtmlElement(),false)
|
---|
5462 | }}}};
|
---|
5463 | DwtTabView.prototype._tabButtonListener=function(e){
|
---|
5464 | this.switchToTab(e.item.getData("tabKey"))
|
---|
5465 | };
|
---|
5466 | DwtTabViewPage=function(a,t,e){
|
---|
5467 | if(arguments.length==0){
|
---|
5468 | return
|
---|
5469 | }
|
---|
5470 | params=Dwt.getParams(arguments,DwtTabViewPage.PARAMS);
|
---|
5471 | params.className=params.className||"ZTabPage";
|
---|
5472 | params.posStyle=params.posStyle||DwtControl.ABSOLUTE_STYLE;
|
---|
5473 | this._rendered=true;
|
---|
5474 | DwtPropertyPage.call(this,params);
|
---|
5475 | this._createHtml();
|
---|
5476 | this.getHtmlElement().style.overflowY="auto";
|
---|
5477 | this.getHtmlElement().style.overflowX="visible";
|
---|
5478 | if(params.contentTemplate){
|
---|
5479 | this.getContentHtmlElement().innerHTML=AjxTemplate.expand(params.contentTemplate,this._htmlElId)
|
---|
5480 | }};
|
---|
5481 | DwtTabViewPage.prototype=new DwtPropertyPage;
|
---|
5482 | DwtTabViewPage.prototype.constructor=DwtTabViewPage;
|
---|
5483 | DwtTabViewPage.prototype.toString=function(){
|
---|
5484 | return"DwtTabViewPage"
|
---|
5485 | };
|
---|
5486 | DwtTabViewPage.prototype.TEMPLATE="dwt.Widgets#ZTabPage";
|
---|
5487 | DwtTabViewPage.PARAMS=DwtPropertyPage.PARAMS.concat("contentTemplate");
|
---|
5488 | DwtTabViewPage.prototype.getContentHtmlElement=function(){
|
---|
5489 | return this._contentEl||this.getHtmlElement()
|
---|
5490 | };
|
---|
5491 | DwtTabViewPage.prototype.showMe=function(){
|
---|
5492 | this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
|
---|
5493 | if(this.parent.getHtmlElement().offsetHeight>80){
|
---|
5494 | this._contentEl.style.height=this.parent.getHtmlElement().offsetHeight-80
|
---|
5495 | }else{
|
---|
5496 | var t=parseInt(this.parent.getHtmlElement().style.height);
|
---|
5497 | var e=AjxStringUtil.getUnitsFromSizeString(this.parent.getHtmlElement().style.height);
|
---|
5498 | if(t>80){
|
---|
5499 | this._contentEl.style.height=(Number(t-80).toString()+e)
|
---|
5500 | }}
|
---|
5501 | this._contentEl.style.width=this.parent.getHtmlElement().style.width
|
---|
5502 | };
|
---|
5503 | DwtTabViewPage.prototype.hideMe=function(){
|
---|
5504 | this.setZIndex(DwtTabView.Z_HIDDEN_TAB)
|
---|
5505 | };
|
---|
5506 | DwtTabViewPage.prototype.resetSize=function(t,e){
|
---|
5507 | this.setSize(t,e)
|
---|
5508 | };
|
---|
5509 | DwtTabViewPage.prototype._createHtml=function(e){
|
---|
5510 | this._createHtmlFromTemplate(e||this.TEMPLATE,{
|
---|
5511 | id:this._htmlElId}
|
---|
5512 | )
|
---|
5513 | };
|
---|
5514 | DwtTabViewPage.prototype._createHtmlFromTemplate=function(e,t){
|
---|
5515 | DwtPropertyPage.prototype._createHtmlFromTemplate.call(this,e,t);
|
---|
5516 | this._contentEl=document.getElementById(t.id+"_content")||this.getHtmlElement()
|
---|
5517 | };
|
---|
5518 | DwtTabBar=function(a,t,i){
|
---|
5519 | if(arguments.length==0){
|
---|
5520 | return
|
---|
5521 | }
|
---|
5522 | this._buttons=[];
|
---|
5523 | this._btnStyle=i||"ZTab";
|
---|
5524 | this._btnImage=null;
|
---|
5525 | this._currentTabKey=1;
|
---|
5526 | var e=t||"ZTabBar";
|
---|
5527 | DwtToolBar.call(this,{
|
---|
5528 | parent:a,className:e,posStyle:DwtControl.STATIC_STYLE}
|
---|
5529 | )
|
---|
5530 | };
|
---|
5531 | DwtTabBar.prototype=new DwtToolBar;
|
---|
5532 | DwtTabBar.prototype.constructor=DwtTabBar;
|
---|
5533 | DwtTabBar.prototype.TEMPLATE="dwt.Widgets#ZTabBar";
|
---|
5534 | DwtTabBar.prototype.toString=function(){
|
---|
5535 | return"DwtTabBar"
|
---|
5536 | };
|
---|
5537 | DwtTabBar.prototype.getCurrentTab=function(){
|
---|
5538 | return this._currentTabKey
|
---|
5539 | };
|
---|
5540 | DwtTabBar.prototype.addStateChangeListener=function(e){
|
---|
5541 | this._eventMgr.addListener(DwtEvent.STATE_CHANGE,e)
|
---|
5542 | };
|
---|
5543 | DwtTabBar.prototype.removeStateChangeListener=function(e){
|
---|
5544 | this._eventMgr.removeListener(DwtEvent.STATE_CHANGE,e)
|
---|
5545 | };
|
---|
5546 | DwtTabBar.prototype.addSelectionListener=function(t,e){
|
---|
5547 | this._buttons[t].addSelectionListener(e)
|
---|
5548 | };
|
---|
5549 | DwtTabBar.prototype.removeSelectionListener=function(t,e){
|
---|
5550 | this._buttons[t].removeSelectionListener(e)
|
---|
5551 | };
|
---|
5552 | DwtTabBar.prototype.addButton=function(n,o,s,a){
|
---|
5553 | var t=this._buttons[n]=new DwtTabButton(this,s,a);
|
---|
5554 | this._buttons[n].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
|
---|
5555 | if(this._btnImage!=null){
|
---|
5556 | t.setImage(this._btnImage)
|
---|
5557 | }
|
---|
5558 | if(o!=null){
|
---|
5559 | t.setText(o)
|
---|
5560 | }
|
---|
5561 | t.setEnabled(true);
|
---|
5562 | t.setData("tabKey",n);
|
---|
5563 | if(parseInt(n)==1){
|
---|
5564 | this.openTab(n,true)
|
---|
5565 | }
|
---|
5566 | var e=this.__getButtonIndex(this._currentTabKey);
|
---|
5567 | if(e!=-1){
|
---|
5568 | var i=this.__getButtonIndex(n);
|
---|
5569 | if(i==e+1){
|
---|
5570 | Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT)
|
---|
5571 | }}
|
---|
5572 | return t
|
---|
5573 | };
|
---|
5574 | DwtTabBar.prototype.getButton=function(e){
|
---|
5575 | return(this._buttons[e])?this._buttons[e]:null
|
---|
5576 | };
|
---|
5577 | DwtTabBar.prototype.openTab=function(e,o){
|
---|
5578 | this._currentTabKey=e;
|
---|
5579 | var i=this._buttons.length;
|
---|
5580 | for(var t=0;
|
---|
5581 | t<i;
|
---|
5582 | t++){
|
---|
5583 | if(t==e){
|
---|
5584 | continue
|
---|
5585 | }
|
---|
5586 | var a=this._buttons[t];
|
---|
5587 | if(a){
|
---|
5588 | this.__markPrevNext(t,false);
|
---|
5589 | a.setClosed()
|
---|
5590 | }}
|
---|
5591 | var a=this._buttons[e];
|
---|
5592 | if(a){
|
---|
5593 | a.setOpen();
|
---|
5594 | this.__markPrevNext(e,true)
|
---|
5595 | }
|
---|
5596 | if(!o&&this._eventMgr.isListenerRegistered(DwtEvent.STATE_CHANGE)){
|
---|
5597 | this._eventMgr.notifyListeners(DwtEvent.STATE_CHANGE,this._stateChangeEv)
|
---|
5598 | }};
|
---|
5599 | DwtTabBar._setActiveTab=function(a){
|
---|
5600 | var e;
|
---|
5601 | if(a&&a.item){
|
---|
5602 | e=a.item.getData("tabKey")
|
---|
5603 | }else{
|
---|
5604 | if(a&&a.target){
|
---|
5605 | var t=a.target;
|
---|
5606 | while(t.tagName!="TABLE"&&t.offsetParent){
|
---|
5607 | t=t.offsetParent
|
---|
5608 | }
|
---|
5609 | e=t.getAttribute("tabKey");
|
---|
5610 | if(e==null){
|
---|
5611 | return false
|
---|
5612 | }}else{
|
---|
5613 | return false
|
---|
5614 | }}
|
---|
5615 | this.openTab(e)
|
---|
5616 | };
|
---|
5617 | DwtTabButton=function(t,a,e){
|
---|
5618 | if(arguments.length==0){
|
---|
5619 | return
|
---|
5620 | }
|
---|
5621 | DwtButton.call(this,{
|
---|
5622 | parent:t,className:"ZTab",id:a,index:e}
|
---|
5623 | )
|
---|
5624 | };
|
---|
5625 | DwtTabButton.prototype=new DwtButton;
|
---|
5626 | DwtTabButton.prototype.constructor=DwtTabButton;
|
---|
5627 | DwtTabButton.prototype.TEMPLATE="dwt.Widgets#ZTab";
|
---|
5628 | DwtTabButton.prototype.toString=function(){
|
---|
5629 | return"DwtTabButton"
|
---|
5630 | };
|
---|
5631 | DwtTabButton.prototype.setOpen=function(){
|
---|
5632 | this._isSelected=true;
|
---|
5633 | this.setDisplayState(DwtControl.SELECTED)
|
---|
5634 | };
|
---|
5635 | DwtTabButton.prototype.setClosed=function(){
|
---|
5636 | this._isSelected=false;
|
---|
5637 | this.setDisplayState(DwtControl.NORMAL)
|
---|
5638 | };
|
---|
5639 | DwtTabButton.prototype.setDisplayState=function(e){
|
---|
5640 | if(this._isSelected&&e!=DwtControl.SELECTED){
|
---|
5641 | e=[DwtControl.SELECTED,e].join(" ")
|
---|
5642 | }
|
---|
5643 | DwtButton.prototype.setDisplayState.call(this,e)
|
---|
5644 | };
|
---|
5645 | DwtTabBarFloat=function(t,e,a){
|
---|
5646 | if(arguments.length==0){
|
---|
5647 | return
|
---|
5648 | }
|
---|
5649 | DwtTabBar.call(this,t,e,a)
|
---|
5650 | };
|
---|
5651 | DwtTabBarFloat.prototype=new DwtTabBar;
|
---|
5652 | DwtTabBarFloat.prototype.constructor=DwtTabBarFloat;
|
---|
5653 | DwtTabBarFloat.prototype.TEMPLATE="dwt.Widgets#ZTabBarFloat";
|
---|
5654 | DwtTabBarFloat.prototype.addButton=function(o,i,n){
|
---|
5655 | var t=this._buttons[o]=new DwtTabButtonFloat(this,n);
|
---|
5656 | this._buttons[o].addSelectionListener(new AjxListener(this,DwtTabBar._setActiveTab));
|
---|
5657 | if(this._btnImage!=null){
|
---|
5658 | t.setImage(this._btnImage)
|
---|
5659 | }
|
---|
5660 | if(i!=null){
|
---|
5661 | t.setText(i)
|
---|
5662 | }
|
---|
5663 | t.setEnabled(true);
|
---|
5664 | t.setData("tabKey",o);
|
---|
5665 | if(parseInt(o)==1){
|
---|
5666 | this.openTab(o,true)
|
---|
5667 | }
|
---|
5668 | var e=this.__getButtonIndex(this._currentTabKey);
|
---|
5669 | if(e!=-1){
|
---|
5670 | var a=this.__getButtonIndex(o);
|
---|
5671 | if(a==e+1){
|
---|
5672 | Dwt.addClass(t.getHtmlElement(),DwtTabBar.SELECTED_NEXT)
|
---|
5673 | }}
|
---|
5674 | return t
|
---|
5675 | };
|
---|
5676 | DwtTabBarFloat.prototype.addChild=function(t,e){
|
---|
5677 | DwtComposite.prototype.addChild.apply(this,arguments);
|
---|
5678 | this._addItem(DwtToolBar.ELEMENT,t,e)
|
---|
5679 | };
|
---|
5680 | DwtTabBarFloat.prototype._addItem=function(i,a,t){
|
---|
5681 | var o=this._items[t]||this._suffixEl;
|
---|
5682 | var e=t||(typeof t=="number")?t:this._items.length;
|
---|
5683 | this._items.splice(e,0,a);
|
---|
5684 | this._itemsEl.insertBefore(a.getHtmlElement(),o)
|
---|
5685 | };
|
---|
5686 | DwtTabButtonFloat=function(e,t){
|
---|
5687 | DwtTabButton.call(this,e,t)
|
---|
5688 | };
|
---|
5689 | DwtTabButtonFloat.prototype=new DwtTabButton;
|
---|
5690 | DwtTabButtonFloat.prototype.constructor=DwtTabButtonFloat;
|
---|
5691 | DwtTabButtonFloat.prototype.TEMPLATE="dwt.Widgets#ZTabFloat"
|
---|
5692 | }
|
---|
5693 | if(AjxPackage.define("ajax.dwt.widgets.DwtWizardDialog")){
|
---|
5694 | DwtWizardDialog=function(o,i,l,e,a){
|
---|
5695 | if(arguments.length==0){
|
---|
5696 | return
|
---|
5697 | }
|
---|
5698 | i=i||"DwtDialog";
|
---|
5699 | var s=new DwtDialog_ButtonDescriptor(DwtWizardDialog.NEXT_BUTTON,AjxMsg._next,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goNext));
|
---|
5700 | var t=new DwtDialog_ButtonDescriptor(DwtWizardDialog.PREV_BUTTON,AjxMsg._prev,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.goPrev));
|
---|
5701 | var n=new DwtDialog_ButtonDescriptor(DwtWizardDialog.FINISH_BUTTON,AjxMsg._finish,DwtDialog.ALIGN_RIGHT,new AjxCallback(this,this.finishWizard));
|
---|
5702 | DwtDialog.call(this,{
|
---|
5703 | parent:o,className:i,standardButtons:[DwtDialog.CANCEL_BUTTON],extraButtons:[t,s,n]}
|
---|
5704 | );
|
---|
5705 | if(!e){
|
---|
5706 | this._contentW="80ex"
|
---|
5707 | }else{
|
---|
5708 | this._contentW=e
|
---|
5709 | }
|
---|
5710 | if(!a){
|
---|
5711 | this._contentH="100ex"
|
---|
5712 | }else{
|
---|
5713 | this._contentH=a
|
---|
5714 | }
|
---|
5715 | this._pages=new Array();
|
---|
5716 | this._pageIx=1;
|
---|
5717 | this._currentPage=1;
|
---|
5718 | this._progressDiv=document.createElement("div");
|
---|
5719 | this._progressDiv.style.position=DwtControl.STATIC_STYLE;
|
---|
5720 | this._pageDiv=document.createElement("div");
|
---|
5721 | this._pageDiv.className="DwtWizardDialogPageDiv";
|
---|
5722 | this._pageDiv.style.width=this._contentW;
|
---|
5723 | this._pageDiv.style.height=this._contentH;
|
---|
5724 | this._progressBar=new DwtWizProgressBar(this);
|
---|
5725 | this._createContentHtml();
|
---|
5726 | this.setTitle(l)
|
---|
5727 | };
|
---|
5728 | DwtWizardDialog.prototype=new DwtDialog;
|
---|
5729 | DwtWizardDialog.prototype.constructor=DwtWizardDialog;
|
---|
5730 | DwtWizardDialog.Z_ACTIVE_PAGE=Dwt.Z_VIEW+10;
|
---|
5731 | DwtWizardDialog.Z_HIDDEN_PAGE=Dwt.Z_HIDDEN;
|
---|
5732 | DwtWizardDialog.Z_TAB_PANEL=Dwt.Z_VIEW+20;
|
---|
5733 | DwtWizardDialog.Z_CURTAIN=Dwt.Z_CURTAIN;
|
---|
5734 | DwtWizardDialog.NEXT_BUTTON=12;
|
---|
5735 | DwtWizardDialog.PREV_BUTTON=11;
|
---|
5736 | DwtWizardDialog.FINISH_BUTTON=13;
|
---|
5737 | DwtWizardDialog.prototype.toString=function(){
|
---|
5738 | return"DwtWizardDialog"
|
---|
5739 | };
|
---|
5740 | DwtWizardDialog.prototype.popdown=function(){
|
---|
5741 | DwtDialog.prototype.popdown.call(this);
|
---|
5742 | this._hideAllPages()
|
---|
5743 | };
|
---|
5744 | DwtWizardDialog.prototype.goPage=function(e){
|
---|
5745 | if(this._pages&&this._pages[e]){
|
---|
5746 | this._currentPage=e;
|
---|
5747 | this._showPage(e);
|
---|
5748 | this._progressBar.showStep(e);
|
---|
5749 | this._pages[e].setActive()
|
---|
5750 | }};
|
---|
5751 | DwtWizardDialog.prototype.goNext=function(){
|
---|
5752 | var e=this._currentPage+1;
|
---|
5753 | if(this._pages&&this._pages[this._currentPage]){
|
---|
5754 | this._pages[this._currentPage].switchToNextPage(e)
|
---|
5755 | }};
|
---|
5756 | DwtWizardDialog.prototype.goPrev=function(){
|
---|
5757 | var e=this._currentPage-1;
|
---|
5758 | if(this._pages&&this._pages[this._currentPage]){
|
---|
5759 | this._pages[this._currentPage].switchToPrevPage(e)
|
---|
5760 | }};
|
---|
5761 | DwtWizardDialog.prototype.finishWizard=function(){
|
---|
5762 | this.popdown()
|
---|
5763 | };
|
---|
5764 | DwtWizardDialog.prototype.getPage=function(e){
|
---|
5765 | if(this._pages&&this._pages[e]){
|
---|
5766 | return this._pages[e]
|
---|
5767 | }else{
|
---|
5768 | return null
|
---|
5769 | }};
|
---|
5770 | DwtWizardDialog.prototype.addPage=function(e,t){
|
---|
5771 | var a=this._pageIx++;
|
---|
5772 | this._pages[a]=e;
|
---|
5773 | this._progressBar.addStep(a,t);
|
---|
5774 | this._pageDiv.appendChild(this._pages[a].getHtmlElement());
|
---|
5775 | if(a==1){
|
---|
5776 | this._pages[a].setZIndex(DwtWizardDialog.Z_ACTIVE_PAGE)
|
---|
5777 | }else{
|
---|
5778 | this._pages[a].setZIndex(DwtWizardDialog.Z_HIDDEN_PAGE);
|
---|
5779 | Dwt.setVisible(this._pages[a].getHtmlElement(),false)
|
---|
5780 | }
|
---|
5781 | return a
|
---|
5782 | };
|
---|
5783 | DwtWizardDialog.prototype._createContentHtml=function(){
|
---|
5784 | this._table=document.createElement("table");
|
---|
5785 | this._table.border=0;
|
---|
5786 | this._table.width=this._contentW;
|
---|
5787 | this._table.cellPadding=this._table.cellSpacing=0;
|
---|
5788 | this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
|
---|
5789 | var i;
|
---|
5790 | var o;
|
---|
5791 | i=this._table.insertRow(0);
|
---|
5792 | i.align="left";
|
---|
5793 | i.vAlign="middle";
|
---|
5794 | o=i.insertCell(i.cells.length);
|
---|
5795 | o.align="left";
|
---|
5796 | o.vAlign="middle";
|
---|
5797 | o.noWrap=true;
|
---|
5798 | o.width="100%";
|
---|
5799 | o.className="DwtTabTable";
|
---|
5800 | o.appendChild(this._progressBar.getHtmlElement());
|
---|
5801 | var s;
|
---|
5802 | var e;
|
---|
5803 | s=this._table.insertRow(1);
|
---|
5804 | s.align="center";
|
---|
5805 | s.vAlign="middle";
|
---|
5806 | e=s.insertCell(s.cells.length);
|
---|
5807 | e.align="left";
|
---|
5808 | e.vAlign="middle";
|
---|
5809 | e.noWrap=true;
|
---|
5810 | e.style.width=this._contentW;
|
---|
5811 | var n=document.createElement("div");
|
---|
5812 | n.className="horizSep";
|
---|
5813 | n.style.width=this._contentW;
|
---|
5814 | n.style.height="5px";
|
---|
5815 | e.appendChild(n);
|
---|
5816 | var t;
|
---|
5817 | var a;
|
---|
5818 | t=this._table.insertRow(2);
|
---|
5819 | t.align="left";
|
---|
5820 | t.vAlign="middle";
|
---|
5821 | a=t.insertCell(t.cells.length);
|
---|
5822 | a.align="left";
|
---|
5823 | a.vAlign="middle";
|
---|
5824 | a.noWrap=true;
|
---|
5825 | a.width=this._contentW;
|
---|
5826 | a.appendChild(this._pageDiv);
|
---|
5827 | this._getContentDiv().appendChild(this._table)
|
---|
5828 | };
|
---|
5829 | DwtWizardDialog.prototype.addChild=function(e){
|
---|
5830 | this._children.add(e)
|
---|
5831 | };
|
---|
5832 | DwtWizardDialog.prototype._showPage=function(e){
|
---|
5833 | if(this._pages&&this._pages[e]){
|
---|
5834 | this._hideAllPages();
|
---|
5835 | this._pages[e].showMe();
|
---|
5836 | Dwt.setVisible(this._pages[e].getHtmlElement(),true)
|
---|
5837 | }};
|
---|
5838 | DwtWizardDialog.prototype._hideAllPages=function(){
|
---|
5839 | if(this._pages&&this._pages.length){
|
---|
5840 | for(var e in this._pages){
|
---|
5841 | if(this._pages[e]){
|
---|
5842 | this._pages[e].hideMe();
|
---|
5843 | Dwt.setVisible(this._pages[e].getHtmlElement(),false)
|
---|
5844 | }}}};
|
---|
5845 | DwtWizardPage=function(t,e){
|
---|
5846 | if(arguments.length==0){
|
---|
5847 | return
|
---|
5848 | }
|
---|
5849 | var a=e||"DwtDialog";
|
---|
5850 | DwtPropertyPage.call(this,t,e,DwtControl.ABSOLUTE_STYLE)
|
---|
5851 | };
|
---|
5852 | DwtWizardPage.prototype=new DwtTabViewPage;
|
---|
5853 | DwtWizardPage.prototype.constructor=DwtWizardPage;
|
---|
5854 | DwtWizardPage.prototype.toString=function(){
|
---|
5855 | return"DwtWizardPage"
|
---|
5856 | };
|
---|
5857 | DwtWizardPage.prototype.setActive=function(){};
|
---|
5858 | DwtWizardPage.prototype.switchToNextPage=function(e){
|
---|
5859 | this.parent.goPage(e)
|
---|
5860 | };
|
---|
5861 | DwtWizardPage.prototype.switchToPrevPage=function(e){
|
---|
5862 | this.parent.goPage(e)
|
---|
5863 | };
|
---|
5864 | DwtWizardPage.prototype.showMe=function(){
|
---|
5865 | this.setZIndex(DwtTabView.Z_ACTIVE_TAB);
|
---|
5866 | this.getHtmlElement().style.height=this.parent._contentH;
|
---|
5867 | this.getHtmlElement().style.width=this.parent._contentW
|
---|
5868 | };
|
---|
5869 | DwtWizProgressBar=function(e){
|
---|
5870 | if(arguments.length==0){
|
---|
5871 | return
|
---|
5872 | }
|
---|
5873 | DwtComposite.call(this,{
|
---|
5874 | parent:e,className:"DwtWizProgressBar",posStyle:DwtControl.STATIC_STYLE}
|
---|
5875 | );
|
---|
5876 | this._table=document.createElement("table");
|
---|
5877 | this._table.border=0;
|
---|
5878 | this._table.cellPadding=0;
|
---|
5879 | this._table.cellSpacing=0;
|
---|
5880 | this.getHtmlElement().appendChild(this._table);
|
---|
5881 | this._table.backgroundColor=DwtCssStyle.getProperty(this.parent.getHtmlElement(),"background-color");
|
---|
5882 | this._stepsNumber=0;
|
---|
5883 | this._steps=new Array();
|
---|
5884 | this._lblHeader=new DwtStepLabel(this);
|
---|
5885 | this._lblHeader.setText("Step 0 of 0");
|
---|
5886 | this._lblHeader.setActive(true)
|
---|
5887 | };
|
---|
5888 | DwtWizProgressBar.prototype=new DwtComposite;
|
---|
5889 | DwtWizProgressBar.prototype.constructor=DwtWizProgressBar;
|
---|
5890 | DwtWizProgressBar.prototype.toString=function(){
|
---|
5891 | return"DwtWizProgressBar"
|
---|
5892 | };
|
---|
5893 | DwtWizProgressBar.prototype.showStep=function(t){
|
---|
5894 | var e="Step "+t+" of "+this._stepsNumber;
|
---|
5895 | if(this._steps[t]){
|
---|
5896 | e=e+": "+this._steps[t]
|
---|
5897 | }
|
---|
5898 | this._lblHeader.setText(e)
|
---|
5899 | };
|
---|
5900 | DwtWizProgressBar.prototype.addStep=function(t,e){
|
---|
5901 | this._steps[t]=e;
|
---|
5902 | return(++this._stepsNumber)
|
---|
5903 | };
|
---|
5904 | DwtWizProgressBar.prototype.addChild=function(a){
|
---|
5905 | this._children.add(a);
|
---|
5906 | var t;
|
---|
5907 | var e;
|
---|
5908 | this._table.width="100%";
|
---|
5909 | t=(this._table.rows.length!=0)?this._table.rows[0]:this._table.insertRow(0);
|
---|
5910 | t.align="center";
|
---|
5911 | t.vAlign="middle";
|
---|
5912 | e=t.insertCell(t.cells.length);
|
---|
5913 | e.align="center";
|
---|
5914 | e.vAlign="middle";
|
---|
5915 | e.noWrap=true;
|
---|
5916 | e.appendChild(a.getHtmlElement())
|
---|
5917 | };
|
---|
5918 | DwtStepLabel=function(e){
|
---|
5919 | DwtLabel.call(this,{
|
---|
5920 | parent:e,style:DwtLabel.ALIGN_CENTER,className:"DwtStepLabel"}
|
---|
5921 | )
|
---|
5922 | };
|
---|
5923 | DwtStepLabel.prototype=new DwtLabel;
|
---|
5924 | DwtStepLabel.prototype.constructor=DwtStepLabel;
|
---|
5925 | DwtStepLabel.prototype.toString=function(){
|
---|
5926 | return"DwtStepLabel"
|
---|
5927 | };
|
---|
5928 | DwtStepLabel.prototype.setActive=function(e){
|
---|
5929 | if(e){
|
---|
5930 | this._textCell.className="DwtStepLabelActive"
|
---|
5931 | }else{
|
---|
5932 | this._textCell.className="DwtStepLabelInactive"
|
---|
5933 | }}
|
---|
5934 | }
|
---|
5935 | if(AjxPackage.define("ajax.dwt.widgets.DwtSelect")){
|
---|
5936 | DwtSelect=function(o){
|
---|
5937 | if(arguments.length==0){
|
---|
5938 | return
|
---|
5939 | }
|
---|
5940 | o=Dwt.getParams(arguments,DwtSelect.PARAMS);
|
---|
5941 | o.className=o.className||"ZSelect";
|
---|
5942 | o.posStyle=o.posStyle||Dwt.STATIC_STYLE;
|
---|
5943 | DwtButton.call(this,o);
|
---|
5944 | var a=AjxEnv.isIE?[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP]:[DwtEvent.ONMOUSEDOWN,DwtEvent.ONMOUSEUP,DwtEvent.ONMOUSEOVER,DwtEvent.ONMOUSEOUT];
|
---|
5945 | this._setEventHdlrs(a);
|
---|
5946 | this._hasSetMouseEvents=true;
|
---|
5947 | this._currentSelectionId=-1;
|
---|
5948 | this._options=new AjxVector();
|
---|
5949 | this._optionValuesToIndices={};
|
---|
5950 | this._selectedValue=this._selectedOption=null;
|
---|
5951 | this._cascade=o.cascade==null||o.cascade;
|
---|
5952 | var e=o.options;
|
---|
5953 | if(e){
|
---|
5954 | for(var t=0;
|
---|
5955 | t<e.length;
|
---|
5956 | ++t){
|
---|
5957 | this.addOption(e[t])
|
---|
5958 | }}
|
---|
5959 | this.setDropDownImages("SelectPullDownArrow","SelectPullDownArrowDis","SelectPullDownArrow","SelectPullDownArrow");
|
---|
5960 | this._menuCallback=new AjxListener(this,this._createMenu);
|
---|
5961 | this.setMenu(this._menuCallback,true)
|
---|
5962 | };
|
---|
5963 | DwtSelect.PARAMS=["parent","options","style","className"];
|
---|
5964 | DwtSelect.prototype=new DwtButton;
|
---|
5965 | DwtSelect.prototype.constructor=DwtSelect;
|
---|
5966 | DwtSelect.prototype.toString=function(){
|
---|
5967 | return"DwtSelect"
|
---|
5968 | };
|
---|
5969 | DwtSelect._CONTAINER_TEMPLATE="dwt.Widgets#ZSelectAutoSizingContainer";
|
---|
5970 | DwtSelect._objectIds=[null];
|
---|
5971 | DwtSelect.prototype.TEMPLATE="dwt.Widgets#ZSelect";
|
---|
5972 | DwtSelect.getObjectFromElement=function(e){
|
---|
5973 | return e&&e.dwtObj?AjxCore.objectWithId(e.dwtObj):null
|
---|
5974 | };
|
---|
5975 | DwtSelect.prototype.addOption=function(i,a,n){
|
---|
5976 | if(!i){
|
---|
5977 | return -1
|
---|
5978 | }
|
---|
5979 | var t=null;
|
---|
5980 | var h=null;
|
---|
5981 | if(typeof(i)=="string"){
|
---|
5982 | h=n!=null?n:i;
|
---|
5983 | t=new DwtSelectOption(h,a,i,this,null,null)
|
---|
5984 | }else{
|
---|
5985 | if(i instanceof DwtSelectOption){
|
---|
5986 | t=i;
|
---|
5987 | if(n){
|
---|
5988 | t.setValue(n)
|
---|
5989 | }
|
---|
5990 | a=t.isSelected()
|
---|
5991 | }else{
|
---|
5992 | if(i instanceof DwtSelectOptionData||i.value!=null){
|
---|
5993 | h=n!=null?n:i.value;
|
---|
5994 | t=new DwtSelectOption(h,i.isSelected,i.displayValue,this,null,i.image,i.selectedValue);
|
---|
5995 | a=Boolean(i.isSelected)
|
---|
5996 | }else{
|
---|
5997 | return -1
|
---|
5998 | }}}
|
---|
5999 | this._options.add(t);
|
---|
6000 | if(this._options.size()==1||a){
|
---|
6001 | this._setSelectedOption(t)
|
---|
6002 | }
|
---|
6003 | var o=this._pseudoItemsEl;
|
---|
6004 | var s=o.insertRow(-1);
|
---|
6005 | var e=s.insertCell(-1);
|
---|
6006 | e.className="ZSelectPseudoItem";
|
---|
6007 | e.innerHTML=["<div class='ZWidgetTitle'>",AjxStringUtil.htmlEncode(t.getDisplayValue()),"</div>"].join("");
|
---|
6008 | this.setMenu(this._menuCallback,true);
|
---|
6009 | this._optionValuesToIndices[t.getValue()]=this._options.size()-1;
|
---|
6010 | return(this._options.size()-1)
|
---|
6011 | };
|
---|
6012 | DwtSelect.prototype.popup=function(){
|
---|
6013 | var n=this.getMenu();
|
---|
6014 | if(!n){
|
---|
6015 | return
|
---|
6016 | }
|
---|
6017 | var i=this._selectEl;
|
---|
6018 | var t=Dwt.getBounds(i);
|
---|
6019 | var o=(i.style.borderLeftWidth=="")?0:parseInt(i.style.borderLeftWidth);
|
---|
6020 | var h=(i.style.borderTopWidth=="")?0:parseInt(i.style.borderTopWidth);
|
---|
6021 | h+=(i.style.borderBottomWidth=="")?0:parseInt(i.style.borderBottomWidth);
|
---|
6022 | var a=Dwt.toWindow(i,0,0);
|
---|
6023 | var e=a.x+o;
|
---|
6024 | var s=a.y+t.height+h;
|
---|
6025 | n.popup(0,e,s)
|
---|
6026 | };
|
---|
6027 | DwtSelect.prototype.rename=function(t,a){
|
---|
6028 | var e=this.getOptionWithValue(t);
|
---|
6029 | e._displayValue=a;
|
---|
6030 | if(this.__selectedOption&&(this.__selectedOption._value==t)){
|
---|
6031 | this.setText(AjxStringUtil.htmlEncode(a))
|
---|
6032 | }
|
---|
6033 | this.setMenu(this._menuCallback,true)
|
---|
6034 | };
|
---|
6035 | DwtSelect.prototype.enableOption=function(i,e){
|
---|
6036 | var t=this.getOptionWithValue(i);
|
---|
6037 | if(t.enabled!=e){
|
---|
6038 | t.enabled=e;
|
---|
6039 | var a=t.getItem();
|
---|
6040 | if(a){
|
---|
6041 | a.setEnabled(e)
|
---|
6042 | }}};
|
---|
6043 | DwtSelect.prototype.clearOptions=function(){
|
---|
6044 | var t=this._options.getArray();
|
---|
6045 | for(var e=0;
|
---|
6046 | e<t.length;
|
---|
6047 | ++e){
|
---|
6048 | t[e]=null
|
---|
6049 | }
|
---|
6050 | this._options.removeAll();
|
---|
6051 | this._optionValuesToIndices=null;
|
---|
6052 | this._optionValuesToIndices=[];
|
---|
6053 | this._selectedValue=null;
|
---|
6054 | this._selectedOption=null;
|
---|
6055 | this._currentSelectionId=-1
|
---|
6056 | };
|
---|
6057 | DwtSelect.prototype.setName=function(e){
|
---|
6058 | this._name=e
|
---|
6059 | };
|
---|
6060 | DwtSelect.prototype.getName=function(){
|
---|
6061 | return this._name
|
---|
6062 | };
|
---|
6063 | DwtSelect.prototype.setSelectedValue=function(t){
|
---|
6064 | var e=this._optionValuesToIndices[t];
|
---|
6065 | if(e!=null){
|
---|
6066 | this.setSelected(e)
|
---|
6067 | }};
|
---|
6068 | DwtSelect.prototype.setSelected=function(e){
|
---|
6069 | var t=this.getOptionWithHandle(e);
|
---|
6070 | this.setSelectedOption(t)
|
---|
6071 | };
|
---|
6072 | DwtSelect.prototype.getOptionCount=function(){
|
---|
6073 | return this._options.size()
|
---|
6074 | };
|
---|
6075 | DwtSelect.prototype.getOptions=function(){
|
---|
6076 | return this._options
|
---|
6077 | };
|
---|
6078 | DwtSelect.prototype.getOptionWithHandle=function(e){
|
---|
6079 | return this._options.get(e)
|
---|
6080 | };
|
---|
6081 | DwtSelect.prototype.getOptionAtIndex=DwtSelect.prototype.getOptionWithHandle;
|
---|
6082 | DwtSelect.prototype.getIndexForValue=function(e){
|
---|
6083 | return this._optionValuesToIndices[e]
|
---|
6084 | };
|
---|
6085 | DwtSelect.prototype.getOptionWithValue=function(a){
|
---|
6086 | var e=this._optionValuesToIndices[a];
|
---|
6087 | var t=null;
|
---|
6088 | if(e!=null){
|
---|
6089 | t=this.getOptionWithHandle(e)
|
---|
6090 | }
|
---|
6091 | return t
|
---|
6092 | };
|
---|
6093 | DwtSelect.prototype.setSelectedOption=function(e){
|
---|
6094 | if(e){
|
---|
6095 | this._setSelectedOption(e)
|
---|
6096 | }};
|
---|
6097 | DwtSelect.prototype.getValue=function(){
|
---|
6098 | return this._selectedValue
|
---|
6099 | };
|
---|
6100 | DwtSelect.prototype.getSelectedOption=function(){
|
---|
6101 | return this._selectedOption
|
---|
6102 | };
|
---|
6103 | DwtSelect.prototype.getSelectedIndex=function(){
|
---|
6104 | return this.getIndexForValue(this.getValue())
|
---|
6105 | };
|
---|
6106 | DwtSelect.prototype.addChangeListener=function(e){
|
---|
6107 | this.addListener(DwtEvent.ONCHANGE,e)
|
---|
6108 | };
|
---|
6109 | DwtSelect.prototype.size=function(){
|
---|
6110 | return this._options.size()
|
---|
6111 | };
|
---|
6112 | DwtSelect.prototype.disable=function(){
|
---|
6113 | this.setEnabled(false)
|
---|
6114 | };
|
---|
6115 | DwtSelect.prototype.enable=function(){
|
---|
6116 | this.setEnabled(true)
|
---|
6117 | };
|
---|
6118 | DwtSelect.prototype.setImage=function(e){
|
---|
6119 | DwtLabel.prototype.setImage.call(this,e)
|
---|
6120 | };
|
---|
6121 | DwtSelect.prototype.setText=function(e){
|
---|
6122 | DwtLabel.prototype.setText.call(this,e)
|
---|
6123 | };
|
---|
6124 | DwtSelect.prototype.dispose=function(){
|
---|
6125 | this._selectEl=null;
|
---|
6126 | this._pseudoItemsEl=null;
|
---|
6127 | this._containerEl=null;
|
---|
6128 | DwtButton.prototype.dispose.call(this);
|
---|
6129 | if(this._internalObjectId){
|
---|
6130 | DwtSelect._unassignId(this._internalObjectId)
|
---|
6131 | }};
|
---|
6132 | DwtSelect._assignId=function(e){
|
---|
6133 | var t=DwtSelect._objectIds.length;
|
---|
6134 | DwtSelect._objectIds[t]=e;
|
---|
6135 | return t
|
---|
6136 | };
|
---|
6137 | DwtSelect._getObjectWithId=function(e){
|
---|
6138 | return DwtSelect._objectIds[e]
|
---|
6139 | };
|
---|
6140 | DwtSelect._unassignId=function(e){
|
---|
6141 | DwtSelect._objectIds[e]=null
|
---|
6142 | };
|
---|
6143 | DwtSelect.prototype._createHtmlFromTemplate=function(a,o){
|
---|
6144 | var t=DwtSelect._CONTAINER_TEMPLATE;
|
---|
6145 | var e={
|
---|
6146 | id:o.id,selectTemplateId:a||this.TEMPLATE,selectData:o};
|
---|
6147 | DwtButton.prototype._createHtmlFromTemplate.call(this,t,e);
|
---|
6148 | this._selectEl=document.getElementById(o.id+"_select_container");
|
---|
6149 | this._pseudoItemsEl=document.getElementById(o.id+"_pseudoitems_container");
|
---|
6150 | this._pseudoItemsEl.style.display="none";
|
---|
6151 | var i=this.getHtmlElement();
|
---|
6152 | this._containerEl=i;
|
---|
6153 | this._selectEl.className=i.className;
|
---|
6154 | i.className="ZSelectAutoSizingContainer";
|
---|
6155 | i.setAttribute("style","");
|
---|
6156 | if(AjxEnv.isIE){
|
---|
6157 | i.style.overflow="hidden"
|
---|
6158 | }};
|
---|
6159 | DwtSelect.prototype._createMenu=function(){
|
---|
6160 | var h=new DwtSelectMenu(this);
|
---|
6161 | for(var a=0,e=this._options.size();
|
---|
6162 | a<e;
|
---|
6163 | ++a){
|
---|
6164 | var t=new DwtSelectMenuItem(h);
|
---|
6165 | var o=this._options.get(a);
|
---|
6166 | var n=o.getImage();
|
---|
6167 | if(n){
|
---|
6168 | t.setImage(n)
|
---|
6169 | }
|
---|
6170 | var s=o.getDisplayValue();
|
---|
6171 | if(s){
|
---|
6172 | t.setText(AjxStringUtil.htmlEncode(s))
|
---|
6173 | }
|
---|
6174 | t.setEnabled(o.enabled);
|
---|
6175 | t.addSelectionListener(new AjxListener(this,this._handleOptionSelection));
|
---|
6176 | t._optionIndex=a;
|
---|
6177 | o.setItem(t)
|
---|
6178 | }
|
---|
6179 | return h
|
---|
6180 | };
|
---|
6181 | DwtSelect.prototype._handleOptionSelection=function(s){
|
---|
6182 | var i=s.item;
|
---|
6183 | var n=i._optionIndex;
|
---|
6184 | var a=this._options.get(n);
|
---|
6185 | var t=this.getValue();
|
---|
6186 | this._setSelectedOption(a);
|
---|
6187 | var e=new Object();
|
---|
6188 | e.selectObj=this;
|
---|
6189 | e.newValue=a.getValue();
|
---|
6190 | e.oldValue=t;
|
---|
6191 | var o=DwtUiEvent.getEvent(s);
|
---|
6192 | o._args=e;
|
---|
6193 | this.notifyListeners(DwtEvent.ONCHANGE,o)
|
---|
6194 | };
|
---|
6195 | DwtSelect.prototype._clearOptionSelection=function(){
|
---|
6196 | if(this._currentSelectionId!=-1){
|
---|
6197 | var e=DwtSelect._getObjectWithId(this._currentSelectionId);
|
---|
6198 | e.deSelect()
|
---|
6199 | }};
|
---|
6200 | DwtSelect.prototype._setSelectedOption=function(t){
|
---|
6201 | var e=t.getSelectedValue()||t.getDisplayValue();
|
---|
6202 | var a=t.getImage();
|
---|
6203 | if(this._selectedOption!=t){
|
---|
6204 | if(e){
|
---|
6205 | this.setText(AjxStringUtil.htmlEncode(e))
|
---|
6206 | }
|
---|
6207 | this.setImage(a);
|
---|
6208 | this._selectedValue=t._value;
|
---|
6209 | this._selectedOption=t
|
---|
6210 | }
|
---|
6211 | this._updateSelection(t);
|
---|
6212 | this.autoResize()
|
---|
6213 | };
|
---|
6214 | DwtSelect.prototype.autoResize=function(){
|
---|
6215 | var e=this.getHtmlElement();
|
---|
6216 | AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
|
---|
6217 | var t=document.getElementById(e.id);
|
---|
6218 | if(t){
|
---|
6219 | t.style.width=t.childNodes[0].offsetWidth||"auto"
|
---|
6220 | }}
|
---|
6221 | ,200))
|
---|
6222 | };
|
---|
6223 | DwtSelect.prototype._updateSelection=function(e){
|
---|
6224 | var t=(this._currentSelectionId!=-1)?DwtSelect._getObjectWithId(this._currentSelectionId):null;
|
---|
6225 | if(t){
|
---|
6226 | t.deSelect()
|
---|
6227 | }
|
---|
6228 | if(e){
|
---|
6229 | e.select();
|
---|
6230 | this._currentSelectionId=e.getIdentifier()
|
---|
6231 | }};
|
---|
6232 | DwtSelect.prototype.updateRendering=function(){
|
---|
6233 | var e=this.getScrollStyle();
|
---|
6234 | this.setScrollStyle(e==Dwt.VISIBLE?Dwt.CLIP:Dwt.VISIBLE);
|
---|
6235 | var t=function(){
|
---|
6236 | try{
|
---|
6237 | this.setScrollStyle(e)
|
---|
6238 | }
|
---|
6239 | catch(i){}};
|
---|
6240 | var a=new AjxTimedAction(this,t);
|
---|
6241 | AjxTimedAction.scheduleAction(a,4)
|
---|
6242 | };
|
---|
6243 | DwtSelectOptionData=function(i,a,e,t,o){
|
---|
6244 | if(i==null||a==null){
|
---|
6245 | return null
|
---|
6246 | }
|
---|
6247 | this.value=i;
|
---|
6248 | this.displayValue=a;
|
---|
6249 | this.isSelected=e;
|
---|
6250 | this.selectedValue=t;
|
---|
6251 | this.image=o
|
---|
6252 | };
|
---|
6253 | DwtSelectOption=function(n,o,i,t,e,s,a){
|
---|
6254 | this._value=n;
|
---|
6255 | this._selected=o;
|
---|
6256 | this._displayValue=i;
|
---|
6257 | this._image=s;
|
---|
6258 | this._selectedValue=a;
|
---|
6259 | this._internalObjectId=DwtSelect._assignId(this);
|
---|
6260 | this.enabled=true
|
---|
6261 | };
|
---|
6262 | DwtSelectOption.prototype.setItem=function(e){
|
---|
6263 | this._menuItem=e
|
---|
6264 | };
|
---|
6265 | DwtSelectOption.prototype.getItem=function(e){
|
---|
6266 | return this._menuItem
|
---|
6267 | };
|
---|
6268 | DwtSelectOption.prototype.getDisplayValue=function(){
|
---|
6269 | return this._displayValue
|
---|
6270 | };
|
---|
6271 | DwtSelectOption.prototype.getImage=function(){
|
---|
6272 | return this._image
|
---|
6273 | };
|
---|
6274 | DwtSelectOption.prototype.getSelectedValue=function(){
|
---|
6275 | return this._selectedValue
|
---|
6276 | };
|
---|
6277 | DwtSelectOption.prototype.getValue=function(){
|
---|
6278 | return this._value
|
---|
6279 | };
|
---|
6280 | DwtSelectOption.prototype.setValue=function(e){
|
---|
6281 | this._value=e
|
---|
6282 | };
|
---|
6283 | DwtSelectOption.prototype.select=function(){
|
---|
6284 | this._selected=true
|
---|
6285 | };
|
---|
6286 | DwtSelectOption.prototype.deSelect=function(){
|
---|
6287 | this._selected=false
|
---|
6288 | };
|
---|
6289 | DwtSelectOption.prototype.isSelected=function(){
|
---|
6290 | return this._selected
|
---|
6291 | };
|
---|
6292 | DwtSelectOption.prototype.getIdentifier=function(){
|
---|
6293 | return this._internalObjectId
|
---|
6294 | };
|
---|
6295 | DwtSelectMenu=function(e){
|
---|
6296 | DwtMenu.call(this,{
|
---|
6297 | parent:e,style:DwtMenu.DROPDOWN_STYLE,className:"DwtMenu",cascade:e._cascade}
|
---|
6298 | )
|
---|
6299 | };
|
---|
6300 | DwtSelectMenu.prototype=new DwtMenu;
|
---|
6301 | DwtSelectMenu.prototype.constructor=DwtSelectMenu;
|
---|
6302 | DwtSelectMenu.prototype.TEMPLATE="dwt.Widgets#ZSelectMenu";
|
---|
6303 | DwtSelectMenuItem=function(e){
|
---|
6304 | DwtMenuItem.call(this,{
|
---|
6305 | parent:e,style:DwtMenuItem.SELECT_STYLE,className:"ZSelectMenuItem"}
|
---|
6306 | )
|
---|
6307 | };
|
---|
6308 | DwtSelectMenuItem.prototype=new DwtMenuItem;
|
---|
6309 | DwtSelectMenuItem.prototype.constructor=DwtSelectMenuItem;
|
---|
6310 | DwtSelectMenuItem.prototype.TEMPLATE="dwt.Widgets#ZSelectMenuItem"
|
---|
6311 | }
|
---|
6312 | if(AjxPackage.define("ajax.dwt.widgets.DwtAlert")){
|
---|
6313 | DwtAlert=function(a,t,e){
|
---|
6314 | if(arguments.length==0){
|
---|
6315 | return
|
---|
6316 | }
|
---|
6317 | t=t||"DwtAlert";
|
---|
6318 | e=e||DwtControl.STATIC_STYLE;
|
---|
6319 | DwtControl.call(this,{
|
---|
6320 | parent:a,className:t,posStyle:e}
|
---|
6321 | );
|
---|
6322 | this._alertStyle=DwtAlert.INFORMATION;
|
---|
6323 | this._createHtml()
|
---|
6324 | };
|
---|
6325 | DwtAlert.prototype=new DwtControl;
|
---|
6326 | DwtAlert.prototype.constructor=DwtAlert;
|
---|
6327 | DwtAlert.INFORMATION=0;
|
---|
6328 | DwtAlert.WARNING=1;
|
---|
6329 | DwtAlert.CRITICAL=2;
|
---|
6330 | DwtAlert._ICONS=[AjxImg.getClassForImage("Information_32"),AjxImg.getClassForImage("Warning_32"),AjxImg.getClassForImage("Critical_32")];
|
---|
6331 | DwtAlert._CLASSES=["DwtAlertInfo","DwtAlertWarn","DwtAlertCrit"];
|
---|
6332 | DwtAlert._RE_ICONS=new RegExp(DwtAlert._ICONS.join("|"));
|
---|
6333 | DwtAlert._RE_CLASSES=new RegExp(DwtAlert._CLASSES.join("|"));
|
---|
6334 | DwtAlert.prototype.TEMPLATE="dwt.Widgets#DwtAlert";
|
---|
6335 | DwtAlert.prototype.setStyle=function(e){
|
---|
6336 | this._alertStyle=e||DwtAlert.INFORMATION;
|
---|
6337 | if(this._iconDiv){
|
---|
6338 | Dwt.delClass(this._iconDiv,DwtAlert._RE_ICONS,DwtAlert._ICONS[this._alertStyle])
|
---|
6339 | }
|
---|
6340 | Dwt.delClass(this.getHtmlElement(),DwtAlert._RE_CLASSES,DwtAlert._CLASSES[this._alertStyle])
|
---|
6341 | };
|
---|
6342 | DwtAlert.prototype.getStyle=function(){
|
---|
6343 | return this._alertStyle
|
---|
6344 | };
|
---|
6345 | DwtAlert.prototype.setIconVisible=function(e){
|
---|
6346 | if(this._iconDiv){
|
---|
6347 | Dwt.setVisible(this._iconDiv,e)
|
---|
6348 | }};
|
---|
6349 | DwtAlert.prototype.getIconVisible=function(){
|
---|
6350 | return this._iconDiv?Dwt.getVisible(this._iconDiv):false
|
---|
6351 | };
|
---|
6352 | DwtAlert.prototype.setTitle=function(e){
|
---|
6353 | this._alertTitle=e;
|
---|
6354 | if(this._titleDiv){
|
---|
6355 | this._titleDiv.innerHTML=e||""
|
---|
6356 | }};
|
---|
6357 | DwtAlert.prototype.getTitle=function(){
|
---|
6358 | return this._alertTitle
|
---|
6359 | };
|
---|
6360 | DwtAlert.prototype.setContent=function(e){
|
---|
6361 | this._alertContent=e;
|
---|
6362 | if(this._contentDiv){
|
---|
6363 | this._contentDiv.innerHTML=e||""
|
---|
6364 | }};
|
---|
6365 | DwtAlert.prototype.getContent=function(){
|
---|
6366 | return this._alertContent
|
---|
6367 | };
|
---|
6368 | DwtAlert.prototype.setDismissContent=function(e){
|
---|
6369 | if(this._dismissDiv){
|
---|
6370 | e.reparentHtmlElement(this._dismissDiv.id)
|
---|
6371 | }};
|
---|
6372 | DwtAlert.prototype.getTabGroupMember=function(){
|
---|
6373 | return null
|
---|
6374 | };
|
---|
6375 | DwtAlert.prototype._createHtml=function(e){
|
---|
6376 | var t={
|
---|
6377 | id:this._htmlElId};
|
---|
6378 | this._createHtmlFromTemplate(e||this.TEMPLATE,t)
|
---|
6379 | };
|
---|
6380 | DwtAlert.prototype._createHtmlFromTemplate=function(e,t){
|
---|
6381 | DwtControl.prototype._createHtmlFromTemplate.apply(this,arguments);
|
---|
6382 | this._iconDiv=document.getElementById(t.id+"_icon");
|
---|
6383 | this._titleDiv=document.getElementById(t.id+"_title");
|
---|
6384 | this._contentDiv=document.getElementById(t.id+"_content");
|
---|
6385 | this._dismissDiv=document.getElementById(t.id+"_dismiss")
|
---|
6386 | }
|
---|
6387 | }
|
---|
6388 | if(AjxPackage.define("ajax.dwt.widgets.DwtPropertySheet")){
|
---|
6389 | DwtPropertySheet=function(o,i,a,e){
|
---|
6390 | if(arguments.length==0){
|
---|
6391 | return
|
---|
6392 | }
|
---|
6393 | i=i||"DwtPropertySheet";
|
---|
6394 | DwtComposite.call(this,{
|
---|
6395 | parent:o,className:i,posStyle:a}
|
---|
6396 | );
|
---|
6397 | this._labelSide=e||DwtPropertySheet.DEFAULT;
|
---|
6398 | this._propertyIdCount=0;
|
---|
6399 | this._propertyList=[];
|
---|
6400 | this._propertyMap={};
|
---|
6401 | this._tableEl=document.createElement("TABLE");
|
---|
6402 | this._tableEl.border=0;
|
---|
6403 | this._tableEl.cellSpacing=3;
|
---|
6404 | this._tableEl.cellPadding=0;
|
---|
6405 | var t=this.getHtmlElement();
|
---|
6406 | t.appendChild(this._tableEl)
|
---|
6407 | };
|
---|
6408 | DwtPropertySheet.prototype=new DwtComposite;
|
---|
6409 | DwtPropertySheet.prototype.constructor=DwtPropertySheet;
|
---|
6410 | DwtPropertySheet.prototype.toString=function(){
|
---|
6411 | return"DwtPropertySheet"
|
---|
6412 | };
|
---|
6413 | DwtPropertySheet.RIGHT="right";
|
---|
6414 | DwtPropertySheet.LEFT="left";
|
---|
6415 | DwtPropertySheet.DEFAULT=DwtPropertySheet.LEFT;
|
---|
6416 | DwtPropertySheet.prototype._labelSide;
|
---|
6417 | DwtPropertySheet.prototype._labelCssClass="Label";
|
---|
6418 | DwtPropertySheet.prototype._valueCssClass="Field";
|
---|
6419 | DwtPropertySheet.prototype._tableEl;
|
---|
6420 | DwtPropertySheet.prototype._propertyIdCount;
|
---|
6421 | DwtPropertySheet.prototype._propertyList;
|
---|
6422 | DwtPropertySheet.prototype._propertyMap;
|
---|
6423 | DwtPropertySheet.prototype.addProperty=function(t,i,n){
|
---|
6424 | var e=this._tableEl.rows.length;
|
---|
6425 | var o=this._tableEl.insertRow(e);
|
---|
6426 | o.vAlign=this._vAlign?this._vAlign:"top";
|
---|
6427 | if(this._labelSide==DwtPropertySheet.LEFT){
|
---|
6428 | this._insertLabel(o,t,n);
|
---|
6429 | this._insertValue(o,i,n)
|
---|
6430 | }else{
|
---|
6431 | this._insertValue(o,i,n);
|
---|
6432 | this._insertLabel(o,t,n)
|
---|
6433 | }
|
---|
6434 | var s=this._propertyIdCount++;
|
---|
6435 | var a={
|
---|
6436 | id:s,index:e,row:o,visible:true};
|
---|
6437 | this._propertyList.push(a);
|
---|
6438 | this._propertyMap[s]=a;
|
---|
6439 | return s
|
---|
6440 | };
|
---|
6441 | DwtPropertySheet.prototype._insertLabel=function(o,e,i){
|
---|
6442 | var a=o.insertCell(-1);
|
---|
6443 | a.className=this._labelCssClass;
|
---|
6444 | if(this._labelSide!=DwtPropertySheet.LEFT){
|
---|
6445 | a.width="100%";
|
---|
6446 | a.style.textAlign="left"
|
---|
6447 | }
|
---|
6448 | a.innerHTML=e;
|
---|
6449 | if(i){
|
---|
6450 | var t=this._tableEl.ownerDocument.createElement("SUP");
|
---|
6451 | t.innerHTML="*";
|
---|
6452 | a.insertBefore(t,a.firstChild)
|
---|
6453 | }};
|
---|
6454 | DwtPropertySheet.prototype._insertValue=function(i,t,a){
|
---|
6455 | var e=i.insertCell(-1);
|
---|
6456 | e.className=this._valueCssClass;
|
---|
6457 | if(!t){
|
---|
6458 | e.innerHTML=" "
|
---|
6459 | }else{
|
---|
6460 | if(t instanceof DwtControl){
|
---|
6461 | e.appendChild(t.getHtmlElement())
|
---|
6462 | }else{
|
---|
6463 | if(t.nodeType==AjxUtil.ELEMENT_NODE){
|
---|
6464 | e.appendChild(t)
|
---|
6465 | }else{
|
---|
6466 | e.innerHTML=String(t)
|
---|
6467 | }}}};
|
---|
6468 | DwtPropertySheet.prototype.removeProperty=function(s){
|
---|
6469 | var n=this._propertyMap[s];
|
---|
6470 | if(n.visible){
|
---|
6471 | var t=n.index;
|
---|
6472 | var o=this.__getTableIndex(t);
|
---|
6473 | var a=this._tableEl.rows[o];
|
---|
6474 | a.parentNode.removeChild(a)
|
---|
6475 | }
|
---|
6476 | n.row=null;
|
---|
6477 | for(var e=index+1;
|
---|
6478 | e<this._propertyList.length;
|
---|
6479 | e++){
|
---|
6480 | var n=this._propertyList[e];
|
---|
6481 | n.index--
|
---|
6482 | }
|
---|
6483 | this._propertyList.splice(index,1);
|
---|
6484 | delete this._propertyMap[s]
|
---|
6485 | };
|
---|
6486 | DwtPropertySheet.prototype.setPropertyVisible=function(n,i){
|
---|
6487 | var o=this._propertyMap[n];
|
---|
6488 | if(o.visible!=i){
|
---|
6489 | o.visible=i;
|
---|
6490 | var e=o.index;
|
---|
6491 | if(i){
|
---|
6492 | var a=this.__getTableIndex(e);
|
---|
6493 | var t=this._tableEl.insertRow(a);
|
---|
6494 | DwtPropertySheet.__moveChildNodes(o.row,t);
|
---|
6495 | o.row=t
|
---|
6496 | }else{
|
---|
6497 | var t=o.row;
|
---|
6498 | if(t&&t.parentNode){
|
---|
6499 | t.parentNode.removeChild(t)
|
---|
6500 | }}}};
|
---|
6501 | DwtPropertySheet.prototype.__getTableIndex=function(t){
|
---|
6502 | var a=0;
|
---|
6503 | for(var e=0;
|
---|
6504 | e<t;
|
---|
6505 | e++){
|
---|
6506 | var o=this._propertyList[e];
|
---|
6507 | if(o.visible){
|
---|
6508 | a++
|
---|
6509 | }}
|
---|
6510 | return a
|
---|
6511 | };
|
---|
6512 | DwtPropertySheet.__moveChildNodes=function(t,e){
|
---|
6513 | if(t===e){
|
---|
6514 | return
|
---|
6515 | }
|
---|
6516 | var a=t.firstChild;
|
---|
6517 | while(a!=null){
|
---|
6518 | e.appendChild(a);
|
---|
6519 | a=t.firstChild
|
---|
6520 | }}
|
---|
6521 | }
|
---|
6522 | if(AjxPackage.define("ajax.dwt.widgets.DwtGrouper")){
|
---|
6523 | DwtGrouper=function(i,a,t){
|
---|
6524 | if(arguments.length==0){
|
---|
6525 | return
|
---|
6526 | }
|
---|
6527 | a=a||"DwtGrouper";
|
---|
6528 | t=t||DwtControl.STATIC_STYLE;
|
---|
6529 | DwtComposite.call(this,{
|
---|
6530 | parent:i,posStyle:t}
|
---|
6531 | );
|
---|
6532 | this._labelEl=document.createElement("LEGEND");
|
---|
6533 | this._insetEl=document.createElement("DIV");
|
---|
6534 | this._borderEl=document.createElement("FIELDSET");
|
---|
6535 | this._borderEl.appendChild(this._labelEl);
|
---|
6536 | this._borderEl.appendChild(this._insetEl);
|
---|
6537 | var e=this.getHtmlElement();
|
---|
6538 | e.appendChild(this._borderEl)
|
---|
6539 | };
|
---|
6540 | DwtGrouper.prototype=new DwtComposite;
|
---|
6541 | DwtGrouper.prototype.constructor=DwtGrouper;
|
---|
6542 | DwtGrouper.prototype._borderEl;
|
---|
6543 | DwtGrouper.prototype._labelEl;
|
---|
6544 | DwtGrouper.prototype._insetEl;
|
---|
6545 | DwtGrouper.prototype.setLabel=function(e){
|
---|
6546 | Dwt.setVisible(this._labelEl,Boolean(e));
|
---|
6547 | this._labelEl.style.display="";
|
---|
6548 | this._labelEl.innerHTML=e?e:""
|
---|
6549 | };
|
---|
6550 | DwtGrouper.prototype.setContent=function(t){
|
---|
6551 | var e=this._insetEl;
|
---|
6552 | e.innerHTML=t
|
---|
6553 | };
|
---|
6554 | DwtGrouper.prototype.setElement=function(t){
|
---|
6555 | var e=this._insetEl;
|
---|
6556 | Dwt.removeChildren(e);
|
---|
6557 | e.appendChild(t)
|
---|
6558 | };
|
---|
6559 | DwtGrouper.prototype.setView=function(e){
|
---|
6560 | this.setElement(e.getHtmlElement())
|
---|
6561 | };
|
---|
6562 | DwtGrouper.prototype.getInsetHtmlElement=function(){
|
---|
6563 | return this._insetEl
|
---|
6564 | }
|
---|
6565 | }
|
---|
6566 | if(AjxPackage.define("ajax.dwt.widgets.DwtProgressBar")){
|
---|
6567 | DwtProgressBar=function(a,t,e){
|
---|
6568 | if(arguments.length==0){
|
---|
6569 | return
|
---|
6570 | }
|
---|
6571 | e=e||DwtControl.STATIC_STYLE;
|
---|
6572 | DwtComposite.call(this,{
|
---|
6573 | parent:a,posStyle:e}
|
---|
6574 | );
|
---|
6575 | this._maxValue=100;
|
---|
6576 | this._value=0;
|
---|
6577 | this._quotabarDiv=null;
|
---|
6578 | this._quotausedDiv=null;
|
---|
6579 | this._progressBgColor=null;
|
---|
6580 | this._progressCssClass="quotaused";
|
---|
6581 | this._wholeBgColor=null;
|
---|
6582 | this._wholeCssClass="quotabar";
|
---|
6583 | this._createHTML()
|
---|
6584 | };
|
---|
6585 | DwtProgressBar.prototype=new DwtComposite;
|
---|
6586 | DwtProgressBar.prototype.constructor=DwtProgressBar;
|
---|
6587 | DwtProgressBar.prototype.setProgressBgColor=function(e){
|
---|
6588 | this._progressBgColor=e
|
---|
6589 | };
|
---|
6590 | DwtProgressBar.prototype.setWholeBgColor=function(e){
|
---|
6591 | this._wholeBgColor=e
|
---|
6592 | };
|
---|
6593 | DwtProgressBar.prototype.setProgressCssClass=function(e){
|
---|
6594 | this._progressCssClass=e
|
---|
6595 | };
|
---|
6596 | DwtProgressBar.prototype.setWholeCssClass=function(e){
|
---|
6597 | this._wholeCssClass=e
|
---|
6598 | };
|
---|
6599 | DwtProgressBar.prototype.setProgressCssStyle=function(e){
|
---|
6600 | this._progressCssStyle=e
|
---|
6601 | };
|
---|
6602 | DwtProgressBar.prototype.setWholeCssStyle=function(e){
|
---|
6603 | this._wholeCssStyle=e
|
---|
6604 | };
|
---|
6605 | DwtProgressBar.prototype.setValue=function(t){
|
---|
6606 | this._value=parseInt(t);
|
---|
6607 | var e;
|
---|
6608 | if(this._value==this._maxValue){
|
---|
6609 | e=100
|
---|
6610 | }else{
|
---|
6611 | e=Math.min(Math.round((this._value/this._maxValue)*100),100)
|
---|
6612 | }
|
---|
6613 | if(isNaN(e)){
|
---|
6614 | e="0"
|
---|
6615 | }
|
---|
6616 | if(!this._quotabarDiv){
|
---|
6617 | this._quotabarDiv=document.createElement("div");
|
---|
6618 | if(this._wholeCssClass){
|
---|
6619 | this._quotabarDiv.className=this._wholeCssClass
|
---|
6620 | }
|
---|
6621 | if(this._wholeBgColor){
|
---|
6622 | this._quotabarDiv.backgroundColor=this._wholeBgColor
|
---|
6623 | }
|
---|
6624 | this._cell.appendChild(this._quotabarDiv)
|
---|
6625 | }
|
---|
6626 | if(!this._quotausedDiv){
|
---|
6627 | this._quotausedDiv=document.createElement("div");
|
---|
6628 | if(this._progressCssClass){
|
---|
6629 | this._quotausedDiv.className=this._progressCssClass
|
---|
6630 | }
|
---|
6631 | if(this._progressBgColor){
|
---|
6632 | this._quotausedDiv.style.backgroundColor=this._progressBgColor
|
---|
6633 | }
|
---|
6634 | this._quotabarDiv.appendChild(this._quotausedDiv)
|
---|
6635 | }
|
---|
6636 | this._quotausedDiv.style.width=e+"%"
|
---|
6637 | };
|
---|
6638 | DwtProgressBar.prototype.setValueByPercent=function(e){
|
---|
6639 | this.setMaxValue(100);
|
---|
6640 | this.setValue(e.replace(/\%/gi,""))
|
---|
6641 | };
|
---|
6642 | DwtProgressBar.prototype.getValue=function(){
|
---|
6643 | return this._value
|
---|
6644 | };
|
---|
6645 | DwtProgressBar.prototype.getMaxValue=function(){
|
---|
6646 | return this._maxValue
|
---|
6647 | };
|
---|
6648 | DwtProgressBar.prototype.setMaxValue=function(e){
|
---|
6649 | this._maxValue=parseInt(e)
|
---|
6650 | };
|
---|
6651 | DwtProgressBar.prototype.setLabel=function(o,t){
|
---|
6652 | var a=document.createTextNode(o);
|
---|
6653 | var e=t?-1:0;
|
---|
6654 | var i=this._row.insertCell(e);
|
---|
6655 | i.appendChild(a)
|
---|
6656 | };
|
---|
6657 | DwtProgressBar.prototype._createHTML=function(){
|
---|
6658 | this._table=document.createElement("table");
|
---|
6659 | this._table.border=this._table.cellpadding=this._table.cellspacing=0;
|
---|
6660 | this._row=this._table.insertRow(-1);
|
---|
6661 | this._cell=this._row.insertCell(-1);
|
---|
6662 | this.getHtmlElement().appendChild(this._table)
|
---|
6663 | }
|
---|
6664 | }
|
---|
6665 | if(AjxPackage.define("ajax.dwt.widgets.DwtPropertyEditor")){
|
---|
6666 | DwtPropertyEditor=function(o,t,i,a,e){
|
---|
6667 | if(arguments.length>0){
|
---|
6668 | if(!i){
|
---|
6669 | i="DwtPropertyEditor"
|
---|
6670 | }
|
---|
6671 | DwtComposite.call(this,{
|
---|
6672 | parent:o,className:i,posStyle:a,deferred:e}
|
---|
6673 | );
|
---|
6674 | this._useDwtInputField=t!=null?t:true;
|
---|
6675 | this._schema=null;
|
---|
6676 | this._init()
|
---|
6677 | }};
|
---|
6678 | DwtPropertyEditor.MSG_TIMEOUT=4000;
|
---|
6679 | DwtPropertyEditor.MSG={
|
---|
6680 | mustMatch:"This field does not match validators: REGEXP",mustNotMatch:"This field matches anti-validators: REGEXP"};
|
---|
6681 | DwtPropertyEditor.prototype=new DwtComposite;
|
---|
6682 | DwtPropertyEditor.prototype.constructor=DwtPropertyEditor;
|
---|
6683 | DwtPropertyEditor.prototype.toString=function(){
|
---|
6684 | return"DwtPropertyEditor"
|
---|
6685 | };
|
---|
6686 | DwtPropertyEditor.prototype._init=function(){
|
---|
6687 | var t=document.createElement("div");
|
---|
6688 | t.id=this._relDivId=Dwt.getNextId();
|
---|
6689 | t.style.position="relative";
|
---|
6690 | var e=document.createElement("table");
|
---|
6691 | e.id=this._tableId=Dwt.getNextId();
|
---|
6692 | e.cellSpacing=e.cellPadding=0;
|
---|
6693 | e.appendChild(document.createElement("tbody"));
|
---|
6694 | t.appendChild(e);
|
---|
6695 | this.getHtmlElement().appendChild(t);
|
---|
6696 | this.maxLabelWidth=0;
|
---|
6697 | this.maxFieldWidth=0;
|
---|
6698 | this._setMouseEventHdlrs();
|
---|
6699 | this._onMouseDown=new AjxListener(this,this._onMouseDown);
|
---|
6700 | this.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown)
|
---|
6701 | };
|
---|
6702 | DwtPropertyEditor.prototype.getRelDiv=function(){
|
---|
6703 | return document.getElementById(this._relDivId)
|
---|
6704 | };
|
---|
6705 | DwtPropertyEditor.prototype.getTable=function(){
|
---|
6706 | return document.getElementById(this._tableId)
|
---|
6707 | };
|
---|
6708 | DwtPropertyEditor.prototype._onMouseDown=function(a){
|
---|
6709 | var i=a.target;
|
---|
6710 | var e=i.tagName.toLowerCase();
|
---|
6711 | if(e=="input"){
|
---|
6712 | a._stopPropagation=false;
|
---|
6713 | a._returnValue=true;
|
---|
6714 | return true
|
---|
6715 | }
|
---|
6716 | if(this._currentInputField&&!this._currentInputField.onblur()){
|
---|
6717 | a._stopPropagation=true;
|
---|
6718 | a._returnValue=false;
|
---|
6719 | return false
|
---|
6720 | }
|
---|
6721 | try{
|
---|
6722 | while(i&&e!="tr"){
|
---|
6723 | i=i.parentNode;
|
---|
6724 | e=i.tagName.toLowerCase()
|
---|
6725 | }
|
---|
6726 | if(i&&i.__msh_doMouseDown){
|
---|
6727 | i.__msh_doMouseDown(a)
|
---|
6728 | }}
|
---|
6729 | catch(t){}};
|
---|
6730 | DwtPropertyEditor.prototype.getProperties=function(){
|
---|
6731 | if(this._currentInputField){
|
---|
6732 | this._currentInputField.onblur()
|
---|
6733 | }
|
---|
6734 | function e(o){
|
---|
6735 | var h={}
|
---|
6736 | ,a,s=o.length;
|
---|
6737 | for(var t=0;
|
---|
6738 | t<s;
|
---|
6739 | ++t){
|
---|
6740 | a=o[t];
|
---|
6741 | if(a.type=="struct"){
|
---|
6742 | h[a.name]=e(a.children)
|
---|
6743 | }else{
|
---|
6744 | h[a.name]=a.value
|
---|
6745 | }}
|
---|
6746 | return h
|
---|
6747 | }
|
---|
6748 | return e(this._schema)
|
---|
6749 | };
|
---|
6750 | DwtPropertyEditor.prototype.validateData=function(){
|
---|
6751 | var e=true;
|
---|
6752 | function t(s){
|
---|
6753 | var o,h=s.length;
|
---|
6754 | for(var a=0;
|
---|
6755 | a<h;
|
---|
6756 | ++a){
|
---|
6757 | o=s[a];
|
---|
6758 | if(o.type=="struct"){
|
---|
6759 | t(o.children)
|
---|
6760 | }else{
|
---|
6761 | if(!o._validate()){
|
---|
6762 | e=false
|
---|
6763 | }}}}
|
---|
6764 | t(this._schema);
|
---|
6765 | return e
|
---|
6766 | };
|
---|
6767 | DwtPropertyEditor.prototype.initProperties=function(a,t){
|
---|
6768 | if(t==null){
|
---|
6769 | this._schema=a;
|
---|
6770 | t=null
|
---|
6771 | }
|
---|
6772 | for(var e=0;
|
---|
6773 | e<a.length;
|
---|
6774 | ++e){
|
---|
6775 | this._createProperty(a[e],t)
|
---|
6776 | }};
|
---|
6777 | DwtPropertyEditor.prototype._createProperty=function(e,c){
|
---|
6778 | var t=c?c._level+1:0;
|
---|
6779 | var l=this.getTable().firstChild.appendChild(document.createElement("tr"));
|
---|
6780 | e._parent=c;
|
---|
6781 | e._level=t;
|
---|
6782 | e._rowElId=l.id=Dwt.getNextId();
|
---|
6783 | e._propertyEditor=this;
|
---|
6784 | for(var s in DwtPropertyEditor._prop_functions){
|
---|
6785 | e[s]=DwtPropertyEditor._prop_functions[s]
|
---|
6786 | }
|
---|
6787 | e._init();
|
---|
6788 | l.className="level-"+t;
|
---|
6789 | if(e.visible=="false"){
|
---|
6790 | l.className+=" invisible"
|
---|
6791 | }
|
---|
6792 | if(e.readonly){
|
---|
6793 | l.className+=" readonly"
|
---|
6794 | }
|
---|
6795 | if(e.type!="struct"){
|
---|
6796 | l.className+=" "+e.type;
|
---|
6797 | var a=document.createElement("td");
|
---|
6798 | a.className="label";
|
---|
6799 | if(e.type=="checkboxgroup"){
|
---|
6800 | a.className+=" grouplabel"
|
---|
6801 | }
|
---|
6802 | l.appendChild(a);
|
---|
6803 | var h=AjxStringUtil.htmlEncode(e.label||e.name);
|
---|
6804 | if(e.required){
|
---|
6805 | h+="<span class='DwtPropertyEditor-required'>*</span>"
|
---|
6806 | }
|
---|
6807 | a.innerHTML=h;
|
---|
6808 | var o=document.createElement("td");
|
---|
6809 | o.className="field";
|
---|
6810 | l.appendChild(o);
|
---|
6811 | switch(e.type){
|
---|
6812 | case"boolean":this._createCheckbox(e,o);
|
---|
6813 | break;
|
---|
6814 | case"enum":this._createDropDown(e,o);
|
---|
6815 | break;
|
---|
6816 | case"date":this._createCalendar(e,o);
|
---|
6817 | break;
|
---|
6818 | case"checkboxgroup":this._createCheckBoxGroup(e,o);
|
---|
6819 | break;
|
---|
6820 | default:if(this._useDwtInputField){
|
---|
6821 | this._createInputField(e,o)
|
---|
6822 | }else{
|
---|
6823 | o.innerHTML=e._makeDisplayValue();
|
---|
6824 | l.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._edit,e)
|
---|
6825 | }
|
---|
6826 | break
|
---|
6827 | }
|
---|
6828 | e._fieldCellId=o.id=Dwt.getNextId();
|
---|
6829 | if(a.offsetWidth>this.maxLabelWidth){
|
---|
6830 | this.maxLabelWidth=a.offsetWidth
|
---|
6831 | }
|
---|
6832 | if(o.offsetWidth>this.maxFieldWidth){
|
---|
6833 | this.maxFieldWidth=o.offsetWidth
|
---|
6834 | }}else{
|
---|
6835 | var n=document.createElement("td");
|
---|
6836 | n.colSpan=2;
|
---|
6837 | l.appendChild(n);
|
---|
6838 | n.className="label";
|
---|
6839 | l.className+=" expander-collapsed";
|
---|
6840 | n.innerHTML=["<div>",AjxStringUtil.htmlEncode(e.label),"</div>"].join("");
|
---|
6841 | this.initProperties(e.children,e);
|
---|
6842 | l.__msh_doMouseDown=DwtPropertyEditor.simpleClosure(e._toggle,e)
|
---|
6843 | }
|
---|
6844 | if(t>0){
|
---|
6845 | l.style.display="none";
|
---|
6846 | c._hidden=true
|
---|
6847 | }};
|
---|
6848 | DwtPropertyEditor.prototype.setFixedLabelWidth=function(e){
|
---|
6849 | try{
|
---|
6850 | this.getTable().rows[0].cells[0].style.width=(e||this.maxLabelWidth)+"px"
|
---|
6851 | }
|
---|
6852 | catch(t){}};
|
---|
6853 | DwtPropertyEditor.prototype.setFixedFieldWidth=function(e){
|
---|
6854 | try{
|
---|
6855 | this.getTable().rows[0].cells[1].style.width=(e||this.maxFieldWidth)+"px"
|
---|
6856 | }
|
---|
6857 | catch(t){}};
|
---|
6858 | DwtPropertyEditor.prototype._setCurrentMsgDiv=function(e){
|
---|
6859 | this._currentMsgDiv=e;
|
---|
6860 | this._currentMsgDivTimer=setTimeout(DwtPropertyEditor.simpleClosure(this._clearMsgDiv,this),DwtPropertyEditor.MSG_TIMEOUT)
|
---|
6861 | };
|
---|
6862 | DwtPropertyEditor.prototype._clearMsgDiv=function(){
|
---|
6863 | try{
|
---|
6864 | this._stopMsgDivTimer()
|
---|
6865 | }
|
---|
6866 | catch(e){}
|
---|
6867 | var t=this._currentMsgDiv;
|
---|
6868 | if(t){
|
---|
6869 | t.parentNode.removeChild(t);
|
---|
6870 | this._currentMsgDiv=t=null;
|
---|
6871 | this._currentMsgDivTimer=null
|
---|
6872 | }};
|
---|
6873 | DwtPropertyEditor.prototype._stopMsgDivTimer=function(){
|
---|
6874 | if(this._currentMsgDivTimer){
|
---|
6875 | clearTimeout(this._currentMsgDivTimer);
|
---|
6876 | this._currentMsgDivTimer=null
|
---|
6877 | }};
|
---|
6878 | DwtPropertyEditor.prototype.addChild=function(e){
|
---|
6879 | if(!this._currentFieldCell){
|
---|
6880 | DwtComposite.prototype.addChild.call(this,e)
|
---|
6881 | }else{
|
---|
6882 | this._children.add(e);
|
---|
6883 | this._currentFieldCell.appendChild(e.getHtmlElement())
|
---|
6884 | }};
|
---|
6885 | DwtPropertyEditor.prototype._createCheckbox=function(a,t){
|
---|
6886 | var e=document.createElement("input");
|
---|
6887 | e._prop=a;
|
---|
6888 | e.id=a.name;
|
---|
6889 | e.type="checkbox";
|
---|
6890 | if(AjxEnv.isIE){
|
---|
6891 | e.attachEvent("onclick",a._onCheckboxChange)
|
---|
6892 | }else{
|
---|
6893 | e.addEventListener("click",a._onCheckboxChange,false)
|
---|
6894 | }
|
---|
6895 | this._children.add(e);
|
---|
6896 | t.appendChild(e);
|
---|
6897 | if(a.value=="true"){
|
---|
6898 | e.checked=a.value
|
---|
6899 | }};
|
---|
6900 | DwtPropertyEditor.prototype._createCheckBoxGroup=function(e,n){
|
---|
6901 | var t=document.createElement("div");
|
---|
6902 | t._prop=e;
|
---|
6903 | t.id=e.name;
|
---|
6904 | e._checkBox=[];
|
---|
6905 | t.appendChild(document.createTextNode(e.value));
|
---|
6906 | var l=document.createElement("table");
|
---|
6907 | l.id=Dwt.getNextId();
|
---|
6908 | l.border=0;
|
---|
6909 | l.cellSpacing=l.cellPadding=0;
|
---|
6910 | l.appendChild(document.createElement("tbody"));
|
---|
6911 | for(var a=0;
|
---|
6912 | a<e.checkBox.length;
|
---|
6913 | a++){
|
---|
6914 | var s=document.createElement("tr");
|
---|
6915 | var c=document.createElement("td");
|
---|
6916 | c.className="field";
|
---|
6917 | var o=this._createCheckboxForGroup(e,e.checkBox[a],c);
|
---|
6918 | s.appendChild(c);
|
---|
6919 | o._label=e.checkBox[a].label;
|
---|
6920 | var h=document.createElement("td");
|
---|
6921 | h.className="field";
|
---|
6922 | h.appendChild(document.createTextNode(e.checkBox[a].label));
|
---|
6923 | s.appendChild(h);
|
---|
6924 | l.firstChild.appendChild(s);
|
---|
6925 | e._checkBox[a]=o
|
---|
6926 | }
|
---|
6927 | t.appendChild(l);
|
---|
6928 | this._children.add(t);
|
---|
6929 | n.appendChild(t);
|
---|
6930 | return t
|
---|
6931 | };
|
---|
6932 | DwtPropertyEditor.prototype._createCheckboxForGroup=function(e,i,a){
|
---|
6933 | var t=document.createElement("input");
|
---|
6934 | t._prop=e;
|
---|
6935 | t.id=i.name;
|
---|
6936 | t.type="checkbox";
|
---|
6937 | if(i.value=="true"){
|
---|
6938 | t.checked=i.value
|
---|
6939 | }
|
---|
6940 | if(AjxEnv.isIE){
|
---|
6941 | t.attachEvent("onclick",e._onCheckboxGroupChange)
|
---|
6942 | }else{
|
---|
6943 | t.addEventListener("click",e._onCheckboxGroupChange,false)
|
---|
6944 | }
|
---|
6945 | this._children.add(t);
|
---|
6946 | a.appendChild(t);
|
---|
6947 | return t
|
---|
6948 | };
|
---|
6949 | DwtPropertyEditor.prototype._createDropDown=function(h,s){
|
---|
6950 | this._currentFieldCell=s;
|
---|
6951 | var o,n,a=0,t=[],e=h.item;
|
---|
6952 | while(o=e[a]){
|
---|
6953 | t[a++]=new DwtSelectOption(o.value,o.value==h.value,o.label)
|
---|
6954 | }
|
---|
6955 | h._select=n=new DwtSelect({
|
---|
6956 | parent:this,options:t}
|
---|
6957 | );
|
---|
6958 | n.addChangeListener(new AjxListener(h,h._onSelectChange));
|
---|
6959 | n.addListener(DwtEvent.ONMOUSEDOWN,this._onMouseDown);
|
---|
6960 | this._currentFieldCell=null
|
---|
6961 | };
|
---|
6962 | DwtPropertyEditor.prototype._createCalendar=function(n,i){
|
---|
6963 | this._currentFieldCell=i;
|
---|
6964 | var t=new DwtButton({
|
---|
6965 | parent:this}
|
---|
6966 | );
|
---|
6967 | this._currentFieldCell=null;
|
---|
6968 | t.setText(n._makeDisplayValue());
|
---|
6969 | var o=new DwtMenu({
|
---|
6970 | parent:t,style:DwtMenu.CALENDAR_PICKER_STYLE}
|
---|
6971 | );
|
---|
6972 | o.setAssociatedObj(t);
|
---|
6973 | var a=new DwtCalendar({
|
---|
6974 | parent:o}
|
---|
6975 | );
|
---|
6976 | var e=new Date();
|
---|
6977 | e.setTime(n.value);
|
---|
6978 | a.setDate(e);
|
---|
6979 | a.setSize(150,"auto");
|
---|
6980 | a.addSelectionListener(new AjxListener(n,n._onCalendarSelect));
|
---|
6981 | t.setMenu(o);
|
---|
6982 | n._dateButton=t;
|
---|
6983 | n._dateCalendar=a
|
---|
6984 | };
|
---|
6985 | DwtPropertyEditor.DWT_INPUT_FIELD_TYPES={
|
---|
6986 | string:DwtInputField.STRING,password:DwtInputField.PASSWORD,integer:DwtInputField.INTEGER,number:DwtInputField.FLOAT};
|
---|
6987 | DwtPropertyEditor.prototype._createInputField=function(i,a){
|
---|
6988 | this._currentFieldCell=a;
|
---|
6989 | var e=DwtPropertyEditor.DWT_INPUT_FIELD_TYPES[i.type]||DwtInputField.STRING;
|
---|
6990 | var t=new DwtInputField({
|
---|
6991 | parent:this,type:e,initialValue:i.value,maxLen:i.maxLength,rows:i.rows}
|
---|
6992 | );
|
---|
6993 | if(e==DwtInputField.INTEGER||e==DwtInputField.FLOAT){
|
---|
6994 | t.setValidNumberRange(i.minValue||null,i.maxValue||null);
|
---|
6995 | if(i.decimals!=null){
|
---|
6996 | t.setNumberPrecision(i.decimals)
|
---|
6997 | }}
|
---|
6998 | if(e==DwtInputField.STRING||e==DwtInputField.PASSWORD){
|
---|
6999 | t.setValidStringLengths(i.minLength,i.maxLength)
|
---|
7000 | }
|
---|
7001 | if(i.required){
|
---|
7002 | t.setRequired()
|
---|
7003 | }
|
---|
7004 | this._currentFieldCell=null;
|
---|
7005 | i._inputField=t;
|
---|
7006 | t.setValue(i.value);
|
---|
7007 | if(i.readonly){
|
---|
7008 | t.setReadOnly(true)
|
---|
7009 | }
|
---|
7010 | t.setValidationCallback(new AjxCallback(i,i._onDwtInputFieldValidated))
|
---|
7011 | };
|
---|
7012 | DwtPropertyEditor._prop_functions={
|
---|
7013 | _init:function(){
|
---|
7014 | this.type!=null||(this.type="string");
|
---|
7015 | this.value!=null||(this.value="");
|
---|
7016 | this._initialVal=this.value;
|
---|
7017 | if(this.type=="date"){
|
---|
7018 | if(!this.value){
|
---|
7019 | this.value=new Date().getTime()
|
---|
7020 | }
|
---|
7021 | if(!this.format){
|
---|
7022 | this.format=AjxDateUtil.getSimpleDateFormat().toPattern()
|
---|
7023 | }}}
|
---|
7024 | ,_modified:function(){
|
---|
7025 | return this._initialVal!=this.value
|
---|
7026 | }
|
---|
7027 | ,_getRowEl:function(){
|
---|
7028 | return document.getElementById(this._rowElId)
|
---|
7029 | }
|
---|
7030 | ,_makeDisplayValue:function(){
|
---|
7031 | var t=this._getValue();
|
---|
7032 | switch(this.type){
|
---|
7033 | case"password":t=t.replace(/./g,"*");
|
---|
7034 | break;
|
---|
7035 | case"date":var e=new Date();
|
---|
7036 | e.setTime(t);
|
---|
7037 | t=AjxDateFormat.format(this.format,e);
|
---|
7038 | break
|
---|
7039 | }
|
---|
7040 | if(t==""){
|
---|
7041 | t="<br />"
|
---|
7042 | }else{
|
---|
7043 | t=AjxStringUtil.htmlEncode(String(t))
|
---|
7044 | }
|
---|
7045 | return t
|
---|
7046 | }
|
---|
7047 | ,_display:function(o){
|
---|
7048 | var n=this.children,a=o?"":"none";
|
---|
7049 | if(n){
|
---|
7050 | var e=n.length;
|
---|
7051 | while(--e>=0){
|
---|
7052 | n[e]._getRowEl().style.display=a;
|
---|
7053 | if(!o){
|
---|
7054 | n[e]._display(false)
|
---|
7055 | }}
|
---|
7056 | this._hidden=!o;
|
---|
7057 | var t=this._getRowEl();
|
---|
7058 | t.className=t.className.replace(/expander-[^\s]+/,o?"expander-expanded":"expander-collapsed")
|
---|
7059 | }}
|
---|
7060 | ,_toggle:function(){
|
---|
7061 | this._display(this._hidden)
|
---|
7062 | }
|
---|
7063 | ,_edit:function(){
|
---|
7064 | if(this.readonly){
|
---|
7065 | return
|
---|
7066 | }
|
---|
7067 | switch(this.type){
|
---|
7068 | case"string":case"number":case"integer":case"password":setTimeout(DwtPropertyEditor.simpleClosure(this._createInputField,this),50);
|
---|
7069 | break
|
---|
7070 | }}
|
---|
7071 | ,_createInputField:function(){
|
---|
7072 | var e=this._propertyEditor;
|
---|
7073 | var n=document.getElementById(this._fieldCellId);
|
---|
7074 | var a=e.getRelDiv();
|
---|
7075 | var t=document.createElement("input");
|
---|
7076 | t.className="DwtPropertyEditor-input "+this.type;
|
---|
7077 | t.setAttribute("autocomplete","off");
|
---|
7078 | t.type=this.type=="password"?"password":"text";
|
---|
7079 | var o=n.offsetLeft,i=n.offsetTop;
|
---|
7080 | if(AjxEnv.isGeckoBased){
|
---|
7081 | --o;
|
---|
7082 | --i
|
---|
7083 | }
|
---|
7084 | t.style.left=o+"px";
|
---|
7085 | t.style.top=i+"px";
|
---|
7086 | t.style.width=n.offsetWidth+1+"px";
|
---|
7087 | t.style.height=n.offsetHeight+1+"px";
|
---|
7088 | t.value=this._getValue();
|
---|
7089 | a.appendChild(t);
|
---|
7090 | t.focus();
|
---|
7091 | t.onblur=DwtPropertyEditor.simpleClosure(this._saveInput,this);
|
---|
7092 | t.onkeydown=DwtPropertyEditor.simpleClosure(this._inputKeyPress,this);
|
---|
7093 | this._propertyEditor._currentInputField=this._inputField=t;
|
---|
7094 | if(!AjxEnv.isGeckoBased){
|
---|
7095 | t.select()
|
---|
7096 | }else{
|
---|
7097 | t.setSelectionRange(0,t.value.length)
|
---|
7098 | }}
|
---|
7099 | ,_getValue:function(){
|
---|
7100 | return this.value||""
|
---|
7101 | }
|
---|
7102 | ,_checkValue:function(a){
|
---|
7103 | var e=a=="";
|
---|
7104 | if(e){
|
---|
7105 | if(!this.required){
|
---|
7106 | return a
|
---|
7107 | }
|
---|
7108 | this._displayMsg(AjxMsg.valueIsRequired);
|
---|
7109 | return null
|
---|
7110 | }
|
---|
7111 | if(this.maxLength!=null&&a.length>this.maxLength){
|
---|
7112 | this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooLong,this.maxLength));
|
---|
7113 | return null
|
---|
7114 | }
|
---|
7115 | if(this.minLength!=null&&a.length<this.minLength){
|
---|
7116 | this._displayMsg(AjxMessageFormat.format(AjxMsg.stringTooShort,this.minLength));
|
---|
7117 | return null
|
---|
7118 | }
|
---|
7119 | if(this.mustMatch&&!this.mustMatch.test(a)){
|
---|
7120 | this._displayMsg(this.msg_mustMatch||DwtPropertyEditor.MSG.mustMatch.replace(/REGEXP/,this.mustMatch.toString()));
|
---|
7121 | return null
|
---|
7122 | }
|
---|
7123 | if(this.mustNotMatch&&this.mustNotMatch.test(a)){
|
---|
7124 | this._displayMsg(this.msg_mustNotMatch||DwtPropertyEditor.MSG.mustNotMatch.replace(/REGEXP/,this.mustNotMatch.toString()));
|
---|
7125 | return null
|
---|
7126 | }
|
---|
7127 | switch(this.type){
|
---|
7128 | case"integer":case"number":var o=new Number(a);
|
---|
7129 | if(isNaN(o)){
|
---|
7130 | this._displayMsg(AjxMsg.notANumber);
|
---|
7131 | return null
|
---|
7132 | }
|
---|
7133 | if(this.type=="integer"&&Math.round(o)!=o){
|
---|
7134 | this._displayMsg(AjxMsg.notAnInteger);
|
---|
7135 | return null
|
---|
7136 | }
|
---|
7137 | if(this.minValue!=null&&o<this.minValue){
|
---|
7138 | this._displayMsg(AjxMessageFormat.format(AjxMsg.numberLessThanMin,this.minValue));
|
---|
7139 | return null
|
---|
7140 | }
|
---|
7141 | if(this.maxValue!=null&&o>this.maxValue){
|
---|
7142 | this._displayMsg(AjxMessageFormat.format(AjxMsg.numberMoreThanMax,this.maxValue));
|
---|
7143 | return null
|
---|
7144 | }
|
---|
7145 | a=o;
|
---|
7146 | if(this.type=="number"&&this.decimals!=null){
|
---|
7147 | var t=a.toString();
|
---|
7148 | var i=t.indexOf(".");
|
---|
7149 | if(i==-1){
|
---|
7150 | i=t.length
|
---|
7151 | }
|
---|
7152 | a=a.toPrecision(i+this.decimals)
|
---|
7153 | }
|
---|
7154 | break
|
---|
7155 | }
|
---|
7156 | return a
|
---|
7157 | }
|
---|
7158 | ,_displayMsg:function(t){
|
---|
7159 | var s,n,l,i;
|
---|
7160 | var o=this._propertyEditor;
|
---|
7161 | var e=o._currentMsgDiv;
|
---|
7162 | if(!e){
|
---|
7163 | e=document.createElement("div");
|
---|
7164 | e.className="DwtPropertyEditor-ErrorMsg";
|
---|
7165 | o.getRelDiv().appendChild(e)
|
---|
7166 | }else{
|
---|
7167 | o._stopMsgDivTimer()
|
---|
7168 | }
|
---|
7169 | e.style.visibility="hidden";
|
---|
7170 | e.innerHTML=AjxStringUtil.htmlEncode(t);
|
---|
7171 | var c=o.getTable();
|
---|
7172 | l=c.offsetWidth;
|
---|
7173 | if(!AjxEnv.isIE){
|
---|
7174 | l-=12
|
---|
7175 | }
|
---|
7176 | s=c.offsetLeft;
|
---|
7177 | e.style.left=s+"px";
|
---|
7178 | e.style.width=l+"px";
|
---|
7179 | i=e.offsetHeight;
|
---|
7180 | var a=document.getElementById(this._fieldCellId);
|
---|
7181 | n=a.offsetTop+a.offsetHeight;
|
---|
7182 | if(n+i>c.offsetTop+c.offsetHeight){
|
---|
7183 | n=a.offsetTop-i
|
---|
7184 | }
|
---|
7185 | e.style.top=n+"px";
|
---|
7186 | e.style.visibility="";
|
---|
7187 | o._setCurrentMsgDiv(e)
|
---|
7188 | }
|
---|
7189 | ,_saveInput:function(){
|
---|
7190 | var e=this._inputField;
|
---|
7191 | var t=this._checkValue(e.value);
|
---|
7192 | if(t!=null){
|
---|
7193 | this._setValue(t);
|
---|
7194 | e.onblur=e.onkeyup=e.onkeydown=e.onkeypress=null;
|
---|
7195 | var a=document.getElementById(this._fieldCellId);
|
---|
7196 | a.innerHTML=this._makeDisplayValue();
|
---|
7197 | this._inputField=null;
|
---|
7198 | this._propertyEditor._currentInputField=null;
|
---|
7199 | this._propertyEditor._clearMsgDiv();
|
---|
7200 | e.parentNode.removeChild(e);
|
---|
7201 | return true
|
---|
7202 | }else{
|
---|
7203 | if(e.className.indexOf(" DwtPropertyEditor-input-error")==-1){
|
---|
7204 | e.className+=" DwtPropertyEditor-input-error"
|
---|
7205 | }
|
---|
7206 | e.focus();
|
---|
7207 | return false
|
---|
7208 | }}
|
---|
7209 | ,_inputKeyPress:function(t){
|
---|
7210 | t||(t=window.event);
|
---|
7211 | var e=this._inputField;
|
---|
7212 | if(t.keyCode==13){
|
---|
7213 | this._saveInput()
|
---|
7214 | }else{
|
---|
7215 | if(t.keyCode==27){
|
---|
7216 | e.value=this._getValue();
|
---|
7217 | this._saveInput()
|
---|
7218 | }else{
|
---|
7219 | this._propertyEditor._clearMsgDiv();
|
---|
7220 | e.className=e.className.replace(/ DwtPropertyEditor-input-error/,"")
|
---|
7221 | }}}
|
---|
7222 | ,_onCheckboxChange:function(t){
|
---|
7223 | t||(t=window.event);
|
---|
7224 | var e=AjxEnv.isIE?t.srcElement:t.target;
|
---|
7225 | e._prop._setValue(e.checked?"true":"false")
|
---|
7226 | }
|
---|
7227 | ,_onSelectChange:function(){
|
---|
7228 | this._setValue(this._select.getValue())
|
---|
7229 | }
|
---|
7230 | ,_onCheckboxGroupChange:function(o){
|
---|
7231 | o||(o=window.event);
|
---|
7232 | var a=AjxEnv.isIE?o.srcElement:o.target;
|
---|
7233 | var e=a._prop._checkBox;
|
---|
7234 | var n=[];
|
---|
7235 | for(var t=0;
|
---|
7236 | t<e.length;
|
---|
7237 | t++){
|
---|
7238 | if(e[t].checked){
|
---|
7239 | n.push(e[t]._label)
|
---|
7240 | }}
|
---|
7241 | a._prop._setValue(n)
|
---|
7242 | }
|
---|
7243 | ,_onCalendarSelect:function(){
|
---|
7244 | this._setValue(this._dateCalendar.getDate().getTime());
|
---|
7245 | this._dateButton.setText(this._makeDisplayValue())
|
---|
7246 | }
|
---|
7247 | ,_onDwtInputFieldValidated:function(e,a,t){
|
---|
7248 | if(a){
|
---|
7249 | this._setValue(t)
|
---|
7250 | }}
|
---|
7251 | ,_setValue:function(t){
|
---|
7252 | this.value=t;
|
---|
7253 | var e=this._getRowEl();
|
---|
7254 | e.className=e.className.replace(/ dirty/,"");
|
---|
7255 | if(this._modified()){
|
---|
7256 | e.className+=" dirty"
|
---|
7257 | }}
|
---|
7258 | ,_validate:function(){
|
---|
7259 | if(this._inputField){
|
---|
7260 | if(this._inputField instanceof DwtInputField){
|
---|
7261 | return this._inputField.validate()
|
---|
7262 | }else{
|
---|
7263 | return this._inputField.onblur()
|
---|
7264 | }}else{
|
---|
7265 | return true
|
---|
7266 | }}};
|
---|
7267 | DwtPropertyEditor.simpleClosure=function(e,t){
|
---|
7268 | return function(){
|
---|
7269 | return e.call(t,arguments[0])
|
---|
7270 | }
|
---|
7271 | }
|
---|
7272 | }
|
---|
7273 | if(AjxPackage.define("ajax.dwt.widgets.DwtConfirmDialog")){
|
---|
7274 | DwtConfirmDialog=function(t,e){
|
---|
7275 | if(arguments.length==0){
|
---|
7276 | return
|
---|
7277 | }
|
---|
7278 | var a=[DwtDialog.YES_BUTTON,DwtDialog.NO_BUTTON,DwtDialog.CANCEL_BUTTON];
|
---|
7279 | DwtDialog.call(this,{
|
---|
7280 | parent:t,className:e,title:AjxMsg.confirmTitle,standardButtons:a}
|
---|
7281 | );
|
---|
7282 | this._questionDiv=document.createElement("DIV");
|
---|
7283 | this._questionDiv.className="DwtConfirmDialogQuestion";
|
---|
7284 | this._getContentDiv().appendChild(this._questionDiv);
|
---|
7285 | this.registerCallback(DwtDialog.YES_BUTTON,this._handleYesButton,this);
|
---|
7286 | this.registerCallback(DwtDialog.NO_BUTTON,this._handleNoButton,this);
|
---|
7287 | this.registerCallback(DwtDialog.CANCEL_BUTTON,this._handleCancelButton,this)
|
---|
7288 | };
|
---|
7289 | DwtConfirmDialog.prototype=new DwtDialog;
|
---|
7290 | DwtConfirmDialog.prototype.constructor=DwtConfirmDialog;
|
---|
7291 | DwtConfirmDialog.prototype.toString=function(){
|
---|
7292 | return"DwtConfirmDialog"
|
---|
7293 | };
|
---|
7294 | DwtConfirmDialog.prototype.popup=function(a,e,i,t,o){
|
---|
7295 | this._questionDiv.innerHTML=a||"";
|
---|
7296 | this._yesCallback=e;
|
---|
7297 | this._noCallback=i;
|
---|
7298 | this._cancelCallback=t;
|
---|
7299 | this.setButtonVisible(DwtDialog.CANCEL_BUTTON,Boolean(i));
|
---|
7300 | DwtDialog.prototype.popup.call(this,o)
|
---|
7301 | };
|
---|
7302 | DwtConfirmDialog.prototype.popdown=function(){
|
---|
7303 | this._yesCallback=this._noCallback=this._cancelCallback=null;
|
---|
7304 | DwtDialog.prototype.popdown.call(this)
|
---|
7305 | };
|
---|
7306 | DwtConfirmDialog.prototype._handleYesButton=function(e){
|
---|
7307 | if(this._yesCallback){
|
---|
7308 | this._yesCallback.run(e)
|
---|
7309 | }
|
---|
7310 | this.popdown()
|
---|
7311 | };
|
---|
7312 | DwtConfirmDialog.prototype._handleNoButton=function(e){
|
---|
7313 | if(this._noCallback){
|
---|
7314 | this._noCallback.run(e)
|
---|
7315 | }
|
---|
7316 | this.popdown()
|
---|
7317 | };
|
---|
7318 | DwtConfirmDialog.prototype._handleCancelButton=function(e){
|
---|
7319 | if(this._cancelCallback){
|
---|
7320 | this._cancelCallback.run(e)
|
---|
7321 | }
|
---|
7322 | this.popdown()
|
---|
7323 | };
|
---|
7324 | DwtConfirmDialog.prototype._getSeparatorTemplate=function(){
|
---|
7325 | return""
|
---|
7326 | }
|
---|
7327 | }
|
---|
7328 | if(AjxPackage.define("ajax.dwt.widgets.DwtChooser")){
|
---|
7329 | DwtChooser=function(a){
|
---|
7330 | if(arguments.length==0){
|
---|
7331 | return
|
---|
7332 | }
|
---|
7333 | DwtComposite.call(this,a.parent,a.className);
|
---|
7334 | this._slvClassName=a.slvClassName;
|
---|
7335 | this._tlvClassName=a.tlvClassName;
|
---|
7336 | this._layoutStyle=a.layoutStyle?a.layoutStyle:DwtChooser.HORIZ_STYLE;
|
---|
7337 | this._selectStyle=a.selectStyle?a.selectStyle:DwtChooser.MULTI_SELECT;
|
---|
7338 | this._mode=a.listStyle?a.listStyle:DwtChooser.MODE_MOVE;
|
---|
7339 | this._noDuplicates=(a.noDuplicates!==false);
|
---|
7340 | this._singleHeight=a.singleHeight?a.singleHeight:45;
|
---|
7341 | this._listSize=a.listSize;
|
---|
7342 | this._sourceEmptyOk=a.sourceEmptyOk;
|
---|
7343 | this._allButtons=a.allButtons;
|
---|
7344 | this._hasTextField=a.hasTextField;
|
---|
7345 | this._handleButtonInfo(a.buttonInfo);
|
---|
7346 | this._mode=a.mode?a.mode:this._hasMultiButtons?DwtChooser.MODE_COPY:DwtChooser.MODE_MOVE;
|
---|
7347 | this._createHtml();
|
---|
7348 | this._initialize();
|
---|
7349 | var t=a.parent.getSize();
|
---|
7350 | var i=a.listWidth||t.x;
|
---|
7351 | var e=a.listHeight||t.y;
|
---|
7352 | if(i&&e){
|
---|
7353 | this.resize(i,e)
|
---|
7354 | }};
|
---|
7355 | DwtChooser.prototype=new DwtComposite;
|
---|
7356 | DwtChooser.prototype.constructor=DwtChooser;
|
---|
7357 | DwtChooser.HORIZ_STYLE=1;
|
---|
7358 | DwtChooser.VERT_STYLE=2;
|
---|
7359 | DwtChooser.SINGLE_SELECT=1;
|
---|
7360 | DwtChooser.MULTI_SELECT=2;
|
---|
7361 | DwtChooser.MODE_COPY=1;
|
---|
7362 | DwtChooser.MODE_MOVE=2;
|
---|
7363 | DwtChooser.REMOVE_BTN_ID="__remove__";
|
---|
7364 | DwtChooser.ADD_ALL_BTN_ID="__addAll__";
|
---|
7365 | DwtChooser.REMOVE_ALL_BTN_ID="__removeAll__";
|
---|
7366 | DwtChooser.prototype.toString=function(){
|
---|
7367 | return"DwtChooser"
|
---|
7368 | };
|
---|
7369 | DwtChooser.prototype.setItems=function(t,e,a){
|
---|
7370 | e=e?e:DwtChooserListView.SOURCE;
|
---|
7371 | this._reset(e);
|
---|
7372 | this.addItems(t,e,true);
|
---|
7373 | this._selectFirst(e);
|
---|
7374 | if(a){
|
---|
7375 | this._reset((e==DwtChooserListView.SOURCE)?DwtChooserListView.TARGET:DwtChooserListView.SOURCE)
|
---|
7376 | }};
|
---|
7377 | DwtChooser.prototype.getItems=function(e){
|
---|
7378 | e=e?e:DwtChooserListView.TARGET;
|
---|
7379 | if(e==DwtChooserListView.SOURCE){
|
---|
7380 | return this.sourceListView.getList().clone()
|
---|
7381 | }else{
|
---|
7382 | if(this._hasMultiButtons){
|
---|
7383 | var a={};
|
---|
7384 | for(var t in this._data){
|
---|
7385 | a[t]=this._data[t].clone()
|
---|
7386 | }
|
---|
7387 | return a
|
---|
7388 | }else{
|
---|
7389 | return this._data[this._buttonInfo[0].id].clone()
|
---|
7390 | }}};
|
---|
7391 | DwtChooser.prototype.addItems=function(t,e,o,h){
|
---|
7392 | e=e?e:DwtChooserListView.SOURCE;
|
---|
7393 | var s=(t instanceof AjxVector)?t.getArray():(t instanceof Array)?t:[t];
|
---|
7394 | if(e==DwtChooserListView.SOURCE){
|
---|
7395 | for(var a=0;
|
---|
7396 | a<s.length;
|
---|
7397 | a++){
|
---|
7398 | this._addToSource(s[a],null,o)
|
---|
7399 | }}else{
|
---|
7400 | var n;
|
---|
7401 | if(this._selectStyle==DwtChooser.SINGLE_SELECT){
|
---|
7402 | this.targetListView._resetList();
|
---|
7403 | s=(s.length>0)?[s[0]]:s
|
---|
7404 | }
|
---|
7405 | for(var a=0;
|
---|
7406 | a<s.length;
|
---|
7407 | a++){
|
---|
7408 | this._addToTarget(s[a],h,o)
|
---|
7409 | }}
|
---|
7410 | if(e==DwtChooserListView.SOURCE){
|
---|
7411 | var s=this.sourceListView.getList();
|
---|
7412 | this._sourceSize=s?s.size():0
|
---|
7413 | }};
|
---|
7414 | DwtChooser.prototype.removeItems=function(o,e,a){
|
---|
7415 | o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
|
---|
7416 | for(var t=0;
|
---|
7417 | t<o.length;
|
---|
7418 | t++){
|
---|
7419 | (e==DwtChooserListView.SOURCE)?this._removeFromSource(o[t],a):this._removeFromTarget(o[t],a)
|
---|
7420 | }};
|
---|
7421 | DwtChooser.prototype.transfer=function(t,i,e){
|
---|
7422 | i=i?i:this._activeButtonId;
|
---|
7423 | this._setActiveButton(i);
|
---|
7424 | if(this._mode==DwtChooser.MODE_MOVE){
|
---|
7425 | if(this._selectStyle==DwtChooser.SINGLE_SELECT){
|
---|
7426 | var a=this.targetListView.getList();
|
---|
7427 | if(a&&a.size()){
|
---|
7428 | this.remove(a,true)
|
---|
7429 | }}
|
---|
7430 | this.removeItems(t,DwtChooserListView.SOURCE,true)
|
---|
7431 | }
|
---|
7432 | this.addItems(t,DwtChooserListView.TARGET,e);
|
---|
7433 | this.sourceListView.deselectAll()
|
---|
7434 | };
|
---|
7435 | DwtChooser.prototype.remove=function(o,a){
|
---|
7436 | o=(o instanceof AjxVector)?o.getArray():(o instanceof Array)?o:[o];
|
---|
7437 | if(this._mode==DwtChooser.MODE_MOVE){
|
---|
7438 | for(var t=0;
|
---|
7439 | t<o.length;
|
---|
7440 | t++){
|
---|
7441 | var e=this._getInsertionIndex(this.sourceListView,o[t]);
|
---|
7442 | this.sourceListView.addItem(o[t],e,true)
|
---|
7443 | }
|
---|
7444 | this._sourceSize=o?o.length:0
|
---|
7445 | }
|
---|
7446 | this.removeItems(o,DwtChooserListView.TARGET)
|
---|
7447 | };
|
---|
7448 | DwtChooser.prototype.setSelectStyle=function(i,s){
|
---|
7449 | if(i==this._selectStyle){
|
---|
7450 | return
|
---|
7451 | }
|
---|
7452 | this._selectStyle=i;
|
---|
7453 | if(this._defLabel){
|
---|
7454 | var t=this._button[this._buttonInfo[0].id];
|
---|
7455 | t.setText((i==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add)
|
---|
7456 | }
|
---|
7457 | if(!s){
|
---|
7458 | var o=this.getSize();
|
---|
7459 | this.resize(o.x,o.y)
|
---|
7460 | }
|
---|
7461 | if(this._allButtons){
|
---|
7462 | this._addAllButton.setVisible(i==DwtChooser.MULTI_SELECT);
|
---|
7463 | this._removeAllButton.setVisible(i==DwtChooser.MULTI_SELECT);
|
---|
7464 | this._enableButtons()
|
---|
7465 | }
|
---|
7466 | if(i==DwtChooser.SINGLE_SELECT){
|
---|
7467 | var n=this.targetListView.getList();
|
---|
7468 | var e=n?n.clone().getArray():null;
|
---|
7469 | if(e&&e.length){
|
---|
7470 | this._reset(DwtChooserListView.TARGET);
|
---|
7471 | this.addItems(e[0],DwtChooserListView.TARGET,true);
|
---|
7472 | this.targetListView.deselectAll();
|
---|
7473 | if(e.length>1&&this._mode==DwtChooser.MODE_MOVE){
|
---|
7474 | this.addItems(e.slice(1),DwtChooserListView.SOURCE,true)
|
---|
7475 | }
|
---|
7476 | this._enableButtons()
|
---|
7477 | }}
|
---|
7478 | this.sourceListView.multiSelectEnabled=(i==DwtChooser.MULTI_SELECT);
|
---|
7479 | this.targetListView.multiSelectEnabled=(i==DwtChooser.MULTI_SELECT)
|
---|
7480 | };
|
---|
7481 | DwtChooser.prototype.reset=function(e){
|
---|
7482 | this._reset(e);
|
---|
7483 | this._setActiveButton(this._buttonInfo[0].id);
|
---|
7484 | this._enableButtons();
|
---|
7485 | if(this._hasTextField){
|
---|
7486 | this._textField.setValue("")
|
---|
7487 | }};
|
---|
7488 | DwtChooser.prototype._reset=function(e){
|
---|
7489 | if(!e||e==DwtChooserListView.SOURCE){
|
---|
7490 | this.sourceListView._resetList()
|
---|
7491 | }
|
---|
7492 | if(!e||e==DwtChooserListView.TARGET){
|
---|
7493 | this.targetListView._resetList();
|
---|
7494 | for(var t in this._data){
|
---|
7495 | this._data[t].removeAll()
|
---|
7496 | }}};
|
---|
7497 | DwtChooser.prototype.addStateChangeListener=function(e){
|
---|
7498 | this.targetListView.addStateChangeListener(e)
|
---|
7499 | };
|
---|
7500 | DwtChooser.prototype.removeStateChangeListener=function(e){
|
---|
7501 | this.targetListView.removeStateChangeListener(e)
|
---|
7502 | };
|
---|
7503 | DwtChooser.prototype.getSourceListView=function(){
|
---|
7504 | return document.getElementById(this._sourceListViewDivId)
|
---|
7505 | };
|
---|
7506 | DwtChooser.prototype.getButtons=function(){
|
---|
7507 | return document.getElementById(this._buttonsDivId)
|
---|
7508 | };
|
---|
7509 | DwtChooser.prototype.getTargetListView=function(){
|
---|
7510 | return document.getElementById(this._targetListViewDivId)
|
---|
7511 | };
|
---|
7512 | DwtChooser.prototype.getTextField=function(){
|
---|
7513 | return this._textField
|
---|
7514 | };
|
---|
7515 | DwtChooser.prototype._createHtml=function(){
|
---|
7516 | this._sourceListViewDivId=Dwt.getNextId();
|
---|
7517 | this._targetListViewDivId=Dwt.getNextId();
|
---|
7518 | this._buttonsDivId=Dwt.getNextId();
|
---|
7519 | this._removeButtonDivId=Dwt.getNextId();
|
---|
7520 | if(this._allButtons){
|
---|
7521 | this._addAllButtonDivId=Dwt.getNextId();
|
---|
7522 | this._removeAllButtonDivId=Dwt.getNextId()
|
---|
7523 | }
|
---|
7524 | if(this._hasTextField){
|
---|
7525 | this._textFieldTdId=Dwt.getNextId()
|
---|
7526 | }
|
---|
7527 | var a=[];
|
---|
7528 | var e=0;
|
---|
7529 | if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
|
---|
7530 | a[e++]="<table cellspacing=0 cellpadding=0 border=0>";
|
---|
7531 | a[e++]="<tr>";
|
---|
7532 | a[e++]="<td id='";
|
---|
7533 | a[e++]=this._sourceListViewDivId;
|
---|
7534 | a[e++]="'></td>";
|
---|
7535 | a[e++]="<td valign='middle' id='";
|
---|
7536 | a[e++]=this._buttonsDivId;
|
---|
7537 | a[e++]="'>";
|
---|
7538 | if(this._allButtons){
|
---|
7539 | a[e++]="<div id='";
|
---|
7540 | a[e++]=this._addAllButtonDivId;
|
---|
7541 | a[e++]="'></div><br>"
|
---|
7542 | }
|
---|
7543 | for(var t=0;
|
---|
7544 | t<this._buttonInfo.length;
|
---|
7545 | t++){
|
---|
7546 | var o=this._buttonInfo[t].id;
|
---|
7547 | a[e++]="<div id='";
|
---|
7548 | a[e++]=this._buttonDivId[o];
|
---|
7549 | a[e++]="'></div><br>"
|
---|
7550 | }
|
---|
7551 | a[e++]="<br><div id='";
|
---|
7552 | a[e++]=this._removeButtonDivId;
|
---|
7553 | a[e++]="'></div>";
|
---|
7554 | if(this._allButtons){
|
---|
7555 | a[e++]="<br><div id='";
|
---|
7556 | a[e++]=this._removeAllButtonDivId;
|
---|
7557 | a[e++]="'></div><br>"
|
---|
7558 | }
|
---|
7559 | a[e++]="</td>";
|
---|
7560 | a[e++]="<td id='";
|
---|
7561 | a[e++]=this._targetListViewDivId;
|
---|
7562 | a[e++]="'></td>";
|
---|
7563 | a[e++]="</tr>";
|
---|
7564 | if(this._hasTextField){
|
---|
7565 | a[e++]="<tr><td>";
|
---|
7566 | a[e++]="<table border=0 width=100%><tr><td style='white-space:nowrap; width:1%'>";
|
---|
7567 | a[e++]=AjxMsg.add;
|
---|
7568 | a[e++]=":</td><td id='";
|
---|
7569 | a[e++]=this._textFieldTdId;
|
---|
7570 | a[e++]="'></td></tr></table>";
|
---|
7571 | a[e++]="</td><td> </td><td> </td></tr>"
|
---|
7572 | }
|
---|
7573 | a[e++]="</table>"
|
---|
7574 | }else{
|
---|
7575 | a[e++]="<div id='";
|
---|
7576 | a[e++]=this._sourceListViewDivId;
|
---|
7577 | a[e++]="'></div>";
|
---|
7578 | a[e++]="<div align='center' id='";
|
---|
7579 | a[e++]=this._buttonsDivId;
|
---|
7580 | a[e++]="'>";
|
---|
7581 | a[e++]="<table><tr>";
|
---|
7582 | if(this._allButtons){
|
---|
7583 | a[e++]="<td id='";
|
---|
7584 | a[e++]=this._addAllButtonDivId;
|
---|
7585 | a[e++]="'></td>"
|
---|
7586 | }
|
---|
7587 | for(var t=0;
|
---|
7588 | t<this._buttonInfo.length;
|
---|
7589 | t++){
|
---|
7590 | var o=this._buttonInfo[t].id;
|
---|
7591 | a[e++]="<td id='";
|
---|
7592 | a[e++]=this._buttonDivId[o];
|
---|
7593 | a[e++]="'></td>"
|
---|
7594 | }
|
---|
7595 | a[e++]="<td id='";
|
---|
7596 | a[e++]=this._removeButtonDivId;
|
---|
7597 | a[e++]="'></td>";
|
---|
7598 | if(this._allButtons){
|
---|
7599 | a[e++]="<td id='";
|
---|
7600 | a[e++]=this._removeAllButtonDivId;
|
---|
7601 | a[e++]="'></td>"
|
---|
7602 | }
|
---|
7603 | a[e++]="</tr></table></div>";
|
---|
7604 | a[e++]="<div id='";
|
---|
7605 | a[e++]=this._targetListViewDivId;
|
---|
7606 | a[e++]="'></div>"
|
---|
7607 | }
|
---|
7608 | this.getHtmlElement().innerHTML=a.join("")
|
---|
7609 | };
|
---|
7610 | DwtChooser.prototype._handleButtonInfo=function(t){
|
---|
7611 | if(!t){
|
---|
7612 | this._defLabel=(this._selectStyle==DwtChooser.SINGLE_SELECT)?AjxMsg.select:AjxMsg.add;
|
---|
7613 | t=[{
|
---|
7614 | label:this._defLabel}
|
---|
7615 | ]
|
---|
7616 | }
|
---|
7617 | this._buttonInfo=t;
|
---|
7618 | this._buttonDivId={};
|
---|
7619 | this._buttonId={};
|
---|
7620 | if(this._buttonInfo.length==1){
|
---|
7621 | if(!this._buttonInfo[0].id){
|
---|
7622 | this._buttonInfo[0].id=Dwt.getNextId()
|
---|
7623 | }
|
---|
7624 | this._activeButtonId=this._buttonInfo[0].id
|
---|
7625 | }
|
---|
7626 | for(var e=0;
|
---|
7627 | e<this._buttonInfo.length;
|
---|
7628 | e++){
|
---|
7629 | var a=this._buttonInfo[e].id;
|
---|
7630 | this._buttonDivId[a]=Dwt.getNextId();
|
---|
7631 | this._buttonId[a]=Dwt.getNextId()
|
---|
7632 | }
|
---|
7633 | this._hasMultiButtons=(this._buttonInfo.length>1)
|
---|
7634 | };
|
---|
7635 | DwtChooser.prototype._initialize=function(){
|
---|
7636 | var e=new AjxListener(this,this._transferButtonListener);
|
---|
7637 | this._button={};
|
---|
7638 | this._buttonIndex={};
|
---|
7639 | this._data={};
|
---|
7640 | for(var t=0;
|
---|
7641 | t<this._buttonInfo.length;
|
---|
7642 | t++){
|
---|
7643 | var o=this._buttonInfo[t].id;
|
---|
7644 | this._button[o]=this._setupButton(o,this._buttonId[o],this._buttonDivId[o],this._buttonInfo[t].label);
|
---|
7645 | this._button[o].addSelectionListener(e);
|
---|
7646 | this._buttonIndex[o]=t;
|
---|
7647 | this._data[o]=new AjxVector()
|
---|
7648 | }
|
---|
7649 | this.sourceListView=this._createSourceListView();
|
---|
7650 | this._addListView(this.sourceListView,this._sourceListViewDivId);
|
---|
7651 | this.sourceListView.addSelectionListener(new AjxListener(this,this._sourceListener));
|
---|
7652 | this.targetListView=this._createTargetListView();
|
---|
7653 | this._addListView(this.targetListView,this._targetListViewDivId);
|
---|
7654 | this.targetListView.addSelectionListener(new AjxListener(this,this._targetListener));
|
---|
7655 | this._removeButtonId=Dwt.getNextId();
|
---|
7656 | this._removeButton=this._setupButton(DwtChooser.REMOVE_BTN_ID,this._removeButtonId,this._removeButtonDivId,AjxMsg.remove);
|
---|
7657 | this._removeButton.addSelectionListener(new AjxListener(this,this._removeButtonListener));
|
---|
7658 | if(this._allButtons){
|
---|
7659 | this._addAllButtonId=Dwt.getNextId();
|
---|
7660 | this._addAllButton=this._setupButton(DwtChooser.ADD_ALL_BTN_ID,this._addAllButtonId,this._addAllButtonDivId,AjxMsg.addAll);
|
---|
7661 | this._addAllButton.addSelectionListener(new AjxListener(this,this._addAllButtonListener));
|
---|
7662 | this._removeAllButtonId=Dwt.getNextId();
|
---|
7663 | this._removeAllButton=this._setupButton(DwtChooser.REMOVE_ALL_BTN_ID,this._removeAllButtonId,this._removeAllButtonDivId,AjxMsg.removeAll);
|
---|
7664 | this._removeAllButton.addSelectionListener(new AjxListener(this,this._removeAllButtonListener));
|
---|
7665 | if(this._selectStyle==DwtChooser.SINGLE_SELECT){
|
---|
7666 | this._addAllButton.setVisible(false);
|
---|
7667 | this._removeAllButton.setVisible(false)
|
---|
7668 | }}
|
---|
7669 | if(this._hasTextField){
|
---|
7670 | var a={
|
---|
7671 | parent:this,type:DwtInputField.STRING};
|
---|
7672 | this._textField=new DwtInputField(a);
|
---|
7673 | this._textField.reparentHtmlElement(this._textFieldTdId);
|
---|
7674 | this._textField._chooser=this;
|
---|
7675 | this._textField.setHandler(DwtEvent.ONKEYUP,DwtChooser._onKeyUp);
|
---|
7676 | Dwt.setSize(this._textField.getInputElement(),"100%",Dwt.DEFAULT)
|
---|
7677 | }
|
---|
7678 | if(this._selectStyle==DwtChooser.SINGLE_SELECT){
|
---|
7679 | this.sourceListView.multiSelectEnabled=false;
|
---|
7680 | this.targetListView.multiSelectEnabled=false
|
---|
7681 | }};
|
---|
7682 | DwtChooser.prototype._createSourceListView=function(){
|
---|
7683 | return new DwtChooserListView(this,DwtChooserListView.SOURCE,this._slvClassName)
|
---|
7684 | };
|
---|
7685 | DwtChooser.prototype._createTargetListView=function(){
|
---|
7686 | return new DwtChooserListView(this,DwtChooserListView.TARGET,this._tlvClassName)
|
---|
7687 | };
|
---|
7688 | DwtChooser.prototype._addListView=function(t,a){
|
---|
7689 | var e=document.getElementById(a);
|
---|
7690 | e.appendChild(t.getHtmlElement());
|
---|
7691 | t.setUI(null,true);
|
---|
7692 | t._initialized=true
|
---|
7693 | };
|
---|
7694 | DwtChooser.prototype.resize=function(o,e){
|
---|
7695 | if(!o||!e){
|
---|
7696 | return
|
---|
7697 | }
|
---|
7698 | if(o==Dwt.DEFAULT&&e==Dwt.DEFAULT){
|
---|
7699 | return
|
---|
7700 | }
|
---|
7701 | var a=document.getElementById(this._buttonsDivId);
|
---|
7702 | var s=Dwt.getSize(a);
|
---|
7703 | var t,i,n;
|
---|
7704 | if(this._layoutStyle==DwtChooser.HORIZ_STYLE){
|
---|
7705 | t=this._listSize?this._listSize:(o==Dwt.DEFAULT)?o:Math.floor(((o-s.x)/2)-12);
|
---|
7706 | i=n=e
|
---|
7707 | }else{
|
---|
7708 | t=o;
|
---|
7709 | if(this._selectStyle==DwtChooser.SINGLE_SELECT){
|
---|
7710 | i=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:e-s.y-this._singleHeight-30;
|
---|
7711 | n=(e==Dwt.DEFAULT)?e:e-s.y-i-30
|
---|
7712 | }else{
|
---|
7713 | i=n=this._listSize?this._listSize:(e==Dwt.DEFAULT)?e:Math.floor(((e-s.y)/2)-12)
|
---|
7714 | }}
|
---|
7715 | this.sourceListView.setSize(t+2,i);
|
---|
7716 | this.targetListView.setSize(t+2,n)
|
---|
7717 | };
|
---|
7718 | DwtChooser.prototype._setupButton=function(n,a,o,e){
|
---|
7719 | var t=new DwtButton({
|
---|
7720 | parent:this,id:a}
|
---|
7721 | );
|
---|
7722 | t.setText(e);
|
---|
7723 | t.id=a;
|
---|
7724 | t._buttonId=n;
|
---|
7725 | var i=document.getElementById(o);
|
---|
7726 | i.appendChild(t.getHtmlElement());
|
---|
7727 | return t
|
---|
7728 | };
|
---|
7729 | DwtChooser.prototype._sourceListener=function(e){
|
---|
7730 | if(e.detail==DwtListView.ITEM_DBL_CLICKED){
|
---|
7731 | this.transfer(this.sourceListView.getSelection(),this._activeButtonId);
|
---|
7732 | this.sourceListView.deselectAll()
|
---|
7733 | }else{
|
---|
7734 | if(this._activeButtonId==DwtChooser.REMOVE_BTN_ID){
|
---|
7735 | var t=this._lastActiveTransferButtonId?this._lastActiveTransferButtonId:this._buttonInfo[0].id;
|
---|
7736 | this._setActiveButton(t)
|
---|
7737 | }}
|
---|
7738 | this.targetListView.deselectAll();
|
---|
7739 | this._enableButtons()
|
---|
7740 | };
|
---|
7741 | DwtChooser.prototype._targetListener=function(e){
|
---|
7742 | if(e.detail==DwtListView.ITEM_DBL_CLICKED){
|
---|
7743 | this.remove(this.targetListView.getSelection())
|
---|
7744 | }else{
|
---|
7745 | this._setActiveButton(DwtChooser.REMOVE_BTN_ID);
|
---|
7746 | this.sourceListView.deselectAll();
|
---|
7747 | this._enableButtons()
|
---|
7748 | }};
|
---|
7749 | DwtChooser.prototype._transferButtonListener=function(a){
|
---|
7750 | var t=DwtControl.getTargetControl(a);
|
---|
7751 | var n=t._buttonId;
|
---|
7752 | var o=this.sourceListView.getSelection();
|
---|
7753 | if(o&&o.length){
|
---|
7754 | this.transfer(o,n);
|
---|
7755 | var i=this.sourceListView.getList();
|
---|
7756 | if(i&&i.size()){
|
---|
7757 | this._selectFirst(DwtChooserListView.SOURCE)
|
---|
7758 | }else{
|
---|
7759 | this._enableButtons()
|
---|
7760 | }}else{
|
---|
7761 | var e=this._getEmailFromText();
|
---|
7762 | if(e){
|
---|
7763 | this.transfer([e],n)
|
---|
7764 | }else{
|
---|
7765 | this._setActiveButton(n)
|
---|
7766 | }}};
|
---|
7767 | DwtChooser.prototype._removeButtonListener=function(e){
|
---|
7768 | this.remove(this.targetListView.getSelection());
|
---|
7769 | var t=this.targetListView.getList();
|
---|
7770 | if(t&&t.size()){
|
---|
7771 | this._selectFirst(DwtChooserListView.TARGET)
|
---|
7772 | }else{
|
---|
7773 | this._enableButtons()
|
---|
7774 | }};
|
---|
7775 | DwtChooser.prototype._addAllButtonListener=function(e){
|
---|
7776 | this.transfer(this.sourceListView.getList().clone());
|
---|
7777 | this._selectFirst(DwtChooserListView.TARGET)
|
---|
7778 | };
|
---|
7779 | DwtChooser.prototype._removeAllButtonListener=function(e){
|
---|
7780 | this.remove(this.targetListView.getList().clone());
|
---|
7781 | this._selectFirst(DwtChooserListView.SOURCE)
|
---|
7782 | };
|
---|
7783 | DwtChooser.prototype._enableButtons=function(a,h){
|
---|
7784 | var l=this.sourceListView.getList();
|
---|
7785 | var d=this.targetListView.getList();
|
---|
7786 | var o=(a||(this.sourceListView.getSelectionCount()>0));
|
---|
7787 | for(var s=0;
|
---|
7788 | s<this._buttonInfo.length;
|
---|
7789 | s++){
|
---|
7790 | var t=this._buttonInfo[s].id;
|
---|
7791 | this._button[t].setEnabled(o)
|
---|
7792 | }
|
---|
7793 | var c=(h||(this.targetListView.getSelectionCount()>0));
|
---|
7794 | this._removeButton.setEnabled(c);
|
---|
7795 | if(this._allButtons&&(this._selectStyle==DwtChooser.MULTI_SELECT)){
|
---|
7796 | var e=l?l.size():0;
|
---|
7797 | var n=d?d.size():0;
|
---|
7798 | this._addAllButton.setEnabled(e>0);
|
---|
7799 | this._removeAllButton.setEnabled(n>0)
|
---|
7800 | }};
|
---|
7801 | DwtChooser.prototype._selectFirst=function(t,a){
|
---|
7802 | var e=(t==DwtChooserListView.SOURCE)?this.sourceListView:this.targetListView;
|
---|
7803 | var i=e.getList();
|
---|
7804 | if(i&&i.size()>0){
|
---|
7805 | e.setSelection(i.get(0))
|
---|
7806 | }};
|
---|
7807 | DwtChooser.prototype._setActiveButton=function(i){
|
---|
7808 | if(!this._hasMultiButtons){
|
---|
7809 | return
|
---|
7810 | }
|
---|
7811 | if(i!=this._activeButtonId){
|
---|
7812 | var a=(this._activeButtonId==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[this._activeButtonId];
|
---|
7813 | if(a){
|
---|
7814 | var e=DwtControl.findControl(document.getElementById(a));
|
---|
7815 | if(e){
|
---|
7816 | e.setDisplayState(DwtControl.NORMAL)
|
---|
7817 | }}
|
---|
7818 | a=(i==DwtChooser.REMOVE_BTN_ID)?this._removeButtonId:this._buttonId[i];
|
---|
7819 | var t=DwtControl.findControl(document.getElementById(a));
|
---|
7820 | if(t){
|
---|
7821 | t.setDisplayState(DwtControl.DEFAULT)
|
---|
7822 | }
|
---|
7823 | this._activeButtonId=i;
|
---|
7824 | if(i!=DwtChooser.REMOVE_BTN_ID){
|
---|
7825 | this._lastActiveTransferButtonId=i
|
---|
7826 | }}};
|
---|
7827 | DwtChooser.prototype._isDuplicate=function(e,t){
|
---|
7828 | return t.contains(e)
|
---|
7829 | };
|
---|
7830 | DwtChooser.prototype._addToSource=function(a,e,t){
|
---|
7831 | if(!a){
|
---|
7832 | return
|
---|
7833 | }
|
---|
7834 | if(!a._chooserIndex){
|
---|
7835 | var i=this.sourceListView.getList();
|
---|
7836 | a._chooserIndex=i?i.size()+1:1
|
---|
7837 | }
|
---|
7838 | this.sourceListView.addItem(a,e,t)
|
---|
7839 | };
|
---|
7840 | DwtChooser.prototype._addToTarget=function(c,e,s){
|
---|
7841 | if(!c){
|
---|
7842 | return
|
---|
7843 | }
|
---|
7844 | e=e?e:this._activeButtonId;
|
---|
7845 | if(this._noDuplicates&&this._data[e]&&this._isDuplicate(c,this._data[e])){
|
---|
7846 | return
|
---|
7847 | }
|
---|
7848 | var n=this.targetListView.getList();
|
---|
7849 | if(n&&n.contains(c)&&c.clone){
|
---|
7850 | var a=c.clone();
|
---|
7851 | a.id=Dwt.getNextId();
|
---|
7852 | c=a
|
---|
7853 | }
|
---|
7854 | var h=null;
|
---|
7855 | if(this._hasMultiButtons){
|
---|
7856 | n=[];
|
---|
7857 | for(var t=0;
|
---|
7858 | t<this._buttonInfo.length;
|
---|
7859 | t++){
|
---|
7860 | n=n.concat(this._data[this._buttonInfo[t].id].getArray())
|
---|
7861 | }
|
---|
7862 | var o=this._buttonIndex[e];
|
---|
7863 | for(h=0;
|
---|
7864 | h<n.length;
|
---|
7865 | h++){
|
---|
7866 | var l=this._buttonIndex[n[h]._buttonId];
|
---|
7867 | if(l>o){
|
---|
7868 | break
|
---|
7869 | }}}
|
---|
7870 | c._buttonId=e;
|
---|
7871 | c.id=c.id||Dwt.getNextId();
|
---|
7872 | this._data[e].add(c);
|
---|
7873 | this.targetListView.addItem(c,h,s)
|
---|
7874 | };
|
---|
7875 | DwtChooser.prototype._removeFromSource=function(t,e){
|
---|
7876 | if(!t){
|
---|
7877 | return
|
---|
7878 | }
|
---|
7879 | var a=this.sourceListView.getList();
|
---|
7880 | if(!a){
|
---|
7881 | return
|
---|
7882 | }
|
---|
7883 | if(!a.contains(t)){
|
---|
7884 | return
|
---|
7885 | }
|
---|
7886 | this.sourceListView.removeItem(t,e)
|
---|
7887 | };
|
---|
7888 | DwtChooser.prototype._removeFromTarget=function(t,e){
|
---|
7889 | if(!t){
|
---|
7890 | return
|
---|
7891 | }
|
---|
7892 | var a=this.targetListView.getList();
|
---|
7893 | if(!a){
|
---|
7894 | return
|
---|
7895 | }
|
---|
7896 | if(!a.contains(t)){
|
---|
7897 | return
|
---|
7898 | }
|
---|
7899 | this._data[t._buttonId].remove(t);
|
---|
7900 | this.targetListView.removeItem(t,e)
|
---|
7901 | };
|
---|
7902 | DwtChooser.prototype._getInsertionIndex=function(t,n){
|
---|
7903 | var s=t.getList();
|
---|
7904 | if(!s){
|
---|
7905 | return null
|
---|
7906 | }
|
---|
7907 | var e=s.getArray();
|
---|
7908 | for(var o=0;
|
---|
7909 | o<e.length;
|
---|
7910 | o++){
|
---|
7911 | if(n._chooserIndex&&e[o]._chooserIndex&&(e[o]._chooserIndex>=n._chooserIndex)){
|
---|
7912 | return o
|
---|
7913 | }}
|
---|
7914 | return null
|
---|
7915 | };
|
---|
7916 | DwtChooser.prototype._getEmailFromText=function(){
|
---|
7917 | var t=this._textField.getValue();
|
---|
7918 | var e=AjxEmailAddress.parse(t);
|
---|
7919 | if(e){
|
---|
7920 | e.id=Dwt.getNextId();
|
---|
7921 | return e
|
---|
7922 | }};
|
---|
7923 | DwtChooser._onKeyUp=function(o){
|
---|
7924 | var a=DwtUiEvent.getTarget(o);
|
---|
7925 | var n=DwtControl.findControl(a);
|
---|
7926 | var i=n._chooser;
|
---|
7927 | var t=DwtKeyEvent.getCharCode(o);
|
---|
7928 | if(t==3||t==13){
|
---|
7929 | var e=i._getEmailFromText();
|
---|
7930 | if(e){
|
---|
7931 | i.transfer([e],i._activeButtonId);
|
---|
7932 | a.value=""
|
---|
7933 | }}
|
---|
7934 | i._enableButtons(a.value.length)
|
---|
7935 | };
|
---|
7936 | DwtChooserListView=function(e){
|
---|
7937 | if(arguments.length==0){
|
---|
7938 | return
|
---|
7939 | }
|
---|
7940 | e=Dwt.getParams(arguments,DwtChooserListView.PARAMS);
|
---|
7941 | e.className=e.className||"DwtChooserListView";
|
---|
7942 | e.headerList=this._getHeaderList(parent);
|
---|
7943 | DwtListView.call(this,e);
|
---|
7944 | this.type=e.type;
|
---|
7945 | this._chooserParent=e.parent.parent
|
---|
7946 | };
|
---|
7947 | DwtChooserListView.PARAMS=["parent","type","className","view"];
|
---|
7948 | DwtChooserListView.SOURCE=1;
|
---|
7949 | DwtChooserListView.TARGET=2;
|
---|
7950 | DwtChooserListView.prototype=new DwtListView;
|
---|
7951 | DwtChooserListView.prototype.constructor=DwtChooserListView;
|
---|
7952 | DwtChooserListView.prototype._getHeaderList=function(){};
|
---|
7953 | DwtChooserListView.prototype.toString=function(){
|
---|
7954 | return"DwtChooserListView"
|
---|
7955 | };
|
---|
7956 | DwtChooserListView.prototype.setUI=function(t,e){
|
---|
7957 | e=e?e:((this.type==DwtChooserListView.TARGET)||this.parent._sourceEmptyOk);
|
---|
7958 | DwtListView.prototype.setUI.call(this,t,e)
|
---|
7959 | };
|
---|
7960 | DwtChooserListView.prototype._itemClicked=function(e,t){
|
---|
7961 | if(!t.shiftKey&&!t.ctrlKey&&t.button==DwtMouseEvent.RIGHT){
|
---|
7962 | return
|
---|
7963 | }else{
|
---|
7964 | DwtListView.prototype._itemClicked.call(this,e,t)
|
---|
7965 | }};
|
---|
7966 | DwtChooserListView.prototype._sortColumn=function(t,e){
|
---|
7967 | this._chooserParent.search(t,e)
|
---|
7968 | };
|
---|
7969 | DwtChooserListView.prototype._getHeaderSashLocation=function(){
|
---|
7970 | var t=this.getHtmlElement();
|
---|
7971 | if(Dwt.getPosition(t)==Dwt.ABSOLUTE_STYLE){
|
---|
7972 | return DwtListView.prototype._getHeaderSashLocation.call(this)
|
---|
7973 | }
|
---|
7974 | var a=Dwt.toWindow(t,0,0);
|
---|
7975 | var e=Dwt.toWindow(this._chooserParent.getHtmlElement(),0,0);
|
---|
7976 | if(!this._tmpPoint){
|
---|
7977 | this._tmpPoint=new DwtPoint()
|
---|
7978 | }
|
---|
7979 | this._tmpPoint.x=a.x-e.x;
|
---|
7980 | this._tmpPoint.y=a.y-e.y;
|
---|
7981 | return this._tmpPoint
|
---|
7982 | }
|
---|
7983 | }
|
---|
7984 | if(AjxPackage.define("ajax.dwt.widgets.DwtGridSizePicker")){
|
---|
7985 | DwtGridSizePicker=function(e,t){
|
---|
7986 | if(arguments.length==0){
|
---|
7987 | return
|
---|
7988 | }
|
---|
7989 | DwtControl.call(this,{
|
---|
7990 | parent:e,className:"DwtGridSizePicker"}
|
---|
7991 | );
|
---|
7992 | this._title=t;
|
---|
7993 | if(e instanceof DwtMenu){
|
---|
7994 | e.addPopdownListener(new AjxListener(this,this._reset))
|
---|
7995 | }
|
---|
7996 | this._reset()
|
---|
7997 | };
|
---|
7998 | DwtGridSizePicker.prototype=new DwtControl;
|
---|
7999 | DwtGridSizePicker.prototype.constructor=DwtGridSizePicker;
|
---|
8000 | DwtGridSizePicker.prototype.addSelectionListener=function(e){
|
---|
8001 | this.addListener(DwtEvent.SELECTION,e)
|
---|
8002 | };
|
---|
8003 | DwtGridSizePicker.prototype.removeSelectionListener=function(e){
|
---|
8004 | this.removeListener(DwtEvent.SELECTION,e)
|
---|
8005 | };
|
---|
8006 | DwtGridSizePicker.prototype._createGrid=function(){
|
---|
8007 | var a=this.getHtmlElement();
|
---|
8008 | var t=["<table cellpadding='0' border='0' cellspacing='0'>","<tr class='info'><td colspan='",this.maxCols,"'>",this._title,"</td></tr>"];
|
---|
8009 | var o=["<tr class='grid'>"];
|
---|
8010 | for(var e=0;
|
---|
8011 | e<this.maxCols;
|
---|
8012 | ++e){
|
---|
8013 | o.push("<td unselectable='unselectable'></td>")
|
---|
8014 | }
|
---|
8015 | o.push("</tr>");
|
---|
8016 | o=o.join("");
|
---|
8017 | for(var e=0;
|
---|
8018 | e<this.maxRows;
|
---|
8019 | ++e){
|
---|
8020 | t.push(o)
|
---|
8021 | }
|
---|
8022 | t.push("</table>");
|
---|
8023 | t=t.join("");
|
---|
8024 | a.innerHTML=t;
|
---|
8025 | a.onmouseover=DwtGridSizePicker._onMouseOver;
|
---|
8026 | a.onmouseup=DwtGridSizePicker._onSelect
|
---|
8027 | };
|
---|
8028 | DwtGridSizePicker.prototype._reset=function(){
|
---|
8029 | this._endRow=-1;
|
---|
8030 | this._endCol=-1;
|
---|
8031 | this.maxRows=7;
|
---|
8032 | this.maxCols=7;
|
---|
8033 | this._createGrid()
|
---|
8034 | };
|
---|
8035 | DwtGridSizePicker._onSelect=function(e){
|
---|
8036 | if(AjxEnv.isIE){
|
---|
8037 | e=window.event
|
---|
8038 | }
|
---|
8039 | DwtControl.getTargetControl(e)._onSelect(e)
|
---|
8040 | };
|
---|
8041 | DwtGridSizePicker.prototype._onSelect=function(i){
|
---|
8042 | if(AjxEnv.isIE){
|
---|
8043 | i=window.event
|
---|
8044 | }
|
---|
8045 | var a=new DwtUiEvent();
|
---|
8046 | a.setFromDhtmlEvent(i);
|
---|
8047 | var o=a.target;
|
---|
8048 | if(o.tagName.toLowerCase()=="td"){
|
---|
8049 | var n=o.parentNode.rowIndex;
|
---|
8050 | if(n>0){
|
---|
8051 | var e=o.cellIndex;
|
---|
8052 | var t=DwtShell.selectionEvent;
|
---|
8053 | t.item=this;
|
---|
8054 | t.detail={
|
---|
8055 | rows:n,cols:e+1};
|
---|
8056 | if(this.parent instanceof DwtMenu){
|
---|
8057 | DwtMenu.closeActiveMenu()
|
---|
8058 | }
|
---|
8059 | this.notifyListeners(DwtEvent.SELECTION,t)
|
---|
8060 | }}};
|
---|
8061 | DwtGridSizePicker.prototype._onMouseOut=function(i){
|
---|
8062 | if(AjxEnv.isIE){
|
---|
8063 | i=window.event
|
---|
8064 | }
|
---|
8065 | var t=new DwtUiEvent();
|
---|
8066 | t.setFromDhtmlEvent(i);
|
---|
8067 | var o=t.target;
|
---|
8068 | var a=this.getHtmlElement().firstChild;
|
---|
8069 | try{
|
---|
8070 | while(o&&o!==a){
|
---|
8071 | o=o.parentNode
|
---|
8072 | }}
|
---|
8073 | catch(e){
|
---|
8074 | o=null
|
---|
8075 | }
|
---|
8076 | if(!o){
|
---|
8077 | this._endRow=this._endCol=-1;
|
---|
8078 | this._update()
|
---|
8079 | }};
|
---|
8080 | DwtGridSizePicker._onMouseOver=function(e){
|
---|
8081 | if(AjxEnv.isIE){
|
---|
8082 | e=window.event
|
---|
8083 | }
|
---|
8084 | DwtControl.getTargetControl(e)._onMouseOver(e)
|
---|
8085 | };
|
---|
8086 | DwtGridSizePicker.prototype._onMouseOver=function(t){
|
---|
8087 | var e=new DwtUiEvent(true);
|
---|
8088 | e.setFromDhtmlEvent(t);
|
---|
8089 | var a=e.target;
|
---|
8090 | if(this._updateTimeout){
|
---|
8091 | clearTimeout(this._updateTimeout)
|
---|
8092 | }
|
---|
8093 | this._updateTimeout=setTimeout(AjxCallback.simpleClosure(this._updateOnTimeout,this,a),10);
|
---|
8094 | e.setToDhtmlEvent(t)
|
---|
8095 | };
|
---|
8096 | DwtGridSizePicker.prototype._addRow=function(){
|
---|
8097 | var t=this.getHtmlElement().firstChild;
|
---|
8098 | var a=t.insertRow(-1);
|
---|
8099 | a.className="grid";
|
---|
8100 | for(var e=0;
|
---|
8101 | e<this.maxCols;
|
---|
8102 | ++e){
|
---|
8103 | var o=a.insertCell(-1);
|
---|
8104 | o.unselectable=true
|
---|
8105 | }
|
---|
8106 | ++this.maxRows
|
---|
8107 | };
|
---|
8108 | DwtGridSizePicker.prototype._addCol=function(){
|
---|
8109 | var t=this.getHtmlElement().firstChild;
|
---|
8110 | var o=t.rows;
|
---|
8111 | for(var e=1;
|
---|
8112 | e<=this.maxRows;
|
---|
8113 | ++e){
|
---|
8114 | var a=o[e];
|
---|
8115 | var n=a.insertCell(-1);
|
---|
8116 | n.unselectable=true
|
---|
8117 | }
|
---|
8118 | ++t.rows[0].cells[0].colSpan;
|
---|
8119 | ++this.maxCols
|
---|
8120 | };
|
---|
8121 | DwtGridSizePicker.prototype._updateOnTimeout=function(a){
|
---|
8122 | var e=true,i,t;
|
---|
8123 | if(a.tagName.toLowerCase()=="td"){
|
---|
8124 | i=a.parentNode.rowIndex;
|
---|
8125 | if(i>0){
|
---|
8126 | t=this._endCol=a.cellIndex;
|
---|
8127 | this._endRow=a.parentNode.rowIndex-1;
|
---|
8128 | e=false
|
---|
8129 | }}
|
---|
8130 | if(e){
|
---|
8131 | this._endRow=this._endCol=-1
|
---|
8132 | }
|
---|
8133 | this._update();
|
---|
8134 | if(!e){
|
---|
8135 | if(i==this.maxRows){
|
---|
8136 | this._addRow()
|
---|
8137 | }
|
---|
8138 | if(t==this.maxCols-1){
|
---|
8139 | this._addCol()
|
---|
8140 | }}};
|
---|
8141 | DwtGridSizePicker.prototype._update=function(){
|
---|
8142 | var t=this._endRow;
|
---|
8143 | var s=this._endCol;
|
---|
8144 | var l=this.getHtmlElement().firstChild;
|
---|
8145 | var n=l.rows[0].cells[0];
|
---|
8146 | this._rows=t+1;
|
---|
8147 | this._cols=s+1;
|
---|
8148 | if(this._rows>0&&this._cols>0){
|
---|
8149 | n.innerHTML=this._rows+" x "+this._cols
|
---|
8150 | }else{
|
---|
8151 | n.innerHTML=this._title
|
---|
8152 | }
|
---|
8153 | for(var a=0;
|
---|
8154 | a<this.maxRows;
|
---|
8155 | ++a){
|
---|
8156 | var c=l.rows[a+1];
|
---|
8157 | for(var e=0;
|
---|
8158 | e<this.maxCols;
|
---|
8159 | ++e){
|
---|
8160 | var h=c.cells[e];
|
---|
8161 | var o=(a>this._endRow)||(e>this._endCol);
|
---|
8162 | if(o){
|
---|
8163 | Dwt.delClass(h,"Hovered")
|
---|
8164 | }else{
|
---|
8165 | Dwt.addClass(h,"Hovered")
|
---|
8166 | }}}}
|
---|
8167 | }
|
---|
8168 | if(AjxPackage.define("ajax.dwt.widgets.DwtSpinner")){
|
---|
8169 | DwtSpinner=function(e){
|
---|
8170 | if(arguments.length==0){
|
---|
8171 | return
|
---|
8172 | }
|
---|
8173 | DwtControl.call(this,{
|
---|
8174 | parent:e.parent,className:e.className,posStyle:e.posStyle,parentElement:e.parentElement}
|
---|
8175 | );
|
---|
8176 | this._maxValue=e.max!=null?e.max:null;
|
---|
8177 | this._minValue=e.min!=null?e.min:null;
|
---|
8178 | this._fieldSize=e.size!=null?e.size:3;
|
---|
8179 | this._origValue=e.value||0;
|
---|
8180 | this._maxLen=e.maxLen||null;
|
---|
8181 | this._step=e.step||1;
|
---|
8182 | this._decimals="decimals" in e?e.decimals:0;
|
---|
8183 | this._align=e.align||null;
|
---|
8184 | this._timerFunc=AjxCallback.simpleClosure(this._timerFunc,this);
|
---|
8185 | this._btnPressCapture=new DwtMouseEventCapture({
|
---|
8186 | targetObj:this,id:"DwtSpinner",mouseUpHdlr:AjxCallback.simpleClosure(this._stopCapture,this)}
|
---|
8187 | );
|
---|
8188 | this._createElements()
|
---|
8189 | };
|
---|
8190 | DwtSpinner.prototype=new DwtControl;
|
---|
8191 | DwtSpinner.prototype.constructor=DwtSpinner;
|
---|
8192 | DwtSpinner.INIT_TIMER=250;
|
---|
8193 | DwtSpinner.SLOW_TIMER=125;
|
---|
8194 | DwtSpinner.FAST_TIMER=33;
|
---|
8195 | DwtSpinner.prototype._createElements=function(){
|
---|
8196 | var n=this.getHtmlElement();
|
---|
8197 | var o=Dwt.getNextId();
|
---|
8198 | this._idField=o;
|
---|
8199 | this._idUpButton=o+"-up";
|
---|
8200 | this._idDownButton=o+"-down";
|
---|
8201 | var i=["<table class='DwtSpinner' cellspacing='0' cellpadding='0'>","<tr><td rowspan='2' class='DwtSpinner-inputCell'>","<input id='",o,"' autocomplete='off' />","</td>","<td unselectable id='",this._idUpButton,"' class='DwtSpinner-upBtn'><div class='ImgUpArrowSmall'> </div></td>","</tr><tr>","<td unselectable id='",this._idDownButton,"' class='DwtSpinner-downBtn'><div class='ImgDownArrowSmall'> </div></td>","</tr></table>"];
|
---|
8202 | n.innerHTML=i.join("");
|
---|
8203 | var a=this._getUpButton();
|
---|
8204 | a.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Up");
|
---|
8205 | var t=this._getDownButton();
|
---|
8206 | t.onmousedown=AjxCallback.simpleClosure(this._btnPressed,this,"Down");
|
---|
8207 | var e=this.getInputElement();
|
---|
8208 | if(this._maxLen){
|
---|
8209 | e.maxLength=this._maxLen
|
---|
8210 | }
|
---|
8211 | if(this._fieldSize){
|
---|
8212 | e.size=this._fieldSize
|
---|
8213 | }
|
---|
8214 | if(this._align){
|
---|
8215 | e.style.textAlign=this._align
|
---|
8216 | }
|
---|
8217 | if(this._origValue!=null){
|
---|
8218 | this.setValue(this._origValue)
|
---|
8219 | }
|
---|
8220 | e.onblur=AjxCallback.simpleClosure(this.setValue,this,null);
|
---|
8221 | e[(AjxEnv.isIE||AjxEnv.isOpera)?"onkeydown":"onkeypress"]=AjxCallback.simpleClosure(this.__onKeyPress,this)
|
---|
8222 | };
|
---|
8223 | DwtSpinner.prototype._getValidValue=function(e){
|
---|
8224 | var t=parseFloat(e);
|
---|
8225 | if(isNaN(t)||t==null){
|
---|
8226 | t=this._lastValidValue
|
---|
8227 | }
|
---|
8228 | if(t==null){
|
---|
8229 | t=this._minValue||0
|
---|
8230 | }
|
---|
8231 | if(this._minValue!=null&&t<this._minValue){
|
---|
8232 | t=this._minValue
|
---|
8233 | }
|
---|
8234 | if(this._maxValue!=null&&t>this._maxValue){
|
---|
8235 | t=this._maxValue
|
---|
8236 | }
|
---|
8237 | t=parseFloat(t);
|
---|
8238 | if(this._decimals!=null){
|
---|
8239 | t=t.toFixed(this._decimals)
|
---|
8240 | }
|
---|
8241 | this._lastValidValue=t;
|
---|
8242 | return t
|
---|
8243 | };
|
---|
8244 | DwtSpinner.prototype.getInputElement=function(){
|
---|
8245 | return document.getElementById(this._idField)
|
---|
8246 | };
|
---|
8247 | DwtSpinner.prototype._getUpButton=function(){
|
---|
8248 | return document.getElementById(this._idUpButton)
|
---|
8249 | };
|
---|
8250 | DwtSpinner.prototype._getDownButton=function(){
|
---|
8251 | return document.getElementById(this._idDownButton)
|
---|
8252 | };
|
---|
8253 | DwtSpinner.prototype._getButton=function(e){
|
---|
8254 | switch(e){
|
---|
8255 | case"Up":return this._getUpButton();
|
---|
8256 | case"Down":return this._getDownButton()
|
---|
8257 | }};
|
---|
8258 | DwtSpinner.prototype._setBtnState=function(e,a){
|
---|
8259 | var t=this._getButton(e);
|
---|
8260 | if(a){
|
---|
8261 | Dwt.addClass(t,"DwtSpinner-"+e+"-disabled");
|
---|
8262 | t.firstChild.className="Img"+e+"ArrowSmallDis"
|
---|
8263 | }else{
|
---|
8264 | Dwt.delClass(t,"DwtSpinner-"+e+"-disabled");
|
---|
8265 | t.firstChild.className="Img"+e+"ArrowSmall"
|
---|
8266 | }};
|
---|
8267 | DwtSpinner.prototype.getValue=function(){
|
---|
8268 | return parseFloat(this._getValidValue(this.getInputElement().value))
|
---|
8269 | };
|
---|
8270 | DwtSpinner.prototype.setValue=function(e){
|
---|
8271 | if(e==null){
|
---|
8272 | e=this.getInputElement().value
|
---|
8273 | }
|
---|
8274 | e=this._getValidValue(e);
|
---|
8275 | this.getInputElement().value=e;
|
---|
8276 | e=parseFloat(e);
|
---|
8277 | this._setBtnState("Down",this._minValue!=null&&this._minValue==e);
|
---|
8278 | this._setBtnState("Up",this._maxValue!=null&&this._maxValue==e)
|
---|
8279 | };
|
---|
8280 | DwtSpinner.prototype.setEnabled=function(e){
|
---|
8281 | DwtControl.prototype.setEnabled.call(this,e);
|
---|
8282 | this.getInputElement().disabled=!e;
|
---|
8283 | var t=this.getHtmlElement().firstChild;
|
---|
8284 | if(!e){
|
---|
8285 | Dwt.addClass(t,"DwtSpinner-disabled")
|
---|
8286 | }else{
|
---|
8287 | Dwt.delClass(t,"DwtSpinner-disabled")
|
---|
8288 | }};
|
---|
8289 | DwtSpinner.prototype._rotateVal=function(e){
|
---|
8290 | var t=this.getValue();
|
---|
8291 | switch(e){
|
---|
8292 | case"Up":t+=this._step;
|
---|
8293 | break;
|
---|
8294 | case"Down":t-=this._step;
|
---|
8295 | break
|
---|
8296 | }
|
---|
8297 | this.setValue(t)
|
---|
8298 | };
|
---|
8299 | DwtSpinner.prototype._btnPressed=function(e){
|
---|
8300 | if(!this.getEnabled()){
|
---|
8301 | return
|
---|
8302 | }
|
---|
8303 | Dwt.addClass(this._getButton(e),"DwtSpinner-"+e+"-pressed");
|
---|
8304 | this._direction=e;
|
---|
8305 | this._rotateVal(e);
|
---|
8306 | this._btnPressCapture.capture();
|
---|
8307 | this._timerSteps=0;
|
---|
8308 | this._timer=setTimeout(this._timerFunc,DwtSpinner.INIT_TIMER)
|
---|
8309 | };
|
---|
8310 | DwtSpinner.prototype._timerFunc=function(){
|
---|
8311 | var a=this.getValue();
|
---|
8312 | this._rotateVal(this._direction);
|
---|
8313 | var t=this.getValue();
|
---|
8314 | this._timerSteps++;
|
---|
8315 | var e=this._timerSteps>4?DwtSpinner.FAST_TIMER:DwtSpinner.SLOW_TIMER;
|
---|
8316 | if(a!=t){
|
---|
8317 | this._timer=setTimeout(this._timerFunc,e)
|
---|
8318 | }else{
|
---|
8319 | this._stopCapture()
|
---|
8320 | }};
|
---|
8321 | DwtSpinner.prototype._stopCapture=function(){
|
---|
8322 | if(this._timer){
|
---|
8323 | clearTimeout(this._timer)
|
---|
8324 | }
|
---|
8325 | this._timer=null;
|
---|
8326 | this._timerSteps=null;
|
---|
8327 | var t=this._direction;
|
---|
8328 | Dwt.delClass(this._getButton(t),"DwtSpinner-"+t+"-pressed");
|
---|
8329 | this._direction=null;
|
---|
8330 | this._btnPressCapture.release();
|
---|
8331 | var e=this.getInputElement();
|
---|
8332 | e.focus();
|
---|
8333 | Dwt.setSelectionRange(e,0,e.value.length)
|
---|
8334 | };
|
---|
8335 | DwtSpinner.prototype.__onKeyPress=function(a){
|
---|
8336 | if(AjxEnv.isIE){
|
---|
8337 | a=window.event
|
---|
8338 | }
|
---|
8339 | var t=null;
|
---|
8340 | switch(a.keyCode){
|
---|
8341 | case 38:t="Up";
|
---|
8342 | break;
|
---|
8343 | case 40:t="Down";
|
---|
8344 | break
|
---|
8345 | }
|
---|
8346 | if(t){
|
---|
8347 | this._rotateVal(t);
|
---|
8348 | var e=this.getInputElement();
|
---|
8349 | Dwt.setSelectionRange(e,0,e.value.length)
|
---|
8350 | }};
|
---|
8351 | DwtSpinner.prototype.focus=function(){
|
---|
8352 | this.getInputElement().focus()
|
---|
8353 | };
|
---|
8354 | DwtSpinner.prototype.select=function(){
|
---|
8355 | var e=this.getInputElement();
|
---|
8356 | e.focus();
|
---|
8357 | Dwt.setSelectionRange(e,0,e.value.length)
|
---|
8358 | }
|
---|
8359 | }
|
---|
8360 | if(AjxPackage.define("ajax.dwt.widgets.DwtButtonColorPicker")){
|
---|
8361 | DwtButtonColorPicker=function(a){
|
---|
8362 | if(arguments.length==0){
|
---|
8363 | return
|
---|
8364 | }
|
---|
8365 | a=Dwt.getParams(arguments,DwtButtonColorPicker.PARAMS);
|
---|
8366 | a.actionTiming=DwtButton.ACTION_MOUSEUP;
|
---|
8367 | DwtButton.call(this,a);
|
---|
8368 | var e=new DwtMenu({
|
---|
8369 | parent:this,style:DwtMenu.COLOR_PICKER_STYLE}
|
---|
8370 | );
|
---|
8371 | this.setMenu(e);
|
---|
8372 | var t=new DwtColorPicker(e,null,null,a.noFillLabel,a.allowColorInput);
|
---|
8373 | t.addSelectionListener(new AjxListener(this,this._colorPicked));
|
---|
8374 | this.__colorPicker=t;
|
---|
8375 | this.__color=""
|
---|
8376 | };
|
---|
8377 | DwtButtonColorPicker.PARAMS=["parent","style","className","posStyle","id","index","noFillLabel","allowColorInput"];
|
---|
8378 | DwtButtonColorPicker.prototype=new DwtButton;
|
---|
8379 | DwtButtonColorPicker.prototype.constructor=DwtButtonColorPicker;
|
---|
8380 | DwtButtonColorPicker._RGB_RE=/rgb\(([0-9]{1,3}),\s*([0-9]{1,3}),\s*([0-9]{1,3})\)/;
|
---|
8381 | DwtButtonColorPicker._hexdigits=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];
|
---|
8382 | DwtButtonColorPicker.toHex=function(i,t){
|
---|
8383 | var e=[];
|
---|
8384 | while(i){
|
---|
8385 | var a=DwtButtonColorPicker._hexdigits[i&15];
|
---|
8386 | e.push(a);
|
---|
8387 | i=i>>4
|
---|
8388 | }
|
---|
8389 | if(t!=null){
|
---|
8390 | t-=e.length;
|
---|
8391 | while(t-->0){
|
---|
8392 | e.push("0")
|
---|
8393 | }}
|
---|
8394 | e.reverse();
|
---|
8395 | return e.join("")
|
---|
8396 | };
|
---|
8397 | DwtButtonColorPicker.prototype.showColorDisplay=function(e){
|
---|
8398 | if(!this._colorEl){
|
---|
8399 | return
|
---|
8400 | }
|
---|
8401 | if(!e){
|
---|
8402 | this._colorEl.onmouseover=DwtButtonColorPicker.__colorDisplay_onMouseOver;
|
---|
8403 | this._colorEl.onmouseout=DwtButtonColorPicker.__colorDisplay_onMouseOut;
|
---|
8404 | this._colorEl.onmousedown=DwtButtonColorPicker.__colorDisplay_onMouseDown
|
---|
8405 | }};
|
---|
8406 | DwtButtonColorPicker.prototype.getColor=function(){
|
---|
8407 | return this.__color
|
---|
8408 | };
|
---|
8409 | DwtButtonColorPicker.prototype.setColor=function(e){
|
---|
8410 | var t=e.match(DwtButtonColorPicker._RGB_RE);
|
---|
8411 | if(t){
|
---|
8412 | e="#"+DwtButtonColorPicker.toHex(parseInt(t[1]),2)+DwtButtonColorPicker.toHex(parseInt(t[2]),2)+DwtButtonColorPicker.toHex(parseInt(t[3]),2)
|
---|
8413 | }
|
---|
8414 | this.__color=e;
|
---|
8415 | var a=this._colorEl;
|
---|
8416 | if(a){
|
---|
8417 | a.style.backgroundColor=e
|
---|
8418 | }};
|
---|
8419 | DwtButtonColorPicker.prototype._createHtmlFromTemplate=function(t,a){
|
---|
8420 | DwtButton.prototype._createHtmlFromTemplate.call(this,t,a);
|
---|
8421 | var e=AjxTemplate.expand("dwt.Widgets#ZButtonColorDisplay",a);
|
---|
8422 | this.setText(e);
|
---|
8423 | this._colorEl=document.getElementById(a.id+"_color")
|
---|
8424 | };
|
---|
8425 | DwtButtonColorPicker.prototype._setMinWidth=function(){};
|
---|
8426 | DwtButtonColorPicker.prototype._colorPicked=function(a){
|
---|
8427 | var e=a.detail;
|
---|
8428 | this.__color=this.__detail=e;
|
---|
8429 | var t=this._colorEl;
|
---|
8430 | if(t){
|
---|
8431 | t.style.backgroundColor=e
|
---|
8432 | }
|
---|
8433 | if(this.isListenerRegistered(DwtEvent.SELECTION)){
|
---|
8434 | var i=DwtShell.selectionEvent;
|
---|
8435 | i.item=this;
|
---|
8436 | i.detail=e;
|
---|
8437 | this.notifyListeners(DwtEvent.SELECTION,i)
|
---|
8438 | }};
|
---|
8439 | DwtButtonColorPicker.prototype.__colorDisplay_onMouseOver=function(e,t){
|
---|
8440 | if(!this.getEnabled()){
|
---|
8441 | return
|
---|
8442 | }
|
---|
8443 | Dwt.addClass(t,"ImgDisable")
|
---|
8444 | };
|
---|
8445 | DwtButtonColorPicker.prototype.__colorDisplay_onMouseOut=function(e,t){
|
---|
8446 | if(!this.getEnabled()){
|
---|
8447 | return
|
---|
8448 | }
|
---|
8449 | Dwt.delClass(t,"ImgDisable")
|
---|
8450 | };
|
---|
8451 | DwtButtonColorPicker.prototype.__colorDisplay_onMouseDown=function(t,i){
|
---|
8452 | if(!this.getEnabled()){
|
---|
8453 | return
|
---|
8454 | }
|
---|
8455 | var e=DwtShell.mouseEvent;
|
---|
8456 | e.setFromDhtmlEvent(t);
|
---|
8457 | this.__color=this.__detail=i.style.backgroundColor="";
|
---|
8458 | if(this.isListenerRegistered(DwtEvent.SELECTION)){
|
---|
8459 | var a=DwtShell.selectionEvent;
|
---|
8460 | a.item=this;
|
---|
8461 | a.detail="";
|
---|
8462 | this.notifyListeners(DwtEvent.SELECTION,a)
|
---|
8463 | }
|
---|
8464 | e._stopPropagation=true;
|
---|
8465 | e._returnValue=false;
|
---|
8466 | e.setToDhtmlEvent(t);
|
---|
8467 | return false
|
---|
8468 | };
|
---|
8469 | DwtButtonColorPicker.__colorDisplay_onMouseOver=function(e){
|
---|
8470 | var t=DwtControl.getTargetControl(e);
|
---|
8471 | t.__colorDisplay_onMouseOver(e,this)
|
---|
8472 | };
|
---|
8473 | DwtButtonColorPicker.__colorDisplay_onMouseOut=function(e){
|
---|
8474 | var t=DwtControl.getTargetControl(e);
|
---|
8475 | t.__colorDisplay_onMouseOut(e,this)
|
---|
8476 | };
|
---|
8477 | DwtButtonColorPicker.__colorDisplay_onMouseDown=function(e){
|
---|
8478 | var t=DwtControl.getTargetControl(e);
|
---|
8479 | t.__colorDisplay_onMouseDown(e,this)
|
---|
8480 | }
|
---|
8481 | }
|
---|
8482 | if(AjxPackage.define("ajax.dwt.widgets.DwtMessageComposite")){
|
---|
8483 | DwtMessageComposite=function(a,t,e){
|
---|
8484 | if(arguments.length==0){
|
---|
8485 | return
|
---|
8486 | }
|
---|
8487 | t=t||"DwtMessageComposite";
|
---|
8488 | DwtComposite.call(this,{
|
---|
8489 | parent:a,className:t,posStyle:e}
|
---|
8490 | )
|
---|
8491 | };
|
---|
8492 | DwtMessageComposite.prototype=new DwtComposite;
|
---|
8493 | DwtMessageComposite.prototype.constructor=DwtMessageComposite;
|
---|
8494 | DwtMessageComposite.prototype.toString=function(){
|
---|
8495 | return"DwtMessageComposite"
|
---|
8496 | };
|
---|
8497 | DwtMessageComposite.prototype._formatter;
|
---|
8498 | DwtMessageComposite.prototype._controls;
|
---|
8499 | DwtMessageComposite.prototype.setFormat=function(f,l,n){
|
---|
8500 | this._formatter=new AjxMessageFormat(f);
|
---|
8501 | this._controls={};
|
---|
8502 | var y=this._htmlElId;
|
---|
8503 | var x=["<table class='DwtCompositeTable' border='0' cellspacing='0' cellpadding='0'><tr valign='center'>"];
|
---|
8504 | var b=this._formatter.getSegments();
|
---|
8505 | var s={};
|
---|
8506 | var w={};
|
---|
8507 | for(var v=0;
|
---|
8508 | v<b.length;
|
---|
8509 | v++){
|
---|
8510 | var t=b[v];
|
---|
8511 | var k=t instanceof AjxMessageFormat.MessageSegment;
|
---|
8512 | var d=[y,v].join("_");
|
---|
8513 | x.push("<td id='",d,"' class='",(k?"MessageControl"+t.getIndex():"")," DwtCompositeCell'>");
|
---|
8514 | if(k){
|
---|
8515 | var u=l?l.run(this,t,v):null;
|
---|
8516 | if(!u){
|
---|
8517 | u=new DwtInputField({
|
---|
8518 | parent:this}
|
---|
8519 | )
|
---|
8520 | }
|
---|
8521 | s[d]=u.getHtmlElement();
|
---|
8522 | w[d]=n&&n.run(this,t,v);
|
---|
8523 | var m=t.getIndex();
|
---|
8524 | this._controls[m]=this._controls[m]||u
|
---|
8525 | }else{
|
---|
8526 | x.push(t.toSubPattern())
|
---|
8527 | }
|
---|
8528 | x.push("</td>")
|
---|
8529 | }
|
---|
8530 | x.push("</tr></table>");
|
---|
8531 | var o=this.getHtmlElement();
|
---|
8532 | var c=o.childNodes.length;
|
---|
8533 | var q=document.createElement("DIV");
|
---|
8534 | q.className=y+"_container";
|
---|
8535 | o.appendChild(q);
|
---|
8536 | q.innerHTML=x.join("");
|
---|
8537 | for(var d in s){
|
---|
8538 | var e=s[d];
|
---|
8539 | var h=document.getElementById(d);
|
---|
8540 | h.appendChild(e);
|
---|
8541 | for(var g in w[d]){
|
---|
8542 | h[g]=w[d][g]
|
---|
8543 | }}};
|
---|
8544 | DwtMessageComposite.prototype.format=function(){
|
---|
8545 | var t=[];
|
---|
8546 | for(var e in this._controls){
|
---|
8547 | t[e]=this._controls[e].getValue()
|
---|
8548 | }
|
---|
8549 | return this._formatter.format(t)
|
---|
8550 | }
|
---|
8551 | }
|
---|
8552 | if(AjxPackage.define("ajax.dwt.widgets.DwtRadioButtonGroup")){
|
---|
8553 | DwtRadioButtonGroup=function(a,e){
|
---|
8554 | this._radios={};
|
---|
8555 | this._radioButtons={};
|
---|
8556 | this._values={};
|
---|
8557 | this._value2id={};
|
---|
8558 | this._eventMgr=new AjxEventMgr();
|
---|
8559 | for(var t in a){
|
---|
8560 | this.addRadio(t,a[t],(t==e))
|
---|
8561 | }};
|
---|
8562 | DwtRadioButtonGroup.prototype.toString=function(){
|
---|
8563 | return"DwtRadioButtonGroup"
|
---|
8564 | };
|
---|
8565 | DwtRadioButtonGroup.prototype._enabled=true;
|
---|
8566 | DwtRadioButtonGroup.prototype._visible=true;
|
---|
8567 | DwtRadioButtonGroup.prototype.addSelectionListener=function(e){
|
---|
8568 | return this._eventMgr.addListener(DwtEvent.SELECTION,e)
|
---|
8569 | };
|
---|
8570 | DwtRadioButtonGroup.prototype.removeSelectionListener=function(e){
|
---|
8571 | return this._eventMgr.removeListener(DwtEvent.SELECTION,e)
|
---|
8572 | };
|
---|
8573 | DwtRadioButtonGroup.prototype.setEnabled=function(e){
|
---|
8574 | this._enabled=e;
|
---|
8575 | for(var t in this._radios){
|
---|
8576 | this._radios[t].disabled=!e
|
---|
8577 | }};
|
---|
8578 | DwtRadioButtonGroup.prototype.isEnabled=function(){
|
---|
8579 | return this._enabled
|
---|
8580 | };
|
---|
8581 | DwtRadioButtonGroup.prototype.setVisible=function(e){
|
---|
8582 | this._visible=e;
|
---|
8583 | for(var t in this._radioButtons){
|
---|
8584 | this._radioButtons[t].setVisible(e)
|
---|
8585 | }
|
---|
8586 | for(var t in this._radios){
|
---|
8587 | Dwt.setVisible(this._radios[t],e)
|
---|
8588 | }};
|
---|
8589 | DwtRadioButtonGroup.prototype.isVisible=function(){
|
---|
8590 | return this._visible
|
---|
8591 | };
|
---|
8592 | DwtRadioButtonGroup.prototype.addRadio=function(h,s,i){
|
---|
8593 | var e=s instanceof DwtRadioButton;
|
---|
8594 | var o=e?s:null;
|
---|
8595 | var n=o?o.getValue():s;
|
---|
8596 | this._values[h]=n;
|
---|
8597 | this._value2id[n]=h;
|
---|
8598 | var t=document.getElementById(h);
|
---|
8599 | this._radios[h]=t;
|
---|
8600 | this._radioButtons[h]=o;
|
---|
8601 | var a=AjxCallback.simpleClosure(this._handleClick,this);
|
---|
8602 | Dwt.setHandler(t,DwtEvent.ONCLICK,a);
|
---|
8603 | t.checked=i;
|
---|
8604 | if(i){
|
---|
8605 | this._selectedId=h
|
---|
8606 | }};
|
---|
8607 | DwtRadioButtonGroup.prototype.getRadioByValue=function(e){
|
---|
8608 | var t=this._value2id[e];
|
---|
8609 | return this._radios[t]
|
---|
8610 | };
|
---|
8611 | DwtRadioButtonGroup.prototype.getRadioButtonByValue=function(e){
|
---|
8612 | var t=this._value2id[e];
|
---|
8613 | return this._radioButtons[t]
|
---|
8614 | };
|
---|
8615 | DwtRadioButtonGroup.prototype.setSelectedId=function(i,e){
|
---|
8616 | if(i!=this._selectedId){
|
---|
8617 | var t=document.getElementById(i);
|
---|
8618 | if(!t){
|
---|
8619 | return
|
---|
8620 | }
|
---|
8621 | t.checked=true;
|
---|
8622 | this._selectedId=i;
|
---|
8623 | if(!e){
|
---|
8624 | var a=DwtShell.selectionEvent;
|
---|
8625 | a.reset();
|
---|
8626 | this._notifySelection(a)
|
---|
8627 | }}};
|
---|
8628 | DwtRadioButtonGroup.prototype.setSelectedValue=function(t,e){
|
---|
8629 | var a=this._valueToId(t);
|
---|
8630 | this.setSelectedId(a,e)
|
---|
8631 | };
|
---|
8632 | DwtRadioButtonGroup.prototype.getSelectedId=function(){
|
---|
8633 | return this._selectedId
|
---|
8634 | };
|
---|
8635 | DwtRadioButtonGroup.prototype.getSelectedValue=function(){
|
---|
8636 | return this._values[this._selectedId]
|
---|
8637 | };
|
---|
8638 | DwtRadioButtonGroup.prototype.getValue=function(){
|
---|
8639 | return this.getSelectedValue()
|
---|
8640 | };
|
---|
8641 | DwtRadioButtonGroup.prototype.getData=function(t){
|
---|
8642 | var e=!AjxUtil.isUndefined(this._selectedId)&&this._radioButtons[this._selectedId];
|
---|
8643 | if(e){
|
---|
8644 | return e.getData(t)
|
---|
8645 | }};
|
---|
8646 | DwtRadioButtonGroup.prototype._valueToId=function(e){
|
---|
8647 | for(var t in this._values){
|
---|
8648 | if(this._values[t]==e){
|
---|
8649 | return t
|
---|
8650 | }
|
---|
8651 | if(e===true&&this._values[t]=="true"){
|
---|
8652 | return t
|
---|
8653 | }
|
---|
8654 | if(e===false&&(this._values[t]=="false"||this._values[t]=="")){
|
---|
8655 | return t
|
---|
8656 | }}
|
---|
8657 | return null
|
---|
8658 | };
|
---|
8659 | DwtRadioButtonGroup.prototype._notifySelection=function(e){
|
---|
8660 | e.item=this;
|
---|
8661 | e.detail={
|
---|
8662 | id:this._selectedId,value:this._values[this._selectedId]};
|
---|
8663 | this._eventMgr.notifyListeners(DwtEvent.SELECTION,e)
|
---|
8664 | };
|
---|
8665 | DwtRadioButtonGroup.prototype._handleClick=function(e){
|
---|
8666 | e=DwtUiEvent.getEvent(e);
|
---|
8667 | var a=DwtUiEvent.getTarget(e);
|
---|
8668 | if(a&&a.nodeName.match(/label/i)){
|
---|
8669 | a=document.getElementById(a.getAttribute(AjxEnv.isIE?"htmlFor":"for"))
|
---|
8670 | }
|
---|
8671 | var i=a.id;
|
---|
8672 | if(!a.checked){
|
---|
8673 | for(i in this._radios){
|
---|
8674 | if(this._radios[i].checked){
|
---|
8675 | break
|
---|
8676 | }}}
|
---|
8677 | if(i!=this._selectedId){
|
---|
8678 | this._selectedId=i;
|
---|
8679 | var t=DwtShell.selectionEvent;
|
---|
8680 | DwtUiEvent.copy(t,e);
|
---|
8681 | this._notifySelection(t)
|
---|
8682 | }}
|
---|
8683 | }
|
---|
8684 | if(AjxPackage.define("ajax.dwt.widgets.DwtComboBox")){
|
---|
8685 | DwtComboBox=function(e){
|
---|
8686 | if(arguments.length==0){
|
---|
8687 | return
|
---|
8688 | }
|
---|
8689 | e=Dwt.getParams(arguments,DwtComboBox.PARAMS);
|
---|
8690 | e.className=e.className||"DwtComboBox";
|
---|
8691 | DwtComposite.call(this,e);
|
---|
8692 | this.input=null;
|
---|
8693 | this._button=null;
|
---|
8694 | this._textToValue={};
|
---|
8695 | this._valueToText={};
|
---|
8696 | this._valueToItem={};
|
---|
8697 | this._size=0;
|
---|
8698 | this._hasMenuCallback=true;
|
---|
8699 | this._menuItemListenerObj=new AjxListener(this,this._menuItemListener);
|
---|
8700 | this._inputParams=e.inputParams;
|
---|
8701 | this._createHtml()
|
---|
8702 | };
|
---|
8703 | DwtComboBox.PARAMS=["parent","inputParams","className","posStyle","dialog"];
|
---|
8704 | DwtComboBox.prototype=new DwtComposite;
|
---|
8705 | DwtComboBox.prototype.constructor=DwtComboBox;
|
---|
8706 | DwtComboBox.prototype.toString=function(){
|
---|
8707 | return"DwtComboBox"
|
---|
8708 | };
|
---|
8709 | DwtComboBox.prototype.TEMPLATE="dwt.Widgets#DwtComboBox";
|
---|
8710 | DwtComboBox.prototype.getTabGroupMember=function(){
|
---|
8711 | return this._tabGroup
|
---|
8712 | };
|
---|
8713 | DwtComboBox.prototype.addChangeListener=function(e){
|
---|
8714 | this.addListener(DwtEvent.ONCHANGE,e)
|
---|
8715 | };
|
---|
8716 | DwtComboBox.prototype.removeChangeListener=function(e){
|
---|
8717 | this.removeListener(DwtEvent.ONCHANGE,e)
|
---|
8718 | };
|
---|
8719 | DwtComboBox.prototype.add=function(i,t,e){
|
---|
8720 | this._textToValue[i]=t;
|
---|
8721 | this._valueToText[t]=i;
|
---|
8722 | if(!this._hasMenuCallback){
|
---|
8723 | var a=this._button.getMenu();
|
---|
8724 | this._createMenuItem(a,i)
|
---|
8725 | }
|
---|
8726 | if(e){
|
---|
8727 | this.setText(i)
|
---|
8728 | }
|
---|
8729 | this._size++;
|
---|
8730 | this._updateButton()
|
---|
8731 | };
|
---|
8732 | DwtComboBox.prototype.remove=function(t){
|
---|
8733 | var e=this._valueToItem[t];
|
---|
8734 | if(e){
|
---|
8735 | this._button.getMenu().removeChild(e);
|
---|
8736 | var a=this._valueToText[t];
|
---|
8737 | delete this._textToValue[a];
|
---|
8738 | delete this._valueToText[t];
|
---|
8739 | delete this._valueToItem[t];
|
---|
8740 | if(this.getText()==a){
|
---|
8741 | this.setText("")
|
---|
8742 | }
|
---|
8743 | this._size--;
|
---|
8744 | this._updateButton()
|
---|
8745 | }};
|
---|
8746 | DwtComboBox.prototype.removeAll=function(){
|
---|
8747 | this._button.setMenu(new AjxCallback(this,this._createMenu),true);
|
---|
8748 | this._hasMenuCallback=true;
|
---|
8749 | this._textToValue={};
|
---|
8750 | this._valueToText={};
|
---|
8751 | this._valueToItem={};
|
---|
8752 | this._size=0;
|
---|
8753 | this._updateButton()
|
---|
8754 | };
|
---|
8755 | DwtComboBox.prototype.getValue=function(){
|
---|
8756 | var e=this.getText();
|
---|
8757 | return this._textToValue[e]
|
---|
8758 | };
|
---|
8759 | DwtComboBox.prototype.setValue=function(e){
|
---|
8760 | var t=this._valueToText[e];
|
---|
8761 | this.setText(t||e)
|
---|
8762 | };
|
---|
8763 | DwtComboBox.prototype.getText=function(){
|
---|
8764 | return this.input.getValue()
|
---|
8765 | };
|
---|
8766 | DwtComboBox.prototype.setText=function(e){
|
---|
8767 | this.input.setValue(e)
|
---|
8768 | };
|
---|
8769 | DwtComboBox.prototype.setEnabled=function(e){
|
---|
8770 | if(e!=this._enabled){
|
---|
8771 | DwtComposite.prototype.setEnabled.call(this,e);
|
---|
8772 | this.input.setEnabled(e);
|
---|
8773 | this._button.setEnabled(e)
|
---|
8774 | }};
|
---|
8775 | DwtComboBox.prototype.focus=function(){
|
---|
8776 | this.input.focus()
|
---|
8777 | };
|
---|
8778 | DwtComboBox.prototype._createMenu=function(){
|
---|
8779 | var o=new DwtMenu({
|
---|
8780 | parent:this}
|
---|
8781 | );
|
---|
8782 | for(var e in this._textToValue){
|
---|
8783 | var t=this._createMenuItem(o,e);
|
---|
8784 | var a=this._textToValue[e];
|
---|
8785 | this._valueToItem[a]=t
|
---|
8786 | }
|
---|
8787 | this._hasMenuCallback=false;
|
---|
8788 | return o
|
---|
8789 | };
|
---|
8790 | DwtComboBox.prototype._createMenuItem=function(a,t){
|
---|
8791 | var e=new DwtMenuItem({
|
---|
8792 | parent:a}
|
---|
8793 | );
|
---|
8794 | e.setText(t);
|
---|
8795 | e.addSelectionListener(this._menuItemListenerObj);
|
---|
8796 | if(!this._menuWidth){
|
---|
8797 | this._menuWidth=this.getW()-10
|
---|
8798 | }
|
---|
8799 | e.getHtmlElement().style.minWidth=this._menuWidth;
|
---|
8800 | return e
|
---|
8801 | };
|
---|
8802 | DwtComboBox.prototype._menuItemListener=function(i){
|
---|
8803 | var t=i.dwtObj;
|
---|
8804 | var o=this.input.getValue();
|
---|
8805 | var n=t.getText();
|
---|
8806 | this.input.setValue(n);
|
---|
8807 | var a=DwtUiEvent.getEvent(i);
|
---|
8808 | a._args={
|
---|
8809 | selectObj:this,newValue:n,oldValue:o};
|
---|
8810 | this.notifyListeners(DwtEvent.ONCHANGE,a);
|
---|
8811 | var e=this.input.getInputElement();
|
---|
8812 | e.focus();
|
---|
8813 | e.select()
|
---|
8814 | };
|
---|
8815 | DwtComboBox.prototype._handleKeyDown=function(e){
|
---|
8816 | this.__ovalue=this.input.getValue();
|
---|
8817 | return true
|
---|
8818 | };
|
---|
8819 | DwtComboBox.prototype._handleKeyUp=function(t){
|
---|
8820 | DwtInputField._keyUpHdlr(t);
|
---|
8821 | var e=DwtUiEvent.getEvent(t);
|
---|
8822 | e._args={
|
---|
8823 | selectObj:this,newValue:this.input.getValue(),oldValue:this.__ovalue};
|
---|
8824 | this.notifyListeners(DwtEvent.ONCHANGE,e);
|
---|
8825 | return true
|
---|
8826 | };
|
---|
8827 | DwtComboBox.prototype._updateButton=function(){
|
---|
8828 | this._button.setVisible(this._size>0)
|
---|
8829 | };
|
---|
8830 | DwtComboBox.prototype._createHtml=function(e){
|
---|
8831 | var t={
|
---|
8832 | id:this._htmlElId};
|
---|
8833 | this._createHtmlFromTemplate(e||this.TEMPLATE,t)
|
---|
8834 | };
|
---|
8835 | DwtComboBox.prototype._createHtmlFromTemplate=function(t,a){
|
---|
8836 | DwtComposite.prototype._createHtmlFromTemplate.call(this,t,a);
|
---|
8837 | var e=this._inputParams||{};
|
---|
8838 | e.parent=this;
|
---|
8839 | e.size=e.size||40;
|
---|
8840 | delete this._inputParams;
|
---|
8841 | this.input=new DwtInputField(e);
|
---|
8842 | this.input.replaceElement(a.id+"_input");
|
---|
8843 | this.input.setHandler(DwtEvent.ONKEYDOWN,AjxCallback.simpleClosure(this._handleKeyDown,this));
|
---|
8844 | this.input.setHandler(DwtEvent.ONKEYUP,AjxCallback.simpleClosure(this._handleKeyUp,this));
|
---|
8845 | this._button=new DwtComboBoxButton({
|
---|
8846 | parent:this}
|
---|
8847 | );
|
---|
8848 | this._button.setMenu(new AjxListener(this,this._createMenu),true);
|
---|
8849 | this._button.replaceElement(a.id+"_button");
|
---|
8850 | this._updateButton();
|
---|
8851 | this._tabGroup=new DwtTabGroup(this._htmlElId);
|
---|
8852 | this._tabGroup.addMember(this.input);
|
---|
8853 | this._tabGroup.addMember(this._button)
|
---|
8854 | };
|
---|
8855 | DwtComboBox.prototype._replaceElementHook=function(t,a,e,i){
|
---|
8856 | DwtComposite.prototype._replaceElementHook.apply(this,arguments);
|
---|
8857 | if(t.size){
|
---|
8858 | this.input.getInputElement().size=t.size
|
---|
8859 | }
|
---|
8860 | if(t.title){
|
---|
8861 | this.input.setHint(t.title)
|
---|
8862 | }};
|
---|
8863 | DwtComboBoxButton=function(e){
|
---|
8864 | e=Dwt.getParams(arguments,DwtComboBoxButton.PARAMS);
|
---|
8865 | e.posStyle=Dwt.RELATIVE_STYLE;
|
---|
8866 | DwtButton.call(this,e)
|
---|
8867 | };
|
---|
8868 | DwtComboBoxButton.prototype=new DwtButton;
|
---|
8869 | DwtComboBoxButton.prototype.constructor=DwtComboBoxButton;
|
---|
8870 | DwtComboBoxButton.prototype.toString=function(){
|
---|
8871 | return"DwtComboBoxButton"
|
---|
8872 | };
|
---|
8873 | DwtComboBoxButton.PARAMS=["parent","className"];
|
---|
8874 | DwtComboBoxButton.prototype.TEMPLATE="dwt.Widgets#DwtComboBoxButton"
|
---|
8875 | }
|
---|
8876 | if(AjxPackage.define("zimbra.common.ZLoginFactory")){
|
---|
8877 | ZLoginFactory=function(){};
|
---|
8878 | ZLoginFactory.USER_ID="ZLoginUserName";
|
---|
8879 | ZLoginFactory.PASSWORD_ID="ZLoginPassword";
|
---|
8880 | ZLoginFactory.REMEMBER_ME_ID="rememberMe";
|
---|
8881 | ZLoginFactory.REMEMBER_ME_CONTAINER_ID="ZLoginRememberMeContainer";
|
---|
8882 | ZLoginFactory.NEW_PASSWORD_ID="newpass1";
|
---|
8883 | ZLoginFactory.NEW_PASSWORD_TR_ID="ZLoginNewPassword1Tr";
|
---|
8884 | ZLoginFactory.PASSWORD_CONFIRM_TR_ID="ZLoginNewPassword2Tr";
|
---|
8885 | ZLoginFactory.PASSWORD_CONFIRM_ID="newpass2";
|
---|
8886 | ZLoginFactory.LOGIN_BUTTON_ID="ZLoginButton";
|
---|
8887 | ZLoginFactory.HIDDEN_BUTTON_ID="ZLoginHiddenButton";
|
---|
8888 | ZLoginFactory.TEXT_TYPE=0;
|
---|
8889 | ZLoginFactory.CHECKBOX_TYPE=1;
|
---|
8890 | ZLoginFactory.BUTTON_TYPE=2;
|
---|
8891 | ZLoginFactory.TAB_ORDER=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_ID,ZLoginFactory.PASSWORD_CONFIRM_ID,ZLoginFactory.REMEMBER_ME_ID,ZLoginFactory.LOGIN_BUTTON_ID];
|
---|
8892 | ZLoginFactory.VISIBILITY=[ZLoginFactory.USER_ID,ZLoginFactory.PASSWORD_ID,ZLoginFactory.NEW_PASSWORD_TR_ID,ZLoginFactory.PASSWORD_CONFIRM_TR_ID,ZLoginFactory.REMEMBER_ME_CONTAINER_ID,ZLoginFactory.LOGIN_BUTTON_ID];
|
---|
8893 | ZLoginFactory.TAB_TYPE=[ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.TEXT_TYPE,ZLoginFactory.CHECKBOX_TYPE,ZLoginFactory.BUTTON_TYPE];
|
---|
8894 | ZLoginFactory.copyDefaultParams=function(e){
|
---|
8895 | return{
|
---|
8896 | showPanelBorder:true,companyURL:e.splashScreenCompanyURL||"",shortVersion:"",longVersion:"",appName:e.splashScreenAppName||"",productName:"",showError:false,errorMsg:"",showAbout:false,aboutMsg:"",showLoading:false,loadingMsg:e.splashScreenLoading||"",showForm:false,showUserField:false,userNameMsg:e.username?e.username+":":"",showPasswordField:false,passwordMsg:e.password?e.password+":":"",showNewPasswordFields:false,newPassword1Msg:e.newPassword+":"||"",newPassword2Msg:e.confirm+":"||"",showLicenseMsg:false,licenseMsg:"",showRememberMeCheckbox:false,rememberMeMsg:e.rememberMe||"",showLogOff:false,logOffMsg:e.loginAsDiff||"",logOffAction:"",showButton:false,buttonName:e.login||"",copyrightText:e.splashScreenCopyright||""}
|
---|
8897 | };
|
---|
8898 | ZLoginFactory.getLoginPanel=function(){
|
---|
8899 | var e=this.get("ZLoginPanel");
|
---|
8900 | if(!e){
|
---|
8901 | e=this.get("ZLoginPanelInvisible")
|
---|
8902 | }
|
---|
8903 | return e
|
---|
8904 | };
|
---|
8905 | ZLoginFactory.showErrorMsg=function(e){
|
---|
8906 | this.setHTML("ZLoginErrorMsg",e);
|
---|
8907 | this.show("ZLoginErrorPanel");
|
---|
8908 | this._flickerErrorMessagePanel()
|
---|
8909 | };
|
---|
8910 | ZLoginFactory.hideErrorMsg=function(){
|
---|
8911 | this.hide("ZLoginErrorPanel")
|
---|
8912 | };
|
---|
8913 | ZLoginFactory.getErrorMsgPanel=function(){
|
---|
8914 | return this.get("ZLoginErrorPanel")
|
---|
8915 | };
|
---|
8916 | ZLoginFactory.showAboutMsg=function(e){
|
---|
8917 | this.setHTML("ZLoginAboutPanel",e);
|
---|
8918 | this.show("ZLoginAboutPanel")
|
---|
8919 | };
|
---|
8920 | ZLoginFactory.hideAboutMsg=function(){
|
---|
8921 | this.hide("ZLoginAboutPanel")
|
---|
8922 | };
|
---|
8923 | ZLoginFactory.getAboutMsg=function(){
|
---|
8924 | return this.get("ZLoginAboutPanel")
|
---|
8925 | };
|
---|
8926 | ZLoginFactory.showLoadingMsg=function(e){
|
---|
8927 | this.setHTML("ZLoginLoadingMsg",e);
|
---|
8928 | this.show("ZLoginAboutPanel")
|
---|
8929 | };
|
---|
8930 | ZLoginFactory.hideLoadingMsg=function(){
|
---|
8931 | this.hide("ZLoginAboutPanel")
|
---|
8932 | };
|
---|
8933 | ZLoginFactory.getLoadingMsg=function(){
|
---|
8934 | return this.get("ZLoginAboutPanel")
|
---|
8935 | };
|
---|
8936 | ZLoginFactory.showForm=function(){
|
---|
8937 | this.show("ZLoginFormPanel")
|
---|
8938 | };
|
---|
8939 | ZLoginFactory.hideForm=function(){
|
---|
8940 | this.hide("ZLoginFormPanel")
|
---|
8941 | };
|
---|
8942 | ZLoginFactory.getForm=function(){
|
---|
8943 | return this.get("ZLoginFormPanel")
|
---|
8944 | };
|
---|
8945 | ZLoginFactory.showUserField=function(e){
|
---|
8946 | this.setValue(ZLoginFactory.USER_ID,e);
|
---|
8947 | this.show(ZLoginFactory.USER_ID)
|
---|
8948 | };
|
---|
8949 | ZLoginFactory.hideUserField=function(){
|
---|
8950 | this.hide(ZLoginFactory.USER_ID)
|
---|
8951 | };
|
---|
8952 | ZLoginFactory.getUserField=function(){
|
---|
8953 | return this.get(ZLoginFactory.USER_ID)
|
---|
8954 | };
|
---|
8955 | ZLoginFactory.showPasswordField=function(e){
|
---|
8956 | this.show(ZLoginFactory.PASSWORD_ID)
|
---|
8957 | };
|
---|
8958 | ZLoginFactory.hidePasswordField=function(){
|
---|
8959 | this.hide(ZLoginFactory.PASSWORD_ID)
|
---|
8960 | };
|
---|
8961 | ZLoginFactory.getPasswordField=function(){
|
---|
8962 | return this.get(ZLoginFactory.PASSWORD_ID)
|
---|
8963 | };
|
---|
8964 | ZLoginFactory.showNewPasswordFields=function(){
|
---|
8965 | this.show(ZLoginFactory.NEW_PASSWORD_TR_ID);
|
---|
8966 | this.show(ZLoginFactory.PASSWORD_CONFIRM_TR_ID)
|
---|
8967 | };
|
---|
8968 | ZLoginFactory.hideNewPasswordFields=function(){
|
---|
8969 | this.hide(ZLoginFactory.NEW_PASSWORD_TR_ID);
|
---|
8970 | this.hide(ZLoginFactory.PASSWORD_CONFIRM_TR_ID)
|
---|
8971 | };
|
---|
8972 | ZLoginFactory.areNewPasswordFieldsShown=function(){
|
---|
8973 | return this.isShown(ZLoginFactory.NEW_PASSWORD_TR_ID)
|
---|
8974 | };
|
---|
8975 | ZLoginFactory.getNewPasswordField=function(){
|
---|
8976 | return this.get(ZLoginFactory.NEW_PASSWORD_ID)
|
---|
8977 | };
|
---|
8978 | ZLoginFactory.getPasswordConfirmField=function(){
|
---|
8979 | return this.get(ZLoginFactory.PASSWORD_CONFIRM_ID)
|
---|
8980 | };
|
---|
8981 | ZLoginFactory.showRememberMeCheckbox=function(){
|
---|
8982 | this.show(ZLoginFactory.REMEMBER_ME_CONTAINER_ID)
|
---|
8983 | };
|
---|
8984 | ZLoginFactory.hideRememberMeCheckbox=function(){
|
---|
8985 | this.hide(ZLoginFactory.REMEMBER_ME_CONTAINER_ID)
|
---|
8986 | };
|
---|
8987 | ZLoginFactory.showLogOff=function(){
|
---|
8988 | this.show("ZLoginLogOffContainer")
|
---|
8989 | };
|
---|
8990 | ZLoginFactory.hideLogOff=function(){
|
---|
8991 | this.hide("ZLoginLogOffContainer")
|
---|
8992 | };
|
---|
8993 | ZLoginFactory.setLoginButtonName=function(e){
|
---|
8994 | this.setHTML("ZLoginButtonText",e)
|
---|
8995 | };
|
---|
8996 | ZLoginFactory.setLoginButtonAction=function(t){
|
---|
8997 | var e=document.getElementById(ZLoginFactory.LOGIN_BUTTON_ID);
|
---|
8998 | if(e){
|
---|
8999 | e.onclick=t
|
---|
9000 | }};
|
---|
9001 | ZLoginFactory.getLoginButton=function(){
|
---|
9002 | return this.get(ZLoginFactory.LOGIN_BUTTON_ID)
|
---|
9003 | };
|
---|
9004 | ZLoginFactory.getLoginDialogHTML=function(t){
|
---|
9005 | var e=["<div ",(t.showPanelBorder?"id='ZLoginPanel'":"id='ZLoginPanelInvisible'"),">","<table class='zLoginTable' width='100%' cellpadding=0 cellspacing=0>","<tr><td id='ZLoginHeaderContainer'><center>","<table class='zLoginTable'>","<tr><td id='ZLoginBannerContainer'>","<div id='ZLoginBannerPanel'>","<table class='zLoginTable'><tr>","<td><div style='cursor:pointer' id='ZLoginBannerImage' class='ImgLoginBanner'"," onclick='window.open(\"",t.companyURL,'", "_blank")\'></div></td>',"<td valign=top id='ZLoginShortVersion'>",t.shortVersion,"</td>","</tr></table>","<div id='ZLoginAppName'>",t.appName,"</div>","<div id='ZLoginProductName'>",t.productName,"</div>","<div id='ZLoginLongVersion'>",t.longVersion,"</div>","</div>","</td>","</tr>","</table>","</center></td>","</tr>","<tr><td id='ZLoginBodyContainer'>","<div id='ZLoginErrorPanel' ",(t.showError?"":"style='display:none'"),">","<table>","<tr><td valign='top' width='40'><div class='ImgCritical_32'></td>","<td width='*' id='ZLoginErrorMsg' class='errorText'>",t.errorMsg,"</td>","</tr>","</table>","</div>","","<div id='ZLoginAboutPanel' ",(t.showAbout?"":"style='display:none'"),">",t.aboutMsg,"</div>","<div id='ZLoginLoadingPanel' ",(t.showLoading?"":"style='display:none'"),">","<table><tr><td></td><td id='ZLoginLoadingMsg'>",t.loadingMsg,"</td></tr></table>","</div>","<div id='ZLoginFormPanel' ",(t.showForm?"":"style='display:none'"),">","<table class='zLoginTable' width='100%' cellpadding=4>","<tr id='ZLoginUserTr'",(t.showUserField?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",t.userNameMsg,"</td>","<td class='zLoginFieldContainer' colspan=2>","<input id='",ZLoginFactory.USER_ID,"' class='zLoginField' autocomplete=OFF type=text tabIndex=1>","</td>","</tr>","<tr id='ZLoginPasswordTr' ",(t.showPasswordField?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",t.passwordMsg,"</td>","<td class='zLoginFieldContainer' colspan=2>","<input id='",ZLoginFactory.PASSWORD_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>","</td>","</tr>","<tr id='",ZLoginFactory.NEW_PASSWORD_TR_ID,"' ",(t.showNewPasswordFields?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",t.newPassword1Msg,"</td>","<td class='zLoginFieldContainer' colspan=2>","<input id='",ZLoginFactory.NEW_PASSWORD_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>","</td>","</tr>","<tr id='",ZLoginFactory.PASSWORD_CONFIRM_TR_ID,"' ",(t.showNewPasswordFields?"":"style='display:none'"),"><td class='zLoginLabelContainer'>",t.newPassword2Msg,"</td>","<td class='zLoginFieldContainer' colspan=2>","<input id='",ZLoginFactory.PASSWORD_CONFIRM_ID,"' class='zLoginField' autocomplete=OFF type=password tabIndex=2>","</td>","</tr>","<tr id='ZLoginLicenseMsgContainer' ",(t.showLicenseMsg?"":"style='display:none'"),">","<td colspan=3 id='ZLoginLicenseMsg'>",t.licenseMsg,"</td>","</tr>","<tr><td class='zLoginLabelContainer'> </td>","<td class='zLoginFieldContainer' id='",ZLoginFactory.REMEMBER_ME_CONTAINER_ID,"' ",(t.showRememberMeCheckbox?"":"style='display:none'"),">","<table class='zLoginTable' width=100%>","<tr><td width=1><input id='",ZLoginFactory.REMEMBER_ME_ID,"' type='checkbox'></td>","<td class='zLoginCheckboxLabelContainer'>",t.rememberMeMsg,"</td>","</tr>","</table>","</td>","<td class='zLoginFieldContainer' id='ZLoginLogOffContainer' ",(t.showLogOff?"":"style='display:none'"),">","<a href='' onclick='javascript:"+t.logOffAction+";'>"+t.logOffMsg+"</a>","</td>","<td class='zLoginButtonContainer' align='right'",(t.showButton?"":"style='display:none'"),">","<div id='",ZLoginFactory.LOGIN_BUTTON_ID,"' class='DwtButton'","onclick='",t.loginAction,";return false'","onmouseover='javascript:this.className=\"DwtButton-hover\"'","onmouseout='javascript:this.className=\"DwtButton\"'","onmousedown='javascript:this.className=\"DwtButton-active\";return false'","onmouseup='javascript:this.className=\"DwtButton\"'","onmousemove='javascript:return false'","onselectstart='javascript: return false'","onfocus='javascript:this.className = \"DwtButton-focused\";return false'","onblur='javascript:this.className = \"DwtButton\";return false'",">","<table style='width:100%;height:100%' cellspacing=0>","<tr><td align='center' class='Text' id='ZLoginButtonText'>",t.buttonName,"</td></tr>","</table>","</div>","<!-- non-IE browsers dont allow focus for non-INPUT elements so we have to"," create a hidden input to fake focus for our DIV which acts as an input button -->","<input type='button' style='position:absolute;top:-10000;left:-10000;' id='",ZLoginFactory.HIDDEN_BUTTON_ID,"'>","</td>","</tr>","</table>","</div>","<table class='zLoginTable' width='100%' cellpadding=0 cellspacing=0>","<tr>","<td id='ZloginClientLevelContainer'>",t.clientLevelNotice,"</td>","</tr>","<tr>","<td id='ZLoginLicenseContainer'>",t.copyrightText,"</td>","</tr>","</table>","</td>","</tr>","</table>","</div>"].join("");
|
---|
9006 | return e
|
---|
9007 | };
|
---|
9008 | ZLoginFactory.setHTML=function(a,e){
|
---|
9009 | var t=document.getElementById(a);
|
---|
9010 | if(t&&e!=null){
|
---|
9011 | t.innerHTML=e
|
---|
9012 | }};
|
---|
9013 | ZLoginFactory.setValue=function(a,e){
|
---|
9014 | var t=document.getElementById(a);
|
---|
9015 | if(t&&e!=null){
|
---|
9016 | t.value=e
|
---|
9017 | }};
|
---|
9018 | ZLoginFactory.show=function(a,e){
|
---|
9019 | var t=document.getElementById(a);
|
---|
9020 | if(t){
|
---|
9021 | t.style.display=""
|
---|
9022 | }};
|
---|
9023 | ZLoginFactory.isShown=function(t){
|
---|
9024 | var e=document.getElementById(t);
|
---|
9025 | return e?(e.style.display!="none"):false
|
---|
9026 | };
|
---|
9027 | ZLoginFactory.hide=function(t){
|
---|
9028 | var e=document.getElementById(t);
|
---|
9029 | if(e){
|
---|
9030 | e.style.display="none"
|
---|
9031 | }};
|
---|
9032 | ZLoginFactory.get=function(e){
|
---|
9033 | return document.getElementById(e)
|
---|
9034 | };
|
---|
9035 | ZLoginFactory.handleKeyPress=function(h){
|
---|
9036 | h=h||window.event;
|
---|
9037 | if(h==null){
|
---|
9038 | return true
|
---|
9039 | }
|
---|
9040 | var n=h.target?h.target:h.srcElement;
|
---|
9041 | if(!n){
|
---|
9042 | return true
|
---|
9043 | }
|
---|
9044 | var c=h.keyCode;
|
---|
9045 | var e=false;
|
---|
9046 | if(c==13){
|
---|
9047 | if(n.id==ZLoginFactory.USER_ID||n.id==ZLoginFactory.NEW_PASSWORD_ID){
|
---|
9048 | e=true
|
---|
9049 | }else{
|
---|
9050 | var t=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID).onclick;
|
---|
9051 | if(t){
|
---|
9052 | t.call(n)
|
---|
9053 | }
|
---|
9054 | ZLoginFactory._cancelEvent(h);
|
---|
9055 | return false
|
---|
9056 | }}
|
---|
9057 | if(e||(c==9)){
|
---|
9058 | var l=ZLoginFactory.TAB_ORDER.length-1;
|
---|
9059 | for(var a=0;
|
---|
9060 | a<ZLoginFactory.TAB_ORDER.length;
|
---|
9061 | a++){
|
---|
9062 | if(ZLoginFactory.TAB_ORDER[a]==n.id){
|
---|
9063 | l=a;
|
---|
9064 | break
|
---|
9065 | }}
|
---|
9066 | var o=!h.shiftKey;
|
---|
9067 | var u=ZLoginFactory._getTabToIndex(l,o);
|
---|
9068 | var s=ZLoginFactory.TAB_ORDER[u];
|
---|
9069 | var d=ZLoginFactory.TAB_TYPE[u];
|
---|
9070 | ZLoginFactory._onFocusChange(d,s,n);
|
---|
9071 | ZLoginFactory._cancelEvent(h)
|
---|
9072 | }};
|
---|
9073 | ZLoginFactory._cancelEvent=function(e){
|
---|
9074 | if(e.stopPropagation){
|
---|
9075 | e.stopPropagation()
|
---|
9076 | }
|
---|
9077 | if(e.preventDefault){
|
---|
9078 | e.preventDefault()
|
---|
9079 | }
|
---|
9080 | e.cancelBubble=true;
|
---|
9081 | e.returnValue=false
|
---|
9082 | };
|
---|
9083 | ZLoginFactory._onFocusChange=function(t,n,o){
|
---|
9084 | if((t!=ZLoginFactory.BUTTON_TYPE)&&!AjxEnv.isIE){
|
---|
9085 | ZLoginFactory._loginButtonBlur()
|
---|
9086 | }
|
---|
9087 | if(t==ZLoginFactory.TEXT_TYPE){
|
---|
9088 | var a=ZLoginFactory.get(n);
|
---|
9089 | a.focus();
|
---|
9090 | a.select()
|
---|
9091 | }else{
|
---|
9092 | if(t==ZLoginFactory.CHECKBOX_TYPE){
|
---|
9093 | var i=ZLoginFactory.get(n);
|
---|
9094 | i.focus()
|
---|
9095 | }else{
|
---|
9096 | var e=ZLoginFactory.get(n);
|
---|
9097 | if(AjxEnv.isIE){
|
---|
9098 | e.focus()
|
---|
9099 | }else{
|
---|
9100 | ZLoginFactory._loginButtonFocus(e);
|
---|
9101 | o.blur();
|
---|
9102 | document.getElementById(ZLoginFactory.HIDDEN_BUTTON_ID).focus()
|
---|
9103 | }}}};
|
---|
9104 | ZLoginFactory._getTabToIndex=function(n,e){
|
---|
9105 | var t=n;
|
---|
9106 | do{
|
---|
9107 | var o;
|
---|
9108 | if(e){
|
---|
9109 | t=(t==(ZLoginFactory.TAB_ORDER.length-1))?0:t+1
|
---|
9110 | }else{
|
---|
9111 | t=(t==0)?(ZLoginFactory.TAB_ORDER.length-1):t-1
|
---|
9112 | }
|
---|
9113 | var s=ZLoginFactory.TAB_ORDER[t];
|
---|
9114 | var a=ZLoginFactory.VISIBILITY[t];
|
---|
9115 | var i=ZLoginFactory.get(s);
|
---|
9116 | if(ZLoginFactory.isShown(a)&&!ZLoginFactory.get(s).disabled){
|
---|
9117 | return t
|
---|
9118 | }}
|
---|
9119 | while(t!=n);
|
---|
9120 | return 0
|
---|
9121 | };
|
---|
9122 | ZLoginFactory._loginButtonFocus=function(e){
|
---|
9123 | e.className="DwtButton-focused"
|
---|
9124 | };
|
---|
9125 | ZLoginFactory._loginButtonBlur=function(e){
|
---|
9126 | var e=ZLoginFactory.get(ZLoginFactory.LOGIN_BUTTON_ID);
|
---|
9127 | e.className="DwtButton"
|
---|
9128 | };
|
---|
9129 | ZLoginFactory._flickerErrorMessagePanel=function(){
|
---|
9130 | ZLoginFactory.getErrorMsgPanel().style.visibility="hidden";
|
---|
9131 | window.setTimeout(ZLoginFactory._showErrorMessagePanel,8)
|
---|
9132 | };
|
---|
9133 | ZLoginFactory._showErrorMessagePanel=function(){
|
---|
9134 | ZLoginFactory.getErrorMsgPanel().style.visibility="visible"
|
---|
9135 | }
|
---|
9136 | }
|
---|
9137 | if(AjxPackage.define("zimbra.common.ZmBaseSplashScreen")){
|
---|
9138 | ZmBaseSplashScreen=function(t,e,a){
|
---|
9139 | if(arguments.length==0){
|
---|
9140 | return
|
---|
9141 | }
|
---|
9142 | if(!(t instanceof DwtShell)){
|
---|
9143 | throw new AjxException("Parent must be a DwtShell",AjxException.INVALIDPARENT,"ZSplashScreen")
|
---|
9144 | }
|
---|
9145 | a=a||"ZSplashScreen";
|
---|
9146 | DwtControl.call(this,{
|
---|
9147 | parent:t,className:a,posStyle:Dwt.ABSOLUTE_STYLE}
|
---|
9148 | );
|
---|
9149 | this.__createContents()
|
---|
9150 | };
|
---|
9151 | ZmBaseSplashScreen.prototype=new DwtControl;
|
---|
9152 | ZmBaseSplashScreen.prototype.constructor=ZmBaseSplashScreen;
|
---|
9153 | ZmBaseSplashScreen.prototype.getHtml=function(){};
|
---|
9154 | ZmBaseSplashScreen.prototype.setVisible=function(e){
|
---|
9155 | if(e==this.getVisible()){
|
---|
9156 | return
|
---|
9157 | }
|
---|
9158 | if(e){
|
---|
9159 | this.__createContents()
|
---|
9160 | }
|
---|
9161 | DwtControl.prototype.setVisible.call(this,e);
|
---|
9162 | if(!e){
|
---|
9163 | this.getHtmlElement().innerHTML=""
|
---|
9164 | }};
|
---|
9165 | ZmBaseSplashScreen.prototype.__createContents=function(){
|
---|
9166 | var a=this.getHtmlElement();
|
---|
9167 | a.style.zIndex=Dwt.Z_SPLASH;
|
---|
9168 | var t=document.createElement("table");
|
---|
9169 | t.border=t.cellSpacing=t.cellPadding=0;
|
---|
9170 | Dwt.setSize(t,"100%","100%");
|
---|
9171 | var i=t.insertRow(0);
|
---|
9172 | var e=i.insertCell(0);
|
---|
9173 | e.vAlign="middle";
|
---|
9174 | e.align="center";
|
---|
9175 | e.innerHTML=this.getHtml();
|
---|
9176 | a.appendChild(t);
|
---|
9177 | a.style.cursor="wait"
|
---|
9178 | }
|
---|
9179 | }
|
---|
9180 | if(AjxPackage.define("zimbra.common.ZmErrorDialog")){
|
---|
9181 | ZmErrorDialog=function(t,a){
|
---|
9182 | this._strNav=this._getNavigatorInfo();
|
---|
9183 | this._subjPfx=this._getSubjectPrefix();
|
---|
9184 | var i=new DwtDialog_ButtonDescriptor(ZmErrorDialog.REPORT_BUTTON,a.report,DwtDialog.ALIGN_LEFT);
|
---|
9185 | var e=new DwtDialog_ButtonDescriptor(ZmErrorDialog.DETAIL_BUTTON,a.showDetails,DwtDialog.ALIGN_LEFT);
|
---|
9186 | DwtMessageDialog.call(this,{
|
---|
9187 | parent:t,extraButtons:[i,e]}
|
---|
9188 | );
|
---|
9189 | this.registerCallback(ZmErrorDialog.REPORT_BUTTON,this._reportCallback,this);
|
---|
9190 | this.registerCallback(ZmErrorDialog.DETAIL_BUTTON,this._showDetail,this);
|
---|
9191 | this._showDetailsMsg=a.showDetails;
|
---|
9192 | this._hideDetailsMsg=a.hideDetails
|
---|
9193 | };
|
---|
9194 | ZmErrorDialog.prototype=new DwtMessageDialog;
|
---|
9195 | ZmErrorDialog.prototype.constructor=ZmErrorDialog;
|
---|
9196 | ZmErrorDialog.prototype.toString=function(){
|
---|
9197 | return"ZmErrorDialog"
|
---|
9198 | };
|
---|
9199 | ZmErrorDialog.REPORT_BUTTON=++DwtDialog.LAST_BUTTON;
|
---|
9200 | ZmErrorDialog.DETAIL_BUTTON=++DwtDialog.LAST_BUTTON;
|
---|
9201 | ZmErrorDialog.DEFAULT_REPORT_URL="//www.zimbra.com/e/";
|
---|
9202 | ZmErrorDialog.prototype._detailsVisible=false;
|
---|
9203 | ZmErrorDialog.prototype.CONTROLS_TEMPLATE="zimbra.Widgets#ZmErrorDialogControls";
|
---|
9204 | ZmErrorDialog.prototype.reset=function(){
|
---|
9205 | this.setDetailString();
|
---|
9206 | DwtMessageDialog.prototype.reset.call(this)
|
---|
9207 | };
|
---|
9208 | ZmErrorDialog.prototype.setDetailString=function(e){
|
---|
9209 | if(!(this._button[ZmErrorDialog.DETAIL_BUTTON])){
|
---|
9210 | return
|
---|
9211 | }
|
---|
9212 | this._button[ZmErrorDialog.DETAIL_BUTTON].setVisible(e!=null);
|
---|
9213 | this._detailStr=e
|
---|
9214 | };
|
---|
9215 | ZmErrorDialog.prototype.setMessage=function(e,i,t,a){
|
---|
9216 | this._msgStr=e;
|
---|
9217 | this.setDetailString(i);
|
---|
9218 | this._msgStyle=t;
|
---|
9219 | this._msgTitle=a;
|
---|
9220 | this._detailsVisible=false;
|
---|
9221 | this._button[ZmErrorDialog.DETAIL_BUTTON].setText(this._showDetailsMsg);
|
---|
9222 | DwtMessageDialog.prototype.setMessage.call(this,e,t,a)
|
---|
9223 | };
|
---|
9224 | ZmErrorDialog.prototype.popup=function(e,t){
|
---|
9225 | if(t){
|
---|
9226 | this.setButtonVisible(ZmErrorDialog.REPORT_BUTTON,false)
|
---|
9227 | }
|
---|
9228 | DwtMessageDialog.prototype.popup.call(this,e)
|
---|
9229 | };
|
---|
9230 | ZmErrorDialog.prototype.popdown=function(){
|
---|
9231 | DwtMessageDialog.prototype.popdown.call(this);
|
---|
9232 | this.setSize(Dwt.CLEAR,Dwt.CLEAR);
|
---|
9233 | this.setButtonVisible(ZmErrorDialog.REPORT_BUTTON,true)
|
---|
9234 | };
|
---|
9235 | ZmErrorDialog.prototype._getNavigatorInfo=function(){
|
---|
9236 | var a=[];
|
---|
9237 | var e=0;
|
---|
9238 | a[e++]="\n\n";
|
---|
9239 | a[e++]="href: ";
|
---|
9240 | a[e++]=location.href;
|
---|
9241 | a[e++]="\n";
|
---|
9242 | for(var t in navigator){
|
---|
9243 | if(typeof navigator[t]=="function"){
|
---|
9244 | continue
|
---|
9245 | }
|
---|
9246 | if(typeof navigator[t]=="unknown"){
|
---|
9247 | continue
|
---|
9248 | }
|
---|
9249 | a[e++]=t+": "+navigator[t]+"\n"
|
---|
9250 | }
|
---|
9251 | return a.join("")
|
---|
9252 | };
|
---|
9253 | ZmErrorDialog.prototype._getSubjectPrefix=function(){
|
---|
9254 | var t=[];
|
---|
9255 | var e=0;
|
---|
9256 | t[e++]="ER: ";
|
---|
9257 | if(AjxEnv.isIE){
|
---|
9258 | t[e++]="IE "
|
---|
9259 | }else{
|
---|
9260 | if(AjxEnv.isFirefox){
|
---|
9261 | t[e++]="FF "
|
---|
9262 | }else{
|
---|
9263 | if(AjxEnv.isMozilla){
|
---|
9264 | t[e++]="MOZ "
|
---|
9265 | }else{
|
---|
9266 | if(AjxEnv.isSafari){
|
---|
9267 | t[e++]="SAF "
|
---|
9268 | }else{
|
---|
9269 | if(AjxEnv.isOpera){
|
---|
9270 | t[e++]="OPE "
|
---|
9271 | }else{
|
---|
9272 | t[e++]="UKN "
|
---|
9273 | }}}}}
|
---|
9274 | if(AjxEnv.isWindows){
|
---|
9275 | t[e++]="WIN "
|
---|
9276 | }else{
|
---|
9277 | if(AjxEnv.isLinux){
|
---|
9278 | t[e++]="LNX "
|
---|
9279 | }else{
|
---|
9280 | if(AjxEnv.isMac){
|
---|
9281 | t[e++]="MAC "
|
---|
9282 | }else{
|
---|
9283 | t[e++]="UNK "
|
---|
9284 | }}}
|
---|
9285 | t[e++]=appCtxt.get(ZmSetting.CLIENT_VERSION)+" ";
|
---|
9286 | return t.join("")
|
---|
9287 | };
|
---|
9288 | ZmErrorDialog.prototype._getUserPrefs=function(){
|
---|
9289 | var o=appCtxt.getCurrentSearch();
|
---|
9290 | var a=[];
|
---|
9291 | var e=0;
|
---|
9292 | a[e++]="\n\n";
|
---|
9293 | a[e++]="username: ";
|
---|
9294 | a[e++]=appCtxt.get(ZmSetting.USERNAME);
|
---|
9295 | a[e++]="\n";
|
---|
9296 | if(o){
|
---|
9297 | a[e++]="currentSearch: ";
|
---|
9298 | a[e++]=o.query;
|
---|
9299 | a[e++]="\n"
|
---|
9300 | }
|
---|
9301 | for(var t in ZmSetting.INIT){
|
---|
9302 | if(ZmSetting.INIT[t][0]){
|
---|
9303 | a[e++]=ZmSetting.INIT[t][0];
|
---|
9304 | a[e++]=": ";
|
---|
9305 | a[e++]=(""+ZmSetting.INIT[t][3]);
|
---|
9306 | a[e++]="\n"
|
---|
9307 | }}
|
---|
9308 | return a.join("")
|
---|
9309 | };
|
---|
9310 | ZmErrorDialog.prototype._reportCallback=function(){
|
---|
9311 | this._iframe=document.createElement("iframe");
|
---|
9312 | this._iframe.style.width=this._iframe.style.height=0;
|
---|
9313 | this._iframe.style.visibility="hidden";
|
---|
9314 | var a=this._getContentDiv();
|
---|
9315 | a.appendChild(this._iframe);
|
---|
9316 | var l=this._getUserPrefs();
|
---|
9317 | var h=Dwt.getNextId();
|
---|
9318 | var o=[];
|
---|
9319 | var s=0;
|
---|
9320 | var n=this._subjPfx+this._detailStr.substring(0,40);
|
---|
9321 | var t=(location.protocol=="https:")?"https:":"http:";
|
---|
9322 | o[s++]="<html><head></head><body><form id='";
|
---|
9323 | o[s++]=h;
|
---|
9324 | o[s++]="' method='POST' action='";
|
---|
9325 | o[s++]=t;
|
---|
9326 | o[s++]=appCtxt.get(ZmSetting.ERROR_REPORT_URL)||ZmErrorDialog.DEFAULT_REPORT_URL;
|
---|
9327 | o[s++]="'>";
|
---|
9328 | o[s++]="<textarea name='details'>";
|
---|
9329 | o[s++]=this._detailStr;
|
---|
9330 | o[s++]="version - ";
|
---|
9331 | o[s++]=appCtxt.get(ZmSetting.CLIENT_VERSION);
|
---|
9332 | o[s++]="\n";
|
---|
9333 | o[s++]="release - ";
|
---|
9334 | o[s++]=appCtxt.get(ZmSetting.CLIENT_RELEASE);
|
---|
9335 | o[s++]="\n";
|
---|
9336 | o[s++]="date - ";
|
---|
9337 | o[s++]=appCtxt.get(ZmSetting.CLIENT_DATETIME);
|
---|
9338 | o[s++]="</textarea><textarea name='navigator'>";
|
---|
9339 | o[s++]=this._strNav;
|
---|
9340 | o[s++]="</textarea><textarea name='prefs'>";
|
---|
9341 | o[s++]=l;
|
---|
9342 | o[s++]="</textarea><textarea name='subject'>";
|
---|
9343 | o[s++]=n;
|
---|
9344 | o[s++]="</textarea></form></body></html>";
|
---|
9345 | var i=Dwt.getIframeDoc(this._iframe);
|
---|
9346 | i.open();
|
---|
9347 | i.write(o.join(""));
|
---|
9348 | i.close();
|
---|
9349 | var e=i.getElementById(h);
|
---|
9350 | if(e){
|
---|
9351 | e.submit();
|
---|
9352 | appCtxt.setStatusMsg(ZmMsg.errorReportSent)
|
---|
9353 | }
|
---|
9354 | this.popdown()
|
---|
9355 | };
|
---|
9356 | ZmErrorDialog.prototype._showDetail=function(){
|
---|
9357 | this._detailsVisible=!this._detailsVisible;
|
---|
9358 | var e=this._msgStr;
|
---|
9359 | if(this._detailsVisible){
|
---|
9360 | e+="<hr>"+this._detailStr;
|
---|
9361 | this.setSize(Dwt.CLEAR,"300")
|
---|
9362 | }else{
|
---|
9363 | this.setSize(Dwt.CLEAR,Dwt.CLEAR)
|
---|
9364 | }
|
---|
9365 | DwtMessageDialog.prototype.setMessage.call(this,e,this._msgStyle,this._msgTitle);
|
---|
9366 | this._button[ZmErrorDialog.DETAIL_BUTTON].setText(this._detailsVisible?this._hideDetailsMsg:this._showDetailsMsg)
|
---|
9367 | }
|
---|
9368 | }
|
---|
9369 | if(AjxPackage.define("zimbraMail.share.model.ZmAuthenticate")){
|
---|
9370 | ZmAuthenticate=function(){};
|
---|
9371 | ZmAuthenticate._isAdmin=false;
|
---|
9372 | ZmAuthenticate.setAdmin=function(e){
|
---|
9373 | ZmAuthenticate._isAdmin=e
|
---|
9374 | };
|
---|
9375 | ZmAuthenticate.prototype.toString=function(){
|
---|
9376 | return"ZmAuthenticate"
|
---|
9377 | };
|
---|
9378 | ZmAuthenticate.prototype.execute=function(e,o,s){
|
---|
9379 | var i=new ZmCsfeCommand();
|
---|
9380 | var a;
|
---|
9381 | if(!ZmAuthenticate._isAdmin){
|
---|
9382 | a=AjxSoapDoc.create("AuthRequest","urn:zimbraAccount");
|
---|
9383 | var t=a.set("account",e);
|
---|
9384 | t.setAttribute("by","name")
|
---|
9385 | }else{
|
---|
9386 | a=AjxSoapDoc.create("AuthRequest","urn:zimbraAdmin",null);
|
---|
9387 | a.set("name",e)
|
---|
9388 | }
|
---|
9389 | a.set("virtualHost",location.hostname);
|
---|
9390 | a.set("password",o);
|
---|
9391 | var n=new AjxCallback(this,this._handleResponseExecute,s);
|
---|
9392 | i.invoke({
|
---|
9393 | soapDoc:a,noAuthToken:true,noSession:true,asyncMode:true,callback:n}
|
---|
9394 | )
|
---|
9395 | };
|
---|
9396 | ZmAuthenticate.prototype._handleResponseExecute=function(a,e){
|
---|
9397 | if(!e.isException()){
|
---|
9398 | var t=e.getResponse().Body.AuthResponse;
|
---|
9399 | this._setAuthToken(t)
|
---|
9400 | }
|
---|
9401 | if(a){
|
---|
9402 | a.run(e)
|
---|
9403 | }};
|
---|
9404 | ZmAuthenticate.prototype._setAuthToken=function(t){
|
---|
9405 | var e=appCtxt.rememberMe?t.lifetime:0;
|
---|
9406 | ZmCsfeCommand.setAuthToken(t.authToken[0]._content,e)
|
---|
9407 | }
|
---|
9408 | }
|
---|
9409 | if(AjxPackage.define("zimbraMail.share.model.ZmAutocomplete")){
|
---|
9410 | ZmAutocomplete=function(){
|
---|
9411 | this._acRequests={};
|
---|
9412 | if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
|
---|
9413 | var a=new AjxListener(this,this._settingChangeListener);
|
---|
9414 | var t=[ZmSetting.GAL_AUTOCOMPLETE,ZmSetting.AUTOCOMPLETE_SHARE,ZmSetting.AUTOCOMPLETE_SHARED_ADDR_BOOKS,ZmSetting.AUTOCOMPLETE_NO_GROUP_MATCH];
|
---|
9415 | for(var e=0;
|
---|
9416 | e<t.length;
|
---|
9417 | e++){
|
---|
9418 | appCtxt.getSettings().getSetting(t[e]).addChangeListener(a)
|
---|
9419 | }}};
|
---|
9420 | ZmAutocomplete.AC_VALUE_FULL="fullAddress";
|
---|
9421 | ZmAutocomplete.AC_VALUE_EMAIL="email";
|
---|
9422 | ZmAutocomplete.AC_VALUE_NAME="name";
|
---|
9423 | ZmAutocomplete.AC_TIMEOUT=20;
|
---|
9424 | ZmAutocomplete.AC_TYPE_CONTACT="contact";
|
---|
9425 | ZmAutocomplete.AC_TYPE_GAL="gal";
|
---|
9426 | ZmAutocomplete.AC_TYPE_GROUP="group";
|
---|
9427 | ZmAutocomplete.AC_TYPE_TABLE="rankingTable";
|
---|
9428 | ZmAutocomplete.AC_TYPE_UNKNOWN="unknown";
|
---|
9429 | ZmAutocomplete.AC_TYPE_LOCATION="Location";
|
---|
9430 | ZmAutocomplete.AC_TYPE_EQUIPMENT="Equipment";
|
---|
9431 | ZmAutocomplete.AC_ICON={};
|
---|
9432 | ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_CONTACT]="Contact";
|
---|
9433 | ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_GAL]="GALContact";
|
---|
9434 | ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_GROUP]="Group";
|
---|
9435 | ZmAutocomplete.GAL_RESULTS_TTL=900000;
|
---|
9436 | ZmAutocomplete.prototype.toString=function(){
|
---|
9437 | return"ZmAutocomplete"
|
---|
9438 | };
|
---|
9439 | ZmAutocomplete.prototype.autocompleteMatch=function(n,h,t,e,o){
|
---|
9440 | n=n.toLowerCase().replace(/"/g,"");
|
---|
9441 | this._curAcStr=n;
|
---|
9442 | var a=(e&&e.type)||ZmAutocomplete.AC_TYPE_CONTACT;
|
---|
9443 | var i=this._checkCache(n,a,o);
|
---|
9444 | if(i!==null){
|
---|
9445 | this._handleResponseAutocompleteMatch(n,h,i);
|
---|
9446 | return
|
---|
9447 | }
|
---|
9448 | var s=new AjxCallback(this,this._handleResponseAutocompleteMatch,[n,h]);
|
---|
9449 | this._doAutocomplete(n,t,e,a,s,o)
|
---|
9450 | };
|
---|
9451 | ZmAutocomplete.prototype._handleResponseAutocompleteMatch=function(t,a,e){
|
---|
9452 | if(t==this._curAcStr){
|
---|
9453 | a.run(e)
|
---|
9454 | }};
|
---|
9455 | ZmAutocomplete.prototype._doAutocomplete=function(n,i,c,t,h,o){
|
---|
9456 | if(this._acRequests[n]){
|
---|
9457 | return
|
---|
9458 | }
|
---|
9459 | for(var e in this._acRequests){
|
---|
9460 | if(n!=e){
|
---|
9461 | appCtxt.getAppController().cancelRequest(this._acRequests[e],null,true);
|
---|
9462 | delete this._acRequests[n]
|
---|
9463 | }}
|
---|
9464 | var a={
|
---|
9465 | query:n,isAutocompleteSearch:true};
|
---|
9466 | if(t!=ZmAutocomplete.AC_TYPE_CONTACT){
|
---|
9467 | a.isGalAutocompleteSearch=true;
|
---|
9468 | a.isAutocompleteSearch=false;
|
---|
9469 | a.limit=a.limit*2;
|
---|
9470 | a.types=AjxVector.fromArray([ZmItem.CONTACT]);
|
---|
9471 | a.galType=ZmSearch.GAL_RESOURCE
|
---|
9472 | }else{}
|
---|
9473 | a.accountName=o&&o.name;
|
---|
9474 | var l=new ZmSearch(a);
|
---|
9475 | var s={
|
---|
9476 | callback:(new AjxCallback(this,this._handleResponseDoAutocomplete,[n,i,c,t,h,o])),errorCallback:(new AjxCallback(this,this._handleErrorDoAutocomplete,[n,i])),timeout:ZmAutocomplete.AC_TIMEOUT,noBusyOverlay:true};
|
---|
9477 | this._acRequests[n]=l.execute(s)
|
---|
9478 | };
|
---|
9479 | ZmAutocomplete.prototype._handleResponseDoAutocomplete=function(u,l,p,e,f,c,g){
|
---|
9480 | if(u!=this._curAcStr){
|
---|
9481 | return
|
---|
9482 | }
|
---|
9483 | delete this._acRequests[u];
|
---|
9484 | var t,h=false,s=false;
|
---|
9485 | var a=g.getResponse();
|
---|
9486 | if(a&&a.search&&a.search.isGalAutocompleteSearch){
|
---|
9487 | var m=a.getResults(ZmItem.CONTACT);
|
---|
9488 | t=(m&&m.getArray())||[];
|
---|
9489 | h=s=true
|
---|
9490 | }else{
|
---|
9491 | t=a._respEl.match||[]
|
---|
9492 | }
|
---|
9493 | var d=[];
|
---|
9494 | for(var o=0;
|
---|
9495 | o<t.length;
|
---|
9496 | o++){
|
---|
9497 | var n=new ZmAutocompleteMatch(t[o],p,h);
|
---|
9498 | if(n.acType==e){
|
---|
9499 | if(n.type==ZmAutocomplete.AC_TYPE_GAL){
|
---|
9500 | s=true
|
---|
9501 | }
|
---|
9502 | d.push(n)
|
---|
9503 | }}
|
---|
9504 | f.run(d);
|
---|
9505 | this._cacheResults(u,e,d,s,a._respEl.canBeCached,null,c)
|
---|
9506 | };
|
---|
9507 | ZmAutocomplete.prototype._handleErrorDoAutocomplete=function(a,t,e){
|
---|
9508 | appCtxt.getAppController().cancelRequest(this._acRequests[a],null,true);
|
---|
9509 | appCtxt.setStatusMsg({
|
---|
9510 | msg:ZmMsg.autocompleteFailed,level:ZmStatusView.LEVEL_WARNING}
|
---|
9511 | );
|
---|
9512 | delete this._acRequests[a];
|
---|
9513 | return true
|
---|
9514 | };
|
---|
9515 | ZmAutocomplete.acSortCompare=function(t,e){
|
---|
9516 | var o=(t&&t.score)||0;
|
---|
9517 | var i=(e&&e.score)||0;
|
---|
9518 | return(o>i)?1:(o<i)?-1:0
|
---|
9519 | };
|
---|
9520 | ZmAutocomplete.prototype.isComplete=function(e){
|
---|
9521 | return AjxEmailAddress.isValid(e)
|
---|
9522 | };
|
---|
9523 | ZmAutocomplete.prototype.quickComplete=function(n){
|
---|
9524 | if(n.indexOf("@")!=-1){
|
---|
9525 | return null
|
---|
9526 | }
|
---|
9527 | if(!this._userDomain){
|
---|
9528 | var t=appCtxt.get(ZmSetting.USERNAME);
|
---|
9529 | if(t){
|
---|
9530 | var e=t.split("@");
|
---|
9531 | if(e&&e.length){
|
---|
9532 | this._userDomain=e[e.length-1]
|
---|
9533 | }}}
|
---|
9534 | if(this._userDomain){
|
---|
9535 | var o=[n,this._userDomain].join("@");
|
---|
9536 | var i=new ZmAutocompleteMatch();
|
---|
9537 | i.name=i.email=i.fullAddress=o;
|
---|
9538 | return i
|
---|
9539 | }else{
|
---|
9540 | return null
|
---|
9541 | }};
|
---|
9542 | ZmAutocomplete.prototype.forget=function(i,a){
|
---|
9543 | var t={
|
---|
9544 | RankingActionRequest:{
|
---|
9545 | _jsns:"urn:zimbraMail"}};
|
---|
9546 | t.RankingActionRequest.action={
|
---|
9547 | op:"delete",email:i};
|
---|
9548 | var e=new AjxCallback(this,this._handleResponseForget,[a]);
|
---|
9549 | appCtxt.getRequestMgr().sendRequest({
|
---|
9550 | jsonObj:t,asyncMode:true,callback:e}
|
---|
9551 | )
|
---|
9552 | };
|
---|
9553 | ZmAutocomplete.prototype._handleResponseForget=function(e){
|
---|
9554 | appCtxt.clearAutocompleteCache(ZmAutocomplete.AC_TYPE_CONTACT);
|
---|
9555 | if(e){
|
---|
9556 | e.run()
|
---|
9557 | }};
|
---|
9558 | ZmAutocomplete.prototype._getCache=function(a,o,i,t){
|
---|
9559 | var e=AjxEnv.isIE?window.appCtxt:window.parentAppCtxt||window.appCtxt;
|
---|
9560 | return e.getAutocompleteCache(a,o,i,t)
|
---|
9561 | };
|
---|
9562 | ZmAutocomplete.prototype._cacheResults=function(s,i,n,a,e,h,o){
|
---|
9563 | var t=this._getCache(i,s,o,true);
|
---|
9564 | t.list=n;
|
---|
9565 | t.cacheable=(h&&h.cacheable)||e;
|
---|
9566 | if(a){
|
---|
9567 | t.ts=(h&&h.ts)||(new Date()).getTime()
|
---|
9568 | }};
|
---|
9569 | ZmAutocomplete.prototype._checkCache=function(l,t,s){
|
---|
9570 | var e=this._getCachedResults(l,t,null,s);
|
---|
9571 | var h=e&&e.list;
|
---|
9572 | if(h!==null){
|
---|
9573 | return h
|
---|
9574 | }
|
---|
9575 | if(l.length<=1){
|
---|
9576 | return null
|
---|
9577 | }
|
---|
9578 | var a=l;
|
---|
9579 | while(a&&!h){
|
---|
9580 | a=a.slice(0,-1);
|
---|
9581 | e=this._getCachedResults(a,t,true,s);
|
---|
9582 | h=e&&e.list;
|
---|
9583 | if(h&&h.length==0){
|
---|
9584 | return h
|
---|
9585 | }}
|
---|
9586 | var c=[];
|
---|
9587 | if(h&&h.length){
|
---|
9588 | for(var o=0;
|
---|
9589 | o<h.length;
|
---|
9590 | o++){
|
---|
9591 | var n=h[o];
|
---|
9592 | if(n.matches(l)){
|
---|
9593 | c.push(n)
|
---|
9594 | }}}else{
|
---|
9595 | return null
|
---|
9596 | }
|
---|
9597 | this._cacheResults(l,t,c,false,false,e,s);
|
---|
9598 | return c
|
---|
9599 | };
|
---|
9600 | ZmAutocomplete.prototype._getCachedResults=function(n,i,e,o){
|
---|
9601 | var t=this._getCache(i,n,o);
|
---|
9602 | if(t){
|
---|
9603 | if(e&&(t.cacheable===false)){
|
---|
9604 | return null
|
---|
9605 | }
|
---|
9606 | if(t.ts){
|
---|
9607 | var a=(new Date()).getTime();
|
---|
9608 | if(a>(t.ts+ZmAutocomplete.GAL_RESULTS_TTL)){
|
---|
9609 | return null
|
---|
9610 | }}
|
---|
9611 | return t
|
---|
9612 | }else{
|
---|
9613 | return null
|
---|
9614 | }};
|
---|
9615 | ZmAutocomplete.prototype._settingChangeListener=function(t){
|
---|
9616 | if(t.type!=ZmEvent.S_SETTING){
|
---|
9617 | return
|
---|
9618 | }
|
---|
9619 | var e=AjxEnv.isIE?window.appCtxt:window.parentAppCtxt||window.appCtxt;
|
---|
9620 | e.clearAutocompleteCache(ZmAutocomplete.AC_TYPE_CONTACT)
|
---|
9621 | };
|
---|
9622 | ZmAutocompleteMatch=function(a,t,n){
|
---|
9623 | if(!a){
|
---|
9624 | return
|
---|
9625 | }
|
---|
9626 | this.type=a.type;
|
---|
9627 | if(n){
|
---|
9628 | this.text=this.name=a.getFullName();
|
---|
9629 | this.email=a.getEmail();
|
---|
9630 | this.item=a;
|
---|
9631 | this.type=ZmContact.getAttr(a,ZmResource.F_type)||ZmAutocomplete.AC_TYPE_GAL
|
---|
9632 | }else{
|
---|
9633 | if(this.type==ZmAutocomplete.AC_TYPE_GROUP){
|
---|
9634 | this.fullAddress=a.email;
|
---|
9635 | this.name=a.display;
|
---|
9636 | var h=[];
|
---|
9637 | var s=a.email.split(",");
|
---|
9638 | for(var o=0;
|
---|
9639 | o<s.length;
|
---|
9640 | o++){
|
---|
9641 | var e=AjxEmailAddress.parse(s[o]);
|
---|
9642 | if(e&&e.getAddress()){
|
---|
9643 | h.push(e.getAddress())
|
---|
9644 | }}
|
---|
9645 | this.email=h.join(";");
|
---|
9646 | this.text=a.display
|
---|
9647 | }else{
|
---|
9648 | var e=AjxEmailAddress.parse(a.email);
|
---|
9649 | if(e){
|
---|
9650 | this.fullAddress=e.toString();
|
---|
9651 | this.name=e.getName();
|
---|
9652 | this.email=e.getAddress()
|
---|
9653 | }else{
|
---|
9654 | this.email=a.email
|
---|
9655 | }
|
---|
9656 | this.text=AjxStringUtil.htmlEncode(a.email);
|
---|
9657 | if(t&&t.needItem&&window.ZmContact){
|
---|
9658 | this.item=new ZmContact(null);
|
---|
9659 | this.item.initFromEmail(e||a.email)
|
---|
9660 | }}
|
---|
9661 | this.icon=ZmAutocomplete.AC_ICON[a.type];
|
---|
9662 | this.score=a.ranking
|
---|
9663 | }
|
---|
9664 | this.icon=this.icon||ZmAutocomplete.AC_ICON[ZmAutocomplete.AC_TYPE_CONTACT];
|
---|
9665 | this.acType=(this.type==ZmAutocomplete.AC_TYPE_LOCATION||this.type==ZmAutocomplete.AC_TYPE_EQUIPMENT)?this.type:ZmAutocomplete.AC_TYPE_CONTACT;
|
---|
9666 | this.canForget=(a.type==ZmAutocomplete.AC_TYPE_TABLE)
|
---|
9667 | };
|
---|
9668 | ZmAutocompleteMatch.prototype.toString=function(){
|
---|
9669 | return"ZmAutocompleteMatch"
|
---|
9670 | };
|
---|
9671 | ZmAutocompleteMatch.prototype.matches=function(s){
|
---|
9672 | if(this.name&&!this._nameParsed){
|
---|
9673 | var n=this.name.split(/\s+/,3);
|
---|
9674 | var a=n[0];
|
---|
9675 | this._lastName=n[n.length-1];
|
---|
9676 | this._firstLast=[a,this._lastName].join(" ");
|
---|
9677 | this._nameParsed=true
|
---|
9678 | }
|
---|
9679 | var e=[this.email,this.name,this._lastName,this._firstLast];
|
---|
9680 | for(var t=0;
|
---|
9681 | t<e.length;
|
---|
9682 | t++){
|
---|
9683 | var o=e[t]&&e[t].toLowerCase();
|
---|
9684 | if(o&&(o.indexOf(s)==0)){
|
---|
9685 | return true
|
---|
9686 | }}
|
---|
9687 | return false
|
---|
9688 | };
|
---|
9689 | ZmSearchAutocomplete=function(){
|
---|
9690 | this._op={};
|
---|
9691 | this._list={};
|
---|
9692 | this._loadFunc={};
|
---|
9693 | var e={
|
---|
9694 | loader:this._loadTags,text:function(t){
|
---|
9695 | return t.getName(false,null,true,true)
|
---|
9696 | }
|
---|
9697 | ,icon:function(t){
|
---|
9698 | return t.getIcon()
|
---|
9699 | }
|
---|
9700 | ,matchText:function(t){
|
---|
9701 | return t.createQuery()
|
---|
9702 | }};
|
---|
9703 | this._registerHandler("tag",e);
|
---|
9704 | e={
|
---|
9705 | listType:ZmId.ORG_FOLDER,text:function(t){
|
---|
9706 | return t.getPath(false,false,null,true,true)
|
---|
9707 | }
|
---|
9708 | ,icon:function(t){
|
---|
9709 | return t.getIcon()
|
---|
9710 | }
|
---|
9711 | ,matchText:function(t){
|
---|
9712 | return t.createQuery()
|
---|
9713 | }};
|
---|
9714 | this._loadFunc[ZmId.ORG_FOLDER]=this._loadFolders;
|
---|
9715 | this._registerHandler("in",e);
|
---|
9716 | this._registerHandler("under",e);
|
---|
9717 | e={
|
---|
9718 | loader:this._loadFlags};
|
---|
9719 | this._registerHandler("is",e);
|
---|
9720 | e={
|
---|
9721 | loader:this._loadObjects,icon:function(t){
|
---|
9722 | return ZmSearchAutocomplete.ICON[t]
|
---|
9723 | }};
|
---|
9724 | this._registerHandler("has",e);
|
---|
9725 | e={
|
---|
9726 | listType:ZmId.ITEM_ATT,text:function(t){
|
---|
9727 | return t.desc
|
---|
9728 | }
|
---|
9729 | ,icon:function(t){
|
---|
9730 | return t.image
|
---|
9731 | }
|
---|
9732 | ,matchText:function(t){
|
---|
9733 | return t.type
|
---|
9734 | }
|
---|
9735 | ,quoteMatch:true};
|
---|
9736 | this._loadFunc[ZmId.ITEM_ATT]=this._loadTypes;
|
---|
9737 | this._registerHandler("type",e);
|
---|
9738 | this._registerHandler("attachment",e);
|
---|
9739 | appCtxt.getFolderTree().addChangeListener(new AjxListener(this,this._folderTreeChangeListener));
|
---|
9740 | appCtxt.getTagTree().addChangeListener(new AjxListener(this,this._tagTreeChangeListener))
|
---|
9741 | };
|
---|
9742 | ZmSearchAutocomplete.ICON={};
|
---|
9743 | ZmSearchAutocomplete.ICON.attachment="Attachment";
|
---|
9744 | ZmSearchAutocomplete.ICON.phone="Telephone";
|
---|
9745 | ZmSearchAutocomplete.ICON.url="URL";
|
---|
9746 | ZmSearchAutocomplete.prototype._registerHandler=function(a,e){
|
---|
9747 | var t=e.loader||this._loadFunc[e.listType];
|
---|
9748 | this._op[a]={
|
---|
9749 | loader:new AjxCallback(this,t),text:e.text,icon:e.icon,listType:e.listType||a,matchText:e.matchText||e.text,quoteMatch:e.quoteMatch}
|
---|
9750 | };
|
---|
9751 | ZmSearchAutocomplete.prototype.autocompleteMatch=function(n,s,i,l){
|
---|
9752 | if(ZmSearchAutocomplete._ignoreNextKey){
|
---|
9753 | ZmSearchAutocomplete._ignoreNextKey=false;
|
---|
9754 | return
|
---|
9755 | }
|
---|
9756 | n=n.toLowerCase().replace(/"/g,"");
|
---|
9757 | var t=n.match(/\b-?([a-z]+):/);
|
---|
9758 | if(!(t&&t.length)){
|
---|
9759 | s.run();
|
---|
9760 | return
|
---|
9761 | }
|
---|
9762 | var a=t[1];
|
---|
9763 | var e=this._op[a];
|
---|
9764 | if(!e){
|
---|
9765 | s.run();
|
---|
9766 | return
|
---|
9767 | }
|
---|
9768 | var o=this._list[e.listType];
|
---|
9769 | if(o){
|
---|
9770 | s.run(this._getMatches(a,n))
|
---|
9771 | }else{
|
---|
9772 | var h=new AjxCallback(this,this._handleResponseLoad,[a,n,s]);
|
---|
9773 | this._list[e.listType]=[];
|
---|
9774 | e.loader.run(e.listType,h)
|
---|
9775 | }};
|
---|
9776 | ZmSearchAutocomplete.prototype._getMatches=function(l,m){
|
---|
9777 | var e=this._op[l];
|
---|
9778 | var s=[];
|
---|
9779 | var d=this._list[e.listType];
|
---|
9780 | var a=m.substr(m.indexOf(":")+1);
|
---|
9781 | if(e.listType==ZmId.ORG_FOLDER){
|
---|
9782 | a=a.replace(/^\//,"")
|
---|
9783 | }
|
---|
9784 | for(var h=0,c=d.length;
|
---|
9785 | h<c;
|
---|
9786 | h++){
|
---|
9787 | var t=d[h];
|
---|
9788 | var f=e.text?e.text(t):t;
|
---|
9789 | var u=f.toLowerCase();
|
---|
9790 | if(!a||(u.indexOf(a)==0)){
|
---|
9791 | var n=e.matchText?e.matchText(t):e.quoteMatch?[l,":",'"',f,'"'].join(""):[l,":",f].join("");
|
---|
9792 | n=m.replace(l+":"+a,n);
|
---|
9793 | s.push({
|
---|
9794 | text:f,icon:e.icon?e.icon(t):null,matchText:n,exactMatch:(u.length==a.length)}
|
---|
9795 | )
|
---|
9796 | }}
|
---|
9797 | if(s.length==1&&s[0].exactMatch){
|
---|
9798 | s=[]
|
---|
9799 | }
|
---|
9800 | return s
|
---|
9801 | };
|
---|
9802 | ZmSearchAutocomplete.prototype._handleResponseLoad=function(a,e,t){
|
---|
9803 | t.run(this._getMatches(a,e))
|
---|
9804 | };
|
---|
9805 | ZmSearchAutocomplete.prototype._loadTags=function(n,h){
|
---|
9806 | var s=this._list[n];
|
---|
9807 | var a=appCtxt.getTagTree().asList();
|
---|
9808 | for(var o=0,t=a.length;
|
---|
9809 | o<t;
|
---|
9810 | o++){
|
---|
9811 | var e=a[o];
|
---|
9812 | if(e.id!=ZmOrganizer.ID_ROOT){
|
---|
9813 | s.push(e)
|
---|
9814 | }}
|
---|
9815 | s.sort(ZmTag.sortCompare);
|
---|
9816 | if(h){
|
---|
9817 | h.run()
|
---|
9818 | }};
|
---|
9819 | ZmSearchAutocomplete.prototype._loadFolders=function(o,h){
|
---|
9820 | var s=this._list[o];
|
---|
9821 | var a=appCtxt.getFolderTree().asList({
|
---|
9822 | includeRemote:true}
|
---|
9823 | );
|
---|
9824 | for(var t=0,e=a.length;
|
---|
9825 | t<e;
|
---|
9826 | t++){
|
---|
9827 | var n=a[t];
|
---|
9828 | if(n.id!=ZmOrganizer.ID_ROOT&&n.type==ZmOrganizer.FOLDER){
|
---|
9829 | s.push(n)
|
---|
9830 | }}
|
---|
9831 | s.sort(ZmFolder.sortComparePath);
|
---|
9832 | if(h){
|
---|
9833 | h.run()
|
---|
9834 | }};
|
---|
9835 | ZmSearchAutocomplete.prototype._loadFlags=function(e,t){
|
---|
9836 | this._list[e]=["anywhere","unread","read","flagged","unflagged","sent","received","replied","unreplied","forwarded","unforwarded","invite","solo","tome","fromme","ccme","tofromme","fromccme","tofromccme","local","remote"].sort();
|
---|
9837 | if(t){
|
---|
9838 | t.run()
|
---|
9839 | }};
|
---|
9840 | ZmSearchAutocomplete.prototype._loadObjects=function(a,n){
|
---|
9841 | var o=this._list[a];
|
---|
9842 | o.push("attachment");
|
---|
9843 | var e=appCtxt.getZimletMgr().getIndexedZimlets();
|
---|
9844 | if(e.length){
|
---|
9845 | for(var t=0;
|
---|
9846 | t<e.length;
|
---|
9847 | t++){
|
---|
9848 | o.push(e[t].keyword)
|
---|
9849 | }}
|
---|
9850 | o.sort();
|
---|
9851 | if(n){
|
---|
9852 | n.run()
|
---|
9853 | }};
|
---|
9854 | ZmSearchAutocomplete.prototype._loadTypes=function(t,i){
|
---|
9855 | AjxDispatcher.require("Browse");
|
---|
9856 | var e=new ZmAttachmentTypeList();
|
---|
9857 | var a=new AjxCallback(this,this._handleResponseLoadTypes,[e,t,i]);
|
---|
9858 | e.load(a)
|
---|
9859 | };
|
---|
9860 | ZmSearchAutocomplete.prototype._handleResponseLoadTypes=function(e,t,a){
|
---|
9861 | this._list[t]=e.getAttachments();
|
---|
9862 | if(a){
|
---|
9863 | a.run()
|
---|
9864 | }};
|
---|
9865 | ZmSearchAutocomplete.prototype._folderTreeChangeListener=function(a){
|
---|
9866 | var e=a.getDetail("fields");
|
---|
9867 | if(a.event==ZmEvent.E_DELETE||a.event==ZmEvent.E_CREATE||a.event==ZmEvent.E_MOVE||((a.event==ZmEvent.E_MODIFY)&&e&&e[ZmOrganizer.F_NAME])){
|
---|
9868 | var t=ZmId.ORG_FOLDER;
|
---|
9869 | if(this._list[t]){
|
---|
9870 | this._list[t]=[];
|
---|
9871 | this._loadFolders(t)
|
---|
9872 | }}};
|
---|
9873 | ZmSearchAutocomplete.prototype._tagTreeChangeListener=function(a){
|
---|
9874 | var e=a.getDetail("fields");
|
---|
9875 | if(a.event==ZmEvent.E_DELETE||a.event==ZmEvent.E_CREATE||a.event==ZmEvent.E_MOVE||((a.event==ZmEvent.E_MODIFY)&&e&&e[ZmOrganizer.F_NAME])){
|
---|
9876 | var t="tag";
|
---|
9877 | if(this._list[t]){
|
---|
9878 | this._list[t]=[];
|
---|
9879 | this._loadTags(t)
|
---|
9880 | }}}
|
---|
9881 | }
|
---|
9882 | if(AjxPackage.define("zimbraMail.share.model.ZmInvite")){
|
---|
9883 | ZmInvite=function(){
|
---|
9884 | ZmModel.call(this)
|
---|
9885 | };
|
---|
9886 | ZmInvite.prototype=new ZmModel;
|
---|
9887 | ZmInvite.prototype.constructor=ZmInvite;
|
---|
9888 | ZmInvite.prototype.toString=function(){
|
---|
9889 | return"ZmInvite: name="+this.name+" id="+this.id
|
---|
9890 | };
|
---|
9891 | ZmInvite._sendFun=null;
|
---|
9892 | ZmInvite.createFromDom=function(n){
|
---|
9893 | var t=new ZmInvite();
|
---|
9894 | t.components=n[0].comp;
|
---|
9895 | t.replies=n[0].replies;
|
---|
9896 | if(t.components==null){
|
---|
9897 | t.components=[{}
|
---|
9898 | ];
|
---|
9899 | t.components.empty=true
|
---|
9900 | }
|
---|
9901 | var e=n[0];
|
---|
9902 | if(e.tz){
|
---|
9903 | for(var o=0;
|
---|
9904 | o<e.tz.length;
|
---|
9905 | o++){
|
---|
9906 | var l=e.tz[o];
|
---|
9907 | var s=AjxTimezone.getRule(l.id);
|
---|
9908 | if(!s){
|
---|
9909 | var h={
|
---|
9910 | standard:l.standard?AjxUtil.createProxy(l.standard[0]):{}
|
---|
9911 | ,daylight:l.daylight?AjxUtil.createProxy(l.daylight[0]):null};
|
---|
9912 | h.standard.offset=l.stdoff;
|
---|
9913 | delete h.standard._object_;
|
---|
9914 | if(l.daylight){
|
---|
9915 | h.daylight.offset=l.dayoff;
|
---|
9916 | delete h.daylight._object_
|
---|
9917 | }
|
---|
9918 | s=AjxTimezone.getRule(l.id,h);
|
---|
9919 | if(s){
|
---|
9920 | var a=AjxUtil.createProxy(s);
|
---|
9921 | a.aliasId=s.clientId;
|
---|
9922 | a.clientId=l.id;
|
---|
9923 | a.serverId=l.id;
|
---|
9924 | AjxTimezone.addRule(a)
|
---|
9925 | }}
|
---|
9926 | if(!s){
|
---|
9927 | s={
|
---|
9928 | clientId:l.id,serverId:l.id,autoDetected:true};
|
---|
9929 | if(l.daylight){
|
---|
9930 | s.standard=AjxUtil.createProxy(l.standard[0]);
|
---|
9931 | s.standard.offset=l.stdoff;
|
---|
9932 | s.standard.trans=AjxTimezone.createTransitionDate(s.standard);
|
---|
9933 | s.daylight=AjxUtil.createProxy(l.daylight[0]);
|
---|
9934 | s.daylight.offset=l.dayoff;
|
---|
9935 | s.daylight.trans=AjxTimezone.createTransitionDate(s.daylight)
|
---|
9936 | }else{
|
---|
9937 | s.standard={
|
---|
9938 | offset:l.stdoff}
|
---|
9939 | }
|
---|
9940 | AjxTimezone.addRule(s)
|
---|
9941 | }}}
|
---|
9942 | t.type=e&&e.type?e.type:"appt";
|
---|
9943 | return t
|
---|
9944 | };
|
---|
9945 | ZmInvite.prototype.setMessageId=function(e){
|
---|
9946 | this.msgId=e
|
---|
9947 | };
|
---|
9948 | ZmInvite.prototype.getMessageId=function(){
|
---|
9949 | return this.msgId
|
---|
9950 | };
|
---|
9951 | ZmInvite.prototype.getComponent=function(e){
|
---|
9952 | return this.components[e]
|
---|
9953 | };
|
---|
9954 | ZmInvite.prototype.getComponents=function(){
|
---|
9955 | return this.components
|
---|
9956 | };
|
---|
9957 | ZmInvite.prototype.getComponentByUid=function(t){
|
---|
9958 | for(var e=0;
|
---|
9959 | e<components.length;
|
---|
9960 | ++e){
|
---|
9961 | if(components.uid==t){
|
---|
9962 | break
|
---|
9963 | }}};
|
---|
9964 | ZmInvite.prototype.hasMultipleComponents=function(){
|
---|
9965 | return(this.components.length>1)
|
---|
9966 | };
|
---|
9967 | ZmInvite.prototype.hasOtherAttendees=function(e){
|
---|
9968 | var t=e||0;
|
---|
9969 | return this.components[t].at&&this.components[t].at.length>0
|
---|
9970 | };
|
---|
9971 | ZmInvite.prototype.getEventName=function(e){
|
---|
9972 | var t=e||0;
|
---|
9973 | return this.components[t]?this.components[t].name:null
|
---|
9974 | };
|
---|
9975 | ZmInvite.prototype.getAlarm=function(e){
|
---|
9976 | var t=e||0;
|
---|
9977 | return this.components[t]?this.components[t].alarm:null
|
---|
9978 | };
|
---|
9979 | ZmInvite.prototype.getInviteMethod=function(e){
|
---|
9980 | var t=e||0;
|
---|
9981 | return this.components[t]?this.components[t].method:null
|
---|
9982 | };
|
---|
9983 | ZmInvite.prototype.getSequenceNo=function(e){
|
---|
9984 | var t=e||0;
|
---|
9985 | return this.components[t]?this.components[t].seq:null
|
---|
9986 | };
|
---|
9987 | ZmInvite.prototype.getOrganizerEmail=function(e){
|
---|
9988 | var t=e||0;
|
---|
9989 | return(this.components[t]&&this.components[t].or&&this.components[t].or.url)?(this.components[t].or.url.replace("MAILTO:","")):null
|
---|
9990 | };
|
---|
9991 | ZmInvite.prototype.getOrganizerName=function(e){
|
---|
9992 | var t=e||0;
|
---|
9993 | return(this.components[t]&&this.components[t].or)?(this.components[t].or.d||this.components[t].or.url):null
|
---|
9994 | };
|
---|
9995 | ZmInvite.prototype.getSentBy=function(e){
|
---|
9996 | var t=e||0;
|
---|
9997 | return(this.components[t]&&this.components[t].or)?this.components[t].or.sentBy:null
|
---|
9998 | };
|
---|
9999 | ZmInvite.prototype.isOrganizer=function(e){
|
---|
10000 | var t=e||0;
|
---|
10001 | return this.components[t]?(!!this.components[t].isOrg):false
|
---|
10002 | };
|
---|
10003 | ZmInvite.prototype.shouldRsvp=function(e){
|
---|
10004 | var t=e||0;
|
---|
10005 | return this.components[t]?this.components[t].rsvp:null
|
---|
10006 | };
|
---|
10007 | ZmInvite.prototype.getRecurrenceRules=function(e){
|
---|
10008 | var t=e||0;
|
---|
10009 | return this.components[t].recur
|
---|
10010 | };
|
---|
10011 | ZmInvite.prototype.getAttendees=function(a){
|
---|
10012 | var n=a||0;
|
---|
10013 | var e=this.components[n].at;
|
---|
10014 | var o=[];
|
---|
10015 | if(!(e&&e.length)){
|
---|
10016 | return o
|
---|
10017 | }
|
---|
10018 | for(var t=0;
|
---|
10019 | t<e.length;
|
---|
10020 | t++){
|
---|
10021 | if(!e[t].cutype||(e[t].cutype==ZmCalendarApp.CUTYPE_INDIVIDUAL)){
|
---|
10022 | o.push(e[t])
|
---|
10023 | }}
|
---|
10024 | return o
|
---|
10025 | };
|
---|
10026 | ZmInvite.prototype.getReplies=function(e){
|
---|
10027 | var t=e||0;
|
---|
10028 | return(this.replies&&this.replies[t])?this.replies[t].reply:null
|
---|
10029 | };
|
---|
10030 | ZmInvite.prototype.getResources=function(a){
|
---|
10031 | var n=a||0;
|
---|
10032 | var e=this.components[n].at;
|
---|
10033 | var o=[];
|
---|
10034 | if(!(e&&e.length)){
|
---|
10035 | return o
|
---|
10036 | }
|
---|
10037 | for(var t=0;
|
---|
10038 | t<e.length;
|
---|
10039 | t++){
|
---|
10040 | if(e[t].cutype==ZmCalendarApp.CUTYPE_RESOURCE){
|
---|
10041 | o.push(e[t])
|
---|
10042 | }}
|
---|
10043 | return o
|
---|
10044 | };
|
---|
10045 | ZmInvite.prototype.getExceptId=function(e){
|
---|
10046 | var t=e||0;
|
---|
10047 | return(this.components[t]&&this.components[t].exceptId)?this.components[t].exceptId[0]:null
|
---|
10048 | };
|
---|
10049 | ZmInvite.prototype.getAppointmentId=function(e){
|
---|
10050 | var t=e||0;
|
---|
10051 | return this.components[t].apptId
|
---|
10052 | };
|
---|
10053 | ZmInvite.prototype.getStatus=function(e){
|
---|
10054 | var t=e||0;
|
---|
10055 | return this.components[t].status
|
---|
10056 | };
|
---|
10057 | ZmInvite.prototype.isEmpty=function(){
|
---|
10058 | return Boolean(this.components.empty)
|
---|
10059 | };
|
---|
10060 | ZmInvite.prototype.isException=function(e){
|
---|
10061 | var t=e||0;
|
---|
10062 | return this.components[t]?this.components[t].ex:false
|
---|
10063 | };
|
---|
10064 | ZmInvite.prototype.isRecurring=function(e){
|
---|
10065 | var t=e||0;
|
---|
10066 | return this.components[t]?this.components[t].recur:false
|
---|
10067 | };
|
---|
10068 | ZmInvite.prototype.isAllDayEvent=function(e){
|
---|
10069 | var t=e||0;
|
---|
10070 | return this.components[t]?this.components[t].allDay=="1":false
|
---|
10071 | };
|
---|
10072 | ZmInvite.prototype.isMultiDay=function(t){
|
---|
10073 | var i=t||0;
|
---|
10074 | var a=this.getServerStartDate(i);
|
---|
10075 | var e=this.getServerEndDate(i);
|
---|
10076 | return(a.getDate()!=e.getDate())||(a.getMonth()!=e.getMonth())||(a.getFullYear()!=e.getFullYear())
|
---|
10077 | };
|
---|
10078 | ZmInvite.prototype.getComponentDescriptionHtml=function(t){
|
---|
10079 | var n=t||0;
|
---|
10080 | var e=this.components[n];
|
---|
10081 | if(e==null){
|
---|
10082 | return
|
---|
10083 | }
|
---|
10084 | var o=e.descHtml;
|
---|
10085 | var i=o&&o[0]._content||null;
|
---|
10086 | if(!i){
|
---|
10087 | var a=e.desc;
|
---|
10088 | a=(a&&a[0]._content)||null;
|
---|
10089 | if(!a){
|
---|
10090 | i=this.getApptSummary(true)
|
---|
10091 | }}
|
---|
10092 | return i
|
---|
10093 | };
|
---|
10094 | ZmInvite.prototype.getComponentDescription=function(t){
|
---|
10095 | var n=t||0;
|
---|
10096 | var e=this.components[n];
|
---|
10097 | if(e==null){
|
---|
10098 | return
|
---|
10099 | }
|
---|
10100 | var i=e.desc;
|
---|
10101 | var a=i&&i[0]._content||null;
|
---|
10102 | if(!a){
|
---|
10103 | var o=e.descHtml;
|
---|
10104 | o=(o&&o[0]._content)||null;
|
---|
10105 | if(!o){
|
---|
10106 | a=this.getApptSummary()
|
---|
10107 | }}
|
---|
10108 | return a
|
---|
10109 | };
|
---|
10110 | ZmInvite.prototype.getServerEndTime=function(l){
|
---|
10111 | var u=l||0;
|
---|
10112 | if(this.components[u]==null){
|
---|
10113 | return
|
---|
10114 | }
|
---|
10115 | if(this._serverEndTime==null){
|
---|
10116 | if(this.components[u].e!=null){
|
---|
10117 | this._serverEndTime=this.components[u].e[0].d
|
---|
10118 | }else{
|
---|
10119 | if(this.components[u].s){
|
---|
10120 | var a=this.components[u].dur;
|
---|
10121 | var f=a&&a[0].d||0;
|
---|
10122 | var e=a&&a[0].w||0;
|
---|
10123 | var o=a&&a[0].h||0;
|
---|
10124 | var n=a&&a[0].m||0;
|
---|
10125 | var g=a&&a[0].s||0;
|
---|
10126 | var p=parseInt(g)+(parseInt(n)*60)+(parseInt(o)*3600)+(parseInt(f)*24*3600)+(parseInt(e)*7*24*3600);
|
---|
10127 | var i=this.components[u].s[0].d;
|
---|
10128 | var s=parseInt(i.substr(0,4),10);
|
---|
10129 | var m=parseInt(i.substr(4,2),10);
|
---|
10130 | var f=parseInt(i.substr(6,2),10);
|
---|
10131 | var c=new Date(s,m-1,f);
|
---|
10132 | if(i.charAt(8)=="T"){
|
---|
10133 | o=parseInt(i.substr(9,2),10);
|
---|
10134 | n=parseInt(i.substr(11,2),10);
|
---|
10135 | g=parseInt(i.substr(13,2),10);
|
---|
10136 | c.setHours(o,n,g,0)
|
---|
10137 | }
|
---|
10138 | var h=new Date(c.getTime()+(p*1000));
|
---|
10139 | m=AjxDateUtil._pad(c.getMonth()+1);
|
---|
10140 | f=AjxDateUtil._pad(c.getDate());
|
---|
10141 | o=AjxDateUtil._pad(c.getHours());
|
---|
10142 | n=AjxDateUtil._pad(c.getMinutes());
|
---|
10143 | g=AjxDateUtil._pad(c.getSeconds());
|
---|
10144 | s=c.getFullYear();
|
---|
10145 | this._serverEndTime=[s,m,f,"T",o,n,g].join("")
|
---|
10146 | }}}
|
---|
10147 | return this._serverEndTime
|
---|
10148 | };
|
---|
10149 | ZmInvite.prototype.getServerEndDate=function(e){
|
---|
10150 | var t=e||0;
|
---|
10151 | if(this._serverEndDate==null){
|
---|
10152 | this._serverEndDate=AjxDateUtil.parseServerDateTime(this.getServerEndTime(t))
|
---|
10153 | }
|
---|
10154 | return this._serverEndDate
|
---|
10155 | };
|
---|
10156 | ZmInvite.prototype.getServerStartTime=function(e){
|
---|
10157 | var t=e||0;
|
---|
10158 | return this.components[t]&&this.components[t].s?this.components[t].s[0].d:null
|
---|
10159 | };
|
---|
10160 | ZmInvite.prototype.getServerStartDate=function(e){
|
---|
10161 | var t=e||0;
|
---|
10162 | if(this._serverStartDate==null){
|
---|
10163 | this._serverStartDate=AjxDateUtil.parseServerDateTime(this.getServerStartTime(t))
|
---|
10164 | }
|
---|
10165 | return this._serverStartDate
|
---|
10166 | };
|
---|
10167 | ZmInvite.prototype.getServerStartTimeTz=function(e){
|
---|
10168 | var a=e||0;
|
---|
10169 | if(this.components[a]==null){
|
---|
10170 | return
|
---|
10171 | }
|
---|
10172 | if(this._serverStartTimeZone==null){
|
---|
10173 | var t=this.getServerStartTime();
|
---|
10174 | this._serverStartTimeZone=t&&t.charAt(t.length-1)=="Z"?AjxTimezone.GMT_NO_DST:(this.components[a].s?this.components[a].s[0].tz:null)
|
---|
10175 | }
|
---|
10176 | return this._serverStartTimeZone
|
---|
10177 | };
|
---|
10178 | ZmInvite.prototype.getServerEndTimeTz=function(t){
|
---|
10179 | var a=t||0;
|
---|
10180 | if(this.components[a]==null){
|
---|
10181 | return
|
---|
10182 | }
|
---|
10183 | if(this._serverEndTimeZone==null){
|
---|
10184 | var e=this.getServerEndTime();
|
---|
10185 | this._serverEndTimeZone=e&&startTime.charAt(e.length-1)=="Z"?AjxTimezone.GMT_NO_DST:this.components[a].e[0].tz
|
---|
10186 | }
|
---|
10187 | return this._serverEndTimeZone
|
---|
10188 | };
|
---|
10189 | ZmInvite.prototype.getDurationText=function(m,y,e,l){
|
---|
10190 | var p=this.components[m];
|
---|
10191 | var o=this.getServerStartDate(m);
|
---|
10192 | var i=this.getServerEndDate(m);
|
---|
10193 | if(!o&&!i){
|
---|
10194 | return""
|
---|
10195 | }
|
---|
10196 | if(this.isAllDayEvent(m)){
|
---|
10197 | if(y){
|
---|
10198 | return""
|
---|
10199 | }
|
---|
10200 | var f=this.getServerStartDate(m);
|
---|
10201 | if(this.isMultiDay(m)){
|
---|
10202 | var c=this.getServerEndDate(m);
|
---|
10203 | var h=AjxDateFormat.getDateInstance();
|
---|
10204 | var u=h.format(f);
|
---|
10205 | var t=h.format(c);
|
---|
10206 | if(!ZmInvite._daysFormatter){
|
---|
10207 | ZmInvite._daysFormatter=new AjxMessageFormat(ZmMsg.durationDays)
|
---|
10208 | }
|
---|
10209 | return ZmInvite._daysFormatter.format([u,t])
|
---|
10210 | }else{
|
---|
10211 | var h=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
|
---|
10212 | return h.format(f)
|
---|
10213 | }}else{
|
---|
10214 | var h=AjxDateFormat.getDateInstance(AjxDateFormat.FULL);
|
---|
10215 | var s=AjxDateFormat.getTimeInstance(AjxDateFormat.SHORT);
|
---|
10216 | var f=this.getServerStartDate(m);
|
---|
10217 | var g=[];
|
---|
10218 | if(f){
|
---|
10219 | g=[h.format(f),l?" ":"<br>"];
|
---|
10220 | if(e){
|
---|
10221 | g.push(s.format(f))
|
---|
10222 | }else{
|
---|
10223 | var c=this.getServerEndDate(m);
|
---|
10224 | if(c){
|
---|
10225 | var n=s.format(f);
|
---|
10226 | var d=s.format(c);
|
---|
10227 | if(!ZmInvite._hoursFormatter){
|
---|
10228 | ZmInvite._hoursFormatter=new AjxMessageFormat(ZmMsg.durationHours)
|
---|
10229 | }
|
---|
10230 | g.push(ZmInvite._hoursFormatter.format([n,d]))
|
---|
10231 | }}}
|
---|
10232 | return g.join("")
|
---|
10233 | }};
|
---|
10234 | ZmInvite.prototype.getName=function(e){
|
---|
10235 | var t=e||0;
|
---|
10236 | return this.components[t]?this.components[t].name:null
|
---|
10237 | };
|
---|
10238 | ZmInvite.prototype.getFreeBusy=function(e){
|
---|
10239 | var t=e||0;
|
---|
10240 | return this.components[t]?this.components[t].fb:null
|
---|
10241 | };
|
---|
10242 | ZmInvite.prototype.getPrivacy=function(e){
|
---|
10243 | var t=e||0;
|
---|
10244 | return this.components[t]?this.components[t]["class"]:null
|
---|
10245 | };
|
---|
10246 | ZmInvite.prototype.getXProp=function(e){
|
---|
10247 | var t=e||0;
|
---|
10248 | return this.components[t]?this.components[t]["xprop"]:null
|
---|
10249 | };
|
---|
10250 | ZmInvite.prototype.getLocation=function(e){
|
---|
10251 | var t=e||0;
|
---|
10252 | return this.components[t]?this.components[t].loc:null
|
---|
10253 | };
|
---|
10254 | ZmInvite.prototype.getRecurrenceId=function(e){
|
---|
10255 | var t=e||0;
|
---|
10256 | return this.components[t]?this.components[t].ridZ:null
|
---|
10257 | };
|
---|
10258 | ZmInvite.prototype.getToolTip=function(){
|
---|
10259 | if(this._toolTip){
|
---|
10260 | return this._toolTip
|
---|
10261 | }
|
---|
10262 | var i=0;
|
---|
10263 | var a=[];
|
---|
10264 | var t=0;
|
---|
10265 | a[t++]="<table cellpadding=0 cellspacing=0 border=0 >";
|
---|
10266 | a[t++]="<tr valign='center'><td colspan=2 align='left'>";
|
---|
10267 | a[t++]="<div style='border-bottom: 1px solid black;'>";
|
---|
10268 | a[t++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
|
---|
10269 | a[t++]="<tr valign='center'><td><b>";
|
---|
10270 | a[t++]="<div style='white-space:nowrap'><table border=0 cellpadding=0 cellspacing=0 style='display:inline'><tr>";
|
---|
10271 | if(this.hasOtherAttendees(i)){
|
---|
10272 | a[t++]="<td>";
|
---|
10273 | a[t++]=AjxImg.getImageHtml("ApptMeeting");
|
---|
10274 | a[t++]="</td>"
|
---|
10275 | }
|
---|
10276 | if(this.isException(i)){
|
---|
10277 | a[t++]="<td>";
|
---|
10278 | a[t++]=AjxImg.getImageHtml("ApptException");
|
---|
10279 | a[t++]="</td>"
|
---|
10280 | }else{
|
---|
10281 | if(this.isRecurring(i)){
|
---|
10282 | a[t++]="<td>";
|
---|
10283 | a[t++]=AjxImg.getImageHtml("ApptRecur");
|
---|
10284 | a[t++]="</td>"
|
---|
10285 | }}
|
---|
10286 | a[t++]="</tr></table> ";
|
---|
10287 | a[t++]=AjxStringUtil.htmlEncode(this.getName(i));
|
---|
10288 | a[t++]=" </div></b></td><td align='right'>";
|
---|
10289 | a[t++]=AjxImg.getImageHtml("Appointment");
|
---|
10290 | a[t++]="</td></table></div></td></tr>";
|
---|
10291 | var e=this.getDurationText(i,false,false);
|
---|
10292 | t=this._addEntryRow(ZmMsg.when,e,a,t,false,null,true);
|
---|
10293 | if(this.isRecurring(i)){
|
---|
10294 | if(!this._recurBlurb){
|
---|
10295 | AjxDispatcher.require("CalendarCore");
|
---|
10296 | var o=new ZmRecurrence();
|
---|
10297 | o.parse(this.getRecurrenceRules(i));
|
---|
10298 | this._recurBlurb=o.getBlurb()
|
---|
10299 | }
|
---|
10300 | t=this._addEntryRow(ZmMsg.repeats,this._recurBlurb,a,t,true,null,true)
|
---|
10301 | }
|
---|
10302 | t=this._addEntryRow(ZmMsg.location,this.getLocation(i),a,t,false);
|
---|
10303 | a[t++]="</table>";
|
---|
10304 | this._toolTip=a.join("");
|
---|
10305 | return this._toolTip
|
---|
10306 | };
|
---|
10307 | ZmInvite.prototype.getApptSummary=function(e){
|
---|
10308 | var a=this.getMessageId();
|
---|
10309 | var i=appCtxt.getById(this.getMessageId());
|
---|
10310 | var t;
|
---|
10311 | if(i){
|
---|
10312 | AjxDispatcher.require("CalendarCore");
|
---|
10313 | t=new ZmAppt();
|
---|
10314 | t.setFromMessage(i)
|
---|
10315 | }
|
---|
10316 | return t?t.getSummary(e):this.getSummary(e)
|
---|
10317 | };
|
---|
10318 | ZmInvite.prototype.getSummary=function(e){
|
---|
10319 | var h=0;
|
---|
10320 | var c=this.getOrganizerName(h);
|
---|
10321 | var u=this.getDurationText(h,false,false,true);
|
---|
10322 | var l=this.getLocation(h);
|
---|
10323 | if(this.isRecurring(h)){
|
---|
10324 | if(!this._recurBlurb){
|
---|
10325 | AjxDispatcher.require("CalendarCore");
|
---|
10326 | var s=new ZmRecurrence();
|
---|
10327 | s.setRecurrenceRules(this.getRecurrenceRules(h),this.getServerStartDate(h));
|
---|
10328 | this._recurBlurb=s.getBlurb()
|
---|
10329 | }}
|
---|
10330 | var n=this._recurBlurb;
|
---|
10331 | var t=[];
|
---|
10332 | var o=0;
|
---|
10333 | if(!this._summaryHtmlLineFormatter){
|
---|
10334 | this._summaryHtmlLineFormatter=new AjxMessageFormat("<tr><th align='left'>{0}</th><td>{1} {2}</td></tr>");
|
---|
10335 | this._summaryTextLineFormatter=new AjxMessageFormat("{0} {1} {2}")
|
---|
10336 | }
|
---|
10337 | var d=e?this._summaryHtmlLineFormatter:this._summaryTextLineFormatter;
|
---|
10338 | var a=[];
|
---|
10339 | if(e){
|
---|
10340 | t[o++]="<p>\n<table border='0'>\n"
|
---|
10341 | }
|
---|
10342 | if(c){
|
---|
10343 | a=[ZmMsg.organizerLabel,c,""];
|
---|
10344 | t[o++]=d.format(a);
|
---|
10345 | t[o++]="\n"
|
---|
10346 | }
|
---|
10347 | if(u){
|
---|
10348 | a=[ZmMsg.whenLabel,u,""];
|
---|
10349 | t[o++]=d.format(a);
|
---|
10350 | t[o++]="\n"
|
---|
10351 | }
|
---|
10352 | if(l){
|
---|
10353 | a=[ZmMsg.locationLabel,l,""];
|
---|
10354 | t[o++]=d.format(a);
|
---|
10355 | t[o++]="\n"
|
---|
10356 | }
|
---|
10357 | if(n){
|
---|
10358 | a=[ZmMsg.repeatLabel,n,""];
|
---|
10359 | t[o++]=d.format(a);
|
---|
10360 | t[o++]="\n"
|
---|
10361 | }
|
---|
10362 | if(e){
|
---|
10363 | t[o++]="</table>\n"
|
---|
10364 | }
|
---|
10365 | t[o++]=e?"<div>":"\n\n";
|
---|
10366 | t[o++]=ZmItem.NOTES_SEPARATOR;
|
---|
10367 | t[o++]=e?"</div><br>":"\n\n";
|
---|
10368 | return t.join("")
|
---|
10369 | };
|
---|
10370 | ZmInvite.prototype._addEntryRow=function(s,n,t,e,o,i,a){
|
---|
10371 | if(n!=null&&n!=""){
|
---|
10372 | t[e++]="<tr valign='top'><td align='right' style='padding-right: 5px;'><b><div style='white-space:nowrap'>";
|
---|
10373 | t[e++]=AjxMessageFormat.format(ZmMsg.makeLabel,AjxStringUtil.htmlEncode(s));
|
---|
10374 | t[e++]="</div></b></td><td align='left'><div style='white-space:";
|
---|
10375 | t[e++]=o?"wrap;":"nowrap;";
|
---|
10376 | if(i){
|
---|
10377 | t[e++]="width:";
|
---|
10378 | t[e++]=i;
|
---|
10379 | t[e++]="px;"
|
---|
10380 | }
|
---|
10381 | t[e++]="'>";
|
---|
10382 | t[e++]=a?n:AjxStringUtil.htmlEncode(n);
|
---|
10383 | t[e++]="</div></td></tr>"
|
---|
10384 | }
|
---|
10385 | return e
|
---|
10386 | };
|
---|
10387 | ZmInvite.prototype.hasAcceptableComponents=function(){
|
---|
10388 | for(var e in this.components){
|
---|
10389 | if(this.getStatus(e)!=ZmCalendarApp.STATUS_CANC){
|
---|
10390 | return true
|
---|
10391 | }}
|
---|
10392 | return false
|
---|
10393 | };
|
---|
10394 | ZmInvite.prototype.hasInviteReplyMethod=function(t){
|
---|
10395 | var e=this.getInviteMethod(t);
|
---|
10396 | var a=(e==ZmCalendarApp.METHOD_REQUEST||e==ZmCalendarApp.METHOD_PUBLISH);
|
---|
10397 | return((e==null)||a)
|
---|
10398 | };
|
---|
10399 | ZmInvite.prototype.hasCounterMethod=function(t){
|
---|
10400 | var e=this.getInviteMethod(t);
|
---|
10401 | return(e==ZmCalendarApp.METHOD_COUNTER)
|
---|
10402 | };
|
---|
10403 | ZmInvite.prototype.getProposedTimeStr=function(t){
|
---|
10404 | var e=this.getInviteMethod(t);
|
---|
10405 | if(e==ZmCalendarApp.METHOD_COUNTER){
|
---|
10406 | return this.getDurationText(t,false,false,true)
|
---|
10407 | }
|
---|
10408 | return""
|
---|
10409 | }
|
---|
10410 | }
|
---|
10411 | if(AjxPackage.define("zimbraMail.share.view.ZmAutocompleteListView")){
|
---|
10412 | ZmAutocompleteListView=function(i){
|
---|
10413 | var e=i.className?i.className:"ZmAutocompleteListView";
|
---|
10414 | DwtComposite.call(this,i.parent||appCtxt.getShell(),e,DwtControl.ABSOLUTE_STYLE);
|
---|
10415 | this._dataClass=this._dataAPI=i.dataClass;
|
---|
10416 | this._dataLoader=i.dataLoader;
|
---|
10417 | this._dataLoaded=false;
|
---|
10418 | this._matchValue=i.matchValue;
|
---|
10419 | this._separator=(i.separator!=null)?i.separator:AjxEmailAddress.SEPARATOR;
|
---|
10420 | this._compCallback=i.compCallback;
|
---|
10421 | this._keyDownCallback=i.keyDownCallback;
|
---|
10422 | this._keyPressCallback=i.keyPressCallback;
|
---|
10423 | this._keyUpCallback=i.keyUpCallback;
|
---|
10424 | this._enterCallback=i.enterCallback;
|
---|
10425 | this._options=i.options||{};
|
---|
10426 | this._isDelim=AjxUtil.arrayAsHash(i.delims||ZmAutocompleteListView.DELIMS);
|
---|
10427 | this._isDelimCode=AjxUtil.arrayAsHash(i.delimCodes||ZmAutocompleteListView.DELIM_CODES);
|
---|
10428 | if(!i.delims&&!i.delimCodes){
|
---|
10429 | this._isDelim[","]=this._isDelimCode[188]=appCtxt.get(ZmSetting.AUTOCOMPLETE_ON_COMMA);
|
---|
10430 | var t=new AjxListener(this,this._settingChangeListener);
|
---|
10431 | var a=appCtxt.getSettings().getSetting(ZmSetting.AUTOCOMPLETE_ON_COMMA);
|
---|
10432 | if(a){
|
---|
10433 | a.addChangeListener(t)
|
---|
10434 | }}
|
---|
10435 | this._setMouseEventHdlrs();
|
---|
10436 | this.addListener(DwtEvent.ONMOUSEDOWN,new AjxListener(this,this._mouseDownListener));
|
---|
10437 | this.addListener(DwtEvent.ONMOUSEOVER,new AjxListener(this,this._mouseOverListener));
|
---|
10438 | this._addSelectionListener(new AjxListener(this,this._listSelectionListener));
|
---|
10439 | this._outsideListener=new AjxListener(null,ZmAutocompleteListView._outsideMouseDownListener);
|
---|
10440 | this._acInterval=appCtxt.get(ZmSetting.AC_TIMER_INTERVAL);
|
---|
10441 | this._acAction=new AjxTimedAction(null,this._autocompleteAction);
|
---|
10442 | this._acActionId=-1;
|
---|
10443 | if(AjxEnv.isGeckoBased){
|
---|
10444 | this._focusAction=new AjxTimedAction(null,this._autocompleteFocus)
|
---|
10445 | }
|
---|
10446 | this._origClass="acRow";
|
---|
10447 | this._selClass="acRow-selected";
|
---|
10448 | this._showForgetTextClass="ForgetText";
|
---|
10449 | this._hideForgetTextClass="ForgetText-hide";
|
---|
10450 | this._hideSelForgetTextClass="ForgetText-hide-selected";
|
---|
10451 | this._numChars=0;
|
---|
10452 | this._done={};
|
---|
10453 | this.setVisible(false);
|
---|
10454 | this.setScrollStyle(Dwt.SCROLL)
|
---|
10455 | };
|
---|
10456 | ZmAutocompleteListView.prototype=new DwtComposite;
|
---|
10457 | ZmAutocompleteListView.prototype.constructor=ZmAutocompleteListView;
|
---|
10458 | ZmAutocompleteListView.DELIMS=[",",";","\n","\r","\t"];
|
---|
10459 | ZmAutocompleteListView.DELIM_CODES=[188,59,186,3,13,9];
|
---|
10460 | ZmAutocompleteListView.WAIT_ID="wait";
|
---|
10461 | ZmAutocompleteListView.NEXT=-1;
|
---|
10462 | ZmAutocompleteListView.PREV=-2;
|
---|
10463 | ZmAutocompleteListView.onKeyDown=function(n){
|
---|
10464 | n=DwtUiEvent.getEvent(n);
|
---|
10465 | var e=null;
|
---|
10466 | var i=DwtKeyEvent.getCharCode(n);
|
---|
10467 | if(i==38||i==40){
|
---|
10468 | ZmAutocompleteListView.__geckoKeyCode=null;
|
---|
10469 | e=ZmAutocompleteListView._onKeyUp(n)
|
---|
10470 | }else{
|
---|
10471 | e=ZmAutocompleteListView._onKeyDown(n)
|
---|
10472 | }
|
---|
10473 | var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
|
---|
10474 | var t=DwtControl.ALL_BY_ID[a._aclvId];
|
---|
10475 | if(t&&t._keyDownCallback){
|
---|
10476 | var o=t._keyDownCallback.run(n,t,e);
|
---|
10477 | e=(o===true||o===false)?o:e
|
---|
10478 | }
|
---|
10479 | return e
|
---|
10480 | };
|
---|
10481 | ZmAutocompleteListView.onKeyPress=function(n){
|
---|
10482 | n=DwtUiEvent.getEvent(n);
|
---|
10483 | DwtKeyEvent.geckoCheck(n);
|
---|
10484 | var e=null;
|
---|
10485 | var i=DwtKeyEvent.getCharCode(n);
|
---|
10486 | if(AjxEnv.isGeckoBased&&(i==38||i==40)){
|
---|
10487 | if(ZmAutocompleteListView.__geckoKeyCode){
|
---|
10488 | e=ZmAutocompleteListView._onKeyUp(n)
|
---|
10489 | }else{
|
---|
10490 | ZmAutocompleteListView.__geckoKeyCode=i
|
---|
10491 | }}
|
---|
10492 | var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
|
---|
10493 | var t=DwtControl.ALL_BY_ID[a._aclvId];
|
---|
10494 | if(t&&t._keyPressCallback){
|
---|
10495 | var o=t._keyPressCallback.run(n,t);
|
---|
10496 | e=(o===true||o===false)?o:e
|
---|
10497 | }
|
---|
10498 | return(e!=null)?e:ZmAutocompleteListView._echoKey(true,n)
|
---|
10499 | };
|
---|
10500 | ZmAutocompleteListView.onKeyUp=function(n){
|
---|
10501 | n=DwtUiEvent.getEvent(n);
|
---|
10502 | var i=DwtKeyEvent.getCharCode(n);
|
---|
10503 | if(i==38||i==40){
|
---|
10504 | ZmAutocompleteListView.__geckoKeyCode=null;
|
---|
10505 | return true
|
---|
10506 | }
|
---|
10507 | var e=ZmAutocompleteListView._onKeyUp(n);
|
---|
10508 | var a=DwtUiEvent.getTargetWithProp(n,"_aclvId");
|
---|
10509 | var t=DwtControl.ALL_BY_ID[a._aclvId];
|
---|
10510 | if(t&&t._keyUpCallback){
|
---|
10511 | var o=t._keyUpCallback.run(n,t,e);
|
---|
10512 | e=(o===true||o===false)?o:e
|
---|
10513 | }
|
---|
10514 | return e
|
---|
10515 | };
|
---|
10516 | ZmAutocompleteListView._onKeyDown=function(i){
|
---|
10517 | var a=DwtKeyEvent.getCharCode(i);
|
---|
10518 | if(a==3||a==13){
|
---|
10519 | var t=DwtUiEvent.getTargetWithProp(i,"_aclvId");
|
---|
10520 | if(!t){
|
---|
10521 | return ZmAutocompleteListView._echoKey(true,i)
|
---|
10522 | }
|
---|
10523 | var e=DwtControl.ALL_BY_ID[t._aclvId];
|
---|
10524 | if(e&&e.getVisible()){
|
---|
10525 | return ZmAutocompleteListView._echoKey(false,i)
|
---|
10526 | }}
|
---|
10527 | if(a==9||a==27){
|
---|
10528 | return ZmAutocompleteListView._onKeyUp(i)
|
---|
10529 | }else{
|
---|
10530 | return ZmAutocompleteListView._echoKey(true,i)
|
---|
10531 | }};
|
---|
10532 | ZmAutocompleteListView._onKeyUp=function(s){
|
---|
10533 | this._hasCompleted=false;
|
---|
10534 | var n=DwtUiEvent.getTargetWithProp(s,"_aclvId");
|
---|
10535 | if(!n){
|
---|
10536 | return ZmAutocompleteListView._echoKey(true,s)
|
---|
10537 | }
|
---|
10538 | var o=DwtControl.ALL_BY_ID[n._aclvId];
|
---|
10539 | var i=DwtKeyEvent.getCharCode(s);
|
---|
10540 | if(AjxEnv.isIE&&s.type=="keyup"&&(i==9||i==27)){
|
---|
10541 | return ZmAutocompleteListView._echoKey(true,s)
|
---|
10542 | }
|
---|
10543 | var h=n.value;
|
---|
10544 | if(o._acActionId!=-1&&!DwtKeyMap.IS_MODIFIER[i]){
|
---|
10545 | AjxTimedAction.cancelAction(o._acActionId);
|
---|
10546 | o._acActionId=-1
|
---|
10547 | }
|
---|
10548 | if(DwtKeyMap.IS_MODIFIER[i]||DwtKeyMapMgr.hasModifier(s)){
|
---|
10549 | return ZmAutocompleteListView._echoKey(true,s)
|
---|
10550 | }
|
---|
10551 | if(!h){
|
---|
10552 | o.reset();
|
---|
10553 | return ZmAutocompleteListView._echoKey(true,s)
|
---|
10554 | }
|
---|
10555 | if(i==37||i==39){
|
---|
10556 | return ZmAutocompleteListView._echoKey(true,s)
|
---|
10557 | }
|
---|
10558 | if((i==9||i==27)&&!o.size()){
|
---|
10559 | return ZmAutocompleteListView._echoKey(true,s)
|
---|
10560 | }
|
---|
10561 | if(AjxStringUtil.isPrintKey(i)||(i==3||i==9||i==13)){
|
---|
10562 | o._numChars++
|
---|
10563 | }
|
---|
10564 | var t=(o.getVisible()&&(o._numChars==1)&&(!s.shiftKey&&o._isDelimCode[i]));
|
---|
10565 | if(t||(i==27||(o.getVisible()&&(i==38||i==40)))){
|
---|
10566 | o.handleAction(i,t);
|
---|
10567 | if(AjxEnv.isGeckoBased&&i==9){
|
---|
10568 | o._focusAction.args=[n];
|
---|
10569 | AjxTimedAction.scheduleAction(o._focusAction,0)
|
---|
10570 | }
|
---|
10571 | if((i==13||i==3)&&o._enterCallback){
|
---|
10572 | var e=o._enterCallback.run(s);
|
---|
10573 | return(e!=null)?e:ZmAutocompleteListView._echoKey(true,s)
|
---|
10574 | }
|
---|
10575 | return ZmAutocompleteListView._echoKey(false,s)
|
---|
10576 | }
|
---|
10577 | if(!AjxStringUtil.isPrintKey(i)&&(i!=3&&i!=13&&i!=9&&i!=8&&i!=46)){
|
---|
10578 | return ZmAutocompleteListView._echoKey(true,s)
|
---|
10579 | }
|
---|
10580 | if((i==13||i==3)&&o._enterCallback){
|
---|
10581 | o.reset();
|
---|
10582 | var e=o._enterCallback.run(s);
|
---|
10583 | return(e!=null)?e:ZmAutocompleteListView._echoKey(true,s)
|
---|
10584 | }
|
---|
10585 | var a=new DwtKeyEvent();
|
---|
10586 | DwtKeyEvent.copy(a,s);
|
---|
10587 | a.aclv=o;
|
---|
10588 | a.element=n;
|
---|
10589 | o._acAction.obj=o;
|
---|
10590 | o._acAction.args=[a];
|
---|
10591 | o._acActionId=AjxTimedAction.scheduleAction(o._acAction,o._acInterval);
|
---|
10592 | return ZmAutocompleteListView._echoKey(true,s)
|
---|
10593 | };
|
---|
10594 | ZmAutocompleteListView._echoKey=function(e,t){
|
---|
10595 | DwtUiEvent.setBehaviour(t,!e,e);
|
---|
10596 | return e
|
---|
10597 | };
|
---|
10598 | ZmAutocompleteListView._outsideMouseDownListener=function(t){
|
---|
10599 | var e=ZmAutocompleteListView._activeAcList;
|
---|
10600 | if(e.getVisible()){
|
---|
10601 | var a=DwtControl.getTargetControl(t);
|
---|
10602 | if(a!=e&&!a.isForgetText){
|
---|
10603 | e.show(false);
|
---|
10604 | t._stopPropagation=false;
|
---|
10605 | t._returnValue=true
|
---|
10606 | }}};
|
---|
10607 | ZmAutocompleteListView.prototype.toString=function(){
|
---|
10608 | return"ZmAutocompleteListView"
|
---|
10609 | };
|
---|
10610 | ZmAutocompleteListView.prototype.setActiveAccount=function(e){
|
---|
10611 | this._activeAccount=e
|
---|
10612 | };
|
---|
10613 | ZmAutocompleteListView.prototype.handle=function(e){
|
---|
10614 | e._aclvId=this._htmlElId;
|
---|
10615 | Dwt.setHandler(e,DwtEvent.ONKEYDOWN,ZmAutocompleteListView.onKeyDown);
|
---|
10616 | Dwt.setHandler(e,DwtEvent.ONKEYPRESS,ZmAutocompleteListView.onKeyPress);
|
---|
10617 | Dwt.setHandler(e,DwtEvent.ONKEYUP,ZmAutocompleteListView.onKeyUp)
|
---|
10618 | };
|
---|
10619 | ZmAutocompleteListView.prototype.autocomplete=function(t){
|
---|
10620 | if(!t||(t.text=="undefined")){
|
---|
10621 | return
|
---|
10622 | }
|
---|
10623 | if(this._dataLoader&&!this._dataLoaded){
|
---|
10624 | this._data=this._dataLoader.call(this._dataClass);
|
---|
10625 | this._dataAPI=this._data;
|
---|
10626 | this._dataLoaded=true
|
---|
10627 | }
|
---|
10628 | var a=new AjxCallback(this,this.autocomplete);
|
---|
10629 | if(t.start<t.text.length){
|
---|
10630 | var e=this._nextChunk(t.text,t.start);
|
---|
10631 | this._autocomplete(e,a)
|
---|
10632 | }else{
|
---|
10633 | if(t.change){
|
---|
10634 | this._updateField(t.text,t.match)
|
---|
10635 | }}};
|
---|
10636 | ZmAutocompleteListView.prototype.reset=function(){
|
---|
10637 | this._matches=null;
|
---|
10638 | this._matchHash={};
|
---|
10639 | this._canForget={};
|
---|
10640 | this._selected=null;
|
---|
10641 | this.show(false)
|
---|
10642 | };
|
---|
10643 | ZmAutocompleteListView.prototype.handleAction=function(t,e){
|
---|
10644 | if(e){
|
---|
10645 | this._update(true)
|
---|
10646 | }else{
|
---|
10647 | if(t==38||t==40){
|
---|
10648 | if(this.size()<=1){
|
---|
10649 | return
|
---|
10650 | }
|
---|
10651 | if(t==40){
|
---|
10652 | this._setSelected(ZmAutocompleteListView.NEXT)
|
---|
10653 | }else{
|
---|
10654 | if(t==38){
|
---|
10655 | this._setSelected(ZmAutocompleteListView.PREV)
|
---|
10656 | }}}else{
|
---|
10657 | if(t==27){
|
---|
10658 | this.reset()
|
---|
10659 | }}}};
|
---|
10660 | ZmAutocompleteListView.prototype.setWaiting=function(t){
|
---|
10661 | if(t&&!this._waitingRow){
|
---|
10662 | if(!this.size()){
|
---|
10663 | this.show(true)
|
---|
10664 | }
|
---|
10665 | var i=this._getTable();
|
---|
10666 | var o=this._waitingRow=i.insertRow(-1);
|
---|
10667 | var e=o.insertCell(-1);
|
---|
10668 | e.innerHTML="<div class='DwtWait16Icon'></div>";
|
---|
10669 | e=o.insertCell(-1);
|
---|
10670 | e.innerHTML=ZmMsg.autocompleteWaiting;
|
---|
10671 | e=o.insertCell(-1);
|
---|
10672 | e.innerHTML=" "
|
---|
10673 | }else{
|
---|
10674 | var a=new AjxTimedAction(this,this._clearWaiting);
|
---|
10675 | AjxTimedAction.scheduleAction(a,1000)
|
---|
10676 | }};
|
---|
10677 | ZmAutocompleteListView.prototype._autocompleteAction=function(a){
|
---|
10678 | var t=a.element;
|
---|
10679 | var e=a.aclv;
|
---|
10680 | e._acActionId=-1;
|
---|
10681 | e._numChars=0;
|
---|
10682 | e.reset();
|
---|
10683 | e._element=t;
|
---|
10684 | var i={
|
---|
10685 | text:t.value,start:0};
|
---|
10686 | e.autocomplete(i)
|
---|
10687 | };
|
---|
10688 | ZmAutocompleteListView.prototype.show=function(e,t){
|
---|
10689 | if(e){
|
---|
10690 | this._popup(t)
|
---|
10691 | }else{
|
---|
10692 | this._hasCompleted=false;
|
---|
10693 | this._popdown()
|
---|
10694 | }};
|
---|
10695 | ZmAutocompleteListView.prototype._nextChunk=function(o,s){
|
---|
10696 | while(o.charAt(s)==" "){
|
---|
10697 | s++
|
---|
10698 | }
|
---|
10699 | var e=false;
|
---|
10700 | for(var a=s;
|
---|
10701 | a<o.length;
|
---|
10702 | a++){
|
---|
10703 | var n=o.charAt(a);
|
---|
10704 | if(n=='"'){
|
---|
10705 | n=o.charAt(++a);
|
---|
10706 | while(a<o.length&&n!='"'){
|
---|
10707 | n=o.charAt(++a)
|
---|
10708 | }}
|
---|
10709 | if(this._isDelim[n]){
|
---|
10710 | var t=o.substring(s,a);
|
---|
10711 | if(this._dataAPI.isComplete&&this._dataAPI.isComplete(t)){
|
---|
10712 | s=a+1;
|
---|
10713 | while(o.charAt(s)==" "){
|
---|
10714 | s++
|
---|
10715 | }}else{
|
---|
10716 | return{
|
---|
10717 | text:o,str:t,start:s,end:a,delim:true}
|
---|
10718 | }}}
|
---|
10719 | var t=o.substring(s,a);
|
---|
10720 | return{
|
---|
10721 | text:o,str:t,start:s,end:a,delim:false}
|
---|
10722 | };
|
---|
10723 | ZmAutocompleteListView.prototype._autocomplete=function(e,n){
|
---|
10724 | if(!e||!(this._dataAPI&&this._dataAPI.autocompleteMatch)){
|
---|
10725 | return
|
---|
10726 | }
|
---|
10727 | var a=AjxStringUtil.trim(e.str);
|
---|
10728 | if(!(a&&a.length)||(this._done[a])){
|
---|
10729 | if(n){
|
---|
10730 | n.run({
|
---|
10731 | text:e.text,start:e.end+1}
|
---|
10732 | );
|
---|
10733 | return
|
---|
10734 | }else{
|
---|
10735 | return{
|
---|
10736 | text:e.text,start:e.end+1}
|
---|
10737 | }}
|
---|
10738 | this._start=e.start;
|
---|
10739 | this._end=e.end;
|
---|
10740 | var t=e.text;
|
---|
10741 | var o=e.end;
|
---|
10742 | this._removeAll();
|
---|
10743 | var i=new AjxCallback(this,this._handleResponseAutocomplete,[a,e,t,o,n]);
|
---|
10744 | this._dataAPI.autocompleteMatch(a,i,this,this._options,this._activeAccount)
|
---|
10745 | };
|
---|
10746 | ZmAutocompleteListView.prototype._handleResponseAutocomplete=function(o,s,l,e,h,i){
|
---|
10747 | var t;
|
---|
10748 | var n=false;
|
---|
10749 | if(!t){
|
---|
10750 | if(i&&i.length){
|
---|
10751 | this._set(i)
|
---|
10752 | }
|
---|
10753 | var a;
|
---|
10754 | if(s&&s.delim&&(s.end==s.text.length-1)){
|
---|
10755 | var c=this._complete(l,o,true);
|
---|
10756 | if(c){
|
---|
10757 | l=c.text;
|
---|
10758 | e=c.start;
|
---|
10759 | a=c.match;
|
---|
10760 | n=true
|
---|
10761 | }}else{
|
---|
10762 | if(i&&i.length){
|
---|
10763 | if(!this._hasCompleted){
|
---|
10764 | this.show(true)
|
---|
10765 | }}}
|
---|
10766 | t={
|
---|
10767 | text:l,start:e,match:a,change:n}
|
---|
10768 | }
|
---|
10769 | if(h){
|
---|
10770 | h.run(t)
|
---|
10771 | }};
|
---|
10772 | ZmAutocompleteListView.prototype._complete=function(d,l,t){
|
---|
10773 | var s=this._matchHash[this._selected];
|
---|
10774 | if(!s&&l&&t&&this._dataAPI.quickComplete){
|
---|
10775 | s=this._dataAPI.quickComplete(l)
|
---|
10776 | }
|
---|
10777 | if(!s){
|
---|
10778 | return
|
---|
10779 | }
|
---|
10780 | var e=this._start;
|
---|
10781 | var a=t?this._end+1:this._end;
|
---|
10782 | var c="";
|
---|
10783 | if(this._matchValue instanceof Array){
|
---|
10784 | for(var o=0,h=this._matchValue.length;
|
---|
10785 | o<h;
|
---|
10786 | o++){
|
---|
10787 | if(s[this._matchValue[o]]){
|
---|
10788 | c=s[this._matchValue[o]];
|
---|
10789 | break
|
---|
10790 | }}}else{
|
---|
10791 | c=s[this._matchValue]||""
|
---|
10792 | }
|
---|
10793 | var n=[d.substring(0,e),c,this._separator,d.substring(a,d.length)].join("");
|
---|
10794 | if(c){
|
---|
10795 | this._done[c]=true
|
---|
10796 | }
|
---|
10797 | return{
|
---|
10798 | text:n,start:e+c.length+this._separator.length,match:s}
|
---|
10799 | };
|
---|
10800 | ZmAutocompleteListView.prototype._updateField=function(a,e){
|
---|
10801 | var t=this._element;
|
---|
10802 | t.value=a;
|
---|
10803 | t.focus();
|
---|
10804 | Dwt.setSelectionRange(t,a.length,a.length);
|
---|
10805 | this.reset();
|
---|
10806 | this._hasCompleted=true;
|
---|
10807 | if(this._compCallback){
|
---|
10808 | this._compCallback.run(a,t,e)
|
---|
10809 | }};
|
---|
10810 | ZmAutocompleteListView.prototype._update=function(t){
|
---|
10811 | var e=this._complete(this._element.value,null,t);
|
---|
10812 | if(e){
|
---|
10813 | this._updateField(e.text,e.match)
|
---|
10814 | }};
|
---|
10815 | ZmAutocompleteListView.prototype._mouseDownListener=function(e){
|
---|
10816 | e=DwtUiEvent.getEvent(e);
|
---|
10817 | var a=DwtUiEvent.getTargetWithProp(e,"id");
|
---|
10818 | if(!a||!a.id){
|
---|
10819 | return
|
---|
10820 | }
|
---|
10821 | if(e.button==DwtMouseEvent.LEFT){
|
---|
10822 | this._setSelected(a.id);
|
---|
10823 | if(this.isListenerRegistered(DwtEvent.SELECTION)){
|
---|
10824 | var t=DwtShell.selectionEvent;
|
---|
10825 | DwtUiEvent.copy(t,e);
|
---|
10826 | t.detail=0;
|
---|
10827 | this.notifyListeners(DwtEvent.SELECTION,t);
|
---|
10828 | return true
|
---|
10829 | }}};
|
---|
10830 | ZmAutocompleteListView.prototype._mouseOverListener=function(e){
|
---|
10831 | e=DwtUiEvent.getEvent(e);
|
---|
10832 | var t=Dwt.findAncestor(DwtUiEvent.getTarget(e),"id");
|
---|
10833 | if(t){
|
---|
10834 | this._setSelected(t.id)
|
---|
10835 | }
|
---|
10836 | return true
|
---|
10837 | };
|
---|
10838 | ZmAutocompleteListView.prototype._addSelectionListener=function(e){
|
---|
10839 | this._eventMgr.addListener(DwtEvent.SELECTION,e)
|
---|
10840 | };
|
---|
10841 | ZmAutocompleteListView.prototype._listSelectionListener=function(e){
|
---|
10842 | this._update(true)
|
---|
10843 | };
|
---|
10844 | ZmAutocompleteListView.prototype._getTable=function(){
|
---|
10845 | var a=this._tableId&&document.getElementById(this._tableId);
|
---|
10846 | if(!a){
|
---|
10847 | var t=[],e=0;
|
---|
10848 | this._tableId=Dwt.getNextId();
|
---|
10849 | t[e++]="<table id='"+this._tableId+"' cellpadding=0 cellspacing=0 border=0>";
|
---|
10850 | t[e++]="</table>";
|
---|
10851 | this.getHtmlElement().innerHTML=t.join("");
|
---|
10852 | a=document.getElementById(this._tableId)
|
---|
10853 | }
|
---|
10854 | return a
|
---|
10855 | };
|
---|
10856 | ZmAutocompleteListView.prototype._set=function(s){
|
---|
10857 | var c=this._getTable();
|
---|
10858 | this._matches=s;
|
---|
10859 | var n=this._matches.length;
|
---|
10860 | for(var t=0;
|
---|
10861 | t<n;
|
---|
10862 | t++){
|
---|
10863 | var o=this._matches[t];
|
---|
10864 | if(o&&(o.text||o.icon)){
|
---|
10865 | var e=o.id=this._getId("Row",t);
|
---|
10866 | this._matchHash[e]=o;
|
---|
10867 | var d=c.insertRow(-1);
|
---|
10868 | d.className=this._origClass;
|
---|
10869 | d.id=e;
|
---|
10870 | var a=[],h=0;
|
---|
10871 | var l=d.insertCell(-1);
|
---|
10872 | l.className="Icon";
|
---|
10873 | if(o.icon){
|
---|
10874 | l.innerHTML=(o.icon.indexOf("Dwt")!=-1)?["<div class='",o.icon,"'></div>"].join(""):AjxImg.getImageHtml(o.icon)
|
---|
10875 | }else{
|
---|
10876 | l.innerHTML=" "
|
---|
10877 | }
|
---|
10878 | l=d.insertCell(-1);
|
---|
10879 | l.innerHTML=o.text||" ";
|
---|
10880 | if(this._options.supportForget!==false){
|
---|
10881 | this._canForget[e]=o.canForget;
|
---|
10882 | l=d.insertCell(-1);
|
---|
10883 | l.className="Forget";
|
---|
10884 | l.innerHTML=o.canForget?"<a id='"+this._getId("Forget",t)+"'></a>":""
|
---|
10885 | }}}
|
---|
10886 | this._addForgetLinks();
|
---|
10887 | AjxTimedAction.scheduleAction(new AjxTimedAction(this,function(){
|
---|
10888 | this._setSelected(this._getId("Row",0))
|
---|
10889 | }
|
---|
10890 | ),100)
|
---|
10891 | };
|
---|
10892 | ZmAutocompleteListView.prototype._getId=function(t,e){
|
---|
10893 | return[this._htmlElId,"ac"+t,e].join("_")
|
---|
10894 | };
|
---|
10895 | ZmAutocompleteListView.prototype._addForgetLinks=function(){
|
---|
10896 | this._rowForgetHash={};
|
---|
10897 | var e=this._matches.length;
|
---|
10898 | for(var a=0;
|
---|
10899 | a<e;
|
---|
10900 | a++){
|
---|
10901 | var t=this._matches[a];
|
---|
10902 | var h=t.id=this._getId("Row",a);
|
---|
10903 | var o=this._getId("Forget",a);
|
---|
10904 | var s=document.getElementById(o);
|
---|
10905 | if(s){
|
---|
10906 | var l=new DwtText({
|
---|
10907 | parent:this,className:this._hideForgetTextClass}
|
---|
10908 | );
|
---|
10909 | this._rowForgetHash[h]=l;
|
---|
10910 | l.isForgetText=true;
|
---|
10911 | l.setText(ZmMsg.forget);
|
---|
10912 | l.setToolTipContent(ZmMsg.forgetTooltip);
|
---|
10913 | var n=new AjxListener(this,this._handleForgetLink,[t.email,h]);
|
---|
10914 | l.addListener(DwtEvent.ONMOUSEDOWN,n);
|
---|
10915 | l.reparentHtmlElement(s)
|
---|
10916 | }}};
|
---|
10917 | ZmAutocompleteListView.prototype._showForgetLink=function(a,t){
|
---|
10918 | var e=this._rowForgetHash[a];
|
---|
10919 | if(e){
|
---|
10920 | e.setClassName(!t?this._hideForgetTextClass:this._canForget[a]?this._showForgetTextClass:this._hideSelForgetTextClass)
|
---|
10921 | }};
|
---|
10922 | ZmAutocompleteListView.prototype._popup=function(a){
|
---|
10923 | var i=this.shell.getSize().y;
|
---|
10924 | var o=Dwt.getLocation(this._element);
|
---|
10925 | var c=Dwt.getSize(this._element);
|
---|
10926 | var h=o.x;
|
---|
10927 | var n=o.y+c.y;
|
---|
10928 | var l=i-n;
|
---|
10929 | var s=this.size()*this._getRowHeight();
|
---|
10930 | this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
|
---|
10931 | this.setVisible(true);
|
---|
10932 | var e=this.getSize();
|
---|
10933 | if(l<s){
|
---|
10934 | this.setSize(Dwt.DEFAULT,l-(AjxEnv.isIE?30:10));
|
---|
10935 | var t=this.getHtmlElement();
|
---|
10936 | if(t.clientWidth!=t.scrollWidth){
|
---|
10937 | this.setSize(e.x+Dwt.SCROLLBAR_WIDTH,Dwt.DEFAULT)
|
---|
10938 | }}else{
|
---|
10939 | if(e.y<s){
|
---|
10940 | this.setSize(Dwt.CLEAR,s)
|
---|
10941 | }}
|
---|
10942 | this.setLocation(h,n);
|
---|
10943 | this.setVisible(true);
|
---|
10944 | this.setZIndex(Dwt.Z_DIALOG_MENU);
|
---|
10945 | ZmAutocompleteListView._activeAcList=this;
|
---|
10946 | DwtEventManager.addListener(DwtEvent.ONMOUSEDOWN,ZmAutocompleteListView._outsideMouseDownListener);
|
---|
10947 | this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN]);
|
---|
10948 | this.shell.addListener(DwtEvent.ONMOUSEDOWN,this._outsideListener)
|
---|
10949 | };
|
---|
10950 | ZmAutocompleteListView.prototype._popdown=function(){
|
---|
10951 | this.setZIndex(Dwt.Z_HIDDEN);
|
---|
10952 | this.setVisible(false);
|
---|
10953 | ZmAutocompleteListView._activeAcList=null;
|
---|
10954 | DwtEventManager.removeListener(DwtEvent.ONMOUSEDOWN,ZmAutocompleteListView._outsideMouseDownListener);
|
---|
10955 | this.shell._setEventHdlrs([DwtEvent.ONMOUSEDOWN],true);
|
---|
10956 | this.shell.removeListener(DwtEvent.ONMOUSEDOWN,this._outsideListener)
|
---|
10957 | };
|
---|
10958 | ZmAutocompleteListView.prototype._setSelected=function(e){
|
---|
10959 | if(e==this._selected){
|
---|
10960 | return
|
---|
10961 | }
|
---|
10962 | var h=document.getElementById(this._tableId);
|
---|
10963 | var c=h&&h.rows;
|
---|
10964 | if(!(c&&c.length)){
|
---|
10965 | return
|
---|
10966 | }
|
---|
10967 | var a=c.length;
|
---|
10968 | var s=-1;
|
---|
10969 | if(e==ZmAutocompleteListView.NEXT||e==ZmAutocompleteListView.PREV){
|
---|
10970 | if(a<=1){
|
---|
10971 | return
|
---|
10972 | }
|
---|
10973 | for(var t=0;
|
---|
10974 | t<a;
|
---|
10975 | t++){
|
---|
10976 | if(c[t].id==this._selected){
|
---|
10977 | s=t;
|
---|
10978 | break
|
---|
10979 | }}
|
---|
10980 | var n=(e==ZmAutocompleteListView.PREV)?s-1:s+1;
|
---|
10981 | if(n<0||n>=a){
|
---|
10982 | return
|
---|
10983 | }
|
---|
10984 | e=c[n].id
|
---|
10985 | }
|
---|
10986 | DwtControl._scrollIntoView(c[n],this.getHtmlElement());
|
---|
10987 | for(var t=0;
|
---|
10988 | t<a;
|
---|
10989 | t++){
|
---|
10990 | var l=c[t];
|
---|
10991 | var o=l.className;
|
---|
10992 | if(l.id==e){
|
---|
10993 | l.className=this._selClass
|
---|
10994 | }else{
|
---|
10995 | if(o!=this._origClass){
|
---|
10996 | l.className=this._origClass
|
---|
10997 | }}}
|
---|
10998 | this._showForgetLink(this._selected,false);
|
---|
10999 | this._showForgetLink(e,true);
|
---|
11000 | this._selected=e
|
---|
11001 | };
|
---|
11002 | ZmAutocompleteListView.prototype._getRowHeight=function(){
|
---|
11003 | if(!this._rowHeight){
|
---|
11004 | if(!ZmAutocompleteListView._activeAcList){
|
---|
11005 | this.setLocation(Dwt.LOC_NOWHERE,Dwt.LOC_NOWHERE);
|
---|
11006 | this.setVisible(true)
|
---|
11007 | }
|
---|
11008 | var e=this._getTable().rows[0];
|
---|
11009 | this._rowHeight=e&&Dwt.getSize(e).y
|
---|
11010 | }
|
---|
11011 | return this._rowHeight||18
|
---|
11012 | };
|
---|
11013 | ZmAutocompleteListView.prototype._removeAll=function(){
|
---|
11014 | this._matches=null;
|
---|
11015 | var n=this._getTable();
|
---|
11016 | for(var o=n.rows.length-1;
|
---|
11017 | o>=0;
|
---|
11018 | o--){
|
---|
11019 | var s=n.rows[o];
|
---|
11020 | if(s!=this._waitingRow){
|
---|
11021 | n.deleteRow(o)
|
---|
11022 | }}
|
---|
11023 | var a=AjxUtil.values(this._rowForgetHash);
|
---|
11024 | for(var o=0,t=a.length;
|
---|
11025 | o<t;
|
---|
11026 | o++){
|
---|
11027 | var e=a[o];
|
---|
11028 | DwtControl.ALL_BY_ID[e]=null;
|
---|
11029 | delete DwtControl.ALL_BY_ID[e]
|
---|
11030 | }};
|
---|
11031 | ZmAutocompleteListView.prototype.size=function(){
|
---|
11032 | return this._getTable().rows.length
|
---|
11033 | };
|
---|
11034 | ZmAutocompleteListView.prototype._autocompleteFocus=function(e){
|
---|
11035 | e.focus()
|
---|
11036 | };
|
---|
11037 | ZmAutocompleteListView.prototype._getAcListLoc=function(a){
|
---|
11038 | var t=a.element;
|
---|
11039 | var i=Dwt.getLocation(t);
|
---|
11040 | var e=Dwt.getSize(t).y;
|
---|
11041 | return(new DwtPoint(i.x,i.y+e))
|
---|
11042 | };
|
---|
11043 | ZmAutocompleteListView.prototype._clearWaiting=function(){
|
---|
11044 | if(this._waitingRow&&this._waitingRow.parentNode){
|
---|
11045 | this._waitingRow.parentNode.removeChild(this._waitingRow)
|
---|
11046 | }
|
---|
11047 | this._waitingRow=null;
|
---|
11048 | if(!this.size()){
|
---|
11049 | this.show(false)
|
---|
11050 | }};
|
---|
11051 | ZmAutocompleteListView.prototype._settingChangeListener=function(e){
|
---|
11052 | if(e.type!=ZmEvent.S_SETTING){
|
---|
11053 | return
|
---|
11054 | }
|
---|
11055 | if(e.source.id==ZmSetting.AUTOCOMPLETE_ON_COMMA){
|
---|
11056 | this._isDelim[","]=this._isDelimCode[188]=appCtxt.get(ZmSetting.AUTOCOMPLETE_ON_COMMA)
|
---|
11057 | }};
|
---|
11058 | ZmAutocompleteListView.prototype._handleForgetLink=function(e,t){
|
---|
11059 | if(this._dataAPI.forget){
|
---|
11060 | this._dataAPI.forget(e,new AjxCallback(this,this._handleResponseForget,[t,e]))
|
---|
11061 | }};
|
---|
11062 | ZmAutocompleteListView.prototype._handleResponseForget=function(t,e){
|
---|
11063 | var i=document.getElementById(t);
|
---|
11064 | if(i){
|
---|
11065 | i.parentNode.removeChild(i);
|
---|
11066 | var a=AjxMessageFormat.format(ZmMsg.forgetSummary,[e]);
|
---|
11067 | appCtxt.setStatusMsg(a)
|
---|
11068 | }}
|
---|
11069 | }
|
---|
11070 | if(AjxPackage.define("zimbraMail.share.view.assistant.ZmAssistant")){
|
---|
11071 | ZmAssistant=function(o,i,t){
|
---|
11072 | if(arguments.length==0){
|
---|
11073 | return
|
---|
11074 | }
|
---|
11075 | this._objectManager=new ZmObjectManager();
|
---|
11076 | try{
|
---|
11077 | if(window.ZmDate10ObjectHandler){
|
---|
11078 | this._objectManager.addHandler(new ZmDate10ObjectHandler(),ZmObjectManager.DATE,100)
|
---|
11079 | }}
|
---|
11080 | catch(a){}
|
---|
11081 | this._fields={};
|
---|
11082 | this._title=o;
|
---|
11083 | this._commandSummary=t?t:o;
|
---|
11084 | this._command=i
|
---|
11085 | };
|
---|
11086 | ZmAssistant.prototype.constructor=ZmAssistant;
|
---|
11087 | ZmAssistant._handlers={};
|
---|
11088 | ZmAssistant._commands=[];
|
---|
11089 | ZmAssistant._allCommands=[];
|
---|
11090 | ZmAssistant.register=function(t,e){
|
---|
11091 | if(e==null){
|
---|
11092 | e=t.getCommand()
|
---|
11093 | }
|
---|
11094 | if(e in ZmAssistant._handlers){
|
---|
11095 | return
|
---|
11096 | }
|
---|
11097 | ZmAssistant._handlers[e]=t;
|
---|
11098 | ZmAssistant._allCommands.push(e);
|
---|
11099 | ZmAssistant._allCommands.sort();
|
---|
11100 | if(e.substring(0,1)!="."){
|
---|
11101 | ZmAssistant._commands.push(e);
|
---|
11102 | ZmAssistant._commands.sort()
|
---|
11103 | }};
|
---|
11104 | ZmAssistant.matchWord=function(a,o){
|
---|
11105 | if(o==null){
|
---|
11106 | o=ZmAssistant._allCommands
|
---|
11107 | }
|
---|
11108 | var t;
|
---|
11109 | var e=[];
|
---|
11110 | for(t in o){
|
---|
11111 | var s=o[t];
|
---|
11112 | if(s==a){
|
---|
11113 | return[s]
|
---|
11114 | }else{
|
---|
11115 | if(s.substring(0,a.length)==a){
|
---|
11116 | e.push(s)
|
---|
11117 | }}}
|
---|
11118 | return e
|
---|
11119 | };
|
---|
11120 | ZmAssistant.getHandler=function(e){
|
---|
11121 | return ZmAssistant._handlers[e]
|
---|
11122 | };
|
---|
11123 | ZmAssistant.getHandlerCommands=function(){
|
---|
11124 | return ZmAssistant._commands
|
---|
11125 | };
|
---|
11126 | ZmAssistant.prototype.initialize=function(t){
|
---|
11127 | var e=new AjxBuffer();
|
---|
11128 | this._tableId=Dwt.getNextId();
|
---|
11129 | e.append("<table cellspacing='3' border='0' width='100%'><tbody id='",this._tableId,"'>");
|
---|
11130 | e.append("</tbody></table>");
|
---|
11131 | t.setAssistantContent(e.toString())
|
---|
11132 | };
|
---|
11133 | ZmAssistant.prototype.finish=function(e){
|
---|
11134 | this._clearFields()
|
---|
11135 | };
|
---|
11136 | ZmAssistant.prototype.getTitle=function(){
|
---|
11137 | return this._title
|
---|
11138 | };
|
---|
11139 | ZmAssistant.prototype.getCommand=function(){
|
---|
11140 | return this._command
|
---|
11141 | };
|
---|
11142 | ZmAssistant.prototype.getCommandSummary=function(){
|
---|
11143 | return this._commandSummary
|
---|
11144 | };
|
---|
11145 | ZmAssistant.prototype.handle=function(t,a,e){};
|
---|
11146 | ZmAssistant.prototype.okHandler=function(e){
|
---|
11147 | return true
|
---|
11148 | };
|
---|
11149 | ZmAssistant.prototype.getHelp=function(){
|
---|
11150 | return null
|
---|
11151 | };
|
---|
11152 | ZmAssistant.prototype.extraButtonHandler=function(e){
|
---|
11153 | return true
|
---|
11154 | };
|
---|
11155 | ZmAssistant.prototype._matchTime=function(a){
|
---|
11156 | var e,o,t=null;
|
---|
11157 | var n=a.match(/\s*(?:(?:@|at|\-)\s*)?(\d+):(\d\d)(?:\s*(AM|PM))?\s*/i);
|
---|
11158 | var i=a.match(/\s*(?:(?:@|at|\-)\s*)?(\d+)(AM|PM)\s*/i);
|
---|
11159 | if(n&&i){
|
---|
11160 | if(n.index<i.index){
|
---|
11161 | i=null
|
---|
11162 | }else{
|
---|
11163 | n=null
|
---|
11164 | }}
|
---|
11165 | if(n){
|
---|
11166 | e=parseInt(n[1]);
|
---|
11167 | o=parseInt(n[2]);
|
---|
11168 | if(n[3]){
|
---|
11169 | t=n[3].toLowerCase()
|
---|
11170 | }
|
---|
11171 | a=a.replace(n[0]," ")
|
---|
11172 | }else{
|
---|
11173 | if(i){
|
---|
11174 | e=parseInt(i[1]);
|
---|
11175 | o=0;
|
---|
11176 | t=i[2].toLowerCase();
|
---|
11177 | a=a.replace(i[0]," ")
|
---|
11178 | }else{
|
---|
11179 | return null
|
---|
11180 | }}
|
---|
11181 | if(t=="pm"&&e<12){
|
---|
11182 | e+=12
|
---|
11183 | }else{
|
---|
11184 | if(t=="am"&&e==12){
|
---|
11185 | e=0
|
---|
11186 | }}
|
---|
11187 | return{
|
---|
11188 | hour:e,minute:o,args:a}
|
---|
11189 | };
|
---|
11190 | ZmAssistant._BRACKETS="ZmAssistantBrackets";
|
---|
11191 | ZmAssistant._PARENS="ZmAssistantParens";
|
---|
11192 | ZmAssistant.prototype._matchTypedObject=function(n,t,a){
|
---|
11193 | var i;
|
---|
11194 | var l=0;
|
---|
11195 | if(t==ZmAssistant._BRACKETS){
|
---|
11196 | i=n.match(/\s*\[([^\]]*)\]?\s*/);
|
---|
11197 | l=1
|
---|
11198 | }else{
|
---|
11199 | i=this._objectManager.findMatch(n,t)
|
---|
11200 | }
|
---|
11201 | if(!i){
|
---|
11202 | return null
|
---|
11203 | }
|
---|
11204 | var s=a.defaultType;
|
---|
11205 | var e=null;
|
---|
11206 | if(i.index>0){
|
---|
11207 | var o=n.substring(0,i.index);
|
---|
11208 | e=o.match(/\b(\w+):\s*$/i);
|
---|
11209 | if(e){
|
---|
11210 | s=e[1].toLowerCase()
|
---|
11211 | }}
|
---|
11212 | if(e){
|
---|
11213 | n=n.replace(e[0]+i[0]," ")
|
---|
11214 | }else{
|
---|
11215 | n=n.replace(i[0]," ")
|
---|
11216 | }
|
---|
11217 | if(a.aliases){
|
---|
11218 | var h=a.aliases[s];
|
---|
11219 | if(h){
|
---|
11220 | s=h
|
---|
11221 | }}
|
---|
11222 | return{
|
---|
11223 | data:i[l],args:n,type:s}
|
---|
11224 | };
|
---|
11225 | ZmAssistant.prototype._clearField=function(a){
|
---|
11226 | var t=this._fields[a];
|
---|
11227 | if(t){
|
---|
11228 | var e=document.getElementById(t.rowId);
|
---|
11229 | if(e){
|
---|
11230 | e.parentNode.removeChild(e)
|
---|
11231 | }
|
---|
11232 | delete this._fields[a]
|
---|
11233 | }};
|
---|
11234 | ZmAssistant.prototype._setOptField=function(n,i,a,o,t,e){
|
---|
11235 | if(i&&i!=""){
|
---|
11236 | return this._setField(n,i,a,o,t,e)
|
---|
11237 | }else{
|
---|
11238 | this._clearField(n);
|
---|
11239 | return -1
|
---|
11240 | }};
|
---|
11241 | ZmAssistant.prototype._setField=function(u,f,o,h,c,n){
|
---|
11242 | var s=o?"ZmAsstFieldDefValue":"ZmAsstField";
|
---|
11243 | var l=-1;
|
---|
11244 | var t=this._fields[u];
|
---|
11245 | if(h){
|
---|
11246 | f=AjxStringUtil.htmlEncode(f)
|
---|
11247 | }
|
---|
11248 | if(t){
|
---|
11249 | var i=document.getElementById(t.rowId);
|
---|
11250 | if(i){
|
---|
11251 | l=i.rowIndex
|
---|
11252 | }
|
---|
11253 | var p=document.getElementById(t.id);
|
---|
11254 | p.innerHTML=f;
|
---|
11255 | p.className=s
|
---|
11256 | }else{
|
---|
11257 | var e=Dwt.getNextId();
|
---|
11258 | if(c!=null){
|
---|
11259 | l=c
|
---|
11260 | }
|
---|
11261 | var a=document.getElementById(this._tableId);
|
---|
11262 | var g=a.insertRow(l);
|
---|
11263 | g.id=Dwt.getNextId();
|
---|
11264 | var m=g.insertCell(-1);
|
---|
11265 | m.vAlign=n?n:"top";
|
---|
11266 | m.className="ZmAsstFieldLabel";
|
---|
11267 | m.innerHTML=AjxStringUtil.htmlEncode(u+":");
|
---|
11268 | var d=g.insertCell(-1);
|
---|
11269 | d.innerHTML="<div id='"+e+"' class='"+s+"'>"+f+"</div></td>";
|
---|
11270 | this._fields[u]={
|
---|
11271 | id:e,rowId:g.id};
|
---|
11272 | l=g.rowIndex
|
---|
11273 | }
|
---|
11274 | return l
|
---|
11275 | };
|
---|
11276 | ZmAssistant.prototype._clearFields=function(){
|
---|
11277 | for(var e in this._fields){
|
---|
11278 | this._clearField(e)
|
---|
11279 | }}
|
---|
11280 | }
|
---|
11281 | if(AjxPackage.define("zimbraMail.share.view.htmlEditor.ZmHtmlEditor")){
|
---|
11282 | ZmHtmlEditor=function(i,a,o,s,e){
|
---|
11283 | if(arguments.length==0){
|
---|
11284 | return
|
---|
11285 | }
|
---|
11286 | this._toolbars=[];
|
---|
11287 | this.ACE_ENABLED=!!e;
|
---|
11288 | this.ACE_DEBUG=false;
|
---|
11289 | if(this.ACE_ENABLED){
|
---|
11290 | this._ace_componentsLoading=0
|
---|
11291 | }
|
---|
11292 | DwtHtmlEditor.call(this,{
|
---|
11293 | parent:i,className:"ZmHtmlEditor",posStyle:a,content:o,mode:s,blankIframeSrc:appContextPath+"/public/blank.html"}
|
---|
11294 | );
|
---|
11295 | this.addStateChangeListener(new AjxListener(this,this._rteStateChangeListener));
|
---|
11296 | var t=appCtxt.getSettings();
|
---|
11297 | var n=new AjxListener(this,this._settingChangeListener);
|
---|
11298 | t.getSetting(ZmSetting.COMPOSE_INIT_FONT_COLOR).addChangeListener(n);
|
---|
11299 | t.getSetting(ZmSetting.COMPOSE_INIT_FONT_FAMILY).addChangeListener(n);
|
---|
11300 | t.getSetting(ZmSetting.COMPOSE_INIT_FONT_SIZE).addChangeListener(n);
|
---|
11301 | this._ignoreWords={}
|
---|
11302 | };
|
---|
11303 | ZmHtmlEditor.prototype=new DwtHtmlEditor;
|
---|
11304 | ZmHtmlEditor.prototype.constructor=ZmHtmlEditor;
|
---|
11305 | ZmHtmlEditor._VALUE="value";
|
---|
11306 | ZmHtmlEditor.FONT_SIZE_VALUES=["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
|
---|
11307 | ZmHtmlEditor.__makeFontName=function(e){
|
---|
11308 | return e.replace(/,.*/,"").replace(/\b[a-z]/g,ZmHtmlEditor.__toUpperCase)
|
---|
11309 | };
|
---|
11310 | ZmHtmlEditor.__toUpperCase=function(e){
|
---|
11311 | return e.toUpperCase()
|
---|
11312 | };
|
---|
11313 | ZmHtmlEditor.FONT_FAMILY={};
|
---|
11314 | (function(){
|
---|
11315 | var e=["fontFamilyIntl","fontFamilyBase"];
|
---|
11316 | var n,a,o,s,t;
|
---|
11317 | for(a=0;
|
---|
11318 | a<e.length;
|
---|
11319 | a++){
|
---|
11320 | for(n=1;
|
---|
11321 | s=AjxMsg[e[a]+n+".css"];
|
---|
11322 | n++){
|
---|
11323 | if(s.match(/^#+$/)){
|
---|
11324 | break
|
---|
11325 | }
|
---|
11326 | t=AjxMsg[e[a]+n+".display"];
|
---|
11327 | ZmHtmlEditor.FONT_FAMILY[s]={
|
---|
11328 | name:t,value:s}
|
---|
11329 | }}}
|
---|
11330 | )();
|
---|
11331 | ZmHtmlEditor.ACE_IFRAME_RE=new RegExp("<iframe\\s+.*?\\bid\\s*=\\s*[\"']?(ace-[^\"'\\s]*).*?>.*?</iframe(\\s.*?)?>","ig");
|
---|
11332 | ZmHtmlEditor.prototype.toString=function(){
|
---|
11333 | return"ZmHtmlEditor"
|
---|
11334 | };
|
---|
11335 | ZmHtmlEditor.prototype.isHtmlEditingSupported=function(){
|
---|
11336 | var e=DwtHtmlEditor.prototype.isHtmlEditingSupported.call(this);
|
---|
11337 | if(e){
|
---|
11338 | e=appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)
|
---|
11339 | }
|
---|
11340 | return e
|
---|
11341 | };
|
---|
11342 | ZmHtmlEditor.prototype.setContent=function(e){
|
---|
11343 | DwtHtmlEditor.prototype.setContent.apply(this,arguments);
|
---|
11344 | this._ignoreWords={}
|
---|
11345 | };
|
---|
11346 | ZmHtmlEditor.prototype.setMode=function(o,a){
|
---|
11347 | this.discardMisspelledWords();
|
---|
11348 | DwtHtmlEditor.prototype.setMode.call(this,o,a);
|
---|
11349 | if(o==DwtHtmlEditor.HTML){
|
---|
11350 | this._createToolbars()
|
---|
11351 | }
|
---|
11352 | for(var e=0;
|
---|
11353 | e<this._toolbars.length;
|
---|
11354 | e++){
|
---|
11355 | var t=this._toolbars[e];
|
---|
11356 | t.setVisible(o==DwtHtmlEditor.HTML)
|
---|
11357 | }
|
---|
11358 | appCtxt.notifyZimlets("on_htmlEditor_setMode",[this,o])
|
---|
11359 | };
|
---|
11360 | ZmHtmlEditor.prototype.getBodyFieldId=function(){
|
---|
11361 | return this._mode==DwtHtmlEditor.HTML?this._iFrameId:this._textAreaId
|
---|
11362 | };
|
---|
11363 | ZmHtmlEditor.prototype.getTextVersion=function(e){
|
---|
11364 | return this._mode==DwtHtmlEditor.HTML?this._convertHtml2Text(e):this.getContent()
|
---|
11365 | };
|
---|
11366 | ZmHtmlEditor.prototype.reEnableDesignMode=function(){
|
---|
11367 | if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
|
---|
11368 | this._enableDesignMode(this._getIframeDoc())
|
---|
11369 | }};
|
---|
11370 | ZmHtmlEditor.prototype.addEventCallback=function(e){
|
---|
11371 | this._eventCallback=e
|
---|
11372 | };
|
---|
11373 | ZmHtmlEditor.prototype._onContentInitialized=function(){
|
---|
11374 | DwtHtmlEditor.prototype._onContentInitialized.call(this);
|
---|
11375 | this._loadExternalStyle("/css/editor.css");
|
---|
11376 | this._setFontStyles();
|
---|
11377 | if(this.ACE_ENABLED&&this._mode==DwtHtmlEditor.HTML){
|
---|
11378 | setTimeout(AjxCallback.simpleClosure(this._deserializeAceObjects,this),100)
|
---|
11379 | }
|
---|
11380 | if(this._onContentInitializeCallback){
|
---|
11381 | this._onContentInitializeCallback.run()
|
---|
11382 | }};
|
---|
11383 | ZmHtmlEditor.prototype.addOnContentIntializedListener=function(e){
|
---|
11384 | this._onContentInitializeCallback=e
|
---|
11385 | };
|
---|
11386 | ZmHtmlEditor.prototype.removeOnContentIntializedListener=function(){
|
---|
11387 | this._onContentInitializeCallback=null
|
---|
11388 | };
|
---|
11389 | ZmHtmlEditor.prototype.getContent=function(e,a){
|
---|
11390 | this.discardMisspelledWords();
|
---|
11391 | var i;
|
---|
11392 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
11393 | var o=this._getIframeDoc();
|
---|
11394 | var t=this._pendingContent||(o&&o.body?(this._getIframeDoc().body.innerHTML):"");
|
---|
11395 | i=this._embedHtmlContent(t,e,a);
|
---|
11396 | if(this.ACE_ENABLED){
|
---|
11397 | i=this._serializeAceObjects(i)
|
---|
11398 | }}else{
|
---|
11399 | i=document.getElementById(this._textAreaId).value
|
---|
11400 | }
|
---|
11401 | return i
|
---|
11402 | };
|
---|
11403 | ZmHtmlEditor.prototype.checkMisspelledWords=function(o,t,e){
|
---|
11404 | var i=this.getTextVersion();
|
---|
11405 | if(/\S/.test(i)){
|
---|
11406 | AjxDispatcher.require("Extras");
|
---|
11407 | this._spellChecker=new ZmSpellChecker(this);
|
---|
11408 | this._spellCheck=null;
|
---|
11409 | this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
|
---|
11410 | if(!this.onExitSpellChecker){
|
---|
11411 | this.onExitSpellChecker=t
|
---|
11412 | }
|
---|
11413 | var a={
|
---|
11414 | text:i,ignore:AjxUtil.keys(this._ignoreWords).join()};
|
---|
11415 | this._spellChecker.check(a,o,e);
|
---|
11416 | return true
|
---|
11417 | }
|
---|
11418 | return false
|
---|
11419 | };
|
---|
11420 | ZmHtmlEditor.prototype.spellCheck=function(a){
|
---|
11421 | var t=this.getTextVersion();
|
---|
11422 | if(/\S/.test(t)){
|
---|
11423 | AjxDispatcher.require("Extras");
|
---|
11424 | this._spellChecker=new ZmSpellChecker(this);
|
---|
11425 | this._spellCheck=null;
|
---|
11426 | this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
|
---|
11427 | if(!this.onExitSpellChecker){
|
---|
11428 | this.onExitSpellChecker=a
|
---|
11429 | }
|
---|
11430 | var e={
|
---|
11431 | text:t,ignore:AjxUtil.keys(this._ignoreWords).join()};
|
---|
11432 | this._spellChecker.check(e,new AjxCallback(this,this._spellCheckCallback));
|
---|
11433 | return true
|
---|
11434 | }
|
---|
11435 | return false
|
---|
11436 | };
|
---|
11437 | ZmHtmlEditor.prototype.resetSpellCheck=function(){
|
---|
11438 | this.discardMisspelledWords();
|
---|
11439 | this._spellCheckHideModeDiv()
|
---|
11440 | };
|
---|
11441 | ZmHtmlEditor.prototype.discardMisspelledWords=function(c){
|
---|
11442 | if(!this._spellCheck){
|
---|
11443 | return
|
---|
11444 | }
|
---|
11445 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
11446 | var s=this._getIframeDoc();
|
---|
11447 | s.body.style.display="none";
|
---|
11448 | var t=null;
|
---|
11449 | var h=this._spellCheck.spanIds;
|
---|
11450 | for(var n in h){
|
---|
11451 | var l=s.getElementById(n);
|
---|
11452 | if(!l){
|
---|
11453 | continue
|
---|
11454 | }
|
---|
11455 | t=l.parentNode;
|
---|
11456 | while(l.firstChild){
|
---|
11457 | t.insertBefore(l.firstChild,l)
|
---|
11458 | }
|
---|
11459 | t.removeChild(l)
|
---|
11460 | }
|
---|
11461 | if(!AjxEnv.isIE){
|
---|
11462 | s.body.normalize()
|
---|
11463 | }else{
|
---|
11464 | s.body.innerHTML=s.body.innerHTML
|
---|
11465 | }
|
---|
11466 | t=s.getElementById("ZM-SPELLCHECK-STYLE");
|
---|
11467 | if(t){
|
---|
11468 | t.parentNode.removeChild(t)
|
---|
11469 | }
|
---|
11470 | s.body.style.display="";
|
---|
11471 | this._unregisterEditorEventHandler(s,"contextmenu")
|
---|
11472 | }else{
|
---|
11473 | if(this._spellCheckDivId!=null){
|
---|
11474 | var e=document.getElementById(this._spellCheckDivId);
|
---|
11475 | var o=e.scrollTop;
|
---|
11476 | var a=document.getElementById(this._textAreaId);
|
---|
11477 | if(AjxEnv.isGeckoBased){
|
---|
11478 | e.innerHTML=AjxStringUtil.htmlDecode(e.innerHTML,true)
|
---|
11479 | }
|
---|
11480 | a.value=AjxUtil.getInnerText(e);
|
---|
11481 | e.onclick=null;
|
---|
11482 | e.oncontextmenu=null;
|
---|
11483 | e.onmousedown=null;
|
---|
11484 | e.parentNode.removeChild(e);
|
---|
11485 | a.style.display="";
|
---|
11486 | a.scrollTop=o
|
---|
11487 | }}
|
---|
11488 | this._spellCheckDivId=this._spellCheck=null;
|
---|
11489 | window.status="";
|
---|
11490 | if(!c){
|
---|
11491 | this._spellCheckHideModeDiv()
|
---|
11492 | }
|
---|
11493 | if(this.onExitSpellChecker){
|
---|
11494 | this.onExitSpellChecker.run()
|
---|
11495 | }};
|
---|
11496 | ZmHtmlEditor.prototype._resetFormatControls=function(){
|
---|
11497 | this._resetFormatControlDefaults();
|
---|
11498 | setTimeout(AjxCallback.simpleClosure(this._loadExternalStyle,this,"/css/editor.css"),250);
|
---|
11499 | setTimeout(AjxCallback.simpleClosure(this._setFontStyles,this),250)
|
---|
11500 | };
|
---|
11501 | ZmHtmlEditor.prototype._resetFormatControlDefaults=function(){
|
---|
11502 | this._fontFamilyButton.setText(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY));
|
---|
11503 | this._fontSizeButton.setText(this._getFontSizeLabel(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE)));
|
---|
11504 | this._fontColorButton.setColor(appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR));
|
---|
11505 | this._styleMenu.checkItem(ZmHtmlEditor._VALUE,DwtHtmlEditor.PARAGRAPH,true);
|
---|
11506 | this._justifyMenu.checkItem(ZmHtmlEditor._VALUE,DwtHtmlEditor.JUSTIFY_LEFT,true)
|
---|
11507 | };
|
---|
11508 | ZmHtmlEditor.prototype._loadExternalStyle=function(n){
|
---|
11509 | var o=this._getIframeDoc();
|
---|
11510 | var a=o.getElementById(n);
|
---|
11511 | if(!a){
|
---|
11512 | a=o.createElement("link");
|
---|
11513 | a.id=n;
|
---|
11514 | a.rel="stylesheet";
|
---|
11515 | a.type="text/css";
|
---|
11516 | var i=appContextPath+n+"?v="+cacheKillerVersion;
|
---|
11517 | if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
|
---|
11518 | i=document.baseURI.replace(/^(https?:\x2f\x2f[^\x2f]+).*$/,"$1")+i
|
---|
11519 | }
|
---|
11520 | var e=DBG&&DBG.getDebugLevel();
|
---|
11521 | if(e){
|
---|
11522 | i=i+"&debug="+e
|
---|
11523 | }
|
---|
11524 | a.href=i;
|
---|
11525 | var t=o.getElementsByTagName("head")[0];
|
---|
11526 | if(!t){
|
---|
11527 | t=o.createElement("head");
|
---|
11528 | var s=o.documentElement;
|
---|
11529 | if(s){
|
---|
11530 | s.insertBefore(t,s.firstChild)
|
---|
11531 | }}
|
---|
11532 | t.appendChild(a)
|
---|
11533 | }};
|
---|
11534 | ZmHtmlEditor.prototype._setFontStyles=function(){
|
---|
11535 | var t=this._getIframeDoc();
|
---|
11536 | var e=t.body&&t.body.style;
|
---|
11537 | if(e){
|
---|
11538 | e.fontFamily=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
|
---|
11539 | e.fontSize=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
|
---|
11540 | e.color=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR)
|
---|
11541 | }};
|
---|
11542 | ZmHtmlEditor.prototype.highlightMisspelledWords=function(u,t){
|
---|
11543 | this.discardMisspelledWords(t);
|
---|
11544 | var y,p,w,o,d=this,n={}
|
---|
11545 | ,m={}
|
---|
11546 | ,v=["([^A-Za-z0-9']|^)("],l={};
|
---|
11547 | for(var f=0;
|
---|
11548 | f<u.length;
|
---|
11549 | ++f){
|
---|
11550 | y=u[f].word;
|
---|
11551 | if(!l[y]){
|
---|
11552 | f&&v.push("|");
|
---|
11553 | v.push(y);
|
---|
11554 | var b=u[f].suggestions.split(/\s*,\s*/);
|
---|
11555 | if(!b[b.length-1]){
|
---|
11556 | b.pop()
|
---|
11557 | }
|
---|
11558 | l[y]=b;
|
---|
11559 | if(l[y].length>5){
|
---|
11560 | l[y].length=5
|
---|
11561 | }}}
|
---|
11562 | v.push(")([^A-Za-z0-9']|$)");
|
---|
11563 | v=new RegExp(v.join(""),"gm");
|
---|
11564 | function h(z,O){
|
---|
11565 | z=O?AjxStringUtil.convertToHtml(z):AjxStringUtil.htmlEncode(z);
|
---|
11566 | var k;
|
---|
11567 | v.lastIndex=0;
|
---|
11568 | while(k=v.exec(z)){
|
---|
11569 | var j=k[0];
|
---|
11570 | var x=k[1];
|
---|
11571 | var a=k[2];
|
---|
11572 | var T=k[3];
|
---|
11573 | var i=Dwt.getNextId();
|
---|
11574 | n[i]=a;
|
---|
11575 | if(!m[a]){
|
---|
11576 | m[a]=[]
|
---|
11577 | }
|
---|
11578 | m[a].push(i);
|
---|
11579 | var q=[x,'<span word="',a,'" id="',i,'" class="ZM-SPELLCHECK-MISSPELLED">',a,"</span>",T].join("");
|
---|
11580 | z=[z.substr(0,k.index),q,z.substr(k.index+j.length)].join("");
|
---|
11581 | v.lastIndex=k.index+q.length-T.length
|
---|
11582 | }
|
---|
11583 | return z
|
---|
11584 | }
|
---|
11585 | var w;
|
---|
11586 | rec=function(z){
|
---|
11587 | switch(z.nodeType){
|
---|
11588 | case 1:for(var j=z.firstChild;
|
---|
11589 | j;
|
---|
11590 | j=rec(j)){}
|
---|
11591 | z=z.nextSibling;
|
---|
11592 | break;
|
---|
11593 | case 3:if(!/[^\s\xA0]/.test(z.data)){
|
---|
11594 | z=z.nextSibling;
|
---|
11595 | break
|
---|
11596 | }
|
---|
11597 | var q=null,x=null;
|
---|
11598 | var k=/^[\s\xA0]+/.exec(z.data);
|
---|
11599 | if(k){
|
---|
11600 | q=z;
|
---|
11601 | z=z.splitText(k[0].length)
|
---|
11602 | }
|
---|
11603 | k=/[\s\xA0]+$/.exec(z.data);
|
---|
11604 | if(k){
|
---|
11605 | x=z.splitText(z.data.length-k[0].length)
|
---|
11606 | }
|
---|
11607 | var O=h(z.data,false);
|
---|
11608 | O=O.replace(/^ +/," ").replace(/ +$/," ");
|
---|
11609 | var A=w.createElement("div");
|
---|
11610 | A.innerHTML=O;
|
---|
11611 | if(q){
|
---|
11612 | A.insertBefore(q,A.firstChild)
|
---|
11613 | }
|
---|
11614 | if(x){
|
---|
11615 | A.appendChild(x)
|
---|
11616 | }
|
---|
11617 | var T=z.parentNode;
|
---|
11618 | while(A.firstChild){
|
---|
11619 | T.insertBefore(A.firstChild,z)
|
---|
11620 | }
|
---|
11621 | A=z.nextSibling;
|
---|
11622 | T.removeChild(z);
|
---|
11623 | z=A;
|
---|
11624 | break;
|
---|
11625 | default:z=z.nextSibling
|
---|
11626 | }
|
---|
11627 | return z
|
---|
11628 | };
|
---|
11629 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
11630 | w=this._getIframeDoc();
|
---|
11631 | o=w.body;
|
---|
11632 | this._loadExternalStyle("/css/spellcheck.css");
|
---|
11633 | o.style.display="none";
|
---|
11634 | if(!AjxEnv.isIE){
|
---|
11635 | o.normalize()
|
---|
11636 | }else{
|
---|
11637 | o.innerHTML=o.innerHTML
|
---|
11638 | }
|
---|
11639 | rec(o);
|
---|
11640 | if(!AjxEnv.isIE){
|
---|
11641 | o.normalize()
|
---|
11642 | }else{
|
---|
11643 | o.innerHTML=o.innerHTML
|
---|
11644 | }
|
---|
11645 | o.style.display="";
|
---|
11646 | this._registerEditorEventHandler(w,"contextmenu")
|
---|
11647 | }else{
|
---|
11648 | var g=document.getElementById(this._textAreaId);
|
---|
11649 | var e=g.scrollTop;
|
---|
11650 | var c=Dwt.getSize(g);
|
---|
11651 | g.style.display="none";
|
---|
11652 | var s=document.createElement("div");
|
---|
11653 | s.className="TextSpellChecker";
|
---|
11654 | this._spellCheckDivId=s.id=Dwt.getNextId();
|
---|
11655 | s.style.overflow="auto";
|
---|
11656 | if(!AjxEnv.isIE){
|
---|
11657 | c.x-=4;
|
---|
11658 | c.y-=6
|
---|
11659 | }
|
---|
11660 | s.style.width=c.x+"px";
|
---|
11661 | s.style.height=c.y+"px";
|
---|
11662 | s.innerHTML=AjxStringUtil.convertToHtml(this.getContent());
|
---|
11663 | w=document;
|
---|
11664 | rec(s);
|
---|
11665 | g.parentNode.insertBefore(s,g);
|
---|
11666 | s.scrollTop=e;
|
---|
11667 | s.oncontextmenu=s.onclick=function(a){
|
---|
11668 | d._handleSpellCheckerEvents(a||window.event)
|
---|
11669 | }
|
---|
11670 | }
|
---|
11671 | this._spellCheckShowModeDiv();
|
---|
11672 | this._spellCheck={
|
---|
11673 | suggestions:l,spanIds:n,wordIds:m}
|
---|
11674 | };
|
---|
11675 | ZmHtmlEditor.prototype.setSize=function(t,l){
|
---|
11676 | var h=this._spellCheckDivId&&document.getElementById(this._spellCheckDivId);
|
---|
11677 | var e=document.getElementById(this.getBodyFieldId());
|
---|
11678 | var s=this._mode==DwtHtmlEditor.HTML?8:10;
|
---|
11679 | if(t==Dwt.CLEAR){
|
---|
11680 | e.style.width=null;
|
---|
11681 | if(h){
|
---|
11682 | h.style.width=null
|
---|
11683 | }}else{
|
---|
11684 | if(t==Dwt.DEFAULT){
|
---|
11685 | e.style.width="auto";
|
---|
11686 | if(h){
|
---|
11687 | h.style.width="auto"
|
---|
11688 | }}else{
|
---|
11689 | if(typeof(t)=="number"){
|
---|
11690 | t-=s+4;
|
---|
11691 | if(t<0){
|
---|
11692 | t=0
|
---|
11693 | }
|
---|
11694 | e.style.width=t+5+"px";
|
---|
11695 | if(h){
|
---|
11696 | if(!AjxEnv.isIE){
|
---|
11697 | t=t>4?(t-4):t
|
---|
11698 | }
|
---|
11699 | h.style.width=t+"px"
|
---|
11700 | }}}}
|
---|
11701 | if(l==Dwt.CLEAR){
|
---|
11702 | e.style.height=null;
|
---|
11703 | if(h){
|
---|
11704 | h.style.height=null
|
---|
11705 | }}else{
|
---|
11706 | if(l==Dwt.DEFAULT){
|
---|
11707 | e.style.height="auto";
|
---|
11708 | if(h){
|
---|
11709 | h.style.height="auto"
|
---|
11710 | }}else{
|
---|
11711 | if(typeof(l)=="number"){
|
---|
11712 | if(this._spellCheckModeDivId){
|
---|
11713 | var a=document.getElementById(this._spellCheckModeDivId).offsetHeight;
|
---|
11714 | l-=(isNaN(a)?0:a)
|
---|
11715 | }
|
---|
11716 | if(this._mode==DwtHtmlEditor.HTML&&this._toolbars.length>0){
|
---|
11717 | for(var o=0;
|
---|
11718 | o<this._toolbars.length;
|
---|
11719 | o++){
|
---|
11720 | var n=this._toolbars[o];
|
---|
11721 | l-=n.getHtmlElement().offsetHeight
|
---|
11722 | }}
|
---|
11723 | l-=s;
|
---|
11724 | if(l<0){
|
---|
11725 | l=0
|
---|
11726 | }
|
---|
11727 | e.style.height=l+"px";
|
---|
11728 | if(h){
|
---|
11729 | if(!AjxEnv.isIE){
|
---|
11730 | l=l>4?(l-4):l
|
---|
11731 | }else{
|
---|
11732 | l+=2
|
---|
11733 | }
|
---|
11734 | h.style.height=l+"px"
|
---|
11735 | }}}}};
|
---|
11736 | ZmHtmlEditor.prototype._initialize=function(){
|
---|
11737 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
11738 | this._createToolbars()
|
---|
11739 | }
|
---|
11740 | DwtHtmlEditor.prototype._initialize.call(this)
|
---|
11741 | };
|
---|
11742 | ZmHtmlEditor.prototype._styleListener=function(e){
|
---|
11743 | this.setStyle(e.item.getData(ZmHtmlEditor._VALUE))
|
---|
11744 | };
|
---|
11745 | ZmHtmlEditor.prototype._fontFamilyListener=function(e){
|
---|
11746 | var t=e.item.getData(ZmHtmlEditor._VALUE);
|
---|
11747 | this.setFont(ZmHtmlEditor.FONT_FAMILY[t].value);
|
---|
11748 | this._fontFamilyButton.setText(ZmHtmlEditor.FONT_FAMILY[t].name)
|
---|
11749 | };
|
---|
11750 | ZmHtmlEditor.prototype._fontSizeListener=function(e){
|
---|
11751 | this.setFont(null,null,e.item.getData(ZmHtmlEditor._VALUE))
|
---|
11752 | };
|
---|
11753 | ZmHtmlEditor.prototype._indentListener=function(e){
|
---|
11754 | this.setIndent(e.item.getData(ZmHtmlEditor._VALUE))
|
---|
11755 | };
|
---|
11756 | ZmHtmlEditor.prototype._insertLinkListener=function(){
|
---|
11757 | var o=this._insertLinkDialog;
|
---|
11758 | if(!o){
|
---|
11759 | o=this._insertLinkDialog=new DwtDialog({
|
---|
11760 | parent:DwtShell.getShell(window),title:ZmMsg.linkProperties}
|
---|
11761 | );
|
---|
11762 | var n=o.base_id=Dwt.getNextId();
|
---|
11763 | var a=AjxTemplate.expand("share.Dialogs#EditorInsertLink",{
|
---|
11764 | id:n}
|
---|
11765 | );
|
---|
11766 | o.setContent(a);
|
---|
11767 | o.linkText=new DwtInputField({
|
---|
11768 | parent:o,size:40,parentElement:n+"_linkTextCont"}
|
---|
11769 | );
|
---|
11770 | o.linkTarget=new DwtInputField({
|
---|
11771 | parent:o,size:40,parentElement:n+"_linkTargetCont"}
|
---|
11772 | );
|
---|
11773 | function e(){
|
---|
11774 | var s=o.linkTarget.getValue();
|
---|
11775 | if(s&&!/^(https?|ftp):\x2f\x2f/i.test(s)){
|
---|
11776 | s="http://"+s;
|
---|
11777 | o.linkTarget.setValue(s)
|
---|
11778 | }
|
---|
11779 | return s
|
---|
11780 | }
|
---|
11781 | var t=new DwtButton({
|
---|
11782 | parent:o,parentElement:n+"_testBtnCont"}
|
---|
11783 | );
|
---|
11784 | t.setText(ZmMsg.testUrl);
|
---|
11785 | t.setToolTipContent(ZmMsg.testUrlTooltip);
|
---|
11786 | t.addSelectionListener(new AjxListener(this,function(){
|
---|
11787 | var s=e();
|
---|
11788 | if(s){
|
---|
11789 | window.open(s)
|
---|
11790 | }}
|
---|
11791 | ));
|
---|
11792 | o._tabGroup.addMember(o.linkText,0);
|
---|
11793 | o._tabGroup.addMember(o.linkTarget,1);
|
---|
11794 | o._tabGroup.addMember(t,2);
|
---|
11795 | o.registerCallback(DwtDialog.OK_BUTTON,new AjxListener(this,function(){
|
---|
11796 | var h=e();
|
---|
11797 | var s=this.getNearestElement("img");
|
---|
11798 | var l=o.linkText.getValue()||h;
|
---|
11799 | if(s){
|
---|
11800 | var l=o.linkText.getValue()
|
---|
11801 | }
|
---|
11802 | o.popdown();
|
---|
11803 | this.insertLink({
|
---|
11804 | text:l,url:h}
|
---|
11805 | )
|
---|
11806 | }
|
---|
11807 | ))
|
---|
11808 | }
|
---|
11809 | var i=this.getLinkProps();
|
---|
11810 | o.linkText.setValue(i.text||"");
|
---|
11811 | o.linkTarget.setValue(i.url||"");
|
---|
11812 | o.popup();
|
---|
11813 | if(/\S/.test(i.text)){
|
---|
11814 | o.linkTarget.focus()
|
---|
11815 | }else{
|
---|
11816 | o.linkText.focus()
|
---|
11817 | }};
|
---|
11818 | ZmHtmlEditor.prototype._insElementListener=function(e){
|
---|
11819 | this.insertElement(e.item.getData(ZmHtmlEditor._VALUE))
|
---|
11820 | };
|
---|
11821 | ZmHtmlEditor.prototype._justificationListener=function(e){
|
---|
11822 | this.setJustification(e.item.getData(ZmHtmlEditor._VALUE))
|
---|
11823 | };
|
---|
11824 | ZmHtmlEditor.prototype._fontStyleListener=function(e){
|
---|
11825 | this.setFont(null,e.item.getData(ZmHtmlEditor._VALUE))
|
---|
11826 | };
|
---|
11827 | ZmHtmlEditor.prototype._fontColorListener=function(e){
|
---|
11828 | this.setFont(null,null,null,e.detail||"#000000")
|
---|
11829 | };
|
---|
11830 | ZmHtmlEditor.prototype._fontHiliteListener=function(e){
|
---|
11831 | this.setFont(null,null,null,null,e.detail||"#ffffff")
|
---|
11832 | };
|
---|
11833 | ZmHtmlEditor.prototype._createToolbars=function(t){
|
---|
11834 | if(!this._toolbar1){
|
---|
11835 | var e=this._toolbar1=new DwtToolBar({
|
---|
11836 | parent:this,className:"ZToolbar",posStyle:DwtControl.RELATIVE_STYLE,cellSpacing:2,index:0}
|
---|
11837 | );
|
---|
11838 | e.setVisible(this._mode==DwtHtmlEditor.HTML);
|
---|
11839 | if(!t){
|
---|
11840 | this._createToolBar1(e);
|
---|
11841 | new DwtControl({
|
---|
11842 | parent:e,className:"vertSep"}
|
---|
11843 | );
|
---|
11844 | this._createToolBar2(e);
|
---|
11845 | this._resetFormatControls()
|
---|
11846 | }
|
---|
11847 | this._toolbars.push(e)
|
---|
11848 | }};
|
---|
11849 | ZmHtmlEditor.prototype._createToolBar1=function(e){
|
---|
11850 | this._createFontFamilyMenu(e);
|
---|
11851 | this._createFontSizeMenu(e);
|
---|
11852 | this._createStyleMenu(e);
|
---|
11853 | this._createJustifyMenu(e);
|
---|
11854 | new DwtControl({
|
---|
11855 | parent:e,className:"vertSep"}
|
---|
11856 | );
|
---|
11857 | this._createListMenu(e);
|
---|
11858 | this._createIndentMenu(e);
|
---|
11859 | new DwtControl({
|
---|
11860 | parent:e,className:"vertSep"}
|
---|
11861 | );
|
---|
11862 | this._createBUIButtons(e);
|
---|
11863 | appCtxt.notifyZimlets("on_htmlEditor_createToolbar1",[this,e])
|
---|
11864 | };
|
---|
11865 | ZmHtmlEditor.prototype._createToolBar2=function(e){
|
---|
11866 | this._createFontColorButtons(e);
|
---|
11867 | new DwtControl({
|
---|
11868 | parent:e,className:"vertSep"}
|
---|
11869 | );
|
---|
11870 | this._createHorizRuleButton(e);
|
---|
11871 | this._createUrlButton(e);
|
---|
11872 | this._createTableMenu(e);
|
---|
11873 | if(this.ACE_ENABLED){
|
---|
11874 | this._createSpreadSheetButton(e)
|
---|
11875 | }
|
---|
11876 | appCtxt.notifyZimlets("on_htmlEditor_createToolbar2",[this,e])
|
---|
11877 | };
|
---|
11878 | ZmHtmlEditor.prototype.__createTableOperationItems=function(e){
|
---|
11879 | var h=new AjxListener(this,this._tableOperationsListener);
|
---|
11880 | var s=["tableProperties...","cellProperties...",null,"insertRowAbove","insertRowUnder","deleteRow",null,"insertColumnBefore","insertColumnAfter","deleteColumn",null];
|
---|
11881 | if(AjxEnv.isGeckoBased){
|
---|
11882 | s.push("mergeCells","splitCells",null)
|
---|
11883 | }
|
---|
11884 | s.push("deleteTable");
|
---|
11885 | var a=["TableProperties","CellProperties",null,"InsertRowBefore","InsertRowAfter","DeleteRow",null,"InsertColBefore","InsertColAfter","DeleteCol",null,"MergeCells","SplitCells",null,"DeleteTable"];
|
---|
11886 | e._tblItems={};
|
---|
11887 | for(var n=0;
|
---|
11888 | n<s.length;
|
---|
11889 | ++n){
|
---|
11890 | var t=s[n];
|
---|
11891 | if(t==null){
|
---|
11892 | new DwtMenuItem({
|
---|
11893 | parent:e,style:DwtMenuItem.SEPARATOR_STYLE}
|
---|
11894 | )
|
---|
11895 | }else{
|
---|
11896 | var l="";
|
---|
11897 | if(/\.\.\.$/.test(t)){
|
---|
11898 | t=t.substr(0,t.length-3);
|
---|
11899 | l="…"
|
---|
11900 | }
|
---|
11901 | var c=new DwtMenuItem({
|
---|
11902 | parent:e}
|
---|
11903 | );
|
---|
11904 | e._tblItems[t]=c;
|
---|
11905 | var o=ZmMsg[t]||t;
|
---|
11906 | c.setText(o+l);
|
---|
11907 | if(a[n]){
|
---|
11908 | c.setImage(a[n])
|
---|
11909 | }
|
---|
11910 | c.setData("TableOperations",t);
|
---|
11911 | c.addSelectionListener(h)
|
---|
11912 | }}
|
---|
11913 | e.addPopupListener(new AjxListener(this,this.__onTableOperationsPopup))
|
---|
11914 | };
|
---|
11915 | ZmHtmlEditor.prototype.__onTableOperationsPopup=function(t){
|
---|
11916 | this.focus();
|
---|
11917 | var m=this.getNearestElement("table");
|
---|
11918 | var c=t._tblItems;
|
---|
11919 | for(var s in c){
|
---|
11920 | c[s].setEnabled(!!m)
|
---|
11921 | }
|
---|
11922 | if(!m){
|
---|
11923 | return
|
---|
11924 | }
|
---|
11925 | t.setData("table",m);
|
---|
11926 | if(!AjxEnv.isIE){
|
---|
11927 | var o=this.getNearestElement("td");
|
---|
11928 | var d=o&&((o.colSpan&&o.colSpan>1)||(o.rowSpan&&o.rowSpan>1));
|
---|
11929 | c.splitCells.setEnabled(d);
|
---|
11930 | var u=this.getSelectedCells();
|
---|
11931 | var f=true;
|
---|
11932 | var h=0;
|
---|
11933 | try{
|
---|
11934 | for(var s=u.length;
|
---|
11935 | --s>=0;
|
---|
11936 | ){
|
---|
11937 | var e=u[s];
|
---|
11938 | for(var n=e.length;
|
---|
11939 | --n>=0;
|
---|
11940 | ){
|
---|
11941 | var o=e[n];
|
---|
11942 | ++h;
|
---|
11943 | if(o.rowSpan>1||o.colSpan>1){
|
---|
11944 | throw"can't merge"
|
---|
11945 | }}}}
|
---|
11946 | catch(l){
|
---|
11947 | f=false
|
---|
11948 | }
|
---|
11949 | if(h<2){
|
---|
11950 | f=false
|
---|
11951 | }
|
---|
11952 | c.mergeCells.setEnabled(f)
|
---|
11953 | }};
|
---|
11954 | ZmHtmlEditor.prototype._tableOperationsListener=function(a){
|
---|
11955 | var t=a.item;
|
---|
11956 | var e=t.parent.getData("table");
|
---|
11957 | var i=t.getData("TableOperations");
|
---|
11958 | this.focus();
|
---|
11959 | switch(i){
|
---|
11960 | case"tableProperties":AjxDispatcher.require("Extras");
|
---|
11961 | var o=ZmTableEditor.getTablePropsDialog(this,this.getNearestElement("table"));
|
---|
11962 | o.popup();
|
---|
11963 | break;
|
---|
11964 | case"cellProperties":AjxDispatcher.require("Extras");
|
---|
11965 | var o=ZmTableEditor.getCellPropsDialog(this,this.getNearestElement("table"),this.getSelectedCells());
|
---|
11966 | o.popup();
|
---|
11967 | break;
|
---|
11968 | default:this.doTableOperation(i,{
|
---|
11969 | table:e,cells:this.getSelectedCells()}
|
---|
11970 | )
|
---|
11971 | }};
|
---|
11972 | ZmHtmlEditor.prototype._createTableListener=function(t){
|
---|
11973 | var e=t.detail;
|
---|
11974 | this.insertTable(e.rows,e.cols,"90%",null,3,"center")
|
---|
11975 | };
|
---|
11976 | ZmHtmlEditor.prototype._menu_insertObject=function(t){
|
---|
11977 | var e=t.item;
|
---|
11978 | var a=e.getData("ACE");
|
---|
11979 | this.insertObject(a)
|
---|
11980 | };
|
---|
11981 | ZmHtmlEditor.prototype.insertObject=function(e,s,o){
|
---|
11982 | var a=document.URL.replace(/^(https?:\x2f\x2f[^\x2f]+\x2f?).*$/i,"$1").replace(/\x2f*$/,"");
|
---|
11983 | var n=null;
|
---|
11984 | switch(e){
|
---|
11985 | case"ZmSpreadSheet":n=[a,appContextPath,"/public/Spreadsheet.jsp?localeId=",AjxEnv.DEFAULT_LOCALE].join("");
|
---|
11986 | break
|
---|
11987 | }
|
---|
11988 | if(n){
|
---|
11989 | var l=this._getIframeDoc();
|
---|
11990 | this.focus();
|
---|
11991 | ++this._ace_componentsLoading;
|
---|
11992 | if(AjxEnv.isGeckoBased){
|
---|
11993 | Dwt.enableDesignMode(l,false)
|
---|
11994 | }
|
---|
11995 | var i=l.createElement("iframe");
|
---|
11996 | i.id="ACE-"+Dwt.getNextId();
|
---|
11997 | i.frameBorder=0;
|
---|
11998 | i.src=n;
|
---|
11999 | i.style.width="100%";
|
---|
12000 | i.style.height="400px";
|
---|
12001 | i.ondragstart=AjxCallback.returnFalse;
|
---|
12002 | if(!s){
|
---|
12003 | var t=l.createElement("br");
|
---|
12004 | var h=l.createDocumentFragment();
|
---|
12005 | h.appendChild(t);
|
---|
12006 | h.appendChild(i);
|
---|
12007 | h.appendChild(t.cloneNode(true));
|
---|
12008 | this._insertNodeAtSelection(h)
|
---|
12009 | }else{
|
---|
12010 | s.parentNode.replaceChild(i,s)
|
---|
12011 | }
|
---|
12012 | var c=AjxCallback.simpleClosure(this._ace_finishedLoading,this,i,e,o);
|
---|
12013 | if(AjxEnv.isIE){
|
---|
12014 | i.onreadystatechange=c
|
---|
12015 | }else{
|
---|
12016 | i.addEventListener("load",c,true)
|
---|
12017 | }}};
|
---|
12018 | ZmHtmlEditor.prototype._ace_finishedLoading=function(i,t,a){
|
---|
12019 | var e=this;
|
---|
12020 | if(!AjxEnv.isIE||i.readyState=="complete"){
|
---|
12021 | setTimeout(function(){
|
---|
12022 | try{
|
---|
12023 | var n=Dwt.getIframeWindow(i);
|
---|
12024 | n.ZmACE=true;
|
---|
12025 | n.ZmACE_COMPONENT_NAME=t;
|
---|
12026 | i.onload=null;
|
---|
12027 | i.onreadystatechange=null;
|
---|
12028 | n.create(a);
|
---|
12029 | --e._ace_componentsLoading
|
---|
12030 | }
|
---|
12031 | catch(o){
|
---|
12032 | --e._ace_componentsLoading;
|
---|
12033 | var s=appCtxt.getErrorDialog();
|
---|
12034 | s.setMessage(ZmMsg.aleError,o.msg||o.toString(),DwtMessageDialog.WARNING_STYLE,"ALE error");
|
---|
12035 | s.popup(null,true)
|
---|
12036 | }}
|
---|
12037 | ,10)
|
---|
12038 | }};
|
---|
12039 | ZmHtmlEditor.prototype._getAceObjects=function(){
|
---|
12040 | var o=this._getIframeDoc().getElementsByTagName("iframe");
|
---|
12041 | var e=new Array(o.length);
|
---|
12042 | for(var t=o.length;
|
---|
12043 | --t>=0;
|
---|
12044 | ){
|
---|
12045 | e[t]=o[t]
|
---|
12046 | }
|
---|
12047 | return e
|
---|
12048 | };
|
---|
12049 | ZmHtmlEditor.prototype._embedHtmlContent=function(o,a,i){
|
---|
12050 | if(!a&&!i){
|
---|
12051 | if(!(this.ACE_ENABLED&&this._headContent)){
|
---|
12052 | return DwtHtmlEditor.prototype._embedHtmlContent.call(this,o)
|
---|
12053 | }}
|
---|
12054 | if(i){
|
---|
12055 | var t=[],e=0;
|
---|
12056 | if(a){
|
---|
12057 | t[e++]="<div";
|
---|
12058 | t[e++]=" style='font-family:";
|
---|
12059 | t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
|
---|
12060 | t[e++]="; font-size: ";
|
---|
12061 | t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
|
---|
12062 | t[e++]="; color: ";
|
---|
12063 | t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
|
---|
12064 | t[e++]=";'>";
|
---|
12065 | t[e++]=o;
|
---|
12066 | t[e++]="</div>"
|
---|
12067 | }else{
|
---|
12068 | t[e++]=o
|
---|
12069 | }
|
---|
12070 | return t.join("")
|
---|
12071 | }
|
---|
12072 | var n="<style type='text/css'>p { margin: 0; }</style>";
|
---|
12073 | if(a){
|
---|
12074 | o=this._getFontStyle(o)
|
---|
12075 | }
|
---|
12076 | var s=this._headContent?this._headContent.join(""):"";
|
---|
12077 | return["<html><head>",n,s,"</head><body>",o,"</body></html>"].join("")
|
---|
12078 | };
|
---|
12079 | ZmHtmlEditor.prototype._getFontStyle=function(o){
|
---|
12080 | var e=[],t=0;
|
---|
12081 | e[t++]="<div style='font-family: ";
|
---|
12082 | e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
|
---|
12083 | e[t++]="; font-size: ";
|
---|
12084 | e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
|
---|
12085 | e[t++]="; color: ";
|
---|
12086 | e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
|
---|
12087 | e[t++]="'>";
|
---|
12088 | e[t++]=o;
|
---|
12089 | e[t++]="</div>";
|
---|
12090 | return e.join("")
|
---|
12091 | };
|
---|
12092 | ZmHtmlEditor.prototype._serializeAceObjects=function(t){
|
---|
12093 | this._headContent=[];
|
---|
12094 | var e={};
|
---|
12095 | var a=AjxCallback.simpleClosure(this._replaceAceIframes,this,e);
|
---|
12096 | return t.replace(ZmHtmlEditor.ACE_IFRAME_RE,a)
|
---|
12097 | };
|
---|
12098 | ZmHtmlEditor.prototype._replaceAceIframes=function(e,a,h){
|
---|
12099 | var o=this._getIframeDoc().getElementById(h);
|
---|
12100 | var s=Dwt.getIframeWindow(o);
|
---|
12101 | var i=s.getHTML();
|
---|
12102 | var n=s.serialize().replace(/&/g,"&").replace(/>/g,">");
|
---|
12103 | var t=s.ZmACE_COMPONENT_NAME;
|
---|
12104 | if(!e[t]&&typeof s.getHeadHTML=="function"){
|
---|
12105 | e[t]=true;
|
---|
12106 | this._headContent.push(s.getHeadHTML())
|
---|
12107 | }
|
---|
12108 | return['<div class="ACE ',t,'">',i,"<!--","ACE[",t,"]:",n,"-->","</div>"].join("")
|
---|
12109 | };
|
---|
12110 | ZmHtmlEditor.prototype._deserializeAceObjects=function(){
|
---|
12111 | var n=this._getIframeDoc().getElementsByTagName("div");
|
---|
12112 | var o=new Array(n.length);
|
---|
12113 | for(var a=0;
|
---|
12114 | a<n.length;
|
---|
12115 | ++a){
|
---|
12116 | o[a]=n.item(a)
|
---|
12117 | }
|
---|
12118 | n=o;
|
---|
12119 | for(var a=0;
|
---|
12120 | a<n.length;
|
---|
12121 | ++a){
|
---|
12122 | var t=n[a];
|
---|
12123 | if(/^ACE\s+([^\s]+)/.test(t.className)){
|
---|
12124 | var e=RegExp.$1;
|
---|
12125 | var s=t.lastChild;
|
---|
12126 | if(s.nodeType==8){
|
---|
12127 | s=s.data;
|
---|
12128 | var h="ACE["+e+"]:";
|
---|
12129 | if(s.indexOf(h)==0){
|
---|
12130 | s=s.substr(h.length).replace(/>/g,">").replace(/&/g,"&");
|
---|
12131 | this.insertObject(e,t,s)
|
---|
12132 | }}}}};
|
---|
12133 | ZmHtmlEditor.prototype._createBUIButtons=function(e){
|
---|
12134 | var a={
|
---|
12135 | parent:e,style:DwtButton.TOGGLE_STYLE};
|
---|
12136 | var t=new AjxListener(this,this._fontStyleListener);
|
---|
12137 | this._boldButton=new DwtToolBarButton(a);
|
---|
12138 | this._boldButton.setImage("Bold");
|
---|
12139 | this._boldButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_BOLD));
|
---|
12140 | this._boldButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.BOLD_STYLE);
|
---|
12141 | this._boldButton.addSelectionListener(t);
|
---|
12142 | this._italicButton=new DwtToolBarButton(a);
|
---|
12143 | this._italicButton.setImage("Italics");
|
---|
12144 | this._italicButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_ITALIC));
|
---|
12145 | this._italicButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.ITALIC_STYLE);
|
---|
12146 | this._italicButton.addSelectionListener(t);
|
---|
12147 | this._underlineButton=new DwtToolBarButton(a);
|
---|
12148 | this._underlineButton.setImage("Underline");
|
---|
12149 | this._underlineButton.setToolTipContent(appCtxt.getShortcutHint("editor",DwtKeyMap.TEXT_UNDERLINE));
|
---|
12150 | this._underlineButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.UNDERLINE_STYLE);
|
---|
12151 | this._underlineButton.addSelectionListener(t)
|
---|
12152 | };
|
---|
12153 | ZmHtmlEditor.prototype._createFontColorButtons=function(e){
|
---|
12154 | this._fontColorButton=new ZmHtmlEditorColorPicker(e,null,"ZToolbarButton");
|
---|
12155 | this._fontColorButton.dontStealFocus();
|
---|
12156 | this._fontColorButton.setImage("FontColor");
|
---|
12157 | this._fontColorButton.showColorDisplay(true);
|
---|
12158 | this._fontColorButton.setToolTipContent(ZmMsg.fontColor);
|
---|
12159 | this._fontColorButton.addSelectionListener(new AjxListener(this,this._fontColorListener));
|
---|
12160 | this._fontBackgroundButton=new ZmHtmlEditorColorPicker(e,null,"ZToolbarButton");
|
---|
12161 | this._fontBackgroundButton.dontStealFocus();
|
---|
12162 | this._fontBackgroundButton.setImage("FontBackground");
|
---|
12163 | this._fontBackgroundButton.showColorDisplay(true);
|
---|
12164 | this._fontBackgroundButton.setToolTipContent(ZmMsg.fontBackground);
|
---|
12165 | this._fontBackgroundButton.addSelectionListener(new AjxListener(this,this._fontHiliteListener))
|
---|
12166 | };
|
---|
12167 | ZmHtmlEditor.prototype._createHorizRuleButton=function(e){
|
---|
12168 | var t={
|
---|
12169 | parent:e};
|
---|
12170 | this._horizRuleButton=new DwtToolBarButton(t);
|
---|
12171 | this._horizRuleButton.setImage("HorizRule");
|
---|
12172 | this._horizRuleButton.setToolTipContent(ZmMsg.horizRule);
|
---|
12173 | this._horizRuleButton.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.HORIZ_RULE);
|
---|
12174 | this._horizRuleButton.addSelectionListener(new AjxListener(this,this._insElementListener))
|
---|
12175 | };
|
---|
12176 | ZmHtmlEditor.prototype._createUrlButton=function(e){
|
---|
12177 | var t={
|
---|
12178 | parent:e};
|
---|
12179 | this._insertLinkButton=new DwtToolBarButton(t);
|
---|
12180 | this._insertLinkButton.setImage("URL");
|
---|
12181 | this._insertLinkButton.setToolTipContent(ZmMsg.insertLink);
|
---|
12182 | this._insertLinkButton.addSelectionListener(new AjxListener(this,this._insertLinkListener))
|
---|
12183 | };
|
---|
12184 | ZmHtmlEditor.prototype._createTableMenu=function(t){
|
---|
12185 | var s={
|
---|
12186 | parent:t};
|
---|
12187 | var e=this._tableMenu=new DwtToolBarButton(s);
|
---|
12188 | e.setToolTipContent(ZmMsg.insertTable);
|
---|
12189 | e.dontStealFocus();
|
---|
12190 | e.setImage("Table");
|
---|
12191 | var n=new DwtMenu({
|
---|
12192 | parent:e}
|
---|
12193 | );
|
---|
12194 | e.setMenu(n);
|
---|
12195 | var o=new DwtMenuItem({
|
---|
12196 | parent:n}
|
---|
12197 | );
|
---|
12198 | o.setText(ZmMsg.insertTable);
|
---|
12199 | var i=new DwtMenu({
|
---|
12200 | parent:o,style:DwtMenu.GENERIC_WIDGET_STYLE}
|
---|
12201 | );
|
---|
12202 | var a=new DwtGridSizePicker(i,ZmMsg.tableSize);
|
---|
12203 | a.addSelectionListener(new AjxListener(this,this._createTableListener));
|
---|
12204 | o.setMenu(i);
|
---|
12205 | o.setImage("InsertTable");
|
---|
12206 | new DwtMenuItem({
|
---|
12207 | parent:n,style:DwtMenuItem.SEPARATOR_STYLE}
|
---|
12208 | );
|
---|
12209 | this.__createTableOperationItems(n)
|
---|
12210 | };
|
---|
12211 | ZmHtmlEditor.prototype._createSpreadSheetButton=function(t){
|
---|
12212 | new DwtControl({
|
---|
12213 | parent:t,className:"vertSep"}
|
---|
12214 | );
|
---|
12215 | var a={
|
---|
12216 | parent:t,style:0};
|
---|
12217 | var e=new DwtToolBarButton(a);
|
---|
12218 | e.setImage("SpreadSheet");
|
---|
12219 | e.setData("ACE","ZmSpreadSheet");
|
---|
12220 | e.setToolTipContent(ZmMsg.insertSpreadsheet);
|
---|
12221 | e.addSelectionListener(new AjxListener(this,this._menu_insertObject))
|
---|
12222 | };
|
---|
12223 | ZmHtmlEditor.prototype._createStyleMenu=function(e){
|
---|
12224 | var n=new DwtToolBarButton({
|
---|
12225 | parent:e}
|
---|
12226 | );
|
---|
12227 | n.setText("x");
|
---|
12228 | n._textEl.innerHTML="<span style='font-size:13px'>§</span>";
|
---|
12229 | n.setToolTipContent(ZmMsg.sections);
|
---|
12230 | n.dontStealFocus();
|
---|
12231 | var c=this._styleMenu=new ZmPopupMenu(n);
|
---|
12232 | var l=new AjxListener(this,this._styleListener);
|
---|
12233 | var o=[{
|
---|
12234 | label:ZmMsg.normal,id:DwtHtmlEditor.PARAGRAPH}
|
---|
12235 | ,{
|
---|
12236 | label:ZmMsg.heading1,id:DwtHtmlEditor.H1}
|
---|
12237 | ,{
|
---|
12238 | label:ZmMsg.heading2,id:DwtHtmlEditor.H2}
|
---|
12239 | ,{
|
---|
12240 | label:ZmMsg.heading3,id:DwtHtmlEditor.H3}
|
---|
12241 | ,{
|
---|
12242 | label:ZmMsg.heading4,id:DwtHtmlEditor.H4}
|
---|
12243 | ,{
|
---|
12244 | label:ZmMsg.heading5,id:DwtHtmlEditor.H5}
|
---|
12245 | ,{
|
---|
12246 | label:ZmMsg.heading6,id:DwtHtmlEditor.H6}
|
---|
12247 | ,{
|
---|
12248 | label:ZmMsg.address,id:DwtHtmlEditor.ADDRESS}
|
---|
12249 | ,{
|
---|
12250 | label:ZmMsg.preformatted,id:DwtHtmlEditor.PREFORMATTED}
|
---|
12251 | ];
|
---|
12252 | for(var a=0;
|
---|
12253 | a<o.length;
|
---|
12254 | a++){
|
---|
12255 | var h=o[a];
|
---|
12256 | var t=c.createMenuItem(h.id,{
|
---|
12257 | text:h.label,style:DwtMenuItem.RADIO_STYLE}
|
---|
12258 | );
|
---|
12259 | t.addSelectionListener(l);
|
---|
12260 | t.setData(ZmHtmlEditor._VALUE,h.id);
|
---|
12261 | if(a==0){
|
---|
12262 | t.setChecked(true,true)
|
---|
12263 | }}
|
---|
12264 | n.setMenu(c)
|
---|
12265 | };
|
---|
12266 | ZmHtmlEditor.prototype._createListMenu=function(t){
|
---|
12267 | var e=this._listMenuButton=new DwtToolBarButton({
|
---|
12268 | parent:t}
|
---|
12269 | );
|
---|
12270 | e.dontStealFocus();
|
---|
12271 | e.setImage("BulletedList");
|
---|
12272 | e.setToolTipContent(ZmMsg.bulletedList);
|
---|
12273 | var a=new AjxListener(this,this._insElementListener);
|
---|
12274 | var n=this._listMenu=new ZmPopupMenu(e);
|
---|
12275 | var i=this._bulletListMenuItem=n.createMenuItem(DwtHtmlEditor.UNORDERED_LIST,{
|
---|
12276 | image:"BulletedList",style:DwtMenuItem.SELECT_STYLE}
|
---|
12277 | );
|
---|
12278 | i.addSelectionListener(a);
|
---|
12279 | i.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.UNORDERED_LIST);
|
---|
12280 | var o=this._numberListMenuItem=n.createMenuItem(DwtHtmlEditor.ORDERED_LIST,{
|
---|
12281 | image:"NumberedList",style:DwtMenuItem.SELECT_STYLE}
|
---|
12282 | );
|
---|
12283 | o.addSelectionListener(a);
|
---|
12284 | o.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.ORDERED_LIST);
|
---|
12285 | e.setMenu(n)
|
---|
12286 | };
|
---|
12287 | ZmHtmlEditor.prototype._createIndentMenu=function(t){
|
---|
12288 | var e=this._indentMenuButton=new DwtToolBarButton({
|
---|
12289 | parent:t}
|
---|
12290 | );
|
---|
12291 | e.dontStealFocus();
|
---|
12292 | e.setImage("Outdent");
|
---|
12293 | e.setToolTipContent(ZmMsg.indentTooltip);
|
---|
12294 | var o=new AjxListener(this,this._indentListener);
|
---|
12295 | var n=this._indentMenu=new ZmPopupMenu(e);
|
---|
12296 | var a=this._indentMenuItem=n.createMenuItem(DwtHtmlEditor.OUTDENT,{
|
---|
12297 | image:"Outdent",style:DwtMenuItem.SELECT_STYLE}
|
---|
12298 | );
|
---|
12299 | a.addSelectionListener(o);
|
---|
12300 | a.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.OUTDENT);
|
---|
12301 | var i=this._outdentMenuItem=n.createMenuItem(DwtHtmlEditor.INDENT,{
|
---|
12302 | image:"Indent",style:DwtMenuItem.SELECT_STYLE}
|
---|
12303 | );
|
---|
12304 | i.addSelectionListener(o);
|
---|
12305 | i.setData(ZmHtmlEditor._VALUE,DwtHtmlEditor.INDENT);
|
---|
12306 | e.setMenu(n)
|
---|
12307 | };
|
---|
12308 | ZmHtmlEditor.prototype._createJustifyMenu=function(t){
|
---|
12309 | var e=new DwtToolBarButton({
|
---|
12310 | parent:t}
|
---|
12311 | );
|
---|
12312 | e.dontStealFocus();
|
---|
12313 | e.setImage("LeftJustify");
|
---|
12314 | e.setToolTipContent(ZmMsg.alignment);
|
---|
12315 | var l=this._justifyMenu=new ZmPopupMenu(e);
|
---|
12316 | var h=new AjxListener(this,this._justificationListener);
|
---|
12317 | var n=[{
|
---|
12318 | image:"LeftJustify",id:DwtHtmlEditor.JUSTIFY_LEFT}
|
---|
12319 | ,{
|
---|
12320 | image:"CenterJustify",id:DwtHtmlEditor.JUSTIFY_CENTER}
|
---|
12321 | ,{
|
---|
12322 | image:"RightJustify",id:DwtHtmlEditor.JUSTIFY_RIGHT}
|
---|
12323 | ,{
|
---|
12324 | image:"FullJustify",id:DwtHtmlEditor.JUSTIFY_FULL}
|
---|
12325 | ];
|
---|
12326 | for(var o=0;
|
---|
12327 | o<n.length;
|
---|
12328 | o++){
|
---|
12329 | var s=n[o];
|
---|
12330 | var a=l.createMenuItem(s.id,{
|
---|
12331 | image:s.image,style:DwtMenuItem.RADIO_STYLE}
|
---|
12332 | );
|
---|
12333 | a.addSelectionListener(h);
|
---|
12334 | a.setData(ZmHtmlEditor._VALUE,s.id);
|
---|
12335 | if(o==0){
|
---|
12336 | a.setChecked(true,true)
|
---|
12337 | }}
|
---|
12338 | e.setMenu(l,false,DwtMenuItem.RADIO_STYLE)
|
---|
12339 | };
|
---|
12340 | ZmHtmlEditor.prototype._createFontFamilyMenu=function(e){
|
---|
12341 | this._fontFamilyButton=new DwtToolBarButton({
|
---|
12342 | parent:e}
|
---|
12343 | );
|
---|
12344 | this._fontFamilyButton.dontStealFocus();
|
---|
12345 | this._fontFamilyButton.setSize(Dwt.DEFAULT);
|
---|
12346 | this._fontFamilyButton.setAlign(DwtLabel.ALIGN_LEFT);
|
---|
12347 | var o=new ZmPopupMenu(this._fontFamilyButton);
|
---|
12348 | var i=new AjxListener(this,this._fontFamilyListener);
|
---|
12349 | for(var n in ZmHtmlEditor.FONT_FAMILY){
|
---|
12350 | var a=ZmHtmlEditor.FONT_FAMILY[n];
|
---|
12351 | var t=o.createMenuItem(a.name,{
|
---|
12352 | text:a.name}
|
---|
12353 | );
|
---|
12354 | t.addSelectionListener(i);
|
---|
12355 | t.setData(ZmHtmlEditor._VALUE,a.value)
|
---|
12356 | }
|
---|
12357 | this._fontFamilyButton.setMenu(o)
|
---|
12358 | };
|
---|
12359 | ZmHtmlEditor.prototype._createFontSizeMenu=function(e){
|
---|
12360 | this._fontSizeButton=new DwtToolBarButton({
|
---|
12361 | parent:e}
|
---|
12362 | );
|
---|
12363 | this._fontSizeButton.dontStealFocus();
|
---|
12364 | var l=new ZmPopupMenu(this._fontSizeButton);
|
---|
12365 | var s=new AjxListener(this,this._fontSizeListener);
|
---|
12366 | for(var o=0;
|
---|
12367 | o<ZmHtmlEditor.FONT_SIZE_VALUES.length;
|
---|
12368 | o++){
|
---|
12369 | var n=ZmHtmlEditor.FONT_SIZE_VALUES[o];
|
---|
12370 | var a=o+1;
|
---|
12371 | var h=a+" ("+n+")";
|
---|
12372 | var t=l.createMenuItem(o,{
|
---|
12373 | text:h}
|
---|
12374 | );
|
---|
12375 | t.addSelectionListener(s);
|
---|
12376 | t.setData(ZmHtmlEditor._VALUE,a)
|
---|
12377 | }
|
---|
12378 | this._fontSizeButton.setMenu(l)
|
---|
12379 | };
|
---|
12380 | ZmHtmlEditor.prototype._getFontSizeLabel=function(a){
|
---|
12381 | for(var e=0;
|
---|
12382 | e<ZmHtmlEditor.FONT_SIZE_VALUES.length;
|
---|
12383 | e++){
|
---|
12384 | var t=ZmHtmlEditor.FONT_SIZE_VALUES[e];
|
---|
12385 | if(a==t){
|
---|
12386 | return((e+1)+" ("+t+")")
|
---|
12387 | }}
|
---|
12388 | return"3 (12pt)"
|
---|
12389 | };
|
---|
12390 | ZmHtmlEditor.prototype._rteStateChangeListener=function(a){
|
---|
12391 | this._boldButton.setSelected(a.isBold);
|
---|
12392 | this._underlineButton.setSelected(a.isUnderline);
|
---|
12393 | this._italicButton.setSelected(a.isItalic);
|
---|
12394 | if(this._strikeThruButton){
|
---|
12395 | this._strikeThruButton.setSelected(a.isStrikeThru)
|
---|
12396 | }
|
---|
12397 | if(this._subscriptButton){
|
---|
12398 | this._subscriptButton.setSelected(a.isSubscript)
|
---|
12399 | }
|
---|
12400 | if(this._superscriptButton){
|
---|
12401 | this._superscriptButton.setSelected(a.isSuperscript)
|
---|
12402 | }
|
---|
12403 | if(a.color){
|
---|
12404 | this._fontColorButton.setColor(a.color)
|
---|
12405 | }
|
---|
12406 | if(a.backgroundColor){
|
---|
12407 | this._fontBackgroundButton.setColor(a.backgroundColor)
|
---|
12408 | }
|
---|
12409 | if(a.style){
|
---|
12410 | this._styleMenu.checkItem(ZmHtmlEditor._VALUE,a.style,true)
|
---|
12411 | }
|
---|
12412 | if(!AjxEnv.isIE){
|
---|
12413 | if(a.fontFamily){
|
---|
12414 | var i=a.fontFamily;
|
---|
12415 | var t=ZmHtmlEditor.FONT_FAMILY[i]&&ZmHtmlEditor.FONT_FAMILY[i].name;
|
---|
12416 | t=t||ZmHtmlEditor.__makeFontName(i);
|
---|
12417 | this._fontFamilyButton.setText(t)
|
---|
12418 | }
|
---|
12419 | if(a.fontSize){
|
---|
12420 | var e=this._fontSizeButton.getMenu().getItem(parseInt(a.fontSize)-1);
|
---|
12421 | if(e){
|
---|
12422 | this._fontSizeButton.setText(e.getText())
|
---|
12423 | }}}
|
---|
12424 | this._justifyMenu.checkItem(ZmHtmlEditor._VALUE,a.justification,true)
|
---|
12425 | };
|
---|
12426 | ZmHtmlEditor.prototype._settingChangeListener=function(e){
|
---|
12427 | if(e.type!=ZmEvent.S_SETTING){
|
---|
12428 | return
|
---|
12429 | }
|
---|
12430 | var t=e.source.id;
|
---|
12431 | if(t==ZmSetting.COMPOSE_INIT_FONT_COLOR||t==ZmSetting.COMPOSE_INIT_FONT_FAMILY||t==ZmSetting.COMPOSE_INIT_FONT_SIZE){
|
---|
12432 | this._resetFormatControlDefaults();
|
---|
12433 | this._fontStyle=null
|
---|
12434 | }};
|
---|
12435 | ZmHtmlEditor.prototype._handleEditorEvent=function(s){
|
---|
12436 | var a=this._eventCallback?this._eventCallback.run(s):true;
|
---|
12437 | if(a){
|
---|
12438 | a=DwtHtmlEditor.prototype._handleEditorEvent.call(this,s)
|
---|
12439 | }
|
---|
12440 | if(this._TIMER_spell){
|
---|
12441 | clearTimeout(this._TIMER_spell)
|
---|
12442 | }
|
---|
12443 | var l=this;
|
---|
12444 | if(this._spellCheck){
|
---|
12445 | var e;
|
---|
12446 | if(/mouse|context|click|select/i.test(s.type)){
|
---|
12447 | e=new DwtMouseEvent(true)
|
---|
12448 | }else{
|
---|
12449 | e=new DwtUiEvent(true)
|
---|
12450 | }
|
---|
12451 | e.setFromDhtmlEvent(s);
|
---|
12452 | this._TIMER_spell=setTimeout(function(){
|
---|
12453 | l._handleSpellCheckerEvents(e);
|
---|
12454 | this._TIMER_spell=null
|
---|
12455 | }
|
---|
12456 | ,100)
|
---|
12457 | }
|
---|
12458 | if(/keydown/i.test(s.type)){
|
---|
12459 | if(s.keyCode==13){
|
---|
12460 | var i=this._getParentElement();
|
---|
12461 | var o=i;
|
---|
12462 | while(o){
|
---|
12463 | var h=Dwt.getAttr(o,"tagName");
|
---|
12464 | if(h&&h.toLowerCase()==="blockquote"){
|
---|
12465 | break
|
---|
12466 | }
|
---|
12467 | o=o.parentNode
|
---|
12468 | }
|
---|
12469 | if(o){
|
---|
12470 | this._splitBlockquote(o,i);
|
---|
12471 | a=false
|
---|
12472 | }}
|
---|
12473 | if(s.keyCode==8||s.keyCode==46){
|
---|
12474 | setTimeout(AjxCallback.simpleClosure(function(){
|
---|
12475 | var m,d;
|
---|
12476 | for(var u=this._getIframeDoc().body.firstChild;
|
---|
12477 | u&&u.nextSibling;
|
---|
12478 | u=u.nextSibling){
|
---|
12479 | var c=u.nextSibling;
|
---|
12480 | if(c&&c.tagName&&c.tagName.toLowerCase()=="p"&&this._elementIsIEFiller(c.firstChild)){
|
---|
12481 | c=c.nextSibling
|
---|
12482 | }
|
---|
12483 | if(c&&u.tagName&&c.tagName&&u.tagName.toLowerCase()=="blockquote"&&c.tagName.toLowerCase()=="blockquote"){
|
---|
12484 | this._mergeBlockquotes(u,c)
|
---|
12485 | }}}
|
---|
12486 | ,this),5);
|
---|
12487 | if(s.keyCode==46){
|
---|
12488 | if(!AjxEnv.isIE){
|
---|
12489 | var n=this._getRange();
|
---|
12490 | var t=n.startContainer.childNodes[n.startOffset];
|
---|
12491 | if(t&&t.tagName&&t.tagName.toLowerCase()=="br"){
|
---|
12492 | this._removeElement(t)
|
---|
12493 | }}}}}
|
---|
12494 | return a
|
---|
12495 | };
|
---|
12496 | ZmHtmlEditor.prototype._splitBlockquote=function(e,i){
|
---|
12497 | var d,a,n=null,s=null;
|
---|
12498 | var l,h;
|
---|
12499 | if(AjxEnv.isIE){
|
---|
12500 | var u=this._getIframeDoc();
|
---|
12501 | d=u.selection.createRange();
|
---|
12502 | d.collapse(false);
|
---|
12503 | a=i;
|
---|
12504 | var z="###"+Dwt.getNextId()+"###";
|
---|
12505 | d.pasteHTML(z);
|
---|
12506 | n=a.innerHTML.indexOf(z);
|
---|
12507 | a.innerHTML=a.innerHTML.replace(z,"");
|
---|
12508 | l=n?a.innerHTML.substring(0,n):"";
|
---|
12509 | h=a.innerHTML.substring(n)
|
---|
12510 | }else{
|
---|
12511 | d=this._getRange();
|
---|
12512 | d.collapse(false);
|
---|
12513 | var o=d.startContainer.nodeType;
|
---|
12514 | if(o==3||o==4||o==8){
|
---|
12515 | n=d.startOffset;
|
---|
12516 | a=d.startContainer.parentNode;
|
---|
12517 | l=n?d.startContainer.textContent.substring(0,n):"";
|
---|
12518 | h=d.startContainer.textContent.substring(n);
|
---|
12519 | var w=d.startContainer.previousSibling;
|
---|
12520 | while(w){
|
---|
12521 | l=this._getElementHTML(w)+l;
|
---|
12522 | w=w.previousSibling
|
---|
12523 | }
|
---|
12524 | w=d.startContainer.nextSibling;
|
---|
12525 | while(w){
|
---|
12526 | h=h+this._getElementHTML(w);
|
---|
12527 | w=w.nextSibling
|
---|
12528 | }}else{
|
---|
12529 | s=d.startOffset;
|
---|
12530 | a=d.startContainer
|
---|
12531 | }}
|
---|
12532 | var b=a.id=a.id||Dwt.getNextId();
|
---|
12533 | var y=e.cloneNode(true);
|
---|
12534 | var f=a;
|
---|
12535 | var m=Dwt.byId(b,y);
|
---|
12536 | m.removeAttribute("id");
|
---|
12537 | if(n!==null){
|
---|
12538 | f.innerHTML=l;
|
---|
12539 | m.innerHTML=h
|
---|
12540 | }else{
|
---|
12541 | if(s!==null){
|
---|
12542 | this._removeNextSiblings(f.childNodes[s]);
|
---|
12543 | var v=m.childNodes[s];
|
---|
12544 | this._removePreviousSiblings(v);
|
---|
12545 | this._removeElement(v)
|
---|
12546 | }}
|
---|
12547 | while(f!=e){
|
---|
12548 | this._removeNextSiblings(f);
|
---|
12549 | f=f.parentNode
|
---|
12550 | }
|
---|
12551 | while(m!=y){
|
---|
12552 | this._removePreviousSiblings(m);
|
---|
12553 | m=m.parentNode
|
---|
12554 | }
|
---|
12555 | if(e.nextSibling){
|
---|
12556 | e.parentNode.insertBefore(y,e.nextSibling)
|
---|
12557 | }else{
|
---|
12558 | e.parentNode.appendChild(y)
|
---|
12559 | }
|
---|
12560 | if(AjxEnv.isIE){
|
---|
12561 | var g=document.createElement("p");
|
---|
12562 | var q=document.createElement("span");
|
---|
12563 | var k=document.createElement("span");
|
---|
12564 | var j=document.createElement("br");
|
---|
12565 | q.appendChild(k);
|
---|
12566 | q.appendChild(j);
|
---|
12567 | g.appendChild(q);
|
---|
12568 | y.parentNode.insertBefore(g,y);
|
---|
12569 | this._setCursor(k);
|
---|
12570 | this._setIEFiller(q);
|
---|
12571 | k.parentNode.removeChild(k)
|
---|
12572 | }else{
|
---|
12573 | if(AjxEnv.isSafari){
|
---|
12574 | var c=this;
|
---|
12575 | setTimeout(function(){
|
---|
12576 | var T;
|
---|
12577 | if(e.lastChild&&e.lastChild.childElementCount==1&&e.lastChild.firstChild instanceof HTMLBRElement){
|
---|
12578 | T=e.lastChild
|
---|
12579 | }else{
|
---|
12580 | if(y.firstChild&&y.firstChild.childElementCount==1&&y.firstChild.firstChild instanceof HTMLBRElement){
|
---|
12581 | T=y.firstChild
|
---|
12582 | }}
|
---|
12583 | if(T){
|
---|
12584 | e.parentNode.insertBefore(T,y);
|
---|
12585 | d.setStart(T,0);
|
---|
12586 | var t=c._getSelection();
|
---|
12587 | t.removeAllRanges();
|
---|
12588 | t.addRange(d)
|
---|
12589 | }}
|
---|
12590 | ,5)
|
---|
12591 | }
|
---|
12592 | d.setStartAfter(e);
|
---|
12593 | var x=this._getSelection();
|
---|
12594 | x.removeAllRanges();
|
---|
12595 | x.addRange(d)
|
---|
12596 | }};
|
---|
12597 | ZmHtmlEditor.prototype._getElementHTML=function(t){
|
---|
12598 | if(AjxEnv.isIE){
|
---|
12599 | return t.outerHTML
|
---|
12600 | }
|
---|
12601 | var e=document.createElement(t.parentNode&&t.parentNode.tagName||"span");
|
---|
12602 | e.appendChild(t.cloneNode(true));
|
---|
12603 | return e.innerHTML
|
---|
12604 | };
|
---|
12605 | ZmHtmlEditor.prototype._removeElement=function(e){
|
---|
12606 | if(e&&e.parentNode){
|
---|
12607 | e.parentNode.removeChild(e)
|
---|
12608 | }};
|
---|
12609 | ZmHtmlEditor.prototype._removePreviousSiblings=function(e){
|
---|
12610 | if(e&&e.parentNode){
|
---|
12611 | while(e.previousSibling){
|
---|
12612 | this._removeElement(e.previousSibling)
|
---|
12613 | }}};
|
---|
12614 | ZmHtmlEditor.prototype._removeNextSiblings=function(e){
|
---|
12615 | if(e&&e.parentNode){
|
---|
12616 | while(e.nextSibling){
|
---|
12617 | this._removeElement(e.nextSibling)
|
---|
12618 | }}};
|
---|
12619 | ZmHtmlEditor.prototype._selectNode=function(a){
|
---|
12620 | var i;
|
---|
12621 | var e=this._getRange();
|
---|
12622 | while(!i&&a){
|
---|
12623 | try{
|
---|
12624 | e.setStartBefore(a);
|
---|
12625 | i=true
|
---|
12626 | }
|
---|
12627 | catch(t){
|
---|
12628 | a=a.parentNode;
|
---|
12629 | i=false
|
---|
12630 | }}};
|
---|
12631 | ZmHtmlEditor.prototype._nextElement=function(e){
|
---|
12632 | if(e.childNodes&&e.childNodes.length){
|
---|
12633 | return e.childNodes[0]
|
---|
12634 | }
|
---|
12635 | if(e.nextSibling){
|
---|
12636 | return e.nextSibling
|
---|
12637 | }
|
---|
12638 | var t=e.parentNode;
|
---|
12639 | while(!e.nextSibling){
|
---|
12640 | e=e.parentNode;
|
---|
12641 | if(!e){
|
---|
12642 | return null
|
---|
12643 | }}
|
---|
12644 | return e.nextSibling
|
---|
12645 | };
|
---|
12646 | ZmHtmlEditor.prototype._elementIsIEFiller=function(t){
|
---|
12647 | if(t.attributes){
|
---|
12648 | for(var e=0;
|
---|
12649 | e<t.attributes.length;
|
---|
12650 | e++){
|
---|
12651 | if(t.attributes[e].name=="_ieFiller"){
|
---|
12652 | return true
|
---|
12653 | }}}};
|
---|
12654 | ZmHtmlEditor.prototype._setIEFiller=function(e){
|
---|
12655 | if(e){
|
---|
12656 | e.setAttribute("_ieFiller","")
|
---|
12657 | }};
|
---|
12658 | ZmHtmlEditor.prototype._removeIEFiller=function(t){
|
---|
12659 | if(t){
|
---|
12660 | if(this._elementIsIEFiller(t)){
|
---|
12661 | t.parentNode.removeChild(t)
|
---|
12662 | }
|
---|
12663 | for(var e=0;
|
---|
12664 | e<t.children.length;
|
---|
12665 | e++){
|
---|
12666 | this._removeIEFiller(t.children[e])
|
---|
12667 | }}};
|
---|
12668 | ZmHtmlEditor.prototype._mergeBlockquotes=function(h,s){
|
---|
12669 | if(AjxEnv.isIE){
|
---|
12670 | this._removeIEFiller(h.lastChild)
|
---|
12671 | }
|
---|
12672 | var i=h;
|
---|
12673 | var u=0;
|
---|
12674 | while(i.childNodes.length){
|
---|
12675 | i=i.childNodes[i.childNodes.length-1];
|
---|
12676 | while(i.previousSibling&&i.tagName=="BR"){
|
---|
12677 | i=i.previousSibling
|
---|
12678 | }
|
---|
12679 | u++
|
---|
12680 | }
|
---|
12681 | var a=s;
|
---|
12682 | var d=0;
|
---|
12683 | while(a.childNodes.length){
|
---|
12684 | a=a.childNodes[0];
|
---|
12685 | d++
|
---|
12686 | }
|
---|
12687 | if(i.nodeType==3){
|
---|
12688 | i=i.parentNode;
|
---|
12689 | u--
|
---|
12690 | }
|
---|
12691 | if(a.nodeType==3){
|
---|
12692 | a=a.parentNode;
|
---|
12693 | d--
|
---|
12694 | }
|
---|
12695 | var l=(AjxEnv.isIE)?this._getIframeDoc().selection.createRange():this._getRange();
|
---|
12696 | if(u==d){
|
---|
12697 | var f=[i.innerHTML,a.innerHTML];
|
---|
12698 | var o="###"+Dwt.getNextId()+"###";
|
---|
12699 | i.innerHTML=f.join(o);
|
---|
12700 | var n=i.innerHTML.replace(/<br>/ig," ").replace(/<\/?[^>]+>/g,"").indexOf(o);
|
---|
12701 | i.innerHTML=f.join("");
|
---|
12702 | if(AjxEnv.isIE){
|
---|
12703 | l.moveToElementText(i);
|
---|
12704 | l.moveStart("character",n)
|
---|
12705 | }else{
|
---|
12706 | var e;
|
---|
12707 | for(var e=i;
|
---|
12708 | e!=null&&n>0;
|
---|
12709 | e=this._nextElement(e)){
|
---|
12710 | var m=e.nodeType;
|
---|
12711 | var c=e.textContent||e.innerText||e.innerHTML||"";
|
---|
12712 | if(m==3||m==4||m==8){
|
---|
12713 | if(n<=c.length){
|
---|
12714 | break
|
---|
12715 | }
|
---|
12716 | n-=c.length
|
---|
12717 | }else{
|
---|
12718 | if(e.tagName.toLowerCase()=="br"){
|
---|
12719 | n--
|
---|
12720 | }
|
---|
12721 | if(n==0){
|
---|
12722 | break
|
---|
12723 | }}}
|
---|
12724 | l.setStart(e,n)
|
---|
12725 | }}else{
|
---|
12726 | if(u==d+1){
|
---|
12727 | while(a.firstChild){
|
---|
12728 | i.parentNode.appendChild(a.firstChild)
|
---|
12729 | }
|
---|
12730 | if(AjxEnv.isIE){
|
---|
12731 | var m=e.nodeType;
|
---|
12732 | var n=1;
|
---|
12733 | if(m==3||m==4||m==8){
|
---|
12734 | n=e.length;
|
---|
12735 | e=e.parentNode
|
---|
12736 | }
|
---|
12737 | l.moveToElementText(e);
|
---|
12738 | l.moveStart("character",n)
|
---|
12739 | }else{
|
---|
12740 | if(i.tagName&&i.tagName.toLowerCase()=="br"){
|
---|
12741 | l.setStartBefore(i)
|
---|
12742 | }else{
|
---|
12743 | l.setStartAfter(i)
|
---|
12744 | }}
|
---|
12745 | i=i.parentNode
|
---|
12746 | }else{
|
---|
12747 | if(u+1==d){
|
---|
12748 | var e=i.childNodes.length?i.childNodes[i.childNodes.length-1]:i;
|
---|
12749 | a=a.parentNode;
|
---|
12750 | while(a.firstChild){
|
---|
12751 | i.appendChild(a.firstChild)
|
---|
12752 | }
|
---|
12753 | if(AjxEnv.isIE){
|
---|
12754 | var m=e.nodeType;
|
---|
12755 | var n=1;
|
---|
12756 | if(m==3||m==4||m==8){
|
---|
12757 | n=e.length;
|
---|
12758 | e=e.parentNode
|
---|
12759 | }
|
---|
12760 | l.moveToElementText(e);
|
---|
12761 | l.moveStart("character",n)
|
---|
12762 | }else{
|
---|
12763 | if(e.tagName&&e.tagName.toLowerCase()=="br"){
|
---|
12764 | l.setStartBefore(e)
|
---|
12765 | }else{
|
---|
12766 | l.setStartAfter(e)
|
---|
12767 | }}}else{
|
---|
12768 | return
|
---|
12769 | }}}
|
---|
12770 | while(i!=h&&a!=s){
|
---|
12771 | while(a.nextSibling){
|
---|
12772 | i.parentNode.appendChild(a.nextSibling)
|
---|
12773 | }
|
---|
12774 | i=i.parentNode;
|
---|
12775 | a=a.parentNode
|
---|
12776 | }
|
---|
12777 | this._removeElement(s);
|
---|
12778 | l.collapse(true);
|
---|
12779 | if(AjxEnv.isIE){
|
---|
12780 | l.select()
|
---|
12781 | }else{
|
---|
12782 | var t=this._getSelection();
|
---|
12783 | t.removeAllRanges();
|
---|
12784 | t.addRange(l)
|
---|
12785 | }};
|
---|
12786 | ZmHtmlEditor._spellCheckResumeEditing=function(){
|
---|
12787 | var e=Dwt.getObjectFromElement(this);
|
---|
12788 | e.discardMisspelledWords()
|
---|
12789 | };
|
---|
12790 | ZmHtmlEditor._spellCheckAgain=function(){
|
---|
12791 | var e=Dwt.getObjectFromElement(this);
|
---|
12792 | e.discardMisspelledWords();
|
---|
12793 | e.spellCheck()
|
---|
12794 | };
|
---|
12795 | ZmHtmlEditor.prototype._spellCheckShowModeDiv=function(){
|
---|
12796 | var o=this.getSize();
|
---|
12797 | if(!this._spellCheckModeDivId){
|
---|
12798 | var s=document.createElement("div");
|
---|
12799 | s.className="SpellCheckModeDiv";
|
---|
12800 | s.id=this._spellCheckModeDivId=Dwt.getNextId();
|
---|
12801 | var a=new Array();
|
---|
12802 | var t=0;
|
---|
12803 | a[t++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='width:25'>";
|
---|
12804 | a[t++]=AjxImg.getImageHtml("SpellCheck");
|
---|
12805 | a[t++]="</td><td style='white-space:nowrap'><span class='SpellCheckLink'>";
|
---|
12806 | a[t++]=ZmMsg.resumeEditing;
|
---|
12807 | a[t++]="</span> | <span class='SpellCheckLink'>";
|
---|
12808 | a[t++]=ZmMsg.checkAgain;
|
---|
12809 | a[t++]="</span></td></tr></table>";
|
---|
12810 | s.innerHTML=a.join("");
|
---|
12811 | var e=document.getElementById((this._spellCheckDivId||this.getBodyFieldId()));
|
---|
12812 | e.parentNode.insertBefore(s,e);
|
---|
12813 | var n=s.getElementsByTagName("span");
|
---|
12814 | Dwt.associateElementWithObject(n[0],this);
|
---|
12815 | Dwt.setHandler(n[0],"onclick",ZmHtmlEditor._spellCheckResumeEditing);
|
---|
12816 | Dwt.associateElementWithObject(n[1],this);
|
---|
12817 | Dwt.setHandler(n[1],"onclick",ZmHtmlEditor._spellCheckAgain)
|
---|
12818 | }else{
|
---|
12819 | document.getElementById(this._spellCheckModeDivId).style.display=""
|
---|
12820 | }
|
---|
12821 | this.setSize(o.x,o.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
|
---|
12822 | };
|
---|
12823 | ZmHtmlEditor.prototype._spellCheckHideModeDiv=function(){
|
---|
12824 | var e=this.getSize();
|
---|
12825 | if(this._spellCheckModeDivId){
|
---|
12826 | document.getElementById(this._spellCheckModeDivId).style.display="none"
|
---|
12827 | }
|
---|
12828 | this.setSize(e.x,e.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
|
---|
12829 | };
|
---|
12830 | ZmHtmlEditor.prototype._spellCheckSuggestionListener=function(l){
|
---|
12831 | var m=l.item;
|
---|
12832 | var d=m.getData("orig");
|
---|
12833 | if(!d){
|
---|
12834 | return
|
---|
12835 | }
|
---|
12836 | var t=m.getData("value");
|
---|
12837 | var n=this._mode==DwtHtmlEditor.TEXT;
|
---|
12838 | var h=m.getData("fixall");
|
---|
12839 | var u=n?document:this._getIframeDoc();
|
---|
12840 | var o=u.getElementById(m.getData("spanId"));
|
---|
12841 | var i=m.getData(ZmPopupMenu.MENU_ITEM_ID_KEY);
|
---|
12842 | switch(i){
|
---|
12843 | case"ignore":t=d;
|
---|
12844 | this._ignoreWords[t]=true;
|
---|
12845 | if(h){}
|
---|
12846 | break;
|
---|
12847 | case"add":t=d;
|
---|
12848 | var c=AjxSoapDoc.create("ModifyPrefsRequest","urn:zimbraAccount");
|
---|
12849 | var s=c.set("pref",t);
|
---|
12850 | s.setAttribute("name","+zimbraPrefSpellIgnoreWord");
|
---|
12851 | var a={
|
---|
12852 | soapDoc:c,asyncMode:true,callback:new AjxCallback(appCtxt,appCtxt.setStatusMsg,[ZmMsg.wordAddedToDictionary])};
|
---|
12853 | appCtxt.getAppController().sendRequest(a);
|
---|
12854 | this._ignoreWords[t]=true;
|
---|
12855 | break;
|
---|
12856 | default:break
|
---|
12857 | }
|
---|
12858 | if(n&&t==null){
|
---|
12859 | this._editWord(h,o)
|
---|
12860 | }else{
|
---|
12861 | var e=h?this._spellCheck.wordIds[d]:o;
|
---|
12862 | this._editWordFix(e,t)
|
---|
12863 | }
|
---|
12864 | this._handleSpellCheckerEvents(null)
|
---|
12865 | };
|
---|
12866 | ZmHtmlEditor.prototype._getEditorDocument=function(){
|
---|
12867 | var e=this._mode==DwtHtmlEditor.TEXT;
|
---|
12868 | return e?document:this._getIframeDoc()
|
---|
12869 | };
|
---|
12870 | ZmHtmlEditor.prototype._editWord=function(s,e){
|
---|
12871 | var o=this._getEditorDocument();
|
---|
12872 | var t=o.createElement("input");
|
---|
12873 | t.type="text";
|
---|
12874 | t.value=AjxUtil.getInnerText(e);
|
---|
12875 | t.className="SpellCheckInputField";
|
---|
12876 | t.style.left=e.offsetLeft-2+"px";
|
---|
12877 | t.style.top=e.offsetTop-2+"px";
|
---|
12878 | t.style.width=e.offsetWidth+4+"px";
|
---|
12879 | var n=o.getElementById(this._spellCheckDivId);
|
---|
12880 | var i=n.scrollTop;
|
---|
12881 | n.appendChild(t);
|
---|
12882 | n.scrollTop=i;
|
---|
12883 | t.setAttribute("autocomplete","off");
|
---|
12884 | t.focus();
|
---|
12885 | if(!AjxEnv.isGeckoBased){
|
---|
12886 | t.select()
|
---|
12887 | }else{
|
---|
12888 | t.setSelectionRange(0,t.value.length)
|
---|
12889 | }
|
---|
12890 | var a=AjxCallback.simpleClosure(this._editWordHandler,this,s,e);
|
---|
12891 | t.onblur=a;
|
---|
12892 | t.onkeydown=a
|
---|
12893 | };
|
---|
12894 | ZmHtmlEditor.prototype._editWordHandler=function(a,e,t){
|
---|
12895 | t=DwtUiEvent.getEvent(t);
|
---|
12896 | t={
|
---|
12897 | type:t.type,keyCode:t.keyCode,ctrlKey:t.ctrlKey,target:DwtUiEvent.getTarget(t)};
|
---|
12898 | setTimeout(AjxCallback.simpleClosure(this._editWordHandler2,this,a,e,t),20)
|
---|
12899 | };
|
---|
12900 | ZmHtmlEditor.prototype._editWordHandler2=function(s,o,h){
|
---|
12901 | h=DwtUiEvent.getEvent(h);
|
---|
12902 | var l=h.type;
|
---|
12903 | var t=h.keyCode;
|
---|
12904 | var i=h.ctrlKey;
|
---|
12905 | var c=DwtUiEvent.getTarget(h);
|
---|
12906 | var n=/key/.test(l);
|
---|
12907 | var a=true;
|
---|
12908 | if(/blur/.test(l)||(n&&t==13)){
|
---|
12909 | if(i){
|
---|
12910 | s=!s
|
---|
12911 | }
|
---|
12912 | var d=AjxUtil.getInnerText(o);
|
---|
12913 | var e=s?this._spellCheck.wordIds[d]:o;
|
---|
12914 | this._editWordFix(e,c.value)
|
---|
12915 | }else{
|
---|
12916 | if(n&&t==27){
|
---|
12917 | this._editWordFix(o,AjxUtil.getInnerText(o))
|
---|
12918 | }else{
|
---|
12919 | a=false
|
---|
12920 | }}
|
---|
12921 | if(a){
|
---|
12922 | c.onblur=null;
|
---|
12923 | c.onkeydown=null;
|
---|
12924 | if(c.parentNode){
|
---|
12925 | c.parentNode.removeChild(c)
|
---|
12926 | }}
|
---|
12927 | this._handleSpellCheckerEvents(null)
|
---|
12928 | };
|
---|
12929 | ZmHtmlEditor.prototype._editWordFix=function(a,o){
|
---|
12930 | a=a instanceof Array?a:[a];
|
---|
12931 | var n=this._getEditorDocument();
|
---|
12932 | for(var t=a.length-1;
|
---|
12933 | t>=0;
|
---|
12934 | t--){
|
---|
12935 | var e=a[t];
|
---|
12936 | if(typeof e=="string"){
|
---|
12937 | e=n.getElementById(e)
|
---|
12938 | }
|
---|
12939 | if(e){
|
---|
12940 | e.innerHTML=o
|
---|
12941 | }}};
|
---|
12942 | ZmHtmlEditor.prototype._handleSpellCheckerEvents=function(f){
|
---|
12943 | var h=this._mode==DwtHtmlEditor.TEXT;
|
---|
12944 | var n=h?(f?DwtUiEvent.getTarget(f):null):this._getParentElement(),y,e,s,l,d=this._spellCheck,g=this._getEditorDocument(),b=false,o="";
|
---|
12945 | if(f&&/^span$/i.test(n.tagName)&&/ZM-SPELLCHECK/.test(n.className)){
|
---|
12946 | o=n.getAttribute("word");
|
---|
12947 | b=o!=AjxUtil.getInnerText(n)
|
---|
12948 | }
|
---|
12949 | e=d.spanIds;
|
---|
12950 | for(s in e){
|
---|
12951 | y=g.getElementById(s);
|
---|
12952 | if(y){
|
---|
12953 | if(e[s]!=AjxUtil.getInnerText(y)||this._ignoreWords[e[s]]){
|
---|
12954 | y.className="ZM-SPELLCHECK-FIXED"
|
---|
12955 | }else{
|
---|
12956 | if(e[s]==o){
|
---|
12957 | y.className="ZM-SPELLCHECK-MISSPELLED2"
|
---|
12958 | }else{
|
---|
12959 | y.className="ZM-SPELLCHECK-MISSPELLED"
|
---|
12960 | }}}}
|
---|
12961 | if(d.menu&&(!f||(/click|mousedown|mouseup|contextmenu/.test(f.type)||(/key/.test(f.type)&&(!o||b))))){
|
---|
12962 | if(d.menu._menuItems.fixall){
|
---|
12963 | d.menu._menuItems.fixall.getMenu().dispose()
|
---|
12964 | }
|
---|
12965 | d.menu.dispose();
|
---|
12966 | d.menu=null;
|
---|
12967 | window.status=""
|
---|
12968 | }
|
---|
12969 | if(f&&o&&(l=d.suggestions[o])&&(/mouseup|contextmenu/i.test(f.type)||(h&&/(click|mousedown|contextmenu)/i.test(f.type)))&&(o==AjxUtil.getInnerText(n)&&!this._ignoreWords[o])){
|
---|
12970 | d.menu=this._spellCheckCreateMenu(this,0,l,o,n.id,b);
|
---|
12971 | var m,a=d.menu.getSize(),c=this.shell.getSize();
|
---|
12972 | if(!h){
|
---|
12973 | m=Dwt.toWindow(document.getElementById(this._iFrameId),0,0,null,true);
|
---|
12974 | var u=Dwt.toWindow(n,0,0,null,true);
|
---|
12975 | m.x+=u.x-(g.documentElement.scrollLeft||g.body.scrollLeft);
|
---|
12976 | m.y+=u.y-(g.documentElement.scrollTop||g.body.scrollTop)
|
---|
12977 | }else{
|
---|
12978 | m=Dwt.toWindow(n,0,0,null,true);
|
---|
12979 | var t=document.getElementById(this._spellCheckDivId);
|
---|
12980 | m.x-=t.scrollLeft;
|
---|
12981 | m.y-=t.scrollTop
|
---|
12982 | }
|
---|
12983 | m.y+=n.offsetHeight;
|
---|
12984 | if(m.y+a.y>c.y){
|
---|
12985 | m.y-=a.y+n.offsetHeight
|
---|
12986 | }
|
---|
12987 | d.menu.popup(0,m.x,m.y);
|
---|
12988 | f._stopPropagation=true;
|
---|
12989 | f._returnValue=false
|
---|
12990 | }};
|
---|
12991 | ZmHtmlEditor.prototype._spellCheckCreateMenu=function(d,c,l,t,o,u){
|
---|
12992 | var a=new ZmPopupMenu(d);
|
---|
12993 | if(u){
|
---|
12994 | var s="<b>"+t+"</b>";
|
---|
12995 | this._spellCheckCreateMenuItem(a,"orig",{
|
---|
12996 | text:s}
|
---|
12997 | ,c,t,t,o)
|
---|
12998 | }
|
---|
12999 | if(l.length>0){
|
---|
13000 | for(var n=0;
|
---|
13001 | n<l.length;
|
---|
13002 | ++n){
|
---|
13003 | this._spellCheckCreateMenuItem(a,"sug-"+n,{
|
---|
13004 | text:l[n],className:""}
|
---|
13005 | ,c,l[n],t,o)
|
---|
13006 | }
|
---|
13007 | if(!(d instanceof DwtMenuItem)&&this._spellCheck.wordIds[t].length>1){
|
---|
13008 | if(!this._replaceAllFormatter){
|
---|
13009 | this._replaceAllFormatter=new AjxMessageFormat(ZmMsg.replaceAllMenu)
|
---|
13010 | }
|
---|
13011 | var s="<i>"+this._replaceAllFormatter.format(this._spellCheck.wordIds[t].length)+"</i>";
|
---|
13012 | var m=a.createMenuItem("fixall",{
|
---|
13013 | text:s}
|
---|
13014 | );
|
---|
13015 | var e=this._spellCheckCreateMenu(m,1,l,t,o,u);
|
---|
13016 | m.setMenu(e)
|
---|
13017 | }}else{
|
---|
13018 | var m=this._spellCheckCreateMenuItem(a,"noop",{
|
---|
13019 | text:ZmMsg.noSuggestions}
|
---|
13020 | ,c,"",t,o);
|
---|
13021 | m.setEnabled(false);
|
---|
13022 | this._spellCheckCreateMenuItem(a,"clear",{
|
---|
13023 | text:"<i>"+ZmMsg.clearText+"</i>"}
|
---|
13024 | ,c,"",t,o)
|
---|
13025 | }
|
---|
13026 | a.createSeparator();
|
---|
13027 | var h=this._mode==DwtHtmlEditor.TEXT;
|
---|
13028 | if(h){
|
---|
13029 | var s=c?ZmMsg.editAll:ZmMsg.edit;
|
---|
13030 | this._spellCheckCreateMenuItem(a,"edit",{
|
---|
13031 | text:s}
|
---|
13032 | ,c,null,t,o)
|
---|
13033 | }
|
---|
13034 | if(!c){
|
---|
13035 | this._spellCheckCreateMenuItem(a,"ignore",{
|
---|
13036 | text:ZmMsg.ignoreWord}
|
---|
13037 | ,0,null,t,o)
|
---|
13038 | }
|
---|
13039 | if(!c&&appCtxt.get(ZmSetting.SPELL_CHECK_ADD_WORD_ENABLED)){
|
---|
13040 | this._spellCheckCreateMenuItem(a,"add",{
|
---|
13041 | text:ZmMsg.addWord}
|
---|
13042 | ,c,null,t,o)
|
---|
13043 | }
|
---|
13044 | return a
|
---|
13045 | };
|
---|
13046 | ZmHtmlEditor.prototype._spellCheckCreateMenuItem=function(a,t,o,s,h,e,n,i){
|
---|
13047 | if(o.className==null){
|
---|
13048 | o.className="ZMenuItem ZmSpellMenuItem"
|
---|
13049 | }
|
---|
13050 | var l=a.createMenuItem(t,o);
|
---|
13051 | l.setData("fixall",s);
|
---|
13052 | l.setData("value",h);
|
---|
13053 | l.setData("orig",e);
|
---|
13054 | l.setData("spanId",n);
|
---|
13055 | l.addSelectionListener(i||this._spellCheckSuggestionListenerObj);
|
---|
13056 | return l
|
---|
13057 | };
|
---|
13058 | ZmHtmlEditor.prototype._spellCheckCallback=function(i){
|
---|
13059 | var e=false;
|
---|
13060 | if(i&&i.available){
|
---|
13061 | var a=i.misspelled;
|
---|
13062 | if(a==null||a.length==0){
|
---|
13063 | appCtxt.setStatusMsg(ZmMsg.noMisspellingsFound,ZmStatusView.LEVEL_INFO)
|
---|
13064 | }else{
|
---|
13065 | var t=AjxMessageFormat.format(ZmMsg.misspellingsResult,a.length);
|
---|
13066 | appCtxt.setStatusMsg(t,ZmStatusView.LEVEL_WARNING);
|
---|
13067 | this.highlightMisspelledWords(a);
|
---|
13068 | e=true
|
---|
13069 | }}else{
|
---|
13070 | appCtxt.setStatusMsg(ZmMsg.spellCheckUnavailable,ZmStatusView.LEVEL_CRITICAL)
|
---|
13071 | }
|
---|
13072 | if(AjxEnv.isGeckoBased&&this._mode==DwtHtmlEditor.HTML){
|
---|
13073 | setTimeout(AjxCallback.simpleClosure(this.focus,this),10)
|
---|
13074 | }
|
---|
13075 | if(this.onExitSpellChecker){
|
---|
13076 | this.onExitSpellChecker.run(e)
|
---|
13077 | }};
|
---|
13078 | ZmHtmlEditor.prototype._enableDesignMode=function(e){
|
---|
13079 | if(!e){
|
---|
13080 | return
|
---|
13081 | }
|
---|
13082 | if(!(AjxEnv.isGeckoBased&&this.ACE_ENABLED)){
|
---|
13083 | return DwtHtmlEditor.prototype._enableDesignMode.call(this,e)
|
---|
13084 | }
|
---|
13085 | if(!this._hasGeckoFocusHacks){
|
---|
13086 | this.__enableGeckoFocusHacks()
|
---|
13087 | }
|
---|
13088 | this._getIframeWin().addEventListener("blur",this._designModeHack_blur,true);
|
---|
13089 | this._getIframeWin().addEventListener("focus",this._designModeHack_focus,true)
|
---|
13090 | };
|
---|
13091 | ZmHtmlEditor.prototype.__enableGeckoFocusHacks=function(){
|
---|
13092 | var t=null;
|
---|
13093 | var a=0;
|
---|
13094 | this._hasGeckoFocusHacks=true;
|
---|
13095 | function e(n){
|
---|
13096 | var o=[];
|
---|
13097 | for(var s=0;
|
---|
13098 | s<this._toolbars.length;
|
---|
13099 | s++){
|
---|
13100 | o=o.concat(this._toolbars[s].getChildren())
|
---|
13101 | }
|
---|
13102 | for(var s=0;
|
---|
13103 | s<o.length;
|
---|
13104 | ++s){
|
---|
13105 | o[s].setEnabled(n)
|
---|
13106 | }}
|
---|
13107 | this._designModeHack_blur=AjxCallback.simpleClosure(function(u){
|
---|
13108 | if(a<0){
|
---|
13109 | return
|
---|
13110 | }
|
---|
13111 | var c=false;
|
---|
13112 | var h=DwtShell.mouseEvent;
|
---|
13113 | h.setFromDhtmlEvent(u,true);
|
---|
13114 | var n=appCtxt.getKeyboardMgr();
|
---|
13115 | if(n&&n.__focusObj){
|
---|
13116 | for(var l=0;
|
---|
13117 | l<this._toolbars.length;
|
---|
13118 | l++){
|
---|
13119 | if((n.__focusObj==this._toolbars[l])||(n.__focusObj.parent==this._toolbars[l])){
|
---|
13120 | c=true;
|
---|
13121 | break
|
---|
13122 | }}}
|
---|
13123 | e.call(this,c);
|
---|
13124 | var m=this._getIframeDoc();
|
---|
13125 | Dwt.enableDesignMode(m,false);
|
---|
13126 | a=-1;
|
---|
13127 | if(this._ace_componentsLoading>0){
|
---|
13128 | return
|
---|
13129 | }
|
---|
13130 | try{
|
---|
13131 | var s=this._getIframeWin().getSelection();
|
---|
13132 | var l=0,o;
|
---|
13133 | try{
|
---|
13134 | t=[];
|
---|
13135 | while(o=s.getRangeAt(l++)){
|
---|
13136 | t.push(o)
|
---|
13137 | }}
|
---|
13138 | catch(d){}
|
---|
13139 | s.removeAllRanges()
|
---|
13140 | }
|
---|
13141 | catch(d){
|
---|
13142 | t=null
|
---|
13143 | }}
|
---|
13144 | ,this);
|
---|
13145 | e.call(this,false);
|
---|
13146 | this._designModeHack_focus=AjxCallback.simpleClosure(function(n){
|
---|
13147 | if(a>0){
|
---|
13148 | return
|
---|
13149 | }
|
---|
13150 | var h=this._getIframeDoc();
|
---|
13151 | var s=this._getIframeWin().getSelection();
|
---|
13152 | e.call(this,true);
|
---|
13153 | if(this._ace_componentsLoading>0){
|
---|
13154 | return
|
---|
13155 | }
|
---|
13156 | Dwt.enableDesignMode(h,true);
|
---|
13157 | if(!t||t.length==0){
|
---|
13158 | r=h.createRange();
|
---|
13159 | r.selectNodeContents(h.body);
|
---|
13160 | r.collapse(true);
|
---|
13161 | t=[r]
|
---|
13162 | }
|
---|
13163 | s.removeAllRanges();
|
---|
13164 | for(var o=0;
|
---|
13165 | o<t.length;
|
---|
13166 | ++o){
|
---|
13167 | s.addRange(t[o])
|
---|
13168 | }
|
---|
13169 | t=null;
|
---|
13170 | a=1
|
---|
13171 | }
|
---|
13172 | ,this)
|
---|
13173 | };
|
---|
13174 | ZmHtmlEditor.WRAP_LENGTH=72;
|
---|
13175 | ZmHtmlEditor.HTML_QUOTE_PRE='<blockquote style="border-left:2px solid '+AjxStringUtil.HTML_QUOTE_COLOR+';margin-left:5px;padding-left:5px;">';
|
---|
13176 | ZmHtmlEditor.HTML_QUOTE_POST="</blockquote><br/>";
|
---|
13177 | ZmHtmlEditor.getWrapParams=function(a,e){
|
---|
13178 | e=e||{};
|
---|
13179 | var t={};
|
---|
13180 | t.htmlMode=a;
|
---|
13181 | t.len=ZmHtmlEditor.WRAP_LENGTH;
|
---|
13182 | t.eol=a?"<br/>":"\n";
|
---|
13183 | t.pre=(a||!e.prefix)?"":appCtxt.get(ZmSetting.REPLY_PREFIX)+" ";
|
---|
13184 | t.before=(a&&e.prefix)?ZmHtmlEditor.HTML_QUOTE_PRE:"";
|
---|
13185 | t.after=(a&&e.prefix)?ZmHtmlEditor.HTML_QUOTE_POST:"";
|
---|
13186 | return t
|
---|
13187 | };
|
---|
13188 | ZmHtmlEditorColorPicker=function(a,t,e){
|
---|
13189 | DwtButtonColorPicker.call(this,a,t,e)
|
---|
13190 | };
|
---|
13191 | ZmHtmlEditorColorPicker.prototype=new DwtButtonColorPicker;
|
---|
13192 | ZmHtmlEditorColorPicker.prototype.constructor=ZmHtmlEditorColorPicker;
|
---|
13193 | ZmHtmlEditorColorPicker.prototype.TEMPLATE="dwt.Widgets#ZToolbarButton"
|
---|
13194 | }
|
---|
13195 | if(AjxPackage.define("zimbraMail.share.view.htmlEditor.ZmAdvancedHtmlEditor")){
|
---|
13196 | ZmAdvancedHtmlEditor=function(a,t,i,o,e){
|
---|
13197 | if(arguments.length==0){
|
---|
13198 | return
|
---|
13199 | }
|
---|
13200 | this.isTinyMCE=window.isTinyMCE;
|
---|
13201 | this._mode=o;
|
---|
13202 | this._hasFocus={};
|
---|
13203 | this.initTinyMCEEditor(a,t,i,o,e);
|
---|
13204 | this._ignoreWords={}
|
---|
13205 | };
|
---|
13206 | ZmAdvancedHtmlEditor.TINY_MCE_PATH="/tiny_mce/3.2.6";
|
---|
13207 | ZmAdvancedHtmlEditor.prototype.toString=function(){
|
---|
13208 | return"ZmAdvancedHtmlEditor"
|
---|
13209 | };
|
---|
13210 | ZmAdvancedHtmlEditor.prototype.getEditor=function(){
|
---|
13211 | return(window.tinyMCE)?tinyMCE.get(this._bodyTextAreaId):null
|
---|
13212 | };
|
---|
13213 | ZmAdvancedHtmlEditor.prototype.getBodyFieldId=function(){
|
---|
13214 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
13215 | var e=this.getEditor();
|
---|
13216 | return e?this._bodyTextAreaId+"_ifr":this._bodyTextAreaId
|
---|
13217 | }
|
---|
13218 | return this._bodyTextAreaId
|
---|
13219 | };
|
---|
13220 | ZmAdvancedHtmlEditor.prototype.getBodyField=function(){
|
---|
13221 | return document.getElementById(this.getBodyFieldId())
|
---|
13222 | };
|
---|
13223 | ZmAdvancedHtmlEditor.prototype.resizeWidth=function(e){
|
---|
13224 | var t=document.getElementById(this._bodyTextAreaId+"_tbl");
|
---|
13225 | if(t){
|
---|
13226 | t.style.width=e
|
---|
13227 | }};
|
---|
13228 | ZmAdvancedHtmlEditor.prototype.setSize=function(e,n){
|
---|
13229 | var a=this.getEditor();
|
---|
13230 | var t=this.getBodyField();
|
---|
13231 | var o=this._mode==DwtHtmlEditor.HTML?10:8;
|
---|
13232 | e-=o+4;
|
---|
13233 | n-=o;
|
---|
13234 | if(e<0){
|
---|
13235 | e=0
|
---|
13236 | }
|
---|
13237 | if(n<0){
|
---|
13238 | n=0
|
---|
13239 | }
|
---|
13240 | var i=document.getElementById(this._bodyTextAreaId+"_tbl");
|
---|
13241 | if(a&&i){
|
---|
13242 | i.style.height=n+"px";
|
---|
13243 | i.style.width="100%"
|
---|
13244 | }
|
---|
13245 | if(this._mode==DwtHtmlEditor.HTML&&this.isTinyMCE){
|
---|
13246 | n-=26
|
---|
13247 | }
|
---|
13248 | t.style.width=e+5+"px";
|
---|
13249 | t.style.height=n+"px"
|
---|
13250 | };
|
---|
13251 | ZmAdvancedHtmlEditor.prototype.editorContainerFocus=function(){
|
---|
13252 | this.focus()
|
---|
13253 | };
|
---|
13254 | ZmAdvancedHtmlEditor.prototype.focus=function(){
|
---|
13255 | var t=this.getEditor();
|
---|
13256 | if(t){
|
---|
13257 | t.focus();
|
---|
13258 | this.setFocusStatus(true)
|
---|
13259 | }else{
|
---|
13260 | var e=this.getContentField();
|
---|
13261 | if(e){
|
---|
13262 | e.focus()
|
---|
13263 | }
|
---|
13264 | this.setFocusStatus(true,true)
|
---|
13265 | }};
|
---|
13266 | ZmAdvancedHtmlEditor.prototype.getTextVersion=function(){
|
---|
13267 | var t=this.getContentField();
|
---|
13268 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
13269 | var e=this.getEditor();
|
---|
13270 | return e?this._convertHtml2Text():""
|
---|
13271 | }
|
---|
13272 | return t.value
|
---|
13273 | };
|
---|
13274 | ZmAdvancedHtmlEditor.prototype.getContent=function(e,t){
|
---|
13275 | this.discardMisspelledWords();
|
---|
13276 | var o=this.getContentField();
|
---|
13277 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
13278 | var a=this.getEditor();
|
---|
13279 | var n={};
|
---|
13280 | n.format="raw";
|
---|
13281 | var i=a?a.getContent(n):(this._pendingContent||"");
|
---|
13282 | if(i=='<br mce_bogus="1">'||i=='<br mce_bogus="1"/>'){
|
---|
13283 | i=""
|
---|
13284 | }
|
---|
13285 | i=this._embedHtmlContent(i,e,t);
|
---|
13286 | return i
|
---|
13287 | }
|
---|
13288 | return o.value
|
---|
13289 | };
|
---|
13290 | ZmAdvancedHtmlEditor.prototype._embedHtmlContent=function(o,a,i){
|
---|
13291 | if(!a&&!i){
|
---|
13292 | return["<html><body>",o,"</body></html>"].join("")
|
---|
13293 | }
|
---|
13294 | if(i){
|
---|
13295 | var t=[];
|
---|
13296 | var e=0;
|
---|
13297 | if(a){
|
---|
13298 | t[e++]="<div";
|
---|
13299 | t[e++]=" style='font-family:";
|
---|
13300 | t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
|
---|
13301 | t[e++]="; font-size: ";
|
---|
13302 | t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
|
---|
13303 | t[e++]="; color: ";
|
---|
13304 | t[e++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
|
---|
13305 | t[e++]=";'>";
|
---|
13306 | t[e++]=o;
|
---|
13307 | t[e++]="</div>"
|
---|
13308 | }else{
|
---|
13309 | t[e++]=o
|
---|
13310 | }
|
---|
13311 | return t.join("")
|
---|
13312 | }
|
---|
13313 | var n="<style type='text/css'>p { margin: 0; }</style>";
|
---|
13314 | if(a){
|
---|
13315 | o=this._getFontStyle(o)
|
---|
13316 | }
|
---|
13317 | return["<html><head>",n,"</head><body>",o,"</body></html>"].join("")
|
---|
13318 | };
|
---|
13319 | ZmAdvancedHtmlEditor.prototype._getFontStyle=function(o){
|
---|
13320 | var e=[],t=0;
|
---|
13321 | e[t++]="<div style='font-family: ";
|
---|
13322 | e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
|
---|
13323 | e[t++]="; font-size: ";
|
---|
13324 | e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
|
---|
13325 | e[t++]="; color: ";
|
---|
13326 | e[t++]=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR);
|
---|
13327 | e[t++]="'>";
|
---|
13328 | e[t++]=o;
|
---|
13329 | e[t++]="</div>";
|
---|
13330 | return e.join("")
|
---|
13331 | };
|
---|
13332 | ZmAdvancedHtmlEditor.prototype.setContent=function(t){
|
---|
13333 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
13334 | var e=this.getEditor();
|
---|
13335 | if(e&&this._editorInitialized){
|
---|
13336 | e.setContent(t,{
|
---|
13337 | format:"raw"}
|
---|
13338 | )
|
---|
13339 | }else{
|
---|
13340 | this._pendingContent=t
|
---|
13341 | }}else{
|
---|
13342 | var a=this.getContentField();
|
---|
13343 | a.value=t
|
---|
13344 | }
|
---|
13345 | this._ignoreWords={}
|
---|
13346 | };
|
---|
13347 | ZmAdvancedHtmlEditor.prototype.reEnableDesignMode=function(){};
|
---|
13348 | ZmAdvancedHtmlEditor.prototype.getMode=function(){
|
---|
13349 | return this._mode
|
---|
13350 | };
|
---|
13351 | ZmAdvancedHtmlEditor.prototype.isHtmlModeInited=function(){
|
---|
13352 | return Boolean(this.getEditor())
|
---|
13353 | };
|
---|
13354 | ZmAdvancedHtmlEditor.prototype._convertHtml2Text=function(){
|
---|
13355 | var e=this.getEditor();
|
---|
13356 | var t=e&&e.getDoc();
|
---|
13357 | return(t&&t.body)?this._convertHtml2TextContinue(t.body):""
|
---|
13358 | };
|
---|
13359 | ZmAdvancedHtmlEditor.prototype._convertHtml2TextContinue=function(a){
|
---|
13360 | var i=[];
|
---|
13361 | var t=0;
|
---|
13362 | var e={};
|
---|
13363 | AjxStringUtil._traverse(a,i,t,AjxStringUtil._NO_LIST,0,0,e);
|
---|
13364 | if(i.length&&i[0]=="\n\n"){
|
---|
13365 | i[0]=""
|
---|
13366 | }
|
---|
13367 | return i.join("")
|
---|
13368 | };
|
---|
13369 | ZmAdvancedHtmlEditor.prototype.moveCaretToTop=function(){
|
---|
13370 | var i=document.activeElement;
|
---|
13371 | if(this._mode==DwtHtmlEditor.TEXT){
|
---|
13372 | var a=this.getContentField();
|
---|
13373 | if(a.createTextRange){
|
---|
13374 | var e=a.createTextRange();
|
---|
13375 | e.collapse(true);
|
---|
13376 | e.select()
|
---|
13377 | }else{
|
---|
13378 | if(a.setSelectionRange){
|
---|
13379 | a.setSelectionRange(0,0)
|
---|
13380 | }}}else{
|
---|
13381 | this._moveCaretToTopHtml(true)
|
---|
13382 | }
|
---|
13383 | try{
|
---|
13384 | if(i){
|
---|
13385 | i.focus()
|
---|
13386 | }}
|
---|
13387 | catch(t){}};
|
---|
13388 | ZmAdvancedHtmlEditor.prototype._moveCaretToTopHtml=function(t){
|
---|
13389 | var i=this.getEditor();
|
---|
13390 | if(!i){
|
---|
13391 | return
|
---|
13392 | }
|
---|
13393 | var e=i.getDoc().body;
|
---|
13394 | var n=false;
|
---|
13395 | if(AjxEnv.isIE){
|
---|
13396 | if(e){
|
---|
13397 | e.createTextRange().collapse(true);
|
---|
13398 | n=true
|
---|
13399 | }}else{
|
---|
13400 | var a=i.selection?i.selection.getSel():"";
|
---|
13401 | if(a){
|
---|
13402 | a.collapse(e,0);
|
---|
13403 | n=true
|
---|
13404 | }}
|
---|
13405 | if(!n&&t){
|
---|
13406 | var o=new AjxTimedAction(this,this._moveCaretToTopHtml);
|
---|
13407 | AjxTimedAction.scheduleAction(o,DwtHtmlEditor._INITDELAY+1)
|
---|
13408 | }};
|
---|
13409 | ZmAdvancedHtmlEditor.prototype.getEditorContainer=function(){
|
---|
13410 | return this._editorContainer
|
---|
13411 | };
|
---|
13412 | ZmAdvancedHtmlEditor.prototype.hasFocus=function(){
|
---|
13413 | return Boolean(this._hasFocus[this._mode])
|
---|
13414 | };
|
---|
13415 | ZmAdvancedHtmlEditor.prototype._getIframeDoc=function(){
|
---|
13416 | var e=this.getEditor();
|
---|
13417 | return e?e.getDoc():null
|
---|
13418 | };
|
---|
13419 | ZmAdvancedHtmlEditor.prototype._getIframeWin=function(){
|
---|
13420 | var e=this.getEditor();
|
---|
13421 | return e?e.getWin():null
|
---|
13422 | };
|
---|
13423 | ZmAdvancedHtmlEditor.prototype.clear=function(){
|
---|
13424 | this.setPendingContent(null);
|
---|
13425 | var e=this.getEditor();
|
---|
13426 | if(e){
|
---|
13427 | e.setContent("",{
|
---|
13428 | format:"raw"}
|
---|
13429 | )
|
---|
13430 | }
|
---|
13431 | var t=this.getContentField();
|
---|
13432 | if(t){
|
---|
13433 | t.value=""
|
---|
13434 | }};
|
---|
13435 | ZmAdvancedHtmlEditor.prototype.reparentHtmlElement=function(t,e){
|
---|
13436 | return this._editorContainer.reparentHtmlElement(t,e)
|
---|
13437 | };
|
---|
13438 | ZmAdvancedHtmlEditor.prototype.getParent=function(){
|
---|
13439 | return this._editorContainer.parent
|
---|
13440 | };
|
---|
13441 | ZmAdvancedHtmlEditor.prototype.getInputElement=function(){
|
---|
13442 | return document.getElementById(this._bodyTextAreaId)
|
---|
13443 | };
|
---|
13444 | ZmAdvancedHtmlEditor.prototype.initTinyMCEEditor=function(h,a,s,n,l){
|
---|
13445 | var i={
|
---|
13446 | parent:h,posStyle:a,mode:n,content:s,withAce:l,className:"ZmHtmlEditor"};
|
---|
13447 | this._editorContainer=new ZmEditorContainer(i);
|
---|
13448 | var t=this._editorContainer.getHtmlElement();
|
---|
13449 | var e=this._bodyTextAreaId=this._editorContainer.getHTMLElId()+"_content";
|
---|
13450 | var d=document.createElement("textarea");
|
---|
13451 | d.setAttribute("id",e);
|
---|
13452 | d.setAttribute("name",e);
|
---|
13453 | d.className="DwtHtmlEditorTextArea";
|
---|
13454 | t.appendChild(d);
|
---|
13455 | this._textAreaId=e;
|
---|
13456 | Dwt.setHandler(d,DwtEvent.ONFOCUS,AjxCallback.simpleClosure(this.setFocusStatus,this,true,true));
|
---|
13457 | Dwt.setHandler(d,DwtEvent.ONBLUR,AjxCallback.simpleClosure(this.setFocusStatus,this,false,true));
|
---|
13458 | this._editorContainer.setFocusMember(d);
|
---|
13459 | if(s!=null){
|
---|
13460 | this.setPendingContent(s)
|
---|
13461 | }
|
---|
13462 | if(!window.tinyMCE){
|
---|
13463 | var c=new AjxCallback(this,this.initEditorManager,[e,n,s]);
|
---|
13464 | var o={
|
---|
13465 | name:"tiny_mce",path:appContextPath+ZmAdvancedHtmlEditor.TINY_MCE_PATH+"/tiny_mce.js",extension:".js",method:AjxPackage.METHOD_XHR_SYNC,async:false,callback:null,scripts:[],basePath:appContextPath+ZmAdvancedHtmlEditor.TINY_MCE_PATH};
|
---|
13466 | AjxPackage.require(o);
|
---|
13467 | this.initEditorManager(e,n,s)
|
---|
13468 | }else{
|
---|
13469 | this.initEditorManager(e,n,s)
|
---|
13470 | }};
|
---|
13471 | ZmAdvancedHtmlEditor.prototype.getPendingContent=function(){
|
---|
13472 | return this._pendingContent
|
---|
13473 | };
|
---|
13474 | ZmAdvancedHtmlEditor.prototype.setPendingContent=function(e){
|
---|
13475 | this._pendingContent=e
|
---|
13476 | };
|
---|
13477 | ZmAdvancedHtmlEditor.prototype.addOnContentIntializedListener=function(e){
|
---|
13478 | this._onContentInitializeCallback=e
|
---|
13479 | };
|
---|
13480 | ZmAdvancedHtmlEditor.prototype.removeOnContentIntializedListener=function(){
|
---|
13481 | this._onContentInitializeCallback=null
|
---|
13482 | };
|
---|
13483 | ZmAdvancedHtmlEditor.prototype._handleEditorKeyEvent=function(t,e){
|
---|
13484 | var i=true;
|
---|
13485 | var a=null;
|
---|
13486 | if(DwtKeyEvent.isKeyPressEvent(t)){
|
---|
13487 | if(DwtKeyboardMgr.isPossibleInputShortcut(t)){
|
---|
13488 | i=DwtKeyboardMgr.__keyDownHdlr(t)
|
---|
13489 | }}
|
---|
13490 | if(window.DwtIdleTimer){
|
---|
13491 | DwtIdleTimer.resetIdle()
|
---|
13492 | }
|
---|
13493 | return i
|
---|
13494 | };
|
---|
13495 | ZmAdvancedHtmlEditor.prototype.onLoadContent=function(t){
|
---|
13496 | var e=this.getPendingContent();
|
---|
13497 | if(e!=null){
|
---|
13498 | t.setContent(e,{
|
---|
13499 | format:"raw"}
|
---|
13500 | );
|
---|
13501 | this.setPendingContent(null)
|
---|
13502 | }
|
---|
13503 | if(this._onContentInitializeCallback){
|
---|
13504 | this._onContentInitializeCallback.run()
|
---|
13505 | }};
|
---|
13506 | ZmAdvancedHtmlEditor.prototype.setFocusStatus=function(a,e){
|
---|
13507 | var t=e?DwtHtmlEditor.TEXT:DwtHtmlEditor.HTML;
|
---|
13508 | this._hasFocus[t]=a
|
---|
13509 | };
|
---|
13510 | ZmAdvancedHtmlEditor.prototype.initEditorManager=function(t,s,h){
|
---|
13511 | var o=this;
|
---|
13512 | function n(d){
|
---|
13513 | o.onLoadContent(d);
|
---|
13514 | o.initDefaultFontSize(d)
|
---|
13515 | }
|
---|
13516 | function c(d){
|
---|
13517 | o.initDefaultFontSize(d);
|
---|
13518 | tinymce.dom.Event.add(d.getWin(),"focus",function(m){
|
---|
13519 | o.setFocusStatus(true)
|
---|
13520 | }
|
---|
13521 | );
|
---|
13522 | tinymce.dom.Event.add(d.getWin(),"blur",function(m){
|
---|
13523 | o.setFocusStatus(false)
|
---|
13524 | }
|
---|
13525 | );
|
---|
13526 | var u=o.getEditorContainer();
|
---|
13527 | u.setFocusMember(d.getWin());
|
---|
13528 | o._editorInitialized=true
|
---|
13529 | }
|
---|
13530 | function i(d,u){
|
---|
13531 | return o._handleEditorKeyEvent(u,d)
|
---|
13532 | }
|
---|
13533 | var a=AjxStringUtil.parseURL(location.href);
|
---|
13534 | tinymce.baseURL=appContextPath+ZmAdvancedHtmlEditor.TINY_MCE_PATH+"/";
|
---|
13535 | if(tinymce.EditorManager){
|
---|
13536 | tinymce.EditorManager.baseURI=new tinymce.util.URI(a.protocol+"://"+a.authority+tinymce.baseURL)
|
---|
13537 | }
|
---|
13538 | if(tinymce.dom){
|
---|
13539 | tinymce.DOM=new tinymce.dom.DOMUtils(document,{
|
---|
13540 | process_html:0}
|
---|
13541 | )
|
---|
13542 | }
|
---|
13543 | if(tinymce.dom&&tinymce.dom.Event){
|
---|
13544 | tinymce.dom.Event.domLoaded=true
|
---|
13545 | }
|
---|
13546 | var l=appCtxt.get(ZmSetting.LOCALE_NAME);
|
---|
13547 | var e=appContextPath+"/css/editor_ui.css?v="+window.cacheKillerVersion+"&skin="+appCurrentSkin+"&locale="+l;
|
---|
13548 | tinyMCE.init({
|
---|
13549 | mode:(s==DwtHtmlEditor.HTML)?"exact":"none",elements:t,plugins:"table,ztable,inlinepopups,zcontextmenu,fullscreen,zbreakquote",theme:"advanced",theme_advanced_buttons1:"fontselect,fontsizeselect,formatselect,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,bold,italic,underline,separator,forecolor,backcolor,separator,link,ztablecontrols,fullscreen",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_buttons4:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_resizing:true,convert_urls:false,verify_html:false,gecko_spellcheck:true,force_br_newlines:true,forced_root_block:"",force_p_newlines:false,content_css:false,editor_css:e,inline_styles:false,setup:function(d){
|
---|
13550 | d.onLoadContent.add(n);
|
---|
13551 | d.onInit.add(c);
|
---|
13552 | d.onKeyPress.add(i)
|
---|
13553 | }}
|
---|
13554 | );
|
---|
13555 | this._editor=this.getEditor();
|
---|
13556 | this._iFrameId=this._bodyTextAreaId+"_ifr"
|
---|
13557 | };
|
---|
13558 | ZmAdvancedHtmlEditor.prototype.setMode=function(s,o){
|
---|
13559 | this.discardMisspelledWords();
|
---|
13560 | if(s==this._mode||(s!=DwtHtmlEditor.HTML&&s!=DwtHtmlEditor.TEXT)){
|
---|
13561 | return
|
---|
13562 | }
|
---|
13563 | this._mode=s;
|
---|
13564 | var e=this.getEditor();
|
---|
13565 | if(s==DwtHtmlEditor.HTML){
|
---|
13566 | var n=this.getContentField();
|
---|
13567 | if(e&&e.getDoc()){
|
---|
13568 | var i=e.getDoc();
|
---|
13569 | var a=o?AjxStringUtil.convertToHtml(n.value):n.value;
|
---|
13570 | i.body.innerHTML=a;
|
---|
13571 | this._pendingContent=a;
|
---|
13572 | n.value="";
|
---|
13573 | this._editorContainer.setFocusMember(e.getWin())
|
---|
13574 | }else{
|
---|
13575 | var a=o?AjxStringUtil.convertToHtml(n.value):n.value;
|
---|
13576 | this._pendingContent=a
|
---|
13577 | }
|
---|
13578 | tinyMCE.execCommand("mceToggleEditor",false,this._bodyTextAreaId)
|
---|
13579 | }else{
|
---|
13580 | var n=this.getContentField();
|
---|
13581 | var i=e.getDoc();
|
---|
13582 | var t=o?this._convertHtml2Text():i.innerHTML;
|
---|
13583 | tinyMCE.execCommand("mceToggleEditor",false,this._bodyTextAreaId);
|
---|
13584 | n.value=t;
|
---|
13585 | this._editorContainer.setFocusMember(n)
|
---|
13586 | }};
|
---|
13587 | ZmAdvancedHtmlEditor.prototype.getContentField=function(){
|
---|
13588 | return document.getElementById(this._bodyTextAreaId)
|
---|
13589 | };
|
---|
13590 | ZmAdvancedHtmlEditor.prototype.insertImage=function(n,s,o,t){
|
---|
13591 | var i=[];
|
---|
13592 | var e=0;
|
---|
13593 | i[e++]="<img";
|
---|
13594 | i[e++]=" src='";
|
---|
13595 | i[e++]=n;
|
---|
13596 | i[e++]="'";
|
---|
13597 | if(o!=null){
|
---|
13598 | i[e++]=" width='"+o+"'"
|
---|
13599 | }
|
---|
13600 | if(t!=null){
|
---|
13601 | i[e++]=" height='"+t+"'"
|
---|
13602 | }
|
---|
13603 | i[e++]=">";
|
---|
13604 | var a=this.getEditor();
|
---|
13605 | if(tinymce.isWebKit){
|
---|
13606 | a.getWin().focus()
|
---|
13607 | }
|
---|
13608 | a.execCommand("mceInsertContent",false,i.join(""),{
|
---|
13609 | skip_undo:1}
|
---|
13610 | )
|
---|
13611 | };
|
---|
13612 | ZmAdvancedHtmlEditor.prototype.initDefaultFontSize=function(e){
|
---|
13613 | var t=e&&e.getDoc();
|
---|
13614 | if(t){
|
---|
13615 | t.body.style.fontFamily=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY);
|
---|
13616 | t.body.style.fontSize=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE);
|
---|
13617 | t.body.style.color=appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR)
|
---|
13618 | }};
|
---|
13619 | ZmAdvancedHtmlEditor.prototype.addCSSForDefaultFontSize=function(t){
|
---|
13620 | var a="body,td,pre";
|
---|
13621 | var e=["font-family:",appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_FAMILY),";","font-size:",appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_SIZE),";","color:",appCtxt.get(ZmSetting.COMPOSE_INIT_FONT_COLOR),";"].join("");
|
---|
13622 | var i=t?t.getDoc():null;
|
---|
13623 | if(i){
|
---|
13624 | this.insertDefaultCSS(i,a,e)
|
---|
13625 | }};
|
---|
13626 | ZmAdvancedHtmlEditor.prototype.insertDefaultCSS=function(o,i,t){
|
---|
13627 | var a,e;
|
---|
13628 | if(o.createStyleSheet){
|
---|
13629 | a=o.createStyleSheet()
|
---|
13630 | }else{
|
---|
13631 | e=o.createElement("style");
|
---|
13632 | o.getElementsByTagName("head")[0].appendChild(e);
|
---|
13633 | a=e.styleSheet?e.styleSheet:e.sheet
|
---|
13634 | }
|
---|
13635 | if(!a&&e){
|
---|
13636 | t=t.replace(/^\{?([^\}])/,"$1");
|
---|
13637 | e.innerHTML=i+t
|
---|
13638 | }else{
|
---|
13639 | if(a.addRule){
|
---|
13640 | t=t.replace(/^\{?([^\}])/,"$1");
|
---|
13641 | a.addRule(i,t)
|
---|
13642 | }else{
|
---|
13643 | if(a.insertRule){
|
---|
13644 | if(!/^\{[^\}]*\}$/.test(t)){
|
---|
13645 | t="{"+t+"}"
|
---|
13646 | }
|
---|
13647 | a.insertRule(i+" "+t,a.cssRules.length)
|
---|
13648 | }}}};
|
---|
13649 | ZmAdvancedHtmlEditor.prototype.resetSpellCheck=function(){
|
---|
13650 | this.discardMisspelledWords();
|
---|
13651 | this._spellCheckHideModeDiv()
|
---|
13652 | };
|
---|
13653 | ZmAdvancedHtmlEditor.prototype.checkMisspelledWords=function(o,t,e){
|
---|
13654 | var i=this.getTextVersion();
|
---|
13655 | if(/\S/.test(i)){
|
---|
13656 | AjxDispatcher.require("Extras");
|
---|
13657 | this._spellChecker=new ZmSpellChecker(this);
|
---|
13658 | this._spellCheck=null;
|
---|
13659 | this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
|
---|
13660 | if(!this.onExitSpellChecker){
|
---|
13661 | this.onExitSpellChecker=t
|
---|
13662 | }
|
---|
13663 | var a={
|
---|
13664 | text:i,ignore:AjxUtil.keys(this._ignoreWords).join()};
|
---|
13665 | this._spellChecker.check(a,o,e);
|
---|
13666 | return true
|
---|
13667 | }
|
---|
13668 | return false
|
---|
13669 | };
|
---|
13670 | ZmAdvancedHtmlEditor.prototype.spellCheck=function(a){
|
---|
13671 | var t=this.getTextVersion();
|
---|
13672 | if(/\S/.test(t)){
|
---|
13673 | AjxDispatcher.require("Extras");
|
---|
13674 | this._spellChecker=new ZmSpellChecker(this);
|
---|
13675 | this._spellCheck=null;
|
---|
13676 | this._spellCheckSuggestionListenerObj=new AjxListener(this,this._spellCheckSuggestionListener);
|
---|
13677 | if(!this.onExitSpellChecker){
|
---|
13678 | this.onExitSpellChecker=a
|
---|
13679 | }
|
---|
13680 | var e={
|
---|
13681 | text:t,ignore:AjxUtil.keys(this._ignoreWords).join()};
|
---|
13682 | this._spellChecker.check(e,new AjxCallback(this,this._spellCheckCallback));
|
---|
13683 | return true
|
---|
13684 | }
|
---|
13685 | return false
|
---|
13686 | };
|
---|
13687 | ZmAdvancedHtmlEditor.prototype._spellCheckCallback=function(i){
|
---|
13688 | var e=false;
|
---|
13689 | if(i&&i.available){
|
---|
13690 | var a=i.misspelled;
|
---|
13691 | if(a==null||a.length==0){
|
---|
13692 | appCtxt.setStatusMsg(ZmMsg.noMisspellingsFound,ZmStatusView.LEVEL_INFO)
|
---|
13693 | }else{
|
---|
13694 | var t=AjxMessageFormat.format(ZmMsg.misspellingsResult,a.length);
|
---|
13695 | appCtxt.setStatusMsg(t,ZmStatusView.LEVEL_WARNING);
|
---|
13696 | this.highlightMisspelledWords(a);
|
---|
13697 | e=true
|
---|
13698 | }}else{
|
---|
13699 | appCtxt.setStatusMsg(ZmMsg.spellCheckUnavailable,ZmStatusView.LEVEL_CRITICAL)
|
---|
13700 | }
|
---|
13701 | if(AjxEnv.isGeckoBased&&this._mode==DwtHtmlEditor.HTML){
|
---|
13702 | setTimeout(AjxCallback.simpleClosure(this.focus,this),10)
|
---|
13703 | }
|
---|
13704 | if(this.onExitSpellChecker){
|
---|
13705 | this.onExitSpellChecker.run(e)
|
---|
13706 | }};
|
---|
13707 | ZmAdvancedHtmlEditor.prototype._spellCheckSuggestionListener=function(h){
|
---|
13708 | var f=this;
|
---|
13709 | var m=h.item;
|
---|
13710 | var d=m.getData("orig");
|
---|
13711 | if(!d){
|
---|
13712 | return
|
---|
13713 | }
|
---|
13714 | var t=m.getData(ZmHtmlEditor._VALUE);
|
---|
13715 | var o=this._mode==DwtHtmlEditor.TEXT;
|
---|
13716 | var s=m.getData("fixall");
|
---|
13717 | var u=o?document:this._getIframeDoc();
|
---|
13718 | var c=u.getElementById(m.getData("spanId"));
|
---|
13719 | var i=m.getData(ZmPopupMenu.MENU_ITEM_ID_KEY);
|
---|
13720 | switch(i){
|
---|
13721 | case"ignore":t=d;
|
---|
13722 | this._ignoreWords[t]=true;
|
---|
13723 | if(s){}
|
---|
13724 | break;
|
---|
13725 | case"add":t=d;
|
---|
13726 | var l=AjxSoapDoc.create("ModifyPrefsRequest","urn:zimbraAccount");
|
---|
13727 | var n=l.set("pref",t);
|
---|
13728 | n.setAttribute("name","+zimbraPrefSpellIgnoreWord");
|
---|
13729 | var a={
|
---|
13730 | soapDoc:l,asyncMode:true,callback:new AjxCallback(appCtxt,appCtxt.setStatusMsg,[ZmMsg.wordAddedToDictionary])};
|
---|
13731 | appCtxt.getAppController().sendRequest(a);
|
---|
13732 | this._ignoreWords[t]=true;
|
---|
13733 | break;
|
---|
13734 | default:break
|
---|
13735 | }
|
---|
13736 | if(o&&t==null){
|
---|
13737 | this._editWord(s,c)
|
---|
13738 | }else{
|
---|
13739 | var e=s?this._spellCheck.wordIds[d]:c;
|
---|
13740 | this._editWordFix(e,t)
|
---|
13741 | }
|
---|
13742 | this._handleSpellCheckerEvents(null)
|
---|
13743 | };
|
---|
13744 | ZmAdvancedHtmlEditor.prototype._getEditorDocument=function(){
|
---|
13745 | var e=this._mode==DwtHtmlEditor.TEXT;
|
---|
13746 | return e?document:this._getIframeDoc()
|
---|
13747 | };
|
---|
13748 | ZmAdvancedHtmlEditor.prototype._editWord=function(s,e){
|
---|
13749 | var o=this._getEditorDocument();
|
---|
13750 | var t=o.createElement("input");
|
---|
13751 | t.type="text";
|
---|
13752 | t.value=AjxUtil.getInnerText(e);
|
---|
13753 | t.className="SpellCheckInputField";
|
---|
13754 | t.style.left=e.offsetLeft-2+"px";
|
---|
13755 | t.style.top=e.offsetTop-2+"px";
|
---|
13756 | t.style.width=e.offsetWidth+4+"px";
|
---|
13757 | var n=o.getElementById(this._spellCheckDivId);
|
---|
13758 | var i=n.scrollTop;
|
---|
13759 | n.appendChild(t);
|
---|
13760 | n.scrollTop=i;
|
---|
13761 | t.setAttribute("autocomplete","off");
|
---|
13762 | t.focus();
|
---|
13763 | if(!AjxEnv.isGeckoBased){
|
---|
13764 | t.select()
|
---|
13765 | }else{
|
---|
13766 | t.setSelectionRange(0,t.value.length)
|
---|
13767 | }
|
---|
13768 | var a=AjxCallback.simpleClosure(this._editWordHandler,this,s,e);
|
---|
13769 | t.onblur=a;
|
---|
13770 | t.onkeydown=a
|
---|
13771 | };
|
---|
13772 | ZmAdvancedHtmlEditor.prototype._editWordHandler=function(a,e,t){
|
---|
13773 | setTimeout(AjxCallback.simpleClosure(this._editWordHandler2,this,a,e,t),20)
|
---|
13774 | };
|
---|
13775 | ZmAdvancedHtmlEditor.prototype._editWordHandler2=function(s,o,h){
|
---|
13776 | h=DwtUiEvent.getEvent(h);
|
---|
13777 | var l=h.type;
|
---|
13778 | var t=h.keyCode;
|
---|
13779 | var i=h.ctrlKey;
|
---|
13780 | var c=DwtUiEvent.getTarget(h);
|
---|
13781 | var n=/key/.test(l);
|
---|
13782 | var a=true;
|
---|
13783 | if(/blur/.test(l)||(n&&t==13)){
|
---|
13784 | if(i){
|
---|
13785 | s=!s
|
---|
13786 | }
|
---|
13787 | var d=AjxUtil.getInnerText(o);
|
---|
13788 | var e=s?this._spellCheck.wordIds[d]:o;
|
---|
13789 | this._editWordFix(e,c.value)
|
---|
13790 | }else{
|
---|
13791 | if(n&&t==27){
|
---|
13792 | this._editWordFix(o,AjxUtil.getInnerText(o))
|
---|
13793 | }else{
|
---|
13794 | a=false
|
---|
13795 | }}
|
---|
13796 | if(a){
|
---|
13797 | c.onblur=null;
|
---|
13798 | c.onkeydown=null;
|
---|
13799 | if(c.parentNode){
|
---|
13800 | c.parentNode.removeChild(c)
|
---|
13801 | }}
|
---|
13802 | this._handleSpellCheckerEvents(null)
|
---|
13803 | };
|
---|
13804 | ZmAdvancedHtmlEditor.prototype._editWordFix=function(a,o){
|
---|
13805 | a=a instanceof Array?a:[a];
|
---|
13806 | var n=this._getEditorDocument();
|
---|
13807 | for(var t=a.length-1;
|
---|
13808 | t>=0;
|
---|
13809 | t--){
|
---|
13810 | var e=a[t];
|
---|
13811 | if(typeof e=="string"){
|
---|
13812 | e=n.getElementById(e)
|
---|
13813 | }
|
---|
13814 | if(e){
|
---|
13815 | e.innerHTML=o
|
---|
13816 | }}};
|
---|
13817 | ZmAdvancedHtmlEditor.prototype._getParentElement=function(){
|
---|
13818 | var e=this.getEditor();
|
---|
13819 | if(e.selection){
|
---|
13820 | return e.selection.getNode()
|
---|
13821 | }else{
|
---|
13822 | var t=this._getIframeDoc();
|
---|
13823 | return t?t.body:null
|
---|
13824 | }};
|
---|
13825 | ZmAdvancedHtmlEditor.prototype._handleSpellCheckerEvents=function(v){
|
---|
13826 | var l=this._mode==DwtHtmlEditor.TEXT;
|
---|
13827 | var u=l?(v?DwtUiEvent.getTarget(v):null):this._getParentElement(),g,f,y,c,d=this,e=this._spellCheck,k=l?document:this._getIframeDoc(),n=false,b="";
|
---|
13828 | if(v&&/^span$/i.test(u.tagName)&&/ZM-SPELLCHECK/.test(u.className)){
|
---|
13829 | b=u.getAttribute("word");
|
---|
13830 | window.status="Suggestions: "+e.suggestions[b].join(", ");
|
---|
13831 | n=b!=AjxUtil.getInnerText(u)
|
---|
13832 | }
|
---|
13833 | f=e.spanIds;
|
---|
13834 | for(y in f){
|
---|
13835 | g=k.getElementById(y);
|
---|
13836 | if(g){
|
---|
13837 | if(f[y]!=AjxUtil.getInnerText(g)||this._ignoreWords[f[y]]){
|
---|
13838 | g.className="ZM-SPELLCHECK-FIXED"
|
---|
13839 | }else{
|
---|
13840 | if(f[y]==b){
|
---|
13841 | g.className="ZM-SPELLCHECK-MISSPELLED2"
|
---|
13842 | }else{
|
---|
13843 | g.className="ZM-SPELLCHECK-MISSPELLED"
|
---|
13844 | }}}}
|
---|
13845 | if(e.menu&&(!v||(/click|mousedown|mouseup|contextmenu/.test(v.type)||(/key/.test(v.type)&&(!b||n))))){
|
---|
13846 | if(e.menu._menuItems.fixall){
|
---|
13847 | e.menu._menuItems.fixall.getMenu().dispose()
|
---|
13848 | }
|
---|
13849 | e.menu.dispose();
|
---|
13850 | e.menu=null;
|
---|
13851 | window.status=""
|
---|
13852 | }
|
---|
13853 | if(v&&b&&(c=e.suggestions[b])&&(/mouseup|contextmenu/i.test(v.type)||(l&&/(click|mousedown|contextmenu)/i.test(v.type)))&&(b==AjxUtil.getInnerText(u)&&!this._ignoreWords[b])){
|
---|
13854 | e.menu=this._spellCheckCreateMenu(this.getParent(),0,c,b,u.id,n);
|
---|
13855 | if(e.wordIds[b].length>1){
|
---|
13856 | e.menu.createSeparator();
|
---|
13857 | this._replaceAllFormatter=this._replaceAllFormatter||new AjxMessageFormat(ZmMsg.replaceAllMenu);
|
---|
13858 | var s=this._replaceAllFormatter.format(e.wordIds[b].length);
|
---|
13859 | var w=e.menu.createMenuItem("fixall",{
|
---|
13860 | text:s}
|
---|
13861 | );
|
---|
13862 | w.setMenu(makeMenu(1,w))
|
---|
13863 | }
|
---|
13864 | var o,m=e.menu.getSize(),t=this._editorContainer.shell.getSize();
|
---|
13865 | if(!l){
|
---|
13866 | o=Dwt.toWindow(document.getElementById(this._iFrameId),0,0,null,true);
|
---|
13867 | var a=Dwt.toWindow(u,0,0,null,true);
|
---|
13868 | o.x+=a.x-(k.documentElement.scrollLeft||k.body.scrollLeft);
|
---|
13869 | o.y+=a.y-(k.documentElement.scrollTop||k.body.scrollTop)
|
---|
13870 | }else{
|
---|
13871 | o=Dwt.toWindow(u,0,0,null,true);
|
---|
13872 | var h=document.getElementById(this._spellCheckDivId);
|
---|
13873 | o.x-=h.scrollLeft;
|
---|
13874 | o.y-=h.scrollTop
|
---|
13875 | }
|
---|
13876 | o.y+=u.offsetHeight;
|
---|
13877 | if(o.y+m.y>t.y){
|
---|
13878 | o.y-=m.y+u.offsetHeight
|
---|
13879 | }
|
---|
13880 | e.menu.popup(0,o.x,o.y);
|
---|
13881 | v._stopPropagation=true;
|
---|
13882 | v._returnValue=false
|
---|
13883 | }};
|
---|
13884 | ZmAdvancedHtmlEditor.prototype._spellCheckCreateMenu=function(d,c,l,t,o,u){
|
---|
13885 | var a=new ZmPopupMenu(d);
|
---|
13886 | if(u){
|
---|
13887 | var s="<b>"+t+"</b>";
|
---|
13888 | this._spellCheckCreateMenuItem(a,"orig",{
|
---|
13889 | text:s}
|
---|
13890 | ,c,t,t,o)
|
---|
13891 | }
|
---|
13892 | if(l.length>0){
|
---|
13893 | for(var n=0;
|
---|
13894 | n<l.length;
|
---|
13895 | ++n){
|
---|
13896 | this._spellCheckCreateMenuItem(a,"sug-"+n,{
|
---|
13897 | text:l[n],className:""}
|
---|
13898 | ,c,l[n],t,o)
|
---|
13899 | }
|
---|
13900 | if(!(d instanceof DwtMenuItem)&&this._spellCheck.wordIds[t].length>1){
|
---|
13901 | if(!this._replaceAllFormatter){
|
---|
13902 | this._replaceAllFormatter=new AjxMessageFormat(ZmMsg.replaceAllMenu)
|
---|
13903 | }
|
---|
13904 | var s="<i>"+this._replaceAllFormatter.format(this._spellCheck.wordIds[t].length)+"</i>";
|
---|
13905 | var m=a.createMenuItem("fixall",{
|
---|
13906 | text:s}
|
---|
13907 | );
|
---|
13908 | var e=this._spellCheckCreateMenu(m,1,l,t,o,u);
|
---|
13909 | m.setMenu(e)
|
---|
13910 | }}else{
|
---|
13911 | var m=this._spellCheckCreateMenuItem(a,"noop",{
|
---|
13912 | text:ZmMsg.noSuggestions}
|
---|
13913 | ,c,"",t,o);
|
---|
13914 | m.setEnabled(false);
|
---|
13915 | this._spellCheckCreateMenuItem(a,"clear",{
|
---|
13916 | text:"<i>"+ZmMsg.clearText+"</i>"}
|
---|
13917 | ,c,"",t,o)
|
---|
13918 | }
|
---|
13919 | a.createSeparator();
|
---|
13920 | var h=this._mode==DwtHtmlEditor.TEXT;
|
---|
13921 | if(h){
|
---|
13922 | var s=c?ZmMsg.editAll:ZmMsg.edit;
|
---|
13923 | this._spellCheckCreateMenuItem(a,"edit",{
|
---|
13924 | text:s}
|
---|
13925 | ,c,null,t,o)
|
---|
13926 | }
|
---|
13927 | if(!c){
|
---|
13928 | this._spellCheckCreateMenuItem(a,"ignore",{
|
---|
13929 | text:ZmMsg.ignoreWord}
|
---|
13930 | ,0,null,t,o)
|
---|
13931 | }
|
---|
13932 | if(!c&&appCtxt.get(ZmSetting.SPELL_CHECK_ADD_WORD_ENABLED)){
|
---|
13933 | this._spellCheckCreateMenuItem(a,"add",{
|
---|
13934 | text:ZmMsg.addWord}
|
---|
13935 | ,c,null,t,o)
|
---|
13936 | }
|
---|
13937 | return a
|
---|
13938 | };
|
---|
13939 | ZmAdvancedHtmlEditor.prototype._spellCheckCreateMenuItem=function(a,t,o,s,h,e,n,i){
|
---|
13940 | if(o.className==null){
|
---|
13941 | o.className="ZMenuItem ZmSpellMenuItem"
|
---|
13942 | }
|
---|
13943 | var l=a.createMenuItem(t,o);
|
---|
13944 | l.setData("fixall",s);
|
---|
13945 | l.setData("value",h);
|
---|
13946 | l.setData("orig",e);
|
---|
13947 | l.setData("spanId",n);
|
---|
13948 | l.addSelectionListener(i||this._spellCheckSuggestionListenerObj);
|
---|
13949 | return l
|
---|
13950 | };
|
---|
13951 | ZmAdvancedHtmlEditor.prototype.discardMisspelledWords=function(c){
|
---|
13952 | if(!this._spellCheck){
|
---|
13953 | return
|
---|
13954 | }
|
---|
13955 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
13956 | var s=this._getIframeDoc();
|
---|
13957 | s.body.style.display="none";
|
---|
13958 | var t=null;
|
---|
13959 | var h=this._spellCheck.spanIds;
|
---|
13960 | for(var n in h){
|
---|
13961 | var l=s.getElementById(n);
|
---|
13962 | if(!l){
|
---|
13963 | continue
|
---|
13964 | }
|
---|
13965 | t=l.parentNode;
|
---|
13966 | while(l.firstChild){
|
---|
13967 | t.insertBefore(l.firstChild,l)
|
---|
13968 | }
|
---|
13969 | t.removeChild(l)
|
---|
13970 | }
|
---|
13971 | if(!AjxEnv.isIE){
|
---|
13972 | s.body.normalize()
|
---|
13973 | }else{
|
---|
13974 | s.body.innerHTML=s.body.innerHTML
|
---|
13975 | }
|
---|
13976 | t=s.getElementById("ZM-SPELLCHECK-STYLE");
|
---|
13977 | if(t){
|
---|
13978 | t.parentNode.removeChild(t)
|
---|
13979 | }
|
---|
13980 | s.body.style.display="";
|
---|
13981 | this._unregisterEditorEventHandler(s,"contextmenu")
|
---|
13982 | }else{
|
---|
13983 | if(this._spellCheckDivId!=null){
|
---|
13984 | var e=document.getElementById(this._spellCheckDivId);
|
---|
13985 | var o=e.scrollTop;
|
---|
13986 | var a=document.getElementById(this._textAreaId);
|
---|
13987 | if(AjxEnv.isGeckoBased){
|
---|
13988 | e.innerHTML=AjxStringUtil.htmlDecode(e.innerHTML,true)
|
---|
13989 | }
|
---|
13990 | a.value=AjxUtil.getInnerText(e);
|
---|
13991 | e.onclick=null;
|
---|
13992 | e.oncontextmenu=null;
|
---|
13993 | e.onmousedown=null;
|
---|
13994 | e.parentNode.removeChild(e);
|
---|
13995 | a.style.display="";
|
---|
13996 | a.scrollTop=o
|
---|
13997 | }}
|
---|
13998 | this._spellCheckDivId=this._spellCheck=null;
|
---|
13999 | window.status="";
|
---|
14000 | if(!c){
|
---|
14001 | this._spellCheckHideModeDiv()
|
---|
14002 | }
|
---|
14003 | if(this.onExitSpellChecker){
|
---|
14004 | this.onExitSpellChecker.run()
|
---|
14005 | }};
|
---|
14006 | ZmAdvancedHtmlEditor.prototype._spellCheckShowModeDiv=function(){
|
---|
14007 | var o=this._editorContainer.getSize();
|
---|
14008 | if(!this._spellCheckModeDivId){
|
---|
14009 | var s=document.createElement("div");
|
---|
14010 | s.className="SpellCheckModeDiv";
|
---|
14011 | s.id=this._spellCheckModeDivId=Dwt.getNextId();
|
---|
14012 | var a=new Array();
|
---|
14013 | var t=0;
|
---|
14014 | a[t++]="<table border=0 cellpadding=0 cellspacing=0><tr><td style='width:25'>";
|
---|
14015 | a[t++]=AjxImg.getImageHtml("SpellCheck");
|
---|
14016 | a[t++]="</td><td style='white-space:nowrap'><span class='SpellCheckLink'>";
|
---|
14017 | a[t++]=ZmMsg.resumeEditing;
|
---|
14018 | a[t++]="</span> | <span class='SpellCheckLink'>";
|
---|
14019 | a[t++]=ZmMsg.checkAgain;
|
---|
14020 | a[t++]="</span></td></tr></table>";
|
---|
14021 | s.innerHTML=a.join("");
|
---|
14022 | var e=this._editorContainer.getHtmlElement();
|
---|
14023 | e.insertBefore(s,e.firstChild);
|
---|
14024 | var n=s.getElementsByTagName("span");
|
---|
14025 | Dwt.associateElementWithObject(n[0],this);
|
---|
14026 | Dwt.setHandler(n[0],"onclick",ZmAdvancedHtmlEditor._spellCheckResumeEditing);
|
---|
14027 | Dwt.associateElementWithObject(n[1],this);
|
---|
14028 | Dwt.setHandler(n[1],"onclick",ZmAdvancedHtmlEditor._spellCheckAgain)
|
---|
14029 | }else{
|
---|
14030 | document.getElementById(this._spellCheckModeDivId).style.display=""
|
---|
14031 | }
|
---|
14032 | this.setSize(o.x,o.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
|
---|
14033 | };
|
---|
14034 | ZmAdvancedHtmlEditor._spellCheckResumeEditing=function(){
|
---|
14035 | var e=Dwt.getObjectFromElement(this);
|
---|
14036 | e.discardMisspelledWords()
|
---|
14037 | };
|
---|
14038 | ZmAdvancedHtmlEditor._spellCheckAgain=function(){
|
---|
14039 | var e=Dwt.getObjectFromElement(this);
|
---|
14040 | e.discardMisspelledWords();
|
---|
14041 | e.spellCheck()
|
---|
14042 | };
|
---|
14043 | ZmAdvancedHtmlEditor.prototype._spellCheckHideModeDiv=function(){
|
---|
14044 | var e=this._editorContainer.getSize();
|
---|
14045 | if(this._spellCheckModeDivId){
|
---|
14046 | document.getElementById(this._spellCheckModeDivId).style.display="none"
|
---|
14047 | }
|
---|
14048 | this.setSize(e.x,e.y+(this._mode==DwtHtmlEditor.TEXT?1:2))
|
---|
14049 | };
|
---|
14050 | ZmAdvancedHtmlEditor.prototype.highlightMisspelledWords=function(m,t){
|
---|
14051 | this.discardMisspelledWords(t);
|
---|
14052 | var b,g,v,n,u=this,s={}
|
---|
14053 | ,f={}
|
---|
14054 | ,k=["([^A-Za-z0-9']|^)("],c={};
|
---|
14055 | for(var p=0;
|
---|
14056 | p<m.length;
|
---|
14057 | ++p){
|
---|
14058 | b=m[p].word;
|
---|
14059 | if(!c[b]){
|
---|
14060 | p&&k.push("|");
|
---|
14061 | k.push(b);
|
---|
14062 | var w=m[p].suggestions.split(/\s*,\s*/);
|
---|
14063 | if(!w[w.length-1]){
|
---|
14064 | w.pop()
|
---|
14065 | }
|
---|
14066 | c[b]=w;
|
---|
14067 | if(c[b].length>5){
|
---|
14068 | c[b].length=5
|
---|
14069 | }}}
|
---|
14070 | k.push(")([^A-Za-z0-9']|$)");
|
---|
14071 | k=new RegExp(k.join(""),"gm");
|
---|
14072 | function l(T,A){
|
---|
14073 | T=A?AjxStringUtil.convertToHtml(T):AjxStringUtil.htmlEncode(T);
|
---|
14074 | var x;
|
---|
14075 | k.lastIndex=0;
|
---|
14076 | while(x=k.exec(T)){
|
---|
14077 | var z=x[0];
|
---|
14078 | var q=x[1];
|
---|
14079 | var a=x[2];
|
---|
14080 | var O=x[3];
|
---|
14081 | var i=Dwt.getNextId();
|
---|
14082 | s[i]=a;
|
---|
14083 | if(!f[a]){
|
---|
14084 | f[a]=[]
|
---|
14085 | }
|
---|
14086 | f[a].push(i);
|
---|
14087 | var j=[q,'<span word="',a,'" id="',i,'" class="ZM-SPELLCHECK-MISSPELLED">',a,"</span>",O].join("");
|
---|
14088 | T=[T.substr(0,x.index),j,T.substr(x.index+z.length)].join("");
|
---|
14089 | k.lastIndex=x.index+j.length-O.length
|
---|
14090 | }
|
---|
14091 | return T
|
---|
14092 | }
|
---|
14093 | var v;
|
---|
14094 | rec=function(T){
|
---|
14095 | switch(T.nodeType){
|
---|
14096 | case 1:for(var z=T.firstChild;
|
---|
14097 | z;
|
---|
14098 | z=rec(z)){}
|
---|
14099 | T=T.nextSibling;
|
---|
14100 | break;
|
---|
14101 | case 3:if(!/[^\s\xA0]/.test(T.data)){
|
---|
14102 | T=T.nextSibling;
|
---|
14103 | break
|
---|
14104 | }
|
---|
14105 | var j=null,q=null;
|
---|
14106 | var x=/^[\s\xA0]+/.exec(T.data);
|
---|
14107 | if(x){
|
---|
14108 | j=T;
|
---|
14109 | T=T.splitText(x[0].length)
|
---|
14110 | }
|
---|
14111 | x=/[\s\xA0]+$/.exec(T.data);
|
---|
14112 | if(x){
|
---|
14113 | q=T.splitText(T.data.length-x[0].length)
|
---|
14114 | }
|
---|
14115 | var A=l(T.data,false);
|
---|
14116 | A=A.replace(/^ +/," ").replace(/ +$/," ");
|
---|
14117 | var W=v.createElement("div");
|
---|
14118 | W.innerHTML=A;
|
---|
14119 | if(j){
|
---|
14120 | W.insertBefore(j,W.firstChild)
|
---|
14121 | }
|
---|
14122 | if(q){
|
---|
14123 | W.appendChild(q)
|
---|
14124 | }
|
---|
14125 | var O=T.parentNode;
|
---|
14126 | while(W.firstChild){
|
---|
14127 | O.insertBefore(W.firstChild,T)
|
---|
14128 | }
|
---|
14129 | W=T.nextSibling;
|
---|
14130 | O.removeChild(T);
|
---|
14131 | T=W;
|
---|
14132 | break;
|
---|
14133 | default:T=T.nextSibling
|
---|
14134 | }
|
---|
14135 | return T
|
---|
14136 | };
|
---|
14137 | if(this._mode==DwtHtmlEditor.HTML){
|
---|
14138 | v=this._getIframeDoc();
|
---|
14139 | n=v.body;
|
---|
14140 | this._loadExternalStyle("/css/spellcheck.css");
|
---|
14141 | n.style.display="none";
|
---|
14142 | if(!AjxEnv.isIE){
|
---|
14143 | n.normalize()
|
---|
14144 | }else{
|
---|
14145 | n.innerHTML=n.innerHTML
|
---|
14146 | }
|
---|
14147 | rec(n);
|
---|
14148 | if(!AjxEnv.isIE){
|
---|
14149 | n.normalize()
|
---|
14150 | }else{
|
---|
14151 | n.innerHTML=n.innerHTML
|
---|
14152 | }
|
---|
14153 | n.style.display="";
|
---|
14154 | var o=this.getEditor();
|
---|
14155 | o.onContextMenu.add(this._handleEditorEvent,this);
|
---|
14156 | o.onMouseUp.add(this._handleEditorEvent,this)
|
---|
14157 | }else{
|
---|
14158 | var y=document.getElementById(this._textAreaId);
|
---|
14159 | var e=y.scrollTop;
|
---|
14160 | var d=Dwt.getSize(y);
|
---|
14161 | y.style.display="none";
|
---|
14162 | var h=document.createElement("div");
|
---|
14163 | h.className="TextSpellChecker";
|
---|
14164 | this._spellCheckDivId=h.id=Dwt.getNextId();
|
---|
14165 | h.style.overflow="auto";
|
---|
14166 | if(!AjxEnv.isIE){
|
---|
14167 | d.x-=4;
|
---|
14168 | d.y-=6
|
---|
14169 | }
|
---|
14170 | h.style.width=d.x+"px";
|
---|
14171 | h.style.height=d.y+"px";
|
---|
14172 | h.innerHTML=AjxStringUtil.convertToHtml(this.getContent());
|
---|
14173 | v=document;
|
---|
14174 | rec(h);
|
---|
14175 | y.parentNode.insertBefore(h,y);
|
---|
14176 | h.scrollTop=e;
|
---|
14177 | h.oncontextmenu=h.onclick=function(a){
|
---|
14178 | u._handleSpellCheckerEvents(a||window.event)
|
---|
14179 | }
|
---|
14180 | }
|
---|
14181 | this._spellCheckShowModeDiv();
|
---|
14182 | this._spellCheck={
|
---|
14183 | suggestions:c,spanIds:s,wordIds:f}
|
---|
14184 | };
|
---|
14185 | ZmAdvancedHtmlEditor.prototype._loadExternalStyle=function(o){
|
---|
14186 | var i=this._getIframeDoc();
|
---|
14187 | var t=i.getElementById(o);
|
---|
14188 | if(!t){
|
---|
14189 | t=i.createElement("link");
|
---|
14190 | t.id=o;
|
---|
14191 | t.rel="stylesheet";
|
---|
14192 | t.type="text/css";
|
---|
14193 | var a=appContextPath+o+"?v="+cacheKillerVersion;
|
---|
14194 | if(AjxEnv.isGeckoBased||AjxEnv.isSafari){
|
---|
14195 | a=document.baseURI.replace(/^(https?:\x2f\x2f[^\x2f]+).*$/,"$1")+a
|
---|
14196 | }
|
---|
14197 | t.href=a;
|
---|
14198 | var e=i.getElementsByTagName("head")[0];
|
---|
14199 | if(!e){
|
---|
14200 | e=i.createElement("head");
|
---|
14201 | var n=i.documentElement;
|
---|
14202 | if(n){
|
---|
14203 | n.insertBefore(e,n.firstChild)
|
---|
14204 | }}
|
---|
14205 | e.appendChild(t)
|
---|
14206 | }};
|
---|
14207 | ZmAdvancedHtmlEditor.prototype._registerEditorEventHandler=function(t,e){
|
---|
14208 | if(AjxEnv.isIE){
|
---|
14209 | t.attachEvent("on"+e,this.__eventClosure)
|
---|
14210 | }else{
|
---|
14211 | t.addEventListener(e,this.__eventClosure,true)
|
---|
14212 | }};
|
---|
14213 | ZmAdvancedHtmlEditor.prototype._unregisterEditorEventHandler=function(t,e){
|
---|
14214 | if(AjxEnv.isIE){
|
---|
14215 | t.detachEvent("on"+e,this.__eventClosure)
|
---|
14216 | }else{
|
---|
14217 | t.removeEventListener(e,this.__eventClosure,true)
|
---|
14218 | }};
|
---|
14219 | ZmAdvancedHtmlEditor.prototype.__eventClosure=function(e){
|
---|
14220 | this._handleEditorEvent(AjxEnv.isIE?this._getIframeWin().event:e);
|
---|
14221 | return tinymce.dom.Event.cancel(e)
|
---|
14222 | };
|
---|
14223 | ZmAdvancedHtmlEditor.prototype._handleEditorEvent=function(i,n){
|
---|
14224 | var t=true;
|
---|
14225 | if(n.type=="contextmenu"){
|
---|
14226 | var h=DwtShell.mouseEvent;
|
---|
14227 | h.setFromDhtmlEvent(n);
|
---|
14228 | var o=Dwt.getLocation(document.getElementById(this._iFrameId));
|
---|
14229 | if(!AjxEnv.isIE){
|
---|
14230 | var s=this._getIframeDoc();
|
---|
14231 | var a=s.documentElement.scrollLeft||s.body.scrollLeft;
|
---|
14232 | var c=s.documentElement.scrollTop||s.body.scrollTop;
|
---|
14233 | o.x-=a;
|
---|
14234 | o.y-=c
|
---|
14235 | }
|
---|
14236 | h.docX+=o.x;
|
---|
14237 | h.docY+=o.y;
|
---|
14238 | DwtControl.__mouseEvent(n,DwtEvent.ONCONTEXTMENU,this,h);
|
---|
14239 | t=h._returnValue
|
---|
14240 | }
|
---|
14241 | var l=this;
|
---|
14242 | if(this._spellCheck){
|
---|
14243 | var e;
|
---|
14244 | if(/mouse|context|click|select/i.test(n.type)){
|
---|
14245 | e=new DwtMouseEvent(true)
|
---|
14246 | }else{
|
---|
14247 | e=new DwtUiEvent(true)
|
---|
14248 | }
|
---|
14249 | e.setFromDhtmlEvent(n);
|
---|
14250 | this._TIMER_spell=setTimeout(function(){
|
---|
14251 | l._handleSpellCheckerEvents(e);
|
---|
14252 | this._TIMER_spell=null
|
---|
14253 | }
|
---|
14254 | ,100);
|
---|
14255 | return tinymce.dom.Event.cancel(n)
|
---|
14256 | }
|
---|
14257 | return t
|
---|
14258 | };
|
---|
14259 | ZmAdvancedHtmlEditor.prototype._getSelection=function(){
|
---|
14260 | if(AjxEnv.isIE){
|
---|
14261 | return this._getIframeDoc().selection
|
---|
14262 | }else{
|
---|
14263 | return this._getIframeWin().getSelection()
|
---|
14264 | }};
|
---|
14265 | ZmEditorContainer=function(e){
|
---|
14266 | if(arguments.length==0){
|
---|
14267 | return
|
---|
14268 | }
|
---|
14269 | e=Dwt.getParams(arguments,ZmEditorContainer.PARAMS);
|
---|
14270 | DwtComposite.call(this,e)
|
---|
14271 | };
|
---|
14272 | ZmEditorContainer.PARAMS=["parent","className","posStyle","content","mode","blankIframeSrc"];
|
---|
14273 | ZmEditorContainer.prototype=new DwtComposite();
|
---|
14274 | ZmEditorContainer.prototype.constructor=ZmEditorContainer;
|
---|
14275 | ZmEditorContainer.prototype.setFocusMember=function(e){
|
---|
14276 | this._focusMember=e
|
---|
14277 | };
|
---|
14278 | ZmEditorContainer.prototype._focus=function(){
|
---|
14279 | if(this._focusMember){
|
---|
14280 | this._focusMember.focus()
|
---|
14281 | }}
|
---|
14282 | }
|
---|
14283 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmDialog")){
|
---|
14284 | ZmDialog=function(e){
|
---|
14285 | if(arguments.length==0){
|
---|
14286 | return
|
---|
14287 | }
|
---|
14288 | DwtDialog.call(this,e);
|
---|
14289 | if(!e.view){
|
---|
14290 | this.setContent(this._contentHtml())
|
---|
14291 | }
|
---|
14292 | if(this._button[DwtDialog.OK_BUTTON]){
|
---|
14293 | this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._okButtonListener))
|
---|
14294 | }
|
---|
14295 | this._overview={};
|
---|
14296 | this._opc=appCtxt.getOverviewController();
|
---|
14297 | this._baseTabGroupSize=this._tabGroup.size()
|
---|
14298 | };
|
---|
14299 | ZmDialog.prototype=new DwtDialog;
|
---|
14300 | ZmDialog.prototype.constructor=ZmDialog;
|
---|
14301 | ZmDialog.prototype._contentHtml=function(){
|
---|
14302 | return""
|
---|
14303 | };
|
---|
14304 | ZmDialog.prototype.setView=function(i,e){
|
---|
14305 | this.reset();
|
---|
14306 | if(i){
|
---|
14307 | var a=this._getContentDiv();
|
---|
14308 | var t=i.getHtmlElement();
|
---|
14309 | a.parentNode.replaceChild(t,a);
|
---|
14310 | this._contentDiv=t
|
---|
14311 | }};
|
---|
14312 | ZmDialog.prototype.popup=function(){
|
---|
14313 | this._tabGroup.__members._array.splice(this._baseTabGroupSize);
|
---|
14314 | this._tabGroup.addMember(this._getTabGroupMembers());
|
---|
14315 | DwtDialog.prototype.popup.call(this);
|
---|
14316 | if(this._focusElement){
|
---|
14317 | appCtxt.getKeyboardMgr().grabFocus(this._focusElement)
|
---|
14318 | }};
|
---|
14319 | ZmDialog.prototype.reset=function(){
|
---|
14320 | if(this._nameField){
|
---|
14321 | this._nameField.value=""
|
---|
14322 | }
|
---|
14323 | DwtDialog.prototype.reset.call(this)
|
---|
14324 | };
|
---|
14325 | ZmDialog.prototype._okButtonListener=function(){
|
---|
14326 | this.popdown()
|
---|
14327 | };
|
---|
14328 | ZmDialog.prototype._setNameField=function(e){
|
---|
14329 | this._nameField=this._focusElement=document.getElementById(e);
|
---|
14330 | if(this._enterListener){
|
---|
14331 | this.addEnterListener(new AjxListener(this,this._enterListener))
|
---|
14332 | }};
|
---|
14333 | ZmDialog.prototype._setOverview=function(i,e){
|
---|
14334 | if(appCtxt.multiAccounts){
|
---|
14335 | var t=this._opc.getOverviewContainer(this._curOverviewId)||this._opc.getOverview(this._curOverviewId);
|
---|
14336 | if(t){
|
---|
14337 | t.setVisible(false)
|
---|
14338 | }}
|
---|
14339 | if(appCtxt.multiAccounts&&!e){
|
---|
14340 | var s=this._curOverviewId=i.overviewId;
|
---|
14341 | var l=this._opc.getOverviewContainer(s);
|
---|
14342 | if(!l){
|
---|
14343 | var h={
|
---|
14344 | overviewClass:"dialogOverviewContainer",headerClass:"DwtTreeItem",noTooltips:true,treeStyle:i.treeStyle,treeIds:i.treeIds,overviewTrees:i.overviewTrees,omit:i.omit,omitPerAcct:i.omitPerAcct,selectable:i.selectable};
|
---|
14345 | var o={
|
---|
14346 | appName:i.appName,containerId:s};
|
---|
14347 | l=this._opc.createOverviewContainer(o,h);
|
---|
14348 | l.setSize(Dwt.DEFAULT,"200");
|
---|
14349 | document.getElementById(i.fieldId).appendChild(l.getHtmlElement())
|
---|
14350 | }
|
---|
14351 | l.setVisible(true);
|
---|
14352 | return l
|
---|
14353 | }
|
---|
14354 | var a=this._curOverviewId=i.overviewId;
|
---|
14355 | var c=this._opc.getOverview(a);
|
---|
14356 | if(!c){
|
---|
14357 | var n={
|
---|
14358 | overviewId:a,overviewClass:"dialogOverview",headerClass:"DwtTreeItem",noTooltips:true,treeStyle:i.treeStyle,treeIds:i.treeIds,account:((appCtxt.multiAccounts&&i.forceSingle)?appCtxt.getActiveAccount():i.account)};
|
---|
14359 | c=this._overview[a]=this._opc.createOverview(n);
|
---|
14360 | this._renderOverview(c,i.treeIds,i.omit,i.noRootSelect);
|
---|
14361 | document.getElementById(i.fieldId).appendChild(c.getHtmlElement())
|
---|
14362 | }
|
---|
14363 | this._makeOverviewVisible(a);
|
---|
14364 | return c
|
---|
14365 | };
|
---|
14366 | ZmDialog.prototype._makeOverviewVisible=function(e){
|
---|
14367 | for(var t in this._overview){
|
---|
14368 | this._overview[t].setVisible(t==e)
|
---|
14369 | }};
|
---|
14370 | ZmDialog.prototype._renderOverview=function(h,a,n,s){
|
---|
14371 | h.set(a,n);
|
---|
14372 | if(!s){
|
---|
14373 | for(var o=0;
|
---|
14374 | o<a.length;
|
---|
14375 | o++){
|
---|
14376 | var e=h.getTreeView(a[o]);
|
---|
14377 | var t=e&&e.getHeaderItem();
|
---|
14378 | if(t){
|
---|
14379 | t.enableSelection(true)
|
---|
14380 | }}}};
|
---|
14381 | ZmDialog.prototype._getOverview=function(){
|
---|
14382 | return this._overview[this._curOverviewId]
|
---|
14383 | };
|
---|
14384 | ZmDialog.prototype._getInputFields=function(){
|
---|
14385 | return(this._nameField)?[this._nameField]:null
|
---|
14386 | };
|
---|
14387 | ZmDialog.prototype._showError=function(i,a){
|
---|
14388 | var t=a||(new DwtPoint(this.getLocation().x+50,this.getLocation().y+100));
|
---|
14389 | var e=appCtxt.getMsgDialog();
|
---|
14390 | e.reset();
|
---|
14391 | e.setMessage(i,DwtMessageDialog.CRITICAL_STYLE);
|
---|
14392 | e.popup(t)
|
---|
14393 | };
|
---|
14394 | ZmDialog.prototype._getTabGroupMembers=function(){
|
---|
14395 | return[this._nameField]
|
---|
14396 | }
|
---|
14397 | }
|
---|
14398 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmAttachDialog")){
|
---|
14399 | ZmAttachDialog=function(e,t){
|
---|
14400 | t=t||"ZmAttachDialog";
|
---|
14401 | DwtDialog.call(this,{
|
---|
14402 | parent:e,className:t,title:ZmMsg.attachFile}
|
---|
14403 | );
|
---|
14404 | this._createBaseHtml();
|
---|
14405 | this._defaultCancelCallback=new AjxCallback(this,this._defaultCancelListener);
|
---|
14406 | this._cancelListeners={};
|
---|
14407 | this._defaultOkCallback=new AjxCallback(this,this._defaultOkListener);
|
---|
14408 | this._okListeners={};
|
---|
14409 | this.setButtonListener(DwtDialog.CANCEL_BUTTON,new AjxListener(this,function(){
|
---|
14410 | this._cancelButtonListener()
|
---|
14411 | }
|
---|
14412 | ));
|
---|
14413 | this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,function(){
|
---|
14414 | this._okButtonListener()
|
---|
14415 | }
|
---|
14416 | ));
|
---|
14417 | this._tabKeys={};
|
---|
14418 | var a=this.getButton(DwtDialog.OK_BUTTON);
|
---|
14419 | a.setText(ZmMsg.attach);
|
---|
14420 | this._addMyComputerTab();
|
---|
14421 | if(appCtxt.get(ZmSetting.BRIEFCASE_ENABLED)){
|
---|
14422 | this._addBriefcaseViewTab()
|
---|
14423 | }};
|
---|
14424 | ZmAttachDialog.prototype=new DwtDialog;
|
---|
14425 | ZmAttachDialog.prototype.constructor=ZmAttachDialog;
|
---|
14426 | ZmAttachDialog.TABKEY_MYCOMPUTER="MY_COMPUTER";
|
---|
14427 | ZmAttachDialog.TABKEY_BRIEFCASE="BRIEFCASE";
|
---|
14428 | ZmAttachDialog.supportsHTML5=(window.FileReader||AjxEnv.isChrome||AjxEnv.isSafari4up);
|
---|
14429 | ZmAttachDialog.prototype.addCancelListener=function(t,e){
|
---|
14430 | if(e&&(e instanceof AjxListener||e instanceof AjxCallback)){
|
---|
14431 | this._cancelListeners[t]=e
|
---|
14432 | }};
|
---|
14433 | ZmAttachDialog.prototype._defaultCancelListener=function(){
|
---|
14434 | this.popdown()
|
---|
14435 | };
|
---|
14436 | ZmAttachDialog.prototype._cancelButtonListener=function(){
|
---|
14437 | var e=this._cancelListeners[this._tabView.getCurrentTab()];
|
---|
14438 | if(e){
|
---|
14439 | e.run()
|
---|
14440 | }else{
|
---|
14441 | this._defaultCancelCallback.run()
|
---|
14442 | }};
|
---|
14443 | ZmAttachDialog.prototype.addOkListener=function(t,e){
|
---|
14444 | if(e&&(e instanceof AjxListener||e instanceof AjxCallback)){
|
---|
14445 | this._okListeners[t]=e
|
---|
14446 | }};
|
---|
14447 | ZmAttachDialog.prototype._defaultOkListener=function(){
|
---|
14448 | this.popdown()
|
---|
14449 | };
|
---|
14450 | ZmAttachDialog.prototype._okButtonListener=function(){
|
---|
14451 | var t=this.getButton(DwtDialog.OK_BUTTON);
|
---|
14452 | t.setEnabled(false);
|
---|
14453 | var e=this._okListeners[this._tabView.getCurrentTab()];
|
---|
14454 | if(e){
|
---|
14455 | e.run(this)
|
---|
14456 | }else{
|
---|
14457 | this._defaultOkCallback.run()
|
---|
14458 | }
|
---|
14459 | t.setEnabled(true)
|
---|
14460 | };
|
---|
14461 | ZmAttachDialog.prototype._createBaseHtml=function(){
|
---|
14462 | this._baseContainerView=new DwtComposite({
|
---|
14463 | parent:this,className:"ZmAttachDialog-container"}
|
---|
14464 | );
|
---|
14465 | this._initializeTabView(this._baseContainerView);
|
---|
14466 | this.setView(this._baseContainerView)
|
---|
14467 | };
|
---|
14468 | ZmAttachDialog.prototype._initializeTabView=function(e){
|
---|
14469 | this._tabView=new ZmAttachTabView(e,null,Dwt.STATIC_STYLE);
|
---|
14470 | this._tabView.addTabChangeListener(new AjxListener(this,this.tabChangeListener));
|
---|
14471 | this._tabView.addStateChangeListener(new AjxListener(this,this.stateChangeListener));
|
---|
14472 | this._setAttachmentSizeSection(e);
|
---|
14473 | this._setInlineOptionSection(e);
|
---|
14474 | this._setFooterSection(e)
|
---|
14475 | };
|
---|
14476 | ZmAttachDialog.prototype.stateChangeListener=function(e){
|
---|
14477 | this._resetInlineOption()
|
---|
14478 | };
|
---|
14479 | ZmAttachDialog.prototype.tabChangeListener=function(t){
|
---|
14480 | this.setFooter("");
|
---|
14481 | var a=this._tabView.getCurrentTab();
|
---|
14482 | var e=this._tabView.getTabView(a);
|
---|
14483 | if(e&&e.gotAttachments()){
|
---|
14484 | this.setFooter(ZmMsg.attachClearUploadMessage);
|
---|
14485 | return false
|
---|
14486 | }
|
---|
14487 | return true
|
---|
14488 | };
|
---|
14489 | ZmAttachDialog.prototype._setAttachmentSizeSection=function(e){
|
---|
14490 | var a=document.createElement("div");
|
---|
14491 | a.className="ZmAttachDialog-note";
|
---|
14492 | var t=AjxUtil.formatSize(appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)||0,true);
|
---|
14493 | a.innerHTML=AjxMessageFormat.format(ZmMsg.attachmentLimitMsg,t);
|
---|
14494 | e.getHtmlElement().appendChild(a)
|
---|
14495 | };
|
---|
14496 | ZmAttachDialog.prototype._setFooterSection=function(e){
|
---|
14497 | var t=document.createElement("div");
|
---|
14498 | t.className="ZmAttachDialog-footer";
|
---|
14499 | t.id=Dwt.getNextId();
|
---|
14500 | e.getHtmlElement().appendChild(t);
|
---|
14501 | this._footer=document.getElementById(t.id)
|
---|
14502 | };
|
---|
14503 | ZmAttachDialog.prototype.setFooter=function(e){
|
---|
14504 | if(typeof e=="string"){
|
---|
14505 | this._footer.innerHTML=e
|
---|
14506 | }else{
|
---|
14507 | this._footer.appendChild(e)
|
---|
14508 | }};
|
---|
14509 | ZmAttachDialog.prototype.getTabView=function(){
|
---|
14510 | return this._tabView
|
---|
14511 | };
|
---|
14512 | ZmAttachDialog.prototype.addTab=function(a,t,e){
|
---|
14513 | if(!this._tabView||!e){
|
---|
14514 | return null
|
---|
14515 | }
|
---|
14516 | this._tabKeys[a]=this._tabView.addTab(t,e);
|
---|
14517 | return this._tabKeys[a]
|
---|
14518 | };
|
---|
14519 | ZmAttachDialog.prototype.getTabKey=function(e){
|
---|
14520 | return this._tabKeys[e]
|
---|
14521 | };
|
---|
14522 | ZmAttachDialog.prototype.getTabViewPage=function(e){
|
---|
14523 | return this._tabView.getTabView(this._tabKeys[e])
|
---|
14524 | };
|
---|
14525 | ZmAttachDialog.prototype.popup=function(){
|
---|
14526 | var e=this.getTabKey(ZmAttachDialog.TABKEY_MYCOMPUTER);
|
---|
14527 | this._tabView.switchToTab(e,true);
|
---|
14528 | this.setButtonEnabled(DwtDialog.OK_BUTTON,true);
|
---|
14529 | this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
|
---|
14530 | this.setFooter("");
|
---|
14531 | DwtDialog.prototype.popup.call(this);
|
---|
14532 | this.setFooter("")
|
---|
14533 | };
|
---|
14534 | ZmAttachDialog.prototype.uploadFiles=function(){
|
---|
14535 | this.setFooter("");
|
---|
14536 | var a=this._tabView.getCurrentTab();
|
---|
14537 | var e=this._tabView.getTabView(a);
|
---|
14538 | if(e&&e.validate){
|
---|
14539 | var t=e.validate();
|
---|
14540 | if(!t.status){
|
---|
14541 | this.setFooter(t.error);
|
---|
14542 | return false
|
---|
14543 | }}
|
---|
14544 | if(e&&e.gotAttachments()){
|
---|
14545 | this.upload(this._uploadCallback,e.uploadForm)
|
---|
14546 | }else{
|
---|
14547 | this.setFooter(ZmMsg.attachSelectMessage)
|
---|
14548 | }};
|
---|
14549 | ZmAttachDialog.prototype.cancelUploadFiles=function(){
|
---|
14550 | this._cancelUpload=true;
|
---|
14551 | this._defaultCancelListener()
|
---|
14552 | };
|
---|
14553 | ZmAttachDialog.prototype.setUploadCallback=function(e){
|
---|
14554 | this._uploadCallback=e
|
---|
14555 | };
|
---|
14556 | ZmAttachDialog.prototype.getUploadCallback=function(){
|
---|
14557 | return this._uploadCallback
|
---|
14558 | };
|
---|
14559 | ZmAttachDialog.prototype.upload=function(t,e){
|
---|
14560 | if(!t){
|
---|
14561 | t=false
|
---|
14562 | }
|
---|
14563 | this.setButtonEnabled(DwtDialog.OK_BUTTON,false);
|
---|
14564 | this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
|
---|
14565 | this.setFooter(ZmMsg.attachingFiles);
|
---|
14566 | this._cancelUpload=false;
|
---|
14567 | this._processUpload(t,e)
|
---|
14568 | };
|
---|
14569 | ZmAttachDialog.prototype._processUpload=function(o,a){
|
---|
14570 | var i=new AjxCallback(this,this._uploadDoneCallback,[o]);
|
---|
14571 | var e=appCtxt.getUploadManager();
|
---|
14572 | window._uploadManager=e;
|
---|
14573 | try{
|
---|
14574 | e.execute(i,a)
|
---|
14575 | }
|
---|
14576 | catch(t){
|
---|
14577 | i.run()
|
---|
14578 | }};
|
---|
14579 | ZmAttachDialog.prototype._uploadDoneCallback=function(n,e,t){
|
---|
14580 | if(this._cancelUpload){
|
---|
14581 | return
|
---|
14582 | }
|
---|
14583 | this.setButtonEnabled(DwtDialog.CANCEL_BUTTON,true);
|
---|
14584 | if(e==AjxPost.SC_OK){
|
---|
14585 | this.setFooter(ZmMsg.attachingFilesDone);
|
---|
14586 | if(n){
|
---|
14587 | n.run(e,t)
|
---|
14588 | }}else{
|
---|
14589 | if(e==AjxPost.SC_UNAUTHORIZED){
|
---|
14590 | var i=new AjxException("401 response during attachment upload",ZmCsfeException.SVC_AUTH_EXPIRED);
|
---|
14591 | appCtxt.getAppController()._handleException(i,{
|
---|
14592 | continueCallback:n}
|
---|
14593 | )
|
---|
14594 | }else{
|
---|
14595 | var o=AjxMessageFormat.format(ZmMsg.errorAttachment,(e||AjxPost.SC_NO_CONTENT));
|
---|
14596 | switch(e){
|
---|
14597 | case AjxPost.SC_REQUEST_ENTITY_TOO_LARGE:o+=" "+ZmMsg.errorAttachmentTooBig+"<br><br>";
|
---|
14598 | break;
|
---|
14599 | default:o+=" ";
|
---|
14600 | break
|
---|
14601 | }
|
---|
14602 | var a=appCtxt.getMsgDialog();
|
---|
14603 | a.setMessage(o,DwtMessageDialog.CRITICAL_STYLE);
|
---|
14604 | a.popup();
|
---|
14605 | this.setFooter(ZmMsg.attachingFilesError)
|
---|
14606 | }}
|
---|
14607 | this.setButtonEnabled(DwtDialog.OK_BUTTON,true)
|
---|
14608 | };
|
---|
14609 | ZmAttachDialog.prototype._addMyComputerTab=function(){
|
---|
14610 | this._myComputerTabViewPage=new ZmMyComputerTabViewPage(this._tabView);
|
---|
14611 | var e=this.addTab(ZmAttachDialog.TABKEY_MYCOMPUTER,ZmMsg.myComputer,this._myComputerTabViewPage);
|
---|
14612 | this.addOkListener(e,(new AjxCallback(this,this.uploadFiles)));
|
---|
14613 | this.addCancelListener(e,(new AjxCallback(this,this.cancelUploadFiles)))
|
---|
14614 | };
|
---|
14615 | ZmAttachDialog.prototype._addBriefcaseViewTab=function(){
|
---|
14616 | var e=new AjxCallback(this,this.getBriefcaseTabView);
|
---|
14617 | var t=this.addTab(ZmAttachDialog.TABKEY_BRIEFCASE,ZmMsg.briefcase,e)
|
---|
14618 | };
|
---|
14619 | ZmAttachDialog.prototype.getBriefcaseTabView=function(t){
|
---|
14620 | if(!this._briefcaseTabView){
|
---|
14621 | AjxDispatcher.require(["BriefcaseCore","Briefcase"]);
|
---|
14622 | this._briefcaseTabView=new ZmBriefcaseTabView(this._tabView);
|
---|
14623 | var e=new AjxCallback(this._briefcaseTabView,this._briefcaseTabView.uploadFiles);
|
---|
14624 | this.addOkListener(t,e);
|
---|
14625 | this.addCancelListener(t,(new AjxCallback(this,this.cancelUploadFiles)))
|
---|
14626 | }
|
---|
14627 | return this._briefcaseTabView
|
---|
14628 | };
|
---|
14629 | ZmAttachDialog.prototype._setInlineOptionSection=function(e){
|
---|
14630 | var t=document.createElement("div");
|
---|
14631 | t.className="ZmAttachDialog-inline";
|
---|
14632 | t.id=Dwt.getNextId();
|
---|
14633 | e.getHtmlElement().appendChild(t);
|
---|
14634 | this._inlineOption=document.getElementById(t.id)
|
---|
14635 | };
|
---|
14636 | ZmAttachDialog.prototype.enableInlineOption=function(e){
|
---|
14637 | if(e){
|
---|
14638 | var t=this._htmlElId+"_inlineCheckbox";
|
---|
14639 | this._inlineOption.setAttribute("option","inline");
|
---|
14640 | this._inlineOption.innerHTML=["<input type='checkbox' name='inlineimages' id='",t,"'> <label for='",t,"'>",ZmMsg.inlineAttachmentOption,"</label>"].join("")
|
---|
14641 | }else{
|
---|
14642 | this._inlineOption.innerHTML=""
|
---|
14643 | }};
|
---|
14644 | ZmAttachDialog.prototype._resetInlineOption=function(){
|
---|
14645 | var e=document.getElementById(this._htmlElId+"_inlineCheckbox");
|
---|
14646 | if(e){
|
---|
14647 | e.checked=false
|
---|
14648 | }};
|
---|
14649 | ZmAttachDialog.prototype.isInline=function(){
|
---|
14650 | var e=document.getElementById(this._htmlElId+"_inlineCheckbox");
|
---|
14651 | return(e&&e.checked)
|
---|
14652 | };
|
---|
14653 | ZmAttachTabView=function(a,t,e){
|
---|
14654 | if(arguments.length==0){
|
---|
14655 | return
|
---|
14656 | }
|
---|
14657 | DwtTabView.call(this,a,t,e)
|
---|
14658 | };
|
---|
14659 | ZmAttachTabView.prototype=new DwtTabView;
|
---|
14660 | ZmAttachTabView.prototype.constructor=new ZmAttachTabView;
|
---|
14661 | ZmAttachTabView.prototype.addTabChangeListener=function(e){
|
---|
14662 | this._addTabChangeListener=e
|
---|
14663 | };
|
---|
14664 | ZmAttachTabView.prototype.switchToTab=function(a,t){
|
---|
14665 | if(!t&&this._addTabChangeListener&&!this._addTabChangeListener.run()){
|
---|
14666 | var e=this._tabBar.getButton(this.getCurrentTab());
|
---|
14667 | e.setOpen();
|
---|
14668 | e=this._tabBar.getButton(a);
|
---|
14669 | e.setClosed();
|
---|
14670 | return
|
---|
14671 | }
|
---|
14672 | DwtTabView.prototype.switchToTab.call(this,a)
|
---|
14673 | };
|
---|
14674 | ZmMyComputerTabViewPage=function(a,t,e){
|
---|
14675 | if(arguments.length==0){
|
---|
14676 | return
|
---|
14677 | }
|
---|
14678 | DwtTabViewPage.call(this,a,t,Dwt.STATIC_STYLE);
|
---|
14679 | this.setScrollStyle(Dwt.SCROLL)
|
---|
14680 | };
|
---|
14681 | ZmMyComputerTabViewPage.prototype=new DwtTabViewPage;
|
---|
14682 | ZmMyComputerTabViewPage.prototype.constructor=ZmMyComputerTabViewPage;
|
---|
14683 | ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS=5;
|
---|
14684 | ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS=10;
|
---|
14685 | ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME="_attFile_";
|
---|
14686 | ZmMyComputerTabViewPage.prototype.toString=function(){
|
---|
14687 | return"ZmMyComputerTabViewPage"
|
---|
14688 | };
|
---|
14689 | ZmMyComputerTabViewPage.prototype.showMe=function(){
|
---|
14690 | this.resetAttachments();
|
---|
14691 | DwtTabViewPage.prototype.showMe.call(this);
|
---|
14692 | this.setSize(Dwt.DEFAULT,"240");
|
---|
14693 | this._focusAttEl()
|
---|
14694 | };
|
---|
14695 | ZmMyComputerTabViewPage.prototype.hideMe=function(){
|
---|
14696 | DwtTabViewPage.prototype.hideMe.call(this)
|
---|
14697 | };
|
---|
14698 | ZmMyComputerTabViewPage.prototype._createHtml=function(){
|
---|
14699 | var e={
|
---|
14700 | id:this._htmlElId,uri:(appCtxt.get(ZmSetting.CSFE_ATTACHMENT_UPLOAD_URI)+"?fmt=extended")};
|
---|
14701 | this._contentEl=this.getContentHtmlElement();
|
---|
14702 | this._contentEl.innerHTML=AjxTemplate.expand("share.Dialogs#ZmAttachDialog-MyComputerTab",e);
|
---|
14703 | this.attachmentTable=document.getElementById(this._htmlElId+"_attachmentTable");
|
---|
14704 | this.uploadForm=document.getElementById(this._htmlElId+"_uploadForm");
|
---|
14705 | this.attachmentButtonTable=document.getElementById(this._htmlElId+"_attachmentButtonTable");
|
---|
14706 | this._addAttachmentFieldButton();
|
---|
14707 | this._attachCount=0
|
---|
14708 | };
|
---|
14709 | ZmMyComputerTabViewPage.prototype._addAttachmentField=function(){
|
---|
14710 | if(this._attachCount>=ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS){
|
---|
14711 | return
|
---|
14712 | }
|
---|
14713 | this._attachCount++;
|
---|
14714 | var h=this.attachmentTable.insertRow(-1);
|
---|
14715 | var e=h.insertCell(-1);
|
---|
14716 | var a=Dwt.getNextId();
|
---|
14717 | var i={
|
---|
14718 | id:a,uploadName:ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME};
|
---|
14719 | e.innerHTML=AjxTemplate.expand("share.Dialogs#ZmAttachDialog-MyComputerTab-AddAttachment",i);
|
---|
14720 | var o=document.getElementById(a+"_remove");
|
---|
14721 | o.onclick=AjxCallback.simpleClosure(this._removeAttachmentField,this,h);
|
---|
14722 | var t=a+"_input";
|
---|
14723 | if(this._focusElId==-1){
|
---|
14724 | this._focusElId=t
|
---|
14725 | }
|
---|
14726 | var s=document.getElementById(t);
|
---|
14727 | var n=document.getElementById(a+"_size");
|
---|
14728 | if(ZmAttachDialog.supportsHTML5){
|
---|
14729 | Dwt.setHandler(s,"onchange",AjxCallback.simpleClosure(this._handleFileSize,this,s,n))
|
---|
14730 | }
|
---|
14731 | if(AjxEnv.isIE){
|
---|
14732 | s.onkeydown=AjxCallback.simpleClosure(this._handleKeys,this)
|
---|
14733 | }};
|
---|
14734 | ZmMyComputerTabViewPage.prototype._handleFileSize=function(o,i){
|
---|
14735 | var a=o.files;
|
---|
14736 | if(!a){
|
---|
14737 | return
|
---|
14738 | }
|
---|
14739 | var t=a[0];
|
---|
14740 | var e=t.size||t.fileSize;
|
---|
14741 | if(i){
|
---|
14742 | i.innerHTML=" ("+AjxUtil.formatSize(e,true)+")";
|
---|
14743 | if(e>appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)){
|
---|
14744 | Dwt.addClass(i,"RedC")
|
---|
14745 | }else{
|
---|
14746 | Dwt.delClass(i,"RedC")
|
---|
14747 | }}};
|
---|
14748 | ZmMyComputerTabViewPage.prototype._removeAttachmentField=function(e){
|
---|
14749 | this.attachmentTable.deleteRow(e.rowIndex);
|
---|
14750 | this._attachCount--;
|
---|
14751 | if(this._attachCount==0){
|
---|
14752 | this._addAttachmentField()
|
---|
14753 | }};
|
---|
14754 | ZmMyComputerTabViewPage.prototype._addAttachmentFieldButton=function(){
|
---|
14755 | var a=this.attachmentButtonTable.insertRow(-1);
|
---|
14756 | var e=a.insertCell(-1);
|
---|
14757 | var t=new DwtButton({
|
---|
14758 | parent:this,parentElement:e}
|
---|
14759 | );
|
---|
14760 | t.setText(ZmMsg.addMoreAttachments);
|
---|
14761 | t.addSelectionListener(new AjxListener(this,this._addAttachmentField))
|
---|
14762 | };
|
---|
14763 | ZmMyComputerTabViewPage.prototype.gotAttachments=function(){
|
---|
14764 | var t=document.getElementsByName(ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME);
|
---|
14765 | for(var e=0;
|
---|
14766 | e<t.length;
|
---|
14767 | e++){
|
---|
14768 | if(t[e].value.length){
|
---|
14769 | return true
|
---|
14770 | }}
|
---|
14771 | return false
|
---|
14772 | };
|
---|
14773 | ZmMyComputerTabViewPage.prototype.resetAttachments=function(){
|
---|
14774 | this._cleanTable(this.attachmentTable);
|
---|
14775 | this._attachCount=0;
|
---|
14776 | if(ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS>ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS){
|
---|
14777 | ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS=ZmMyComputerTabViewPage.MAX_NO_ATTACHMENTS
|
---|
14778 | }
|
---|
14779 | this._focusElId=-1;
|
---|
14780 | var a=this.attachmentTable.insertRow(-1);
|
---|
14781 | var e=a.insertCell(-1);
|
---|
14782 | e.appendChild(document.createElement("br"));
|
---|
14783 | e.appendChild(document.createElement("br"));
|
---|
14784 | for(var t=0;
|
---|
14785 | t<ZmMyComputerTabViewPage.SHOW_NO_ATTACHMENTS;
|
---|
14786 | t++){
|
---|
14787 | this._addAttachmentField()
|
---|
14788 | }
|
---|
14789 | delete t
|
---|
14790 | };
|
---|
14791 | ZmMyComputerTabViewPage.prototype._focusAttEl=function(){
|
---|
14792 | var e=document.getElementById(this._focusElId);
|
---|
14793 | if(e){
|
---|
14794 | e.focus()
|
---|
14795 | }};
|
---|
14796 | ZmMyComputerTabViewPage.prototype._cleanTable=function(e){
|
---|
14797 | if(!e||!e.rows){
|
---|
14798 | return
|
---|
14799 | }
|
---|
14800 | while(e.rows.length>0){
|
---|
14801 | e.deleteRow(0)
|
---|
14802 | }};
|
---|
14803 | ZmMyComputerTabViewPage.prototype._handleKeys=function(t){
|
---|
14804 | var e=DwtKeyEvent.getCharCode(t);
|
---|
14805 | return(e!=DwtKeyEvent.KEY_ENTER&&e!=DwtKeyEvent.KEY_END_OF_TEXT)
|
---|
14806 | };
|
---|
14807 | ZmMyComputerTabViewPage.prototype._validateFileSize=function(){
|
---|
14808 | var o=document.getElementsByName(ZmMyComputerTabViewPage.UPLOAD_FIELD_NAME);
|
---|
14809 | var a,t;
|
---|
14810 | for(var e=0;
|
---|
14811 | e<o.length;
|
---|
14812 | e++){
|
---|
14813 | a=o[e].files;
|
---|
14814 | if(!a||a.length==0){
|
---|
14815 | continue
|
---|
14816 | }
|
---|
14817 | a=a[0];
|
---|
14818 | t=a.size||a.fileSize;
|
---|
14819 | if(t>appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)){
|
---|
14820 | return false
|
---|
14821 | }}
|
---|
14822 | return true
|
---|
14823 | };
|
---|
14824 | ZmMyComputerTabViewPage.prototype.validate=function(){
|
---|
14825 | var e,t;
|
---|
14826 | if(ZmAttachDialog.supportsHTML5){
|
---|
14827 | e=this._validateFileSize();
|
---|
14828 | t=AjxMessageFormat.format(ZmMsg.attachmentSizeError,AjxUtil.formatSize(appCtxt.get(ZmSetting.ATTACHMENT_SIZE_LIMIT)))
|
---|
14829 | }else{
|
---|
14830 | e=true
|
---|
14831 | }
|
---|
14832 | return{
|
---|
14833 | status:e,error:t}
|
---|
14834 | }
|
---|
14835 | }
|
---|
14836 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmLoginDialog")){
|
---|
14837 | ZmLoginDialog=function(i,a){
|
---|
14838 | a=a||"ZmLoginDialog";
|
---|
14839 | DwtComposite.call(this,{
|
---|
14840 | parent:i,className:a,posStyle:DwtControl.ABSOLUTE_STYLE}
|
---|
14841 | );
|
---|
14842 | this._origClassName=a;
|
---|
14843 | this._xparentClassName=a+"-Transparent";
|
---|
14844 | this.setBounds(0,0,"100%","100%");
|
---|
14845 | var o=this.getHtmlElement();
|
---|
14846 | o.style.zIndex=Dwt.Z_DIALOG+1;
|
---|
14847 | o.className=a;
|
---|
14848 | this.setVisible(false);
|
---|
14849 | var n=ZLoginFactory.copyDefaultParams(ZmMsg);
|
---|
14850 | n.showPanelBorder=true;
|
---|
14851 | n.showForm=true;
|
---|
14852 | n.showUserField=true;
|
---|
14853 | n.showPasswordField=true;
|
---|
14854 | n.showLicenseMsg=true;
|
---|
14855 | n.showRememberMeCheckbox=false;
|
---|
14856 | n.showLogOff=true;
|
---|
14857 | n.logOffAction="ZmLoginDialog._loginDiffListener()";
|
---|
14858 | n.loginAction="ZmLoginDialog._loginListener(this)";
|
---|
14859 | n.showButton=true;
|
---|
14860 | var t=[];
|
---|
14861 | var e=0;
|
---|
14862 | t[e++]="<table border=0 cellspacing=0 cellpadding=0 style='width:100%; height:100%'><tr><td align='center' valign='center'>";
|
---|
14863 | t[e++]=ZLoginFactory.getLoginDialogHTML(n);
|
---|
14864 | t[e++]="</td></tr></table>";
|
---|
14865 | o.innerHTML=t.join("");
|
---|
14866 | var s=ZLoginFactory.LOGIN_BUTTON_ID;
|
---|
14867 | if(s&&DwtControl.ALL_BY_ID){
|
---|
14868 | DwtControl.ALL_BY_ID[s]=this
|
---|
14869 | }
|
---|
14870 | this.setReloginMode(false)
|
---|
14871 | };
|
---|
14872 | ZmLoginDialog.prototype=new DwtComposite;
|
---|
14873 | ZmLoginDialog.prototype.constructor=ZmLoginDialog;
|
---|
14874 | ZmLoginDialog.prototype.toString=function(){
|
---|
14875 | return"ZmLoginDialog"
|
---|
14876 | };
|
---|
14877 | ZmLoginDialog.prototype.registerCallback=function(t,a,e){
|
---|
14878 | this._callback=new AjxCallback(a,t,e)
|
---|
14879 | };
|
---|
14880 | ZmLoginDialog.prototype.clearAll=function(){
|
---|
14881 | ZLoginFactory.get(ZLoginFactory.USER_ID).value="";
|
---|
14882 | ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value=""
|
---|
14883 | };
|
---|
14884 | ZmLoginDialog.prototype.clearPassword=function(){
|
---|
14885 | ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value=""
|
---|
14886 | };
|
---|
14887 | ZmLoginDialog.prototype.setError=function(e){
|
---|
14888 | if(e&&e.length){
|
---|
14889 | ZLoginFactory.showErrorMsg(e)
|
---|
14890 | }else{
|
---|
14891 | ZLoginFactory.hideErrorMsg()
|
---|
14892 | }};
|
---|
14893 | ZmLoginDialog.prototype.setFocus=function(t,e){
|
---|
14894 | ZLoginFactory.showUserField(t);
|
---|
14895 | this.setReloginMode(t&&t.length&&e)
|
---|
14896 | };
|
---|
14897 | ZmLoginDialog.prototype.setVisible=function(a,e){
|
---|
14898 | DwtComposite.prototype.setVisible.call(this,a);
|
---|
14899 | var i=appCtxt.getKeyboardMgr();
|
---|
14900 | if(i){
|
---|
14901 | if(a){
|
---|
14902 | if(i.isEnabled()){
|
---|
14903 | i.enable(false);
|
---|
14904 | this._kbnavDisabled=true
|
---|
14905 | }}else{
|
---|
14906 | if(this._kbnavDisabled){
|
---|
14907 | i.enable(true);
|
---|
14908 | this._kbnavDisabled=false
|
---|
14909 | }}}
|
---|
14910 | if(!a){
|
---|
14911 | return
|
---|
14912 | }
|
---|
14913 | this.setCursor("default");
|
---|
14914 | if((e==null||!e)&&this._className!=this._origClassName){
|
---|
14915 | this.getHtmlElement().className=this._origClassName;
|
---|
14916 | this._className=this._origClassName
|
---|
14917 | }else{
|
---|
14918 | if(e&&this._className!=this._xparentClassName){
|
---|
14919 | this.getHtmlElement().className=this._xparentClassName;
|
---|
14920 | this._className=this._xparentClassName
|
---|
14921 | }}
|
---|
14922 | Dwt.setHandler(this.getHtmlElement(),DwtEvent.ONKEYDOWN,ZLoginFactory.handleKeyPress);
|
---|
14923 | var t=ZLoginFactory.get(ZLoginFactory.PASSWORD_ID);
|
---|
14924 | if(t&&t.focus){
|
---|
14925 | t.focus()
|
---|
14926 | }};
|
---|
14927 | ZmLoginDialog.prototype.addChild=function(t,e){
|
---|
14928 | this._children.add(t)
|
---|
14929 | };
|
---|
14930 | ZmLoginDialog.prototype.setReloginMode=function(e){
|
---|
14931 | e?ZLoginFactory.showLogOff():ZLoginFactory.hideLogOff();
|
---|
14932 | ZLoginFactory.get(ZLoginFactory.USER_ID).disabled=e
|
---|
14933 | };
|
---|
14934 | ZmLoginDialog.prototype._loginSelListener=function(){
|
---|
14935 | this.setCursor("wait");
|
---|
14936 | var t=ZLoginFactory.get(ZLoginFactory.USER_ID).value;
|
---|
14937 | if(!(t&&t.length)){
|
---|
14938 | this.setError(ZmMsg.enterUsername);
|
---|
14939 | return
|
---|
14940 | }
|
---|
14941 | if(this._callback){
|
---|
14942 | var e=ZLoginFactory.get(ZLoginFactory.PASSWORD_ID).value;
|
---|
14943 | this._callback.run(t,e,appCtxt.rememberMe)
|
---|
14944 | }};
|
---|
14945 | ZmLoginDialog._loginListener=function(a){
|
---|
14946 | var t=a;
|
---|
14947 | while(t){
|
---|
14948 | var e=DwtControl.fromElement(t);
|
---|
14949 | if(e instanceof ZmLoginDialog){
|
---|
14950 | e._loginSelListener();
|
---|
14951 | break
|
---|
14952 | }
|
---|
14953 | t=t.parentNode
|
---|
14954 | }};
|
---|
14955 | ZmLoginDialog._loginDiffListener=function(e){
|
---|
14956 | ZmZimbraMail.logOff()
|
---|
14957 | }
|
---|
14958 | }
|
---|
14959 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewOrganizerDialog")){
|
---|
14960 | ZmNewOrganizerDialog=function(a,t,i,e){
|
---|
14961 | if(arguments.length==0){
|
---|
14962 | return
|
---|
14963 | }
|
---|
14964 | ZmDialog.call(this,{
|
---|
14965 | parent:a,className:t,title:i}
|
---|
14966 | );
|
---|
14967 | this._organizerType=e;
|
---|
14968 | this._setupControls()
|
---|
14969 | };
|
---|
14970 | ZmNewOrganizerDialog.prototype=new ZmDialog;
|
---|
14971 | ZmNewOrganizerDialog.prototype.constructor=ZmNewOrganizerDialog;
|
---|
14972 | ZmNewOrganizerDialog.prototype.toString=function(){
|
---|
14973 | return"ZmNewOrganizerDialog"
|
---|
14974 | };
|
---|
14975 | ZmNewOrganizerDialog.prototype.popup=function(t,s){
|
---|
14976 | if(this._folderTreeCellId){
|
---|
14977 | var n={
|
---|
14978 | overviewId:this.toString(),treeIds:this._treeIds,omit:this._omit,fieldId:this._folderTreeCellId,overviewTrees:[this._organizerType]};
|
---|
14979 | this._setOverview(n);
|
---|
14980 | if(this._folderTreeView){
|
---|
14981 | this._folderTreeView.getHeaderItem().setVisible(true,true);
|
---|
14982 | if(t){
|
---|
14983 | if(t.nId==ZmOrganizer.ID_ROOT){
|
---|
14984 | t=appCtxt.getFolderTree().root
|
---|
14985 | }}else{
|
---|
14986 | t=appCtxt.getFolderTree().root
|
---|
14987 | }
|
---|
14988 | var e=this._folderTreeView.getTreeItemById(t.id);
|
---|
14989 | if(e){
|
---|
14990 | this._folderTreeView.setSelection(e)
|
---|
14991 | }
|
---|
14992 | if(t.nId==ZmOrganizer.ID_ROOT){
|
---|
14993 | var a=ZmOrganizer.getSystemId(t.id);
|
---|
14994 | var e=this._folderTreeView.getTreeItemById(a);
|
---|
14995 | if(e){
|
---|
14996 | e.setExpanded(true)
|
---|
14997 | }}}}
|
---|
14998 | if(t&&(t.type!=ZmOrganizer.FOLDER)&&this._colorSelect){
|
---|
14999 | var l=this._colorSelect.getMenu().getItem(0);
|
---|
15000 | if(l.getText()==ZmOrganizer.COLOR_TEXT[0]){
|
---|
15001 | this._colorSelect.getMenu().removeChild(l)
|
---|
15002 | }}
|
---|
15003 | var c=appCtxt.multiAccounts&&this._opc.getOverviewContainer(this.toString());
|
---|
15004 | if(c){
|
---|
15005 | if(!t||(t&&t.nId==ZmOrganizer.ID_ROOT)){
|
---|
15006 | var h=s||appCtxt.getActiveAccount();
|
---|
15007 | c.setSelection(c.getHeaderItem(h))
|
---|
15008 | }else{
|
---|
15009 | var o=appCtxt.getOverviewId(this.toString(),s);
|
---|
15010 | var d=c.getOverview(o);
|
---|
15011 | var i=d&&d.getTreeView(this._organizerType);
|
---|
15012 | if(i){
|
---|
15013 | c.deselectAll();
|
---|
15014 | var e=i.getTreeItemById(t.id);
|
---|
15015 | i.setSelection(e)
|
---|
15016 | }}
|
---|
15017 | c.expandAccountOnly(s)
|
---|
15018 | }
|
---|
15019 | ZmDialog.prototype.popup.call(this)
|
---|
15020 | };
|
---|
15021 | ZmNewOrganizerDialog.prototype.reset=function(e){
|
---|
15022 | ZmDialog.prototype.reset.apply(this,arguments);
|
---|
15023 | if(this._colorSelect){
|
---|
15024 | this._initColorSelect(e)
|
---|
15025 | }
|
---|
15026 | if(this._remoteCheckboxField){
|
---|
15027 | this._remoteCheckboxField.checked=false;
|
---|
15028 | var t=document.getElementById(this._remoteCheckboxFieldId+"URLrow");
|
---|
15029 | if(t){
|
---|
15030 | t.style.display="none"
|
---|
15031 | }}
|
---|
15032 | if(this._urlField){
|
---|
15033 | this._urlField.value=""
|
---|
15034 | }
|
---|
15035 | if(appCtxt.multiAccounts){
|
---|
15036 | this._account=e
|
---|
15037 | }else{
|
---|
15038 | this._account=null
|
---|
15039 | }};
|
---|
15040 | ZmNewOrganizerDialog.prototype._getRemoteLabel=function(){
|
---|
15041 | return ZmMsg.subscribeToFeed
|
---|
15042 | };
|
---|
15043 | ZmNewOrganizerDialog.prototype._initColorSelect=function(a){
|
---|
15044 | var e=(this._colorSelect.getValue()+1)%ZmOrganizer.COLOR_CHOICES.length;
|
---|
15045 | var t=this._colorSelect.getOptionWithValue(e);
|
---|
15046 | this._colorSelect.setSelectedOption(t)
|
---|
15047 | };
|
---|
15048 | ZmNewOrganizerDialog.prototype._contentHtml=function(){
|
---|
15049 | var t=[];
|
---|
15050 | var e=0;
|
---|
15051 | t[e++]="<table cellpadding=0 cellspacing=5 border=0";
|
---|
15052 | t[e++]=(AjxEnv.isSafari)?" width='300'>":">";
|
---|
15053 | e=this._createStandardContentHtml(t,e);
|
---|
15054 | e=this._createExtraContentHtml(t,e);
|
---|
15055 | t[e++]="</table>";
|
---|
15056 | return t.join("")
|
---|
15057 | };
|
---|
15058 | ZmNewOrganizerDialog.prototype._createStandardContentHtml=function(t,e){
|
---|
15059 | e=this._createNameContentHtml(t,e);
|
---|
15060 | e=this._createColorContentHtml(t,e);
|
---|
15061 | return e
|
---|
15062 | };
|
---|
15063 | ZmNewOrganizerDialog.prototype._createNameContentHtml=function(t,e){
|
---|
15064 | this._nameFieldId=this._htmlElId+"_name";
|
---|
15065 | t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogName",{
|
---|
15066 | id:this._htmlElId}
|
---|
15067 | );
|
---|
15068 | return e
|
---|
15069 | };
|
---|
15070 | ZmNewOrganizerDialog.prototype._createColorContentHtml=function(t,e){
|
---|
15071 | this._colorSelectId=this._htmlElId+"_colorSelect";
|
---|
15072 | t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogColor",{
|
---|
15073 | id:this._htmlElId}
|
---|
15074 | );
|
---|
15075 | return e
|
---|
15076 | };
|
---|
15077 | ZmNewOrganizerDialog.prototype._createExtraContentHtml=function(t,e){
|
---|
15078 | e=this._createRemoteContentHtml(t,e);
|
---|
15079 | e=this._createFolderContentHtml(t,e);
|
---|
15080 | return e
|
---|
15081 | };
|
---|
15082 | ZmNewOrganizerDialog.prototype._createRemoteContentHtml=function(a,e){
|
---|
15083 | this._remoteCheckboxFieldId=this._htmlElId+"_remote";
|
---|
15084 | this._urlFieldId=this._htmlElId+"_url";
|
---|
15085 | var t={
|
---|
15086 | id:this._htmlElId,remoteLabel:this._getRemoteLabel()};
|
---|
15087 | a[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogRemote",t);
|
---|
15088 | return e
|
---|
15089 | };
|
---|
15090 | ZmNewOrganizerDialog.prototype._createFolderContentHtml=function(t,e){
|
---|
15091 | this._folderTreeCellId=this._htmlElId+"_folderTree";
|
---|
15092 | t[e++]=AjxTemplate.expand("share.Dialogs#ZmNewOrgDialogFolder",{
|
---|
15093 | id:this._htmlElId}
|
---|
15094 | );
|
---|
15095 | return e
|
---|
15096 | };
|
---|
15097 | ZmNewOrganizerDialog.prototype._setupControls=function(){
|
---|
15098 | this._setupStandardControls();
|
---|
15099 | this._setupExtraControls()
|
---|
15100 | };
|
---|
15101 | ZmNewOrganizerDialog.prototype._setupStandardControls=function(){
|
---|
15102 | this._setupNameControl();
|
---|
15103 | this._setupColorControl()
|
---|
15104 | };
|
---|
15105 | ZmNewOrganizerDialog.prototype._setupNameControl=function(){
|
---|
15106 | this._setNameField(this._nameFieldId)
|
---|
15107 | };
|
---|
15108 | ZmNewOrganizerDialog.prototype._setupColorControl=function(){
|
---|
15109 | this._colorSelect=new DwtSelect({
|
---|
15110 | parent:this}
|
---|
15111 | );
|
---|
15112 | for(var t=0;
|
---|
15113 | t<ZmOrganizer.COLOR_CHOICES.length;
|
---|
15114 | t++){
|
---|
15115 | var e=ZmOrganizer.COLOR_CHOICES[t];
|
---|
15116 | this._colorSelect.addOption(e.label,t==0,e.value)
|
---|
15117 | }
|
---|
15118 | var a=document.getElementById(this._colorSelectId);
|
---|
15119 | if(a){
|
---|
15120 | a.appendChild(this._colorSelect.getHtmlElement())
|
---|
15121 | }};
|
---|
15122 | ZmNewOrganizerDialog.prototype._setupExtraControls=function(){
|
---|
15123 | this._setupRemoteControl();
|
---|
15124 | this._setupFolderControl()
|
---|
15125 | };
|
---|
15126 | ZmNewOrganizerDialog.prototype._setupRemoteControl=function(){
|
---|
15127 | this._remoteCheckboxField=document.getElementById(this._remoteCheckboxFieldId);
|
---|
15128 | if(this._remoteCheckboxField){
|
---|
15129 | this._urlField=document.getElementById(this._remoteCheckboxFieldId+"URLfield");
|
---|
15130 | Dwt.setHandler(this._remoteCheckboxField,DwtEvent.ONCLICK,this._handleCheckbox)
|
---|
15131 | }};
|
---|
15132 | ZmNewOrganizerDialog.prototype._setupFolderControl=function(){
|
---|
15133 | if(!this._folderTreeCellId){
|
---|
15134 | return
|
---|
15135 | }
|
---|
15136 | this._treeIds=[this._organizerType];
|
---|
15137 | this._omit={};
|
---|
15138 | this._omit[ZmFolder.ID_SPAM]=true;
|
---|
15139 | this._omit[ZmFolder.ID_DRAFTS]=true;
|
---|
15140 | this._omit[ZmFolder.ID_SYNC_FAILURES]=true;
|
---|
15141 | this._omit[ZmFolder.ID_OUTBOX]=true;
|
---|
15142 | var e=appCtxt.getFolderTree();
|
---|
15143 | var t=e?e.getByName(ZmFolder.SYNC_ISSUES):null;
|
---|
15144 | if(t){
|
---|
15145 | this._omit[t.id]=true
|
---|
15146 | }
|
---|
15147 | this._omit[ZmOrganizer.ID_ZIMLET]=true
|
---|
15148 | };
|
---|
15149 | ZmNewOrganizerDialog.prototype._renderOverview=function(i,e,t,a){
|
---|
15150 | this._setupFolderControl();
|
---|
15151 | ZmDialog.prototype._renderOverview.apply(this,arguments);
|
---|
15152 | this._folderTreeView=i.getTreeView(this._organizerType)
|
---|
15153 | };
|
---|
15154 | ZmNewOrganizerDialog.prototype._getFolderData=function(){
|
---|
15155 | var i=appCtxt.multiAccounts?this._opc.getOverviewContainer(this.toString()):this._opc.getOverview(this._curOverviewId);
|
---|
15156 | var s=i?i.getSelected():appCtxt.getFolderTree(this._account).root;
|
---|
15157 | var a=AjxStringUtil.trim(this._nameField.value);
|
---|
15158 | var n=ZmFolder.checkName(a,s);
|
---|
15159 | if(!n&&s.hasChild(a)){
|
---|
15160 | n=AjxMessageFormat.format(ZmMsg.errorAlreadyExists,[a])
|
---|
15161 | }
|
---|
15162 | var e=null;
|
---|
15163 | if(!n&&this._colorSelectId){
|
---|
15164 | e=this._colorSelect.getValue()
|
---|
15165 | }
|
---|
15166 | var t=null;
|
---|
15167 | if(!n&&this._remoteCheckboxField){
|
---|
15168 | t=this._remoteCheckboxField.checked?this._urlField.value:null;
|
---|
15169 | if(t||t!=null){
|
---|
15170 | n=ZmOrganizer.checkUrl(t)
|
---|
15171 | }}
|
---|
15172 | if(!n&&s.disallowSubFolder){
|
---|
15173 | n=AjxMessageFormat.format(ZmMsg.errorSubFolderNotAllowed,s.name)
|
---|
15174 | }
|
---|
15175 | var o=appCtxt.multiAccounts?s.getAccount():null;
|
---|
15176 | return(n?this._showError(n):{
|
---|
15177 | l:s.id,name:a,color:e,url:t,account:o}
|
---|
15178 | )
|
---|
15179 | };
|
---|
15180 | ZmNewOrganizerDialog.prototype._getTabGroupMembers=function(){
|
---|
15181 | var e=[this._nameField];
|
---|
15182 | if(this._colorSelect){
|
---|
15183 | e.push(this._colorSelect)
|
---|
15184 | }
|
---|
15185 | if(this._overview[this._curOverviewId]){
|
---|
15186 | e.push(this._overview[this._curOverviewId])
|
---|
15187 | }
|
---|
15188 | return e
|
---|
15189 | };
|
---|
15190 | ZmNewOrganizerDialog.prototype._okButtonListener=function(t){
|
---|
15191 | var e=this._getFolderData();
|
---|
15192 | if(e){
|
---|
15193 | DwtDialog.prototype._buttonListener.call(this,t,e)
|
---|
15194 | }};
|
---|
15195 | ZmNewOrganizerDialog.prototype._enterListener=function(t){
|
---|
15196 | var e=this._getFolderData();
|
---|
15197 | if(e){
|
---|
15198 | this._runEnterCallback(e)
|
---|
15199 | }};
|
---|
15200 | ZmNewOrganizerDialog.prototype._handleCheckbox=function(e){
|
---|
15201 | e=e||window.event;
|
---|
15202 | var a=DwtUiEvent.getTarget(e);
|
---|
15203 | var t=document.getElementById(a.id+"URLrow");
|
---|
15204 | var i=document.getElementById(a.id+"URLfield");
|
---|
15205 | t.style.display=a.checked?(AjxEnv.isIE?"block":"table-row"):"none";
|
---|
15206 | if(a.checked){
|
---|
15207 | i.focus()
|
---|
15208 | }}
|
---|
15209 | }
|
---|
15210 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewFolderDialog")){
|
---|
15211 | ZmNewFolderDialog=function(a,t){
|
---|
15212 | var i=ZmMsg.createNewFolder;
|
---|
15213 | var e=ZmOrganizer.FOLDER;
|
---|
15214 | ZmNewOrganizerDialog.call(this,a,t,i,e)
|
---|
15215 | };
|
---|
15216 | ZmNewFolderDialog.prototype=new ZmNewOrganizerDialog;
|
---|
15217 | ZmNewFolderDialog.prototype.constructor=ZmNewFolderDialog;
|
---|
15218 | ZmNewFolderDialog.prototype.toString=function(){
|
---|
15219 | return"ZmNewFolderDialog"
|
---|
15220 | };
|
---|
15221 | ZmNewFolderDialog.prototype._createColorContentHtml=function(t,e){
|
---|
15222 | return e
|
---|
15223 | };
|
---|
15224 | ZmNewFolderDialog.prototype._setupColorControl=function(){}
|
---|
15225 | }
|
---|
15226 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewSearchDialog")){
|
---|
15227 | ZmNewSearchDialog=function(t,e){
|
---|
15228 | ZmDialog.call(this,{
|
---|
15229 | parent:t,className:e,title:ZmMsg.saveSearch}
|
---|
15230 | );
|
---|
15231 | this._omit={};
|
---|
15232 | this._omit[ZmFolder.ID_SPAM]=true;
|
---|
15233 | this._omit[ZmFolder.ID_DRAFTS]=true;
|
---|
15234 | this._setNameField(this._nameFieldId)
|
---|
15235 | };
|
---|
15236 | ZmNewSearchDialog.prototype=new ZmDialog;
|
---|
15237 | ZmNewSearchDialog.prototype.constructor=ZmNewSearchDialog;
|
---|
15238 | ZmNewSearchDialog.prototype.toString=function(){
|
---|
15239 | return"ZmNewSearchDialog"
|
---|
15240 | };
|
---|
15241 | ZmNewSearchDialog.prototype.popup=function(n){
|
---|
15242 | var a=appCtxt.multiAccounts?appCtxt.getActiveAccount():null;
|
---|
15243 | var o=this._curOverviewId=(a?([this.toString(),a.name].join("-")):this.toString());
|
---|
15244 | var i={
|
---|
15245 | account:a,treeIds:[ZmOrganizer.FOLDER,ZmOrganizer.SEARCH],fieldId:this._folderTreeCellId,omit:this._omit,overviewId:o};
|
---|
15246 | var t=this._setOverview(i,true);
|
---|
15247 | this._folderTreeView=t.getTreeView(ZmOrganizer.FOLDER);
|
---|
15248 | this._searchTreeView=t.getTreeView(ZmOrganizer.SEARCH);
|
---|
15249 | this._search=n.search;
|
---|
15250 | this._searchTreeView.setSelected(appCtxt.getFolderTree(a).root,true);
|
---|
15251 | this._isGlobalSearch=appCtxt.multiAccounts&&appCtxt.getSearchController().searchAllAccounts;
|
---|
15252 | if(appCtxt.multiAccounts){
|
---|
15253 | this._searchTreeView.setVisible(true);
|
---|
15254 | this._makeOverviewVisible(o)
|
---|
15255 | }
|
---|
15256 | var e=document.getElementById(this._overviewDivId);
|
---|
15257 | if(e){
|
---|
15258 | Dwt.setVisible(e,(n.showOverview&&!this._isGlobalSearch))
|
---|
15259 | }
|
---|
15260 | ZmDialog.prototype.popup.call(this)
|
---|
15261 | };
|
---|
15262 | ZmNewSearchDialog.prototype._contentHtml=function(){
|
---|
15263 | this._nameFieldId=this._htmlElId+"_nameField";
|
---|
15264 | this._folderTreeCellId=this._htmlElId+"_folderTreeCell";
|
---|
15265 | this._overviewDivId=this._htmlElId+"_overviewDiv";
|
---|
15266 | return(AjxTemplate.expand("share.Dialogs#NewSearch",{
|
---|
15267 | id:this._htmlElId}
|
---|
15268 | ))
|
---|
15269 | };
|
---|
15270 | ZmNewSearchDialog.prototype._okButtonListener=function(t){
|
---|
15271 | var e=this._getSearchData();
|
---|
15272 | if(e){
|
---|
15273 | DwtDialog.prototype._buttonListener.call(this,t,e)
|
---|
15274 | }};
|
---|
15275 | ZmNewSearchDialog.prototype._getSearchData=function(){
|
---|
15276 | var a=this._isGlobalSearch?appCtxt.getById(ZmOrganizer.ID_ROOT):this._overview[this._curOverviewId].getSelected();
|
---|
15277 | var e=AjxStringUtil.trim(this._nameField.value);
|
---|
15278 | var t=ZmFolder.checkName(e,a);
|
---|
15279 | if(!t&&a.hasChild(e)){
|
---|
15280 | t=ZmMsg.folderOrSearchNameExists
|
---|
15281 | }
|
---|
15282 | if(!t&&(a.id==ZmOrganizer.ID_ROOT)&&appCtxt.getFolderTree().root.hasChild(e)){
|
---|
15283 | t=ZmMsg.folderOrSearchNameExists
|
---|
15284 | }
|
---|
15285 | if(t){
|
---|
15286 | return this._showError(t)
|
---|
15287 | }else{
|
---|
15288 | return{
|
---|
15289 | parent:a,isGlobal:this._isGlobalSearch,name:e,search:this._search}
|
---|
15290 | }};
|
---|
15291 | ZmNewSearchDialog.prototype._enterListener=function(t){
|
---|
15292 | var e=this._getSearchData();
|
---|
15293 | if(e){
|
---|
15294 | this._runEnterCallback(e)
|
---|
15295 | }};
|
---|
15296 | ZmNewSearchDialog.prototype._getTabGroupMembers=function(){
|
---|
15297 | var e=[this._nameField];
|
---|
15298 | if(this._overview[this._curOverviewId]){
|
---|
15299 | e.push(this._overview[this._curOverviewId])
|
---|
15300 | }
|
---|
15301 | return e
|
---|
15302 | }
|
---|
15303 | }
|
---|
15304 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmNewTagDialog")){
|
---|
15305 | ZmNewTagDialog=function(t,e){
|
---|
15306 | ZmDialog.call(this,{
|
---|
15307 | parent:t,className:e,title:ZmMsg.createNewTag}
|
---|
15308 | );
|
---|
15309 | this._setNameField(this._htmlElId+"_name");
|
---|
15310 | this._setTagColorMenu();
|
---|
15311 | this._setAccountMenu()
|
---|
15312 | };
|
---|
15313 | ZmNewTagDialog.prototype=new ZmDialog;
|
---|
15314 | ZmNewTagDialog.prototype.constructor=ZmNewTagDialog;
|
---|
15315 | ZmNewTagDialog.prototype.toString=function(){
|
---|
15316 | return"ZmNewTagDialog"
|
---|
15317 | };
|
---|
15318 | ZmNewTagDialog.prototype.popup=function(a,e){
|
---|
15319 | if(this._accountSelect){
|
---|
15320 | var t=e||appCtxt.getActiveAccount();
|
---|
15321 | this._accountSelect.setSelectedValue(t.id)
|
---|
15322 | }
|
---|
15323 | ZmDialog.prototype.popup.call(this)
|
---|
15324 | };
|
---|
15325 | ZmNewTagDialog.prototype.cleanup=function(e){
|
---|
15326 | DwtDialog.prototype.cleanup.call(this,e);
|
---|
15327 | var t=this._getNextColor();
|
---|
15328 | this._setColorButton(t,ZmOrganizer.COLOR_TEXT[t],ZmTag.COLOR_ICON[t])
|
---|
15329 | };
|
---|
15330 | ZmNewTagDialog.prototype._colorListener=function(t){
|
---|
15331 | var e=t.item.getData(ZmOperation.MENUITEM_ID);
|
---|
15332 | this._setColorButton(e,ZmOrganizer.COLOR_TEXT[e],ZmTag.COLOR_ICON[e])
|
---|
15333 | };
|
---|
15334 | ZmNewTagDialog.prototype._setTagColorMenu=function(){
|
---|
15335 | var a=this._htmlElId+"_tagColor";
|
---|
15336 | this._colorButton=new DwtButton({
|
---|
15337 | parent:this,parentElement:a,id:"ZmTagColorMenu"}
|
---|
15338 | );
|
---|
15339 | this._colorButton.noMenuBar=true;
|
---|
15340 | ZmOperation.addColorMenu(this._colorButton);
|
---|
15341 | var t=ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG];
|
---|
15342 | this._setColorButton(t,ZmOrganizer.COLOR_TEXT[t],ZmTag.COLOR_ICON[t]);
|
---|
15343 | this._tagColorListener=new AjxListener(this,this._colorListener);
|
---|
15344 | var e=this._colorButton.getMenu().getItems();
|
---|
15345 | for(var o=0;
|
---|
15346 | o<e.length;
|
---|
15347 | o++){
|
---|
15348 | e[o].addSelectionListener(this._tagColorListener)
|
---|
15349 | }};
|
---|
15350 | ZmNewTagDialog.prototype._setAccountMenu=function(){
|
---|
15351 | if(!appCtxt.multiAccounts){
|
---|
15352 | return
|
---|
15353 | }
|
---|
15354 | var e=this._htmlElId+"_account";
|
---|
15355 | this._accountSelect=new DwtSelect({
|
---|
15356 | parent:this,parentElement:e}
|
---|
15357 | );
|
---|
15358 | var a=appCtxt.accountList.visibleAccounts;
|
---|
15359 | for(var t=0;
|
---|
15360 | t<a.length;
|
---|
15361 | t++){
|
---|
15362 | var s=a[t];
|
---|
15363 | if(appCtxt.get(ZmSetting.TAGGING_ENABLED,null,s)){
|
---|
15364 | var n=new DwtSelectOption(s.id,null,s.getDisplayName(),null,null,s.getIcon());
|
---|
15365 | this._accountSelect.addOption(n)
|
---|
15366 | }}};
|
---|
15367 | ZmNewTagDialog.prototype._setColorButton=function(e,a,t){
|
---|
15368 | this._colorButton.setData(ZmOperation.MENUITEM_ID,e);
|
---|
15369 | this._colorButton.setText(a);
|
---|
15370 | this._colorButton.setImage(t)
|
---|
15371 | };
|
---|
15372 | ZmNewTagDialog.prototype._contentHtml=function(){
|
---|
15373 | return AjxTemplate.expand("share.Dialogs#ZmPromptDialog",{
|
---|
15374 | id:this._htmlElId}
|
---|
15375 | )
|
---|
15376 | };
|
---|
15377 | ZmNewTagDialog.prototype._okButtonListener=function(t){
|
---|
15378 | var e=this._getTagData();
|
---|
15379 | if(e){
|
---|
15380 | DwtDialog.prototype._buttonListener.call(this,t,e)
|
---|
15381 | }};
|
---|
15382 | ZmNewTagDialog.prototype._getTagData=function(){
|
---|
15383 | var a=this._accountSelect&&this._accountSelect.getValue();
|
---|
15384 | var i=a&&appCtxt.accountList.getAccount(a);
|
---|
15385 | var t=AjxStringUtil.trim(this._nameField.value);
|
---|
15386 | var o=ZmTag.checkName(t);
|
---|
15387 | var e=appCtxt.getTagTree(i);
|
---|
15388 | if(!o&&e&&e.getByName(t)){
|
---|
15389 | o=ZmMsg.tagNameExists
|
---|
15390 | }
|
---|
15391 | return(o)?this._showError(o):{
|
---|
15392 | name:t,color:this._colorButton.getData(ZmOperation.MENUITEM_ID),accountName:(i&&i.name)}
|
---|
15393 | };
|
---|
15394 | ZmNewTagDialog.prototype._enterListener=function(t){
|
---|
15395 | var e=this._getTagData();
|
---|
15396 | if(e){
|
---|
15397 | this._runEnterCallback(e)
|
---|
15398 | }};
|
---|
15399 | ZmNewTagDialog.prototype._getNextColor=function(){
|
---|
15400 | var a={};
|
---|
15401 | var e=appCtxt.getTagTree();
|
---|
15402 | if(!e){
|
---|
15403 | return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
|
---|
15404 | }
|
---|
15405 | var o=e.root.children.getArray();
|
---|
15406 | if(!(o&&o.length)){
|
---|
15407 | return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
|
---|
15408 | }
|
---|
15409 | for(var n=0;
|
---|
15410 | n<o.length;
|
---|
15411 | n++){
|
---|
15412 | a[o[n].color]=true
|
---|
15413 | }
|
---|
15414 | for(var n=0;
|
---|
15415 | n<ZmTagTree.COLOR_LIST.length;
|
---|
15416 | n++){
|
---|
15417 | var t=ZmTagTree.COLOR_LIST[n];
|
---|
15418 | if(!a[t]){
|
---|
15419 | return t
|
---|
15420 | }}
|
---|
15421 | return ZmOrganizer.DEFAULT_COLOR[ZmOrganizer.TAG]
|
---|
15422 | };
|
---|
15423 | ZmNewTagDialog.prototype._getTabGroupMembers=function(){
|
---|
15424 | return[this._nameField,this._colorButton]
|
---|
15425 | }
|
---|
15426 | }
|
---|
15427 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmFolderPropsDialog")){
|
---|
15428 | ZmFolderPropsDialog=function(a,t){
|
---|
15429 | t=t||"ZmFolderPropsDialog";
|
---|
15430 | var i;
|
---|
15431 | if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
|
---|
15432 | i=[new DwtDialog_ButtonDescriptor(ZmFolderPropsDialog.ADD_SHARE_BUTTON,ZmMsg.addShare,DwtDialog.ALIGN_LEFT)]
|
---|
15433 | }
|
---|
15434 | DwtDialog.call(this,{
|
---|
15435 | parent:a,className:t,title:ZmMsg.folderProperties,extraButtons:i}
|
---|
15436 | );
|
---|
15437 | if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
|
---|
15438 | this.registerCallback(ZmFolderPropsDialog.ADD_SHARE_BUTTON,this._handleAddShareButton,this)
|
---|
15439 | }
|
---|
15440 | this.setButtonListener(DwtDialog.OK_BUTTON,new AjxListener(this,this._handleOkButton));
|
---|
15441 | this.setButtonListener(DwtDialog.CANCEL_BUTTON,new AjxListener(this,this._handleCancelButton));
|
---|
15442 | this._folderChangeListener=new AjxListener(this,this._handleFolderChange);
|
---|
15443 | var e=this._createView();
|
---|
15444 | this.setView(e)
|
---|
15445 | };
|
---|
15446 | ZmFolderPropsDialog.prototype=new DwtDialog;
|
---|
15447 | ZmFolderPropsDialog.prototype.constructor=ZmFolderPropsDialog;
|
---|
15448 | ZmFolderPropsDialog.ADD_SHARE_BUTTON=++DwtDialog.LAST_BUTTON;
|
---|
15449 | ZmFolderPropsDialog.SHARES_HEIGHT="9em";
|
---|
15450 | ZmFolderPropsDialog.prototype.toString=function(){
|
---|
15451 | return"ZmFolderPropsDialog"
|
---|
15452 | };
|
---|
15453 | ZmFolderPropsDialog.prototype.popup=function(t){
|
---|
15454 | this._organizer=t;
|
---|
15455 | t.addChangeListener(this._folderChangeListener);
|
---|
15456 | if(this._color&&t.type!=ZmOrganizer.FOLDER&&t.type!=ZmOrganizer.TASKS&&t.type!=ZmOrganizer.ADDRBOOK){
|
---|
15457 | this._color.clearOptions();
|
---|
15458 | for(var o=1;
|
---|
15459 | o<ZmOrganizer.COLOR_CHOICES.length;
|
---|
15460 | o++){
|
---|
15461 | var a=ZmOrganizer.COLOR_CHOICES[o];
|
---|
15462 | this._color.addOption(a.label,false,a.value)
|
---|
15463 | }}else{
|
---|
15464 | this._color.clearOptions();
|
---|
15465 | for(var o=0;
|
---|
15466 | o<ZmOrganizer.COLOR_CHOICES.length;
|
---|
15467 | o++){
|
---|
15468 | var a=ZmOrganizer.COLOR_CHOICES[o];
|
---|
15469 | this._color.addOption(a.label,false,a.value)
|
---|
15470 | }}
|
---|
15471 | this._handleFolderChange();
|
---|
15472 | if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
|
---|
15473 | var e=(!t.link||t.isAdmin());
|
---|
15474 | this.setButtonVisible(ZmFolderPropsDialog.ADD_SHARE_BUTTON,e)
|
---|
15475 | }
|
---|
15476 | DwtDialog.prototype.popup.call(this);
|
---|
15477 | if(this._nameInputEl.style.display!="none"){
|
---|
15478 | this._nameInputEl.focus()
|
---|
15479 | }};
|
---|
15480 | ZmFolderPropsDialog.prototype.popdown=function(){
|
---|
15481 | if(this._organizer){
|
---|
15482 | this._organizer.removeChangeListener(this._folderChangeListener);
|
---|
15483 | this._organizer=null
|
---|
15484 | }
|
---|
15485 | DwtDialog.prototype.popdown.call(this)
|
---|
15486 | };
|
---|
15487 | ZmFolderPropsDialog.prototype._getSeparatorTemplate=function(){
|
---|
15488 | return""
|
---|
15489 | };
|
---|
15490 | ZmFolderPropsDialog.prototype._handleEditShare=function(a,t){
|
---|
15491 | t=t||Dwt.getObjectFromElement(DwtUiEvent.getTarget(a));
|
---|
15492 | var e=appCtxt.getSharePropsDialog();
|
---|
15493 | e.popup(ZmSharePropsDialog.EDIT,t.object,t);
|
---|
15494 | return false
|
---|
15495 | };
|
---|
15496 | ZmFolderPropsDialog.prototype._handleRevokeShare=function(a,t){
|
---|
15497 | t=t||Dwt.getObjectFromElement(DwtUiEvent.getTarget(a));
|
---|
15498 | var e=appCtxt.getRevokeShareDialog();
|
---|
15499 | e.popup(t);
|
---|
15500 | return false
|
---|
15501 | };
|
---|
15502 | ZmFolderPropsDialog.prototype._handleResendShare=function(o,i){
|
---|
15503 | AjxDispatcher.require("Share");
|
---|
15504 | i=i||Dwt.getObjectFromElement(DwtUiEvent.getTarget(o));
|
---|
15505 | var e=new ZmShare({
|
---|
15506 | object:i.object}
|
---|
15507 | );
|
---|
15508 | e.grantee.id=i.grantee.id;
|
---|
15509 | e.grantee.email=(i.grantee.type=="guest")?i.grantee.id:i.grantee.name;
|
---|
15510 | e.grantee.name=i.grantee.name;
|
---|
15511 | if(e.object.isRemote()){
|
---|
15512 | e.grantor.id=e.object.zid;
|
---|
15513 | e.grantor.email=e.object.owner;
|
---|
15514 | e.grantor.name=e.grantor.email;
|
---|
15515 | e.link.id=e.object.rid
|
---|
15516 | }else{
|
---|
15517 | e.grantor.id=appCtxt.get(ZmSetting.USERID);
|
---|
15518 | e.grantor.email=appCtxt.get(ZmSetting.USERNAME);
|
---|
15519 | e.grantor.name=appCtxt.get(ZmSetting.DISPLAY_NAME)||e.grantor.email;
|
---|
15520 | e.link.id=e.object.id
|
---|
15521 | }
|
---|
15522 | e.link.name=i.object.name;
|
---|
15523 | e.link.view=ZmOrganizer.getViewName(i.object.type);
|
---|
15524 | e.link.perm=i.link.perm;
|
---|
15525 | if(i.grantee.type=="guest"){
|
---|
15526 | if(!this._guestFormatter){
|
---|
15527 | this._guestFormatter=new AjxMessageFormat(ZmMsg.shareWithGuestNotes)
|
---|
15528 | }
|
---|
15529 | var a=i.object.getRestUrl();
|
---|
15530 | var n=e.grantee.email;
|
---|
15531 | var t=i.link.pw;
|
---|
15532 | if(t&&n){
|
---|
15533 | e.notes=this._guestFormatter.format([a,n,t])
|
---|
15534 | }}
|
---|
15535 | e.sendMessage(ZmShare.NEW);
|
---|
15536 | appCtxt.setStatusMsg(ZmMsg.resentShareMessage);
|
---|
15537 | return false
|
---|
15538 | };
|
---|
15539 | ZmFolderPropsDialog.prototype._handleAddShareButton=function(t){
|
---|
15540 | var e=appCtxt.getSharePropsDialog();
|
---|
15541 | e.popup(ZmSharePropsDialog.NEW,this._organizer,null)
|
---|
15542 | };
|
---|
15543 | ZmFolderPropsDialog.prototype._handleOkButton=function(a){
|
---|
15544 | if(!this._handleErrorCallback){
|
---|
15545 | this._handleErrorCallback=new AjxCallback(this,this._handleError);
|
---|
15546 | this._handleRenameErrorCallback=new AjxCallback(this,this._handleRenameError)
|
---|
15547 | }
|
---|
15548 | var i=new AjxCallback(this,this._handleColor);
|
---|
15549 | var e=this._organizer;
|
---|
15550 | if(!e.isSystem()&&!e.isDataSource()){
|
---|
15551 | var t=this._nameInputEl.value;
|
---|
15552 | if(e.name!=t){
|
---|
15553 | e.rename(t,i,this._handleRenameErrorCallback);
|
---|
15554 | return
|
---|
15555 | }}
|
---|
15556 | i.run(null)
|
---|
15557 | };
|
---|
15558 | ZmFolderPropsDialog.prototype._handleColor=function(a){
|
---|
15559 | var i=new AjxCallback(this,this._handleFreeBusy);
|
---|
15560 | var e=this._organizer;
|
---|
15561 | var t=this._color.getValue();
|
---|
15562 | if(e.color!=t){
|
---|
15563 | e.setColor(t,i,this._handleErrorCallback);
|
---|
15564 | return
|
---|
15565 | }
|
---|
15566 | i.run(a)
|
---|
15567 | };
|
---|
15568 | ZmFolderPropsDialog.prototype._handleFreeBusy=function(t){
|
---|
15569 | var i=new AjxCallback(this,this.popdown);
|
---|
15570 | var e=this._organizer;
|
---|
15571 | if(Dwt.getVisible(this._excludeFbEl)&&e.setFreeBusy){
|
---|
15572 | var a=this._excludeFbCheckbox.checked;
|
---|
15573 | if(e.excludeFreeBusy!=a){
|
---|
15574 | e.setFreeBusy(a,i,this._handleErrorCallback);
|
---|
15575 | return
|
---|
15576 | }}
|
---|
15577 | i.run(t)
|
---|
15578 | };
|
---|
15579 | ZmFolderPropsDialog.prototype._handleError=function(e){};
|
---|
15580 | ZmFolderPropsDialog.prototype._handleRenameError=function(e){
|
---|
15581 | var a=this._nameInputEl.value;
|
---|
15582 | var i,t;
|
---|
15583 | if(e.code==ZmCsfeException.MAIL_ALREADY_EXISTS){
|
---|
15584 | i=AjxMessageFormat.format(ZmMsg.errorAlreadyExists,[a])
|
---|
15585 | }else{
|
---|
15586 | if(e.code==ZmCsfeException.MAIL_IMMUTABLE){
|
---|
15587 | i=AjxMessageFormat.format(ZmMsg.errorCannotRename,[a])
|
---|
15588 | }else{
|
---|
15589 | if(e.code==ZmCsfeException.SVC_INVALID_REQUEST){
|
---|
15590 | i=e.msg
|
---|
15591 | }}}
|
---|
15592 | appCtxt.getAppController().popupErrorDialog(i,e.msg,null,true);
|
---|
15593 | return true
|
---|
15594 | };
|
---|
15595 | ZmFolderPropsDialog.prototype._handleCancelButton=function(e){
|
---|
15596 | this.popdown()
|
---|
15597 | };
|
---|
15598 | ZmFolderPropsDialog.prototype._handleFolderChange=function(i){
|
---|
15599 | var t=this._organizer;
|
---|
15600 | if(t.isSystem()||t.isDataSource()){
|
---|
15601 | this._nameOutputEl.innerHTML=AjxStringUtil.htmlEncode(t.name);
|
---|
15602 | this._nameOutputEl.style.display="block";
|
---|
15603 | this._nameInputEl.style.display="none"
|
---|
15604 | }else{
|
---|
15605 | this._nameInputEl.value=t.name;
|
---|
15606 | this._nameInputEl.style.display="block";
|
---|
15607 | this._nameOutputEl.style.display="none"
|
---|
15608 | }
|
---|
15609 | this._ownerEl.innerHTML=AjxStringUtil.htmlEncode(t.owner);
|
---|
15610 | this._typeEl.innerHTML=ZmMsg[ZmOrganizer.FOLDER_KEY[t.type]]||ZmMsg.folder;
|
---|
15611 | this._urlEl.innerHTML=t.url||"";
|
---|
15612 | if(this._color){
|
---|
15613 | this._color.setSelectedValue(t.color);
|
---|
15614 | var e=(t.type!=ZmOrganizer.FOLDER||(t.type==ZmOrganizer.FOLDER&&appCtxt.get(ZmSetting.MAIL_FOLDER_COLORS_ENABLED)));
|
---|
15615 | this._props.setPropertyVisible(this._colorId,e)
|
---|
15616 | }
|
---|
15617 | this._excludeFbCheckbox.checked=t.excludeFreeBusy;
|
---|
15618 | var n=t.isMountpoint;
|
---|
15619 | if(n){
|
---|
15620 | AjxDispatcher.require("Share");
|
---|
15621 | var a=ZmShare.getShareFromLink(t);
|
---|
15622 | var o=a&&a.link&&a.link.role;
|
---|
15623 | this._permEl.innerHTML=ZmShare.getRoleActions(o)
|
---|
15624 | }
|
---|
15625 | if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
|
---|
15626 | this._populateShares(t)
|
---|
15627 | }
|
---|
15628 | this._props.setPropertyVisible(this._ownerId,t.owner!=null);
|
---|
15629 | this._props.setPropertyVisible(this._urlId,t.url);
|
---|
15630 | this._props.setPropertyVisible(this._permId,n);
|
---|
15631 | Dwt.setVisible(this._excludeFbEl,!t.link&&(t.type==ZmOrganizer.CALENDAR))
|
---|
15632 | };
|
---|
15633 | ZmFolderPropsDialog.prototype._populateShares=function(e){
|
---|
15634 | this._sharesGroup.setContent("");
|
---|
15635 | var s=this._getDisplayShares(e);
|
---|
15636 | var a=false;
|
---|
15637 | if(s.length){
|
---|
15638 | for(var t=0;
|
---|
15639 | t<s.length;
|
---|
15640 | t++){
|
---|
15641 | var o=s[t];
|
---|
15642 | if(!(o.grantee&&o.grantee.name)){
|
---|
15643 | a=true
|
---|
15644 | }}}
|
---|
15645 | if(a){
|
---|
15646 | var n=new AjxCallback(this,this._handleResponseGetFolder,[s]);
|
---|
15647 | e.getFolder(n)
|
---|
15648 | }else{
|
---|
15649 | this._handleResponseGetFolder(s)
|
---|
15650 | }
|
---|
15651 | this._sharesGroup.setVisible(s.length>0)
|
---|
15652 | };
|
---|
15653 | ZmFolderPropsDialog.prototype._getDisplayShares=function(e){
|
---|
15654 | var a=e.shares;
|
---|
15655 | var h=[];
|
---|
15656 | if((!e.link||e.isAdmin())&&a&&a.length>0){
|
---|
15657 | AjxDispatcher.require("Share");
|
---|
15658 | var s=appCtxt.accountList.mainAccount.id;
|
---|
15659 | for(var t=0;
|
---|
15660 | t<a.length;
|
---|
15661 | t++){
|
---|
15662 | var o=a[t];
|
---|
15663 | if(o.grantee){
|
---|
15664 | var n=o.grantee.id;
|
---|
15665 | if((o.grantee.type!=ZmShare.TYPE_USER)||(o.grantee.id!=s)){
|
---|
15666 | h.push(o)
|
---|
15667 | }}}}
|
---|
15668 | return h
|
---|
15669 | };
|
---|
15670 | ZmFolderPropsDialog.prototype._handleResponseGetFolder=function(c,h){
|
---|
15671 | if(h){
|
---|
15672 | c=this._getDisplayShares(h)
|
---|
15673 | }
|
---|
15674 | if(c.length){
|
---|
15675 | var u=document.createElement("TABLE");
|
---|
15676 | u.border=0;
|
---|
15677 | u.cellSpacing=0;
|
---|
15678 | u.cellPadding=3;
|
---|
15679 | for(var n=0;
|
---|
15680 | n<c.length;
|
---|
15681 | n++){
|
---|
15682 | var d=c[n];
|
---|
15683 | var m=u.insertRow(-1);
|
---|
15684 | var t=m.insertCell(-1);
|
---|
15685 | t.style.paddingRight="15px";
|
---|
15686 | var s=d.grantee&&d.grantee.name;
|
---|
15687 | if(d.isAll()){
|
---|
15688 | s=ZmMsg.shareWithAll
|
---|
15689 | }else{
|
---|
15690 | if(d.isPublic()){
|
---|
15691 | s=ZmMsg.shareWithPublic
|
---|
15692 | }else{
|
---|
15693 | if(d.isGuest()){
|
---|
15694 | s=s||(d.grantee&&d.grantee.id)
|
---|
15695 | }}}
|
---|
15696 | t.innerHTML=AjxStringUtil.htmlEncode(s);
|
---|
15697 | var o=m.insertCell(-1);
|
---|
15698 | o.style.paddingRight="15px";
|
---|
15699 | o.innerHTML=ZmShare.getRoleName(d.link.role);
|
---|
15700 | this.__createCmdCells(m,d)
|
---|
15701 | }
|
---|
15702 | this._sharesGroup.setElement(u);
|
---|
15703 | var e=Dwt.DEFAULT;
|
---|
15704 | var l=c.length>5?ZmFolderPropsDialog.SHARES_HEIGHT:Dwt.CLEAR;
|
---|
15705 | var a=this._sharesGroup.getInsetHtmlElement();
|
---|
15706 | Dwt.setScrollStyle(a,Dwt.SCROLL);
|
---|
15707 | Dwt.setSize(a,e,l)
|
---|
15708 | }
|
---|
15709 | this._sharesGroup.setVisible(c.length>0)
|
---|
15710 | };
|
---|
15711 | ZmFolderPropsDialog.prototype.__createCmdCells=function(d,c){
|
---|
15712 | var s=c.grantee.type;
|
---|
15713 | if(s==ZmShare.TYPE_DOMAIN||!c.link.role){
|
---|
15714 | var l=d.insertCell(-1);
|
---|
15715 | l.colSpan=3;
|
---|
15716 | l.innerHTML=ZmMsg.configureWithAdmin;
|
---|
15717 | return
|
---|
15718 | }
|
---|
15719 | var a=[ZmShare.EDIT,ZmShare.REVOKE,ZmShare.RESEND];
|
---|
15720 | var e=[this._handleEditShare,this._handleRevokeShare,this._handleResendShare];
|
---|
15721 | for(var o=0;
|
---|
15722 | o<a.length;
|
---|
15723 | o++){
|
---|
15724 | var t=a[o];
|
---|
15725 | var l=d.insertCell(-1);
|
---|
15726 | var n=c.grantee&&(c.grantee.type==ZmShare.TYPE_ALL);
|
---|
15727 | if((n||c.isPublic())&&(t==ZmShare.EDIT||t==ZmShare.RESEND)){
|
---|
15728 | continue
|
---|
15729 | }
|
---|
15730 | var h=document.createElement("A");
|
---|
15731 | h.href="#";
|
---|
15732 | h.innerHTML=ZmShare.ACTION_LABEL[t];
|
---|
15733 | Dwt.setHandler(h,DwtEvent.ONCLICK,e[o]);
|
---|
15734 | Dwt.associateElementWithObject(h,c);
|
---|
15735 | l.appendChild(h)
|
---|
15736 | }};
|
---|
15737 | ZmFolderPropsDialog.prototype._createView=function(){
|
---|
15738 | var t=new DwtComposite(this);
|
---|
15739 | this._nameOutputEl=document.createElement("SPAN");
|
---|
15740 | this._nameInputEl=document.createElement("INPUT");
|
---|
15741 | this._nameInputEl.style.width="20em";
|
---|
15742 | this._nameInputEl._dialog=this;
|
---|
15743 | var l=this._nameInputEl;
|
---|
15744 | this._ownerEl=document.createElement("DIV");
|
---|
15745 | this._typeEl=document.createElement("DIV");
|
---|
15746 | this._urlEl=document.createElement("DIV");
|
---|
15747 | this._permEl=document.createElement("DIV");
|
---|
15748 | var n=document.createElement("DIV");
|
---|
15749 | n.appendChild(this._nameOutputEl);
|
---|
15750 | n.appendChild(l);
|
---|
15751 | this._excludeFbCheckbox=document.createElement("INPUT");
|
---|
15752 | this._excludeFbCheckbox.type="checkbox";
|
---|
15753 | this._excludeFbCheckbox._dialog=this;
|
---|
15754 | this._excludeFbEl=document.createElement("DIV");
|
---|
15755 | this._excludeFbEl.style.display="none";
|
---|
15756 | this._excludeFbEl.appendChild(this._excludeFbCheckbox);
|
---|
15757 | this._excludeFbEl.appendChild(document.createTextNode(ZmMsg.excludeFromFreeBusy));
|
---|
15758 | var o=new DwtGrouper(t);
|
---|
15759 | o.setLabel(ZmMsg.properties);
|
---|
15760 | this._props=new DwtPropertySheet(o);
|
---|
15761 | this._color=new DwtSelect({
|
---|
15762 | parent:this._props}
|
---|
15763 | );
|
---|
15764 | for(var h=0;
|
---|
15765 | h<ZmOrganizer.COLOR_CHOICES.length;
|
---|
15766 | h++){
|
---|
15767 | var a=ZmOrganizer.COLOR_CHOICES[h];
|
---|
15768 | this._color.addOption(a.label,false,a.value)
|
---|
15769 | }
|
---|
15770 | this._props.addProperty(ZmMsg.nameLabel,n);
|
---|
15771 | this._props.addProperty(ZmMsg.typeLabel,this._typeEl);
|
---|
15772 | this._ownerId=this._props.addProperty(ZmMsg.ownerLabel,this._ownerEl);
|
---|
15773 | this._urlId=this._props.addProperty(ZmMsg.urlLabel,this._urlEl);
|
---|
15774 | this._permId=this._props.addProperty(ZmMsg.permissions,this._permEl);
|
---|
15775 | this._colorId=this._props.addProperty(ZmMsg.colorLabel,this._color);
|
---|
15776 | var e=document.createElement("DIV");
|
---|
15777 | e.appendChild(this._props.getHtmlElement());
|
---|
15778 | e.appendChild(this._excludeFbEl);
|
---|
15779 | o.setElement(e);
|
---|
15780 | if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
|
---|
15781 | this._sharesGroup=new DwtGrouper(t);
|
---|
15782 | this._sharesGroup.setLabel(ZmMsg.folderSharing);
|
---|
15783 | this._sharesGroup.setVisible(false);
|
---|
15784 | this._sharesGroup.setScrollStyle(Dwt.SCROLL)
|
---|
15785 | }
|
---|
15786 | var s=t.getHtmlElement();
|
---|
15787 | s.appendChild(o.getHtmlElement());
|
---|
15788 | if(appCtxt.get(ZmSetting.SHARING_ENABLED)){
|
---|
15789 | s.appendChild(this._sharesGroup.getHtmlElement())
|
---|
15790 | }
|
---|
15791 | return t
|
---|
15792 | }
|
---|
15793 | }
|
---|
15794 | if(AjxPackage.define("zimbraMail.share.view.dialog.ZmQuickAddDialog")){
|
---|
15795 | ZmQuickAddDialog=function(t,o,e,a,i){
|
---|
15796 | if(arguments.length==0){
|
---|
15797 | return
|
---|
15798 | }
|
---|
15799 | DwtDialog.call(this,{
|
---|
15800 | parent:t,title:o,standardButtons:e,extraButtons:a,loc:i}
|
---|
15801 | )
|
---|
15802 | };
|
---|
15803 | ZmQuickAddDialog.prototype=new DwtDialog;
|
---|
15804 | ZmQuickAddDialog.prototype.constructor=ZmQuickAddDialog;
|
---|
15805 | ZmQuickAddDialog.prototype.toString=function(){
|
---|
15806 | return"ZmQuickAddDialog"
|
---|
15807 | };
|
---|
15808 | ZmQuickAddDialog.prototype.TEMPLATE="dwt.Widgets#DwtSemiModalDialog";
|
---|
15809 | ZmQuickAddDialog.prototype.addSelectionListener=function(e,t){
|
---|
15810 | this._button[e].addSelectionListener(t)
|
---|
15811 | }
|
---|
15812 | }
|
---|
15813 | if(AjxPackage.define("zimbraMail.core.ZmNewWindow")){
|
---|
15814 | ZmNewWindow=function(){
|
---|
15815 | ZmController.call(this,null);
|
---|
15816 | appCtxt.setAppController(this);
|
---|
15817 | this._settings=appCtxt.getSettings();
|
---|
15818 | this._shell=appCtxt.getShell();
|
---|
15819 | this._kbMgr=appCtxt.getKeyboardMgr();
|
---|
15820 | if(appCtxt.get(ZmSetting.USE_KEYBOARD_SHORTCUTS)){
|
---|
15821 | this._kbMgr.enable(true);
|
---|
15822 | this._kbMgr.registerKeyMap(new ZmKeyMap());
|
---|
15823 | this._kbMgr.pushDefaultHandler(this)
|
---|
15824 | }
|
---|
15825 | this._apps={}
|
---|
15826 | };
|
---|
15827 | ZmNewWindow.prototype=new ZmController;
|
---|
15828 | ZmNewWindow.prototype.constructor=ZmNewWindow;
|
---|
15829 | ZmNewWindow.prototype.toString=function(){
|
---|
15830 | return"ZmNewWindow"
|
---|
15831 | };
|
---|
15832 | ZmNewWindow.run=function(){
|
---|
15833 | AjxDispatcher.setLoaded("MailCore",true);
|
---|
15834 | AjxDispatcher.setLoaded("Mail",true);
|
---|
15835 | var a=window.opener||window;
|
---|
15836 | if(!window.parentController){
|
---|
15837 | window.parentController=a._zimbraMail
|
---|
15838 | }
|
---|
15839 | window.appCtxt=new ZmAppCtxt();
|
---|
15840 | window.appCtxt.isChildWindow=true;
|
---|
15841 | window.parentAppCtxt=a.appCtxt;
|
---|
15842 | appCtxt.setSettings(parentAppCtxt.getSettings());
|
---|
15843 | appCtxt.isOffline=parentAppCtxt.isOffline;
|
---|
15844 | appCtxt.multiAccounts=parentAppCtxt.multiAccounts;
|
---|
15845 | window.ZmSetting=a.ZmSetting;
|
---|
15846 | ZmOperation.initialize();
|
---|
15847 | ZmApp.initialize();
|
---|
15848 | var e=new DwtShell({
|
---|
15849 | className:"MainShell"}
|
---|
15850 | );
|
---|
15851 | window.onbeforeunload=ZmNewWindow._confirmExitMethod;
|
---|
15852 | appCtxt.setShell(e);
|
---|
15853 | var t=new ZmNewWindow();
|
---|
15854 | t.startup()
|
---|
15855 | };
|
---|
15856 | ZmNewWindow.unload=function(e){
|
---|
15857 | if(!window.opener||!window.parentController){
|
---|
15858 | return
|
---|
15859 | }
|
---|
15860 | if(window.command=="compose"||window.command=="composeDetach"){
|
---|
15861 | var a=AjxDispatcher.run("GetComposeController",appCtxt.composeCtlrSessionId);
|
---|
15862 | if(a){
|
---|
15863 | a.dispose()
|
---|
15864 | }}else{
|
---|
15865 | if(window.command=="msgViewDetach"){
|
---|
15866 | var t=AjxDispatcher.run("GetMsgController",appCtxt.msgCtlrSessionId);
|
---|
15867 | if(t){
|
---|
15868 | t.dispose()
|
---|
15869 | }}}
|
---|
15870 | if(window.parentController){
|
---|
15871 | window.parentController.removeChildWindow(window)
|
---|
15872 | }};
|
---|
15873 | ZmNewWindow.prototype.startup=function(){
|
---|
15874 | if(window.parentController){
|
---|
15875 | var h=window.parentController.getChildWindow(window);
|
---|
15876 | if(h){
|
---|
15877 | window.newWindowCommand=h.command;
|
---|
15878 | window.newWindowParams=h.params
|
---|
15879 | }}
|
---|
15880 | var o=window.newWindowCommand;
|
---|
15881 | var s=window.newWindowParams;
|
---|
15882 | if(o=="shortcuts"){
|
---|
15883 | var e={};
|
---|
15884 | e[ZmApp.PREFERENCES]=true;
|
---|
15885 | this._createEnabledApps(e);
|
---|
15886 | this._createView();
|
---|
15887 | return
|
---|
15888 | }
|
---|
15889 | if(!this._appViewMgr){
|
---|
15890 | this._appViewMgr=new ZmAppViewMgr(this._shell,this,true,false);
|
---|
15891 | this._statusView=new ZmStatusView(this._shell,"ZmStatus",Dwt.ABSOLUTE_STYLE,ZmId.STATUS_VIEW)
|
---|
15892 | }
|
---|
15893 | var m=appCtxt.getRootTabGroup();
|
---|
15894 | var e={};
|
---|
15895 | e[ZmApp.MAIL]=true;
|
---|
15896 | e[ZmApp.CONTACTS]=true;
|
---|
15897 | var i=(o=="msgViewDetach")?s.msg:null;
|
---|
15898 | if(i&&i.isInvite()){
|
---|
15899 | e[ZmApp.CALENDAR]=true
|
---|
15900 | }
|
---|
15901 | e[ZmApp.PREFERENCES]=true;
|
---|
15902 | e[ZmApp.BRIEFCASE]=true;
|
---|
15903 | this._createEnabledApps(e);
|
---|
15904 | var c=parentAppCtxt.getApp(ZmApp.MAIL);
|
---|
15905 | appCtxt.getApp(ZmApp.MAIL)._identityCollection=c.getIdentityCollection();
|
---|
15906 | var d;
|
---|
15907 | if(o=="compose"||o=="composeDetach"){
|
---|
15908 | d="compose-window"
|
---|
15909 | }else{
|
---|
15910 | if(o=="msgViewDetach"){
|
---|
15911 | d="view-window"
|
---|
15912 | }}
|
---|
15913 | if(d){
|
---|
15914 | var l=parentAppCtxt.get(ZmSetting.ZIMLETS);
|
---|
15915 | l=l||[];
|
---|
15916 | var u=this._settings._getCheckedZimlets(l);
|
---|
15917 | if(this._hasZimletsForTarget(u,d)){
|
---|
15918 | var a=appCtxt.getZimletMgr();
|
---|
15919 | var n=this._getUserProps();
|
---|
15920 | var t=new AjxCallback(this,this._createView);
|
---|
15921 | appCtxt.setZimletsPresent(true);
|
---|
15922 | a.loadZimlets(u,n,d,t,true);
|
---|
15923 | return
|
---|
15924 | }}
|
---|
15925 | this._createView()
|
---|
15926 | };
|
---|
15927 | ZmNewWindow.prototype._createView=function(){
|
---|
15928 | var o=window.newWindowCommand;
|
---|
15929 | var n=window.newWindowParams;
|
---|
15930 | var l=appCtxt.getRootTabGroup();
|
---|
15931 | var a;
|
---|
15932 | if(o=="compose"||o=="composeDetach"){
|
---|
15933 | var i=AjxDispatcher.run("GetComposeController");
|
---|
15934 | appCtxt.composeCtlrSessionId=i.sessionId;
|
---|
15935 | if(n.action==ZmOperation.REPLY_ALL){
|
---|
15936 | n.msg=this._deepCopyMsg(n.msg)
|
---|
15937 | }
|
---|
15938 | if(o=="compose"){
|
---|
15939 | i._setView(n)
|
---|
15940 | }else{
|
---|
15941 | var h=n.action||ZmOperation.NEW_MESSAGE;
|
---|
15942 | if(n.msg&&n.msg._mode){
|
---|
15943 | switch(n.msg._mode){
|
---|
15944 | case ZmAppt.MODE_DELETE:case ZmAppt.MODE_DELETE_INSTANCE:case ZmAppt.MODE_DELETE_SERIES:h=ZmOperation.REPLY_CANCEL;
|
---|
15945 | break
|
---|
15946 | }}
|
---|
15947 | n.action=h;
|
---|
15948 | i._setView(n);
|
---|
15949 | i._composeView.setDetach(n);
|
---|
15950 | var c=window.parentController.getApp(ZmApp.MAIL).getComposeController(n.sessionId);
|
---|
15951 | if(c&&c._composeView){
|
---|
15952 | c._composeView.reset(true);
|
---|
15953 | c._app.popView(true)
|
---|
15954 | }}
|
---|
15955 | i._setComposeTabGroup();
|
---|
15956 | l.addMember(i.getTabGroup());
|
---|
15957 | a=i._getDefaultFocusItem();
|
---|
15958 | target="compose-window"
|
---|
15959 | }else{
|
---|
15960 | if(o=="msgViewDetach"){
|
---|
15961 | var s=AjxDispatcher.run("GetMsgController");
|
---|
15962 | appCtxt.msgCtlrSessionId=s.sessionId;
|
---|
15963 | s.show(n.msg,n.mode);
|
---|
15964 | l.addMember(s.getTabGroup());
|
---|
15965 | a=s.getCurrentView();
|
---|
15966 | target="view-window"
|
---|
15967 | }else{
|
---|
15968 | if(o=="shortcuts"){
|
---|
15969 | var e=appCtxt.getShortcutsPanel();
|
---|
15970 | e.popup(n.cols)
|
---|
15971 | }}}
|
---|
15972 | var t=appCtxt.getKeyboardMgr();
|
---|
15973 | t.setTabGroup(l);
|
---|
15974 | t.grabFocus(a)
|
---|
15975 | };
|
---|
15976 | ZmNewWindow.prototype._hasZimletsForTarget=function(t,o){
|
---|
15977 | var s=new RegExp("\\b"+o+"\\b");
|
---|
15978 | for(var a=0;
|
---|
15979 | a<t.length;
|
---|
15980 | a++){
|
---|
15981 | var e=t[a];
|
---|
15982 | var n=e.zimlet[0];
|
---|
15983 | if(s.test(n.target||"main")){
|
---|
15984 | return true
|
---|
15985 | }}
|
---|
15986 | return false
|
---|
15987 | };
|
---|
15988 | ZmNewWindow.prototype._getUserProps=function(){
|
---|
15989 | var s=parentAppCtxt.get(ZmSetting.USER_PROPS);
|
---|
15990 | s=s?[].concat(s):[];
|
---|
15991 | var e=parentAppCtxt.getZimletMgr().getZimletsHash();
|
---|
15992 | var h=parentAppCtxt.get(ZmSetting.ZIMLETS);
|
---|
15993 | for(var o=0;
|
---|
15994 | o<h.length;
|
---|
15995 | o++){
|
---|
15996 | var n=h[o].zimlet[0].name;
|
---|
15997 | var t=e[n];
|
---|
15998 | if(!t||!t.userProperties){
|
---|
15999 | continue
|
---|
16000 | }
|
---|
16001 | for(var a=0;
|
---|
16002 | a<t.userProperties.length;
|
---|
16003 | a++){
|
---|
16004 | var c=t.userProperties[a];
|
---|
16005 | var l={
|
---|
16006 | zimlet:n,name:c.name,_content:c.value};
|
---|
16007 | s.push(l)
|
---|
16008 | }}
|
---|
16009 | return s
|
---|
16010 | };
|
---|
16011 | ZmNewWindow.prototype.cancelRequest=function(a,e,t){
|
---|
16012 | return window.parentController?window.parentController.cancelRequest(a,e,t):null
|
---|
16013 | };
|
---|
16014 | ZmNewWindow.prototype.sendRequest=function(e){
|
---|
16015 | window.onbeforeunload=null;
|
---|
16016 | e.errorCallback=new AjxCallback(this,this._handleException,[(e.errorCallback||null)]);
|
---|
16017 | return window.parentController?window.parentController.sendRequest(e):null
|
---|
16018 | };
|
---|
16019 | ZmNewWindow.prototype._handleException=function(e,t){
|
---|
16020 | var a=false;
|
---|
16021 | if(e){
|
---|
16022 | a=e.run(t)
|
---|
16023 | }
|
---|
16024 | if(!a){
|
---|
16025 | ZmController.prototype._handleException.apply(this,[t])
|
---|
16026 | }
|
---|
16027 | return true
|
---|
16028 | };
|
---|
16029 | ZmNewWindow.prototype.popupErrorDialog=function(o,a,t,s){
|
---|
16030 | var i;
|
---|
16031 | if(a instanceof Object||typeof a=="object"){
|
---|
16032 | var e=[];
|
---|
16033 | a.msg=a.msg||o;
|
---|
16034 | for(var n in a){
|
---|
16035 | if(typeof a[n]=="function"||(typeof a[n]=="object"&&a[n].apply&&a[n].call)){
|
---|
16036 | continue
|
---|
16037 | }
|
---|
16038 | e.push([n,": ",a[n],"<br/>\n"].join(""))
|
---|
16039 | }
|
---|
16040 | i=e.join("")
|
---|
16041 | }
|
---|
16042 | ZmController.prototype.popupErrorDialog.call(this,o,(i||a),t,s)
|
---|
16043 | };
|
---|
16044 | ZmNewWindow.prototype.setStatusMsg=function(e){
|
---|
16045 | e=Dwt.getParams(arguments,ZmStatusView.MSG_PARAMS);
|
---|
16046 | this._statusView.setStatusMsg(e)
|
---|
16047 | };
|
---|
16048 | ZmNewWindow.prototype.getApp=function(e){
|
---|
16049 | if(!this._apps[e]){
|
---|
16050 | this._createApp(e)
|
---|
16051 | }
|
---|
16052 | return this._apps[e]
|
---|
16053 | };
|
---|
16054 | ZmNewWindow.prototype.getAppViewMgr=function(){
|
---|
16055 | return this._appViewMgr
|
---|
16056 | };
|
---|
16057 | ZmNewWindow.prototype.setActiveApp=function(){};
|
---|
16058 | ZmNewWindow.prototype.getKeyMapMgr=function(){
|
---|
16059 | return this._kbMgr
|
---|
16060 | };
|
---|
16061 | ZmNewWindow.prototype.getKeyMapName=function(){
|
---|
16062 | var e=appCtxt.getCurrentController();
|
---|
16063 | if(e&&e.getKeyMapName){
|
---|
16064 | return e.getKeyMapName()
|
---|
16065 | }
|
---|
16066 | return"Global"
|
---|
16067 | };
|
---|
16068 | ZmNewWindow.prototype.handleKeyAction=function(t,a){
|
---|
16069 | var e=appCtxt.getCurrentController();
|
---|
16070 | if(e&&e.handleKeyAction){
|
---|
16071 | return e.handleKeyAction(t,a)
|
---|
16072 | }
|
---|
16073 | return false
|
---|
16074 | };
|
---|
16075 | ZmNewWindow.prototype._createEnabledApps=function(a){
|
---|
16076 | for(var o in ZmApp.CLASS){
|
---|
16077 | if(!a||a[o]){
|
---|
16078 | ZmApp.APPS.push(o)
|
---|
16079 | }}
|
---|
16080 | ZmApp.APPS.sort(function(n,i){
|
---|
16081 | return ZmZimbraMail.hashSortCompare(ZmApp.LOAD_SORT,n,i)
|
---|
16082 | }
|
---|
16083 | );
|
---|
16084 | for(var e=0;
|
---|
16085 | e<ZmApp.APPS.length;
|
---|
16086 | e++){
|
---|
16087 | var o=ZmApp.APPS[e];
|
---|
16088 | if(o!=ZmApp.IM){
|
---|
16089 | var t=ZmApp.SETTING[o];
|
---|
16090 | if(!t||appCtxt.get(t)){
|
---|
16091 | this._createApp(o)
|
---|
16092 | }}}};
|
---|
16093 | ZmNewWindow.prototype._createApp=function(appName){
|
---|
16094 | if(this._apps[appName]){
|
---|
16095 | return
|
---|
16096 | }
|
---|
16097 | var appClass=eval(ZmApp.CLASS[appName]);
|
---|
16098 | this._apps[appName]=new appClass(this._shell,window.parentController)
|
---|
16099 | };
|
---|
16100 | ZmNewWindow.prototype._deepCopyMsg=function(o){
|
---|
16101 | var e=null;
|
---|
16102 | var d=o.list.search;
|
---|
16103 | if(d){
|
---|
16104 | e=new ZmSearch();
|
---|
16105 | for(var s in d){
|
---|
16106 | if((typeof d[s]=="object")||(typeof d[s]=="function")){
|
---|
16107 | continue
|
---|
16108 | }
|
---|
16109 | e[s]=d[s]
|
---|
16110 | }
|
---|
16111 | e.types=new AjxVector();
|
---|
16112 | var l=d.types.getArray();
|
---|
16113 | for(var s in l){
|
---|
16114 | e.types.add(l[s])
|
---|
16115 | }}
|
---|
16116 | var c=new ZmMailList(o.list.type,e);
|
---|
16117 | for(var s in o.list){
|
---|
16118 | if((typeof o.list[s]=="object")||(typeof o.list[s]=="function")){
|
---|
16119 | continue
|
---|
16120 | }
|
---|
16121 | c[s]=o.list[s]
|
---|
16122 | }
|
---|
16123 | var a=new ZmMailMsg(o.id,c);
|
---|
16124 | for(var s in o){
|
---|
16125 | if((typeof o[s]=="object")||(typeof o[s]=="function")){
|
---|
16126 | continue
|
---|
16127 | }
|
---|
16128 | a[s]=o[s]
|
---|
16129 | }
|
---|
16130 | for(var s in o._addrs){
|
---|
16131 | var h=o._addrs[s].getArray();
|
---|
16132 | for(var n in h){
|
---|
16133 | a._addrs[s].add(h[n])
|
---|
16134 | }}
|
---|
16135 | if(o.attachments&&o.attachments.length>0){
|
---|
16136 | for(var s in o.attachments){
|
---|
16137 | a.attachments.push(o.attachments[s])
|
---|
16138 | }}
|
---|
16139 | for(var s in o._bodyParts){
|
---|
16140 | a._bodyParts.push(o._bodyParts[s])
|
---|
16141 | }
|
---|
16142 | if(o._topPart){
|
---|
16143 | a._topPart=new ZmMimePart();
|
---|
16144 | for(var s in o._topPart){
|
---|
16145 | if((typeof o._topPart[s]=="object")||(typeof o._topPart[s]=="function")){
|
---|
16146 | continue
|
---|
16147 | }
|
---|
16148 | a._topPart[s]=o._topPart[s]
|
---|
16149 | }
|
---|
16150 | var t=o._topPart.children.getArray();
|
---|
16151 | for(var s in t){
|
---|
16152 | a._topPart.children.add(t[s])
|
---|
16153 | }}
|
---|
16154 | return a
|
---|
16155 | };
|
---|
16156 | ZmNewWindow._confirmExitMethod=function(e){
|
---|
16157 | if(window.parentController&&(window.newWindowCommand=="compose"||window.newWindowCommand=="composeDetach")){
|
---|
16158 | var t=AjxDispatcher.run("GetComposeController",appCtxt.composeCtlrSessionId);
|
---|
16159 | if(t&&t._composeView&&t._composeView.isDirty()){
|
---|
16160 | return ZmMsg.newWinComposeExit
|
---|
16161 | }}}
|
---|
16162 | }
|
---|
16163 | if(AjxPackage.define("zimbraMail.calendar.model.ZmCalMgr")){
|
---|
16164 | ZmCalMgr=function(e){
|
---|
16165 | this._container=e;
|
---|
16166 | this.clearCache();
|
---|
16167 | this._listeners={};
|
---|
16168 | this._folderNames={};
|
---|
16169 | this._listeners[ZmOperation.NEW_APPT]=new AjxListener(this,this._newApptAction);
|
---|
16170 | this._listeners[ZmOperation.NEW_ALLDAY_APPT]=new AjxListener(this,this._newAllDayApptAction);
|
---|
16171 | this._listeners[ZmOperation.SEARCH_MAIL]=new AjxListener(this,this._searchMailAction)
|
---|
16172 | };
|
---|
16173 | ZmCalMgr.prototype.toString=function(){
|
---|
16174 | return"ZmCalMgr"
|
---|
16175 | };
|
---|
16176 | ZmCalMgr.prototype.clearCache=function(){
|
---|
16177 | this._miniCalData={}
|
---|
16178 | };
|
---|
16179 | ZmCalMgr.prototype._createMiniCalendar=function(o){
|
---|
16180 | o=o?o:new Date();
|
---|
16181 | var e=appCtxt.get(ZmSetting.CAL_FIRST_DAY_OF_WEEK)||0;
|
---|
16182 | var h=AjxTimezone.getServerId(AjxTimezone.DEFAULT);
|
---|
16183 | var t=(h&&h.indexOf("Europe")==0&&h!="Europe/London");
|
---|
16184 | this._miniCalendar=new DwtCalendar({
|
---|
16185 | parent:this._container,posStyle:DwtControl.ABSOLUTE_STYLE,firstDayOfWeek:e,showWeekNumber:appCtxt.get(ZmSetting.CAL_SHOW_CALENDAR_WEEK),useISO8601WeekNo:t}
|
---|
16186 | );
|
---|
16187 | this._miniCalendar.setDate(o);
|
---|
16188 | this._miniCalendar.setScrollStyle(Dwt.CLIP);
|
---|
16189 | this._miniCalendar.addSelectionListener(new AjxListener(this,this._miniCalSelectionListener));
|
---|
16190 | this._miniCalendar.addActionListener(new AjxListener(this,this._miniCalActionListener));
|
---|
16191 | this._miniCalendar.addDateRangeListener(new AjxListener(this,this._miniCalDateRangeListener));
|
---|
16192 | this._miniCalendar.setMouseOverDayCallback(new AjxCallback(this,this._miniCalMouseOverDayCallback));
|
---|
16193 | this._miniCalendar.setMouseOutDayCallback(new AjxCallback(this,this._miniCalMouseOutDayCallback));
|
---|
16194 | var l=[];
|
---|
16195 | if(appCtxt.get(ZmSetting.MAIL_ENABLED)){
|
---|
16196 | l.push("ZmMailMsg");
|
---|
16197 | l.push("ZmConv")
|
---|
16198 | }
|
---|
16199 | if(appCtxt.get(ZmSetting.CONTACTS_ENABLED)){
|
---|
16200 | l.push("ZmContact")
|
---|
16201 | }
|
---|
16202 | this._miniCalDropTarget=new DwtDropTarget(l);
|
---|
16203 | this._miniCalDropTarget.addDropListener(new AjxListener(this,this._miniCalDropTargetListener));
|
---|
16204 | this._miniCalendar.setDropTarget(this._miniCalDropTarget);
|
---|
16205 | var m=[];
|
---|
16206 | for(var n=0;
|
---|
16207 | n<7;
|
---|
16208 | n++){
|
---|
16209 | var c=(n+e)%7;
|
---|
16210 | m[n]=(c>0&&c<6)
|
---|
16211 | }
|
---|
16212 | this._miniCalendar.setWorkingWeek(m);
|
---|
16213 | var s={};
|
---|
16214 | s[ZmAppViewMgr.C_TREE_FOOTER]=this._miniCalendar;
|
---|
16215 | appCtxt.getAppViewMgr().addComponents(s,true);
|
---|
16216 | var a=appCtxt.getApp(ZmApp.CALENDAR);
|
---|
16217 | var u=a._active||appCtxt.get(ZmSetting.CAL_ALWAYS_SHOW_MINI_CAL);
|
---|
16218 | this._miniCalendar.setSkipNotifyOnPage(u&&!a._active);
|
---|
16219 | if(!a._active){
|
---|
16220 | this._miniCalendar.setSelectionMode(DwtCalendar.DAY)
|
---|
16221 | }};
|
---|
16222 | ZmCalMgr.prototype._miniCalDropTargetListener=function(t){
|
---|
16223 | var e=this.getCalViewController();
|
---|
16224 | e._miniCalDropTargetListener(t)
|
---|
16225 | };
|
---|
16226 | ZmCalMgr.prototype.getMiniCalendar=function(){
|
---|
16227 | if(!this._miniCalendar){
|
---|
16228 | this._createMiniCalendar()
|
---|
16229 | }
|
---|
16230 | return this._miniCalendar
|
---|
16231 | };
|
---|
16232 | ZmCalMgr.prototype._refreshCallback=function(e){
|
---|
16233 | this.getReminderController()._refreshCallback(e)
|
---|
16234 | };
|
---|
16235 | ZmCalMgr.prototype.getReminderController=function(){
|
---|
16236 | if(!this._reminderController){
|
---|
16237 | this._reminderController=new ZmReminderController(this)
|
---|
16238 | }
|
---|
16239 | return this._reminderController
|
---|
16240 | };
|
---|
16241 | ZmCalMgr.prototype._miniCalSelectionListener=function(t){
|
---|
16242 | if(t.item instanceof DwtCalendar){
|
---|
16243 | var e=this.getCalViewController();
|
---|
16244 | e._handleLoadMiniCalSelection(t)
|
---|
16245 | }};
|
---|
16246 | ZmCalMgr.prototype._miniCalActionListener=function(e){
|
---|
16247 | var t=this._getMiniCalActionMenu();
|
---|
16248 | t.__detail=e.detail;
|
---|
16249 | t.popup(0,e.docX,e.docY)
|
---|
16250 | };
|
---|
16251 | ZmCalMgr.prototype._getMiniCalActionMenu=function(){
|
---|
16252 | if(this._minicalMenu==null){
|
---|
16253 | this.postInitListeners();
|
---|
16254 | var o=[ZmOperation.NEW_APPT,ZmOperation.NEW_ALLDAY_APPT,ZmOperation.SEP,ZmOperation.SEARCH_MAIL];
|
---|
16255 | var s=ZmZimlet.actionMenus?ZmZimlet.actionMenus.ZmCalViewController:null;
|
---|
16256 | if(s&&s.length){
|
---|
16257 | for(var a=0;
|
---|
16258 | a<s.length;
|
---|
16259 | a++){
|
---|
16260 | var h=s[a];
|
---|
16261 | ZmOperation.defineOperation(null,h);
|
---|
16262 | o.push(h.id)
|
---|
16263 | }}
|
---|
16264 | var n={
|
---|
16265 | parent:appCtxt.getShell(),menuItems:o};
|
---|
16266 | this._minicalMenu=new ZmActionMenu(n);
|
---|
16267 | o=this._minicalMenu.opList;
|
---|
16268 | var t=o.length;
|
---|
16269 | for(var e=0;
|
---|
16270 | e<t;
|
---|
16271 | e++){
|
---|
16272 | if(this._listeners[o[e]]){
|
---|
16273 | this._minicalMenu.addSelectionListener(o[e],this._listeners[o[e]])
|
---|
16274 | }}}
|
---|
16275 | return this._minicalMenu
|
---|
16276 | };
|
---|
16277 | ZmCalMgr.prototype.postInitListeners=function(){
|
---|
16278 | if(ZmZimlet.listeners&&ZmZimlet.listeners.ZmCalViewController){
|
---|
16279 | for(var e in ZmZimlet.listeners.ZmCalViewController){
|
---|
16280 | if(ZmZimlet.listeners.ZmCalViewController[e] instanceof AjxListener){
|
---|
16281 | this._listeners[e]=ZmZimlet.listeners.ZmCalViewController[e]
|
---|
16282 | }else{
|
---|
16283 | this._listeners[e]=new AjxListener(this,this._proxyListeners,[ZmZimlet.listeners.ZmCalViewController[e]])
|
---|
16284 | }}}};
|
---|
16285 | ZmCalMgr.prototype._proxyListeners=function(t,a){
|
---|
16286 | var e=this.getCalViewController();
|
---|
16287 | return(new AjxListener(e,t)).handleEvent(a)
|
---|
16288 | };
|
---|
16289 | ZmCalMgr.prototype.isMiniCalCreated=function(){
|
---|
16290 | return(this._miniCalendar!=null)
|
---|
16291 | };
|
---|
16292 | ZmCalMgr.prototype._miniCalDateRangeListener=function(a){
|
---|
16293 | var e=appCtxt.getCurrentViewId();
|
---|
16294 | if(e==ZmId.VIEW_CAL_APPT||e==ZmId.VIEW_CAL){
|
---|
16295 | var t=this.getCalViewController();
|
---|
16296 | t._scheduleMaintenance(ZmCalViewController.MAINT_MINICAL)
|
---|
16297 | }else{
|
---|
16298 | this.highlightMiniCal()
|
---|
16299 | }};
|
---|
16300 | ZmCalMgr.prototype._miniCalMouseOverDayCallback=function(a,e){
|
---|
16301 | this._currentMouseOverDay=e;
|
---|
16302 | var t=new AjxTimedAction(this,this._getDayToolTipOnDelay,[a,e]);
|
---|
16303 | AjxTimedAction.scheduleAction(t,1000)
|
---|
16304 | };
|
---|
16305 | ZmCalMgr.prototype.getCalViewController=function(){
|
---|
16306 | var e=AjxDispatcher.run("GetCalController");
|
---|
16307 | e._miniCalendar=this._miniCalendar;
|
---|
16308 | e._minicalMenu=this._minicalMenu;
|
---|
16309 | e._miniCalDropTarget=this._miniCalDropTarget;
|
---|
16310 | return e
|
---|
16311 | };
|
---|
16312 | ZmCalMgr.prototype._miniCalMouseOutDayCallback=function(e){
|
---|
16313 | this._currentMouseOverDay=null
|
---|
16314 | };
|
---|
16315 | ZmCalMgr.prototype._getDayToolTipOnDelay=function(a,e){
|
---|
16316 | if(!this._currentMouseOverDay){
|
---|
16317 | return
|
---|
16318 | }
|
---|
16319 | if((this._currentMouseOverDay.getDate()==e.getDate())&&(this._currentMouseOverDay.getMonth()==e.getMonth())){
|
---|
16320 | this._currentMouseOverDay=null;
|
---|
16321 | var t=DwtShell.mouseEvent;
|
---|
16322 | if(t&&t.docX>0&&t.docY>0){
|
---|
16323 | var i=new AjxCallback(this,this.showTooltip,[a,t.docX,t.docY]);
|
---|
16324 | this.getCalViewController().getDayToolTipText(e,false,i)
|
---|
16325 | }}};
|
---|
16326 | ZmCalMgr.prototype.showTooltip=function(o,e,n,i){
|
---|
16327 | o.setToolTipContent(i);
|
---|
16328 | if(e>0&&n>0){
|
---|
16329 | var t=DwtShell.getShell(window);
|
---|
16330 | var a=t.getToolTip();
|
---|
16331 | a.setContent(i);
|
---|
16332 | a.popup(e,n);
|
---|
16333 | o.__tooltipClosed=false
|
---|
16334 | }};
|
---|
16335 | ZmCalMgr.prototype.getApptSummaries=function(t){
|
---|
16336 | var e=this.setSearchParams(t);
|
---|
16337 | if(e!=null&&(e instanceof AjxVector)){
|
---|
16338 | return e
|
---|
16339 | }
|
---|
16340 | this._rawAppts=[];
|
---|
16341 | if(t.callback){
|
---|
16342 | this._search(t)
|
---|
16343 | }else{
|
---|
16344 | return this._search(t)
|
---|
16345 | }};
|
---|
16346 | ZmCalMgr.prototype.setSearchParams=function(o){
|
---|
16347 | if(!(o.folderIds instanceof Array)){
|
---|
16348 | o.folderIds=[o.folderIds]
|
---|
16349 | }else{
|
---|
16350 | if(o.folderIds.length==0){
|
---|
16351 | var t=new AjxVector();
|
---|
16352 | if(o.callback){
|
---|
16353 | o.callback.run(t)
|
---|
16354 | }
|
---|
16355 | return t
|
---|
16356 | }}
|
---|
16357 | var n={};
|
---|
16358 | var l="";
|
---|
16359 | for(var h=0;
|
---|
16360 | h<o.folderIds.length;
|
---|
16361 | h++){
|
---|
16362 | var a=o.folderIds[h];
|
---|
16363 | var s=appCtxt.getActiveAccount().isMain?a:ZmOrganizer.getSystemId(a);
|
---|
16364 | var e=appCtxt.getById(s);
|
---|
16365 | var d=e?e.getRemoteId():s;
|
---|
16366 | n[d]=s;
|
---|
16367 | if(l.length){
|
---|
16368 | l+=" OR "
|
---|
16369 | }
|
---|
16370 | var c=AjxUtil.isNumeric(a)?a:['"',a,'"'].join("");
|
---|
16371 | l+="inid:"+c
|
---|
16372 | }
|
---|
16373 | o.queryHint=l;
|
---|
16374 | o.folderIdMapper=n;
|
---|
16375 | o.offset=0
|
---|
16376 | };
|
---|
16377 | ZmCalMgr.prototype._search=function(o){
|
---|
16378 | var n={
|
---|
16379 | SearchRequest:{
|
---|
16380 | _jsns:"urn:zimbraMail"}};
|
---|
16381 | var i=n.SearchRequest;
|
---|
16382 | this._setSoapParams(i,o);
|
---|
16383 | var a=appCtxt.multiAccounts?appCtxt.accountList.mainAccount.name:null;
|
---|
16384 | if(o.callback){
|
---|
16385 | appCtxt.getAppController().sendRequest({
|
---|
16386 | jsonObj:n,asyncMode:true,callback:(new AjxCallback(this,this._getApptSummariesResponse,[o])),noBusyOverlay:o.noBusyOverlay,accountName:a}
|
---|
16387 | )
|
---|
16388 | }else{
|
---|
16389 | var t=appCtxt.getAppController().sendRequest({
|
---|
16390 | jsonObj:n,accountName:a}
|
---|
16391 | );
|
---|
16392 | var e=new ZmCsfeResult(t,false);
|
---|
16393 | return this._getApptSummariesResponse(o,e)
|
---|
16394 | }};
|
---|
16395 | ZmCalMgr.prototype._setSoapParams=function(e,a){
|
---|
16396 | e.sortBy="none";
|
---|
16397 | e.limit="500";
|
---|
16398 | e.calExpandInstStart=a.start;
|
---|
16399 | e.calExpandInstEnd=a.end;
|
---|
16400 | e.types=ZmSearch.TYPE[ZmItem.APPT];
|
---|
16401 | e.offset=a.offset;
|
---|
16402 | var t=a.query;
|
---|
16403 | if(a.queryHint){
|
---|
16404 | t=(t!=null)?(t+" ("+a.queryHint+")"):a.queryHint
|
---|
16405 | }
|
---|
16406 | e.query={
|
---|
16407 | _content:t}
|
---|
16408 | };
|
---|
16409 | ZmCalMgr.prototype._getApptSummariesResponse=function(n,e){
|
---|
16410 | if(!e){
|
---|
16411 | return
|
---|
16412 | }
|
---|
16413 | var s=n.callback;
|
---|
16414 | var o;
|
---|
16415 | try{
|
---|
16416 | o=e.getResponse()
|
---|
16417 | }
|
---|
16418 | catch(t){
|
---|
16419 | if(s){
|
---|
16420 | s.run(new AjxVector())
|
---|
16421 | }
|
---|
16422 | return
|
---|
16423 | }
|
---|
16424 | var i=o.SearchResponse;
|
---|
16425 | var a=this.processSearchResponse(i,n);
|
---|
16426 | if(a==null){
|
---|
16427 | return
|
---|
16428 | }
|
---|
16429 | if(s){
|
---|
16430 | s.run(a,n.query)
|
---|
16431 | }else{
|
---|
16432 | return a
|
---|
16433 | }};
|
---|
16434 | ZmCalMgr.prototype.processSearchResponse=function(s,n){
|
---|
16435 | if(!s){
|
---|
16436 | return
|
---|
16437 | }
|
---|
16438 | if(s&&s.appt&&s.appt.length){
|
---|
16439 | this._rawAppts=this._rawAppts!=null?this._rawAppts.concat(s.appt):s.appt;
|
---|
16440 | if(s.more){
|
---|
16441 | var d=s.appt[s.appt.length-1];
|
---|
16442 | if(d){
|
---|
16443 | n.offset+=500;
|
---|
16444 | this._search(n);
|
---|
16445 | return
|
---|
16446 | }}}
|
---|
16447 | var a=new AjxVector();
|
---|
16448 | if(this._rawAppts&&this._rawAppts.length){
|
---|
16449 | this._list=new ZmList(ZmItem.APPT);
|
---|
16450 | for(var l=0;
|
---|
16451 | l<this._rawAppts.length;
|
---|
16452 | l++){
|
---|
16453 | var o=this._rawAppts[l];
|
---|
16454 | var t=o?o.inst:null;
|
---|
16455 | if(t){
|
---|
16456 | var c={
|
---|
16457 | list:this._list};
|
---|
16458 | for(var h=0;
|
---|
16459 | h<t.length;
|
---|
16460 | h++){
|
---|
16461 | var e=ZmCalBaseItem.createFromDom(o,c,t[h]);
|
---|
16462 | if(e){
|
---|
16463 | a.add(e)
|
---|
16464 | }}}}}
|
---|
16465 | return a
|
---|
16466 | };
|
---|
16467 | ZmCalMgr.prototype.getCalendarName=function(e){
|
---|
16468 | var t=appCtxt.getApp(ZmApp.CALENDAR);
|
---|
16469 | return t.getCalendarName(e)
|
---|
16470 | };
|
---|
16471 | ZmCalMgr.prototype._newApptAction=function(t){
|
---|
16472 | var e=this.getCalViewController();
|
---|
16473 | e._newApptAction(t)
|
---|
16474 | };
|
---|
16475 | ZmCalMgr.prototype._newAllDayApptAction=function(t){
|
---|
16476 | var e=this.getCalViewController();
|
---|
16477 | e._newAllDayApptAction(t)
|
---|
16478 | };
|
---|
16479 | ZmCalMgr.prototype._searchMailAction=function(t){
|
---|
16480 | var e=this.getCalViewController();
|
---|
16481 | e._searchMailAction(t)
|
---|
16482 | };
|
---|
16483 | ZmCalMgr.prototype.getCheckedCalendarFolderIds=function(e){
|
---|
16484 | var t=appCtxt.getApp(ZmApp.CALENDAR);
|
---|
16485 | return t.getCheckedCalendarFolderIds(e)
|
---|
16486 | };
|
---|
16487 | ZmCalMgr.prototype._handleError=function(t){
|
---|
16488 | if(t.code=="mail.INVITE_OUT_OF_DATE"||t.code=="mail.NO_SUCH_APPT"){
|
---|
16489 | var e=appCtxt.getMsgDialog();
|
---|
16490 | e.setMessage(ZmMsg.apptOutOfDate,DwtMessageDialog.INFO_STYLE);
|
---|
16491 | e.popup();
|
---|
16492 | return true
|
---|
16493 | }
|
---|
16494 | return false
|
---|
16495 | };
|
---|
16496 | ZmCalMgr.prototype.highlightMiniCal=function(){
|
---|
16497 | this.getMiniCalCache()._getMiniCalData(this.getMiniCalendarParams())
|
---|
16498 | };
|
---|
16499 | ZmCalMgr.prototype.getMiniCalendarParams=function(){
|
---|
16500 | var e=this.getMiniCalendar().getDateRange();
|
---|
16501 | return{
|
---|
16502 | start:e.start.getTime(),end:e.end.getTime(),fanoutAllDay:true,noBusyOverlay:true,folderIds:this.getCheckedCalendarFolderIds(),tz:AjxTimezone.DEFAULT}
|
---|
16503 | };
|
---|
16504 | ZmCalMgr.prototype.getMiniCalCache=function(){
|
---|
16505 | if(!this._miniCalCache){
|
---|
16506 | this._miniCalCache=new ZmMiniCalCache(this)
|
---|
16507 | }
|
---|
16508 | return this._miniCalCache
|
---|
16509 | };
|
---|
16510 | ZmCalMgr.prototype.getQuickReminderSearchTimeRange=function(){
|
---|
16511 | var a=new Date();
|
---|
16512 | a.setHours(23,59,59,999);
|
---|
16513 | var e=new Date(a.getTime());
|
---|
16514 | var t=a;
|
---|
16515 | t.setHours(0,0,0,0);
|
---|
16516 | return{
|
---|
16517 | start:t.getTime(),end:e.getTime()}
|
---|
16518 | };
|
---|
16519 | ZmCalMgr.prototype.showQuickReminder=function(){
|
---|
16520 | var e=this.getQuickReminderParams();
|
---|
16521 | this.getApptSummaries(e)
|
---|
16522 | };
|
---|
16523 | ZmCalMgr.prototype.getQuickReminderParams=function(){
|
---|
16524 | var e=this.getQuickReminderSearchTimeRange();
|
---|
16525 | return{
|
---|
16526 | start:e.start,end:e.end,fanoutAllDay:false,folderIds:this.getCheckedCalendarFolderIds(true),callback:(new AjxCallback(this,this._quickReminderCallback)),includeReminders:true}
|
---|
16527 | };
|
---|
16528 | ZmCalMgr.prototype._quickReminderCallback=function(l){
|
---|
16529 | var o=new AjxVector();
|
---|
16530 | this._cacheMap={};
|
---|
16531 | var d=l.size();
|
---|
16532 | var a=(new Date()).getTime();
|
---|
16533 | for(var h=0;
|
---|
16534 | h<d;
|
---|
16535 | h++){
|
---|
16536 | var e=l.get(h);
|
---|
16537 | var t=e.id;
|
---|
16538 | if(!this._cacheMap[t]){
|
---|
16539 | this._cacheMap[t]=e;
|
---|
16540 | if(e.isAllDayEvent()){
|
---|
16541 | continue
|
---|
16542 | }
|
---|
16543 | var c=e.getStartTime()-a;
|
---|
16544 | var s=(c>=0&&c<=AjxDateUtil.MSEC_PER_HOUR);
|
---|
16545 | if((a>=e.getStartTime()&&a<=e.getEndTime())||s){
|
---|
16546 | e.isUpcomingEvent=s;
|
---|
16547 | o.add(e)
|
---|
16548 | }}}
|
---|
16549 | var n=this.getQuickReminderDialog();
|
---|
16550 | n.initialize(o);
|
---|
16551 | n.popup()
|
---|
16552 | };
|
---|
16553 | ZmCalMgr.prototype.getQuickReminderDialog=function(){
|
---|
16554 | if(this._reminderDialog==null){
|
---|
16555 | this._reminderDialog=new ZmQuickReminderDialog(appCtxt.getShell(),this,this._calController)
|
---|
16556 | }
|
---|
16557 | return this._reminderDialog
|
---|
16558 | }
|
---|
16559 | }
|
---|
16560 | if(AjxPackage.define("zimbraMail.calendar.model.ZmMiniCalCache")){
|
---|
16561 | ZmMiniCalCache=function(e){
|
---|
16562 | this._calViewController=e;
|
---|
16563 | this.clearCache()
|
---|
16564 | };
|
---|
16565 | ZmMiniCalCache.prototype.toString=function(){
|
---|
16566 | return"ZmMiniCalCache"
|
---|
16567 | };
|
---|
16568 | ZmMiniCalCache.prototype.clearCache=function(){
|
---|
16569 | this._miniCalData={}
|
---|
16570 | };
|
---|
16571 | ZmMiniCalCache.prototype.updateCache=function(a,t){
|
---|
16572 | var e=this._getCacheKey(a);
|
---|
16573 | this._miniCalData[e]=t
|
---|
16574 | };
|
---|
16575 | ZmMiniCalCache.prototype._getCacheKey=function(t){
|
---|
16576 | var e=[];
|
---|
16577 | e=e.concat(t.folderIds);
|
---|
16578 | e.sort();
|
---|
16579 | return(t.start+":"+t.end+":"+e.join(":"))
|
---|
16580 | };
|
---|
16581 | ZmMiniCalCache.prototype._getMiniCalData=function(i){
|
---|
16582 | var a=this._getCacheKey(i);
|
---|
16583 | var t=this._miniCalData[a];
|
---|
16584 | if(t){
|
---|
16585 | this.highlightMiniCal(t);
|
---|
16586 | if(i.callback){
|
---|
16587 | i.callback.run(t);
|
---|
16588 | return
|
---|
16589 | }
|
---|
16590 | return t
|
---|
16591 | }
|
---|
16592 | var o={
|
---|
16593 | GetMiniCalRequest:{
|
---|
16594 | _jsns:"urn:zimbraMail"}};
|
---|
16595 | var e=o.GetMiniCalRequest;
|
---|
16596 | this._setSoapParams(e,i);
|
---|
16597 | appCtxt.getAppController().sendRequest({
|
---|
16598 | jsonObj:o,asyncMode:true,callback:(new AjxCallback(this,this._getMiniCalResponse,[i])),errorCallback:(new AjxCallback(this,this._handleMiniCalResponseError,[i])),noBusyOverlay:i.noBusyOverlay,accountName:(appCtxt.multiAccounts?appCtxt.accountList.mainAccount.name:null)}
|
---|
16599 | )
|
---|
16600 | };
|
---|
16601 | ZmMiniCalCache.prototype.getCacheData=function(a){
|
---|
16602 | var t=this._getCacheKey(a);
|
---|
16603 | var e=this._miniCalData[t];
|
---|
16604 | if(e){
|
---|
16605 | return e
|
---|
16606 | }};
|
---|
16607 | ZmMiniCalCache.prototype._handleMiniCalResponseError=function(o,e){
|
---|
16608 | var a=e?e.code:null;
|
---|
16609 | if(a==ZmCsfeException.ACCT_NO_SUCH_ACCOUNT||a==ZmCsfeException.MAIL_NO_SUCH_MOUNTPOINT){
|
---|
16610 | var i=(e&&e.data)?e.data:null;
|
---|
16611 | var n=(i&&i.itemId&&(i.itemId.length>0))?i.itemId[0]:null;
|
---|
16612 | if(n&&appCtxt.getById(n)&&this._faultHandler){
|
---|
16613 | var t=appCtxt.getById(n);
|
---|
16614 | t.noSuchFolder=true;
|
---|
16615 | this._faultHandler.run(t);
|
---|
16616 | return true
|
---|
16617 | }}
|
---|
16618 | if(o.callback){
|
---|
16619 | o.callback.run([])
|
---|
16620 | }
|
---|
16621 | return true
|
---|
16622 | };
|
---|
16623 | ZmMiniCalCache.prototype._setSoapParams=function(a,o){
|
---|
16624 | a.s=o.start;
|
---|
16625 | a.e=o.end;
|
---|
16626 | a.tz=o.tz;
|
---|
16627 | var e=null;
|
---|
16628 | if(o.folderIds&&o.folderIds.length){
|
---|
16629 | a.folder=[];
|
---|
16630 | for(var t=0;
|
---|
16631 | t<o.folderIds.length;
|
---|
16632 | t++){
|
---|
16633 | a.folder.push({
|
---|
16634 | id:o.folderIds[t]}
|
---|
16635 | )
|
---|
16636 | }}
|
---|
16637 | if(o.tz){
|
---|
16638 | a.tz=[];
|
---|
16639 | a.tz.push({
|
---|
16640 | id:o.tz}
|
---|
16641 | )
|
---|
16642 | }};
|
---|
16643 | ZmMiniCalCache.prototype.setFaultHandler=function(e){
|
---|
16644 | this._faultHandler=e
|
---|
16645 | };
|
---|
16646 | ZmMiniCalCache.prototype._getMiniCalResponse=function(h,e){
|
---|
16647 | var o=[];
|
---|
16648 | if(!e){
|
---|
16649 | return o
|
---|
16650 | }
|
---|
16651 | var l=h.callback;
|
---|
16652 | var s=e&&e._data&&e._data;
|
---|
16653 | var a=s.GetMiniCalResponse;
|
---|
16654 | if(a&&a.date){
|
---|
16655 | var n=a.date;
|
---|
16656 | if(n){
|
---|
16657 | for(var t=0;
|
---|
16658 | t<n.length;
|
---|
16659 | t++){
|
---|
16660 | if(n[t]._content){
|
---|
16661 | o.push(n[t]._content)
|
---|
16662 | }}}
|
---|
16663 | this.highlightMiniCal(o)
|
---|
16664 | }else{
|
---|
16665 | this.highlightMiniCal([])
|
---|
16666 | }
|
---|
16667 | this.updateCache(h,o);
|
---|
16668 | if(h.callback){
|
---|
16669 | h.callback.run(o);
|
---|
16670 | return
|
---|
16671 | }
|
---|
16672 | return o
|
---|
16673 | };
|
---|
16674 | ZmMiniCalCache.prototype.processBatchResponse=function(a,t){
|
---|
16675 | if(!a){
|
---|
16676 | return
|
---|
16677 | }
|
---|
16678 | for(var e=0;
|
---|
16679 | e<a.length;
|
---|
16680 | e++){
|
---|
16681 | var o=(a[e]&&a[e].date);
|
---|
16682 | if(o){
|
---|
16683 | for(var e=0;
|
---|
16684 | e<o.length;
|
---|
16685 | e++){
|
---|
16686 | if(o[e]._content){
|
---|
16687 | t.push(o[e]._content)
|
---|
16688 | }}}}};
|
---|
16689 | ZmMiniCalCache.prototype.highlightMiniCal=function(a){
|
---|
16690 | var e=[];
|
---|
16691 | for(var t=0;
|
---|
16692 | t<a.length;
|
---|
16693 | t++){
|
---|
16694 | if(a[t]){
|
---|
16695 | e[a[t]]=AjxDateFormat.parse("yyyyMMdd",a[t])
|
---|
16696 | }}
|
---|
16697 | if(this._calViewController&&this._calViewController._miniCalendar){
|
---|
16698 | this._calViewController._miniCalendar.setHilite(e,true,true)
|
---|
16699 | }}
|
---|
16700 | }
|
---|
16701 | if(AjxPackage.define("zimbraMail.calendar.controller.ZmReminderController")){
|
---|
16702 | ZmReminderController=function(e){
|
---|
16703 | this._calController=e;
|
---|
16704 | this._apptState={};
|
---|
16705 | this._cacheMap={};
|
---|
16706 | this._cachedAppts=new AjxVector();
|
---|
16707 | this._activeAppts=new AjxVector();
|
---|
16708 | this._oldAppts=new AjxVector();
|
---|
16709 | this._housekeepingTimedAction=new AjxTimedAction(this,this._housekeepingAction);
|
---|
16710 | this._refreshTimedAction=new AjxTimedAction(this,this.refresh);
|
---|
16711 | var a=appCtxt.getSettings();
|
---|
16712 | var i=new AjxListener(this,this._settingChangeListener);
|
---|
16713 | var t=a.getSetting(ZmSetting.CAL_REMINDER_WARNING_TIME);
|
---|
16714 | if(t){
|
---|
16715 | t.addChangeListener(i);
|
---|
16716 | this._warningTime=appCtxt.get(ZmSetting.CAL_REMINDER_WARNING_TIME)
|
---|
16717 | }};
|
---|
16718 | ZmReminderController.prototype.constructor=ZmReminderController;
|
---|
16719 | ZmReminderController._STATE_ACTIVE=1;
|
---|
16720 | ZmReminderController._STATE_DISMISSED=2;
|
---|
16721 | ZmReminderController._STATE_SNOOZED=3;
|
---|
16722 | ZmReminderController._CACHE_RANGE=24;
|
---|
16723 | ZmReminderController._CACHE_REFRESH=16;
|
---|
16724 | ZmReminderController.prototype.toString=function(){
|
---|
16725 | return"ZmReminderController"
|
---|
16726 | };
|
---|
16727 | ZmReminderController.prototype._settingChangeListener=function(i){
|
---|
16728 | if(i.type!=ZmEvent.S_SETTING){
|
---|
16729 | return
|
---|
16730 | }
|
---|
16731 | var a=i.source;
|
---|
16732 | if(a.id!=ZmSetting.CAL_REMINDER_WARNING_TIME){
|
---|
16733 | return
|
---|
16734 | }
|
---|
16735 | var t=this._warningTime;
|
---|
16736 | var e=this._warningTime=a.getValue();
|
---|
16737 | if(e==0){
|
---|
16738 | this._cancelRefreshAction();
|
---|
16739 | this._cancelHousekeepingAction()
|
---|
16740 | }else{
|
---|
16741 | if(t==0){
|
---|
16742 | this.refresh()
|
---|
16743 | }else{
|
---|
16744 | this._cancelHousekeepingAction();
|
---|
16745 | this._housekeepingAction()
|
---|
16746 | }}
|
---|
16747 | this._warningTime=e
|
---|
16748 | };
|
---|
16749 | ZmReminderController.prototype.refresh=function(){
|
---|
16750 | if(this._warningTime==0){
|
---|
16751 | return
|
---|
16752 | }
|
---|
16753 | this._searchTimeRange=this.getSearchTimeRange();
|
---|
16754 | var e=this.getRefreshParams();
|
---|
16755 | this._calController.getApptSummaries(e);
|
---|
16756 | if(this._refreshActionId){
|
---|
16757 | AjxTimedAction.cancelAction(this._refreshActionId)
|
---|
16758 | }
|
---|
16759 | this._refreshActionId=AjxTimedAction.scheduleAction(this._refreshTimedAction,(AjxDateUtil.MSEC_PER_HOUR*ZmReminderController._CACHE_REFRESH))
|
---|
16760 | };
|
---|
16761 | ZmReminderController.prototype.getSearchTimeRange=function(){
|
---|
16762 | var a=new Date();
|
---|
16763 | a.setHours(23,59,59,999);
|
---|
16764 | var e=new Date(a.getTime());
|
---|
16765 | a.setDate(a.getDate()-7);
|
---|
16766 | var t=a;
|
---|
16767 | t.setHours(0,0,0,0);
|
---|
16768 | return{
|
---|
16769 | start:t.getTime(),end:e.getTime()}
|
---|
16770 | };
|
---|
16771 | ZmReminderController.prototype.getRefreshParams=function(){
|
---|
16772 | var e=this.getSearchTimeRange();
|
---|
16773 | return{
|
---|
16774 | start:e.start,end:e.end,fanoutAllDay:false,folderIds:this._calController.getCheckedCalendarFolderIds(true),callback:(new AjxCallback(this,this._refreshCallback)),includeReminders:true}
|
---|
16775 | };
|
---|
16776 | ZmReminderController.prototype._cancelRefreshAction=function(){
|
---|
16777 | if(this._refreshActionId){
|
---|
16778 | AjxTimedAction.cancelAction(this._refreshActionId);
|
---|
16779 | delete this._refreshActionId
|
---|
16780 | }};
|
---|
16781 | ZmReminderController.prototype._cancelHousekeepingAction=function(){
|
---|
16782 | if(this._houseKeepingActionId){
|
---|
16783 | AjxTimedAction.cancelAction(this._housekeepingActionId);
|
---|
16784 | delete this._houseKeepingActionId
|
---|
16785 | }};
|
---|
16786 | ZmReminderController.prototype._refreshCallback=function(n){
|
---|
16787 | if(this._refreshDelay>0){
|
---|
16788 | AjxTimedAction.scheduleAction(new AjxTimedAction(this,this._refreshCallback,[n]),this._refreshDelay);
|
---|
16789 | this._refreshDelay=0;
|
---|
16790 | return
|
---|
16791 | }
|
---|
16792 | if(n instanceof ZmCsfeException){
|
---|
16793 | this._calController._handleError(n,new AjxCallback(this,this._maintErrorHandler));
|
---|
16794 | return
|
---|
16795 | }
|
---|
16796 | var a=new AjxVector();
|
---|
16797 | this._cacheMap={};
|
---|
16798 | var t=n.size();
|
---|
16799 | for(var e=0;
|
---|
16800 | e<t;
|
---|
16801 | e++){
|
---|
16802 | var o=n.get(e);
|
---|
16803 | var s=o.id;
|
---|
16804 | if(o.hasAlarmData()){
|
---|
16805 | if(!this._cacheMap[s]){
|
---|
16806 | this._cacheMap[s]=true;
|
---|
16807 | a.add(o)
|
---|
16808 | }}}
|
---|
16809 | this._cachedAppts=a.clone();
|
---|
16810 | this._cachedAppts.sort(ZmCalBaseItem.compareByTimeAndDuration);
|
---|
16811 | this._activeAppts.removeAll();
|
---|
16812 | this._cancelHousekeepingAction();
|
---|
16813 | this._housekeepingAction()
|
---|
16814 | };
|
---|
16815 | ZmReminderController.prototype.updateCache=function(n){
|
---|
16816 | if(!n){
|
---|
16817 | return
|
---|
16818 | }
|
---|
16819 | if(!this._cachedAppts){
|
---|
16820 | this._cachedAppts=new AjxVector()
|
---|
16821 | }
|
---|
16822 | var h=this.getSearchTimeRange();
|
---|
16823 | var o=0;
|
---|
16824 | var t=n.size();
|
---|
16825 | for(var e=0;
|
---|
16826 | e<t;
|
---|
16827 | e++){
|
---|
16828 | var a=n.get(e);
|
---|
16829 | var s=a.id;
|
---|
16830 | if(a.hasAlarmData()&&!this._cacheMap[s]&&a.isStartInRange(h.start,h.end)){
|
---|
16831 | this._cacheMap[s]=true;
|
---|
16832 | this._cachedAppts.add(a);
|
---|
16833 | o++
|
---|
16834 | }}};
|
---|
16835 | ZmReminderController.prototype.isApptSnoozed=function(e){
|
---|
16836 | return(this._apptState[e]==ZmReminderController._STATE_SNOOZED)
|
---|
16837 | };
|
---|
16838 | ZmReminderController.prototype._housekeepingAction=function(){
|
---|
16839 | var p=this.getReminderDialog();
|
---|
16840 | if(!ZmCsfeCommand.getAuthToken()){
|
---|
16841 | if(p&&p.isPoppedUp()){
|
---|
16842 | p.popdown()
|
---|
16843 | }
|
---|
16844 | return
|
---|
16845 | }
|
---|
16846 | if(this._searchTimeRange){
|
---|
16847 | var u=this.getSearchTimeRange();
|
---|
16848 | var f=u.end-this._searchTimeRange.end;
|
---|
16849 | if(f>AjxDateUtil.MSEC_PER_HOUR){
|
---|
16850 | this._searchTimeRange=null;
|
---|
16851 | this.refresh();
|
---|
16852 | return
|
---|
16853 | }}
|
---|
16854 | var t=this._cachedAppts.size();
|
---|
16855 | var l=this._activeAppts.size();
|
---|
16856 | if(t==0&&l==0){
|
---|
16857 | this._housekeepingActionId=AjxTimedAction.scheduleAction(this._housekeepingTimedAction,60*1000);
|
---|
16858 | return
|
---|
16859 | }
|
---|
16860 | var m=0;
|
---|
16861 | var n=(new Date()).getTime();
|
---|
16862 | var c=n+(this._warningTime*60*1000);
|
---|
16863 | var o=[];
|
---|
16864 | for(var h=0;
|
---|
16865 | h<t;
|
---|
16866 | h++){
|
---|
16867 | var e=this._cachedAppts.get(h);
|
---|
16868 | if(e&&this._snoozedAppt){
|
---|
16869 | var d=e.getUniqueId(true);
|
---|
16870 | if(this._snoozedAppt[d]){
|
---|
16871 | this._apptState[d]=ZmReminderController._STATE_ACTIVE;
|
---|
16872 | o.push(e);
|
---|
16873 | m++;
|
---|
16874 | this._activeAppts.add(e);
|
---|
16875 | delete this._snoozedAppt[d];
|
---|
16876 | continue
|
---|
16877 | }}
|
---|
16878 | if(!e||e.ptst==ZmCalBaseItem.PSTATUS_DECLINED){
|
---|
16879 | o.push(e)
|
---|
16880 | }else{
|
---|
16881 | if(e.isAlarmInRange()){
|
---|
16882 | var d=e.getUniqueId(true);
|
---|
16883 | var a=this._apptState[d];
|
---|
16884 | var s=false;
|
---|
16885 | if(a==ZmReminderController._STATE_DISMISSED){}else{
|
---|
16886 | if(a==ZmReminderController._STATE_ACTIVE){
|
---|
16887 | s=true
|
---|
16888 | }else{
|
---|
16889 | if(a!=ZmReminderController._STATE_SNOOZED){
|
---|
16890 | m++;
|
---|
16891 | s=true;
|
---|
16892 | this._apptState[d]=ZmReminderController._STATE_ACTIVE
|
---|
16893 | }}}
|
---|
16894 | if(s){
|
---|
16895 | o.push(e);
|
---|
16896 | if(!appCtxt.get(ZmSetting.CAL_SHOW_PAST_DUE_REMINDERS)&&e.isAlarmOld()){
|
---|
16897 | m--;
|
---|
16898 | this._oldAppts.add(e)
|
---|
16899 | }else{
|
---|
16900 | this._activeAppts.add(e)
|
---|
16901 | }}}}}
|
---|
16902 | for(var h in o){
|
---|
16903 | this._cachedAppts.remove(o[h])
|
---|
16904 | }
|
---|
16905 | if(m||p.isPoppedUp()){
|
---|
16906 | if(this._activeAppts.size()==0&&p.isPoppedUp()){
|
---|
16907 | p.popdown()
|
---|
16908 | }else{
|
---|
16909 | p.initialize(this._activeAppts);
|
---|
16910 | if(!p.isPoppedUp()){
|
---|
16911 | p.popup()
|
---|
16912 | }}}
|
---|
16913 | if(this._oldAppts.size()>0){
|
---|
16914 | this.dismissAppt(this._oldAppts,new AjxCallback(this,this._silentDismissCallback))
|
---|
16915 | }
|
---|
16916 | this._housekeepingActionId=AjxTimedAction.scheduleAction(this._housekeepingTimedAction,60*1000)
|
---|
16917 | };
|
---|
16918 | ZmReminderController.prototype._silentDismissCallback=function(o){
|
---|
16919 | var t=o.size();
|
---|
16920 | for(var e=0;
|
---|
16921 | e<t;
|
---|
16922 | e++){
|
---|
16923 | var a=o.get(e);
|
---|
16924 | if(a&&a.hasAlarmData()){
|
---|
16925 | if(a.isAlarmInRange()){
|
---|
16926 | this._activeAppts.add(a)
|
---|
16927 | }}}
|
---|
16928 | this._oldAppts.removeAll();
|
---|
16929 | this._cancelHousekeepingAction();
|
---|
16930 | this._housekeepingAction()
|
---|
16931 | };
|
---|
16932 | ZmReminderController.prototype.dismissAppt=function(a,o){
|
---|
16933 | var t;
|
---|
16934 | if(!(a instanceof AjxVector)){
|
---|
16935 | a=AjxVector.fromArray((a instanceof Array)?a:[a])
|
---|
16936 | }
|
---|
16937 | for(var e=0;
|
---|
16938 | e<a.size();
|
---|
16939 | e++){
|
---|
16940 | var t=a.get(e);
|
---|
16941 | this._apptState[t.getUniqueId(true)]=ZmReminderController._STATE_DISMISSED;
|
---|
16942 | this._activeAppts.remove(t)
|
---|
16943 | }
|
---|
16944 | this.dismissApptRequest(a,o)
|
---|
16945 | };
|
---|
16946 | ZmReminderController.prototype.snoozeAppt=function(n){
|
---|
16947 | var a=[];
|
---|
16948 | var o;
|
---|
16949 | var t;
|
---|
16950 | for(var e=0;
|
---|
16951 | e<n.size();
|
---|
16952 | e++){
|
---|
16953 | o=n.get(e);
|
---|
16954 | t=o.getUniqueId(true);
|
---|
16955 | this._apptState[t]=ZmReminderController._STATE_SNOOZED;
|
---|
16956 | a.push(t);
|
---|
16957 | this._activeAppts.remove(o);
|
---|
16958 | this._cachedAppts.add(o)
|
---|
16959 | }
|
---|
16960 | return a
|
---|
16961 | };
|
---|
16962 | ZmReminderController.prototype.activateSnoozedAppts=function(n){
|
---|
16963 | var o=this.getReminderDialog();
|
---|
16964 | if(o&&o.isPoppedUp()){
|
---|
16965 | o.popdown()
|
---|
16966 | }
|
---|
16967 | if(this._snoozedAppt==null){
|
---|
16968 | this._snoozedAppt={}
|
---|
16969 | }
|
---|
16970 | var a;
|
---|
16971 | var t;
|
---|
16972 | for(var e=0;
|
---|
16973 | e<n.size();
|
---|
16974 | e++){
|
---|
16975 | a=n.get(e);
|
---|
16976 | if(a){
|
---|
16977 | t=a.getUniqueId(true);
|
---|
16978 | this._snoozedAppt[t]=true
|
---|
16979 | }}
|
---|
16980 | this._cancelHousekeepingAction();
|
---|
16981 | this._housekeepingAction()
|
---|
16982 | };
|
---|
16983 | ZmReminderController.prototype.dismissApptRequest=function(s,c){
|
---|
16984 | var l=AjxSoapDoc.create("DismissCalendarItemAlarmRequest","urn:zimbraMail");
|
---|
16985 | var t=(new Date()).getTime();
|
---|
16986 | for(var n=0;
|
---|
16987 | n<s.size();
|
---|
16988 | n++){
|
---|
16989 | var e=s.get(n);
|
---|
16990 | var a=l.set("appt");
|
---|
16991 | a.setAttribute("id",e.id);
|
---|
16992 | a.setAttribute("dismissedAt",t)
|
---|
16993 | }
|
---|
16994 | var h=appCtxt.multiAccounts&&appCtxt.accountList.mainAccount;
|
---|
16995 | var o={
|
---|
16996 | soapDoc:l,asyncMode:true,accountName:(h?h.name:null),callback:(new AjxCallback(this,this._handleDismissAppt,[s,c])),errorCallback:(new AjxCallback(this,this._handleErrorDismissAppt,[s,c]))};
|
---|
16997 | appCtxt.getAppController().sendRequest(o);
|
---|
16998 | return true
|
---|
16999 | };
|
---|
17000 | ZmReminderController.prototype.setAlarmData=function(e,t,i){
|
---|
17001 | var a=e.set("alarmData",null,t);
|
---|
17002 | a.setAttribute("")
|
---|
17003 | };
|
---|
17004 | ZmReminderController.prototype._handleDismissAppt=function(n,l,d){
|
---|
17005 | if(d.isException()){
|
---|
17006 | return
|
---|
17007 | }
|
---|
17008 | var t=d.getResponse();
|
---|
17009 | var s=t.DismissCalendarItemAlarmResponse;
|
---|
17010 | var a=s?s.appt:null;
|
---|
17011 | if(!a){
|
---|
17012 | return
|
---|
17013 | }
|
---|
17014 | var h={};
|
---|
17015 | for(var o in a){
|
---|
17016 | var e=a[o];
|
---|
17017 | if(e&&e.calItemId){
|
---|
17018 | h[e.calItemId]=e.alarmData?e.alarmData:{}
|
---|
17019 | }}
|
---|
17020 | var c=n.size();
|
---|
17021 | for(var o=0;
|
---|
17022 | o<c;
|
---|
17023 | o++){
|
---|
17024 | var e=n.get(o);
|
---|
17025 | if(e){
|
---|
17026 | if(h[e.id]){
|
---|
17027 | e.alarmData=(h[e.id]!={}
|
---|
17028 | )?h[e.id]:null
|
---|
17029 | }}}
|
---|
17030 | if(l){
|
---|
17031 | l.run(n)
|
---|
17032 | }};
|
---|
17033 | ZmReminderController.prototype._handleErrorDismissAppt=function(t,a,e){};
|
---|
17034 | ZmReminderController.prototype.getReminderDialog=function(){
|
---|
17035 | if(this._reminderDialog==null){
|
---|
17036 | this._reminderDialog=new ZmReminderDialog(appCtxt.getShell(),this,this._calController)
|
---|
17037 | }
|
---|
17038 | return this._reminderDialog
|
---|
17039 | }
|
---|
17040 | }
|
---|
17041 | if(AjxPackage.define("zimbraMail.calendar.view.ZmReminderDialog")){
|
---|
17042 | ZmReminderDialog=function(n,h,e){
|
---|
17043 | var o=Dwt.getNextId();
|
---|
17044 | var a=[];
|
---|
17045 | var t=0;
|
---|
17046 | a[t++]="<td valign='middle' class='ZmReminderField'>";
|
---|
17047 | a[t++]=ZmMsg.snoozeAll;
|
---|
17048 | a[t++]="</td><td valign='middle' id='";
|
---|
17049 | a[t++]=o;
|
---|
17050 | a[t++]="'></td><td valign='middle' id=\"{0}\"></td>";
|
---|
17051 | var s=new DwtDialog_ButtonDescriptor(ZmReminderDialog.SNOOZE_BUTTON,ZmMsg.snooze,DwtDialog.ALIGN_LEFT,null,a.join(""));
|
---|
17052 | var l=new DwtDialog_ButtonDescriptor(ZmReminderDialog.DISMISS_ALL_BUTTON,ZmMsg.dismissAll,DwtDialog.ALIGN_RIGHT);
|
---|
17053 | DwtDialog.call(this,{
|
---|
17054 | parent:n,standardButtons:DwtDialog.NO_BUTTONS,extraButtons:[s,l]}
|
---|
17055 | );
|
---|
17056 | this._reminderController=h;
|
---|
17057 | this._calController=e;
|
---|
17058 | this.setContent(this._contentHtml(o));
|
---|
17059 | this.setTitle(ZmMsg.apptReminders);
|
---|
17060 | this.registerCallback(ZmReminderDialog.SNOOZE_BUTTON,this._handleSnoozeButton,this);
|
---|
17061 | this.registerCallback(ZmReminderDialog.DISMISS_ALL_BUTTON,this._handleDismissAllButton,this)
|
---|
17062 | };
|
---|
17063 | ZmReminderDialog.prototype=new DwtDialog;
|
---|
17064 | ZmReminderDialog.prototype.constructor=ZmReminderDialog;
|
---|
17065 | ZmReminderDialog.SNOOZE_BUTTON=++DwtDialog.LAST_BUTTON;
|
---|
17066 | ZmReminderDialog.DISMISS_ALL_BUTTON=++DwtDialog.LAST_BUTTON;
|
---|
17067 | ZmReminderDialog.SOON=-AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES;
|
---|
17068 | ZmReminderDialog.prototype.toString=function(){
|
---|
17069 | return"ZmReminderDialog"
|
---|
17070 | };
|
---|
17071 | ZmReminderDialog.prototype.popup=function(){
|
---|
17072 | DwtDialog.prototype.popup.call(this);
|
---|
17073 | this._cancelSnooze();
|
---|
17074 | if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_BROWSER)){
|
---|
17075 | AjxPackage.require("Alert");
|
---|
17076 | ZmBrowserAlert.getInstance().start(ZmMsg.appointmentReminder)
|
---|
17077 | }
|
---|
17078 | if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_SOUNDS)){
|
---|
17079 | AjxPackage.require("Alert");
|
---|
17080 | ZmSoundAlert.getInstance().start()
|
---|
17081 | }
|
---|
17082 | if(appCtxt.get(ZmSetting.CAL_REMINDER_NOTIFY_TOASTER)){
|
---|
17083 | AjxPackage.require("Alert");
|
---|
17084 | var o=[];
|
---|
17085 | var e=this._list.getArray();
|
---|
17086 | for(var t=0;
|
---|
17087 | t<e.length&&t<5;
|
---|
17088 | t++){
|
---|
17089 | var a=e[t];
|
---|
17090 | var s=this._formatDeltaString(this._computeDelta(a));
|
---|
17091 | var n=[a.getName(),", ",this._getDurationText(a),"\n(",s,")"].join("");
|
---|
17092 | if(AjxEnv.isMac){
|
---|
17093 | ZmDesktopAlert.getInstance().start(ZmMsg.appointmentReminder,n)
|
---|
17094 | }else{
|
---|
17095 | if(AjxEnv.isWindows){
|
---|
17096 | o.push(n)
|
---|
17097 | }}}
|
---|
17098 | if(AjxEnv.isWindows&&o.length>0){
|
---|
17099 | if(e.length>5){
|
---|
17100 | o.push(ZmMsg.andMore)
|
---|
17101 | }
|
---|
17102 | ZmDesktopAlert.getInstance().start(ZmMsg.appointmentReminder,o.join("\n"),5)
|
---|
17103 | }}};
|
---|
17104 | ZmReminderDialog.prototype.initialize=function(u){
|
---|
17105 | this._list=u.clone();
|
---|
17106 | this._apptData={};
|
---|
17107 | var c=[];
|
---|
17108 | var m=0;
|
---|
17109 | var p=u.size();
|
---|
17110 | c[m++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
|
---|
17111 | for(var h=0;
|
---|
17112 | h<p;
|
---|
17113 | h++){
|
---|
17114 | var e=u.get(h);
|
---|
17115 | var d=e.getUniqueId(true);
|
---|
17116 | var s=this._apptData[d]={
|
---|
17117 | appt:e};
|
---|
17118 | m=this._addAppt(c,m,e,s,(h>0))
|
---|
17119 | }
|
---|
17120 | c[m++]="</table>";
|
---|
17121 | if(this._dismissButtons){
|
---|
17122 | for(var a in this._dismissButtons){
|
---|
17123 | this._dismissButtons[a].dispose()
|
---|
17124 | }}
|
---|
17125 | if(this._openButtons){
|
---|
17126 | for(var a in this._openButtons){
|
---|
17127 | this._openButtons[a].dispose()
|
---|
17128 | }}
|
---|
17129 | this._dismissButtons={};
|
---|
17130 | this._openButtons={};
|
---|
17131 | var o=new AjxListener(this,this._dismissButtonListener);
|
---|
17132 | var f=new AjxListener(this,this._openButtonListener);
|
---|
17133 | var t=document.getElementById(this._listId);
|
---|
17134 | t.innerHTML=c.join("");
|
---|
17135 | for(var h=0;
|
---|
17136 | h<p;
|
---|
17137 | h++){
|
---|
17138 | var e=u.get(h);
|
---|
17139 | var d=e.getUniqueId(true);
|
---|
17140 | var s=this._apptData[d];
|
---|
17141 | var l=this._dismissButtons[s.dismissBtnId]=new DwtButton({
|
---|
17142 | parent:this,className:"DwtToolbarButton",parentElement:s.dismissBtnId}
|
---|
17143 | );
|
---|
17144 | l.setImage("Cancel");
|
---|
17145 | l.setText(ZmMsg.dismiss);
|
---|
17146 | l.addSelectionListener(o);
|
---|
17147 | l.apptUid=d;
|
---|
17148 | var n=this._openButtons[s.openBtnId]=new DwtButton({
|
---|
17149 | parent:this,className:"DwtToolbarButton",parentElement:s.openBtnId}
|
---|
17150 | );
|
---|
17151 | n.setImage(e.otherAttendees?"ApptMeeting":"Appointment");
|
---|
17152 | n.setText(ZmMsg.viewAppointment);
|
---|
17153 | n.addSelectionListener(f);
|
---|
17154 | n.apptUid=d;
|
---|
17155 | this._updateDelta(s)
|
---|
17156 | }};
|
---|
17157 | ZmReminderDialog.prototype._contentHtml=function(o){
|
---|
17158 | this._listId=Dwt.getNextId();
|
---|
17159 | var e=[1,5,10,15,30,45,60];
|
---|
17160 | this._select=new DwtSelect({
|
---|
17161 | parent:this}
|
---|
17162 | );
|
---|
17163 | var n=new AjxMessageFormat(ZmMsg.reminderSnoozeMinutes);
|
---|
17164 | for(var a=0;
|
---|
17165 | a<e.length;
|
---|
17166 | a++){
|
---|
17167 | var t=n.format(e[a]);
|
---|
17168 | this._select.addOption(t,a==0,e[a])
|
---|
17169 | }
|
---|
17170 | this._select.reparentHtmlElement(o);
|
---|
17171 | return["<div class='ZmReminderDialog' id='",this._listId,"'>"].join("")
|
---|
17172 | };
|
---|
17173 | ZmReminderDialog.prototype._updateDelta=function(t){
|
---|
17174 | var a=document.getElementById(t.deltaId);
|
---|
17175 | if(a){
|
---|
17176 | var e=this._computeDelta(t.appt);
|
---|
17177 | if(e>=0){
|
---|
17178 | a.className="ZmReminderOverdue"
|
---|
17179 | }else{
|
---|
17180 | if(e>ZmReminderDialog.SOON){
|
---|
17181 | a.className="ZmReminderSoon"
|
---|
17182 | }else{
|
---|
17183 | a.className="ZmReminderFuture"
|
---|
17184 | }}
|
---|
17185 | a.innerHTML=this._formatDeltaString(e)
|
---|
17186 | }};
|
---|
17187 | ZmReminderDialog.prototype._addAppt=function(t,e,a,i,h){
|
---|
17188 | i.dismissBtnId=Dwt.getNextId();
|
---|
17189 | i.openBtnId=Dwt.getNextId();
|
---|
17190 | i.deltaId=Dwt.getNextId();
|
---|
17191 | i.rowId=Dwt.getNextId();
|
---|
17192 | var n=(a.folderId!=ZmOrganizer.ID_CALENDAR&&this._calController)?this._calController.getCalendarName(a.folderId):null;
|
---|
17193 | var o=appCtxt.getById(a.folderId);
|
---|
17194 | var s={
|
---|
17195 | needSep:h,rowId:i.rowId,calName:n,accountName:(appCtxt.multiAccounts&&o&&o.getAccount().getDisplayName()),location:a.getReminderLocation(),apptIconHtml:(AjxImg.getImageHtml(a.otherAttendees?"ApptMeeting":"Appointment")),organizer:a.otherAtt?a.organizer:null,reminderName:(AjxStringUtil.htmlEncode(a.getReminderName())),durationText:(AjxStringUtil.trim(this._getDurationText(a))),deltaId:i.deltaId,openBtnId:i.openBtnId,dismissBtnId:i.dismissBtnId};
|
---|
17196 | t[e++]=AjxTemplate.expand("calendar.Calendar#ReminderDialogRow",s);
|
---|
17197 | return e
|
---|
17198 | };
|
---|
17199 | ZmReminderDialog.prototype._openButtonListener=function(o){
|
---|
17200 | appCtxt.getAppController().setStatusMsg(ZmMsg.allRemindersAreSnoozed,ZmStatusView.LEVEL_INFO);
|
---|
17201 | this._handleSnoozeButton();
|
---|
17202 | var s=DwtControl.getTargetControl(o);
|
---|
17203 | var n=this._apptData[s.apptUid];
|
---|
17204 | var a=n?n.appt:null;
|
---|
17205 | if(a){
|
---|
17206 | AjxDispatcher.require(["CalendarCore","Calendar"]);
|
---|
17207 | var l=AjxDispatcher.run("GetCalController");
|
---|
17208 | var t=new ZmAppt();
|
---|
17209 | for(var e in a){
|
---|
17210 | if(!AjxUtil.isFunction(a[e])){
|
---|
17211 | t[e]=a[e]
|
---|
17212 | }}
|
---|
17213 | var h=new AjxCallback(l,l._showAppointmentDetails,t);
|
---|
17214 | t.getDetails(null,h,null,null,true)
|
---|
17215 | }};
|
---|
17216 | ZmReminderDialog.prototype._dismissButtonListener=function(a){
|
---|
17217 | var n=DwtControl.getTargetControl(a);
|
---|
17218 | var o=this._apptData[n.apptUid];
|
---|
17219 | if(!o){
|
---|
17220 | return
|
---|
17221 | }
|
---|
17222 | this._reminderController.dismissAppt(o.appt);
|
---|
17223 | var e=this._dismissButtons[o.dismissBtnId];
|
---|
17224 | if(e){
|
---|
17225 | e.dispose();
|
---|
17226 | delete this._dismissButtons[o.dismissBtnId]
|
---|
17227 | }
|
---|
17228 | var i=this._openButtons[o.openBtnId];
|
---|
17229 | if(i){
|
---|
17230 | i.dispose();
|
---|
17231 | delete this._openButtons[o.openBtnId]
|
---|
17232 | }
|
---|
17233 | var s=document.getElementById(o.rowId);
|
---|
17234 | if(s){
|
---|
17235 | var t=s.nextSibling;
|
---|
17236 | if(t&&t.getAttribute("name")=="rdsep"){
|
---|
17237 | t.parentNode.removeChild(t)
|
---|
17238 | }
|
---|
17239 | s.parentNode.removeChild(s)
|
---|
17240 | }
|
---|
17241 | delete this._apptData[n.apptUid];
|
---|
17242 | this._list.remove(o.appt);
|
---|
17243 | if(this._list.size()==0){
|
---|
17244 | this.popdown()
|
---|
17245 | }};
|
---|
17246 | ZmReminderDialog.prototype._handleSnoozeButton=function(){
|
---|
17247 | this.popdown();
|
---|
17248 | var e=this._reminderController.snoozeAppt(this._list);
|
---|
17249 | var a=this._list.clone();
|
---|
17250 | var t=new AjxTimedAction(this,this._snoozeAction,[a]);
|
---|
17251 | AjxTimedAction.scheduleAction(t,this._select.getValue()*60*1000)
|
---|
17252 | };
|
---|
17253 | ZmReminderDialog.prototype._snoozeAction=function(e){
|
---|
17254 | if(e){
|
---|
17255 | this._reminderController.activateSnoozedAppts(e)
|
---|
17256 | }};
|
---|
17257 | ZmReminderDialog.prototype._cancelSnooze=function(){
|
---|
17258 | if(this._snoozeActionId){
|
---|
17259 | AjxTimedAction.cancelAction(this._snoozeActionId);
|
---|
17260 | delete this._snoozeActionId
|
---|
17261 | }};
|
---|
17262 | ZmReminderDialog.prototype._handleDismissAllButton=function(){
|
---|
17263 | this._cancelSnooze();
|
---|
17264 | this.popdown();
|
---|
17265 | this._reminderController.dismissAppt(this._list)
|
---|
17266 | };
|
---|
17267 | ZmReminderDialog.prototype._getDurationText=function(a){
|
---|
17268 | var o=a.isMultiDay();
|
---|
17269 | var n=a._alarmInstStart?new Date(a._alarmInstStart):a.startDate;
|
---|
17270 | var t=a._alarmInstStart?(n.getTime()+a.getDuration()):a.getEndTime();
|
---|
17271 | var e=new Date(t);
|
---|
17272 | if(a.isAllDayEvent()){
|
---|
17273 | e=new Date(t-(o?2*AjxDateUtil.MSEC_PER_HOUR:0));
|
---|
17274 | var i=o?ZmMsg.apptTimeAllDayMulti:ZmMsg.apptTimeAllDay;
|
---|
17275 | return AjxMessageFormat.format(i,[n,e])
|
---|
17276 | }
|
---|
17277 | var i=o?ZmMsg.apptTimeInstanceMulti:ZmMsg.apptTimeInstance;
|
---|
17278 | return AjxMessageFormat.format(i,[n,e,""])
|
---|
17279 | };
|
---|
17280 | ZmReminderDialog.prototype._computeDelta=function(e){
|
---|
17281 | return(e.alarmData&&e.alarmData.length>0)?((new Date()).getTime()-e.adjustMS(e.alarmData[0].alarmInstStart,e.tzo)):((new Date()).getTime()-e.getStartTime())
|
---|
17282 | };
|
---|
17283 | ZmReminderDialog.prototype._formatDeltaString=function(i){
|
---|
17284 | var o=i<0?"In":"OverdueBy";
|
---|
17285 | i=Math.abs(i);
|
---|
17286 | var s=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*365));
|
---|
17287 | if(s!=0){
|
---|
17288 | i-=s*AjxDateUtil.MSEC_PER_DAY*365
|
---|
17289 | }
|
---|
17290 | var t=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*30.42));
|
---|
17291 | if(t>0){
|
---|
17292 | i-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
|
---|
17293 | }
|
---|
17294 | var d=Math.floor(i/AjxDateUtil.MSEC_PER_DAY);
|
---|
17295 | if(d>0){
|
---|
17296 | i-=d*AjxDateUtil.MSEC_PER_DAY
|
---|
17297 | }
|
---|
17298 | var l=Math.floor(i/AjxDateUtil.MSEC_PER_HOUR);
|
---|
17299 | if(l>0){
|
---|
17300 | i-=l*AjxDateUtil.MSEC_PER_HOUR
|
---|
17301 | }
|
---|
17302 | var e=Math.floor(i/60000);
|
---|
17303 | if(e>0){
|
---|
17304 | i-=e*60000
|
---|
17305 | }
|
---|
17306 | var n=Math.floor(i/1000);
|
---|
17307 | if(n>30&&e<59){
|
---|
17308 | e++
|
---|
17309 | }
|
---|
17310 | var n=0;
|
---|
17311 | var a;
|
---|
17312 | if(s>0){
|
---|
17313 | a="Years";
|
---|
17314 | if(s<=3&&t>0){
|
---|
17315 | a="YearsMonths"
|
---|
17316 | }}else{
|
---|
17317 | if(t>0){
|
---|
17318 | a="Months";
|
---|
17319 | if(t<=3&&d>0){
|
---|
17320 | a="MonthsDays"
|
---|
17321 | }}else{
|
---|
17322 | if(d>0){
|
---|
17323 | a="Days";
|
---|
17324 | if(d<=2&&l>0){
|
---|
17325 | a="DaysHours"
|
---|
17326 | }}else{
|
---|
17327 | if(l>0){
|
---|
17328 | a="Hours";
|
---|
17329 | if(l<5&&e>0){
|
---|
17330 | a="HoursMinutes"
|
---|
17331 | }}else{
|
---|
17332 | a="Minutes"
|
---|
17333 | }}}}
|
---|
17334 | var c=["reminder",o,a].join("");
|
---|
17335 | var h=[i,s,t,d,l,e,n];
|
---|
17336 | return AjxMessageFormat.format(ZmMsg[c],h)
|
---|
17337 | }
|
---|
17338 | }
|
---|
17339 | if(AjxPackage.define("zimbraMail.calendar.view.ZmQuickReminderDialog")){
|
---|
17340 | ZmQuickReminderDialog=function(a,i,e){
|
---|
17341 | var t=Dwt.getNextId();
|
---|
17342 | DwtDialog.call(this,{
|
---|
17343 | parent:a,standardButtons:[DwtDialog.OK_BUTTON]}
|
---|
17344 | );
|
---|
17345 | this._reminderController=i;
|
---|
17346 | this._calController=e;
|
---|
17347 | this.setContent(this._contentHtml(t));
|
---|
17348 | this.setTitle(ZmMsg.currentMeetings)
|
---|
17349 | };
|
---|
17350 | ZmQuickReminderDialog.prototype=new DwtDialog;
|
---|
17351 | ZmQuickReminderDialog.prototype.constructor=ZmQuickReminderDialog;
|
---|
17352 | ZmQuickReminderDialog.SOON=-AjxDateUtil.MSEC_PER_FIFTEEN_MINUTES;
|
---|
17353 | ZmQuickReminderDialog.prototype.toString=function(){
|
---|
17354 | return"ZmQuickReminderDialog"
|
---|
17355 | };
|
---|
17356 | ZmQuickReminderDialog.prototype.popup=function(){
|
---|
17357 | DwtDialog.prototype.popup.call(this)
|
---|
17358 | };
|
---|
17359 | ZmQuickReminderDialog.prototype.initialize=function(c){
|
---|
17360 | this._list=c.clone();
|
---|
17361 | this._apptData={};
|
---|
17362 | var h=[];
|
---|
17363 | var d=0;
|
---|
17364 | var m=c.size();
|
---|
17365 | h[d++]="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
|
---|
17366 | for(var s=0;
|
---|
17367 | s<m;
|
---|
17368 | s++){
|
---|
17369 | var e=c.get(s);
|
---|
17370 | var l=e.getUniqueId(true);
|
---|
17371 | var n=this._apptData[l]={
|
---|
17372 | appt:e};
|
---|
17373 | d=this._addAppt(h,d,e,n,(s>0))
|
---|
17374 | }
|
---|
17375 | if(m==0){
|
---|
17376 | h[d++]='<tr name="rdsep">';
|
---|
17377 | h[d++]="<td colspan=3><div>"+ZmMsg.noMeetingsFound+"</div></td>";
|
---|
17378 | h[d++]="</tr>"
|
---|
17379 | }
|
---|
17380 | h[d++]="</table>";
|
---|
17381 | if(this._openButtons){
|
---|
17382 | for(var a in this._openButtons){
|
---|
17383 | this._openButtons[a].dispose()
|
---|
17384 | }}
|
---|
17385 | this._openButtons={};
|
---|
17386 | var u=new AjxListener(this,this._openButtonListener);
|
---|
17387 | var t=document.getElementById(this._listId);
|
---|
17388 | t.innerHTML=h.join("");
|
---|
17389 | for(var s=0;
|
---|
17390 | s<m;
|
---|
17391 | s++){
|
---|
17392 | var e=c.get(s);
|
---|
17393 | var l=e.getUniqueId(true);
|
---|
17394 | var n=this._apptData[l];
|
---|
17395 | var o=this._openButtons[n.openBtnId]=new DwtButton({
|
---|
17396 | parent:this,className:"DwtToolbarButton",parentElement:n.openBtnId}
|
---|
17397 | );
|
---|
17398 | o.setImage(e.otherAttendees?"ApptMeeting":"Appointment");
|
---|
17399 | o.setText(ZmMsg.viewAppointment);
|
---|
17400 | o.addSelectionListener(u);
|
---|
17401 | o.apptUid=l;
|
---|
17402 | this._updateDelta(n)
|
---|
17403 | }};
|
---|
17404 | ZmQuickReminderDialog.prototype._contentHtml=function(e){
|
---|
17405 | this._listId=Dwt.getNextId();
|
---|
17406 | return["<div class='ZmQuickReminderDialog' id='",this._listId,"'>"].join("")
|
---|
17407 | };
|
---|
17408 | ZmQuickReminderDialog.prototype._updateDelta=function(t){
|
---|
17409 | var a=document.getElementById(t.deltaId);
|
---|
17410 | if(a){
|
---|
17411 | var e=this._computeDelta(t.appt);
|
---|
17412 | if(e>=0){
|
---|
17413 | a.className="ZmReminderOverdue"
|
---|
17414 | }else{
|
---|
17415 | if(e>ZmQuickReminderDialog.SOON){
|
---|
17416 | a.className="ZmReminderSoon"
|
---|
17417 | }else{
|
---|
17418 | a.className="ZmReminderFuture"
|
---|
17419 | }}
|
---|
17420 | a.innerHTML=this._formatDeltaString(e)
|
---|
17421 | }};
|
---|
17422 | ZmQuickReminderDialog.prototype._addAppt=function(o,h,e,i,s){
|
---|
17423 | i.openBtnId=Dwt.getNextId();
|
---|
17424 | i.deltaId=Dwt.getNextId();
|
---|
17425 | i.rowId=Dwt.getNextId();
|
---|
17426 | var n=(e.folderId!=ZmOrganizer.ID_CALENDAR&&this._calController)?this._calController.getCalendarName(e.folderId):null;
|
---|
17427 | var a=appCtxt.getById(e.folderId);
|
---|
17428 | var l=e.isUpcomingEvent?" ("+ZmMsg.upcoming+")":"";
|
---|
17429 | var t={
|
---|
17430 | needSep:s,rowId:i.rowId,calName:n,accountName:(appCtxt.multiAccounts&&a&&a.getAccount().getDisplayName()),location:e.getLocation(),apptIconHtml:(AjxImg.getImageHtml(e.otherAttendees?"ApptMeeting":"Appointment")),organizer:e.otherAtt?e.organizer:null,reminderName:(AjxStringUtil.htmlEncode(e.name+l)),durationText:(AjxStringUtil.trim(this._getDurationText(e))),deltaId:i.deltaId,openBtnId:i.openBtnId};
|
---|
17431 | o[h++]=AjxTemplate.expand("calendar.Calendar#ReminderDialogRow",t);
|
---|
17432 | return h
|
---|
17433 | };
|
---|
17434 | ZmQuickReminderDialog.prototype._openButtonListener=function(o){
|
---|
17435 | var s=DwtControl.getTargetControl(o);
|
---|
17436 | var n=this._apptData[s.apptUid];
|
---|
17437 | var a=n?n.appt:null;
|
---|
17438 | if(a){
|
---|
17439 | AjxDispatcher.require(["CalendarCore","Calendar"]);
|
---|
17440 | var l=AjxDispatcher.run("GetCalController");
|
---|
17441 | var t=new ZmAppt();
|
---|
17442 | for(var e in a){
|
---|
17443 | if(!AjxUtil.isFunction(a[e])){
|
---|
17444 | t[e]=a[e]
|
---|
17445 | }}
|
---|
17446 | var h=new AjxCallback(l,l._showAppointmentDetails,t);
|
---|
17447 | t.getDetails(null,h,null,null,true);
|
---|
17448 | this.popdown()
|
---|
17449 | }};
|
---|
17450 | ZmQuickReminderDialog.prototype._getDurationText=function(a){
|
---|
17451 | var o=a.isMultiDay();
|
---|
17452 | var n=a.startDate;
|
---|
17453 | var t=a.getEndTime();
|
---|
17454 | var e=new Date(t);
|
---|
17455 | if(a.isAllDayEvent()){
|
---|
17456 | e=new Date(t-(o?2*AjxDateUtil.MSEC_PER_HOUR:0));
|
---|
17457 | var i=o?ZmMsg.apptTimeAllDayMulti:ZmMsg.apptTimeAllDay;
|
---|
17458 | return AjxMessageFormat.format(i,[n,e])
|
---|
17459 | }
|
---|
17460 | var i=o?ZmMsg.apptTimeInstanceMulti:ZmMsg.apptTimeInstance;
|
---|
17461 | return AjxMessageFormat.format(i,[n,e,""])
|
---|
17462 | };
|
---|
17463 | ZmQuickReminderDialog.prototype._computeDelta=function(e){
|
---|
17464 | return((new Date()).getTime()-e.getStartTime())
|
---|
17465 | };
|
---|
17466 | ZmQuickReminderDialog.prototype._formatDeltaString=function(i){
|
---|
17467 | var o=i<0?"In":"OverdueBy";
|
---|
17468 | i=Math.abs(i);
|
---|
17469 | var s=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*365));
|
---|
17470 | if(s!=0){
|
---|
17471 | i-=s*AjxDateUtil.MSEC_PER_DAY*365
|
---|
17472 | }
|
---|
17473 | var t=Math.floor(i/(AjxDateUtil.MSEC_PER_DAY*30.42));
|
---|
17474 | if(t>0){
|
---|
17475 | i-=Math.floor(t*AjxDateUtil.MSEC_PER_DAY*30.42)
|
---|
17476 | }
|
---|
17477 | var d=Math.floor(i/AjxDateUtil.MSEC_PER_DAY);
|
---|
17478 | if(d>0){
|
---|
17479 | i-=d*AjxDateUtil.MSEC_PER_DAY
|
---|
17480 | }
|
---|
17481 | var l=Math.floor(i/AjxDateUtil.MSEC_PER_HOUR);
|
---|
17482 | if(l>0){
|
---|
17483 | i-=l*AjxDateUtil.MSEC_PER_HOUR
|
---|
17484 | }
|
---|
17485 | var e=Math.floor(i/60000);
|
---|
17486 | if(e>0){
|
---|
17487 | i-=e*60000
|
---|
17488 | }
|
---|
17489 | var n=Math.floor(i/1000);
|
---|
17490 | if(n>30&&e<59){
|
---|
17491 | e++
|
---|
17492 | }
|
---|
17493 | var n=0;
|
---|
17494 | var a;
|
---|
17495 | if(s>0){
|
---|
17496 | a="Years";
|
---|
17497 | if(s<=3&&t>0){
|
---|
17498 | a="YearsMonths"
|
---|
17499 | }}else{
|
---|
17500 | if(t>0){
|
---|
17501 | a="Months";
|
---|
17502 | if(t<=3&&d>0){
|
---|
17503 | a="MonthsDays"
|
---|
17504 | }}else{
|
---|
17505 | if(d>0){
|
---|
17506 | a="Days";
|
---|
17507 | if(d<=2&&l>0){
|
---|
17508 | a="DaysHours"
|
---|
17509 | }}else{
|
---|
17510 | if(l>0){
|
---|
17511 | a="Hours";
|
---|
17512 | if(l<5&&e>0){
|
---|
17513 | a="HoursMinutes"
|
---|
17514 | }}else{
|
---|
17515 | a="Minutes"
|
---|
17516 | }}}}
|
---|
17517 | var c=["reminder",o,a].join("");
|
---|
17518 | var h=[i,s,t,d,l,e,n];
|
---|
17519 | return AjxMessageFormat.format(ZmMsg[c],h)
|
---|
17520 | }
|
---|
17521 | }};
|
---|
17522 | </script></head><body style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; overflow-x: hidden; overflow-y: hidden; ">
|
---|
17523 |
|
---|
17524 | <!--
|
---|
17525 | ***** BEGIN LICENSE BLOCK *****
|
---|
17526 | Zimbra Collaboration Suite Web Client
|
---|
17527 | Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Zimbra, Inc.
|
---|
17528 |
|
---|
17529 | The contents of this file are subject to the Zimbra Public License
|
---|
17530 | Version 1.3 ("License"); you may not use this file except in
|
---|
17531 | compliance with the License. You may obtain a copy of the License at
|
---|
17532 | http://www.zimbra.com/license.
|
---|
17533 |
|
---|
17534 | Software distributed under the License is distributed on an "AS IS"
|
---|
17535 | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
---|
17536 | ***** END LICENSE BLOCK *****
|
---|
17537 | -->
|
---|
17538 | <script type="text/javascript" src="/zimbra/res/I18nMsg,AjxMsg,ZMsg,ZmMsg,AjxKeys,ZmKeys,ZdMsg,AjxTemplateMsg.js.zgz?v=110527090709&skin=velodrome2"></script>
|
---|
17539 |
|
---|
17540 |
|
---|
17541 | <!-- image overlays and masks -->
|
---|
17542 | <script>
|
---|
17543 | if (!window.AjxImgData) AjxImgData = {};
|
---|
17544 | AjxImgData["ImgCalendarFolderOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgCalendarFolderOverlay.png"};
|
---|
17545 | AjxImgData["ImgContactsFolderOverlay"]={t:0,l:0,w:14,h:16,f:"@AppContextPath@/img/overlays/ImgContactsFolderOverlay.png"};
|
---|
17546 | AjxImgData["ImgEmailedContactsOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgEmailedContactsOverlay.png"};
|
---|
17547 | AjxImgData["ImgFolderOverlay"]={t:0,l:0,w:16,h:14,f:"@AppContextPath@/img/overlays/ImgFolderOverlay.png"};
|
---|
17548 | AjxImgData["ImgInboxOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgInboxOverlay.png"};
|
---|
17549 | AjxImgData["ImgMailFolderOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgMailFolderOverlay.png"};
|
---|
17550 | AjxImgData["ImgNotebookOverlay"]={t:0,l:0,w:16,h:15,f:"@AppContextPath@/img/overlays/ImgNotebookOverlay.png"};
|
---|
17551 | AjxImgData["ImgRSSOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgRSSOverlay.png"};
|
---|
17552 | AjxImgData["ImgSectionOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSectionOverlay.png"};
|
---|
17553 | AjxImgData["ImgSentFolderOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgSentFolderOverlay.png"};
|
---|
17554 | AjxImgData["ImgSharedCalendarFolderOverlay"]={t:0,l:0,w:16,h:15,f:"@AppContextPath@/img/overlays/ImgSharedCalendarFolderOverlay.png"};
|
---|
17555 | AjxImgData["ImgSharedContactsFolderOverlay"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/overlays/ImgSharedContactsFolderOverlay.png"};
|
---|
17556 | AjxImgData["ImgSharedMailFolderOverlay"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/overlays/ImgSharedMailFolderOverlay.png"};
|
---|
17557 | AjxImgData["ImgSharedNotebookOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSharedNotebookOverlay.png"};
|
---|
17558 | AjxImgData["ImgSharedSectionOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgSharedSectionOverlay.png"};
|
---|
17559 | AjxImgData["ImgSharedTaskListOverlay"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/overlays/ImgSharedTaskListOverlay.png"};
|
---|
17560 | AjxImgData["ImgTagOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgTagOverlay.png"};
|
---|
17561 | AjxImgData["ImgTaskListOverlay"]={t:0,l:0,w:16,h:16,f:"@AppContextPath@/img/overlays/ImgTaskListOverlay.png"};
|
---|
17562 | AjxImgData["ImgMailFolderMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/mail.gif"};
|
---|
17563 | AjxImgData["ImgRSSMask"]={t:-354,l:0,w:16,h:16,f:"@AppContextPath@/img/mail.gif"};
|
---|
17564 | AjxImgData["ImgSharedTaskListMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/tasks.gif"};
|
---|
17565 | AjxImgData["ImgTaskListMask"]={t:-114,l:0,w:16,h:16,f:"@AppContextPath@/img/tasks.gif"};
|
---|
17566 | AjxImgData["ImgSentFolderMask"]={t:0,l:0,w:16,h:18,f:"@AppContextPath@/img/startup.gif"};
|
---|
17567 | AjxImgData["ImgSharedMailFolderMask"]={t:-18,l:0,w:16,h:17,f:"@AppContextPath@/img/startup.gif"};
|
---|
17568 | AjxImgData["ImgInboxMask"]={t:-611,l:0,w:16,h:16,f:"@AppContextPath@/img/startup.gif"};
|
---|
17569 | AjxImgData["ImgTagMask"]={t:-1491,l:0,w:16,h:16,f:"@AppContextPath@/img/startup.gif"};
|
---|
17570 | AjxImgData["ImgFolderMask"]={t:-1731,l:0,w:16,h:14,f:"@AppContextPath@/img/startup.gif"};
|
---|
17571 | AjxImgData["ImgSharedContactsFolderMask"]={t:0,l:0,w:16,h:17,f:"@AppContextPath@/img/contacts.gif"};
|
---|
17572 | AjxImgData["ImgContactsFolderMask"]={t:-65,l:0,w:14,h:16,f:"@AppContextPath@/img/contacts.gif"};
|
---|
17573 | AjxImgData["ImgEmailedContactsMask"]={t:-113,l:0,w:16,h:16,f:"@AppContextPath@/img/contacts.gif"};
|
---|
17574 | AjxImgData["ImgNotebookMask"]={t:-80,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
|
---|
17575 | AjxImgData["ImgSectionMask"]={t:-128,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
|
---|
17576 | AjxImgData["ImgSharedNotebookMask"]={t:-160,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
|
---|
17577 | AjxImgData["ImgSharedSectionMask"]={t:-208,l:0,w:16,h:16,f:"@AppContextPath@/img/notes.gif"};
|
---|
17578 | AjxImgData["ImgCalendarFolderMask"]={t:-96,l:0,w:16,h:16,f:"@AppContextPath@/img/calendar.gif"};
|
---|
17579 | AjxImgData["ImgSharedCalendarFolderMask"]={t:-413,l:0,w:15,h:15,f:"@AppContextPath@/img/calendar.gif"};
|
---|
17580 | if (!window.AjxImgData) AjxImgData = {};
|
---|
17581 |
|
---|
17582 | document.write("<DIV style='display:none'>");
|
---|
17583 | for (var id in AjxImgData) {
|
---|
17584 | var data = AjxImgData[id];
|
---|
17585 | if (data.f) data.f = data.f.replace(/@AppContextPath@/,appContextPath);
|
---|
17586 | document.write("<IMG id='",id,"' src='",data.d||data.f,"'>");
|
---|
17587 | }
|
---|
17588 | document.write("</DIV>");
|
---|
17589 | </script><div style="display:none"><img id="ImgCalendarFolderOverlay" src="/zimbra/img/overlays/ImgCalendarFolderOverlay.png"><img id="ImgContactsFolderOverlay" src="/zimbra/img/overlays/ImgContactsFolderOverlay.png"><img id="ImgEmailedContactsOverlay" src="/zimbra/img/overlays/ImgEmailedContactsOverlay.png"><img id="ImgFolderOverlay" src="/zimbra/img/overlays/ImgFolderOverlay.png"><img id="ImgInboxOverlay" src="/zimbra/img/overlays/ImgInboxOverlay.png"><img id="ImgMailFolderOverlay" src="/zimbra/img/overlays/ImgMailFolderOverlay.png"><img id="ImgNotebookOverlay" src="/zimbra/img/overlays/ImgNotebookOverlay.png"><img id="ImgRSSOverlay" src="/zimbra/img/overlays/ImgRSSOverlay.png"><img id="ImgSectionOverlay" src="/zimbra/img/overlays/ImgSectionOverlay.png"><img id="ImgSentFolderOverlay" src="/zimbra/img/overlays/ImgSentFolderOverlay.png"><img id="ImgSharedCalendarFolderOverlay" src="/zimbra/img/overlays/ImgSharedCalendarFolderOverlay.png"><img id="ImgSharedContactsFolderOverlay" src="/zimbra/img/overlays/ImgSharedContactsFolderOverlay.png"><img id="ImgSharedMailFolderOverlay" src="/zimbra/img/overlays/ImgSharedMailFolderOverlay.png"><img id="ImgSharedNotebookOverlay" src="/zimbra/img/overlays/ImgSharedNotebookOverlay.png"><img id="ImgSharedSectionOverlay" src="/zimbra/img/overlays/ImgSharedSectionOverlay.png"><img id="ImgSharedTaskListOverlay" src="/zimbra/img/overlays/ImgSharedTaskListOverlay.png"><img id="ImgTagOverlay" src="/zimbra/img/overlays/ImgTagOverlay.png"><img id="ImgTaskListOverlay" src="/zimbra/img/overlays/ImgTaskListOverlay.png"><img id="ImgMailFolderMask" src="/zimbra/img/mail.gif"><img id="ImgRSSMask" src="/zimbra/img/mail.gif"><img id="ImgSharedTaskListMask" src="/zimbra/img/tasks.gif"><img id="ImgTaskListMask" src="/zimbra/img/tasks.gif"><img id="ImgSentFolderMask" src="/zimbra/img/startup.gif"><img id="ImgSharedMailFolderMask" src="/zimbra/img/startup.gif"><img id="ImgInboxMask" src="/zimbra/img/startup.gif"><img id="ImgTagMask" src="/zimbra/img/startup.gif"><img id="ImgFolderMask" src="/zimbra/img/startup.gif"><img id="ImgSharedContactsFolderMask" src="/zimbra/img/contacts.gif"><img id="ImgContactsFolderMask" src="/zimbra/img/contacts.gif"><img id="ImgEmailedContactsMask" src="/zimbra/img/contacts.gif"><img id="ImgNotebookMask" src="/zimbra/img/notes.gif"><img id="ImgSectionMask" src="/zimbra/img/notes.gif"><img id="ImgSharedNotebookMask" src="/zimbra/img/notes.gif"><img id="ImgSharedSectionMask" src="/zimbra/img/notes.gif"><img id="ImgCalendarFolderMask" src="/zimbra/img/calendar.gif"><img id="ImgSharedCalendarFolderMask" src="/zimbra/img/calendar.gif"></div>
|
---|
17590 |
|
---|
17591 | <!--
|
---|
17592 | --
|
---|
17593 | --
|
---|
17594 | --
|
---|
17595 | BEGIN SKIN
|
---|
17596 | --
|
---|
17597 | --
|
---|
17598 | --
|
---|
17599 | -->
|
---|
17600 |
|
---|
17601 | <!--
|
---|
17602 | - #define NAVIGATOR_COMPATIBLE true
|
---|
17603 | - #define SAFARI_3 true
|
---|
17604 | - #define SAFARI true
|
---|
17605 | - #define WEBKIT true
|
---|
17606 | - #define CHROME true
|
---|
17607 | - #define SAFARI_2_OR_HIGHER true
|
---|
17608 | -->
|
---|
17609 |
|
---|
17610 | <!--
|
---|
17611 | - File: zimbra/skins/velodrome2/skin.html
|
---|
17612 | -->
|
---|
17613 |
|
---|
17614 | <!-- BEGIN SKIN HTML -->
|
---|
17615 | <script type="text/javascript">
|
---|
17616 | document.title=ZmMsg.zimbraTitle;
|
---|
17617 | </script>
|
---|
17618 |
|
---|
17619 | <!-- END SKIN HTML -->
|
---|
17620 |
|
---|
17621 | <!-- BEGIN SPLASH SCREEN -->
|
---|
17622 | <div id="skin_container_splash_screen" class="skin_container_splash_screen" align="center">
|
---|
17623 | <script language="javascript">
|
---|
17624 | function showCompanyUrl() {
|
---|
17625 | window.open('<fmt:message key="splashScreenCompanyURL/>', '_blank');
|
---|
17626 | }
|
---|
17627 | </script>
|
---|
17628 | <!-- xr-feat-163 -->
|
---|
17629 | <div id="skin_container_splash_logo" class="skin_container_splash_logo"></div>
|
---|
17630 | <div class="skin_container_splash_loading"></div>
|
---|
17631 | <div class="skin_container_splash_footer">
|
---|
17632 | <div class="skin_container_splash_footer_logo"></div>
|
---|
17633 | <p>Copyright © Comcast Interactive Media 2011. All rights reserved.</p>
|
---|
17634 | </div>
|
---|
17635 | <!-- End xr-feat-163 -->
|
---|
17636 | </div>
|
---|
17637 | <!-- END SPLASH SCREEN -->
|
---|
17638 |
|
---|
17639 |
|
---|
17640 | <!--
|
---|
17641 | --
|
---|
17642 | --
|
---|
17643 | --
|
---|
17644 | END SKIN
|
---|
17645 | --
|
---|
17646 | --
|
---|
17647 | --
|
---|
17648 | -->
|
---|
17649 | <div style="display:none;">
|
---|
17650 |
|
---|
17651 | <!-- bootstrap classes -->
|
---|
17652 |
|
---|
17653 | <script type="text/javascript">
|
---|
17654 | AjxEnv=function(){};
|
---|
17655 | AjxEnv.DEFAULT_LOCALE=window.navigator.userLanguage||window.navigator.language||window.navigator.systemLanguage;
|
---|
17656 | AjxEnv._inited=false;
|
---|
17657 | AjxEnv.geckoDate;
|
---|
17658 | AjxEnv.mozVersion;
|
---|
17659 | AjxEnv.webKitVersion;
|
---|
17660 | AjxEnv.isMac;
|
---|
17661 | AjxEnv.isWindows;
|
---|
17662 | AjxEnv.isLinux;
|
---|
17663 | AjxEnv.isNav;
|
---|
17664 | AjxEnv.isIE;
|
---|
17665 | AjxEnv.isNav4;
|
---|
17666 | AjxEnv.trueNs;
|
---|
17667 | AjxEnv.isNav6;
|
---|
17668 | AjxEnv.isNav6up;
|
---|
17669 | AjxEnv.isNav7;
|
---|
17670 | AjxEnv.isIE3;
|
---|
17671 | AjxEnv.isIE4;
|
---|
17672 | AjxEnv.isIE4up;
|
---|
17673 | AjxEnv.isIE5;
|
---|
17674 | AjxEnv.isIE5_5;
|
---|
17675 | AjxEnv.isIE5up;
|
---|
17676 | AjxEnv.isIE5_5up;
|
---|
17677 | AjxEnv.isIE6;
|
---|
17678 | AjxEnv.isIE6up;
|
---|
17679 | AjxEnv.isIE7;
|
---|
17680 | AjxEnv.isIE7up;
|
---|
17681 | AjxEnv.isIE8;
|
---|
17682 | AjxEnv.isIE8up;
|
---|
17683 | AjxEnv.isNormalResolution;
|
---|
17684 | AjxEnv.ieScaleFactor;
|
---|
17685 | AjxEnv.isFirefox;
|
---|
17686 | AjxEnv.isFirefox1up;
|
---|
17687 | AjxEnv.isFirefox1_5up;
|
---|
17688 | AjxEnv.isFirefox3up;
|
---|
17689 | AjxEnv.isFirefox3_6up;
|
---|
17690 | AjxEnv.isMozilla;
|
---|
17691 | AjxEnv.isMozilla1_4up;
|
---|
17692 | AjxEnv.isSafari;
|
---|
17693 | AjxEnv.isSafari2;
|
---|
17694 | AjxEnv.isSafari3;
|
---|
17695 | AjxEnv.isSafari3up;
|
---|
17696 | AjxEnv.isSafari4;
|
---|
17697 | AjxEnv.isSafari4up;
|
---|
17698 | AjxEnv.isSafari5up;
|
---|
17699 | AjxEnv.isCamino;
|
---|
17700 | AjxEnv.isChrome;
|
---|
17701 | AjxEnv.isGeckoBased;
|
---|
17702 | AjxEnv.isWebKitBased;
|
---|
17703 | AjxEnv.isOpera;
|
---|
17704 | AjxEnv.useTransparentPNGs;
|
---|
17705 | AjxEnv.isDesktop;
|
---|
17706 | AjxEnv.isDesktop2up;
|
---|
17707 | AjxEnv.is800x600orLower;
|
---|
17708 | AjxEnv.is1024x768orLower;
|
---|
17709 | AjxEnv.reset=function(){
|
---|
17710 | AjxEnv.geckoDate=0;
|
---|
17711 | AjxEnv.mozVersion=-1;
|
---|
17712 | AjxEnv.webKitVersion=-1;
|
---|
17713 | AjxEnv.isMac=false;
|
---|
17714 | AjxEnv.isWindows=false;
|
---|
17715 | AjxEnv.isLinux=false;
|
---|
17716 | AjxEnv.isNav=false;
|
---|
17717 | AjxEnv.isIE=false;
|
---|
17718 | AjxEnv.isNav4=false;
|
---|
17719 | AjxEnv.trueNs=true;
|
---|
17720 | AjxEnv.isNav6=false;
|
---|
17721 | AjxEnv.isNav6up=false;
|
---|
17722 | AjxEnv.isNav7=false;
|
---|
17723 | AjxEnv.isIE3=false;
|
---|
17724 | AjxEnv.isIE4=false;
|
---|
17725 | AjxEnv.isIE4up=false;
|
---|
17726 | AjxEnv.isIE5=false;
|
---|
17727 | AjxEnv.isIE5_5=false;
|
---|
17728 | AjxEnv.isIE5up=false;
|
---|
17729 | AjxEnv.isIE5_5up=false;
|
---|
17730 | AjxEnv.isIE6=false;
|
---|
17731 | AjxEnv.isIE6up=false;
|
---|
17732 | AjxEnv.isIE7=false;
|
---|
17733 | AjxEnv.isIE7up=false;
|
---|
17734 | AjxEnv.isIE8=false;
|
---|
17735 | AjxEnv.isIE8up=false;
|
---|
17736 | AjxEnv.isNormalResolution=false;
|
---|
17737 | AjxEnv.ieScaleFactor=1;
|
---|
17738 | AjxEnv.isFirefox=false;
|
---|
17739 | AjxEnv.isFirefox1up=false;
|
---|
17740 | AjxEnv.isFirefox1_5up=false;
|
---|
17741 | AjxEnv.isFirefox3up=false;
|
---|
17742 | AjxEnv.isFirefox3_6up=false;
|
---|
17743 | AjxEnv.isMozilla=false;
|
---|
17744 | AjxEnv.isMozilla1_4up=false;
|
---|
17745 | AjxEnv.isSafari=false;
|
---|
17746 | AjxEnv.isSafari2=false;
|
---|
17747 | AjxEnv.isSafari3=false;
|
---|
17748 | AjxEnv.isSafari4=false;
|
---|
17749 | AjxEnv.isSafari3up=false;
|
---|
17750 | AjxEnv.isSafari4up=false;
|
---|
17751 | AjxEnv.isSafari5up=false;
|
---|
17752 | AjxEnv.isCamino=false;
|
---|
17753 | AjxEnv.isChrome=false;
|
---|
17754 | AjxEnv.isGeckoBased=false;
|
---|
17755 | AjxEnv.isWebKitBased=false;
|
---|
17756 | AjxEnv.isOpera=false;
|
---|
17757 | AjxEnv.useTransparentPNGs=false;
|
---|
17758 | AjxEnv.isDesktop=false;
|
---|
17759 | AjxEnv.isDesktop2up=false;
|
---|
17760 | AjxEnv.is800x600orLower=screen&&(screen.width<=800&&screen.height<=600);
|
---|
17761 | AjxEnv.is1024x768orLower=screen&&(screen.width<=1024&&screen.height<=768)
|
---|
17762 | };
|
---|
17763 | AjxEnv.parseUA=function(){
|
---|
17764 | AjxEnv.reset();
|
---|
17765 | var n=navigator.userAgent.toLowerCase();
|
---|
17766 | var t=n.split(" ");
|
---|
17767 | var c=false;
|
---|
17768 | var o=false;
|
---|
17769 | var r=false;
|
---|
17770 | var e=false;
|
---|
17771 | var a=false;
|
---|
17772 | if(t!=null){
|
---|
17773 | var u;
|
---|
17774 | var l=-1;
|
---|
17775 | if((l=t[0].search(/^\s*mozilla\//))!=-1){
|
---|
17776 | e=true;
|
---|
17777 | AjxEnv.browserVersion=parseFloat(t[0].substring(l+8));
|
---|
17778 | AjxEnv.isNav=true
|
---|
17779 | }
|
---|
17780 | var s;
|
---|
17781 | for(var h=0;
|
---|
17782 | h<t.length;
|
---|
17783 | ++h){
|
---|
17784 | s=t[h];
|
---|
17785 | if(s.indexOf("compatible")!=-1){
|
---|
17786 | a=true;
|
---|
17787 | AjxEnv.isNav=false
|
---|
17788 | }else{
|
---|
17789 | if((s.indexOf("opera"))!=-1){
|
---|
17790 | AjxEnv.isOpera=true;
|
---|
17791 | AjxEnv.isNav=false;
|
---|
17792 | u=parseFloat(t[h+1])
|
---|
17793 | }else{
|
---|
17794 | if((s.indexOf("spoofer"))!=-1){
|
---|
17795 | c=true;
|
---|
17796 | AjxEnv.isNav=false
|
---|
17797 | }else{
|
---|
17798 | if((s.indexOf("webtv"))!=-1){
|
---|
17799 | o=true;
|
---|
17800 | AjxEnv.isNav=false
|
---|
17801 | }else{
|
---|
17802 | if((s.indexOf("hotjava"))!=-1){
|
---|
17803 | r=true;
|
---|
17804 | AjxEnv.isNav=false
|
---|
17805 | }else{
|
---|
17806 | if((l=s.indexOf("msie"))!=-1){
|
---|
17807 | AjxEnv.isIE=true;
|
---|
17808 | u=parseFloat(t[h+1])
|
---|
17809 | }else{
|
---|
17810 | if((l=s.indexOf("gecko/"))!=-1){
|
---|
17811 | AjxEnv.isGeckoBased=true;
|
---|
17812 | AjxEnv.geckoDate=parseFloat(s.substr(l+6))
|
---|
17813 | }else{
|
---|
17814 | if((l=s.indexOf("applewebkit/"))!=-1){
|
---|
17815 | AjxEnv.isWebKitBased=true;
|
---|
17816 | AjxEnv.webKitVersion=parseFloat(s.substr(l+12))
|
---|
17817 | }else{
|
---|
17818 | if((l=s.indexOf("rv:"))!=-1){
|
---|
17819 | AjxEnv.mozVersion=parseFloat(s.substr(l+3));
|
---|
17820 | u=AjxEnv.mozVersion
|
---|
17821 | }else{
|
---|
17822 | if((l=s.indexOf("firefox/"))!=-1){
|
---|
17823 | AjxEnv.isFirefox=true;
|
---|
17824 | u=parseFloat(s.substr(l+8))
|
---|
17825 | }else{
|
---|
17826 | if((l=s.indexOf("prism"))!=-1){
|
---|
17827 | AjxEnv.isPrism=true
|
---|
17828 | }else{
|
---|
17829 | if((l=s.indexOf("camino/"))!=-1){
|
---|
17830 | AjxEnv.isCamino=true;
|
---|
17831 | u=parseFloat(s.substr(l+7))
|
---|
17832 | }else{
|
---|
17833 | if((l=s.indexOf("netscape6/"))!=-1){
|
---|
17834 | AjxEnv.trueNs=true;
|
---|
17835 | u=parseFloat(s.substr(l+10))
|
---|
17836 | }else{
|
---|
17837 | if((l=s.indexOf("netscape/"))!=-1){
|
---|
17838 | AjxEnv.trueNs=true;
|
---|
17839 | u=parseFloat(s.substr(l+9))
|
---|
17840 | }else{
|
---|
17841 | if((l=s.indexOf("safari/"))!=-1){
|
---|
17842 | AjxEnv.isSafari=true
|
---|
17843 | }else{
|
---|
17844 | if((l=s.indexOf("chrome/"))!=-1){
|
---|
17845 | AjxEnv.isChrome=true;
|
---|
17846 | u=parseFloat(s.substr(l+7))
|
---|
17847 | }else{
|
---|
17848 | if(l=s.indexOf("version/")!=-1){
|
---|
17849 | u=parseFloat(s.substr(l+7))
|
---|
17850 | }else{
|
---|
17851 | if(s.indexOf("windows")!=-1){
|
---|
17852 | AjxEnv.isWindows=true
|
---|
17853 | }else{
|
---|
17854 | if((s.indexOf("macintosh")!=-1)||(s.indexOf("mac_")!=-1)){
|
---|
17855 | AjxEnv.isMac=true
|
---|
17856 | }else{
|
---|
17857 | if(s.indexOf("linux")!=-1){
|
---|
17858 | AjxEnv.isLinux=true
|
---|
17859 | }else{
|
---|
17860 | if((l=s.indexOf("zdesktop/"))!=-1){
|
---|
17861 | AjxEnv.isDesktop=true;
|
---|
17862 | u=parseFloat(s.substr(l+9))
|
---|
17863 | }}}}}}}}}}}}}}}}}}}}}}
|
---|
17864 | AjxEnv.browserVersion=u;
|
---|
17865 | AjxEnv.isNav=(e&&!c&&!a&&!AjxEnv.isOpera&&!o&&!r&&!AjxEnv.isSafari);
|
---|
17866 | AjxEnv.isIE=(AjxEnv.isIE&&!AjxEnv.isOpera);
|
---|
17867 | AjxEnv.isNav4=(AjxEnv.isNav&&(u==4)&&(!AjxEnv.isIE));
|
---|
17868 | AjxEnv.isNav6=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=6&&u<7));
|
---|
17869 | AjxEnv.isNav6up=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=6));
|
---|
17870 | AjxEnv.isNav7=(AjxEnv.isNav&&AjxEnv.trueNs&&(u>=7&&u<8));
|
---|
17871 | AjxEnv.isIE3=(AjxEnv.isIE&&u<4);
|
---|
17872 | AjxEnv.isIE4=(AjxEnv.isIE&&u>=4&&u<5);
|
---|
17873 | AjxEnv.isIE4up=(AjxEnv.isIE&&u>=4);
|
---|
17874 | AjxEnv.isIE5=(AjxEnv.isIE&&u>=5&&u<6);
|
---|
17875 | AjxEnv.isIE5_5=(AjxEnv.isIE&&u==5.5);
|
---|
17876 | AjxEnv.isIE5up=(AjxEnv.isIE&&u>=5);
|
---|
17877 | AjxEnv.isIE5_5up=(AjxEnv.isIE&&u>=5.5);
|
---|
17878 | AjxEnv.isIE6=(AjxEnv.isIE&&u>=6&&u<7);
|
---|
17879 | AjxEnv.isIE6up=(AjxEnv.isIE&&u>=6);
|
---|
17880 | AjxEnv.isIE7=(AjxEnv.isIE&&u>=7&&u<8);
|
---|
17881 | AjxEnv.isIE7up=(AjxEnv.isIE&&u>=7);
|
---|
17882 | AjxEnv.isIE8=(AjxEnv.isIE&&u>=8&&u<9);
|
---|
17883 | AjxEnv.isIE8up=(AjxEnv.isIE&&u>=8);
|
---|
17884 | AjxEnv.isMozilla=((AjxEnv.isNav&&AjxEnv.mozVersion&&AjxEnv.isGeckoBased&&(AjxEnv.geckoDate!=0)));
|
---|
17885 | AjxEnv.isMozilla1_4up=(AjxEnv.isMozilla&&(AjxEnv.mozVersion>=1.4));
|
---|
17886 | AjxEnv.isFirefox=((AjxEnv.isMozilla&&AjxEnv.isFirefox));
|
---|
17887 | AjxEnv.isFirefox1up=(AjxEnv.isFirefox&&u>=1);
|
---|
17888 | AjxEnv.isFirefox1_5up=(AjxEnv.isFirefox&&u>=1.5);
|
---|
17889 | AjxEnv.isFirefox2_0up=(AjxEnv.isFirefox&&u>=2);
|
---|
17890 | AjxEnv.isFirefox3up=(AjxEnv.isFirefox&&u>=3);
|
---|
17891 | AjxEnv.isFirefox3_5up=(AjxEnv.isFirefox&&u>=3.5);
|
---|
17892 | AjxEnv.isFirefox3_6up=(AjxEnv.isFirefox&&u>=3.6);
|
---|
17893 | AjxEnv.isSafari2=(AjxEnv.isSafari&&u>=2&&u<3);
|
---|
17894 | AjxEnv.isSafari3=(AjxEnv.isSafari&&u>=3&&u<4)||AjxEnv.isChrome;
|
---|
17895 | AjxEnv.isSafari4=(AjxEnv.isSafari&&u>=4);
|
---|
17896 | AjxEnv.isSafari3up=(AjxEnv.isSafari&&u>=3)||AjxEnv.isChrome;
|
---|
17897 | AjxEnv.isSafari4up=(AjxEnv.isSafari&&u>=4)||AjxEnv.isChrome;
|
---|
17898 | AjxEnv.isSafari5up=(AjxEnv.isSafari&&u>=5)||AjxEnv.isChrome;
|
---|
17899 | AjxEnv.isDesktop2up=(AjxEnv.isDesktop&&u>=2);
|
---|
17900 | AjxEnv.isChrome7=(AjxEnv.isChrome&&u>=7);
|
---|
17901 | AjxEnv.browser="[unknown]";
|
---|
17902 | if(AjxEnv.isOpera){
|
---|
17903 | AjxEnv.browser="OPERA"
|
---|
17904 | }else{
|
---|
17905 | if(AjxEnv.isSafari3up){
|
---|
17906 | AjxEnv.browser="SAF3"
|
---|
17907 | }else{
|
---|
17908 | if(AjxEnv.isSafari){
|
---|
17909 | AjxEnv.browser="SAF"
|
---|
17910 | }else{
|
---|
17911 | if(AjxEnv.isCamino){
|
---|
17912 | AjxEnv.browser="CAM"
|
---|
17913 | }else{
|
---|
17914 | if(o){
|
---|
17915 | AjxEnv.browser="WEBTV"
|
---|
17916 | }else{
|
---|
17917 | if(r){
|
---|
17918 | AjxEnv.browser="HOTJAVA"
|
---|
17919 | }else{
|
---|
17920 | if(AjxEnv.isFirefox3up){
|
---|
17921 | AjxEnv.browser="FF3.0"
|
---|
17922 | }else{
|
---|
17923 | if(AjxEnv.isFirefox2_0up){
|
---|
17924 | AjxEnv.browser="FF2.0"
|
---|
17925 | }else{
|
---|
17926 | if(AjxEnv.isFirefox1_5up){
|
---|
17927 | AjxEnv.browser="FF1.5"
|
---|
17928 | }else{
|
---|
17929 | if(AjxEnv.isFirefox1up){
|
---|
17930 | AjxEnv.browser="FF1.0"
|
---|
17931 | }else{
|
---|
17932 | if(AjxEnv.isFirefox){
|
---|
17933 | AjxEnv.browser="FF"
|
---|
17934 | }else{
|
---|
17935 | if(AjxEnv.isPrism){
|
---|
17936 | AjxEnv.browser="PRISM"
|
---|
17937 | }else{
|
---|
17938 | if(AjxEnv.isNav7){
|
---|
17939 | AjxEnv.browser="NAV7"
|
---|
17940 | }else{
|
---|
17941 | if(AjxEnv.isNav6){
|
---|
17942 | AjxEnv.browser="NAV6"
|
---|
17943 | }else{
|
---|
17944 | if(AjxEnv.isNav4){
|
---|
17945 | AjxEnv.browser="NAV4"
|
---|
17946 | }else{
|
---|
17947 | if(AjxEnv.isIE8){
|
---|
17948 | AjxEnv.browser="IE8"
|
---|
17949 | }else{
|
---|
17950 | if(AjxEnv.isIE7){
|
---|
17951 | AjxEnv.browser="IE7"
|
---|
17952 | }else{
|
---|
17953 | if(AjxEnv.isIE6){
|
---|
17954 | AjxEnv.browser="IE6"
|
---|
17955 | }else{
|
---|
17956 | if(AjxEnv.isIE5){
|
---|
17957 | AjxEnv.browser="IE5"
|
---|
17958 | }else{
|
---|
17959 | if(AjxEnv.isIE4){
|
---|
17960 | AjxEnv.browser="IE4"
|
---|
17961 | }else{
|
---|
17962 | if(AjxEnv.isIE3){
|
---|
17963 | AjxEnv.browser="IE"
|
---|
17964 | }else{
|
---|
17965 | if(AjxEnv.isDesktop){
|
---|
17966 | AjxEnv.browser="ZDESKTOP"
|
---|
17967 | }}}}}}}}}}}}}}}}}}}}}}
|
---|
17968 | AjxEnv.platform="[unknown]";
|
---|
17969 | if(AjxEnv.isWindows){
|
---|
17970 | AjxEnv.platform="Win"
|
---|
17971 | }else{
|
---|
17972 | if(AjxEnv.isMac){
|
---|
17973 | AjxEnv.platform="Mac"
|
---|
17974 | }else{
|
---|
17975 | if(AjxEnv.isLinux){
|
---|
17976 | AjxEnv.platform="Linux"
|
---|
17977 | }}}}
|
---|
17978 | if(AjxEnv.isIE){
|
---|
17979 | AjxEnv.isNormalResolution=true;
|
---|
17980 | AjxEnv.ieScaleFactor=screen.deviceXDPI/screen.logicalXDPI;
|
---|
17981 | if(AjxEnv.ieScaleFactor>1){
|
---|
17982 | AjxEnv.isNormalResolution=false
|
---|
17983 | }}
|
---|
17984 | AjxEnv.useTransparentPNGs=!AjxEnv.isIE&&!AjxEnv.isLinux&&!AjxEnv.isSafari;
|
---|
17985 | AjxEnv._inited=!AjxEnv.isIE;
|
---|
17986 | if(AjxEnv.isSafari){
|
---|
17987 | var d=AjxEnv.getWebkitVersion();
|
---|
17988 | AjxEnv.isSafariNightly=(d&&d.is_nightly);
|
---|
17989 | AjxEnv.isSafari2=!AjxEnv.isSafari3&&!AjxEnv.isSafariNightly
|
---|
17990 | }};
|
---|
17991 | AjxEnv.getWebkitVersion=function(){
|
---|
17992 | var t;
|
---|
17993 | var o=new RegExp("\\(.*\\) AppleWebKit/(.*) \\((.*)");
|
---|
17994 | var s=o.exec(navigator.userAgent);
|
---|
17995 | if(s){
|
---|
17996 | var e=s[1];
|
---|
17997 | var n=e.split(".");
|
---|
17998 | var a=(e[e.length-1]=="+");
|
---|
17999 | var i=a?"+":parseInt(n[1]);
|
---|
18000 | if(isNaN(i)){
|
---|
18001 | i=""
|
---|
18002 | }
|
---|
18003 | t={
|
---|
18004 | major:parseInt(n[0]),minor:i,is_nightly:a}
|
---|
18005 | }
|
---|
18006 | return t||{}
|
---|
18007 | };
|
---|
18008 | AjxEnv.parseUA();
|
---|
18009 | AjxCallback=function(a,t,e){
|
---|
18010 | if(arguments.length==0){
|
---|
18011 | return
|
---|
18012 | }
|
---|
18013 | if(typeof arguments[0]=="function"){
|
---|
18014 | this.obj=null;
|
---|
18015 | this.func=arguments[0];
|
---|
18016 | this.args=arguments[1]
|
---|
18017 | }else{
|
---|
18018 | this.obj=a;
|
---|
18019 | this.func=t;
|
---|
18020 | this.args=e
|
---|
18021 | }};
|
---|
18022 | AjxCallback.prototype.toString=function(){
|
---|
18023 | return"AjxCallback"
|
---|
18024 | };
|
---|
18025 | AjxCallback.NOP=new AjxCallback(function(){}
|
---|
18026 | );
|
---|
18027 | AjxCallback.prototype.run=function(){
|
---|
18028 | var e=[];
|
---|
18029 | if(typeof this.args!="undefined"){
|
---|
18030 | if(this.args instanceof Array){
|
---|
18031 | e=arguments.length>0?e.concat(this.args):this.args
|
---|
18032 | }else{
|
---|
18033 | e.push(this.args)
|
---|
18034 | }}
|
---|
18035 | for(var t=0;
|
---|
18036 | t<arguments.length;
|
---|
18037 | ++t){
|
---|
18038 | e.push(arguments[t])
|
---|
18039 | }
|
---|
18040 | if(this.func){
|
---|
18041 | return this.func.apply(this.obj||window,e)
|
---|
18042 | }};
|
---|
18043 | AjxCallback.prototype.run1=function(t){
|
---|
18044 | var e=[];
|
---|
18045 | if(typeof this.args!="undefined"){
|
---|
18046 | if(this.args instanceof Array){
|
---|
18047 | e=arguments.length>0?e.concat(this.args):this.args
|
---|
18048 | }else{
|
---|
18049 | e.push(this.args)
|
---|
18050 | }}
|
---|
18051 | if(t&&t.length){
|
---|
18052 | for(var a=0;
|
---|
18053 | a<t.length;
|
---|
18054 | ++a){
|
---|
18055 | e.push(t[a])
|
---|
18056 | }}
|
---|
18057 | if(this.func){
|
---|
18058 | return this.func.apply(this.obj||window,e)
|
---|
18059 | }};
|
---|
18060 | AjxCallback.simpleClosure=function(a,o){
|
---|
18061 | var e=[];
|
---|
18062 | for(var t=2;
|
---|
18063 | t<arguments.length;
|
---|
18064 | ++t){
|
---|
18065 | e.push(arguments[t])
|
---|
18066 | }
|
---|
18067 | return function(){
|
---|
18068 | var s=[];
|
---|
18069 | for(var n=0;
|
---|
18070 | n<arguments.length;
|
---|
18071 | ++n){
|
---|
18072 | s.push(arguments[n])
|
---|
18073 | }
|
---|
18074 | return a.apply(o||this,e.concat(s))
|
---|
18075 | }
|
---|
18076 | };
|
---|
18077 | AjxCallback.returnFalse=function(){
|
---|
18078 | return false
|
---|
18079 | };
|
---|
18080 | AjxCallback.isNull=function(e){
|
---|
18081 | return e==null
|
---|
18082 | };
|
---|
18083 | AjxLoader=function(){};
|
---|
18084 | AjxLoader.__createXHR;
|
---|
18085 | if(window.XMLHttpRequest){
|
---|
18086 | AjxLoader.__createXHR=function(){
|
---|
18087 | return new XMLHttpRequest()
|
---|
18088 | }
|
---|
18089 | }else{
|
---|
18090 | if(window.ActiveXObject){
|
---|
18091 | (function(){
|
---|
18092 | var t=["MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
|
---|
18093 | for(var a=0;
|
---|
18094 | a<t.length;
|
---|
18095 | a++){
|
---|
18096 | try{
|
---|
18097 | new ActiveXObject(t[a]);
|
---|
18098 | AjxLoader.__createXHR=function(){
|
---|
18099 | return new ActiveXObject(t[a])
|
---|
18100 | };
|
---|
18101 | break
|
---|
18102 | }
|
---|
18103 | catch(o){}}}
|
---|
18104 | )()
|
---|
18105 | }}
|
---|
18106 | AjxLoader.load=function(a){
|
---|
18107 | var n=a;
|
---|
18108 | if(typeof a=="string"){
|
---|
18109 | n={
|
---|
18110 | url:a}
|
---|
18111 | }
|
---|
18112 | var o=AjxLoader.__createXHR();
|
---|
18113 | var i=Boolean(n.callback)?function(){
|
---|
18114 | AjxLoader._response(o,n.callback)
|
---|
18115 | }
|
---|
18116 | :null;
|
---|
18117 | var s=n.method||(n.content!=null?"POST":"GET");
|
---|
18118 | if(i){
|
---|
18119 | o.onreadystatechange=i
|
---|
18120 | }
|
---|
18121 | var t=n.async!=null?n.async:Boolean(i);
|
---|
18122 | o.open(s,n.url,t,n.userName,n.password);
|
---|
18123 | for(var e in n.headers){
|
---|
18124 | o.setRequestHeader(e,n.headers[e])
|
---|
18125 | }
|
---|
18126 | o.send(n.content||"");
|
---|
18127 | return o
|
---|
18128 | };
|
---|
18129 | AjxLoader._response=function(e,t){
|
---|
18130 | if(e.readyState==4){
|
---|
18131 | t.run(e)
|
---|
18132 | }};
|
---|
18133 | AjxPackage=function(){};
|
---|
18134 | AjxPackage.METHOD_XHR_SYNC="xhr-sync";
|
---|
18135 | AjxPackage.METHOD_XHR_ASYNC="xhr-async";
|
---|
18136 | AjxPackage.METHOD_SCRIPT_TAG="script-tag";
|
---|
18137 | AjxPackage.DEFAULT_SYNC=AjxPackage.METHOD_XHR_SYNC;
|
---|
18138 | AjxPackage.DEFAULT_ASYNC=AjxEnv.isIE?AjxPackage.METHOD_XHR_ASYNC:AjxPackage.METHOD_SCRIPT_TAG;
|
---|
18139 | AjxPackage._packages={};
|
---|
18140 | AjxPackage._extension=".js";
|
---|
18141 | AjxPackage.__depth=0;
|
---|
18142 | AjxPackage.__scripts=[];
|
---|
18143 | AjxPackage.__data={};
|
---|
18144 | AjxPackage.setBasePath=function(e){
|
---|
18145 | AjxPackage._basePath=e
|
---|
18146 | };
|
---|
18147 | AjxPackage.setExtension=function(e){
|
---|
18148 | AjxPackage._extension=e
|
---|
18149 | };
|
---|
18150 | AjxPackage.setQueryString=function(e){
|
---|
18151 | AjxPackage._queryString=e
|
---|
18152 | };
|
---|
18153 | AjxPackage.isDefined=function(e){
|
---|
18154 | return Boolean(AjxPackage._packages[e])
|
---|
18155 | };
|
---|
18156 | AjxPackage.define=function(e){
|
---|
18157 | AjxPackage.__log("DEFINE "+e,"font-weight:bold;font-style:italic");
|
---|
18158 | e=AjxPackage.__package2path(e);
|
---|
18159 | if(!AjxPackage._packages[e]){
|
---|
18160 | AjxPackage._packages[e]=true;
|
---|
18161 | return true
|
---|
18162 | }
|
---|
18163 | return false
|
---|
18164 | };
|
---|
18165 | AjxPackage.undefine=function(e){
|
---|
18166 | AjxPackage.__log("UNDEFINE "+e,"font-weight:bold;font-style:italic");
|
---|
18167 | e=AjxPackage.__package2path(e);
|
---|
18168 | if(AjxPackage._packages[e]){
|
---|
18169 | delete AjxPackage._packages[e]
|
---|
18170 | }};
|
---|
18171 | AjxPackage.require=function(a){
|
---|
18172 | var b=a;
|
---|
18173 | if(typeof a=="string"){
|
---|
18174 | b={
|
---|
18175 | name:a}
|
---|
18176 | }
|
---|
18177 | var s=b.name;
|
---|
18178 | if(s instanceof Array){
|
---|
18179 | if(!s.internal){
|
---|
18180 | s=[].concat(s);
|
---|
18181 | s.internal=true;
|
---|
18182 | b.name=s
|
---|
18183 | }
|
---|
18184 | var x=s.shift();
|
---|
18185 | if(s.length>0){
|
---|
18186 | var o=new Function();
|
---|
18187 | o.prototype=b;
|
---|
18188 | o.prototype.constructor=o;
|
---|
18189 | var n=new o();
|
---|
18190 | n.name=x;
|
---|
18191 | n.callback=new AjxCallback(null,AjxPackage.__requireNext,b);
|
---|
18192 | AjxPackage.require(n);
|
---|
18193 | return
|
---|
18194 | }
|
---|
18195 | b.name=x
|
---|
18196 | }
|
---|
18197 | var c=b.name;
|
---|
18198 | var x=AjxPackage.__package2path(c);
|
---|
18199 | var i=b.callback;
|
---|
18200 | if(typeof i=="function"){
|
---|
18201 | i=new AjxCallback(i)
|
---|
18202 | }
|
---|
18203 | var f=i?" (callback)":"";
|
---|
18204 | var y=AjxPackage._packages[x]?" LOADED":"";
|
---|
18205 | var d=AjxPackage.__scripts.length?" (async, queueing...)":"";
|
---|
18206 | AjxPackage.__log(['REQUIRE "',c,'"',f,y,d].join(""));
|
---|
18207 | var g=b.forceReload!=null?b.forceReload:false;
|
---|
18208 | if(AjxPackage._packages[x]&&!g){
|
---|
18209 | if(i){
|
---|
18210 | i.run()
|
---|
18211 | }
|
---|
18212 | return
|
---|
18213 | }
|
---|
18214 | var w=b.basePath||AjxPackage._basePath||window.contextPath;
|
---|
18215 | var h=b.extension||AjxPackage._extension;
|
---|
18216 | var t=b.queryString||AjxPackage._queryString;
|
---|
18217 | var k=[w,"/",x,h];
|
---|
18218 | if(t){
|
---|
18219 | k.push("?",t)
|
---|
18220 | }
|
---|
18221 | var m=k.join("");
|
---|
18222 | var e=b.method||(b.callback?AjxPackage.DEFAULT_ASYNC:AjxPackage.DEFAULT_SYNC);
|
---|
18223 | var l=e==AjxPackage.METHOD_XHR_SYNC||b.forceSync;
|
---|
18224 | var r=!l;
|
---|
18225 | var v={
|
---|
18226 | name:x,path:m,method:e,async:r,callback:i||AjxCallback.NOP,scripts:r?[]:null};
|
---|
18227 | if(l||AjxPackage.__scripts.length==0){
|
---|
18228 | AjxPackage.__doLoad(v)
|
---|
18229 | }else{
|
---|
18230 | var p=AjxPackage.__scripts[AjxPackage.__scripts.length-1];
|
---|
18231 | v.method=p.method;
|
---|
18232 | v.async=p.async;
|
---|
18233 | v.scripts=[];
|
---|
18234 | if(i){
|
---|
18235 | var u=AjxPackage.__scripts[0];
|
---|
18236 | u.callback=new AjxCallback(AjxPackage.__chainCallbacks,[u.callback,i]);
|
---|
18237 | v.callback=AjxCallback.NOP
|
---|
18238 | }
|
---|
18239 | p.scripts.push(v)
|
---|
18240 | }};
|
---|
18241 | AjxPackage.eval=function(text){
|
---|
18242 | if(window.execScript){
|
---|
18243 | window.execScript(text)
|
---|
18244 | }else{
|
---|
18245 | if(AjxEnv.isGeckoBased){
|
---|
18246 | window.eval(text)
|
---|
18247 | }else{
|
---|
18248 | var e=document.createElement("SCRIPT");
|
---|
18249 | var t=document.createTextNode(text);
|
---|
18250 | e.appendChild(t);
|
---|
18251 | var heads=document.getElementsByTagName("HEAD");
|
---|
18252 | if(heads.length==0){
|
---|
18253 | heads=[document.createElement("HEAD")];
|
---|
18254 | document.documentElement.appendChild(heads[0])
|
---|
18255 | }
|
---|
18256 | heads[0].appendChild(e)
|
---|
18257 | }}};
|
---|
18258 | AjxPackage.__package2path=function(e){
|
---|
18259 | return e.replace(/\./g,"/").replace(/\*$/,"__all__")
|
---|
18260 | };
|
---|
18261 | AjxPackage.__requireNext=function(t){
|
---|
18262 | var e=AjxCallback.simpleClosure(AjxPackage.require,null,t);
|
---|
18263 | setTimeout(e,AjxEnv.isIE?10:0)
|
---|
18264 | };
|
---|
18265 | AjxPackage.__doLoad=function(e){
|
---|
18266 | if(e.async){
|
---|
18267 | AjxPackage.__doAsyncLoad(e)
|
---|
18268 | }else{
|
---|
18269 | AjxPackage.__doXHR(e)
|
---|
18270 | }};
|
---|
18271 | AjxPackage.__doAsyncLoad=function(t,e){
|
---|
18272 | AjxPackage.__data[name]=t;
|
---|
18273 | if(e||AjxPackage.__scripts.length==0){
|
---|
18274 | AjxPackage.__scripts.push(t);
|
---|
18275 | if(t.method==AjxPackage.METHOD_SCRIPT_TAG){
|
---|
18276 | AjxPackage.__doScriptTag(t)
|
---|
18277 | }else{
|
---|
18278 | AjxPackage.__doXHR(t)
|
---|
18279 | }}else{
|
---|
18280 | var a=AjxPackage.__scripts[AjxPackage.__scripts.length-1];
|
---|
18281 | a.scripts.push(t)
|
---|
18282 | }};
|
---|
18283 | AjxPackage.__doScriptTag=function(i){
|
---|
18284 | var e=document.createElement("SCRIPT");
|
---|
18285 | e.type="text/javascript";
|
---|
18286 | e.src=i.path;
|
---|
18287 | if(AjxEnv.isIE){
|
---|
18288 | var t=AjxCallback.simpleClosure(AjxPackage.__onAsyncLoadIE,null,e);
|
---|
18289 | e.attachEvent("onreadystatechange",t)
|
---|
18290 | }else{
|
---|
18291 | var t=AjxCallback.simpleClosure(AjxPackage.__onAsyncLoad,null,i.name);
|
---|
18292 | e.addEventListener("load",t,true)
|
---|
18293 | }
|
---|
18294 | var a=document.getElementsByTagName("HEAD");
|
---|
18295 | if(!a||a.length==0){
|
---|
18296 | a=[document.createElement("HEAD")];
|
---|
18297 | document.documentElement.appendChild(a[0])
|
---|
18298 | }
|
---|
18299 | a[0].appendChild(e)
|
---|
18300 | };
|
---|
18301 | AjxPackage.__doXHR=function(a){
|
---|
18302 | var i=a.async?new AjxCallback(null,AjxPackage.__onXHR,[a]):null;
|
---|
18303 | var e={
|
---|
18304 | url:a.path,userName:a.userName,password:a.password,async:a.async,callback:i};
|
---|
18305 | var t=AjxLoader.load(e);
|
---|
18306 | if(!a.async){
|
---|
18307 | AjxPackage.__onXHR(a,t)
|
---|
18308 | }};
|
---|
18309 | AjxPackage.__onXHR=function(t,e){
|
---|
18310 | if(e.status==200||e.status==0){
|
---|
18311 | AjxPackage.__requireEval(e.responseText||"")
|
---|
18312 | }else{
|
---|
18313 | AjxPackage.__log("error: "+e.status,"background-color:red")
|
---|
18314 | }
|
---|
18315 | if(t.async){
|
---|
18316 | AjxPackage.__onAsyncLoad()
|
---|
18317 | }else{
|
---|
18318 | AjxPackage.__onLoad(t)
|
---|
18319 | }};
|
---|
18320 | AjxPackage.__onAsyncLoadIE=function(e){
|
---|
18321 | if(e.readyState=="loaded"){
|
---|
18322 | AjxPackage.__onAsyncLoad()
|
---|
18323 | }};
|
---|
18324 | AjxPackage.__onAsyncLoad=function(){
|
---|
18325 | var e;
|
---|
18326 | while(e=AjxPackage.__scripts.pop()){
|
---|
18327 | if(e.scripts.length){
|
---|
18328 | AjxPackage.__scripts.push(e);
|
---|
18329 | e=e.scripts.shift();
|
---|
18330 | AjxPackage.__scripts.push(e);
|
---|
18331 | AjxPackage.__doAsyncLoad(e,true);
|
---|
18332 | return
|
---|
18333 | }
|
---|
18334 | AjxPackage.__onLoad(e)
|
---|
18335 | }};
|
---|
18336 | AjxPackage.__onLoad=function(t){
|
---|
18337 | AjxPackage.define(t.name);
|
---|
18338 | if(t.callback){
|
---|
18339 | try{
|
---|
18340 | t.callback.run()
|
---|
18341 | }
|
---|
18342 | catch(a){
|
---|
18343 | AjxPackage.__log("error on callback: "+a,"color:red")
|
---|
18344 | }}};
|
---|
18345 | AjxPackage.__requireEval=function(text){
|
---|
18346 | AjxPackage.__depth++;
|
---|
18347 | try{
|
---|
18348 | AjxPackage.eval(text)
|
---|
18349 | }
|
---|
18350 | catch(e){
|
---|
18351 | AjxPackage.__log("error on eval: "+e,"color:red")
|
---|
18352 | }
|
---|
18353 | AjxPackage.__depth--
|
---|
18354 | };
|
---|
18355 | AjxPackage.__log=function(t,e){};
|
---|
18356 | AjxPackage.__alertStack=function(r){
|
---|
18357 | var e=[];
|
---|
18358 | if(r){
|
---|
18359 | e.push(r,"\n\n")
|
---|
18360 | }
|
---|
18361 | for(var s=AjxPackage.__scripts.length-1;
|
---|
18362 | s>=0;
|
---|
18363 | s--){
|
---|
18364 | var t=AjxPackage.__scripts[s];
|
---|
18365 | e.push(t.name," (",Boolean(t.callback),")","\n");
|
---|
18366 | if(t.scripts){
|
---|
18367 | for(var n=0;
|
---|
18368 | n<t.scripts.length;
|
---|
18369 | n++){
|
---|
18370 | var o=t.scripts[n];
|
---|
18371 | e.push(" ",o.name," (",Boolean(o.callback),")","\n")
|
---|
18372 | }}}
|
---|
18373 | alert(e.join(""))
|
---|
18374 | };
|
---|
18375 | AjxPackage.__chainCallbacks=function(t,e){
|
---|
18376 | if(t){
|
---|
18377 | t.run()
|
---|
18378 | }
|
---|
18379 | if(e){
|
---|
18380 | e.run()
|
---|
18381 | }};
|
---|
18382 | AjxTemplate=function(){};
|
---|
18383 | AjxTemplate._templates={};
|
---|
18384 | AjxTemplate._stack=[];
|
---|
18385 | AjxTemplate.setBasePath=function(e){
|
---|
18386 | AjxTemplate._basePath=e
|
---|
18387 | };
|
---|
18388 | AjxTemplate.setExtension=function(e){
|
---|
18389 | AjxTemplate._extension=e
|
---|
18390 | };
|
---|
18391 | AjxTemplate.register=function(t,a,i,e){
|
---|
18392 | if(!e&&AjxTemplate._templates[t]&&AjxTemplate._templates[t].authoritative){
|
---|
18393 | return
|
---|
18394 | }
|
---|
18395 | AjxTemplate._templates[t]={
|
---|
18396 | name:t,func:a,params:i||{}
|
---|
18397 | ,authoritative:e}
|
---|
18398 | };
|
---|
18399 | AjxTemplate.getTemplate=function(e){
|
---|
18400 | var t=AjxTemplate._templates[e];
|
---|
18401 | return t&&t.func
|
---|
18402 | };
|
---|
18403 | AjxTemplate.getParams=function(e){
|
---|
18404 | var t=AjxTemplate._templates[e];
|
---|
18405 | return t&&t.params
|
---|
18406 | };
|
---|
18407 | AjxTemplate.expand=function(t,r,s){
|
---|
18408 | if(!AjxTemplate._templates[t]&&AjxTemplate.compile){
|
---|
18409 | var i=document.getElementById(t);
|
---|
18410 | if(i){
|
---|
18411 | var d=i.nodeName.toUpperCase()=="TEXTAREA";
|
---|
18412 | AjxTemplate.compile(t,true,true,d?i.value:i.innerHTML)
|
---|
18413 | }}
|
---|
18414 | var c=AjxTemplate.__name2Package(t);
|
---|
18415 | var a=t.replace(/^[^#]*#?/,"");
|
---|
18416 | if(a){
|
---|
18417 | t=[c,a].join("#")
|
---|
18418 | }
|
---|
18419 | AjxTemplate.require(c);
|
---|
18420 | var h=Boolean(s);
|
---|
18421 | s=s||[];
|
---|
18422 | var o=AjxTemplate.getTemplate(t);
|
---|
18423 | if(o){
|
---|
18424 | try{
|
---|
18425 | AjxTemplate._stack.push(c);
|
---|
18426 | var n=AjxTemplate.getParams(t);
|
---|
18427 | o(t,n,r,s)
|
---|
18428 | }
|
---|
18429 | catch(l){
|
---|
18430 | s.push(this.__formatError(t,l))
|
---|
18431 | }
|
---|
18432 | finally{
|
---|
18433 | AjxTemplate._stack.pop()
|
---|
18434 | }}else{
|
---|
18435 | s.push(this.__formatError(t,"template not found"))
|
---|
18436 | }
|
---|
18437 | return h?s.length:s.join("")
|
---|
18438 | };
|
---|
18439 | AjxTemplate.require=function(e){
|
---|
18440 | AjxPackage.require({
|
---|
18441 | name:AjxTemplate.__name2Package(e),basePath:AjxTemplate._basePath,extension:AjxTemplate._extension}
|
---|
18442 | );
|
---|
18443 | return AjxTemplate.getTemplate(e)!=null
|
---|
18444 | };
|
---|
18445 | AjxTemplate.setContent=function(a,e,i){
|
---|
18446 | if(typeof a=="string"){
|
---|
18447 | a=document.getElementById(a)
|
---|
18448 | }
|
---|
18449 | if(a==null){
|
---|
18450 | return
|
---|
18451 | }
|
---|
18452 | var t=AjxTemplate.expand(e,i);
|
---|
18453 | a.innerHTML=t
|
---|
18454 | };
|
---|
18455 | AjxTemplate.__name2Package=function(t){
|
---|
18456 | var e=t.replace(/#.*$/,"");
|
---|
18457 | if(t.match(/^#/)&&AjxTemplate._stack.length>0){
|
---|
18458 | e=AjxTemplate._stack[AjxTemplate._stack.length-1]
|
---|
18459 | }
|
---|
18460 | return e
|
---|
18461 | };
|
---|
18462 | AjxTemplate.__formatError=function(e,t){
|
---|
18463 | return"Error in template '"+e+"': "+t
|
---|
18464 | };
|
---|
18465 | AjxTemplate.compile=function(d,u,l,f){
|
---|
18466 | var e=AjxPackage.__package2path(d);
|
---|
18467 | var g=f!=null?f:AjxLoader.load(e).reponseText;
|
---|
18468 | var r=[],s=0,h=true;
|
---|
18469 | AjxTemplate.__RE_TEMPLATE.lastIndex=0;
|
---|
18470 | var o=AjxTemplate.__RE_TEMPLATE.exec(g);
|
---|
18471 | if(o){
|
---|
18472 | do{
|
---|
18473 | var p=AjxTemplate.__parseAttrs(o[1]);
|
---|
18474 | var c=o[2];
|
---|
18475 | if(p["xml:space"]!="preserve"){
|
---|
18476 | c=c.replace(AjxTemplate.__RE_GT_LINESEP_LT,"><").trim()
|
---|
18477 | }
|
---|
18478 | var n=d;
|
---|
18479 | var a=p.id;
|
---|
18480 | if(a&&(a.indexOf("#")!=-1||a.match(/^\//))){
|
---|
18481 | if(a.indexOf("#")==-1){
|
---|
18482 | a+="#"
|
---|
18483 | }
|
---|
18484 | n=a.replace(/#.*$/,"").replace(/^\//,"").replace(/\//g,".");
|
---|
18485 | a=a.replace(/^.*#/,"")
|
---|
18486 | }
|
---|
18487 | var t=a?n+"#"+a:n;
|
---|
18488 | var i=AjxTemplate.__convertLines(c);
|
---|
18489 | AjxTemplate.register(n,i,p,u);
|
---|
18490 | if(h&&l){
|
---|
18491 | AjxPackage.define(n)
|
---|
18492 | }
|
---|
18493 | if(h){
|
---|
18494 | h=false;
|
---|
18495 | AjxTemplate.register(n,i,p,u)
|
---|
18496 | }}
|
---|
18497 | while(o=AjxTemplate.__RE_TEMPLATE.exec(g))
|
---|
18498 | }else{
|
---|
18499 | if(l){
|
---|
18500 | AjxPackage.define(d)
|
---|
18501 | }
|
---|
18502 | var i=AjxTemplate.__convertLines(g);
|
---|
18503 | AjxTemplate.register(d,i,{}
|
---|
18504 | ,u)
|
---|
18505 | }};
|
---|
18506 | AjxTemplate.__RE_REPLACE=new RegExp(["\\$\\{(.+?)\\}","<\\$=(.+?)\\$>","<\\$(.+?)\\$>"].join("|"),"mg");
|
---|
18507 | AjxTemplate.__RE_TEMPLATE=new RegExp("<template(.*?)>(.*?)</template>","mg");
|
---|
18508 | AjxTemplate.__RE_ATTR=new RegExp("\\s*(\\S+)\\s*=\\s*('[^']*'|\"[^\"]*\")","mg");
|
---|
18509 | AjxTemplate.__RE_PARAM_PART=new RegExp("([^\\(\\.]+)(\\(.*?\\))?\\.?","g");
|
---|
18510 | AjxTemplate.__RE_GT_LINESEP_LT=new RegExp([">","\\s*\\n+\\s*","<"].join(""),"mg");
|
---|
18511 | AjxTemplate.__convertLines=function(a){
|
---|
18512 | var t=[],r=0;
|
---|
18513 | t[r++]="\tvar _hasBuffer = Boolean(buffer);";
|
---|
18514 | t[r++]='\tdata = (typeof data == "string" ? { id: data } : data) || {};';
|
---|
18515 | t[r++]="\tbuffer = buffer || [];";
|
---|
18516 | t[r++]="\tvar _i = buffer.length;";
|
---|
18517 | t[r++]="\n";
|
---|
18518 | AjxTemplate.__RE_REPLACE.lastIndex=0;
|
---|
18519 | var e=AjxTemplate.__RE_REPLACE.exec(a);
|
---|
18520 | if(e){
|
---|
18521 | var o=0;
|
---|
18522 | do{
|
---|
18523 | var i=AjxTemplate.__RE_REPLACE.lastIndex-e[0].length;
|
---|
18524 | if(o<i){
|
---|
18525 | AjxTemplate.__printStringLines(t,a.substring(o,i))
|
---|
18526 | }
|
---|
18527 | var s=e[1];
|
---|
18528 | var n=e[2];
|
---|
18529 | if(s){
|
---|
18530 | r=AjxTemplate.__printDataLine(t,s)
|
---|
18531 | }else{
|
---|
18532 | if(n){
|
---|
18533 | r=AjxTemplate.__printBufferLine(t,n)
|
---|
18534 | }else{
|
---|
18535 | r=AjxTemplate.__printLine(t,"\t",e[3].replace(/\n/g,"\n\t"),"\n")
|
---|
18536 | }}
|
---|
18537 | o=AjxTemplate.__RE_REPLACE.lastIndex
|
---|
18538 | }
|
---|
18539 | while(e=AjxTemplate.__RE_REPLACE.exec(a));
|
---|
18540 | if(o<a.length){
|
---|
18541 | r=AjxTemplate.__printStringLines(t,a.substring(o))
|
---|
18542 | }}else{
|
---|
18543 | r=AjxTemplate.__printStringLines(t,a)
|
---|
18544 | }
|
---|
18545 | t[r++]="\n";
|
---|
18546 | t[r++]='\treturn _hasBuffer ? buffer.length : buffer.join("");';
|
---|
18547 | return new Function("name,params,data,buffer",t.join(""))
|
---|
18548 | };
|
---|
18549 | AjxTemplate.__parseAttrs=function(a){
|
---|
18550 | var t={}
|
---|
18551 | ,e;
|
---|
18552 | AjxTemplate.__RE_ATTR.lastIndex=0;
|
---|
18553 | while(e=AjxTemplate.__RE_ATTR.exec(a)){
|
---|
18554 | var i=e[2];
|
---|
18555 | t[e[1]]=i.substring(1,i.length-1)
|
---|
18556 | }
|
---|
18557 | return t
|
---|
18558 | };
|
---|
18559 | AjxTemplate.__printLine=function(e,a){
|
---|
18560 | var o=e.length;
|
---|
18561 | for(var t=1;
|
---|
18562 | t<arguments.length;
|
---|
18563 | t++){
|
---|
18564 | e[o++]=arguments[t]
|
---|
18565 | }
|
---|
18566 | return o
|
---|
18567 | };
|
---|
18568 | AjxTemplate.__printStringLines=function(a,r){
|
---|
18569 | var l=a.length;
|
---|
18570 | for(var n=1;
|
---|
18571 | n<arguments.length;
|
---|
18572 | n++){
|
---|
18573 | var h=arguments[n];
|
---|
18574 | var t=h.split("\n");
|
---|
18575 | for(var o=0;
|
---|
18576 | o<t.length;
|
---|
18577 | o++){
|
---|
18578 | var e=t[o];
|
---|
18579 | l=AjxTemplate.__printStringLine(a,e,n<t.length-1?"\n":"")
|
---|
18580 | }}
|
---|
18581 | return l
|
---|
18582 | };
|
---|
18583 | AjxTemplate.__printStringLine=function(e,a){
|
---|
18584 | var o=e.length;
|
---|
18585 | e[o++]='\tbuffer[_i++] = "';
|
---|
18586 | for(var t=1;
|
---|
18587 | t<arguments.length;
|
---|
18588 | t++){
|
---|
18589 | o=AjxTemplate.__printEscaped(e,arguments[t])
|
---|
18590 | }
|
---|
18591 | e[o++]='";';
|
---|
18592 | return o
|
---|
18593 | };
|
---|
18594 | AjxTemplate.__printDataLine=function(t,a){
|
---|
18595 | var i=t.length,e;
|
---|
18596 | t[i++]="\tbuffer[_i++] = data";
|
---|
18597 | AjxTemplate.__RE_PARAM_PART.lastIndex=0;
|
---|
18598 | while(e=AjxTemplate.__RE_PARAM_PART.exec(a)){
|
---|
18599 | t[i++]='["';
|
---|
18600 | t[i++]=e[1];
|
---|
18601 | t[i++]='"]';
|
---|
18602 | if(e[2]!=null){
|
---|
18603 | t[i++]=e[2]
|
---|
18604 | }}
|
---|
18605 | t[i++]=";";
|
---|
18606 | return i
|
---|
18607 | };
|
---|
18608 | AjxTemplate.__printBufferLine=function(e,a){
|
---|
18609 | var o=e.length;
|
---|
18610 | e[o++]="\tbuffer[_i++] = ";
|
---|
18611 | for(var t=1;
|
---|
18612 | t<arguments.length;
|
---|
18613 | t++){
|
---|
18614 | e[o++]=arguments[t]
|
---|
18615 | }
|
---|
18616 | e[o++]=";";
|
---|
18617 | return o
|
---|
18618 | };
|
---|
18619 | AjxTemplate.__printEscaped=function(e,t){
|
---|
18620 | var a=e.length;
|
---|
18621 | e[a++]=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace("\n","\\n").replace("\r","\\r").replace("\t","\\t");
|
---|
18622 | return a
|
---|
18623 | };
|
---|
18624 | AjxDispatcher=function(){};
|
---|
18625 | AjxDispatcher._registry={};
|
---|
18626 | AjxDispatcher._package={};
|
---|
18627 | AjxDispatcher._preLoad=[];
|
---|
18628 | AjxDispatcher._postLoad=[];
|
---|
18629 | AjxDispatcher._loadFunctionsEnabled=false;
|
---|
18630 | AjxDispatcher._timedAction=null;
|
---|
18631 | AjxDispatcher.addPackageLoadFunction=function(e,a){
|
---|
18632 | var t=AjxDispatcher._getPackageData(e);
|
---|
18633 | if(!t._loaded&&!AjxPackage.isDefined(e)){
|
---|
18634 | t.callback.push(a)
|
---|
18635 | }else{
|
---|
18636 | AjxTimedAction.scheduleAction(new AjxTimedAction(a,a.run),0)
|
---|
18637 | }};
|
---|
18638 | AjxDispatcher.addPreLoadFunction=function(e){
|
---|
18639 | AjxDispatcher._preLoad.push(e)
|
---|
18640 | };
|
---|
18641 | AjxDispatcher.addPostLoadFunction=function(e){
|
---|
18642 | AjxDispatcher._postLoad.push(e)
|
---|
18643 | };
|
---|
18644 | AjxDispatcher.setPackageLoadFunction=AjxDispatcher.addPackageLoadFunction;
|
---|
18645 | AjxDispatcher.setPreLoadFunction=AjxDispatcher.addPreLoadFunction;
|
---|
18646 | AjxDispatcher.setPostLoadFunction=AjxDispatcher.addPostLoadFunction;
|
---|
18647 | AjxDispatcher.enableLoadFunctions=function(e){
|
---|
18648 | AjxDispatcher._loadFunctionsEnabled=e
|
---|
18649 | };
|
---|
18650 | AjxDispatcher.loaded=function(e){
|
---|
18651 | var t=AjxDispatcher._getPackageData(e);
|
---|
18652 | return(t&&t._loaded)||AjxPackage.isDefined(e)
|
---|
18653 | };
|
---|
18654 | AjxDispatcher.setLoaded=function(t,e){
|
---|
18655 | var n=AjxDispatcher._getPackageData(t);
|
---|
18656 | n._loaded=e;
|
---|
18657 | if(e){
|
---|
18658 | var o=n.callback||[];
|
---|
18659 | for(var a=0;
|
---|
18660 | a<o.length;
|
---|
18661 | a++){
|
---|
18662 | o[a].run()
|
---|
18663 | }}};
|
---|
18664 | AjxDispatcher.registerMethod=function(a,e,t){
|
---|
18665 | AjxDispatcher._registry[a]={
|
---|
18666 | pkg:e,callback:t}
|
---|
18667 | };
|
---|
18668 | AjxDispatcher.run=function(o){
|
---|
18669 | if(!o){
|
---|
18670 | return
|
---|
18671 | }
|
---|
18672 | var e,a,t,l,h;
|
---|
18673 | if(typeof(o)=="string"){
|
---|
18674 | e=o;
|
---|
18675 | t=false;
|
---|
18676 | h=false
|
---|
18677 | }else{
|
---|
18678 | e=o.method;
|
---|
18679 | a=o.noLoad;
|
---|
18680 | l=o.callback;
|
---|
18681 | t=o.async!=null?o.async:Boolean(l);
|
---|
18682 | h=o.preLoadOk!=null?o.preLoadOk:(l!=null)
|
---|
18683 | }
|
---|
18684 | var c=AjxDispatcher._registry[e];
|
---|
18685 | if(!c){
|
---|
18686 | AjxPackage.__log("API method '"+e+"' not found");
|
---|
18687 | return
|
---|
18688 | }
|
---|
18689 | AjxPackage.__log("Run method: "+e);
|
---|
18690 | var r=c.pkg;
|
---|
18691 | var s=[];
|
---|
18692 | for(var n=1;
|
---|
18693 | n<arguments.length;
|
---|
18694 | ++n){
|
---|
18695 | s.push(arguments[n])
|
---|
18696 | }
|
---|
18697 | if(l){
|
---|
18698 | s.push(l)
|
---|
18699 | }
|
---|
18700 | return AjxDispatcher.require(r,t,c.callback,s,h)
|
---|
18701 | };
|
---|
18702 | AjxDispatcher.require=function(n,a,h,s,r){
|
---|
18703 | if(!n){
|
---|
18704 | return
|
---|
18705 | }
|
---|
18706 | if(typeof(n)=="string"){
|
---|
18707 | n=[n]
|
---|
18708 | }
|
---|
18709 | var l=[];
|
---|
18710 | for(var o=0;
|
---|
18711 | o<n.length;
|
---|
18712 | o++){
|
---|
18713 | var t=n[o];
|
---|
18714 | if(!AjxDispatcher._getPackageData(t)._loaded){
|
---|
18715 | l.push(t)
|
---|
18716 | }}
|
---|
18717 | if(l.length==0){
|
---|
18718 | return AjxDispatcher._postLoadCallback(n,false,h,s)
|
---|
18719 | }else{
|
---|
18720 | var e=AjxDispatcher._preLoad;
|
---|
18721 | if(r&&AjxDispatcher._loadFunctionsEnabled&&e.length){
|
---|
18722 | AjxPackage.__log("pre-load function");
|
---|
18723 | AjxDispatcher._timedAction=new AjxCallback(null,AjxDispatcher._continueRequire,[l,a,h,s]);
|
---|
18724 | for(var o=0;
|
---|
18725 | o<e.length;
|
---|
18726 | o++){
|
---|
18727 | e[o].run()
|
---|
18728 | }
|
---|
18729 | window.setTimeout("AjxDispatcher._timedAction.run()",0)
|
---|
18730 | }else{
|
---|
18731 | return AjxDispatcher._continueRequire(l,a,h,s)
|
---|
18732 | }}};
|
---|
18733 | AjxDispatcher._continueRequire=function(s,e,c,r){
|
---|
18734 | var l=s.join(", ");
|
---|
18735 | AjxPackage.__log("------------------------------------- Loading package: "+l);
|
---|
18736 | if(window.console){
|
---|
18737 | console.log("------------------------------------- Loading package: "+l)
|
---|
18738 | }
|
---|
18739 | if(e&&c){
|
---|
18740 | var o=new AjxCallback(null,AjxDispatcher._postLoadCallback,[s,true,c,r]);
|
---|
18741 | AjxPackage.require({
|
---|
18742 | name:s,callback:o}
|
---|
18743 | )
|
---|
18744 | }else{
|
---|
18745 | var n=new Date();
|
---|
18746 | for(var a=0;
|
---|
18747 | a<s.length;
|
---|
18748 | a++){
|
---|
18749 | AjxPackage.require(s[a])
|
---|
18750 | }
|
---|
18751 | var h=new Date();
|
---|
18752 | var d=h.getTime()-n.getTime();
|
---|
18753 | AjxPackage.__log("LOAD TIME for "+l+": "+d);
|
---|
18754 | return AjxDispatcher._postLoadCallback(s,true,c,r)
|
---|
18755 | }};
|
---|
18756 | AjxDispatcher._postLoadCallback=function(r,n,l,h){
|
---|
18757 | for(var a=0;
|
---|
18758 | a<r.length;
|
---|
18759 | a++){
|
---|
18760 | AjxDispatcher._getPackageData(r[a])._loaded=true
|
---|
18761 | }
|
---|
18762 | for(var a=0;
|
---|
18763 | a<r.length;
|
---|
18764 | a++){
|
---|
18765 | var e=AjxDispatcher._getPackageData(r[a]);
|
---|
18766 | if(n&&e.callback.length&&!e.callbackDone){
|
---|
18767 | e.callbackDone=true;
|
---|
18768 | AjxPackage.__log("Running post-load package function for "+r[a]);
|
---|
18769 | var s=e.callback;
|
---|
18770 | for(var t=0;
|
---|
18771 | t<s.length;
|
---|
18772 | t++){
|
---|
18773 | s[t].run()
|
---|
18774 | }
|
---|
18775 | e.callback.length=0
|
---|
18776 | }}
|
---|
18777 | if(n){
|
---|
18778 | var o=AjxDispatcher._postLoad;
|
---|
18779 | if(AjxDispatcher._loadFunctionsEnabled&&o.length){
|
---|
18780 | for(var a=0;
|
---|
18781 | a<o.length;
|
---|
18782 | a++){
|
---|
18783 | o[a].run()
|
---|
18784 | }}}
|
---|
18785 | if(l){
|
---|
18786 | return l.run1(h)
|
---|
18787 | }};
|
---|
18788 | AjxDispatcher._getPackageData=function(e){
|
---|
18789 | if(!AjxDispatcher._package[e]){
|
---|
18790 | AjxDispatcher._package[e]={
|
---|
18791 | callback:[]}
|
---|
18792 | }
|
---|
18793 | return AjxDispatcher._package[e]
|
---|
18794 | };
|
---|
18795 | </script>
|
---|
18796 |
|
---|
18797 |
|
---|
18798 | <script type="text/javascript">
|
---|
18799 | AjxPackage.setBasePath("/zimbra/js");
|
---|
18800 | AjxPackage.setExtension("_all.js.zgz");
|
---|
18801 | AjxPackage.setQueryString("v=110527090709");
|
---|
18802 |
|
---|
18803 | AjxTemplate.setBasePath("/zimbra/templates");
|
---|
18804 | AjxTemplate.setExtension(".template.js");
|
---|
18805 | </script>
|
---|
18806 |
|
---|
18807 | <script>
|
---|
18808 | AjxEnv.DEFAULT_LOCALE = "en_US";
|
---|
18809 |
|
---|
18810 | function switchToStandardClient() {
|
---|
18811 | document.location = appContextPath + "/?client=standard";
|
---|
18812 | }
|
---|
18813 |
|
---|
18814 | var enforceMinDisplay = true;
|
---|
18815 | var unsupported = (screen && (screen.width <= 800 && screen.height <= 600) && !false) || (AjxEnv.isSafari && !AjxEnv.isSafari4up);
|
---|
18816 | if (enforceMinDisplay && unsupported) {
|
---|
18817 | switchToStandardClient();
|
---|
18818 | }
|
---|
18819 |
|
---|
18820 | </script>
|
---|
18821 | <script>
|
---|
18822 | /**
|
---|
18823 | * DO NOT EDIT! This file is generated.
|
---|
18824 | * <p>
|
---|
18825 | * Any copy of this file checked into source control is merely for
|
---|
18826 | * convenience and should not be edited in any way.
|
---|
18827 | * <p>
|
---|
18828 | * Generated at Sun Sep 30 09:07:34 PDT 2012
|
---|
18829 | * @private
|
---|
18830 | */
|
---|
18831 | AjxTimezoneData = {};
|
---|
18832 |
|
---|
18833 | AjxTimezoneData.TRANSITION_YEAR = 2012;
|
---|
18834 |
|
---|
18835 | AjxTimezoneData.TIMEZONE_RULES = [
|
---|
18836 | { serverId: "Etc/GMT+12", clientId: "Etc/GMT+12", score: 100, standard: { offset: -720, tzname: "GMT+12" } },
|
---|
18837 | { serverId: "Pacific/Midway", clientId: "Pacific/Midway", score: 100, standard: { offset: -660, tzname: "SST" } },
|
---|
18838 | { serverId: "Pacific/Honolulu", clientId: "Pacific/Honolulu", score: 200, standard: { offset: -600, tzname: "HST" } },
|
---|
18839 | { serverId: "America/Anchorage", clientId: "America/Anchorage", score: 200,
|
---|
18840 | standard: { offset: -540, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "AKST" },
|
---|
18841 | daylight: { offset: -480, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "AKDT" }
|
---|
18842 | },
|
---|
18843 | { serverId: "America/Los_Angeles", clientId: "America/Los_Angeles", score: 200,
|
---|
18844 | standard: { offset: -480, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "PST" },
|
---|
18845 | daylight: { offset: -420, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "PDT" }
|
---|
18846 | },
|
---|
18847 | { serverId: "America/Tijuana", clientId: "America/Tijuana", score: 100,
|
---|
18848 | standard: { offset: -480, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "PST" },
|
---|
18849 | daylight: { offset: -420, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "PDT" }
|
---|
18850 | },
|
---|
18851 | { serverId: "America/Chihuahua", clientId: "America/Chihuahua", score: 100,
|
---|
18852 | standard: { offset: -420, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MST" },
|
---|
18853 | daylight: { offset: -360, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "MDT" }
|
---|
18854 | },
|
---|
18855 | { serverId: "America/Denver", clientId: "America/Denver", score: 200,
|
---|
18856 | standard: { offset: -420, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "MST" },
|
---|
18857 | daylight: { offset: -360, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "MDT" }
|
---|
18858 | },
|
---|
18859 | { serverId: "America/Phoenix", clientId: "America/Phoenix", score: 200, standard: { offset: -420, tzname: "MST" } },
|
---|
18860 | { serverId: "America/Chicago", clientId: "America/Chicago", score: 200,
|
---|
18861 | standard: { offset: -360, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "CST" },
|
---|
18862 | daylight: { offset: -300, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "CDT" }
|
---|
18863 | },
|
---|
18864 | { serverId: "America/Guatemala", clientId: "America/Guatemala", score: 100, standard: { offset: -360 } },
|
---|
18865 | { serverId: "America/Mexico_City", clientId: "America/Mexico_City", score: 100,
|
---|
18866 | standard: { offset: -360, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CST" },
|
---|
18867 | daylight: { offset: -300, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CDT" }
|
---|
18868 | },
|
---|
18869 | { serverId: "America/Regina", clientId: "America/Regina", score: 200, standard: { offset: -360, tzname: "CST" } },
|
---|
18870 | { serverId: "America/Bogota", clientId: "America/Bogota", score: 100, standard: { offset: -300 } },
|
---|
18871 | { serverId: "America/Indiana/Indianapolis", clientId: "America/Indiana/Indianapolis", score: 100,
|
---|
18872 | standard: { offset: -300, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "EST" },
|
---|
18873 | daylight: { offset: -240, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "EDT" }
|
---|
18874 | },
|
---|
18875 | { serverId: "America/New_York", clientId: "America/New_York", score: 200,
|
---|
18876 | standard: { offset: -300, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "EST" },
|
---|
18877 | daylight: { offset: -240, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "EDT" }
|
---|
18878 | },
|
---|
18879 | { serverId: "America/Caracas", clientId: "America/Caracas", score: 100, standard: { offset: -270, tzname: "VET" } },
|
---|
18880 | { serverId: "America/Asuncion", clientId: "America/Asuncion", score: 100,
|
---|
18881 | standard: { offset: -240, mon: 4, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 8 ], tzname: "PYT" },
|
---|
18882 | daylight: { offset: -180, mon: 10, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "PYST" }
|
---|
18883 | },
|
---|
18884 | { serverId: "America/Cuiaba", clientId: "America/Cuiaba", score: 100,
|
---|
18885 | standard: { offset: -240, mon: 2, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 2, 19 ], tzname: "AMT" },
|
---|
18886 | daylight: { offset: -180, mon: 10, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 21 ], tzname: "AMST" }
|
---|
18887 | },
|
---|
18888 | { serverId: "America/Guyana", clientId: "America/Guyana", score: 100, standard: { offset: -240, tzname: "GYT" } },
|
---|
18889 | { serverId: "America/Halifax", clientId: "America/Halifax", score: 100,
|
---|
18890 | standard: { offset: -240, mon: 11, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 11, 4 ], tzname: "AST" },
|
---|
18891 | daylight: { offset: -180, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "ADT" }
|
---|
18892 | },
|
---|
18893 | { serverId: "America/Santiago", clientId: "America/Santiago", score: 100,
|
---|
18894 | standard: { offset: -240, mon: 4, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CLT" },
|
---|
18895 | daylight: { offset: -180, mon: 10, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 14 ], tzname: "CLST" }
|
---|
18896 | },
|
---|
18897 | { serverId: "America/St_Johns", clientId: "America/St_Johns", score: 100,
|
---|
18898 | standard: { offset: -210, mon: 11, week: 1, wkday: 1, hour: 0, min: 1, sec: 0, trans: [ 2012, 11, 4 ], tzname: "NST" },
|
---|
18899 | daylight: { offset: -150, mon: 3, week: 2, wkday: 1, hour: 0, min: 1, sec: 0, trans: [ 2012, 3, 11 ], tzname: "NDT" }
|
---|
18900 | },
|
---|
18901 | { serverId: "America/Argentina/Buenos_Aires", clientId: "America/Argentina/Buenos_Aires", score: 100, standard: { offset: -180 } },
|
---|
18902 | { serverId: "America/Cayenne", clientId: "America/Cayenne", score: 100, standard: { offset: -180, tzname: "GFT" } },
|
---|
18903 | { serverId: "America/Godthab", clientId: "America/Godthab", score: 100,
|
---|
18904 | standard: { offset: -180, mon: 10, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "WGT" },
|
---|
18905 | daylight: { offset: -120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "WGST" }
|
---|
18906 | },
|
---|
18907 | { serverId: "America/Montevideo", clientId: "America/Montevideo", score: 100,
|
---|
18908 | standard: { offset: -180, mon: 3, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 11 ], tzname: "UYT" },
|
---|
18909 | daylight: { offset: -120, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "UYST" }
|
---|
18910 | },
|
---|
18911 | { serverId: "America/Sao_Paulo", clientId: "America/Sao_Paulo", score: 100,
|
---|
18912 | standard: { offset: -180, mon: 2, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 2, 19 ], tzname: "BRT" },
|
---|
18913 | daylight: { offset: -120, mon: 10, week: 3, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 21 ], tzname: "BRST" }
|
---|
18914 | },
|
---|
18915 | { serverId: "Atlantic/South_Georgia", clientId: "Atlantic/South_Georgia", score: 100, standard: { offset: -120, tzname: "GST" } },
|
---|
18916 | { serverId: "Atlantic/Azores", clientId: "Atlantic/Azores", score: 100,
|
---|
18917 | standard: { offset: -60, mon: 10, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AZOT" },
|
---|
18918 | daylight: { offset: 0, mon: 3, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AZOST" }
|
---|
18919 | },
|
---|
18920 | { serverId: "Atlantic/Cape_Verde", clientId: "Atlantic/Cape_Verde", score: 100, standard: { offset: -60, tzname: "CVT" } },
|
---|
18921 | { serverId: "Africa/Casablanca", clientId: "Africa/Casablanca", score: 100,
|
---|
18922 | standard: { offset: 0, mon: 8, week: 2, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 8, 12 ], tzname: "WET" },
|
---|
18923 | daylight: { offset: 60, mon: 5, week: 1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 5, 6 ], tzname: "WEST" }
|
---|
18924 | },
|
---|
18925 | { serverId: "Africa/Monrovia", clientId: "Africa/Monrovia", score: 100, standard: { offset: 0, tzname: "GMT" } },
|
---|
18926 | { serverId: "Europe/London", clientId: "Europe/London", score: 100,
|
---|
18927 | standard: { offset: 0, mon: 10, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "GMT/BST" },
|
---|
18928 | daylight: { offset: 60, mon: 3, week: -1, wkday: 1, hour: 1, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "GMT/BST" }
|
---|
18929 | },
|
---|
18930 | { serverId: "UTC", clientId: "UTC", score: 100, standard: { offset: 0, tzname: "UTC" } },
|
---|
18931 | { serverId: "Africa/Algiers", clientId: "Africa/Algiers", score: 100, standard: { offset: 60, tzname: "CET" } },
|
---|
18932 | { serverId: "Africa/Windhoek", clientId: "Africa/Windhoek", score: 100,
|
---|
18933 | standard: { offset: 60, mon: 4, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "WAT" },
|
---|
18934 | daylight: { offset: 120, mon: 9, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 2 ], tzname: "WAST" }
|
---|
18935 | },
|
---|
18936 | { serverId: "Europe/Belgrade", clientId: "Europe/Belgrade", score: 100,
|
---|
18937 | standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
|
---|
18938 | daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
|
---|
18939 | },
|
---|
18940 | { serverId: "Europe/Berlin", clientId: "Europe/Berlin", score: 200,
|
---|
18941 | standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
|
---|
18942 | daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
|
---|
18943 | },
|
---|
18944 | { serverId: "Europe/Brussels", clientId: "Europe/Brussels", score: 100,
|
---|
18945 | standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
|
---|
18946 | daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
|
---|
18947 | },
|
---|
18948 | { serverId: "Europe/Warsaw", clientId: "Europe/Warsaw", score: 100,
|
---|
18949 | standard: { offset: 60, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "CET" },
|
---|
18950 | daylight: { offset: 120, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "CEST" }
|
---|
18951 | },
|
---|
18952 | { serverId: "Africa/Cairo", clientId: "Africa/Cairo", score: 100,
|
---|
18953 | standard: { offset: 120, mon: 9, week: -1, wkday: 5, hour: 0, min: 0, sec: 0, trans: [ 2012, 9, 27 ], tzname: "EET" },
|
---|
18954 | daylight: { offset: 180, mon: 4, week: -1, wkday: 6, hour: 0, min: 0, sec: 0, trans: [ 2012, 4, 27 ], tzname: "EEST" }
|
---|
18955 | },
|
---|
18956 | { serverId: "Africa/Harare", clientId: "Africa/Harare", score: 100, standard: { offset: 120, tzname: "CAT" } },
|
---|
18957 | { serverId: "Asia/Amman", clientId: "Asia/Amman", score: 100,
|
---|
18958 | standard: { offset: 120, mon: 10, week: -1, wkday: 6, hour: 1, min: 0, sec: 0, trans: [ 2012, 10, 26 ], tzname: "EET" },
|
---|
18959 | daylight: { offset: 180, mon: 3, week: -1, wkday: 5, hour: 23, min: 59, sec: 59, trans: [ 2012, 3, 29 ], tzname: "EEST" }
|
---|
18960 | },
|
---|
18961 | { serverId: "Asia/Beirut", clientId: "Asia/Beirut", score: 100,
|
---|
18962 | standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
|
---|
18963 | daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
|
---|
18964 | },
|
---|
18965 | { serverId: "Asia/Jerusalem", clientId: "Asia/Jerusalem", score: 100,
|
---|
18966 | standard: { offset: 120, mon: 9, week: 2, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 9 ], tzname: "IST" },
|
---|
18967 | daylight: { offset: 180, mon: 3, week: -1, wkday: 6, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 30 ], tzname: "IDT" }
|
---|
18968 | },
|
---|
18969 | { serverId: "Europe/Athens", clientId: "Europe/Athens", score: 200,
|
---|
18970 | standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
|
---|
18971 | daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
|
---|
18972 | },
|
---|
18973 | { serverId: "Europe/Helsinki", clientId: "Europe/Helsinki", score: 100,
|
---|
18974 | standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
|
---|
18975 | daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
|
---|
18976 | },
|
---|
18977 | { serverId: "Europe/Minsk", clientId: "Europe/Minsk", score: 100,
|
---|
18978 | standard: { offset: 120, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "EET" },
|
---|
18979 | daylight: { offset: 180, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "EEST" }
|
---|
18980 | },
|
---|
18981 | { serverId: "Africa/Nairobi", clientId: "Africa/Nairobi", score: 200, standard: { offset: 180, tzname: "EAT" } },
|
---|
18982 | { serverId: "Asia/Baghdad", clientId: "Asia/Baghdad", score: 100, standard: { offset: 180 } },
|
---|
18983 | { serverId: "Asia/Kuwait", clientId: "Asia/Kuwait", score: 100, standard: { offset: 180, tzname: "AST" } },
|
---|
18984 | { serverId: "Europe/Moscow", clientId: "Europe/Moscow", score: 100,
|
---|
18985 | standard: { offset: 180, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MSK/MSD" },
|
---|
18986 | daylight: { offset: 240, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "MSK/MSD" }
|
---|
18987 | },
|
---|
18988 | { serverId: "Asia/Tehran", clientId: "Asia/Tehran", score: 100,
|
---|
18989 | standard: { offset: 210, mon: 9, week: 4, wkday: 4, hour: 0, min: 0, sec: 0, trans: [ 2012, 9, 26 ], tzname: "IRST" },
|
---|
18990 | daylight: { offset: 270, mon: 3, week: 4, wkday: 2, hour: 0, min: 0, sec: 0, trans: [ 2012, 3, 26 ], tzname: "IRDT" }
|
---|
18991 | },
|
---|
18992 | { serverId: "Asia/Baku", clientId: "Asia/Baku", score: 100,
|
---|
18993 | standard: { offset: 240, mon: 10, week: -1, wkday: 1, hour: 5, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AZT" },
|
---|
18994 | daylight: { offset: 300, mon: 3, week: -1, wkday: 1, hour: 4, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AZST" }
|
---|
18995 | },
|
---|
18996 | { serverId: "Asia/Muscat", clientId: "Asia/Muscat", score: 100, standard: { offset: 240, tzname: "GST" } },
|
---|
18997 | { serverId: "Asia/Tbilisi", clientId: "Asia/Tbilisi", score: 200, standard: { offset: 240, tzname: "GET" } },
|
---|
18998 | { serverId: "Asia/Yerevan", clientId: "Asia/Yerevan", score: 100,
|
---|
18999 | standard: { offset: 240, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "AMT" },
|
---|
19000 | daylight: { offset: 300, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "AMST" }
|
---|
19001 | },
|
---|
19002 | { serverId: "Indian/Mauritius", clientId: "Indian/Mauritius", score: 100, standard: { offset: 240 } },
|
---|
19003 | { serverId: "Asia/Kabul", clientId: "Asia/Kabul", score: 100, standard: { offset: 270, tzname: "AFT" } },
|
---|
19004 | { serverId: "Asia/Karachi", clientId: "Asia/Karachi", score: 200, standard: { offset: 300 } },
|
---|
19005 | { serverId: "Asia/Tashkent", clientId: "Asia/Tashkent", score: 100, standard: { offset: 300, tzname: "UZT" } },
|
---|
19006 | { serverId: "Asia/Yekaterinburg", clientId: "Asia/Yekaterinburg", score: 100,
|
---|
19007 | standard: { offset: 300, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "YEKT" },
|
---|
19008 | daylight: { offset: 360, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "YEKST" }
|
---|
19009 | },
|
---|
19010 | { serverId: "Asia/Colombo", clientId: "Asia/Colombo", score: 100, standard: { offset: 330, tzname: "IST" } },
|
---|
19011 | { serverId: "Asia/Kolkata", clientId: "Asia/Kolkata", score: 200, standard: { offset: 330, tzname: "IST" } },
|
---|
19012 | { serverId: "Asia/Almaty", clientId: "Asia/Almaty", score: 100, standard: { offset: 360, tzname: "ALMT" } },
|
---|
19013 | { serverId: "Asia/Dhaka", clientId: "Asia/Dhaka", score: 100, standard: { offset: 360 } },
|
---|
19014 | { serverId: "Asia/Novosibirsk", clientId: "Asia/Novosibirsk", score: 100,
|
---|
19015 | standard: { offset: 360, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "NOVT" },
|
---|
19016 | daylight: { offset: 420, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "NOVST" }
|
---|
19017 | },
|
---|
19018 | { serverId: "Asia/Rangoon", clientId: "Asia/Rangoon", score: 100, standard: { offset: 390, tzname: "MMT" } },
|
---|
19019 | { serverId: "Asia/Bangkok", clientId: "Asia/Bangkok", score: 100, standard: { offset: 420, tzname: "ICT" } },
|
---|
19020 | { serverId: "Asia/Krasnoyarsk", clientId: "Asia/Krasnoyarsk", score: 100,
|
---|
19021 | standard: { offset: 420, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "KRAT" },
|
---|
19022 | daylight: { offset: 480, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "KRAST" }
|
---|
19023 | },
|
---|
19024 | { serverId: "Asia/Hong_Kong", clientId: "Asia/Hong_Kong", score: 200, standard: { offset: 480 } },
|
---|
19025 | { serverId: "Asia/Irkutsk", clientId: "Asia/Irkutsk", score: 100,
|
---|
19026 | standard: { offset: 480, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "IRKT" },
|
---|
19027 | daylight: { offset: 540, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "IRKST" }
|
---|
19028 | },
|
---|
19029 | { serverId: "Asia/Kuala_Lumpur", clientId: "Asia/Kuala_Lumpur", score: 100, standard: { offset: 480, tzname: "MYT" } },
|
---|
19030 | { serverId: "Asia/Taipei", clientId: "Asia/Taipei", score: 100, standard: { offset: 480 } },
|
---|
19031 | { serverId: "Asia/Ulaanbaatar", clientId: "Asia/Ulaanbaatar", score: 100, standard: { offset: 480 } },
|
---|
19032 | { serverId: "Australia/Perth", clientId: "Australia/Perth", score: 100, standard: { offset: 480, tzname: "WST" } },
|
---|
19033 | { serverId: "Asia/Seoul", clientId: "Asia/Seoul", score: 100, standard: { offset: 540 } },
|
---|
19034 | { serverId: "Asia/Tokyo", clientId: "Asia/Tokyo", score: 200, standard: { offset: 540 } },
|
---|
19035 | { serverId: "Asia/Yakutsk", clientId: "Asia/Yakutsk", score: 100,
|
---|
19036 | standard: { offset: 540, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "YAKT" },
|
---|
19037 | daylight: { offset: 600, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "YAKST" }
|
---|
19038 | },
|
---|
19039 | { serverId: "Australia/Adelaide", clientId: "Australia/Adelaide", score: 100,
|
---|
19040 | standard: { offset: 570, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "CST" },
|
---|
19041 | daylight: { offset: 630, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "CST" }
|
---|
19042 | },
|
---|
19043 | { serverId: "Australia/Darwin", clientId: "Australia/Darwin", score: 100, standard: { offset: 570, tzname: "CST" } },
|
---|
19044 | { serverId: "Asia/Vladivostok", clientId: "Asia/Vladivostok", score: 100,
|
---|
19045 | standard: { offset: 600, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "VLAT" },
|
---|
19046 | daylight: { offset: 660, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "VLAST" }
|
---|
19047 | },
|
---|
19048 | { serverId: "Australia/Brisbane", clientId: "Australia/Brisbane", score: 200, standard: { offset: 600, tzname: "EST" } },
|
---|
19049 | { serverId: "Australia/Hobart", clientId: "Australia/Hobart", score: 100,
|
---|
19050 | standard: { offset: 600, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "EST" },
|
---|
19051 | daylight: { offset: 660, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "EST" }
|
---|
19052 | },
|
---|
19053 | { serverId: "Australia/Sydney", clientId: "Australia/Sydney", score: 200,
|
---|
19054 | standard: { offset: 600, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "EST" },
|
---|
19055 | daylight: { offset: 660, mon: 10, week: 1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 7 ], tzname: "EST" }
|
---|
19056 | },
|
---|
19057 | { serverId: "Pacific/Guam", clientId: "Pacific/Guam", score: 100, standard: { offset: 600, tzname: "ChST" } },
|
---|
19058 | { serverId: "Asia/Magadan", clientId: "Asia/Magadan", score: 100,
|
---|
19059 | standard: { offset: 660, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "MAGT" },
|
---|
19060 | daylight: { offset: 720, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "MAGST" }
|
---|
19061 | },
|
---|
19062 | { serverId: "Asia/Kamchatka", clientId: "Asia/Kamchatka", score: 100,
|
---|
19063 | standard: { offset: 720, mon: 10, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "PETT" },
|
---|
19064 | daylight: { offset: 780, mon: 3, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "PETST" }
|
---|
19065 | },
|
---|
19066 | { serverId: "Pacific/Auckland", clientId: "Pacific/Auckland", score: 100,
|
---|
19067 | standard: { offset: 720, mon: 4, week: 1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 4, 1 ], tzname: "NZST" },
|
---|
19068 | daylight: { offset: 780, mon: 9, week: -1, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 9, 30 ], tzname: "NZDT" }
|
---|
19069 | },
|
---|
19070 | { serverId: "Pacific/Fiji", clientId: "Pacific/Fiji", score: 100,
|
---|
19071 | standard: { offset: 720, mon: 3, week: -1, wkday: 1, hour: 3, min: 0, sec: 0, trans: [ 2012, 3, 25 ], tzname: "FJT" },
|
---|
19072 | daylight: { offset: 780, mon: 10, week: 4, wkday: 1, hour: 2, min: 0, sec: 0, trans: [ 2012, 10, 28 ], tzname: "FJST" }
|
---|
19073 | },
|
---|
19074 | { serverId: "Pacific/Tongatapu", clientId: "Pacific/Tongatapu", score: 100, standard: { offset: 780 } }
|
---|
19075 | ];
|
---|
19076 |
|
---|
19077 | </script>
|
---|
19078 |
|
---|
19079 | <script src="/zimbra/js/Startup1_1_all.js.zgz?v=110527090709"></script>
|
---|
19080 |
|
---|
19081 | <script src="/zimbra/js/Startup1_2_all.js.zgz?v=110527090709"></script>
|
---|
19082 |
|
---|
19083 | <script type="text/javascript">
|
---|
19084 | function ZmSkin(e){
|
---|
19085 | this.hints=this.mergeObjects({
|
---|
19086 | name:"velodrome2",version:"2.0.0",logo:{
|
---|
19087 | url:"http://www.comcast.net/"}
|
---|
19088 | ,banner:{
|
---|
19089 | position:"static",url:"http://www.comcast.net/"}
|
---|
19090 | ,userInfo:{
|
---|
19091 | position:"static"}
|
---|
19092 | ,search:{
|
---|
19093 | position:"static"}
|
---|
19094 | ,quota:{
|
---|
19095 | position:"static"}
|
---|
19096 | ,appChooser:{
|
---|
19097 | direction:"LR"}
|
---|
19098 | ,helpButton:{
|
---|
19099 | style:"link",container:"quota",url:""}
|
---|
19100 | ,logoutButton:{
|
---|
19101 | style:"link",container:"quota"}
|
---|
19102 | ,toast:{
|
---|
19103 | location:"N",transitions:[{
|
---|
19104 | type:"fade-in",step:10,duration:200}
|
---|
19105 | ,{
|
---|
19106 | type:"pause",duration:1000}
|
---|
19107 | ,{
|
---|
19108 | type:"fade-out",step:-10,duration:500}
|
---|
19109 | ]}
|
---|
19110 | ,skin:{
|
---|
19111 | containers:"skin_outer"}
|
---|
19112 | ,tree:{
|
---|
19113 | minWidth:150,maxWidth:300,containers:["skin_td_outer_tree","skin_outer_tree","skin_col_tree_inner","skin_col_tree"]}
|
---|
19114 | ,searchBuilder:{
|
---|
19115 | containers:["skin_container_search_builder_outer","skin_td_search_builder"]}
|
---|
19116 | ,topToolbar:{
|
---|
19117 | containers:["skin_tr_top_toolbar","!skin_tr_top_toolbar_shim"]}
|
---|
19118 | ,bottomToolbar:{
|
---|
19119 | containers:["skin_tr_bottom_toolbar","!skin_tr_bottom_toolbar_shim"]}
|
---|
19120 | ,treeFooter:{
|
---|
19121 | containers:["skin_tr_tree_footer_sep","skin_tr_tree_footer"]}
|
---|
19122 | ,topAd:{
|
---|
19123 | containers:["skin_tr_top_ad"]}
|
---|
19124 | ,sidebarAd:{
|
---|
19125 | containers:["skin_td_sidebar_ad"]}
|
---|
19126 | ,fullScreen:{
|
---|
19127 | containers:["skin_tr_toolbar_full","skin_tr_main_full","!skin_tr_toolbar","!skin_tr_main","!skin_tr_status"]}}
|
---|
19128 | ,e)
|
---|
19129 | }
|
---|
19130 | window.BaseSkin=ZmSkin;
|
---|
19131 | ZmSkin.prototype={
|
---|
19132 | show:function(a,r){
|
---|
19133 | var s=this.hints[a]&&this.hints[a].containers;
|
---|
19134 | if(s){
|
---|
19135 | if(typeof s=="function"){
|
---|
19136 | s(this,r);
|
---|
19137 | skin._reflowApp();
|
---|
19138 | return
|
---|
19139 | }
|
---|
19140 | if(typeof s=="string"){
|
---|
19141 | s=[s]
|
---|
19142 | }
|
---|
19143 | for(var n=0;
|
---|
19144 | n<s.length;
|
---|
19145 | n++){
|
---|
19146 | var o=s[n];
|
---|
19147 | var t=o.replace(/^!/,"");
|
---|
19148 | var e=o!=t;
|
---|
19149 | this._showEl(t,e?!r:r)
|
---|
19150 | }
|
---|
19151 | skin._reflowApp()
|
---|
19152 | }
|
---|
19153 | if(a=="fullScreen"){
|
---|
19154 | this._showFullScreen(r)
|
---|
19155 | }}
|
---|
19156 | ,hide:function(e){
|
---|
19157 | this.show(e,false)
|
---|
19158 | }
|
---|
19159 | ,gotoApp:function(e,t){
|
---|
19160 | appCtxt.getAppController().activateApp(e,null,t)
|
---|
19161 | }
|
---|
19162 | ,gotoPrefs:function(e){
|
---|
19163 | if(appCtxt.getCurrentAppName()!=ZmApp.PREFERENCES){
|
---|
19164 | var t=new AjxCallback(this,this._gotoPrefPage,[e]);
|
---|
19165 | this.gotoApp(ZmApp.PREFERENCES,t)
|
---|
19166 | }else{
|
---|
19167 | this._gotoPrefPage(e)
|
---|
19168 | }}
|
---|
19169 | ,mergeObjects:function(e,o){
|
---|
19170 | if(e==null){
|
---|
19171 | e={}
|
---|
19172 | }
|
---|
19173 | for(var a=1;
|
---|
19174 | a<arguments.length;
|
---|
19175 | a++){
|
---|
19176 | var n=arguments[a];
|
---|
19177 | for(var t in n){
|
---|
19178 | var s=e[t];
|
---|
19179 | if(typeof s=="object"&&!(s instanceof Array)){
|
---|
19180 | this.mergeObjects(e[t],n[t]);
|
---|
19181 | continue
|
---|
19182 | }
|
---|
19183 | e[t]=n[t]
|
---|
19184 | }}
|
---|
19185 | return e
|
---|
19186 | }
|
---|
19187 | ,getTreeWidth:function(){
|
---|
19188 | return Dwt.getSize(this._getEl(this.hints.tree.containers[0])).x
|
---|
19189 | }
|
---|
19190 | ,setTreeWidth:function(e){
|
---|
19191 | this._setContainerSizes("tree",e,null)
|
---|
19192 | }
|
---|
19193 | ,showTopAd:function(e){
|
---|
19194 | skin._showEl("skin_tr_top_ad",e);
|
---|
19195 | skin._reflowApp()
|
---|
19196 | }
|
---|
19197 | ,hideTopAd:function(){
|
---|
19198 | skin.showTopAd(false)
|
---|
19199 | }
|
---|
19200 | ,getTopAdContainer:function(){
|
---|
19201 | return skin._getEl("skin_container_top_ad")
|
---|
19202 | }
|
---|
19203 | ,showSidebarAd:function(e){
|
---|
19204 | var t="skin_td_sidebar_ad";
|
---|
19205 | if(e!=null){
|
---|
19206 | skin._setSize(t,e)
|
---|
19207 | }
|
---|
19208 | skin._showEl(t);
|
---|
19209 | skin._reflowApp()
|
---|
19210 | }
|
---|
19211 | ,hideSidebarAd:function(){
|
---|
19212 | var e="skin_td_sidebar_ad";
|
---|
19213 | skin._hideEl(e);
|
---|
19214 | skin._reflowApp()
|
---|
19215 | }
|
---|
19216 | ,getSidebarAdContainer:function(){
|
---|
19217 | return this._getEl("skin_container_sidebar_ad")
|
---|
19218 | }
|
---|
19219 | ,_getEl:function(e){
|
---|
19220 | return(typeof e=="string"?document.getElementById(e):e)
|
---|
19221 | }
|
---|
19222 | ,_showEl:function(o,i){
|
---|
19223 | var t=this._getEl(o);
|
---|
19224 | if(!t){
|
---|
19225 | return
|
---|
19226 | }
|
---|
19227 | var a;
|
---|
19228 | if(i==false){
|
---|
19229 | a="none"
|
---|
19230 | }else{
|
---|
19231 | var e=t.tagName;
|
---|
19232 | if(e=="TD"&&document.all==null){
|
---|
19233 | a="table-cell"
|
---|
19234 | }else{
|
---|
19235 | if(e=="TR"&&document.all==null){
|
---|
19236 | a="table-row"
|
---|
19237 | }else{
|
---|
19238 | a="block"
|
---|
19239 | }}}
|
---|
19240 | t.style.display=a
|
---|
19241 | }
|
---|
19242 | ,_hideEl:function(e){
|
---|
19243 | this._showEl(e,false)
|
---|
19244 | }
|
---|
19245 | ,_reparentEl:function(i,e){
|
---|
19246 | var a=this._getEl(e);
|
---|
19247 | var t=a&&this._getEl(i);
|
---|
19248 | if(t){
|
---|
19249 | a.appendChild(t)
|
---|
19250 | }}
|
---|
19251 | ,_setSize:function(i,a,e){
|
---|
19252 | var t=this._getEl(i);
|
---|
19253 | if(!t){
|
---|
19254 | return
|
---|
19255 | }
|
---|
19256 | if(a!=null){
|
---|
19257 | t.style.width=a
|
---|
19258 | }
|
---|
19259 | if(e!=null){
|
---|
19260 | t.style.height=e
|
---|
19261 | }}
|
---|
19262 | ,_setContainerSizes:function(n,a,e){
|
---|
19263 | var o=this.hints[n].containers;
|
---|
19264 | for(var t=0;
|
---|
19265 | t<o.length;
|
---|
19266 | t++){
|
---|
19267 | this._setSize(o[t],a,null)
|
---|
19268 | }}
|
---|
19269 | ,_reflowApp:function(){
|
---|
19270 | if(window._zimbraMail){
|
---|
19271 | window._zimbraMail.getAppViewMgr().fitAll()
|
---|
19272 | }}
|
---|
19273 | ,_showFullScreen:function(i){
|
---|
19274 | var a="skin_container_app_top_toolbar";
|
---|
19275 | var t=i==null||i;
|
---|
19276 | var e=t?"skin_border_app_top_toolbar_full":"skin_td_app_top_toolbar";
|
---|
19277 | this._reparentEl(a,e);
|
---|
19278 | if(AjxEnv.isIE){
|
---|
19279 | var o=document.getElementById("skin_container_app_main_full");
|
---|
19280 | if(o){
|
---|
19281 | Dwt.setVisible(o,t)
|
---|
19282 | }}}
|
---|
19283 | ,_gotoPrefPage:function(a){
|
---|
19284 | if(a==null){
|
---|
19285 | return
|
---|
19286 | }
|
---|
19287 | var i=appCtxt.getApp(ZmApp.PREFERENCES);
|
---|
19288 | var t=i.getPrefController();
|
---|
19289 | var e=t.getPrefsView();
|
---|
19290 | e.selectSection(a)
|
---|
19291 | }};
|
---|
19292 | window.skin=new ZmSkin();
|
---|
19293 | function VelodromeSkin(){
|
---|
19294 | BaseSkin.call(this,{
|
---|
19295 | appChooser:{
|
---|
19296 | direction:"LR",fullWidth:true}
|
---|
19297 | ,helpButton:{
|
---|
19298 | style:"link",container:"quota",hideIcon:true,url:"http://www.comcast.net/help/faq/index.jsp?cat=Email#SmartZone"}
|
---|
19299 | ,logoutButton:{
|
---|
19300 | style:"link",container:"quota",hideIcon:true}
|
---|
19301 | ,quota:{
|
---|
19302 | containers:["skin_td_quota"]}
|
---|
19303 | ,userInfo:{
|
---|
19304 | position:"static"}
|
---|
19305 | ,sidebarAd:{
|
---|
19306 | containers:function(t,e){
|
---|
19307 | t._showEl("skin_sidebar_ad_outer",e);
|
---|
19308 | t._reflowApp()
|
---|
19309 | }}
|
---|
19310 | ,fullScreen:{
|
---|
19311 | containers:["skin_tr_main_full","!skin_tr_main","!skin_td_tree_outer","!skin_td_tree_app_sash"]}
|
---|
19312 | ,searchBuilder:{
|
---|
19313 | containers:["skin_tr_search_builder_toolbar","skin_tr_search_builder","skin_td_search_builder_toolbar","skin_td_search_builder"]}
|
---|
19314 | ,treeFooter:{
|
---|
19315 | containers:["skin_tr_tree_footer","skin_td_tree_footer","skin_container_tree_footer"]}}
|
---|
19316 | )
|
---|
19317 | }
|
---|
19318 | VelodromeSkin.prototype=new BaseSkin;
|
---|
19319 | VelodromeSkin.prototype.constructor=VelodromeSkin;
|
---|
19320 | VelodromeSkin.prototype.show=function(n,i){
|
---|
19321 | ZmFolder.HIDE_ID[ZmFolder.ID_AUTO_ADDED]=true;
|
---|
19322 | BaseSkin.prototype.show.apply(this,arguments);
|
---|
19323 | if(n=="fullScreen"){
|
---|
19324 | i=i==null||i;
|
---|
19325 | var o=i?"skin_full_toolbar_container":"skin_main_toolbar_container";
|
---|
19326 | var a=document.getElementById(o);
|
---|
19327 | var t="skin_container_app_top_toolbar";
|
---|
19328 | var e=document.getElementById(t);
|
---|
19329 | a.appendChild(e)
|
---|
19330 | }};
|
---|
19331 | VelodromeSkin.prototype.getSidebarAdContainer=function(){
|
---|
19332 | return document.getElementById("skin_container_sidebar_ad")
|
---|
19333 | };
|
---|
19334 | VelodromeSkin.prototype._getPortalToolBarOps=function(){
|
---|
19335 | return[]
|
---|
19336 | };
|
---|
19337 | skin=new VelodromeSkin();
|
---|
19338 | skin.__handleMailLaunch=function(){
|
---|
19339 | appCtxt.set(ZmSetting.SEND_ON_BEHALF_OF,true)
|
---|
19340 | };
|
---|
19341 | ZmZimbraMail.addAppListener(ZmApp.MAIL,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin.__handleMailLaunch));
|
---|
19342 | skin.__handleVoiceLaunch=function(){
|
---|
19343 | ZmVoiceApp.overviewFallbackApp=ZmApp.MAIL
|
---|
19344 | };
|
---|
19345 | ZmZimbraMail.addAppListener(ZmApp.VOICE,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin.__handleVoiceLaunch));
|
---|
19346 | skin.__handlePortalLaunch=function(){
|
---|
19347 | this.overrideAPI(ZmPortalController.prototype,"_getToolBarOps",this._getPortalToolBarOps)
|
---|
19348 | };
|
---|
19349 | AjxDispatcher.addPackageLoadFunction("Portal",new AjxCallback(skin,skin.__handlePortalLaunch));
|
---|
19350 | VelodromeSkin.prototype.overrideAPI=function(a,t,i){
|
---|
19351 | i=i||this[t];
|
---|
19352 | if(i){
|
---|
19353 | var e=a[t];
|
---|
19354 | a[t]=function(){
|
---|
19355 | i.func=e;
|
---|
19356 | return i.apply(this,arguments)
|
---|
19357 | };
|
---|
19358 | a[t].func=e
|
---|
19359 | }};
|
---|
19360 | VelodromeSkin.prototype.setShortcut=function(e){};
|
---|
19361 | skin.overrideAPI(DwtMenuItem.prototype,"setShortcut");
|
---|
19362 | VelodromeSkin.prototype._noImportExport_handlePrefsPreLaunch=function(){
|
---|
19363 | var e="IMPORT_FOLDER";
|
---|
19364 | var t=ZmPref.getPrefSectionWithPref(e);
|
---|
19365 | ZmPref.unregisterPrefSection(t&&t.id);
|
---|
19366 | e="CHECKED_ZIMLETS";
|
---|
19367 | t=ZmPref.getPrefSectionWithPref(e);
|
---|
19368 | ZmPref.unregisterPrefSection(t&&t.id)
|
---|
19369 | };
|
---|
19370 | ZmZimbraMail.addAppListener(ZmApp.PREFERENCES,ZmAppEvent.PRE_LAUNCH,new AjxListener(skin,skin._noImportExport_handlePrefsPreLaunch));
|
---|
19371 | VelodromeSkin.prototype._collapseImapTrees_handlePreStartup=function(){
|
---|
19372 | appCtxt.set(ZmSetting.COLLAPSE_IMAP_TREES,true)
|
---|
19373 | };
|
---|
19374 | ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,new AjxListener(skin,skin._collapseImapTrees_handlePreStartup));
|
---|
19375 | VelodromeSkin.prototype._saveToImapSent_handlePreStartup=function(){
|
---|
19376 | appCtxt.set(ZmSetting.SAVE_TO_IMAP_SENT,true)
|
---|
19377 | };
|
---|
19378 | ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,new AjxListener(skin,skin._saveToImapSent_handlePreStartup));
|
---|
19379 | VelodromeSkin.prototype._MailList_initializeToolBar=function(t){
|
---|
19380 | arguments.callee.func.call(this,t);
|
---|
19381 | var e=this._toolbar[t];
|
---|
19382 | if(e){
|
---|
19383 | var a;
|
---|
19384 | a=e.getButton(ZmOperation.CHECK_MAIL);
|
---|
19385 | if(a){
|
---|
19386 | if(!appCtxt.isOffline){
|
---|
19387 | var i=(appCtxt.get(ZmSetting.GET_MAIL_ACTION)==ZmSetting.GETMAIL_ACTION_DEFAULT)?ZmMsg.checkMailPrefDefault_velodrome:ZmMsg.checkMailPrefUpdate_velodrome;
|
---|
19388 | a.setToolTipContent(i)
|
---|
19389 | }}
|
---|
19390 | a=e.getButton(ZmOperation.PRINT);
|
---|
19391 | if(a){
|
---|
19392 | a.setText(ZmMsg.print)
|
---|
19393 | }
|
---|
19394 | if(!appCtxt.isChildWindow){
|
---|
19395 | a=e.getButton(ZmOperation.MOVE);
|
---|
19396 | if(a){
|
---|
19397 | a.setText(ZmMsg.move)
|
---|
19398 | }
|
---|
19399 | a=e.getButton(ZmOperation.DELETE_MENU);
|
---|
19400 | if(a){
|
---|
19401 | a.setText(ZmMsg.del)
|
---|
19402 | }
|
---|
19403 | a=e.getButton(ZmOperation.DELETE);
|
---|
19404 | if(a){
|
---|
19405 | a.setText(ZmMsg.del)
|
---|
19406 | }
|
---|
19407 | if(AjxEnv.is800x600orLower){
|
---|
19408 | a=e.getButton(REPLY);
|
---|
19409 | if(a){
|
---|
19410 | a.setText("")
|
---|
19411 | }
|
---|
19412 | a=e.getButton(REPLY_ALL);
|
---|
19413 | if(a){
|
---|
19414 | a.setText("")
|
---|
19415 | }}}}};
|
---|
19416 | VelodromeSkin.prototype._DoublePane_getToolBarOps=VelodromeSkin.prototype._MailList_getToolBarOps=function(){
|
---|
19417 | if(appCtxt.isChildWindow){
|
---|
19418 | return[ZmOperation.PRINT,ZmOperation.CLOSE]
|
---|
19419 | }
|
---|
19420 | var e=this._getDefaultToolBarOps();
|
---|
19421 | e.push(ZmOperation.SEP,ZmOperation.VIEW_MENU);
|
---|
19422 | return e
|
---|
19423 | };
|
---|
19424 | VelodromeSkin.prototype._Msg_getToolBarOps=VelodromeSkin.prototype._Conv_getToolBarOps=function(){
|
---|
19425 | if(appCtxt.isChildWindow){
|
---|
19426 | return[ZmOperation.PRINT,ZmOperation.CLOSE]
|
---|
19427 | }
|
---|
19428 | var e=this._getDefaultToolBarOps();
|
---|
19429 | e.push(ZmOperation.TAG_MENU,ZmOperation.SEP);
|
---|
19430 | if(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)){
|
---|
19431 | e.push(ZmOperation.DETACH)
|
---|
19432 | }
|
---|
19433 | return e
|
---|
19434 | };
|
---|
19435 | VelodromeSkin.prototype._Mail_getDefaultToolBarOps=function(){
|
---|
19436 | var e=[];
|
---|
19437 | e.push(ZmOperation.NEW_MENU,ZmOperation.CHECK_MAIL,ZmOperation.SEP,ZmOperation.REPLY,ZmOperation.REPLY_ALL,ZmOperation.FORWARD,ZmOperation.SEP,ZmOperation.EDIT);
|
---|
19438 | e.push((window.ZmConvController&&this instanceof ZmConvController)?ZmOperation.DELETE_MENU:ZmOperation.DELETE);
|
---|
19439 | e.push(ZmOperation.MOVE,ZmOperation.SPAM,ZmOperation.PRINT);
|
---|
19440 | return e
|
---|
19441 | };
|
---|
19442 | VelodromeSkin.prototype._Mail_resetOperations=function(o,a){
|
---|
19443 | arguments.callee.func.call(this,o,a);
|
---|
19444 | if(o&&o instanceof ZmToolBar){
|
---|
19445 | var n;
|
---|
19446 | var e=this._getSearchFolderId();
|
---|
19447 | if(a==1&&(e!=ZmFolder.ID_DRAFTS)){
|
---|
19448 | var s=this._listView[this._currentView].getSelection();
|
---|
19449 | if(s&&s.length){
|
---|
19450 | n=s[0]
|
---|
19451 | }}
|
---|
19452 | var t=(n&&n.isDraft)||(e==ZmFolder.ID_DRAFTS);
|
---|
19453 | var i=o.getButton&&o.getButton(ZmOperation.VIEW_MENU);
|
---|
19454 | if(i){
|
---|
19455 | var r=i.getMenu();
|
---|
19456 | if(r){
|
---|
19457 | r.enable(ZmOperation.DETACH,(appCtxt.get(ZmSetting.DETACH_MAILVIEW_ENABLED)&&!t&&a==1))
|
---|
19458 | }}}};
|
---|
19459 | VelodromeSkin.prototype._Mail_setupGroupByMenuItems=function(e,a){
|
---|
19460 | arguments.callee.func.call(this,e,a);
|
---|
19461 | if(a){
|
---|
19462 | var t=a.createMenuItem(ZmOperation.DETACH,{
|
---|
19463 | image:"OpenInNewWindow",text:ZmMsg.detach}
|
---|
19464 | );
|
---|
19465 | t.addSelectionListener(this._listeners[ZmOperation.DETACH])
|
---|
19466 | }};
|
---|
19467 | VelodromeSkin.prototype._createComcastAppIconButton=function(){
|
---|
19468 | if(!appCtxt.isChildWindow){
|
---|
19469 | VelodromeSkin.prototype._Msg_getTabParams=function(t,e){
|
---|
19470 | return{
|
---|
19471 | id:t,image:"MessageView",textPrecedence:85,tooltip:ZmMsgController.DEFAULT_TAB_TEXT,tabCallback:e,hasIcon:true}
|
---|
19472 | };
|
---|
19473 | VelodromeSkin.prototype._Compose_getTabParams=function(){
|
---|
19474 | return{
|
---|
19475 | id:this.tabId,image:"NewMessage",textPrecedence:75,tooltip:ZmComposeController.DEFAULT_TAB_TEXT,hasIcon:true}
|
---|
19476 | };
|
---|
19477 | ComcastAppIconButton=function(e){
|
---|
19478 | if(arguments.length==0){
|
---|
19479 | return
|
---|
19480 | }
|
---|
19481 | ZmAppButton.call(this,e)
|
---|
19482 | };
|
---|
19483 | ComcastAppIconButton.prototype=new ZmAppButton;
|
---|
19484 | ComcastAppIconButton.prototype.constructor=ComcastAppIconButton;
|
---|
19485 | ComcastAppIconButton.prototype.toString=function(){
|
---|
19486 | return"ComcastAppIconButton"
|
---|
19487 | };
|
---|
19488 | ComcastAppIconButton.prototype.TEMPLATE="share.Widgets#ZmAppChooserIconButton";
|
---|
19489 | VelodromeSkin.prototype._appChooser_addButton=function(i,a){
|
---|
19490 | var t={
|
---|
19491 | parent:this,id:ZmId.getButtonId(ZmId.APP,i),text:a.text,image:a.image,index:a.index};
|
---|
19492 | var e=(a.hasIcon)?new ComcastAppIconButton(t):new ZmAppButton(t);
|
---|
19493 | e.setToolTipContent(a.tooltip);
|
---|
19494 | e.textPrecedence=a.textPrecedence;
|
---|
19495 | e.imagePrecedence=a.imagePrecedence;
|
---|
19496 | e.setData(Dwt.KEY_ID,i);
|
---|
19497 | e.addSelectionListener(this._buttonListener);
|
---|
19498 | this._buttons[i]=e;
|
---|
19499 | if(e.textPrecedence||e.imagePrecedence){
|
---|
19500 | this._createPrecedenceList()
|
---|
19501 | }
|
---|
19502 | this.adjustSize();
|
---|
19503 | return e
|
---|
19504 | }
|
---|
19505 | }};
|
---|
19506 | VelodromeSkin.prototype._mail_handleStartup2Load=function(){
|
---|
19507 | if(appCtxt&&!appCtxt.isChildWindow){
|
---|
19508 | this._createComcastAppIconButton();
|
---|
19509 | var e=window.ZmAppChooser&&ZmAppChooser.prototype;
|
---|
19510 | if(e){
|
---|
19511 | this.overrideAPI(ZmAppChooser.prototype,"addButton",this._appChooser_addButton)
|
---|
19512 | }}};
|
---|
19513 | AjxDispatcher.addPackageLoadFunction("Startup2",new AjxCallback(skin,skin._mail_handleStartup2Load));
|
---|
19514 | VelodromeSkin.prototype._mail_handleMailCoreLoad=function(){
|
---|
19515 | var e=window.ZmDoublePaneController&&ZmDoublePaneController.prototype;
|
---|
19516 | if(e){
|
---|
19517 | this.overrideAPI(e,"_getToolBarOps",this._DoublePane_getToolBarOps);
|
---|
19518 | this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
|
---|
19519 | this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations)
|
---|
19520 | }
|
---|
19521 | var e=window.ZmMailListController&&ZmMailListController.prototype;
|
---|
19522 | if(e){
|
---|
19523 | this.overrideAPI(e,"_initializeToolBar",this._MailList_initializeToolBar);
|
---|
19524 | this.overrideAPI(e,"_getToolBarOps",this._MailList_getToolBarOps);
|
---|
19525 | this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
|
---|
19526 | this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations);
|
---|
19527 | this.overrideAPI(e,"_setupGroupByMenuItems",this._Mail_setupGroupByMenuItems)
|
---|
19528 | }
|
---|
19529 | ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_MESSAGE]="newMessage";
|
---|
19530 | ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_FOLDER]="newFolder"
|
---|
19531 | };
|
---|
19532 | VelodromeSkin.prototype._mail_handleMailLoad=function(){
|
---|
19533 | var e=window.ZmMsgController&&ZmMsgController.prototype;
|
---|
19534 | if(e){
|
---|
19535 | this.overrideAPI(e,"_getToolBarOps",this._Msg_getToolBarOps);
|
---|
19536 | this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
|
---|
19537 | this.overrideAPI(e,"_getTabParams",this._Msg_getTabParams)
|
---|
19538 | }
|
---|
19539 | var e=window.ZmConvController&&ZmConvController.prototype;
|
---|
19540 | if(e){
|
---|
19541 | this.overrideAPI(e,"_getToolBarOps",this._Conv_getToolBarOps);
|
---|
19542 | this.overrideAPI(e,"_getDefaultToolBarOps",this._Mail_getDefaultToolBarOps);
|
---|
19543 | this.overrideAPI(e,"_resetOperations",this._Mail_resetOperations)
|
---|
19544 | }
|
---|
19545 | var e=window.ZmComposeController&&ZmComposeController.prototype;
|
---|
19546 | if(e){
|
---|
19547 | this.overrideAPI(e,"_getTabParams",this._Compose_getTabParams)
|
---|
19548 | }};
|
---|
19549 | AjxDispatcher.addPackageLoadFunction("MailCore",new AjxCallback(skin,skin._mail_handleMailCoreLoad));
|
---|
19550 | AjxDispatcher.addPackageLoadFunction("Mail",new AjxCallback(skin,skin._mail_handleMailLoad));
|
---|
19551 | VelodromeSkin.prototype._getContactListToolBarOps=function(){
|
---|
19552 | return[ZmOperation.NEW_MENU,ZmOperation.SEP,ZmOperation.EDIT,ZmOperation.SEP,ZmOperation.DELETE,ZmOperation.PRINT,ZmOperation.SEP,ZmOperation.TAG_MENU]
|
---|
19553 | };
|
---|
19554 | VelodromeSkin.prototype._getContactListActionMenuOps=function(){
|
---|
19555 | var e=this._participantOps();
|
---|
19556 | e.push(ZmOperation.SEP,ZmOperation.TAG_MENU,ZmOperation.DELETE,ZmOperation.PRINT_CONTACT);
|
---|
19557 | return e
|
---|
19558 | };
|
---|
19559 | VelodromeSkin.prototype.addRow=function(e,t){
|
---|
19560 | arguments.callee.func.apply(this,arguments);
|
---|
19561 | if(this._rowCount>=this._maxRows){
|
---|
19562 | return
|
---|
19563 | }
|
---|
19564 | if(t==null){
|
---|
19565 | t=this._rowCount-1
|
---|
19566 | }
|
---|
19567 | e=e||(this._rowDef&&AjxUtil.createProxy(this._rowDef));
|
---|
19568 | if(!e){
|
---|
19569 | return
|
---|
19570 | }
|
---|
19571 | e.id=e.id||this._items[t].id;
|
---|
19572 | var a={};
|
---|
19573 | a.id=e.id+"_helptext";
|
---|
19574 | a.visible="true";
|
---|
19575 | var o=this._registerControl(a,null,null,null,null,"DwtLabel");
|
---|
19576 | var i=this._items[e.id];
|
---|
19577 | i._helpId=a.id;
|
---|
19578 | this._setControlIds(i.id,t);
|
---|
19579 | if(this._itemDef.id=="EMAIL"){
|
---|
19580 | this._setFirstHelpText(ZmMsg.contactEditAddRemoveHelp)
|
---|
19581 | }};
|
---|
19582 | VelodromeSkin.prototype.removeRow=function(e){
|
---|
19583 | arguments.callee.func.apply(this,arguments);
|
---|
19584 | if(this._itemDef.id=="EMAIL"){
|
---|
19585 | this._setFirstHelpText(ZmMsg.contactEditAddRemoveHelp)
|
---|
19586 | }};
|
---|
19587 | VelodromeSkin.prototype._setFirstHelpText=function(o){
|
---|
19588 | for(var e=0;
|
---|
19589 | e<this._rowCount;
|
---|
19590 | e++){
|
---|
19591 | var a=this._items[e]._helpId;
|
---|
19592 | if(a){
|
---|
19593 | var t=this._items[a].control;
|
---|
19594 | if(t){
|
---|
19595 | t.setText((e==0)?o:"")
|
---|
19596 | }}}};
|
---|
19597 | VelodromeSkin.prototype._setControlIds=function(i,e){
|
---|
19598 | arguments.callee.func.apply(this,arguments);
|
---|
19599 | var o=[this.getHTMLElId(),e].join("_");
|
---|
19600 | var t=this._items[i];
|
---|
19601 | var a=this._items[t._helpId];
|
---|
19602 | this._setControlId(a&&a.control,o+"_helptext")
|
---|
19603 | };
|
---|
19604 | VelodromeSkin.prototype._handleContactsLoad=function(){
|
---|
19605 | var e=window.ZmContactListController&&ZmContactListController.prototype;
|
---|
19606 | if(e){
|
---|
19607 | this.overrideAPI(e,"_getToolBarOps",this._getContactListToolBarOps);
|
---|
19608 | this.overrideAPI(e,"_getActionMenuOps",this._getContactListActionMenuOps)
|
---|
19609 | }
|
---|
19610 | var e=window.ZmEditContactViewInputSelectRows&&ZmEditContactViewInputSelectRows.prototype;
|
---|
19611 | if(e){
|
---|
19612 | this.overrideAPI(e,"addRow",this.addRow);
|
---|
19613 | this.overrideAPI(e,"removeRow",this.removeRow);
|
---|
19614 | this.overrideAPI(e,"_setControlIds",this._setControlIds);
|
---|
19615 | this.overrideAPI(e,"_setFirstHelpText",this._setFirstHelpText)
|
---|
19616 | }
|
---|
19617 | ZmEditContactViewRows.prototype.ROW_TEMPLATE="abook.Contacts#ZmEditContactViewRow"
|
---|
19618 | };
|
---|
19619 | VelodromeSkin.prototype._handleContactsCoreLoad=function(){
|
---|
19620 | ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_CONTACT]="newContact";
|
---|
19621 | ZmOperation.NEW_ITEM_KEY[ZmOperation.NEW_GROUP]="newGroup"
|
---|
19622 | };
|
---|
19623 | AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,skin._handleContactsLoad));
|
---|
19624 | AjxDispatcher.addPackageLoadFunction("ContactsCore",new AjxCallback(skin,skin._handleContactsCoreLoad));
|
---|
19625 | VelodromeSkin.prototype._SignaturesPage_initialize=function(t){
|
---|
19626 | t.getHtmlElement().innerHTML=AjxTemplate.expand(ZmSignaturesPage.SIGNATURE_TEMPLATE,{
|
---|
19627 | id:this._htmlElId}
|
---|
19628 | );
|
---|
19629 | var r=document.getElementById(this._htmlElId+"_SIG_LIST");
|
---|
19630 | var h=new ZmSignatureListView(this);
|
---|
19631 | this._replaceControlElement(r,h);
|
---|
19632 | h.setMultiSelect(false);
|
---|
19633 | h.addSelectionListener(new AjxListener(this,this._selectionListener));
|
---|
19634 | h.setUI(null,true);
|
---|
19635 | this._sigList=h;
|
---|
19636 | var a=document.getElementById(this._htmlElId+"_SIG_NAME");
|
---|
19637 | var o={
|
---|
19638 | parent:this,type:DwtInputField.STRING,required:true,validationStyle:DwtInputField.CONTINUAL_VALIDATION,validator:AjxCallback.simpleClosure(this._updateName,this)};
|
---|
19639 | var c=this._sigName=new DwtInputField(o);
|
---|
19640 | this._replaceControlElement(a,c);
|
---|
19641 | var l=document.getElementById(this._htmlElId+"_SIG_FORMAT");
|
---|
19642 | if(l&&appCtxt.get(ZmSetting.HTML_COMPOSE_ENABLED)){
|
---|
19643 | var d=new DwtSelect(this);
|
---|
19644 | d.setToolTipContent(ZmMsg.formatTooltip);
|
---|
19645 | d.addOption(ZmMsg.formatAsText,1,true);
|
---|
19646 | d.addOption(ZmMsg.formatAsHtml,0,false);
|
---|
19647 | d.addChangeListener(new AjxListener(this,this._handleFormatSelect));
|
---|
19648 | this._replaceControlElement(l,d);
|
---|
19649 | this._sigFormat=d
|
---|
19650 | }
|
---|
19651 | var e=document.getElementById(this._htmlElId+"_SIG_BUTTON");
|
---|
19652 | var n=new DwtButton(this);
|
---|
19653 | n.setText(ZmMsg.del);
|
---|
19654 | n.addSelectionListener(new AjxListener(this,this._handleDeleteButton));
|
---|
19655 | this._replaceControlElement(e,n);
|
---|
19656 | this._sigBtn=n;
|
---|
19657 | var i=document.getElementById(this._htmlElId+"_SIG_EDITOR");
|
---|
19658 | var s=new ZmSignatureEditor(this);
|
---|
19659 | this._replaceControlElement(i,s);
|
---|
19660 | this._sigEditor=s
|
---|
19661 | };
|
---|
19662 | VelodromeSkin.prototype._SignaturesPage_validate=function(){
|
---|
19663 | if(this._selSignature){
|
---|
19664 | this._updateSignature()
|
---|
19665 | }
|
---|
19666 | var h=this.getAllSignatures(true);
|
---|
19667 | var e=appCtxt.get(ZmSetting.SIGNATURE_MAX_LENGTH);
|
---|
19668 | for(var n=0;
|
---|
19669 | n<h.length;
|
---|
19670 | n++){
|
---|
19671 | var t=h[n];
|
---|
19672 | var r=(t.name.replace(/\s*/g,"")=="");
|
---|
19673 | var o=(t.value.replace(/\s*/g,"")=="");
|
---|
19674 | var l=new RegExp("^"+ZmMsg.signature+"\\s#(\\d+)$","i");
|
---|
19675 | var a=t.name.match(l);
|
---|
19676 | if(r&&o){
|
---|
19677 | this._deleteSignature(t)
|
---|
19678 | }else{
|
---|
19679 | if(r||(o&&!a)){
|
---|
19680 | this._errorMsg=r?ZmMsg.signatureNameMissingRequired:ZmMsg.signatureValueMissingRequired;
|
---|
19681 | return false
|
---|
19682 | }}
|
---|
19683 | var s=t.value;
|
---|
19684 | if(s.length>e){
|
---|
19685 | this._errorMsg=AjxMessageFormat.format((t.contentType==ZmMimeTable.TEXT_HTML)?ZmMsg.errorHtmlSignatureTooLong:ZmMsg.errorSignatureTooLong,e);
|
---|
19686 | return false
|
---|
19687 | }}
|
---|
19688 | return true
|
---|
19689 | };
|
---|
19690 | VelodromeSkin.prototype._preferences_handlePreferencesLoad=function(){
|
---|
19691 | var e=window.ZmSignaturesPage&&ZmSignaturesPage.prototype;
|
---|
19692 | if(e){
|
---|
19693 | this.overrideAPI(e,"_initialize",this._SignaturesPage_initialize);
|
---|
19694 | this.overrideAPI(e,"validate",this._SignaturesPage_validate)
|
---|
19695 | }};
|
---|
19696 | AjxDispatcher.addPackageLoadFunction("Preferences",new AjxCallback(skin,skin._preferences_handlePreferencesLoad));
|
---|
19697 | VelodromeSkin.F_homeAddress="homeAddress";
|
---|
19698 | VelodromeSkin.F_otherAddress="otherAddress";
|
---|
19699 | VelodromeSkin.F_otherAnniversary="otherAnniversary";
|
---|
19700 | VelodromeSkin.F_otherAsstName="otherAsstName";
|
---|
19701 | VelodromeSkin.F_otherCustom="otherCustom";
|
---|
19702 | VelodromeSkin.F_otherDepartment="otherDepartment";
|
---|
19703 | VelodromeSkin.F_otherMgrName="otherMgrName";
|
---|
19704 | VelodromeSkin.F_otherOffice="otherOffice";
|
---|
19705 | VelodromeSkin.F_otherProfession="otherProfession";
|
---|
19706 | VelodromeSkin.F_tollFree="tollFree";
|
---|
19707 | VelodromeSkin.F_workAddress="workAddress";
|
---|
19708 | VelodromeSkin.F_workEmail="workEmail";
|
---|
19709 | VelodromeSkin.F_workIMAddress="workIM";
|
---|
19710 | VelodromeSkin.F_workMobile="workMobile";
|
---|
19711 | VelodromeSkin.F_imNone="_NONE";
|
---|
19712 | VelodromeSkin.F_imYahoo="yahoo";
|
---|
19713 | VelodromeSkin.F_imAOL="aol";
|
---|
19714 | VelodromeSkin.F_imMSN="msn";
|
---|
19715 | VelodromeSkin.F_imOther="other";
|
---|
19716 | VelodromeSkin.prototype._customContactFields_packageLoad=function(){
|
---|
19717 | window.VelodromeSkinOther=function(){
|
---|
19718 | ZmEditContactViewOther.apply(this,arguments)
|
---|
19719 | };
|
---|
19720 | VelodromeSkinOther.prototype=new ZmEditContactViewOther;
|
---|
19721 | VelodromeSkinOther.prototype.constructor=VelodromeSkinOther;
|
---|
19722 | VelodromeSkinOther.prototype.DATE_ATTRS={
|
---|
19723 | birthday:true,otherAnniversary:true};
|
---|
19724 | VelodromeSkinOther.prototype._createSelect=function(){
|
---|
19725 | var t=ZmEditContactViewInputSelect.prototype._createSelect.apply(this,arguments);
|
---|
19726 | t.addChangeListener(new AjxListener(this,this._resetPicker));
|
---|
19727 | return t
|
---|
19728 | };
|
---|
19729 | ZmEditContactView.updateFieldLists();
|
---|
19730 | ZmEditContactView.LISTS.EMAIL.onlyvalue=false;
|
---|
19731 | ZmEditContactView.LISTS.IM.onlyvalue=false;
|
---|
19732 | ZmEditContactView.LISTS.VELODROME_ADDRESS=ZmEditContactView.LISTS.ADDRESS;
|
---|
19733 | ZmEditContactView.ATTRS.DEPARTMENT=VelodromeSkin.F_otherDepartment;
|
---|
19734 | delete ZmEditContactView.LISTS.ADDRESS;
|
---|
19735 | ZmEditContactView.ALWAYS_SHOW={
|
---|
19736 | FIRST:true,LAST:true,TITLE:true,COMPANY:true};
|
---|
19737 | var e=ZmEditContactView.prototype;
|
---|
19738 | this.overrideAPI(e,"getFormItems");
|
---|
19739 | this.overrideAPI(e,"getEmailOptions");
|
---|
19740 | this.overrideAPI(e,"getPhoneOptions");
|
---|
19741 | this.overrideAPI(e,"getIMOptions");
|
---|
19742 | this.overrideAPI(e,"getIMOptions2");
|
---|
19743 | this.overrideAPI(e,"getAddressOptions");
|
---|
19744 | this.overrideAPI(e,"getURLOptions");
|
---|
19745 | this.overrideAPI(e,"getOtherOptions");
|
---|
19746 | this.overrideAPI(e,"getFileAsOptions")
|
---|
19747 | };
|
---|
19748 | VelodromeSkin.prototype._customContactFields_basePackageLoad=function(){
|
---|
19749 | ZmContact.EMAIL_FIELDS=[ZmContact.F_email,VelodromeSkin.F_workEmail];
|
---|
19750 | ZmContact.PHONE_FIELDS=[ZmContact.F_mobilePhone,ZmContact.F_homePhone,ZmContact.F_otherPhone,ZmContact.F_homeFax,ZmContact.F_pager,ZmContact.F_workPhone,VelodromeSkin.F_workMobile,ZmContact.F_workAltPhone,ZmContact.F_workFax,ZmContact.F_assistantPhone,ZmContact.F_companyPhone,ZmContact.F_otherFax,VelodromeSkin.F_tollFree];
|
---|
19751 | ZmContact.IM_FIELDS=[ZmContact.F_imAddress,VelodromeSkin.F_workIMAddress];
|
---|
19752 | ZmContact.ADDRESS_FIELDS=[VelodromeSkin.F_homeAddress,VelodromeSkin.F_workAddress,VelodromeSkin.F_otherAddress];
|
---|
19753 | ZmContact.OTHER_FIELDS=[ZmContact.F_birthday,VelodromeSkin.F_otherAnniversary,VelodromeSkin.F_otherOffice,VelodromeSkin.F_otherProfession,VelodromeSkin.F_otherMgrName,VelodromeSkin.F_otherAsstName,VelodromeSkin.F_otherCustom];
|
---|
19754 | ZmContact.updateFieldConstants();
|
---|
19755 | ZmContact.IS_ADDONE[VelodromeSkin.F_workEmail]=true;
|
---|
19756 | ZmContact.IS_ADDONE[VelodromeSkin.F_workIMAddress]=true;
|
---|
19757 | ZmContact.IS_ADDONE[VelodromeSkin.F_otherCustom]=true;
|
---|
19758 | ZmContact.IGNORE_NORMALIZATION=[ZmContact.F_homePhone]
|
---|
19759 | };
|
---|
19760 | VelodromeSkin.prototype.getFormItems=function(){
|
---|
19761 | var t=arguments.callee.func.apply(this,arguments);
|
---|
19762 | if(!t._modified){
|
---|
19763 | t._modified=true;
|
---|
19764 | var i=this.getFormItemById("IM",t);
|
---|
19765 | i.type="ZmEditContactViewInputDoubleSelectRows";
|
---|
19766 | i.rowitem={
|
---|
19767 | type:"ZmEditContactViewIMDouble",equals:ZmEditContactViewInputSelect.equals,params:{
|
---|
19768 | hint:ZmMsg.imScreenNameHint,cols:60,options:this.getIMOptions(),options2:this.getIMOptions2()}};
|
---|
19769 | i.maxrows=4;
|
---|
19770 | var a=this.getFormItemById("ADDRESS",t);
|
---|
19771 | a.id="VELODROME_ADDRESS",a.rowitem={
|
---|
19772 | type:"ZmEditContactViewInputSelect",equals:ZmEditContactViewInputSelect.equals,template:"abook.Contacts#ZmEditContactViewAddressSelect",params:{
|
---|
19773 | hint:"Address",cols:40,rows:3,options:this.getAddressOptions()}};
|
---|
19774 | var e=this.getFormItemById("OTHER",t);
|
---|
19775 | e.rowitem.type="VelodromeSkinOther"
|
---|
19776 | }
|
---|
19777 | return t
|
---|
19778 | };
|
---|
19779 | VelodromeSkin.prototype.getEmailOptions=function(){
|
---|
19780 | return[{
|
---|
19781 | value:ZmContact.F_email,label:"Home",max:3}
|
---|
19782 | ,{
|
---|
19783 | value:VelodromeSkin.F_workEmail,label:"Work",max:3}
|
---|
19784 | ]
|
---|
19785 | };
|
---|
19786 | VelodromeSkin.prototype.getPhoneOptions=function(){
|
---|
19787 | return[{
|
---|
19788 | value:ZmContact.F_mobilePhone,label:"Mobile",max:1}
|
---|
19789 | ,{
|
---|
19790 | value:ZmContact.F_homePhone,label:"Home",max:1}
|
---|
19791 | ,{
|
---|
19792 | value:ZmContact.F_otherPhone,label:"Home Alternate",max:1}
|
---|
19793 | ,{
|
---|
19794 | value:ZmContact.F_homeFax,label:"Home Fax",max:1}
|
---|
19795 | ,{
|
---|
19796 | value:ZmContact.F_pager,label:"Work Pager",max:1}
|
---|
19797 | ,{
|
---|
19798 | value:ZmContact.F_workPhone,label:"Work",max:1}
|
---|
19799 | ,{
|
---|
19800 | value:VelodromeSkin.F_workMobile,label:"Work Mobile",max:1}
|
---|
19801 | ,{
|
---|
19802 | value:ZmContact.F_workAltPhone,label:"Work Alternate",max:1}
|
---|
19803 | ,{
|
---|
19804 | value:ZmContact.F_workFax,label:"Work Fax",max:1}
|
---|
19805 | ,{
|
---|
19806 | value:ZmContact.F_assistantPhone,label:"Assistant",max:1}
|
---|
19807 | ,{
|
---|
19808 | value:ZmContact.F_companyPhone,label:"Company",max:1}
|
---|
19809 | ,{
|
---|
19810 | value:ZmContact.F_otherFax,label:"Other Fax",max:1}
|
---|
19811 | ,{
|
---|
19812 | value:VelodromeSkin.F_tollFree,label:"Toll Free",max:1}
|
---|
19813 | ]
|
---|
19814 | };
|
---|
19815 | VelodromeSkin.prototype.getIMOptions2=function(){
|
---|
19816 | return[{
|
---|
19817 | value:VelodromeSkin.F_imNone,label:ZmMsg.none}
|
---|
19818 | ,{
|
---|
19819 | value:VelodromeSkin.F_imYahoo,label:ZmMsg.imGateway_yahoo}
|
---|
19820 | ,{
|
---|
19821 | value:VelodromeSkin.F_imAOL,label:ZmMsg.imGateway_aol}
|
---|
19822 | ,{
|
---|
19823 | value:VelodromeSkin.F_imMSN,label:ZmMsg.imGateway_msn}
|
---|
19824 | ,{
|
---|
19825 | value:VelodromeSkin.F_imOther,label:ZmMsg.other}
|
---|
19826 | ]
|
---|
19827 | };
|
---|
19828 | VelodromeSkin.prototype.getIMOptions=function(){
|
---|
19829 | return[{
|
---|
19830 | value:ZmContact.F_imAddress,label:"Home",max:2}
|
---|
19831 | ,{
|
---|
19832 | value:VelodromeSkin.F_workIMAddress,label:"Work",max:2}
|
---|
19833 | ]
|
---|
19834 | };
|
---|
19835 | VelodromeSkin.prototype.getAddressOptions=function(){
|
---|
19836 | return[{
|
---|
19837 | value:VelodromeSkin.F_homeAddress,label:"Home",max:1}
|
---|
19838 | ,{
|
---|
19839 | value:VelodromeSkin.F_workAddress,label:"Work",max:1}
|
---|
19840 | ,{
|
---|
19841 | value:VelodromeSkin.F_otherAddress,label:ZmMsg.other,max:1}
|
---|
19842 | ]
|
---|
19843 | };
|
---|
19844 | VelodromeSkin.prototype.getURLOptions=function(){
|
---|
19845 | return[{
|
---|
19846 | value:ZmContact.F_homeURL,label:"Home",max:1}
|
---|
19847 | ,{
|
---|
19848 | value:ZmContact.F_workURL,label:"Work",max:1}
|
---|
19849 | ]
|
---|
19850 | };
|
---|
19851 | VelodromeSkin.prototype.getOtherOptions=function(){
|
---|
19852 | return[{
|
---|
19853 | value:ZmContact.F_birthday,label:"Birthday",max:1}
|
---|
19854 | ,{
|
---|
19855 | value:VelodromeSkin.F_otherAnniversary,label:"Anniversary",max:1}
|
---|
19856 | ,{
|
---|
19857 | value:VelodromeSkin.F_otherOffice,label:"Office",max:1}
|
---|
19858 | ,{
|
---|
19859 | value:VelodromeSkin.F_otherProfession,label:"Profession",max:1}
|
---|
19860 | ,{
|
---|
19861 | value:VelodromeSkin.F_otherMgrName,label:"Manager",max:1}
|
---|
19862 | ,{
|
---|
19863 | value:VelodromeSkin.F_otherAsstName,label:"Assistant",max:1}
|
---|
19864 | ,{
|
---|
19865 | value:VelodromeSkin.F_otherCustom,label:"Custom",max:4}
|
---|
19866 | ]
|
---|
19867 | };
|
---|
19868 | VelodromeSkin.prototype.getFileAsOptions=function(){
|
---|
19869 | return arguments.callee.func.apply(this,arguments)
|
---|
19870 | };
|
---|
19871 | AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,skin._customContactFields_packageLoad));
|
---|
19872 | AjxDispatcher.addPackageLoadFunction("ContactsCore",new AjxCallback(skin,skin._customContactFields_basePackageLoad));
|
---|
19873 | JSON=function(){};
|
---|
19874 | (function(){
|
---|
19875 | function e(t){
|
---|
19876 | return t<10?"0"+t:t
|
---|
19877 | }
|
---|
19878 | if(typeof Date.prototype.toJSON!=="function"){
|
---|
19879 | Date.prototype.toJSON=function(t){
|
---|
19880 | return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"Z":null
|
---|
19881 | }
|
---|
19882 | }
|
---|
19883 | String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(t){
|
---|
19884 | return this.valueOf()
|
---|
19885 | }
|
---|
19886 | }
|
---|
19887 | )();
|
---|
19888 | JSON.cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
---|
19889 | JSON.escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
---|
19890 | JSON.meta={
|
---|
19891 | "\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
|
---|
19892 | JSON.rep;
|
---|
19893 | JSON.quote=function(e){
|
---|
19894 | JSON.escapable.lastIndex=0;
|
---|
19895 | return JSON.escapable.test(e)?'"'+e.replace(JSON.escapable,function(t){
|
---|
19896 | var i=JSON.meta[t];
|
---|
19897 | return typeof i==="string"?i:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)
|
---|
19898 | }
|
---|
19899 | )+'"':'"'+e+'"'
|
---|
19900 | };
|
---|
19901 | JSON.str=function(h,n){
|
---|
19902 | var a,t,l,e,s=JSON.gap,o,r=n[h];
|
---|
19903 | if(r&&typeof r==="object"&&typeof r.toJSON==="function"){
|
---|
19904 | r=r.toJSON(h)
|
---|
19905 | }
|
---|
19906 | if(typeof JSON.rep==="function"){
|
---|
19907 | r=JSON.rep.call(n,h,r)
|
---|
19908 | }
|
---|
19909 | switch(typeof r){
|
---|
19910 | case"string":return JSON.quote(r);
|
---|
19911 | case"number":return isFinite(r)?String(r):"null";
|
---|
19912 | case"boolean":case"null":return String(r);
|
---|
19913 | case"object":if(!r){
|
---|
19914 | return"null"
|
---|
19915 | }
|
---|
19916 | JSON.gap+=JSON.indent;
|
---|
19917 | o=[];
|
---|
19918 | if(Object.prototype.toString.apply(r)==="[object Array]"){
|
---|
19919 | e=r.length;
|
---|
19920 | for(a=0;
|
---|
19921 | a<e;
|
---|
19922 | a+=1){
|
---|
19923 | o[a]=str(a,r)||"null"
|
---|
19924 | }
|
---|
19925 | l=o.length===0?"[]":JSON.gap?"[\n"+JSON.gap+o.join(",\n"+JSON.gap)+"\n"+s+"]":"["+o.join(",")+"]";
|
---|
19926 | JSON.gap=s;
|
---|
19927 | return l
|
---|
19928 | }
|
---|
19929 | if(JSON.rep&&typeof JSON.rep==="object"){
|
---|
19930 | e=JSON.rep.length;
|
---|
19931 | for(a=0;
|
---|
19932 | a<e;
|
---|
19933 | a+=1){
|
---|
19934 | t=JSON.rep[a];
|
---|
19935 | if(typeof t==="string"){
|
---|
19936 | l=str(t,r);
|
---|
19937 | if(l){
|
---|
19938 | o.push(JSON.quote(t)+(JSON.gap?": ":":")+l)
|
---|
19939 | }}}}else{
|
---|
19940 | for(t in r){
|
---|
19941 | if(Object.hasOwnProperty.call(r,t)){
|
---|
19942 | l=str(t,r);
|
---|
19943 | if(l){
|
---|
19944 | o.push(JSON.quote(t)+(JSON.gap?": ":":")+l)
|
---|
19945 | }}}}
|
---|
19946 | l=o.length===0?"{}":JSON.gap?"{\n"+JSON.gap+o.join(",\n"+JSON.gap)+"\n"+s+"}":"{"+o.join(",")+"}";
|
---|
19947 | JSON.gap=s;
|
---|
19948 | return l
|
---|
19949 | }};
|
---|
19950 | JSON.stringify=function(o,t,a){
|
---|
19951 | var e;
|
---|
19952 | JSON.gap="";
|
---|
19953 | JSON.indent="";
|
---|
19954 | if(typeof a==="number"){
|
---|
19955 | for(e=0;
|
---|
19956 | e<a;
|
---|
19957 | e+=1){
|
---|
19958 | JSON.indent+=" "
|
---|
19959 | }}else{
|
---|
19960 | if(typeof a==="string"){
|
---|
19961 | JSON.indent=a
|
---|
19962 | }}
|
---|
19963 | JSON.rep=t;
|
---|
19964 | if(t&&typeof t!=="function"&&(typeof t!=="object"||typeof t.length!=="number")){
|
---|
19965 | throw new Error("JSON.stringify")
|
---|
19966 | }
|
---|
19967 | return JSON.str("",{
|
---|
19968 | "":o}
|
---|
19969 | )
|
---|
19970 | };
|
---|
19971 | JSON.parse=function(text,reviver){
|
---|
19972 | var j;
|
---|
19973 | var walk=function walk(holder,key){
|
---|
19974 | var k,v,value=holder[key];
|
---|
19975 | if(value&&typeof value==="object"){
|
---|
19976 | for(k in value){
|
---|
19977 | if(Object.hasOwnProperty.call(value,k)){
|
---|
19978 | v=walk(value,k);
|
---|
19979 | if(v!==undefined){
|
---|
19980 | value[k]=v
|
---|
19981 | }else{
|
---|
19982 | delete value[k]
|
---|
19983 | }}}}
|
---|
19984 | return reviver.call(holder,key,value)
|
---|
19985 | };
|
---|
19986 | text=String(text);
|
---|
19987 | JSON.lastIndex=0;
|
---|
19988 | if(JSON.cx.test(text)){
|
---|
19989 | text=text.replace(JSON.cx,function(a){
|
---|
19990 | return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)
|
---|
19991 | }
|
---|
19992 | )
|
---|
19993 | }
|
---|
19994 | if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){
|
---|
19995 | j=eval("("+text+")");
|
---|
19996 | return typeof reviver==="function"?walk({
|
---|
19997 | "":j}
|
---|
19998 | ,""):j
|
---|
19999 | }
|
---|
20000 | throw new SyntaxError("JSON.parse")
|
---|
20001 | };
|
---|
20002 | window.PLAXO_URL_BASE="http://calendar.comcast.net";
|
---|
20003 | window.CIMA_URL="https://login.comcast.net/api/web-access?c=cal";
|
---|
20004 | Comcast_plaxosync_map={};
|
---|
20005 | Comcast_plaxosync_map.z2p={
|
---|
20006 | anniversary:"anniversary",assistantPhone:"assistantPhone",birthday:"birthday",callbackPhone:"callbackPhone",carPhone:"carPhone",company:"company",companyPhone:"companyPhone",department:"deptName",email:"homeEmail1",email2:"homeEmail2",email3:"homeEmail3",firstName:"firstName",homeCity:"homeCity",homeCountry:"homeCountry",homeFax:"homeFax",homePhone:"homePhone1",homePhone2:"homePhone2",homePostalCode:"homePostalCode",homeState:"homeState",homeStreet:"homeAddress",homeURL:"homeWebPage",image:"workPhotoURL",jobTitle:"jobTitle",lastName:"lastName",middleName:"middleName",mobilePhone:"homeMobile",namePrefix:"nameTitle",nameSuffix:"nameSuffix",nickname:"nickname",otherCity:"otherCity",otherCountry:"otherCountry",otherFax:"otherFax",otherPhone:"otherPhone",otherPostalCode:"otherPostalCode",otherState:"otherState",otherStreet:"otherAddress",pager:"workPager",workCity:"workCity",workCountry:"workCountry",workEmail1:"workEmail1",workEmail2:"workEmail2",workEmail3:"workEmail3",workFax:"workFax",workMobile:"workMobile",workPhone:"workPhone1",workAltPhone:"workPhone2",workPostalCode:"workPostalCode",workState:"workState",workStreet:"workStreet",workURL:"workWebPage",workCardMessage:"workCardMessage",homeCardMessage:"homeCardMessage",fullName:null,itemId:"itemId"};
|
---|
20007 | Comcast_plaxosync_map.p2z={};
|
---|
20008 | for(var key in Comcast_plaxosync_map.z2p){
|
---|
20009 | if(Comcast_plaxosync_map.z2p[key]){
|
---|
20010 | Comcast_plaxosync_map.p2z[Comcast_plaxosync_map.z2p[key]]=key
|
---|
20011 | }}
|
---|
20012 | Comcast_plaxosync_map.p2z.email="email";
|
---|
20013 | Comcast_plaxosync_map.im_z2p={
|
---|
20014 | imAddress:"homeIMList",workIM:"workIMList"};
|
---|
20015 | Comcast_plaxosync_map.imPattern=/(\w+):\/\/(.+)/;
|
---|
20016 | Comcast_plaxosync_map.map=function(s,o){
|
---|
20017 | if(AjxUtil.isObject(o)){
|
---|
20018 | if(AjxUtil.isArray(s)){
|
---|
20019 | var n=[];
|
---|
20020 | for(var a=0;
|
---|
20021 | a<s.length;
|
---|
20022 | a++){
|
---|
20023 | n.push(Comcast_plaxosync_map.map(s[a],o))
|
---|
20024 | }
|
---|
20025 | return n
|
---|
20026 | }else{
|
---|
20027 | if(AjxUtil.isObject(s)){
|
---|
20028 | var n={};
|
---|
20029 | for(var t in s){
|
---|
20030 | if(t!=null){
|
---|
20031 | var e=o[t]||null;
|
---|
20032 | if(e!=null){
|
---|
20033 | n[e]=s[t]
|
---|
20034 | }}}
|
---|
20035 | return n
|
---|
20036 | }else{
|
---|
20037 | if(AxjUtil.isString(s)){
|
---|
20038 | return o[s]
|
---|
20039 | }}}}
|
---|
20040 | return null
|
---|
20041 | };
|
---|
20042 | Comcast_plaxosync_map.map_z2p=function(t){
|
---|
20043 | if(AjxUtil.isArray(t)){
|
---|
20044 | var e=[];
|
---|
20045 | for(var n=0;
|
---|
20046 | n<t.length;
|
---|
20047 | n++){
|
---|
20048 | var o=t[n];
|
---|
20049 | var s=Comcast_plaxosync_map.map(o,Comcast_plaxosync_map.z2p);
|
---|
20050 | var r=Comcast_plaxosync_map.mapIM_z2p(o);
|
---|
20051 | s=AjxUtil.hashUpdate(s,r,true);
|
---|
20052 | e.push(s)
|
---|
20053 | }
|
---|
20054 | return e
|
---|
20055 | }else{
|
---|
20056 | if(AjxUtil.isObject(t)){
|
---|
20057 | var e=Comcast_plaxosync_map.map(t,Comcast_plaxosync_map.z2p);
|
---|
20058 | var a=Comcast_plaxosync_map.mapIM_z2p(t);
|
---|
20059 | e=AjxUtil.hashUpdate(e,a,true);
|
---|
20060 | return e
|
---|
20061 | }}};
|
---|
20062 | Comcast_plaxosync_map.map_p2z=function(t){
|
---|
20063 | if(AjxUtil.isArray(t)){
|
---|
20064 | var e=[];
|
---|
20065 | for(var n=0;
|
---|
20066 | n<t.length;
|
---|
20067 | n++){
|
---|
20068 | var r=t[n];
|
---|
20069 | var o=Comcast_plaxosync_map.map(r,Comcast_plaxosync_map.p2z);
|
---|
20070 | var a=Comcast_plaxosync_map.mapIM_p2z(r);
|
---|
20071 | o=AjxUtil.hashUpdate(o,a,true);
|
---|
20072 | e.push(o)
|
---|
20073 | }
|
---|
20074 | return e
|
---|
20075 | }else{
|
---|
20076 | if(AjxUtil.isObject(t)){
|
---|
20077 | var e=Comcast_plaxosync_map.map(t,Comcast_plaxosync_map.p2z);
|
---|
20078 | var s=Comcast_plaxosync_map.mapIM_p2z(t);
|
---|
20079 | e=AjxUtil.hashUpdate(e,s,true);
|
---|
20080 | return e
|
---|
20081 | }}};
|
---|
20082 | Comcast_plaxosync_map.mapIM_z2p=function(d){
|
---|
20083 | if(AjxUtil.isObject(d)){
|
---|
20084 | var a={};
|
---|
20085 | for(var e in Comcast_plaxosync_map.im_z2p){
|
---|
20086 | var r=Comcast_plaxosync_map.im_z2p[e];
|
---|
20087 | var o=new RegExp(e+"(\\d+)");
|
---|
20088 | var h=[];
|
---|
20089 | for(var c in d){
|
---|
20090 | var n=o.exec(c);
|
---|
20091 | if(n&&n.length>=2){
|
---|
20092 | var s=parseInt(n[1])-1;
|
---|
20093 | var l=d[c];
|
---|
20094 | if(l!=null){
|
---|
20095 | var t=Comcast_plaxosync_map.mapIM_z2p_single(l);
|
---|
20096 | if(t!=null){
|
---|
20097 | h[s]=t
|
---|
20098 | }}}}
|
---|
20099 | if(h.length>0){
|
---|
20100 | a[r]={
|
---|
20101 | imAddress:h}
|
---|
20102 | }}
|
---|
20103 | return a
|
---|
20104 | }};
|
---|
20105 | Comcast_plaxosync_map.mapIM_z2p_single=function(o){
|
---|
20106 | var t=Comcast_plaxosync_map.imPattern.exec(o);
|
---|
20107 | if(t&&t.length>=3){
|
---|
20108 | var e=t[1];
|
---|
20109 | var a=t[2];
|
---|
20110 | var i={};
|
---|
20111 | i.service=t[1];
|
---|
20112 | i.address=t[2];
|
---|
20113 | return i
|
---|
20114 | }
|
---|
20115 | return null
|
---|
20116 | };
|
---|
20117 | Comcast_plaxosync_map.mapIM_p2z=function(a){
|
---|
20118 | var u={};
|
---|
20119 | for(var t in Comcast_plaxosync_map.im_z2p){
|
---|
20120 | var c=Comcast_plaxosync_map.im_z2p[t];
|
---|
20121 | try{
|
---|
20122 | var l=a[c];
|
---|
20123 | var n=l.imAddress;
|
---|
20124 | var s=1;
|
---|
20125 | for(var r=0;
|
---|
20126 | r<n.length;
|
---|
20127 | r++){
|
---|
20128 | var d=n[r];
|
---|
20129 | var o=Comcast_plaxosync_map.mapIM_p2z_single(d);
|
---|
20130 | u[t+s]=o;
|
---|
20131 | s++
|
---|
20132 | }}
|
---|
20133 | catch(h){}}
|
---|
20134 | return u
|
---|
20135 | };
|
---|
20136 | Comcast_plaxosync_map.mapIM_p2z_single=function(e){
|
---|
20137 | return e.service.toLowerCase()+"://"+e.address
|
---|
20138 | };
|
---|
20139 | Comcast_plaxosync=function(){
|
---|
20140 | this.requestmgr=new Comcast_plaxosync_requestmgr();
|
---|
20141 | window.Comcast_plaxosync_instance=this
|
---|
20142 | };
|
---|
20143 | Comcast_plaxosync.DISPLAY_IFRAME=true;
|
---|
20144 | Comcast_plaxosync.prototype.toString=function(){
|
---|
20145 | return"Comcast_plaxosync"
|
---|
20146 | };
|
---|
20147 | Comcast_plaxosync.handleFrameData=function(e,a,t){
|
---|
20148 | if(AjxUtil.isString(e)){
|
---|
20149 | if(t){
|
---|
20150 | Comcast_plaxosync_instance.setIframeUrl(t)
|
---|
20151 | }
|
---|
20152 | var i={
|
---|
20153 | action:ZmOperation.NEW_MESSAGE,toOverride:e,subjOverride:a||""};
|
---|
20154 | AjxDispatcher.run("GetComposeController").doAction(i)
|
---|
20155 | }};
|
---|
20156 | Comcast_plaxosync.prototype.init=function(){
|
---|
20157 | var e=new AjxListener(this,this.init2);
|
---|
20158 | ZmZimbraMail.addListener(ZmAppEvent.PRE_STARTUP,e);
|
---|
20159 | ZmZimbraMail.addListener(ZmAppEvent.POST_STARTUP,e)
|
---|
20160 | };
|
---|
20161 | Comcast_plaxosync.prototype.init2=function(){
|
---|
20162 | if(!this._init2run){
|
---|
20163 | this._init2run=true;
|
---|
20164 | if(Comcast_plaxosync.DISPLAY_IFRAME){
|
---|
20165 | this._createIframeView()
|
---|
20166 | }
|
---|
20167 | this.requestmgr.init()
|
---|
20168 | }};
|
---|
20169 | Comcast_plaxosync.PLAXO_URL_SHOW_ALL=window.PLAXO_URL_BASE+"/ab/contactList/?skin=none";
|
---|
20170 | Comcast_plaxosync.PLAXO_URL_SHOW_CONTACT=window.PLAXO_URL_BASE+"/ab/home/contactView/{0}?skin=none";
|
---|
20171 | Comcast_plaxosync.PLAXO_URL_SHOW_SEARCH=window.PLAXO_URL_BASE+"/ab/contactList?skin=none&query=Search&src=addressBookSearch#search={0}";
|
---|
20172 | Comcast_plaxosync.PLAXO_URL_NEW_CONTACT=window.PLAXO_URL_BASE+"/ab/home/contactAdd/?skin=none&name={0}&email={1}&phone={2}";
|
---|
20173 | Comcast_plaxosync.PLAXO_URL_EDIT_CONTACT=window.PLAXO_URL_BASE+"/xfc/editContact?e={1}&n={0}&skin=none";
|
---|
20174 | Comcast_plaxosync.PLAXO_URL_NEW_GROUP=window.PLAXO_URL_BASE+"/ab/contactList?skin=none#createGroup=1";
|
---|
20175 | Comcast_plaxosync.prototype._createIframeView=function(){
|
---|
20176 | if(Comcast_plaxosync.DISPLAY_IFRAME){
|
---|
20177 | this.viewName="PlaxoFrame";
|
---|
20178 | this._iframeView=new ZmUpsellView({
|
---|
20179 | parent:appCtxt.getShell(),posStyle:Dwt.ABSOLUTE_STYLE,className:"ZmUpsellView"}
|
---|
20180 | );
|
---|
20181 | var i=this._iframeView.getHtmlElement();
|
---|
20182 | var t=[];
|
---|
20183 | var e=0;
|
---|
20184 | t[e++]="<iframe id='iframe_";
|
---|
20185 | t[e++]=this._iframeView.getHTMLElId();
|
---|
20186 | t[e++]="' ";
|
---|
20187 | if(this._iframeSrc){
|
---|
20188 | t[e++]="src='";
|
---|
20189 | t[e++]="'"
|
---|
20190 | }
|
---|
20191 | t[e++]=" width='100%' height='100%' frameborder='0'>";
|
---|
20192 | i.innerHTML=t.join("");
|
---|
20193 | var n={};
|
---|
20194 | n[ZmAppViewMgr.C_APP_CONTENT_FULL]=this._iframeView;
|
---|
20195 | var o={};
|
---|
20196 | o[ZmAppViewMgr.CB_POST_SHOW]=new AjxCallback(this,this.displayIframeView);
|
---|
20197 | appCtxt.getAppViewMgr().createView({
|
---|
20198 | viewId:this.viewName,elements:n,isTransient:false,callbacks:o}
|
---|
20199 | );
|
---|
20200 | var a=this.getIframe();
|
---|
20201 | a.onload=null
|
---|
20202 | }};
|
---|
20203 | Comcast_plaxosync.prototype.displayIframeView=function(e){
|
---|
20204 | if(Comcast_plaxosync.DISPLAY_IFRAME){
|
---|
20205 | var t=[ZmMsg.zimbraTitle,"Address Book"].join(": ");
|
---|
20206 | Dwt.setTitle(t)
|
---|
20207 | }};
|
---|
20208 | Comcast_plaxosync.prototype.getIframe=function(){
|
---|
20209 | if(!this._iframe){
|
---|
20210 | this._iframe=document.getElementById("iframe_"+this._iframeView.getHTMLElId())
|
---|
20211 | }
|
---|
20212 | return this._iframe
|
---|
20213 | };
|
---|
20214 | Comcast_plaxosync.prototype.getIframeView=function(){
|
---|
20215 | return this._iframeView
|
---|
20216 | };
|
---|
20217 | Comcast_plaxosync.prototype.setIframeUrl=function(t,o){
|
---|
20218 | if(Comcast_plaxosync.DISPLAY_IFRAME){
|
---|
20219 | if(t){
|
---|
20220 | this._iframeSrc=t
|
---|
20221 | }
|
---|
20222 | if(this._iframeView){
|
---|
20223 | var i=this.getIframe();
|
---|
20224 | if(i){
|
---|
20225 | var e=appCtxt.getAppViewMgr();
|
---|
20226 | if(o&&e.getCurrentViewId()!=this.viewName){
|
---|
20227 | appCtxt.getAppChooser().setSelected("Contacts");
|
---|
20228 | if(t){
|
---|
20229 | var a=AjxCallback.simpleClosure(this.displayIframe,this);
|
---|
20230 | if(AjxEnv.isIE){
|
---|
20231 | i.attachEvent("onload",a)
|
---|
20232 | }else{
|
---|
20233 | Dwt.setHandler(i,"onload",a)
|
---|
20234 | }
|
---|
20235 | this._displayLoading()
|
---|
20236 | }}else{
|
---|
20237 | Dwt.clearHandler(i,"onload")
|
---|
20238 | }
|
---|
20239 | if(t){
|
---|
20240 | i.src=t
|
---|
20241 | }}}}};
|
---|
20242 | Comcast_plaxosync.prototype.displayIframe=function(){
|
---|
20243 | var e=appCtxt.getAppViewMgr();
|
---|
20244 | e.popView(ZmId.VIEW_LOADING,true);
|
---|
20245 | e.pushView(this.viewName);
|
---|
20246 | appCtxt.getAppChooser().setSelected("Contacts")
|
---|
20247 | };
|
---|
20248 | Comcast_plaxosync.prototype._displayLoading=function(){
|
---|
20249 | if(!appCtxt.inStartup){
|
---|
20250 | appCtxt.getAppViewMgr().pushView(ZmId.VIEW_LOADING,true)
|
---|
20251 | }};
|
---|
20252 | Comcast_plaxosync.prototype.add=function(a,t,i){
|
---|
20253 | i=i||this[t];
|
---|
20254 | if(i){
|
---|
20255 | var e=a[t];
|
---|
20256 | a[t]=function(){
|
---|
20257 | var o=arguments;
|
---|
20258 | o.push(e.apply(this,arguments));
|
---|
20259 | return i.apply(this,o)
|
---|
20260 | };
|
---|
20261 | a[t].func=e
|
---|
20262 | }};
|
---|
20263 | Comcast_plaxosync.parseQuery=function(e){
|
---|
20264 | locFound=/.*:.*/.test(e);
|
---|
20265 | match=locFound&&/(.*)\(.*:(.*)\)$/.exec(e);
|
---|
20266 | return{
|
---|
20267 | location:(match&&AjxStringUtil.trim(match[2]))||(locFound&&e)||"",searchfor:(match&&AjxStringUtil.trim(match[1]))||(!locFound&&e)||""}
|
---|
20268 | };
|
---|
20269 | Comcast_plaxosync.getFirstAttr=function(e,n,o){
|
---|
20270 | for(var a=0;
|
---|
20271 | a<n.length;
|
---|
20272 | a++){
|
---|
20273 | var t=n[a];
|
---|
20274 | if(e[t]){
|
---|
20275 | return e[t]
|
---|
20276 | }}
|
---|
20277 | return o
|
---|
20278 | };
|
---|
20279 | VelodromeSkin.prototype.sendRequest=function(o){
|
---|
20280 | var a=o.jsonObj;
|
---|
20281 | var e;
|
---|
20282 | if(a){
|
---|
20283 | var i=window.plaxosync.requestmgr;
|
---|
20284 | var n=new AjxCallback(this,this._handleDataReturn,o);
|
---|
20285 | if(a.CreateContactRequest){
|
---|
20286 | i.createContactRequest(a.CreateContactRequest,n);
|
---|
20287 | delete a.CreateContactRequest
|
---|
20288 | }
|
---|
20289 | if(a.ModifyContactRequest){
|
---|
20290 | i.modifyContactRequest(a.ModifyContactRequest,n);
|
---|
20291 | delete a.ModifyContactRequest
|
---|
20292 | }
|
---|
20293 | if(a.ContactActionRequest){
|
---|
20294 | i.contactActionRequest(a.ContactActionRequest,n);
|
---|
20295 | delete a.ContactActionRequest
|
---|
20296 | }
|
---|
20297 | for(var t in a){
|
---|
20298 | if(a[t]&&(t!="SearchRequest"||!e)){
|
---|
20299 | return this.sendRequest.func.call(this,o)
|
---|
20300 | }}}else{
|
---|
20301 | return this.sendRequest.func.call(this,o)
|
---|
20302 | }};
|
---|
20303 | VelodromeSkin.prototype._handleDataReturn=function(a,e){
|
---|
20304 | var t=a.jsonObj;
|
---|
20305 | if(t){
|
---|
20306 | if(t.SearchRequest){
|
---|
20307 | if(t.SearchRequest.types){
|
---|
20308 | a.callback=new AjxCallback(this,function(o,i){
|
---|
20309 | i._data.SearchResponse.cn=e.Body.SearchResponse.cn;
|
---|
20310 | o.run(i)
|
---|
20311 | }
|
---|
20312 | ,a.callback);
|
---|
20313 | this.sendRequest.func.call(this,a);
|
---|
20314 | return
|
---|
20315 | }}
|
---|
20316 | a.response=e;
|
---|
20317 | this.sendRequest.func.call(this,a)
|
---|
20318 | }};
|
---|
20319 | VelodromeSkin.prototype.load=function(i,e,t){
|
---|
20320 | this.isCanonical=true;
|
---|
20321 | var a=new AjxCallback(this,this._handleResponseLoad,[i]);
|
---|
20322 | window.plaxosync.requestmgr.getContacts(new AjxCallback(this,this._handleResponseLoad,[i]))
|
---|
20323 | };
|
---|
20324 | VelodromeSkin.prototype._handleResponseLoad=function(r,i){
|
---|
20325 | for(var s in i){
|
---|
20326 | var e=i[s];
|
---|
20327 | var o={}
|
---|
20328 | ,n={};
|
---|
20329 | for(var t in e){
|
---|
20330 | var a=e[t];
|
---|
20331 | if(ZmContactList.IS_CONTACT_FIELD[t]){
|
---|
20332 | o[t]=a
|
---|
20333 | }else{
|
---|
20334 | n[t]=a
|
---|
20335 | }}
|
---|
20336 | o._attrs=n;
|
---|
20337 | o.id=s;
|
---|
20338 | this._addContact(o)
|
---|
20339 | }
|
---|
20340 | this._finishLoading();
|
---|
20341 | if(r){
|
---|
20342 | r.run()
|
---|
20343 | }};
|
---|
20344 | VelodromeSkin.prototype._show=function(e,s){
|
---|
20345 | if(Comcast_plaxosync.DISPLAY_IFRAME){
|
---|
20346 | if(e){
|
---|
20347 | if(e.type==ZmItem.GROUP){
|
---|
20348 | var o=Comcast_plaxosync.PLAXO_URL_NEW_GROUP
|
---|
20349 | }else{
|
---|
20350 | var i=[e.attr.firstName||"",e.attr.middleName||"",e.attr.lastName||""].join(" ").replace(/\s+/g," ");
|
---|
20351 | i=i.replace(/^\s+|\s+$/g,"");
|
---|
20352 | var n=["email","workEmail1"];
|
---|
20353 | var a=Comcast_plaxosync.getFirstAttr(e.attr,n,"");
|
---|
20354 | var t=Comcast_plaxosync.getFirstAttr(e.attr,ZmContact.PHONE_FIELDS,"");
|
---|
20355 | var o=(e.id)?AjxMessageFormat.format(Comcast_plaxosync.PLAXO_URL_EDIT_CONTACT,[i,a]):AjxMessageFormat.format(Comcast_plaxosync.PLAXO_URL_NEW_CONTACT,[i,a,t])
|
---|
20356 | }
|
---|
20357 | window.plaxosync.setIframeUrl(o,true)
|
---|
20358 | }}else{
|
---|
20359 | arguments.callee.func.apply(this,arguments)
|
---|
20360 | }};
|
---|
20361 | VelodromeSkin.prototype._Portalshow=function(e,t){
|
---|
20362 | window.location="http://xfinityconnect.mail.comcast.net/"
|
---|
20363 | };
|
---|
20364 | VelodromeSkin.prototype._doSearch=function(s,e,r,t){
|
---|
20365 | var i=s.types||this.getTypes(s);
|
---|
20366 | if(Comcast_plaxosync.DISPLAY_IFRAME&&((AjxUtil.isArray(i)&&i.length==1&&i[0]==ZmItem.CONTACT)||(i instanceof AjxVector&&i.size()==1&&i.get(0)==ZmItem.CONTACT))){
|
---|
20367 | var o=s.query;
|
---|
20368 | var n=o&&Comcast_plaxosync.parseQuery(o);
|
---|
20369 | var a;
|
---|
20370 | if(n&&n.searchfor){
|
---|
20371 | window.plaxosync.setIframeUrl(AjxMessageFormat.format(Comcast_plaxosync.PLAXO_URL_SHOW_SEARCH,[n.searchfor]),true)
|
---|
20372 | }else{
|
---|
20373 | if(!window.plaxosync._iframeSrc){
|
---|
20374 | window.plaxosync.setIframeUrl(Comcast_plaxosync.PLAXO_URL_SHOW_ALL,true)
|
---|
20375 | }else{
|
---|
20376 | window.plaxosync.displayIframe()
|
---|
20377 | }}}
|
---|
20378 | arguments.callee.func.apply(this,arguments)
|
---|
20379 | };
|
---|
20380 | VelodromeSkin.prototype._defaultView=function(){
|
---|
20381 | if(Comcast_plaxosync.DISPLAY_IFRAME){
|
---|
20382 | return window.plaxosync.viewName
|
---|
20383 | }else{
|
---|
20384 | return(appCtxt.get(ZmSetting.CONTACTS_VIEW)=="cards")?ZmId.VIEW_CONTACT_CARDS:ZmId.VIEW_CONTACT_SIMPLE
|
---|
20385 | }};
|
---|
20386 | VelodromeSkin.prototype.switchView=function(e,a,i,t){
|
---|
20387 | if(Comcast_plaxosync.DISPLAY_IFRAME){
|
---|
20388 | e=window.plaxosync.viewName;
|
---|
20389 | i=true;
|
---|
20390 | if(!this._appViews[e]){
|
---|
20391 | this._appViews[e]=window.plaxosync.getIframeView()
|
---|
20392 | }}
|
---|
20393 | return arguments.callee.func.call(this,e,a,i,t)
|
---|
20394 | };
|
---|
20395 | VelodromeSkin.prototype.listShow=function(){
|
---|
20396 | this.switchView(window.plaxosync.viewName)
|
---|
20397 | };
|
---|
20398 | VelodromeSkin.prototype._createNewView=function(e){
|
---|
20399 | if(e==window.plaxosync.viewName){
|
---|
20400 | return window.plaxosync.getIframeView()
|
---|
20401 | }
|
---|
20402 | return arguments.callee.func.apply(this,arguments)
|
---|
20403 | };
|
---|
20404 | VelodromeSkin.prototype._initializeListView=function(e){
|
---|
20405 | if(e==window.plaxosync.viewName){
|
---|
20406 | this._listView[e]=this._createNewView(e)
|
---|
20407 | }else{
|
---|
20408 | arguments.callee.func.apply(this,arguments)
|
---|
20409 | }};
|
---|
20410 | VelodromeSkin.prototype._handleContactsCoreLoad=function(){
|
---|
20411 | this.overrideAPI(ZmContactList.prototype,"load",this.load);
|
---|
20412 | this.overrideAPI(ZmContactList.prototype,"_handleResponseLoad",this._handleResponseLoad)
|
---|
20413 | };
|
---|
20414 | VelodromeSkin.prototype._handleContactsLoad=function(){
|
---|
20415 | this.overrideAPI(ZmContactController.prototype,"show",this._show);
|
---|
20416 | this.overrideAPI(ZmContactListController.prototype,"_defaultView",this._defaultView);
|
---|
20417 | this.overrideAPI(ZmContactListController.prototype,"show",this.listShow);
|
---|
20418 | this.overrideAPI(ZmContactListController.prototype,"_createNewView",this._createNewView);
|
---|
20419 | this.overrideAPI(ZmContactListController.prototype,"_initializeListView",this._initializeListView);
|
---|
20420 | this.overrideAPI(ZmContactListController.prototype,"switchView",this.switchView);
|
---|
20421 | this.overrideAPI(ZmContactListController.prototype,"_setViewContents",AjxCallback.returnFalse);
|
---|
20422 | this.overrideAPI(ZmContactListController.prototype,"_resetOperations",AjxCallback.returnFalse)
|
---|
20423 | };
|
---|
20424 | VelodromeSkin.prototype._handlePortalLoad=function(){
|
---|
20425 | this.overrideAPI(ZmPortalController.prototype,"show",this._Portalshow)
|
---|
20426 | };
|
---|
20427 | VelodromeSkin.prototype._handleStartupLoad=function(){
|
---|
20428 | window.plaxosync=new Comcast_plaxosync();
|
---|
20429 | this.overrideAPI(ZmRequestMgr.prototype,"sendRequest",this.sendRequest);
|
---|
20430 | this.overrideAPI(ZmRequestMgr.prototype,"_handleDataReturn",this._handleDataReturn);
|
---|
20431 | this.overrideAPI(ZmSearchController.prototype,"_doSearch",this._doSearch);
|
---|
20432 | window.plaxosync.init()
|
---|
20433 | };
|
---|
20434 | AjxDispatcher.addPackageLoadFunction("Contacts",new AjxCallback(skin,skin._handleContactsLoad));
|
---|
20435 | AjxDispatcher.addPackageLoadFunction("Portal",new AjxCallback(skin,skin._handlePortalLoad));
|
---|
20436 | AjxDispatcher.addPackageLoadFunction("Startup1_2",new AjxCallback(skin,skin._handleStartupLoad));
|
---|
20437 | Comcast_plaxosync_requestmgr=function(){
|
---|
20438 | this.session=null;
|
---|
20439 | this.token=null;
|
---|
20440 | this.clientId="cal"
|
---|
20441 | };
|
---|
20442 | Comcast_plaxosync_requestmgr.prototype.init=function(){
|
---|
20443 | this._cimaQueue=[]
|
---|
20444 | };
|
---|
20445 | Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON=window.PLAXO_URL_BASE+"/axis/json/contact";
|
---|
20446 | Comcast_plaxosync_requestmgr.PLAXO_CONTACT_URL=window.PLAXO_URL_BASE+"/axis/contact";
|
---|
20447 | Comcast_plaxosync_requestmgr.PLAXO_FOLDER_JSON=window.PLAXO_URL_BASE+"/axis/json/folder";
|
---|
20448 | Comcast_plaxosync_requestmgr.SEARCH_FIELDS=["firstName","lastName","fullName"];
|
---|
20449 | Comcast_plaxosync_requestmgr.PROMPT_IF_MISSING=true;
|
---|
20450 | Comcast_plaxosync_requestmgr.prototype.getCIMAAccess=function(){
|
---|
20451 | this._cimaQueue=[];
|
---|
20452 | var t="/service/proxy?target="+AjxStringUtil.urlComponentEncode(window.CIMA_URL);
|
---|
20453 | var e=AjxCookie.getCookie(document,"s_ticket")||(Comcast_plaxosync_requestmgr.PROMPT_IF_MISSING&&prompt("Please enter a valid comcast s_ticket cookie value",""));
|
---|
20454 | if(e){
|
---|
20455 | var a={
|
---|
20456 | Authorization:"cima-session "+e,"Content-type":"application/x-www-form-urlencoded"};
|
---|
20457 | var i=new AjxCallback(this,this._handleGetCIMAAccess);
|
---|
20458 | AjxRpc.invoke("",t,a,i,false,0)
|
---|
20459 | }else{
|
---|
20460 | appCtxt.setStatusMsg("Login failed: nonexistent s_ticket",ZmStatusView.LEVEL_CRITICAL);
|
---|
20461 | this._cimaQueue=null
|
---|
20462 | }};
|
---|
20463 | Comcast_plaxosync_requestmgr.findDescendant=function(n){
|
---|
20464 | if(arguments.length<2){
|
---|
20465 | return n
|
---|
20466 | }
|
---|
20467 | var e=AjxUtil.isArray(arguments[1])?arguments[1]:Array.prototype.slice.call(arguments,1);
|
---|
20468 | for(var a=0;
|
---|
20469 | a<e.length;
|
---|
20470 | a++){
|
---|
20471 | var t=e[a];
|
---|
20472 | if(t instanceof RegExp){
|
---|
20473 | for(var o in n){
|
---|
20474 | if(t.test(o)){
|
---|
20475 | n=n[o];
|
---|
20476 | break
|
---|
20477 | }}}else{
|
---|
20478 | n=n[t]
|
---|
20479 | }
|
---|
20480 | if(!n){
|
---|
20481 | return null
|
---|
20482 | }}
|
---|
20483 | return n
|
---|
20484 | };
|
---|
20485 | Comcast_plaxosync_requestmgr.prototype._handleGetCIMAAccess=function(e){
|
---|
20486 | if(e.success){
|
---|
20487 | var n=AjxXmlDoc.createFromDom(e.xml).toJSObject();
|
---|
20488 | var o=Comcast_plaxosync_requestmgr.findDescendant(n,"cima:ServiceToken",/^[^:]+:GetSessionResponse/,"response","session","__msh_content");
|
---|
20489 | if(o){
|
---|
20490 | if(o.match(/^[\d:]+$/)){
|
---|
20491 | this.session=o
|
---|
20492 | }else{
|
---|
20493 | this.token=o
|
---|
20494 | }}
|
---|
20495 | this.userid=Comcast_plaxosync_requestmgr.findDescendant(n,"cima:ServiceToken",/^[^:]+:GetSessionResponse/,"response","userId","__msh_content");
|
---|
20496 | if(!this.token&&!this.session){
|
---|
20497 | appCtxt.setStatusMsg("Login failed: invalid s_ticket",ZmStatusView.LEVEL_CRITICAL)
|
---|
20498 | }else{
|
---|
20499 | if(this._cimaQueue&&this._cimaQueue.length){
|
---|
20500 | for(var a=0;
|
---|
20501 | a<this._cimaQueue.length;
|
---|
20502 | a++){
|
---|
20503 | this._cimaQueue[a].run()
|
---|
20504 | }}
|
---|
20505 | this._cimaQueue=null
|
---|
20506 | }}else{
|
---|
20507 | appCtxt.setStatusMsg("Login failed: cannot connect to single-signon service",ZmStatusView.LEVEL_CRITICAL)
|
---|
20508 | }};
|
---|
20509 | Comcast_plaxosync_requestmgr.prototype.send=function(i,t,r,o,s){
|
---|
20510 | var e=new AjxCallback(this,this.receive,[r||null]);
|
---|
20511 | var a="/service/proxy?target="+AjxStringUtil.urlEncode(i);
|
---|
20512 | if(AjxUtil.isObject(t)){
|
---|
20513 | t=AjxStringUtil.objToString(t)
|
---|
20514 | }
|
---|
20515 | var n={
|
---|
20516 | "Content-Type":"application/json; charset=utf-8"};
|
---|
20517 | if(AjxEnv.isIE6&&(location.protocol=="https:")){
|
---|
20518 | n.Connection="Close"
|
---|
20519 | }
|
---|
20520 | if(s&&AjxUtil.isObject(s)){
|
---|
20521 | n=Comcast_plaxosync_requestmgr.hashUpdate(n,s,true)
|
---|
20522 | }
|
---|
20523 | AjxRpc.invoke(t,a,n,e,o)
|
---|
20524 | };
|
---|
20525 | Comcast_plaxosync_requestmgr.prototype.receive=function(a,e){
|
---|
20526 | if(e.success&&a){
|
---|
20527 | var t=Comcast_plaxosync_requestmgr.evalJSON(AjxStringUtil.trim(e.text));
|
---|
20528 | a.run(t)
|
---|
20529 | }};
|
---|
20530 | Comcast_plaxosync_requestmgr.prototype.createContactRequest=function(s,h){
|
---|
20531 | if(this.isLoggedIn()){
|
---|
20532 | var n=s.cn.a;
|
---|
20533 | var r={};
|
---|
20534 | var a={};
|
---|
20535 | for(var o=0;
|
---|
20536 | o<n.length;
|
---|
20537 | o++){
|
---|
20538 | var t=n[o];
|
---|
20539 | a[t.n]=t._content
|
---|
20540 | }
|
---|
20541 | if(!a.firstName&&!a.containsKey.lastName&&!a.fullName&&!a.displayName){
|
---|
20542 | if(a.email){
|
---|
20543 | a.fullName=a.email
|
---|
20544 | }}
|
---|
20545 | var e={
|
---|
20546 | AddContactRequest:{
|
---|
20547 | authInfo:this.getAuthInfo(),contact:Comcast_plaxosync_map.map_z2p(a)}};
|
---|
20548 | this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,e,new AjxCallback(this,this.createContactResponse,[s,h]),false)
|
---|
20549 | }else{
|
---|
20550 | if(this._cimaQueue!==null){
|
---|
20551 | this._cimaQueue.push(new AjxCallback(this,this.createContactRequest,[s,h]))
|
---|
20552 | }else{
|
---|
20553 | this.createContactResponse(s,h,{}
|
---|
20554 | )
|
---|
20555 | }}};
|
---|
20556 | Comcast_plaxosync_requestmgr.prototype.createContactResponse=function(n,u,s){
|
---|
20557 | var c=s&&s.contact&&Comcast_plaxosync_map.map_p2z(s.contact);
|
---|
20558 | var d,t,h,o;
|
---|
20559 | if(c){
|
---|
20560 | d=this.pruneAttrs(c);
|
---|
20561 | t=c.itemId;
|
---|
20562 | h=""+t;
|
---|
20563 | o=ZmContact.computeFileAs(d)
|
---|
20564 | }
|
---|
20565 | var l=appCtxt.getActiveAccount().name;
|
---|
20566 | var e=n.cn.l;
|
---|
20567 | var a=new Date().getTime();
|
---|
20568 | var r=40500;
|
---|
20569 | var m=appCtxt.getRequestMgr()._highestNotifySeen+1;
|
---|
20570 | var i={
|
---|
20571 | Header:{
|
---|
20572 | context:{
|
---|
20573 | change:{
|
---|
20574 | token:r}
|
---|
20575 | ,notify:[{
|
---|
20576 | seq:m,created:c?{
|
---|
20577 | cn:[{
|
---|
20578 | id:h,l:e,d:a,rev:r,fileAsStr:o,_attrs:d}
|
---|
20579 | ]}
|
---|
20580 | :{}
|
---|
20581 | ,modified:c?{
|
---|
20582 | folder:[{
|
---|
20583 | id:e,n:8,s:0,i4ms:r,i4next:t+1}
|
---|
20584 | ]}
|
---|
20585 | :{}}
|
---|
20586 | ],_jsns:"urn:zimbra"}}
|
---|
20587 | ,Body:{
|
---|
20588 | CreateContactResponse:{
|
---|
20589 | cn:c?[{
|
---|
20590 | id:h,l:e,d:a,rev:r,fileAsStr:o,_attrs:d}
|
---|
20591 | ]:[],_jsns:"urn:zimbraMail"}}
|
---|
20592 | ,_jsns:"urn:zimbraSoap"};
|
---|
20593 | if(u){
|
---|
20594 | u.run(i)
|
---|
20595 | }
|
---|
20596 | return i
|
---|
20597 | };
|
---|
20598 | Comcast_plaxosync_requestmgr.prototype.modifyContactRequest=function(n,u){
|
---|
20599 | if(this.isLoggedIn()){
|
---|
20600 | var e=n.cn.id;
|
---|
20601 | var t=n.cn.a;
|
---|
20602 | var o={};
|
---|
20603 | var c={};
|
---|
20604 | for(var s=0;
|
---|
20605 | s<t.length;
|
---|
20606 | s++){
|
---|
20607 | var a=t[s];
|
---|
20608 | c[a.n]=a._content
|
---|
20609 | }
|
---|
20610 | var d;
|
---|
20611 | for(var s=0;
|
---|
20612 | s<ZmContact.ADDRESS_FIELDS.length&&!d;
|
---|
20613 | s++){
|
---|
20614 | if(o[ZmContact.ADDRESS_FIELDS[s]]){
|
---|
20615 | d=true
|
---|
20616 | }}
|
---|
20617 | if(!Comcast_plaxosync_requestmgr.NAME_FIELDS){
|
---|
20618 | Comcast_plaxosync_requestmgr.NAME_FIELDS=[ZmContact.F_firstName,ZmContact.F_lastName,ZmContact.F_maidenName,ZmContact.F_middleName,ZmContact.F_namePrefix,ZmContact.F_nameSuffix]
|
---|
20619 | }
|
---|
20620 | var r;
|
---|
20621 | for(var s=0;
|
---|
20622 | s<Comcast_plaxosync_requestmgr.NAME_FIELDS.length&&!r;
|
---|
20623 | s++){
|
---|
20624 | if(c[Comcast_plaxosync_requestmgr.NAME_FIELDS[s]]){
|
---|
20625 | r=true
|
---|
20626 | }}
|
---|
20627 | if(d||r){
|
---|
20628 | var h=appCtxt.getById(e);
|
---|
20629 | if(h){
|
---|
20630 | if(d){
|
---|
20631 | Comcast_plaxosync_requestmgr.hashUpdate(c,h.attr,true,null,ZmContact.ADDRESS_FIELDS)
|
---|
20632 | }
|
---|
20633 | if(r){
|
---|
20634 | Comcast_plaxosync_requestmgr.hashUpdate(c,h.attr,true,null,Comcast_plaxosync_requestmgr.NAME_FIELDS)
|
---|
20635 | }}}
|
---|
20636 | c.itemId=e;
|
---|
20637 | var l={
|
---|
20638 | SetContactRequest:{
|
---|
20639 | authInfo:this.getAuthInfo(),contact:Comcast_plaxosync_map.map_z2p(c)}};
|
---|
20640 | this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,l,new AjxCallback(this,this.modifyContactResponse,[n,u]),false)
|
---|
20641 | }else{
|
---|
20642 | if(this._cimaQueue!==null){
|
---|
20643 | this._cimaQueue.push(new AjxCallback(this,this.modifyContactRequest,[n,u]))
|
---|
20644 | }else{
|
---|
20645 | this.modifyContactResponse(n,u,{}
|
---|
20646 | )
|
---|
20647 | }}};
|
---|
20648 | Comcast_plaxosync_requestmgr.hashUpdate=function(o,i,t,n,e){
|
---|
20649 | for(var a in i){
|
---|
20650 | if((t||!(a in o))&&(!n||AjxUtil.indexOf(n,a)==-1)&&(!e||AjxUtil.indexOf(e,a)!=-1)){
|
---|
20651 | o[a]=i[a]
|
---|
20652 | }}
|
---|
20653 | return o
|
---|
20654 | };
|
---|
20655 | Comcast_plaxosync_requestmgr.prototype.modifyContactResponse=function(n,u,s){
|
---|
20656 | var c=s&&s.contact&&Comcast_plaxosync_map.map_p2z(s.contact);
|
---|
20657 | var d,o,t,h;
|
---|
20658 | if(c){
|
---|
20659 | d=this.pruneAttrs(c);
|
---|
20660 | o=ZmContact.computeFileAs(d);
|
---|
20661 | t=c.itemId;
|
---|
20662 | h=""+t
|
---|
20663 | }
|
---|
20664 | var l=appCtxt.getActiveAccount().name;
|
---|
20665 | var e=n.cn.l;
|
---|
20666 | var a=new Date().getTime();
|
---|
20667 | var r=41200;
|
---|
20668 | var m=appCtxt.getRequestMgr()._highestNotifySeen+1;
|
---|
20669 | var i={
|
---|
20670 | Header:{
|
---|
20671 | context:{
|
---|
20672 | change:{
|
---|
20673 | token:r}
|
---|
20674 | ,notify:[{
|
---|
20675 | seq:m,modified:c?{
|
---|
20676 | folder:[{
|
---|
20677 | id:e,n:12,s:0,i4ms:r,i4next:t+1}
|
---|
20678 | ],cn:[{
|
---|
20679 | id:t,f:"",d:a,rev:r,fileAsStr:o,_attrs:d}
|
---|
20680 | ]}
|
---|
20681 | :{}}
|
---|
20682 | ],_jsns:"urn:zimbra"}}
|
---|
20683 | ,Body:{
|
---|
20684 | ModifyContactResponse:{
|
---|
20685 | cn:c?[{
|
---|
20686 | id:t,l:e,d:a,rev:r,fileAsStr:o,_attrs:d}
|
---|
20687 | ]:[],_jsns:"urn:zimbraMail"}}
|
---|
20688 | ,_jsns:"urn:zimbraSoap"};
|
---|
20689 | if(u){
|
---|
20690 | u.run(i)
|
---|
20691 | }
|
---|
20692 | return i
|
---|
20693 | };
|
---|
20694 | Comcast_plaxosync_requestmgr.prototype.contactActionRequest=function(t,o){
|
---|
20695 | var i=t.action.id;
|
---|
20696 | var e=t.action.l;
|
---|
20697 | var a=t.action.op;
|
---|
20698 | if(a=="delete"||(a=="move"&&e==3)||a=="trash"){
|
---|
20699 | this.deleteContactRequest(new AjxCallback(this,this.contactActionResponse,[t,o]),i)
|
---|
20700 | }};
|
---|
20701 | Comcast_plaxosync_requestmgr.prototype.deleteContactRequest=function(t,e){
|
---|
20702 | return this.deleteContactsRequest(t,[e])
|
---|
20703 | };
|
---|
20704 | Comcast_plaxosync_requestmgr.prototype.deleteContactsRequest=function(a,t){
|
---|
20705 | if(this.isLoggedIn()){
|
---|
20706 | var e={
|
---|
20707 | DeleteContactsRequest:{
|
---|
20708 | authInfo:this.getAuthInfo(),itemIds:{
|
---|
20709 | delimited:{
|
---|
20710 | data:t.join(",")}}}};
|
---|
20711 | this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,e,new AjxCallback(this,this.deleteContactsResponse,[a]),false)
|
---|
20712 | }else{
|
---|
20713 | if(this._cimaQueue!==null){
|
---|
20714 | this._cimaQueue.push(new AjxCallback(this,this.deleteContactsRequest,[a,t]))
|
---|
20715 | }else{
|
---|
20716 | this.deleteContactsResponse(a,{}
|
---|
20717 | )
|
---|
20718 | }}};
|
---|
20719 | Comcast_plaxosync_requestmgr.prototype.deleteContactsResponse=function(i,t){
|
---|
20720 | var a=t&&t.affected;
|
---|
20721 | var e=t.response&&t.response["code"];
|
---|
20722 | if(i){
|
---|
20723 | i.run(t)
|
---|
20724 | }};
|
---|
20725 | Comcast_plaxosync_requestmgr.prototype.contactActionResponse=function(o,d,s){
|
---|
20726 | var u=!!(s&&s.affected);
|
---|
20727 | var c=appCtxt.getActiveAccount().name;
|
---|
20728 | var e=o.action.id;
|
---|
20729 | var f=appCtxt.getById(e);
|
---|
20730 | var t=o.action.l;
|
---|
20731 | var n=f.folderId;
|
---|
20732 | var l=o.action.op;
|
---|
20733 | var h=""+e;
|
---|
20734 | var a=new Date().getTime();
|
---|
20735 | var r=41200;
|
---|
20736 | var m=appCtxt.getRequestMgr()._highestNotifySeen+1;
|
---|
20737 | var i={
|
---|
20738 | Header:{
|
---|
20739 | context:{
|
---|
20740 | change:{
|
---|
20741 | token:r}
|
---|
20742 | ,notify:[{
|
---|
20743 | seq:m,modified:u?{
|
---|
20744 | folder:[{
|
---|
20745 | id:n,n:11,s:0,i4ms:r,i4next:5261}
|
---|
20746 | ,{
|
---|
20747 | id:t,n:167,s:491637,i4ms:r,i4next:5280}
|
---|
20748 | ],cn:[{
|
---|
20749 | id:h,l:t}
|
---|
20750 | ]}
|
---|
20751 | :{}}
|
---|
20752 | ],_jsns:"urn:zimbra"}}
|
---|
20753 | ,Body:{
|
---|
20754 | ContactActionResponse:{
|
---|
20755 | action:{
|
---|
20756 | id:h,op:l}
|
---|
20757 | ,_jsns:"urn:zimbraMail"}}
|
---|
20758 | ,_jsns:"urn:zimbraSoap"};
|
---|
20759 | if(d){
|
---|
20760 | d.run(i)
|
---|
20761 | }
|
---|
20762 | return i
|
---|
20763 | };
|
---|
20764 | Comcast_plaxosync_requestmgr.prototype.search=function(T,h){
|
---|
20765 | if(this.isLoggedIn()){
|
---|
20766 | var o=T.query&&AjxStringUtil.trim(T.query)||"";
|
---|
20767 | var r=T.fields;
|
---|
20768 | var a,f,t,m;
|
---|
20769 | var v=o&&Comcast_plaxosync.parseQuery(o);
|
---|
20770 | var z=T.limit||0;
|
---|
20771 | var d=T.offset||0;
|
---|
20772 | var l=v&&v.searchfor;
|
---|
20773 | if(l){
|
---|
20774 | l=l.replace(/[^\w\d]/g,"")
|
---|
20775 | }
|
---|
20776 | var e=-1;
|
---|
20777 | var q={};
|
---|
20778 | var n={};
|
---|
20779 | n.authInfo=this.getAuthInfo();
|
---|
20780 | if(z>0){
|
---|
20781 | var c={};
|
---|
20782 | c.limit=z;
|
---|
20783 | if(d>0){
|
---|
20784 | c.offset=d
|
---|
20785 | }
|
---|
20786 | n.page=c
|
---|
20787 | }
|
---|
20788 | var w=(l&&l.length);
|
---|
20789 | var u=(e>=0);
|
---|
20790 | if(w||u){
|
---|
20791 | var b={};
|
---|
20792 | if(w){
|
---|
20793 | var s={};
|
---|
20794 | var k={};
|
---|
20795 | var x=[];
|
---|
20796 | for(var j=0;
|
---|
20797 | j<Comcast_plaxosync_requestmgr.SEARCH_FIELDS.length;
|
---|
20798 | j++){
|
---|
20799 | var y={
|
---|
20800 | field:Comcast_plaxosync_requestmgr.SEARCH_FIELDS[j],op:"StartsWith",value:l};
|
---|
20801 | x.push(y)
|
---|
20802 | }
|
---|
20803 | k.byField=x;
|
---|
20804 | s.fields=k;
|
---|
20805 | s.op="Or";
|
---|
20806 | b.byFields=s
|
---|
20807 | }
|
---|
20808 | if(u){
|
---|
20809 | b.byFolderId=e
|
---|
20810 | }
|
---|
20811 | n.filters=b
|
---|
20812 | }
|
---|
20813 | if(r){
|
---|
20814 | var g=[];
|
---|
20815 | for(var j=0;
|
---|
20816 | j<r.length;
|
---|
20817 | j++){
|
---|
20818 | g.push(r[j].toString())
|
---|
20819 | }
|
---|
20820 | n.fields={
|
---|
20821 | field:g}
|
---|
20822 | }
|
---|
20823 | q.GetContactsRequest=n;
|
---|
20824 | this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,q,new AjxCallback(this,this._handleSearch,[h,d]),false)
|
---|
20825 | }else{
|
---|
20826 | if(this._cimaQueue!==null){
|
---|
20827 | this._cimaQueue.push(new AjxCallback(this,this.search,[T,h]))
|
---|
20828 | }else{
|
---|
20829 | this._handleSearch(h)
|
---|
20830 | }}};
|
---|
20831 | Comcast_plaxosync_requestmgr.prototype._handleSearch=function(n,o,i){
|
---|
20832 | var a=i&&i.contacts&&i.contacts["contact"];
|
---|
20833 | var t=i&&i.editCounter;
|
---|
20834 | var e=i&&i.totalCount;
|
---|
20835 | if(n){
|
---|
20836 | n.run(a&&Comcast_plaxosync_map.map_p2z(a),t,e,o)
|
---|
20837 | }};
|
---|
20838 | Comcast_plaxosync_requestmgr.prototype.searchRequest=function(e,t){
|
---|
20839 | this.search(e,new AjxCallback(this,this.searchResponse,[t]))
|
---|
20840 | };
|
---|
20841 | Comcast_plaxosync_requestmgr.prototype.searchResponse=function(m,a,d,f,n){
|
---|
20842 | var h=41200;
|
---|
20843 | a=a||[];
|
---|
20844 | var r=[];
|
---|
20845 | var t=new Date().getTime();
|
---|
20846 | for(var s=0;
|
---|
20847 | s<a.length;
|
---|
20848 | s++){
|
---|
20849 | var c=a[s];
|
---|
20850 | var u=this.pruneAttrs(c);
|
---|
20851 | var e={
|
---|
20852 | id:c.itemId,f:"",d:t,rev:h,fileAsStr:ZmContact.computeFileAs(c),_attrs:u};
|
---|
20853 | r.push(e)
|
---|
20854 | }
|
---|
20855 | r.sort(function(p,i){
|
---|
20856 | return p.fileAsStr>i.fileAsStr
|
---|
20857 | }
|
---|
20858 | );
|
---|
20859 | var l=appCtxt.getActiveAccount().name;
|
---|
20860 | var t=new Date().getTime();
|
---|
20861 | var o={
|
---|
20862 | Header:{
|
---|
20863 | context:{
|
---|
20864 | change:{
|
---|
20865 | token:h}
|
---|
20866 | ,_jsns:"urn:zimbra"}}
|
---|
20867 | ,Body:{
|
---|
20868 | SearchResponse:{
|
---|
20869 | sortBy:"com.zimbra.cs.index.LocalizedSortBy@a4f040",offset:n||0,cn:r,more:(a.length+n<f)?true:false,_jsns:"urn:zimbraMail"}}
|
---|
20870 | ,_jsns:"urn:zimbraSoap"};
|
---|
20871 | if(m){
|
---|
20872 | m.run(o)
|
---|
20873 | }
|
---|
20874 | return o
|
---|
20875 | };
|
---|
20876 | Comcast_plaxosync_requestmgr.prototype.autoCompleteRequest=function(e,a){
|
---|
20877 | var t={
|
---|
20878 | query:e.name._content};
|
---|
20879 | this.search(t,new AjxCallback(this,this.autoCompleteResponse,[e,a]))
|
---|
20880 | };
|
---|
20881 | Comcast_plaxosync_requestmgr.prototype.autoCompleteResponse=function(a,n,r){
|
---|
20882 | var b=41200;
|
---|
20883 | var o=a.name._content;
|
---|
20884 | var y=[];
|
---|
20885 | if(r){
|
---|
20886 | var s=new Date().getTime();
|
---|
20887 | for(var f=0;
|
---|
20888 | f<r.length&&f<1000;
|
---|
20889 | f++){
|
---|
20890 | var t=r[f];
|
---|
20891 | var d=this.pruneAttrs(t);
|
---|
20892 | var w=this.getFirstMatching(o,[d.displayName,d.fullName,AjxUtil.collapseList([d.firstName,d.middleName,d.lastName]).join(" ")]);
|
---|
20893 | var l=[d[ZmContact.F_email],d[ZmContact.F_workEmail1],d[ZmContact.F_email2],d[ZmContact.F_workEmail2],d[ZmContact.F_email3],d[ZmContact.F_workEmail3]];
|
---|
20894 | var g=AjxUtil.uniq(AjxUtil.collapseList(l));
|
---|
20895 | for(var m=0;
|
---|
20896 | m<g.length;
|
---|
20897 | m++){
|
---|
20898 | var u=g[m];
|
---|
20899 | var h=new AjxEmailAddress(u,null,w).toString();
|
---|
20900 | var p=this.getMatchScore(o,w,u);
|
---|
20901 | var c={
|
---|
20902 | id:t.itemId,email:h,type:"contact",ranking:p};
|
---|
20903 | y.push(c)
|
---|
20904 | }}
|
---|
20905 | y.sort(function(v,i){
|
---|
20906 | return v.ranking&&v.ranking<i.ranking
|
---|
20907 | }
|
---|
20908 | )
|
---|
20909 | }
|
---|
20910 | var e={
|
---|
20911 | Header:{
|
---|
20912 | context:{
|
---|
20913 | change:{
|
---|
20914 | token:b}
|
---|
20915 | ,_jsns:"urn:zimbra"}}
|
---|
20916 | ,Body:{
|
---|
20917 | AutoCompleteResponse:{
|
---|
20918 | canBeCached:true,match:y,_jsns:"urn:zimbraMail"}}
|
---|
20919 | ,_jsns:"urn:zimbraSoap"};
|
---|
20920 | if(n){
|
---|
20921 | n.run(e)
|
---|
20922 | }
|
---|
20923 | return e
|
---|
20924 | };
|
---|
20925 | Comcast_plaxosync_requestmgr.prototype.getContacts=function(e){
|
---|
20926 | this.search({
|
---|
20927 | fields:["NameFields","EmailFields","PhoneFields"]}
|
---|
20928 | ,new AjxCallback(this,this._handleGetContacts,[e]))
|
---|
20929 | };
|
---|
20930 | Comcast_plaxosync_requestmgr.prototype._handleGetContacts=function(o,e){
|
---|
20931 | if(e){
|
---|
20932 | var a={};
|
---|
20933 | for(var t=0;
|
---|
20934 | t<e.length;
|
---|
20935 | t++){
|
---|
20936 | a[e[t].itemId]=this.pruneAttrs(e[t])
|
---|
20937 | }
|
---|
20938 | if(o){
|
---|
20939 | o.run(a)
|
---|
20940 | }
|
---|
20941 | return a
|
---|
20942 | }};
|
---|
20943 | Comcast_plaxosync_requestmgr.prototype.getFirstMatching=function(n,o,a){
|
---|
20944 | var t=new RegExp(n,e);
|
---|
20945 | for(var e=0;
|
---|
20946 | e<o.length;
|
---|
20947 | e++){
|
---|
20948 | if(t.test(o[e])){
|
---|
20949 | return o[e]
|
---|
20950 | }}
|
---|
20951 | if(!AjxUtil.isUndefined(a)){
|
---|
20952 | return a
|
---|
20953 | }
|
---|
20954 | for(var e=0;
|
---|
20955 | e<o.length;
|
---|
20956 | e++){
|
---|
20957 | if(o[e]){
|
---|
20958 | return o[e]
|
---|
20959 | }}
|
---|
20960 | return o[o.length-1]
|
---|
20961 | };
|
---|
20962 | Comcast_plaxosync_requestmgr.prototype.getMatchScore=function(i,a,t){
|
---|
20963 | var o=0;
|
---|
20964 | if(i){
|
---|
20965 | i=i.toLowerCase();
|
---|
20966 | a=a&&a.toLowerCase();
|
---|
20967 | t=t&&t.toLowerCase();
|
---|
20968 | if(a){
|
---|
20969 | var e=a.indexOf(i);
|
---|
20970 | if(e!=-1){
|
---|
20971 | o+=(a.length-e)/a.length
|
---|
20972 | }}
|
---|
20973 | if(t){
|
---|
20974 | var e=t.indexOf(i);
|
---|
20975 | if(e!=-1){
|
---|
20976 | o+=(t.length-e)/t.length
|
---|
20977 | }}}
|
---|
20978 | return 0.5*o
|
---|
20979 | };
|
---|
20980 | Comcast_plaxosync_requestmgr.evalJSON=function(a){
|
---|
20981 | try{
|
---|
20982 | return JSON.parse(a)
|
---|
20983 | }
|
---|
20984 | catch(t){
|
---|
20985 | return{}
|
---|
20986 | }};
|
---|
20987 | Comcast_plaxosync_requestmgr.prototype.pruneAttrs=function(a){
|
---|
20988 | if(!this.validAttrs){
|
---|
20989 | if(ZmContact&&ZmContact.DISPLAY_FIELDS&&window.VelodromeSkinOther){
|
---|
20990 | this.validAttrs=AjxUtil.arrayAsHash(ZmContact.DISPLAY_FIELDS)
|
---|
20991 | }else{
|
---|
20992 | return Comcast_plaxosync_requestmgr.hashUpdate({}
|
---|
20993 | ,a,true,["itemId"])
|
---|
20994 | }}
|
---|
20995 | var t={};
|
---|
20996 | for(var i in a){
|
---|
20997 | var e=i.replace(/\d+$/,"");
|
---|
20998 | if(this.validAttrs[e]){
|
---|
20999 | t[i]=a[i]
|
---|
21000 | }}
|
---|
21001 | return t
|
---|
21002 | };
|
---|
21003 | Comcast_plaxosync_requestmgr.prototype.urlFormat=function(o){
|
---|
21004 | var e=[],a=0;
|
---|
21005 | for(var t in o){
|
---|
21006 | if(o[t]!==undefined){
|
---|
21007 | e[a++]=t+"="+o[t]
|
---|
21008 | }}
|
---|
21009 | return e.join("&")
|
---|
21010 | };
|
---|
21011 | Comcast_plaxosync_requestmgr.prototype.getCommonParams=function(){
|
---|
21012 | if(!this._commonParams){
|
---|
21013 | this._commonParams={
|
---|
21014 | u:appCtxt.getActiveAccount().getEmail()}
|
---|
21015 | }
|
---|
21016 | return this._commonParams
|
---|
21017 | };
|
---|
21018 | Comcast_plaxosync_requestmgr.prototype.isLoggedIn=function(){
|
---|
21019 | return !!((this.userid&&this.token)||this.session)
|
---|
21020 | };
|
---|
21021 | Comcast_plaxosync_requestmgr.prototype.getSessionType=function(){
|
---|
21022 | return"ShortSession"
|
---|
21023 | };
|
---|
21024 | Comcast_plaxosync_requestmgr.prototype.getClientInfo=function(){
|
---|
21025 | var e={};
|
---|
21026 | e.clientId=this.clientId;
|
---|
21027 | return e
|
---|
21028 | };
|
---|
21029 | Comcast_plaxosync_requestmgr.prototype.getAuthInfo=function(){
|
---|
21030 | var e={};
|
---|
21031 | e.sessionType="NoSession";
|
---|
21032 | if(this.clientId){
|
---|
21033 | e.clientInfo=this.getClientInfo()
|
---|
21034 | }
|
---|
21035 | if(this.userid&&this.token){
|
---|
21036 | e.authByToken=Comcast_plaxosync_requestmgr.getAuthByToken(this.userid,this.token)
|
---|
21037 | }else{
|
---|
21038 | if(this.session){
|
---|
21039 | e.authBySession=Comcast_plaxosync_requestmgr.getAuthBySession(this.session)
|
---|
21040 | }}
|
---|
21041 | return e
|
---|
21042 | };
|
---|
21043 | Comcast_plaxosync_requestmgr.prototype.loginPlain=function(a,t){
|
---|
21044 | var e={
|
---|
21045 | GetSessionRequest:{
|
---|
21046 | authInfo:{
|
---|
21047 | sessionType:this.getSessionType(),clientInfo:this.getClientInfo(),authByEmail:Comcast_plaxosync_requestmgr.getAuthByEmail(a,t)}}};
|
---|
21048 | this.send(Comcast_plaxosync_requestmgr.PLAXO_CONTACT_JSON,e,new AjxCallback(this,this._handleLoginResponse,[a]),false)
|
---|
21049 | };
|
---|
21050 | Comcast_plaxosync_requestmgr.prototype._handleLoginResponse=function(i,a){
|
---|
21051 | if(a){
|
---|
21052 | var e=a.response;
|
---|
21053 | if(e){
|
---|
21054 | var t=e.code;
|
---|
21055 | if(t==200){
|
---|
21056 | this.session=e.session;
|
---|
21057 | this.username=i;
|
---|
21058 | return
|
---|
21059 | }else{
|
---|
21060 | appCtxt.setStatusMsg("Login failed: "+e.message+" (Code "+e.code+")",ZmStatusView.LEVEL_CRITICAL);
|
---|
21061 | return
|
---|
21062 | }}}
|
---|
21063 | appCtxt.setStatusMsg("Login failed: Plaxo server sent invalid response",ZmStatusView.LEVEL_CRITICAL)
|
---|
21064 | };
|
---|
21065 | Comcast_plaxosync_requestmgr.getAuthBySession=function(e){
|
---|
21066 | return{
|
---|
21067 | session:e}
|
---|
21068 | };
|
---|
21069 | Comcast_plaxosync_requestmgr.getAuthByUhid=function(e,t){
|
---|
21070 | return{
|
---|
21071 | userId:e,password:t}
|
---|
21072 | };
|
---|
21073 | Comcast_plaxosync_requestmgr.getAuthByEmail=function(t,e){
|
---|
21074 | return{
|
---|
21075 | email:t,password:e}
|
---|
21076 | };
|
---|
21077 | Comcast_plaxosync_requestmgr.getAuthByComcast=function(t,e){
|
---|
21078 | return{
|
---|
21079 | comcastUsername:t,password:e}
|
---|
21080 | };
|
---|
21081 | Comcast_plaxosync_requestmgr.getAuthByIdentity=function(e,t){
|
---|
21082 | return{
|
---|
21083 | identity:e,password:t}
|
---|
21084 | };
|
---|
21085 | Comcast_plaxosync_requestmgr.getAuthByToken=function(t,e){
|
---|
21086 | return{
|
---|
21087 | userId:t,token:e}
|
---|
21088 | };
|
---|
21089 | </script>
|
---|
21090 |
|
---|
21091 | <script type="text/javascript" src="/zimbra/js/skin.js?client=advanced&skin=velodrome2&locale=en_US&debug=false&compress=true&templates=only&v=110527090709"></script>
|
---|
21092 |
|
---|
21093 | <script>
|
---|
21094 | // compile locale specific templates
|
---|
21095 | for (var pkg in window.AjxTemplateMsg) {
|
---|
21096 | var text = AjxTemplateMsg[pkg];
|
---|
21097 | AjxTemplate.compile(pkg, true, true, text);
|
---|
21098 | }
|
---|
21099 | </script>
|
---|
21100 |
|
---|
21101 | <script>
|
---|
21102 | var cacheKillerVersion = "110527090709";
|
---|
21103 | function launch() {
|
---|
21104 | // quit if this function has already been called
|
---|
21105 | if (arguments.callee.done) {return;}
|
---|
21106 |
|
---|
21107 | // flag this function so we don't do the same thing twice
|
---|
21108 | arguments.callee.done = true;
|
---|
21109 |
|
---|
21110 | // kill the timer
|
---|
21111 | if (_timer) {
|
---|
21112 | clearInterval(_timer);
|
---|
21113 | _timer = null;
|
---|
21114 | }
|
---|
21115 |
|
---|
21116 | var prodMode = true;
|
---|
21117 | var debugLevel = "";
|
---|
21118 | if (!prodMode || debugLevel) {
|
---|
21119 | AjxDispatcher.require("Debug");
|
---|
21120 | DBG = new AjxDebug(AjxDebug.NONE, null, false);
|
---|
21121 | // figure out the debug level
|
---|
21122 | if (debugLevel == 't') {
|
---|
21123 | DBG.showTiming(true);
|
---|
21124 | } else {
|
---|
21125 | DBG.setDebugLevel(debugLevel);
|
---|
21126 | }
|
---|
21127 | }
|
---|
21128 |
|
---|
21129 | AjxHistoryMgr.BLANK_FILE = "/zimbra/public/blankHistory.html";
|
---|
21130 | var noSplashScreen = "";
|
---|
21131 | var protocolMode = "http";
|
---|
21132 |
|
---|
21133 |
|
---|
21134 | var batchInfoResponse =
|
---|
21135 | // NOTE: Domain info settings moved into launch function to
|
---|
21136 | // prevent sloppy code from accessing extraneous window
|
---|
21137 | // scoped variable.
|
---|
21138 |
|
---|
21139 | var settings = {
|
---|
21140 | "dummy":1,
|
---|
21141 | "zimbraPrefMailItemsPerPage":"25",
|
---|
21142 | "zimbraPrefGroupMailBy":"message",
|
---|
21143 | "zimbraPrefSkin":"velodrome2",
|
---|
21144 | "zimbraPrefClientType":"advanced",
|
---|
21145 | "zimbraFeatureTasksEnabled":"FALSE",
|
---|
21146 | "zimbraFeatureNotebookEnabled":"FALSE",
|
---|
21147 | "zimbraFeatureIMEnabled":"FALSE",
|
---|
21148 | "zimbraFeatureVoiceEnabled":"TRUE",
|
---|
21149 | "zimbraFeatureContactsEnabled":"TRUE",
|
---|
21150 | "zimbraFeatureConversationsEnabled":"TRUE",
|
---|
21151 | "zimbraFeaturePortalEnabled":"TRUE",
|
---|
21152 | "zimbraFeatureVoiceUpsellEnabled":"FALSE",
|
---|
21153 | "zimbraFeatureOptionsEnabled":"TRUE",
|
---|
21154 | "zimbraFeatureMailEnabled":"TRUE",
|
---|
21155 | "zimbraFeatureCalendarUpsellEnabled":"TRUE",
|
---|
21156 | "zimbraFeatureCalendarEnabled":"FALSE",
|
---|
21157 | "zimbraWebClientLogoutURL":"https://login.comcast.net/logout?s=smartzone&continue=http://www.comcast.net",
|
---|
21158 | "zimbraWebClientLoginURL":"https://login.comcast.net/login?s=smartzone"
|
---|
21159 | };
|
---|
21160 |
|
---|
21161 | var params = {
|
---|
21162 | app:"mail",
|
---|
21163 | settings:settings, batchInfoResponse:batchInfoResponse,
|
---|
21164 | offlineMode:false, devMode:false,
|
---|
21165 | protocolMode:protocolMode, httpPort:"80", httpsPort:"443",
|
---|
21166 | noSplashScreen:noSplashScreen
|
---|
21167 | };
|
---|
21168 | ZmZimbraMail.run(params);
|
---|
21169 | }
|
---|
21170 |
|
---|
21171 | // START DOMContentLoaded
|
---|
21172 | // Mozilla and Opera 9 expose the event we could use
|
---|
21173 | if (document.addEventListener) {
|
---|
21174 | document.addEventListener("DOMContentLoaded", launch, null);
|
---|
21175 |
|
---|
21176 | // mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
|
---|
21177 | document.addEventListener("load", launch, null);
|
---|
21178 | }
|
---|
21179 |
|
---|
21180 | // for Internet Explorer. readyState will not be achieved on init call
|
---|
21181 | if (AjxEnv.isIE && AjxEnv.isWindows) {
|
---|
21182 | document.attachEvent("onreadystatechange", function(e) {
|
---|
21183 | if (document.readyState == "complete") {
|
---|
21184 | launch();
|
---|
21185 | }
|
---|
21186 | });
|
---|
21187 | }
|
---|
21188 |
|
---|
21189 | if (/(WebKit|khtml)/i.test(navigator.userAgent)) { // sniff
|
---|
21190 | var _timer = setInterval(function() {
|
---|
21191 | if (/loaded|complete/.test(document.readyState)) {
|
---|
21192 | launch();
|
---|
21193 | // call the onload handler
|
---|
21194 | }
|
---|
21195 | }, 10);
|
---|
21196 | }
|
---|
21197 | // END DOMContentLoaded
|
---|
21198 |
|
---|
21199 | AjxCore.addOnloadListener(launch);
|
---|
21200 | AjxCore.addOnunloadListener(ZmZimbraMail.unload);
|
---|
21201 | </script>
|
---|
21202 | </div>
|
---|
21203 |
|
---|
21204 |
|
---|
21205 | <div id="z_shell" class="DwtShell" style="height: 100%; width: 100%; "><div id="DWT1" style="position: absolute; overflow-x: visible; overflow-y: visible; width: 100%; height: 100%; z-index: 300; " class="DwtControl" parentid="z_shell"><div id="skin_outer" style="display: block; ">
|
---|
21206 | <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%">
|
---|
21207 | <tbody><tr id="skin_R1" class="ImgSkin_Chrome_R1">
|
---|
21208 | <td class="ImgSkin_Chrome_R1" colspan="3">
|
---|
21209 | <table width="98%" cellspacing="0" cellpadding="0" border="0" align="center">
|
---|
21210 | <tbody><tr>
|
---|
21211 | <!-- xr-feat-101 -->
|
---|
21212 | <td>
|
---|
21213 | <iframe scrolling="no" frameborder="0" style="height: 22px; width: 320px; margin-top: 0px; margin-right: 0px; margin-left: auto; position: relative; display: block;" src="/zimbra/skins/velodrome2/xpbar.html"></iframe>
|
---|
21214 | </td>
|
---|
21215 | <td class="ImgSkin_Chrome_R1"></td>
|
---|
21216 | <td width="100%"> </td>
|
---|
21217 | <td class="R1Text">Hi, </td>
|
---|
21218 | <td><div id="skin_container_username"></div></td>
|
---|
21219 | <td class="R1Link"><nobr><a href="javascript:;" onclick="ZmZimbraMail._onClickLogOff();">Sign Out</a></nobr></td>
|
---|
21220 | <td class="R1Sep"> | </td>
|
---|
21221 | <td class="R1Link R1Account"><a target="_new" href="https://customer.comcast.com/SmartUrl/Secure/Users.aspx">My Account</a></td>
|
---|
21222 | <td class="R1Link"><a href="javascript:;" onclick="ZmZimbraMail.helpLinkCallback();">Help</a></td>
|
---|
21223 | <td class="R1Sep">|</td>
|
---|
21224 | <td class="R1Link"><nobr><a target="_new" href="http://www.comcast.net/security/">Security</a></nobr></td>
|
---|
21225 | <td class="R1Sep">|</td>
|
---|
21226 | <td class="R1Link"><nobr><a target="_new" href="http://www.comcast.net/providers/askcomcast/popup.html" onclick="window.open(this.href,"AskComcast","width=640,height=480,dependent,resizable");return false;">Ask Comcast</a></nobr></td>
|
---|
21227 | <td class="ImgSkin_Chrome_R1"></td>
|
---|
21228 | <!-- xr-feat-101 -->
|
---|
21229 | </tr>
|
---|
21230 | </tbody></table>
|
---|
21231 | </td>
|
---|
21232 | </tr>
|
---|
21233 | <tr>
|
---|
21234 | <td width="100%">
|
---|
21235 | <table id="skin_table_outer" class="skin_table fixed_table" cellspacing="0" cellpadding="0" border="0">
|
---|
21236 | <colgroup>
|
---|
21237 | <col id="skin_col_L">
|
---|
21238 | <col id="skin_col_tree">
|
---|
21239 | <col id="skin_col_sash">
|
---|
21240 | <col id="skin_col_main">
|
---|
21241 | <col id="skin_col_R">
|
---|
21242 | </colgroup>
|
---|
21243 | <tbody><tr id="skin_R2">
|
---|
21244 | <!-- xr-feat-111 -->
|
---|
21245 | <td>
|
---|
21246 | <div class="ImgSkin_Chrome_R2"></div>
|
---|
21247 | </td>
|
---|
21248 | <td class="ImgSkin_Chrome_R2" colspan="3">
|
---|
21249 | <table width="100%" cellspacing="0" cellpadding="0">
|
---|
21250 | <tbody><tr>
|
---|
21251 | <td>
|
---|
21252 | <div class="ImgSkin_Chrome_Logo" onclick="skin.gotoApp(ZmApp.PORTAL);return false;" style="cursor:pointer;"></div>
|
---|
21253 | </td>
|
---|
21254 | <td id="skin_td_search" valign="middle">
|
---|
21255 | <div style="position:relative;" align="right">
|
---|
21256 | <!-- search box -->
|
---|
21257 | <div id="skin_container_search" class="skin_container"></div>
|
---|
21258 | </div>
|
---|
21259 | </td>
|
---|
21260 | </tr>
|
---|
21261 | </tbody></table>
|
---|
21262 | </td>
|
---|
21263 | <td>
|
---|
21264 | <div class="ImgSkin_Chrome_R2"></div>
|
---|
21265 | </td>
|
---|
21266 | <!-- End xr-feat-111 -->
|
---|
21267 | </tr>
|
---|
21268 |
|
---|
21269 | <!-- search builder -->
|
---|
21270 | <tr id="skin_tr_search_builder_toolbar">
|
---|
21271 | <td>
|
---|
21272 | <div class="ImgSkin_Chrome_SB_Toolbar_L"></div>
|
---|
21273 | </td>
|
---|
21274 | <td id="skin_td_search_builder_toolbar" class="ImgSkin_Chrome_SB_Toolbar" colspan="3">
|
---|
21275 | <div id="skin_container_search_builder_toolbar" class="skin_container">
|
---|
21276 | <!-- search builder toolbar -->
|
---|
21277 | </div>
|
---|
21278 | </td>
|
---|
21279 | <td>
|
---|
21280 | <div class="ImgSkin_Chrome_SB_Toolbar_R"></div>
|
---|
21281 | </td>
|
---|
21282 | </tr>
|
---|
21283 |
|
---|
21284 | <tr id="skin_tr_search_builder">
|
---|
21285 | <td class="ImgSkin_Chrome_SB_L">
|
---|
21286 | <div></div>
|
---|
21287 | </td>
|
---|
21288 | <td id="skin_td_search_builder" class="ImgSkin_Chrome_SB" colspan="3">
|
---|
21289 | <div id="skin_container_search_builder" class="skin_container">
|
---|
21290 | <!-- search builder -->
|
---|
21291 | </div>
|
---|
21292 | </td>
|
---|
21293 | <td class="ImgSkin_Chrome_SB_R">
|
---|
21294 | <div></div>
|
---|
21295 | </td>
|
---|
21296 | </tr>
|
---|
21297 | <!-- end search builder -->
|
---|
21298 |
|
---|
21299 | <tr id="skin_R3">
|
---|
21300 | <td>
|
---|
21301 | <div class="ImgSkin_Chrome_R3_L"></div>
|
---|
21302 | </td>
|
---|
21303 | <td class="ImgSkin_Chrome_R3">
|
---|
21304 | <div style="position:relative;width:100%;height:100%;">
|
---|
21305 | <div id="Xskin_container_current_app" class="skin_container">
|
---|
21306 | <table width="100%" height="100%">
|
---|
21307 | <tbody><tr>
|
---|
21308 | <td id="skin_td_quota">
|
---|
21309 | <div id="skin_container_quota" class="skin_container"><!-- quota --></div>
|
---|
21310 | </td>
|
---|
21311 | </tr>
|
---|
21312 | </tbody></table>
|
---|
21313 | </div>
|
---|
21314 | </div>
|
---|
21315 | </td>
|
---|
21316 | <td class="ImgSkin_Chrome_R3"> </td>
|
---|
21317 | <td class="ImgSkin_Chrome_R3" style="padding:0px;">
|
---|
21318 | <table width="100%" cellspacing="0" cellpadding="0">
|
---|
21319 | <tbody><tr>
|
---|
21320 | <td id="skin_td_app_chooser">
|
---|
21321 | <div id="skin_container_app_chooser" class="skin_container"></div>
|
---|
21322 | </td>
|
---|
21323 |
|
---|
21324 | </tr>
|
---|
21325 | </tbody></table>
|
---|
21326 | </td>
|
---|
21327 | <td>
|
---|
21328 | <div class="ImgSkin_Chrome_R3_R"></div>
|
---|
21329 | </td>
|
---|
21330 | </tr>
|
---|
21331 |
|
---|
21332 | <tr id="skin_tr_main">
|
---|
21333 | <td id="skin_td_tree_outer" colspan="2">
|
---|
21334 | <table id="skin_tree_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
|
---|
21335 | <tbody><tr>
|
---|
21336 | <td height="100%" id="skin_td_tree">
|
---|
21337 | <div id="skin_container_tree" class="skin_container"></div>
|
---|
21338 | </td>
|
---|
21339 | </tr>
|
---|
21340 | <tr id="skin_tr_tree_footer">
|
---|
21341 | <td id="skin_td_tree_footer">
|
---|
21342 | <div id="skin_container_tree_footer" class="skin_container"></div>
|
---|
21343 | </td>
|
---|
21344 | </tr>
|
---|
21345 | <tr>
|
---|
21346 | <td id="skin_td_tree_bottom_ad" height="150">
|
---|
21347 | <div id="portlet_text">Loading...</div>
|
---|
21348 | </td>
|
---|
21349 | </tr>
|
---|
21350 | </tbody></table>
|
---|
21351 | </td>
|
---|
21352 | <td id="skin_td_tree_app_sash">
|
---|
21353 | <div class="DwtHorizontalSash ImgHSash" style="height:100%;">
|
---|
21354 | <div class="ImgHSash_thumb" style="position:relative;top:50%;"></div>
|
---|
21355 | </div>
|
---|
21356 | </td>
|
---|
21357 | <td id="skin_td_app_outer" colspan="2">
|
---|
21358 | <table id="skin_app_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
|
---|
21359 | <tbody><tr>
|
---|
21360 | <td id="skin_main_toolbar_container" class="skin_td_app_toolbar ImgSkin_Toolbar">
|
---|
21361 | <div id="skin_container_app_top_toolbar" class="skin_container"></div>
|
---|
21362 | </td>
|
---|
21363 | </tr>
|
---|
21364 | <tr>
|
---|
21365 | <td id="skin_td_app">
|
---|
21366 | <div id="skin_container_app_main" class="skin_container"></div>
|
---|
21367 | </td>
|
---|
21368 | </tr>
|
---|
21369 | </tbody></table>
|
---|
21370 | </td>
|
---|
21371 | <td></td>
|
---|
21372 | </tr>
|
---|
21373 |
|
---|
21374 | <tr id="skin_tr_main_full" style="display:none">
|
---|
21375 | <td id="skin_td_app_full_outer" class="full_height" colspan="5" height="100%">
|
---|
21376 | <table id="skin_app_full_table" class="skin_table fullSize" cellspacing="0" cellpadding="0">
|
---|
21377 | <tbody><tr>
|
---|
21378 | <td id="skin_full_toolbar_container" class="skin_td_app_toolbar ImgSkin_Toolbar">
|
---|
21379 | <!--div id='skin_container_app_top_toolbar' class='skin_container'></div-->
|
---|
21380 | </td>
|
---|
21381 | </tr>
|
---|
21382 | <tr>
|
---|
21383 | <td id="skin_td_app_full">
|
---|
21384 | <div id="skin_container_app_main_full" class="skin_container" height="100%">
|
---|
21385 | <!--Full screen app-->
|
---|
21386 |
|
---|
21387 | </div>
|
---|
21388 | </td>
|
---|
21389 | </tr>
|
---|
21390 | </tbody></table>
|
---|
21391 | </td>
|
---|
21392 | </tr>
|
---|
21393 | </tbody></table>
|
---|
21394 | </td>
|
---|
21395 | <td valign="top" id="comcast-adsrvc" style="display:none;overflow:hidden;">
|
---|
21396 | <div class="skin_container" id="skin_adsrvc">
|
---|
21397 | <table cellpadding="0" cellspacing="0" border="0" height="100%" width="171">
|
---|
21398 | <tbody><tr height="100%">
|
---|
21399 | <td valign="middle" align="center" height="100%">
|
---|
21400 | <div id="comcast-adshowhide" class="AdSrvcLeftArrow"></div>
|
---|
21401 | </td>
|
---|
21402 | <td valign="middle" id="comcast-skyscrapperad" align="center">
|
---|
21403 | <!-- xr-feat-126 -->
|
---|
21404 | <div id="skin_container_sidebar_ad" style="height:95%;"></div>
|
---|
21405 |
|
---|
21406 | <div class="adslug">
|
---|
21407 | <ul>
|
---|
21408 | <li class="comcast-adinfo" id="comcast-adinfo"><a href="#">Ad Info</a></li>
|
---|
21409 | <li class="comcast-adfeedback" id="comcast-adfeedback"><a href="#">Ad Feedback</a></li>
|
---|
21410 | </ul>
|
---|
21411 | </div>
|
---|
21412 | <!-- End xr-feat-126 -->
|
---|
21413 | </td>
|
---|
21414 | </tr>
|
---|
21415 | </tbody></table>
|
---|
21416 | </div>
|
---|
21417 | </td>
|
---|
21418 | </tr>
|
---|
21419 | <!-- xr-feat-173 -->
|
---|
21420 | <tr id="skin_R4">
|
---|
21421 | <td id="skin_td_R4" class="ImgSkin_Chrome_R4" colspan="3">
|
---|
21422 | <div id="skin_footer" class="skin_container">
|
---|
21423 | <table width="100%" id="skin_table_R4" class="skin_table fullSize" cellspacing="0" cellpadding="0">
|
---|
21424 | <tbody><tr>
|
---|
21425 | <td style="text-align:left;padding-left:20px;" width="23%"><table><tbody><tr><td>© 2011 Comcast Cable Communications</td></tr></tbody></table></td>
|
---|
21426 | <td width="14%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.net/privacy/">Privacy Statement</a></td></tr></tbody></table></td>
|
---|
21427 | <td width="14%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.net/terms/">Terms of Service</a></td></tr></tbody></table></td>
|
---|
21428 | <td width="12%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.net/help/contact">Contact Us</a></td></tr></tbody></table></td>
|
---|
21429 | <td width="15%"><table><tbody><tr><td><a target="blank" href="http://www.comcast.com/shop/buyflow/default.ashx">Add Comcast Services</a></td></tr></tbody></table></td>
|
---|
21430 | <td width="15%"><table><tbody><tr><td><a target="blank" href="http://www.comcastsupport.com/forms/net/sccfeedback.asp">Tell Us What You Think</a></td></tr></tbody></table></td>
|
---|
21431 | <td width="7%" align="right"><a target="blank" href="http://www.comcast.net/"><div class="ImgSkin_Customer_Logo_Bottom"></div></a></td>
|
---|
21432 | </tr>
|
---|
21433 | </tbody></table>
|
---|
21434 | </div>
|
---|
21435 | </td>
|
---|
21436 | </tr>
|
---|
21437 | <!-- End xr-feat-173 -->
|
---|
21438 | </tbody></table>
|
---|
21439 |
|
---|
21440 | <!-- misc containers that haven't been placed yet -->
|
---|
21441 | <div id="skin_container_logo" class="skin_container offscreen"></div>
|
---|
21442 | <div id="skin_container_top_ad" class="skin_container offscreen"></div>
|
---|
21443 | <div id="skin_container_app_toolbar_sep" class="skin_container offscreen"></div>
|
---|
21444 | <div id="skin_container_tree_app_sash" class="skin_container offscreen"></div>
|
---|
21445 | <div id="skin_tr_status" class="offscreen"></div>
|
---|
21446 | <div id="skin_container_status" class="skin_container offscreen"></div>
|
---|
21447 | </div></div><div class="BusyOverlay" style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 600; cursor: default; display: none; " x-display="block"><table cellspacing="0" cellpadding="0" style="width:100%; height:100%"><tbody><tr><td> </td></tr></tbody></table></div><div class="VeilOverlay" style="position: absolute; cursor: wait; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 600; "><table cellspacing="0" cellpadding="0" style="width:100%; height:100%"><tbody><tr><td> </td></tr></tbody></table></div><div class="DwtToolTip" style="position: absolute; z-index: 100; left: -10000px; top: -10000px; "><div id="tooltipTopPointer" class="DwtToolTipTopPointer"><center><div class="DwtToolTipPointerRow" style="width:1px;"> </div><div class="DwtToolTipPointerRow" style="width:3px;"> </div><div class="DwtToolTipPointerRow" style="width:5px;"> </div><div class="DwtToolTipPointerRow" style="width:7px;"> </div><div class="DwtToolTipPointerRow" style="width:9px;"> </div><div class="DwtToolTipPointerRow" style="width:11px;"> </div><div class="DwtToolTipPointerRow" style="width:13px;"> </div><div class="DwtToolTipPointerRow" style="width:15px;"> </div><div class="DwtToolTipPointerRow" style="width:17px;"> </div><div class="DwtToolTipPointerRow" style="width:19px;"> </div><div class="DwtToolTipPointerRow" style="width:21px;"> </div></center></div><div id="tooltipContents" class="DwtToolTipBody"></div><div id="tooltipBottomPointer" class="DwtToolTipBottomPointer"><center><div class="DwtToolTipPointerRow" style="width:21px;"> </div><div class="DwtToolTipPointerRow" style="width:19px;"> </div><div class="DwtToolTipPointerRow" style="width:17px;"> </div><div class="DwtToolTipPointerRow" style="width:15px;"> </div><div class="DwtToolTipPointerRow" style="width:13px;"> </div><div class="DwtToolTipPointerRow" style="width:11px;"> </div><div class="DwtToolTipPointerRow" style="width:9px;"> </div><div class="DwtToolTipPointerRow" style="width:7px;"> </div><div class="DwtToolTipPointerRow" style="width:5px;"> </div><div class="DwtToolTipPointerRow" style="width:3px;"> </div><div class="DwtToolTipPointerRow" style="width:1px;"> </div></center></div></div><div id="z_loading" style="position: absolute; overflow-x: visible; overflow-y: visible; " class="DwtListView" parentid="z_shell"><table border="0" cellpadding="0" cellspacing="0" style="width:100%;height=100%"><tbody><tr><td align="center" valign="middle"><br><br><br>Loading...<br><br><div class="Imgwait_64"></div><br><br><br></td></tr><tr><td style="height:100%"> </td></tr></tbody></table></div><div id="z_sash" style="position: absolute; overflow-x: visible; overflow-y: visible; cursor: w-resize; z-index: 300; " class="console_inset_app_l" parentid="z_shell"><div class="DwtHorizontalSash ImgHSash"><center><div class="ImgHSash_thumb"></div></center></div></div><div id="z_banner" style="position: absolute; overflow-x: visible; overflow-y: visible; " class="DwtComposite" parentid="z_shell"><table border="0" cellpadding="0" cellspacing="0" style="width:100%;height:100%"><tbody><tr><td align="center" valign="middle"><a href="http://www.comcast.net/" target="_blank"><div class="ImgAppBanner"></div></a></td></tr></tbody></table></div><div id="z_userName" style="position: static; overflow-x: visible; overflow-y: visible; " class="BannerTextUser" parentid="z_shell"></div><div id="z_userQuota" style="position: static; overflow-x: visible; overflow-y: visible; " class="BannerTextQuota" parentid="z_shell"></div><div id="z_status" style="position: absolute; overflow-x: visible; overflow-y: visible; " class="ZmStatus" parentid="z_shell"></div><div id="z_toast" style="position: absolute; overflow-x: visible; overflow-y: visible; z-index: 950; " class="ZToast ZToastInfo" parentid="z_shell"><div class="ZToastBG"><div class="ZToastContent"><div id="z_toast_icon" class="ZToastIcon"></div><div id="z_toast_text" class="ZToastText"></div></div></div></div><div id="DWT6" style="position: absolute; overflow-x: visible; overflow-y: visible; left: 345px; top: 309px; z-index: 700; " class="DwtDialog" parentid="z_shell"><div class="DwtDialog"><table cellspacing="0" cellpadding="0" style="cursor:move;" border="0"><tbody><tr id="DWT6_handle"><td class="ImgDialog_NW" width="6"></td><td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="ImgDialog_N minWidth" width="1%"></td><td id="DWT6_title" class="ImgDialog_N DwtDialogTitle" nowrap="nowrap">XFINITY Connect</td><td class="ImgDialog_N minWidth" width="1%"><div class=""></div></td><td class="ImgDialog_N minWidth width=" 1%'=""><div class=""></div></td></tr></tbody></table></td><td class="ImgDialog_NE" width="6"></td></tr><tr><td class="ImgDialog_W" width="6"></td><td class="DwtDialogBody" id="DWT6_content"><div id="DWT2" class="DwtMsgDialog"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top"><div class="ImgCritical_32"></div></td><td class="DwtMsgArea">Result of expression 'o' [undefined] is not an object.</td></tr></tbody></table></div></td><td class="ImgDialog_E" width="6"></td></tr><tr><td valign="bottom" class="ImgDialog_SW" width="6"></td><td class="ImgDialog_S"><div id="DWT6_buttons" class="DwtDialogButtonBar"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td align="left"><table cellspacing="5" cellpadding="0" border="0"><tbody><tr><td id="DWT4"><div id="DWT8" style="position: static; overflow-x: visible; overflow-y: visible; " class="ZButton ZWidget ZHasText" parentid="DWT6"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT8_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT8_title" class="ImgButton ZWidgetTitle">Send Error Report</td><td id="DWT8_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT8_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td><td id="DWT5"><div id="DWT9" style="position: static; overflow-x: visible; overflow-y: visible; display: block; " class="ZButton ZWidget ZHasText" parentid="DWT6"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT9_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT9_title" class="ImgButton ZWidgetTitle">Show Details</td><td id="DWT9_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT9_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></td><td align="right"><table cellspacing="5" cellpadding="0" border="0"><tbody><tr><td id="DWT3"><div id="DWT7" style="position: static; overflow-x: visible; overflow-y: visible; " class="ZButton ZWidget ZHasText" parentid="DWT6"><table class="ZWidgetBorder ZButtonBorder ZWidgetTable ZButtonTable" cellspacing="0" cellpadding="0"><tbody><tr><td class="ImgButton_L"><div></div></td><td id="DWT7_left_icon" class="ImgButton ZLeftIcon ZWidgetIcon"></td><td id="DWT7_title" class="ImgButton ZWidgetTitle">OK</td><td id="DWT7_right_icon" class="ImgButton ZRightIcon ZWidgetIcon"></td><td id="DWT7_dropdown" class="ImgButton ZDropDown"></td><td class="ImgButton_R"><div></div></td></tr></tbody></table></div></td></tr></tbody></table></td></tr></tbody></table></div></td><td valign="bottom" class="ImgDialog_SE" width="6"></td></tr></tbody></table></div></div></div></body></html>
|
---|