summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js
Unidiff
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.js124
1 files changed, 124 insertions, 0 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js b/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js
new file mode 100644
index 0000000..67e257b
--- a/dev/null
+++ b/frontend/beta/js/Clipperz/PM/Components/BaseComponent.js
@@ -0,0 +1,124 @@
1/*
2
3Copyright 2008-2011 Clipperz Srl
4
5This file is part of Clipperz's Javascript Crypto Library.
6Javascript Crypto Library provides web developers with an extensive
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please
11refer 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
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
31if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; }
32
33//#############################################################################
34
35var _Clipperz_PM_Components_Panels_base_id_ = 0;
36
37//#############################################################################
38
39Clipperz.PM.Components.BaseComponent = function(anElement, args) {
40 args = args || {};
41 //MochiKit.Base.bindMethods(this);
42 //Clipperz.PM.Components.BaseComponent.superclass.constructor.call(this, args);
43
44 this._element = anElement;
45 this._ids = {};
46
47 return this;
48}
49
50//=============================================================================
51
52//MochiKit.Base.update(Clipperz.PM.Components.BaseComponent.prototype, {
53YAHOO.extendX(Clipperz.PM.Components.BaseComponent, YAHOO.ext.util.Observable, {
54
55 'isClipperzPMComponent': true,
56
57 //-------------------------------------------------------------------------
58
59 'toString': function () {
60 return "Clipperz.PM.Components.BaseComponent component";
61 },
62
63 //-------------------------------------------------------------------------
64
65 'domHelper': function() {
66 return Clipperz.YUI.DomHelper;
67 },
68
69 //-------------------------------------------------------------------------
70
71 'element': function() {
72//MochiKit.Logging.logDebug(">>> BaseComponent.element");
73 return this._element;
74 },
75
76 'setElement': function(aValue) {
77 this._element = aValue;
78 },
79
80 //-----------------------------------------------------
81
82 'remove': function() {
83//MochiKit.Logging.logDebug(">>> BaseComponent.remove");
84 Clipperz.NotificationCenter.unregister(this);
85 MochiKit.Signal.disconnectAllTo(this);
86//MochiKit.Logging.logDebug("<<< BaseComponent.remove");
87 },
88
89 //-------------------------------------------------------------------------
90
91 'getId': function(aValue) {
92 varresult;
93
94 result = this._ids[aValue];
95
96 if (typeof(result) == 'undefined') {
97 _Clipperz_PM_Components_Panels_base_id_ ++;
98
99 result = "Clipperz_PM_Components_Panels_" + aValue + "_" + _Clipperz_PM_Components_Panels_base_id_;
100 this._ids[aValue] = result;
101//MochiKit.Logging.logDebug(">>> getId(" + aValue + ") = " + result);
102 } else {
103//MochiKit.Logging.logDebug("<<< getId(" + aValue + ") = " + result);
104 }
105
106 return result;
107 },
108
109 'getDom': function(aValue) {
110 return YAHOO.util.Dom.get(this.getId(aValue));
111 },
112
113 'getElement': function(aValue) {
114 return YAHOO.ext.Element.get(this.getId(aValue));
115 },
116
117 'getActor': function(aValue, anAnimator) {
118 return new YAHOO.ext.Actor(this.getDom(aValue), anAnimator);
119 },
120
121 //-------------------------------------------------------------------------
122 __syntaxFix__: "syntax fix"
123
124});