Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Controllers') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js index 9a0e744..1ab2e69 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js | |||
@@ -226,19 +226,21 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { | |||
226 | 226 | ||
227 | this.appPage().slotNamed('accountPanel').setContent(this.accountPanel()); | 227 | this.appPage().slotNamed('accountPanel').setContent(this.accountPanel()); |
228 | this.appPage().slotNamed('dataPanel').setContent(this.dataPanel()); | 228 | this.appPage().slotNamed('dataPanel').setContent(this.dataPanel()); |
229 | this.appPage().slotNamed('toolsPanel').setContent(this.toolsPanel()); | 229 | this.appPage().slotNamed('toolsPanel').setContent(this.toolsPanel()); |
230 | 230 | ||
231 | this.hideAllAppPageTabSlots(); | 231 | this.hideAllAppPageTabSlots(); |
232 | this.appPage().showSlot(this.slotNameForTab('cards')); | 232 | this.appPage().showSlot(this.slotNameForTab('cards')); |
233 | 233 | ||
234 | MochiKit.Signal.connect(this.tabSidePanel(), 'tabSelected',this, 'handleTabSelected'); | 234 | MochiKit.Signal.connect(this.tabSidePanel(), 'tabSelected', this, 'handleTabSelected'); |
235 | MochiKit.Signal.connect(this.tabSidePanel(), 'addCard', this, 'handleAddCard'); | 235 | MochiKit.Signal.connect(this.tabSidePanel(), 'addCard', this, 'handleAddCard'); |
236 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'addCard', this, 'handleAddCard'); | 236 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'addCard', this, 'handleAddCard'); |
237 | |||
238 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'downloadOfflineCopy',this, 'handleDownloadOfflineCopy'); | ||
237 | 239 | ||
238 | deferredResult = new Clipperz.Async.Deferred("AppController.run", {trace:false}); | 240 | deferredResult = new Clipperz.Async.Deferred("AppController.run", {trace:false}); |
239 | 241 | ||
240 | deferredResult.addMethod(this.cardsController(), 'run', {slot:this.appPage().slotNamed('cardGrid'), user:user}); | 242 | deferredResult.addMethod(this.cardsController(), 'run', {slot:this.appPage().slotNamed('cardGrid'), user:user}); |
241 | // deferredResult.addMethod(this.directLoginsController(), 'run', {slot:this.appPage().slotNamed('directLoginGrid'), user:user}); | 243 | // deferredResult.addMethod(this.directLoginsController(), 'run', {slot:this.appPage().slotNamed('directLoginGrid'), user:user}); |
242 | deferredResult.addMethod(this, 'populateUserInfo'); | 244 | deferredResult.addMethod(this, 'populateUserInfo'); |
243 | 245 | ||
244 | deferredResult.addCallback(MochiKit.Visual.ScrollTo, 'miscLinks', {duration:0}); | 246 | deferredResult.addCallback(MochiKit.Visual.ScrollTo, 'miscLinks', {duration:0}); |
@@ -316,11 +318,34 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { | |||
316 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'), | 318 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'), |
317 | MochiKit.Base.method(this.user(), 'login'), | 319 | MochiKit.Base.method(this.user(), 'login'), |
318 | MochiKit.Base.method(this.cardsController(), 'focus'), | 320 | MochiKit.Base.method(this.cardsController(), 'focus'), |
319 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'), | 321 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'), |
320 | MochiKit.Base.method(this.userInfoBox(), 'unlock') | 322 | MochiKit.Base.method(this.userInfoBox(), 'unlock') |
321 | ], {trace:false}); | 323 | ], {trace:false}); |
322 | }, | 324 | }, |
323 | 325 | ||
326 | 'handleDownloadOfflineCopy': function (anEvent) { | ||
327 | console.log("AppController.handleDownloadOfflineCopy"); | ||
328 | var downloadHref; | ||
329 | |||
330 | downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl; | ||
331 | |||
332 | if (Clipperz_IEisBroken == true) { | ||
333 | window.open(downloadHref, ""); | ||
334 | } else { | ||
335 | vardeferredResult; | ||
336 | var newWindow; | ||
337 | |||
338 | newWindow = window.open("", ""); | ||
339 | |||
340 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:true}); | ||
341 | deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"}); | ||
342 | deferredResult.addCallback(function(aWindow) { | ||
343 | aWindow.location.href = downloadHref; | ||
344 | }, newWindow); | ||
345 | deferredResult.callback(); | ||
346 | } | ||
347 | }, | ||
348 | |||
324 | //============================================================================= | 349 | //============================================================================= |
325 | __syntaxFix__: "syntax fix" | 350 | __syntaxFix__: "syntax fix" |
326 | }); | 351 | }); |