Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js index 29fe972..d114eaa 100644 --- a/frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/RecordDetail/TitleComponent.js | |||
@@ -1,134 +1,132 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * 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 |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 26 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
29 | if (typeof(Clipperz.PM.Components.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } | 27 | if (typeof(Clipperz.PM.Components.RecordDetail) == 'undefined') { Clipperz.PM.Components.RecordDetail = {}; } |
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.Components.RecordDetail.TitleComponent = function(anElement, args) { | 31 | Clipperz.PM.Components.RecordDetail.TitleComponent = function(anElement, args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | Clipperz.PM.Components.RecordDetail.TitleComponent.superclass.constructor.call(this, anElement, args); | 34 | Clipperz.PM.Components.RecordDetail.TitleComponent.superclass.constructor.call(this, anElement, args); |
37 | 35 | ||
38 | //this._inputElement = null; | 36 | //this._inputElement = null; |
39 | 37 | ||
40 | this.mainComponent().addEditComponent(this); | 38 | this.mainComponent().addEditComponent(this); |
41 | 39 | ||
42 | this.render(); | 40 | this.render(); |
43 | 41 | ||
44 | return this; | 42 | return this; |
45 | } | 43 | } |
46 | 44 | ||
47 | //============================================================================= | 45 | //============================================================================= |
48 | 46 | ||
49 | YAHOO.extendX(Clipperz.PM.Components.RecordDetail.TitleComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { | 47 | YAHOO.extendX(Clipperz.PM.Components.RecordDetail.TitleComponent, Clipperz.PM.Components.RecordDetail.AbstractComponent, { |
50 | 48 | ||
51 | 'toString': function() { | 49 | 'toString': function() { |
52 | return "Clipperz.PM.Components.RecordDetail.TitleComponent component"; | 50 | return "Clipperz.PM.Components.RecordDetail.TitleComponent component"; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
56 | 54 | ||
57 | 'value': function() { | 55 | 'value': function() { |
58 | return this.record().label(); | 56 | return this.record().label(); |
59 | }, | 57 | }, |
60 | 58 | ||
61 | 'setValue': function(aValue) { | 59 | 'setValue': function(aValue) { |
62 | this.record().setLabel(aValue); | 60 | this.record().setLabel(aValue); |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | /* | 64 | /* |
67 | 'inputElement': function() { | 65 | 'inputElement': function() { |
68 | return this._inputElement; | 66 | return this._inputElement; |
69 | }, | 67 | }, |
70 | 68 | ||
71 | 'setInputElement': function(aValue) { | 69 | 'setInputElement': function(aValue) { |
72 | this._inputElement = aValue; | 70 | this._inputElement = aValue; |
73 | }, | 71 | }, |
74 | */ | 72 | */ |
75 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
76 | 74 | ||
77 | 'render': function() { | 75 | 'render': function() { |
78 | // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', html:' '}); | 76 | // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', html:' '}); |
79 | // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', colspan:"3", html:' ', children:[ | 77 | // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', colspan:"3", html:' ', children:[ |
80 | // {tag:'div', /*style:'border: 1px solid green;',*/ id:this.getId('title')} | 78 | // {tag:'div', /*style:'border: 1px solid green;',*/ id:this.getId('title')} |
81 | // ]}); | 79 | // ]}); |
82 | // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', html:' '}); | 80 | // Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'td', html:' '}); |
83 | // | 81 | // |
84 | // this.setInputElement(new Clipperz.PM.Components.TextFormField(this.getElement('title'), {editMode:this.editMode(), value:this.value()})); | 82 | // this.setInputElement(new Clipperz.PM.Components.TextFormField(this.getElement('title'), {editMode:this.editMode(), value:this.value()})); |
85 | 83 | ||
86 | this.update(); | 84 | this.update(); |
87 | }, | 85 | }, |
88 | 86 | ||
89 | //------------------------------------------------------------------------- | 87 | //------------------------------------------------------------------------- |
90 | /* | 88 | /* |
91 | 'update': function() { | 89 | 'update': function() { |
92 | this.inputElement().update({value:this.value(), editMode:this.editMode()}); | 90 | this.inputElement().update({value:this.value(), editMode:this.editMode()}); |
93 | }, | 91 | }, |
94 | */ | 92 | */ |
95 | //------------------------------------------------------------------------- | 93 | //------------------------------------------------------------------------- |
96 | 94 | ||
97 | 'updateViewMode': function() { | 95 | 'updateViewMode': function() { |
98 | this.element().update(""); | 96 | this.element().update(""); |
99 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'h2', html:this.value()}); | 97 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'h2', html:this.value()}); |
100 | }, | 98 | }, |
101 | 99 | ||
102 | //------------------------------------------------------------------------- | 100 | //------------------------------------------------------------------------- |
103 | 101 | ||
104 | 'updateEditMode': function() { | 102 | 'updateEditMode': function() { |
105 | //MochiKit.Logging.logDebug(">>> TitleComponent.updateEditMode"); | 103 | //MochiKit.Logging.logDebug(">>> TitleComponent.updateEditMode"); |
106 | // this.getElement('title').update(""); | 104 | // this.getElement('title').update(""); |
107 | // Clipperz.YUI.DomHelper.append(this.getDom('title'), {tag:'div', id:this.getId('title_input')}); | 105 | // Clipperz.YUI.DomHelper.append(this.getDom('title'), {tag:'div', id:this.getId('title_input')}); |
108 | // this.setInputElement(Clipperz.YUI.DomHelper.append(this.getDom('title_input'), {tag:'input', type:'text', value:this.value()}, true)); | 106 | // this.setInputElement(Clipperz.YUI.DomHelper.append(this.getDom('title_input'), {tag:'input', type:'text', value:this.value()}, true)); |
109 | 107 | ||
110 | this.element().update(""); | 108 | this.element().update(""); |
111 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', id:this.getId('titleField'), type:'text', value:"this.value()"}); | 109 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'input', id:this.getId('titleField'), type:'text', value:"this.value()"}); |
112 | this.getElement('titleField').dom.value = this.value(); | 110 | this.getElement('titleField').dom.value = this.value(); |
113 | 111 | ||
114 | //MochiKit.Logging.logDebug("<<< TitleComponent.updateEditMode"); | 112 | //MochiKit.Logging.logDebug("<<< TitleComponent.updateEditMode"); |
115 | }, | 113 | }, |
116 | 114 | ||
117 | //------------------------------------------------------------------------- | 115 | //------------------------------------------------------------------------- |
118 | 116 | ||
119 | 'synchronizeComponentValues': function() { | 117 | 'synchronizeComponentValues': function() { |
120 | var inputElement; | 118 | var inputElement; |
121 | 119 | ||
122 | //MochiKit.Logging.logDebug(">>> TitleComponent.synchronizeComponentValues"); | 120 | //MochiKit.Logging.logDebug(">>> TitleComponent.synchronizeComponentValues"); |
123 | inputElement = this.element().getChildrenByTagName('input')[0]; | 121 | inputElement = this.element().getChildrenByTagName('input')[0]; |
124 | 122 | ||
125 | if (inputElement != null) { | 123 | if (inputElement != null) { |
126 | this.setValue(inputElement.dom.value); | 124 | this.setValue(inputElement.dom.value); |
127 | } | 125 | } |
128 | //MochiKit.Logging.logDebug("<<< TitleComponent.synchronizeComponentValues"); | 126 | //MochiKit.Logging.logDebug("<<< TitleComponent.synchronizeComponentValues"); |
129 | }, | 127 | }, |
130 | 128 | ||
131 | //------------------------------------------------------------------------- | 129 | //------------------------------------------------------------------------- |
132 | __syntaxFix__: "syntax fix" | 130 | __syntaxFix__: "syntax fix" |
133 | }); | 131 | }); |
134 | 132 | ||