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();
}
}
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);
}
message = new osrfMessage({
'threadTrace' : this.reqid,
- 'type' : OSRF_MESSAGE_TYPE_CONNECT,
+ 'type' : OSRF_MESSAGE_TYPE_CONNECT
});
this.send(message, {'timeout' : this.timeout});
this.send(
new osrfMessage({
'threadTrace' : this.reqid,
- 'type' : OSRF_MESSAGE_TYPE_DISCONNECT,
+ 'type' : OSRF_MESSAGE_TYPE_DISCONNECT
})
);
this.remote_id = null;
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() {