!function(){var moduleFactory=function($){var module=this;$.require().script("mvc/model.service").done(function(){var exports=function(){$.Model.service.yql=$.Model.service({select:"*",from:"flickr.photos.search",convert:function(query,params){return $.each(params,function(key){var name=new RegExp("#{"+key+"}","g"),value=$.trim(this);query=query.replace(name,value)}),query},findAll:function(params,success,error){params=$.extend({},this._service,params);var query=["SELECT",params.select,"FROM",params.from];params.where&&query.push("WHERE","string"==typeof params.where||this._service.convert(params.where[0],params.where[1]));
var self=this,yqlJson={url:"http://query.yahooapis.com/v1/public/yql",dataType:"jsonp",data:{q:query.join(" "),format:"json",env:"store://datatables.org/alltableswithkeys",callback:"?"}};error&&(yqlJson.error=error),yqlJson.success=this.wrapMany?function(data){var results=data.query.results;if(results)for(var name in results){success(self.wrapMany(data.query.results[name]));break}else success([])}:success,$.ajax(yqlJson)}})};exports(),module.resolveWith(exports)})};dispatch("mvc/model.service.yql").containing(moduleFactory).to("Foundry/2.1 Modules")
}();