Calculate progress against estimated audio size CGI parameter, reduce update frequency

This commit is contained in:
df 2020-09-07 14:56:27 +00:00
parent 159a5a58ad
commit 8733ffe0e8
1 changed files with 18 additions and 18 deletions

View File

@ -3,7 +3,7 @@ var handle = 0;
function update()
{
$.get('progress.jim?file=' + $('#params').attr('rfile'),
$.get('progress.jim?file=' + $('#params').attr('rfile') + '&asize=' + $('#params').attr('asize'),
function(data) {
if (handle)
$('#progressbar').reportprogress(data);
@ -12,25 +12,25 @@ function update()
$(document).ready(function() {
$('#progressbar').reportprogress(0);
$('#progressbar').reportprogress(0);
$('#back').button().click(function() {
window.location = '/go/browse?dir=' + $('#params').attr('dir');
});
$('#audioit').button().click(function() {
$('#audiodiv').hide('slow');
$('#progressdiv').show('slow');
$('#back').hide();
handle = setInterval("update()", 1000);
$('#output').load('execute.jim?file=' + $('#params').attr('rfile'),
function() {
clearInterval(handle);
handle = 0;
$('#back').show();
$('#progressbar').reportprogress(100);
$('#back').button().click(function() {
window.location = '/go/browse?dir=' + $('#params').attr('dir');
});
$('#audioit').button().click(function() {
$('#audiodiv').hide('slow');
$('#progressdiv').show('slow');
$('#back').hide();
handle = setInterval("update()", 1000);
$('#output').load('execute.jim?file=' + $('#params').attr('rfile'),
function() {
clearInterval(handle);
handle = 0;
$('#back').show();
$('#progressbar').reportprogress(100);
});
});
});
});