Commit Graph

56 Commits (aa55b6a538bc210fe5a956dc212dc04f2d883101)

Author SHA1 Message Date
Ikarulus 53cd3af78b Added a dark theme
I added a dark theme in order to solve #328.
This may fix #328 at least partially.
8 years ago
lilia 224afdd063 Fix tests 9 years ago
2-4601 669338c717 i18n 'Theme'
// FREEBIE
9 years ago
lilia b0c59233f3 Add test fixtures
Test page loads fixtures and renders the inbox view. This may be useful
for smoke testing style changes or generating screenshots with
pseudo-realistic data.

Includes a couple small changes to get rendering working outside the
app.
9 years ago
lilia 7e0df07e88 Fix tests
// FREEBIE
9 years ago
lilia b1d370755a Rename AxolotlStore
// FREEBIE
9 years ago
lilia 9aa429e18a Add frontend support for expiring releases
When a release expires, it gets a persistent banner notification to
upgrade, and an ephemeral toast warning when trying to send a message.

// FREEBIE
9 years ago
lilia 37fb2580bc Fix tests
// FREEBIE
9 years ago
Lorenz Hübschle-Schneider e876d8f6ed Display relative timestamps in conversation list
This mimicks Signal-Android's relative timestamps.
Previously, only the date was displayed.

Fixes #284
9 years ago
lilia a258f1a66b Refactor number parsing and validation
Refactor libphonenumber.validateNumber into libphonenumber.parseNumber,
which encapsulates the try-catch pattern used in number parsing and
returns an object of info about the input number rather tha throwing
since we expect to get some invalid number inputs the user is typing.

In the conversation model,
  * Separate phone number validation from search token updating.
  * Perform token update before save if the number was valid.
  * Stop storing unneeded number variants as conversation properties.

// FREEBIE
9 years ago
lilia 3d98b54027 Create contact from number with common punctuation
The 'Create new contact' option should now appear for numbers including
parens and other common punctuation.

// FREEBIE
9 years ago
lilia 038e263023 Fix the build
1. Update chrome version because v40 fails to clear the session store
2. Add message view to test page and fix bad reference to chrome
3. Update the message view template in tests with new timestmap markup

// FREEBIE
10 years ago
lilia 87ce3241c8 Remove script-tag for nonexistant test
// FREEBIE
10 years ago
lilia 78d7296f84 Fix tests
// FREEBIE
10 years ago
lilia f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
10 years ago
lilia 029c9754f0 Fix tests 10 years ago
lilia 96eafc7750 Integrate libaxolotl async storage changes
* Session records are now opaque strings, so treat them that way:
  - no more cross checking identity key and session records
  - Move hasOpenSession to axolotl wrapper
  - Remote registration ids must be fetched async'ly via protocol wrapper
* Implement async AxolotlStore using textsecure.storage
* Add some db stores and move prekeys and signed keys to indexeddb
* Add storage tests
* Rename identityKey storage key from libaxolotl25519KeyidentityKey to
  simply identityKey, since it's no longer hardcoded in libaxolotl
* Rework registration and key-generation, keeping logic in libtextsecure
  and rendering in options.js.
* Remove key_worker since workers are handled at the libaxolotl level
  now
10 years ago
lilia 5a46300581 Reorder database.js include in test 10 years ago
lilia dc1b09f59d Auto-link urls in message bodies
And watch out for xss.

Closes #187
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 4cefd17ac6 Remove unused view 10 years ago
lilia e96aa2f06e Remove obsolete script tags
For the recently deleted notifications.js
10 years ago
lilia 711e211e20 Remove bootstrap tagsinput 10 years ago
lilia 55802f2087 Remove obsolete note on test page
Actually this page totally works from file:// now.
10 years ago
Matt Corallo e7f3e52b6c Remove NaCL! 10 years ago
Matt Corallo 5785f4033c Compile curve25519/webcrypto into libtextsecure.js 10 years ago
Matt Corallo 899d756469 Split tests between libtextsecure and main 10 years ago
Matt Corallo 8ad1a38b5b Move js files around for libtextsecure split 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
Matt Corallo 2c781e5b62 s/\t/ /g in test/index.html 10 years ago
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.
10 years ago
lilia 7b23e24b71 Add stringview license info and script tags
Closes #94
10 years ago
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.
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 94634fc77a Remove nativeclient from test page
Native client won't work on Sauce. Removing for now. TODO: find a
way to gracefully disable native client in the Sauce environment.
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 18378d8097 Fold nacl-common into components 11 years ago
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.
11 years ago
lilia 4518d03f43 Move protocol test to end of suite and extend timeout
The keygen test works without native client, but it takes a loooooong
tiiiiiiime.
11 years ago
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.
11 years ago
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.
11 years ago
lilia 3d27c98845 Remove stray curve25519.js include 11 years ago
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.
11 years ago
lilia df0e52a893 Split crypto_test into crypto, protocol and helpers tests 11 years ago
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.
11 years ago
lilia f7d92ccb5b Bowerize backbone.localstorage 11 years ago
lilia 6e86a2b7cf Switch libphonenumber to bower 11 years ago
lilia 6b034e951a Make the concat list explicit
Since I decided to preen mocha and chai, we can no longer generate the
concat file list from the preen config. We must instead explicitly list
the modules we want to concatenate. I placed this config in bower.json
so that most of the time, we won't need to change the Gruntfile.

Also added a concatenation task for test page dependencies.
11 years ago