Commit Graph

1260 Commits (41fdcef69503996b1dd1b2fa90eaf129cea23083)

Author SHA1 Message Date
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
lilia 06ff6c3087 Let thread collection double as contacts db
When a thread is 'destroyed' from the UI we delete its messages and mark
the thread as inactive, (in other words, keep it around as contact info).
Additionally, we only load active threads when initializing the UI, and
reactivate threads when new messages are added to them.

Conflicts:
	js/models/messages.js
	js/models/threads.js
	js/views/conversations/show.js
11 years ago
lilia ebf1b3352f Use separate message collections for each thread to facilitate lookup and lazy loading 11 years ago
Marco 13a9329bcf improved number validation (based on google's libphonenumber) 11 years ago
lilia ce3c5eb909 Refactor conversation list view
Pull apart UI classes for displaying and creating threads.
Also get rid of ugly alert popup in favor of Whisper.notify.
11 years ago
lilia a09a4776d3 Fix incoming message display/storage
There were a few problems.

1. The message event was being triggered in background, not popup
2. The initial message/thread fetches from localStorage were mis-ordered
3. The timestamp wasn't being extracted from the right place
4. #3 caused messages to fail validation and not be saved

1-3 are fixed. To address 4 I switched validate() to log a warning
instead of preventing save.
11 years ago
Matt Corallo d0fd3e94d8 sendMessage refactor, initial group stuff (breaks message storage) 11 years ago
Matt Corallo 1724d122d3 More typos from me being too tired 11 years ago
lilia 83508abab8 Thread model and UI improvements
Adds thread model/collection for managing conversation-level state, such
as unreadCounts, group membership, thread order, etc... plus various UI
improvements enabled by thread model, including an improved compose
flow, and thread-destroy button.

Adds Whisper.notify for presenting messages to the user in an orderly
fashion. Currently using a growl-style fade in/out effect.

Also some housekeeping:
Cut up views into separate files.
Partial fix for formatTimestamp.
Tweaked buttons and other styles.
11 years ago
lilia 1e672030de Fix a couple things broken in d9bf0a4
Slight revert from said commit. We really do need the
IncomingPushMessageSignal protobuf at the UI layer, mostly because
it contains the 'source' attribute, without which we don't know
who sent the message.

Also fix a crash when there are no attachments on a message.
11 years ago
Matt Corallo ee2f43aba4 Fix, display (image) attachments 11 years ago
lilia 3bd559bbaa DRY up PushMessageContentProtobuf construction
Messages now know how to protobuf-ify themselves.
11 years ago
lilia 2601c3cc3a Rename some things to be a little more semantic
The 'sender' field actually holds the recipient for outgoing
messages. Rename that field to 'person', indicating the 2nd
party generically.

Also decouples the thread name from thread recipients at the
view layer, in preparation for group support.
11 years ago
lilia b852e68290 Backbone message storage and views
Adds Backbone-based Whisper.Messages model/collection with local storage
extension. Saves sent and received messages in Whisper.Messages instead
of message map. This will assign a unique id to the message and save it
to localStorage.

Adds Backbone-based view to popup.html
  Automatically updates itself when new messages are saved to
  Whisper.Messages db from the background page.

Added some shiny new styles, and started splitting up css into multiple
files for sanity's sake.
11 years ago