backporting IE fixes
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 6 Mar 2009 03:48:51 +0000 (03:48 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 6 Mar 2009 03:48:51 +0000 (03:48 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/rel_1_0@1674 9efc2488-bf62-4759-914b-345cdb29e865

src/javascript/DojoSRF.js
src/javascript/opensrf.js
src/javascript/opensrf_xhr.js

index aa06c6b..6529505 100644 (file)
@@ -20,12 +20,12 @@ if(!dojo._hasResource['DojoSRF']){
         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();
         }
 }
index ecdfe09..b543de8 100644 (file)
@@ -54,7 +54,7 @@ OpenSRF.set_subclass = function(cls, pcls) {
     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 @@ OpenSRF.ClientSession.prototype.connect = function(args) {
 
     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 @@ OpenSRF.ClientSession.prototype.disconnect = function(args) {
     this.send(
         new osrfMessage({
             'threadTrace' : this.reqid, 
-            'type' : OSRF_MESSAGE_TYPE_DISCONNECT,
+            'type' : OSRF_MESSAGE_TYPE_DISCONNECT
         })
     );
     this.remote_id = null;
index 76d8473..8cace89 100644 (file)
@@ -27,7 +27,16 @@ var OSRF_POST_CONTENT_TYPE = 'application/x-www-form-urlencoded';
 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() {