From 930b63fdb47cc15c4830907ed731cc1a15d58d75 Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 20 Apr 2007 13:39:48 +0000 Subject: [PATCH] Added check for firefox2 (js function captureEvents deprecated/not needed). git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6161 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/include/focus.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/html/include/focus.js b/html/include/focus.js index a8c3375f0..b470b0bf8 100644 --- a/html/include/focus.js +++ b/html/include/focus.js @@ -1,8 +1,11 @@ var browserType; +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"}; netscape = ""; ver= navigator.appVersion; len = ver.length; @@ -78,6 +81,7 @@ function keyPress(DnEvents) { if (k == 13) { // enter key pressed if(typeof(nextfield)!='undefined') { if(nextfield == 'login') { + alert("login"); return true; // submit, we finished all fields } else { // we are not done yet, send focus to next box eval('document.mainform.' + nextfield + '.focus()'); @@ -196,8 +200,10 @@ function changeTripleSelectState_2nd_neg(firstTriggerField, secondTriggerField, } // work together to analyze keystrokes if (netscape){ - document.captureEvents(Event.KEYPRESS); - document.onkeypress= keyPress; + if(firefoxType== "firefox") { + window.captureEvents(Event.KEYPRESS); + } + window.onkeypress= keyPress; } else { document.onkeydown= keyPress; } -- 2.30.2