Progress bar for allthumbs and allmeds

This commit is contained in:
q
2015-01-03 11:27:54 +02:00
parent 0f95a3010e
commit 6f66c52dff

View File

@@ -1199,6 +1199,22 @@ function getThumbStartEnd(n,maxThumb) {
return {first: startI, last: endI}
}
function allprogress() {
var imgs=document.images;
var completed=0;
for (i=0;i<imgs.length;i++) {
if (imgs[i].complete) { completed++; }
}
if (imgs.length==completed) {
$('#imagecontainer').html('');
$('#imagecontainer').css('height',0);
clearInterval($('#imagecontainer').data('preloaded'));
} else {
setProgress(completed);
}
return
}
function allthumbs() {
// Shows all the thumbnails in the current folder
thumbstr='<div id="thumbrow">';
@@ -1207,10 +1223,11 @@ function allthumbs() {
}
thumbstr+='</div>';
$('#thumbcontainer').html(thumbstr);
$('#imagecontainer').html('');
$('#imagecontainer').css('height',0);
$('#imagecontainer').html(getProgressEl());
$('#imagecontainer').css('height',15);
$('#desccontainer').hide();
currentimage=-1;
$('#imagecontainer').data('preloaded',setInterval('allprogress()', 200));
return;
}
@@ -1222,14 +1239,15 @@ function allmediums() {
}
thumbstr+='</div>';
$('#thumbcontainer').html(thumbstr);
$('#imagecontainer').html('');
$('#imagecontainer').css('height',0);
$('#imagecontainer').html(getProgressEl());
$('#imagecontainer').css('height',15);
$('#desccontainer').hide();
for (i=0; i<imagelist.length; i++) {
$('#img'+i).css('max-height',document.body.clientHeight);
$('#img'+i).css('max-width',document.body.clientWidth);
}
currentimage=-1;
$('#imagecontainer').data('preloaded',setInterval('allprogress()', 200));
return;
}