oxdata/templates/poster.html
2009-07-15 20:19:56 +02:00

41 lines
1.1 KiB
HTML

<!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" valign="top">' + key + '</td>';
row += '<td>';
$.each(urls, function(i, poster) {
row += '<div style="float: left; height: 280px;padding-right: 4px;"><img src="'+poster.url+'" height="256">';
row += '<div>' + poster.width + 'x'+ poster.height + '</div></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>