2010-01-26 08:49:53 +00:00
|
|
|
jQuery(function () {
|
2010-02-25 21:08:49 +00:00
|
|
|
function render_image(o) {
|
|
|
|
return '<li>\n\
|
2010-02-28 20:37:38 +00:00
|
|
|
<a href="' + (Mojo.escape(Mojo.normalize(o.href))) + '" rel="prettyPhoto[flickr]"><img src="' + (Mojo.escape(Mojo.normalize(o.src))) + '" alt="' + (Mojo.escape(Mojo.normalize(o.alt))) + '" /></a>\n\
|
|
|
|
</li>';
|
2010-02-25 21:08:49 +00:00
|
|
|
};
|
|
|
|
|
2010-01-26 08:49:53 +00:00
|
|
|
function populate_flickr(data, text_status) {
|
|
|
|
var ul = $("ul", "#flickr");
|
2010-02-28 20:37:38 +00:00
|
|
|
ul.empty();
|
2010-02-25 21:08:49 +00:00
|
|
|
jQuery.each($('photo', data), function(i, obj) {
|
|
|
|
var photo = $(obj);
|
|
|
|
var image = {
|
|
|
|
href: photo.attr('url_m'),
|
2010-02-28 20:37:38 +00:00
|
|
|
src: '/images/photos.jpg',
|
|
|
|
alt: photo.attr('title'),
|
2010-02-25 21:08:49 +00:00
|
|
|
};
|
|
|
|
var li = $(render_image(image));
|
2010-02-28 20:37:38 +00:00
|
|
|
$('img', li).css({left: (i * -75) + 'px'});
|
2010-01-26 08:49:53 +00:00
|
|
|
ul.append(li);
|
|
|
|
});
|
2010-01-27 10:17:02 +00:00
|
|
|
$("a[rel^='prettyPhoto']").prettyPhoto({theme: "facebook"});
|
2010-01-26 08:49:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Populate Flickr
|
2010-02-25 21:08:49 +00:00
|
|
|
jQuery.get("/photos.xml", {dataType: 'xml'}, populate_flickr);
|
2010-01-26 08:49:53 +00:00
|
|
|
});
|