author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2 |
Updated Copyright claims
- updated reference dates;
- removed reference to Community Edition;
- normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js | 23 |
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,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer 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 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.AppController = function(args) { | 26 | Clipperz.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; |
47 | this._userInfoBox = null; | 45 | this._userInfoBox = null; |
48 | this._tabSidePanel = null; | 46 | this._tabSidePanel = null; |
49 | 47 | ||
50 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'editCard', this, 'handleEditCard'); | 48 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'editCard', this, 'handleEditCard'); |
51 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'deleteCard',this, 'handleDeleteCard'); | 49 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'deleteCard',this, 'handleDeleteCard'); |
52 | 50 | ||
53 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userDataSuccessfullySaved',this, 'userDataSuccessfullySavedHandler'); | 51 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userDataSuccessfullySaved',this, 'userDataSuccessfullySavedHandler'); |
54 | 52 | ||
55 | return this; | 53 | return this; |
56 | } | 54 | } |
57 | 55 | ||
58 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { | 56 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { |
59 | 57 | ||
60 | 'toString': function() { | 58 | 'toString': function() { |
61 | return "Clipperz.PM.UI.Web.Controllers.AppController"; | 59 | return "Clipperz.PM.UI.Web.Controllers.AppController"; |
62 | }, | 60 | }, |
63 | 61 | ||
64 | //----------------------------------------------------------------------------- | 62 | //----------------------------------------------------------------------------- |
65 | 63 | ||
66 | 'setUser': function(anUser) { | 64 | 'setUser': function(anUser) { |
67 | this._user = anUser; | 65 | this._user = anUser; |
68 | }, | 66 | }, |
69 | 67 | ||
70 | 'user': function() { | 68 | 'user': function() { |
@@ -279,73 +277,72 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { | |||
279 | //============================================================================= | 277 | //============================================================================= |
280 | 278 | ||
281 | 'handleAddCard': function (aSourceElement) { | 279 | 'handleAddCard': function (aSourceElement) { |
282 | //Clipperz.log("=== AppController.addCard", aSourceElement); | 280 | //Clipperz.log("=== AppController.addCard", aSourceElement); |
283 | this.cardsController().addCard(aSourceElement); | 281 | this.cardsController().addCard(aSourceElement); |
284 | }, | 282 | }, |
285 | 283 | ||
286 | //============================================================================= | 284 | //============================================================================= |
287 | 285 | ||
288 | 'userDataSuccessfullySavedHandler': function (anEvent) { | 286 | 'userDataSuccessfullySavedHandler': function (anEvent) { |
289 | this.populateUserInfo(); | 287 | this.populateUserInfo(); |
290 | }, | 288 | }, |
291 | 289 | ||
292 | //============================================================================= | 290 | //============================================================================= |
293 | 291 | ||
294 | 'handleLogout': function(anEvent) { | 292 | 'handleLogout': function(anEvent) { |
295 | var deferredResult; | 293 | var deferredResult; |
296 | 294 | ||
297 | deferredResult = new Clipperz.Async.Deferred("AppController.handleLogout", {trace:false}); | 295 | deferredResult = new Clipperz.Async.Deferred("AppController.handleLogout", {trace:false}); |
298 | deferredResult.addMethod(this.user(), 'logout'); | 296 | deferredResult.addMethod(this.user(), 'logout'); |
299 | deferredResult.addCallback(MochiKit.Signal.signal, this, 'logout'); | 297 | deferredResult.addCallback(MochiKit.Signal.signal, this, 'logout'); |
300 | deferredResult.callback(); | 298 | deferredResult.callback(); |
301 | 299 | ||
302 | return deferredResult; | 300 | return deferredResult; |
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) { |
327 | console.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 | }); |