summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bubble.js36
1 files changed, 27 insertions, 9 deletions
diff --git a/bubble.js b/bubble.js
index 1d715b1..935a7d7 100644
--- a/bubble.js
+++ b/bubble.js
@@ -36,11 +36,11 @@ function WSR_getElementsByClassName(_2,_3,_4){
function bindBubbles(e){
lbActions=WSR_getElementsByClassName(document,"a","bubble");
for(i=0;i<lbActions.length;i++){
- if(window.addEventListener){
+ if(window.addEventListener){ // Mozilla, Firefox
lbActions[i].addEventListener("mouseover",attachBubble,false);
lbActions[i].addEventListener("mouseout",detachBubble,false);
lbActions[i].addEventListener("click",detachBubble,false);
- }else{
+ }else{ // IE
lbActions[i].attachEvent("onmouseover",attachBubble);
lbActions[i].attachEvent("onmouseout",detachBubble);
lbActions[i].attachEvent("onclick",detachBubble);
@@ -50,9 +50,9 @@ function bindBubbles(e){
function attachBubble(_b){
var _c;
- if(_b["srcElement"]){
+ if(_b["srcElement"]){ // IE
_c=_b["srcElement"];
- }else{
+ }else{ // Mozilla, Firefox
_c=_b["target"];
}
if (_c.href == undefined){
@@ -268,12 +268,30 @@ var BrowserDetect = {
};
-function var_dump(obj) {
- if(typeof obj == "object") {
- return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "")+"\nValue: " + obj;
- } else {
- return "Type: "+typeof(obj)+"\nValue: "+obj;
+function var_dump(arr,level) {
+ var dumped_text = "";
+ if(!level) level = 0;
+
+ //The padding given at the beginning of the line.
+ var level_padding = "";
+ for(var j=0;j<level+1;j++) level_padding += " ";
+
+ if(typeof(arr) == 'object') { //Array/Hashes/Objects
+ for(var item in arr) {
+ var value = arr[item];
+
+ if(typeof(value) == 'object') { //If it is an array,
+ dumped_text += level_padding + "'" + item + "' ...\n";
+ dumped_text += dump(value,level+1);
+ } else {
+ dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
+ }
+ }
+ } else { //Stings/Chars/Numbers etc.
+ dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}
+ return dumped_text;
+
}//end function var_dump
function get_page_height()