summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/js.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-01 15:20:30 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-01 15:20:30 +0000
commitd6c398a22edb09dffc3f7589635897c78b1fae62 (patch)
treee8156cb24679a71056b0312c5dbe953fb1911b14 /frontends/php/include/js.inc.php
parentc5b41261327759f046d89ed339e309b9535213e5 (diff)
downloadzabbix-d6c398a22edb09dffc3f7589635897c78b1fae62.tar.gz
zabbix-d6c398a22edb09dffc3f7589635897c78b1fae62.tar.xz
zabbix-d6c398a22edb09dffc3f7589635897c78b1fae62.zip
- [DEV-54] added zoom for screens (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4965 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/js.inc.php')
-rw-r--r--frontends/php/include/js.inc.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/frontends/php/include/js.inc.php b/frontends/php/include/js.inc.php
index e5b1df96..2a59a364 100644
--- a/frontends/php/include/js.inc.php
+++ b/frontends/php/include/js.inc.php
@@ -54,13 +54,14 @@ function zbx_add_post_js($script)
}
-function get_js_sizeable_graph($url){
+function get_js_sizeable_graph($dom_graph_id,$url){
return '
<script language="JavaScript" type="text/javascript">
<!--
- var ZBX_GZ_shiftT = 17;
- var ZBX_GZ_shiftL = 10;
+ A_SBOX["'.$dom_graph_id.'"] = new Object;
+ A_SBOX["'.$dom_graph_id.'"].shiftT = 17;
+ A_SBOX["'.$dom_graph_id.'"].shiftL = 10;
var ZBX_G_WIDTH;
if(window.innerWidth) ZBX_G_WIDTH=window.innerWidth;
@@ -68,14 +69,14 @@ return '
ZBX_G_WIDTH-= 80;
- insert_sizeable_graph('.zbx_jsvalue($url).');
+ insert_sizeable_graph('.zbx_jsvalue($dom_graph_id).','.zbx_jsvalue($url).');
-->
</script>
';
}
-function get_dynamic_chart($img_src,$width=0){
+function get_dynamic_chart($dom_graph_id,$img_src,$width=0){
if(is_int($width) && $width > 0) $img_src.= url_param($width, false, 'width');
$result = '
<script language="JavaScript" type="text/javascript">
@@ -83,8 +84,9 @@ function get_dynamic_chart($img_src,$width=0){
var width = "'.((!(is_int($width) && $width > 0)) ? $width : '').'";
var img_src = "'.$img_src.'";
- var ZBX_GZ_shiftT = 17;
- var ZBX_GZ_shiftL = 10;
+ A_SBOX["'.$dom_graph_id.'"] = new Object;
+ A_SBOX["'.$dom_graph_id.'"].shiftT = 17;
+ A_SBOX["'.$dom_graph_id.'"].shiftL = 10;
var ZBX_G_WIDTH;
@@ -101,7 +103,7 @@ function get_dynamic_chart($img_src,$width=0){
ZBX_G_WIDTH = '.$width.';
}
- document.write(\'<img alt="chart" src="\'+img_src + width +\'" />\');
+ document.write(\'<img src="\'+img_src + width +\'" alt="chart" id="'.$dom_graph_id.'" />\');
-->
</script>';
return $result;
@@ -186,4 +188,8 @@ function insert_js_function($fnct_name){
break;
}
}
+
+function insert_js($script){
+print('<script type="text/javascript">'."\n".$script."\n".'</script>');
+}
?>