diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-12 15:26:10 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-12 15:26:10 +0000 |
| commit | e0804e0b83b63f79b4d61c20d9cfece0f2ca0db1 (patch) | |
| tree | 85492e5f0d2b084f70a03852bbda8de46be80728 /frontends | |
| parent | c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a (diff) | |
| download | zabbix-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')
| -rw-r--r-- | frontends/php/graphs.php | 4 | ||||
| -rw-r--r-- | frontends/php/include/forms.inc.php | 4 | ||||
| -rw-r--r-- | frontends/php/js/common.js | 14 | ||||
| -rw-r--r-- | frontends/php/js/gmenu.js | 18 | ||||
| -rw-r--r-- | frontends/php/js/sbinit.js | 25 | ||||
| -rw-r--r-- | frontends/php/js/sbox.js | 8 |
6 files changed, 40 insertions, 33 deletions
diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index 4fec67d7..bb88ae7b 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -288,12 +288,12 @@ include_once "include/page_header.php"; echo BR; $table = new CTable(NULL,"graph"); if(($_REQUEST['graphtype'] == GRAPH_TYPE_PIE) || ($_REQUEST['graphtype'] == GRAPH_TYPE_EXPLODED)){ - $table->AddRow(new CImg('chart7.php?period=3600&from=0'.url_param('items'). + $table->AddRow(new CImg('chart7.php?period=3600'.url_param('items'). url_param('name').url_param('legend').url_param('graph3d').url_param('width').url_param('height').url_param('graphtype'))); $table->Show(); } else { - $table->AddRow(new CImg('chart3.php?period=3600&from=0'.url_param('items'). + $table->AddRow(new CImg('chart3.php?period=3600'.url_param('items'). url_param('name').url_param('width').url_param('height').url_param('yaxistype'). url_param('yaxismin').url_param('yaxismax').url_param('show_work_period'). url_param('show_triggers').url_param('graphtype'))); diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 45e8408c..ff86a87f 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -2599,11 +2599,11 @@ array( $items_table, new CButton('add_item',S_ADD, - 'return PopUp("popup_gitem.php?dstfrm='.$frmGraph->GetName(). + "return PopUp('popup_gitem.php?dstfrm=".$frmGraph->GetName(). url_param($only_hostid, false, 'only_hostid'). url_param($monitored_hosts, false, 'monitored_hosts'). url_param($graphtype, false, 'graphtype'). - '",550,400,"graph_item_form");'), + "',550,400,'graph_item_form');"), $dedlete_button )); unset($items_table, $dedlete_button); 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; |
