Commit Graph

5700 Commits (5826b6f22a3816bc7c1ed06794384266f411aaa2)

Author SHA1 Message Date
Luke Barnard 5826b6f22a Instead of sending HTML for any Entity, only send HTML for Links
Otherwise emoji messages are sent as HTML, needlessly
2017-07-13 13:41:17 +01:00
Luke Barnard be045a6dc0 Interpret whitespace after entity as the end of the entity
The easiest way to stop the user from inserting whitespace onto the end of an entity is to toggle the entity state of the whitespace that was just entered. This allows the user to continue drafting a message without editing the link content.

This is for pasted `<a>` tags that have been copied from a website. We probably also want to be storing entities for substrings of content that are determined to be URLs.
2017-07-13 13:28:51 +01:00
Luke Barnard 4b96963408 Send HTML if there are any entities present in the composer
This is so that pasted HTML links that are represented as entities are sent as HTML.
2017-07-13 13:27:49 +01:00
Luke Barnard 55e1202c09 Decorate pasted links so that they look like links
By default, draftjs will represent pasted `<a>` tags as `LINK` entities, but it doesn't do any default decoration of these links. Add a decorator to do so.

Most of this was taken from https://github.com/facebook/draft-js/blob/v0.8.1/examples/link/link.html (note the version, v0.8.1).
2017-07-13 13:26:13 +01:00
Luke Barnard 4cc8b5621d Merge pull request #1212 from matrix-org/luke/fix-ctrl-k
Enable ctrl+k room filter focus
2017-07-12 18:20:45 +01:00
Luke Barnard 6547a55852 Update to reflect previous implementation
Which was originally a74bbb424c
2017-07-12 17:12:57 +01:00
David Baker 3093f2d6fb Merge pull request #1211 from matrix-org/rav/use_react_test_utils
Use matrix-react-test-utils rather than our own impl
2017-07-12 16:44:25 +01:00
David Baker a48c7d2364 Only allow http and https widget URLs 2017-07-12 14:16:47 +01:00
Luke Barnard 0dbd1d988e Enable ctrl+k room filter focus
By using the `focus_room_filter` dispatch
2017-07-12 13:51:55 +01:00
David Baker 918f5abe81 Lint correctly 2017-07-12 10:34:50 +01:00
David Baker 53316a76f4 Sandbox app iframes 2017-07-12 10:22:14 +01:00
Richard van der Hoff 7455002b1a InteractiveAuthDialogTest: increase timeout
Blindly increase the number of attempts, because it's failing on travis, but
not on my dev box...
2017-07-12 00:24:00 +01:00
Richard van der Hoff 928287b8fc Bump to matrix-react-test-utils 0.1.1
... because 0.1.0 was broken
2017-07-12 00:02:52 +01:00
Richard van der Hoff 7ae4e96e4d Merge pull request #1207 from matrix-org/rav/fix_dispatcher_race
Fix a race in session loading code
2017-07-11 23:21:33 +01:00
Richard van der Hoff 30ef6d4932 Merge pull request #1210 from matrix-org/t3chguy/test-crossplatform
use npm scripts arg passing instead of $KARMAFLAGS to make cross-compat
2017-07-11 23:18:53 +01:00
Richard van der Hoff ab61b6b1b6 Use matrix-react-test-utils rather than our own impl
waitForRenderedDOMComponentWithTag is now in matrix-react-test-utils.
2017-07-11 23:14:56 +01:00
Michael Telatynski 7473c654d5
use npm scripts arg passing instead of $KARMAFLAGS to make cross-compat 2017-07-11 22:54:18 +01:00
David Baker 569ea909c4 Merge pull request #1209 from matrix-org/luke/fix-emoji-support-zwj
Update `unicodeToImage` to maintain compatibility with emojione
2017-07-11 18:38:54 +01:00
David Baker eb4e4a66ff Merge pull request #1206 from matrix-org/rav/login_unmounted_guard
Give Login an unmounted guard
2017-07-11 18:37:50 +01:00
Luke Barnard 0df144cb62 Update `unicodeToImage` to maintain compatibility with emojione
We recently updated our version of emojione but this update included the addition of emoji represented in unicode with ZWJ (Zero-Width-Joiners). These ZWJs are not present in the asset file names, so any emoji with ZWJ in them were just not found (404 on the web client).

