/* Class : FileProgress
 * 
 * Simple class representing a file upload bar UI.
 * 
 */

// Construct a new FileProgress object and show the relevant divs
function FileProgress() {
  this.bar_parent = jQuery('#progress_parent');
  this.bar = jQuery('#progress_bar');
  this.status = jQuery('#progress_status');
  
  this.bar_parent.show();
}
// Set the state to 'started''
FileProgress.prototype.setStart = function () {
	this.status.html('Uploading...');
  this.bar.css('width', '0%');
};
// Update the progress
FileProgress.prototype.setProgress = function (percentage) {
	this.status.html(percentage + '%');
  this.bar.css('width', percentage+'%');
};
// Set the state to 'complete'
FileProgress.prototype.setComplete = function () {
	this.status.html('Complete!');
  this.bar.css('width', '100%');
};
// Set a status message (with no upload bar)
FileProgress.prototype.setStatus = function (status) {
  this.status.html(status);
  this.bar.css('width', '0%');
};