2012-02-07 00:17:33 +00:00
|
|
|
|
|
|
|
$('#filelist li').hover(
|
|
|
|
function() { $(this).css('cursor', 'pointer'); },
|
|
|
|
function() { $(this).css('cursor', 'auto'); }
|
|
|
|
);
|
|
|
|
|
|
|
|
var handle = 0;
|
|
|
|
|
|
|
|
function update()
|
|
|
|
{
|
|
|
|
$.get('progress.jim'
|
|
|
|
+ '?esize=' + $('#back').attr('esize')
|
|
|
|
+ '&file=' + $('#back').attr('dir') + '/' + $('#dest').val(),
|
|
|
|
function(data) {
|
|
|
|
if (handle)
|
|
|
|
$('#progressbar').reportprogress(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
$('#progressbar').reportprogress(0);
|
|
|
|
|
|
|
|
$('#back').button().click(function() {
|
2013-02-25 22:31:54 +00:00
|
|
|
window.location = '../index.jim?dir=' + $(this).attr('dir');
|
2012-02-07 00:17:33 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
$('#filelist').sortable().disableSelection();
|
|
|
|
|
|
|
|
$('#dojoin').button().attr('disabled', true).addClass('ui-state-disabled')
|
|
|
|
.click(function() {
|
|
|
|
var files = $('#filelist').sortable('toArray');
|
|
|
|
var sfiles = new Array();
|
|
|
|
for (x in files)
|
|
|
|
sfiles.push(encodeURIComponent(files[x]));
|
|
|
|
|
|
|
|
$('#joindiv').hide('slow');
|
|
|
|
$('#progressdiv').show('slow');
|
|
|
|
handle = setInterval("update()", 1000);
|
|
|
|
|
|
|
|
$('#output').text('Please do not interrupt...')
|
|
|
|
.load('execute.jim?files=' +
|
|
|
|
sfiles.join() + '&dest=' + $('#dest').val(),
|
|
|
|
function() {
|
|
|
|
clearInterval(handle);
|
|
|
|
handle = 0;
|
|
|
|
$('#back').show();
|
|
|
|
$('#progressbar').reportprogress(100);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#dest').val('').keyup(function() {
|
|
|
|
if ($(this).val().length > 0)
|
|
|
|
$('#dojoin')
|
|
|
|
.removeProp('disabled').removeClass('ui-state-disabled');
|
|
|
|
else
|
|
|
|
$('#dojoin')
|
|
|
|
.prop('disabled', true).addClass('ui-state-disabled');
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|