summaryrefslogtreecommitdiff
path: root/spice.html
diff options
context:
space:
mode:
authorPavel Grunt <pgrunt@redhat.com>2015-01-14 17:44:41 +0100
committerJeremy White <jwhite@codeweavers.com>2015-01-15 09:00:00 -0600
commit50e279577199946e1058e60084a564fafc6f1a1f (patch)
tree6aac4a57767643a654db69da7c9803eba586af5b /spice.html
parentb9b8567c9d12f8d4162a777f36cf77980f647bb0 (diff)
Use drag and drop for transfering files from client to guest
Diffstat (limited to 'spice.html')
-rw-r--r--spice.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/spice.html b/spice.html
index fc53a2a..000f23d 100644
--- a/spice.html
+++ b/spice.html
@@ -111,6 +111,11 @@
}
document.getElementById('connectButton').innerHTML = "Start";
document.getElementById('connectButton').onclick = connect;
+ if (window.File && window.FileReader && window.FileList && window.Blob)
+ {
+ document.getElementById('spice-area').removeEventListener('dragover', handle_file_dragover, false);
+ document.getElementById('spice-area').removeEventListener('drop', handle_file_drop, false);
+ }
console.log("<< disconnect");
}
@@ -120,6 +125,16 @@
window.spice_connection = this;
resize_helper(this);
+
+ if (window.File && window.FileReader && window.FileList && window.Blob)
+ {
+ document.getElementById('spice-area').addEventListener('dragover', handle_file_dragover, false);
+ document.getElementById('spice-area').addEventListener('drop', handle_file_drop, false);
+ }
+ else
+ {
+ console.log("File API is not supported");
+ }
}
</script>