Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/BaseComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/BaseComponent.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js b/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js index f3a3902..07c0b97 100644 --- a/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js +++ b/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js | |||
@@ -1,121 +1,119 @@ | |||
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 | 27 | ||
30 | //############################################################################# | 28 | //############################################################################# |
31 | 29 | ||
32 | var _Clipperz_PM_Components_Panels_base_id_ = 0; | 30 | var _Clipperz_PM_Components_Panels_base_id_ = 0; |
33 | 31 | ||
34 | //############################################################################# | 32 | //############################################################################# |
35 | 33 | ||
36 | Clipperz.PM.Components.BaseComponent = function(anElement, args) { | 34 | Clipperz.PM.Components.BaseComponent = function(anElement, args) { |
37 | args = args || {}; | 35 | args = args || {}; |
38 | //MochiKit.Base.bindMethods(this); | 36 | //MochiKit.Base.bindMethods(this); |
39 | //Clipperz.PM.Components.BaseComponent.superclass.constructor.call(this, args); | 37 | //Clipperz.PM.Components.BaseComponent.superclass.constructor.call(this, args); |
40 | 38 | ||
41 | this._element = anElement; | 39 | this._element = anElement; |
42 | this._ids = {}; | 40 | this._ids = {}; |
43 | 41 | ||
44 | return this; | 42 | return this; |
45 | } | 43 | } |
46 | 44 | ||
47 | //============================================================================= | 45 | //============================================================================= |
48 | 46 | ||
49 | //MochiKit.Base.update(Clipperz.PM.Components.BaseComponent.prototype, { | 47 | //MochiKit.Base.update(Clipperz.PM.Components.BaseComponent.prototype, { |
50 | YAHOO.extendX(Clipperz.PM.Components.BaseComponent, YAHOO.ext.util.Observable, { | 48 | YAHOO.extendX(Clipperz.PM.Components.BaseComponent, YAHOO.ext.util.Observable, { |
51 | 49 | ||
52 | 'isClipperzPMComponent': true, | 50 | 'isClipperzPMComponent': true, |
53 | 51 | ||
54 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
55 | 53 | ||
56 | 'toString': function () { | 54 | 'toString': function () { |
57 | return "Clipperz.PM.Components.BaseComponent component"; | 55 | return "Clipperz.PM.Components.BaseComponent component"; |
58 | }, | 56 | }, |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'domHelper': function() { | 60 | 'domHelper': function() { |
63 | return Clipperz.YUI.DomHelper; | 61 | return Clipperz.YUI.DomHelper; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'element': function() { | 66 | 'element': function() { |
69 | //MochiKit.Logging.logDebug(">>> BaseComponent.element"); | 67 | //MochiKit.Logging.logDebug(">>> BaseComponent.element"); |
70 | return this._element; | 68 | return this._element; |
71 | }, | 69 | }, |
72 | 70 | ||
73 | 'setElement': function(aValue) { | 71 | 'setElement': function(aValue) { |
74 | this._element = aValue; | 72 | this._element = aValue; |
75 | }, | 73 | }, |
76 | 74 | ||
77 | //----------------------------------------------------- | 75 | //----------------------------------------------------- |
78 | 76 | ||
79 | 'remove': function() { | 77 | 'remove': function() { |
80 | //MochiKit.Logging.logDebug(">>> BaseComponent.remove"); | 78 | //MochiKit.Logging.logDebug(">>> BaseComponent.remove"); |
81 | Clipperz.NotificationCenter.unregister(this); | 79 | Clipperz.NotificationCenter.unregister(this); |
82 | MochiKit.Signal.disconnectAllTo(this); | 80 | MochiKit.Signal.disconnectAllTo(this); |
83 | //MochiKit.Logging.logDebug("<<< BaseComponent.remove"); | 81 | //MochiKit.Logging.logDebug("<<< BaseComponent.remove"); |
84 | }, | 82 | }, |
85 | 83 | ||
86 | //------------------------------------------------------------------------- | 84 | //------------------------------------------------------------------------- |
87 | 85 | ||
88 | 'getId': function(aValue) { | 86 | 'getId': function(aValue) { |
89 | varresult; | 87 | varresult; |
90 | 88 | ||
91 | result = this._ids[aValue]; | 89 | result = this._ids[aValue]; |
92 | 90 | ||
93 | if (typeof(result) == 'undefined') { | 91 | if (typeof(result) == 'undefined') { |
94 | _Clipperz_PM_Components_Panels_base_id_ ++; | 92 | _Clipperz_PM_Components_Panels_base_id_ ++; |
95 | 93 | ||
96 | result = "Clipperz_PM_Components_Panels_" + aValue + "_" + _Clipperz_PM_Components_Panels_base_id_; | 94 | result = "Clipperz_PM_Components_Panels_" + aValue + "_" + _Clipperz_PM_Components_Panels_base_id_; |
97 | this._ids[aValue] = result; | 95 | this._ids[aValue] = result; |
98 | //MochiKit.Logging.logDebug(">>> getId(" + aValue + ") = " + result); | 96 | //MochiKit.Logging.logDebug(">>> getId(" + aValue + ") = " + result); |
99 | } else { | 97 | } else { |
100 | //MochiKit.Logging.logDebug("<<< getId(" + aValue + ") = " + result); | 98 | //MochiKit.Logging.logDebug("<<< getId(" + aValue + ") = " + result); |
101 | } | 99 | } |
102 | 100 | ||
103 | return result; | 101 | return result; |
104 | }, | 102 | }, |
105 | 103 | ||
106 | 'getDom': function(aValue) { | 104 | 'getDom': function(aValue) { |
107 | return YAHOO.util.Dom.get(this.getId(aValue)); | 105 | return YAHOO.util.Dom.get(this.getId(aValue)); |
108 | }, | 106 | }, |
109 | 107 | ||
110 | 'getElement': function(aValue) { | 108 | 'getElement': function(aValue) { |
111 | return YAHOO.ext.Element.get(this.getId(aValue)); | 109 | return YAHOO.ext.Element.get(this.getId(aValue)); |
112 | }, | 110 | }, |
113 | 111 | ||
114 | 'getActor': function(aValue, anAnimator) { | 112 | 'getActor': function(aValue, anAnimator) { |
115 | return new YAHOO.ext.Actor(this.getDom(aValue), anAnimator); | 113 | return new YAHOO.ext.Actor(this.getDom(aValue), anAnimator); |
116 | }, | 114 | }, |
117 | 115 | ||
118 | //------------------------------------------------------------------------- | 116 | //------------------------------------------------------------------------- |
119 | __syntaxFix__: "syntax fix" | 117 | __syntaxFix__: "syntax fix" |
120 | 118 | ||
121 | }); | 119 | }); |