author | Michael Krelin <hacker@klever.net> | 2013-11-29 21:02:52 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2013-11-29 21:02:52 (UTC) |
commit | 603bcf8293434f4bb8c7435fa02a7fb435632d81 (patch) (unidiff) | |
tree | 669995150fa35aff97d9953a55f28da20c9373b2 | |
parent | 11a51653179a40dff1ecf13b9b4eb5e073920c04 (diff) | |
download | clipperz-603bcf8293434f4bb8c7435fa02a7fb435632d81.zip clipperz-603bcf8293434f4bb8c7435fa02a7fb435632d81.tar.gz clipperz-603bcf8293434f4bb8c7435fa02a7fb435632d81.tar.bz2 |
turn off autocompletion for change passphrase form
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js index defce91..a627adc 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js | |||
@@ -1,779 +1,779 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2013 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz, the online password manager. | 5 | This file is part of Clipperz, the online password manager. |
6 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
7 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
8 | 8 | ||
9 | * Clipperz is free software: you can redistribute it and/or modify it | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
10 | under the terms of the GNU Affero General Public License as published | 10 | under the terms of the GNU Affero General Public License as published |
11 | by the Free Software Foundation, either version 3 of the License, or | 11 | by the Free Software Foundation, either version 3 of the License, or |
12 | (at your option) any later version. | 12 | (at your option) any later version. |
13 | 13 | ||
14 | * Clipperz is distributed in the hope that it will be useful, but | 14 | * Clipperz is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
18 | 18 | ||
19 | * 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 |
20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
21 | 21 | ||
22 | */ | 22 | */ |
23 | 23 | ||
24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
26 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 26 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
27 | if (typeof(Clipperz.PM.Components.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } | 27 | if (typeof(Clipperz.PM.Components.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } |
28 | 28 | ||
29 | //############################################################################# | 29 | //############################################################################# |
30 | 30 | ||
31 | Clipperz.PM.Components.Panels.AccountPanel = function(anElement, args) { | 31 | Clipperz.PM.Components.Panels.AccountPanel = function(anElement, args) { |
32 | //MochiKit.Logging.logDebug(">>> new AccountPanel"); | 32 | //MochiKit.Logging.logDebug(">>> new AccountPanel"); |
33 | args = args || {}; | 33 | args = args || {}; |
34 | 34 | ||
35 | Clipperz.PM.Components.Panels.AccountPanel.superclass.constructor.call(this, anElement, args); | 35 | Clipperz.PM.Components.Panels.AccountPanel.superclass.constructor.call(this, anElement, args); |
36 | 36 | ||
37 | Clipperz.NotificationCenter.register(null, 'setupDone', this, 'render'); | 37 | Clipperz.NotificationCenter.register(null, 'setupDone', this, 'render'); |
38 | 38 | ||
39 | this._shouldLoadLoginHistory = true; | 39 | this._shouldLoadLoginHistory = true; |
40 | 40 | ||
41 | //this.render(); | 41 | //this.render(); |
42 | //MochiKit.Logging.logDebug("<<< new AccountPanel"); | 42 | //MochiKit.Logging.logDebug("<<< new AccountPanel"); |
43 | 43 | ||
44 | return this; | 44 | return this; |
45 | } | 45 | } |
46 | 46 | ||
47 | //============================================================================= | 47 | //============================================================================= |
48 | 48 | ||
49 | 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, { |
50 | 50 | ||
51 | 'toString': function() { | 51 | 'toString': function() { |
52 | return "Clipperz.PM.Components.AccountPanel component"; | 52 | return "Clipperz.PM.Components.AccountPanel component"; |
53 | }, | 53 | }, |
54 | 54 | ||
55 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
56 | 56 | ||
57 | 'render': function() { | 57 | 'render': function() { |
58 | var errorMessageActor; | 58 | var errorMessageActor; |
59 | varchangePasswordButton; | 59 | varchangePasswordButton; |
60 | var deleteAccountButton; | 60 | var deleteAccountButton; |
61 | 61 | ||
62 | try { | 62 | try { |
63 | //MochiKit.Logging.logDebug(">>> AccountPanel.render"); | 63 | //MochiKit.Logging.logDebug(">>> AccountPanel.render"); |
64 | Clipperz.NotificationCenter.unregister(this); | 64 | Clipperz.NotificationCenter.unregister(this); |
65 | MochiKit.Signal.disconnectAllTo(this); | 65 | MochiKit.Signal.disconnectAllTo(this); |
66 | 66 | ||
67 | this.element().update(""); | 67 | this.element().update(""); |
68 | 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:[ |
69 | {tag:'tbody', children:[ | 69 | {tag:'tbody', children:[ |
70 | {tag:'tr', children:[ | 70 | {tag:'tr', children:[ |
71 | {tag:'td', valign:'top', width:'200', children:[ | 71 | {tag:'td', valign:'top', width:'200', children:[ |
72 | {tag:'ul', id:"accountSubMenu", cls:'subMenu', children:[ | 72 | {tag:'ul', id:"accountSubMenu", cls:'subMenu', children:[ |
73 | {tag:'li', id:'changePassphraseTab', htmlString:Clipperz.PM.Strings['changePasswordTabLabel']}, | 73 | {tag:'li', id:'changePassphraseTab', htmlString:Clipperz.PM.Strings['changePasswordTabLabel']}, |
74 | {tag:'li', id:'manageOTPTab', htmlString:Clipperz.PM.Strings['manageOTPTabLabel']}, | 74 | {tag:'li', id:'manageOTPTab', htmlString:Clipperz.PM.Strings['manageOTPTabLabel']}, |
75 | {tag:'li', id:'accountPreferencesTab', htmlString:Clipperz.PM.Strings['accountPreferencesLabel']}, | 75 | {tag:'li', id:'accountPreferencesTab', htmlString:Clipperz.PM.Strings['accountPreferencesLabel']}, |
76 | {tag:'li', id:'loginHistoryTab', htmlString:Clipperz.PM.Strings['accountLoginHistoryLabel']}, | 76 | {tag:'li', id:'loginHistoryTab', htmlString:Clipperz.PM.Strings['accountLoginHistoryLabel']}, |
77 | {tag:'li', id:'deleteAccountTab', htmlString:Clipperz.PM.Strings['deleteAccountTabLabel']} | 77 | {tag:'li', id:'deleteAccountTab', htmlString:Clipperz.PM.Strings['deleteAccountTabLabel']} |
78 | // {tag:'li', id:'paidAccountTab'), htmlString:Clipperz.PM.Strings['paidAccountTabLabel']} | 78 | // {tag:'li', id:'paidAccountTab'), htmlString:Clipperz.PM.Strings['paidAccountTabLabel']} |
79 | ]} | 79 | ]} |
80 | ]}, | 80 | ]}, |
81 | {tag:'td', valign:'top', children:[ | 81 | {tag:'td', valign:'top', children:[ |
82 | {tag:'ul', cls:'clipperzTabPanels', children:[ | 82 | {tag:'ul', cls:'clipperzTabPanels', children:[ |
83 | {tag:'li', id:this.getId('changePassphrasePanel'), children:[ | 83 | {tag:'li', id:this.getId('changePassphrasePanel'), children:[ |
84 | {tag:'div', cls:'clipperzSubPanel', children:[ | 84 | {tag:'div', cls:'clipperzSubPanel', children:[ |
85 | {tag:'h5', htmlString:Clipperz.PM.Strings['changePasswordTabTitle']}, | 85 | {tag:'h5', htmlString:Clipperz.PM.Strings['changePasswordTabTitle']}, |
86 | {tag:'div', cls:'panelBody', id:'changePassphraseBlock', children:[ | 86 | {tag:'div', cls:'panelBody', id:'changePassphraseBlock', children:[ |
87 | {tag:'form', id:this.getId('changePassphraseForm'), children:[ | 87 | {tag:'form', id:this.getId('changePassphraseForm'), children:[ |
88 | {tag:'h5', cls:'errorMessage', id:this.getId('changePassphrase_errorMessage')}, | 88 | {tag:'h5', cls:'errorMessage', id:this.getId('changePassphrase_errorMessage')}, |
89 | {tag:'table', cls:'panelBody', children:[ | 89 | {tag:'table', cls:'panelBody', children:[ |
90 | {tag:'tr', children:[ | 90 | {tag:'tr', children:[ |
91 | {tag:'td', children:[ | 91 | {tag:'td', children:[ |
92 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormUsernameLabel']} | 92 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormUsernameLabel']} |
93 | ]}, | 93 | ]}, |
94 | {tag:'td', children:[ | 94 | {tag:'td', children:[ |
95 | {tag:'input', type:'text', name:'username', id:this.getId('changePassphrase_username')} | 95 | {tag:'input', type:'text', name:'username', id:this.getId('changePassphrase_username'), autocomplete:'off'} |
96 | ]} | 96 | ]} |
97 | ]}, | 97 | ]}, |
98 | {tag:'tr', children:[ | 98 | {tag:'tr', children:[ |
99 | {tag:'td', children:[ | 99 | {tag:'td', children:[ |
100 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormOldPassphraseLabel']} | 100 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormOldPassphraseLabel']} |
101 | ]}, | 101 | ]}, |
102 | {tag:'td', children:[ | 102 | {tag:'td', children:[ |
103 | {tag:'input', type:'password', name:'oldPassphrase', id:this.getId('changePassphrase_oldPassphrase')} | 103 | {tag:'input', type:'password', name:'oldPassphrase', id:this.getId('changePassphrase_oldPassphrase'), autocomplete:'off'} |
104 | ]} | 104 | ]} |
105 | ]}, | 105 | ]}, |
106 | {tag:'tr', children:[ | 106 | {tag:'tr', children:[ |
107 | {tag:'td', children:[ | 107 | {tag:'td', children:[ |
108 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormNewPassphraseLabel']} | 108 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormNewPassphraseLabel']} |
109 | ]}, | 109 | ]}, |
110 | {tag:'td', children:[ | 110 | {tag:'td', children:[ |
111 | {tag:'input', type:'password', name:'newPassphrase', id:this.getId('changePassphrase_newPassphrase')} | 111 | {tag:'input', type:'password', name:'newPassphrase', id:this.getId('changePassphrase_newPassphrase'), autocomplete:'off'} |
112 | ]} | 112 | ]} |
113 | ]}, | 113 | ]}, |
114 | {tag:'tr', children:[ | 114 | {tag:'tr', children:[ |
115 | {tag:'td', children:[ | 115 | {tag:'td', children:[ |
116 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormRetypePassphraseLabel']} | 116 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['changePasswordFormRetypePassphraseLabel']} |
117 | ]}, | 117 | ]}, |
118 | {tag:'td', children:[ | 118 | {tag:'td', children:[ |
119 | {tag:'input', type:'password', name:'renewPassphrase', id:this.getId('changePassphrase_renewPassphrase')} | 119 | {tag:'input', type:'password', name:'renewPassphrase', id:this.getId('changePassphrase_renewPassphrase'), autocomplete:'off'} |
120 | ]} | 120 | ]} |
121 | ]}, | 121 | ]}, |
122 | {tag:'tr', children:[ | 122 | {tag:'tr', children:[ |
123 | {tag:'td', align:'right', children:[ | 123 | {tag:'td', align:'right', children:[ |
124 | {tag:'input', type:'checkbox', id:this.getId('changePassphrase_safetyCheck')} | 124 | {tag:'input', type:'checkbox', id:this.getId('changePassphrase_safetyCheck')} |
125 | ]}, | 125 | ]}, |
126 | {tag:'td', children:[ | 126 | {tag:'td', children:[ |
127 | {tag:'span', htmlString:Clipperz.PM.Strings['changePasswordFormSafetyCheckboxLabel']} | 127 | {tag:'span', htmlString:Clipperz.PM.Strings['changePasswordFormSafetyCheckboxLabel']} |
128 | ]} | 128 | ]} |
129 | ]} | 129 | ]} |
130 | ]}, | 130 | ]}, |
131 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ | 131 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ |
132 | {tag:'div', id:this.getId('changePassphraseButton')} | 132 | {tag:'div', id:this.getId('changePassphraseButton')} |
133 | ]} | 133 | ]} |
134 | ]} | 134 | ]} |
135 | ]} | 135 | ]} |
136 | ]} | 136 | ]} |
137 | ]}, | 137 | ]}, |
138 | {tag:'li', id:this.getId('manageOTPPanel'), children:[ | 138 | {tag:'li', id:this.getId('manageOTPPanel'), children:[ |
139 | {tag:'div', cls:'clipperzSubPanel', children:[ | 139 | {tag:'div', cls:'clipperzSubPanel', children:[ |
140 | {tag:'h5', htmlString:Clipperz.PM.Strings['manageOTPTabTitle']}, | 140 | {tag:'h5', htmlString:Clipperz.PM.Strings['manageOTPTabTitle']}, |
141 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['manageOTPTabDescription']}, | 141 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['manageOTPTabDescription']}, |
142 | {tag:'div', id:'OTPComponent'} | 142 | {tag:'div', id:'OTPComponent'} |
143 | ]} | 143 | ]} |
144 | ]}, | 144 | ]}, |
145 | {tag:'li', id:this.getId('accountPreferencesPanel'), children:[ | 145 | {tag:'li', id:this.getId('accountPreferencesPanel'), children:[ |
146 | {tag:'div', cls:'clipperzSubPanel', children:[ | 146 | {tag:'div', cls:'clipperzSubPanel', children:[ |
147 | {tag:'h5', htmlString:Clipperz.PM.Strings['accountPreferencesTabTitle']}, | 147 | {tag:'h5', htmlString:Clipperz.PM.Strings['accountPreferencesTabTitle']}, |
148 | {tag:'div', cls:'panelBody', id:this.getId('preferencesPanelBody')} | 148 | {tag:'div', cls:'panelBody', id:this.getId('preferencesPanelBody')} |
149 | ]} | 149 | ]} |
150 | ]}, | 150 | ]}, |
151 | {tag:'li', id:this.getId('loginHistoryAccountPanel'), children:[ | 151 | {tag:'li', id:this.getId('loginHistoryAccountPanel'), children:[ |
152 | {tag:'div', cls:'clipperzSubPanel', children:[ | 152 | {tag:'div', cls:'clipperzSubPanel', children:[ |
153 | {tag:'h5', htmlString:Clipperz.PM.Strings['loginHistoryTabTitle']}, | 153 | {tag:'h5', htmlString:Clipperz.PM.Strings['loginHistoryTabTitle']}, |
154 | {tag:'div', cls:'panelBody', id:'loginHistoryAccountBlock'} | 154 | {tag:'div', cls:'panelBody', id:'loginHistoryAccountBlock'} |
155 | ]} | 155 | ]} |
156 | ]}, | 156 | ]}, |
157 | {tag:'li', id:this.getId('deleteAccountPanel'), children:[ | 157 | {tag:'li', id:this.getId('deleteAccountPanel'), children:[ |
158 | {tag:'div', cls:'clipperzSubPanel', children:[ | 158 | {tag:'div', cls:'clipperzSubPanel', children:[ |
159 | {tag:'h5', htmlString:Clipperz.PM.Strings['deleteAccountTabTitle']}, | 159 | {tag:'h5', htmlString:Clipperz.PM.Strings['deleteAccountTabTitle']}, |
160 | 160 | ||
161 | {tag:'div', cls:'panelBody', id:'deleteAccountBlock', children:[ | 161 | {tag:'div', cls:'panelBody', id:'deleteAccountBlock', children:[ |
162 | {tag:'form', id:this.getId('deleteAccountForm'), children:[ | 162 | {tag:'form', id:this.getId('deleteAccountForm'), children:[ |
163 | {tag:'h5', cls:'errorMessage', id:this.getId('deleteAccount_errorMessage')}, | 163 | {tag:'h5', cls:'errorMessage', id:this.getId('deleteAccount_errorMessage')}, |
164 | {tag:'table', cls:'panelBody', children:[ | 164 | {tag:'table', cls:'panelBody', children:[ |
165 | {tag:'tr', children:[ | 165 | {tag:'tr', children:[ |
166 | {tag:'td', children:[ | 166 | {tag:'td', children:[ |
167 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormUsernameLabel']} | 167 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormUsernameLabel']} |
168 | ]}, | 168 | ]}, |
169 | {tag:'td', children:[ | 169 | {tag:'td', children:[ |
170 | {tag:'input', type:'text', name:'username', id:this.getId('deleteAccount_username')} | 170 | {tag:'input', type:'text', name:'username', id:this.getId('deleteAccount_username')} |
171 | ]} | 171 | ]} |
172 | ]}, | 172 | ]}, |
173 | {tag:'tr', children:[ | 173 | {tag:'tr', children:[ |
174 | {tag:'td', children:[ | 174 | {tag:'td', children:[ |
175 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormPassphraseLabel']} | 175 | {tag:'span', cls:'formLabel', htmlString:Clipperz.PM.Strings['deleteAccountFormPassphraseLabel']} |
176 | ]}, | 176 | ]}, |
177 | {tag:'td', children:[ | 177 | {tag:'td', children:[ |
178 | {tag:'input', type:'password', name:'passphrase', id:this.getId('deleteAccount_passphrase')} | 178 | {tag:'input', type:'password', name:'passphrase', id:this.getId('deleteAccount_passphrase')} |
179 | ]} | 179 | ]} |
180 | ]}, | 180 | ]}, |
181 | {tag:'tr', children:[ | 181 | {tag:'tr', children:[ |
182 | {tag:'td', align:'right', children:[ | 182 | {tag:'td', align:'right', children:[ |
183 | {tag:'input', type:'checkbox', id:this.getId('deleteAccount_safetyCheck')} | 183 | {tag:'input', type:'checkbox', id:this.getId('deleteAccount_safetyCheck')} |
184 | ]}, | 184 | ]}, |
185 | {tag:'td', children:[ | 185 | {tag:'td', children:[ |
186 | {tag:'span', htmlString:Clipperz.PM.Strings['deleteAccountFormSafetyCheckboxLabel']} | 186 | {tag:'span', htmlString:Clipperz.PM.Strings['deleteAccountFormSafetyCheckboxLabel']} |
187 | ]} | 187 | ]} |
188 | ]} | 188 | ]} |
189 | ]}, | 189 | ]}, |
190 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ | 190 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ |
191 | {tag:'div', id:this.getId('deleteAccountButton')} | 191 | {tag:'div', id:this.getId('deleteAccountButton')} |
192 | ]} | 192 | ]} |
193 | ]} | 193 | ]} |
194 | ]} | 194 | ]} |
195 | ]} | 195 | ]} |
196 | ]} | 196 | ]} |
197 | /* | 197 | /* |
198 | {tag:'li', id:this.getId('paidAccountPanel'), children:[ | 198 | {tag:'li', id:this.getId('paidAccountPanel'), children:[ |
199 | {tag:'div', cls:'clipperzSubPanel', children:[ | 199 | {tag:'div', cls:'clipperzSubPanel', children:[ |
200 | {tag:'h5', htmlString:Clipperz.PM.Strings['upgradeAccountTabTitle']}, | 200 | {tag:'h5', htmlString:Clipperz.PM.Strings['upgradeAccountTabTitle']}, |
201 | {tag:'div', htmlString:Clipperz.PM.Strings['comingSoon']} | 201 | {tag:'div', htmlString:Clipperz.PM.Strings['comingSoon']} |
202 | ]} | 202 | ]} |
203 | ]} | 203 | ]} |
204 | */ | 204 | */ |
205 | ]} | 205 | ]} |
206 | ]} | 206 | ]} |
207 | ]} | 207 | ]} |
208 | ]} | 208 | ]} |
209 | ]}); | 209 | ]}); |
210 | 210 | ||
211 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 1"); | 211 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 1"); |
212 | MochiKit.Signal.connect(this.getId('changePassphraseForm'), 'onkeydown', this, 'onkeydown'); | 212 | MochiKit.Signal.connect(this.getId('changePassphraseForm'), 'onkeydown', this, 'onkeydown'); |
213 | errorMessageActor = this.getActor('changePassphrase_errorMessage'); | 213 | errorMessageActor = this.getActor('changePassphrase_errorMessage'); |
214 | errorMessageActor.setVisibilityMode(YAHOO.ext.Element.DISPLAY); | 214 | errorMessageActor.setVisibilityMode(YAHOO.ext.Element.DISPLAY); |
215 | errorMessageActor.update("---"); | 215 | errorMessageActor.update("---"); |
216 | errorMessageActor.hide(); | 216 | errorMessageActor.hide(); |
217 | changePasswordButton = new YAHOO.ext.Button(this.getDom('changePassphraseButton'), {text:Clipperz.PM.Strings['changePasswordFormSubmitLabel'], handler:this.doChangePassphrase, scope:this}); | 217 | changePasswordButton = new YAHOO.ext.Button(this.getDom('changePassphraseButton'), {text:Clipperz.PM.Strings['changePasswordFormSubmitLabel'], handler:this.doChangePassphrase, scope:this}); |
218 | 218 | ||
219 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 2"); | 219 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 2"); |
220 | 220 | ||
221 | MochiKit.Signal.connect(this.getId('deleteAccountForm'), 'onkeydown', this, 'onkeydown'); | 221 | MochiKit.Signal.connect(this.getId('deleteAccountForm'), 'onkeydown', this, 'onkeydown'); |
222 | errorMessageActor = this.getActor('deleteAccount_errorMessage'); | 222 | errorMessageActor = this.getActor('deleteAccount_errorMessage'); |
223 | errorMessageActor.setVisibilityMode(YAHOO.ext.Element.DISPLAY); | 223 | errorMessageActor.setVisibilityMode(YAHOO.ext.Element.DISPLAY); |
224 | errorMessageActor.update(Clipperz.PM.Strings['deleteAccountFormEmptyErrorMessage']); | 224 | errorMessageActor.update(Clipperz.PM.Strings['deleteAccountFormEmptyErrorMessage']); |
225 | errorMessageActor.hide(); | 225 | errorMessageActor.hide(); |
226 | deleteAccountButton = new YAHOO.ext.Button(this.getDom('deleteAccountButton'), {text:Clipperz.PM.Strings['deleteAccountFormSubmitLabel'], handler:this.doDeleteAccount, scope:this}); | 226 | deleteAccountButton = new YAHOO.ext.Button(this.getDom('deleteAccountButton'), {text:Clipperz.PM.Strings['deleteAccountFormSubmitLabel'], handler:this.doDeleteAccount, scope:this}); |
227 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 5"); | 227 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 5"); |
228 | 228 | ||
229 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { | 229 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { |
230 | this.getElement('changePassphraseForm').addClass('read-only'); | 230 | this.getElement('changePassphraseForm').addClass('read-only'); |
231 | // this.getElement('accountPreferencesForm').addClass('read-only'); | 231 | // this.getElement('accountPreferencesForm').addClass('read-only'); |
232 | this.getElement('deleteAccountForm').addClass('read-only'); | 232 | this.getElement('deleteAccountForm').addClass('read-only'); |
233 | changePasswordButton.disable(); | 233 | changePasswordButton.disable(); |
234 | deleteAccountButton.disable(); | 234 | deleteAccountButton.disable(); |
235 | } | 235 | } |
236 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 6"); | 236 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 6"); |
237 | 237 | ||
238 | new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('changePassphrase_oldPassphrase')); | 238 | new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('changePassphrase_oldPassphrase')); |
239 | new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('changePassphrase_newPassphrase')); | 239 | new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('changePassphrase_newPassphrase')); |
240 | 240 | ||
241 | new Clipperz.PM.Components.OTP.MainComponent(YAHOO.ext.Element.get('OTPComponent'), {user:this.user()}); | 241 | new Clipperz.PM.Components.OTP.MainComponent(YAHOO.ext.Element.get('OTPComponent'), {user:this.user()}); |
242 | 242 | ||
243 | this.tabPanelController().setUp(); | 243 | this.tabPanelController().setUp(); |
244 | Clipperz.NotificationCenter.register(null, 'tabSelected', this, 'tabSelectedHandler'); | 244 | Clipperz.NotificationCenter.register(null, 'tabSelected', this, 'tabSelectedHandler'); |
245 | Clipperz.NotificationCenter.register(null, 'updatedPreferences', this, 'renderPreferences'); | 245 | Clipperz.NotificationCenter.register(null, 'updatedPreferences', this, 'renderPreferences'); |
246 | Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); | 246 | Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); |
247 | //MochiKit.Logging.logDebug("<<< AccountPanel.render"); | 247 | //MochiKit.Logging.logDebug("<<< AccountPanel.render"); |
248 | 248 | ||
249 | } catch(exception) { | 249 | } catch(exception) { |
250 | MochiKit.Logging.logError("### " + exception); | 250 | MochiKit.Logging.logError("### " + exception); |
251 | throw exception; | 251 | throw exception; |
252 | } | 252 | } |
253 | }, | 253 | }, |
254 | 254 | ||
255 | //------------------------------------------------------------------------- | 255 | //------------------------------------------------------------------------- |
256 | 256 | ||
257 | 'tabPanelController': function() { | 257 | 'tabPanelController': function() { |
258 | if (this._tabPanelController == null) { | 258 | if (this._tabPanelController == null) { |
259 | var tabPanelControllerConfig; | 259 | var tabPanelControllerConfig; |
260 | 260 | ||
261 | tabPanelControllerConfig = {} | 261 | tabPanelControllerConfig = {} |
262 | tabPanelControllerConfig['changePassphraseTab'] = this.getId('changePassphrasePanel'); | 262 | tabPanelControllerConfig['changePassphraseTab'] = this.getId('changePassphrasePanel'); |
263 | tabPanelControllerConfig['manageOTPTab'] = this.getId('manageOTPPanel'); | 263 | tabPanelControllerConfig['manageOTPTab'] = this.getId('manageOTPPanel'); |
264 | tabPanelControllerConfig['accountPreferencesTab'] = this.getId('accountPreferencesPanel'); | 264 | tabPanelControllerConfig['accountPreferencesTab'] = this.getId('accountPreferencesPanel'); |
265 | tabPanelControllerConfig['loginHistoryTab'] = this.getId('loginHistoryAccountPanel'); | 265 | tabPanelControllerConfig['loginHistoryTab'] = this.getId('loginHistoryAccountPanel'); |
266 | tabPanelControllerConfig['deleteAccountTab'] = this.getId('deleteAccountPanel'); | 266 | tabPanelControllerConfig['deleteAccountTab'] = this.getId('deleteAccountPanel'); |
267 | // tabPanelControllerConfig['paidAccountTab'] = this.getId('paidAccountPanel'); | 267 | // tabPanelControllerConfig['paidAccountTab'] = this.getId('paidAccountPanel'); |
268 | 268 | ||
269 | this._tabPanelController = new Clipperz.PM.Components.TabPanel.TabPanelController({ | 269 | this._tabPanelController = new Clipperz.PM.Components.TabPanel.TabPanelController({ |
270 | name:'accountTabPanel', | 270 | name:'accountTabPanel', |
271 | config:tabPanelControllerConfig, | 271 | config:tabPanelControllerConfig, |
272 | selectedTab:'changePassphraseTab' | 272 | selectedTab:'changePassphraseTab' |
273 | }); | 273 | }); |
274 | } | 274 | } |
275 | 275 | ||
276 | return this._tabPanelController; | 276 | return this._tabPanelController; |
277 | }, | 277 | }, |
278 | 278 | ||
279 | //------------------------------------------------------------------------- | 279 | //------------------------------------------------------------------------- |
280 | 280 | ||
281 | 'doChangePassphrase': function() { | 281 | 'doChangePassphrase': function() { |
282 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly() == false) { | 282 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly() == false) { |
283 | varusername; | 283 | varusername; |
284 | varoldPassphrase; | 284 | varoldPassphrase; |
285 | var newPassphrase; | 285 | var newPassphrase; |
286 | var renewPassphrase; | 286 | var renewPassphrase; |
287 | var safetyCheck; | 287 | var safetyCheck; |
288 | varareThereAnyErrors; | 288 | varareThereAnyErrors; |
289 | var errorMessageActor; | 289 | var errorMessageActor; |
290 | 290 | ||
291 | errorMessageActor = this.getActor('changePassphrase_errorMessage'); | 291 | errorMessageActor = this.getActor('changePassphrase_errorMessage'); |
292 | 292 | ||
293 | areThereAnyErrors = false; | 293 | areThereAnyErrors = false; |
294 | username = this.getDom('changePassphrase_username').value; | 294 | username = this.getDom('changePassphrase_username').value; |
295 | oldPassphrase= this.getDom('changePassphrase_oldPassphrase').value; | 295 | oldPassphrase= this.getDom('changePassphrase_oldPassphrase').value; |
296 | newPassphrase= this.getDom('changePassphrase_newPassphrase').value; | 296 | newPassphrase= this.getDom('changePassphrase_newPassphrase').value; |
297 | renewPassphrase= this.getDom('changePassphrase_renewPassphrase').value; | 297 | renewPassphrase= this.getDom('changePassphrase_renewPassphrase').value; |
298 | safetyCheck = this.getDom('changePassphrase_safetyCheck').checked; | 298 | safetyCheck = this.getDom('changePassphrase_safetyCheck').checked; |
299 | 299 | ||
300 | if (this.user().username() != username) { | 300 | if (this.user().username() != username) { |
301 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['changePasswordFormWrongUsernameWarning']); | 301 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['changePasswordFormWrongUsernameWarning']); |
302 | this.getElement('changePassphrase_username').focus().dom.select(); | 302 | this.getElement('changePassphrase_username').focus().dom.select(); |
303 | areThereAnyErrors = true; | 303 | areThereAnyErrors = true; |
304 | } else if (this.user().passphrase() != oldPassphrase) { | 304 | } else if (this.user().passphrase() != oldPassphrase) { |
305 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['changePasswordFormWrongPassphraseWarning']); | 305 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['changePasswordFormWrongPassphraseWarning']); |
306 | this.getElement('changePassphrase_oldPassphrase').focus().dom.select(); | 306 | this.getElement('changePassphrase_oldPassphrase').focus().dom.select(); |
307 | areThereAnyErrors = true; | 307 | areThereAnyErrors = true; |
308 | } else if (newPassphrase != renewPassphrase) { | 308 | } else if (newPassphrase != renewPassphrase) { |
309 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['changePasswordFormWrongRetypePassphraseWarning']); | 309 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['changePasswordFormWrongRetypePassphraseWarning']); |
310 | this.getElement('changePassphrase_renewPassphrase').focus().dom.select(); | 310 | this.getElement('changePassphrase_renewPassphrase').focus().dom.select(); |
311 | areThereAnyErrors = true; | 311 | areThereAnyErrors = true; |
312 | } else if (safetyCheck != true) { | 312 | } else if (safetyCheck != true) { |
313 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['changePasswordFormSafetyCheckWarning']); | 313 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['changePasswordFormSafetyCheckWarning']); |
314 | this.getElement('changePassphrase_safetyCheck').focus(); | 314 | this.getElement('changePassphrase_safetyCheck').focus(); |
315 | areThereAnyErrors = true; | 315 | areThereAnyErrors = true; |
316 | } | 316 | } |
317 | 317 | ||
318 | if (areThereAnyErrors == false) { | 318 | if (areThereAnyErrors == false) { |
319 | errorMessageActor.hide(); | 319 | errorMessageActor.hide(); |
320 | this.doChangePassphraseWithUsernameAndPassphrase(username, newPassphrase); | 320 | this.doChangePassphraseWithUsernameAndPassphrase(username, newPassphrase); |
321 | } | 321 | } |
322 | } | 322 | } |
323 | }, | 323 | }, |
324 | 324 | ||
325 | //------------------------------------------------------------------------- | 325 | //------------------------------------------------------------------------- |
326 | 326 | ||
327 | 'doChangePassphraseWithUsernameAndPassphrase': function(anUsername, aPassphrase) { | 327 | 'doChangePassphraseWithUsernameAndPassphrase': function(anUsername, aPassphrase) { |
328 | var deferredResult; | 328 | var deferredResult; |
329 | 329 | ||
330 | //MochiKit.Logging.logDebug(">>> AccountPanel.doChangePassphraseWithUsernameAndPassphrase - this.user: " + this.user()); | 330 | //MochiKit.Logging.logDebug(">>> AccountPanel.doChangePassphraseWithUsernameAndPassphrase - this.user: " + this.user()); |
331 | deferredResult = new MochiKit.Async.Deferred(); | 331 | deferredResult = new MochiKit.Async.Deferred(); |
332 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 1: " + res); return res;}); | 332 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 1: " + res); return res;}); |
333 | deferredResult.addCallback(MochiKit.Base.method(Clipperz.PM.Components.MessageBox(), 'deferredShow'), | 333 | deferredResult.addCallback(MochiKit.Base.method(Clipperz.PM.Components.MessageBox(), 'deferredShow'), |
334 | { | 334 | { |
335 | title:Clipperz.PM.Strings['changePasswordFormProgressDialogTitle'], | 335 | title:Clipperz.PM.Strings['changePasswordFormProgressDialogTitle'], |
336 | text:Clipperz.PM.Strings['changePasswordFormProgressDialogEmptyText'], | 336 | text:Clipperz.PM.Strings['changePasswordFormProgressDialogEmptyText'], |
337 | width:240, | 337 | width:240, |
338 | showProgressBar:true, | 338 | showProgressBar:true, |
339 | showCloseButton:false, | 339 | showCloseButton:false, |
340 | steps:4 | 340 | steps:4 |
341 | }, | 341 | }, |
342 | this.getDom('changePassphraseButton') | 342 | this.getDom('changePassphraseButton') |
343 | ); | 343 | ); |
344 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 2: " + res); return res;}); | 344 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 2: " + res); return res;}); |
345 | deferredResult.addCallback(MochiKit.Base.method(this.user(), 'changeCredentials'), anUsername, aPassphrase); | 345 | deferredResult.addCallback(MochiKit.Base.method(this.user(), 'changeCredentials'), anUsername, aPassphrase); |
346 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 3: " + res); return res;}); | 346 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 3: " + res); return res;}); |
347 | deferredResult.addCallback(function() { | 347 | deferredResult.addCallback(function() { |
348 | Clipperz.PM.Components.MessageBox().update({ | 348 | Clipperz.PM.Components.MessageBox().update({ |
349 | title:Clipperz.PM.Strings['changePasswordFormProgressDialogConnectedMessageTitle'], | 349 | title:Clipperz.PM.Strings['changePasswordFormProgressDialogConnectedMessageTitle'], |
350 | text:Clipperz.PM.Strings['changePasswordFormProgressDialogConnectedMessageText'], | 350 | text:Clipperz.PM.Strings['changePasswordFormProgressDialogConnectedMessageText'], |
351 | /*showProgressBar:false,*/ | 351 | /*showProgressBar:false,*/ |
352 | step:'next' | 352 | step:'next' |
353 | }); | 353 | }); |
354 | }); | 354 | }); |
355 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 4: " + res); return res;}); | 355 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 4: " + res); return res;}); |
356 | deferredResult.addCallback(MochiKit.Async.wait, 1); | 356 | deferredResult.addCallback(MochiKit.Async.wait, 1); |
357 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 5: " + res); return res;}); | 357 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 5: " + res); return res;}); |
358 | deferredResult.addCallback(function(anAccountPanel, res) { | 358 | deferredResult.addCallback(function(anAccountPanel, res) { |
359 | Clipperz.PM.Components.MessageBox().hide(YAHOO.ext.Element.get('main')); | 359 | Clipperz.PM.Components.MessageBox().hide(YAHOO.ext.Element.get('main')); |
360 | 360 | ||
361 | anAccountPanel.getDom('changePassphrase_username').value = ""; | 361 | anAccountPanel.getDom('changePassphrase_username').value = ""; |
362 | anAccountPanel.getDom('changePassphrase_oldPassphrase').value = ""; | 362 | anAccountPanel.getDom('changePassphrase_oldPassphrase').value = ""; |
363 | anAccountPanel.getElement('changePassphrase_oldPassphrase').focus(); | 363 | anAccountPanel.getElement('changePassphrase_oldPassphrase').focus(); |
364 | anAccountPanel.getDom('changePassphrase_newPassphrase').value = ""; | 364 | anAccountPanel.getDom('changePassphrase_newPassphrase').value = ""; |
365 | anAccountPanel.getElement('changePassphrase_newPassphrase').focus(); | 365 | anAccountPanel.getElement('changePassphrase_newPassphrase').focus(); |
366 | anAccountPanel.getDom('changePassphrase_renewPassphrase').value = ""; | 366 | anAccountPanel.getDom('changePassphrase_renewPassphrase').value = ""; |
367 | anAccountPanel.getDom('changePassphrase_safetyCheck').checked = false; | 367 | anAccountPanel.getDom('changePassphrase_safetyCheck').checked = false; |
368 | 368 | ||
369 | anAccountPanel.getElement('changePassphrase_username').focus(); | 369 | anAccountPanel.getElement('changePassphrase_username').focus(); |
370 | return res; | 370 | return res; |
371 | }, this); | 371 | }, this); |
372 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 6: " + res); return res;}); | 372 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 6: " + res); return res;}); |
373 | deferredResult.addErrback(function() { | 373 | deferredResult.addErrback(function() { |
374 | Clipperz.PM.Components.MessageBox().update({ | 374 | Clipperz.PM.Components.MessageBox().update({ |
375 | title:Clipperz.PM.Strings['changePasswordFormProgressDialogErrorMessageTitle'], | 375 | title:Clipperz.PM.Strings['changePasswordFormProgressDialogErrorMessageTitle'], |
376 | text:Clipperz.PM.Strings['changePasswordFormProgressDialogErrorMessageText'], | 376 | text:Clipperz.PM.Strings['changePasswordFormProgressDialogErrorMessageText'], |
377 | buttons:{'ok':"close"} | 377 | buttons:{'ok':"close"} |
378 | }); | 378 | }); |
379 | }); | 379 | }); |
380 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 7: " + res); return res;}); | 380 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug(" AccountPanel.doChangePassphraseWithUsernameAndPassphrase 7: " + res); return res;}); |
381 | deferredResult.callback(); | 381 | deferredResult.callback(); |
382 | 382 | ||
383 | //MochiKit.Logging.logDebug("<<< AccountPanel.doChangePassphraseWithUsernameAndPassphrase"); | 383 | //MochiKit.Logging.logDebug("<<< AccountPanel.doChangePassphraseWithUsernameAndPassphrase"); |
384 | }, | 384 | }, |
385 | 385 | ||
386 | //------------------------------------------------------------------------- | 386 | //------------------------------------------------------------------------- |
387 | 387 | ||
388 | 'doDeleteAccount': function() { | 388 | 'doDeleteAccount': function() { |
389 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly() == false) { | 389 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly() == false) { |
390 | varusername; | 390 | varusername; |
391 | varpassphrase; | 391 | varpassphrase; |
392 | var safetyCheck; | 392 | var safetyCheck; |
393 | varareThereAnyErrors; | 393 | varareThereAnyErrors; |
394 | var errorMessageActor; | 394 | var errorMessageActor; |
395 | 395 | ||
396 | errorMessageActor = this.getActor('deleteAccount_errorMessage'); | 396 | errorMessageActor = this.getActor('deleteAccount_errorMessage'); |
397 | 397 | ||
398 | areThereAnyErrors = false; | 398 | areThereAnyErrors = false; |
399 | username = this.getDom('deleteAccount_username').value; | 399 | username = this.getDom('deleteAccount_username').value; |
400 | passphrase= this.getDom('deleteAccount_passphrase').value; | 400 | passphrase= this.getDom('deleteAccount_passphrase').value; |
401 | safetyCheck = this.getDom('deleteAccount_safetyCheck').checked; | 401 | safetyCheck = this.getDom('deleteAccount_safetyCheck').checked; |
402 | 402 | ||
403 | if (this.user().username() != username) { | 403 | if (this.user().username() != username) { |
404 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['deleteAccountFormWrongUsernameWarning']); | 404 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['deleteAccountFormWrongUsernameWarning']); |
405 | this.getElement('deleteAccount_username').focus().dom.select(); | 405 | this.getElement('deleteAccount_username').focus().dom.select(); |
406 | areThereAnyErrors = true; | 406 | areThereAnyErrors = true; |
407 | } else if (this.user().passphrase() != passphrase) { | 407 | } else if (this.user().passphrase() != passphrase) { |
408 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['deleteAccountFormWrongPassphraseWarning']); | 408 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['deleteAccountFormWrongPassphraseWarning']); |
409 | this.getElement('deleteAccount_passphrase').focus().dom.select(); | 409 | this.getElement('deleteAccount_passphrase').focus().dom.select(); |
410 | areThereAnyErrors = true; | 410 | areThereAnyErrors = true; |
411 | } else if (safetyCheck != true) { | 411 | } else if (safetyCheck != true) { |
412 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['deleteAccountFormSafetyCheckWarning']); | 412 | this.showFormErrorMessageAnimation(errorMessageActor, Clipperz.PM.Strings['deleteAccountFormSafetyCheckWarning']); |
413 | this.getElement('deleteAccount_safetyCheck').focus(); | 413 | this.getElement('deleteAccount_safetyCheck').focus(); |
414 | areThereAnyErrors = true; | 414 | areThereAnyErrors = true; |
415 | } | 415 | } |
416 | 416 | ||
417 | if (areThereAnyErrors == false) { | 417 | if (areThereAnyErrors == false) { |
418 | var deferred; | 418 | var deferred; |
419 | 419 | ||
420 | deferred = new MochiKit.Async.Deferred(); | 420 | deferred = new MochiKit.Async.Deferred(); |
421 | errorMessageActor.hide(); | 421 | errorMessageActor.hide(); |
422 | 422 | ||
423 | deferred.addCallback(function() { | 423 | deferred.addCallback(function() { |
424 | var deferredResult; | 424 | var deferredResult; |
425 | 425 | ||
426 | //TODO: if the form is submitted with the return key, the confirmation dialog is skipped!? | 426 | //TODO: if the form is submitted with the return key, the confirmation dialog is skipped!? |
427 | deferredResult = new MochiKit.Async.Deferred(); | 427 | deferredResult = new MochiKit.Async.Deferred(); |
428 | Clipperz.PM.Components.MessageBox().deferredShow({ | 428 | Clipperz.PM.Components.MessageBox().deferredShow({ |
429 | title:Clipperz.PM.Strings['accountPanelDeletingAccountPanelConfirmationTitle'], | 429 | title:Clipperz.PM.Strings['accountPanelDeletingAccountPanelConfirmationTitle'], |
430 | text:Clipperz.PM.Strings['accountPanelDeleteAccountPanelConfirmationText'], | 430 | text:Clipperz.PM.Strings['accountPanelDeleteAccountPanelConfirmationText'], |
431 | width:240, | 431 | width:240, |
432 | showProgressBar:false, | 432 | showProgressBar:false, |
433 | showCloseButton:false, | 433 | showCloseButton:false, |
434 | buttons:{ | 434 | buttons:{ |
435 | 'yes':Clipperz.PM.Strings['accountPanelDeleteAccountPanelConfirmButtonLabel'], | 435 | 'yes':Clipperz.PM.Strings['accountPanelDeleteAccountPanelConfirmButtonLabel'], |
436 | 'no':Clipperz.PM.Strings['accountPanelDeleteAccountPanelDenyButtonLabel'] | 436 | 'no':Clipperz.PM.Strings['accountPanelDeleteAccountPanelDenyButtonLabel'] |
437 | }, | 437 | }, |
438 | fn:MochiKit.Base.partial(function(aDeferred, aResult) { | 438 | fn:MochiKit.Base.partial(function(aDeferred, aResult) { |
439 | if (aResult == 'yes') { | 439 | if (aResult == 'yes') { |
440 | aDeferred.callback(aResult); | 440 | aDeferred.callback(aResult); |
441 | } else { | 441 | } else { |
442 | aDeferred.errback(aResult); | 442 | aDeferred.errback(aResult); |
443 | } | 443 | } |
444 | }, deferredResult) | 444 | }, deferredResult) |
445 | }); | 445 | }); |
446 | 446 | ||
447 | return deferredResult; | 447 | return deferredResult; |
448 | }); | 448 | }); |
449 | deferred.addCallback(MochiKit.Base.method(Clipperz.PM.Components.MessageBox(), 'deferredShow'), | 449 | deferred.addCallback(MochiKit.Base.method(Clipperz.PM.Components.MessageBox(), 'deferredShow'), |
450 | { | 450 | { |
451 | title:Clipperz.PM.Strings['accountPanelDeletingAccountPanelProgressTitle'], | 451 | title:Clipperz.PM.Strings['accountPanelDeletingAccountPanelProgressTitle'], |
452 | text:Clipperz.PM.Strings['accountPanelDeletingAccountPanelProgressText'], | 452 | text:Clipperz.PM.Strings['accountPanelDeletingAccountPanelProgressText'], |
453 | width:240, | 453 | width:240, |
454 | showProgressBar:true, | 454 | showProgressBar:true, |
455 | showCloseButton:false | 455 | showCloseButton:false |
456 | } | 456 | } |
457 | ); | 457 | ); |
458 | deferred.addCallback(MochiKit.Base.method(this.user(), 'deleteAccountAction')); | 458 | deferred.addCallback(MochiKit.Base.method(this.user(), 'deleteAccountAction')); |
459 | deferred.addCallback(Clipperz.PM.exit, 'accountDeleted.html'); | 459 | deferred.addCallback(Clipperz.PM.exit, 'accountDeleted.html'); |
460 | deferred.addErrback(function(res) { | 460 | deferred.addErrback(function(res) { |
461 | alert(res); | 461 | alert(res); |
462 | }) | 462 | }) |
463 | deferred.callback(); | 463 | deferred.callback(); |
464 | } | 464 | } |
465 | } | 465 | } |
466 | }, | 466 | }, |
467 | 467 | ||
468 | //------------------------------------------------------------------------- | 468 | //------------------------------------------------------------------------- |
469 | 469 | ||
470 | 'showFormErrorMessageAnimation': function(anActor, anErrorMessage, aCallback) { | 470 | 'showFormErrorMessageAnimation': function(anActor, anErrorMessage, aCallback) { |
471 | anActor.update(anErrorMessage); | 471 | anActor.update(anErrorMessage); |
472 | anActor.show(true); | 472 | anActor.show(true); |
473 | anActor.play(aCallback); | 473 | anActor.play(aCallback); |
474 | }, | 474 | }, |
475 | 475 | ||
476 | //------------------------------------------------------------------------- | 476 | //------------------------------------------------------------------------- |
477 | 477 | ||
478 | 'onkeydown': function(anEvent) { | 478 | 'onkeydown': function(anEvent) { |
479 | //MochiKit.Logging.logDebug(">>> onkeydown - " + anEvent.src().id); | 479 | //MochiKit.Logging.logDebug(">>> onkeydown - " + anEvent.src().id); |
480 | if (anEvent.key().code == 13) { | 480 | if (anEvent.key().code == 13) { |
481 | anEvent.stop(); | 481 | anEvent.stop(); |
482 | 482 | ||
483 | if (anEvent.src() == this.getDom('changePassphraseForm')) { | 483 | if (anEvent.src() == this.getDom('changePassphraseForm')) { |
484 | this.doChangePassphrase(); | 484 | this.doChangePassphrase(); |
485 | } else if (anEvent.src() == this.getDom('deleteAccountForm')) { | 485 | } else if (anEvent.src() == this.getDom('deleteAccountForm')) { |
486 | this.doDeleteAccount(); | 486 | this.doDeleteAccount(); |
487 | } else { | 487 | } else { |
488 | } | 488 | } |
489 | 489 | ||
490 | } | 490 | } |
491 | }, | 491 | }, |
492 | 492 | ||
493 | //------------------------------------------------------------------------- | 493 | //------------------------------------------------------------------------- |
494 | 494 | ||
495 | 'selectSelectedLanguageOption': function() { | 495 | 'selectSelectedLanguageOption': function() { |
496 | varuserSelectedLanguage; | 496 | varuserSelectedLanguage; |
497 | 497 | ||
498 | userSelectedLanguage = this.user().preferences().preferredLanguage() || "default"; | 498 | userSelectedLanguage = this.user().preferences().preferredLanguage() || "default"; |
499 | MochiKit.Base.filter(function(anOption) {return (anOption.value == userSelectedLanguage)}, this.getDom('languageSelector').childNodes)[0].selected = true; | 499 | MochiKit.Base.filter(function(anOption) {return (anOption.value == userSelectedLanguage)}, this.getDom('languageSelector').childNodes)[0].selected = true; |
500 | }, | 500 | }, |
501 | 501 | ||
502 | //------------------------------------------------------------------------- | 502 | //------------------------------------------------------------------------- |
503 | 503 | ||
504 | 'doSaveUserPreferences': function() { | 504 | 'doSaveUserPreferences': function() { |
505 | var selectedLanguage; | 505 | var selectedLanguage; |
506 | var showDonationReminderDialog; | 506 | var showDonationReminderDialog; |
507 | // var disableUnsecureFaviconLoadingForIE; | 507 | // var disableUnsecureFaviconLoadingForIE; |
508 | 508 | ||
509 | //MochiKit.Logging.logDebug(">>> AccountPanel.doSaveUserPreferences"); | 509 | //MochiKit.Logging.logDebug(">>> AccountPanel.doSaveUserPreferences"); |
510 | selectedLanguage = this.getDom('languageSelector').value; | 510 | selectedLanguage = this.getDom('languageSelector').value; |
511 | if (selectedLanguage == "default") { | 511 | if (selectedLanguage == "default") { |
512 | selectedLanguage = null; | 512 | selectedLanguage = null; |
513 | } | 513 | } |
514 | this.user().preferences().setPreferredLanguage(selectedLanguage); | 514 | this.user().preferences().setPreferredLanguage(selectedLanguage); |
515 | 515 | ||
516 | showDonationReminderDialog = this.getDom('showDonationReminderCheckbox').checked; | 516 | showDonationReminderDialog = this.getDom('showDonationReminderCheckbox').checked; |
517 | this.user().preferences().setShouldShowDonationPanel(showDonationReminderDialog); | 517 | this.user().preferences().setShouldShowDonationPanel(showDonationReminderDialog); |
518 | 518 | ||
519 | // disableUnsecureFaviconLoadingForIE = this.getDom('disableFaviconForIECheckbox').checked; | 519 | // disableUnsecureFaviconLoadingForIE = this.getDom('disableFaviconForIECheckbox').checked; |
520 | // this.user().preferences().setDisableUnsecureFaviconLoadingForIE(disableUnsecureFaviconLoadingForIE); | 520 | // this.user().preferences().setDisableUnsecureFaviconLoadingForIE(disableUnsecureFaviconLoadingForIE); |
521 | 521 | ||
522 | this.user().preferences().saveChanges(this.getDom('saveUserPreferences')); | 522 | this.user().preferences().saveChanges(this.getDom('saveUserPreferences')); |
523 | }, | 523 | }, |
524 | 524 | ||
525 | 'doCancelUserPreferences': function() { | 525 | 'doCancelUserPreferences': function() { |
526 | this.renderPreferences(); | 526 | this.renderPreferences(); |
527 | }, | 527 | }, |
528 | 528 | ||
529 | //'switchLanguage': function(anEvent) { | 529 | //'switchLanguage': function(anEvent) { |
530 | // Clipperz.PM.Strings.Languages.setSelectedLanguage(anEvent.src().value); | 530 | // Clipperz.PM.Strings.Languages.setSelectedLanguage(anEvent.src().value); |
531 | //}, | 531 | //}, |
532 | 532 | ||
533 | //------------------------------------------------------------------------- | 533 | //------------------------------------------------------------------------- |
534 | 534 | ||
535 | 'renderLoginHistory': function() { | 535 | 'renderLoginHistory': function() { |
536 | var element; | 536 | var element; |
537 | 537 | ||
538 | //MochiKit.Logging.logDebug(">>> AccountPanel.renderLoginHistory"); | 538 | //MochiKit.Logging.logDebug(">>> AccountPanel.renderLoginHistory"); |
539 | element = YAHOO.ext.Element.get('loginHistoryAccountBlock'); | 539 | element = YAHOO.ext.Element.get('loginHistoryAccountBlock'); |
540 | 540 | ||
541 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { | 541 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { |
542 | element.update(""); | 542 | element.update(""); |
543 | this.domHelper().append(element, {tag:'div', cls:'loginHistoryReadOnlyMessage', htmlString:Clipperz.PM.Strings['loginHistoryReadOnlyMessage']}); | 543 | this.domHelper().append(element, {tag:'div', cls:'loginHistoryReadOnlyMessage', htmlString:Clipperz.PM.Strings['loginHistoryReadOnlyMessage']}); |
544 | } else { | 544 | } else { |
545 | var deferredResult; | 545 | var deferredResult; |
546 | 546 | ||
547 | deferredResult = new MochiKit.Async.Deferred(); | 547 | deferredResult = new MochiKit.Async.Deferred(); |
548 | deferredResult.addCallback(MochiKit.Base.bind(function(anElement) { | 548 | deferredResult.addCallback(MochiKit.Base.bind(function(anElement) { |
549 | anElement.update(""); | 549 | anElement.update(""); |
550 | Clipperz.YUI.DomHelper.append(anElement, {tag:'div', cls:'loadingMessage', htmlString:Clipperz.PM.Strings['loginHistoryLoadingMessage']}); | 550 | Clipperz.YUI.DomHelper.append(anElement, {tag:'div', cls:'loadingMessage', htmlString:Clipperz.PM.Strings['loginHistoryLoadingMessage']}); |
551 | }, this), element); | 551 | }, this), element); |
552 | deferredResult.addCallback(MochiKit.Base.method(this.user(), 'loadLoginHistory')); | 552 | deferredResult.addCallback(MochiKit.Base.method(this.user(), 'loadLoginHistory')); |
553 | deferredResult.addCallback(MochiKit.Base.bind(function(anElement, aResult) { | 553 | deferredResult.addCallback(MochiKit.Base.bind(function(anElement, aResult) { |
554 | var loginListItems; | 554 | var loginListItems; |
555 | var tBodyElement; | 555 | var tBodyElement; |
556 | var imageExtension; | 556 | var imageExtension; |
557 | var now; | 557 | var now; |
558 | var i, c; | 558 | var i, c; |
559 | 559 | ||
560 | loginListItems = aResult; | 560 | loginListItems = aResult; |
561 | //MochiKit.Logging.logDebug("=== loginListItems: " + Clipperz.Base.serializeJSON(loginListItems)); | 561 | //MochiKit.Logging.logDebug("=== loginListItems: " + Clipperz.Base.serializeJSON(loginListItems)); |
562 | imageExtension = (Clipperz_IEisBroken == true) ? 'gif': 'png'; | 562 | imageExtension = (Clipperz_IEisBroken == true) ? 'gif': 'png'; |
563 | 563 | ||
564 | now = new Date(); | 564 | now = new Date(); |
565 | anElement.update(""); | 565 | anElement.update(""); |
566 | Clipperz.YUI.DomHelper.append(anElement, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['loginHistoryLoadedMessage']}); | 566 | Clipperz.YUI.DomHelper.append(anElement, {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['loginHistoryLoadedMessage']}); |
567 | Clipperz.YUI.DomHelper.append(anElement, {tag:'table', id:'loginHistoryTable', cellspacing:'0', cellpadding:'2', border:'0', children:[ | 567 | Clipperz.YUI.DomHelper.append(anElement, {tag:'table', id:'loginHistoryTable', cellspacing:'0', cellpadding:'2', border:'0', children:[ |
568 | {tag:'tbody', id:this.getId('loginHistoryTBody'), children:[]} | 568 | {tag:'tbody', id:this.getId('loginHistoryTBody'), children:[]} |
569 | ]}); | 569 | ]}); |
570 | //# Clipperz.YUI.DomHelper.append(anElement, {tag:'div', id:'loginHistoryFooter', children:[ | 570 | //# Clipperz.YUI.DomHelper.append(anElement, {tag:'div', id:'loginHistoryFooter', children:[ |
571 | Clipperz.YUI.DomHelper.append(anElement, {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ | 571 | Clipperz.YUI.DomHelper.append(anElement, {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ |
572 | {tag:'div', id:this.getId('reloadHistoryButton')} | 572 | {tag:'div', id:this.getId('reloadHistoryButton')} |
573 | ]}); | 573 | ]}); |
574 | 574 | ||
575 | new YAHOO.ext.Button(this.getDom('reloadHistoryButton'), {text:Clipperz.PM.Strings['loginHistoryReloadButtonLabel'], handler:this.reloadHistory, scope:this}); | 575 | new YAHOO.ext.Button(this.getDom('reloadHistoryButton'), {text:Clipperz.PM.Strings['loginHistoryReloadButtonLabel'], handler:this.reloadHistory, scope:this}); |
576 | 576 | ||
577 | tBodyElement = this.getElement('loginHistoryTBody'); | 577 | tBodyElement = this.getElement('loginHistoryTBody'); |
578 | c = loginListItems.length; | 578 | c = loginListItems.length; |
579 | for (i=0; i<c; i++) { | 579 | for (i=0; i<c; i++) { |
580 | var ip; | 580 | var ip; |
581 | var date; | 581 | var date; |
582 | var mainText; | 582 | var mainText; |
583 | 583 | ||
584 | date = Clipperz.PM.Date.parseDateWithUTCFormat(loginListItems[i]['date']); | 584 | date = Clipperz.PM.Date.parseDateWithUTCFormat(loginListItems[i]['date']); |
585 | 585 | ||
586 | if (loginListItems[i]['isCurrent'] === true) { | 586 | if (loginListItems[i]['isCurrent'] === true) { |
587 | mainText ={tag:'div', cls:'currentSession', htmlString:Clipperz.PM.Strings['loginHistoryCurrentSessionText']} | 587 | mainText ={tag:'div', cls:'currentSession', htmlString:Clipperz.PM.Strings['loginHistoryCurrentSessionText']} |
588 | } else { | 588 | } else { |
589 | mainText = {tag:'div', cls:'elapsedTime', html:Clipperz.PM.Date.getElapsedTimeDescription(date)} | 589 | mainText = {tag:'div', cls:'elapsedTime', html:Clipperz.PM.Date.getElapsedTimeDescription(date)} |
590 | } | 590 | } |
591 | 591 | ||
592 | if (loginListItems[i]['connectionType'] == "ONE_TIME_PASSPHRASE") { | 592 | if (loginListItems[i]['connectionType'] == "ONE_TIME_PASSPHRASE") { |
593 | optionalInfo = [ | 593 | optionalInfo = [ |
594 | {tag:'span', html:"OTP"} | 594 | {tag:'span', html:"OTP"} |
595 | ]; | 595 | ]; |
596 | } else { | 596 | } else { |
597 | optionalInfo = []; | 597 | optionalInfo = []; |
598 | } | 598 | } |
599 | 599 | ||
600 | ip = (loginListItems[i]['ip'].match(/^\d{1,3}(.\d{1,3}){3}$/)) ? loginListItems[i]['ip'] : Clipperz.PM.Strings['unknown_ip']; | 600 | ip = (loginListItems[i]['ip'].match(/^\d{1,3}(.\d{1,3}){3}$/)) ? loginListItems[i]['ip'] : Clipperz.PM.Strings['unknown_ip']; |
601 | Clipperz.YUI.DomHelper.append(tBodyElement, {tag:'tr', children:[ | 601 | Clipperz.YUI.DomHelper.append(tBodyElement, {tag:'tr', children:[ |
602 | {tag:'td', cls:'loginHistoryValues', valign:'top', children:[ | 602 | {tag:'td', cls:'loginHistoryValues', valign:'top', children:[ |
603 | mainText, | 603 | mainText, |
604 | {tag:'div', cls:'fullDate', html:Clipperz.PM.Date.formatDateWithTemplate(date, Clipperz.PM.Strings['fullDate_format'])}, | 604 | {tag:'div', cls:'fullDate', html:Clipperz.PM.Date.formatDateWithTemplate(date, Clipperz.PM.Strings['fullDate_format'])}, |
605 | {tag:'div', cls:'loginHistoryIP', children:[ | 605 | {tag:'div', cls:'loginHistoryIP', children:[ |
606 | {tag:'span', cls:'loginHistoryIPLabel', htmlString:Clipperz.PM.Strings['loginHistoryIPLabel']}, | 606 | {tag:'span', cls:'loginHistoryIPLabel', htmlString:Clipperz.PM.Strings['loginHistoryIPLabel']}, |
607 | {tag:'span', cls:'loginHistoryIPValue', html:ip} | 607 | {tag:'span', cls:'loginHistoryIPValue', html:ip} |
608 | ]} | 608 | ]} |
609 | ]}, | 609 | ]}, |
610 | {tag:'td', cls:'loginHistoryCountry', valign:'top', children:optionalInfo}, | 610 | {tag:'td', cls:'loginHistoryCountry', valign:'top', children:optionalInfo}, |
611 | {tag:'td', cls:'loginHistoryCountry', valign:'top', align:'center', children:[ | 611 | {tag:'td', cls:'loginHistoryCountry', valign:'top', align:'center', children:[ |
612 | {tag:'img', title:Clipperz.PM.Strings['countries'][loginListItems[i]['country']], cls:'flag', src:Clipperz.PM.Strings['icons_baseUrl'] + "/flags/" + loginListItems[i]['country'].toLowerCase() + "." + imageExtension, width:'32', height:'32'} | 612 | {tag:'img', title:Clipperz.PM.Strings['countries'][loginListItems[i]['country']], cls:'flag', src:Clipperz.PM.Strings['icons_baseUrl'] + "/flags/" + loginListItems[i]['country'].toLowerCase() + "." + imageExtension, width:'32', height:'32'} |
613 | // {tag:'span', cls:'label', htmlString:Clipperz.PM.Strings['countries'][loginListItems[i]['country']]} | 613 | // {tag:'span', cls:'label', htmlString:Clipperz.PM.Strings['countries'][loginListItems[i]['country']]} |
614 | ]}, | 614 | ]}, |
615 | {tag:'td', cls:'loginHistoryBrowser', valign:'top', align:'center', children:[ | 615 | {tag:'td', cls:'loginHistoryBrowser', valign:'top', align:'center', children:[ |
616 | {tag:'img', title:Clipperz.PM.Strings['browsers'][loginListItems[i]['browser']], cls:'browser', src:Clipperz.PM.Strings['icons_baseUrl'] + "/browsers/" + loginListItems[i]['browser'].toLowerCase() + "." + imageExtension, width:'32', height:'32'} | 616 | {tag:'img', title:Clipperz.PM.Strings['browsers'][loginListItems[i]['browser']], cls:'browser', src:Clipperz.PM.Strings['icons_baseUrl'] + "/browsers/" + loginListItems[i]['browser'].toLowerCase() + "." + imageExtension, width:'32', height:'32'} |
617 | // {tag:'span', cls:'label', htmlString:Clipperz.PM.Strings['browsers'][loginListItems[i]['browser']]} | 617 | // {tag:'span', cls:'label', htmlString:Clipperz.PM.Strings['browsers'][loginListItems[i]['browser']]} |
618 | ]}, | 618 | ]}, |
619 | {tag:'td', cls:'loginHistoryOperatingSystem', valign:'top', align:'center', children:[ | 619 | {tag:'td', cls:'loginHistoryOperatingSystem', valign:'top', align:'center', children:[ |
620 | {tag:'img', title:Clipperz.PM.Strings['operatingSystems'][loginListItems[i]['operatingSystem']], cls:'operatingSystem', src:Clipperz.PM.Strings['icons_baseUrl'] + "/operatingSystems/" + loginListItems[i]['operatingSystem'].toLowerCase() + "." + imageExtension, width:'32', height:'32'} | 620 | {tag:'img', title:Clipperz.PM.Strings['operatingSystems'][loginListItems[i]['operatingSystem']], cls:'operatingSystem', src:Clipperz.PM.Strings['icons_baseUrl'] + "/operatingSystems/" + loginListItems[i]['operatingSystem'].toLowerCase() + "." + imageExtension, width:'32', height:'32'} |
621 | // {tag:'span', cls:'label', htmlString:Clipperz.PM.Strings['operatingSystems'][loginListItems[i]['operatingSystem']]} | 621 | // {tag:'span', cls:'label', htmlString:Clipperz.PM.Strings['operatingSystems'][loginListItems[i]['operatingSystem']]} |
622 | ]} | 622 | ]} |
623 | ]}); | 623 | ]}); |
624 | } | 624 | } |
625 | 625 | ||
626 | Clipperz.Style.applyZebraStylesToTable('loginHistoryTable'); | 626 | Clipperz.Style.applyZebraStylesToTable('loginHistoryTable'); |
627 | }, this), element); | 627 | }, this), element); |
628 | 628 | ||
629 | deferredResult.callback(); | 629 | deferredResult.callback(); |
630 | } | 630 | } |
631 | //MochiKit.Logging.logDebug("<<< AccountPanel.renderLoginHistory"); | 631 | //MochiKit.Logging.logDebug("<<< AccountPanel.renderLoginHistory"); |
632 | }, | 632 | }, |
633 | 633 | ||
634 | //------------------------------------------------------------------------- | 634 | //------------------------------------------------------------------------- |
635 | 635 | ||
636 | 'renderPreferences': function() { | 636 | 'renderPreferences': function() { |
637 | var saveUserPreferencesButton; | 637 | var saveUserPreferencesButton; |
638 | var cancelUserPreferencesButton; | 638 | var cancelUserPreferencesButton; |
639 | var preferencedPanelBodyElement; | 639 | var preferencedPanelBodyElement; |
640 | 640 | ||
641 | preferencedPanelBodyElement = this.getElement('preferencesPanelBody'); | 641 | preferencedPanelBodyElement = this.getElement('preferencesPanelBody'); |
642 | 642 | ||
643 | preferencedPanelBodyElement.update(""); | 643 | preferencedPanelBodyElement.update(""); |
644 | Clipperz.YUI.DomHelper.append(preferencedPanelBodyElement, | 644 | Clipperz.YUI.DomHelper.append(preferencedPanelBodyElement, |
645 | {tag:'form', id:this.getId('accountPreferencesForm'), children:[ | 645 | {tag:'form', id:this.getId('accountPreferencesForm'), children:[ |
646 | {tag:'table', cls:'panelBody', children:[ | 646 | {tag:'table', cls:'panelBody', children:[ |
647 | {tag:'tr', cls:'openPreferenceBlock', children:[ | 647 | {tag:'tr', cls:'openPreferenceBlock', children:[ |
648 | {tag:'td', children:[ | 648 | {tag:'td', children:[ |
649 | {tag:'div', cls:'preferenceBlockTitle', htmlString:Clipperz.PM.Strings['accountPreferencesLanguageTitle']}, | 649 | {tag:'div', cls:'preferenceBlockTitle', htmlString:Clipperz.PM.Strings['accountPreferencesLanguageTitle']}, |
650 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['accountPreferencesLanguageDescription']}, | 650 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['accountPreferencesLanguageDescription']}, |
651 | {tag:'div', cls:'panelDescription', children:[ | 651 | {tag:'div', cls:'panelDescription', children:[ |
652 | {tag:'select', | 652 | {tag:'select', |
653 | id:this.getId('languageSelector'), | 653 | id:this.getId('languageSelector'), |
654 | children:MochiKit.Base.concat([{tag:'option', value:"default", html:"---"}], Clipperz.PM.Strings['loginPanelSwitchLanguageSelectOptions']) | 654 | children:MochiKit.Base.concat([{tag:'option', value:"default", html:"---"}], Clipperz.PM.Strings['loginPanelSwitchLanguageSelectOptions']) |
655 | } | 655 | } |
656 | ]} | 656 | ]} |
657 | ]} | 657 | ]} |
658 | ]}, | 658 | ]}, |
659 | {tag:'tr', cls:'openPreferenceBlock', children:[ | 659 | {tag:'tr', cls:'openPreferenceBlock', children:[ |
660 | {tag:'td', children:[ | 660 | {tag:'td', children:[ |
661 | {tag:'div', cls:'preferenceBlockTitle', htmlString:Clipperz.PM.Strings['showDonationReminderPanelTitle']}, | 661 | {tag:'div', cls:'preferenceBlockTitle', htmlString:Clipperz.PM.Strings['showDonationReminderPanelTitle']}, |
662 | {tag:'table', cellpadding:'0', cellspacing:'0', children:[ | 662 | {tag:'table', cellpadding:'0', cellspacing:'0', children:[ |
663 | {tag:'tbody', children:[ | 663 | {tag:'tbody', children:[ |
664 | {tag:'tr', children:[ | 664 | {tag:'tr', children:[ |
665 | {tag:'td', valign:'top', children:[ | 665 | {tag:'td', valign:'top', children:[ |
666 | {tag:'div', cls:'panelDescription', children:[ | 666 | {tag:'div', cls:'panelDescription', children:[ |
667 | {tag:'input', type:'checkbox', id:this.getId('showDonationReminderCheckbox')} | 667 | {tag:'input', type:'checkbox', id:this.getId('showDonationReminderCheckbox')} |
668 | ]} | 668 | ]} |
669 | ]}, | 669 | ]}, |
670 | {tag:'td', valign:'top', children:[ | 670 | {tag:'td', valign:'top', children:[ |
671 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['showDonationReminderPanelDescription']} | 671 | {tag:'div', cls:'panelDescription', htmlString:Clipperz.PM.Strings['showDonationReminderPanelDescription']} |
672 | ]} | 672 | ]} |
673 | ]} | 673 | ]} |
674 | ]} | 674 | ]} |
675 | ]} | 675 | ]} |
676 | ]} | 676 | ]} |
677 | ]}//, | 677 | ]}//, |
678 | /* | 678 | /* |
679 | {tag:'tr', cls:'openPreferenceBlock', children:[ | 679 | {tag:'tr', cls:'openPreferenceBlock', children:[ |
680 | {tag:'td', children:[ | 680 | {tag:'td', children:[ |
681 | {tag:'div', cls:'preferenceBlockTitle', htmlString:Clipperz.PM.Strings['disableFaviconForIETitle']}, | 681 | {tag:'div', cls:'preferenceBlockTitle', htmlString:Clipperz.PM.Strings['disableFaviconForIETitle']}, |
682 | {tag:'table', cellpadding:'0', cellspacing:'0', children:[ | 682 | {tag:'table', cellpadding:'0', cellspacing:'0', children:[ |
683 | {tag:'tbody', children:[ | 683 | {tag:'tbody', children:[ |
684 | {tag:'tr', children:[ | 684 | {tag:'tr', children:[ |
685 | {tag:'td', valign:'top', children:[ | 685 | {tag:'td', valign:'top', children:[ |
686 | {tag:'div', cls:'panelDescription', children:[ | 686 | {tag:'div', cls:'panelDescription', children:[ |
687 | {tag:'input', type:'checkbox', id:this.getId('disableFaviconForIECheckbox')} | 687 | {tag:'input', type:'checkbox', id:this.getId('disableFaviconForIECheckbox')} |
688 | ]} | 688 | ]} |
689 | ]}, | 689 | ]}, |
690 | {tag:'td', valign:'top', children:[ | 690 | {tag:'td', valign:'top', children:[ |
691 | {tag:'div', cls:'panelDescription', children:Clipperz.PM.Strings['disableFaviconForIEDescriptionConfig']} | 691 | {tag:'div', cls:'panelDescription', children:Clipperz.PM.Strings['disableFaviconForIEDescriptionConfig']} |
692 | ]} | 692 | ]} |
693 | ]} | 693 | ]} |
694 | ]} | 694 | ]} |
695 | ]} | 695 | ]} |
696 | ]} | 696 | ]} |
697 | ]}, | 697 | ]}, |
698 | */ | 698 | */ |
699 | // {tag:'tr', cls:'openPreferenceBlock', children:[ | 699 | // {tag:'tr', cls:'openPreferenceBlock', children:[ |
700 | // {tag:'td', children:[ | 700 | // {tag:'td', children:[ |
701 | // {tag:'div', cls:'preferenceBlockTitle', htmlString:Clipperz.PM.Strings['accountPreferencesInterfaceTitle']}, | 701 | // {tag:'div', cls:'preferenceBlockTitle', htmlString:Clipperz.PM.Strings['accountPreferencesInterfaceTitle']}, |
702 | // {tag:'div', cls:'panelDescription', children:Clipperz.PM.Strings['accountPreferencesInterfaceDescriptionConfig']} | 702 | // {tag:'div', cls:'panelDescription', children:Clipperz.PM.Strings['accountPreferencesInterfaceDescriptionConfig']} |
703 | // ]} | 703 | // ]} |
704 | // ]} | 704 | // ]} |
705 | ]}, | 705 | ]}, |
706 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ | 706 | {tag:'div', cls:'clipperzSubPanelButtonBox', children:[ |
707 | {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ | 707 | {tag:'table', border:'0', cellspacing:'0', cellpadding:'0', children:[ |
708 | {tag:'tbody', children:[ | 708 | {tag:'tbody', children:[ |
709 | {tag:'tr', children:[ | 709 | {tag:'tr', children:[ |
710 | {tag:'td', width:'100', align:'right', cls:'newRecordPanelButtonTD', children:[ | 710 | {tag:'td', width:'100', align:'right', cls:'newRecordPanelButtonTD', children:[ |
711 | {tag:'div', id:this.getId('saveUserPreferences')} | 711 | {tag:'div', id:this.getId('saveUserPreferences')} |
712 | ]}, | 712 | ]}, |
713 | {tag:'td', width:'10', html:" "}, | 713 | {tag:'td', width:'10', html:" "}, |
714 | {tag:'td', cls:'newRecordPanelButtonTD', children:[ | 714 | {tag:'td', cls:'newRecordPanelButtonTD', children:[ |
715 | {tag:'div', id:this.getId('cancelUserPreferences')} | 715 | {tag:'div', id:this.getId('cancelUserPreferences')} |
716 | ]} | 716 | ]} |
717 | ]} | 717 | ]} |
718 | ]} | 718 | ]} |
719 | ]} | 719 | ]} |
720 | ]} | 720 | ]} |
721 | ]} | 721 | ]} |
722 | ); | 722 | ); |
723 | 723 | ||
724 | this.selectSelectedLanguageOption(); | 724 | this.selectSelectedLanguageOption(); |
725 | if (this.user().preferences().shouldShowDonationPanel()) { | 725 | if (this.user().preferences().shouldShowDonationPanel()) { |
726 | this.getDom('showDonationReminderCheckbox').checked = true; | 726 | this.getDom('showDonationReminderCheckbox').checked = true; |
727 | } | 727 | } |
728 | // if (this.user().preferences().disableUnsecureFaviconLoadingForIE()) { | 728 | // if (this.user().preferences().disableUnsecureFaviconLoadingForIE()) { |
729 | // this.getDom('disableFaviconForIECheckbox').checked = true; | 729 | // this.getDom('disableFaviconForIECheckbox').checked = true; |
730 | // } | 730 | // } |
731 | 731 | ||
732 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 3"); | 732 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 3"); |
733 | //# saveUserPreferencesButton = new YAHOO.ext.Button(this.getDom('saveUserPreferences'), {text:Clipperz.PM.Strings['saveUserPreferencesFormSubmitLabel'], handler:this.doSaveUserPreferences, scope:this}); | 733 | //# saveUserPreferencesButton = new YAHOO.ext.Button(this.getDom('saveUserPreferences'), {text:Clipperz.PM.Strings['saveUserPreferencesFormSubmitLabel'], handler:this.doSaveUserPreferences, scope:this}); |
734 | saveUserPreferencesButton = new YAHOO.ext.Button(this.getDom('saveUserPreferences'), {text:'-----------------', handler:this.doSaveUserPreferences, scope:this}); | 734 | saveUserPreferencesButton = new YAHOO.ext.Button(this.getDom('saveUserPreferences'), {text:'-----------------', handler:this.doSaveUserPreferences, scope:this}); |
735 | saveUserPreferencesButton.setText(Clipperz.PM.Strings['saveUserPreferencesFormSubmitLabel']); | 735 | saveUserPreferencesButton.setText(Clipperz.PM.Strings['saveUserPreferencesFormSubmitLabel']); |
736 | //# cancelUserPreferencesButton = new YAHOO.ext.Button(this.getDom('cancelUserPreferences'), {text:Clipperz.PM.Strings['cancelUserPreferencesFormSubmitLabel'], handler:this.doCancelUserPreferences, scope:this}); | 736 | //# cancelUserPreferencesButton = new YAHOO.ext.Button(this.getDom('cancelUserPreferences'), {text:Clipperz.PM.Strings['cancelUserPreferencesFormSubmitLabel'], handler:this.doCancelUserPreferences, scope:this}); |
737 | cancelUserPreferencesButton = new YAHOO.ext.Button(this.getDom('cancelUserPreferences'), {text:'-----------------', handler:this.doCancelUserPreferences, scope:this}); | 737 | cancelUserPreferencesButton = new YAHOO.ext.Button(this.getDom('cancelUserPreferences'), {text:'-----------------', handler:this.doCancelUserPreferences, scope:this}); |
738 | cancelUserPreferencesButton.setText(Clipperz.PM.Strings['cancelUserPreferencesFormSubmitLabel']); | 738 | cancelUserPreferencesButton.setText(Clipperz.PM.Strings['cancelUserPreferencesFormSubmitLabel']); |
739 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 4"); | 739 | //MochiKit.Logging.logDebug("--- AccountPanel.render - 4"); |
740 | 740 | ||
741 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { | 741 | if (Clipperz.PM.Proxy.defaultProxy.isReadOnly()) { |
742 | this.getElement('accountPreferencesForm').addClass('read-only'); | 742 | this.getElement('accountPreferencesForm').addClass('read-only'); |
743 | saveUserPreferencesButton.disable(); | 743 | saveUserPreferencesButton.disable(); |
744 | cancelUserPreferencesButton.disable(); | 744 | cancelUserPreferencesButton.disable(); |
745 | } | 745 | } |
746 | 746 | ||
747 | }, | 747 | }, |
748 | 748 | ||
749 | //------------------------------------------------------------------------- | 749 | //------------------------------------------------------------------------- |
750 | 750 | ||
751 | 'reloadHistory': function() { | 751 | 'reloadHistory': function() { |
752 | this.setShouldLoadLoginHistory(true); | 752 | this.setShouldLoadLoginHistory(true); |
753 | this.renderLoginHistory(); | 753 | this.renderLoginHistory(); |
754 | }, | 754 | }, |
755 | 755 | ||
756 | 'shouldLoadLoginHistory': function() { | 756 | 'shouldLoadLoginHistory': function() { |
757 | return this._shouldLoadLoginHistory; | 757 | return this._shouldLoadLoginHistory; |
758 | }, | 758 | }, |
759 | 759 | ||
760 | 'setShouldLoadLoginHistory': function(aValue) { | 760 | 'setShouldLoadLoginHistory': function(aValue) { |
761 | this._shouldLoadLoginHistory = aValue; | 761 | this._shouldLoadLoginHistory = aValue; |
762 | }, | 762 | }, |
763 | 763 | ||
764 | 'tabSelectedHandler': function(anEvent) { | 764 | 'tabSelectedHandler': function(anEvent) { |
765 | if (anEvent.parameters() == 'accountPreferencesTab') { | 765 | if (anEvent.parameters() == 'accountPreferencesTab') { |
766 | this.renderPreferences(); | 766 | this.renderPreferences(); |
767 | } | 767 | } |
768 | 768 | ||
769 | if ((this.shouldLoadLoginHistory()) && (anEvent.parameters() == 'loginHistoryTab')) { | 769 | if ((this.shouldLoadLoginHistory()) && (anEvent.parameters() == 'loginHistoryTab')) { |
770 | this.renderLoginHistory(); | 770 | this.renderLoginHistory(); |
771 | this.setShouldLoadLoginHistory(false); | 771 | this.setShouldLoadLoginHistory(false); |
772 | } | 772 | } |
773 | }, | 773 | }, |
774 | 774 | ||
775 | //------------------------------------------------------------------------- | 775 | //------------------------------------------------------------------------- |
776 | __syntaxFix__: "syntax fix" | 776 | __syntaxFix__: "syntax fix" |
777 | 777 | ||
778 | }); | 778 | }); |
779 | 779 | ||