diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-05 10:57:58 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-05 10:57:58 +0000 |
commit | 7d13ea434dba96e69195d74c338498f847e9fed3 (patch) | |
tree | 174bc17745807e3341b518d256ab5f3b8d355f0b /frontends/php/js | |
parent | d13ea897eda76d08bac623bb1a6e965b712c8116 (diff) | |
download | zabbix-7d13ea434dba96e69195d74c338498f847e9fed3.tar.gz zabbix-7d13ea434dba96e69195d74c338498f847e9fed3.tar.xz zabbix-7d13ea434dba96e69195d74c338498f847e9fed3.zip |
- added changes for better support Konqueror Browser (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5133 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/js')
-rw-r--r-- | frontends/php/js/common.js | 34 | ||||
-rw-r--r-- | frontends/php/js/sbox.js | 2 | ||||
-rw-r--r-- | frontends/php/js/scrollbar.js | 7 |
3 files changed, 30 insertions, 13 deletions
diff --git a/frontends/php/js/common.js b/frontends/php/js/common.js index fca2da4e..48cc7c1a 100644 --- a/frontends/php/js/common.js +++ b/frontends/php/js/common.js @@ -19,7 +19,16 @@ 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) ; +var SF = (agt.indexOf("safari") != -1); +var KQ = (agt.indexOf("khtml") != -1) && (!SF); + +function checkBrowser(){ + if(OP) SDI('Opera'); + if(IE) SDI('IE'); + if(SF) SDI('Safari'); + if(KQ) SDI('Konqueror'); +return 0; +} function isset(obj){ return (typeof(obj) != 'undefined'); @@ -266,15 +275,12 @@ return false; /* Pages stuff */ /************************************************************************************/ -function GetSelectedText(obj) -{ - if (navigator.appName == "Microsoft Internet Explorer") - { +function GetSelectedText(obj){ + if(IE){ obj.focus(); return document.selection.createRange().text; } - else (obj.selectionStart) - { + else if(obj.selectionStart){ if(obj.selectionStart != obj.selectionEnd) { var s = obj.selectionStart; var e = obj.selectionEnd; @@ -349,4 +355,18 @@ function resizeiframe(id){ if(!is_null($('scroll')) && showgraphmenu){ showgraphmenu('iframe'); } +} + +function get_bodywidth(){ + var w = parseInt(document.body.scrollWidth); + var w2 = parseInt(document.body.offsetWidth); + + if(KQ){ + w = (w2 < w)?w2:w; + w-=16; + } + else{ + w = (w2 > w)?w2:w; + } +return w; }
\ No newline at end of file diff --git a/frontends/php/js/sbox.js b/frontends/php/js/sbox.js index 6325c480..4c06c1e1 100644 --- a/frontends/php/js/sbox.js +++ b/frontends/php/js/sbox.js @@ -252,7 +252,7 @@ deselectall: function(){ if(IE){ document.selection.empty(); } - else{ + else if(!KQ){ var sel = window.getSelection(); sel.removeAllRanges(); } diff --git a/frontends/php/js/scrollbar.js b/frontends/php/js/scrollbar.js index 11277b96..ebe2138a 100644 --- a/frontends/php/js/scrollbar.js +++ b/frontends/php/js/scrollbar.js @@ -31,10 +31,7 @@ function scrollinit(x,y,w,period,stime,timel,bar_stime){ } w = w | 0; if(w == 0){ - var w = parseInt(document.body.scrollWidth) - 36; - var w2 = parseInt(document.body.offsetWidth) - 36; - - w = (w2 > w)?w2:w; + w=get_bodywidth() - 36; } scrollcreate(x,y,w); @@ -484,7 +481,7 @@ deselectall: function(){ if(IE){ document.selection.empty(); } - else{ + else if(!KQ){ var sel = window.getSelection(); sel.removeAllRanges(); } |