2 lines
6.4 KiB
JavaScript
2 lines
6.4 KiB
JavaScript
|
var Typertext;!function(a){var b=function(){function a(a,b,c){this.message=a,this.code=b,this.custom=c}return a.prototype.GetCode=function(){return this.code},a.prototype.GetMessage=function(){return this.message},a.prototype.GetCustom=function(){return this.custom},a}();a.BaseException=b}(Typertext||(Typertext={}));var Typertext;!function(){}(Typertext||(Typertext={}));var Typertext;!function(a){var b=function(){function a(a,b,c,d){this.status=a,this.headers=b,this.httpStatus=c,this.content=d}return a.prototype.GetContent=function(){return this.content},a.prototype.GetContentType=function(){return this.GetHeader("Content-Type")},a.prototype.GetHeader=function(a){return this.headers(a)},a.prototype.GetHttpStatus=function(){return this.httpStatus},a.prototype.GetStatus=function(){return this.status},a}();a.GenericResponse=b}(Typertext||(Typertext={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Typertext;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b}(a.BaseException);b.HttpException=c}(a.Http||(a.Http={}));a.Http}(Typertext||(Typertext={}));var Typertext;!function(a){!function(a){!function(a){a[a.GET=0]="GET",a[a.POST=1]="POST"}(a.HttpMethod||(a.HttpMethod={}));a.HttpMethod}(a.Http||(a.Http={}));a.Http}(Typertext||(Typertext={}));var Typertext;!function(a){!function(a){!function(a){a[a.http=0]="http",a[a.https=1]="https"}(a.HttpProtocol||(a.HttpProtocol={}));a.HttpProtocol}(a.Http||(a.Http={}));a.Http}(Typertext||(Typertext={}));var Typertext;!function(a){!function(b){var c=function(){function b(){}return b.prototype.Get=function(a,b){this.RawRequest(0,a,{},b)},b.prototype.Post=function(a,b,c){this.RawRequest(1,a,b,c)},b.prototype.RawRequest=function(b,c,d,e){"undefined"==typeof d&&(d={}),"undefined"==typeof e&&(e=function(){});var f=function(){return""},g=new XMLHttpRequest;return g.onreadystatechange=function(){if(4==g.readyState){var b=function(a){return g.getResponseHeader(a)};if(200!=g.status)throw g.status>=400&&g.status<500?new a.Http.HttpException("The server returned an error response state",g.status,new a.Http.HttpResponse(2,b,g.status,g.responseText)):g.status>=500&&g.status<600?new a.Http.HttpException("The server returned an error response state",g.status,new a.Http.HttpResponse(1,b,g.status,g.responseText)):new a.Http.HttpException("An unknown error has occurred",-2,new a.Http.HttpResponse(4,b,g.status,g.responseText));e(new a.Http.HttpResponse(0,b,g.status,g.responseText))}},g.ontimeout=function(){throw new a.Http.HttpException("The server took too long to respond to our request",-1,new a.Http.HttpResponse(5,f,-1,""))},g.open(a.Http.HttpMethod[b],c.ToString(),!0),0==b?void g.send():(g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void g.send(a.Http.HttpUrl.UrlEncodeObject(d)))},b}();b.HttpRequest=c}(a.Http||(a.Http={}));a.Http}(Typertext||(Typertext={}));var Typertext;!function(a){!function(b){var c=function(a){function b(b,c,d,e){a.call(this,b,c,d,e)}return __extends(b,a),b}(a.GenericResponse);b.HttpResponse=c}(a.Http||(a.Http={}));a.Http}(Typertext||(Typertext={}));var Typertext;!function(a){!function(a){!function(a){a[a.success=0]="success",a[a.serverError=1]="serverError",a[a.clientError=2]="clientError",a[a.responseError=3]="responseError",a[a.unknownError=4]="unknownError",a[a.timeout=5]="timeout"}(a.HttpResponseStatus||(a.HttpResponseStatus={}));a.HttpResponseStatus}(a.Http||(a.Http={}));a.Http}(Typertext||(Typertext={}));var Typertext;!function(a){!function(b){var c=function(){function b(a,c,d,e,f){"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d="/"),"undefined"==typeof e&&(e={}),"undefined"==typeof f&&(f=0),(1>f||f>65535||isNaN(f))&&(f=b.DefaultPort(c)),0!=d.indexOf("/")&&(d="/"+d),this.domain=a,this.protocol=c,this.path=d,this.queryString=e,this.port=f}return b.DefaultPort=function(a){switch(a){case 0:return 80;case 1:return 443;default:return-1}},b.FromUrl=function(c){var d=document.crea
|
||
|
//# sourceMappingURL=typertext.min.js.map
|