Commit graph

828 commits

Author SHA1 Message Date
lilia
1bb480f6ea DRY up a common view pattern
Define a Whisper.View base class that automatically parses and renders
templates and attributes defined by the subclass. This saves us a good
number of lines of code as well as some marginal memory overhead, since
we are no longer saving per-instance copies of template strings.
2015-03-05 15:36:35 -08:00
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
2015-03-04 18:43:38 -08:00
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.
2015-03-04 16:07:02 -08:00
lilia
567a48e82b Adjust widths of bubbles and chat window
With these changes, message bubbles in the default-sized chat popup are
just wide enough to display the full complement of html5 media player
controls.
2015-03-04 15:59:28 -08:00
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.
2015-03-04 13:59:30 -08:00
lilia
37d20b986b Add canvas.toBlob polyfill 2015-03-03 18:44:18 -08:00
lilia
68d68e9009 Add blueimp lib for html5's canvas-based image scaling 2015-03-03 17:50:11 -08:00
lilia
f89340a4e8 Turn up the volume on README warnings
Closes #185
2015-03-03 15:28:12 -08: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
4f5d3f0080 s/End Session/Reset Session/
Use the friendlier sounding copy from iOS.
2015-03-03 11:40:30 -08:00
lilia
11bdc58701 Update CONTRIBUTING.md 2015-03-03 11:15:28 -08:00
lilia
4cefd17ac6 Remove unused view 2015-03-03 10:55:04 -08:00
lilia
9d94bce92a After clearing messages, leave conversation open
Fixes #178
2015-03-03 10:39:10 -08:00
lilia
ce5f6e41a8 Add missing images 2015-03-02 23:23:11 -08:00
lilia
0778854cc4 Attachments should be in spans, not divs 2015-03-02 18:37:20 -08:00
lilia
88a708ce03 Fix file inputs on inbox view 2015-03-02 18:32:41 -08:00
lilia
1311f7c9ae Fix attachment previews for audio/video files 2015-03-02 18:27:14 -08:00
lilia
6fe262ceed Lazy init file input's FileReader 2015-03-02 18:01:59 -08:00
lilia
c8274d7bc7 Give video elements black backgrounds 2015-03-02 17:53:44 -08:00
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.
2015-03-02 17:50:03 -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
aa659877be Fix broken file input view 2015-03-02 15:35:04 -08:00
lilia
dcc1588219 Add key verification screen
Accessible from the menu on private conversations.
2015-02-26 22:26:46 -08:00
lilia
33b9a11e65 Always overflow: auto 2015-02-26 22:19:06 -08:00
lilia
1e45c089dd Remove obsolete native client divs 2015-02-26 15:22:14 -08:00
lilia
c08c29bd4a Render group members in the message detail view
This requires that we fetch contact info when opening a conversation
so that's available for rendering contact names and avatars.
2015-02-26 13:35:04 -08:00
Matt Corallo
2277b41639 Remove non-existant device messages 2015-02-26 12:13:56 -08:00
Matt Corallo
5abf3073d5 Check END_SESSION messages in processDecrypted 2015-02-26 12:11:05 -08:00
Matt Corallo
29192edcb8 Ignore END_SESSION on messages with a sync context 2015-02-26 12:11:04 -08:00
Matt Corallo
9c3f8a1868 Dont send group-update right before we quit the group
Fixes #166
2015-02-25 15:59:49 -08:00
lilia
fd30dc6f1a Add message detail view 2015-02-23 14:03:35 -08:00
lilia
368cd2f79a Refactor back button style
Make it easier to reuse these styles.
2015-02-23 12:52:15 -08:00
lilia
d0392a3e04 Refactor title bar text style 2015-02-23 12:07:06 -08:00
lilia
f35e8f347e Add grunt watch tasks to rebuild libs 2015-02-23 11:58:21 -08:00
lilia
e96aa2f06e Remove obsolete script tags
For the recently deleted notifications.js
2015-02-23 11:57:57 -08:00
lilia
b1035c23e5 Preserve whitespace in _concat files
This is a whitespace-only change. The diff is best viewed
with the `--patience` flag.

Some component library sources include trailing whitespace and carriage
returns which were excluded from these compiled files, (but somehow
still included in the final libtextsecure build). Although superfluous,
excluding these characters from these files means that I end up with
spurious changes whenever I rebuild them.
2015-02-20 15:34:49 -08:00
Matt Corallo
f2853d00e6 Merge pull request #167 from WhisperSystems/sync
Sync outgoing individual and group messages
2015-02-20 12:39:26 -08:00
lilia
f860cb4492 Return end session messages to the frontend
So we can save them in the message history, and because the caller
expects a promise.
2015-02-20 10:30:43 -08:00
lilia
55c46d1bb6 Close conversation menu when clicking outside it 2015-02-19 11:55:31 -08:00
lilia
4945180c12 Constrain .end-session style to the .message-list
It was incorrectly being applied to the End Session menu item.
2015-02-19 11:53:33 -08:00
lilia
e853c21c98 Remove unused code
There is no .settings-btn or .go-back in this view.
2015-02-19 11:00:29 -08:00
lilia
ec43a0b633 jshint all the things
Small style fixes here and there. Removed one unused file.
2015-02-19 00:22:23 -08:00
lilia
76da5bb4f9 Add background.js to jshint 2015-02-18 23:59:41 -08:00
lilia
09704444e9 Fix missing delivery receipt checkmarks
The delivered class should be updated on each render to ensure it is
up to date.
2015-02-18 23:57:19 -08:00
lilia
06e8e0dca7 Remove an extension.trigger
No need to trigger an extension-wide event now that all our models live
in the background page. We can just update them more or less directly.
2015-02-18 23:56:13 -08:00
lilia
626b63ee7c Fix some jshints 2015-02-18 23:41:45 -08:00
lilia
3292177a96 Remove resize logic in favor of pure css 2015-02-18 23:09:34 -08:00
lilia
07e44ccf21 Revisit resize and scroll logic once more
Wait a little longer on initial scroll down. Previous timeout sometimes
triggered before all text is finished rendering.

Remove redundant resize calls.
2015-02-18 16:54:43 -08:00