posters all over
This commit is contained in:
parent
bc59f543cb
commit
0243766f8f
25 changed files with 211 additions and 211 deletions
41
templates/poster.html
Normal file
41
templates/poster.html
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<!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>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue