Commit Graph

23 Commits

Author SHA1 Message Date
lilia a27ea20f3e Improve unsupported file type handling
Make arbitrary files look nicer and display the filename.

If an audio or video element fails to load for any reason, timeout after
a few seconds and render it as an arbitrary file. Also short circuit to
this treatment for common audio and video file types that we know are
going to fail, e.g., proprietary formats from apple.

// FREEBIE
2017-04-18 16:27:50 -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
Blake Griffith 1e498294e0 Add attachment_views_test.js tests 2017-02-06 21:23:35 -08:00
lilia 41216f1378 Add timestamps to attachment filenames 2017-01-25 20:40:24 -08:00
lilia 8a153e942e Fix lightbox
// FREEBIE
2016-06-30 16:56:51 -07:00
lilia f670061669 Pressing escape closes the lightbox
// FREEBIE
2016-06-30 12:28:36 -07:00
lilia a069939f65 Refactor attachment saving for DRYness
// FREEBIE
2016-06-30 12:28:36 -07:00
Benedikt Radtke a1345c52b4 Added Save-As dialog for unsupported filetypes
Despite the "click to save"-description of unsupported file types, clicking them did not save them.
This commit implements a Save-As dialog instead of opening the file in chrome.

// FREEBIE
2016-06-30 00:18:36 -07:00
lilia 9091233950 Open images in a lightbox
Adds file-write permission for saving to disk from lightbox.

Fixes #810

// FREEBIE
2016-06-20 11:55:23 -07:00
lilia ccdbfc3e12 i18n AttachmentView
// FREEBIE
2016-01-02 02:51:24 -08:00
lilia 881aa1685d Fix up unsupported attachment rendering
Rather than simply displaying an inactionable error, render a link that
allows the user to save the unsupported attachment.

// FREEBIE
2015-12-21 17:57:35 -08:00
David Baldwynn 8251db6ae6 Added error message for unsupported attachment type (issue #419) 2015-12-21 00:19:32 -08:00
lilia 2fc78ddd7d Fix scroll position jumping when images load
Messages with images or media were causing the scroll position to jump
around when they loaded, because rendering them changed the height of their
elements from 0 to full-height sometime after they were inserted into
the DOM.

Now when rendering attachments, we wait for them to load so they can
render at full height immediately, then warn our parent message list
before and after a potential height change, so the scroll position can
be saved and reset.

// FREEBIE
2015-11-15 15:32:35 -08:00
lilia 2e32c7bbc3 Small refactor of attachment views
Bind the sub-view to some data when we initialize it, rather than
passing it in on render. That means the image view click handler will
only ever open the blob we bound it to, even if its src attr changes for
some reason, which should never happen, but if it does, it's nice to
guard against opening arbitrary urls found in the dom.

// FREEBIE
2015-10-21 10:52:20 -07:00
Odysseas 49585c8c57 Add feature to open image attachments
Images that are attached to messages, either sent or received
can be opened in a new tab by clicking on them.

The previous approach that used Anchors to open the image
attachmets failed in various systems because:
 - Chrome on Windows recognised "blob" as protocol and tried
   to find an app for it
 - Chromium on Ubuntu didn't open a new window to load the URL

The new approach adds a "click" listener to the IMG element and
opens the link using window.open (which seems to be working globaly).

Resolves: #252
2015-10-21 10:26:14 -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 bd82591b6c Remove extraneous listener 2015-03-23 16:05:55 -07:00
lilia 258a872ce3 Trigger update events after attachments load
Mostly so we can ensure we're scrolled to the bottom when the
conversation is loaded.
2015-03-03 13:23:55 -08:00
lilia f9ca13a86f DRY up audio and video views 2015-03-03 13:05:39 -08:00
lilia df06499a19 Use blob urls to display attachments
Converting attachment data to base64-encoded data uris takes O(n) and
there's no need! URL.createObjectURL returns a magic link that can be
set as the `src` attribute to `img`, `video`, and `audio` tags to load
blob data directly without copying.

https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
2015-03-03 13:05:24 -08:00
lilia 0778854cc4 Attachments should be in spans, not divs 2015-03-02 18:37:20 -08:00
lilia ddc0ed1b9a Add audio and video players
Basic implementation using html5 audio/video tags and data URIs.
2015-03-02 15:49:14 -08:00
lilia 3d6c251fd1 Group avatars 2015-01-11 01:27:22 -10:00