jsonp-min.js revision e7eae9b3ca0194e8c08f10b485269a2cdb28b450
YUI.add("jsonp-base",function(D){var A=D.Lang,C=A.isFunction;function B(){this._init.apply(this,arguments);}B._pattern=/\bcallback=(.*?)(?=&|$)/i;B._template="callback={callback}";B.prototype={_init:function(E,G){this.url=E;G=(C(G))?{on:{success:G}}:G||{};var F=G.on||{};if(!F.success){F.success=this._defaultCallback(E,G);}this._config=D.merge({context:this,args:[],format:this._format},G,{on:F});},_defaultCallback:function(G){var F=G.match(B._pattern)||[],E=F[1],H;if(E){E=E.replace(/^Y\./,"");if(/^\w+$/.test(E)){H=D.config.win[E]||D[E];}}return(C(H))?H:function(){};},send:function(I){if(!this._config.on.success){return this;}var G=D.guid().replace(/-/g,"_"),F=this._config,E=F.format.call(this,this.url,"YUI.Env.JSONP."+G);function H(J){return(C(J))?function(K){delete YUI.Env.JSONP[G];J.apply(F.context,[K].concat(F.args));}:null;}YUI.Env.JSONP[G]=H(F.on.success);D.Get.script(E,{onFailure:H(F.on.failure),onTimeout:H(F.on.timeout||F.on.failure),timeout:F.timeout});return this;},_format:function(E,G){var H=B._template.replace(/\{callback\}/,G),F;if(B._pattern.test(E)){return E.replace(B._pattern,H);}else{F=E.slice(-1);if(F!=="&"&&F!=="?"){E+=(E.indexOf("?")>-1)?"&":"?";}return E+H;}}};D.JSONPRequest=B;D.jsonp=function(E,F){return new D.JSONPRequest(E,F).send();};YUI.Env.JSONP={};},"@VERSION@",{requires:["get","oop"]});YUI.add("jsonp-url",function(E){var A=E.Lang.isObject,D=E.Lang.isFunction,F=".",B="@";function C(H,K,G){var I=K.length-1,J=K[0],L;if(J.charAt(0)===B){J=G[J];}for(;I>0;--I){L=K[I];if(L.charAt(0)===B){L=G[L];}H=H[L];if(!A(H)){return null;}}return(A(H)&&D(H[J]))?E.bind(J,H):null;}E.JSONPRequest.prototype._defaultCallback=function(I){var H=I.match(E.JSONPRequest._pattern),G={},J=0,K,L;if(H){K=H[1].replace(/\[(?:(['"])([^\]\1]+)\1|(\d+))\]/g,function(P,N,O,M){var R=(RegExp.rightContext||".").charAt(0),Q=B+(++J);G[Q]=O||M;if(R!==F&&R!=="["){Q+=F;}return F+Q;}).split(/\./).reverse();L=C(E.config.win,K,G);if(!L){L=C(E,K,G);if(!L&&K.length>1){K.pop();L=C(E,K,G);}}}return L||function(){};};},"@VERSION@",{requires:["jsonp-base"]});YUI.add("jsonp",function(A){},"@VERSION@",{use:["jsonp-base","jsonp-url"]});