Commit 9d628efc authored by Aral Balkan's avatar Aral Balkan
Browse files

Cleaned up the JS. Updated thank you copy.

parent ef997a11
......@@ -89,6 +89,8 @@ var displayMessage = function(message) {
messageDisplay.innerHTML = message;
messageDisplay.style.display = 'block';
// messageDisplay.scrollIntoView();
};
......@@ -167,7 +169,8 @@ uploadItButton.addEventListener('click', function(evt) {
uploadItButton.disabled = true;
// Display status message and (TODO) display link to the user’s video.
displayMessage('<b>Uploaded… thank you!</b> Share your video with friends. Here’s the link:')
// TODO Get the link back from the server.
displayMessage('<h1>Uploaded… thank you!</h1><p>Share your video with friends.</p><p>Here’s the link:</p>');
});
xhr.upload.addEventListener('loadend', function(e) {
......@@ -200,26 +203,6 @@ uploadItButton.addEventListener('click', function(evt) {
}
});
////
// xhr.upload.onprogress = function(e) {
// if (e.lengthComputable) {
// var percentage = (e.loaded / e.total) * 100;
// document.getElementById('progress').style.width = percentage + '%';
// }
// }
// xhr.onerror = function(e) {
// console.log('Error: ' + e);
// displayMessage('Sorry, could not upload your video. Perhaps it was too long/too big?');
// }
// xhr.onload = function() {
// console.log('XHR ONLOAD');
// displayMessage(this.statusText);
// }
xhr.send(formData);
} else {
console.log('Not uploading: wrong type of file selected. Probably a hack attempt (seriously?)')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment