Make the permanode file upload onchange do something.

Change-Id: I7e3ce0257906e733e8f81dd5a94b2eb34361bcc3
This commit is contained in:
Brad Fitzpatrick 2012-12-06 14:32:45 -08:00
parent f7562e033a
commit d1c8a85308
2 changed files with 12 additions and 3 deletions

View File

@ -81,7 +81,7 @@
<input type="file" id="fileInput" multiple="true" onchange="">
<input type="submit" id="fileUploadBtn" value="Upload">
</form>
<p>
<p id='filelist'>
<em>or drag &amp; drop files here</em>
</p>
<pre id="info"></pre>

View File

@ -247,11 +247,20 @@ function startFileUpload(file) {
function onFileFormSubmit(e) {
e.stopPropagation();
e.preventDefault();
alert("TODO: upload");
handleFiles(document.getElementById("fileInput").files);
}
function $(id) { return document.getElementById(id) }
function onFileInputChange(e) {
handleFiles(document.getElementById("fileInput").files);
var s = "";
var files = $("fileInput").files;
for (var i = 0; i < files.length; i++) {
var file = files[i];
s += "<p>" + file.name + "</p>";
}
var fl = $("filelist");
fl.innerHTML = s;
}
function setupFilesHandlers() {