summaryrefslogtreecommitdiff
path: root/lib/scripts/domLib.js
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-10-29 02:26:52 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-10-29 02:26:52 +0200
commitbad31ae944f074dab12f7a6d1362775d8f2b18dd (patch)
treeaf7ed25d7d8ef9c2c836afdd21b1ee7398db3dcd /lib/scripts/domLib.js
parent551242f8292dd257969d52089332f6ddb8bd70b2 (diff)
downloadrpg-bad31ae944f074dab12f7a6d1362775d8f2b18dd.tar.gz
rpg-bad31ae944f074dab12f7a6d1362775d8f2b18dd.tar.bz2
JavaScript refactoring
This patch addes a first go on a central javascript and CSS dispatcher which builds a single script from all needed scripts, does optimizing and caching. darcs-hash:20051029002652-7ad00-7558b569c2bf65f5e41820644580d97c62edd0d6.gz
Diffstat (limited to 'lib/scripts/domLib.js')
-rw-r--r--lib/scripts/domLib.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/scripts/domLib.js b/lib/scripts/domLib.js
index 9dd3af463..e46c6fecf 100644
--- a/lib/scripts/domLib.js
+++ b/lib/scripts/domLib.js
@@ -65,7 +65,7 @@ var domLib_isIE6up = domLib_isIE55up && !domLib_isIE55;
var domLib_standardsMode = (document.compatMode && document.compatMode == 'CSS1Compat');
var domLib_useLibrary = (domLib_isOpera7up || domLib_isKHTML || domLib_isIE5up || domLib_isGecko || domLib_isMacIE || document.defaultView);
// fixed in Konq3.2
-var domLib_hasBrokenTimeout = (domLib_isMacIE || (domLib_isKonq && domLib_userAgent.match(/konqueror\/3.([2-9])/) == null));
+var domLib_hasBrokenTimeout = (domLib_isMacIE || (domLib_isKonq && domLib_userAgent.match(/konqueror\/3.([2-9])/) === null));
var domLib_canFade = (domLib_isGecko || domLib_isIE || domLib_isSafari || domLib_isOpera);
var domLib_canDrawOverSelect = (domLib_isMac || domLib_isOpera || domLib_isGecko);
var domLib_canDrawOverFlash = (domLib_isMac || domLib_isWin);
@@ -109,7 +109,7 @@ function domLib_clone(obj)
var value = obj[i];
try
{
- if (value != null && typeof(value) == 'object' && value != window && !value.nodeType)
+ if (value !== null && typeof(value) == 'object' && value != window && !value.nodeType)
{
copy[i] = domLib_clone(value);
}
@@ -153,7 +153,7 @@ function Hash()
Hash.prototype.get = function(in_key)
{
return this.elementData[in_key];
-}
+};
Hash.prototype.set = function(in_key, in_value)
{
@@ -168,11 +168,12 @@ Hash.prototype.set = function(in_key, in_value)
}
}
- return this.elementData[in_key] = in_value;
+ this.elementData[in_key] = in_value;
+ return this.elementData[in_key];
}
return false;
-}
+};
Hash.prototype.remove = function(in_key)
{
@@ -190,17 +191,17 @@ Hash.prototype.remove = function(in_key)
}
return tmp_value;
-}
+};
Hash.prototype.size = function()
{
return this.length;
-}
+};
Hash.prototype.has = function(in_key)
{
return typeof(this.elementData[in_key]) != 'undefined';
-}
+};
Hash.prototype.find = function(in_obj)
{
@@ -211,7 +212,7 @@ Hash.prototype.find = function(in_obj)
return tmp_key;
}
}
-}
+};
Hash.prototype.merge = function(in_hash)
{
@@ -228,7 +229,7 @@ Hash.prototype.merge = function(in_hash)
this.elementData[tmp_key] = in_hash.elementData[tmp_key];
}
-}
+};
Hash.prototype.compare = function(in_hash)
{
@@ -246,7 +247,7 @@ Hash.prototype.compare = function(in_hash)
}
return true;
-}
+};
// }}}
// {{{ domLib_isDescendantOf()
@@ -341,7 +342,7 @@ function domLib_detectCollisions(in_object, in_recover, in_useCache)
return;
}
- else if (domLib_collisionElements.length == 0)
+ else if (domLib_collisionElements.length === 0)
{
return;
}
@@ -349,9 +350,9 @@ function domLib_detectCollisions(in_object, in_recover, in_useCache)
// okay, we have a tip, so hunt and destroy
var objectOffsets = domLib_getOffsets(in_object);
- for (var cnt = 0; cnt < domLib_collisionElements.length; cnt++)
+ for (cnt = 0; cnt < domLib_collisionElements.length; cnt++)
{
- var thisElement = domLib_collisionElements[cnt];
+ thisElement = domLib_collisionElements[cnt];
// if collision element is in active element, move on
// WARNING: is this too costly?
@@ -442,8 +443,7 @@ function domLib_getOffsets(in_object)
'bottom', offsetTop + originalHeight,
'leftCenter', offsetLeft + originalWidth/2,
'topCenter', offsetTop + originalHeight/2,
- 'radius', Math.max(originalWidth, originalHeight)
- );
+ 'radius', Math.max(originalWidth, originalHeight) );
}
// }}}
@@ -461,7 +461,7 @@ function domLib_setTimeout(in_function, in_timeout, in_args)
// timeout event is disabled
return;
}
- else if (in_timeout == 0)
+ else if (in_timeout === 0)
{
in_function(in_args);
return 0;
@@ -500,7 +500,7 @@ function domLib_clearTimeout(in_id)
{
if (domLib_timeoutStates.has(in_id))
{
- clearTimeout(domLib_timeoutStates.get(in_id).get('timeoutId'))
+ clearTimeout(domLib_timeoutStates.get(in_id).get('timeoutId'));
domLib_timeoutStates.remove(in_id);
}
}
@@ -631,7 +631,7 @@ function domLib_getComputedStyle(in_obj, in_property)
// getComputedStyle() is broken in konqueror, so let's go for the style object
else if (domLib_isKonq)
{
- var humpBackProp = in_property.replace(/-(.)/, function (a, b) { return b.toUpperCase(); });
+ humpBackProp = in_property.replace(/-(.)/, function (a, b) { return b.toUpperCase(); });
return eval('in_obj.style.' + in_property);
}
else