Commit Graph

463 Commits (e91f6469209da899755c2103c90f791d8fdcce60)

Author SHA1 Message Date
lilia 694f801676 Stop hiding inbox instead of closing
This behavior was intended to help keep the websocket alive, but keeping
the inbox window around can cause some stale frontend state. Also we now
have a keepalive alarm to check for new messages once a minute.
10 years ago
lilia 72f16b94ff Polish group update ux
* Show the members list as static elements
* Style the search results as a drop down, mirroring android ux

Fixes #248 // FREEBIE
10 years ago
lilia 23db5802cf Support custom placeholder on recipients input 10 years ago
lilia ac401c78b3 Fix socket status indicator
It was not correctly reporting the status after a background page reload.
10 years ago
lilia 6e1a41e9cf Update inbox when group avatars change 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 cdb7fcfbad Pass windows around to let file inputs work 10 years ago
lilia 3d1df790a5 Update the window title when a group title or contact name changes 10 years ago
lilia d26c13b155 Add openInbox link to conversation menu. Fixes #246 10 years ago
lilia 9d688cb761 List views persist sroll offset by percentage
Fixes #188
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 3e73282a64 Fix key verification screen 10 years ago
lilia e2eff893d4 Fix 'Delete messages'
Replaces window.confirm with generic promise-based confirmation dialog
functionality available to all views.

// FREEBIE
10 years ago
lilia 8a17953468 Display sent_at timestamps instead of received_at 10 years ago
lilia 3e39271220 Render messages light blue until finished sending // Fixes #219 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 7bf1d41184 Render conversation titles 10 years ago
lilia d0a529351c Fix sending messages with no attachments 10 years ago
lilia a5e80e8a5a Really close conversation windows
Only the inbox should hide when closed.
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 39d11d8eb3 Apply custom chrome to conversation windows 10 years ago
lilia 95f8e3921c Keep inbox window open, but allow it to be hidden
As a chrome packaged app, we have to keep at least one window open in
order to maintain our websocket connection in the background page.

This change replaces the system window frame with custom buttons in the
inbox header, such that the 'close' button merely hides the window
rather than unloading it.

Fixes #237
FREEBIE
10 years ago
lilia 7afd0a02e8 Convert beforeunload listeners 10 years ago
lilia 76e170686a Make getBackground async 10 years ago
lilia f774047935 Make libtextsecure group storage asynchronous 10 years ago
lilia 20ebc3f890 Move identity key storage functions to axolotl store 10 years ago
lilia 71715c95bc Async remove identity 10 years ago
lilia de65f9e6bd Add missing resolve 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
Matt Corallo 454b4726bd Replace load/decode/index around our own number with helpers 10 years ago
lilia 923bb8bbc9 Fix crash in message detail view
Fix crash when there's no contact for a group member.
10 years ago
lilia e8cb4efaa4 Allow key conflict resolution for group updates
Creating a group with a member who's identity key has changed would
previously fail silently. Now, we catch and save the error, allowing the
same conflict resolution process as with regular messages.

Fixes #205
10 years ago
lilia 4bd46f80e7 Allow empty group avatar file input 10 years ago
lilia ce36c36bd0 Include outgoing control messages in message history
So you know it worked.
10 years ago
lilia 6c3ac2de02 Collapse two views into one
We used to have a subview that branched on content/control messages, but
no more.
10 years ago
lilia caddb8dc09 Smoother group create experience
Previously there was a long pause between confirming the group details
and opening the conversation. Fix by first saving/opening the
conversation, rather than waiting for the initial group update to finish
transmitting.
10 years ago
lilia 74e01c2a95 Re-render control messages if necessary 10 years ago
lilia 48b0e8832d Fix message detail contacts for incoming group message
Previously the From-field displayed all the group contacts.
10 years ago
lilia bd82591b6c Remove extraneous listener 10 years ago
lilia a7079206f4 Nicer looking end-session and group control messages 10 years ago
lilia 20baa795ad Fixes #198 Squished avatars
Refactor all avatar views to use a shared partial, then change it to a
background image. Requires allowing unsafe-inline styles in the CSP.
10 years ago
lilia 5ffa265559 Revert "Popout inbox"
This reverts commit 31e7d285e3.

