datasource-jsonparser-min.js revision 57fa1401f6016185ba44150db21aa452d5afc70e
YUI.add("datasource-jsonparser",function(B){var A=function(){A.superclass.constructor.apply(this,arguments);};B.mix(A,{NS:"parser",NAME:"DataSourceJSONParser",ATTRS:{parser:{readOnly:true,value:B.DataParser.JSON,useRef:true},schema:{}}});B.extend(A,B.Plugin,{initializer:function(C){this.doBefore("_defDataFn",this._beforeDefDataFn);},_beforeDefDataFn:function(E){var D=((this._owner instanceof B.DataSource.XHR)&&B.Lang.isString(E.data.responseText))?E.data.responseText:E.data,C=(this.get("parser").parse(this.get("schema"),D));if(!C){C={meta:{},results:D};}this._owner.fire("response",B.mix({response:C},E));return new B.Do.Halt("DataSourceJSONParser plugin halted _defDataFn");}});B.namespace("plugin").DataSourceJSONParser=A;},"@VERSION@",{requires:["plugin","datasource-base","dataparser-json"]});