author | Giulio Cesare Solaroli <giulio.cesare@solaroli.it> | 2011-10-03 16:04:12 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@solaroli.it> | 2011-10-03 16:04:12 (UTC) |
commit | 541bb378ddece2eab135a8066a16994e94436dea (patch) (unidiff) | |
tree | ff160ea3e26f7fe07fcfd401387c5a0232ca715e /frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js | |
parent | 1bf431fd3d45cbdf4afa3e12afefe5d24f4d3bc7 (diff) | |
parent | ecad5e895831337216544e81f1a467e0c68c4a6a (diff) | |
download | clipperz-541bb378ddece2eab135a8066a16994e94436dea.zip clipperz-541bb378ddece2eab135a8066a16994e94436dea.tar.gz clipperz-541bb378ddece2eab135a8066a16994e94436dea.tar.bz2 |
Merge pull request #1 from gcsolaroli/master
First version of the restructured repository
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js | 486 |
1 files changed, 486 insertions, 0 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js new file mode 100644 index 0000000..759903f --- a/dev/null +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/DataPanel.js | |||
@@ -0,0 +1,486 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | ||
11 | refer to http://www.clipperz.com | ||
12 | |||
13 | * Javascript Crypto Library is free software: you can redistribute | ||
14 | it and/or modify it under the terms of the GNU Affero General Public | ||
15 | License as published by the Free Software Foundation, either version | ||
16 | 3 of the License, or (at your option) any later version. | ||
17 | |||
18 | * Javascript Crypto Library is distributed in the hope that it will | ||
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
21 | See the GNU Affero General Public License for more details. | ||
22 | |||
23 | * You should have received a copy of the GNU Affero General Public | ||
24 | License along with Javascript Crypto Library. If not, see | ||
25 | <http://www.gnu.org/licenses/>. | ||
26 | |||
27 | */ | ||
28 | |||
29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | ||
30 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | ||
31 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | ||
32 | if (typeof(Clipperz.PM.Components.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } | ||
33 | |||
34 | //############################################################################# | ||
35 | |||
36 | Clipperz.PM.Components.Panels.DataPanel = function(anElement, args) { | ||
37 | args = args || {}; | ||
38 | |||
39 | Clipperz.PM.Components.Panels.DataPanel.superclass.constructor.call(this, anElement, args); | ||
40 | |||
41 | this._progressWidth = 400; | ||
42 | |||
43 | |||
44 | this.render(); | ||
45 | |||
46 | return this; | ||
47 | } | ||
48 | |||
49 | //============================================================================= | ||
50 | |||
51 | YAHOO.extendX(Clipperz.PM.Components.Panels.DataPanel, Clipperz.PM.Components.Panels.BasePanel, { | ||
52 | |||
53 | 'toString': function() { | ||
54 | return "Clipperz.PM.Components.DataPanel component"; | ||
55 | }, | ||
56 | |||
57 | //------------------------------------------------------------------------- | ||
58 | |||
59 | 'render': function() { | ||
60 | MochiKit.Signal.disconnectAllTo(this); | ||
61 | Clipperz.NotificationCenter.unregister(this); | ||
62 | this.element().update(""); | ||
63 | |||
64 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ | ||
65 | {tag:'tbody', children:[ | ||
66 | {tag:'tr', children:[ | ||
67 | {tag:'td', valign:'top', width:'200', children:[ | ||
68 | {tag:'ul', id:"dataSubMenu", cls:'subMenu', children:[ | ||
69 | {tag:'li', id:'offlineCopyTab', htmlString:Clipperz.PM.Strings['offlineCopyTabLabel']}, | ||
70 | {tag:'li', id:'sharingTab', htmlString:Clipperz.PM.Strings['sharingTabLabel']}, | ||
71 | {tag:'li', id:'importTab', htmlString:Clipperz.PM.Strings['importTabLabel']}, | ||
72 | {tag:'li', id:'printingTab', htmlString:Clipperz.PM.Strings['printingTabLabel']} | ||
73 | ]} | ||
74 | ]}, | ||
75 | {tag:'td', valign:'top', children:[ | ||
76 | {tag:'ul', cls:'clipperzTabPanels', children:[ | ||
77 | {tag:'li', id:this.getId('offlineCopyPanel'), children:[ | ||
78 | {tag:'div', cls:'clipperzSubPanel', children:[ | ||
79 | {tag:'h5', htmlString:Clipperz.PM.Strings['offlineCopyTabTitle']}, | ||
80 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['offlineCopyTabDescription']}, | ||
81 | {tag:'div', id:this.getId('offlineCopyLinkBox'), children:[ | ||
82 | {tag:'a', id:'offlineCopyLink', href:'#', htmlString:Clipperz.PM.Strings['offlineCopyDownloadLinkLabel']} | ||
83 | ]}, | ||
84 | {tag:'div', id:this.getId('offlineCopyLinkBox_read-only'), children:[ | ||
85 | {tag:'span', cls:'read-only', htmlString:Clipperz.PM.Strings['offlineCopyDownloadLinkLabel']} | ||
86 | ]} | ||
87 | ]} | ||
88 | ]}, | ||
89 | {tag:'li', id:this.getId('sharingPanel'), children:[ | ||
90 | {tag:'div', cls:'clipperzSubPanel', children:[ | ||
91 | {tag:'h5', htmlString:Clipperz.PM.Strings['sharingTabTitle']}, | ||
92 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['sharingTabDescription']} | ||
93 | ]} | ||
94 | ]}, | ||
95 | {tag:'li', id:this.getId('importPanel'), children:[ | ||
96 | {tag:'div', cls:'clipperzSubPanel', children:[ | ||
97 | {tag:'div', id:this.getId('importPanelMainComponent')} | ||
98 | ]} | ||
99 | ]}, | ||
100 | {tag:'li', id:this.getId('printingPanel'), children:[ | ||
101 | {tag:'div', cls:'clipperzSubPanel', children:[ | ||
102 | {tag:'h5', htmlString:Clipperz.PM.Strings['printingTabTitle']}, | ||
103 | |||
104 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['printingTabDescription']}, | ||
105 | {tag:'div', id:this.getId('printingLinkBox'), children:[ | ||
106 | {tag:'a', id:'printingLink', href:'#', htmlString:Clipperz.PM.Strings['printingLinkLabel']} | ||
107 | ]}, | ||
108 | |||
109 | {tag:'hr'}, | ||
110 | |||
111 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['exportTabDescription']}, | ||
112 | {tag:'div', id:this.getId('exportLinkBox'), children:[ | ||
113 | {tag:'a', id:'exportLink', href:'#', htmlString:Clipperz.PM.Strings['exportLinkLabel']} | ||
114 | ]} | ||
115 | ]} | ||
116 | ]} | ||
117 | ]} | ||
118 | ]} | ||
119 | ]} | ||
120 | ]} | ||
121 | ]}); | ||
122 | |||
123 | this.tabPanelController().setUp(); | ||
124 | |||
125 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { | ||
126 | this.getElement('offlineCopyLinkBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); | ||
127 | } else { | ||
128 | this.getElement('offlineCopyLinkBox_read-only').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); | ||
129 | MochiKit.Signal.connect('offlineCopyLink', 'onclick', this, 'downloadOfflineCopy'); | ||
130 | } | ||
131 | |||
132 | new Clipperz.PM.Components.Import.MainComponent(this.getElement('importPanelMainComponent'), {user:this.user()}); | ||
133 | |||
134 | MochiKit.Signal.connect('printingLink', 'onclick', this, 'printAllData'); | ||
135 | MochiKit.Signal.connect('exportLink', 'onclick', this, 'exportAllData'); | ||
136 | |||
137 | Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); | ||
138 | }, | ||
139 | |||
140 | //------------------------------------------------------------------------- | ||
141 | |||
142 | 'tabPanelController': function() { | ||
143 | if (this._tabPanelController == null) { | ||
144 | var tabPanelControllerConfig; | ||
145 | |||
146 | tabPanelControllerConfig = {} | ||
147 | tabPanelControllerConfig['offlineCopyTab'] = this.getId('offlineCopyPanel'); | ||
148 | tabPanelControllerConfig['sharingTab'] = this.getId('sharingPanel'); | ||
149 | tabPanelControllerConfig['importTab'] = this.getId('importPanel'); | ||
150 | tabPanelControllerConfig['printingTab'] = this.getId('printingPanel'); | ||
151 | this._tabPanelController = new Clipperz.PM.Components.TabPanel.TabPanelController({ | ||
152 | name: 'dataTabPanel', | ||
153 | config:tabPanelControllerConfig, | ||
154 | selectedTab:'offlineCopyTab' | ||
155 | }); | ||
156 | } | ||
157 | |||
158 | return this._tabPanelController; | ||
159 | }, | ||
160 | |||
161 | //------------------------------------------------------------------------- | ||
162 | |||
163 | 'downloadOfflineCopy': function(anEvent) { | ||
164 | var downloadHref; | ||
165 | |||
166 | downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl; | ||
167 | |||
168 | if (Clipperz_IEisBroken == true) { | ||
169 | window.open(downloadHref, ""); | ||
170 | } else { | ||
171 | vardeferredResult; | ||
172 | var newWindow; | ||
173 | |||
174 | newWindow = window.open("", ""); | ||
175 | |||
176 | anEvent.preventDefault(); | ||
177 | |||
178 | deferredResult = new MochiKit.Async.Deferred(); | ||
179 | deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"}); | ||
180 | deferredResult.addCallback(function(aWindow) { | ||
181 | aWindow.location.href = downloadHref; | ||
182 | }, newWindow); | ||
183 | deferredResult.callback(); | ||
184 | } | ||
185 | }, | ||
186 | |||
187 | //------------------------------------------------------------------------- | ||
188 | |||
189 | 'compareRecords': function(a, b) { | ||
190 | return MochiKit.Base.compare(a.label().toLowerCase(), b.label().toLowerCase()); | ||
191 | }, | ||
192 | |||
193 | 'logo': function() { | ||
194 | var result; | ||
195 | |||
196 | if (Clipperz_IEisBroken == true) { | ||
197 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { | ||
198 | result = "<span><span class=\"clipperzLogoSpan\">clipper</span><span class=\"clipperzLoggoZSpan\">z</span></span>"; | ||
199 | } else { | ||
200 | result = "<img src=\"./images/exportLogo.png\" />"; | ||
201 | } | ||
202 | } else { | ||
203 | result = "<img src=\"data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAANYAAABOCAIAAADTtH9XAAANIWlDQ1BJQ0MgUHJvZmlsZQAAeJyV13k0lG8bB/BrFsYyZhhjDyO77LKHLJFItmwp2bdhJiZRypIUIkso2iiSFC0kEtWPLCHJkq2oyJI9kmXeP6R6f+f9ve95rz+ecz3385xz389zzud7nxsAr+FKpZKRABAQSAuyNjEgOTg6kTBdgAJewAEzaLi6B1P1LS3N4R9roRMQAADtcq5UKvmf3/uPhQtycHQCQMgCANF7vd8OAES39d4WAIhHaFQaAMIHAIjuPq4eAIhwAJANsrU2BEAUAADOe70vBwCc23pfDwC4EHdvGgCiG4CREOjhGwiAmQBg1PXwDHYHwMkCgIdHsHsAAC4ZACwCAigeALgPACDlTg2iAeCZAEDOwdGJtL7kffEAW/kAmMx+jx1JByjNAZDa/XtM9BEAtytAbuLvsTlrQAAAgrs12EtFGQAAEFgDAIYBOn1OAgCTCrCaQqcv59Lpq9cBUH0ANWT3w0EhP/8XAtEM8L/u17/5Z6EQAEgAhBgiH3kUFY4OZzjBGImJZjrJbMRcy3Ka9Qw2ju0srozdhyOFkMKZSjzPlc6dzpPJW8tPEcjelC14WaiedFgkd/N10VbxYxL5km3SJ2Rub+mUi5a/o9CjdFr5vsp71bNqZeqDmklaFdrDOmm6T/XG9DMMnhtO7sgyrjOZNb26q9FsYXeuRcue15avrdqsV2wL93bYddp3OXQ7offdc+7b339gwOX9wQ9uWPfHHp88P3sNe4/4fPEd9eciPwv4GjhJmaJOH5oJmg2ep80f/haycGQx9HvY0tEfx1b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jMFiCGIHBEsQIDJYgRmCwBDECgyWIERgsQYzAYAliBOZ/jys2NWyvP3gAAAAASUVORK5CYIIK\" />"; | ||
204 | } | ||
205 | |||
206 | return result; | ||
207 | }, | ||
208 | |||
209 | 'progressWidth': function() { | ||
210 | return this._progressWidth; | ||
211 | }, | ||
212 | |||
213 | 'updateProgress': function(aProgressComponent, aPercentage) { | ||
214 | |||
215 | |||
216 | }, | ||
217 | |||
218 | //------------------------------------------------------------------------- | ||
219 | |||
220 | 'printAllData': function(anEvent) { | ||
221 | var newWindow; | ||
222 | var allRecords; | ||
223 | |||
224 | //MochiKit.Logging.logDebug(">>> printAllData"); | ||
225 | newWindow = window.open("", ""); | ||
226 | newWindow.document.write( | ||
227 | "<html>" + | ||
228 | "<header>" + | ||
229 | "<title>Clipperz export data</title>" + | ||
230 | "<style>" + | ||
231 | "#exportedData {" + | ||
232 | " width: 600px;"+ | ||
233 | "}" + | ||
234 | ".ext-mb-progress-wrap {" + | ||
235 | "border:1px solid #6593cf;" + | ||
236 | "margin-bottom: 10px;" + | ||
237 | "width: " + this.progressWidth() + "px;" + | ||
238 | "}" + | ||
239 | ".ext-mb-progress {" + | ||
240 | "height:18px;" + | ||
241 | "background:transparent url(./images/default/basic-dialog/progress2.gif) repeat-x 1px 1px;" + | ||
242 | "}" + | ||
243 | ".ext-mb-progress-bar {" + | ||
244 | "height:18px;" + | ||
245 | "overflow:hidden;" + | ||
246 | "width:0;" + | ||
247 | "background:#8bb8f3;" + | ||
248 | "}" + | ||
249 | "body {" + | ||
250 | "font-family: sans-serif;" + | ||
251 | "}" + | ||
252 | "div#logo {" + | ||
253 | "border-bottom: 1px dotted #aaaaaa;" + | ||
254 | "margin-bottom: 15px;" + | ||
255 | "}" + | ||
256 | "div.recordBlock h2 {" + | ||
257 | "font-size: 14pt;" + | ||
258 | "margin: 0px;" + | ||
259 | "padding: 0px;" + | ||
260 | "border: 0px;" + | ||
261 | "color: #666666;" + | ||
262 | "}" + | ||
263 | "div.recordBlock div.recordNotes p {" + | ||
264 | "margin: 0px;" + | ||
265 | "padding: 0px;" + | ||
266 | "border: 0px;" + | ||
267 | "color: #aaaaaa;" + | ||
268 | "font-size: 10pt;" + | ||
269 | "line-height: 18pt;" + | ||
270 | "border-left: 1px solid #aaaaaa;" + | ||
271 | "padding-left: 10px;" + | ||
272 | "}" + | ||
273 | "div.recordBlock dl {" + | ||
274 | "margin: 0px;" + | ||
275 | "padding: 0px;" + | ||
276 | "border: 0px;" + | ||
277 | "color: #999999;" + | ||
278 | "padding-bottom: 10px;" + | ||
279 | "border-bottom: 1px dotted #aaaaaa;" + | ||
280 | "margin-top: 10px;" + | ||
281 | "margin-bottom: 15px;" + | ||
282 | "}" + | ||
283 | "div.recordBlock dl dt {" + | ||
284 | "display: block;" + | ||
285 | "float: left;" + | ||
286 | "min-width: 100px;" + | ||
287 | "white-space: nowrap;" + | ||
288 | "overflow: hidden;" + | ||
289 | "margin-right: 10px;" + | ||
290 | "font-size: 10pt;" + | ||
291 | "line-height: 18pt;" + | ||
292 | "}" + | ||
293 | "div.recordBlock dl dd {" + | ||
294 | "color: #666666;" + | ||
295 | "font-size: 10pt;" + | ||
296 | "line-height: 18pt;" + | ||
297 | "}" + | ||
298 | "" + | ||
299 | "</style>" + | ||
300 | "" + | ||
301 | "<!--[if IE]>" + | ||
302 | "<style>" + | ||
303 | "div.recordBlock dl dt {" + | ||
304 | "width: 100px;" + | ||
305 | "}" + | ||
306 | "</style>" + | ||
307 | "<![endif]-->" + | ||
308 | "" + | ||
309 | "</header>" + | ||
310 | "<body>" + | ||
311 | "<div id=\"logo\">" + this.logo() + | ||
312 | "<div id=\"progressWrapper\"><div class=\"ext-mb-progress-wrap\"><div class=\"ext-mb-progress\"><div id=\"progress\" class=\"ext-mb-progress-bar\"> </div></div></div></div>" + | ||
313 | " </div>" + | ||
314 | "</body>" + | ||
315 | "</html>" | ||
316 | ); | ||
317 | |||
318 | anEvent.preventDefault(); | ||
319 | |||
320 | allRecords = MochiKit.Base.values(this.user().records()); | ||
321 | allRecords.sort(this.compareRecords); | ||
322 | |||
323 | /* | ||
324 | deferredResult = new MochiKit.Async.Deferred(); | ||
325 | MochiKit.Iter.forEach(allRecords, MochiKit.Base.partial(function(aDeferredResult, aWindow, aRecord) { | ||
326 | var printerRecord; | ||
327 | |||
328 | printerRecord = new Clipperz.PM.Components.Printing.Record({record:aRecord}); | ||
329 | aDeferredResult.addCallback(MochiKit.Base.method(printerRecord, 'deferredDrawToWindow', aWindow)); | ||
330 | }, deferredResult, newWindow)); | ||
331 | deferredResult.callback(); | ||
332 | |||
333 | return deferredResult; | ||
334 | */ | ||
335 | |||
336 | MochiKit.DOM.withWindow(newWindow, MochiKit.Base.bind(function(someRecords) { | ||
337 | var currentWindow; | ||
338 | vardeferredResult; | ||
339 | var progressBar; | ||
340 | var progressWrapper; | ||
341 | var i, c; | ||
342 | |||
343 | currentWindow = MochiKit.DOM.currentWindow(); | ||
344 | progressBar = MochiKit.DOM.getElement('progress'); | ||
345 | progressWrapper = MochiKit.DOM.getElement('progressWrapper'); | ||
346 | |||
347 | deferredResult = new MochiKit.Async.Deferred(); | ||
348 | c = someRecords.length; | ||
349 | for (i=0; i<c; i++) { | ||
350 | deferredResult.addCallback(function(aWindow, aRecord) { | ||
351 | var printerRecord; | ||
352 | |||
353 | printerRecord = new Clipperz.PM.Components.Printing.Record({record:aRecord}); | ||
354 | return printerRecord.deferredDrawToWindow(aWindow); | ||
355 | }, currentWindow, someRecords[i]) | ||
356 | deferredResult.addCallback(MochiKit.Base.bind(function(aProgressBar, aProgress) { | ||
357 | MochiKit.Style.setElementDimensions(aProgressBar, {w:aProgress * this.progressWidth()}); | ||
358 | }, this, progressBar, ((i+1)/c))); | ||
359 | deferredResult.addCallback(MochiKit.Async.wait, 0.2); | ||
360 | } | ||
361 | |||
362 | deferredResult.addCallback(function(aWindow, aProgressWrapper) { | ||
363 | MochiKit.DOM.replaceChildNodes(aProgressWrapper); | ||
364 | MochiKit.Style.hideElement(aProgressWrapper); | ||
365 | aWindow.stop(); | ||
366 | }, currentWindow, progressWrapper); | ||
367 | |||
368 | |||
369 | deferredResult.callback(); | ||
370 | }, this, allRecords)); | ||
371 | }, | ||
372 | |||
373 | //------------------------------------------------------------------------- | ||
374 | |||
375 | 'exportAllData': function(anEvent) { | ||
376 | // vardeferredResult; | ||
377 | var newWindow; | ||
378 | var allRecords; | ||
379 | |||
380 | //MochiKit.Logging.logDebug(">>> printAllData"); | ||
381 | newWindow = window.open("", ""); | ||
382 | newWindow.document.write( | ||
383 | "<html>" + | ||
384 | "<header>" + | ||
385 | "<title>Clipperz export data</title>" + | ||
386 | "<style>" + | ||
387 | "#exportedData {" + | ||
388 | " width: 600px;"+ | ||
389 | "}" + | ||
390 | ".ext-mb-progress-wrap {" + | ||
391 | "margin-top:4px;" + | ||
392 | "margin-bottom: 10px;" + | ||
393 | "border:1px solid #6593cf;" + | ||
394 | "width: " + this.progressWidth() + "px;" + | ||
395 | "}" + | ||
396 | ".ext-mb-progress {" + | ||
397 | "height:18px;" + | ||
398 | "background:transparent url(./images/default/basic-dialog/progress2.gif) repeat-x 1px 1px;" + | ||
399 | "}" + | ||
400 | ".ext-mb-progress-bar {" + | ||
401 | "height:18px;" + | ||
402 | "overflow:hidden;" + | ||
403 | "width:0;" + | ||
404 | "background:#8bb8f3;" + | ||
405 | "}" + | ||
406 | "</style>" + | ||
407 | "" + | ||
408 | "<!--[if IE]>" + | ||
409 | "<style>" + | ||
410 | "</style>" + | ||
411 | "<![endif]-->" + | ||
412 | "" + | ||
413 | "</header>" + | ||
414 | "<body>" + | ||
415 | "<div id=\"logo\">" + this.logo() + "</div>" + | ||
416 | "<div id=\"progressWrapper\">" + | ||
417 | " <div class=\"description\">" + Clipperz.PM.Strings['exportDataInProgressDescription'] + "</div>" + | ||
418 | " <div class=\"ext-mb-progress-wrap\"><div class=\"ext-mb-progress\"><div id=\"progress\" class=\"ext-mb-progress-bar\"> </div></div></div>" + | ||
419 | "</div>" + | ||
420 | "<div id=\"textareaWrapper\">" + | ||
421 | " <div class=\"description\">" + Clipperz.PM.Strings['exportDataDescription'] + "</div>" + | ||
422 | " <textarea id=\"exportedData\" cols=\"80\" rows=\"20\">[</textarea>" + | ||
423 | "</div>" + | ||
424 | "</body>" + | ||
425 | "</html>" | ||
426 | ); | ||
427 | |||
428 | anEvent.preventDefault(); | ||
429 | |||
430 | allRecords = MochiKit.Base.values(this.user().records()); | ||
431 | allRecords.sort(this.compareRecords); | ||
432 | |||
433 | MochiKit.DOM.withWindow(newWindow, MochiKit.Base.bind(function(someRecords) { | ||
434 | var currentWindow; | ||
435 | vardeferredResult; | ||
436 | var textareaWrapper; | ||
437 | vartextarea; | ||
438 | var progressBar; | ||
439 | var progressWrapper; | ||
440 | var i, c; | ||
441 | |||
442 | currentWindow = MochiKit.DOM.currentWindow(); | ||
443 | textarea = MochiKit.DOM.getElement('exportedData'); | ||
444 | textareaWrapper = MochiKit.DOM.getElement('textareaWrapper'); | ||
445 | MochiKit.Style.hideElement(textareaWrapper); | ||
446 | progressBar = MochiKit.DOM.getElement('progress'); | ||
447 | progressWrapper = MochiKit.DOM.getElement('progressWrapper'); | ||
448 | |||
449 | deferredResult = new MochiKit.Async.Deferred(); | ||
450 | |||
451 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("exportAllData - 1: " + res); return res;}); | ||
452 | c = someRecords.length; | ||
453 | for (i=0; i<c; i++) { | ||
454 | deferredResult.addCallback(MochiKit.Base.method(someRecords[i], 'deferredData')); | ||
455 | deferredResult.addCallback(MochiKit.Base.method(someRecords[i], 'exportedData')); | ||
456 | deferredResult.addCallback(MochiKit.Base.bind(function(aTextarea, aProgressBar, aProgress, someRecordExportedData) { | ||
457 | aTextarea.value = aTextarea.value + "\n" + someRecordExportedData + ","; | ||
458 | MochiKit.Style.setElementDimensions(aProgressBar, {w:aProgress * this.progressWidth()}); | ||
459 | }, this, textarea, progressBar, ((i+1)/c))); | ||
460 | deferredResult.addCallback(MochiKit.Async.wait, 0.2); | ||
461 | } | ||
462 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("exportAllData - 2: " + res); return res;}); | ||
463 | deferredResult.addCallback(function(aTextareaWrapper, aTextarea, aProgressWrapper) { | ||
464 | aTextarea.value = aTextarea.value.slice(0, -1) + "\n]"; | ||
465 | // MochiKit.DOM.replaceChildNodes(aProgressWrapper); | ||
466 | MochiKit.Style.hideElement(aProgressWrapper); | ||
467 | MochiKit.Style.showElement(aTextareaWrapper); | ||
468 | aTextarea.focus(); | ||
469 | aTextarea.select(); | ||
470 | }, textareaWrapper, textarea, progressWrapper); | ||
471 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("exportAllData - 3: " + res); return res;}); | ||
472 | deferredResult.addBoth(function(aWindow) { | ||
473 | aWindow.stop(); | ||
474 | }, currentWindow); | ||
475 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("exportAllData - 4: " + res); return res;}); | ||
476 | |||
477 | deferredResult.callback(); | ||
478 | }, this, allRecords)); | ||
479 | }, | ||
480 | |||
481 | //------------------------------------------------------------------------- | ||
482 | |||
483 | __syntaxFix__: "syntax fix" | ||
484 | |||
485 | }); | ||
486 | |||