Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js index 7638f00..69cad79 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/DirectLoginComponent.js | |||
@@ -1,216 +1,213 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
30 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
31 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
32 | if (typeof(Clipperz.PM.Components.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } | 29 | if (typeof(Clipperz.PM.Components.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } |
33 | 30 | ||
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | Clipperz.PM.Components.RecordDetail.DirectLoginComponent = function(anElement, args) { | 33 | Clipperz.PM.Components.RecordDetail.DirectLoginComponent = function(anElement, args) { |
37 | args = args || {}; | 34 | args = args || {}; |
38 | 35 | ||
39 | Clipperz.PM.Components.RecordDetail.DirectLoginComponent.superclass.constructor.call(this, anElement, args); | 36 | Clipperz.PM.Components.RecordDetail.DirectLoginComponent.superclass.constructor.call(this, anElement, args); |
40 | 37 | ||
41 | this._directLogin = args.directLogin || null; | 38 | this._directLogin = args.directLogin || null; |
42 | //this._titleElement = null; | 39 | //this._titleElement = null; |
43 | this._structureElement = null; | 40 | this._structureElement = null; |
44 | this._removeButton = null; | 41 | this._removeButton = null; |
45 | this._directLoginBindingComponents = null; | 42 | this._directLoginBindingComponents = null; |
46 | this._collapser = null; | 43 | this._collapser = null; |
47 | 44 | ||
48 | this.mainComponent().addEditComponent(this); | 45 | this.mainComponent().addEditComponent(this); |
49 | this.render(); | 46 | this.render(); |
50 | 47 | ||
51 | return this; | 48 | return this; |
52 | } | 49 | } |
53 | 50 | ||
54 | //============================================================================= | 51 | //============================================================================= |
55 | 52 | ||
56 | YAHOO.extendX(Clipperz.PM.Components.RecordDetail.DirectLoginComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { | 53 | YAHOO.extendX(Clipperz.PM.Components.RecordDetail.DirectLoginComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { |
57 | 54 | ||
58 | 'toString': function() { | 55 | 'toString': function() { |
59 | return "Clipperz.PM.Components.RecordDetail.DirectLoginComponent component"; | 56 | return "Clipperz.PM.Components.RecordDetail.DirectLoginComponent component"; |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //------------------------------------------------------------------------- | 59 | //------------------------------------------------------------------------- |
63 | 60 | ||
64 | 'directLogin': function() { | 61 | 'directLogin': function() { |
65 | return this._directLogin; | 62 | return this._directLogin; |
66 | }, | 63 | }, |
67 | 64 | ||
68 | 'directLoginBindingComponents': function() { | 65 | 'directLoginBindingComponents': function() { |
69 | return this._directLoginBindingComponents; | 66 | return this._directLoginBindingComponents; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
73 | 70 | ||
74 | 'removeDirectLogin': function() { | 71 | 'removeDirectLogin': function() { |
75 | //MochiKit.Logging.logDebug(">>> DirectLoginComponent.removeDirectLogin"); | 72 | //MochiKit.Logging.logDebug(">>> DirectLoginComponent.removeDirectLogin"); |
76 | this.mainComponent().synchronizeComponentValues(); | 73 | this.mainComponent().synchronizeComponentValues(); |
77 | this.directLogin().remove(); | 74 | this.directLogin().remove(); |
78 | this.mainComponent().removeEditComponent(this); | 75 | this.mainComponent().removeEditComponent(this); |
79 | this.mainComponent().render(); | 76 | this.mainComponent().render(); |
80 | //MochiKit.Logging.logDebug("<<< DirectLoginComponent.removeDirectLogin"); | 77 | //MochiKit.Logging.logDebug("<<< DirectLoginComponent.removeDirectLogin"); |
81 | }, | 78 | }, |
82 | 79 | ||
83 | //------------------------------------------------------------------------- | 80 | //------------------------------------------------------------------------- |
84 | /* | 81 | /* |
85 | 'formDataValue': function() { | 82 | 'formDataValue': function() { |
86 | return Clipperz.Base.serializeJSON(this.directLogin().formData()); | 83 | return Clipperz.Base.serializeJSON(this.directLogin().formData()); |
87 | }, | 84 | }, |
88 | 85 | ||
89 | 'setFormDataValue': function(aValue) { | 86 | 'setFormDataValue': function(aValue) { |
90 | 87 | ||
91 | }, | 88 | }, |
92 | */ | 89 | */ |
93 | //------------------------------------------------------------------------- | 90 | //------------------------------------------------------------------------- |
94 | 91 | ||
95 | 'removeButton': function() { | 92 | 'removeButton': function() { |
96 | return this._removeButton; | 93 | return this._removeButton; |
97 | }, | 94 | }, |
98 | 95 | ||
99 | 'setRemoveButton': function(aValue) { | 96 | 'setRemoveButton': function(aValue) { |
100 | this._removeButton = aValue; | 97 | this._removeButton = aValue; |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //------------------------------------------------------------------------- | 100 | //------------------------------------------------------------------------- |
104 | /* | 101 | /* |
105 | 'titleElement': function() { | 102 | 'titleElement': function() { |
106 | return this._titleElement; | 103 | return this._titleElement; |
107 | }, | 104 | }, |
108 | 105 | ||
109 | 'setTitleElement': function(aValue) { | 106 | 'setTitleElement': function(aValue) { |
110 | this._titleElement = aValue; | 107 | this._titleElement = aValue; |
111 | }, | 108 | }, |
112 | */ | 109 | */ |
113 | //------------------------------------------------------------------------- | 110 | //------------------------------------------------------------------------- |
114 | 111 | ||
115 | 'structureElement': function() { | 112 | 'structureElement': function() { |
116 | return this._structureElement; | 113 | return this._structureElement; |
117 | }, | 114 | }, |
118 | 115 | ||
119 | 'setStructureElement': function(aValue) { | 116 | 'setStructureElement': function(aValue) { |
120 | this._structureElement = aValue; | 117 | this._structureElement = aValue; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | //------------------------------------------------------------------------- | 120 | //------------------------------------------------------------------------- |
124 | 121 | ||
125 | 'render': function() { | 122 | 'render': function() { |
126 | //MochiKit.Logging.logDebug(">>> DirectLoginComponent.render"); | 123 | //MochiKit.Logging.logDebug(">>> DirectLoginComponent.render"); |
127 | try { | 124 | try { |
128 | this.element().update(""); | 125 | this.element().update(""); |
129 | Clipperz.YUI.DomHelper.append(this.element().dom, | 126 | Clipperz.YUI.DomHelper.append(this.element().dom, |
130 | {tag:'li', children:[ | 127 | {tag:'li', children:[ |
131 | {tag:'table', width:'100%', border:'0', cellpadding:'0', cellspacing:'0', children:[ | 128 | {tag:'table', width:'100%', border:'0', cellpadding:'0', cellspacing:'0', children:[ |
132 | {tag:'tbody', children:[ | 129 | {tag:'tbody', children:[ |
133 | {tag:'tr', children:[ | 130 | {tag:'tr', children:[ |
134 | {tag:'td', rowspan:'2', width:'30', valign:'top', html:' ', children:[ | 131 | {tag:'td', rowspan:'2', width:'30', valign:'top', html:' ', children:[ |
135 | {tag:'div', id:this.getId('removeDirectLogin'), children:[ | 132 | {tag:'div', id:this.getId('removeDirectLogin'), children:[ |
136 | {tag:'div', id:this.getId('removeDirectLoginButton')} | 133 | {tag:'div', id:this.getId('removeDirectLoginButton')} |
137 | ]}, | 134 | ]}, |
138 | {tag:'div', id:this.getId('collapseLink'), cls:'directLoginCollapseLink'} | 135 | {tag:'div', id:this.getId('collapseLink'), cls:'directLoginCollapseLink'} |
139 | ]}, | 136 | ]}, |
140 | {tag:'td', valign:'top', children:[ | 137 | {tag:'td', valign:'top', children:[ |
141 | {tag:'table', width:'100%', border:'0', cellpadding:'0', cellspacing:'0', children:[ | 138 | {tag:'table', width:'100%', border:'0', cellpadding:'0', cellspacing:'0', children:[ |
142 | {tag:'tbody', children:[ | 139 | {tag:'tbody', children:[ |
143 | {tag:'tr', children:[ | 140 | {tag:'tr', children:[ |
144 | {tag:'td', width:'20', valign:'top', children:[ | 141 | {tag:'td', width:'20', valign:'top', children:[ |
145 | {tag:'a', href:'#', id:this.getId('directLogin'), children:[ | 142 | {tag:'a', href:'#', id:this.getId('directLogin'), children:[ |
146 | {tag:'img', id:this.getId('faviconImage'), width:'16', height:'16', src:this.directLogin().fixedFavicon()} | 143 | {tag:'img', id:this.getId('faviconImage'), width:'16', height:'16', src:this.directLogin().fixedFavicon()} |
147 | ]} | 144 | ]} |
148 | ]}, | 145 | ]}, |
149 | {tag:'td', valign:'top', children:[ | 146 | {tag:'td', valign:'top', children:[ |
150 | {tag:'div', cls:'directLoginDetailTitle', children:[ | 147 | {tag:'div', cls:'directLoginDetailTitle', children:[ |
151 | {tag:'div', id:this.getId('titleViewBox'), children:[ | 148 | {tag:'div', id:this.getId('titleViewBox'), children:[ |
152 | {tag:'a', href:'#', id:this.getId('titleLink')} | 149 | {tag:'a', href:'#', id:this.getId('titleLink')} |
153 | ]}, | 150 | ]}, |
154 | {tag:'div', id:this.getId('titleEditBox'), children:[ | 151 | {tag:'div', id:this.getId('titleEditBox'), children:[ |
155 | {tag:'input', type:'text', id:this.getId('titleInput')} | 152 | {tag:'input', type:'text', id:this.getId('titleInput')} |
156 | ]} | 153 | ]} |
157 | ]} | 154 | ]} |
158 | ]} | 155 | ]} |
159 | ]} | 156 | ]} |
160 | ]} | 157 | ]} |
161 | ]} | 158 | ]} |
162 | ]} | 159 | ]} |
163 | ]}, | 160 | ]}, |
164 | {tag:'tr', children:[ | 161 | {tag:'tr', children:[ |
165 | {tag:'td', /*colspan:'2',*/ children:[ | 162 | {tag:'td', /*colspan:'2',*/ children:[ |
166 | {tag:'div', id:this.getId('details'), children:[ | 163 | {tag:'div', id:this.getId('details'), children:[ |
167 | {tag:'table', cls:'directLoginBindings', border:'0', cellpadding:'0', cellspacing:'0', children:[ | 164 | {tag:'table', cls:'directLoginBindings', border:'0', cellpadding:'0', cellspacing:'0', children:[ |
168 | {tag:'tbody', id:this.getId('tbodyBindings'), children:[]} | 165 | {tag:'tbody', id:this.getId('tbodyBindings'), children:[]} |
169 | ]} | 166 | ]} |
170 | ]} | 167 | ]} |
171 | ]} | 168 | ]} |
172 | ]} | 169 | ]} |
173 | ]} | 170 | ]} |
174 | ]} | 171 | ]} |
175 | ]} | 172 | ]} |
176 | ); | 173 | ); |
177 | 174 | ||
178 | MochiKit.Signal.connect(this.getId('faviconImage'), 'onload', this, 'handleLoadedFaviconImage'); | 175 | MochiKit.Signal.connect(this.getId('faviconImage'), 'onload', this, 'handleLoadedFaviconImage'); |
179 | MochiKit.Signal.connect(this.getId('faviconImage'), 'onerror', this.directLogin(), 'handleMissingFaviconImage'); | 176 | MochiKit.Signal.connect(this.getId('faviconImage'), 'onerror', this.directLogin(), 'handleMissingFaviconImage'); |
180 | MochiKit.Signal.connect(this.getId('faviconImage'), 'onabort', this.directLogin(), 'handleMissingFaviconImage'); | 177 | MochiKit.Signal.connect(this.getId('faviconImage'), 'onabort', this.directLogin(), 'handleMissingFaviconImage'); |
181 | 178 | ||
182 | this.getElement('removeDirectLogin').setVisibilityMode(YAHOO.ext.Element.DISPLAY); | 179 | this.getElement('removeDirectLogin').setVisibilityMode(YAHOO.ext.Element.DISPLAY); |
183 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 1"); | 180 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 1"); |
184 | this.getElement('collapseLink').addClassOnOver('hover'); | 181 | this.getElement('collapseLink').addClassOnOver('hover'); |
185 | this._collapser = new Clipperz.YUI.Collapser(this.getElement('collapseLink'), this.getElement('details'), true); | 182 | this._collapser = new Clipperz.YUI.Collapser(this.getElement('collapseLink'), this.getElement('details'), true); |
186 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 2"); | 183 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 2"); |
187 | MochiKit.Signal.connect(this.getId('directLogin'), 'onclick', this, 'runDirectLogin'); | 184 | MochiKit.Signal.connect(this.getId('directLogin'), 'onclick', this, 'runDirectLogin'); |
188 | // this.getElement('directLogin').on('click', this.runDirectLogin, this, false); | 185 | // this.getElement('directLogin').on('click', this.runDirectLogin, this, false); |
189 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 3"); | 186 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 3"); |
190 | // this.setTitleElement(new Clipperz.PM.Components.TextFormField(this.getElement('title'), { | 187 | // this.setTitleElement(new Clipperz.PM.Components.TextFormField(this.getElement('title'), { |
191 | // editMode:this.editMode(), | 188 | // editMode:this.editMode(), |
192 | // value:this.directLogin().label() | 189 | // value:this.directLogin().label() |
193 | // })); | 190 | // })); |
194 | this.getElement('titleViewBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); | 191 | this.getElement('titleViewBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); |
195 | this.getElement('titleEditBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); | 192 | this.getElement('titleEditBox').setVisibilityMode(YAHOO.ext.Element.DISPLAY); |
196 | //- this.getElement('titleLink').on('click', this.runDirectLogin, this, false); | 193 | //- this.getElement('titleLink').on('click', this.runDirectLogin, this, false); |
197 | MochiKit.Signal.connect(this.getId('titleLink'), 'onclick', this, 'runDirectLogin'); | 194 | MochiKit.Signal.connect(this.getId('titleLink'), 'onclick', this, 'runDirectLogin'); |
198 | 195 | ||
199 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 4"); | 196 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 4"); |
200 | //- this.setStructureElement(new Clipperz.PM.Components.TextFormField(this.getElement('formStructure'), { | 197 | //- this.setStructureElement(new Clipperz.PM.Components.TextFormField(this.getElement('formStructure'), { |
201 | //- editMode:this.editMode(), | 198 | //- editMode:this.editMode(), |
202 | //- value:this.formDataValue(), multiline:true | 199 | //- value:this.formDataValue(), multiline:true |
203 | //- })); | 200 | //- })); |
204 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 5"); | 201 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 5"); |
205 | { | 202 | { |
206 | varbindingKey; | 203 | varbindingKey; |
207 | var valueName; | 204 | var valueName; |
208 | var inputsRequiringAdditionalValues; | 205 | var inputsRequiringAdditionalValues; |
209 | var bindingsElement; | 206 | var bindingsElement; |
210 | var i,c; | 207 | var i,c; |
211 | 208 | ||
212 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 6"); | 209 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 6"); |
213 | this._directLoginBindingComponents = []; | 210 | this._directLoginBindingComponents = []; |
214 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 7"); | 211 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 7"); |
215 | bindingsElement = this.getElement('tbodyBindings'); | 212 | bindingsElement = this.getElement('tbodyBindings'); |
216 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 8"); | 213 | //MochiKit.Logging.logDebug("--- DirectLoginComponent.render - 8"); |