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

add back automatique after uploaded

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