]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update: feedback before redirect
authorMarcin Czarnecki <M.Czarnecki1@uni.brighton.ac.uk>
Sat, 25 Feb 2017 19:16:22 +0000 (19:16 +0000)
committerGitHub <noreply@github.com>
Sat, 25 Feb 2017 19:16:22 +0000 (19:16 +0000)
Signed-off-by: marncz <M.Czarnecki1@uni.brighton.ac.uk>
core/js/update.js

index e849d8a16ce79b416d4bbc15242e6bedd7a7c64b..cc2b20f5c9975dbdfbc345e0aa86c87e05700316 100644 (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(
                                } 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>'+t('core', 'The update was successful. Redirecting you to Nextcloud in ')+'<span id="countdown"></span></p>')
                                        );
+
+                                       for(var i = 4; i >= 0; i--) {
+                                               self.updateCountdown(i);
+                                       }
+
                                        setTimeout(function () {
                                                OC.redirect(OC.webroot + '/');
                                        }, 3000);
                        });
                },
 
+               updateCountdown: function (i) {
+                       setTimeout(function(){
+                                $("#countdown").html(i + " second");
+                                if(i > 1) {  $("#countdown").append("s");  }
+                       }, (4 - i) * 1000);
+               },
+
                setMessage: function(message) {
                        $('#update-progress-message').html(message);
                        $('#update-progress-detailed')