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 | |
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') (more/less context) (ignore whitespace changes)
10 files changed, 102 insertions, 141 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 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js index effde31..b1ff81f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.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.CardDialogController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); | 29 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); |
32 | 30 | ||
33 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | 33 | ||
36 | this._referenceElement = null; | 34 | this._referenceElement = null; |
37 | this._cardDialogComponent = null; | 35 | this._cardDialogComponent = null; |
38 | 36 | ||
39 | this._fieldsReferences = {}; | 37 | this._fieldsReferences = {}; |
40 | this._directLoginReferences = {}; | 38 | this._directLoginReferences = {}; |
41 | 39 | ||
42 | this._directLoginWizardController = null; | 40 | this._directLoginWizardController = null; |
43 | this._directLoginEditingComponent = null; | 41 | this._directLoginEditingComponent = null; |
44 | this._isDirectLoginEditingComponentVisible = false; | 42 | this._isDirectLoginEditingComponentVisible = false; |
45 | 43 | ||
46 | return this; | 44 | return this; |
47 | }; | 45 | }; |
48 | 46 | ||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { | 47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { |
50 | 48 | ||
51 | 'toString': function() { | 49 | 'toString': function() { |
52 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; | 50 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
56 | 54 | ||
57 | 'record': function () { | 55 | 'record': function () { |
58 | return this._record; | 56 | return this._record; |
59 | }, | 57 | }, |
60 | 58 | ||
61 | 'delegate': function () { | 59 | 'delegate': function () { |
62 | return this._delegate; | 60 | return this._delegate; |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | 'fieldsReferences': function () { | 65 | 'fieldsReferences': function () { |
68 | return this._fieldsReferences; | 66 | return this._fieldsReferences; |
69 | }, | 67 | }, |
70 | 68 | ||
@@ -329,97 +327,96 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object | |||
329 | 327 | ||
330 | return deferredResult; | 328 | return deferredResult; |
331 | }, | 329 | }, |
332 | 330 | ||
333 | //------------------------------------------------------------------------- | 331 | //------------------------------------------------------------------------- |
334 | 332 | ||
335 | 'updateRecordDirectLoginDetails': function (aDirectLogin) { | 333 | 'updateRecordDirectLoginDetails': function (aDirectLogin) { |
336 | var result; | 334 | var result; |
337 | 335 | ||
338 | if (MochiKit.Base.isUndefinedOrNull(aDirectLogin)) { | 336 | if (MochiKit.Base.isUndefinedOrNull(aDirectLogin)) { |
339 | result = MochiKit.Async.succeed(); | 337 | result = MochiKit.Async.succeed(); |
340 | } else { | 338 | } else { |
341 | result = Clipperz.Async.callbacks("CardDialogController.updateRecordDirectLoginDetails", [ | 339 | result = Clipperz.Async.callbacks("CardDialogController.updateRecordDirectLoginDetails", [ |
342 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), | 340 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), |
343 | MochiKit.Base.method(aDirectLogin, 'setLabel'), | 341 | MochiKit.Base.method(aDirectLogin, 'setLabel'), |
344 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), | 342 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), |
345 | MochiKit.Base.method(aDirectLogin, 'setFavicon') | 343 | MochiKit.Base.method(aDirectLogin, 'setFavicon') |
346 | ], {trace:false}); | 344 | ], {trace:false}); |
347 | } | 345 | } |
348 | 346 | ||
349 | return result; | 347 | return result; |
350 | }, | 348 | }, |
351 | 349 | ||
352 | //========================================================================= | 350 | //========================================================================= |
353 | 351 | ||
354 | 'addField': function () { | 352 | 'addField': function () { |
355 | return this.record().addField({ | 353 | return this.record().addField({ |
356 | 'label':this.cardDialogComponent().newFieldLabel(), | 354 | 'label':this.cardDialogComponent().newFieldLabel(), |
357 | 'value':this.cardDialogComponent().newFieldValue(), | 355 | 'value':this.cardDialogComponent().newFieldValue(), |
358 | 'isHidden':this.cardDialogComponent().newFieldIsHidden() | 356 | 'isHidden':this.cardDialogComponent().newFieldIsHidden() |
359 | }); | 357 | }); |
360 | }, | 358 | }, |
361 | 359 | ||
362 | 'handleAddField': function () { | 360 | 'handleAddField': function () { |
363 | return Clipperz.Async.callbacks("CardDialogController.handleAddField", [ | 361 | return Clipperz.Async.callbacks("CardDialogController.handleAddField", [ |
364 | MochiKit.Base.method(this, 'addField'), | 362 | MochiKit.Base.method(this, 'addField'), |
365 | 363 | ||
366 | MochiKit.Base.method(this, 'addCardDialogComponentWithField'), | 364 | MochiKit.Base.method(this, 'addCardDialogComponentWithField'), |
367 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), | 365 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), |
368 | 366 | ||
369 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | 367 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), |
370 | MochiKit.Base.method(this, 'handleChangedValue') | 368 | MochiKit.Base.method(this, 'handleChangedValue') |
371 | ], {trace:false}) | 369 | ], {trace:false}) |
372 | }, | 370 | }, |
373 | 371 | ||
374 | //------------------------------------------------------------------------- | 372 | //------------------------------------------------------------------------- |
375 | 373 | ||
376 | 'handlePerformFieldAction': function (aFieldID, aTargetElement) { | 374 | 'handlePerformFieldAction': function (aFieldID, aTargetElement) { |
377 | //console.log("### targetElement", aTargetElement); | ||
378 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ | 375 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ |
379 | MochiKit.Base.method(this.record(), 'fields'), | 376 | MochiKit.Base.method(this.record(), 'fields'), |
380 | MochiKit.Base.itemgetter(aFieldID), | 377 | MochiKit.Base.itemgetter(aFieldID), |
381 | Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", { | 378 | Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", { |
382 | 'value':MochiKit.Base.methodcaller('value'), | 379 | 'value':MochiKit.Base.methodcaller('value'), |
383 | 'type': MochiKit.Base.methodcaller('actionType') | 380 | 'type': MochiKit.Base.methodcaller('actionType') |
384 | }, {trace:false}), | 381 | }, {trace:false}), |
385 | MochiKit.Base.bind(function (someValues) { | 382 | MochiKit.Base.bind(function (someValues) { |
386 | switch (someValues['type']) { | 383 | switch (someValues['type']) { |
387 | case 'NONE': | 384 | case 'NONE': |
388 | throw "this event handler should not be triggered for fields with type 'NONE'"; | 385 | throw "this event handler should not be triggered for fields with type 'NONE'"; |
389 | break; | 386 | break; |
390 | case 'URL': | 387 | case 'URL': |
391 | var url; | 388 | var url; |
392 | 389 | ||
393 | url = someValues['value']; | 390 | url = someValues['value']; |
394 | if (/^https?\:\/\//.test(url) == false) { | 391 | if (/^https?\:\/\//.test(url) == false) { |
395 | url = 'http://' + url; | 392 | url = 'http://' + url; |
396 | } | 393 | } |
397 | 394 | ||
398 | window.open(url); | 395 | window.open(url); |
399 | break; | 396 | break; |
400 | case 'EMAIL': | 397 | case 'EMAIL': |
401 | var url; | 398 | var url; |
402 | 399 | ||
403 | url = 'mailto:' + someValues['value']; | 400 | url = 'mailto:' + someValues['value']; |
404 | 401 | ||
405 | MochiKit.DOM.currentWindow().location = url; | 402 | MochiKit.DOM.currentWindow().location = url; |
406 | break; | 403 | break; |
407 | case 'PASSWORD': | 404 | case 'PASSWORD': |
408 | //Clipperz.log("SHOW PASSWORD " + someValues['value']); | 405 | //Clipperz.log("SHOW PASSWORD " + someValues['value']); |
409 | this.showPasswordTooltip(someValues['value'], aTargetElement); | 406 | this.showPasswordTooltip(someValues['value'], aTargetElement); |
410 | break; | 407 | break; |
411 | } | 408 | } |
412 | }, this) | 409 | }, this) |
413 | ], {trace:false}); | 410 | ], {trace:false}); |
414 | }, | 411 | }, |
415 | 412 | ||
416 | //------------------------------------------------------------------------- | 413 | //------------------------------------------------------------------------- |
417 | 414 | ||
418 | 'handleDeleteField': function (aFieldID) { | 415 | 'handleDeleteField': function (aFieldID) { |
419 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ | 416 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ |
420 | MochiKit.Base.method(this.record(), 'fields'), | 417 | MochiKit.Base.method(this.record(), 'fields'), |
421 | MochiKit.Base.itemgetter(aFieldID), | 418 | MochiKit.Base.itemgetter(aFieldID), |
422 | MochiKit.Base.method(this.record(), 'removeField'), | 419 | MochiKit.Base.method(this.record(), 'removeField'), |
423 | 420 | ||
424 | MochiKit.Base.method(this, 'fieldsReferences'), | 421 | MochiKit.Base.method(this, 'fieldsReferences'), |
425 | MochiKit.Base.itemgetter(aFieldID), | 422 | MochiKit.Base.itemgetter(aFieldID), |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js index f58f0b8..68b5b9f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.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.CardsController = function() { | 26 | Clipperz.PM.UI.Web.Controllers.CardsController = function() { |
29 | Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments); | 27 | Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments); |
30 | 28 | ||
31 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard'); | 29 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard'); |
32 | 30 | ||
33 | return this; | 31 | return this; |
34 | } | 32 | } |
35 | 33 | ||
36 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, { | 34 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, { |
37 | 35 | ||
38 | 'toString': function() { | 36 | 'toString': function() { |
39 | return "Clipperz.PM.UI.Web.Controllers.CardsController"; | 37 | return "Clipperz.PM.UI.Web.Controllers.CardsController"; |
40 | }, | 38 | }, |
41 | 39 | ||
42 | 'createGrid': function () { | 40 | 'createGrid': function () { |
43 | var grid; | 41 | var grid; |
44 | 42 | ||
45 | grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ | 43 | grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ |
46 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ | 44 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ |
47 | 'name': 'Cards.favicon', | 45 | 'name': 'Cards.favicon', |
48 | 'selector': MochiKit.Base.methodcaller('favicon'), | 46 | 'selector': MochiKit.Base.methodcaller('favicon'), |
49 | 'cssClass': 'favicon' | 47 | 'cssClass': 'favicon' |
50 | }), | 48 | }), |
51 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 49 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
52 | 'name': 'Cards.title', | 50 | 'name': 'Cards.title', |
53 | 'selector': MochiKit.Base.methodcaller('label'), | 51 | 'selector': MochiKit.Base.methodcaller('label'), |
54 | 'label': 'title', | 52 | 'label': 'title', |
55 | 'cssClass': 'title', | 53 | 'cssClass': 'title', |
56 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 54 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
57 | 'sortable': true, | 55 | 'sortable': true, |
58 | 'sorted': 'ASCENDING', | 56 | 'sorted': 'ASCENDING', |
59 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'editCard', {objectData:anObject, element:anEvent.src()})} | 57 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'editCard', {objectData:anObject, element:anEvent.src()})} |
60 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') | 58 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') |
61 | }), | 59 | }), |
62 | new Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager({ | 60 | new Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager({ |
63 | 'name': 'Cards.directLogins', | 61 | 'name': 'Cards.directLogins', |
64 | 'selector': MochiKit.Base.methodcaller('directLoginReferences'), | 62 | 'selector': MochiKit.Base.methodcaller('directLoginReferences'), |
65 | 'label': 'direct logins', | 63 | 'label': 'direct logins', |
66 | 'cssClass': 'directLogin' | 64 | 'cssClass': 'directLogin' |
67 | }), | 65 | }), |
68 | new Clipperz.PM.UI.Web.Components.DateColumnManager({ | 66 | new Clipperz.PM.UI.Web.Components.DateColumnManager({ |
69 | 'name': 'Cards.latestUpdate', | 67 | 'name': 'Cards.latestUpdate', |
70 | 'selector': MochiKit.Base.methodcaller('updateDate'), | 68 | 'selector': MochiKit.Base.methodcaller('updateDate'), |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js index c025a51..92ed6e3 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.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.DirectLoginWizardController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController = function(args) { |
29 | this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | 27 | this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); |
30 | this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter'); | 28 | this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter'); |
31 | 29 | ||
32 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); | 30 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); |
33 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward'); | 31 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward'); |
34 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); | 32 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); |
35 | 33 | ||
36 | this._directLogin = null; | 34 | this._directLogin = null; |
37 | this._directLoginHasJustBeenAdded = false; | 35 | this._directLoginHasJustBeenAdded = false; |
38 | 36 | ||
39 | this._rulerComponent = null; | 37 | this._rulerComponent = null; |
40 | 38 | ||
41 | this._steps = null; | 39 | this._steps = null; |
42 | this._currentStepIndex = 0; | 40 | this._currentStepIndex = 0; |
43 | this._isNextEnabled = false; | 41 | this._isNextEnabled = false; |
44 | 42 | ||
45 | this._recordFields = null; | 43 | this._recordFields = null; |
46 | this._originalBindings = null; | 44 | this._originalBindings = null; |
47 | 45 | ||
48 | this._bindingComponents = []; | 46 | this._bindingComponents = []; |
49 | this._formValueComponents = []; | 47 | this._formValueComponents = []; |
50 | 48 | ||
51 | return this; | 49 | return this; |
52 | } | 50 | } |
53 | 51 | ||
54 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.prototype, { | 52 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.prototype, { |
55 | 53 | ||
56 | 'toString': function() { | 54 | 'toString': function() { |
57 | return "Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController"; | 55 | return "Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController"; |
58 | }, | 56 | }, |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'directLogin': function () { | 60 | 'directLogin': function () { |
63 | return this._directLogin; | 61 | return this._directLogin; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'directLoginHasJustBeenAdded': function () { | 66 | 'directLoginHasJustBeenAdded': function () { |
69 | return this._directLoginHasJustBeenAdded; | 67 | return this._directLoginHasJustBeenAdded; |
70 | }, | 68 | }, |
@@ -118,97 +116,96 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController. | |||
118 | 'resetBindingComponents': function () { | 116 | 'resetBindingComponents': function () { |
119 | this.directLoginEditingComponent().clearAllBindingsComponents(); | 117 | this.directLoginEditingComponent().clearAllBindingsComponents(); |
120 | this._bindingComponents = []; | 118 | this._bindingComponents = []; |
121 | }, | 119 | }, |
122 | 120 | ||
123 | //============================================================================= | 121 | //============================================================================= |
124 | 122 | ||
125 | 'formValueComponents': function () { | 123 | 'formValueComponents': function () { |
126 | return this._formValueComponents; | 124 | return this._formValueComponents; |
127 | }, | 125 | }, |
128 | 126 | ||
129 | 'resetFormValueComponents': function () { | 127 | 'resetFormValueComponents': function () { |
130 | this.directLoginEditingComponent().clearAllFormValueComponents(); | 128 | this.directLoginEditingComponent().clearAllFormValueComponents(); |
131 | this._formValueComponents = []; | 129 | this._formValueComponents = []; |
132 | }, | 130 | }, |
133 | 131 | ||
134 | //============================================================================= | 132 | //============================================================================= |
135 | 133 | ||
136 | 'recordFields': function () { | 134 | 'recordFields': function () { |
137 | return this._recordFields; | 135 | return this._recordFields; |
138 | }, | 136 | }, |
139 | 137 | ||
140 | 'setRecordFields': function (aValue) { | 138 | 'setRecordFields': function (aValue) { |
141 | this._recordFields = aValue; | 139 | this._recordFields = aValue; |
142 | }, | 140 | }, |
143 | 141 | ||
144 | 'recordFieldWithReference': function (aReference) { | 142 | 'recordFieldWithReference': function (aReference) { |
145 | var matchingValues; | 143 | var matchingValues; |
146 | var result; | 144 | var result; |
147 | 145 | ||
148 | matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields()); | 146 | matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields()); |
149 | 147 | ||
150 | if (matchingValues.length == 0) { | 148 | if (matchingValues.length == 0) { |
151 | result = null; | 149 | result = null; |
152 | } else { | 150 | } else { |
153 | result = matchingValues[0]; | 151 | result = matchingValues[0]; |
154 | } | 152 | } |
155 | 153 | ||
156 | return result; | 154 | return result; |
157 | }, | 155 | }, |
158 | 156 | ||
159 | //----------------------------------------------------------------------------- | 157 | //----------------------------------------------------------------------------- |
160 | 158 | ||
161 | 'originalBindings': function () { | 159 | 'originalBindings': function () { |
162 | return this._originalBindings; | 160 | return this._originalBindings; |
163 | }, | 161 | }, |
164 | 162 | ||
165 | 'setOriginalBindings': function (aValue) { | 163 | 'setOriginalBindings': function (aValue) { |
166 | //console.log("BINDINGS", aValue); | ||
167 | this._originalBindings = aValue; | 164 | this._originalBindings = aValue; |
168 | }, | 165 | }, |
169 | 166 | ||
170 | //============================================================================= | 167 | //============================================================================= |
171 | 168 | ||
172 | 'rulerComponent': function () { | 169 | 'rulerComponent': function () { |
173 | if (this._rulerComponent == null) { | 170 | if (this._rulerComponent == null) { |
174 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | 171 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ |
175 | translationContext:'Wizards.DirectLoginWizard' | 172 | translationContext:'Wizards.DirectLoginWizard' |
176 | }); | 173 | }); |
177 | this._rulerComponent.render(); | 174 | this._rulerComponent.render(); |
178 | 175 | ||
179 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | 176 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); |
180 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | 177 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); |
181 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | 178 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); |
182 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | 179 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); |
183 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | 180 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); |
184 | } | 181 | } |
185 | 182 | ||
186 | return this._rulerComponent; | 183 | return this._rulerComponent; |
187 | }, | 184 | }, |
188 | 185 | ||
189 | //----------------------------------------------------------------------------- | 186 | //----------------------------------------------------------------------------- |
190 | 187 | ||
191 | 'showRuler': function (someSteps) { | 188 | 'showRuler': function (someSteps) { |
192 | var rulerElement; | 189 | var rulerElement; |
193 | 190 | ||
194 | this.setSteps(someSteps); | 191 | this.setSteps(someSteps); |
195 | 192 | ||
196 | rulerElement = this.rulerComponent().element(); | 193 | rulerElement = this.rulerComponent().element(); |
197 | this.directLoginEditingComponent().disableAllPanels(); | 194 | this.directLoginEditingComponent().disableAllPanels(); |
198 | 195 | ||
199 | MochiKit.Style.showElement(rulerElement); | 196 | MochiKit.Style.showElement(rulerElement); |
200 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.directLoginEditingComponent().bottomMargin()}); | 197 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.directLoginEditingComponent().bottomMargin()}); |
201 | new MochiKit.Visual.Move(rulerElement, { | 198 | new MochiKit.Visual.Move(rulerElement, { |
202 | x:0, y:this.directLoginEditingComponent().bottomMargin(), | 199 | x:0, y:this.directLoginEditingComponent().bottomMargin(), |
203 | mode:'absolute', | 200 | mode:'absolute', |
204 | duration:1, | 201 | duration:1, |
205 | afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') | 202 | afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') |
206 | }); | 203 | }); |
207 | }, | 204 | }, |
208 | 205 | ||
209 | 'fixRulerRendering': function (aValue) { | 206 | 'fixRulerRendering': function (aValue) { |
210 | this.rulerComponent().setDisplayMode(aValue); | 207 | this.rulerComponent().setDisplayMode(aValue); |
211 | }, | 208 | }, |
212 | 209 | ||
213 | //----------------------------------------------------------------------------- | 210 | //----------------------------------------------------------------------------- |
214 | 211 | ||
@@ -362,98 +359,96 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController. | |||
362 | this.directLoginEditingComponent().focusOnFaviconElement(); | 359 | this.directLoginEditingComponent().focusOnFaviconElement(); |
363 | break; | 360 | break; |
364 | case 'DONE': | 361 | case 'DONE': |
365 | break; | 362 | break; |
366 | } | 363 | } |
367 | }, | 364 | }, |
368 | 365 | ||
369 | //============================================================================= | 366 | //============================================================================= |
370 | 367 | ||
371 | 'steps': function () { | 368 | 'steps': function () { |
372 | return this._steps; | 369 | return this._steps; |
373 | }, | 370 | }, |
374 | 371 | ||
375 | 'setSteps': function (aValue) { | 372 | 'setSteps': function (aValue) { |
376 | this._steps = aValue; | 373 | this._steps = aValue; |
377 | 374 | ||
378 | this.rulerComponent().setSteps(aValue); | 375 | this.rulerComponent().setSteps(aValue); |
379 | this.resetCurrentStepIndex(); | 376 | this.resetCurrentStepIndex(); |
380 | }, | 377 | }, |
381 | 378 | ||
382 | 'currentStepIndex': function () { | 379 | 'currentStepIndex': function () { |
383 | return this._currentStepIndex; | 380 | return this._currentStepIndex; |
384 | }, | 381 | }, |
385 | 382 | ||
386 | 'currentStep': function () { | 383 | 'currentStep': function () { |
387 | return this.steps()[this.currentStepIndex()]; | 384 | return this.steps()[this.currentStepIndex()]; |
388 | }, | 385 | }, |
389 | 386 | ||
390 | //============================================================================= | 387 | //============================================================================= |
391 | 388 | ||
392 | 'handleExit': function () { | 389 | 'handleExit': function () { |
393 | MochiKit.Signal.signal(this, 'exit'); | 390 | MochiKit.Signal.signal(this, 'exit'); |
394 | }, | 391 | }, |
395 | 392 | ||
396 | 'done': function () { | 393 | 'done': function () { |
397 | this.doneWithRuler(); | 394 | this.doneWithRuler(); |
398 | 395 | ||
399 | Clipperz.Async.callbacks("DirectLoginWizardController.done", [ | 396 | Clipperz.Async.callbacks("DirectLoginWizardController.done", [ |
400 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), | 397 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), |
401 | MochiKit.Base.method(this.directLogin(), 'setLabel'), | 398 | MochiKit.Base.method(this.directLogin(), 'setLabel'), |
402 | 399 | ||
403 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bookmarkletConfiguration'), | 400 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bookmarkletConfiguration'), |
404 | MochiKit.Base.method(this.directLogin(), 'setBookmarkletConfiguration'), | 401 | MochiKit.Base.method(this.directLogin(), 'setBookmarkletConfiguration'), |
405 | 402 | ||
406 | //Bindings | 403 | //Bindings |
407 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bindingComponents'), | 404 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bindingComponents'), |
408 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.bind(function (aBindingComponent) { | 405 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.bind(function (aBindingComponent) { |
409 | Clipperz.Async.forEach(MochiKit.Base.bind(function (aBindingComponent) { | 406 | Clipperz.Async.forEach(MochiKit.Base.bind(function (aBindingComponent) { |
410 | //console.log("aBindingComponent", aBindingComponent); | ||
411 | // this.directLogin(). | ||
412 | return Clipperz.Async.callbacks("DirectLoginWizardController.done - update directLogin bindings", [ | 407 | return Clipperz.Async.callbacks("DirectLoginWizardController.done - update directLogin bindings", [ |
413 | MochiKit.Base.method(this.directLogin(), 'bindings'), | 408 | MochiKit.Base.method(this.directLogin(), 'bindings'), |
414 | MochiKit.Base.itemgetter(aBindingComponent.formFieldName()), | 409 | MochiKit.Base.itemgetter(aBindingComponent.formFieldName()), |
415 | MochiKit.Base.methodcaller('setFieldKey', aBindingComponent.selectedValue()) | 410 | MochiKit.Base.methodcaller('setFieldKey', aBindingComponent.selectedValue()) |
416 | ], {trace:false}); | 411 | ], {trace:false}); |
417 | }, this)), | 412 | }, this)), |
418 | 413 | ||
419 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), | 414 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), |
420 | MochiKit.Base.method(this.directLogin(), 'setFavicon'), | 415 | MochiKit.Base.method(this.directLogin(), 'setFavicon'), |
421 | 416 | ||
422 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'done', { | 417 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'done', { |
423 | 'directLogin': this.directLogin(), | 418 | 'directLogin': this.directLogin(), |
424 | 'hasJustBeenAdded':this.directLoginHasJustBeenAdded() | 419 | 'hasJustBeenAdded':this.directLoginHasJustBeenAdded() |
425 | }) | 420 | }) |
426 | ], {trace:false}); | 421 | ], {trace:false}); |
427 | }, | 422 | }, |
428 | 423 | ||
429 | //============================================================================= | 424 | //============================================================================= |
430 | 425 | ||
431 | 'handleMoveBackward': function () { | 426 | 'handleMoveBackward': function () { |
432 | if (this._currentStepIndex > 0) { | 427 | if (this._currentStepIndex > 0) { |
433 | varafterMoveAction; | 428 | varafterMoveAction; |
434 | 429 | ||
435 | this._currentStepIndex --; | 430 | this._currentStepIndex --; |
436 | afterMoveAction = MochiKit.Base.noop; | 431 | afterMoveAction = MochiKit.Base.noop; |
437 | 432 | ||
438 | switch(this.currentStep()) { | 433 | switch(this.currentStep()) { |
439 | case 'LABEL': | 434 | case 'LABEL': |
440 | break; | 435 | break; |
441 | case 'TYPE': | 436 | case 'TYPE': |
442 | break; | 437 | break; |
443 | case 'CONFIGURATION': | 438 | case 'CONFIGURATION': |
444 | break; | 439 | break; |
445 | case 'BINDINGS': | 440 | case 'BINDINGS': |
446 | break; | 441 | break; |
447 | case 'FAVICON': | 442 | case 'FAVICON': |
448 | break; | 443 | break; |
449 | case 'DONE': | 444 | case 'DONE': |
450 | break; | 445 | break; |
451 | }; | 446 | }; |
452 | 447 | ||
453 | this.rulerComponent().moveBackward(afterMoveAction); | 448 | this.rulerComponent().moveBackward(afterMoveAction); |
454 | } | 449 | } |
455 | 450 | ||
456 | if (this._currentStepIndex == 0) { | 451 | if (this._currentStepIndex == 0) { |
457 | this.enablePrevious(false); | 452 | this.enablePrevious(false); |
458 | } | 453 | } |
459 | }, | 454 | }, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js index 6ca3be4..7ab512a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.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 | /* | 24 | /* |
27 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 25 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
28 | 26 | ||
29 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() { | 27 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() { |
30 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments); | 28 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments); |
31 | 29 | ||
32 | return this; | 30 | return this; |
33 | }; | 31 | }; |
34 | 32 | ||
35 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, { | 33 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, { |
36 | 34 | ||
37 | 'createGrid': function () { | 35 | 'createGrid': function () { |
38 | return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ | 36 | return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ |
39 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ | 37 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ |
40 | 'name': 'DirectLogins.favicon', | 38 | 'name': 'DirectLogins.favicon', |
41 | 'selector': MochiKit.Base.methodcaller('favicon'), | 39 | 'selector': MochiKit.Base.methodcaller('favicon'), |
42 | 'cssClass': 'favicon' | 40 | 'cssClass': 'favicon' |
43 | }), | 41 | }), |
44 | // new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 42 | // new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
45 | new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({ | 43 | new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({ |
46 | 'name': 'DirectLogins.title', | 44 | 'name': 'DirectLogins.title', |
47 | 'selector': MochiKit.Base.methodcaller('label'), | 45 | 'selector': MochiKit.Base.methodcaller('label'), |
48 | 'label': 'title', | 46 | 'label': 'title', |
49 | 'cssClass': 'title', | 47 | 'cssClass': 'title', |
50 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 48 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
51 | 'sortable': true, | 49 | 'sortable': true, |
52 | 'sorted': 'ASCENDING', | 50 | 'sorted': 'ASCENDING', |
53 | 'actionMethod': MochiKit.Base.methodcaller('runDirectLogin') | 51 | 'actionMethod': MochiKit.Base.methodcaller('runDirectLogin') |
54 | }), | 52 | }), |
55 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager | 53 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager |
56 | // 'label':'strength', | 54 | // 'label':'strength', |
57 | // 'cssClass':'title', | 55 | // 'cssClass':'title', |
58 | // 'selector': MochiKit.Base.methodcaller('label') //should be 'strength' or a strenght evaluation function | 56 | // 'selector': MochiKit.Base.methodcaller('label') //should be 'strength' or a strenght evaluation function |
59 | // }), | 57 | // }), |
60 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 58 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
61 | 'name': 'DirectLogins.cardTitle', | 59 | 'name': 'DirectLogins.cardTitle', |
62 | 'selector': MochiKit.Base.compose(MochiKit.Base.methodcaller('label'), MochiKit.Base.methodcaller('record')), | 60 | 'selector': MochiKit.Base.compose(MochiKit.Base.methodcaller('label'), MochiKit.Base.methodcaller('record')), |
63 | 'label': 'card', | 61 | 'label': 'card', |
64 | 'cssClass': 'cardTitle', | 62 | 'cssClass': 'cardTitle', |
65 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 63 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
66 | 'sortable': true, | 64 | 'sortable': true, |
67 | 'sorted': 'UNSORTED', | 65 | 'sorted': 'UNSORTED', |
68 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') | 66 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') |
69 | }), | 67 | }), |
70 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager | 68 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js index bfc093a..de59ec3 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.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.FilterController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.FilterController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args); | 29 | Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args); |
32 | 30 | ||
33 | this._filterElements = []; | 31 | this._filterElements = []; |
34 | this._filter = ""; | 32 | this._filter = ""; |
35 | 33 | ||
36 | this._pendingSearchClicks = 0; | 34 | this._pendingSearchClicks = 0; |
37 | 35 | ||
38 | return this; | 36 | return this; |
39 | }; | 37 | }; |
40 | 38 | ||
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, { |
43 | 41 | ||
44 | //----------------------------------------------------------------------------- | 42 | //----------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'getFilter': function () { | 44 | 'getFilter': function () { |
47 | return this._filter; | 45 | return this._filter; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | '_setFilter': function (aFilterElement, aFilter) { | 48 | '_setFilter': function (aFilterElement, aFilter) { |
51 | if (aFilter != this._filter) { | 49 | if (aFilter != this._filter) { |
52 | this._filter = aFilter; | 50 | this._filter = aFilter; |
53 | MochiKit.Signal.signal(this, 'filterUpdated', aFilter); | 51 | MochiKit.Signal.signal(this, 'filterUpdated', aFilter); |
54 | this.updateFilterElements(aFilterElement, aFilter); | 52 | this.updateFilterElements(aFilterElement, aFilter); |
55 | } | 53 | } |
56 | }, | 54 | }, |
57 | 55 | ||
58 | 'setFilter': function (aFilter) { | 56 | 'setFilter': function (aFilter) { |
59 | this._setFilter(null, aFilter); | 57 | this._setFilter(null, aFilter); |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //----------------------------------------------------------------------------- | 60 | //----------------------------------------------------------------------------- |
63 | 61 | ||
64 | 'filterElements': function () { | 62 | 'filterElements': function () { |
65 | return this._filterElements; | 63 | return this._filterElements; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | 'registerFilterElement': function (aFilterElement) { | 66 | 'registerFilterElement': function (aFilterElement) { |
69 | //Clipperz.log("=== FilterController.registerFilterElement", aFilterElement); | 67 | //Clipperz.log("=== FilterController.registerFilterElement", aFilterElement); |
70 | this._filterElements.push(aFilterElement); | 68 | this._filterElements.push(aFilterElement); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js index 8bb3016..44fbdef 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.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.GridController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.GridController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args); | 29 | Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args); |
32 | 30 | ||
33 | this._grid = null; | 31 | this._grid = null; |
34 | this._user = null; | 32 | this._user = null; |
35 | this._sortedColumnManager = null; | 33 | this._sortedColumnManager = null; |
36 | this._cachedObjects = null; | 34 | this._cachedObjects = null; |
37 | this._filterController = args.filterController || null; | 35 | this._filterController = args.filterController || null; |
38 | 36 | ||
39 | this._deferredDisplaySelectedRowsInvocation = null; | 37 | this._deferredDisplaySelectedRowsInvocation = null; |
40 | 38 | ||
41 | return this; | 39 | return this; |
42 | }; | 40 | }; |
43 | 41 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, { |
45 | 43 | ||
46 | 'toString': function() { | 44 | 'toString': function() { |
47 | return "Clipperz.PM.UI.Web.Controllers.GridController"; | 45 | return "Clipperz.PM.UI.Web.Controllers.GridController"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //----------------------------------------------------------------------------- | 48 | //----------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'createGrid': function () { | 50 | 'createGrid': function () { |
53 | throw Clipperz.Base.exception.AbstractMethod; | 51 | throw Clipperz.Base.exception.AbstractMethod; |
54 | }, | 52 | }, |
55 | 53 | ||
56 | 'setupWithGrid': function (aGrid) { | 54 | 'setupWithGrid': function (aGrid) { |
57 | this._grid = aGrid; | 55 | this._grid = aGrid; |
58 | 56 | ||
59 | if (this._grid != null) { | 57 | if (this._grid != null) { |
60 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 58 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
61 | if (aColumnManager.isSortable()) { | 59 | if (aColumnManager.isSortable()) { |
62 | if (aColumnManager.isSorted()) { | 60 | if (aColumnManager.isSorted()) { |
63 | this.setSortedColumnManager(aColumnManager); | 61 | this.setSortedColumnManager(aColumnManager); |
64 | } | 62 | } |
65 | MochiKit.Signal.connect(aColumnManager, 'sort', this, 'handleColumnManagerSort'); | 63 | MochiKit.Signal.connect(aColumnManager, 'sort', this, 'handleColumnManagerSort'); |
66 | } | 64 | } |
67 | MochiKit.Signal.connect(aColumnManager, 'selectRow', this, 'handleColumnManagerSelectRow'); | 65 | MochiKit.Signal.connect(aColumnManager, 'selectRow', this, 'handleColumnManagerSelectRow'); |
68 | MochiKit.Signal.connect(aColumnManager, 'unselectRow', this, 'handleColumnManagerUnselectRow'); | 66 | MochiKit.Signal.connect(aColumnManager, 'unselectRow', this, 'handleColumnManagerUnselectRow'); |
69 | }, this); | 67 | }, this); |
70 | } | 68 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js index a57152d..ac85d36 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.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.LoginController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.LoginController = function(args) { |
29 | this._args = args || {}; | 27 | this._args = args || {}; |
30 | 28 | ||
31 | this._loginPage = null; | 29 | this._loginPage = null; |
32 | 30 | ||
33 | this._newUserWizardController = null; | 31 | this._newUserWizardController = null; |
34 | this._newUserCreationComponent = null; | 32 | this._newUserCreationComponent = null; |
35 | 33 | ||
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { | 37 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { |
40 | 38 | ||
41 | 'toString': function() { | 39 | 'toString': function() { |
42 | return "Clipperz.PM.UI.Web.Controllers.LoginController"; | 40 | return "Clipperz.PM.UI.Web.Controllers.LoginController"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | 'args': function () { | 43 | 'args': function () { |
46 | return this._args; | 44 | return this._args; |
47 | }, | 45 | }, |
48 | 46 | ||
49 | //----------------------------------------------------------------------------- | 47 | //----------------------------------------------------------------------------- |
50 | 48 | ||
51 | 'loginPage': function() { | 49 | 'loginPage': function() { |
52 | if (this._loginPage == null) { | 50 | if (this._loginPage == null) { |
53 | this._loginPage = new Clipperz.PM.UI.Web.Components.LoginPage(); | 51 | this._loginPage = new Clipperz.PM.UI.Web.Components.LoginPage(); |
54 | 52 | ||
55 | MochiKit.Signal.connect(this._loginPage, 'createNewAccountClick', this, 'handleCreateNewAccountClick') | 53 | MochiKit.Signal.connect(this._loginPage, 'createNewAccountClick', this, 'handleCreateNewAccountClick') |
56 | } | 54 | } |
57 | 55 | ||
58 | return this._loginPage; | 56 | return this._loginPage; |
59 | }, | 57 | }, |
60 | 58 | ||
61 | //----------------------------------------------------------------------------- | 59 | //----------------------------------------------------------------------------- |
62 | 60 | ||
63 | 'run': function(args) { | 61 | 'run': function(args) { |
64 | varslot; | 62 | varslot; |
65 | varloginPage; | 63 | varloginPage; |
66 | varloginForm; | 64 | varloginForm; |
67 | 65 | ||
68 | slot = args.slot; | 66 | slot = args.slot; |
69 | 67 | ||
70 | loginForm =new Clipperz.PM.UI.Web.Components.LoginForm({'autocomplete': this.args()['autocomplete']}); | 68 | loginForm =new Clipperz.PM.UI.Web.Components.LoginForm({'autocomplete': this.args()['autocomplete']}); |
@@ -167,84 +165,82 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { | |||
167 | this._newUserCreationComponent = new Clipperz.PM.UI.Web.Components.NewUserCreationComponent(); | 165 | this._newUserCreationComponent = new Clipperz.PM.UI.Web.Components.NewUserCreationComponent(); |
168 | } | 166 | } |
169 | 167 | ||
170 | return this._newUserCreationComponent; | 168 | return this._newUserCreationComponent; |
171 | }, | 169 | }, |
172 | 170 | ||
173 | 'clearNewUserCreationComponent': function () { | 171 | 'clearNewUserCreationComponent': function () { |
174 | if (this._newUserCreationComponent != null) { | 172 | if (this._newUserCreationComponent != null) { |
175 | this._newUserCreationComponent.clear(); | 173 | this._newUserCreationComponent.clear(); |
176 | } | 174 | } |
177 | this._newUserCreationComponent = null; | 175 | this._newUserCreationComponent = null; |
178 | }, | 176 | }, |
179 | 177 | ||
180 | //------------------------------------------------------------------------- | 178 | //------------------------------------------------------------------------- |
181 | 179 | ||
182 | 'handleHideNewUserCreationComponent': function () { | 180 | 'handleHideNewUserCreationComponent': function () { |
183 | this.clearNewUserCreationComponent(); | 181 | this.clearNewUserCreationComponent(); |
184 | }, | 182 | }, |
185 | 183 | ||
186 | 'handleCompleteNewUserCreationComponent': function (someParameters) { | 184 | 'handleCompleteNewUserCreationComponent': function (someParameters) { |
187 | vardeferredResult; | 185 | vardeferredResult; |
188 | varuser; | 186 | varuser; |
189 | varnewUserCreationComponent; | 187 | varnewUserCreationComponent; |
190 | 188 | ||
191 | user = someParameters.user; | 189 | user = someParameters.user; |
192 | newUserCreationComponent = this.newUserCreationComponent(); | 190 | newUserCreationComponent = this.newUserCreationComponent(); |
193 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})), | 191 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})), |
194 | 192 | ||
195 | deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false}); | 193 | deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false}); |
196 | 194 | ||
197 | deferredResult.addCallbackList([ | 195 | deferredResult.addCallbackList([ |
198 | MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'), | 196 | MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'), |
199 | MochiKit.Base.method(user, 'login'), | 197 | MochiKit.Base.method(user, 'login'), |
200 | MochiKit.Base.method(this, 'userLoggedIn', user), | 198 | MochiKit.Base.method(this, 'userLoggedIn', user), |
201 | MochiKit.Base.method(this, 'clearNewUserCreationComponent') | 199 | MochiKit.Base.method(this, 'clearNewUserCreationComponent') |
202 | ]); | 200 | ]); |
203 | deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)}); | 201 | deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)}); |
204 | deferredResult.callback(); | 202 | deferredResult.callback(); |
205 | 203 | ||
206 | return deferredResult; | 204 | return deferredResult; |
207 | }, | 205 | }, |
208 | 206 | ||
209 | 207 | ||
210 | //========================================================================= | 208 | //========================================================================= |
211 | 209 | ||
212 | 'handleFailedLogin': function(aLoginProgress, anError) { | 210 | 'handleFailedLogin': function(aLoginProgress, anError) { |
213 | var result; | 211 | var result; |
214 | 212 | ||
215 | //console.log("anError", anError); | ||
216 | if (anError instanceof MochiKit.Async.CancelledError) { | 213 | if (anError instanceof MochiKit.Async.CancelledError) { |
217 | result = anError; | 214 | result = anError; |
218 | } else { | 215 | } else { |
219 | var deferredResult; | 216 | var deferredResult; |
220 | 217 | ||
221 | MochiKit.Logging.logError("## MainController - FAILED LOGIN: " + anError); | 218 | Clipperz.logError("## MainController - FAILED LOGIN: " + anError); |
222 | deferredResult = new MochiKit.Async.Deferred(); | 219 | deferredResult = new MochiKit.Async.Deferred(); |
223 | 220 | ||
224 | aLoginProgress.showErrorMessage("failed login"); | 221 | aLoginProgress.showErrorMessage("failed login"); |
225 | // Clipperz.NotificationCenter.register(loginProgress, 'cancelEvent', deferredResult, 'callback'); | 222 | // Clipperz.NotificationCenter.register(loginProgress, 'cancelEvent', deferredResult, 'callback'); |
226 | MochiKit.Signal.connect(aLoginProgress, 'cancelEvent', deferredResult, 'callback'); | 223 | MochiKit.Signal.connect(aLoginProgress, 'cancelEvent', deferredResult, 'callback'); |
227 | deferredResult.addCallback(MochiKit.Async.fail, anError) | 224 | deferredResult.addCallback(MochiKit.Async.fail, anError) |
228 | result = deferredResult; | 225 | result = deferredResult; |
229 | } | 226 | } |
230 | 227 | ||
231 | return result; | 228 | return result; |
232 | }, | 229 | }, |
233 | 230 | ||
234 | 'handleGenericError': function(anError) { | 231 | 'handleGenericError': function(anError) { |
235 | var result; | 232 | var result; |
236 | 233 | ||
237 | if (anError instanceof MochiKit.Async.CancelledError) { | 234 | if (anError instanceof MochiKit.Async.CancelledError) { |
238 | result = anError; | 235 | result = anError; |
239 | } else { | 236 | } else { |
240 | MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); | 237 | Clipperz.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); |
241 | //console.log(anError); | ||
242 | result = new MochiKit.Async.CancelledError(anError); | 238 | result = new MochiKit.Async.CancelledError(anError); |
243 | } | 239 | } |
244 | 240 | ||
245 | return result; | 241 | return result; |
246 | }, | 242 | }, |
247 | 243 | ||
248 | //----------------------------------------------------------------------------- | 244 | //----------------------------------------------------------------------------- |
249 | __syntaxFix__: "syntax fix" | 245 | __syntaxFix__: "syntax fix" |
250 | }); | 246 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js index c83e3c0..9194125 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.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.MainController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.MainController = function(args) { |
29 | this._args = args; | 27 | this._args = args; |
30 | 28 | ||
31 | //controllers | 29 | //controllers |
32 | this._loginController =null; | 30 | this._loginController =null; |
33 | this._appController =null; | 31 | this._appController =null; |
34 | 32 | ||
35 | //components | 33 | //components |
36 | this._headerComponent = null; | 34 | this._headerComponent = null; |
37 | this._pageComponent =null; | 35 | this._pageComponent =null; |
38 | this._footerComponent = null; | 36 | this._footerComponent = null; |
39 | 37 | ||
40 | this._passphraseDelegateLock = new MochiKit.Async.DeferredLock(); | 38 | this._passphraseDelegateLock = new MochiKit.Async.DeferredLock(); |
41 | this._passphraseDelegateLock.acquire(); | 39 | this._passphraseDelegateLock.acquire(); |
42 | //Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock); | 40 | //Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock); |
43 | this._passphraseDelegate = null; | 41 | this._passphraseDelegate = null; |
44 | 42 | ||
45 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent'); | 43 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent'); |
46 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived'); | 44 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived'); |
47 | 45 | ||
48 | return this; | 46 | return this; |
49 | } | 47 | } |
50 | 48 | ||
51 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { | 49 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { |
52 | 50 | ||
53 | 'toString': function() { | 51 | 'toString': function() { |
54 | return "Clipperz.PM.UI.Web.Controllers.MainController"; | 52 | return "Clipperz.PM.UI.Web.Controllers.MainController"; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | 'args': function () { | 55 | 'args': function () { |
58 | return this._args; | 56 | return this._args; |
59 | }, | 57 | }, |
60 | 58 | ||
61 | //----------------------------------------------------------------------------- | 59 | //----------------------------------------------------------------------------- |
62 | 60 | ||
63 | 'headerComponent': function() { | 61 | 'headerComponent': function() { |
64 | if (this._headerComponent == null) { | 62 | if (this._headerComponent == null) { |
65 | this._headerComponent = new Clipperz.PM.UI.Web.Components.PageHeader(); | 63 | this._headerComponent = new Clipperz.PM.UI.Web.Components.PageHeader(); |
66 | } | 64 | } |
67 | 65 | ||
68 | return this._headerComponent; | 66 | return this._headerComponent; |
69 | }, | 67 | }, |
70 | 68 | ||
@@ -130,86 +128,80 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { | |||
130 | var deferredResult; | 128 | var deferredResult; |
131 | 129 | ||
132 | deferredResult = new Clipperz.Async.Deferred("MainController.getPassphrase", {trace:false}); | 130 | deferredResult = new Clipperz.Async.Deferred("MainController.getPassphrase", {trace:false}); |
133 | 131 | ||
134 | deferredResult.acquireLock(this._passphraseDelegateLock); | 132 | deferredResult.acquireLock(this._passphraseDelegateLock); |
135 | deferredResult.addMethod(this, 'invokePassphraseDelegate'); | 133 | deferredResult.addMethod(this, 'invokePassphraseDelegate'); |
136 | deferredResult.releaseLock(this._passphraseDelegateLock); | 134 | deferredResult.releaseLock(this._passphraseDelegateLock); |
137 | deferredResult.callback(); | 135 | deferredResult.callback(); |
138 | 136 | ||
139 | return deferredResult; | 137 | return deferredResult; |
140 | }, | 138 | }, |
141 | 139 | ||
142 | //......................................................................... | 140 | //......................................................................... |
143 | 141 | ||
144 | 'invokePassphraseDelegate': function () { | 142 | 'invokePassphraseDelegate': function () { |
145 | return this._passphraseDelegate(); | 143 | return this._passphraseDelegate(); |
146 | }, | 144 | }, |
147 | 145 | ||
148 | 'passphraseDelegateLock': function () { | 146 | 'passphraseDelegateLock': function () { |
149 | return this._passphraseDelegateLock; | 147 | return this._passphraseDelegateLock; |
150 | }, | 148 | }, |
151 | 149 | ||
152 | //......................................................................... | 150 | //......................................................................... |
153 | 151 | ||
154 | 'setPassphraseDelegate': function (aDelegate) { | 152 | 'setPassphraseDelegate': function (aDelegate) { |
155 | var shouldReleaseLock; | 153 | var shouldReleaseLock; |
156 | 154 | ||
157 | shouldReleaseLock = (this._passphraseDelegate == null); | 155 | shouldReleaseLock = (this._passphraseDelegate == null); |
158 | 156 | ||
159 | this._passphraseDelegate = aDelegate; | 157 | this._passphraseDelegate = aDelegate; |
160 | 158 | ||
161 | if (shouldReleaseLock) { | 159 | if (shouldReleaseLock) { |
162 | this._passphraseDelegateLock.release(); | 160 | this._passphraseDelegateLock.release(); |
163 | } | 161 | } |
164 | }, | 162 | }, |
165 | 163 | ||
166 | //......................................................................... | 164 | //......................................................................... |
167 | 165 | ||
168 | 'removePassphraseDelegate': function (aDelegate) { | 166 | 'removePassphraseDelegate': function (aDelegate) { |
169 | if (this._passphraseDelegate == aDelegate) { | 167 | if (this._passphraseDelegate == aDelegate) { |
170 | this._passphraseDelegate = null; | 168 | this._passphraseDelegate = null; |
171 | this._passphraseDelegateLock.acquire(); | 169 | this._passphraseDelegateLock.acquire(); |
172 | } | 170 | } |
173 | }, | 171 | }, |
174 | 172 | ||
175 | //------------------------------------------------------------------------- | 173 | //------------------------------------------------------------------------- |
176 | 174 | ||
177 | 'loginControllerUserLoggedInCallback': function(anEvent) { | 175 | 'loginControllerUserLoggedInCallback': function(anEvent) { |
178 | //Clipperz.log(">>> loginControllerUserLoggedInCallback", anEvent); | ||
179 | // this.setUser(anEvent.parameters()['user']); | ||
180 | //console.log("--- loginControllerUserLoggedInCallback - 1"); | ||
181 | |||
182 | //console.log("--- loginControllerUserLoggedInCallback - 2"); | ||
183 | this.headerComponent().switchToLoggedMode(); | 176 | this.headerComponent().switchToLoggedMode(); |
184 | this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']}); | 177 | this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']}); |
185 | //Clipperz.log("<<< loginControllerUserLoggedInCallback"); | ||
186 | }, | 178 | }, |
187 | 179 | ||
188 | //----------------------------------------------------------------------------- | 180 | //----------------------------------------------------------------------------- |
189 | 181 | ||
190 | 'handleRemoteRequestSent': function () { | 182 | 'handleRemoteRequestSent': function () { |
191 | //Clipperz.log("REMOTE REQUEST sent >>>"); | 183 | //Clipperz.log("REMOTE REQUEST sent >>>"); |
192 | }, | 184 | }, |
193 | 185 | ||
194 | 'handleRemoteRequestReceived': function () { | 186 | 'handleRemoteRequestReceived': function () { |
195 | //Clipperz.log("REMOTE REQUEST received <<<"); | 187 | //Clipperz.log("REMOTE REQUEST received <<<"); |
196 | }, | 188 | }, |
197 | 189 | ||
198 | //----------------------------------------------------------------------------- | 190 | //----------------------------------------------------------------------------- |
199 | 191 | ||
200 | 'handleLogout': function(anEvent) { | 192 | 'handleLogout': function(anEvent) { |
201 | this.exit('logout.html'); | 193 | this.exit('logout.html'); |
202 | }, | 194 | }, |
203 | 195 | ||
204 | //----------------------------------------------------------------------------- | 196 | //----------------------------------------------------------------------------- |
205 | 197 | ||
206 | 'exit': function(aPageName) { | 198 | 'exit': function(aPageName) { |
207 | //Clipperz.log("### exit " + aPageName); | 199 | //Clipperz.log("### exit " + aPageName); |
208 | MochiKit.Async.wait(0).addCallback(function() { | 200 | MochiKit.Async.wait(0).addCallback(function() { |
209 | window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage; | 201 | window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage; |
210 | }); | 202 | }); |
211 | }, | 203 | }, |
212 | 204 | ||
213 | //----------------------------------------------------------------------------- | 205 | //----------------------------------------------------------------------------- |
214 | __syntaxFix__: "syntax fix" | 206 | __syntaxFix__: "syntax fix" |
215 | }); | 207 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js index 7db6888..b70aa17 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js | |||
@@ -1,123 +1,120 @@ | |||
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.NewUserWizardController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { |
29 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | 27 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); |
30 | 28 | ||
31 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); | 29 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); |
32 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); | 30 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); |
33 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); | 31 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); |
34 | 32 | ||
35 | this._rulerComponent = null; | 33 | this._rulerComponent = null; |
36 | 34 | ||
37 | this._steps = null; | 35 | this._steps = null; |
38 | this._currentStepIndex = 0; | 36 | this._currentStepIndex = 0; |
39 | this._isNextEnabled = false; | 37 | this._isNextEnabled = false; |
40 | 38 | ||
41 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' | 39 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' |
42 | this._user = null; | 40 | this._user = null; |
43 | return this; | 41 | return this; |
44 | } | 42 | } |
45 | 43 | ||
46 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { | 44 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { |
47 | 45 | ||
48 | 'toString': function() { | 46 | 'toString': function() { |
49 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; | 47 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'newUserCreationComponent': function () { | 52 | 'newUserCreationComponent': function () { |
55 | return this._newUserCreationComponent; | 53 | return this._newUserCreationComponent; |
56 | }, | 54 | }, |
57 | 55 | ||
58 | //============================================================================= | 56 | //============================================================================= |
59 | 57 | ||
60 | 'user': function () { | 58 | 'user': function () { |
61 | return this._user; | 59 | return this._user; |
62 | }, | 60 | }, |
63 | 61 | ||
64 | 'setUser': function (aValue) { | 62 | 'setUser': function (aValue) { |
65 | this._user = aValue; | 63 | this._user = aValue; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | //----------------------------------------------------------------------------- | 66 | //----------------------------------------------------------------------------- |
69 | 67 | ||
70 | 'userCreationState': function () { | 68 | 'userCreationState': function () { |
71 | return this._userCreationState; | 69 | return this._userCreationState; |
72 | }, | 70 | }, |
73 | 71 | ||
74 | 'setUserCreationState': function (aValue) { | 72 | 'setUserCreationState': function (aValue) { |
75 | //console.log("+++ NewUserWizardController.setUserCreationState", aValue); | ||
76 | this._userCreationState = aValue; | 73 | this._userCreationState = aValue; |
77 | this.checkState(); | 74 | this.checkState(); |
78 | }, | 75 | }, |
79 | 76 | ||
80 | //============================================================================= | 77 | //============================================================================= |
81 | 78 | ||
82 | 'resetCurrentStepIndex': function () { | 79 | 'resetCurrentStepIndex': function () { |
83 | this._currentStepIndex = 0; | 80 | this._currentStepIndex = 0; |
84 | this.rulerComponent().resetStatus({animateTransition:true}); | 81 | this.rulerComponent().resetStatus({animateTransition:true}); |
85 | }, | 82 | }, |
86 | 83 | ||
87 | //----------------------------------------------------------------------------- | 84 | //----------------------------------------------------------------------------- |
88 | 85 | ||
89 | 'enableNext': function (aValue) { | 86 | 'enableNext': function (aValue) { |
90 | this.rulerComponent().enableNext(aValue); | 87 | this.rulerComponent().enableNext(aValue); |
91 | this._isNextEnabled = aValue; | 88 | this._isNextEnabled = aValue; |
92 | }, | 89 | }, |
93 | 90 | ||
94 | 'isNextEnabled': function () { | 91 | 'isNextEnabled': function () { |
95 | return this._isNextEnabled; | 92 | return this._isNextEnabled; |
96 | }, | 93 | }, |
97 | 94 | ||
98 | //----------------------------------------------------------------------------- | 95 | //----------------------------------------------------------------------------- |
99 | 96 | ||
100 | 'enablePrevious': function (aValue) { | 97 | 'enablePrevious': function (aValue) { |
101 | this.rulerComponent().enablePrevious(aValue); | 98 | this.rulerComponent().enablePrevious(aValue); |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //============================================================================= | 101 | //============================================================================= |
105 | 102 | ||
106 | 'rulerComponent': function () { | 103 | 'rulerComponent': function () { |
107 | if (this._rulerComponent == null) { | 104 | if (this._rulerComponent == null) { |
108 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | 105 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ |
109 | translationContext:'Wizards.NewUserWizard' | 106 | translationContext:'Wizards.NewUserWizard' |
110 | }); | 107 | }); |
111 | this._rulerComponent.render(); | 108 | this._rulerComponent.render(); |
112 | 109 | ||
113 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | 110 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); |
114 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | 111 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); |
115 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | 112 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); |
116 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | 113 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); |
117 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | 114 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); |
118 | } | 115 | } |
119 | 116 | ||
120 | return this._rulerComponent; | 117 | return this._rulerComponent; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | 'resetRuler': function () { | 120 | 'resetRuler': function () { |
@@ -177,106 +174,103 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot | |||
177 | }, | 174 | }, |
178 | 175 | ||
179 | //============================================================================= | 176 | //============================================================================= |
180 | 177 | ||
181 | 'createNewUserRulerSteps': function () { | 178 | 'createNewUserRulerSteps': function () { |
182 | return [ 'CREDENTIALS', 'CHECK_CREDENTIALS', 'TERMS_OF_SERVICE', 'CREATE_USER'/*, 'LOGIN' */]; | 179 | return [ 'CREDENTIALS', 'CHECK_CREDENTIALS', 'TERMS_OF_SERVICE', 'CREATE_USER'/*, 'LOGIN' */]; |
183 | }, | 180 | }, |
184 | 181 | ||
185 | //------------------------------------------------------------------------- | 182 | //------------------------------------------------------------------------- |
186 | 183 | ||
187 | 'run': function () { | 184 | 'run': function () { |
188 | return Clipperz.Async.callbacks("NewUserWizardController.run", [ | 185 | return Clipperz.Async.callbacks("NewUserWizardController.run", [ |
189 | MochiKit.Base.method(this, 'createNewUserRulerSteps'), | 186 | MochiKit.Base.method(this, 'createNewUserRulerSteps'), |
190 | MochiKit.Base.method(this, 'showRuler') | 187 | MochiKit.Base.method(this, 'showRuler') |
191 | ], {trace:false}); | 188 | ], {trace:false}); |
192 | }, | 189 | }, |
193 | 190 | ||
194 | //----------------------------------------------------------------------------- | 191 | //----------------------------------------------------------------------------- |
195 | 192 | ||
196 | 'checkState': function () { | 193 | 'checkState': function () { |
197 | var enablePrevious; | 194 | var enablePrevious; |
198 | var enableNext; | 195 | var enableNext; |
199 | 196 | ||
200 | enablePrevious = true; | 197 | enablePrevious = true; |
201 | enableNext = false; | 198 | enableNext = false; |
202 | 199 | ||
203 | this.newUserCreationComponent().disableAllPanels(); | 200 | this.newUserCreationComponent().disableAllPanels(); |
204 | 201 | ||
205 | switch(this.currentStep()) { | 202 | switch(this.currentStep()) { |
206 | case 'CREDENTIALS': | 203 | case 'CREDENTIALS': |
207 | this.newUserCreationComponent().enableCredentialsPanel(); | 204 | this.newUserCreationComponent().enableCredentialsPanel(); |
208 | 205 | ||
209 | enableNext = ( | 206 | enableNext = ( |
210 | (this.newUserCreationComponent().username() != '') | 207 | (this.newUserCreationComponent().username() != '') |
211 | && | 208 | && |
212 | (this.newUserCreationComponent().passphrase() != '') | 209 | (this.newUserCreationComponent().passphrase() != '') |
213 | ); | 210 | ); |
214 | // enablePrevious = false; | 211 | // enablePrevious = false; |
215 | break; | 212 | break; |
216 | case 'CHECK_CREDENTIALS': | 213 | case 'CHECK_CREDENTIALS': |
217 | this.newUserCreationComponent().enableCheckCredentialsPanel(); | 214 | this.newUserCreationComponent().enableCheckCredentialsPanel(); |
218 | 215 | ||
219 | enableNext = (this.newUserCreationComponent().passphrase() == this.newUserCreationComponent().rePassphrase()); | 216 | enableNext = (this.newUserCreationComponent().passphrase() == this.newUserCreationComponent().rePassphrase()); |
220 | // enablePrevious = true; | 217 | // enablePrevious = true; |
221 | break | 218 | break |
222 | case 'TERMS_OF_SERVICE': | 219 | case 'TERMS_OF_SERVICE': |
223 | this.newUserCreationComponent().enableTermsOfServicePanel(); | 220 | this.newUserCreationComponent().enableTermsOfServicePanel(); |
224 | 221 | ||
225 | //console.log("awareOfUnrecoverablePassphrase", this.newUserCreationComponent().awareOfUnrecoverablePassphrase()); | ||
226 | //console.log("readTermsOfService", this.newUserCreationComponent().readTermsOfService()); | ||
227 | enableNext = ( | 222 | enableNext = ( |
228 | (this.newUserCreationComponent().awareOfUnrecoverablePassphrase() == 'on') | 223 | (this.newUserCreationComponent().awareOfUnrecoverablePassphrase() == 'on') |
229 | && | 224 | && |
230 | (this.newUserCreationComponent().readTermsOfService() == 'on') | 225 | (this.newUserCreationComponent().readTermsOfService() == 'on') |
231 | ) | 226 | ) |
232 | break; | 227 | break; |
233 | case 'CREATE_USER': | 228 | case 'CREATE_USER': |
234 | //console.log(">>> CREATE_USER", this.userCreationState()); | ||
235 | this.newUserCreationComponent().enableCreateUserPanel(); | 229 | this.newUserCreationComponent().enableCreateUserPanel(); |
236 | 230 | ||
237 | switch (this.userCreationState()) { | 231 | switch (this.userCreationState()) { |
238 | case 'IDLE': | 232 | case 'IDLE': |
239 | this.setUserCreationState('IN PROGRESS'); | 233 | this.setUserCreationState('IN PROGRESS'); |
240 | this.preformActualUserRegistration(); | 234 | this.preformActualUserRegistration(); |
241 | 235 | ||
242 | enablePrevious = false; | 236 | enablePrevious = false; |
243 | enableNext = false; | 237 | enableNext = false; |
244 | break; | 238 | break; |
245 | case 'IN PROGRESS': | 239 | case 'IN PROGRESS': |
246 | enablePrevious = false; | 240 | enablePrevious = false; |
247 | enableNext = false; | 241 | enableNext = false; |
248 | break; | 242 | break; |
249 | case 'DONE': | 243 | case 'DONE': |
250 | enablePrevious = false; | 244 | enablePrevious = false; |
251 | enableNext = true; | 245 | enableNext = true; |
252 | break; | 246 | break; |
253 | case 'FAILED': | 247 | case 'FAILED': |
254 | enablePrevious = true; | 248 | enablePrevious = true; |
255 | enableNext = false; | 249 | enableNext = false; |
256 | break; | 250 | break; |
257 | }; | 251 | }; |
258 | break; | 252 | break; |
259 | // case 'LOGIN': | 253 | // case 'LOGIN': |
260 | // this.newUserCreationComponent().enableLoginPanel(); | 254 | // this.newUserCreationComponent().enableLoginPanel(); |
261 | // break; | 255 | // break; |
262 | } | 256 | } |
263 | 257 | ||
264 | if (this.currentStepIndex() > 0) { | 258 | if (this.currentStepIndex() > 0) { |
265 | this.enablePrevious(enablePrevious); | 259 | this.enablePrevious(enablePrevious); |
266 | } else { | 260 | } else { |
267 | this.enablePrevious(false); | 261 | this.enablePrevious(false); |
268 | } | 262 | } |
269 | this.enableNext(enableNext); | 263 | this.enableNext(enableNext); |
270 | }, | 264 | }, |
271 | 265 | ||
272 | //----------------------------------------------------------------------------- | 266 | //----------------------------------------------------------------------------- |
273 | 267 | ||
274 | 'setFocus': function () { | 268 | 'setFocus': function () { |
275 | switch(this.currentStep()) { | 269 | switch(this.currentStep()) { |
276 | case 'CREDENTIALS': | 270 | case 'CREDENTIALS': |
277 | this.newUserCreationComponent().focusOnUsernameElement(); | 271 | this.newUserCreationComponent().focusOnUsernameElement(); |
278 | break; | 272 | break; |
279 | case 'CHECK_CREDENTIALS': | 273 | case 'CHECK_CREDENTIALS': |
280 | this.newUserCreationComponent().focusOnRePassphraseElement(); | 274 | this.newUserCreationComponent().focusOnRePassphraseElement(); |
281 | break | 275 | break |
282 | case 'TERMS_OF_SERVICE': | 276 | case 'TERMS_OF_SERVICE': |
@@ -292,166 +286,164 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot | |||
292 | 286 | ||
293 | 'steps': function () { | 287 | 'steps': function () { |
294 | return this._steps; | 288 | return this._steps; |
295 | }, | 289 | }, |
296 | 290 | ||
297 | 'setSteps': function (aValue) { | 291 | 'setSteps': function (aValue) { |
298 | this._steps = aValue; | 292 | this._steps = aValue; |
299 | 293 | ||
300 | this.rulerComponent().setSteps(aValue); | 294 | this.rulerComponent().setSteps(aValue); |
301 | this.resetCurrentStepIndex(); | 295 | this.resetCurrentStepIndex(); |
302 | }, | 296 | }, |
303 | 297 | ||
304 | 'currentStepIndex': function () { | 298 | 'currentStepIndex': function () { |
305 | return this._currentStepIndex; | 299 | return this._currentStepIndex; |
306 | }, | 300 | }, |
307 | 301 | ||
308 | 'currentStep': function () { | 302 | 'currentStep': function () { |
309 | return this.steps()[this.currentStepIndex()]; | 303 | return this.steps()[this.currentStepIndex()]; |
310 | }, | 304 | }, |
311 | 305 | ||
312 | //============================================================================= | 306 | //============================================================================= |
313 | 307 | ||
314 | 'handleExit': function () { | 308 | 'handleExit': function () { |
315 | return Clipperz.Async.callbacks("NewUserWizardController.handleExit", [ | 309 | return Clipperz.Async.callbacks("NewUserWizardController.handleExit", [ |
316 | // MochiKit.Base.method(this.newUserCreationComponent(), 'resetContent'), | 310 | // MochiKit.Base.method(this.newUserCreationComponent(), 'resetContent'), |
317 | Clipperz.Async.forkAndJoin("NewUserWizardController.handleExit - fork and join", [ | 311 | Clipperz.Async.forkAndJoin("NewUserWizardController.handleExit - fork and join", [ |
318 | MochiKit.Base.method(this, 'hideRuler'), | 312 | MochiKit.Base.method(this, 'hideRuler'), |
319 | MochiKit.Base.method(this.newUserCreationComponent(), 'deferredHideModal') | 313 | MochiKit.Base.method(this.newUserCreationComponent(), 'deferredHideModal') |
320 | ], {trace:false}), | 314 | ], {trace:false}), |
321 | MochiKit.Base.method(this, 'resetRuler'), | 315 | MochiKit.Base.method(this, 'resetRuler'), |
322 | // MochiKit.Base.method(this.newUserCreationComponent(), 'reset'), | 316 | // MochiKit.Base.method(this.newUserCreationComponent(), 'reset'), |
323 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'exit') | 317 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'exit') |
324 | ], {trace:false}) | 318 | ], {trace:false}) |
325 | }, | 319 | }, |
326 | 320 | ||
327 | 'done': function () { | 321 | 'done': function () { |
328 | this.doneWithRuler(); | 322 | this.doneWithRuler(); |
329 | MochiKit.Signal.signal(this, 'done', {'user': this.user()}); | 323 | MochiKit.Signal.signal(this, 'done', {'user': this.user()}); |
330 | }, | 324 | }, |
331 | 325 | ||
332 | //============================================================================= | 326 | //============================================================================= |
333 | 327 | ||
334 | 'handleMoveBackward': function () { | 328 | 'handleMoveBackward': function () { |
335 | if (this._currentStepIndex > 0) { | 329 | if (this._currentStepIndex > 0) { |
336 | varafterMoveAction; | 330 | varafterMoveAction; |
337 | 331 | ||
338 | afterMoveAction = MochiKit.Base.noop; | 332 | afterMoveAction = MochiKit.Base.noop; |
339 | 333 | ||
340 | //console.log("<-- backward", this.currentStep()); | ||
341 | switch(this.currentStep()) { | 334 | switch(this.currentStep()) { |
342 | case 'CREDENTIALS': | 335 | case 'CREDENTIALS': |
343 | case 'CHECK_CREDENTIALS': | 336 | case 'CHECK_CREDENTIALS': |
344 | case 'TERMS_OF_SERVICE': | 337 | case 'TERMS_OF_SERVICE': |
345 | this._currentStepIndex --; | 338 | this._currentStepIndex --; |
346 | this.rulerComponent().moveBackward(afterMoveAction); | 339 | this.rulerComponent().moveBackward(afterMoveAction); |
347 | break; | 340 | break; |
348 | case 'CREATE_USER': | 341 | case 'CREATE_USER': |
349 | this.setUser(null); | 342 | this.setUser(null); |
350 | this.newUserCreationComponent().hideAllProgeressStates(); | 343 | this.newUserCreationComponent().hideAllProgeressStates(); |
351 | this.resetCurrentStepIndex(); | 344 | this.resetCurrentStepIndex(); |
352 | this.setUserCreationState('IDLE'); | 345 | this.setUserCreationState('IDLE'); |
353 | break; | 346 | break; |
354 | // case 'LOGIN': | 347 | // case 'LOGIN': |
355 | // break; | 348 | // break; |
356 | }; | 349 | }; |
357 | 350 | ||
358 | } | 351 | } |
359 | 352 | ||
360 | if (this._currentStepIndex == 0) { | 353 | if (this._currentStepIndex == 0) { |
361 | this.enablePrevious(false); | 354 | this.enablePrevious(false); |
362 | } | 355 | } |
363 | }, | 356 | }, |
364 | 357 | ||
365 | 'handleMoveForward': function () { | 358 | 'handleMoveForward': function () { |
366 | if (this.isNextEnabled()) { | 359 | if (this.isNextEnabled()) { |
367 | varafterMoveAction; | 360 | varafterMoveAction; |
368 | 361 | ||
369 | this._currentStepIndex ++; | 362 | this._currentStepIndex ++; |
370 | afterMoveAction = MochiKit.Base.noop; | 363 | afterMoveAction = MochiKit.Base.noop; |
371 | 364 | ||
372 | switch(this.currentStep()) { | 365 | switch(this.currentStep()) { |
373 | case 'CREDENTIALS': | 366 | case 'CREDENTIALS': |
374 | break; | 367 | break; |
375 | case 'CHECK_CREDENTIALS': | 368 | case 'CHECK_CREDENTIALS': |
376 | break | 369 | break |
377 | case 'TERMS_OF_SERVICE': | 370 | case 'TERMS_OF_SERVICE': |
378 | break; | 371 | break; |
379 | case 'CREATE_USER': | 372 | case 'CREATE_USER': |
380 | break; | 373 | break; |
381 | // case 'LOGIN': | 374 | // case 'LOGIN': |
382 | // break; | 375 | // break; |
383 | }; | 376 | }; |
384 | 377 | ||
385 | this.rulerComponent().moveForward(afterMoveAction); | 378 | this.rulerComponent().moveForward(afterMoveAction); |
386 | }; | 379 | }; |
387 | }, | 380 | }, |
388 | 381 | ||
389 | 'handleCursorMoved': function () { | 382 | 'handleCursorMoved': function () { |
390 | // this.checkState(); | 383 | // this.checkState(); |
391 | // this.setFocus(); | 384 | // this.setFocus(); |
392 | 385 | ||
393 | return Clipperz.Async.callbacks("NewUserWizardController.handleCursorMoved", [ | 386 | return Clipperz.Async.callbacks("NewUserWizardController.handleCursorMoved", [ |
394 | MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), | 387 | MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), |
395 | MochiKit.Base.method(this, 'checkState'), | 388 | MochiKit.Base.method(this, 'checkState'), |
396 | MochiKit.Base.method(this, 'setFocus') | 389 | MochiKit.Base.method(this, 'setFocus') |
397 | ], {trace:false}); | 390 | ], {trace:false}); |
398 | }, | 391 | }, |
399 | 392 | ||
400 | //------------------------------------------------------------------------- | 393 | //------------------------------------------------------------------------- |
401 | 394 | ||
402 | 'handleChangedValue': function (anEvent) { | 395 | 'handleChangedValue': function (anEvent) { |
403 | this.checkState(); | 396 | this.checkState(); |
404 | }, | 397 | }, |
405 | 398 | ||
406 | //------------------------------------------------------------------------- | 399 | //------------------------------------------------------------------------- |
407 | 400 | ||
408 | 'handleNewUserCreationComponentKeyPressed': function (anEvent) { | 401 | 'handleNewUserCreationComponentKeyPressed': function (anEvent) { |
409 | //console.log(">>> handleNewUserCreationComponentKeyPressed", anEvent.key().string); | ||
410 | if (anEvent.key().string == 'KEY_ENTER') { | 402 | if (anEvent.key().string == 'KEY_ENTER') { |
411 | if (anEvent.target().nodeName != 'TEXTAREA') { | 403 | if (anEvent.target().nodeName != 'TEXTAREA') { |
412 | anEvent.preventDefault(); | 404 | anEvent.preventDefault(); |
413 | this.handleMoveForward(); | 405 | this.handleMoveForward(); |
414 | } | 406 | } |
415 | } else if (anEvent.key().string == 'KEY_TAB') { | 407 | } else if (anEvent.key().string == 'KEY_TAB') { |
416 | if (anEvent.target() == this.newUserCreationComponent().usernameElement()) { | 408 | if (anEvent.target() == this.newUserCreationComponent().usernameElement()) { |
417 | } else { | 409 | } else { |
418 | this.handleMoveForward(); | 410 | this.handleMoveForward(); |
419 | if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { | 411 | if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { |
420 | anEvent.preventDefault(); | 412 | anEvent.preventDefault(); |
421 | } | 413 | } |
422 | } | 414 | } |
423 | } else if ((anEvent.key().string == 'KEY_ARROW_RIGHT') && (anEvent.modifier().meta == true)) { | 415 | } else if ((anEvent.key().string == 'KEY_ARROW_RIGHT') && (anEvent.modifier().meta == true)) { |
424 | this.handleMoveForward(); | 416 | this.handleMoveForward(); |
425 | } else if ((anEvent.key().string == 'KEY_ARROW_LEFT') && (anEvent.modifier().meta == true)) { | 417 | } else if ((anEvent.key().string == 'KEY_ARROW_LEFT') && (anEvent.modifier().meta == true)) { |
426 | this.handleMoveBackward(); | 418 | this.handleMoveBackward(); |
427 | } else if (anEvent.key().string == 'KEY_ESCAPE') { | 419 | } else if (anEvent.key().string == 'KEY_ESCAPE') { |
428 | anEvent.stop(); | 420 | anEvent.stop(); |
429 | this.handleExit(); | 421 | this.handleExit(); |
430 | } else { | 422 | } else { |
431 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'checkState')); | 423 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'checkState')); |
432 | } | 424 | } |
433 | }, | 425 | }, |
434 | 426 | ||
435 | //============================================================================= | 427 | //============================================================================= |
436 | 428 | ||
437 | 'preformActualUserRegistration': function () { | 429 | 'preformActualUserRegistration': function () { |
438 | vardeferredResult; | 430 | vardeferredResult; |
439 | 431 | ||
440 | deferredResult = new Clipperz.Async.Deferred("NewUSerWizardController.preformActualUserRegistration", {trace:false}); | 432 | deferredResult = new Clipperz.Async.Deferred("NewUSerWizardController.preformActualUserRegistration", {trace:false}); |
441 | deferredResult.addMethod(this.newUserCreationComponent(), 'showProgressOnUserCreation'); | 433 | deferredResult.addMethod(this.newUserCreationComponent(), 'showProgressOnUserCreation'); |
442 | deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this.newUserCreationComponent(), 'passphrase')); | 434 | deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this.newUserCreationComponent(), 'passphrase')); |
443 | deferredResult.addCallback(Clipperz.PM.DataModel.User.registerNewAccount, | 435 | deferredResult.addCallback(Clipperz.PM.DataModel.User.registerNewAccount, |
444 | this.newUserCreationComponent().username(), | 436 | this.newUserCreationComponent().username(), |
445 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase') | 437 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase') |
446 | ); | 438 | ); |
447 | deferredResult.addMethod(this, 'setUser'); | 439 | deferredResult.addMethod(this, 'setUser'); |
448 | deferredResult.addMethod(this.newUserCreationComponent(), 'showUserCreationDone'); | 440 | deferredResult.addMethod(this.newUserCreationComponent(), 'showUserCreationDone'); |
449 | deferredResult.addMethod(this, 'setUserCreationState', 'DONE'); | 441 | deferredResult.addMethod(this, 'setUserCreationState', 'DONE'); |
450 | 442 | ||
451 | // deferredResult.addErrback(MochiKit.Base.method(this.newUserCreationComponent(), 'showUserCreationFailed')); | 443 | // deferredResult.addErrback(MochiKit.Base.method(this.newUserCreationComponent(), 'showUserCreationFailed')); |
452 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUser', null)); | 444 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUser', null)); |
453 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUserCreationState', 'FAILED')); | 445 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUserCreationState', 'FAILED')); |
454 | deferredResult.addErrback(MochiKit.Base.bind(function (aValue) { | 446 | deferredResult.addErrback(MochiKit.Base.bind(function (aValue) { |
455 | this.newUserCreationComponent().showUserCreationFailed(); | 447 | this.newUserCreationComponent().showUserCreationFailed(); |
456 | this.setUser(null); | 448 | this.setUser(null); |
457 | this.setUserCreationState('FAILED'); | 449 | this.setUserCreationState('FAILED'); |