This updates `unicodeToImage` to be compatible with emojione 2.2.7 so that the correct filenames are used when converting from unicode to <img>.
2017-07-11 18:27:35 +01:00
Luke Barnard 3bab720a7b Merge pull request #1208 from matrix-org/rav/timelinepanel_test_flakiness
Fix a flaky test in the timelinepanel code
2017-07-11 18:10:55 +01:00
Richard van der Hoff 1139dd2be5 Fix a flaky test in the timelinepanel code
Sometimes it was possible for there to be a scroll event before the initial
pagination completed, which then upset the rest of the test. Just give it a few
ms to sort itself out instead.
2017-07-11 17:34:46 +01:00
Richard van der Hoff f5f1fe6ae6 Fix a race in session loading code
it was possible for on_logging_in to get dispatched *after* on_logged_in,
causing the app to wedge. Fix it by dispatching on_logging_in synchronously.
2017-07-11 17:09:06 +01:00
Richard van der Hoff 67372d4fed Give Login an unmounted guard 2017-07-11 17:04:19 +01:00
Luke Barnard af3b6484cd Merge pull request #1196 from matrix-org/dbkr/groups_better_groupview
Add more features to Group View
2017-07-11 17:03:47 +01:00
Kegsay 6369253142 Scalar messaging: Add can_send_event operation (#1204)
This is mainly for use to pre-emptively show/hide buttons.
2017-07-11 15:20:33 +01:00
David Baker ff3c21ef10 Lint, including putting key in right place 2017-07-11 15:16:58 +01:00
David Baker 4e49ebd6ce Change incorrect refs to this.props 2017-07-11 14:31:07 +01:00
David Baker 8690ed2181 Make the category functions React components 2017-07-11 14:28:44 +01:00
David Baker e242e5e714 Merge pull request #1205 from matrix-org/luke/feature-new-emojis
Bump the dep on emojione to 2.2.7 to add 🦈 and others
2017-07-11 14:13:13 +01:00
Luke Barnard d146246805 Move "regional" category to after "flags"
Otherwise by default it appears first, pushing "people" further down the list

Also, remove "unicode9" category ordering, as this category does not exist as part of emojione
2017-07-11 14:06:15 +01:00
Luke Barnard 4766447e15 Bump the dep on emojione to 2.2.7 to add 🦈 and others
Also, re-run node scripts/emoji-data-strip.js to update emoji meta data in src/stripped-emoji.json
2017-07-11 13:48:15 +01:00
David Baker 222ca054c5 Use PropTypes.shape to define our required inputs 2017-07-11 13:41:00 +01:00
Kegsay cf158530f5 Implement new widget API (#1201)
* Implement new widget API

This allows clients to see who provisioned which widgets.

* Update to make state_key the wid

* Update to latest API

* Only show widgets which have required fields

* Don't constantly show apps dialog

* Fix example to include data key
2017-07-11 12:15:27 +01:00
David Baker 5c89d3303b Merge pull request #1203 from matrix-org/luke/fix-rte-user-completion
Fix bug where a received message would remove completions for users
2017-07-11 11:04:07 +01:00
David Baker 29990296d2 Lint 2017-07-11 11:02:23 +01:00
Luke Barnard e18924c8fc Fix bug where a received message would remove completions for users
`Array.prototype.splice` will return the array of removed items, not a new array. The array operated on is actually modified in-place.

This was causing a few weird things to happen: https://github.com/vector-im/riot-web/issues/4511 and https://github.com/vector-im/riot-web/issues/4533. This should fix both of them but it is concerning that doing the tab completion is required to reproduce. Let's just see how this goes before closing the issues.

Thanks @turt2live for reproducing both bugs, giving enough information for a fix :)
2017-07-11 10:42:02 +01:00
David Baker 925d5bd480 Add featured users to Group View 2017-07-10 19:32:02 +01:00
Luke Barnard 4f95d4ccaf Merge pull request #712 from matrix-org/matthew/whitelist-uri-schemes
whitelist data & mxc URIs on img tags: readds PR #333
2017-07-10 17:59:35 +01:00
Luke Barnard dfa97e8452 Add comment 2017-07-10 17:48:01 +01:00
Luke Barnard 6877b99435 Strip `<img src="https?://..">`s when transforming `img`s instead of using `allowedSchemesByTag` 2017-07-10 17:44:49 +01:00
Luke Barnard bb9080425a Allow image tags with src attributes with schemes http[s]
And transform `mxc:*` URLs to `https?://`
2017-07-10 16:27:23 +01:00
Luke Barnard 96f5f92c7f Disallow data attribute, we don't need it currently 2017-07-10 15:44:46 +01:00
Luke Barnard f9ee89b2f4 Merge branch 'develop' into matthew/whitelist-uri-schemes 2017-07-10 15:42:03 +01:00
David Baker 0e67a9158c hide settings button until it's wired up 2017-07-10 15:32:57 +01:00
David Baker 048912a241 Remove commented ordering code
No lomger needed now roosm come down in order
2017-07-10 15:17:58 +01:00
Luke Barnard 66525f6826 Null-guard RR logic 2017-07-10 15:07:22 +01:00
David Baker ac4be03f7b Merge remote-tracking branch 'origin/develop' into dbkr/groups_better_groupview 2017-07-10 14:51:13 +01:00
Luke Barnard 3718bc399f Merge pull request #1202 from matrix-org/luke/fix-redundant-bindings
Remove redundant functions, bindings, props
2017-07-10 14:46:22 +01:00
Luke Barnard b104228a7b Remove redundant functions, bindings, props 2017-07-10 14:27:41 +01:00