Author: pbr
Date: 2007-07-10 08:26:55 -0700 (Tue, 10 Jul 2007)
New Revision: 5640

Modified:
   openlaszlo/branches/4.0/lps/includes/source/embednew.js
Log:
Manual merge of legals r5461. An older version was present in 4.0 and this 
wrecked browser detection.


Modified: openlaszlo/branches/4.0/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/branches/4.0/lps/includes/source/embednew.js     2007-07-10 
06:43:32 UTC (rev 5639)
+++ openlaszlo/branches/4.0/lps/includes/source/embednew.js     2007-07-10 
15:26:55 UTC (rev 5640)
@@ -148,9 +148,7 @@
             return;
         }
 
-        var isIE = Lz.__BrowserDetect.browser == 'Explorer' && 
Lz.__BrowserDetect.browser != 'Netscape';
-
-        if (isIE) {
+        if (Lz.__BrowserDetect.isIE) {
             var scripturl = lzOptions.ServerRoot+ '/lps/includes/excanvas.js';
             this.__dhtmlLoadScript(scripturl)
         }
@@ -294,21 +292,13 @@
       if (this.hasOwnProperty('supportedBrowser')) {
         return this.supportedBrowser;
       }
-      Lz.__BrowserDetect.init();
-      // currently only used for IE spoofing NS8
-      var isNetscape = Lz.__BrowserDetect.browser == 'Netscape';
-      var isSafari = Lz.__BrowserDetect.browser == 'Safari';
-      var isOpera = Lz.__BrowserDetect.browser == 'Opera';
-      var isFirefox = Lz.__BrowserDetect.browser == 'Firefox';
-      // true if we're on ie and not being spoofed
-      var isIE = Lz.__BrowserDetect.browser == 'Explorer' && 
-                 (! (isNetscape || isSafari || isOpera || isFirefox) );
+      var b = Lz.__BrowserDetect;
+      b.init();
+      b.isSupported = (b.isFirefox && b.version >= 1.5) ||
+                        (b.isIE && b.version >= 6.0) ||
+                        (b.isSafari && b.version >= 418.9);
 
-      var isSupported = (isFirefox && Lz.__BrowserDetect.version >= 1.5) ||
-                        (isIE && Lz.__BrowserDetect.version >= 6.0) ||
-                        (isSafari && Lz.__BrowserDetect.version >= 418.9);
-
-      if (isSupported) {
+      if (b.isSupported) {
         this.supportedBrowser = true;
       } else if (dontAsk) {
         this.supportedBrowser = false;
@@ -439,6 +429,19 @@
                 || "an unknown version";
             this.OS = this.searchString(this.dataOS) || "an unknown OS";
             this.initted = true;
+            if (this.browser == 'Netscape') {
+                // currently only used for IE spoofing NS8
+                this.isNetscape = true;
+            } else if (this.browser == 'Safari') {
+                this.isSafari = true;
+            } else if (this.browser == 'Opera') {
+                this.isOpera = true;
+            } else if (this.browser == 'Firefox') {
+                this.isFirefox = true;
+            } else if (this.browser == 'Explorer') {
+                // true if we're on ie and not being spoofed
+                this.isIE = true;
+            }
         },
         searchString: function (data) {
             for (var i=0;i<data.length;i++)    {


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to