Commit 9eb57864 authored by Xiaowu Zhang's avatar Xiaowu Zhang

add back automatique after uploaded

parent 525e180d
......@@ -19,7 +19,7 @@
<body>
<progress class="bar" style="width: 100%;">
<progress class="bar">
</progress>
<div class="box" style="display:none;position:absolute;">
......
......@@ -4,6 +4,17 @@
(function(window, jIO, rJS) {
"use strict";
var gk = rJS(window);
function exit(g) {
return RSVP.Queue().push(function() {
return g.plEnablePage();
}).push(function() {
return g.displayThisPage({
page: "playlist"
});
}).push(function(url) {
window.location = url;
});
}
gk.declareAcquiredMethod("jio_post", "jio_post").declareAcquiredMethod("jio_putAttachment", "jio_putAttachment").declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash").declareAcquiredMethod("displayThisPage", "displayThisPage").declareAcquiredMethod("displayThisTitle", "displayThisTitle").declareAcquiredMethod("plEnablePage", "plEnablePage").declareAcquiredMethod("plDisablePage", "plDisablePage").declareMethod("render", function() {
return this.displayThisTitle("upload");
}).declareMethod("startService", function() {
......@@ -30,7 +41,7 @@
uploaded += 1;
info_context.innerHTML += "<li>" + input_context.files[uploaded - 1].name + " " + uploaded + "/" + length + "</li>";
if (uploaded === length) {
return g.plEnablePage();
return exit(g);
}
queue.push(post);
}).fail(function(error) {
......
......@@ -19,7 +19,7 @@
<body>
<progress class="bar" style="width: 100%;">
<progress class="bar">
</progress>
<div class="box" style="display:none;position:absolute;">
......
......@@ -4,6 +4,19 @@
(function (window, jIO, rJS) {
"use strict";
var gk = rJS(window);
function exit(g) {
return RSVP.Queue()
.push(function () {
return g.plEnablePage();
})
.push(function () {
return g.displayThisPage({page: "playlist"});
})
.push(function (url) {
window.location = url;
});
}
gk.declareAcquiredMethod("jio_post", "jio_post")
.declareAcquiredMethod("jio_putAttachment", "jio_putAttachment")
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")
......@@ -49,7 +62,7 @@
input_context.files[uploaded - 1].name
+ " " + uploaded + "/" + length + "</li>";
if (uploaded === length) {
return g.plEnablePage();
return exit(g);
}
queue.push(post);
})
......
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