Commit graph

406 commits

Author SHA1 Message Date
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.
2014-12-18 20:07:45 -08:00
lilia
4a401f07f3 Rewrite ReplayableErrors
ReplayableErrors make it easy for the frontend to handle identity key
errors by wrapping the necessary steps into one convenient little
replay() callback function.

The frontend remains agnostic to what those steps are. It just calls
replay() once the user has acknowledged the key change.

The protocol layer is responsible for registering the callbacks needed
by the IncomingIdentityKeyError and OutgoingIdentityKeyError.
2014-12-18 20:00:14 -08:00
lilia
14c53ff710 Support for lower-level queries on indexedDB
superfeedr has done a nice job with this backbone -> indexedDB adapter,
but their query interface is somewhat limited. This commit adds an
alternate interface that lets us specify the index and cursor bounds we
want. This interface requires deeper knowledge of indexedDB indices, but
is more powerful overall.
2014-12-18 19:45:53 -08:00
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.
2014-12-18 19:45:53 -08:00
lilia
2209407d5e Keepalive endpoint 2014-12-10 23:48:26 -08:00
lilia
4f97f8c1e4 Incoming request bodies are no longer base64
Since the socket is not a text-based transport, there's no need to
base64-encode the IncomingPushMessageSignal.
2014-12-10 23:48:23 -08:00
lilia
2ba88bd13a Shorten keep alive interval. Closes #97 2014-12-06 23:42:51 -08:00
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...
2014-12-03 01:37:06 -08:00
lilia
7b23e24b71 Add stringview license info and script tags
Closes #94
2014-12-03 01:36:10 -08:00
Daniel Reichert
db5683a69d Move Base64 functions to their own file
Remove Base64 string functions from helpers.js

Rename Base64 string functions

