jsonp-url-min.js revision f376730c08e3eb4277ea5f192f34f3164790033b
YUI.add("jsonp-url",function(D){var A=D.JSONPRequest,C=D.Object.getValue,B=function(){};D.mix(A.prototype,{_pattern:/\bcallback=(.*?)(?=&|$)/i,_template:"callback={callback}",_defaultCallback:function(G){var F=G.match(this._pattern),I=[],H=0,E,J,K;if(F){E=F[1].replace(/\[(['"])(.*?)\1\]/g,function(M,L,N){I[H]=N;return".@"+(H++);}).replace(/\[(\d+)\]/g,function(M,L){I[H]=parseInt(L,10)|0;return".@"+(H++);}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(E)){J=E.split(".");for(H=J.length-1;H>=0;--H){if(J[H].charAt(0)==="@"){J[H]=I[parseInt(J[H].substr(1),10)];}}K=C(D.config.win,J)||C(D,J)||C(D,J.slice(1));}}return K||B;},_format:function(E,G){var H=this._template.replace(/\{callback\}/,G),F;if(this._pattern.test(E)){return E.replace(this._pattern,H);}else{F=E.slice(-1);if(F!=="&"&&F!=="?"){E+=(E.indexOf("?")>-1)?"&":"?";}return E+H;}}},true);},"@VERSION@",{requires:["jsonp-base"]});