summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js') (more/less context) (show whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js23
1 files changed, 10 insertions, 13 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 1ab2e69..3d9d6d3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
@@ -1,46 +1,44 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers');
27 25
28Clipperz.PM.UI.Web.Controllers.AppController = function(args) { 26Clipperz.PM.UI.Web.Controllers.AppController = function(args) {
29 27
30 this._user = null; 28 this._user = null;
31 this._tabSlotNames = { 29 this._tabSlotNames = {
32 //tabName: slotName 30 //tabName: slotName
33 'cards': 'cardGrid', 31 'cards': 'cardGrid',
34 // 'directLogins':'directLoginGrid', 32 // 'directLogins':'directLoginGrid',
35 'account': 'accountPanel', 33 'account': 'accountPanel',
36 'data': 'dataPanel', 34 'data': 'dataPanel',
37 'tools': 'toolsPanel' 35 'tools': 'toolsPanel'
38 }; 36 };
39 37
40 //controllers 38 //controllers
41 this._cardsController= null; 39 this._cardsController= null;
42 //this._directLoginsController = null; 40 //this._directLoginsController = null;
43 this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController(); 41 this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController();
44 42
45 //components 43 //components
46 this._appPage = null; 44 this._appPage = null;
@@ -303,49 +301,48 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, {
303 }, 301 },
304 302
305 //----------------------------------------------------------------------------- 303 //-----------------------------------------------------------------------------
306 304
307 'handleLock': function (anEvent) { 305 'handleLock': function (anEvent) {
308 return Clipperz.Async.callbacks("AppController.handleLock", [ 306 return Clipperz.Async.callbacks("AppController.handleLock", [
309 MochiKit.Base.method(this.cardsController(), 'deleteAllCleanTextData'), 307 MochiKit.Base.method(this.cardsController(), 'deleteAllCleanTextData'),
310 MochiKit.Base.method(this.user(), 'lock') 308 MochiKit.Base.method(this.user(), 'lock')
311 ], {trace:false}); 309 ], {trace:false});
312 }, 310 },
313 311
314 //............................................................................. 312 //.............................................................................
315 313
316 'handleUnlock': function (anEvent) { 314 'handleUnlock': function (anEvent) {
317 return Clipperz.Async.callbacks("AppController.handleUnock", [ 315 return Clipperz.Async.callbacks("AppController.handleUnock", [
318 MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'), 316 MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'),
319 MochiKit.Base.method(this.user(), 'login'), 317 MochiKit.Base.method(this.user(), 'login'),
320 MochiKit.Base.method(this.cardsController(), 'focus'), 318 MochiKit.Base.method(this.cardsController(), 'focus'),
321 MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'), 319 MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'),
322 MochiKit.Base.method(this.userInfoBox(), 'unlock') 320 MochiKit.Base.method(this.userInfoBox(), 'unlock')
323 ], {trace:false}); 321 ], {trace:false});
324 }, 322 },
325 323
326 'handleDownloadOfflineCopy': function (anEvent) { 324 'handleDownloadOfflineCopy': function (anEvent) {
327console.log("AppController.handleDownloadOfflineCopy");
328 var downloadHref; 325 var downloadHref;
329 326
330 downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl; 327 downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl;
331 328
332 if (Clipperz_IEisBroken == true) { 329 if (Clipperz_IEisBroken == true) {
333 window.open(downloadHref, ""); 330 window.open(downloadHref, "");
334 } else { 331 } else {
335 vardeferredResult; 332 vardeferredResult;
336 var newWindow; 333 var newWindow;
337 334
338 newWindow = window.open("", ""); 335 newWindow = window.open("", "");
339 336
340 deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:true}); 337 deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:true});
341 deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"}); 338 deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"});
342 deferredResult.addCallback(function(aWindow) { 339 deferredResult.addCallback(function(aWindow) {
343 aWindow.location.href = downloadHref; 340 aWindow.location.href = downloadHref;
344 }, newWindow); 341 }, newWindow);
345 deferredResult.callback(); 342 deferredResult.callback();
346 } 343 }
347 }, 344 },
348 345
349 //============================================================================= 346 //=============================================================================
350 __syntaxFix__: "syntax fix" 347 __syntaxFix__: "syntax fix"
351}); 348});