diff options
| author | oweissbarth | 2014-07-24 23:57:00 +0200 |
|---|---|---|
| committer | oweissbarth | 2014-07-24 23:57:00 +0200 |
| commit | 11fc80d072103f72c8e648d804b54ff9bca7958e (patch) | |
| tree | d0d2f066f5af8aaa007b5de90b82140276f50351 | |
| parent | c89bd0fc5efb765166e6e7630c9c62cf917c6bda (diff) | |
| download | files.iamfabulous.de-11fc80d072103f72c8e648d804b54ff9bca7958e.tar.gz | |
improved upload ui
| -rw-r--r-- | www/static/dropzone.css | 36 | ||||
| -rw-r--r-- | www/static/js/dropzone.js | 13 |
2 files changed, 34 insertions, 15 deletions
diff --git a/www/static/dropzone.css b/www/static/dropzone.css index 01649de..8d94dad 100644 --- a/www/static/dropzone.css +++ b/www/static/dropzone.css @@ -29,7 +29,7 @@ } #filelist th{ - background: green; + border-bottom: 1px solid black; } #filelist tr{ @@ -50,17 +50,33 @@ text-align: center; } + #progress-head{ + text-align: right; + padding-right: 22px; + } + + td.filenameCol{ + max-width: 190px; + overflow: hidden; + } + + td.filesizeCol{ + width: 55px; + text-align: right; + } td.publicCol{ - width: 80px; + width: 40px; text-align: center; vertical-align: middle; } - td.filenameCol{ - width: 130px; - overflow: hidden; + td.progressCol{ + width: 100px; + height: 20px; + text-align:right; + padding-right: 22px; } .progressBar{ @@ -71,14 +87,10 @@ height: 18px; border-radius: 9px; vertical-align: middle; + } - .progressCol{ - width: 100px; - height: 20px; - } - .filesize{ - text-align: right; - } + + diff --git a/www/static/js/dropzone.js b/www/static/js/dropzone.js index 7accdc2..8a98a54 100644 --- a/www/static/js/dropzone.js +++ b/www/static/js/dropzone.js @@ -69,14 +69,19 @@ var vfs_upload_queue = []; var filesize = document.createElement("td"); filesize.appendChild(document.createTextNode(Math.floor(file.size/1024*100)/100+"KB")); - filesize.className = "filesize"; + filesize.className = "filesizeCol"; var progressBar = document.createElement("progress"); progressBar.id="progressBar-"+file.name; progressBar.className="progressBar"; + progressBar.style.display="none"; + var progressPending = document.createElement("p"); + progressPending.id="progressPending-"+file.name; + progressPending.appendChild(document.createTextNode("pending")); var progressCol = document.createElement("td"); progressCol.className="progressCol"; progressCol.appendChild(progressBar); + progressCol.appendChild(progressPending); var publicCol = document.createElement("td"); publicCol.className="publicCol"; @@ -98,6 +103,8 @@ var vfs_upload_queue = []; function upload(){ for(i = 0; i<vfs_upload_queue.length; i++){ + document.getElementById("progressPending-"+vfs_upload_queue[i].name).style.display = "none"; + document.getElementById("progressBar-"+vfs_upload_queue[i].name).style.display = "inline"; document.getElementById("progressBar-"+vfs_upload_queue[i].name).value = 0; document.getElementById("progressBar-"+vfs_upload_queue[i].name).max = 100; var xhr = new XMLHttpRequest(); @@ -117,8 +124,8 @@ var vfs_upload_queue = []; xhr.onload=function(){ if (xhr.status==200){ - }else{ - alert("upload failed"); + }else if (xhr.status != 0){ + alert("upload failed due to "+xhr.status); } }; |