This seemed like a nice feature, but the popup bubble isn't very
conducive to nontrivial user inputs, e.g. file inputs.

Fixes #211
10 years ago
lilia c526dbda5f Set up production build task
`grunt copy`

Closes #191
10 years ago
lilia 43ec4099c9 Reset the name field on new group form 10 years ago
lilia 9930937707 Move handlePushMessageContent to message model
And retool message handling flow to helps us avoid instantiating
duplicate message and conversation models.
10 years ago
lilia 897d391817 Improve identity key conflict ux
Clicking on a key conflict message opens the message detail view,
which displays the contact(s) in this conversation. If the message
contains a key conflict with any of these contacts, a button is
displayed which attempts to resolve that conflict and any other
conflicts in the conversation that are related to that contact.
10 years ago
lilia 31e7d285e3 Popout inbox
Rather than opening the inbox in its own window, let it appear as a
browser action popup by default, but allow promotion to its own window
if requested.
10 years ago
lilia cecb438a52 Simplify avatar rendering 10 years ago
lilia f86d6d51e3 Only init emoji map once.
`emoji.init_colons` creates and populates `emoji.map.colons`, a global
map from common names to emoji code points. It's safe to call
repeatedly, but unecessary.
10 years ago
lilia 651b6341fa Unbind frontend listeners when window closes 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 d20e23402d Refactor RecipientsInputView from NewConversationView
For reuse on group update screen.
10 years ago
lilia 36319d6458 Fix crash when sending :invalid_emoji: 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 8e54aa1401 Plumb contact avatars into conversations 10 years ago
lilia 019a9d1fbc Unread counts
Update unreadCounts per-conversation on incoming messages. Render unread
conversations with font-weigh: bold in the inbox view.

To ensure that the inbox and conversation views remain in sync, the
background page now ensures that the same models objects are used for
both views.
10 years ago
lilia ed707db4ba Support :emoji_name: syntax for emoji text input 10 years ago
lilia 254131488e Render emoji in conversation and inbox views. 10 years ago
lilia c73f4d71a7 DRY up scrollable pattern
Switch to using gutter class instead of id since there is potentially
more than one usage on the page.
10 years ago
lilia a72ea7966d Clean up inbox/compose view rendering and swapping
Templatize the inbox view and use the same pattern for in-window view
switching as is now used with the conversation/message detail views.
This means doing more with markup and less jquery manipulation of
individual subelements of the inbox view.
10 years ago
lilia fd6e2954f7 Curtail over-zealous websocket reconnects
Closes #173

Previously, in the event of a failed websocket auth, we would attempt to
reconnect once a second ad infinitum. This changeset ensures that we
only reconnect automatically if the socket closed 'normally' as
indicated by the code on the socket's CloseEvent. Otherwise, show a
'Websocket closed' error on the inbox view.

Ideally we would show a more contextual error (ie, 'Unauthorized'), but
unfortunately the actual server response code is not available to our
code. It can be observed in the console output from the background page,
but programmatically, we only receive the WebSocket CloseEvent codes
listed here:
https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes

The websocket error message is displayed by a normally-hidden but ever
present socket status element. Clicking this element will immediately
refresh the background page, which will try again to open the websocket
connection.
10 years ago
lilia 1321a90667 Rename Whisper.View#attributes
Avoid colliding with Backbone.View attributes, which is a list of attrs
to set on the html element for a view.
10 years ago
lilia dc1b09f59d Auto-link urls in message bodies
And watch out for xss.

Closes #187
10 years ago
lilia 01d5881a71 Remove unneeded if-gaurd 10 years ago
lilia b65190e101 Break a long line 10 years ago
lilia 99787753a8 Stop re-rendering attachments on delivery receipt
Only re-render a message if the body changed. Re-render only the
delivery receipt checkmark if the delivered property changes.

Fix a bug where attachments flash in and out of existance when a
delivery receipt arrives.
10 years ago
lilia dfe7813e7f Fix multiple from address in message detail 10 years ago
lilia 2ee34343a8 Use consistent boiler plate throughout js files 10 years ago
lilia f89cf890df Clean up older views, mostly whitespace 10 years ago
lilia 44a31f3ed9 Remove unneeded function 10 years ago
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.
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 258a872ce3 Trigger update events after attachments load
Mostly so we can ensure we're scrolled to the bottom when the
conversation is loaded.
10 years ago
lilia f9ca13a86f DRY up audio and video views 10 years ago
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
10 years ago
lilia 4cefd17ac6 Remove unused view 10 years ago
lilia 9d94bce92a After clearing messages, leave conversation open
Fixes #178
10 years ago
lilia 0778854cc4 Attachments should be in spans, not divs 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 ddc0ed1b9a Add audio and video players
Basic implementation using html5 audio/video tags and data URIs.
10 years ago
lilia aa659877be Fix broken file input view 10 years ago
lilia dcc1588219 Add key verification screen
Accessible from the menu on private conversations.
10 years ago
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.
10 years ago
lilia fd30dc6f1a Add message detail view 10 years ago
lilia 368cd2f79a Refactor back button style
Make it easier to reuse these styles.
10 years ago
lilia 55c46d1bb6 Close conversation menu when clicking outside it 10 years ago
lilia e853c21c98 Remove unused code
There is no .settings-btn or .go-back in this view.
10 years ago
lilia ec43a0b633 jshint all the things
Small style fixes here and there. Removed one unused file.
10 years ago
lilia 09704444e9 Fix missing delivery receipt checkmarks
The delivered class should be updated on each render to ensure it is
up to date.
10 years ago
lilia 3292177a96 Remove resize logic in favor of pure css 10 years ago
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.
10 years ago
lilia 955ef60292 Fix list_view-related error in background page
Background page conversations were trying to trigger events on the inbox
list view which had been destroyed, resulting in a background page
console error of "can't read innerHeight of null".

Avoid this by removing listeners when the inbox window is closed.
10 years ago
lilia 1c589f2fad Fix list_view.js and message_view.js whitespace 10 years ago
lilia 4716754209 Refactor content message class names 10 years ago
lilia 94c94eb7c9 Refactor message view
The message view has three flavors so far, a normal text+attachments
message, a group update, and an end session message. This changeset
extracts the normal message rendering into its own subview, and adds
some convenience functions to the message model in order to simplify
some of that flavoring logic.
10 years ago
lilia 85bec04010 Render leave-group messages correctly 10 years ago
lilia 367421d40a Style end session messages
Also add a missing call to render()
10 years ago
lilia f00a8f1e81 Render end session messages correctly 10 years ago
lilia 488f25635d Wire up end session and leave group
Closes #136
Closes #137
10 years ago
lilia 85b4643e9b Fixes #161
The first message sent to a new contact was throwing 'Unknown Group'.
This was because we didn't wait for the initial save to sync the `type`
attribute to indexedDB. Instead, don't trigger the conversation to open
until it has finished saving.
10 years ago
lilia 44f9ea5d49 Fix identity key error rendering 10 years ago
lilia 9fe99adf0c Get scrolling right on conversation load 10 years ago
lilia f5c7be7d35 Add some resizes 10 years ago
lilia 5a302271b3 Remove unneeded listeners 10 years ago
lilia 0463e385e8 Remove uneeded render
This is an artifact of a time when conversation elements would pop in
and out of the dom at a moment's notice, and thus needed to rebind their
event listeners regularly.
10 years ago
lilia 5e064db28f Render the message list view. 10 years ago
lilia 5ad5464dd1 Fetch messages in the background 10 years ago
lilia 52b3114970 Simplify list view resizing 10 years ago
lilia 44b1e5c88e Move inbox collection to the background page
No more waiting, no more messy fetch logic. Background page
bootstraps the inbox and keeps it up to date.
10 years ago
lilia a5bc261365 Clear selected files after each sent message 10 years ago
lilia 2de682ef7b Don't create a group without a name 10 years ago
lilia d5c85dfbd8 Resize inbox listview after it finishes loading
Ensures that scrollbars are properly setup on load.
10 years ago
lilia 4422582ab7 Fixup opening existing private conversations 10 years ago
lilia 200981e022 Avoid adding empty-string numbers to recipients 10 years ago
lilia 3a099657e6 Untangle select vs open events 10 years ago
lilia 9087918500 Don't add new convos to inbox until a message is sent 10 years ago
lilia af49ad9b90 Dry up new contact init and handling 10 years ago
lilia 63d232dedb Draw attention to invalid numbers 10 years ago
lilia 746e6530b9 WIP pill view for selected recipients 10 years ago
lilia 5e3ed1658b Show phone numbers in contact selector 10 years ago
lilia 9e245e67e0 Fix double-opening exsisting conversations from typeahead 10 years ago
lilia aca3db97da New messages auto-update the inbox & conversation
When a new message arrives, if its conversation is not already opened,
the background page opens it. If it is alrady open the window is
focused. Finally, the 'message' event is triggered, resulting in
   1. the inbox refetches conversations
   2. all conversations fetch new messages

TODO: only send this event to the target window
10 years ago
lilia db5e7fd6b6 Fix list view scrolling
Resize handlers are ugly. But not as ugly as scroll handlers. :p
Normalized some whitespace along the way.
10 years ago
lilia 0f29cf2043 Put spaces between joined members in group updates 10 years ago
lilia d435ff003b Improve typeahead contact selector experience
Store and match on various phone number formats. Still not perfect, as
occasionally all the models are returned for a non-matching query.
10 years ago
lilia acc2c6f536 Sort contact selector by title 10 years ago
lilia a00632c728 Hook up group creation flow UI
Checkboxes add and remove members as well as exposing the group update
ui. The conversation window is opened after saving the group.
10 years ago
lilia b3e32a2642 Only load contacts (not groups) in the typeahead 10 years ago
lilia 2f93fb9fbc Remove unneeded comparator
This collection is just an in-memory indexer used for typeaheads. For
display, the matching models are added to a separate collection. Thus,
the order of the elements in the typeahead collection does not matter.
10 years ago
lilia 0d6fbabb3e Trigger a checkbox event from conversation list items 10 years ago
lilia 3d5553df09 Remove listener for model open event 10 years ago
lilia 87cd3f5053 Save and open new contact on click 10 years ago
lilia 17f3263a21 Listen for escape key anywhere in the inbox 10 years ago
lilia 070393170c Auto-focus new conversation input field 10 years ago
lilia b1ad04298f Add title bar label to new conversation view 10 years ago
lilia d26dc8c7e6 Move openConversation handler to InboxView
Removes the background page ref to inbox which should fix view tests.
Prep for handling new contact creation.
10 years ago
lilia 9a6c6bcd98 Reset the typahead before showing it 10 years ago
lilia b13e36a11c Style conversation menu 10 years ago
lilia 80ce2d95e0 Sort contacts by name in compose flow 10 years ago
lilia 6d81011f6a Add back button to compose view 10 years ago
lilia fedfdcdd7e Style elements for compose flow 10 years ago
lilia 17deb69a91 Make conversation panel work with a new contact
Prevent view from fetching messages without an id, as this causes a
crash.
10 years ago
lilia 5762724709 Don't show new contact unless input may be a phone number 10 years ago
lilia 4ee4872b27 Stop matching typeahead against group members
It feels a little weird when you can't see the matching member. Would
consider putting this back in if we display the member list in the
contact list item view.
10 years ago
lilia 00e9e3b757 Setup loading gif on conversation list
TODO: get actual gif asset in there.
10 years ago
lilia cc0acc56dd Initially hide newConversationView 10 years ago
lilia 613dc3bedd Start on support for messaging a brand new contact 10 years ago
lilia d3d84f3124 Let typeahead surface groups with matching members 10 years ago
lilia e149650d94 Refactor typeahead into new conversation view 10 years ago
lilia f207137b35 Customize typeahead tokenizer 10 years ago
lilia c6a19afd29 Tweak contact style in typeahead
Remove message snippets and dates.
Add checkboxes.
10 years ago
lilia 7bcceacf69 Implement typeahead (first pass) 10 years ago
lilia 79b4c89ce4 Fixup attachment preview 10 years ago
lilia bd86546cea Make chat window titles match contact list 10 years ago
lilia 1a553fef17 Hide file modal until it's needed 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
lilia 34d5f3e88a Cleanup inbox view
Don't auto open the last conversation. It doesn't make sense now that we
no longer have two column layout.

Don't trigger/listen for selected events. There's no need since the list
item opens a new popup now.
10 years ago
lilia 607d5d3307 Abstract chrome browser action and windows stuff 10 years ago
Riley Shaw 94ce4d4b91 Simplify panel state management and message passing 10 years ago
Riley Shaw 9071d98395 Update styles to material design to match Android client (first pass) 10 years ago
Riley Shaw 783a3f7c15 Prevent duplicate conversations and refocus on click (still buggy) 10 years ago
Riley Shaw 7ec27f814f Get conversations loading through localStorage 10 years ago
Riley Shaw 2cbcb28ee3 Start on panels 10 years ago
lilia 8097db9af7 Micro refactor group update setup in message view 10 years ago
lilia 94e14f2c85 Add license headers
Closes #75
10 years ago
lilia 5d044bd00e Fire an event on phone number validation
Fix a bug introduced by recent phone number input work that prevented
the call and sms buttons from being clickable.
10 years ago
lilia f6376c0fa2 Rename event
'open' seems a better name for an event that triggers the open function.
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 d470b0eb53 Less jquery, more templating in conversation view
`if (foo) then jquery-dom-insert...` is a poor pattern to follow.
Instead, let mustache do the work.
10 years ago
Emily Chao e74cba8a92 Restyled country dropdown
Added jquery plugin that allows for flags and country codes to be
displayed in a user-friendly way, on top of the existing phone view
10 years ago
Emily Chao 5d3020b9ed Refactor phone number input view
Moves validation logic to its own view to be shared on index and options
pages.
10 years ago
lilia 44007ca58f Add rudimentary ui for sending a group update 10 years ago
lilia d119bdff01 restore default avatars 10 years ago
lilia 3d6c251fd1 Group avatars 10 years ago
lilia d52db8fe6f Render group updates
Not pretty, but it works. Also allows for later localization.
Copy/behavior is borrowed from the Android client.

Closes #104
Fixes #65
10 years ago
lilia 0ea176dfa0 Don't require a conversation name
Just display a sensible default in the frontend if it's unset.
For private conversations this should be the phone number, for
groups, the list of numbers.
10 years ago
Dave Sescleifer 441962abc6 Fixed date format 10 years ago
lilia ccc98d2f3d Fixup delivery receipts
Uses app-level timestamps for outgoing messages.
Adds timestamp property to the outgoing jsonData.
Triggers a runtime event to notify frontend on delivery receipts.
Renders delivered messages with a 'delivered' class.
10 years ago
lilia 3795ea5070 Fix message view using the wrong attribute 10 years ago
lilia cfd4ccc803 Move index querying logic to /models 10 years ago
lilia 006653ed8e DB/Index Redux
This change removes the timestamp field from messages and conversations
in favor of multiple semantically named timestamp fields: sent_at,
received_at on messages; active_at on conversations. This requires/lets
us rethink and improve our indexing scheme thusly:

The inbox index on conversations will order entries by the
conversation.active_at property, which should only appear on
conversations destined for the inbox.

The receipt index will use the message.sent_at property, for effecient
lookup of outgoing messages by timestamp, for use in processing delivery
receipts.

The group index on conversation.members is multi-entry, meaning that
looking up any phone number in this index will efficiently yield all
groups the number belongs to.

The conversation index lets us scan messages in a single conversation,
in the order they were received (or the reverse order). It is a compound
index on [conversationId, received_at].
10 years ago
lilia 5762e59c41 DRY up registration event callbacks
This was just a special case of the extension.on/trigger interface.
10 years ago
lilia e68720f07f Frontend support for ReplayableErrors
Eventually we'll store errors on the message model, and this change will
let us render and process them.
10 years ago
lilia 8c93101989 Don't store conversationType on messages
This was used to conditionally render messages in the group style, but
it's actually unnecessary. We can render the same markup in both cases
and change the appearance with css.
10 years ago
lilia 8257fa7478 Add support for deleting a conversation
Note that the conversation record is not actually destroyed,
merely marked inactive, preserving the contact name, photo,
etc...
11 years ago
lilia ccbe837ca2 Rebind events when opening a previously opened conversation 11 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 bf22da209f Fix tests 11 years ago
lilia d1c5b6da7a Get rid of Layout global
Instead, trigger and listen for events on the conversation collection
object.
11 years ago
lilia a835887459 Fix scroll when re-opening a conversation 11 years ago
lilia fd3a72d435 Destroy all globals
Well, not *all* globals..
11 years ago
lilia c0681beca7 Consolidate message callbacks
Register the runtime callback at the top level view rather than having
each conversation view register independently.
Also refactors Layout into InboxView.
11 years ago
lilia 470346c9c4 Save incoming messages and pass to frontend asynchronously
After a message is saved asynchronsly, fire an event and pass the
message attributes to frontend listeners via the chrome-runtime API.

This behavior is similar to the 'storage' event fired by localStorage.
11 years ago
lilia ced295a630 Move message and conversation storage to IndexedDB
Getting up and running with IndexedDB was pretty easy, thanks to
backbone. The tricky part was making reads and writes asynchronous.
In that process I did some refactoring on Whisper.Threads, which
has been renamed Conversations for consistency with the view names.

This change also adds the unlimitedStorage permission.
11 years ago
lilia b9859ad9d4 Add some license headers 11 years ago
lilia 28290477f4 Nicer timestamps with momentjs
This dependency may be a little heavy for our current use case, but we can
roll with it for now and find something slimmer if it turns out yagni.

Closes #77
Closes #40
11 years ago
lilia 0956d328da Fixes #71 Autoscroll
Conversation view autoscroll triggers on dom change, not storage change,
ensuring that we don't scroll before the new element is inserted.
11 years ago
lilia aa937ae1d1 Add attachment inputs to new conversation form
Fixes reference error to 'map' on undefined attachments list.
11 years ago
lilia 987744cd79 Default avatars
Someday you'll be able to edit your avatar. Until then, put a bird on
it.
11 years ago
lilia 229007040c Basic frontend support for image attachments 11 years ago
lilia d362d0d978 Autoscroll conversation views
Scroll to the bottom (most recent) message in the conversation when it
is opened, when we send a message, and when we receive a message.
11 years ago
lilia d67b723f4f Highlight the selected thread 11 years ago
lilia 19dac1f3df Decorate incoming group messages
with numbers and image placeholders, so you know who's saying what.
11 years ago
lilia 78166365c7 Fix new message number validation 11 years ago
lilia 6e2a85ccf1 wip new message phone number validation 11 years ago
lilia 4f21bbd21f Use textsecure.messaging to create groups
Not textsecure.storage. Sigh. Also accomodate the fact that
the group id is not returned directly, but rather at the end
of a promise chain.
11 years ago
lilia 43f4f6cf99 Open a group's view after it's created 11 years ago
lilia 01f9fc1f17 More frontend groups fixes 11 years ago
lilia dc41ebf701 Small frontend fixes for the new group view 11 years ago
lilia 81e4af5827 Move phonenumbery utils to libphonenumber object
Slowly whittling away at helpers.js...
11 years ago
lilia 0f4b53c176 Update records list in BBLocalStorage on fetch
Previously, would only update the known messages.
11 years ago
lilia 2288f8adc1 Fix new group ui not showing 11 years ago
lilia ef066ea9d2 Make conversations open when they are created 11 years ago
lilia 230d24a69e Views already have a #remove() 11 years ago
lilia db86abdf70 Add list view tests
Also,
 * moved fetch out of the list view
 * removed unused #last() function
 * put test setup lines in their own tiny file.
 * added data-cover to view script tags for code coveage reports.
