summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js28
1 files changed, 10 insertions, 18 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
index feb16ad..06746d1 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
@@ -1,223 +1,219 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); 24Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
27 25
28Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) { 26Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) {
29 args = args || {}; 27 args = args || {};
30 28
31 Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments); 29 Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments);
32 30
33 this._tabPanelController = null; 31 this._tabPanelController = null;
34 32
35 this._initiallySelectedTab = args.selected || 'CREDENTIALS'; 33 this._initiallySelectedTab = args.selected || 'CREDENTIALS';
36 this._tabPanelControllerConfiguration = { 34 this._tabPanelControllerConfiguration = {
37 'CREDENTIALS': { 35 'CREDENTIALS': {
38 tab:'credentialsTab', 36 tab:'credentialsTab',
39 panel:'credentialsTabpanel' 37 panel:'credentialsTabpanel'
40 }, 38 },
41 'CHECK_CREDENTIALS': { 39 'CHECK_CREDENTIALS': {
42 tab:'checkCredentialsTab', 40 tab:'checkCredentialsTab',
43 panel:'checkCredentialsTabpanel' 41 panel:'checkCredentialsTabpanel'
44 }, 42 },
45 'TERMS_OF_SERVICE': { 43 'TERMS_OF_SERVICE': {
46 tab:'termsOfServiceTab', 44 tab:'termsOfServiceTab',
47 panel:'termsOfServiceTabpanel' 45 panel:'termsOfServiceTabpanel'
48 }, 46 },
49 'CREATE_USER': { 47 'CREATE_USER': {
50 tab:'createUserTab', 48 tab:'createUserTab',
51 panel:'createUserTabpanel' 49 panel:'createUserTabpanel'
52 }//, 50 }//,
53/* 51/*
54 'LOGIN': { 52 'LOGIN': {
55 tab:'loginTab', 53 tab:'loginTab',
56 panel:'loginTabpanel' 54 panel:'loginTabpanel'
57 } 55 }
58*/ 56*/
59 }; 57 };
60 58
61 return this; 59 return this;
62} 60}
63 61
64//============================================================================= 62//=============================================================================
65 63
66Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { 64Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, {
67 65
68 //------------------------------------------------------------------------- 66 //-------------------------------------------------------------------------
69 67
70 'toString': function () { 68 'toString': function () {
71 return "Clipperz.PM.UI.Web.Components.NewUserCreationComponent component"; 69 return "Clipperz.PM.UI.Web.Components.NewUserCreationComponent component";
72 }, 70 },
73 71
74 //========================================================================= 72 //=========================================================================
75 73
76 'disableAllPanels': function () { 74 'disableAllPanels': function () {
77 this.tabPanelController().selectTab(null); 75 this.tabPanelController().selectTab(null);
78 }, 76 },
79 77
80 //------------------------------------------------------------------------- 78 //-------------------------------------------------------------------------
81 79
82 'enableCredentialsPanel': function () { 80 'enableCredentialsPanel': function () {
83 this.tabPanelController().selectTab('CREDENTIALS'); 81 this.tabPanelController().selectTab('CREDENTIALS');
84 }, 82 },
85 83
86 'enableCheckCredentialsPanel': function () { 84 'enableCheckCredentialsPanel': function () {
87 this.tabPanelController().selectTab('CHECK_CREDENTIALS'); 85 this.tabPanelController().selectTab('CHECK_CREDENTIALS');
88 }, 86 },
89 87
90 'enableTermsOfServicePanel': function () { 88 'enableTermsOfServicePanel': function () {
91 this.tabPanelController().selectTab('TERMS_OF_SERVICE'); 89 this.tabPanelController().selectTab('TERMS_OF_SERVICE');
92 }, 90 },
93 91
94 'enableCreateUserPanel': function () { 92 'enableCreateUserPanel': function () {
95 this.tabPanelController().selectTab('CREATE_USER'); 93 this.tabPanelController().selectTab('CREATE_USER');
96 }, 94 },
97 95
98 //'enableLoginPanel': function () { 96 //'enableLoginPanel': function () {
99 // this.tabPanelController().selectTab('LOGIN'); 97 // this.tabPanelController().selectTab('LOGIN');
100 //}, 98 //},
101 99
102 //========================================================================= 100 //=========================================================================
103 101
104 'shouldShowElementWhileRendering': function() { 102 'shouldShowElementWhileRendering': function() {
105 return false; 103 return false;
106 }, 104 },
107 105
108 //========================================================================= 106 //=========================================================================
109 107
110 'tabPanelController': function () { 108 'tabPanelController': function () {
111 if (this._tabPanelController == null) { 109 if (this._tabPanelController == null) {
112 this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ 110 this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({
113 component:this, 111 component:this,
114 configuration:this._tabPanelControllerConfiguration 112 configuration:this._tabPanelControllerConfiguration
115 }); 113 });
116 114
117 MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') 115 MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected')
118 } 116 }
119 117
120 return this._tabPanelController; 118 return this._tabPanelController;
121 }, 119 },
122 120
123 //------------------------------------------------------------------------- 121 //-------------------------------------------------------------------------
124 122
125 'renderSelf': function() { 123 'renderSelf': function() {
126//console.log('** Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition));
127
128 this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [ 124 this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [
129 {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[ 125 {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[
130 {tag:'div', cls:'header', children:[ 126 {tag:'div', cls:'header', children:[
131 {tag:'div', cls:'title', children:[ 127 {tag:'div', cls:'title', children:[
132 {tag:'h3', id:this.getId('title'), html:"Create new user"} 128 {tag:'h3', id:this.getId('title'), html:"Create new user"}
133 ]} 129 ]}
134 ]}, 130 ]},
135 {tag:'div', id:this.getId('body'), cls:'body', children:[ 131 {tag:'div', id:this.getId('body'), cls:'body', children:[
136 {tag:'div', cls:'tabContainer', children:[ 132 {tag:'div', cls:'tabContainer', children:[
137 {tag:'ul', cls:'tabs', children:[ 133 {tag:'ul', cls:'tabs', children:[
138 {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]}, 134 {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]},
139 {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]}, 135 {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]},
140 {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]}, 136 {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]},
141 {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//, 137 {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//,
142 // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]}, 138 // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]},
143 ]}, 139 ]},
144 {tag:'ul', cls:'tabPanels', children:[ 140 {tag:'ul', cls:'tabPanels', children:[
145 {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[ 141 {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[
146 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]}, 142 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]},
147 {tag:'ul', cls:'credentials', children:[ 143 {tag:'ul', cls:'credentials', children:[
148 {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]}, 144 {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]},
149 {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]} 145 {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]}
150 ]} 146 ]}
151 ]}, 147 ]},
152 {tag:'li', id:this.getId('checkCredentialsTabpanel'), cls:'tabPanel checkCredentials', children:[ 148 {tag:'li', id:this.getId('checkCredentialsTabpanel'), cls:'tabPanel checkCredentials', children:[
153 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CHECK_CREDENTIALS.description')}]}, 149 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CHECK_CREDENTIALS.description')}]},
154 {tag:'ul', cls:'credentials', children:[ 150 {tag:'ul', cls:'credentials', children:[
155 {tag:'li', children:[{tag:'span', cls:'label', html:"re-passphrase"},{tag:'input', type:'password', id:this.getId('re-passphrase')/*, value:'test'*/}]} 151 {tag:'li', children:[{tag:'span', cls:'label', html:"re-passphrase"},{tag:'input', type:'password', id:this.getId('re-passphrase')/*, value:'test'*/}]}
156 ]} 152 ]}
157 ]}, 153 ]},
158 {tag:'li', id:this.getId('termsOfServiceTabpanel'), cls:'tabPanel termsOfService', children:[ 154 {tag:'li', id:this.getId('termsOfServiceTabpanel'), cls:'tabPanel termsOfService', children:[
159 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.TERMS_OF_SERVICE.description')}]}, 155 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.TERMS_OF_SERVICE.description')}]},
160 {tag:'ul', cls:'termsOfService', children:[ 156 {tag:'ul', cls:'termsOfService', children:[
161 {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('awareOfUnrecoverablePassphrase')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('awareOfUnrecoverablePassphrase'), html:"I understand that Clipperz will not be able to recover a lost passphrase."}]}, 157 {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('awareOfUnrecoverablePassphrase')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('awareOfUnrecoverablePassphrase'), html:"I understand that Clipperz will not be able to recover a lost passphrase."}]},
162 {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('readTermsOfService')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('readTermsOfService'), htmlString:"I have read and agreed to the <a href='http://www.clipperz.com/terms_of_service' target='_blank'>Terms of Service</a>."}]} 158 {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('readTermsOfService')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('readTermsOfService'), htmlString:"I have read and agreed to the <a href='http://www.clipperz.com/terms_of_service' target='_blank'>Terms of Service</a>."}]}
163 ]} 159 ]}
164 ]}, 160 ]},
165 {tag:'li', id:this.getId('createUserTabpanel'), cls:'tabPanel createUser', children:[ 161 {tag:'li', id:this.getId('createUserTabpanel'), cls:'tabPanel createUser', children:[
166 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREATE_USER.description')}]}, 162 {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREATE_USER.description')}]},
167 {tag:'ul', cls:'createUserStates', children:[ 163 {tag:'ul', cls:'createUserStates', children:[
168 {tag:'li', cls:'creating', id:this.getId('creatingRegistering'), children:[{tag:'span', html:"registering user"}]}, 164 {tag:'li', cls:'creating', id:this.getId('creatingRegistering'), children:[{tag:'span', html:"registering user"}]},
169 {tag:'li', cls:'done', id:this.getId('creatingDone'), children:[{tag:'span', html:"done"}]}, 165 {tag:'li', cls:'done', id:this.getId('creatingDone'), children:[{tag:'span', html:"done"}]},
170 {tag:'li', cls:'fail', id:this.getId('creatingFailed'), children:[{tag:'span', html:"fail"}]} 166 {tag:'li', cls:'fail', id:this.getId('creatingFailed'), children:[{tag:'span', html:"fail"}]}
171 ]} 167 ]}
172 ]}//, 168 ]}//,
173 // {tag:'li', id:this.getId('loginTabpanel'), cls:'tabPanel login', children:[ 169 // {tag:'li', id:this.getId('loginTabpanel'), cls:'tabPanel login', children:[
174 // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.LOGIN.description')}]}, 170 // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.LOGIN.description')}]},
175 // ]} 171 // ]}
176 ]} 172 ]}
177 ]} 173 ]}
178 ]}, 174 ]},
179 {tag:'div', id:this.getId('footer'), cls:'footer', children:[ 175 {tag:'div', id:this.getId('footer'), cls:'footer', children:[
180 {tag:'div', cls:'buttonArea', children:[ 176 {tag:'div', cls:'buttonArea', children:[
181 // {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, 177 // {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"},
182 // {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} 178 // {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"}
183 ]} 179 ]}
184 ]} 180 ]}
185 ]}, 181 ]},
186 {tag:'div', cls:'clear'} 182 {tag:'div', cls:'clear'}
187 ]}); 183 ]});
188 184
189 this.tabPanelController().setup(); 185 this.tabPanelController().setup();
190 // MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'handleKeyEvent'); 186 // MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'handleKeyEvent');
191 MochiKit.Signal.connect(MochiKit.DOM.currentDocument().body, 'onkeydown', this, 'handleKeyEvent'); 187 MochiKit.Signal.connect(MochiKit.DOM.currentDocument().body, 'onkeydown', this, 'handleKeyEvent');
192 MochiKit.Signal.connect(this.getId('awareOfUnrecoverablePassphrase'), 'onchange', this, 'handleTermsOfServiceCheckboxChange'); 188 MochiKit.Signal.connect(this.getId('awareOfUnrecoverablePassphrase'), 'onchange', this, 'handleTermsOfServiceCheckboxChange');
193 MochiKit.Signal.connect(this.getId('readTermsOfService'), 'onchange', this, 'handleTermsOfServiceCheckboxChange'); 189 MochiKit.Signal.connect(this.getId('readTermsOfService'), 'onchange', this, 'handleTermsOfServiceCheckboxChange');
194 }, 190 },
195 191
196 //------------------------------------------------------------------------- 192 //-------------------------------------------------------------------------
197/* 193/*
198 'resetContent': function () { 194 'resetContent': function () {
199 this.getElement('username').value = ''; 195 this.getElement('username').value = '';
200 this.getElement('passphrase').value = ''; 196 this.getElement('passphrase').value = '';
201 }, 197 },
202*/ 198*/
203 //------------------------------------------------------------------------- 199 //-------------------------------------------------------------------------
204 200
205 'displayElement': function() { 201 'displayElement': function() {
206 return this.getElement('panel'); 202 return this.getElement('panel');
207 }, 203 },
208 204
209 //------------------------------------------------------------------------- 205 //-------------------------------------------------------------------------
210 206
211 'handleTabSelected': function (aSelectedTab) { 207 'handleTabSelected': function (aSelectedTab) {
212/* 208/*
213 switch (aSelectedTab) { 209 switch (aSelectedTab) {
214 case 'DETAILS': 210 case 'DETAILS':
215 break; 211 break;
216 case 'DIRECT_LOGINS': 212 case 'DIRECT_LOGINS':
217 MochiKit.Style.hideElement(this.getElement('backToDirectLoginList')); 213 MochiKit.Style.hideElement(this.getElement('backToDirectLoginList'));
218 break; 214 break;
219 case 'SHARING': 215 case 'SHARING':
220 break; 216 break;
221 } 217 }
222*/ 218*/
223 }, 219 },
@@ -240,188 +236,184 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Cli
240 return this.getElement('re-passphrase').value; 236 return this.getElement('re-passphrase').value;
241 }, 237 },
242 238
243 'awareOfUnrecoverablePassphrase': function () { 239 'awareOfUnrecoverablePassphrase': function () {
244 return this.getElement('awareOfUnrecoverablePassphrase').value; 240 return this.getElement('awareOfUnrecoverablePassphrase').value;
245 }, 241 },
246 242
247 'readTermsOfService': function () { 243 'readTermsOfService': function () {
248 return this.getElement('readTermsOfService').value; 244 return this.getElement('readTermsOfService').value;
249 }, 245 },
250 246
251 //========================================================================= 247 //=========================================================================
252/* 248/*
253 'incrementUpdateFaviconCounter': function () { 249 'incrementUpdateFaviconCounter': function () {
254 this._updateFaviconCounter ++; 250 this._updateFaviconCounter ++;
255 }, 251 },
256 252
257 'decrementUpdateFaviconCounter': function () { 253 'decrementUpdateFaviconCounter': function () {
258 this._updateFaviconCounter --; 254 this._updateFaviconCounter --;
259 }, 255 },
260 256
261 'updateFaviconCounter': function () { 257 'updateFaviconCounter': function () {
262 return this._updateFaviconCounter; 258 return this._updateFaviconCounter;
263 }, 259 },
264 */ 260 */
265 //------------------------------------------------------------------------- 261 //-------------------------------------------------------------------------
266/* 262/*
267 'updateFavicon': function () { 263 'updateFavicon': function () {
268 this.decrementUpdateFaviconCounter(); 264 this.decrementUpdateFaviconCounter();
269 265
270 if (this.updateFaviconCounter() == 0) { 266 if (this.updateFaviconCounter() == 0) {
271 this.setFavicon(this.favicon()); 267 this.setFavicon(this.favicon());
272 } 268 }
273 }, 269 },
274*/ 270*/
275 //========================================================================= 271 //=========================================================================
276/* 272/*
277 'bindingComponents': function () { 273 'bindingComponents': function () {
278 return this._bindingComponents; 274 return this._bindingComponents;
279 }, 275 },
280 276
281 'clearAllBindingsComponents': function () { 277 'clearAllBindingsComponents': function () {
282 MochiKit.Iter.forEach(this.bindingComponents(), MochiKit.Base.methodcaller('remove')); 278 MochiKit.Iter.forEach(this.bindingComponents(), MochiKit.Base.methodcaller('remove'));
283 this._bindingComponents = []; 279 this._bindingComponents = [];
284 this.getElement('bindings').innerHTML = ''; 280 this.getElement('bindings').innerHTML = '';
285 }, 281 },
286 282
287 'addBindingComponent': function (aBindingComponent) { 283 'addBindingComponent': function (aBindingComponent) {
288 this.bindingComponents().push(aBindingComponent); 284 this.bindingComponents().push(aBindingComponent);
289 aBindingComponent.renderInNode(this.append(this.getElement('bindings'), {tag:'div'})); 285 aBindingComponent.renderInNode(this.append(this.getElement('bindings'), {tag:'div'}));
290 }, 286 },
291*/ 287*/
292 //========================================================================= 288 //=========================================================================
293/* 289/*
294 'formValueComponents': function () { 290 'formValueComponents': function () {
295 return this._formValueComponents; 291 return this._formValueComponents;
296 }, 292 },
297 293
298 'clearAllFormValueComponents': function () { 294 'clearAllFormValueComponents': function () {
299 MochiKit.Iter.forEach(this.formValueComponents(), MochiKit.Base.methodcaller('remove')); 295 MochiKit.Iter.forEach(this.formValueComponents(), MochiKit.Base.methodcaller('remove'));
300 this._formValueComponents = []; 296 this._formValueComponents = [];
301 this.getElement('formValues').innerHTML = ''; 297 this.getElement('formValues').innerHTML = '';
302 }, 298 },
303 299
304 'addFormValueComponent': function (aFormValueComponent) { 300 'addFormValueComponent': function (aFormValueComponent) {
305 this.formValueComponents().push(aFormValueComponent); 301 this.formValueComponents().push(aFormValueComponent);
306 aFormValueComponent.renderInNode(this.append(this.getElement('formValues'), {tag:'div'})); 302 aFormValueComponent.renderInNode(this.append(this.getElement('formValues'), {tag:'div'}));
307 }, 303 },
308*/ 304*/
309 //========================================================================= 305 //=========================================================================
310 306
311 'changedValue': function (anEvent) { 307 'changedValue': function (anEvent) {
312 MochiKit.Signal.signal(this, 'changedValue', anEvent); 308 MochiKit.Signal.signal(this, 'changedValue', anEvent);
313 309
314 this.incrementUpdateFaviconCounter(); 310 this.incrementUpdateFaviconCounter();
315 MochiKit.Async.callLater(1, MochiKit.Base.method(this, 'updateFavicon')); 311 MochiKit.Async.callLater(1, MochiKit.Base.method(this, 'updateFavicon'));
316 }, 312 },
317 313
318 //------------------------------------------------------------------------- 314 //-------------------------------------------------------------------------
319 315
320 'handleBackClick': function (anEvent) { 316 'handleBackClick': function (anEvent) {
321 anEvent.preventDefault(); 317 anEvent.preventDefault();
322 318
323 MochiKit.Signal.signal(this, 'back'); 319 MochiKit.Signal.signal(this, 'back');
324 }, 320 },
325 321
326 //========================================================================= 322 //=========================================================================
327 323
328 'bottomMargin': function () { 324 'bottomMargin': function () {
329 var result; 325 var result;
330 326
331 //TODO: WTF!!! 327 //TODO: WTF!!!
332 // result =MochiKit.Style.getElementPosition(this.element())['y'] + 328 // result =MochiKit.Style.getElementPosition(this.element())['y'] +
333 // MochiKit.Style.getElementDimensions(this.element())['h']; 329 // MochiKit.Style.getElementDimensions(this.element())['h'];
334 330
335 // result =MochiKit.Style.getElementPosition(this.getElement('footer'))['y']; 331 // result =MochiKit.Style.getElementPosition(this.getElement('footer'))['y'];
336//console.log("### bottomMargin");
337//console.log('displayElement', this.displayElement());
338//console.log('-- Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition));
339//console.log('element', MochiKit.Style.getElementPosition('modalDialog') ['y'], MochiKit.Style.getElementDimensions('modalDialog')['h']);
340 // result = 450; 332 // result = 450;
341 333
342 result =Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['position']['y'] + 334 result =Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['position']['y'] +
343 Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['dimensions']['h'] - 335 Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['dimensions']['h'] -
344 60; 336 60;
345 337
346 return result; 338 return result;
347 }, 339 },
348 340
349 //========================================================================= 341 //=========================================================================
350 342
351 'focusOnUsernameElement': function () { 343 'focusOnUsernameElement': function () {
352 MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('username'), 'focus')); 344 MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('username'), 'focus'));
353 }, 345 },
354 346
355 'focusOnRePassphraseElement': function () { 347 'focusOnRePassphraseElement': function () {
356 this.getElement('re-passphrase').focus(); 348 this.getElement('re-passphrase').focus();
357 }, 349 },
358 /* 350 /*
359 'focusOnBookmarkletConfigurationElement': function () { 351 'focusOnBookmarkletConfigurationElement': function () {
360 this.getElement('bookmarkletConfiguration').focus(); 352 this.getElement('bookmarkletConfiguration').focus();
361 }, 353 },
362 354
363 'focusOnFaviconElement': function () { 355 'focusOnFaviconElement': function () {
364 this.getElement('faviconURL').focus(); 356 this.getElement('faviconURL').focus();
365 }, 357 },
366*/ 358*/
367 359
368 //========================================================================= 360 //=========================================================================
369 361
370 'hideAllProgeressStates': function () { 362 'hideAllProgeressStates': function () {
371 MochiKit.Style.hideElement(this.getElement('creatingRegistering')); 363 MochiKit.Style.hideElement(this.getElement('creatingRegistering'));
372 MochiKit.Style.hideElement(this.getElement('creatingDone')); 364 MochiKit.Style.hideElement(this.getElement('creatingDone'));
373 MochiKit.Style.hideElement(this.getElement('creatingFailed')); 365 MochiKit.Style.hideElement(this.getElement('creatingFailed'));
374 }, 366 },
375 367
376 'showProgressOnUserCreation': function () { 368 'showProgressOnUserCreation': function () {
377//Clipperz.log(">>> NewUserCreationComponent.showProgressOnUserCreation"); 369//Clipperz.log(">>> NewUserCreationComponent.showProgressOnUserCreation");
378 this.hideAllProgeressStates(); 370 this.hideAllProgeressStates();
379 MochiKit.Style.showElement(this.getElement('creatingRegistering')); 371 MochiKit.Style.showElement(this.getElement('creatingRegistering'));
380 }, 372 },
381 373
382 'showUserCreationDone': function () { 374 'showUserCreationDone': function () {
383//Clipperz.log(">>> NewUserCreationComponent.showUserCreationDone"); 375//Clipperz.log(">>> NewUserCreationComponent.showUserCreationDone");
384 this.hideAllProgeressStates(); 376 this.hideAllProgeressStates();
385 MochiKit.Style.showElement(this.getElement('creatingDone')); 377 MochiKit.Style.showElement(this.getElement('creatingDone'));
386//Clipperz.log("<<< NewUserCreationComponent.showUserCreationDone"); 378//Clipperz.log("<<< NewUserCreationComponent.showUserCreationDone");
387 }, 379 },
388 380
389 'showUserCreationFailed': function () { 381 'showUserCreationFailed': function () {
390//Clipperz.log(">>> NewUserCreationComponent.showUserCreationFailed"); 382//Clipperz.log(">>> NewUserCreationComponent.showUserCreationFailed");
391 this.hideAllProgeressStates(); 383 this.hideAllProgeressStates();
392 MochiKit.Style.showElement(this.getElement('creatingFailed')); 384 MochiKit.Style.showElement(this.getElement('creatingFailed'));
393 }, 385 },
394 386
395 //========================================================================= 387 //=========================================================================
396 388
397 'handleKeyEvent': function (anEvent) { 389 'handleKeyEvent': function (anEvent) {
398 MochiKit.Signal.signal(this, 'keyPressed', anEvent); 390 MochiKit.Signal.signal(this, 'keyPressed', anEvent);
399/* 391/*
400 if (anEvent.key().string == 'KEY_ENTER') { 392 if (anEvent.key().string == 'KEY_ENTER') {
401 if (anEvent.target().nodeName != 'TEXTAREA') { 393 if (anEvent.target().nodeName != 'TEXTAREA') {
402 MochiKit.Signal.signal(this, 'moveForward'); 394 MochiKit.Signal.signal(this, 'moveForward');
403 anEvent.preventDefault(); 395 anEvent.preventDefault();
404 } 396 }
405 } else if (anEvent.key().string == 'KEY_TAB') { 397 } else if (anEvent.key().string == 'KEY_TAB') {
406 if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { 398 if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) {
407 MochiKit.Signal.signal(this, 'moveForward'); 399 MochiKit.Signal.signal(this, 'moveForward');
408 anEvent.preventDefault(); 400 anEvent.preventDefault();
409 } 401 }
410 } 402 }
411*/ 403*/
412 }, 404 },
413 405
414 'handleTermsOfServiceCheckboxChange': function (anEvent) { 406 'handleTermsOfServiceCheckboxChange': function (anEvent) {
415 MochiKit.Signal.signal(this, 'changedValue'); 407 MochiKit.Signal.signal(this, 'changedValue');
416 }, 408 },
417 409
418 //========================================================================= 410 //=========================================================================
419 411
420 'clear': function () { 412 'clear': function () {
421 this.tabPanelController().selectTab(null); 413 this.tabPanelController().selectTab(null);
422 Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.clear.apply(this, arguments); 414 Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.clear.apply(this, arguments);
423 }, 415 },
424 416
425 //========================================================================= 417 //=========================================================================
426 __syntaxFix__: "syntax fix" 418 __syntaxFix__: "syntax fix"
427}); 419});