webif/var/mongoose/html/browse/thumbnail/script.js
hummypkg b2c7be03a4 add thumbnail generation
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1445 2a923420-c742-0410-a762-8d5b09965624
2013-03-11 23:00:41 +00:00

59 lines
1.3 KiB
JavaScript
Executable File

$(document).ready(function() {
var dir = $('#dir').text();
var file = $('#file').text();
$('button').button();
function go(pos)
{
window.location.href = 'index.jim?file=' +
encodeURIComponent(file) + '&pos=' + pos;
}
$('button.mvpos').disable().on('click', function(e) {
e.preventDefault();
var pos = $(this).attr('pos');
go(pos);
});
$('#repos').disable().on('click', function(e) {
e.preventDefault();
var pos = $('#pos').val();
go(pos);
});
$('#back').on('click', function(e) {
e.preventDefault();
window.location.href = '/browse/index.jim?dir=' +
encodeURIComponent(dir);
});
$('button.usethm').disable().on('click', function(e) {
e.preventDefault();
var pos = $(this).attr('pos');
$('button,input').disable();
$.get('set.jim?file=' + encodeURIComponent(file) + '&pos=' + pos,
function() {
window.location.href = '/browse/index.jim?dir=' +
encodeURIComponent(dir);
});;
});
var start = $('#start').text();
var end = $('#end').text();
$.get('mkrange.jim?file=' + encodeURIComponent(file) +
'&s=' + start + '&e=' + end, function() {
$('img.bmp').each(function(i) {
var pos = $(this).attr('pos');
$(this).attr('src',
'fetch.jim?file=' + encodeURIComponent(file) +
'&pos=' + pos);
});
$('button').enable();
});
});