From 4dec2cca5cc97940a5ce3539a9be0c12a3bdc29c Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 11 Jun 2018 18:18:39 +0200 Subject: [PATCH] Translations for new version detected --- customize.dist/translations/messages.fr.js | 2 ++ customize.dist/translations/messages.js | 2 ++ www/common/common-interface.js | 2 ++ www/common/outer/chainpad-netflux-worker.js | 1 - www/common/sframe-common.js | 8 +++++--- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index e053d8fab..b3cfa7301 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -39,6 +39,8 @@ define(function () { 'Appuyez sur Échap pour voir le pad ou rechargez la page pour pouvoir le modifier à nouveau.'; out.errorCopy = ' Vous pouvez toujours copier son contenu ailleurs en appuyant sur Échap.
Dés que vous aurez quitté la page, il sera impossible de le récupérer.'; out.errorRedirectToHome = 'Appuyez sur Échap pour retourner vers votre CryptDrive.'; + out.newVersionError = "Une nouvelle version de CryptPad est disponible.
" + + "Rechargez la page pour utiliser la nouvelle version, ou appuyez sur Échap pour accéder au contenu actuel en mode hors-ligne."; out.loading = "Chargement..."; out.error = "Erreur"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 7e8ee960d..22d03a928 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -40,6 +40,8 @@ define(function () { 'Hit Esc to continue to view this pad, or reload to try editing again.'; out.errorCopy = ' You can still copy the content to another location by pressing Esc.
Once you leave this page, it will disappear forever!'; out.errorRedirectToHome = 'Press Esc to be redirected to your CryptDrive.'; + out.newVersionError = "A new version of CryptPad is available.
" + + "Reload to use the new version, or press escape to access your content in read-only mode."; out.loading = "Loading..."; out.error = "Error"; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 86608e1b3..7b05d22fe 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -626,6 +626,7 @@ define([ h('p.cp-loading-progress-drive'), h('p.cp-loading-progress-pad') ]); + $(progress).hide(); $loading.find('.cp-loading-container').append(progress); } else if (config.noProgress) { $loading.find('.cp-loading-progress').remove(); @@ -647,6 +648,7 @@ define([ UI.updateLoadingProgress = function (data, isDrive) { var $loading = $('#' + LOADING); if (!$loading.length || loading.error) { return; } + $loading.find('.cp-loading-progress').show(); var $progress; if (isDrive) { // Drive state diff --git a/www/common/outer/chainpad-netflux-worker.js b/www/common/outer/chainpad-netflux-worker.js index be0030ceb..631d9c433 100644 --- a/www/common/outer/chainpad-netflux-worker.js +++ b/www/common/outer/chainpad-netflux-worker.js @@ -237,7 +237,6 @@ define([], function () { }; network.on('disconnect', function (reason) { - console.log('disconnect'); //if (isIntentionallyLeaving) { return; } if (reason === "network.disconnect() called") { return; } onDisconnect(); diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index 6687baee0..6039ead70 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -439,9 +439,11 @@ define([ }); ctx.sframeChan.on('EV_NEW_VERSION', function () { - // TODO display new verison stuff - // XXX - UI.errorLoadingScreen("New version detected", true, true); + var $err = $('
').append(Messages.newVersionError); + $err.find('a').click(function () { + funcs.gotoURL(); + }); + UI.errorLoadingScreen($err, true, true); }); ctx.metadataMgr.onReady(waitFor());