1 line
36 KiB
Plaintext
1 line
36 KiB
Plaintext
{"version":3,"file":"typertext.min.js","sources":["typertext.js"],"names":["Typertext","BaseException","message","code","custom","this","prototype","GetCode","GetMessage","GetCustom","GenericResponse","status","responseHeaderGetter","httpResponseCode","responseBody","headers","httpStatus","content","GetContent","GetContentType","GetHeader","name","GetHttpStatus","GetStatus","Http","HttpMethod","HttpUrl","domain","protocol","path","queryString","port","isNaN","DefaultPort","indexOf","FromUrl","location","l","document","createElement","href","hostname","pathname","search","HttpProtocol","slice","DecodeQueryString","parseInt","substring","UrlDecodeString","EncodeQueryString","query","rs","UrlEncodeObject","length","data","temp","cur","Array","i","encodeURIComponent","returnValue","params","splitString","param","key","decodeURIComponent","input","separator","limit","chunks","split","ret","splice","push","join","ToString","GetPort","GetDomain","GetProtocol","SameOriginCheck","url","Transport","__extends","d","b","__","constructor","p","hasOwnProperty","HttpException","_super","apply","arguments","TransportChooser","method","request","ieTestDiv","innerHTML","getElementsByTagName","ieLte9","origin","window","XHR","XDR","HttpRequest","Delete","callback","RawRequest","Get","Post","postData","Put","putData","transport","transportInstance","Send","HttpResponse","call","HttpResponseStatus","Json","JsonException","JsonRequest","jsonContentType","jsonType","_this","response","JsonResponse","fromInvalidHttpResponse","fromHttpResponse","parseSuccess","httpResponse","parse","e","GetParseStatus","xdr","XDomainRequest","getHeader","toLowerCase","contentType","undefined","ontimeout","onerror","responseText","onload","onprogress","open","send","Destroy","xhr","XMLHttpRequest","onreadystatechange","readyState","getResponseHeader","setRequestHeader"],"mappings":"AAAA,GAAIA,YACJ,SAAWA,GACP,GAAIC,GAAgB,WAChB,QAASA,GAAcC,EAASC,EAAMC,GAClCC,KAAKH,QAAUA,EACfG,KAAKF,KAAOA,EACZE,KAAKD,OAASA,EAalB,MAXAH,GAAcK,UAAUC,QAAU,WAC9B,MAAOF,MAAKF,MAGhBF,EAAcK,UAAUE,WAAa,WACjC,MAAOH,MAAKH,SAGhBD,EAAcK,UAAUG,UAAY,WAChC,MAAOJ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,OAAS,IACtC,GAAI0G,GAAa,EAAqBoB,EAAWZ,EAAMwB,IAAI1I,OAAQkH,EAAMwB,IAAIN,cACrFlB,EAAMwB,IAAI1I,QAAU,KAAOkH,EAAMwB,IAAI1I,OAAS,IACtC,GAAI0G,GAAa,EAAqBoB,EAAWZ,EAAMwB,IAAI1I,OAAQkH,EAAMwB,IAAIN,cAE7E,GAAI1B,GAAa,EAAsBoB,EAAWZ,EAAMwB,IAAI1I,OAAQkH,EAAMwB,IAAIN,iBAKzG1I,KAAKgJ,IAAIR,UAAY,WACjBhB,EAAMlB,SAAS,GAAIU,GAAa,EAAiB,WAC7C,MAAO,IACR,GAAI,MAoBf,MAjBAd,GAAIjG,UAAU8G,KAAO,WAGjB,MAFA/G,MAAKgJ,IAAIH,KAAKzH,EAAWpB,KAAK0F,QAAS1F,KAAK2F,QAAQpB,YAAY,GAE7C,GAAfvE,KAAK0F,WACL1F,MAAKgJ,IAAIF,QAIb9I,KAAKgJ,IAAIK,iBAAiB,eAAgB,yCAE1CrJ,MAAKgJ,IAAIF,KAAKzH,EAAQ2B,gBAAgBhD,KAAK0G,aAG/CR,EAAIjG,UAAU8I,QAAU,WACpB/I,KAAKgJ,IAAIE,mBAAqBlJ,KAAKgJ,IAAIR,UAAY,KACnDxI,KAAKgJ,IAAM,MAER9C,IAEXrB,GAAUqB,IAAMA,GACjBvG,EAAUkF,YAAclF,EAAUkF,cACrBlF,GAAUkF,WAC3BlF,YAAcA","sourcesContent":["var Typertext;\n(function (Typertext) {\n var BaseException = (function () {\n function BaseException(message, code, custom) {\n this.message = message;\n this.code = code;\n this.custom = custom;\n }\n BaseException.prototype.GetCode = function () {\n return this.code;\n };\n\n BaseException.prototype.GetMessage = function () {\n return this.message;\n };\n\n BaseException.prototype.GetCustom = function () {\n return this.custom;\n };\n return BaseException;\n })();\n Typertext.BaseException = BaseException;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n var GenericResponse = (function () {\n function GenericResponse(status, responseHeaderGetter, httpResponseCode, responseBody) {\n this.status = status;\n this.headers = responseHeaderGetter;\n this.httpStatus = httpResponseCode;\n this.content = responseBody;\n }\n GenericResponse.prototype.GetContent = function () {\n return this.content;\n };\n\n GenericResponse.prototype.GetContentType = function () {\n return this.GetHeader(\"Content-Type\");\n };\n\n GenericResponse.prototype.GetHeader = function (name) {\n return this.headers(name);\n };\n\n GenericResponse.prototype.GetHttpStatus = function () {\n return this.httpStatus;\n };\n\n GenericResponse.prototype.GetStatus = function () {\n return this.status;\n };\n return GenericResponse;\n })();\n Typertext.GenericResponse = GenericResponse;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Http) {\n (function (HttpMethod) {\n HttpMethod[HttpMethod[\"DELETE\"] = 0] = \"DELETE\";\n HttpMethod[HttpMethod[\"GET\"] = 1] = \"GET\";\n HttpMethod[HttpMethod[\"HEAD\"] = 2] = \"HEAD\";\n HttpMethod[HttpMethod[\"OPTIONS\"] = 3] = \"OPTIONS\";\n HttpMethod[HttpMethod[\"POST\"] = 4] = \"POST\";\n HttpMethod[HttpMethod[\"PUT\"] = 5] = \"PUT\";\n HttpMethod[HttpMethod[\"TRACE\"] = 6] = \"TRACE\";\n })(Http.HttpMethod || (Http.HttpMethod = {}));\n var HttpMethod = Http.HttpMethod;\n })(Typertext.Http || (Typertext.Http = {}));\n var Http = Typertext.Http;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Http) {\n var HttpUrl = (function () {\n function HttpUrl(domain, protocol, path, queryString, port) {\n if (typeof protocol === \"undefined\") { protocol = 0 /* http */; }\n if (typeof path === \"undefined\") { path = \"/\"; }\n if (typeof queryString === \"undefined\") { queryString = {}; }\n if (typeof port === \"undefined\") { port = 0; }\n if (port < 1 || port > 65535 || isNaN(port)) {\n port = HttpUrl.DefaultPort(protocol);\n }\n\n if (path.indexOf(\"/\") != 0) {\n path = \"/\" + path;\n }\n\n this.domain = domain;\n this.protocol = protocol;\n this.path = path;\n this.queryString = queryString;\n this.port = port;\n }\n HttpUrl.DefaultPort = function (protocol) {\n switch (protocol) {\n case 0 /* http */:\n return 80;\n case 1 /* https */:\n return 443;\n default:\n return -1;\n }\n };\n\n HttpUrl.FromUrl = function (location) {\n var l = document.createElement(\"a\");\n l.href = location;\n if (!l.hostname || !l.protocol || !l.pathname || !l.search || !l.port) {\n l.href = l.href;\n }\n return new HttpUrl(l.hostname, Typertext.Http.HttpProtocol[l.protocol.slice(0, -1)], l.pathname, HttpUrl.DecodeQueryString(l.search), parseInt(l.port));\n };\n\n HttpUrl.DecodeQueryString = function (queryString) {\n if (queryString.indexOf(\"?\") == 0) {\n queryString = queryString.substring(1);\n }\n\n return HttpUrl.UrlDecodeString(queryString);\n };\n\n HttpUrl.EncodeQueryString = function (query) {\n var rs = \"?\" + HttpUrl.UrlEncodeObject(query);\n return ((rs.length == 1) ? \"\" : rs);\n };\n\n HttpUrl.UrlEncodeObject = function (data) {\n var rs = \"\";\n var temp;\n\n for (temp in data) {\n var cur = data[temp];\n\n if (typeof cur !== \"object\" && typeof cur !== \"function\") {\n rs += encodeURIComponent(temp) + \"=\" + encodeURIComponent(cur) + \"&\";\n continue;\n }\n\n if (cur instanceof Array) {\n for (var i = 0; i < cur.length; i++) {\n if (typeof cur[i] === \"object\" && typeof cur[i] !== \"function\") {\n continue;\n }\n\n rs += encodeURIComponent(temp) + \"=\" + encodeURIComponent(cur[i]) + \"&\";\n }\n }\n }\n\n return rs.slice(0, -1);\n };\n\n HttpUrl.UrlDecodeString = function (queryString) {\n var returnValue = {}, params = HttpUrl.splitString(queryString, \"&\");\n for (var i = 0; i < params.length; i++) {\n if (params[i] == \"\") {\n continue;\n }\n\n var param = HttpUrl.splitString(params[i], \"=\", 2);\n var key = decodeURIComponent(param[0]);\n if (param.length == 1) {\n returnValue[key] = \"\";\n continue;\n }\n\n returnValue[key] = decodeURIComponent(param[1]);\n }\n\n return returnValue;\n };\n\n HttpUrl.splitString = function (input, separator, limit) {\n if (typeof limit === \"undefined\") { limit = -1; }\n limit++;\n var chunks = input.split(separator);\n if (limit > 0 && chunks.length > limit) {\n var ret = chunks.splice(0, limit);\n ret.push(chunks.join(separator));\n return ret;\n }\n return chunks;\n };\n\n HttpUrl.prototype.ToString = function () {\n return Typertext.Http.HttpProtocol[this.protocol] + \"://\" + this.domain + ((this.port == HttpUrl.DefaultPort(this.protocol)) ? \"\" : \":\" + this.port) + this.path + HttpUrl.EncodeQueryString(this.queryString);\n };\n\n HttpUrl.prototype.GetPort = function () {\n return this.port;\n };\n\n HttpUrl.prototype.GetDomain = function () {\n return this.domain;\n };\n\n HttpUrl.prototype.GetProtocol = function () {\n return this.protocol;\n };\n\n HttpUrl.prototype.SameOriginCheck = function (url) {\n return (this.domain === url.GetDomain() && this.port === url.GetPort() && this.protocol === url.GetProtocol());\n };\n return HttpUrl;\n })();\n Http.HttpUrl = HttpUrl;\n })(Typertext.Http || (Typertext.Http = {}));\n var Http = Typertext.Http;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Transport) {\n })(Typertext.Transport || (Typertext.Transport = {}));\n var Transport = Typertext.Transport;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n \n})(Typertext || (Typertext = {}));\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};\nvar Typertext;\n(function (Typertext) {\n (function (Http) {\n var HttpException = (function (_super) {\n __extends(HttpException, _super);\n function HttpException() {\n _super.apply(this, arguments);\n }\n return HttpException;\n })(Typertext.BaseException);\n Http.HttpException = HttpException;\n })(Typertext.Http || (Typertext.Http = {}));\n var Http = Typertext.Http;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Http) {\n (function (HttpProtocol) {\n HttpProtocol[HttpProtocol[\"http\"] = 0] = \"http\";\n HttpProtocol[HttpProtocol[\"https\"] = 1] = \"https\";\n })(Http.HttpProtocol || (Http.HttpProtocol = {}));\n var HttpProtocol = Http.HttpProtocol;\n })(Typertext.Http || (Typertext.Http = {}));\n var Http = Typertext.Http;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Transport) {\n var HttpUrl = Typertext.Http.HttpUrl;\n\n var TransportChooser = (function () {\n function TransportChooser() {\n }\n TransportChooser.Transport = function (method, request, postData, callback) {\n var ieTestDiv = document.createElement(\"div\");\n ieTestDiv.innerHTML = \"<!--[if lte IE 7]><i></i><![endif]-->\";\n\n if (ieTestDiv.getElementsByTagName(\"i\").length === 1) {\n throw {};\n }\n\n ieTestDiv.innerHTML = \"<!--[if lte IE 9]><i></i><![endif]-->\";\n var ieLte9 = (ieTestDiv.getElementsByTagName(\"i\").length === 1);\n var origin = HttpUrl.FromUrl(window.location.href);\n\n if (origin.SameOriginCheck(origin) || !ieLte9) {\n return Typertext.Transport.XHR;\n }\n\n if (origin.GetProtocol() === request.GetProtocol()) {\n return Typertext.Transport.XDR;\n }\n\n throw {};\n };\n return TransportChooser;\n })();\n Transport.TransportChooser = TransportChooser;\n })(Typertext.Transport || (Typertext.Transport = {}));\n var Transport = Typertext.Transport;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Http) {\n var TransportChooser = Typertext.Transport.TransportChooser;\n\n var HttpRequest = (function () {\n function HttpRequest() {\n }\n HttpRequest.prototype.Delete = function (request, callback) {\n this.RawRequest(5 /* PUT */, request, {}, callback);\n };\n\n HttpRequest.prototype.Get = function (request, callback) {\n this.RawRequest(1 /* GET */, request, {}, callback);\n };\n\n HttpRequest.prototype.Post = function (request, postData, callback) {\n this.RawRequest(4 /* POST */, request, postData, callback);\n };\n\n HttpRequest.prototype.Put = function (request, putData, callback) {\n this.RawRequest(5 /* PUT */, request, putData, callback);\n };\n\n HttpRequest.prototype.RawRequest = function (method, request, postData, callback, transport) {\n if (typeof postData === \"undefined\") { postData = {}; }\n if (!callback)\n callback = function (c) {\n return null;\n };\n\n if (!transport)\n transport = TransportChooser.Transport(method, request, postData, callback);\n\n var transportInstance = new transport(method, request, postData, callback);\n transportInstance.Send();\n };\n return HttpRequest;\n })();\n Http.HttpRequest = HttpRequest;\n })(Typertext.Http || (Typertext.Http = {}));\n var Http = Typertext.Http;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Http) {\n var HttpResponse = (function (_super) {\n __extends(HttpResponse, _super);\n function HttpResponse(status, responseHeaderGetter, httpResponseCode, responseBody) {\n _super.call(this, status, responseHeaderGetter, httpResponseCode, responseBody);\n }\n return HttpResponse;\n })(Typertext.GenericResponse);\n Http.HttpResponse = HttpResponse;\n })(Typertext.Http || (Typertext.Http = {}));\n var Http = Typertext.Http;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Http) {\n (function (HttpResponseStatus) {\n HttpResponseStatus[HttpResponseStatus[\"success\"] = 0] = \"success\";\n HttpResponseStatus[HttpResponseStatus[\"serverError\"] = 1] = \"serverError\";\n HttpResponseStatus[HttpResponseStatus[\"clientError\"] = 2] = \"clientError\";\n HttpResponseStatus[HttpResponseStatus[\"responseError\"] = 3] = \"responseError\";\n HttpResponseStatus[HttpResponseStatus[\"unknownError\"] = 4] = \"unknownError\";\n HttpResponseStatus[HttpResponseStatus[\"timeout\"] = 5] = \"timeout\";\n })(Http.HttpResponseStatus || (Http.HttpResponseStatus = {}));\n var HttpResponseStatus = Http.HttpResponseStatus;\n })(Typertext.Http || (Typertext.Http = {}));\n var Http = Typertext.Http;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Json) {\n var JsonException = (function (_super) {\n __extends(JsonException, _super);\n function JsonException(message, code) {\n _super.call(this, message, code, null);\n }\n return JsonException;\n })(Typertext.BaseException);\n Json.JsonException = JsonException;\n })(Typertext.Json || (Typertext.Json = {}));\n var Json = Typertext.Json;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Json) {\n var HttpRequest = Typertext.Http.HttpRequest;\n\n var HttpMethod = Typertext.Http.HttpMethod;\n\n var JsonRequest = (function () {\n function JsonRequest(jsonContentType) {\n if (typeof jsonContentType === \"undefined\") { jsonContentType = \"application/json\"; }\n this.request = new HttpRequest();\n this.jsonType = jsonContentType;\n }\n JsonRequest.prototype.Delete = function (request, callback) {\n this.RawRequest(0 /* DELETE */, request, {}, callback);\n };\n\n JsonRequest.prototype.Get = function (request, callback) {\n this.RawRequest(1 /* GET */, request, {}, callback);\n };\n\n JsonRequest.prototype.Post = function (request, postData, callback) {\n this.RawRequest(4 /* POST */, request, postData, callback);\n };\n\n JsonRequest.prototype.Put = function (request, putData, callback) {\n this.RawRequest(5 /* PUT */, request, putData, callback);\n };\n\n JsonRequest.prototype.RawRequest = function (method, request, postData, callback, transport) {\n var _this = this;\n if (typeof postData === \"undefined\") { postData = {}; }\n if (typeof callback != \"function\") {\n this.request.RawRequest(method, request, postData, function () {\n });\n return;\n }\n\n this.request.RawRequest(method, request, postData, function (response) {\n if (response.GetContentType() != _this.jsonType) {\n callback(Typertext.Json.JsonResponse.fromInvalidHttpResponse(response));\n return;\n }\n\n callback(Typertext.Json.JsonResponse.fromHttpResponse(response));\n }, transport);\n };\n return JsonRequest;\n })();\n Json.JsonRequest = JsonRequest;\n })(Typertext.Json || (Typertext.Json = {}));\n var Json = Typertext.Json;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Json) {\n var HttpResponseStatus = Typertext.Http.HttpResponseStatus;\n\n var JsonResponse = (function (_super) {\n __extends(JsonResponse, _super);\n function JsonResponse(status, responseHeaderGetter, httpResponseCode, responseBody, parseSuccess) {\n _super.call(this, status, responseHeaderGetter, httpResponseCode, responseBody);\n parseSuccess = !!parseSuccess || false;\n this.parseSuccess = parseSuccess;\n }\n JsonResponse.fromHttpResponse = function (httpResponse) {\n try {\n return new JsonResponse(httpResponse.GetStatus(), httpResponse.GetHeader, httpResponse.GetHttpStatus(), window[\"JSON\"].parse(httpResponse.GetContent()), true);\n } catch (e) {\n return new JsonResponse(httpResponse.GetStatus(), httpResponse.GetHeader, httpResponse.GetHttpStatus(), null);\n }\n };\n\n JsonResponse.fromInvalidHttpResponse = function (httpResponse) {\n return new JsonResponse(3 /* responseError */, httpResponse.GetHeader, httpResponse.GetHttpStatus());\n };\n\n JsonResponse.prototype.GetParseStatus = function () {\n return this.parseSuccess;\n };\n return JsonResponse;\n })(Typertext.GenericResponse);\n Json.JsonResponse = JsonResponse;\n })(Typertext.Json || (Typertext.Json = {}));\n var Json = Typertext.Json;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Transport) {\n var HttpMethod = Typertext.Http.HttpMethod;\n var HttpUrl = Typertext.Http.HttpUrl;\n\n var HttpResponseStatus = Typertext.Http.HttpResponseStatus;\n var HttpResponse = Typertext.Http.HttpResponse;\n\n var XDR = (function () {\n function XDR(method, request, postData, callback) {\n if (typeof postData === \"undefined\") { postData = {}; }\n if (typeof callback === \"undefined\") { callback = function (c) {\n return null;\n }; }\n this.postData = postData;\n this.method = method;\n this.request = request;\n this.callback = callback;\n\n this.xdr = new XDomainRequest();\n }\n XDR.prototype.Send = function () {\n var _this = this;\n var getHeader = function (name) {\n if (name.toLowerCase() === \"content-type\") {\n return _this.xdr.contentType;\n }\n return undefined;\n };\n\n this.xdr.ontimeout = function () {\n _this.callback(new HttpResponse(5 /* timeout */, function (i) {\n return \"\";\n }, -1, \"\"));\n };\n\n this.xdr.onerror = function () {\n _this.callback(new HttpResponse(4 /* unknownError */, getHeader, -1, _this.xdr.responseText));\n };\n\n this.xdr.onload = function () {\n _this.callback(new HttpResponse(0 /* success */, getHeader, 200, _this.xdr.responseText));\n };\n\n this.xdr.onprogress = function () {\n return null;\n };\n\n this.xdr.open(HttpMethod[this.method], this.request.ToString());\n\n if (this.method == 1 /* GET */) {\n this.xdr.send();\n return;\n }\n\n this.xdr.send(HttpUrl.UrlEncodeObject(this.postData));\n };\n\n XDR.prototype.Destroy = function () {\n this.xdr.ontimeout = this.xdr.onerror = this.xdr.onload = this.xdr.onprogress = null;\n this.xdr = null;\n };\n return XDR;\n })();\n Transport.XDR = XDR;\n })(Typertext.Transport || (Typertext.Transport = {}));\n var Transport = Typertext.Transport;\n})(Typertext || (Typertext = {}));\nvar Typertext;\n(function (Typertext) {\n (function (Transport) {\n var HttpMethod = Typertext.Http.HttpMethod;\n var HttpUrl = Typertext.Http.HttpUrl;\n\n var HttpResponseStatus = Typertext.Http.HttpResponseStatus;\n var HttpResponse = Typertext.Http.HttpResponse;\n\n var XHR = (function () {\n function XHR(method, request, postData, callback) {\n if (typeof postData === \"undefined\") { postData = {}; }\n if (typeof callback === \"undefined\") { callback = function (c) {\n return null;\n }; }\n var _this = this;\n this.postData = postData;\n this.method = method;\n this.request = request;\n this.callback = callback;\n\n this.xhr = new XMLHttpRequest();\n\n this.xhr.onreadystatechange = function () {\n if (_this.xhr.readyState == 4) {\n var getHeader = function (name) {\n return _this.xhr.getResponseHeader(name);\n };\n\n if (_this.xhr.status == 200) {\n _this.callback(new HttpResponse(0 /* success */, getHeader, _this.xhr.status, _this.xhr.responseText));\n } else if (_this.xhr.status >= 400 && _this.xhr.status < 500) {\n _this.callback(new HttpResponse(2 /* clientError */, getHeader, _this.xhr.status, _this.xhr.responseText));\n } else if (_this.xhr.status >= 500 && _this.xhr.status < 600) {\n _this.callback(new HttpResponse(1 /* serverError */, getHeader, _this.xhr.status, _this.xhr.responseText));\n } else {\n _this.callback(new HttpResponse(4 /* unknownError */, getHeader, _this.xhr.status, _this.xhr.responseText));\n }\n }\n };\n\n this.xhr.ontimeout = function () {\n _this.callback(new HttpResponse(5 /* timeout */, function (i) {\n return \"\";\n }, -1, \"\"));\n };\n }\n XHR.prototype.Send = function () {\n this.xhr.open(HttpMethod[this.method], this.request.ToString(), true);\n\n if (this.method == 1 /* GET */) {\n this.xhr.send();\n return;\n }\n\n this.xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n this.xhr.send(HttpUrl.UrlEncodeObject(this.postData));\n };\n\n XHR.prototype.Destroy = function () {\n this.xhr.onreadystatechange = this.xhr.ontimeout = null;\n this.xhr = null;\n };\n return XHR;\n })();\n Transport.XHR = XHR;\n })(Typertext.Transport || (Typertext.Transport = {}));\n var Transport = Typertext.Transport;\n})(Typertext || (Typertext = {}));\n//# sourceMappingURL=typertext.js.map\n"]} |