Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js index de20853..389d876 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/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.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.LoginForm = function(args) { | 28 | Clipperz.PM.UI.Web.Components.LoginForm = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | this._autocomplete = args.autocomplete || 'off'; | 31 | this._autocomplete = args.autocomplete || 'off'; |
35 | 32 | ||
36 | Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); | 33 | Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); |
37 | 34 | ||
38 | this._slots = { | 35 | this._slots = { |
39 | 'passphraseEntropy':this.getId('passphraseEntropy') | 36 | 'passphraseEntropy':this.getId('passphraseEntropy') |
40 | }; | 37 | }; |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | //============================================================================= | 42 | //============================================================================= |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'toString': function () { | 48 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Web.Components.LoginForm component"; | 49 | return "Clipperz.PM.UI.Web.Components.LoginForm component"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | 'autocomplete': function () { | 52 | 'autocomplete': function () { |
56 | return this._autocomplete; | 53 | return this._autocomplete; |
57 | }, | 54 | }, |
58 | 55 | ||
59 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
60 | 57 | ||
61 | 'renderSelf': function() { | 58 | 'renderSelf': function() { |
62 | this.append(this.element(), {tag:'div', id:'loginBox', children:[ | 59 | this.append(this.element(), {tag:'div', id:'loginBox', children:[ |
63 | {tag:'div', cls:'header'}, | 60 | {tag:'div', cls:'header'}, |
64 | {tag:'div', cls:'body', id:this.getId('body'), children:[ | 61 | {tag:'div', cls:'body', id:this.getId('body'), children:[ |
65 | {tag:'div', id:this.getId('loginForm'), children:[ | 62 | {tag:'div', id:this.getId('loginForm'), children:[ |
66 | {tag:'div', children:[ | 63 | {tag:'div', children:[ |
67 | {tag:'h4', html:'Login'}, | 64 | {tag:'h4', html:'Login'}, |
68 | // {tag:'form', cls:'loginForm', autocomplete:this.autocomplete(), children:[ | 65 | // {tag:'form', cls:'loginForm', autocomplete:this.autocomplete(), children:[ |
69 | {tag:'form', id:this.getId('form'), cls:'loginForm', children:[ | 66 | {tag:'form', id:this.getId('form'), cls:'loginForm', children:[ |
70 | {tag:'label', html:'username', 'for':this.getId('usernameField')}, | 67 | {tag:'label', html:'username', 'for':this.getId('usernameField')}, |
71 | {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'/*, value:'joe'*/}, | 68 | {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'/*, value:'joe'*/}, |
72 | {tag:'ul', id:this.getId('passwordOptions'), children:[ | 69 | {tag:'ul', id:this.getId('passwordOptions'), children:[ |
73 | {tag:'li', id:this.getId('passphraseOption'), children:[ | 70 | {tag:'li', id:this.getId('passphraseOption'), children:[ |
74 | {tag:'label', html:'passphrase / OTP', 'for':this.getId('passphraseField')}, | 71 | {tag:'label', html:'passphrase / OTP', 'for':this.getId('passphraseField')}, |
75 | {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'/*, value:'clipperz'*/} | 72 | {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'/*, value:'clipperz'*/} |
76 | ]} //, | 73 | ]} //, |
77 | /* | 74 | /* |
78 | {tag:'li', id:this.getId('otpOption'), children:[ | 75 | {tag:'li', id:this.getId('otpOption'), children:[ |
79 | {tag:'label', html:'one-time password', 'for':this.getId('otpField_1')}, | 76 | {tag:'label', html:'one-time password', 'for':this.getId('otpField_1')}, |
80 | {tag:'input', id:this.getId('otpField_1'), type:'text', cls:'otp', value:'abcd-efgh'}, | 77 | {tag:'input', id:this.getId('otpField_1'), type:'text', cls:'otp', value:'abcd-efgh'}, |
81 | {tag:'input', id:this.getId('otpField_2'), type:'text', cls:'otp', value:'abcd-efgh'}, | 78 | {tag:'input', id:this.getId('otpField_2'), type:'text', cls:'otp', value:'abcd-efgh'}, |
82 | {tag:'input', id:this.getId('otpField_3'), type:'text', cls:'otp', value:'abcd-efgh'}, | 79 | {tag:'input', id:this.getId('otpField_3'), type:'text', cls:'otp', value:'abcd-efgh'}, |
83 | {tag:'input', id:this.getId('otpField_4'), type:'text', cls:'otp', value:'abcd-efgh'} | 80 | {tag:'input', id:this.getId('otpField_4'), type:'text', cls:'otp', value:'abcd-efgh'} |
84 | ]} | 81 | ]} |
85 | */ | 82 | */ |
86 | ]}, | 83 | ]}, |
87 | // {tag:'input', id:this.getId('otpCheckbox'), type:'checkbox', cls:'checkbox'}, | 84 | // {tag:'input', id:this.getId('otpCheckbox'), type:'checkbox', cls:'checkbox'}, |
88 | // {tag:'label', html:'use a one-time passphrase', 'for':this.getId('otpCheckbox'), cls:'checkbox'}, | 85 | // {tag:'label', html:'use a one-time passphrase', 'for':this.getId('otpCheckbox'), cls:'checkbox'}, |
89 | 86 | ||
90 | {tag:'div', cls:'translations', children:[ | 87 | {tag:'div', cls:'translations', children:[ |
91 | {tag:'h4', html:'choose your language'}, | 88 | {tag:'h4', html:'choose your language'}, |
92 | {tag:'ul', children:[ | 89 | {tag:'ul', children:[ |
93 | {tag:'li', cls:'selected', html:'english'}, | 90 | {tag:'li', cls:'selected', html:'english'}, |
94 | {tag:'li', html:'italiano'}, | 91 | {tag:'li', html:'italiano'}, |
95 | {tag:'li', html:'dutch'}, | 92 | {tag:'li', html:'dutch'}, |
96 | {tag:'li', html:'french'}, | 93 | {tag:'li', html:'french'}, |
97 | {tag:'li', html:'spanish'}, | 94 | {tag:'li', html:'spanish'}, |
98 | {tag:'li', html:'chinese'}, | 95 | {tag:'li', html:'chinese'}, |
99 | {tag:'li', html:'japanese'}, | 96 | {tag:'li', html:'japanese'}, |
100 | {tag:'li', html:'portugal'}, | 97 | {tag:'li', html:'portugal'}, |
101 | {tag:'li', html:'arabic'} | 98 | {tag:'li', html:'arabic'} |
102 | ]} | 99 | ]} |
103 | ]}, | 100 | ]}, |
104 | 101 | ||
105 | {tag:'input', id:this.getId('submitButton'), type:'submit', value:'login', cls:'submit'} | 102 | {tag:'input', id:this.getId('submitButton'), type:'submit', value:'login', cls:'submit'} |
106 | ]} | 103 | ]} |
107 | ]} | 104 | ]} |
108 | ]} | 105 | ]} |
109 | ]}, | 106 | ]}, |
110 | {tag:'div', cls:'footer'} | 107 | {tag:'div', cls:'footer'} |
111 | ]}); | 108 | ]}); |
112 | 109 | ||
113 | if (this.autocomplete() == 'off') { | 110 | if (this.autocomplete() == 'off') { |
114 | MochiKit.DOM.updateNodeAttributes(this.getElement('form'), {autocomplete:'off'}); | 111 | MochiKit.DOM.updateNodeAttributes(this.getElement('form'), {autocomplete:'off'}); |
115 | } | 112 | } |
116 | 113 | ||
117 | // Clipperz.Style.setBackgroundGradient(this.getElement('body'), {from:"#ff9955", to:"#ff6622"}) | 114 | // Clipperz.Style.setBackgroundGradient(this.getElement('body'), {from:"#ff9955", to:"#ff6622"}) |
118 | 115 | ||
119 | // this.setEntropyDisplay(new Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay(this.getElement('passphraseField'))); | 116 | // this.setEntropyDisplay(new Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay(this.getElement('passphraseField'))); |
120 | 117 | ||