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>
<script src="../<%= copy.renderjs.relative_dest %>" type="text/javascript"></script>
<script src="../<%= curl.jquery.relative_dest %>" type="text/javascript"></script>
<script src="../<%= curl.jquerymobilejs.relative_dest %>"></script>
<link rel="stylesheet" href="../<%= curl.jquerymobilecss.relative_dest %>">
<!-- custom script -->
<script src="./audioplayer.js" type="text/javascript"></script>
<link rel="stylesheet" href="./audioplayer.css" media="screen" ></link> </head>
<!-- renderjs -->
<script src="../<%= copy.rsvp.relative_dest %>" type="text/javascript"></script>
<script src="../<%= copy.renderjs.relative_dest %>" type="text/javascript"></script>
<script src="../<%= curl.jquery.relative_dest %>" type="text/javascript"></script>
<script src="../<%= curl.jquerymobilejs.relative_dest %>"></script>
<link rel="stylesheet" href="../<%= curl.jquerymobilecss.relative_dest %>">
<!-- custom script -->
<script src="./audioplayer.js" type="text/javascript"></script>
<link rel="stylesheet" href="./audioplayer.css" media="screen" ></link>
</head>
<body>
<div class="nav" data-role="header" data-theme="b">
<h1>music player</h1>
<a data-icon="plus" href="#page=upload" >add</a>
<a data-icon="grid" href="#page=playlist" >playlist</a>
</div>
<div class="page">
</div>
<div class="offline" data-gadget-url="../audioplayer_bridge/index.html" data-gadget-scope="offline" >
</div>
<div class="localhost" data-gadget-url="../audioplayer_bridge/index.html" data-gadget-scope="localhost" >
</div>
<div class="online" data-gadget-url="../audioplayer_bridge/index.html" data-gadget-scope="online" >
</div>
<article class="gadget_container"></article>
<article class="gadget_container"></article>
</body>
</html>
......@@ -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