summaryrefslogtreecommitdiff
path: root/filexfer.js
diff options
context:
space:
mode:
Diffstat (limited to 'filexfer.js')
-rw-r--r--filexfer.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/filexfer.js b/filexfer.js
index 2ba0671..2887e14 100644
--- a/filexfer.js
+++ b/filexfer.js
@@ -24,6 +24,35 @@ function SpiceFileXferTask(id, file)
this.file = file;
}
+SpiceFileXferTask.prototype.create_progressbar = function()
+{
+ this.progressbar_container = document.createElement("div");
+ this.progressbar = document.createElement("progress");
+
+ this.progressbar.setAttribute('max', this.file.size);
+ this.progressbar.setAttribute('value', 0);
+ this.progressbar.style.width = '100%';
+ this.progressbar.style.margin = '4px auto';
+ this.progressbar.style.display = 'inline-block';
+ this.progressbar_container.style.width = '90%';
+ this.progressbar_container.style.margin = 'auto';
+ this.progressbar_container.style.padding = '4px';
+ this.progressbar_container.textContent = this.file.name;
+ this.progressbar_container.appendChild(this.progressbar);
+ document.getElementById('spice-xfer-area').appendChild(this.progressbar_container);
+}
+
+SpiceFileXferTask.prototype.update_progressbar = function(value)
+{
+ this.progressbar.setAttribute('value', value);
+}
+
+SpiceFileXferTask.prototype.remove_progressbar = function()
+{
+ if (this.progressbar_container && this.progressbar_container.parentNode)
+ this.progressbar_container.parentNode.removeChild(this.progressbar_container);
+}
+
function handle_file_dragover(e)
{
e.stopPropagation();