From ca95b5c42b174be1e3c8b4c5fa67cca50050674b Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 9 Jun 2017 12:31:07 +0200 Subject: [PATCH 1/5] Remove unused console.log --- www/common/common-title.js | 1 - 1 file changed, 1 deletion(-) diff --git a/www/common/common-title.js b/www/common/common-title.js index f5485d86d..226dc1b34 100644 --- a/www/common/common-title.js +++ b/www/common/common-title.js @@ -40,7 +40,6 @@ define(function () { var renameCb = function (err, newTitle) { if (err) { return; } updateLocalTitle(newTitle); - console.log('here'); onLocal(); }; From 6a96aa6819b4589676a43a86772870191e9d3199 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 9 Jun 2017 14:36:35 +0200 Subject: [PATCH 2/5] Disconnect the network when migrating the drive in another tab --- customize.dist/translations/messages.fr.js | 2 ++ customize.dist/translations/messages.js | 2 ++ www/common/fsStore.js | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 3d8ad6060..9b1f9ad3a 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -248,6 +248,8 @@ define(function () { out.fo_unableToRestore = "Impossible de restaurer ce fichier à son emplacement d'origine. Vous pouvez essayer de le déplacer à un nouvel emplacement."; out.fo_unavailableName = "Un fichier ou dossier avec le même nom existe déjà au nouvel emplacement. Renommez cet élément avant d'essayer à nouveau."; + out.fs_migration = "Votre CryptDrive est en train d'être mis à jour vers une nouvelle version. Cela implique que cette page doive être rechargée.
Veuillez recharger la page pour pouvoir continuer à l'utiliser."; + // login out.login_login = "Connexion"; out.login_makeAPad = 'Créer un pad anonymement'; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 9219ab457..a1eff8fbf 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -250,6 +250,8 @@ define(function () { out.fo_unableToRestore = "Unable to restore that file to its original location. You can try to move it to a new location."; out.fo_unavailableName = "A file or a folder with the same name already exist at the new location. Rename the element and try again."; + out.fs_migration = "Your CryptDrive is being updated to a new version. As a result, the current page has to be reloaded.
Please reload this page to continue to use it."; + // login out.login_login = "Log in"; out.login_makeAPad = 'Create a pad anonymously'; diff --git a/www/common/fsStore.js b/www/common/fsStore.js index 1be9e797f..163235bb0 100644 --- a/www/common/fsStore.js +++ b/www/common/fsStore.js @@ -288,8 +288,16 @@ define([ } return; } + }) + .on('change', ['drive', 'migrate'], function () { + var path = arguments[2]; + var value = arguments[1]; + if (path[0] === 'drive' && path[1] === "migrate" && value == 1) { + rt.network.disconnect(); + rt.realtime.abort(); + Cryptpad.alert(Cryptpad.Messages.fs_migration); + } }); - }; Store.ready = function (f, Cryptpad) { From 969427208382b34291f8eff3e06037766d165bb9 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 9 Jun 2017 14:42:55 +0200 Subject: [PATCH 3/5] Fix html code not parsed --- www/common/fsStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/fsStore.js b/www/common/fsStore.js index edfd02aad..67d87ed9c 100644 --- a/www/common/fsStore.js +++ b/www/common/fsStore.js @@ -299,7 +299,7 @@ define([ if (path[0] === 'drive' && path[1] === "migrate" && value == 1) { rt.network.disconnect(); rt.realtime.abort(); - Cryptpad.alert(Cryptpad.Messages.fs_migration); + Cryptpad.alert(Cryptpad.Messages.fs_migration, null, true); } }); }; From 9d758a040baf0a0364cadd90bf9ac945ebf75fcb Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 9 Jun 2017 15:45:46 +0200 Subject: [PATCH 4/5] Fix an issue with the search field not displayed properly --- www/drive/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/drive/main.js b/www/drive/main.js index ee241ffed..ce90cf999 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -1838,7 +1838,7 @@ define([ module.resetTree(); - if (displayedCategories.indexOf(SEARCH) !== -1) { + if (displayedCategories.indexOf(SEARCH) !== -1 && $tree.find('#searchInput').length) { // in history mode we want to focus the version number input if (!history.isHistoryMode && !APP.mobile()) { var st = $tree.scrollTop() || 0; From c1402fbb0ab1aae203b1e74bb8ac98ea6a69f5aa Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 9 Jun 2017 15:56:18 +0200 Subject: [PATCH 5/5] Lint error --- www/common/fsStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/fsStore.js b/www/common/fsStore.js index 67d87ed9c..35bd9a048 100644 --- a/www/common/fsStore.js +++ b/www/common/fsStore.js @@ -296,7 +296,7 @@ define([ .on('change', ['drive', 'migrate'], function () { var path = arguments[2]; var value = arguments[1]; - if (path[0] === 'drive' && path[1] === "migrate" && value == 1) { + if (path[0] === 'drive' && path[1] === "migrate" && value === 1) { rt.network.disconnect(); rt.realtime.abort(); Cryptpad.alert(Cryptpad.Messages.fs_migration, null, true);