dojox/image/FlickrBadge.js

  • Provides:

    • dojox.image.FlickrBadge
  • Requires:

    • dojox.image.Badge in common
    • dojox.data.FlickrRestStore in common
  • dojox.image.FlickrBadge

    • type
      Function
    • chains:
      • dojox.image.Badge: (prototype)
      • dojox.image.Badge: (call)
    • summary
  • dojox.image.FlickrBadge.children

    • summary
  • dojox.image.FlickrBadge.userid

    • type
      String
    • summary
      If you know your Flickr userid, you can set it to prevent a call to fetch the id
  • dojox.image.FlickrBadge.username

    • type
      String
    • summary
      Your Flickr username
  • dojox.image.FlickrBadge.setid

    • type
      String
    • summary
      The id of the set to display
  • dojox.image.FlickrBadge.tags

    • type
      String|Array
    • summary
      A comma separated list of tags or an array of tags to grab from Flickr
  • dojox.image.FlickrBadge.searchText

    • type
      String
    • summary
      Free text search.  Photos who's title, description, or tags contain the text will be displayed
  • dojox.image.FlickrBadge.target

    • type
      String
    • summary
      Where to display the pictures when clicked on.  Valid values are the same as the target attribute
      of the A tag.
  • dojox.image.FlickrBadge.apikey

    • summary
  • dojox.image.FlickrBadge._store

    • summary
  • dojox.image.FlickrBadge.postCreate

    • type
      Function
    • source: [view]
        if(this.username && !this.userid){
         var def = dojo.io.script.get({
          url: "http://www.flickr.com/services/rest/",
          preventCache: true,
          content: {
           format: "json",
           method: "flickr.people.findByUsername",
           api_key: this.apikey,
           username: this.username
          },
          callbackParamName: "jsoncallback"
         });
         def.addCallback(this, function(data){
          if(data.user && data.user.nsid){
           this.userid = data.user.nsid;
           if(!this._started){
            this.startup();
           }
          }
         });
        }
    • summary
  • dojox.image.FlickrBadge.startup

    • type
      Function
    • 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);
          })
         });
        }
    • chains:
      • dojox.image.Badge.prototype.startup: (call)
    • summary
  • dojox.image

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary