[Opensrf-commits] r1674 - branches/rel_1_0/src/javascript (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 5 22:48:53 EST 2009


Author: erickson
Date: 2009-03-05 22:48:51 -0500 (Thu, 05 Mar 2009)
New Revision: 1674

Modified:
   branches/rel_1_0/src/javascript/DojoSRF.js
   branches/rel_1_0/src/javascript/opensrf.js
   branches/rel_1_0/src/javascript/opensrf_xhr.js
Log:
backporting IE fixes

Modified: branches/rel_1_0/src/javascript/DojoSRF.js
===================================================================
--- branches/rel_1_0/src/javascript/DojoSRF.js	2009-03-06 03:45:32 UTC (rev 1673)
+++ branches/rel_1_0/src/javascript/DojoSRF.js	2009-03-06 03:48:51 UTC (rev 1674)
@@ -20,12 +20,12 @@
         localeRE = /^(\w\w)(-\w\w)?$/;
         localeMatch = localeRE.exec(dojo.locale);
 
-        if (!localeMatch[1]) {
+        if (!localeMatch || !localeMatch[1]) {
                 OpenSRF.locale = dojo.isIE ? navigator.userLanguage : navigator.language;
         } else {
                 OpenSRF.locale = localeMatch[1].toLowerCase();
         }
-        if (localeMatch[2]) {
+        if (localeMatch && localeMatch[2]) {
                 OpenSRF.locale = OpenSRF.locale + localeMatch[2].toUpperCase();
         }
 }

Modified: branches/rel_1_0/src/javascript/opensrf.js
===================================================================
--- branches/rel_1_0/src/javascript/opensrf.js	2009-03-06 03:45:32 UTC (rev 1673)
+++ branches/rel_1_0/src/javascript/opensrf.js	2009-03-06 03:48:51 UTC (rev 1674)
@@ -54,7 +54,7 @@
     var str = cls+'.prototype = new '+pcls+'();';
     str += cls+'.prototype.constructor = '+cls+';';
     str += cls+'.baseClass = '+pcls+'.prototype.constructor;';
-    str += cls+'.prototype.super = '+pcls+'.prototype;';
+    str += cls+'.prototype["super"] = '+pcls+'.prototype;';
     eval(str);
 }
 
@@ -123,7 +123,7 @@
 
     message = new osrfMessage({
         'threadTrace' : this.reqid, 
-        'type' : OSRF_MESSAGE_TYPE_CONNECT,
+        'type' : OSRF_MESSAGE_TYPE_CONNECT
     });
 
     this.send(message, {'timeout' : this.timeout});
@@ -137,7 +137,7 @@
     this.send(
         new osrfMessage({
             'threadTrace' : this.reqid, 
-            'type' : OSRF_MESSAGE_TYPE_DISCONNECT,
+            'type' : OSRF_MESSAGE_TYPE_DISCONNECT
         })
     );
     this.remote_id = null;

Modified: branches/rel_1_0/src/javascript/opensrf_xhr.js
===================================================================
--- branches/rel_1_0/src/javascript/opensrf_xhr.js	2009-03-06 03:45:32 UTC (rev 1673)
+++ branches/rel_1_0/src/javascript/opensrf_xhr.js	2009-03-06 03:48:51 UTC (rev 1674)
@@ -27,7 +27,16 @@
 OpenSRF.XHRequest = function(osrf_msg, args) {
     this.message = osrf_msg;
     this.args = args;
-    this.xreq = new XMLHttpRequest(); /* XXX browser check */
+    try {
+	    this.xreq =  new XMLHttpRequest();
+    } catch(e) {
+	    try { 
+		    this.xreq = new ActiveXObject("Msxml2.XMLHTTP"); 
+	    } catch (e2) {
+			this.xreq = new ActiveXObject("Microsoft.XMLHTTP"); 
+	    }
+    }
+
 }
 
 OpenSRF.XHRequest.prototype.send = function() {



More information about the opensrf-commits mailing list