2012-02-06 23:28:53 +00:00
|
|
|
var handle;
|
|
|
|
var currentpart = 0;
|
2012-02-07 22:48:54 +00:00
|
|
|
var stime = 0;
|
2012-02-06 23:28:53 +00:00
|
|
|
|
|
|
|
function xprogress()
|
|
|
|
{
|
|
|
|
var file = $('#params').attr('file');
|
|
|
|
var bpm = $('#params').attr('bpm');
|
|
|
|
|
|
|
|
if (currentpart > 0)
|
|
|
|
$.get('progress.jim?part=' + currentpart + '&file=' + file,
|
|
|
|
function(data) {
|
|
|
|
if (currentpart > 0)
|
|
|
|
{
|
|
|
|
perc = (data / bpm) * 100 / 45;
|
|
|
|
$('#progresspart' + currentpart)
|
|
|
|
.reportprogress(perc);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function xpart(part)
|
|
|
|
{
|
|
|
|
var parts = $('#params').attr('parts');
|
|
|
|
var file = $('#params').attr('file');
|
|
|
|
|
|
|
|
if (part++ < parts)
|
|
|
|
{
|
|
|
|
currentpart = part;
|
|
|
|
$('#progressstat' + part)
|
|
|
|
.text('extracting...')
|
|
|
|
.addClass('blood');
|
2012-02-07 22:48:54 +00:00
|
|
|
stime = new Date().getTime();
|
2012-02-07 00:40:31 +00:00
|
|
|
$.get('extract.jim?parts=' + parts +
|
|
|
|
'&part=' + part +
|
|
|
|
'&file=' + file,
|
2012-02-06 23:28:53 +00:00
|
|
|
function(data) {
|
2012-02-07 22:48:54 +00:00
|
|
|
var taken = (new Date().getTime() - stime) / 1000;
|
2012-02-06 23:28:53 +00:00
|
|
|
$('#progressstat' + part)
|
2012-02-07 22:48:54 +00:00
|
|
|
.text('done... (' + taken + ' seconds)')
|
2012-02-06 23:28:53 +00:00
|
|
|
.removeClass('blood');
|
|
|
|
currentpart = 0;
|
|
|
|
$('#progresspart' + part)
|
|
|
|
.reportprogress(100);
|
|
|
|
xpart(part);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
clearInterval(handle);
|
|
|
|
$('#findiv').show('slow');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
|
|
|
|
$('div.progressbar').reportprogress(0);
|
|
|
|
|
|
|
|
$('#chunkit').button().click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
$('#chunkdiv').hide('slow');
|
|
|
|
$('tr.part').show('slow');
|
|
|
|
|
|
|
|
handle = setInterval("xprogress()", 1000);
|
|
|
|
xpart(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#back').button().click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
var dir = $(this).attr('dir');
|
|
|
|
|
2013-02-25 22:31:54 +00:00
|
|
|
window.location = '../index.jim?dir=' + dir;
|
2012-02-06 23:28:53 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|