Line 6... |
Line 6... |
6 |
modified BSD license. For more information on Dojo licensing, see:
|
6 |
modified BSD license. For more information on Dojo licensing, see:
|
Line 7... |
Line 7... |
7 |
|
7 |
|
8 |
http://dojotoolkit.org/community/licensing.shtml
|
8 |
http://dojotoolkit.org/community/licensing.shtml
|
Line -... |
Line 9... |
- |
|
9 |
*/
|
- |
|
10 |
|
9 |
*/
|
11 |
|
10 |
|
12 |
|
11 |
dojo.provide("dojo.io.BrowserIO");
|
13 |
dojo.provide("dojo.io.BrowserIO");
|
12 |
dojo.require("dojo.io.common");
|
14 |
dojo.require("dojo.io.common");
|
13 |
dojo.require("dojo.lang.array");
|
15 |
dojo.require("dojo.lang.array");
|
Line 200... |
Line 202... |
200 |
}
|
202 |
}
|
201 |
this.clearCache = function () {
|
203 |
this.clearCache = function () {
|
202 |
_cache = {};
|
204 |
_cache = {};
|
203 |
};
|
205 |
};
|
204 |
function doLoad(kwArgs, http, url, query, useCache) {
|
206 |
function doLoad(kwArgs, http, url, query, useCache) {
|
205 |
if (((http.status >= 200) && (http.status < 300)) || (http.status == 304) || (location.protocol == "file:" && (http.status == 0 || http.status == undefined)) || (location.protocol == "chrome:" && (http.status == 0 || http.status == undefined))) {
|
207 |
if (((http.status >= 200) && (http.status < 300)) || (http.status == 304) || (http.status == 1223) || (location.protocol == "file:" && (http.status == 0 || http.status == undefined)) || (location.protocol == "chrome:" && (http.status == 0 || http.status == undefined))) {
|
206 |
var ret;
|
208 |
var ret;
|
207 |
if (kwArgs.method.toLowerCase() == "head") {
|
209 |
if (kwArgs.method.toLowerCase() == "head") {
|
208 |
var headers = http.getAllResponseHeaders();
|
210 |
var headers = http.getAllResponseHeaders();
|
209 |
ret = {};
|
211 |
ret = {};
|
210 |
ret.toString = function () {
|
212 |
ret.toString = function () {
|
Line 226... |
Line 228... |
226 |
dojo.debug(e);
|
228 |
dojo.debug(e);
|
227 |
dojo.debug(http.responseText);
|
229 |
dojo.debug(http.responseText);
|
228 |
ret = null;
|
230 |
ret = null;
|
229 |
}
|
231 |
}
|
230 |
} else {
|
232 |
} else {
|
231 |
if (kwArgs.mimetype == "text/json" || kwArgs.mimetype == "application/json") {
|
233 |
if (kwArgs.mimetype.substr(0, 9) == "text/json" || kwArgs.mimetype.substr(0, 16) == "application/json") {
|
232 |
try {
|
234 |
try {
|
233 |
ret = dj_eval("(" + http.responseText + ")");
|
235 |
ret = dj_eval("(" + kwArgs.jsonFilter(http.responseText) + ")");
|
234 |
}
|
236 |
}
|
235 |
catch (e) {
|
237 |
catch (e) {
|
236 |
dojo.debug(e);
|
238 |
dojo.debug(e);
|
237 |
dojo.debug(http.responseText);
|
239 |
dojo.debug(http.responseText);
|
238 |
ret = false;
|
240 |
ret = false;
|
Line 322... |
Line 324... |
322 |
}
|
324 |
}
|
323 |
this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();", 10);
|
325 |
this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();", 10);
|
324 |
};
|
326 |
};
|
325 |
var hasXmlHttp = dojo.hostenv.getXmlhttpObject() ? true : false;
|
327 |
var hasXmlHttp = dojo.hostenv.getXmlhttpObject() ? true : false;
|
326 |
this.canHandle = function (kwArgs) {
|
328 |
this.canHandle = function (kwArgs) {
|
- |
|
329 |
var mlc = kwArgs["mimetype"].toLowerCase() || "";
|
327 |
return hasXmlHttp && dojo.lang.inArray(["text/plain", "text/html", "application/xml", "text/xml", "text/javascript", "text/json", "application/json"], (kwArgs["mimetype"].toLowerCase() || "")) && !(kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"]));
|
330 |
return hasXmlHttp && ((dojo.lang.inArray(["text/plain", "text/html", "application/xml", "text/xml", "text/javascript"], mlc)) || (mlc.substr(0, 9) == "text/json" || mlc.substr(0, 16) == "application/json")) && !(kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"]));
|
328 |
};
|
331 |
};
|
329 |
this.multipartBoundary = "45309FFF-BD65-4d50-99C9-36986896A96F";
|
332 |
this.multipartBoundary = "45309FFF-BD65-4d50-99C9-36986896A96F";
|
330 |
this.bind = function (kwArgs) {
|
333 |
this.bind = function (kwArgs) {
|
331 |
if (!kwArgs["url"]) {
|
334 |
if (!kwArgs["url"]) {
|
332 |
if (!kwArgs["formNode"] && (kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"] || kwArgs["watchForURL"]) && (!djConfig.preventBackButtonFix)) {
|
335 |
if (!kwArgs["formNode"] && (kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"] || kwArgs["watchForURL"]) && (!djConfig.preventBackButtonFix)) {
|