Fixed issue 22371: Now OB renders ok in Firefox 17
authorDavid Baz Fayos <david.baz@openbravo.com>
Thu, 22 Nov 2012 14:50:57 +0100
changeset 18603 6da2a9b84afa
parent 18602 b6e9ed3c0a97
child 18604 d0f351ffdbfb
Fixed issue 22371: Now OB renders ok in Firefox 17
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
--- a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Thu Nov 22 12:26:50 2012 +0100
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Thu Nov 22 14:50:57 2012 +0100
@@ -777,4 +777,70 @@
     }
     return this._fieldMatchesFilter(fieldValue, filterValue, requestProperties);
   }
-});
\ No newline at end of file
+});
+
+
+// IMPORTANT: The following code has been imported from "SmartClient_v83p_2012-11-21_LGPL" (source\client\browser\Browser.js)
+//            to allow good Firefox operation from version 17. Issue: https://issues.openbravo.com/view.php?id=22371
+//            This code should be removed once Smartclient be upgraded.
+if (!isc.Browser.isIE) {
+  (function () {
+    var needle, pos;
+    if (navigator.appVersion) {
+      // Safari
+      needle = "Version/";
+      pos = navigator.appVersion.indexOf(needle);
+      if (pos >= 0) {
+        isc.Browser.minorVersion = parseFloat(navigator.appVersion.substring(pos + needle.length));
+        return;
+      }
+    }
+
+    var ua = navigator.userAgent;
+
+    needle = "Chrome/";
+    pos = ua.indexOf(needle);
+    if (pos >= 0) {
+      isc.Browser.minorVersion = parseFloat(ua.substring(pos + needle.length));
+      return;
+    }
+
+    // Handle Camino before Firefox because Camino includes "(like Firefox/x.x.x)" in the UA.
+    needle = "Camino/";
+    pos = ua.indexOf(needle);
+    if (pos >= 0) {
+      isc.Browser.minorVersion = parseFloat(ua.substring(pos + needle.length));
+      return;
+    }
+
+    needle = "Firefox/";
+    pos = ua.indexOf(needle);
+    if (pos >= 0) {
+      isc.Browser.minorVersion = parseFloat(ua.substring(pos + needle.length));
+      return;
+    }
+
+    if (ua.indexOf("Opera/") >= 0) {
+      needle = "Version/";
+      pos = ua.indexOf(needle);
+      if (pos >= 0) {
+        isc.Browser.minorVersion = parseFloat(ua.substring(pos + needle.length));
+        return;
+      } else {
+        // Opera 9.64
+        needle = "Opera/";
+        pos = ua.indexOf(needle);
+        isc.Browser.minorVersion = parseFloat(ua.substring(pos + needle.length));
+        return;
+      }
+    }
+
+  }());
+}
+
+isc.Browser.version = parseInt(isc.Browser.minorVersion, 10);
+if (isc.Browser.isMoz && isc.Browser.version >= 17) {
+  isc.Browser.geckoVersion = 20121121;
+}
+
+// End of Firefox >= 17 compatibiliy code
\ No newline at end of file