Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js index eec83b0..5341878 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.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.iPhone.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.iPhone.Components.LoginForm = function(args) { | 28 | Clipperz.PM.UI.iPhone.Components.LoginForm = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.iPhone.Components.LoginForm.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.iPhone.Components.LoginForm.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | return this; | 33 | return this; |
37 | } | 34 | } |
38 | 35 | ||
39 | //============================================================================= | 36 | //============================================================================= |
40 | 37 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { | 38 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { |
42 | 39 | ||
43 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
44 | 41 | ||
45 | 'toString': function () { | 42 | 'toString': function () { |
46 | return "Clipperz.PM.UI.iPhone.Components.LoginForm component"; | 43 | return "Clipperz.PM.UI.iPhone.Components.LoginForm component"; |
47 | }, | 44 | }, |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'focusOnUsername': function () { | 48 | 'focusOnUsername': function () { |
52 | this.getElement('username').focus(); | 49 | this.getElement('username').focus(); |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'username': function () { | 54 | 'username': function () { |
58 | return this.getElement('username').value; | 55 | return this.getElement('username').value; |
59 | }, | 56 | }, |
60 | 57 | ||
61 | 'passphrase': function () { | 58 | 'passphrase': function () { |
62 | return this.getElement('passphrase').value; | 59 | return this.getElement('passphrase').value; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'renderSelf': function(/*aContainer, aPosition*/) { | 64 | 'renderSelf': function(/*aContainer, aPosition*/) { |
68 | this.append(this.element(), [ | 65 | this.append(this.element(), [ |
69 | {tag:'div', cls:'toolbar iPhoneClipperzToolbar', children:[ | 66 | {tag:'div', cls:'toolbar iPhoneClipperzToolbar', children:[ |
70 | {tag:'h1', id:'pageTitle', html:'Clipperz'}, | 67 | {tag:'h1', id:'pageTitle', html:'Clipperz'}, |
71 | {tag:'a', id:'backButton', cls:'button', href:'#', html:"back"} | 68 | {tag:'a', id:'backButton', cls:'button', href:'#', html:"back"} |
72 | ]}, | 69 | ]}, |
73 | {tag:'form', title:'Theaters', cls:'panel toolbarlessPanel loginForm', id:this.getId('loginFormPanel'), children:[ | 70 | {tag:'form', title:'Theaters', cls:'panel toolbarlessPanel loginForm', id:this.getId('loginFormPanel'), children:[ |
74 | {tag:'fieldset', id:this.getId('fieldset'), children:[ | 71 | {tag:'fieldset', id:this.getId('fieldset'), children:[ |
75 | {tag:'div', cls:'row', children:[ | 72 | {tag:'div', cls:'row', children:[ |
76 | {tag:'label', html:"username"}, | 73 | {tag:'label', html:"username"}, |
77 | {tag:'input', type:'text', name:'username', value:"", autocorrect:'off', autocapitalize:'off', id:this.getId('username')} | 74 | {tag:'input', type:'text', name:'username', value:"", autocorrect:'off', autocapitalize:'off', id:this.getId('username')} |
78 | ]}, | 75 | ]}, |
79 | {tag:'div', cls:'row', children:[ | 76 | {tag:'div', cls:'row', children:[ |
80 | {tag:'label', html:"passphrase"}, | 77 | {tag:'label', html:"passphrase"}, |
81 | {tag:'input', type:'password', name:'passphrase', value:"", id:this.getId('passphrase')} | 78 | {tag:'input', type:'password', name:'passphrase', value:"", id:this.getId('passphrase')} |
82 | ]} | 79 | ]} |
83 | ]}, | 80 | ]}, |
84 | {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Login", id:this.getId('submit')} | 81 | {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Login", id:this.getId('submit')} |
85 | ]}, | 82 | ]}, |
86 | {tag:'div', cls:'panel toolbarlessPanel loginProgressPanel', id:this.getId('loginProgressPanel'), children:[ | 83 | {tag:'div', cls:'panel toolbarlessPanel loginProgressPanel', id:this.getId('loginProgressPanel'), children:[ |
87 | {tag:'div', id:this.getId('progressBar')} //, | 84 | {tag:'div', id:this.getId('progressBar')} //, |
88 | // {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Cancel", id:this.getId('cancel')} | 85 | // {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Cancel", id:this.getId('cancel')} |
89 | ]}, | 86 | ]}, |
90 | {tag:'div', cls:'panel loginErrorPanel', id:this.getId('loginErrorPanel'), children:[ | 87 | {tag:'div', cls:'panel loginErrorPanel', id:this.getId('loginErrorPanel'), children:[ |
91 | {tag:'div', cls:'errorMessage', id:this.getId('errorMessageBox'), children:[ | 88 | {tag:'div', cls:'errorMessage', id:this.getId('errorMessageBox'), children:[ |
92 | {tag:'h2', id:this.getId('errorMessage'), html:"Login failed"} | 89 | {tag:'h2', id:this.getId('errorMessage'), html:"Login failed"} |
93 | ]} | 90 | ]} |
94 | ]} | 91 | ]} |
95 | ]); | 92 | ]); |
96 | 93 | ||
97 | MochiKit.Signal.connect(this.getElement('submit'), 'onclick',this, 'submitHandler'); | 94 | MochiKit.Signal.connect(this.getElement('submit'), 'onclick',this, 'submitHandler'); |
98 | MochiKit.Signal.connect(this.getElement('loginFormPanel'), 'onsubmit',this, 'submitHandler'); | 95 | MochiKit.Signal.connect(this.getElement('loginFormPanel'), 'onsubmit',this, 'submitHandler'); |
99 | 96 | ||
100 | // MochiKit.Signal.connect(this.getElement('cancel'), 'onclick',this, 'cancelHandler'); | 97 | // MochiKit.Signal.connect(this.getElement('cancel'), 'onclick',this, 'cancelHandler'); |
101 | MochiKit.Signal.connect('backButton', 'onclick',this, 'backHandler'); | 98 | MochiKit.Signal.connect('backButton', 'onclick',this, 'backHandler'); |
102 | 99 | ||
103 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | 100 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); |
104 | 101 | ||
105 | // MochiKit.Style.hideElement(this.getElement('errorMessage')); | 102 | // MochiKit.Style.hideElement(this.getElement('errorMessage')); |
106 | 103 | ||
107 | this.showLoginForm(); | 104 | this.showLoginForm(); |
108 | // MochiKit.Async.callLater(0.2, MochiKit.Base.method(this, 'focusOnUsername')); | 105 | // MochiKit.Async.callLater(0.2, MochiKit.Base.method(this, 'focusOnUsername')); |
109 | }, | 106 | }, |
110 | 107 | ||
111 | //------------------------------------------------------------------------- | 108 | //------------------------------------------------------------------------- |
112 | 109 | ||
113 | 'showLoginForm': function () { | 110 | 'showLoginForm': function () { |
114 | MochiKit.Style.showElement(this.getElement('loginFormPanel')); | 111 | MochiKit.Style.showElement(this.getElement('loginFormPanel')); |
115 | MochiKit.Style.hideElement(this.getElement('loginProgressPanel')); | 112 | MochiKit.Style.hideElement(this.getElement('loginProgressPanel')); |
116 | MochiKit.Style.hideElement(this.getElement('loginErrorPanel')); | 113 | MochiKit.Style.hideElement(this.getElement('loginErrorPanel')); |
117 | MochiKit.Style.hideElement('backButton'); | 114 | MochiKit.Style.hideElement('backButton'); |
118 | }, | 115 | }, |
119 | 116 | ||
120 | 'slideInLoginForm': function () { | 117 | 'slideInLoginForm': function () { |