Commit graph

64 commits

Author SHA1 Message Date
lilia
fd3a72d435 Destroy all globals
Well, not *all* globals..
2014-11-24 19:25:03 -08:00
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.
2014-11-24 19:25:03 -08:00
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.
2014-11-24 19:25:03 -08:00
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.
2014-11-24 19:25:03 -08:00
lilia
b9859ad9d4 Add some license headers 2014-11-13 15:53:57 -08:00
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
2014-11-12 11:45:58 -08:00
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.
2014-11-10 23:19:03 -08:00
lilia
aa937ae1d1 Add attachment inputs to new conversation form
Fixes reference error to 'map' on undefined attachments list.
2014-11-03 17:51:57 -08:00
lilia
987744cd79 Default avatars
Someday you'll be able to edit your avatar. Until then, put a bird on
it.
2014-10-29 16:05:51 -07:00
lilia
229007040c Basic frontend support for image attachments 2014-10-24 18:53:55 -07:00
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.
2014-10-24 14:49:42 -07:00
lilia
d67b723f4f Highlight the selected thread 2014-10-22 17:26:37 -07:00
lilia
19dac1f3df Decorate incoming group messages
with numbers and image placeholders, so you know who's saying what.
2014-10-22 16:30:27 -07:00
lilia
78166365c7 Fix new message number validation 2014-10-22 16:07:16 -07:00
lilia
6e2a85ccf1 wip new message phone number validation 2014-10-22 12:05:33 -07:00
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.
2014-10-16 14:15:13 -07:00
lilia
43f4f6cf99 Open a group's view after it's created 2014-10-14 21:35:40 -07:00
lilia
01f9fc1f17 More frontend groups fixes 2014-10-14 19:06:35 -07:00
lilia
dc41ebf701 Small frontend fixes for the new group view 2014-10-14 15:47:51 -07:00
lilia
81e4af5827 Move phonenumbery utils to libphonenumber object
Slowly whittling away at helpers.js...
2014-10-13 22:49:39 -07:00
lilia
0f4b53c176 Update records list in BBLocalStorage on fetch
Previously, would only update the known messages.
2014-10-09 20:08:28 -07:00
lilia
2288f8adc1 Fix new group ui not showing 2014-10-09 19:02:52 -07:00
lilia
ef066ea9d2 Make conversations open when they are created 2014-09-04 00:21:18 -07:00
lilia
230d24a69e Views already have a #remove() 2014-09-04 00:21:02 -07:00
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.
2014-09-04 00:18:15 -07:00
lilia
ad7456b367 Refactor away this poorly named and overloaded file 2014-08-31 18:18:13 -07:00
lilia
b9640a54bd Move new convo stuff to its own file 2014-08-31 18:02:39 -07:00
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.
2014-08-31 17:46:01 -07:00
lilia
5ddcc516e4 remove extra insertion, it's already happening 2014-08-25 19:01:18 -07:00
lilia
2f0b0f7a1b Get overflow scrolls working
Had to resort to a resize event handler.
A bit slow at times, but it works.
2014-08-25 19:01:13 -07:00
lilia
546cdf82cb Fix some markup issues
* Remove spurious search div
* Fix nested uls
* Use class name selected, not closed (the inverse)
* Restor nacl div
2014-08-25 18:59:22 -07:00
lilia
c2beda8e40 Get single recipient message composition working again 2014-08-25 18:55:51 -07:00
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
2014-08-25 18:54:55 -07:00
lilia
5f74a60364 Format thread timestamps 2014-08-25 18:48:12 -07:00
lilia
44f272a181 Get messages sending with new ui
Also convert index.html to 4-space indentation.
2014-07-27 15:04:12 -10:00
lilia
95c31629b7 get frontend rendering with new markup/css 2014-07-27 12:16:58 -10:00
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