Commit da5be247 authored by Xiaowu Zhang's avatar Xiaowu Zhang

add storage insufficente notify when upload

parent fd120a1c
<!DOCTYPE html>
<html manifest="audioPlayer.appcache">
<!--html manifest="audioPlayer.appcache"-->
<head>
<!-- renderjs -->
<script src="../<%= copy.rsvp.relative_dest %>" type="text/javascript"></script>
......@@ -11,7 +11,8 @@
<!-- custom script -->
<script src="./audioplayer.js" type="text/javascript"></script>
<link rel="stylesheet" href="./audioplayer.css" media="screen" ></link> </head>
<link rel="stylesheet" href="./audioplayer.css" media="screen" ></link>
</head>
<body>
<div class="nav" data-role="header" data-theme="b">
<h1>music player</h1>
......
......@@ -20,8 +20,8 @@
<body>
<h1> the music uploaded is duplicated in browser, using of localhost or online is recommmended </h1>
<input type="file" multiple />
<ul class="info">
</ul>
</body>
......
......@@ -47,16 +47,21 @@
uploaded += 1;
info_context.innerHTML += "<li>" +
input_context.files[uploaded - 1].name
+ " uploaded " + uploaded + "/" + length + " </li>";
+ " " + uploaded + "/" + length + "</li>";
if (uploaded === length) {
return g.plEnablePage();
}
queue.push(post);
})
.fail(function (e) {
uploaded += 1;
console.log("error");
return post();
.fail(function (error) {
if (!(error instanceof RSVP.CancellationError)) {
info_context.innerHTML +=
input_context.files[uploaded].name +
" failed : storage insufficient";
return g.plEnablePage();
}
document.getElementsByTagName('body')[0].textContent =
JSON.stringify(error);
});
}
queue = new RSVP.Queue();
......
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