Commit Graph

44 Commits (ed4015f919a0a634056fa48136200195dc076d1f)

Author SHA1 Message Date
lilia ed4015f919 Return early from previewImages for unsupported files
// FREEBIE
9 years ago
lilia fa6d6974ed Discard unsupported files
Fixes #534

// FREEBIE
9 years ago
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
9 years ago
OdysseasKr f2d2e08fa2 Fix code styling 9 years ago
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
9 years ago
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
9 years ago
lilia 78a2b74297 Restyle attachment previews
Closes #380

// FREEBIE
10 years ago
lilia fe2b152186 Change target for appending file previews
// FREEBIE
10 years ago
lilia 9011a85b56 Change selector for opening a file input
// FREEBIE
10 years ago
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
10 years ago
lilia 36ec4300cf Fix broken group avatar preview
Fixes #355

// FREEBIE
10 years ago
lilia f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
10 years ago
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
10 years ago
lilia 583fb98cce Support late-addition of default image to file input
Fixes #256

// FREEBIE
10 years ago
lilia f4a206b266 Scale and crop avatars to 256 square thumbnails.
Fixes #213 // FREEBIE
10 years ago
lilia 590deef063 Decrease auto-scaling size
For better consistency with Android, autoscale images such that the
largest dimension is 1280. Related: #242
10 years ago
lilia 53a9ab4834 Fix bugs with handling large image attachments
* Avoid infinite loop scaling too-big images
* Don't crash if no file is selected
* Fix file size toast

Fixes #242

// FREEBIE
10 years ago
lilia d8f17f9631 Fixes #240
Delete files attached via chrome.fileSystem

// FREEBIE
10 years ago
lilia d0a529351c Fix sending messages with no attachments 10 years ago
lilia 5d3a2a4cc8 Fix file inputs
As a chrome app we are obligated to use the fileSystem api, and must do
so via the window in which we want to open the dialog.
10 years ago
lilia 5d4298697c Use view.$ shorthand for scoped jquery searches
Wish I'd noticed that one earlier. http://backbonejs.org/#View-dollar
10 years ago
lilia 4bd46f80e7 Allow empty group avatar file input 10 years ago
lilia 69d5a6a33c Improve group update ui/ux
Promote group update to its own screen. Add typeahead contact selector
from new conversation view. Restyle to match android (more or less).

Closes #186
10 years ago
lilia f1309b71c1 Don't scale or compress gifs
If a gif is too large, it's too large.

Fixes #196
10 years ago
lilia 2ee34343a8 Use consistent boiler plate throughout js files 10 years ago
lilia 7c9ad975bb Unravel image processing recursion and fix bugs
Although I find the previous implementation more elegant, it results in
a deeper nesting of Promises than necessary, which can make debugging
more complicated. The canvas scaling and compression apis are actually
synchronous, so the callback structure isn't really recessary here.
Converting to a loop also makes this process easier to understand at
a glance.

Fixed some bugs along the way:
* accidentally scaling small images up to 1920px
* jpeg compressing gifs and other formats even if unnecessary
10 years ago
lilia 0da04632f2 Scale large images even if they are small
Previously we would not scale large resolution images with small file
sizes, but in fact, both resolution and file size constraints should be
enforced.
10 years ago
lilia 8bc77fa02b Automatically compress and scale large images
Do nothing to other file types. Continue to block files that are too
large even after scaling and compression.
10 years ago
lilia 1311f7c9ae Fix attachment previews for audio/video files 10 years ago
lilia 6fe262ceed Lazy init file input's FileReader 10 years ago
lilia db7dee9a8a Fixup file size warning
Add contentType-specific limits, switch to lazy-init iff we encounter an
oversized file, and restyle as a toast, factoring out a generic
ToastView along the way.
10 years ago
lilia aa659877be Fix broken file input view 10 years ago
lilia ec43a0b633 jshint all the things
Small style fixes here and there. Removed one unused file.
10 years ago
lilia 746e6530b9 WIP pill view for selected recipients 10 years ago
lilia 79b4c89ce4 Fixup attachment preview 10 years ago
lilia 58e7f3c7e1 Fix file input click zone
Previously, the ugly file input was hidden with opacity, and styled as a
square paperclip icon, but its drop and click zones were not constrained
to the visible square. They remained active across the whole 'Choose
File' button, which overlapped with the textarea. Instead, hide the file
input complete (display: none) and transmit click events from the
paperclip to the input programmatically.

Eventually, we'll need to address drag and drop events, but I want to do
that at the window level. Otherwise dropping a file outside the file
input drop zone causes the browser to navigate to the file://... url.
10 years ago
lilia 8498d7ad1f Fixup conversation page styles and functionality
Render the entire conversation from a template, because some parts of it
must be rendered conditionally if it is a group vs private conversation.

Also apply some style fixes and restore lost functionality:
  * Make conversation title bar fixed.
  * Widens message bubbles.
  * Unhide message list.
  * Restore attachment rendering.
  * Restore message sending and attachment file selection.
  * Style attachments file input as a paperclip.
  * Style send button like on Android and make it a submit input.
10 years ago
Riley Shaw 783a3f7c15 Prevent duplicate conversations and refocus on click (still buggy) 10 years ago
lilia f73596c240 Add a view for attachment previews 10 years ago
Emily Chao bb2b53035e Restyled message attachments
Added a size limit, added functionality to delete the attachments before sending in a more user-friendly way
10 years ago
lilia 9baafddb14 Add license to file input view 10 years ago
lilia 3d6c251fd1 Group avatars 10 years ago
lilia 99a2685f93 Store attachments as binary blobs
Move base64 encoding of attachments to an AttachmentView. This makes
image rendering an asynchronous task so we fire an update event to
indicate to the parent MessageListView that its content has changed
height and it is time to scroll down.
11 years ago
lilia 229007040c Basic frontend support for image attachments 11 years ago