oxdata/templates/poster.html

42 lines
1 KiB
HTML
Raw Normal View History

2009-07-15 16:39:28 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
.hide {
display: none;
}
</style>
<script src="/static/js/jquery.js"></script>
<script>
$(function(){
$.getJSON('/poster/json?imdb={{ imdb }}', function(posters) {
$("#loading").hide();
$.each(posters, function(key, urls) {
var id = 'row' + key.replace('.', '_');
var row = '<tr id="'+id+'">';
row += '<td id="'+id+'_title">' + key + '</td>';
$.each(urls, function(i, poster) {
row += '<td>';
row += '<img src="'+poster.url+'" height="256">';
row += '<div>' + poster.width + 'x'+ poster.height + '</div>';
row += '</td>';
});
row += '</tr>';
$("#posters").append(row);
$('#'+id+'_title').click(function() {
$('#'+id+' img, #'+id+' div').toggleClass("hide");
});
});
});
});
</script>
</head>
<body>
<div id="loading">loading...</div>
<table id="posters">
</table>
</body>
</html>