From 83705ae058df28ddb07c661bed46c94bc2ee901c Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 20 Sep 2016 18:22:40 +0200 Subject: [PATCH] Improve the UI in read-only mode --- customize.dist/translations/messages.fr.js | 7 ++--- customize.dist/translations/messages.js | 7 ++--- www/code/main.js | 34 ++++++++++++---------- www/common/cryptpad-common.js | 7 +++-- www/pad/main.js | 34 ++++++++++++---------- 5 files changed, 47 insertions(+), 42 deletions(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 9fd72124a..d289fbfc3 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -65,10 +65,9 @@ define(function () { out.commitButton = 'VALIDER'; - out.linksButton = 'LIENS'; - out.linksButtonTitle = 'Obtenir les liens disponibles pour accéder à ce document'; - out.readonlyUrl = 'Lien de lecture seule'; - out.editUrl = "Lien d'édition"; + out.getViewButton = 'LECTURE SEULE'; + out.getViewButtonTitle = "Obtenir l'adresse d'accès à ce document en lecture seule"; + out.readonlyUrl = 'URL de lecture seule'; out.disconnectAlert = 'Perte de la connexion au réseau !'; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index eda389589..06df24f26 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -64,11 +64,10 @@ define(function () { out.presentSuccess = 'Hit ESC to exit presentation mode'; out.commitButton = 'COMMIT'; - - out.linksButton = 'LINKS'; - out.linksButtonTitle = 'Get the available links for this document'; + + out.getViewButton = 'READ-ONLY URL'; + out.getViewButtonTitle = 'Get the read-only URL for this document'; out.readonlyUrl = 'Read only URL'; - out.editUrl = 'Edit URL'; out.disconnectAlert = 'Network connection lost!'; diff --git a/www/code/main.js b/www/code/main.js index 491de8e43..e8e7958a6 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -39,7 +39,10 @@ define([ toolbar; var secret = Cryptpad.getSecrets(); - var readOnly = !secret.keys.editKeyStr; + var readOnly = secret.keys && !secret.keys.editKeyStr; + if (!secret.keys) { + secret.keys = secret.key; + } var andThen = function (CMeditor) { var CodeMirror = module.CodeMirror = CMeditor; @@ -398,21 +401,20 @@ define([ }); $rightside.append($forgetPad); - /* add a 'links' button */ - var $links = $('