From: Bill Erickson Date: Fri, 28 Feb 2014 21:03:20 +0000 (-0500) Subject: JS max_chunk_size client-side parsing, final pieces X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fberick%2Fbundling-and-chunking;p=working%2FOpenSRF.git JS max_chunk_size client-side parsing, final pieces Partial and PartialComplete need class definitions for JSON decoding to work. Signed-off-by: Bill Erickson --- diff --git a/src/javascript/opensrf.js b/src/javascript/opensrf.js index 5f6a68f..58db1f0 100644 --- a/src/javascript/opensrf.js +++ b/src/javascript/opensrf.js @@ -159,6 +159,45 @@ osrfResult.prototype.content = function(d) { this.hash.content = d; return this.hash.content; }; +function osrfResultPartial(hash) { + this.hash = hash; + this._encodehash = true; +} +osrfResultPartial.prototype.status = function(d) { + if(arguments.length == 1) + this.hash.status = d; + return this.hash.status; +}; +osrfResultPartial.prototype.statusCode = function(d) { + if(arguments.length == 1) + this.hash.statusCode = d; + return this.hash.statusCode; +}; +osrfResultPartial.prototype.content = function(d) { + if(arguments.length == 1) + this.hash.content = d; + return this.hash.content; +}; +function osrfResultPartialComplete(hash) { + this.hash = hash; + this._encodehash = true; +} +osrfResultPartialComplete.prototype.status = function(d) { + if(arguments.length == 1) + this.hash.status = d; + return this.hash.status; +}; +osrfResultPartialComplete.prototype.statusCode = function(d) { + if(arguments.length == 1) + this.hash.statusCode = d; + return this.hash.statusCode; +}; +osrfResultPartialComplete.prototype.content = function(d) { + if(arguments.length == 1) + this.hash.content = d; + return this.hash.content; +}; + function osrfServerError(hash) { this.hash = hash; this._encodehash = true;