summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/PM') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/PM/Components/Panels/AccountPanel.js8
-rw-r--r--frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.js12
2 files changed, 10 insertions, 10 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,215 +1,215 @@
1/* 1/*
2 2
3Copyright 2008-2013 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz, the online password manager. 5This file is part of Clipperz, the online password manager.
6For further information about its features and functionalities please 6For further information about its features and functionalities please
7refer to http://www.clipperz.com. 7refer 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
24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 25if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
26if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } 26if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; }
27if (typeof(Clipperz.PM.Components.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; } 27if (typeof(Clipperz.PM.Components.Panels) == 'undefined') { Clipperz.PM.Components.Panels = {}; }
28 28
29//############################################################################# 29//#############################################################################
30 30
31Clipperz.PM.Components.Panels.AccountPanel = function(anElement, args) { 31Clipperz.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
49YAHOO.extendX(Clipperz.PM.Components.Panels.AccountPanel, Clipperz.PM.Components.Panels.BasePanel, { 49YAHOO.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
62try { 62try {
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("---");
diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.js
index f2c70aa..a8117d7 100644
--- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.js
+++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/FieldValueComponent.js
@@ -44,227 +44,227 @@ Clipperz.PM.Components.RecordDetail.FieldValueComponent = function(anElement, ar
44//============================================================================= 44//=============================================================================
45 45
46YAHOO.extendX(Clipperz.PM.Components.RecordDetail.FieldValueComponent, Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent, { 46YAHOO.extendX(Clipperz.PM.Components.RecordDetail.FieldValueComponent, Clipperz.PM.Components.RecordDetail.AbstractFieldSubComponent, {
47 47
48 'toString': function() { 48 'toString': function() {
49 return "Clipperz.PM.Components.RecordDetail.FieldValueComponent component"; 49 return "Clipperz.PM.Components.RecordDetail.FieldValueComponent component";
50 }, 50 },
51 51
52 //------------------------------------------------------------------------- 52 //-------------------------------------------------------------------------
53 53
54 'value': function() { 54 'value': function() {
55 return this.recordField().value(); 55 return this.recordField().value();
56 }, 56 },
57 57
58 'setValue': function(aValue) { 58 'setValue': function(aValue) {
59 this.recordField().setValue(aValue); 59 this.recordField().setValue(aValue);
60 }, 60 },
61 61
62 //------------------------------------------------------------------------- 62 //-------------------------------------------------------------------------
63 63
64 'inputElement': function() { 64 'inputElement': function() {
65 return this._inputElement; 65 return this._inputElement;
66 }, 66 },
67 67
68 'setInputElement': function(aValue) { 68 'setInputElement': function(aValue) {
69 this._inputElement = aValue; 69 this._inputElement = aValue;
70 }, 70 },
71 71
72 //------------------------------------------------------------------------- 72 //-------------------------------------------------------------------------
73 73
74 'scrambledStatus': function() { 74 'scrambledStatus': function() {
75 return this._scrambledStatus; 75 return this._scrambledStatus;
76 }, 76 },
77 77
78 'setScrambledStatus': function(aValue) { 78 'setScrambledStatus': function(aValue) {
79 this._scrambledStatus = aValue; 79 this._scrambledStatus = aValue;
80 }, 80 },
81 81
82 //------------------------------------------------------------------------- 82 //-------------------------------------------------------------------------
83 83
84 'handleTypeChange': function() { 84 'handleTypeChange': function() {
85//MochiKit.Logging.logDebug(">>> handling type change - " + this.recordField().type()); 85//MochiKit.Logging.logDebug(">>> handling type change - " + this.recordField().type());
86 this.synchronizeComponentValues(); 86 this.synchronizeComponentValues();
87 this.update(); 87 this.update();
88 }, 88 },
89 89
90 //------------------------------------------------------------------------- 90 //-------------------------------------------------------------------------
91 91
92 'addrUrl': function() { 92 'addrUrl': function() {
93 var result; 93 var result;
94 94
95 result = "http://maps.google.com/maps?q=" + this.value().split(' ').join('+'); 95 result = "http://maps.google.com/maps?q=" + this.value().split(' ').join('+');
96 96
97 return result; 97 return result;
98 }, 98 },
99 99
100 //------------------------------------------------------------------------- 100 //-------------------------------------------------------------------------
101 101
102 'updateViewMode': function() { 102 'updateViewMode': function() {
103 var scarmbledStatus; 103 var scarmbledStatus;
104 104
105 scrambledStatus = this.scrambledStatus() || 'SCRAMBLED'; 105 scrambledStatus = this.scrambledStatus() || 'SCRAMBLED';
106 106
107 this.element().update(""); 107 this.element().update("");
108 if (this.recordField().hidden() == false) { 108 if (this.recordField().hidden() == false) {
109 switch(this.recordField().type()) { 109 switch(this.recordField().type()) {
110 case 'TXT': 110 case 'TXT':
111 case 'PWD': 111 case 'PWD':
112 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', html:this.value()}); 112 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', html:this.value()});
113 break; 113 break;
114 case 'URL': 114 case 'URL':
115 varurlLocation; 115 varurlLocation;
116 116
117 urlLocation = Clipperz.Base.sanitizeString(this.value()); 117 urlLocation = Clipperz.Base.sanitizeString(this.value());
118 if (! (/^(https?|ftp|svn):\/\//.test(urlLocation))) { 118 if (! (/^(https?|ftp|svn):\/\//.test(urlLocation))) {
119 urlLocation = 'http://' + urlLocation; 119 urlLocation = 'http://' + urlLocation;
120 } 120 }
121 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'a', href:urlLocation, html:this.value(), target:'_blank'}); 121 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'a', href:urlLocation, html:this.value(), target:'_blank'});
122 break; 122 break;
123 case 'DATE': 123 case 'DATE':
124 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', html:this.value()}); 124 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'span', html:this.value()});
125 break; 125 break;
126 case 'ADDR': 126 case 'ADDR':
127 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'a', href:this.addrUrl(), html:this.value(), target:'_blank'}); 127 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'a', href:this.addrUrl(), html:this.value(), target:'_blank'});
128 break; 128 break;
129 } 129 }
130 } else { 130 } else {
131 var tableElement; 131 var tableElement;
132 var tdElement; 132 var tdElement;
133 var inputElement; 133 var inputElement;
134 var passwordElementConfiguration; 134 var passwordElementConfiguration;
135 135
136 if (scrambledStatus == 'SCRAMBLED') { 136 if (scrambledStatus == 'SCRAMBLED') {
137 varscrambledInputElement; 137 varscrambledInputElement;
138 138
139 if ((Clipperz_IEisBroken === true) && (Clipperz.PM.Proxy.defaultProxy.isReadOnly())) { 139 if ((Clipperz_IEisBroken === true) && (Clipperz.PM.Proxy.defaultProxy.isReadOnly())) {
140 scrambledInputElement = {tag:'input', type:'password', value:"this.value()"}; 140 scrambledInputElement = {tag:'input', type:'password', value:"this.value()", autocomplete:"off"};
141 } else { 141 } else {
142 scrambledInputElement = {tag:'input', type:'text', cls:'scrambledField', title:Clipperz.PM.Strings['recordDetailPasswordFieldTooltipLabel'], value:"this.value()"}; 142 scrambledInputElement = {tag:'input', type:'text', cls:'scrambledField', title:Clipperz.PM.Strings['recordDetailPasswordFieldTooltipLabel'], value:"this.value()", autocomplete:"off"};
143 } 143 }
144 144
145 passwordElementConfiguration = 145 passwordElementConfiguration =
146 {tag:'table', border:'0', cellspacing:'2', cellpadding:'0', children:[ 146 {tag:'table', border:'0', cellspacing:'2', cellpadding:'0', children:[
147 {tag:'tbody', children:[ 147 {tag:'tbody', children:[
148 {tag:'tr', children:[ 148 {tag:'tr', children:[
149 {tag:'td', valign:'top', children:[ 149 {tag:'td', valign:'top', children:[
150 scrambledInputElement, 150 scrambledInputElement,
151 {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldUnscrambleLabel']} 151 {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldUnscrambleLabel']}
152 ]}, 152 ]},
153 {tag:'td', valign:'top', children:[ 153 {tag:'td', valign:'top', children:[
154 {tag:'span', cls:'scrambledFieldLabel', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldHelpLabel']} 154 {tag:'span', cls:'scrambledFieldLabel', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldHelpLabel']}
155 ]} 155 ]}
156 ]} 156 ]}
157 ]} 157 ]}
158 ]}; 158 ]};
159 } else { 159 } else {
160 passwordElementConfiguration = 160 passwordElementConfiguration =
161 {tag:'div', children:[ 161 {tag:'div', children:[
162 {tag:'input', type:'text', cls:'unscrambledField', value:"this.value()"}, 162 {tag:'input', type:'text', cls:'unscrambledField', value:"this.value()", autocomplete:"off"},
163 {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldScrambleLabel']} 163 {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', htmlString:Clipperz.PM.Strings['recordDetailPasswordFieldScrambleLabel']}
164 ]}; 164 ]};
165 } 165 }
166 166
167 tableElement = Clipperz.YUI.DomHelper.append(this.element().dom, passwordElementConfiguration, true); 167 tableElement = Clipperz.YUI.DomHelper.append(this.element().dom, passwordElementConfiguration, true);
168 168
169 inputElement = tableElement.getChildrenByTagName('input')[0]; 169 inputElement = tableElement.getChildrenByTagName('input')[0];
170 inputElement.dom.value = this.value(); 170 inputElement.dom.value = this.value();
171 inputElement.wrap({tag:'div', cls:'passwordBackground'}).setStyle('background-position', "0px -" + Math.min(128, Clipperz.PM.Crypto.passwordEntropy(this.value())) + "px"); 171 inputElement.wrap({tag:'div', cls:'passwordBackground'}).setStyle('background-position', "0px -" + Math.min(128, Clipperz.PM.Crypto.passwordEntropy(this.value())) + "px");
172 172
173 MochiKit.Signal.connect(inputElement.dom, 'onfocus', this, 'selectHiddenFieldOnFocus'); 173 MochiKit.Signal.connect(inputElement.dom, 'onfocus', this, 'selectHiddenFieldOnFocus');
174 MochiKit.Signal.connect(this.getDom('scrambleLink'), 'onclick', this, 'toggleScramble'); 174 MochiKit.Signal.connect(this.getDom('scrambleLink'), 'onclick', this, 'toggleScramble');
175 } 175 }
176 }, 176 },
177 177
178 //------------------------------------------------------------------------- 178 //-------------------------------------------------------------------------
179 179
180 'updateEditMode': function() { 180 'updateEditMode': function() {
181 var inputElement; 181 var inputElement;
182 var scarmbledStatus; 182 var scarmbledStatus;
183 183
184 scrambledStatus = this.scrambledStatus() || 'SCRAMBLED'; 184 scrambledStatus = this.scrambledStatus() || 'SCRAMBLED';
185 185
186 this.element().update(""); 186 this.element().update("");
187 switch(this.recordField().type()) { 187 switch(this.recordField().type()) {
188 case 'TXT': 188 case 'TXT':
189 case 'URL': 189 case 'URL':
190 case 'ADDR': 190 case 'ADDR':
191 inputElement = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', type:'text', value:"this.value()"}, true); 191 inputElement = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', type:'text', value:"this.value()", autocomplete:"off"}, true);
192 inputElement.dom.value = this.value(); 192 inputElement.dom.value = this.value();
193 break; 193 break;
194 case 'PWD': 194 case 'PWD':
195 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', width:'100%', cellpadding:'0', cellspacing:'0', children:[ 195 Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', width:'100%', cellpadding:'0', cellspacing:'0', children:[
196 {tag:'tbody', children:[ 196 {tag:'tbody', children:[
197 {tag:'tr', children:[ 197 {tag:'tr', children:[
198 {tag:'td', valign:'top', children:[ 198 {tag:'td', valign:'top', children:[
199 {tag:'input', type:((scrambledStatus == 'SCRAMBLED') ? 'password' : 'text'), id:this.getId('passwordInputElement'), value:"this.value()"}, 199 {tag:'input', type:((scrambledStatus == 'SCRAMBLED') ? 'password' : 'text'), id:this.getId('passwordInputElement'), value:"this.value()", autocomplete:"off"},
200 {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', html:(scrambledStatus == 'SCRAMBLED' ? Clipperz.PM.Strings['recordDetailPasswordFieldUnscrambleLabel'] : Clipperz.PM.Strings['recordDetailPasswordFieldScrambleLabel'])} 200 {tag:'a', cls:'scrambleLink', id:this.getId('scrambleLink'), href:'#', html:(scrambledStatus == 'SCRAMBLED' ? Clipperz.PM.Strings['recordDetailPasswordFieldUnscrambleLabel'] : Clipperz.PM.Strings['recordDetailPasswordFieldScrambleLabel'])}
201 ]}, 201 ]},
202 {tag:'td', valign:'top', children:[ 202 {tag:'td', valign:'top', children:[
203 {tag:'div', id:this.getId('passwordGenerator'), cls:'Clipperz_PasswordGenerator_button', html:'&nbsp;'} 203 {tag:'div', id:this.getId('passwordGenerator'), cls:'Clipperz_PasswordGenerator_button', html:'&nbsp;'}
204 ]} 204 ]}
205 ]} 205 ]}
206 ]} 206 ]}
207 ]}) 207 ]})
208 inputElement = this.getElement('passwordInputElement'); 208 inputElement = this.getElement('passwordInputElement');
209 inputElement.dom.value = this.value(); 209 inputElement.dom.value = this.value();
210 new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('passwordInputElement')); 210 new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('passwordInputElement'));
211 new Clipperz.PM.Components.PasswordGenerator(this.getElement('passwordGenerator'), this); 211 new Clipperz.PM.Components.PasswordGenerator(this.getElement('passwordGenerator'), this);
212 MochiKit.Signal.connect(this.getDom('scrambleLink'), 'onclick', this, 'toggleScramble'); 212 MochiKit.Signal.connect(this.getDom('scrambleLink'), 'onclick', this, 'toggleScramble');
213 break; 213 break;
214 // case 'NOTE': 214 // case 'NOTE':
215 // inputElement = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'textarea', rows:'5', html:this.value()}, true); 215 // inputElement = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'textarea', rows:'5', html:this.value()}, true);
216 // break 216 // break
217 case 'DATE': 217 case 'DATE':
218 inputElement = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', type:'text', value:"this.value()"}, true); 218 inputElement = Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', type:'text', value:"this.value()", autocomplete:"off"}, true);
219 inputElement.dom.value = this.value(); 219 inputElement.dom.value = this.value();
220 break; 220 break;
221 } 221 }
222 222
223 this.setInputElement(inputElement); 223 this.setInputElement(inputElement);
224 }, 224 },
225 225
226 //------------------------------------------------------------------------- 226 //-------------------------------------------------------------------------
227 227
228 'synchronizeComponentValues': function() { 228 'synchronizeComponentValues': function() {
229//MochiKit.Logging.logDebug(">>> FieldValueComponent.synchronizeComponentValues"); 229//MochiKit.Logging.logDebug(">>> FieldValueComponent.synchronizeComponentValues");
230 if (this.inputElement() != null) { 230 if (this.inputElement() != null) {
231 var value; 231 var value;
232 232
233 switch(this.recordField().type()) { 233 switch(this.recordField().type()) {
234 case 'TXT': 234 case 'TXT':
235 case 'URL': 235 case 'URL':
236 case 'ADDR': 236 case 'ADDR':
237 case 'PWD': 237 case 'PWD':
238 case 'DATE': 238 case 'DATE':
239 value = this.inputElement().dom.value; 239 value = this.inputElement().dom.value;
240 break; 240 break;
241 } 241 }
242 this.setValue(value); 242 this.setValue(value);
243 } 243 }
244//MochiKit.Logging.logDebug("<<< FieldValueComponent.synchronizeComponentValues"); 244//MochiKit.Logging.logDebug("<<< FieldValueComponent.synchronizeComponentValues");
245 }, 245 },
246 246
247 //------------------------------------------------------------------------- 247 //-------------------------------------------------------------------------
248 248
249 'selectHiddenFieldOnFocus': function(anEvent) { 249 'selectHiddenFieldOnFocus': function(anEvent) {
250 anEvent.src().select(); 250 anEvent.src().select();
251 }, 251 },
252 252
253 //------------------------------------------------------------------------- 253 //-------------------------------------------------------------------------
254 254
255 'toggleScramble': function(anEvent) { 255 'toggleScramble': function(anEvent) {
256 this.synchronizeComponentValues(); 256 this.synchronizeComponentValues();
257 257
258 if (this.scrambledStatus() == 'SCRAMBLED') { 258 if (this.scrambledStatus() == 'SCRAMBLED') {
259 this.setScrambledStatus('UNSCRAMBLED'); 259 this.setScrambledStatus('UNSCRAMBLED');
260 } else { 260 } else {
261 this.setScrambledStatus('SCRAMBLED'); 261 this.setScrambledStatus('SCRAMBLED');
262 }; 262 };
263 263
264 this.update(); 264 this.update();
265 }, 265 },
266 266
267 //------------------------------------------------------------------------- 267 //-------------------------------------------------------------------------
268 __syntaxFix__: "syntax fix" 268 __syntaxFix__: "syntax fix"
269}); 269});
270 270