Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js index c1a7c13..b58062c 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js | |||
@@ -1,120 +1,117 @@ | |||
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 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | this._actionType = null; | 34 | this._actionType = null; |
38 | 35 | ||
39 | return this; | 36 | return this; |
40 | } | 37 | } |
41 | 38 | ||
42 | //============================================================================= | 39 | //============================================================================= |
43 | 40 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
45 | 42 | ||
46 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
47 | 44 | ||
48 | 'toString': function () { | 45 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component"; | 46 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component"; |
50 | }, | 47 | }, |
51 | 48 | ||
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | 50 | ||
54 | 'renderSelf': function() { | 51 | 'renderSelf': function() { |
55 | this.append(this.element(), [ | 52 | this.append(this.element(), [ |
56 | {tag:'td', cls:'fieldState'}, | 53 | {tag:'td', cls:'fieldState'}, |
57 | {tag:'td', cls:'fieldLabel', children:[ | 54 | {tag:'td', cls:'fieldLabel', children:[ |
58 | {tag:'input', cls:'label', id:this.getId('label')} | 55 | {tag:'input', cls:'label', id:this.getId('label')} |
59 | ]}, | 56 | ]}, |
60 | {tag:'td', cls:'fieldLock', children:[ | 57 | {tag:'td', cls:'fieldLock', children:[ |
61 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} | 58 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} |
62 | ]}, | 59 | ]}, |
63 | {tag:'td', cls:'fieldValue', children:[ | 60 | {tag:'td', cls:'fieldValue', children:[ |
64 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ | 61 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ |
65 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} | 62 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} |
66 | ]} | 63 | ]} |
67 | ]}, | 64 | ]}, |
68 | {tag:'td', cls:'fieldAction', children:[ | 65 | {tag:'td', cls:'fieldAction', children:[ |
69 | {tag:'a', href:'#', id:this.getId('actionLink'), html:' '} | 66 | {tag:'a', href:'#', id:this.getId('actionLink'), html:' '} |
70 | ]}, | 67 | ]}, |
71 | {tag:'td', cls:'fieldAddDelete', children:[ | 68 | {tag:'td', cls:'fieldAddDelete', children:[ |
72 | {tag:'div', cls:'delete', children:[ | 69 | {tag:'div', cls:'delete', children:[ |
73 | {tag:'span', children:[ | 70 | {tag:'span', children:[ |
74 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} | 71 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} |
75 | ]} | 72 | ]} |
76 | ]} | 73 | ]} |
77 | ]} | 74 | ]} |
78 | ]); | 75 | ]); |
79 | 76 | ||
80 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | 77 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); |
81 | MochiKit.Signal.connect(this.getId('isHidden'), 'onclick',this, 'toggleIsHidden'); | 78 | MochiKit.Signal.connect(this.getId('isHidden'), 'onclick',this, 'toggleIsHidden'); |
82 | MochiKit.Signal.connect(this.getId('value'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | 79 | MochiKit.Signal.connect(this.getId('value'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); |
83 | MochiKit.Signal.connect(this.getId('actionLink'), 'onclick',this, 'handleActionLink'); | 80 | MochiKit.Signal.connect(this.getId('actionLink'), 'onclick',this, 'handleActionLink'); |
84 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteField'); | 81 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteField'); |
85 | // MochiKit.Signal.connect(this.getId('delete'), 'onclick',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'deleteField', this.reference())); | 82 | // MochiKit.Signal.connect(this.getId('delete'), 'onclick',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'deleteField', this.reference())); |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | 86 | ||
90 | 'shouldShowElementWhileRendering': function () { | 87 | 'shouldShowElementWhileRendering': function () { |
91 | return false; | 88 | return false; |
92 | }, | 89 | }, |
93 | 90 | ||
94 | //========================================================================= | 91 | //========================================================================= |
95 | 92 | ||
96 | 'reference': function () { | 93 | 'reference': function () { |
97 | return this._reference; | 94 | return this._reference; |
98 | }, | 95 | }, |
99 | 96 | ||
100 | //========================================================================= | 97 | //========================================================================= |
101 | 98 | ||
102 | 'label': function () { | 99 | 'label': function () { |
103 | return this.getElement('label').value; | 100 | return this.getElement('label').value; |
104 | }, | 101 | }, |
105 | 102 | ||
106 | 'setLabel': function (aValue) { | 103 | 'setLabel': function (aValue) { |
107 | // this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); | 104 | // this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); |
108 | this.getElement('label').value = aValue; | 105 | this.getElement('label').value = aValue; |
109 | }, | 106 | }, |
110 | 107 | ||
111 | //========================================================================= | 108 | //========================================================================= |
112 | 109 | ||
113 | 'value': function () { | 110 | 'value': function () { |
114 | return this.getElement('value').value; | 111 | return this.getElement('value').value; |
115 | }, | 112 | }, |
116 | 113 | ||
117 | 'setValue': function (aValue) { | 114 | 'setValue': function (aValue) { |
118 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); | 115 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); |
119 | this.getElement('value').value = aValue; | 116 | this.getElement('value').value = aValue; |
120 | }, | 117 | }, |