Cleaned up whitespace
This commit is contained in:
parent
f8a46f2089
commit
2234202c69
1 changed files with 9 additions and 9 deletions
|
|
@ -15,11 +15,11 @@ jQuery(document).ready(function(){
|
||||||
/* Initiates a new upload */
|
/* Initiates a new upload */
|
||||||
function initUpload(){
|
function initUpload(){
|
||||||
var name = "uploadFrame_"+upload_index;
|
var name = "uploadFrame_"+upload_index;
|
||||||
|
|
||||||
// Add iframe
|
// Add iframe
|
||||||
jQuery("body").append("<iframe id='"+name+"' name='"+name+"' height='0' " +
|
jQuery("body").append("<iframe id='"+name+"' name='"+name+"' height='0' " +
|
||||||
"width='0' frameborder='0' scrolling='yes' src='about:blank'></iframe>");
|
"width='0' frameborder='0' scrolling='yes' src='about:blank'></iframe>");
|
||||||
|
|
||||||
// Init form settings
|
// Init form settings
|
||||||
var form = jQuery("#AjaxFileUpload");
|
var form = jQuery("#AjaxFileUpload");
|
||||||
//form.attr("encoding", "multipart/form-data");
|
//form.attr("encoding", "multipart/form-data");
|
||||||
|
|
@ -29,19 +29,19 @@ function initUpload(){
|
||||||
form.attr("action", "{SERVLET_URL}");
|
form.attr("action", "{SERVLET_URL}");
|
||||||
form.bind('submit', startUpload );
|
form.bind('submit', startUpload );
|
||||||
//form.attr("onSubmit", "startUpload()");
|
//form.attr("onSubmit", "startUpload()");
|
||||||
|
|
||||||
// reset the form
|
// reset the form
|
||||||
jQuery("#AjaxFileUpload").each(function(){
|
jQuery("#AjaxFileUpload").each(function(){
|
||||||
this.reset();
|
this.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
upload_index++;
|
upload_index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
function startUpload(){
|
function startUpload(){
|
||||||
if(!upload_update)
|
if(!upload_update)
|
||||||
setTimeout("updateUploadStatus()", 500);
|
setTimeout("updateUploadStatus()", 500);
|
||||||
|
|
||||||
// Init new upload
|
// Init new upload
|
||||||
setTimeout("initUpload()", 500);
|
setTimeout("initUpload()", 500);
|
||||||
}
|
}
|
||||||
|
|
@ -59,7 +59,7 @@ function updateUploadStatus(){
|
||||||
upload_update = false;
|
upload_update = false;
|
||||||
}
|
}
|
||||||
else setTimeout("updateUploadStatus()", 1000);
|
else setTimeout("updateUploadStatus()", 1000);
|
||||||
|
|
||||||
// Request upload info
|
// Request upload info
|
||||||
jQuery.each(data, function(index,item){
|
jQuery.each(data, function(index,item){
|
||||||
// add new list item if needed
|
// add new list item if needed
|
||||||
|
|
@ -75,14 +75,14 @@ function updateUploadStatus(){
|
||||||
jQuery("#UploadQueue #"+item.id+" .filename").html( item.filename );
|
jQuery("#UploadQueue #"+item.id+" .filename").html( item.filename );
|
||||||
if(jQuery("#UploadQueue #"+item.id+" .progress").size() > 0)
|
if(jQuery("#UploadQueue #"+item.id+" .progress").size() > 0)
|
||||||
jQuery("#UploadQueue #"+item.id+" .progress").animate({width: item.percent+"%"}, 'slow');
|
jQuery("#UploadQueue #"+item.id+" .progress").animate({width: item.percent+"%"}, 'slow');
|
||||||
|
|
||||||
if(jQuery("#UploadQueue #"+item.id+" .total").size() > 0)
|
if(jQuery("#UploadQueue #"+item.id+" .total").size() > 0)
|
||||||
jQuery("#UploadQueue #"+item.id+" .total").html( item.total );
|
jQuery("#UploadQueue #"+item.id+" .total").html( item.total );
|
||||||
if(jQuery("#UploadQueue #"+item.id+" .uploaded").size() > 0)
|
if(jQuery("#UploadQueue #"+item.id+" .uploaded").size() > 0)
|
||||||
jQuery("#UploadQueue #"+item.id+" .uploaded").html( item.uploaded );
|
jQuery("#UploadQueue #"+item.id+" .uploaded").html( item.uploaded );
|
||||||
if(jQuery("#UploadQueue #"+item.id+" .speed").size() > 0)
|
if(jQuery("#UploadQueue #"+item.id+" .speed").size() > 0)
|
||||||
jQuery("#UploadQueue #"+item.id+" .speed").html( item.speed );
|
jQuery("#UploadQueue #"+item.id+" .speed").html( item.speed );
|
||||||
|
|
||||||
// remove li when done
|
// remove li when done
|
||||||
if( item.status == "Done" ){
|
if( item.status == "Done" ){
|
||||||
jQuery("#UploadQueue #"+item.id).delay(5000).fadeOut("slow", function(){
|
jQuery("#UploadQueue #"+item.id).delay(5000).fadeOut("slow", function(){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue