mirror of
https://github.com/wezm/wezm.net.git
synced 2024-12-23 04:29:54 +00:00
51f62bf5ac
A generated style sheet is no longer needed and the HTML makes more sense.
27 lines
873 B
JavaScript
27 lines
873 B
JavaScript
jQuery(function () {
|
|
function render_image(o) {
|
|
return '<li>\n\
|
|
<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>';
|
|
};
|
|
|
|
function populate_flickr(data, text_status) {
|
|
var ul = $("ul", "#flickr");
|
|
ul.empty();
|
|
jQuery.each($('photo', data), function(i, obj) {
|
|
var photo = $(obj);
|
|
var image = {
|
|
href: photo.attr('url_m'),
|
|
src: '/images/photos.jpg',
|
|
alt: photo.attr('title'),
|
|
};
|
|
var li = $(render_image(image));
|
|
$('img', li).css({left: (i * -75) + 'px'});
|
|
ul.append(li);
|
|
});
|
|
$("a[rel^='prettyPhoto']").prettyPhoto({theme: "facebook"});
|
|
};
|
|
|
|
// Populate Flickr
|
|
jQuery.get("/photos.xml", {dataType: 'xml'}, populate_flickr);
|
|
});
|