41 lines
1 KiB
HTML
41 lines
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">' + 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>
|
|
|