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) diff --git a/www/code/inner.js b/www/code/inner.js index 56b83b49b..de91714c4 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) @@ -86,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); }; @@ -121,7 +99,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-interface.js b/www/common/common-interface.js index 55fe42e2a..79951c3c5 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -1364,5 +1364,43 @@ 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); + $('body').keydown(function (e) { + if (e.which === 27) { + $content.blur(); + } + }); + }; + return UI; }); 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 db641c3e2..991fe5cc4 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..a4683a884 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -90,9 +90,7 @@ 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, [ h('i.fa.fa-file-o'), h('span.cp-button-name', Messages.toolbar_file) @@ -100,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/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" } 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." } 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" } diff --git a/www/slide/inner.js b/www/slide/inner.js index d0c87e940..ad4308af2 100644 --- a/www/slide/inner.js +++ b/www/slide/inner.js @@ -100,9 +100,7 @@ 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) @@ -110,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); }; @@ -378,7 +357,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 +365,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,