From 57cda316c621c541e664e47616002168640616aa Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 26 May 2020 17:01:51 +0200 Subject: [PATCH 1/9] Translated using Weblate (French) Currently translated at 100.0% (1281 of 1281 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/fr/ --- www/common/translations/messages.fr.json | 26 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index 8c8e58d64..e1c72098c 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -839,19 +839,19 @@ "title": "Pour bien démarrer", "generic": { "more": "Apprenez-en davantage sur le fonctionnement de CryptPad en lisant notre FAQ", - "share": "Utilisez le menu partage () pour générer un lien d'accès ou d'édition pad", + "share": "Partagez ce document avec le bouton Partager et gérez les droits d'accès avec le bouton Accès.", "save": "Tous les changements effectués sont enregistrés automatiquement" }, "text": { - "formatting": "Vous pouvez afficher ou cacher la barre d'outils de texte en cliquant sur les boutons ou ", - "embed": "Les utilisateurs enregistrés peuvent intégrer un fichier de leur CryptDrive en utilisant le bouton ", + "formatting": "Affichez ou cachez la barre d'outils texte avec le bouton Outils.", + "embed": "Insérez une image de votre CryptDrive ou de votre ordinateur avec le bouton Insérer (utilisateurs connectés à leur compte).", "history": "Vous pouvez utiliser l'historique pour voir ou restaurer les versions précédentes du pad" }, "pad": { "export": "Vous pouvez exporter le contenu en tant que PDF avec le bouton de la barre d'outils de mise en forme du texte" }, "code": { - "modes": "Utilisez le sous-menu pour changer le mode de coloration syntaxique ou le thème de couleur" + "modes": "Changez le thème de couleur et la coloration syntaxique avec le menu Thème." }, "beta": { "warning": "Cet éditeur est encore expérimental, vous pouvez signaler tout problème rencontré sur GitHub" @@ -862,7 +862,7 @@ "slide": { "markdown": "Rédigez vos slides en Markdown et séparez les avec une ligne contenant ---", "present": "Démarrez la présentation en utilisant le bouton ", - "settings": "Modifiez les préférences de la présentation (image de fond, transitions, numéro de pages, ...) avec le bouton dans le sous-menu ", + "settings": "Changez les couleurs de la présentation et autres Options (image de fond, transitions, numéro de pages, etc.) avec le menu Thème.", "colors": "Modifiez la couleur du texte ou du fond en utilisant les boutons et " }, "poll": { @@ -873,8 +873,8 @@ }, "whiteboard": { "colors": "Double-cliquez sur les couleurs pour changer la palette", - "mode": "Vous pouvez désactiver le mode dessin pour déplacer, redimensionner, ou supprimer des éléments du dessin", - "embed": "Intégrez des images de votre disque ou de votre CryptDrive et exporter le contenu en tant que PNG sur votre disque ou votre CryptDrive " + "mode": "Le mode Sélection permet de déplacer et transformer des éléments du dessin.", + "embed": "Insérez des images de votre CryptDrive ou ordinateur avec Insérer. Exportez le dessin vers votre CryptDrive avec Fichier > Sauvegarder image ou vers votre ordinateur avec Fichier > Exporter." }, "kanban": { "add": "Ajoutez des cartes et tableaux en cliquant sur les boutons ", @@ -1367,5 +1367,15 @@ "unknownPad": "Pad inconnu", "comments_notification": "Réponses à votre commentaire \"{0}\" sur {1}", "comments_error": "Impossible d'ajouter un commentaire ici", - "fm_sort": "Trier" + "fm_sort": "Trier", + "slide_textCol": "Couleur de texte", + "slide_backCol": "Couleur de fond", + "toolbar_file": "Fichier", + "code_editorTheme": "Thème de l'éditeur", + "drive_treeButton": "Fichiers", + "toolbar_tools": "Outils", + "toolbar_savetodrive": "Sauvegarder image", + "toolbar_insert": "Insérer", + "toolbar_theme": "Thème", + "todo_move": "Votre liste de tâches est désormais dans le kanban {0} dans votre Drive." } From 1f636f3c4a4f60c4678e9b69c03340c811a009a6 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 26 May 2020 17:01:51 +0200 Subject: [PATCH 2/9] Translated using Weblate (English) Currently translated at 100.0% (1281 of 1281 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1281 of 1281 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1280 of 1280 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1279 of 1279 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1278 of 1278 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1277 of 1277 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1276 of 1276 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1275 of 1275 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1274 of 1274 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1273 of 1273 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1272 of 1272 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1271 of 1271 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1271 of 1271 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ --- www/common/translations/messages.json | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index 5d1c28484..637b05bef 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -857,19 +857,19 @@ "title": "Getting started", "generic": { "more": "Learn more about how CryptPad can work for you by reading our FAQ", - "share": "Use the share menu () to generate a link so collaborators can view or edit this pad", + "share": "Share this document with the Share button, and manage access rights with Access.", "save": "All your changes are synced automatically so you never need to save" }, "text": { - "formatting": "You can display or hide the text formatting toolbar by clicking the or buttons", - "embed": "Registered users can embed an image or a file stored in their CryptDrive using ", + "formatting": "Show/hide the text toolbar with the Tools button.", + "embed": "Insert an image from your CryptDrive or computer with the Insert button (logged in users).", "history": "You can use history to view or restore previous versions" }, "pad": { "export": "You can export the content as PDF using the button in the text formatting toolbar" }, "code": { - "modes": "Use the dropdown menus in the submenu to change syntax highlighting modes or color themes" + "modes": "Use the Theme menu to choose an editor theme and syntax highlighting." }, "beta": { "warning": "This editor is still experimental, you can report bugs on our issue tracker" @@ -880,7 +880,7 @@ "slide": { "markdown": "Write slides in Markdown and separate them with a line containing ---", "present": "Start the presentation using the button", - "settings": "Change the slide settings (background, transitions, page numbers, etc.) with the button in the submenu", + "settings": "Use the Theme menu to change slide colors and Options (background, transitions, page numbers, etc.).", "colors": "Change the text and background colors using the and buttons" }, "poll": { @@ -891,8 +891,8 @@ }, "whiteboard": { "colors": "Double-click colors to modify your palette", - "mode": "Disable draw mode to drag and stretch strokes", - "embed": "Embed images from your disk or your CryptDrive and export them as PNG to your disk or your CryptDrive " + "mode": "Switch to Select mode to move and transform strokes.", + "embed": "Embed images from your CryptDrive or computer with Insert. Export the canvas as PNG to your CryptDrive with File > Save as image or to your computer with File > Export." }, "kanban": { "add": "Add new cards and boards by clicking the buttons", @@ -1367,5 +1367,15 @@ "settings_padNotifHint": "Ignore notifications when someone replies to one of your comments", "settings_padNotifCheckbox": "Disable comment notifications", "comments_error": "Can't add a comment here", - "fm_sort": "Sort" + "fm_sort": "Sort", + "todo_move": "Your todo list is now in the kanban {0} in your Drive.", + "toolbar_theme": "Theme", + "toolbar_insert": "Insert", + "toolbar_savetodrive": "Save as image", + "toolbar_tools": "Tools", + "drive_treeButton": "Files", + "code_editorTheme": "Editor theme", + "toolbar_file": "File", + "slide_backCol": "Background color", + "slide_textCol": "Text color" } From 2925316058ea4da45a7bc8865809a2c5a3cd0aba Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 26 May 2020 11:52:02 -0400 Subject: [PATCH 3/9] remove hardcoded translations --- www/code/inner.js | 3 +-- www/common/common-ui-elements.js | 13 +++++-------- www/common/drive-ui.js | 1 - www/common/migrate-user-object.js | 2 +- www/common/notifications.js | 1 - www/common/sframe-common-codemirror.js | 1 - www/common/toolbar.js | 1 - www/slide/inner.js | 3 --- www/whiteboard/inner.js | 1 - 9 files changed, 7 insertions(+), 19 deletions(-) diff --git a/www/code/inner.js b/www/code/inner.js index 56b83b49b..00b6ee50a 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -78,7 +78,6 @@ define([ ]); var mkThemeButton = function (framework) { - Messages.toolbar_theme = "Theme"; // XXX (duplicate from slide/inner.js) var $theme = $(h('button.cp-toolbar-appmenu', [ h('i.cptools.cptools-palette'), h('span.cp-button-name', Messages.toolbar_theme) @@ -121,7 +120,7 @@ define([ name: 'authormarks', icon: 'fa-paint-brush', }).hide(); - framework._.toolbar.$theme.append($showAuthorColorsButton); // XXX + framework._.toolbar.$theme.append($showAuthorColorsButton); markers.setButton($showAuthorColorsButton); }; var mkPrintButton = function (framework, $content, $print) { diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 200f4f458..5d9f38077 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1510,7 +1510,7 @@ define([ break; case 'present': button = $(h('button', { - title: Messages.presentButtonTitle, // XXX remove tippy? + //title: Messages.presentButtonTitle, // TODO display if the label text is collapsed }, [ h('i.fa.fa-play-circle'), h('span.cp-toolbar-name', Messages.share_linkPresent) @@ -1518,7 +1518,7 @@ define([ break; case 'preview': button = $(h('button', { - title: Messages.previewButtonTitle, // XXX remove tippy? + //title: Messages.previewButtonTitle, // TODO display if the label text is collapsed }, [ h('i.fa.fa-eye'), h('span.cp-toolbar-name', Messages.share_linkOpen) @@ -1555,16 +1555,14 @@ define([ } break; case 'mediatag': - Messages.toolbar_insert = "Insert"; // XXX button = $(h('button.cp-toolbar-mediatag', { - title: Messages.filePickerButton, // XXX remove tippy? + //title: Messages.filePickerButton, // TODO display if the label text is collapsed }, [ h('i.fa.fa-picture-o'), h('span.cp-toolbar-name', Messages.toolbar_insert) ])).click(common.prepareFeedback(type)); break; case 'savetodrive': - Messages.toolbar_savetodrive = "Save as image"; // XXX button = $(h('button.cp-toolbar-savetodrive', { title: Messages.canvas_saveToDrive, }, [ @@ -1588,9 +1586,8 @@ define([ }); break; case 'toggle': - Messages.toolbar_tools = "Tools"; // XXX button = $(h('button.cp-toolbar-tools', { - title: data.title || '', // XXX remove tippy? + //title: data.title || '', // TODO display if the label text is collapsed }, [ h('i.fa.fa-wrench'), h('span.cp-toolbar-name', Messages.toolbar_tools) @@ -1661,7 +1658,7 @@ define([ var drawerCls = data.drawer === false ? '' : '.cp-toolbar-drawer-element'; var icon = data.icon || "fa-question"; button = $(h('button', { - title: data.title || '', // XXX remove tippy? + //title: data.title || '', }, [ h('i.fa.' + icon), h('span.cp-toolbar-name'+drawerCls, data.text) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 0b5a5c009..e637d7410 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -3004,7 +3004,6 @@ define([ } }; var collapseTreeButton = function () { - Messages.drive_treeButton = "Files"; // XXX APP.$collapseButton = APP.$collapseButton || common.createButton('', true, { text: Messages.drive_treeButton, name: 'files', diff --git a/www/common/migrate-user-object.js b/www/common/migrate-user-object.js index 15b790531..18bc9c61b 100644 --- a/www/common/migrate-user-object.js +++ b/www/common/migrate-user-object.js @@ -329,7 +329,7 @@ define([ if (!h) { return; } var next = waitFor(function () { Feedback.send('Migrate-10', true); - userObject.version = version = 10; // XXX + userObject.version = version = 10; }); var old; var opts = { diff --git a/www/common/notifications.js b/www/common/notifications.js index 127c0621a..3abc40ca8 100644 --- a/www/common/notifications.js +++ b/www/common/notifications.js @@ -365,7 +365,6 @@ define([ } }; - Messages.todo_move = "Your todo list has been moved to the pad {0}, as the Todo app is now deprecated."; // XXX handlers['MOVE_TODO'] = function(common, data) { var content = data.content; var msg = content.msg; diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 9efd30bce..13655a333 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -359,7 +359,6 @@ define([ content: l.name // Pretty name of the language value }); }); - Messages.code_editorTheme = "Editor theme"; // XXX var dropdownConfig = { text: Messages.code_editorTheme, // Button initial text options: options, // Entries displayed in the menu diff --git a/www/common/toolbar.js b/www/common/toolbar.js index dcdb8b03a..a151e95f6 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -90,7 +90,6 @@ MessengerUI, Messages) { var $file = $toolbar.find('.'+BOTTOM_LEFT_CLS); - Messages.toolbar_file = "File"; // XXX if (!config.hideDrawer) { // XXX a lot of this logic is duplicated (code, slide, here) var $drawer = $(h('button.' + FILE_CLS, [ diff --git a/www/slide/inner.js b/www/slide/inner.js index d0c87e940..f09fd3628 100644 --- a/www/slide/inner.js +++ b/www/slide/inner.js @@ -102,7 +102,6 @@ define([ // XXX this function is a duplicate of /code/ var mkThemeButton = function (framework) { - Messages.toolbar_theme = "Theme"; // XXX var $theme = $(h('button.cp-toolbar-appmenu', [ h('i.cptools.cptools-palette'), h('span.cp-button-name', Messages.toolbar_theme) @@ -378,7 +377,6 @@ define([ framework.localChange(); }; - Messages.slide_backCol = "Background color"; // XXX var $back = framework._.sfCommon.createButton(null, true, { icon: 'fa-square', text: Messages.slide_backCol, @@ -387,7 +385,6 @@ define([ name: 'background', id: SLIDE_BACKCOLOR_ID }); - Messages.slide_textCol = "Text color"; // XXX var $text = framework._.sfCommon.createButton(null, true, { icon: 'fa-i-cursor', text: Messages.slide_textCol, diff --git a/www/whiteboard/inner.js b/www/whiteboard/inner.js index c0d0e2fe7..18fad97f6 100644 --- a/www/whiteboard/inner.js +++ b/www/whiteboard/inner.js @@ -394,7 +394,6 @@ define([ }); }).appendTo($drawer); } else { - Messages.toolbar_insert = "Insert"; // XXX duplicate key from common-ui-elements framework._.sfCommon.createButton('', true, { title: Messages.canvas_imageEmbed, text: Messages.toolbar_insert, From 2a3b1a6ddcd12d26729570f017a7c627cb50769b Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 26 May 2020 18:34:20 +0200 Subject: [PATCH 4/9] Translated using Weblate (German) Currently translated at 100.0% (1281 of 1281 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/de/ --- www/common/translations/messages.de.json | 26 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json index 4c682b94b..8b0638aac 100644 --- a/www/common/translations/messages.de.json +++ b/www/common/translations/messages.de.json @@ -832,19 +832,19 @@ "title": "Mit CryptPad anfangen", "generic": { "more": "Erfahre mehr über die Nutzung von CryptPad, indem du unsere FAQ liest", - "share": "Benutze das Teilen-Menü (), um Links zu generieren, die Mitarbeiter zum Lesen oder Bearbeiten einladen", + "share": "Teile dieses Dokument mit der Schaltfläche Teilen und verwalte die Zugriffsrechte mit Zugriff.", "save": "Alle Änderungen werden automatisch synchronisiert. Du musst sie also nicht selbst speichern" }, "text": { - "formatting": "Du kannst die Werkzeugleiste anzeigen oder verbergen, indem du auf oder klickst", - "embed": "Registrierte Benutzer können mit Bilder oder Dateien einbetten, die in ihrem CryptDrive gespeichert sind", + "formatting": "Blende die Werkzeugleiste ein/aus mit der Schaltfläche Werkzeuge.", + "embed": "Füge mit der Schaltfläche Insert ein Bild aus deinem CryptDrive oder deinem Computer ein (eingeloggte Benutzer).", "history": "Du kannst das Menü Verlauf benutzen, um frühere Versionen anzusehen oder wiederherzustellen" }, "pad": { "export": "Du kannst Pads als PDF exportieren, indem du auf die Schaltfläche in der Werkzeugleiste klickst" }, "code": { - "modes": "Benutze das Dropdown-Menü im Untermenü , um die Syntaxhervorhebung oder das Farbschema zu ändern" + "modes": "Benutze Menü Theme, um Editor-Theme und Syntaxhervorhebung auszuwählen." }, "beta": { "warning": "Dieser Editor ist noch experimentell, du kannst Fehler hier melden" @@ -855,7 +855,7 @@ "slide": { "markdown": "Schreibe Folien in Markdown and trenne sie mit --- in einer Zeile", "present": "Starte die Präsentation mit der Schaltfläche ", - "settings": "Ändere die Einstellungen der Präsentation (Hintergrund, Übergang, Anzeige der Foliennummer etc.) über die Schaltfläche im Untermenü ", + "settings": "Benutze das Menü Theme, um Folienfarben und Einstellungen (Hintergrund, Übergänge, Anzeige der Foliennummer etc.) zu ändern.", "colors": "Ändere Text- und Hintergrundfarbe mit den Schaltflächen und " }, "poll": { @@ -866,8 +866,8 @@ }, "whiteboard": { "colors": "Ein Doppelklick auf Farben erlaubt, die Palette zu verändern", - "mode": "Deaktiviere den Zeichenmodus, um die vorhandenen Striche zu verschieben und zu verlängern", - "embed": "Bette Bilder von deiner Festplatte oder von deinem CryptDrive ein und exportiere sie als PNG zu deiner Festplatte oder zu deinem CryptDrive " + "mode": "Wechsle zum Auswahlmodus, um Elemente zu verschieben und zu verändern.", + "embed": "Bette Bilder von deinem CryptDrive oder deinem Computer ein mit Einfügen. Exportiere die Zeichnung als PNG in dein CryptDrive mit Datei > Als Bild speichern oder zu deinem Computer mit Datei > Exportieren." }, "kanban": { "add": "Füge neue Karten und Boards mit der Schaltfläche hinzu", @@ -1367,5 +1367,15 @@ "comments_edited": "Bearbeitet", "unknownPad": "Unbekanntes Pad", "comments_error": "An dieser Stelle kann kein Kommentar hinzugefügt werden", - "fm_sort": "Sortieren" + "fm_sort": "Sortieren", + "code_editorTheme": "Editor-Theme", + "toolbar_theme": "Theme", + "toolbar_tools": "Werkzeuge", + "todo_move": "Deine To-do-Liste ist nun im Kanban-Dokument {0} in deinem Drive.", + "drive_treeButton": "Dateien", + "toolbar_file": "Datei", + "toolbar_insert": "Einfügen", + "toolbar_savetodrive": "Als Bild speichern", + "slide_backCol": "Hintergrundfarbe", + "slide_textCol": "Textfarbe" } From 6f882e0ddd6932df5d4492297fdd7b682372f94e Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 26 May 2020 12:51:37 -0400 Subject: [PATCH 5/9] refactor repeated 'drawer' pattern --- www/code/inner.js | 27 +++------------------------ www/common/common-interface.js | 33 +++++++++++++++++++++++++++++++++ www/common/toolbar.js | 27 ++------------------------- www/slide/inner.js | 28 ++++------------------------ 4 files changed, 42 insertions(+), 73 deletions(-) diff --git a/www/code/inner.js b/www/code/inner.js index 00b6ee50a..de91714c4 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -85,31 +85,10 @@ define([ var $content = $(h('div.cp-toolbar-drawer-content', { tabindex: 1 })).hide(); - $theme.click(function () { - $content.toggle(); - $theme.removeClass('cp-toolbar-button-active'); - if ($content.is(':visible')) { - $theme.addClass('cp-toolbar-button-active'); - $content.focus(); - var wh = $(window).height(); - var topPos = $theme[0].getBoundingClientRect().bottom; - $content.css('max-height', Math.floor(wh - topPos - 1)+'px'); - } - }); - var onBlur = function (e) { - if (e.relatedTarget) { - var $relatedTarget = $(e.relatedTarget); - if ($relatedTarget.is('.cp-toolbar-drawer-button')) { return; } - if ($relatedTarget.parents('.cp-toolbar-drawer-content').length) { - $relatedTarget.blur(onBlur); - return; - } - } - $theme.removeClass('cp-toolbar-button-active'); - $content.hide(); - }; - $content.blur(onBlur).appendTo($theme); + // set up all the necessary events + UI.createDrawer($theme, $content); + framework._.toolbar.$theme = $content; framework._.toolbar.$bottomL.append($theme); }; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 55fe42e2a..ddaca34be 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -1364,5 +1364,38 @@ define([ }; }; + /* Given two jquery objects (a 'button' and a 'drawer') + add handlers to make it such that clicking the button + displays the drawer contents, and blurring the button + hides the drawer content. Used for toolbar buttons at the moment. + */ + UI.createDrawer = function ($button, $content) { + $button.click(function () { + $content.toggle(); + $button.removeClass('cp-toolbar-button-active'); + if ($content.is(':visible')) { + $button.addClass('cp-toolbar-button-active'); + $content.focus(); + var wh = $(window).height(); + var topPos = $button[0].getBoundingClientRect().bottom; + $content.css('max-height', Math.floor(wh - topPos - 1)+'px'); + } + }); + var onBlur = function (e) { + if (e.relatedTarget) { + var $relatedTarget = $(e.relatedTarget); + + if ($relatedTarget.is('.cp-toolbar-drawer-button')) { return; } + if ($relatedTarget.parents('.cp-toolbar-drawer-content').length) { + $relatedTarget.blur(onBlur); + return; + } + } + $button.removeClass('cp-toolbar-button-active'); + $content.hide(); + }; + $content.blur(onBlur).appendTo($button); + }; + return UI; }); diff --git a/www/common/toolbar.js b/www/common/toolbar.js index a151e95f6..a4683a884 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -91,7 +91,6 @@ MessengerUI, Messages) { var $file = $toolbar.find('.'+BOTTOM_LEFT_CLS); if (!config.hideDrawer) { - // XXX a lot of this logic is duplicated (code, slide, here) var $drawer = $(h('button.' + FILE_CLS, [ h('i.fa.fa-file-o'), h('span.cp-button-name', Messages.toolbar_file) @@ -99,30 +98,8 @@ MessengerUI, Messages) { var $drawerContent = $('
', { 'class': DRAWER_CLS, 'tabindex': 1 - }).appendTo($drawer).hide(); - $drawer.click(function () { - $drawerContent.toggle(); - $drawer.removeClass('cp-toolbar-button-active'); - if ($drawerContent.is(':visible')) { - $drawer.addClass('cp-toolbar-button-active'); - $drawerContent.focus(); - var wh = $(window).height(); - var topPos = $drawer[0].getBoundingClientRect().bottom; - $drawerContent.css('max-height', Math.floor(wh - topPos - 1)+'px'); - } - }); - var onBlur = function (e) { - if (e.relatedTarget) { - if ($(e.relatedTarget).is('.cp-toolbar-drawer-button')) { return; } - if ($(e.relatedTarget).parents('.'+DRAWER_CLS).length) { - $(e.relatedTarget).blur(onBlur); - return; - } - } - $drawer.removeClass('cp-toolbar-button-active'); - $drawerContent.hide(); - }; - $drawerContent.blur(onBlur); + }).hide(); + UI.createDrawer($drawer, $drawerContent); } // The 'notitle' class removes the line added for the title with a small screen diff --git a/www/slide/inner.js b/www/slide/inner.js index f09fd3628..ad4308af2 100644 --- a/www/slide/inner.js +++ b/www/slide/inner.js @@ -100,7 +100,6 @@ define([ }); }; - // XXX this function is a duplicate of /code/ var mkThemeButton = function (framework) { var $theme = $(h('button.cp-toolbar-appmenu', [ h('i.cptools.cptools-palette'), @@ -109,29 +108,10 @@ define([ var $content = $(h('div.cp-toolbar-drawer-content', { tabindex: 1 })).hide(); - $theme.click(function () { - $content.toggle(); - $theme.removeClass('cp-toolbar-button-active'); - if ($content.is(':visible')) { - $theme.addClass('cp-toolbar-button-active'); - $content.focus(); - var wh = $(window).height(); - var topPos = $theme[0].getBoundingClientRect().bottom; - $content.css('max-height', Math.floor(wh - topPos - 1)+'px'); - } - }); - var onBlur = function (e) { - if (e.relatedTarget) { - if ($(e.relatedTarget).is('.cp-toolbar-drawer-button')) { return; } - if ($(e.relatedTarget).parents('.cp-toolbar-drawer-content').length) { - $(e.relatedTarget).blur(onBlur); - return; - } - } - $theme.removeClass('cp-toolbar-button-active'); - $content.hide(); - }; - $content.blur(onBlur).appendTo($theme); + + // set up all the necessary events + UI.createDrawer($theme, $content); + framework._.toolbar.$theme = $content; framework._.toolbar.$bottomL.append($theme); }; From e998e773822cdc644fe7f94254a16a2847294663 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 26 May 2020 16:04:38 -0400 Subject: [PATCH 6/9] update changelog for 3.18.0 --- CHANGELOG.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edf75ffb5..3f3b4274c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,42 @@ +# Smilodon release (3.18.0) + +## Goals + +This is a big one! A lot of people are going to love it and a few are probably going to hate it. + +This release introduces some major changes to our apps' appearances with the intent of making it easier to use, easier for us to support, and easier to maintain. + +## Update notes + +If you're using a mostly standard CryptPad installation this should be a rather easy update. + +If you've customized your styles, particularly for the purpose of overriding the default colors, you may encounter some problems. **We recommend that you test this version in a staging environment** before deploying to ensure that it is compatible with your modifications. + +Otherwise, update to 3.18.0 from 3.17.0 in the following manner: + +1. stop your server +2. fetch the latest code with git +3. bower update +4. relaunch your server + +## Features + +* Obviously, there's the major redesign mentioned in our _goals_. + * You'll immediately notice that we've changed a lot of our color scheme. Apps still have colors as accents to help differentiate them, but the colors are more subtle. The move towards a more monochrome design makes it easier for us to ensure that the UI has a sufficient amount of contrast (less eye strain for everybody!) and simplifies design issues by settling on a simpler color palette. + * You'll probably also notice that a lot of the toolbar features have been rearranged. The chat and userlist are now at the right, while we've adopted the "File menu" layout to which users of office productivity are accustomed. A lot of the common features that were buried in our `...` menu are now under "File" ("new", "import/export", "history", "move to trash", etc.). Some apps feature their special menus ("Insert", "Tools", "Theme") depending on whether they support certain features. In general we'll use text in addition to icons in the toolbar except on very small screens where the use of space is constrained. + * Finally, you'll find some of CryptPad's most important functionality right in the center of the toolbar. The "Share" and "Access" buttons already existed, but lots of people had trouble finding them and missed out on our fine-grained access controls by always sharing the URL directly from their browser's address bar. In case you hadn't seen it, the "Share menu" gives you the ability to generate links that let others view, edit, or delete the document in question. The "Access menu" provides an overview of the document's access settings, and lets its owner(s) add passwords, enable or disable other viewers' ability to request edit rights, restrict access to a dynamic list of users or teams, and modify ownership of the document. It will soon be even more important to know about these menus, because **we plan to enable "Safe links" as the default behaviour in our next release**. "Safe links" are URLs that contain only a document's id instead of its cryptographic secrets, making it less likely that you'll accidentally leak the ability to read your documents during screenshots or when copy-pasting URLs. +* The toolbar redesign has also affected the drive interface, but it's special enough that it deserves a separate mention: + * You can now collapse the sidebar which contains the search button, recent pads, filesystem tree, templates, trash, and account storage quota meter. This should make navigation of the drive on mobile devices much simpler. + * The actual "search" interface is no longer inside the sidebar. Instead, clicking search will bring you to an interface which uses the full size available to display the search bar and its results. +* By the time the toolbar was mostly redesigned we realized that our mockups hadn't included a link to the "todo" app. In fact, we'd been meaning to deprecate it in favour of Kanbans for some time, but we hadn't gotten around to it. So, now there's a migration that will be run automatically when you access your account for the first time after this release. Your todo-list will be transformed into a Kanban located in the root of your drive. +* On that note, this release also makes it much easier to drag and drop kanban cards within and between full columns thanks to an improved scrolling behaviour while you are holding a card. + +## Bug fixes + +* While implementing the todo-list migration we noticed that user accounts were running migrations without updating their version afterward. This resulted in redundant migrations being run at login time, so now that the version has been updated you might notice that login is marginally faster. +* We also fixed a regression in the "Print" functionality of the rich text editor, so you should be able to print correctly-formatted rich text documents once more. +* Lastly, there were some rather annoying issues with spreadsheets throughout this release that resulted in some users not being able to load their sheets or in their sheets being rendered or encoded incorrectly. We spent a lot of time solving these issues, and believe spreadsheets to be stable once more. + # RedGazelle's revenge release (3.17.1) In recent months a growing amount of our time has been going towards answering support tickets, emails, and GitHub issues. This has made it a little more difficult to also maintain a bi-weekly release schedule, since there's some overhead involved in deploying our latest code and producing release notes. @@ -10,7 +49,7 @@ Updating to 3.17.1 from 3.17.0 is pretty standard: 1. Stop your server 2. Get the latest code with git -3. Restart your server +3. Restart your server # RedGazelle release (3.17.0) From c34ea105f05f30a43cd353471c28457347f4cd12 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 26 May 2020 16:22:45 -0400 Subject: [PATCH 7/9] hide drawers on ESC keypresses --- www/common/common-interface.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index ddaca34be..79951c3c5 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -1395,6 +1395,11 @@ define([ $content.hide(); }; $content.blur(onBlur).appendTo($button); + $('body').keydown(function (e) { + if (e.which === 27) { + $content.blur(); + } + }); }; return UI; From 446a429d6b6d306d10b652e53a85622cda291096 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 27 May 2020 13:21:59 +0200 Subject: [PATCH 8/9] Fix share modal in anon drive --- www/common/drive-ui.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 0b5a5c009..db641c3e2 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -4215,8 +4215,9 @@ define([ el = manager.find(paths[0].path); var parsed, modal; var friends = common.getFriends(); + var anonDrive = manager.isPathIn(currentPath, [FILES_DATA]) && !APP.loggedIn; - if (manager.isFolder(el) && !manager.isSharedFolder(el)) { // Folder + if (manager.isFolder(el) && !manager.isSharedFolder(el) && !anonDrive) { // Folder // if folder is inside SF if (manager.isInSharedFolder(paths[0].path)) { return void UI.alert(Messages.convertFolderToSF_SFParent); @@ -4254,8 +4255,12 @@ define([ }); } } else { // File or shared folder - var sf = manager.isSharedFolder(el); - data = sf ? manager.getSharedFolderData(el) : manager.getFileData(el); + var sf = !anonDrive && manager.isSharedFolder(el); + if (anonDrive) { + data = el; + } else { + data = sf ? manager.getSharedFolderData(el) : manager.getFileData(el); + } parsed = (data.href && data.href.indexOf('#') !== -1) ? Hash.parsePadUrl(data.href) : {}; var roParsed = Hash.parsePadUrl(data.roHref); var padType = parsed.type || roParsed.type; From 4cf775e613e892dac11cf8a107b29750b8f7da09 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 27 May 2020 16:32:28 +0200 Subject: [PATCH 9/9] Sort button in the drive --- customize.dist/src/less2/include/drive.less | 9 ++++++--- www/common/common-ui-elements.js | 5 +++++ www/common/sframe-common-codemirror.js | 19 ++----------------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/customize.dist/src/less2/include/drive.less b/customize.dist/src/less2/include/drive.less index 7c428a3de..bf17b1e76 100644 --- a/customize.dist/src/less2/include/drive.less +++ b/customize.dist/src/less2/include/drive.less @@ -716,6 +716,9 @@ } } } + .cp-app-drive-element-state { + display: none !important; + } } } .cp-app-drive-element { @@ -729,6 +732,9 @@ .cp-app-drive-element-type, .cp-app-drive-element-filler { display: none !important; } + .cp-app-drive-element-sort { + display: block !important; + } } @media screen and (max-width: 740px) { @@ -744,9 +750,6 @@ .cp-app-drive-element-header .cp-app-drive-element-state { display: none !important; } - .cp-app-drive-element-sort { - display: block !important; - } } } diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 5d9f38077..868de93f4 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2157,6 +2157,11 @@ define([ e.stopPropagation(); var state = $innerblock.is(':visible'); $('.cp-dropdown-content').hide(); + + var $c = $container.closest('.cp-toolbar-drawer-content'); + $c.removeClass('cp-dropdown-visible'); + if (!state) { $c.addClass('cp-dropdown-visible'); } + try { $('iframe').each(function (idx, ifrw) { $(ifrw).contents().find('.cp-dropdown-content').hide(); diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 13655a333..42c5b6d9e 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -311,14 +311,7 @@ define([ common: Common }; var $block = exp.$language = UIElements.createDropdown(dropdownConfig); - $block.find('button').attr('title', Messages.languageButtonTitle).click(function () { - var state = $block.find('.cp-dropdown-content').is(':visible'); - var $c = $block.closest('.cp-toolbar-drawer-content'); - $c.removeClass('cp-dropdown-visible'); - if (!state) { - $c.addClass('cp-dropdown-visible'); - } - }); + $block.find('button').attr('title', Messages.languageButtonTitle); var isHovering = false; var $aLanguages = $block.find('a'); @@ -368,15 +361,7 @@ define([ common: Common }; var $block = exp.$theme = UIElements.createDropdown(dropdownConfig); - $block.find('button').attr('title', Messages.themeButtonTitle).click(function () { - // XXX copy-pasted code from configureLanguage. We can refactor this. - var state = $block.find('.cp-dropdown-content').is(':visible'); - var $c = $block.closest('.cp-toolbar-drawer-content'); - $c.removeClass('cp-dropdown-visible'); - if (!state) { - $c.addClass('cp-dropdown-visible'); - } - }); + $block.find('button').attr('title', Messages.themeButtonTitle); setTheme(lastTheme, $block);