Removed unused functions from stringview.js
2014-12-03 00:42:55 -08:00
lilia
ee0d7edc0b WebSocket-Resources / websocket refactor
This commit provides the javascript complement to
[WebSocket-Resources](https://github.com/WhisperSystems/WebSocket-Resources),
allowing us to use a bi-directional request-response framework over
websockets.

See websocket-resources.js and websocket-resources_test.js
for usage details.

Along the way I also factored the websocket keepalive and reconnect
logic into its own file/wrapper object.
2014-11-29 11:43:30 -08:00
lilia
ccbe837ca2 Rebind events when opening a previously opened conversation 2014-11-25 13:54:44 -08:00
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.
2014-11-25 12:42:44 -08:00
lilia
bf22da209f Fix tests 2014-11-24 19:25:03 -08:00
lilia
d1c5b6da7a Get rid of Layout global
Instead, trigger and listen for events on the conversation collection
object.
2014-11-24 19:25:03 -08:00
lilia
a835887459 Fix scroll when re-opening a conversation 2014-11-24 19:25:03 -08:00
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
7f04439b37 New websocket protocol 2014-11-14 17:48:57 -08:00
lilia
9364cee578 Misc cleanup threads 2014-11-13 15:53:57 -08:00
lilia
b9859ad9d4 Add some license headers 2014-11-13 15:53:57 -08:00
lilia
735737f0bc Merge Whisper.Messages into Whisper Threads
Eliminates the global Whisper.Messages object and consolidates shared
send/receive logic in Whisper.Threads.

To the latter end, note that the decrypted array buffer on an attachment
pointer is now named data instead of decrypted, in order to match the
format of outgoing attachments presented by
FileReader.readAsArrayBuffers and let us use the same handler to base64
encode them.
2014-11-13 15:53:56 -08:00
lilia
5a0e199fc5 Namespace registration helpers 2014-11-13 15:53:56 -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
Sumit Bindal
d537d6a91f Fixing lint errors
Fixing JSLint Problems
2014-11-11 17:59:52 -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
13446e9c17 "Fix dirty hack" (runtime.reload) in chromium.js
Runtime reload is overkill and causes a jarring ux. Instead, send and
receive messages across the runtime. Also, if we need to jump between
the main ui and options pages, simply navigate within the current tab
rather than spawning a new one.
2014-11-10 16:24:01 -08:00
lilia
4119c13ba2 Registration ux tweaks 2014-11-10 16:24:00 -08:00
lilia
18378d8097 Fold nacl-common into components 2014-11-10 01:35:15 -08:00
lilia
1ad898a62e Simplify webcrypto type conversion
Previously we'd get a WordArray and convert to string before converting
to array buffer. Instead, go directly to array buffer.
2014-11-09 21:52:36 -08:00
lilia
e190582d9e Build CryptoJS components into webcrypto.js
We only depend on cryptojs for this webcrypto polyfill, so let Grunt
concatenate them into one file.

The reference in the getString helper isn't needed since we use the
built in string converters on CryptoJS's word arrays.
2014-11-09 21:52:33 -08:00
lilia
c69c05c15d Remove obsolete argument 2014-11-09 18:58:05 -08:00
lilia
0ff3d438be Update libphonenumber
```
bower install
cd components/libphonenumber-api
./build.sh
grunt
```
Closes #54
2014-11-09 18:28:25 -08:00
lilia
2f58ea5f3a Fixup curve25519 module
Rename methods on the curve25519 interface to be a bit more high level.
Cleanup emscripten wrapper class, wrap long lines and such. Also add a
grunt task alias for building the emscripten compiled curve
implementation.
2014-11-09 15:30:37 -08:00
lilia
a1a528ccdd Finish abstracting native client
Firstly, don't initialize textsecure.nativclient unless the browser
supports it. The mimetype-check trick is hewn from nacl-common.js.

Secondly, nativeclient crypto functions will all automatically wait for
the module to load before sending messages, so we needn't register any
onload callbacks outside nativeclient.js. (Previously, if you wanted to
do crypto with native client, you would have to register a call back and
wait for the module to load.) Now that the native client crypto is
encapsulated behind a nice interface, it can handle all that
onload-callback jazz internally: if the module isn't loaded when you
call a nativeclient function, return a promise that waits for the load
callback, and eventually resolves with the result of the requested
command. This removes the need for textsecure.registerOnLoadCallback.

Finally, although native client has its quirks, it's significantly
faster than the alternative (emscripten compiled js), so this commit
also lets the crypto backend use native client opportunistically, if
it's available, falling back to js if not, which should make us
compatible with older versions of chrome and chromium.
2014-11-09 15:23:23 -08:00
lilia
8d323a4d71 Hooray for options 2014-11-08 11:38:32 -08:00
lilia
59f22ecb26 Clean up after crazy emscripten fueled rager
Man you shoulda been there. Code was compiling all over the damn place.
It was wild.

Seriously though. Ignore that intermediate compiled file. What happens
in build stays in build.
2014-11-08 11:03:24 -08:00
lilia
b4f4f87a7c Add emscripten-compiled curve25519 module
Build with `grunt compile && grunt concat:curve25519` after installing
emscripten.

Enable by either (a) not loading nativeclient.js or (b) setting
`textsecure.NATIVE_CLIENT = false` before loading nativeclient.js.
2014-11-08 10:56:30 -08:00
lilia
74bfc9d04e Wrap some long lines 2014-11-06 18:13:54 -08:00
lilia
0a3c03025b Abstract nativeclient callback logic
The nativeclient.js module overrides
window.textsecure.registerOnLoadFunction with its own version. Otherwise
helpers will define a trivial placeholder for same.

The flag textsecure.NATIVE_CLIENT can be set anywhere ahead of
nativeclient.js, but is only acted on in nativeclient.js,
and crypto.js.
2014-11-06 17:58:48 -08:00
lilia
69c52d51b3 Abstract out curve25519 tests
Also rename the internal variable in crypto.js to be a little more
explicit about which curve we're dealing with.
2014-11-06 14:54:36 -08:00
lilia
79925fd227 Removed now unused copy of getRandomBytes 2014-11-06 04:42:49 -08:00
lilia
9f676af9bb Refactor crypto.js and native client interface
NB: this diff is best viewed with --ignore-whitespace

Distills crypto.js down to the hard cryptoey bones. It pulls from
webcrypto for aes and hmac, and from native client for curve25519 stuff
or potentially another object implementing the handful of needed
curve25519 functions.

Everything else formerly known as crypto, including session storage and
management, axolotl, etc.. is now protocol.js. The separation is not
quite perfect, but it's a big step.

nativeclient.js now enables talking to the native client module through
a high level interface as well as registering callbacks that will be
executed once the module is loaded. And it has tests!

Finally, this commit removes all references to the "testing_only"
object, preferring to run tests on textsecure.crypto instead.
2014-11-06 04:33:43 -08:00
lilia
cd4b98d426 Remove 1mod8
27b5bf54cc
2014-11-06 00:49:55 -08:00
lilia
db76c7e164 Initialize session.currentRatchet.previousCounter 2014-11-03 19:01:18 -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
f7d92ccb5b Bowerize backbone.localstorage 2014-11-03 17:27:44 -08:00
lilia
51de1d46c8 Update ByteBuffer.js
Such update. Very versioned, wow.
2014-11-03 15:29:56 -08:00
Arlo Breault
bc5dea62c3 Use FileReader to base64 encode attachments
* Implements #82
2014-11-03 15:01:52 -08:00
lilia
6e3014895b Fix cryptojs hmac implementation
Apparently the bowerized version of cryptojs's WordArray.create doesn't
handle arraybuffers correctly.
2014-10-31 21:10:02 -07:00
lilia
6e86a2b7cf Switch libphonenumber to bower 2014-10-31 20:59:30 -07:00
lilia
508c59e05c Rename bower_components
To components. Because tab-completion works better when there aren't two
things starting with bower, and shorter names are nicer to deal with in
general.
2014-10-30 16:53:08 -07:00
lilia
ca7ba43b13 Fix overly hidden elements on registration page
Latest bootstrap css is really aggressive about hiding things.
2014-10-30 14:20:42 -07:00
lilia
800e5ab703 Pass protobuf attachment ids as strings
Latest protobuf.js requires that we pass in the sign value when making
longs from strings, ex: dcodeIO.Long.fromString(id, true);

However, it does the string->long conversion automatically if its given
a string for a fixed64 field, so we can pass our string ids right in!
ftw
2014-10-29 23:18:29 -07:00
lilia
9c568ed0b8 Don't warn on missing message bodies
A message can be blank if it has an attachment
2014-10-29 20:50:51 -07:00
lilia
df0eaf622a Clean up test files
Moved all test code into /test. Renamed test.js to crypto_test.js.
(Let's try to keep test files topical.) Merged test_views.html and
test.html into a single test/index.html.

Todo: use Grunt to generate test/index.html from index.html and files
found in /test. Also, write more tests.
2014-10-29 16:05:51 -07: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
2a7d3996bb Remove unused popup.html
And popup.js is now index.js, illustrating its importance as the titular
javascript file.
2014-10-28 22:47:48 -07:00
lilia
1c76c0b546 Move storage objects to their own files
Greatly reduce the size of the ignominiously named helpers.js.
2014-10-28 22:47:48 -07:00
lilia
b92c5bb84e Unused function 2014-10-28 19:15:01 -07:00
lilia
ddd6f1a944 remove another unused function 2014-10-27 02:09:46 -07:00
lilia
80e3fadcb1 Remove unused *MACWithVersionByte functions 2014-10-26 21:27:08 -07:00
lilia
39505c81b1 Finish up webcrypto integration, Fixes #72
We now correctly and opportunistically use the webcrypto API if
available, polyfilling if it's not detected. This change also includes a
layer of abstraction over the webcrypto interface so we no longer have
to deal with key-imports or algorithm names all over the place. Since we
no longer support AES-CTR, code outside this file can simply call
`textsecure.subtle.<encrypt|decrypt|sign>(key, data [, iv])`.
2014-10-26 20:29:10 -07:00
lilia
244e051fc3 Add importKey to webcrypto.js 2014-10-26 15:54:19 -07:00
Matt Corallo
37ef492642 Remove now-broken axolotl test 2014-10-26 03:44:55 -07:00
Matt Corallo
2e7b5b46e3 Remove AES-CTR entirely 2014-10-26 03:41:11 -07:00
Matt Corallo
da0c63fb1b Add (untested) AES-CBC switch from v3 (fs loss resulted in old tested version being lost) 2014-10-26 03:40:00 -07:00
Matt Corallo
3a39602385 Fix borked spacing in webcrypto.js 2014-10-26 03:23:34 -07:00
Matt Corallo
73f867f7de rm useless GPL, license testvectors under X11 (ie 3-c MIT + advertising provision) 2014-10-26 02:59:59 -07:00
Matt Corallo
68a42a6ae7 Give up on webcrypto :( 2014-10-26 02:46:13 -07:00
lilia
21225b2074 Save outgoing attachments 2014-10-26 00:30:20 -07:00
lilia
b69db59ad4 Fix buffer concatenation
TypedArray.prototype.set doesn't handle ArrayBuffers correctly (it
writes all zeros). Instead, wrap each ArrayBuffer in a typed array
for concatenation.
2014-10-25 23:07:14 -07:00
lilia
e07759a93c Fix CBC encryption, test 2014-10-25 20:45:21 -07:00
lilia
e35148add8 No, jQuery, don't processData!
processData (default: true)
Type: Boolean
By default, data passed in to the data option as an object (technically,
anything other than a string) will be processed and transformed into a
query string, fitting to the default content-type
"application/x-www-form-urlencoded". If you want to send a DOMDocument,
or other non-processed data, set this option to false.

https://api.jquery.com/jQuery.ajax/
2014-10-25 19:48:54 -07:00
lilia
211129475c Fix attachment ids
Parse attachment ids out of the attachment pointer url and return them
as strings because the copy parsed by JSON suffers a loss of precision.
Convert them to and from the format expected by the protobuf using
facilities from decodeIO.Long.
2014-10-25 18:12:20 -07:00
lilia
eebb14599f Well that's handy 2014-10-25 18:12:07 -07:00
lilia
674b173c59 Add support for cbc encryption 2014-10-24 19:09:58 -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
4675cdf3f2 Webcrypto won't go down without a fight
Turns out that assigning a new object to window.crypto.subtle
is not so easy. That's probably a good thing.
2014-10-23 21:30:36 -07:00
lilia
a4b25f7df1 Disable the real webcrypto
Sadly, we are not quite compliant with the WC3 webcrypto spec
due to our insistance on passing around key data in plain old
ArrayBuffers.

Also converted whitespace.
2014-10-23 21:15:27 -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
838283f28b Send acks instead of closing and opening the socket
Hopefully the real fix for #67 until we get protocol-level pings from
the wc3 api.
2014-10-22 12:38:30 -07:00
lilia
6e2a85ccf1 wip new message phone number validation 2014-10-22 12:05:33 -07:00
lilia
e831c649bd Require a mandatory websocket reset once a minute
Compensate for the lack of keepalives in the WebSocket API.

Fixes #67
2014-10-21 19:57:53 -07:00
lilia
a3bf40e852 Shorten websocket time out. Fixes #67 2014-10-21 14:26:14 -07:00
lilia
3a00e49791 Open the most recent conversation on load 2014-10-20 17:49:41 -07:00
lilia
1023ea1732 Refactor textsecure.protos -> textsecure.protobuf
DRY up protobuf declarations and move to a slightly briefer naming
convention.

Also dropped some ArrayBuffer -> string conversions as
ProtoBuf.js handles ArrayBuffers just fine, and in fact, more
efficiently than strings.

Finally, dropped the btoa() wrappers, because that incurs an extra
string -> string conversion before the protobuf's internal string ->
array buffer conversion. In lieu of btoa, we can simply pass in the
optional string encoding argument to the protobuf's decode method,
which in these cases should be 'binary'.

Related: #17
2014-10-20 15:11:16 -07:00
lilia
03cc667e48 Standardize some whitespace
The preferred style is 4 spaces.
2014-10-20 15:09:36 -07:00
Arnaud Benard
e568e2c528 Fixes #61 - Order by timestamps with tests 2014-10-20 02:07:46 -07:00
lilia
cc5327dbc9 Fix group loop
All the group messages were being sent to the last recipient in the
list, due to the persistence of `var number` in later loops and async
calls. An easy mistake to make, when you use for instead of each.
2014-10-18 15:00:43 -07:00
lilia
ac5c359053 Fix strange loop in sendMessageProto
Don't declare a new `var i`  within the scope of an existing `var i`.

Fixes #63
2014-10-17 16:57:33 -07:00
lilia
cd55c0a1f1 Put groupid back in id field also 2014-10-17 14:32:37 -07:00
lilia
0bd5f3e3c2 If for some reason a group has no name, provide a default 2014-10-17 13:25:39 -07:00
lilia
0036e4ef74 Store group ids as strings 2014-10-17 13:11:08 -07:00
lilia
8288e298fc Group ids should be converted to ArrayBuffers for transport 2014-10-17 12:52:46 -07:00
lilia
143254cec8 Group ids are stored in groupId 2014-10-16 17:50:36 -07:00
lilia
bbe57ef0bf Stringify incoming group ids
Otherwise when we try to make their local storage keys they look like:
"egroupByteBuffer(offset=4,markedOffset=-1,length=28,capacity=112)"
2014-10-16 17:39:45 -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
fa4c385598 Make initial timestamp on a thread match the 1st message 2014-10-16 14:13:03 -07:00
lilia
f14cd2eed1 Don't validate presence of thread id
It's undefined until the first save();
2014-10-16 14:11:51 -07:00
lilia
7e9c0e2394 Group ids should be strings (or stringables)
ArrayBuffer was a bad choice.
2014-10-16 13:38:33 -07:00
lilia
6db3eeb52e Convert incoming timestamps into numbers
Fixes #59

protip: don't use << for anything over 2^32. The operands of all bitwise
operators are converted to signed 32-bit integers
2014-10-16 12:32:02 -07:00
lilia
d7edfd4efb Remove reference to undefined function 2014-10-15 18:10:27 -07:00
lilia
43f4f6cf99 Open a group's view after it's created 2014-10-14 21:35:40 -07:00
lilia
320d1f18ae Fix exception when protbuf-encoding groupIds
An exception is thrown when protobuf tries to encode a number as the
group id, which is declared to have type 'bytes'.

Fix by make it an ArrayBuffer instead, and increase the length to 16,
which is what the Android client uses:

c632b32ff8/src/org/thoughtcrime/securesms/database/GroupDatabase.java (L222)
2014-10-14 19:33:33 -07:00
lilia
5b0573293f Fix references to GroupContext Type ENUM values 2014-10-14 19:07:00 -07:00
lilia
01f9fc1f17 More frontend groups fixes 2014-10-14 19:06:35 -07:00
lilia
e89e691957 Fix bug in groupId generation
Previously, if calling createNewGroup with an undefined groupId,
no groupId was generated.

This occurred because no entry for "group" + undefined exists in
localStorage, which caused this code to think undefined was a
valid group id.

Fixed by adding `|| groupId == undefined` to the while clause.
Also decoupled the groupId collision check for clarity.
2014-10-14 15:47:51 -07:00
lilia
dc41ebf701 Small frontend fixes for the new group view 2014-10-14 15:47:51 -07:00
lilia
2bd77693e1 Refactor options page and style using bootstrap 2014-10-14 13:59:43 -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
9fc14cfa30 Remove erroneous comment re: MDN copyright
In fact, the code samples we have copied from MDN are declared to be
public domain (see link below):

  "Code samples added on or after August 20, 2010 are in the public
  domain."

https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses

AFAICT we're using code from this page, last updated 10/4/14:
https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
2014-10-10 17:25:40 -07:00
lilia
75e78caec8 Function-wrap options.js 2014-10-10 16:58:44 -07:00
lilia
683c373943 Relaxes verification code validation
When codes are sent they are formatted as xxx-xxx. Previously when I
would paste these from GVoice they failed validation thanks to the dash
and whatever whitespace I happened to grab.
2014-10-10 16:32:22 -07:00
lilia
27708cd8d7 Switch to staging. -ca is now production 2014-10-10 16:32:15 -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
266600e5ab There's no need to wrap this function inside a function afaict 2014-10-09 18:54:23 -07:00
lilia
ae98b8680f Fix whitespace in popup.js
Our official standard is 4 space indentation.
2014-10-09 18:43:58 -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
8d83a8fb27 This element is constant, so let's bootstrap it 2014-08-25 18:48:12 -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
df95a7f71a Move ui init out of nacl callback and remove some lines that no longer apply 2014-07-27 11:35:49 -10:00