summaryrefslogtreecommitdiff
path: root/lib/dojo/request/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dojo/request/util.js')
-rw-r--r--lib/dojo/request/util.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dojo/request/util.js b/lib/dojo/request/util.js
index 763e7d374..a9987d929 100644
--- a/lib/dojo/request/util.js
+++ b/lib/dojo/request/util.js
@@ -5,4 +5,4 @@
*/
//>>built
-define("dojo/request/util",["exports","../errors/RequestError","../errors/CancelError","../Deferred","../io-query","../_base/array","../_base/lang","../promise/Promise","../has"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9){_1.deepCopy=function(_a,_b){for(var _c in _b){var _d=_a[_c],_e=_b[_c];if(_d!==_e){if(_e&&typeof _e==="object"&&!(_9("native-formdata")&&_e instanceof FormData)){if(Object.prototype.toString.call(_e)==="[object Date]"){_a[_c]=new Date(_e);}else{if(_7.isArray(_e)){_a[_c]=_1.deepCopyArray(_e);}else{if(_d&&typeof _d==="object"){_1.deepCopy(_d,_e);}else{_a[_c]=_1.deepCopy({},_e);}}}}else{_a[_c]=_e;}}}return _a;};_1.deepCopyArray=function(_f){var _10=[];_f.forEach(function(_11){if(typeof _11==="object"){_10.push(_1.deepCopy({},_11));}else{_10.push(_11);}});return _10;};_1.deepCreate=function deepCreate(_12,_13){_13=_13||{};var _14=_7.delegate(_12),_15,_16;for(_15 in _12){_16=_12[_15];if(_16&&typeof _16==="object"){_14[_15]=_1.deepCreate(_16,_13[_15]);}}return _1.deepCopy(_14,_13);};var _17=Object.freeze||function(obj){return obj;};function _18(_19){return _17(_19);};function _1a(_1b){return _1b.data!==undefined?_1b.data:_1b.text;};_1.deferred=function deferred(_1c,_1d,_1e,_1f,_20,_21){var def=new _4(function(_22){_1d&&_1d(def,_1c);if(!_22||!(_22 instanceof _2)&&!(_22 instanceof _3)){return new _3("Request canceled",_1c);}return _22;});def.response=_1c;def.isValid=_1e;def.isReady=_1f;def.handleResponse=_20;function _23(_24){_24.response=_1c;throw _24;};var _25=def.then(_18).otherwise(_23);if(_1.notify){_25.then(_7.hitch(_1.notify,"emit","load"),_7.hitch(_1.notify,"emit","error"));}var _26=_25.then(_1a);var _27=new _8();for(var _28 in _26){if(_26.hasOwnProperty(_28)){_27[_28]=_26[_28];}}_27.response=_25;_17(_27);if(_21){def.then(function(_29){_21.call(def,_29);},function(_2a){_21.call(def,_1c,_2a);});}def.promise=_27;def.then=_27.then;return def;};_1.addCommonMethods=function addCommonMethods(_2b,_2c){_6.forEach(_2c||["GET","POST","PUT","DELETE"],function(_2d){_2b[(_2d==="DELETE"?"DEL":_2d).toLowerCase()]=function(url,_2e){_2e=_7.delegate(_2e||{});_2e.method=_2d;return _2b(url,_2e);};});};_1.parseArgs=function parseArgs(url,_2f,_30){var _31=_2f.data,_32=_2f.query;if(_31&&!_30){if(typeof _31==="object"&&(!(_9("native-xhr2"))||!(_31 instanceof ArrayBuffer||_31 instanceof Blob))){_2f.data=_5.objectToQuery(_31);}}if(_32){if(typeof _32==="object"){_32=_5.objectToQuery(_32);}if(_2f.preventCache){_32+=(_32?"&":"")+"request.preventCache="+(+(new Date));}}else{if(_2f.preventCache){_32="request.preventCache="+(+(new Date));}}if(url&&_32){url+=(~url.indexOf("?")?"&":"?")+_32;}return {url:url,options:_2f,getHeader:function(_33){return null;}};};_1.checkStatus=function(_34){_34=_34||0;return (_34>=200&&_34<300)||_34===304||_34===1223||!_34;};}); \ No newline at end of file
+define("dojo/request/util",["exports","../errors/RequestError","../errors/CancelError","../Deferred","../io-query","../_base/array","../_base/lang","../promise/Promise","../has"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9){function _a(_b){return _9("native-arraybuffer")&&_b instanceof ArrayBuffer;};function _c(_d){return _9("native-blob")&&_d instanceof Blob;};function _e(_f){if(typeof Element!=="undefined"){return _f instanceof Element;}return _f.nodeType===1;};function _10(_11){return _9("native-formdata")&&_11 instanceof FormData;};function _12(_13){return _13&&typeof _13==="object"&&!_10(_13)&&!_e(_13)&&!_c(_13)&&!_a(_13);};_1.deepCopy=function(_14,_15){for(var _16 in _15){var _17=_14[_16],_18=_15[_16];if(_16!=="__proto__"&&_17!==_18){if(_12(_18)){if(Object.prototype.toString.call(_18)==="[object Date]"){_14[_16]=new Date(_18);}else{if(_7.isArray(_18)){_14[_16]=_1.deepCopyArray(_18);}else{if(_17&&typeof _17==="object"){_1.deepCopy(_17,_18);}else{_14[_16]=_1.deepCopy({},_18);}}}}else{_14[_16]=_18;}}}return _14;};_1.deepCopyArray=function(_19){var _1a=[];for(var i=0,l=_19.length;i<l;i++){var _1b=_19[i];if(typeof _1b==="object"){_1a.push(_1.deepCopy({},_1b));}else{_1a.push(_1b);}}return _1a;};_1.deepCreate=function deepCreate(_1c,_1d){_1d=_1d||{};var _1e=_7.delegate(_1c),_1f,_20;for(_1f in _1c){_20=_1c[_1f];if(_20&&typeof _20==="object"){_1e[_1f]=_1.deepCreate(_20,_1d[_1f]);}}return _1.deepCopy(_1e,_1d);};var _21=Object.freeze||function(obj){return obj;};function _22(_23){return _21(_23);};function _24(_25){return _25.data!==undefined?_25.data:_25.text;};_1.deferred=function deferred(_26,_27,_28,_29,_2a,_2b){var def=new _4(function(_2c){_27&&_27(def,_26);if(!_2c||!(_2c instanceof _2)&&!(_2c instanceof _3)){return new _3("Request canceled",_26);}return _2c;});def.response=_26;def.isValid=_28;def.isReady=_29;def.handleResponse=_2a;function _2d(_2e){_2e.response=_26;throw _2e;};var _2f=def.then(_22).otherwise(_2d);if(_1.notify){_2f.then(_7.hitch(_1.notify,"emit","load"),_7.hitch(_1.notify,"emit","error"));}var _30=_2f.then(_24);var _31=new _8();for(var _32 in _30){if(_30.hasOwnProperty(_32)){_31[_32]=_30[_32];}}_31.response=_2f;_21(_31);if(_2b){def.then(function(_33){_2b.call(def,_33);},function(_34){_2b.call(def,_26,_34);});}def.promise=_31;def.then=_31.then;return def;};_1.addCommonMethods=function addCommonMethods(_35,_36){_6.forEach(_36||["GET","POST","PUT","DELETE"],function(_37){_35[(_37==="DELETE"?"DEL":_37).toLowerCase()]=function(url,_38){_38=_7.delegate(_38||{});_38.method=_37;return _35(url,_38);};});};_1.parseArgs=function parseArgs(url,_39,_3a){var _3b=_39.data,_3c=_39.query;if(_3b&&!_3a){if(typeof _3b==="object"&&(!(_9("native-xhr2"))||!(_a(_3b)||_c(_3b)))){_39.data=_5.objectToQuery(_3b);}}if(_3c){if(typeof _3c==="object"){_3c=_5.objectToQuery(_3c);}if(_39.preventCache){_3c+=(_3c?"&":"")+"request.preventCache="+(+(new Date));}}else{if(_39.preventCache){_3c="request.preventCache="+(+(new Date));}}if(url&&_3c){url+=(~url.indexOf("?")?"&":"?")+_3c;}return {url:url,options:_39,getHeader:function(_3d){return null;}};};_1.checkStatus=function(_3e){_3e=_3e||0;return (_3e>=200&&_3e<300)||_3e===304||_3e===1223||!_3e;};}); \ No newline at end of file