a:11:{s:9:"#provides";s:19:"dojox.io.xhrPlugins";s:9:"#resource";s:16:"io/xhrPlugins.js";s:9:"#requires";a:2:{i:0;a:3:{i:0;s:6:"common";i:1;s:20:"dojo.AdapterRegistry";i:2;s:4:"dojo";}i:1;a:3:{i:0;s:6:"common";i:1;s:14:"dojo._base.xhr";i:2;s:4:"dojo";}}s:28:"dojox.io.xhrPlugins.register";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:880:" if(!registry){ registry = new dojo.AdapterRegistry(); plainXhr = dojox.io.xhrPlugins.plainXhr = dojo._defaultXhr || dojo.xhr; // replaces the default xhr() method. Can we just use connect() instead? dojo[dojo._defaultXhr ? "_defaultXhr" : "xhr"] = function(/*String*/ method, /*dojo.__XhrArgs*/ args, /*Boolean?*/ hasBody){ return registry.match.apply(registry,arguments); }; registry.register( "xhr", function(method,args){ if(!args.url.match(/^\w*:\/\//)){ // if it is not an absolute url (or relative to the // protocol) we can use this plain XHR return true; } var root = window.location.href.match(/^.*?\/\/.*?\//)[0]; return args.url.substring(0, root.length) == root; // or check to see if we have the same path }, plainXhr ); } return registry.register.apply(registry, arguments);";s:7:"summary";s:73:"overrides the default xhr handler to implement a registry of xhr handlers";s:7:"returns";s:40:"or check to see if we have the same path";}s:28:"dojox.io.xhrPlugins.addProxy";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:8:"proxyUrl";a:2:{s:4:"type";s:4:"This";s:7:"summary";s:31:"is URL to send the requests to.";}}s:6:"source";s:379:" dojox.io.xhrPlugins.register( "proxy", function(method,args){ // this will match on URL // really can be used for anything, but plain XHR will take // precedent by order of loading return true; }, function(method,args,hasBody){ args.url = proxyUrl + encodeURIComponent(args.url); return plainXhr.call(dojo, method, args, hasBody); });";s:7:"summary";s:56:"adds a server side proxy xhr handler for cross-site URLs";s:8:"examples";a:1:{i:0;s:255:"Define a proxy: dojox.io.xhrPlugins.addProxy("/proxy?url="); And then when you call: dojo.xhr("GET",{url:"http://othersite.com/file"}); It would result in the request (to your origin server): GET /proxy?url=http%3A%2F%2Fothersite.com%2Ffile HTTP/1.1";}s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:8:"plainXhr";}}}s:35:"dojox.io.xhrPlugins.addCrossSiteXhr";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:3:"url";a:2:{s:4:"type";s:8:"Requests";s:7:"summary";s:69:"that start with this URL will be considered for using cross-site XHR.";}s:11:"httpAdapter";a:2:{s:4:"type";s:4:"This";s:7:"summary";s:140:"allows for adapting HTTP requests that could not otherwise be sent with XDR, so you can use a convention for headers and PUT/DELETE methods.";}}s:6:"source";s:1612:" if(csXhrSupport === undefined && window.XMLHttpRequest){ // just run this once to see if we have cross-site support try{ var xhr = new XMLHttpRequest(); xhr.open("GET","http://fnadkfna.com",true); csXhrSupport = true; }catch(e){ csXhrSupport = false; } } dojox.io.xhrPlugins.register( "cs-xhr", function(method,args){ return (csXhrSupport || (window.XDomainRequest && args.sync !== true && (method == "GET" || method == "POST" || httpAdapter))) && (args.url.substring(0,url.length) == url); }, csXhrSupport ? plainXhr : function(){ var normalXhrObj = dojo._xhrObj; // we will just substitute this in temporarily so we can use XDomainRequest instead of XMLHttpRequest dojo._xhrObj = function(){ var xdr = new XDomainRequest(); xdr.readyState = 1; xdr.setRequestHeader = function(){}; // just absorb them, we can't set headers :/ xdr.getResponseHeader = function(header){ // this is the only header we can access return header == "Content-Type" ? xdr.contentType : null; } // adapt the xdr handlers to xhr function handler(status, readyState){ return function(){ xdr.readyState = readyState; xdr.status = status; } } xdr.onload = handler(200, 4); xdr.onprogress = handler(200, 3); xdr.onerror = handler(404, 4); // an error, who knows what the real status is return xdr; }; var dfd = (httpAdapter ? httpAdapter(plainXhr) : plainXhr).apply(dojo,arguments); dojo._xhrObj = normalXhrObj; return dfd; } );";s:7:"summary";s:75:"Adds W3C Cross site XHR or XDomainRequest handling for the given URL prefix";s:11:"description";s:244:"This can be used for servers that support W3C cross-site XHR. In order for a server to allow a client to make cross-site XHR requests, it should respond with the header like: Access-Control: allow <*> see: http://www.w3.org/TR/access-control/";}s:35:"dojox.io.xhrPlugins.fullHttpAdapter";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:8:"plainXhr";a:1:{s:4:"type";s:0:"";}s:9:"noRawBody";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:834:" return function(method,args,hasBody){ var content = {}; var parameters = {}; if(method != "GET"){ parameters["http-method"] = method; if(args.putData && noRawBody){ content["http-content"] = args.putData; delete args.putData; hasBody = false; } if(args.postData && noRawBody){ content["http-content"] = args.postData; delete args.postData; hasBody = false; } method = "POST"; } for(var i in args.headers){ var parameterName = i.match(/^X-/) ? i.substring(2).replace(/-/g,'_').toLowerCase() : ("http-" + i); parameters[parameterName] = args.headers[i]; } args.query = dojo.objectToQuery(parameters); dojo._ioAddQueryToUrl(args); args.content = dojo.mixin(args.content || {},content); return plainXhr.call(dojo,method,args,hasBody); };";s:7:"summary";s:25:"Provides a HTTP adaption.";s:11:"description";s:142:"The following convention is used: method name -> ?http-method=PUT Header -> http-Header-Name=header-value X-Header -> header_name=header-value";s:8:"examples";a:1:{i:0;s:87:"dojox.io.xhrPlugins.addXdr("http://somesite.com", dojox.io.xhrPlugins.fullHttpAdapter);";}}s:18:"args.content || {}";a:2:{s:6:"mixins";a:1:{s:6:"normal";a:1:{i:0;s:7:"content";}}s:7:"summary";s:0:"";}s:19:"dojox.io.xhrPlugins";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:8:"dojox.io";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}