Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js index f7991f1..defce91 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js | |||
@@ -1,214 +1,212 @@ | |||
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 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 26 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
29 | if (typeof(Clipperz.PM.Components.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } | 27 | if (typeof(Clipperz.PM.Components.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } |
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.Components.Panels.AccountPanel = function(anElement, args) { | 31 | Clipperz.PM.Components.Panels.AccountPanel = function(anElement, args) { |
34 | //MochiKit.Logging.logDebug(">>> new AccountPanel"); | 32 | //MochiKit.Logging.logDebug(">>> new AccountPanel"); |
35 | args = args || {}; | 33 | args = args || {}; |
36 | 34 | ||
37 | Clipperz.PM.Components.Panels.AccountPanel.superclass.constructor.call(this, anElement, args); | 35 | Clipperz.PM.Components.Panels.AccountPanel.superclass.constructor.call(this, anElement, args); |
38 | 36 | ||
39 | Clipperz.NotificationCenter.register(null, 'setupDone', this, 'render'); | 37 | Clipperz.NotificationCenter.register(null, 'setupDone', this, 'render'); |
40 | 38 | ||
41 | this._shouldLoadLoginHistory = true; | 39 | this._shouldLoadLoginHistory = true; |
42 | 40 | ||
43 | //this.render(); | 41 | //this.render(); |
44 | //MochiKit.Logging.logDebug("<<< new AccountPanel"); | 42 | //MochiKit.Logging.logDebug("<<< new AccountPanel"); |
45 | 43 | ||
46 | return this; | 44 | return this; |
47 | } | 45 | } |
48 | 46 | ||
49 | //============================================================================= | 47 | //============================================================================= |
50 | 48 | ||
51 | YAHOO.extendX(Clipperz.PM.Components.Panels.AccountPanel, Clipperz.PM.Components.Panels.BasePanel, { | 49 | YAHOO.extendX(Clipperz.PM.Components.Panels.AccountPanel, Clipperz.PM.Components.Panels.BasePanel, { |
52 | 50 | ||
53 | 'toString': function() { | 51 | 'toString': function() { |
54 | return "Clipperz.PM.Components.AccountPanel component"; | 52 | return "Clipperz.PM.Components.AccountPanel component"; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'render': function() { | 57 | 'render': function() { |
60 | var errorMessageActor; | 58 | var errorMessageActor; |
61 | varchangePasswordButton; | 59 | varchangePasswordButton; |
62 | var deleteAccountButton; | 60 | var deleteAccountButton; |
63 | 61 | ||
64 | try { | 62 | try { |
65 | //MochiKit.Logging.logDebug(">>> AccountPanel.render"); | 63 | //MochiKit.Logging.logDebug(">>> AccountPanel.render"); |
66 | Clipperz.NotificationCenter.unregister(this); | 64 | Clipperz.NotificationCenter.unregister(this); |
67 | MochiKit.Signal.disconnectAllTo(this); | 65 | MochiKit.Signal.disconnectAllTo(this); |
68 | 66 | ||
69 | this.element().update(""); | 67 | this.element().update(""); |
70 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ | 68 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ |
71 | {tag:'tbody', children:[ | 69 | {tag:'tbody', children:[ |
72 | {tag:'tr', children:[ | 70 | {tag:'tr', children:[ |
73 | {tag:'td', valign:'top', width:'200', children:[ | 71 | {tag:'td', valign:'top', width:'200', children:[ |
74 | {tag:'ul', id:"accountSubMenu", cls:'subMenu', children:[ | 72 | {tag:'ul', id:"accountSubMenu", cls:'subMenu', children:[ |
75 | {tag:'li', id:'changePassphraseTab', htmlString:Clipperz.PM.Strings['changePasswordTabLabel']}, | 73 | {tag:'li', id:'changePassphraseTab', htmlString:Clipperz.PM.Strings['changePasswordTabLabel']}, |
76 | {tag:'li', id:'manageOTPTab', htmlString:Clipperz.PM.Strings['manageOTPTabLabel']}, | 74 | {tag:'li', id:'manageOTPTab', htmlString:Clipperz.PM.Strings['manageOTPTabLabel']}, |
77 | {tag:'li', id:'accountPreferencesTab', htmlString:Clipperz.PM.Strings['accountPreferencesLabel']}, | 75 | {tag:'li', id:'accountPreferencesTab', htmlString:Clipperz.PM.Strings['accountPreferencesLabel']}, |
78 | {tag:'li', id:'loginHistoryTab', htmlString:Clipperz.PM.Strings['accountLoginHistoryLabel']}, | 76 | {tag:'li', id:'loginHistoryTab', htmlString:Clipperz.PM.Strings['accountLoginHistoryLabel']}, |
79 | {tag:'li', id:'deleteAccountTab', htmlString:Clipperz.PM.Strings['deleteAccountTabLabel']} | 77 | {tag:'li', id:'deleteAccountTab', htmlString:Clipperz.PM.Strings['deleteAccountTabLabel']} |
80 | // {tag:'li', id:'paidAccountTab'), htmlString:Clipperz.PM.Strings['paidAccountTabLabel']} | 78 | // {tag:'li', id:'paidAccountTab'), htmlString:Clipperz.PM.Strings['paidAccountTabLabel']} |
81 | ]} | 79 | ]} |
82 | ]}, | 80 | ]}, |
83 | {tag:'td', valign:'top', children:[ | 81 | {tag:'td', valign:'top', children:[ |
84 | {tag:'ul', cls:'clipperzTabPanels', children:[ | 82 | {tag:'ul', cls:'clipperzTabPanels', children:[ |
85 | {tag:'li', id:this.getId('changePassphrasePanel'), children:[ | 83 | {tag:'li', id:this.getId('changePassphrasePanel'), children:[ |
86 | {tag:'div', cls:'clipperzSubPanel', children:[ | 84 | {tag:'div', cls:'clipperzSubPanel', children:[ |
87 | {tag:'h5', htmlString:Clipperz.PM.Strings['changePasswordTabTitle']}, | 85 | {tag:'h5', htmlString:Clipperz.PM.Strings['changePasswordTabTitle']}, |
88 | {tag:'div', cls:'panelBody', id:'changePassphraseBlock', children:[ | 86 | {tag:'div', cls:'panelBody', id:'changePassphraseBlock', children:[ |
89 | {tag:'form', id:this.getId('changePassphraseForm'), children:[ | 87 | {tag:'form', id:this.getId('changePassphraseForm'), children:[ |
90 | {tag:'h5', cls:'errorMessage', id:this.getId('changePassphrase_errorMessage')}, | 88 | {tag:'h5', cls:'errorMessage', id:this.getId('changePassphrase_errorMessage')}, |
91 | {tag:'table', cls:'panelBody', children:[ | 89 | {tag:'table', cls:'panelBody', children:[ |
92 | {tag:'tr', children:[ | 90 | {tag:'tr', children:[ |
93 | {tag:'td', children:[ | 91 | {tag:'td', children:[ |
94 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormUsernameLabel']} | 92 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormUsernameLabel']} |
95 | ]}, | 93 | ]}, |
96 | {tag:'td', children:[ | 94 | {tag:'td', children:[ |
97 | {tag:'input', type:'text', name:'username', id:this.getId('changePassphrase_username')} | 95 | {tag:'input', type:'text', name:'username', id:this.getId('changePassphrase_username')} |
98 | ]} | 96 | ]} |
99 | ]}, | 97 | ]}, |
100 | {tag:'tr', children:[ | 98 | {tag:'tr', children:[ |
101 | {tag:'td', children:[ | 99 | {tag:'td', children:[ |
102 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormOldPassphraseLabel']} | 100 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormOldPassphraseLabel']} |
103 | ]}, | 101 | ]}, |
104 | {tag:'td', children:[ | 102 | {tag:'td', children:[ |
105 | {tag:'input', type:'password', name:'oldPassphrase', id:this.getId('changePassphrase_oldPassphrase')} | 103 | {tag:'input', type:'password', name:'oldPassphrase', id:this.getId('changePassphrase_oldPassphrase')} |
106 | ]} | 104 | ]} |
107 | ]}, | 105 | ]}, |
108 | {tag:'tr', children:[ | 106 | {tag:'tr', children:[ |
109 | {tag:'td', children:[ | 107 | {tag:'td', children:[ |
110 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormNewPassphraseLabel']} | 108 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormNewPassphraseLabel']} |
111 | ]}, | 109 | ]}, |
112 | {tag:'td', children:[ | 110 | {tag:'td', children:[ |
113 | {tag:'input', type:'password', name:'newPassphrase', id:this.getId('changePassphrase_newPassphrase')} | 111 | {tag:'input', type:'password', name:'newPassphrase', id:this.getId('changePassphrase_newPassphrase')} |
114 | ]} | 112 | ]} |
115 | ]}, | 113 | ]}, |
116 | {tag:'tr', children:[ | 114 | {tag:'tr', children:[ |
117 | {tag:'td', children:[ | 115 | {tag:'td', children:[ |
118 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormRetypePassphraseLabel']} | 116 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormRetypePassphraseLabel']} |
119 | ]}, | 117 | ]}, |
120 | {tag:'td', children:[ | 118 | {tag:'td', children:[ |
121 | {tag:'input', type:'password', name:'renewPassphrase', id:this.getId('changePassphrase_renewPassphrase')} | 119 | {tag:'input', type:'password', name:'renewPassphrase', id:this.getId('changePassphrase_renewPassphrase')} |
122 | ]} | 120 | ]} |
123 | ]}, | 121 | ]}, |
124 | {tag:'tr', children:[ | 122 | {tag:'tr', children:[ |
125 | {tag:'td', align:'right', children:[ | 123 | {tag:'td', align:'right', children:[ |
126 | {tag:'input', type:'checkbox', id:this.getId('changePassphrase_safetyCheck')} | 124 | {tag:'input', type:'checkbox', id:this.getId('changePassphrase_safetyCheck')} |
127 | ]}, | 125 | ]}, |
128 | {tag:'td', children:[ | 126 | {tag:'td', children:[ |
129 | {tag:'span', htmlString:Clipperz.PM.Strings['changePasswordFormSafetyCheckboxLabel']} | 127 | {tag:'span', htmlString:Clipperz.PM.Strings['changePasswordFormSafetyCheckboxLabel']} |
130 | ]} | 128 | ]} |
131 | ]} | 129 | ]} |
132 | ]}, | 130 | ]}, |
133 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ | 131 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ |
134 | {tag:'div', id:this.getId('changePassphraseButton')} | 132 | {tag:'div', id:this.getId('changePassphraseButton')} |
135 | ]} | 133 | ]} |
136 | ]} | 134 | ]} |
137 | ]} | 135 | ]} |
138 | ]} | 136 | ]} |
139 | ]}, | 137 | ]}, |
140 | {tag:'li', id:this.getId('manageOTPPanel'), children:[ | 138 | {tag:'li', id:this.getId('manageOTPPanel'), children:[ |
141 | {tag:'div', cls:'clipperzSubPanel', children:[ | 139 | {tag:'div', cls:'clipperzSubPanel', children:[ |
142 | {tag:'h5', htmlString:Clipperz.PM.Strings['manageOTPTabTitle']}, | 140 | {tag:'h5', htmlString:Clipperz.PM.Strings['manageOTPTabTitle']}, |
143 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['manageOTPTabDescription']}, | 141 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['manageOTPTabDescription']}, |
144 | {tag:'div', id:'OTPComponent'} | 142 | {tag:'div', id:'OTPComponent'} |
145 | ]} | 143 | ]} |
146 | ]}, | 144 | ]}, |
147 | {tag:'li', id:this.getId('accountPreferencesPanel'), children:[ | 145 | {tag:'li', id:this.getId('accountPreferencesPanel'), children:[ |
148 | {tag:'div', cls:'clipperzSubPanel', children:[ | 146 | {tag:'div', cls:'clipperzSubPanel', children:[ |
149 | {tag:'h5', htmlString:Clipperz.PM.Strings['accountPreferencesTabTitle']}, | 147 | {tag:'h5', htmlString:Clipperz.PM.Strings['accountPreferencesTabTitle']}, |
150 | {tag:'div', cls:'panelBody', id:this.getId('preferencesPanelBody')} | 148 | {tag:'div', cls:'panelBody', id:this.getId('preferencesPanelBody')} |
151 | ]} | 149 | ]} |
152 | ]}, | 150 | ]}, |
153 | {tag:'li', id:this.getId('loginHistoryAccountPanel'), children:[ | 151 | {tag:'li', id:this.getId('loginHistoryAccountPanel'), children:[ |
154 | {tag:'div', cls:'clipperzSubPanel', children:[ | 152 | {tag:'div', cls:'clipperzSubPanel', children:[ |
155 | {tag:'h5', htmlString:Clipperz.PM.Strings['loginHistoryTabTitle']}, | 153 | {tag:'h5', htmlString:Clipperz.PM.Strings['loginHistoryTabTitle']}, |
156 | {tag:'div', cls:'panelBody', id:'loginHistoryAccountBlock'} | 154 | {tag:'div', cls:'panelBody', id:'loginHistoryAccountBlock'} |
157 | ]} | 155 | ]} |
158 | ]}, | 156 | ]}, |
159 | {tag:'li', id:this.getId('deleteAccountPanel'), children:[ | 157 | {tag:'li', id:this.getId('deleteAccountPanel'), children:[ |
160 | {tag:'div', cls:'clipperzSubPanel', children:[ | 158 | {tag:'div', cls:'clipperzSubPanel', children:[ |
161 | {tag:'h5', htmlString:Clipperz.PM.Strings['deleteAccountTabTitle']}, | 159 | {tag:'h5', htmlString:Clipperz.PM.Strings['deleteAccountTabTitle']}, |
162 | 160 | ||
163 | {tag:'div', cls:'panelBody', id:'deleteAccountBlock', children:[ | 161 | {tag:'div', cls:'panelBody', id:'deleteAccountBlock', children:[ |
164 | {tag:'form', id:this.getId('deleteAccountForm'), children:[ | 162 | {tag:'form', id:this.getId('deleteAccountForm'), children:[ |
165 | {tag:'h5', cls:'errorMessage', id:this.getId('deleteAccount_errorMessage')}, | 163 | {tag:'h5', cls:'errorMessage', id:this.getId('deleteAccount_errorMessage')}, |
166 | {tag:'table', cls:'panelBody', children:[ | 164 | {tag:'table', cls:'panelBody', children:[ |
167 | {tag:'tr', children:[ | 165 | {tag:'tr', children:[ |
168 | {tag:'td', children:[ | 166 | {tag:'td', children:[ |
169 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormUsernameLabel']} | 167 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormUsernameLabel']} |
170 | ]}, | 168 | ]}, |
171 | {tag:'td', children:[ | 169 | {tag:'td', children:[ |
172 | {tag:'input', type:'text', name:'username', id:this.getId('deleteAccount_username')} | 170 | {tag:'input', type:'text', name:'username', id:this.getId('deleteAccount_username')} |
173 | ]} | 171 | ]} |
174 | ]}, | 172 | ]}, |
175 | {tag:'tr', children:[ | 173 | {tag:'tr', children:[ |
176 | {tag:'td', children:[ | 174 | {tag:'td', children:[ |
177 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormPassphraseLabel']} | 175 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormPassphraseLabel']} |
178 | ]}, | 176 | ]}, |
179 | {tag:'td', children:[ | 177 | {tag:'td', children:[ |
180 | {tag:'input', type:'password', name:'passphrase', id:this.getId('deleteAccount_passphrase')} | 178 | {tag:'input', type:'password', name:'passphrase', id:this.getId('deleteAccount_passphrase')} |
181 | ]} | 179 | ]} |
182 | ]}, | 180 | ]}, |
183 | {tag:'tr', children:[ | 181 | {tag:'tr', children:[ |
184 | {tag:'td', align:'right', children:[ | 182 | {tag:'td', align:'right', children:[ |
185 | {tag:'input', type:'checkbox', id:this.getId('deleteAccount_safetyCheck')} | 183 | {tag:'input', type:'checkbox', id:this.getId('deleteAccount_safetyCheck')} |
186 | ]}, | 184 | ]}, |
187 | {tag:'td', children:[ | 185 | {tag:'td', children:[ |
188 | {tag:'span', htmlString:Clipperz.PM.Strings['deleteAccountFormSafetyCheckboxLabel']} | 186 | {tag:'span', htmlString:Clipperz.PM.Strings['deleteAccountFormSafetyCheckboxLabel']} |
189 | ]} | 187 | ]} |
190 | ]} | 188 | ]} |
191 | ]}, | 189 | ]}, |
192 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ | 190 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ |
193 | {tag:'div', id:this.getId('deleteAccountButton')} | 191 | {tag:'div', id:this.getId('deleteAccountButton')} |
194 | ]} | 192 | ]} |
195 | ]} | 193 | ]} |
196 | ]} | 194 | ]} |
197 | ]} | 195 | ]} |
198 | ]} | 196 | ]} |
199 | /* | 197 | /* |
200 | {tag:'li', id:this.getId('paidAccountPanel'), children:[ | 198 | {tag:'li', id:this.getId('paidAccountPanel'), children:[ |
201 | {tag:'div', cls:'clipperzSubPanel', children:[ | 199 | {tag:'div', cls:'clipperzSubPanel', children:[ |
202 | {tag:'h5', htmlString:Clipperz.PM.Strings['upgradeAccountTabTitle']}, | 200 | {tag:'h5', htmlString:Clipperz.PM.Strings['upgradeAccountTabTitle']}, |
203 | {tag:'div', htmlString:Clipperz.PM.Strings['comingSoon']} | 201 | {tag:'div', htmlString:Clipperz.PM.Strings['comingSoon']} |
204 | ]} | 202 | ]} |
205 | ]} | 203 | ]} |
206 | */ | 204 | */ |
207 | ]} | 205 | ]} |
208 | ]} | 206 | ]} |
209 | ]} | 207 | ]} |
210 | ]} | 208 | ]} |
211 | ]}); | 209 | ]}); |
212 | 210 | ||
213 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 1"); | 211 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 1"); |
214 | MochiKit.Signal.connect(this.getId('changePassphraseForm'), 'onkeydown', this, 'onkeydown'); | 212 | MochiKit.Signal.connect(this.getId('changePassphraseForm'), 'onkeydown', this, 'onkeydown'); |