//>>built
define("dojox/image/FlickrBadge",["dojo","dojox/main","dojox/image/Badge","dojox/data/FlickrRestStore"],function(a,d){a.getObject("image",!0,d);return a.declare("dojox.image.FlickrBadge",d.image.Badge,{children:"a.flickrImage",userid:"",username:"",setid:"",tags:"",searchText:"",target:"",apikey:"8c6803164dbc395fb7131c9d54843627",_store:null,postCreate:function(){this.username&&!this.userid&&a.io.script.get({url:"https://www.flickr.com/services/rest/",preventCache:!0,content:{format:"json",method:"flickr.people.findByUsername",
api_key:this.apikey,username:this.username},callbackParamName:"jsoncallback"}).addCallback(this,function(b){b.user&&b.user.nsid&&(this.userid=b.user.nsid,this._started||this.startup())})},startup:function(){if(!this._started&&this.userid){var b={userid:this.userid};this.setid&&(b.setid=this.setid);this.tags&&(b.tags=this.tags);this.searchText&&(b.text=this.searchText);var g=arguments;this._store=new d.data.FlickrRestStore({apikey:this.apikey});this._store.fetch({count:this.cols*this.rows,query:b,
onComplete:a.hitch(this,function(h){a.forEach(h,function(f){var c=a.doc.createElement("a");a.addClass(c,"flickrImage");c.href=this._store.getValue(f,"link");this.target&&(c.target=this.target);var e=a.doc.createElement("img");e.src=this._store.getValue(f,"imageUrlThumb");a.style(e,{width:"100%",height:"100%"});c.appendChild(e);this.domNode.appendChild(c)},this);d.image.Badge.prototype.startup.call(this,g)})})}}})});