Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js new file mode 100644 index 0000000..126c5b1 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js | |||
@@ -0,0 +1,182 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer to http://www.clipperz.com | ||
12 | |||
13 | * Javascript Crypto Library is free software: you can redistribute | ||
14 | 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 | ||
16 | 3 of the License, or (at your option) any later version. | ||
17 | |||
18 | * Javascript Crypto Library is distributed in the hope that it will | ||
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
21 | See the GNU Affero General Public License for more details. | ||
22 | |||
23 | * You should have received a copy of the GNU Affero General Public | ||
24 | License along with Javascript Crypto Library. If not, see | ||
25 | <http://www.gnu.org/licenses/>. | ||
26 | |||
27 | */ | ||
28 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._faviconComponent = null; | ||
38 | |||
39 | return this; | ||
40 | } | ||
41 | |||
42 | //============================================================================= | ||
43 | |||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
45 | |||
46 | //------------------------------------------------------------------------- | ||
47 | |||
48 | 'toString': function () { | ||
49 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent component"; | ||
50 | }, | ||
51 | |||
52 | //------------------------------------------------------------------------- | ||
53 | |||
54 | 'reference': function () { | ||
55 | return this._reference; | ||
56 | }, | ||
57 | |||
58 | //------------------------------------------------------------------------- | ||
59 | |||
60 | 'renderSelf': function() { | ||
61 | //console.log(">>> CardDialogRecordDirectLoginComponent.renderSelf"); | ||
62 | this.append(this.element(), [ | ||
63 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[ | ||
64 | {tag:'img', cls:'favicon', id:this.getId('favicon')} | ||
65 | ]}, | ||
66 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_label', children:[ | ||
67 | {tag:'input', id:this.getId('label'), type:'text'} | ||
68 | ]}, | ||
69 | {tag:'div', cls:'open', children:[ | ||
70 | {tag:'span', children:[ | ||
71 | {tag:'a', href:'open', id:this.getId('open'), html:' '} | ||
72 | ]} | ||
73 | ]}, | ||
74 | {tag:'div', cls:'edit', children:[ | ||
75 | {tag:'span', children:[ | ||
76 | {tag:'a', href:'edit', id:this.getId('edit'), html:"edit"} | ||
77 | ]} | ||
78 | ]}, | ||
79 | {tag:'div', cls:'delete', children:[ | ||
80 | {tag:'span', children:[ | ||
81 | {tag:'a', href:'delete', id:this.getId('delete'), html:"delete"} | ||
82 | ]} | ||
83 | ]} | ||
84 | /* | ||
85 | {tag:'td', cls:'fieldState'}, | ||
86 | {tag:'td', cls:'fieldLabel', children:[ | ||
87 | {tag:'input', cls:'label', id:this.getId('label')} | ||
88 | ]}, | ||
89 | {tag:'td', cls:'fieldLock', children:[ | ||
90 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} | ||
91 | ]}, | ||
92 | {tag:'td', cls:'fieldValue', children:[ | ||
93 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ | ||
94 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} | ||
95 | ]} | ||
96 | ]}, | ||
97 | {tag:'td', cls:'fieldAddDelete', children:[ | ||
98 | {tag:'div', cls:'delete', children:[ | ||
99 | {tag:'span', children:[ | ||
100 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} | ||
101 | ]} | ||
102 | ]} | ||
103 | ]} | ||
104 | */ | ||
105 | ]); | ||
106 | |||
107 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
108 | MochiKit.Signal.connect(this.getId('open'), 'onclick',this, 'openDirectLogin'); | ||
109 | MochiKit.Signal.connect(this.getId('edit'), 'onclick',this, 'editDirectLogin'); | ||
110 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteDirectLogin'); | ||
111 | }, | ||
112 | |||
113 | //------------------------------------------------------------------------- | ||
114 | |||
115 | 'shouldShowElementWhileRendering': function () { | ||
116 | return false; | ||
117 | }, | ||
118 | |||
119 | //------------------------------------------------------------------------- | ||
120 | |||
121 | 'faviconComponent': function () { | ||
122 | if (this._faviconComponent == null) { | ||
123 | //console.log("created the FAVICON component"); | ||
124 | this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')}); | ||
125 | } | ||
126 | |||
127 | return this._faviconComponent; | ||
128 | }, | ||
129 | |||
130 | //========================================================================= | ||
131 | |||
132 | 'label': function () { | ||
133 | return this.getElement('label').value; | ||
134 | }, | ||
135 | |||
136 | 'setLabel': function (aValue) { | ||
137 | this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); | ||
138 | }, | ||
139 | |||
140 | //------------------------------------------------------------------------- | ||
141 | |||
142 | 'favicon': function () { | ||
143 | // return this.getElement('favicon').src; | ||
144 | return this.faviconComponent().src(); | ||
145 | }, | ||
146 | |||
147 | 'setFavicon': function (aValue) { | ||
148 | // this.getElement('favicon').src = Clipperz.Base.sanitizeString(aValue); | ||
149 | this.faviconComponent().setSrc(Clipperz.Base.sanitizeString(aValue)); | ||
150 | }, | ||
151 | |||
152 | //========================================================================= | ||
153 | |||
154 | 'openDirectLogin': function (anEvent) { | ||
155 | anEvent.preventDefault(); | ||
156 | |||
157 | MochiKit.Signal.signal(this, 'openDirectLogin', this.reference()); | ||
158 | }, | ||
159 | |||
160 | //------------------------------------------------------------------------- | ||
161 | |||
162 | 'editDirectLogin': function (anEvent) { | ||
163 | anEvent.preventDefault(); | ||
164 | |||
165 | MochiKit.Signal.signal(this, 'editDirectLogin', this.reference()); | ||
166 | //console.log("EDIT DIRECT LOGIN"); | ||
167 | }, | ||
168 | |||
169 | //------------------------------------------------------------------------- | ||
170 | |||
171 | 'deleteDirectLogin': function (anEvent) { | ||
172 | anEvent.preventDefault(); | ||
173 | |||
174 | MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference()); | ||
175 | //console.log("DELETE DIRECT LOGIN"); | ||
176 | }, | ||
177 | |||
178 | |||
179 | |||
180 | //========================================================================= | ||
181 | __syntaxFix__: "syntax fix" | ||
182 | }); | ||