Merge pull request #3624 from marncz/master

Update.js: countdown feedback before redirect
This commit is contained in:
Roeland Jago Douma 2017-03-16 07:56:51 +01:00 committed by GitHub
commit 4d207680f2
1 changed files with 15 additions and 2 deletions

View File

@ -87,7 +87,7 @@
$('#update-progress-icon')
.addClass('icon-checkmark-white')
.removeClass('icon-loading-dark');
.removeClass('icon-loading-dark');
if (hasWarnings) {
$el.find('.update-show-detailed').before(
@ -97,9 +97,16 @@
);
} else {
// FIXME: use product name
$el.find('.update-show-detailed').before(
$('<p>'+t('core', 'The update was successful. Redirecting you to Nextcloud now.')+'</p>')
$('<p id="redirect-countdown"></p>')
);
for(var i = 0; i <= 4; i++){
self.updateCountdown(i, 4);
}
setTimeout(function () {
OC.redirect(OC.webroot + '/');
}, 3000);
@ -107,6 +114,12 @@
});
},
updateCountdown: function (i, total) {
setTimeout(function(){
$("#redirect-countdown").text(n('core', 'The update was successful. Redirecting you to Nextcloud in %n second.', 'The update was successful. Redirecting you to Nextcloud in %n seconds.', i));
}, (total - i) * 1000);
},
setMessage: function(message) {
$('#update-progress-message').html(message);
$('#update-progress-detailed')