Commit Graph

850 Commits

Author SHA1 Message Date
Daniel Gasienica
98d951ef77 Remove promises reference 2018-02-15 15:16:58 -05:00
Daniel Gasienica
a0e9559ed5 Fix AttachmentView::mediaType fall-through 2018-02-15 15:16:58 -05:00
Daniel Gasienica
67be916a83 Remove minor TODOs 2018-02-15 15:16:58 -05:00
Daniel Gasienica
0af186e118 Enable ESLint for js/views/attachment_view.js 2018-02-15 15:16:58 -05:00
Daniel Gasienica
41b92c0a31 Add operator-linebreak ESLint rule
Based on the following discussion:
https://github.com/signalapp/Signal-Desktop/pull/2040#discussion_r168029106
2018-02-15 15:16:58 -05:00
Daniel Gasienica
c08058ee4b Convert FileList to Array 2018-02-15 15:16:58 -05:00
Daniel Gasienica
2ca7cdbc31 Skip autoOrientImage for non-JPEG images 2018-02-15 15:16:58 -05:00
Daniel Gasienica
a346bab5db Remove vim directives on ESLint-ed files 2018-02-15 15:16:58 -05:00
Daniel Gasienica
8ad0b066a3 Add Whisper.Types namespace
This avoids namespace collision for `Whisper.Message`.
2018-02-15 15:16:58 -05:00
Daniel Gasienica
cd985aa700 Document type signature of FileInputView::readFile 2018-02-15 15:16:58 -05:00
Daniel Gasienica
d70d70e52c Move attachment processing closer to sending
This helps ensure processing happens uniformly, regardless of which code paths
are taken to send an attachment.
2018-02-15 15:16:58 -05:00
Daniel Gasienica
532ac3e273 Process attachment before it’s sent
Picked this place since it already had various async steps, similar to
`onMessageReceived` for the incoming `Attachment.process`.

Could we try have this live closer to where we store it in IndexedDB, e.g.
`Conversation::sendMessage`?
2018-02-15 15:16:58 -05:00
Daniel Gasienica
a4582ae2fb Refactor getFile and getFiles
Lint them using ESLint.
2018-02-15 15:16:58 -05:00
Daniel Gasienica
fdc3ef289d Highlight that dataURLToBlob is synchronous 2018-02-15 15:16:58 -05:00
Daniel Gasienica
8b6494ae6c Document potentially unexpected autoScale behavior 2018-02-15 15:14:59 -05:00
Daniel Gasienica
141155a153 Move blueimp-canvas-to-blob from Bower to npm 2018-02-15 15:14:59 -05:00
Daniel Gasienica
7ccb833e5d 🎨 Clarify data flow 2018-02-15 15:14:59 -05:00
Daniel Gasienica
e7da41591f Use blobUrl for consistency 2018-02-15 15:14:59 -05:00
Daniel Gasienica
523a80eefe Remove just-in-time image auto-orient for lightbox
We can bring this back if our users would like auto-orient for old attachments.
2018-02-15 15:14:59 -05:00
Daniel Gasienica
0739feae9c Remove just-in-time auto-orient of message attachments
We can bring this back if our users would like auto-orient for old attachments. But better
yet, we might implement this as database migration.
2018-02-15 15:14:59 -05:00
Daniel Gasienica
9638fbc987 Use contentType from model 2018-02-15 15:14:59 -05:00
Daniel Gasienica
59974db5a5 Improve readability 2018-02-15 15:14:59 -05:00
Daniel Gasienica
4822f49f22 Auto-orient images in lightbox view 2018-02-15 15:14:59 -05:00
Daniel Gasienica
7317110809 Document magic number for escape key 2018-02-15 15:14:59 -05:00
Daniel Gasienica
c790d07389 Make second View argument an options object 2018-02-15 15:14:59 -05:00
Daniel Gasienica
c285bf5e33 Replace loadImage with autoOrientImage 2018-02-15 15:14:59 -05:00
Daniel Gasienica
c77063afc6 Auto-orient preview images
See: #998
2018-02-15 15:14:59 -05:00
Daniel Gasienica
06dba5eb8f TODO: Use native Canvas::toBlob
One challenge is that `Canvas::toBlob` is async whereas `dataURLtoBlob` is sync.
2018-02-15 15:14:59 -05:00
Daniel Gasienica
b15c304a31 Make null check strict
Appeases JSHint. ESLint has a nice `smart` option for `eqeqeq` rule:
https://eslint.org/docs/rules/eqeqeq#smart
2018-02-15 15:14:59 -05:00
Daniel Gasienica
ea70b92d9b Use Canvas::toDataURL to preserve ImageView logic
This way, all the other code paths remain untouched in case we want to remove
the auto-orient code once Chrome supports the `image-orientation` CSS property.

