summaryrefslogtreecommitdiff
path: root/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js
Unidiff
Diffstat (limited to 'frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js b/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js
index f8e0cb1..11b7a6c 100644
--- a/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js
+++ b/frontend/beta/js/Clipperz/YUI/IBLayoutRegion.js
@@ -1,118 +1,116 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer 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
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; } 25if (typeof(Clipperz.YUI) == 'undefined') { Clipperz.YUI = {}; }
28 26
29 27
30Clipperz.YUI.IBLayoutRegion = function(aManager, aName, aConfig) { 28Clipperz.YUI.IBLayoutRegion = function(aManager, aName, aConfig) {
31 this._configuration = aConfig; 29 this._configuration = aConfig;
32 30
33 //Clipperz.YUI.IBLayoutRegion.superclass.constructor.call(); 31 //Clipperz.YUI.IBLayoutRegion.superclass.constructor.call();
34 Clipperz.YUI.IBLayoutRegion.superclass.constructor.call(this, aManager, aConfig, aName); 32 Clipperz.YUI.IBLayoutRegion.superclass.constructor.call(this, aManager, aConfig, aName);
35}; 33};
36 34
37YAHOO.extendX(Clipperz.YUI.IBLayoutRegion, YAHOO.ext.LayoutRegion, { 35YAHOO.extendX(Clipperz.YUI.IBLayoutRegion, YAHOO.ext.LayoutRegion, {
38 36
39 'toString': function() { 37 'toString': function() {
40 return "IBLayoutRegion (" + this.name() + ")"; 38 return "IBLayoutRegion (" + this.name() + ")";
41 }, 39 },
42 40
43 //----------------------------------------------------- 41 //-----------------------------------------------------
44 42
45 'name': function() { 43 'name': function() {
46 return this.position; 44 return this.position;
47 }, 45 },
48 46
49 //----------------------------------------------------- 47 //-----------------------------------------------------
50 48
51 'manager': function() { 49 'manager': function() {
52 return this.mgr; 50 return this.mgr;
53 }, 51 },
54 52
55 'configuration': function() { 53 'configuration': function() {
56 return this._configuration; 54 return this._configuration;
57 }, 55 },
58 56
59 //----------------------------------------------------- 57 //-----------------------------------------------------
60 58
61 'getAttributeValue': function(anAttribute) { 59 'getAttributeValue': function(anAttribute) {
62 var result; 60 var result;
63 61
64 switch(anAttribute) { 62 switch(anAttribute) {
65 case "top": 63 case "top":
66 result = this.element().getTop(); 64 result = this.element().getTop();
67 break; 65 break;
68 case "left": 66 case "left":
69 result = this.element().getLeft(); 67 result = this.element().getLeft();
70 break; 68 break;
71 case "bottom": 69 case "bottom":
72 result = this.element().getBottom(); 70 result = this.element().getBottom();
73 break; 71 break;
74 case "right": 72 case "right":
75 result = this.element().getRight(); 73 result = this.element().getRight();
76 break; 74 break;
77 case "height": 75 case "height":
78 result = this.element().getHeight(); 76 result = this.element().getHeight();
79 break; 77 break;
80 case "width": 78 case "width":
81 result = this.element().getWidth(); 79 result = this.element().getWidth();
82 break; 80 break;
83 } 81 }
84//MochiKit.Logging.logDebug("--- " + this.name() + " [" + anAttribute + "] = " + result); 82//MochiKit.Logging.logDebug("--- " + this.name() + " [" + anAttribute + "] = " + result);
85 83
86 return result; 84 return result;
87 }, 85 },
88 86
89 //----------------------------------------------------- 87 //-----------------------------------------------------
90 88
91 'normalizeConfigureValue': function(aConfigurationValue) { 89 'normalizeConfigureValue': function(aConfigurationValue) {
92 var result; 90 var result;
93 91
94//MochiKit.Logging.logDebug("--- normalizeConfigureValue - " + aConfigurationValue); 92//MochiKit.Logging.logDebug("--- normalizeConfigureValue - " + aConfigurationValue);
95 if (typeof(aConfigurationValue) == 'number') { 93 if (typeof(aConfigurationValue) == 'number') {
96 result = aConfigurationValue; 94 result = aConfigurationValue;
97 } else if (aConfigurationValue == 'auto') { 95 } else if (aConfigurationValue == 'auto') {
98 result = aConfigurationValue; 96 result = aConfigurationValue;
99 } else { 97 } else {
100 var splitValues; 98 var splitValues;
101 var referenceValue; 99 var referenceValue;
102 var deltaValue; 100 var deltaValue;
103 var targetRegion; 101 var targetRegion;
104 var targetAttribute; 102 var targetAttribute;
105 103
106 splitValues = aConfigurationValue.split('+'); 104 splitValues = aConfigurationValue.split('+');
107 referenceValue = Clipperz.Base.trim(splitValues[0]); 105 referenceValue = Clipperz.Base.trim(splitValues[0]);
108 deltaValue = Clipperz.Base.trim(splitValues[1] || ""); 106 deltaValue = Clipperz.Base.trim(splitValues[1] || "");
109 107
110 splitValues = referenceValue.split('.'); 108 splitValues = referenceValue.split('.');
111 targetRegion = splitValues[0]; 109 targetRegion = splitValues[0];
112 targetAttribute = splitValues[1]; 110 targetAttribute = splitValues[1];
113 111
114//MochiKit.Logging.logDebug("> " + aConfigurationValue); 112//MochiKit.Logging.logDebug("> " + aConfigurationValue);
115//MochiKit.Logging.logDebug(">> manager: " + this.manager()); 113//MochiKit.Logging.logDebug(">> manager: " + this.manager());
116//MochiKit.Logging.logDebug(">> targetRegion: " + targetRegion); 114//MochiKit.Logging.logDebug(">> targetRegion: " + targetRegion);
117//MochiKit.Logging.logDebug(">>> " + this.manager().getRegion(targetRegion)); 115//MochiKit.Logging.logDebug(">>> " + this.manager().getRegion(targetRegion));
118 targetValue = this.manager().getRegion(targetRegion).getAttributeValue(targetAttribute); 116 targetValue = this.manager().getRegion(targetRegion).getAttributeValue(targetAttribute);