diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-26 12:46:19 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-26 12:46:19 +0000 |
commit | 9d240eca134c2433ac0a548a2b7fbe1fccc7c66d (patch) | |
tree | cd3d46256d09ca370f385dccf2082d0d33d96e78 /frontends/php/js | |
parent | 63ce91166a8ecd8550db063ba9d9d914ec270e4c (diff) | |
download | zabbix-9d240eca134c2433ac0a548a2b7fbe1fccc7c66d.tar.gz zabbix-9d240eca134c2433ac0a548a2b7fbe1fccc7c66d.tar.xz zabbix-9d240eca134c2433ac0a548a2b7fbe1fccc7c66d.zip |
- [DEV-177] added checkbox range selection (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5800 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/js')
-rw-r--r-- | frontends/php/js/common.js | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/frontends/php/js/common.js b/frontends/php/js/common.js index ddb1d6b8..cdc6ce46 100644 --- a/frontends/php/js/common.js +++ b/frontends/php/js/common.js @@ -1,6 +1,6 @@ /* ** ZABBIX -** Copyright (C) 2000-2005 SIA Zabbix +** Copyright (C) 2000-2008 SIA Zabbix ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ function checkBrowser(){ if(SF) SDI('Safari'); if(KQ) SDI('Konqueror'); if(MC) SDI('Mac'); + if(GK) SDI('FireFox'); return 0; } @@ -91,7 +92,6 @@ function SDI(msg){ div_help.appendChild(document.createTextNode(msg)); div_help.appendChild(document.createElement("br")); div_help.appendChild(document.createElement("br")); - div_help.appendChild(document.createElement("br")); } function close_window(){ @@ -344,8 +344,7 @@ function PopUp(url,width,height,form_name){ function CheckAll(form_name, chkMain, shkName){ var frmForm = document.forms[form_name]; var value = frmForm.elements[chkMain].checked; - for (var i=0; i < frmForm.length; i++) - { + for (var i=0; i < frmForm.length; i++){ name = frmForm.elements[i].name.split('[')[0]; if(frmForm.elements[i].type != 'checkbox') continue; if(name == chkMain) continue; @@ -408,6 +407,20 @@ function deselectAll(){ sel.removeAllRanges(); } } + +function eventTarget(e){ + var targ = false; + + if (!e) var e = window.event; + if (e.target) targ = e.target; + else if (e.srcElement) targ = e.srcElement; + +// defeat Safari bug + if (targ.nodeType == 3) targ = targ.parentNode; + +return targ; +} + /************************************************************************************/ /* Pages stuff */ /************************************************************************************/ @@ -489,14 +502,12 @@ function GetSelectedText(obj){ return obj.value; } -function ScaleChartToParenElement(obj_name) -{ +function ScaleChartToParenElement(obj_name){ var obj = document.getElementsByName(obj_name); if(obj.length <= 0) throw "Can't find objects with name [" + obj_name +"]"; - for(i = obj.length-1; i>=0; i--) - { + for(i = obj.length-1; i>=0; i--){ obj[i].src += "&width=" + (obj[i].parentNode.offsetWidth - obj[i].parentNode.offsetLeft - 10); } } |