11 years ago
lilia ad7456b367 Refactor away this poorly named and overloaded file 11 years ago
lilia b9640a54bd Move new convo stuff to its own file 11 years ago
lilia 9af18ce6ae Encapsulate page layout js
The layout class is the only class that should have knowledge of
page-level constant markup, such as #gutter and #contacts, and
should be pretty much the only place we find elements by id (with
the exception of template elements).

This change removes references to #gutter from views. Rather than
hardcoding assumptions about page layout, view elements should
ask the layout to insert themselves into the main content area by
calling Whisper.Layout.setContent.
11 years ago
lilia 5ddcc516e4 remove extra insertion, it's already happening 11 years ago
lilia 2f0b0f7a1b Get overflow scrolls working
Had to resort to a resize event handler.
A bit slow at times, but it works.
11 years ago
lilia 546cdf82cb Fix some markup issues
* Remove spurious search div
* Fix nested uls
* Use class name selected, not closed (the inverse)
* Restor nacl div
11 years ago
lilia c2beda8e40 Get single recipient message composition working again 11 years ago
lilia c034ac8267 Refactor components for the main content section
Each conversation views now manages its own separate elements
rather than all binding to a shared #conversation element, and
similarly for message composition ui.

Also includes the beginnings of group creation UI (not working yet),
featuring bootstrap-tagsinput field for entering group recipients
11 years ago
lilia 5f74a60364 Format thread timestamps 11 years ago
lilia 44f272a181 Get messages sending with new ui
Also convert index.html to 4-space indentation.
11 years ago
lilia 95c31629b7 get frontend rendering with new markup/css 11 years ago
lilia 850a91c77d Fix message sending 11 years ago
lilia 0741c74618 Don't recreate views unnecessarily
Let ConversationListItemView save a reference to its corresponding
ConversationView. This lets it render or delegate/undelegate events
when opening and closing a conversation.

Similarly for ConversationView itself, which contains a MessageListView.
11 years ago
lilia 9d0be46a53 Close an open conversation before opening another 11 years ago
lilia bbb5d56516 Don't reopen a currently selected conversation 11 years ago
lilia 98cfc1b701 Remove old convo compose view 11 years ago
lilia 511b121a2f Refactor conversation view into two classes
One that resides in the left hand column as a list item, and another
which displays in the main column and handles ui events therein.
11 years ago
lilia 6ff6ef07a9 Parse the template before binding render to an event 11 years ago
lilia d615a5a18b Let list view changes the color of selected conversations 11 years ago
lilia dc957415c2 Cull dead code
Most of this no longer needed because of templating and list views.
11 years ago
lilia 9082781e09 Make header and footer/form work without overflowing 11 years ago
lilia def32f42d4 New layout/design
Two column layout and style tweaks. Templatized conversation views.
Generalized list view.
11 years ago
lilia 7e20838128 Rename file 11 years ago
lilia 4724c96ecb Use $.find so these locals can go away 11 years ago
lilia 2e3d89ef78 Use mustache template for message rendering 11 years ago
lilia 25fecc949e Condense some code using Backbone.View's event framework 11 years ago