Commit graph

128 commits

Author SHA1 Message Date
lilia
850a91c77d Fix message sending 2014-07-27 11:35:49 -10:00
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.
2014-07-27 11:35:49 -10:00
lilia
9d0be46a53 Close an open conversation before opening another 2014-07-27 11:35:49 -10:00
lilia
bbb5d56516 Don't reopen a currently selected conversation 2014-07-27 11:35:49 -10:00
lilia
98cfc1b701 Remove old convo compose view 2014-07-27 11:35:49 -10:00
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.
2014-07-27 11:35:49 -10:00
lilia
6ff6ef07a9 Parse the template before binding render to an event 2014-07-27 11:35:49 -10:00
lilia
d615a5a18b Let list view changes the color of selected conversations 2014-07-27 11:35:49 -10:00
lilia
dc957415c2 Cull dead code
Most of this no longer needed because of templating and list views.
2014-07-27 11:35:49 -10:00
lilia
9082781e09 Make header and footer/form work without overflowing 2014-07-27 11:35:49 -10:00
lilia
def32f42d4 New layout/design
Two column layout and style tweaks. Templatized conversation views.
Generalized list view.
2014-07-27 11:35:48 -10:00
lilia
7e20838128 Rename file 2014-07-27 11:35:48 -10:00
lilia
4724c96ecb Use $.find so these locals can go away 2014-07-27 11:35:48 -10:00
lilia
2e3d89ef78 Use mustache template for message rendering 2014-07-27 11:35:48 -10:00
lilia
25fecc949e Condense some code using Backbone.View's event framework 2014-07-27 11:35:48 -10:00
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
2014-07-27 11:35:48 -10:00
lilia
ebf1b3352f Use separate message collections for each thread to facilitate lookup and lazy loading 2014-07-27 11:35:48 -10:00
Marco
13a9329bcf improved number validation (based on google's libphonenumber) 2014-06-29 16:39:05 -07:00
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.
2014-06-07 16:31:40 -07:00
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.
2014-06-03 19:57:03 -07:00
Matt Corallo
d0fd3e94d8 sendMessage refactor, initial group stuff (breaks message storage) 2014-06-03 15:28:30 -04:00
Matt Corallo
1724d122d3 More typos from me being too tired 2014-05-28 04:33:01 +02:00
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.
2014-05-26 15:33:45 -07:00
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.
2014-05-22 21:59:34 -07:00
Matt Corallo
ee2f43aba4 Fix, display (image) attachments 2014-05-19 03:07:01 -04:00
lilia
3bd559bbaa DRY up PushMessageContentProtobuf construction
Messages now know how to protobuf-ify themselves.
2014-05-18 14:33:18 -07:00
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.
2014-05-18 13:49:11 -07:00
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.
2014-05-17 20:26:50 -07:00