From 0c4522f04321970474971d6fc2ccf611e633176e Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 3 Jul 2008 10:16:24 +0000 Subject: [PATCH] Updated browser detection- Opera caused undefined browserType attribute. -> Dialogs couldn't be closed. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11522 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/include/focus.js | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/gosa-core/html/include/focus.js b/gosa-core/html/include/focus.js index 796798fb4..843a0a123 100644 --- a/gosa-core/html/include/focus.js +++ b/gosa-core/html/include/focus.js @@ -1,11 +1,32 @@ -var browserType; +var browserType = "Not dectected, adjust focus.js"; var firefoxType; -if (document.layers) {browserType = "nn4"} -if (document.all) {browserType = "ie"} -if (window.navigator.userAgent.toLowerCase().match("gecko")) {browserType= "gecko"} -if (browserType=="gecko" && window.navigator.userAgent.toLowerCase().match("firefox\/2")) {firefoxType= "firefox2"} -else {firefoxType= "firefox"}; +if (document.layers) +{ + browserType = "nn4"; +} + +if (document.all) +{ + browserType = "ie"; +} + +if (window.navigator.userAgent.toLowerCase().match("gecko")) +{ + browserType= "gecko"; +} + +if (window.navigator.userAgent.toLowerCase().match(/opera/i)) +{ + browserType= "gecko"; +} + +if (browserType=="gecko" && window.navigator.userAgent.toLowerCase().match("firefox\/2")) +{ + firefoxType= "firefox2"; +}else{ + firefoxType= "firefox"; +} netscape = ""; ver= navigator.appVersion; len = ver.length; -- 2.30.2