Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js') (more/less context) (show whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js | 15 |
1 files changed, 6 insertions, 9 deletions
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 28d9d20..7db6888 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js | |||
@@ -1,120 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { | 28 | Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { |
32 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | 29 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); |
33 | 30 | ||
34 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); | 31 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); |
35 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); | 32 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); |
36 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); | 33 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); |
37 | 34 | ||
38 | this._rulerComponent = null; | 35 | this._rulerComponent = null; |
39 | 36 | ||
40 | this._steps = null; | 37 | this._steps = null; |
41 | this._currentStepIndex = 0; | 38 | this._currentStepIndex = 0; |
42 | this._isNextEnabled = false; | 39 | this._isNextEnabled = false; |
43 | 40 | ||
44 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' | 41 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' |
45 | this._user = null; | 42 | this._user = null; |
46 | return this; | 43 | return this; |
47 | } | 44 | } |
48 | 45 | ||
49 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { | 46 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { |
50 | 47 | ||
51 | 'toString': function() { | 48 | 'toString': function() { |
52 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; | 49 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'newUserCreationComponent': function () { | 54 | 'newUserCreationComponent': function () { |
58 | return this._newUserCreationComponent; | 55 | return this._newUserCreationComponent; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | //============================================================================= | 58 | //============================================================================= |
62 | 59 | ||
63 | 'user': function () { | 60 | 'user': function () { |
64 | return this._user; | 61 | return this._user; |
65 | }, | 62 | }, |
66 | 63 | ||
67 | 'setUser': function (aValue) { | 64 | 'setUser': function (aValue) { |
68 | this._user = aValue; | 65 | this._user = aValue; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //----------------------------------------------------------------------------- | 68 | //----------------------------------------------------------------------------- |
72 | 69 | ||
73 | 'userCreationState': function () { | 70 | 'userCreationState': function () { |
74 | return this._userCreationState; | 71 | return this._userCreationState; |
75 | }, | 72 | }, |
76 | 73 | ||
77 | 'setUserCreationState': function (aValue) { | 74 | 'setUserCreationState': function (aValue) { |
78 | //console.log("+++ NewUserWizardController.setUserCreationState", aValue); | 75 | //console.log("+++ NewUserWizardController.setUserCreationState", aValue); |
79 | this._userCreationState = aValue; | 76 | this._userCreationState = aValue; |
80 | this.checkState(); | 77 | this.checkState(); |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //============================================================================= | 80 | //============================================================================= |
84 | 81 | ||
85 | 'resetCurrentStepIndex': function () { | 82 | 'resetCurrentStepIndex': function () { |
86 | this._currentStepIndex = 0; | 83 | this._currentStepIndex = 0; |
87 | this.rulerComponent().resetStatus({animateTransition:true}); | 84 | this.rulerComponent().resetStatus({animateTransition:true}); |
88 | }, | 85 | }, |
89 | 86 | ||
90 | //----------------------------------------------------------------------------- | 87 | //----------------------------------------------------------------------------- |
91 | 88 | ||
92 | 'enableNext': function (aValue) { | 89 | 'enableNext': function (aValue) { |
93 | this.rulerComponent().enableNext(aValue); | 90 | this.rulerComponent().enableNext(aValue); |
94 | this._isNextEnabled = aValue; | 91 | this._isNextEnabled = aValue; |
95 | }, | 92 | }, |
96 | 93 | ||
97 | 'isNextEnabled': function () { | 94 | 'isNextEnabled': function () { |
98 | return this._isNextEnabled; | 95 | return this._isNextEnabled; |
99 | }, | 96 | }, |
100 | 97 | ||
101 | //----------------------------------------------------------------------------- | 98 | //----------------------------------------------------------------------------- |
102 | 99 | ||
103 | 'enablePrevious': function (aValue) { | 100 | 'enablePrevious': function (aValue) { |
104 | this.rulerComponent().enablePrevious(aValue); | 101 | this.rulerComponent().enablePrevious(aValue); |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //============================================================================= | 104 | //============================================================================= |
108 | 105 | ||
109 | 'rulerComponent': function () { | 106 | 'rulerComponent': function () { |
110 | if (this._rulerComponent == null) { | 107 | if (this._rulerComponent == null) { |
111 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | 108 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ |
112 | translationContext:'Wizards.NewUserWizard' | 109 | translationContext:'Wizards.NewUserWizard' |
113 | }); | 110 | }); |
114 | this._rulerComponent.render(); | 111 | this._rulerComponent.render(); |
115 | 112 | ||
116 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | 113 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); |
117 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | 114 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); |
118 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | 115 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); |
119 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | 116 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); |
120 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | 117 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); |