aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/update.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/update.js')
-rw-r--r--core/js/update.js28
1 files changed, 13 insertions, 15 deletions
diff --git a/core/js/update.js b/core/js/update.js
index c5f8b09d682..419ab65449f 100644
--- a/core/js/update.js
+++ b/core/js/update.js
@@ -1,16 +1,13 @@
-/*
- * Copyright (c) 2014
- *
- * This file is licensed under the Affero General Public License version 3
- * or later.
- *
- * See the COPYING-README file.
- *
+/**
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2014 ownCloud Inc.
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
(function() {
OC.Update = {
_started : false,
+ options: {},
/**
* Start the update process.
@@ -22,6 +19,7 @@
return;
}
+ this.options = options;
var hasWarnings = false;
this.$el = $el;
@@ -72,7 +70,7 @@
var updateUnsuccessful = $('<p>');
if(message === 'Exception: Updates between multiple major versions and downgrades are unsupported.') {
updateUnsuccessful.append(t('core', 'The update was unsuccessful. For more information <a href="{url}">check our forum post</a> covering this issue.', {'url': 'https://help.nextcloud.com/t/updates-between-multiple-major-versions-are-unsupported/7094'}));
- } else {
+ } else if (OC.Update.options.productName === 'Nextcloud') {
updateUnsuccessful.append(t('core', 'The update was unsuccessful. ' +
'Please report this issue to the ' +
'<a href="https://github.com/nextcloud/server/issues" target="_blank">Nextcloud community</a>.'));
@@ -86,18 +84,15 @@
$('#update-progress-icon')
.addClass('icon-checkmark-white')
- .removeClass('icon-loading-dark');
+ .removeClass('icon-loading-dark');
if (hasWarnings) {
$el.find('.update-show-detailed').before(
- $('<input type="button" class="update-continue" value="'+t('core', 'Continue to Nextcloud')+'">').on('click', function() {
+ $('<input type="button" class="primary" value="'+t('core', 'Continue to {productName}', OC.Update.options)+'">').on('click', function() {
window.location.reload();
})
);
} else {
- // FIXME: use product name
-
-
$el.find('.update-show-detailed').before(
$('<p id="redirect-countdown"></p>')
);
@@ -115,7 +110,9 @@
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));
+ $("#redirect-countdown").text(
+ n('core', 'The update was successful. Redirecting you to {productName} in %n second.', 'The update was successful. Redirecting you to {productName} in %n seconds.', i, OC.Update.options)
+ );
}, (total - i) * 1000);
},
@@ -159,6 +156,7 @@ window.addEventListener('DOMContentLoaded', function() {
});
return false;
});
+
$('.update-show-detailed').on('click', function() {
$('#update-progress-detailed').toggleClass('hidden');
return false;