108 lines
5.4 KiB
JavaScript
108 lines
5.4 KiB
JavaScript
goog.provide('ajax.xhrio');
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxImpl$ = cljs.core.PROTOCOL_SENTINEL);
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxImpl$_js_ajax_request$arity$3 = (function (this$,p__47230,handler){
|
|
var map__47231 = p__47230;
|
|
var map__47231__$1 = cljs.core.__destructure_map(map__47231);
|
|
var uri = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47231__$1,new cljs.core.Keyword(null,"uri","uri",-774711847));
|
|
var method = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47231__$1,new cljs.core.Keyword(null,"method","method",55703592));
|
|
var body = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47231__$1,new cljs.core.Keyword(null,"body","body",-2049205669));
|
|
var headers = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47231__$1,new cljs.core.Keyword(null,"headers","headers",-835030129));
|
|
var timeout = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__47231__$1,new cljs.core.Keyword(null,"timeout","timeout",-318625318),(0));
|
|
var with_credentials = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__47231__$1,new cljs.core.Keyword(null,"with-credentials","with-credentials",-1163127235),false);
|
|
var response_format = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47231__$1,new cljs.core.Keyword(null,"response-format","response-format",1664465322));
|
|
var progress_handler = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47231__$1,new cljs.core.Keyword(null,"progress-handler","progress-handler",333585589));
|
|
var this$__$1 = this;
|
|
var temp__5823__auto___47279 = new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(response_format);
|
|
if(cljs.core.truth_(temp__5823__auto___47279)){
|
|
var response_type_47281 = temp__5823__auto___47279;
|
|
this$__$1.setResponseType(cljs.core.name(response_type_47281));
|
|
} else {
|
|
}
|
|
|
|
if(cljs.core.fn_QMARK_(progress_handler)){
|
|
var G__47233_47282 = this$__$1;
|
|
G__47233_47282.setProgressEventsEnabled(true);
|
|
|
|
goog.events.listen(G__47233_47282,goog.net.EventType.UPLOAD_PROGRESS,progress_handler);
|
|
|
|
} else {
|
|
}
|
|
|
|
var G__47235 = this$__$1;
|
|
goog.events.listen(G__47235,goog.net.EventType.COMPLETE,(function (p1__47221_SHARP_){
|
|
var G__47236 = p1__47221_SHARP_.target;
|
|
return (handler.cljs$core$IFn$_invoke$arity$1 ? handler.cljs$core$IFn$_invoke$arity$1(G__47236) : handler.call(null,G__47236));
|
|
}));
|
|
|
|
G__47235.setTimeoutInterval(timeout);
|
|
|
|
G__47235.setWithCredentials(with_credentials);
|
|
|
|
G__47235.send(uri,method,body,cljs.core.clj__GT_js(headers));
|
|
|
|
return G__47235;
|
|
}));
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxRequest$ = cljs.core.PROTOCOL_SENTINEL);
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxRequest$_abort$arity$1 = (function (this$){
|
|
var this$__$1 = this;
|
|
return this$__$1.abort(goog.net.ErrorCode.ABORT);
|
|
}));
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxResponse$ = cljs.core.PROTOCOL_SENTINEL);
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxResponse$_body$arity$1 = (function (this$){
|
|
var this$__$1 = this;
|
|
return this$__$1.getResponse();
|
|
}));
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxResponse$_status$arity$1 = (function (this$){
|
|
var this$__$1 = this;
|
|
return this$__$1.getStatus();
|
|
}));
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxResponse$_status_text$arity$1 = (function (this$){
|
|
var this$__$1 = this;
|
|
return this$__$1.getStatusText();
|
|
}));
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxResponse$_get_all_headers$arity$1 = (function (this$){
|
|
var this$__$1 = this;
|
|
return cljs.core.js__GT_clj.cljs$core$IFn$_invoke$arity$1(this$__$1.getResponseHeaders());
|
|
}));
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxResponse$_get_response_header$arity$2 = (function (this$,header){
|
|
var this$__$1 = this;
|
|
return this$__$1.getResponseHeader(header);
|
|
}));
|
|
|
|
(goog.net.XhrIo.prototype.ajax$protocols$AjaxResponse$_was_aborted$arity$1 = (function (this$){
|
|
var this$__$1 = this;
|
|
return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(this$__$1.getLastErrorCode(),goog.net.ErrorCode.ABORT);
|
|
}));
|
|
(goog.net.XhrManager.prototype.ajax$protocols$AjaxImpl$ = cljs.core.PROTOCOL_SENTINEL);
|
|
|
|
(goog.net.XhrManager.prototype.ajax$protocols$AjaxImpl$_js_ajax_request$arity$3 = (function (this$,p__47260,handler){
|
|
var map__47261 = p__47260;
|
|
var map__47261__$1 = cljs.core.__destructure_map(map__47261);
|
|
var uri = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47261__$1,new cljs.core.Keyword(null,"uri","uri",-774711847));
|
|
var method = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47261__$1,new cljs.core.Keyword(null,"method","method",55703592));
|
|
var body = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47261__$1,new cljs.core.Keyword(null,"body","body",-2049205669));
|
|
var headers = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47261__$1,new cljs.core.Keyword(null,"headers","headers",-835030129));
|
|
var id = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47261__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
|
|
var timeout = cljs.core.get.cljs$core$IFn$_invoke$arity$3(map__47261__$1,new cljs.core.Keyword(null,"timeout","timeout",-318625318),(0));
|
|
var priority = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47261__$1,new cljs.core.Keyword(null,"priority","priority",1431093715));
|
|
var max_retries = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__47261__$1,new cljs.core.Keyword(null,"max-retries","max-retries",-1933762121));
|
|
var this$__$1 = this;
|
|
var G__47269 = this$__$1;
|
|
G__47269.setTimeoutInterval(timeout);
|
|
|
|
G__47269.send(id,uri,method,body,cljs.core.clj__GT_js(headers),priority,handler,max_retries);
|
|
|
|
return G__47269;
|
|
}));
|
|
|
|
//# sourceMappingURL=ajax.xhrio.js.map
|