diff options
author | Marcin Czarnecki <M.Czarnecki1@uni.brighton.ac.uk> | 2017-03-14 20:36:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-14 20:36:17 +0000 |
commit | df2670ca3c5d5c2eaee71fa4a90a3cccfce04daa (patch) | |
tree | 04e1b7d675392de46f9a077c4d0bea9910b6cded /core/js/update.js | |
parent | 9f1fbc2c988319af21796d959098a7f75bd1d46c (diff) | |
download | nextcloud-server-df2670ca3c5d5c2eaee71fa4a90a3cccfce04daa.tar.gz nextcloud-server-df2670ca3c5d5c2eaee71fa4a90a3cccfce04daa.zip |
Update: feedback before redirect
Signed-off-by: marncz <M.Czarnecki1@uni.brighton.ac.uk>
Diffstat (limited to 'core/js/update.js')
-rw-r--r-- | core/js/update.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/js/update.js b/core/js/update.js index cc2b20f5c99..2b2f01e9aa4 100644 --- a/core/js/update.js +++ b/core/js/update.js @@ -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,12 +97,14 @@ ); } else { // FIXME: use product name + + $el.find('.update-show-detailed').before( - $('<p>'+t('core', 'The update was successful. Redirecting you to Nextcloud in ')+'<span id="countdown"></span></p>') + $('<p id="redirect-countdown"></p>') ); - for(var i = 4; i >= 0; i--) { - self.updateCountdown(i); + for(var i = 0; i <= 4; i++){ + self.updateCountdown(i, 4); } setTimeout(function () { @@ -112,11 +114,10 @@ }); }, - updateCountdown: function (i) { + updateCountdown: function (i, total) { setTimeout(function(){ - $("#countdown").html(i + " second"); - if(i > 1) { $("#countdown").append("s"); } - }, (4 - i) * 1000); + $("#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) { |