From 985b1d6aa647c3944b0ad28f995c495729dc741d Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Sat, 1 Dec 2018 17:48:53 -0800 Subject: [PATCH] New staged attachments UI, multiple image attachments per message --- _locales/en/messages.json | 35 +- background.html | 14 +- images/add-caption-24.svg | 1 + images/x-16.svg | 1 + images/x-shadow-16.svg | 1 + js/modules/signal.js | 6 + js/views/attachment_preview_view.js | 16 - js/views/conversation_view.js | 67 +- js/views/file_input_view.js | 680 ++++++++++-------- libtextsecure/outgoing_message.js | 2 +- stylesheets/_modules.scss | 234 ++++++ ts/components/CaptionEditor.md | 72 ++ ts/components/CaptionEditor.tsx | 78 ++ ts/components/conversation/AttachmentList.md | 114 +++ ts/components/conversation/AttachmentList.tsx | 106 +++ ts/components/conversation/Image.md | 81 +++ ts/components/conversation/Image.tsx | 26 +- ts/components/conversation/ImageGrid.tsx | 2 +- ts/components/conversation/Message.tsx | 92 +-- .../conversation/StagedGenericAttachment.md | 44 ++ .../conversation/StagedGenericAttachment.tsx | 44 ++ ts/util/lint/exceptions.json | 372 +++++----- 22 files changed, 1495 insertions(+), 593 deletions(-) create mode 100644 images/add-caption-24.svg create mode 100644 images/x-16.svg create mode 100644 images/x-shadow-16.svg delete mode 100644 js/views/attachment_preview_view.js create mode 100644 ts/components/CaptionEditor.md create mode 100644 ts/components/CaptionEditor.tsx create mode 100644 ts/components/conversation/AttachmentList.md create mode 100644 ts/components/conversation/AttachmentList.tsx create mode 100644 ts/components/conversation/StagedGenericAttachment.md create mode 100644 ts/components/conversation/StagedGenericAttachment.tsx diff --git a/_locales/en/messages.json b/_locales/en/messages.json index bbc988fc1..edd6b109a 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -172,6 +172,10 @@ "message": "Choose folder", "description": "Button to allow the user to find a folder on disk" }, + "chooseFile": { + "message": "Choose file", + "description": "Button to allow the user to find a file on disk" + }, "loadDataHeader": { "message": "Load your data", "description": "Header shown on the first screen in the data import process" @@ -542,15 +546,27 @@ "message": "Voice Message", "description": "Name for a voice message attachment" }, - "unsupportedFileType": { - "message": "Unsupported file type", - "description": "Displayed for outgoing unsupported attachment" - }, "dangerousFileType": { "message": "Attachment type not allowed for security reasons", "description": "Shown in toast when user attempts to send .exe file, for example" }, + "oneNonImageAtATimeToast": { + "message": + "When including a non-image attachment, the limit is one attachment per message.", + "description": + "An error popup when the user has attempted to add an attachment" + }, + "cannotMixImageAdnNonImageAttachments": { + "message": "You cannot mix non-image and image attachments in one message.", + "description": + "An error popup when the user has attempted to add an attachment" + }, + "maximumAttachments": { + "message": "You cannot add any more attachments to this message.", + "description": + "An error popup when the user has attempted to add an attachment" + }, "fileSizeWarning": { "message": "Sorry, the selected file exceeds message size restrictions." }, @@ -732,6 +748,12 @@ "description": "Shown in toast if user clicks on quote references messages not loaded in view, but in database" }, + "voiceNoteMustBeOnlyAttachment": { + "message": + "A voice note must be the only attachment included in a message.", + "description": + "Shown in toast if tries to record a voice note with any staged attachments" + }, "you": { "message": "You", "description": @@ -910,6 +932,11 @@ "description": "Used for the icon layered on top of an image in message bubbles" }, + "addACaption": { + "message": "Add a caption...", + "descripton": + "Used as the placeholder text in the caption editor text field" + }, "fileIconAlt": { "message": "File icon", "description": diff --git a/background.html b/background.html index dad6103eb..64ef85855 100644 --- a/background.html +++ b/background.html @@ -118,9 +118,9 @@