See:
- #998
- https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation
2018-02-15 15:14:59 -05:00
Daniel Gasienica
62fd744f9f Use CSS to constrain auto-oriented images 2018-02-15 15:14:59 -05:00
Daniel Gasienica
f4d3392687 Replace ImageView el with auto-oriented canvas
See: #998
2018-02-15 15:14:59 -05:00
Daniel Gasienica
1602d7f610 Pass Blob to View (for ImageView)
This allows us to do JPEG auto-orientation based on EXIF metadata.
2018-02-15 15:14:59 -05:00
Daniel Gasienica
e6a414f2b2 🔪 Remove newline 2018-02-15 15:14:59 -05:00
Scott Nonnenberg
7b49180bc0 Big update to new signal branding (#2018) 2018-01-30 14:22:51 -08:00
Scott Nonnenberg
72b7e4ec34 Process expireTimer and block status along with contact/group sync (#1980)
* Mark group as left = false if it is active in contact sync

* Handle expireTimer + blocked state along with contact/group sync
2018-01-29 18:14:39 -08:00
Scott Nonnenberg
fb2ebddaa3 Remove expired message if it expired during database fetch (#1983)
* Log SyncMessage destination, even if it's a group

* Remove disappearing message even if deleted during fetch

This change fixes a potential race condition with disappearing message
removal from the UI. If the UI is in the middle of making a database
request for messages to display, then we need to wait for that to
complete before removing the newly-deleted expired message.
2018-01-23 12:27:34 -08:00
Scott Nonnenberg
c70fb3a254 Video/audio: rely on the browser to detect content type (#1977) 2018-01-17 15:28:12 -08:00
Scott Nonnenberg
743e897541 Left pane: small sorting fix, logging for error cases (#1969) 2018-01-12 16:22:00 -08:00
Scott Nonnenberg
e999473f19 Preserve disabled state in the middle of sending message (#1937)
* Preserve disabled state in send-message field on click

Also: get consistent in treatment of 'disabled' property.

* Add some comments explaining how audio recording dismissal works
2018-01-04 16:51:00 -08:00
Scott Nonnenberg
7781f8fa5b Treat tiffs like unrecognized files; Chrome doesn't render them (#1901) 2017-12-14 17:32:58 -08:00
Scott Nonnenberg
2430ee00d4 Emoji: Eliminate unused images, make sure panel clicks add emoji (#1849)
* Emoji: Ensure that all clicks work by using emoji data directly

* Eliminate a number of unused emoji images from final build

* Re-add the generic sheets directory, which we partially filter
2017-12-04 10:19:35 -08:00
Scott Nonnenberg
0e328f3911 Merge branch 'master' into development
This catches the development branch up with v1.0.39 in master.
2017-11-21 18:25:59 -08:00
Scott Nonnenberg
87d8ec723a Remove conversation from left pane on 'delete messages' (#1807) 2017-11-21 16:37:58 -08:00
Scott Nonnenberg
83428e5b81 Remove last seen indicator if we get a sync'd outgoing message (#1805)
This mirrors the way Android does things.
2017-11-21 14:41:05 -08:00
Scott Nonnenberg
34dd375260 Be resilient to thrown non-errors in import process (#1737) 2017-11-08 17:32:33 -08:00
Lilia
fb931b4733 Emoji picker (#1608)
* Add emoji button and popup panel

This integrates a simple third party emoji panel with a few css overrides to
correct some relative paths and colors.

The trickiest thing about this is ensuring we don't break the layout, which is
acheived through precise control over the panel's height, and prodigious calls
to updateMessageFieldSize.

// FREEBIE

* Don't close emoji panel on click, do close on send

To better facilitate multiple emoji entry.

// FREEBIE

* Make panel emojis bigger and higher resolution

// FREEBIE

* Move paperclip button to the right of the microphone

This makes our bottom-bar button arrangement more comfortable and consistent
with Android.

// FREEBIE

* Move emoji picker padding to inner container

* Insert emojis at cursor position

Don't just append to the end like a n00b! Also handle selected text correctly.
https://stackoverflow.com/questions/11076975

// FREEBIE

* A few visual tweaks to reduce visual complexity of emoji panel

- No gray buffer on the right side of the emoji panel
- No gray buffer between message compose text box and emoji window
- The scroll bar for the emojis is the same as our normal scrollbars
2017-10-30 13:54:55 -07:00
Scott Nonnenberg
dabc56d0cf Load profiles for a conversation without blocking convo load (#1570) 2017-10-18 11:59:12 -07:00
Scott Nonnenberg
75cece3358 Improve OS menu (#1563)
* Remove reload options, new file/help menus, tools/log at bottom

* Further menus refactor: install handlers at template creation

* WIP: Further tune menus, add custom about window

* New About window, new help menu items, menu labels now i18n

* Default device name on registration is now computer hostname

The OS of the device makes sense for those of us testing across a lot of
different OSes. And maybe for a user with just one desktop device. But
most users with multiple desktop devices are using the same OS for both.

* About window: Only show window when content is ready

* Fix typo in app/menu.js
2017-10-13 16:49:16 -07:00
Scott Nonnenberg
151d1797db Fix intermittent conversation sort order problem (#1558)
We were inserting based on what was already in the DOM, instead of
using the index from our conversation collection.

FREEBIE
2017-10-13 11:47:13 -07:00