Commit Graph

81 Commits

Author SHA1 Message Date
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
59974db5a5 Improve readability 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
Scott Nonnenberg
7781f8fa5b Treat tiffs like unrecognized files; Chrome doesn't render them (#1901) 2017-12-14 17:32:58 -08:00
Scott Nonnenberg
f95c65acac Add 100MB file size limit for arbitrary file types (#1555)
Previously we only had limits for audio, video, and image files.

FREEBIE
2017-10-11 14:41:51 -07:00
Scott Nonnenberg
b44f23cc98 Show proper icon when attachment is not an image (#1548)
FREEBIE
2017-10-10 08:49:29 -07:00
lilia
a2b2bd4bf3 Fix relative paths
// FREEBIE
2017-09-14 16:53:46 -07:00
lilia
6686621b0b Fix file dialog 2017-09-14 16:53:34 -07:00
lilia
859d49b3f4 Use relative paths
// FREEBIE
2017-09-14 16:53:34 -07:00
lilia
6c53605dfd Flag voice note attachment protos as such
// FREEBIE
2017-05-12 09:55:15 -07:00
r-clancy
499ca5537a Increase max GIF size to match Signal-Android.
Signal-Android had the max GIF size changed to 25MB in
WhisperSystems/Android@ad0f283

This change brings parity to the two projects and fixed #1116.
2017-05-01 11:00:10 -07:00
lilia
7a8f2f0fec Allow sending arbitrary files 2017-05-01 09:58:03 -07:00
lilia
27a1c9f18a Populate attachment file size
// FREEBIE
2017-04-18 12:08:37 -07:00
lilia
fc514aa96f Add support for attachment file names
Send, receive, and save attachment filenames. Use them as suggested
names when saving files.

// FREEBIE
2017-04-18 11:48:56 -07:00
haffenloher
e8de2f0c52 Increase image constraints to 6 MB / 4096 px
Matches WhisperSystems/Signal-Android@d2be49af

Closes #1055

// FREEBIE
2017-02-08 17:05:33 -08:00
beejaygee
76c165a10a Add copy and paste for images
Switch comparison operator to ===

Move to stricter parsing of clipboard items
2017-02-07 19:26:09 +08:00
Bernhard Steindl
e2cb45c1da Push picture max edge to 2048 and max size to 4 MB
Closes #1032 and catches up with Android
2017-01-25 20:40:25 -08:00
lilia
4f46a164ba Add voice notes
// FREEBIE
2016-08-23 16:16:31 -07:00
lilia
3ac7552d2f Fix errant change event handler from firing
A change in the text field was firing the previewImages handler.

// FREEBIE
2016-04-18 19:15:36 -07:00
lilia
47320fbbc5 Fix file input bug introduced in 28c602a
Fix bug where clicking the attachment button to select a file would
immediately send any text already entered into the message input.

// FREEBIE
2016-04-15 14:40:40 -07:00
2-4601
e874b61839 Fix typo of quality argument in image compression
The quality value should be a float in the range 0.0 to 1.0.
Other values (e.g. 50) are discarded silently and a default is used.

Fixes #713

// FREEBIE
2016-04-09 14:17:47 -07:00
lilia
d8d34e7afc Icon upgrade
Also remove unused images.

// FREEBIE
2016-04-01 13:59:57 -07:00
lilia
173e037fa6 Fix minor style errors
And keep it that way, by making jscs config more opinionated.

// FREEBIE
2016-02-18 13:45:22 -08:00
lilia
47e33a14ac i18n UnsupportedFileTypeToast
// FREEBIE
2016-01-02 02:51:24 -08:00
lilia
42f15011fa i18n FileSizeToast
// FREEBIE
2016-01-02 02:51:24 -08:00
lilia
ed4015f919 Return early from previewImages for unsupported files
// FREEBIE
2015-12-20 22:16:54 -08:00
lilia
fa6d6974ed Discard unsupported files
Fixes #534

// FREEBIE
2015-12-20 22:14:39 -08:00
lilia
77caa63321 Normalize views' template fetching pattern
Typically, a view can specify its templateName and then use the default
render method on Whisper.View, except in some special cases like message
view or message detail where other operations are performed during
render.

// FREEBIE
2015-12-09 18:58:52 -08:00
OdysseasKr
f2d2e08fa2 Fix code styling 2015-12-09 18:57:50 -08:00
OdysseasKr
652d0963fc Add drag and drop support for text
By adding the drag and drop support for media files, the default
event handlers were overwritten. Thus drag and drop did not support
text. Now, the drag and drop listeners revert to the default behaviour
when the user does not drag a file.

Resolves: #478
2015-12-09 18:57:50 -08:00
OdysseasKr
cbbb8dfa24 Add drag and drop for attachments
Files can be dragged and dropped on the bottom in order to be added as
attachments.

Resolves: #260
2015-12-07 15:32:14 -08:00
lilia
78a2b74297 Restyle attachment previews
Closes #380

// FREEBIE
2015-10-29 18:19:51 -07:00
lilia
fe2b152186 Change target for appending file previews
// FREEBIE
2015-10-29 11:04:21 -07:00
lilia
9011a85b56 Change selector for opening a file input
// FREEBIE
2015-10-29 10:58:28 -07:00
Deirdre Connolly
861bc416e6 Update attachment size limits to match mobile clients
Per WhisperSystems/TextSecure@8a1428e, bump GIF limit to 5MB, and
audio/video limit to 100MB. Update toast to notify in correct
human-readable units. The only kB size limit is for images, and will
trigger only if after scaling up to 4 times, the rescaled image did not
come in under the size limit without unacceptable quality loss.

Closes #354
2015-10-20 12:29:52 -07:00
lilia
36ec4300cf Fix broken group avatar preview
Fixes #355

// FREEBIE
2015-09-16 12:29:16 -07:00
lilia
f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
2015-09-07 14:58:42 -07:00
lilia
5925c2fe84 Support for group sync
Protocol and handling is all analogous to contact sync: Multiple
GroupDetails structs are packed into a single attachment blob and parsed
on our end. We don't display the synced groups in the conversation list
until a new message is sent to one of them.

// FREEBIE
2015-06-25 13:24:32 -07:00