Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/TextFormField.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/TextFormField.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/TextFormField.js b/frontend/beta/js/Clipperz/PM/Components/TextFormField.js index cb4f06a..c6f0349 100644 --- a/frontend/beta/js/Clipperz/PM/Components/TextFormField.js +++ b/frontend/beta/js/Clipperz/PM/Components/TextFormField.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 | 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 | 29 | ||
33 | Clipperz.PM.Components.TextFormField = function(anElement, args) { | 30 | Clipperz.PM.Components.TextFormField = function(anElement, args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | 32 | ||
36 | //MochiKit.Logging.logDebug(">>> new TextFormField"); | 33 | //MochiKit.Logging.logDebug(">>> new TextFormField"); |
37 | Clipperz.PM.Components.TextFormField.superclass.constructor.call(this, args); | 34 | Clipperz.PM.Components.TextFormField.superclass.constructor.call(this, args); |
38 | 35 | ||
39 | this._element = anElement; | 36 | this._element = anElement; |
40 | this._editMode = args.editMode || 'VIEW'; | 37 | this._editMode = args.editMode || 'VIEW'; |
41 | this._value = args.value || ""; | 38 | this._value = args.value || ""; |
42 | this._inputElement = null; | 39 | this._inputElement = null; |
43 | this._wrapper = null; | 40 | this._wrapper = null; |
44 | this._multiline = args.multiline || false; | 41 | this._multiline = args.multiline || false; |
45 | 42 | ||
46 | //this.multiline = args.multiline || true; | 43 | //this.multiline = args.multiline || true; |
47 | //this.editing = true; | 44 | //this.editing = true; |
48 | //this.completeOnBlur = true; | 45 | //this.completeOnBlur = true; |
49 | //this.autoSizeTask = new YAHOO.ext.util.DelayedTask(this.autoSize, this); | 46 | //this.autoSizeTask = new YAHOO.ext.util.DelayedTask(this.autoSize, this); |
50 | //this.textSizeEl = Clipperz.YUI.DomHelper.append(document.body, { | 47 | //this.textSizeEl = Clipperz.YUI.DomHelper.append(document.body, { |
51 | // tag: 'div', | 48 | // tag: 'div', |
52 | // cls: 'yinline-editor-sizer ' + (this.cls || '') | 49 | // cls: 'yinline-editor-sizer ' + (this.cls || '') |
53 | //}); | 50 | //}); |
54 | 51 | ||
55 | this.render(); | 52 | this.render(); |
56 | //MochiKit.Logging.logDebug("<<< new TextFormField"); | 53 | //MochiKit.Logging.logDebug("<<< new TextFormField"); |
57 | 54 | ||
58 | return this; | 55 | return this; |
59 | }; | 56 | }; |
60 | 57 | ||
61 | YAHOO.extendX(Clipperz.PM.Components.TextFormField, Clipperz.PM.Components.BaseComponent, { | 58 | YAHOO.extendX(Clipperz.PM.Components.TextFormField, Clipperz.PM.Components.BaseComponent, { |
62 | 59 | ||
63 | 'toString': function() { | 60 | 'toString': function() { |
64 | return "Clipperz.PM.Components.TextFormField"; | 61 | return "Clipperz.PM.Components.TextFormField"; |
65 | }, | 62 | }, |
66 | 63 | ||
67 | //----------------------------------------------------- | 64 | //----------------------------------------------------- |
68 | 65 | ||
69 | 'value': function() { | 66 | 'value': function() { |
70 | if (this.inputElement() != null) { | 67 | if (this.inputElement() != null) { |
71 | this._value = this.inputElement().dom.value; | 68 | this._value = this.inputElement().dom.value; |
72 | } | 69 | } |
73 | 70 | ||
74 | return this._value; | 71 | return this._value; |
75 | // return this.inlineEditor().getValue(); | 72 | // return this.inlineEditor().getValue(); |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'setValue': function(aValue) { | 75 | 'setValue': function(aValue) { |
79 | this._value = aValue; | 76 | this._value = aValue; |
80 | // this.getElement('viewComponent_Content').update(aValue); | 77 | // this.getElement('viewComponent_Content').update(aValue); |
81 | // this.inlineEditor().setValue(aValue); | 78 | // this.inlineEditor().setValue(aValue); |
82 | }, | 79 | }, |
83 | 80 | ||
84 | //----------------------------------------------------- | 81 | //----------------------------------------------------- |
85 | 82 | ||
86 | 'multiline': function() { | 83 | 'multiline': function() { |
87 | return this._multiline; | 84 | return this._multiline; |
88 | }, | 85 | }, |
89 | 86 | ||
90 | //----------------------------------------------------- | 87 | //----------------------------------------------------- |
91 | 88 | ||
92 | 'editMode': function() { | 89 | 'editMode': function() { |
93 | return this._editMode; | 90 | return this._editMode; |
94 | }, | 91 | }, |
95 | 92 | ||
96 | 'setEditMode': function(aValue) { | 93 | 'setEditMode': function(aValue) { |
97 | this._editMode = aValue; | 94 | this._editMode = aValue; |
98 | }, | 95 | }, |
99 | 96 | ||
100 | //----------------------------------------------------- | 97 | //----------------------------------------------------- |
101 | 98 | ||
102 | 'inputElement': function() { | 99 | 'inputElement': function() { |
103 | return this._inputElement; | 100 | return this._inputElement; |
104 | }, | 101 | }, |
105 | 102 | ||
106 | 'setInputElement': function(aValue) { | 103 | 'setInputElement': function(aValue) { |
107 | this._inputElement = aValue; | 104 | this._inputElement = aValue; |
108 | }, | 105 | }, |
109 | 106 | ||
110 | //----------------------------------------------------- | 107 | //----------------------------------------------------- |
111 | 108 | ||
112 | 'on': function(anEventName, anHandler, aScope, shouldOverride) { | 109 | 'on': function(anEventName, anHandler, aScope, shouldOverride) { |
113 | //MochiKit.Logging.logDebug(">>> TextFormField.on - inputElement: " + this.inputElement()); | 110 | //MochiKit.Logging.logDebug(">>> TextFormField.on - inputElement: " + this.inputElement()); |
114 | return this.inputElement().on(anEventName, anHandler, aScope, shouldOverride); | 111 | return this.inputElement().on(anEventName, anHandler, aScope, shouldOverride); |
115 | //MochiKit.Logging.logDebug("<<< TextFormField.on - inputElement: " + this.inputElement()); | 112 | //MochiKit.Logging.logDebug("<<< TextFormField.on - inputElement: " + this.inputElement()); |
116 | }, | 113 | }, |
117 | 114 | ||
118 | //----------------------------------------------------- | 115 | //----------------------------------------------------- |
119 | 116 | ||
120 | 'wrapper': function() { | 117 | 'wrapper': function() { |