summaryrefslogtreecommitdiffstats
path: root/frontends/php/js
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-12 15:26:10 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-12 15:26:10 +0000
commite0804e0b83b63f79b4d61c20d9cfece0f2ca0db1 (patch)
tree85492e5f0d2b084f70a03852bbda8de46be80728 /frontends/php/js
parentc0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a (diff)
downloadzabbix-e0804e0b83b63f79b4d61c20d9cfece0f2ca0db1.tar.gz
zabbix-e0804e0b83b63f79b4d61c20d9cfece0f2ca0db1.tar.xz
zabbix-e0804e0b83b63f79b4d61c20d9cfece0f2ca0db1.zip
- added adjusts for better support of Safari v.3 (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4997 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/js')
-rw-r--r--frontends/php/js/common.js14
-rw-r--r--frontends/php/js/gmenu.js18
-rw-r--r--frontends/php/js/sbinit.js25
-rw-r--r--frontends/php/js/sbox.js8
4 files changed, 36 insertions, 29 deletions
diff --git a/frontends/php/js/common.js b/frontends/php/js/common.js
index 0b0917d7..d7bcb930 100644
--- a/frontends/php/js/common.js
+++ b/frontends/php/js/common.js
@@ -16,16 +16,22 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
-var OP = window.opera?true:false;
-var IE = ((!OP) && (document.all))?true:false;
+var agt = navigator.userAgent.toLowerCase();
+var OP = (agt.indexOf("opera") != -1) && window.opera;
+var IE = (agt.indexOf("msie") != -1) && document.all && !OP;
+var SF = (agt.indexOf("safari") != -1) ;
function isset(obj){
return (typeof(obj) != 'undefined');
}
function empty(obj){
- if(is_null(obj) || !obj) return true;
- return false;
+ if(is_null(obj)) return true;
+ if(obj == false) return true;
+ if((obj == 0) || (obj == '0')) return true;
+ if(is_string(obj) && (obj == '')) return true;
+ if(is_array(obj) && (obj.length == 0)) return true;
+return false;
}
function is_null(obj){
diff --git a/frontends/php/js/gmenu.js b/frontends/php/js/gmenu.js
index 837007ce..89cb2f8a 100644
--- a/frontends/php/js/gmenu.js
+++ b/frontends/php/js/gmenu.js
@@ -90,15 +90,7 @@ function gmenuinit(top,left,period,bar_stime){
}
}
- if(!IE){
- G_MENU.gm_gmenu.addEventListener('mouseover',gm_gm_msover,true);
-
- G_MENU.gm_gmenu.addEventListener('mouseout',gm_gm_msout,false);
-
- $('gmenu_load').addEventListener('click',G_MENU.ongmload.bindAsEventListener(G_MENU),false);
- $('gmenu_hide').addEventListener('click',G_MENU.gmenuhide.bindAsEventListener(G_MENU),false);
- }
- else{
+ if(IE){
G_MENU.gm_gmenu.attachEvent('onmouseover',gm_gm_msover);
G_MENU.gm_gmenu.attachEvent('onmouseout',gm_gm_msout);
@@ -106,6 +98,14 @@ function gmenuinit(top,left,period,bar_stime){
$('gmenu_load').attachEvent('onclick',G_MENU.ongmload.bindAsEventListener(G_MENU));
$('gmenu_hide').attachEvent('onclick',G_MENU.gmenuhide.bindAsEventListener(G_MENU));
}
+ else{
+ G_MENU.gm_gmenu.addEventListener('mouseover',gm_gm_msover,true);
+
+ G_MENU.gm_gmenu.addEventListener('mouseout',gm_gm_msout,false);
+
+ $('gmenu_load').addEventListener('click',G_MENU.ongmload.bindAsEventListener(G_MENU),false);
+ $('gmenu_hide').addEventListener('click',G_MENU.gmenuhide.bindAsEventListener(G_MENU),false);
+ }
diff --git a/frontends/php/js/sbinit.js b/frontends/php/js/sbinit.js
index 7f408ed3..5713d5a5 100644
--- a/frontends/php/js/sbinit.js
+++ b/frontends/php/js/sbinit.js
@@ -51,11 +51,11 @@ function showgraphmenu(obj_id){
G_MENU.gmenushow();
}
}
- if(!IE){
- $('scroll_calendar').addEventListener('click',gmshow,false);
+ if(IE){
+ $('scroll_calendar').attachEvent('onclick',gmshow);
}
else{
- $('scroll_calendar').attachEvent('onclick',gmshow);
+ $('scroll_calendar').addEventListener('click',gmshow,false);
}
var date = datetoarray(G_MENU.bstime);
@@ -126,23 +126,24 @@ function graph_zoom_init(graph_id,stime,period,width,height){
A_SBOX[graph_id].sbox.dom_obj = boxongraph;
- if(OP){
+ if(IE){
+// boxongraph.attachEvent('onmousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox));
+ igraph.attachEvent('onmousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox));
+// boxongraph.attachEvent('onmousemove',A_SBOX[graph_id].sbox.mousemove.bindAsEventListener(A_SBOX[graph_id].sbox));
+ igraph.onmousemove = A_SBOX[graph_id].sbox.mousemove.bind(A_SBOX[graph_id].sbox);
+ document.attachEvent('onmouseup',A_SBOX[graph_id].sbox.mouseup.bindAsEventListener(A_SBOX[graph_id].sbox));
+ }
+ else if(OP){
boxongraph.addEventListener('mousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox),false);
boxongraph.onmousemove = A_SBOX[graph_id].sbox.mousemove.bind(A_SBOX[graph_id].sbox);
document.addEventListener('mouseup',A_SBOX[graph_id].sbox.mouseup.bindAsEventListener(A_SBOX[graph_id].sbox),true);
}
- else if(!IE){
+ else{
boxongraph.addEventListener('mousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox),false);
boxongraph.onmousemove = A_SBOX[graph_id].sbox.mousemove.bind(A_SBOX[graph_id].sbox);
document.addEventListener('mouseup',A_SBOX[graph_id].sbox.mouseup.bindAsEventListener(A_SBOX[graph_id].sbox),true);
}
- else{
-// boxongraph.attachEvent('onmousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox));
- igraph.attachEvent('onmousedown',A_SBOX[graph_id].sbox.mousedown.bindAsEventListener(A_SBOX[graph_id].sbox));
-// boxongraph.attachEvent('onmousemove',A_SBOX[graph_id].sbox.mousemove.bindAsEventListener(A_SBOX[graph_id].sbox));
- igraph.onmousemove = A_SBOX[graph_id].sbox.mousemove.bind(A_SBOX[graph_id].sbox);
- document.attachEvent('onmouseup',A_SBOX[graph_id].sbox.mouseup.bindAsEventListener(A_SBOX[graph_id].sbox));
- }
+
A_SBOX[graph_id].sbox.sboxload = sboxload;
}
diff --git a/frontends/php/js/sbox.js b/frontends/php/js/sbox.js
index b693bff3..6325c480 100644
--- a/frontends/php/js/sbox.js
+++ b/frontends/php/js/sbox.js
@@ -149,13 +149,13 @@ create_box: function(){
this.dom_box.style.height = height+'px';
this.box.height = height;
- if(!IE){
- this.dom_box.addEventListener('mousemove',A_SBOX[this.sbox_id].sbox.mousemove.bindAsEventListener(A_SBOX[this.sbox_id].sbox),true);
- }
- else{
+ if(IE){
// this.dom_box.attachEvent('onmousemove',S_BOX.mousemove.bindAsEventListener(S_BOX));
this.dom_box.onmousemove = A_SBOX[this.sbox_id].sbox.mousemove.bind(A_SBOX[this.sbox_id].sbox);
}
+ else{
+ this.dom_box.addEventListener('mousemove',A_SBOX[this.sbox_id].sbox.mousemove.bindAsEventListener(A_SBOX[this.sbox_id].sbox),true);
+ }
this.start_event.top = this.mouse_event.top;
this.start_event.left = this.mouse_event.left;