source: [view]
if(this._started){ return; }
if(this.userid){
var query = {
userid: this.userid
};
if(this.setid){
query["setid"] = this.setid;
}
if(this.tags){
query.tags = this.tags;
}
if(this.searchText){
query.text = this.searchText;
}
var args = arguments;
this._store = new dojox.data.FlickrRestStore({ apikey: this.apikey });
this._store.fetch({
count: this.cols * this.rows,
query: query,
onComplete: dojo.hitch(this, function(items){
dojo.forEach(items, function(item){
var a = dojo.doc.createElement("a");
dojo.addClass(a, "flickrImage");
a.href = this._store.getValue(item, "link");
if(this.target){
a.target = this.target;
}
var img = dojo.doc.createElement("img");
img.src = this._store.getValue(item, "imageUrlThumb");
dojo.style(img, {
width: "100%",
height: "100%"
});
a.appendChild(img);
this.domNode.appendChild(a);
}, this);
dojox.image.Badge.prototype.startup.call(this, args);
})
});
}