Code

Added check for firefox2 (js function captureEvents deprecated/not needed).
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 Apr 2007 13:39:48 +0000 (13:39 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 20 Apr 2007 13:39:48 +0000 (13:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6161 594d385d-05f5-0310-b6e9-bd551577e9d8

html/include/focus.js

index a8c3375f07e9d5bd9943d761c6dd5f6498cc4645..b470b0bf883c3132cfdaf4ff5be047e9f7874ec0 100644 (file)
@@ -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;
 }