Activate your free membership today | Log-in

Wednesday, June 25th, 2008

Badging Flickr with Dojo

Category: Dojo, Examples

Dylan Schiemann has a really nice case study post on implementing a Flickr badge with Dojo.

What is particularly interesting is how he starts with a simple version:

HTML:
  1.  
  2. ...
  3. <link rel="stylesheet" href="/dojo/dojox/image/resources/image.css" />
  4. <style type="text/css">
  5.         img.thing { width:50px; height:50px; }
  6. </style>
  7. ...
  8. </head>
  9. ...
  10. <div dojoType="dojox.image.FlickrBadge" rows="8" cols="3" username="dylans"
  11.         tags="dojotoolkit,italy"></div>
  12. ...
  13. <script type="text/javascript" src="/dojo/dojo/dojo.js"
  14.         djConfig="parseOnLoad: true"></script>
  15. <script type="text/javascript">
  16.         dojo.require("dojox.image.FlickrBadge");
  17. </script>
  18. </body>
  19.  

And then shows how he tweaks it for performance, explaining what he is doing along the way:

HTML:
  1.  
  2. ...
  3. <link rel="stylesheet" href="/dojo/dojox/image/resources/image.css" />
  4. <style type="text/css">
  5.         img.thing { width:50px; height:50px; }
  6. </style>
  7. ...
  8. </head>
  9. ...
  10. <div id="flickrSidebox"></div>
  11. ...
  12. <script type="text/javascript" src="/dojo/dojo/dojo.js"></script>
  13. <script type="text/javascript">
  14.         function initBadge(){
  15.                 new dojox.image.FlickrBadge({rows: 8, cols: 3,
  16.                         username: "dylans", tags:"italy,dojotoolkit"},
  17.                         "flickrSidebox").startup();
  18.         }
  19.         dojo.addOnLoad(function(){ dojo.require("dojo.badge");
  20.                 dojo.addOnLoad(initBadge)});
  21. </script>
  22.  

It is nice to see his thought process, and how you can start with functionality, and then go back and tweak away.

Posted by Dion Almaer at 7:06 am

+++--
3.2 rating from 29 votes

Comments Here »

Comments feed TrackBack URI

Leave a comment

You must be logged in to post a comment.