Commit Graph

218 Commits

Author SHA1 Message Date
Scott Nonnenberg 334fe32210
Fix electron test race condition with protobuf loading 2018-04-20 15:24:02 -07:00
Scott Nonnenberg 12257e1560
MessageView: Show menu w/ 'reply to message' on triple-dot click 2018-04-20 15:23:55 -07:00
Scott Nonnenberg 26e4e97592
Tighten up CSS
- Remove extra padding at top of Android bubbles, via sibling selector
- Don't include .attachments, .quote-wrapper, .content in bubble unless
  we actually need them. This allows for sibling selectors.
- This is a different technique for adding the ReactWrapperView for
  quotes - it is now appended to the DOM instead of attaching to
  something already in the DOM. This allows us to use .remove(), so it's
  a bit cleaner.
- Users of ReactWrapperView can now specify tagName and className
2018-04-20 15:23:47 -07:00
Scott Nonnenberg 30957341e4
Show three dot icon next to message on hover
But only if it doesn't have an error.

Also: reformatted message template in legacy_templates.js to match what
is in background.html for easier diffing.
2018-04-20 15:23:47 -07:00
Scott Nonnenberg 3bbbf65a6b
Fix iOS: tail, blue partial border, extra attachment space
Turns out that display: inline on the img tag resulted in a mysterious
3px of space added below it.
2018-04-13 18:10:52 -07:00
Scott Nonnenberg 92a89a8e41
Fix MessageView test: p -> div 2018-04-13 18:10:48 -07:00
Scott Nonnenberg 21bf02c94d
Fixed examples in Quote.md, rough Android visuals 2018-04-13 18:05:44 -07:00
Scott Nonnenberg ae043bf239
In iOS theme, join attachment bubble with caption bubble 2018-04-13 18:05:42 -07:00
Scott Nonnenberg 1326b26585
Full styleguide now available via `yarn styleguide`
Due to a number of hacks, the style guide can be used to show Backbone
views. This will allow a smooth path from the old way of doing things to
the new.
2018-04-04 16:08:38 -07:00
Scott Nonnenberg f86a6ef752
Update style of i18n, pull it in via preload instead of .html 2018-04-04 16:03:10 -07:00
colefranz 234411cb29 issue-2023: introduce unit tests for inbox view
There were no unit tests for the file at all so I added some simple ones
mostly focused on my changes.
2018-04-04 15:42:13 -04:00
Vincent 5b5903c70e Fix link to Signal update location
Fixes #2043.
2018-03-23 12:15:52 -07:00
Scott Nonnenberg cea42bde7d
Encryption support for backup and restore
Also moved to the _ prefix in backup.js for all private methods exported
for testing.
2018-03-20 11:53:54 -07:00
Scott Nonnenberg 26c273618a
Refactor: db tasks to database.js, log delete to modules/logs.js 2018-03-14 14:42:15 -07:00
Daniel Gasienica 3df22026ab UX Improvements: Global Menu & Copy Changes (#2078)
- [x] Removed ‘Restart Signal’ global menu item
- [x] Change _Click to create contact…_ to _Start conversation…_
- [x] Move global menu (top-left kebab) into OS menu bar,
      i.e. **Settings** > **Preferences…**
- [x] Add tests for OS menu bar templates
- [x] Fix bug with **Window** menu on macOS when showing setup options
- [x] Use _Title Case_ for all OS menu bar menu items for consistency

commit dedf7c9af0de90980388559659df0d92a77b864c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:53:42 2018 -0500

    Use ‘Title Case’ to be consistent with OS menus

    References:
    - Apple:
        - https://developer.apple.com/macos/human-interface-guidelines/menus/menu-anatomy/#menu-and-menu-item-titles
        - https://developer.apple.com/library/content/documentation/FinalCutProX/Conceptual/FxPlugHIG/TextStyleGuidelines/TextStyleGuidelines.html#//apple_ref/doc/uid/TP40013782-CH6-SW1
    - https://titlecaseconverter.com/

commit 3286da29b334bd4526c587b17707c2f230cec8f5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:36:50 2018 -0500

    Fix bug for macOS ‘Window’ menu with setup options

commit 236a23d1eafe2a16073394a27b9013298b682a25
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:27:46 2018 -0500

    Test menus with included setup options

commit c5d5f5abb8d7f52d6a4aa182a86c92f7ddceade0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:10:27 2018 -0500

    Move settings (‘Preferences’) into OS-level menu

    This reduces our reliance on custom UI until we have more design resources.

commit 027803f8f4983cffa443f0beff1854dcf541689b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:02:56 2018 -0500

    Prepare tests for menu with/without included setup

commit 9e2f006924b85eb249a8a1261c1c4dd1a706afa6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 15:55:46 2018 -0500

    Destructure `includeSetup`

commit 6b2a1eccdf724fd722e58415d2700da73942d9e8
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 15:55:14 2018 -0500

    🔤 `createTemplate` `options`

commit c2fecba34b153fed106f414ed3347d46299f6fe5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:49:55 2018 -0500

    Test menu for Windows and Linux

commit 60281b1af9ad1f022cdbc40711ebd0b688a7355d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:40:39 2018 -0500

    Add `yarn run test-app` command

commit 1a0489919c0a97b03fe88196260fef894fb3d9e4
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:40:29 2018 -0500

    Add test for `SignalMenu.createTemplate` on macOS

commit 9638b86c0f00f231e44562a5aa01626f0e5fdd8b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:34:46 2018 -0500

    Make `createTemplate` pure

    Extracting `options.platform` makes it easier to test without having to
    stub `process.platform`.

commit 9c26404892d7c9a7bd0199a9e8367a165a3b365c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:47:39 2018 -0500

    Extract `locale.load` `appLocale` & `logger` for testability

    This allows us to run this code in a non-Electron environment, e.g. Node.js
    Mocha test suite.

commit 710b22438df25c8d5e8431845a035c55ec8fc0b7
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:46:13 2018 -0500

    🔤 npm scripts

commit 9ae22937fbce078f91443023b560b3c0468c1380
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:45:30 2018 -0500

    Use 2-space indendation for `app` module tests

commit 22c26baf6159bd2e1f5a787c10e2260f09395329
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:22:55 2018 -0500

    Prefer named exports

commit 9c9526195266ac77ac2ca04135a1e675f617dfd2
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:22:46 2018 -0500

    🔤 Organize `require`s

commit 2f144d24d9e9a9ef72fe418996e3c911b304b00a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:13:50 2018 -0500

    Remove existing global hamburger menu

    This will be replaced by a OS-level ‘Preferences’ menu.

commit f5adb374cb742e5f319ececda8ab6d8adee88d7e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 18:40:54 2018 -0500

    Remove ‘Restart Signal’ menu from settings

    Apparently, this is a remnant from the Chrome web application.

commit d7a206bc8e67ef44022085e804ca040ed1b219f7
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 17:16:49 2018 -0500

    Clarify label for starting a new conversation

    When user a enters a number that is not a contact, we prompt them to start a new
    conversation.

commit 715a4064367fb61d85c1a4f9d48261b2ce002435
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 16:46:26 2018 -0500

    Use ‘Enter name or number’ as prompt’

    This follows implementation of Android and recommendation from Alissa.
2018-03-02 15:59:39 -05:00
Scott Nonnenberg 7b49180bc0
Big update to new signal branding (#2018) 2018-01-30 14:22:51 -08:00
Scott Nonnenberg f0aaa7a1c5
Introduce intl-friendly sort order for contact lists (#1900) 2017-12-14 16:30:11 -08:00
Scott Nonnenberg 75cece3358 Improve OS menu (#1563)
* Remove reload options, new file/help menus, tools/log at bottom

* Further menus refactor: install handlers at template creation

* WIP: Further tune menus, add custom about window

* New About window, new help menu items, menu labels now i18n

* Default device name on registration is now computer hostname

The OS of the device makes sense for those of us testing across a lot of
different OSes. And maybe for a user with just one desktop device. But
most users with multiple desktop devices are using the same OS for both.

* About window: Only show window when content is ready

* Fix typo in app/menu.js
2017-10-13 16:49:16 -07:00
Scott Nonnenberg 61a2a1a8f8 Improve fixtures, restore InboxView rendering on the test page (#1562) 2017-10-13 16:48:50 -07:00
Scott Nonnenberg 9db0cb49c4 setTimeout/setImmediate workaround for linux hangs (#1497)
FREEBIE
2017-09-22 11:06:52 -07:00
Scott Nonnenberg 7f8ade7747
Remove migration-related functionality, leaving export stuff
FREEBIE
2017-09-14 17:03:14 -07:00
Scott Nonnenberg 0fbe43c2dc
Protobufs: More logging on failure to load protobufs, fix tests
FREEBIE
2017-09-14 17:02:45 -07:00
Scott Nonnenberg 63e41612b7
Remove spellchecking on the debug log field - causes big slowdown
FREEBIE
2017-09-14 16:53:52 -07:00
lilia 33a82cc8e8
Add spellcheck smoke test
Exposes the spellcheck provider as window.spellChecker, which allows it to be
called from tests.
2017-09-14 16:53:48 -07:00
Scott Nonnenberg 4402a91976
Use correct locale, fall back to en if we don't have translations
FREEBIE
2017-09-14 16:53:47 -07:00
Scott Nonnenberg 18b8907c96
Fix non-rendering unicode characters on test page
FREEBIE
2017-09-14 16:53:46 -07:00
Scott Nonnenberg cc6dcf67b7 Export: Limit attachment filename length, + convo date, + tests (#1439)
* Export: limit attachment names to 30 chars, tests for helper fns

Also, reintroduce last contact date in conversation dir name

FREEBIE

* MessageView tests: Fix failures during blanket coverage run

FREEBIE
2017-09-06 18:20:42 -07:00
Scott Nonnenberg c0cd733139 Full export, migration banner, and full migration workflow - behind flag (#1342)
* Add support for backup and restore

This first pass works for all stores except messages, pending some scaling
improvements.

// FREEBIE

* Import of messages and attachments

Properly sanitize filenames. Logging information that will help with
debugging but won't threaten privacy (no contact or group names),
where the on-disk directories have this information to make things
human-readable

FREEBIE

* First fully operational single-action export and import!

FREEBIE

* Add migration export flow

A banner alert leads to a blocking ui for the migration. We close the socket and
wait for incoming messages to drain before starting the export.

FREEBIE

* A number of updates for the export flow

1. We don't immediately pop the directory selection dialog box, instead
  showing an explicit 'choose directory' button after explaining what is
  about to happen
2. We show a 'submit debug log' button on most steps of the process
3. We handle export errors and encourage the user to double-check their
  filesystem then submit their log
4. We are resilient to restarts during the process
5. We handle the user cancelling out of the directory selection dialog
  differently from other errors.
6. The export process is now serialized: non-messages, then messages.
7. After successful export, show where the data is on disk

FREEBUE

* Put migration behind a flag

FREEBIE

* Shut down websocket before proceeding with export

FREEBIE

* Add MigrationView to test/index.html to fix test

FREEBIE

* Remove 'Submit Debug Log' button when the export process is complete

FREEBIE

* Create a 'Signal Export' directory below user-chosen dir

This cleans things up a bit so we don't litter the user's target
directory with lots of stuff.

FREEBIE

* Clarify MessageReceiver.drain() method comments

FREEBIE

* A couple updates for clarity - event names, else handling

Also the removal of wait(), which wasn't used anywhere.

FREEBIE

* A number of wording updates for the export flow

FREEBIE

* Export complete: put dir on its own line, make text selectable

FREEBIE
2017-08-28 13:06:10 -07:00
Scott Nonnenberg 53f2bfbb57 Animated loading screens on startup and first conversation load
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg cc2c3edaa6 Override Backbone's trigger with one that catches exceptions
Model operations are vulnerable to exceptions thrown by event handlers.
Because this can interrupt really important data operations, it's better
to let the operation continue and log the error. In all likelihood it's
a view-related problem, and that shouldn't cause any data operation to
fail.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 8112cd220a Show warning when we discover key change on verify
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg d1a9b62077 test/index.html: Restore previous location of code coverage stuff
I changed the location when trying to get code coverage to work properly
and it turned out not to be necessary for the fix.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 5c990d2a35 Code coverage: Collect test coverage for the protocol layer
Because we were only doing a partial instrumentation run prior to this
change, un-instrumented code had references to un-instrumented code
(because Blanket's instrumentation re-runs the code once it is
instrumented, updating the window.NAME reference).

A big part of this was that libtextsecure was not instrumented. And for
good reason; it takes a long time to load and run, especially when
instrumented. But without covering it, we'll have an incomplete view
of our code coverage. So, all coverage collection remains off by
default.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 12914307f1 Improve experience when discovering identity key error on send
New experience in the Message Detail view when outgoing identity key
errors happen, matching the Android View.

'View' button is only shown on outgoing key errors right now.

When a contact with an outgoing identity key error is clicked, they are
taken to a view like the popup that comes up on Android: an explanation
of what happened and three options: 'Show Safety Number', 'Send Anyway',
and 'Cancel'

Contacts are now sorted alphabetically, with the set of contacts with
errors coming before the rest.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg b6cca41a0c Update verification-related strings to better match mobile app
FREEBIE
2017-08-04 12:03:25 -07:00
lilia 1e594e79c1 Fix test page template
// FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 16433d661a Show call to action on group member list when verifying
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 31bf05e14a Add verified state summary to top of safety number screen
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 11372b4e00 Add icons for keychange and expiration timer in-conversation items
The shield matches the Android app's key change notification, and the
clock icon was easy to do and makes it easier to visually distinguish
those items in the conversation history.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg c714fb6dbf Shadow/icon/blue for banner, better verify advisories in dark theme
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 1cf9289b1a Add items to conversation history when user verifies/unverifies
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 47c5142a83 Replace unicode check with new svg icon
A good bit of CSS was required to keep the text color changing along
with the text it is nestled within.

Also: took this opportunity to increase the contrast of the number and
verified section right under the contact name in the group members view.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 8264f3ba33 Make the term 'Verified' fully localizable
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 8d29cb9830 Prevent access to Safety Number when talking to yourself
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg c7e385eb38 Remove 'safety number approval' option from settings dialog
Also sync templates in test/index.html and background.html

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 243cbd8123 Confirmaton on send, banner when 'unverified'
Not yet using the new APIs, but ready to. Still to do:
- Send sync messages on trust decisions
- Respond to received trust decision sync messages
- Show trust decisions in the conversation history
- In that rare situation where a sent message ends up with a key error
  make it easy to retry the send.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg bedf10056b Support for group-member verifications via second-level panel
Also:
- All the necessary wire-up to update things in real time. If you have
a safety number page up via a group member view as well as via a 1:1
conversation with that contact, they'll both be updated as the
underlying model changes. Similarly, the overall group will update
in real-time as members change.
- A bit of special-casing for yourself in a group conversation - you're
shown as 'me' and are not clickable, where normally that would take you
to the Safety Number screen for that contact. You are also not included
in the trust calculations for a given group.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg ae3587f05e Move all instances of 'verify identity' to 'show identity'
As discussed in standup this morning - only the act of verifying or a
statement about current status should use that word 'verify.'

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg ee0b0f5ffb Remove all concept of 'key conflict' from the app 2017-08-04 12:03:25 -07:00
Heather Booker 5a3610c8e0 Specify font-family for identicon in notification
Fixes #904, where letters in notification bubbles were being
displayed in serif font on Antergos (Arch) OS.

// FREEBIE
2017-07-12 15:35:53 -07:00
Scott Nonnenberg 0d722a3186 Last seen indicator visual refresh
- Last seen indicator now spans the full conversation, with subtle
shadow highlights above and below
- Scrollbars now overlap the content of the conversation, allowing last
seen indicator to touch the right edge of the window.
- The iOS and Android conversation background is now #eee instead of
white, which meant that the outgoing messages (Android) and incoming
messages (iOS) had to be updated for contrast. They now have white
backgrounds.
- Similarly, the scroll down button needed more contrast, and its
background is now white in light themes.

FREEBIE
2017-06-01 15:19:25 -07:00
Scott Nonnenberg 4c7bfbe9ff Scroll down button: when scrolled up, or new non-visible message
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg 86c866738f Introduce unread message to fixtures, further interactivity fixes
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg 33cdc6ae71 test/index.html: Comments to help in turning off code coverage
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg 0a5960e091 Restore interactivity to InboxViews hosted on test page
FREEBIE
2017-05-23 11:08:23 -07:00
Scott Nonnenberg 423a0fef67 Jumbomoji support matching Android support
FREEBIE
2017-05-10 15:51:39 -07:00
lilia aed5735620 Improve keychange notice reliability/perf
Bind a single listener to keychange events from the storage interface,
which then looks up relevant conversations and adds notices to them,
with tests.

Previously we would need to instantiate a conversation model in order to
start listening to its key change events. In practice this usually
happens at startup but we shouldn't rely on it, and it incurs higher
overhead since it creates a different listener for each conversation.

// FREEBIE
2017-05-09 15:41:41 -07:00
Scott Nonnenberg 731fcb8ecb Add test verifying that AttachmentView shows file size
FREEBIE
2017-05-09 15:14:20 -07:00
lilia 6c7e1aa283 Update tests 2017-04-18 16:27:50 -07:00
lilia d0448ec778 Fix tests
// FREEBIE
2017-04-13 13:15:42 -07:00
Sam Vevang ed4991974b set up a new view for displaying the network status
// FREEBIE
2017-04-08 00:10:56 -07:00
Blake Griffith 1e498294e0 Add attachment_views_test.js tests 2017-02-06 21:23:35 -08:00
Ikarulus 53cd3af78b Added a dark theme
I added a dark theme in order to solve #328.
This may fix #328 at least partially.
2016-12-02 00:41:42 +01:00
lilia 224afdd063 Fix tests 2016-10-07 19:39:50 +09:00
2-4601 669338c717 i18n 'Theme'
// FREEBIE
2016-10-07 19:27:05 +09:00
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.
2016-09-23 19:51:42 -07:00
lilia 7e0df07e88 Fix tests
// FREEBIE
2016-09-01 13:47:50 -07:00
lilia b1d370755a Rename AxolotlStore
// FREEBIE
2016-04-21 18:36:17 -07:00
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
2016-04-03 21:11:50 -07:00
lilia 37fb2580bc Fix tests
// FREEBIE
2016-03-09 16:17:17 -08:00
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
2016-01-26 10:54:40 -08:00
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
2015-12-09 18:58:51 -08:00
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
2015-12-09 18:58:51 -08:00
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
2015-11-08 10:35:24 -08:00
lilia 87ce3241c8 Remove script-tag for nonexistant test
// FREEBIE
2015-09-17 15:25:13 -07:00
lilia 78d7296f84 Fix tests
// FREEBIE
2015-09-17 11:40:42 -07:00
lilia f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
2015-09-07 14:58:42 -07:00
lilia 029c9754f0 Fix tests 2015-05-15 11:39:23 -07:00
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
2015-05-05 17:44:55 -07:00
lilia 5a46300581 Reorder database.js include in test 2015-04-15 18:11:06 -07:00
lilia dc1b09f59d Auto-link urls in message bodies
And watch out for xss.

Closes #187
2015-03-06 17:01:04 -08:00
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.
2015-03-05 15:36:35 -08:00
lilia 4cefd17ac6 Remove unused view 2015-03-03 10:55:04 -08:00
lilia e96aa2f06e Remove obsolete script tags
For the recently deleted notifications.js
2015-02-23 11:57:57 -08:00
lilia 711e211e20 Remove bootstrap tagsinput 2015-02-12 13:21:16 -08:00
lilia 55802f2087 Remove obsolete note on test page
Actually this page totally works from file:// now.
2015-02-11 17:37:59 -08:00
Matt Corallo e7f3e52b6c Remove NaCL! 2015-01-14 11:39:36 -10:00
Matt Corallo 5785f4033c Compile curve25519/webcrypto into libtextsecure.js 2015-01-14 09:35:57 -10:00
Matt Corallo 899d756469 Split tests between libtextsecure and main 2015-01-14 09:35:57 -10:00
Matt Corallo 8ad1a38b5b Move js files around for libtextsecure split 2015-01-14 09:35:57 -10:00
lilia 3d6c251fd1 Group avatars 2015-01-11 01:27:22 -10:00
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
2015-01-10 08:08:20 -10:00
Matt Corallo 2c781e5b62 s/\t/ /g in test/index.html 2015-01-06 14:46:33 -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 7b23e24b71 Add stringview license info and script tags
Closes #94
2014-12-03 01:36:10 -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 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 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.
2014-11-24 19:04:19 -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 18378d8097 Fold nacl-common into components 2014-11-10 01:35:15 -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 4518d03f43 Move protocol test to end of suite and extend timeout
The keygen test works without native client, but it takes a loooooong
tiiiiiiime.
2014-11-09 19:20:33 -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 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 3d27c98845 Remove stray curve25519.js include 2014-11-08 10:46:04 -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 df0e52a893 Split crypto_test into crypto, protocol and helpers tests 2014-11-06 14:33:16 -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 f7d92ccb5b Bowerize backbone.localstorage 2014-11-03 17:27:44 -08:00
lilia 6e86a2b7cf Switch libphonenumber to bower 2014-10-31 20:59:30 -07:00
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.
2014-10-30 18:33:37 -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 6e739a8a77 Add mustache to bower 2014-10-30 01:52:06 -07:00
lilia b351e8cea0 Switch mocha and chai to bower components 2014-10-30 01:47:50 -07:00
lilia 73f4f64351 Grunt preen and concat
Set up grunt with tasks for:
  * preen - deletes unused files from bower_components, configured in
      bower.json
  * concat - concatenates preened bower components, configured
      automagically from the preen config

It's worth noting that this setup assumes the order of files within a
package doesn't matter. This is usually true since we often include only
one file from the package.
2014-10-29 20:50:51 -07:00
lilia c8ad65efe0 Switch to bower dependencies
Checks in only the files we actually need from bower_components.
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
Renamed from test/test_views.html (Browse further)