Commit graph

5081 commits

Author SHA1 Message Date
Javier Quevedo
35ce336c35 Translated using Weblate (Spanish)
Currently translated at 69.2% (634 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/es/
2017-07-26 18:21:48 +00:00
Luke Barnard
c4f049effe Merge pull request #1243 from matrix-org/t3chguy/hide-join-part-2
T3chguy/hide join part (attempt) 2
2017-07-26 17:15:43 +01:00
David Baker
9cb28ff33c Merge pull request #1248 from matrix-org/luke/fix-rte-auto-scroll
Scroll to the bottom of editor if on last line
2017-07-26 16:58:36 +01:00
Richard Lewis
9f52c13bea Grant permission to load app widget. 2017-07-26 16:47:58 +01:00
Michael Telatynski
2348c24369
revert the rm-always-moves-down loop as thats done Server side... 2017-07-26 14:33:48 +01:00
Michael Telatynski
3b8c408482
update comment to make explain behaviour better 2017-07-26 13:37:33 +01:00
Michael Telatynski
3eb87e2aa3
change lastShownEventIndex -> lastShownEvent since some places
do not have the same i reference (namely MELS generation)
this way a member event at bottom of MELS (if is the last event
in the timeline will have last set appropriately)
2017-07-26 12:17:05 +01:00
Michael Telatynski
762e6780d7
fix this hiding unbans as found by Luke's review 2017-07-26 11:51:41 +01:00
Michael Telatynski
f42ae1662b
change wording of comment as per Luke's review 2017-07-26 11:46:59 +01:00
Richard Lewis
76f4f88fcd App tile permissions -- broken 2017-07-26 11:28:43 +01:00
Luke Barnard
fc00eaf546 Merge branch 'develop' into luke/store-history-as-raw-content 2017-07-25 17:19:35 +01:00
Luke Barnard
1ef2a2bcf9 Merge pull request #1250 from matrix-org/dbkr/fix_truncatedlist_i18n
Fix i18n on truncatedlist & friends to be sane
2017-07-25 16:17:44 +01:00
Luke Barnard
2138b4a705 Merge pull request #1249 from uhoreg/imgfix1
allow width, height, alt, title attributes in img
2017-07-25 16:09:01 +01:00
David Baker
fa7a9818c6 Fix i19n on truncatedlist & friends to be sane
Use the proper counterpart tool for plurals rather than if > 1.
Fix up all the translation files respectively.
2017-07-25 15:59:06 +01:00
Hubert Chathi
df71502dbb allow width, height, alt, title attributes in img
fixes vector-im/riot-web#4646

Signed-off-by: Hubert Chathi <hubert@uhoreg.ca>
2017-07-25 10:43:40 -04:00
Luke Barnard
7e0fecbc8c Scroll to the bottom of editor if on last line
Make the MessageComposerInput scroll to the bottom if we are on the last line of the contents.

fixes https://github.com/vector-im/riot-web/issues/4652
2017-07-25 15:22:10 +01:00
Luke Barnard
eccdceae33 Rename props to entityProps for clarity 2017-07-25 11:43:12 +01:00
Luke Barnard
143994e44f Use data-offset-key in RTE decorators
This makes sure the selection state is correct when moving the cursor through an entity in the composer but only in rich text mode. https://github.com/vector-im/riot-web/issues/4666 still persists despite this, probably because the text content inserted during a completion in markdown mode has a different length to the text node within the entity.

fixes vector-im/riot-web#4654
2017-07-25 11:25:33 +01:00
Luke Barnard
b372e5d55d Merge pull request #1246 from matrix-org/luke/feature-async-pills
Get user pill profile remote data and show unrecognised rooms as links
2017-07-25 10:21:55 +01:00
Luke Barnard
76e281662b Merge pull request #1229 from matrix-org/dbkr/groupview_edit
UI for editing groups
2017-07-25 10:13:49 +01:00
Luke Barnard
11f3a1db72 Merge branch 'luke/feature-async-pills' of github.com:matrix-org/matrix-react-sdk into luke/feature-async-pills 2017-07-25 09:37:47 +01:00
Luke Barnard
ac597996e0 Remove outdated comment 2017-07-25 09:37:18 +01:00
Luke Barnard
026582bcf7 Add unmounted guard 2017-07-25 09:22:08 +01:00
Luke Barnard
5efd5bf927 done -> then, style 2017-07-25 09:20:14 +01:00
Luke Barnard
d13c4b510c Merge branch 'develop' into luke/feature-async-pills 2017-07-24 17:39:35 +01:00
Luke Barnard
bcd1ab5cd4 Merge pull request #1245 from matrix-org/luke/feature-mentions-ambiguate
Remove disambiguation from user mentions, add tooltip for mxid
2017-07-24 17:36:42 +01:00
Luke Barnard
61c16569cb Get user pill profile remote data
Instead of relying on the local avatar/displayname of a user, request the data from the server and update the pill if it shows up.

This required a slight refactor which means we're not doing everything in `render` now. Also I noticed unknown rooms weren't being rendered _at all_! So now you get something that looks like a normal link but with the room alias/ID in it.
2017-07-24 17:18:29 +01:00
Luke Barnard
727b1ca545 Remove disambiguation from user mentions, add tooltip for mxid
Also add a tooltip for room pills = room alias/ID

Requires: https://github.com/matrix-org/matrix-js-sdk/pull/513
2017-07-24 15:08:22 +01:00
Luke Barnard
dc09ad8db4 Re-add NL 2017-07-24 14:50:44 +01:00
Luke Barnard
6945fa54ea Reimplement so that only tab-completed mentions are stripped
Instead of blindly stripping all MD mentions, only strip those that were tab-completed. We do this by adding the `isCompleted` flag to the Entity data.
2017-07-24 14:41:13 +01:00
Luke Barnard
397201a74d Remove subjective comment 2017-07-24 09:41:46 +01:00
Glandos
b15f3c08ea Translated using Weblate (French)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fr/
2017-07-22 14:12:05 +00:00
Michael Telatynski
8e66e64621
fix for loop - check happens before pre-inc so cause issues at end of TL
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-22 13:16:16 +01:00
Michael Telatynski
c9b547368b
add algo to ensure that RM always moves forwards
this is needed so that if a client which does not hide any events
sets and RM at bottom of timeline, then riot-web which hides events
sets the RM it'd set it at X-N where X is bottom and N is the amount of
hidden events at bottom of the timeline, this way now an RM will
fall through to the hidden events below a seen event.

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-22 13:10:57 +01:00
Michael Telatynski
b976649b5b
re-add i18n string
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-22 12:52:19 +01:00
Michael Telatynski
a4abd1baa7
fix comment and remove unused const
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-22 12:03:32 +01:00
Michael Telatynski
ae973e1e99
unrevert some more...
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-22 11:37:21 +01:00
Lauris Mierkalns
3631870c96 Translated using Weblate (Latvian)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/lv/
2017-07-22 03:05:04 +00:00
Michael Telatynski
7e355f7cda
unrevert most of the logic.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-21 23:18:18 +01:00
Michael Telatynski
1fa4fe0b9a
remove comments/commented code
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-21 22:51:31 +01:00
Michael Telatynski
5808fce60e
fix logic ordering
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-21 22:45:19 +01:00
Michael Telatynski
17758cd1db
attempt to incorporate more code #2
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-21 20:43:03 +01:00
Michael Telatynski
e47e14ed19
attempt to incorporate more code #1
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-21 20:22:01 +01:00
Michael Telatynski
3859708114
re-add Unread shouldHideEvent code
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-21 19:51:13 +01:00
Michael Telatynski
8167c004a8
re-add core logic
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-21 19:38:01 +01:00
Michael Telatynski
928294eba3
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/hide-join-part-2 2017-07-21 19:23:42 +01:00
Luke Barnard
e315b30f6a Merge branch 'develop' into luke/fix-rte-pt-md-mentions 2017-07-21 18:06:31 +01:00
Luke Barnard
eb0575d9c1 Merge pull request #1241 from matrix-org/luke/refactor-pills
Factor out shared logic in two code-paths for pill rendering
2017-07-21 17:54:20 +01:00
Luke Barnard
feaafc7a1a Remove logging 2017-07-21 17:18:48 +01:00
Luke Barnard
e8495f637f Strip MD mentions from the body of sent messages
Because previously we just sent the display name and MD links are not very readable.
2017-07-21 16:38:31 +01:00
David Baker
f9cff50ef5 _loadGroupFromServer doesn't return a promise 2017-07-21 14:41:29 +01:00
David Baker
d48924e768 Lint 2017-07-21 14:30:09 +01:00
David Baker
be7228996a This should be null rather than false 2017-07-21 14:18:28 +01:00
David Baker
4eda2ab083 Swap classes instead of using 0 height elements 2017-07-21 14:13:57 +01:00
Luke Barnard
7db7192701 Factor out shared logic in two code-paths for pill rendering
This isn't an entirely side-effect-free refactoring:
 - the text of the timeline pills is now either the room ID/alias or user ID/ display name of the linked resource (which means that until we do a roundtrip to get user displaynames, mentions for users not in the current room will have their user IDs shown instead of what was in the link body).
 - timeline links to rooms without avatars are now rendered as links
 - fixed issue that would throw an error whilst rendering (i.e. unusable client) a room link to a room that the client doesn't know about
2017-07-21 14:07:48 +01:00
David Baker
3c44af11f7 Revert changes to ChangeAvatar
This component was basically adding nothing for group editing
2017-07-21 14:06:08 +01:00
David Baker
f2afd852d8 Make group editing work 2017-07-21 14:03:10 +01:00
Richard Lewis
b589fcc3b0 Merge pull request #1240 from matrix-org/rxl881/deleteWidgets
Hide widget panel while it is being deleted.
2017-07-21 11:14:42 +01:00
David Baker
571fada77e Make group profile editing mostly work
apart from avatars
2017-07-21 11:12:15 +01:00
Alexandre Morignot
511ab7c9ea Translated using Weblate (French)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fr/
2017-07-20 20:12:48 +00:00
Luke Barnard
bac22cfb7c Re-add removal of (IRC) suffix 2017-07-20 18:04:12 +01:00
Luke Barnard
08cc0c421d insert_displayname -> insert_mention 2017-07-20 18:02:54 +01:00
Luke Barnard
0cc890c020 WIP store history as raw content state
Not sure this solves any problems because we still have to convert from md and back
2017-07-20 18:01:39 +01:00
Luke Barnard
6d7bff83ca Update type Completion 2017-07-20 16:49:23 +01:00
Luke Barnard
0600c5b049 Pretend that insert_displayname is a completion on that user
This has the advantage of us not reimplementing things and fixing the same bugs twice.
2017-07-20 16:46:53 +01:00
Luke Barnard
4bee9bd8c7 Merge branch 'develop' into luke/feature-rte-insert-pills-on-click-tl-profile 2017-07-20 15:48:38 +01:00
Luke Barnard
0419eff230 Insert pill onClick of timeline profile
When clicking someone in the timeline, insert a user pill instead of the plaintext "displayname:"
2017-07-20 15:46:36 +01:00
Luke Barnard
26b16b076c Merge pull request #1238 from matrix-org/luke/fix-rte-md-mentions
Insert MD links when autocompleting in MD mode
2017-07-20 15:32:36 +01:00
Luke Barnard
e893f994e1 Default to first room alias and then roomID 2017-07-20 15:17:07 +01:00
Luke Barnard
84fe51a162 Insert MD links when autocompleting in MD mode
These will appear decorated because they are inserted as entities. It was necessary to modify pills to have an explicit linkText that is derived from the `href` being pillified (and is thus no longer the inserted completion but rather the display name (or user ID) or room alias.
2017-07-20 15:09:59 +01:00
Richard Lewis
563f5f7bac Merge pull request #1226 from matrix-org/rxl881/beta
Show beta testing icon and help message for widgets tile.
2017-07-20 14:04:53 +01:00
David Baker
199b771051 Merge pull request #1237 from matrix-org/luke/fix-rte-colon-parity
Implement old composer feature that inserts ': ' or ' '
2017-07-20 13:05:40 +01:00
Luke Barnard
0185119146 Merge pull request #1236 from matrix-org/luke/fix-rte-emoji-match-by-name
Match emojis by long name
2017-07-20 11:53:41 +01:00
Luke Barnard
352f70f9ce Implement old composer feature that inserts ': ' or ' '
after a user completion
2017-07-20 11:52:18 +01:00
Luke Barnard
b3df546cb9 Fix comment 2017-07-20 10:51:15 +01:00
LuPa
206c771eb1 Translated using Weblate (Spanish)
Currently translated at 68.2% (625 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/es/
2017-07-20 09:15:25 +00:00
Luke Barnard
a7feb58b63 Match emojis by long name
For example, searching for `:tong` will now match `:stuck_out_tongue` because the query `:tong` has all non-word characters removed, becoming `tong` and is then matched against the (long) names of emojis such as `smiling face with open mouth and tightly-closed eyes`.
2017-07-20 10:01:58 +01:00
Richard van der Hoff
0e8ad75248 Merge pull request #1233 from matrix-org/rav/async_crypto
Prepare for asynchronous e2e APIs
2017-07-19 21:11:36 +01:00
Luke Barnard
2f293adad5 Fix userId undefined in pillifyLinks 2017-07-19 18:21:26 +01:00
Luke Barnard
ecaf6e5223 Merge pull request #1234 from matrix-org/luke/feature-mention-pill
Add mx_UserPill_me class to user pills that match credentials.userId
2017-07-19 17:56:24 +01:00
Luke Barnard
61d5d078dd Merge pull request #1235 from matrix-org/luke/fix-rte-inline-code-format
Mimic ctrl+j of RT mode in MD mode
2017-07-19 17:44:56 +01:00
Luke Barnard
5d1b33d2a8 Merge branch 'develop' into luke/feature-mention-pill 2017-07-19 17:22:03 +01:00
Luke Barnard
3a53fabb87 Merge pull request #1228 from matrix-org/luke/feature-auto-complete-matrixto-pills
Implement composer completion user/room pill insertion
2017-07-19 17:19:47 +01:00
Luke Barnard
29b6d70aff Merge branch 'develop' into luke/fix-rte-inline-code-format 2017-07-19 17:19:25 +01:00
Luke Barnard
d179398cf2 Merge pull request #1227 from matrix-org/luke/feature-matrixto-timeline-pills
Decorate matrix.to anchor tags as mx_UserPill and mx_RoomPill
2017-07-19 17:17:48 +01:00
Luke Barnard
75ca141cf9 Merge pull request #1232 from matrix-org/luke/fix-rte-backspace-unstyled-block
Interpret backspace at start of style block as block style toggle
2017-07-19 17:16:34 +01:00
Richard van der Hoff
8d7ff127f1 Merge pull request #1231 from matrix-org/luke/fix-rte-duplicate-autocompletions
Use _uniq instead of _sortedUniq for return unique matched results
2017-07-19 17:05:12 +01:00
Luke Barnard
c8722292e3 Don't truncate EmojiProvider completion pills 2017-07-19 16:20:57 +01:00
Luke Barnard
28c98d93d1 Mimic ctrl+j of RT mode in MD mode
by inspecting whether multiple lines are selected or the selection is empty. If either of these are true, insert a code block surrounding the selection, otherwise insert single backticks around the selection for inline code formatting.
2017-07-19 16:13:47 +01:00
Luke Barnard
b131637a11 Add mx_UserPill_me class to user pills that match credentials.userId 2017-07-19 11:00:26 +01:00
Richard van der Hoff
4998d1b359 Prepare for asynchronous e2e APIs
the js-sdk is making some of its APIs asynchronous, and adding an `initCrypto`
method which you have to call.

Particular methods we need to worry about are:

* `getStoredDevice`
* `getStoredDevicesForUser`
* `getEventSenderDeviceInfo`
* `isEventSenderVerified`
2017-07-18 23:47:36 +01:00
Luke Barnard
98ca937fef Interpret backspace at start of style block as block style toggle
Part of fixing https://github.com/vector-im/riot-web/issues/4580
2017-07-18 17:52:04 +01:00
Luke Barnard
b185f43d3d Use _uniq instead of _sortedUniq for return unique matched results
_sortedUniq claims to be like _uniq but optimised for sorted arrays - https://lodash.com/docs/4.17.4#sortedUniqBy. But in practice this isn't quite true, so stick with the unoptimised version.
2017-07-18 16:23:54 +01:00
David Baker
8a818d250f Merge remote-tracking branch 'origin/develop' into dbkr/groupview_edit 2017-07-18 11:34:48 +01:00
David Baker
7cfef04c1f Remove other promise notify 2017-07-18 11:27:21 +01:00
David Baker
b261c89a63 Fix inviting multiple people to a room
Removes the promise notify as bluebird doesn't support it. It's
also not used anywhere now.

Fixes https://github.com/vector-im/riot-web/issues/4614
2017-07-18 11:11:42 +01:00
Luke Barnard
d207ee5244 Expand groups into variables with readable names 2017-07-17 19:31:36 +01:00
David Baker
859239f881 Lint / comment out line correctly 2017-07-17 18:13:20 +01:00
David Baker
7041106bf2 Merge remote-tracking branch 'origin/develop' into dbkr/groupview_edit 2017-07-17 17:23:02 +01:00
David Baker
6f65128928 Disable edit button again
until we have an API to edit group profile info
2017-07-17 17:18:46 +01:00
David Baker
1cd79fc918 Rename group settings to 'Edit Group' 2017-07-17 17:17:18 +01:00
Luke Barnard
29757fcf11 Merge branch 'luke/feature-matrixto-timeline-pills' into pills 2017-07-17 16:43:46 +01:00
Luke Barnard
897ff05d87 Implement composer completion user/room pill insertion
This modifies the composer completion such that completing a room or user will insert an IMMUTABLE matrix.to LINK Entity for the range that was replaced. Display names will not have a colon after their name anymore as it seemed strange that we would insert one after a pill.
2017-07-17 15:53:29 +01:00
Luke Barnard
b1e3dc406c Decorate matrix.to anchor tags as mx_UserPill and mx_RoomPill
Requires https://github.com/vector-im/riot-web/pull/4597 to look OK
2017-07-17 14:50:45 +01:00
David Baker
a32113ad97 Add onChange handlers & tabIndexes 2017-07-17 14:40:38 +01:00
Luke Barnard
31290f3377 Remove redundant, unused decorators from RTE
These have since been replaced by decorators that operator whether in MD mode or otherwise. This might not be optimal because LINK entities do not appear in MD mode at all at the moment, but instead you see the ()[] md notation version.
2017-07-17 14:27:50 +01:00
Lauris Mierkalns
57be0cf23d Added translation using Weblate (Latvian) 2017-07-17 03:12:22 +00:00
Richard Lewis
6aa0f68ee9 Show beta testing icon and help message for widgets tile. 2017-07-14 23:31:57 +01:00
Luke Barnard
ee5117525c Merge pull request #1225 from matrix-org/luke/feature-rte-pills
Decorate http://matrix.to links in the composer as pills
2017-07-14 17:47:16 +01:00
David Baker
f6f80bf9ce Remove now unused 'edit' block
And add some css classes
2017-07-14 17:22:17 +01:00
David Baker
3aed1a6293 Merge pull request #1224 from matrix-org/rav/upload_progress
Fix file uploading
2017-07-14 17:18:48 +01:00
Luke Barnard
434660166c Decorate http://matrix.to links in the composer as pills
Any links in the composer that are recognised as matrix.to links will be decorated as `<span>`s with CSS classes (one of mx_UserPill or mx_RoomPill). This implementation has the nice bonus that switching to markdown (and back) will Just Work.

This will have some CSS changes coming to better match the design.
2017-07-14 17:04:28 +01:00
Richard van der Hoff
ad085a6273 Fix file uploading
File uploading no longer supports the .progress API; we now need to pass a
callback to get updates on the upload.
2017-07-14 17:01:03 +01:00
Richard van der Hoff
2a52c902e2 Merge pull request #1223 from matrix-org/rav/roomsettings_promise_usage
Fix RoomSettings save
2017-07-14 14:47:14 +01:00
Richard van der Hoff
9df1fb91ff Fix RoomSettings save
Looks like saving RoomSettings had been broken since 0d7cc59. `isFulfilled`
cannot be used as a static function.
2017-07-14 14:24:42 +01:00
Kegsay
5274cf59a0 Hook up the edit widget button (#1218)
* Hook up the edit widget button

* Review comments
2017-07-14 11:17:59 +01:00
Luke Barnard
1db2431c9f Merge pull request #1222 from matrix-org/luke/fix-rte-allow-split-code-block
Add code-block to the list of blocks where hitting return will split-…
2017-07-14 09:48:47 +01:00
Luke Barnard
219c00bbc3 Add code-block to the list of blocks where hitting return will split-block
Hitting return in a code-block will now split the block into two code blocks. (Holding shift will still insert a soft newline into the current block).

We still need to make it a bit more obvious that consecutive code-blocks
are not contiguous - https://github.com/vector-im/riot-web/issues/4535
2017-07-13 18:42:37 +01:00
David Baker
381f685013 Start on editing groups 2017-07-13 18:41:51 +01:00
Luke Barnard
7945abe6b9 Merge pull request #1219 from matrix-org/luke/fix-autcompleter-promises
Fix Autocompleter promises
2017-07-13 18:11:45 +01:00
Luke Barnard
dcc4db53f9 Async functions now return bluebird promises, remove redundant Promise.resolve 2017-07-13 17:51:14 +01:00
Luke Barnard
d97de4d576 Implement disabled-by-default setting for auto-replacement of plaintext emojis
FTR a list of plaintexts and their unicode equivalents can be found here - https://github.com/vector-im/riot-web/issues/4554#issuecomment-314374303

Pressing space after a matching emoji will replace the plaintext emoji with the equivalent unicode emoji.
2017-07-13 17:37:43 +01:00
Luke Barnard
f78a49b3a9 Do reflect in the same map 2017-07-13 17:20:17 +01:00
Luke Barnard
c9f3a12693 Fix Autocompleter promises
Use bluebird instead of the now removed "q" library.

Also, make sure we timeout and then `reflect` to effectively do an `allSettled` that waits for all promises to either be resolved or rejected. Then we filter for those that are fulfilled and return the completions.
2017-07-13 16:51:14 +01:00
Luke Barnard
7fc10789fc Merge pull request #1217 from matrix-org/luke/fix-rte-html-links
Improve RTE HTML link handling
2017-07-13 13:57:58 +01:00
Luke Barnard
f1a4209d6b Fix indentation 2017-07-13 13:47:08 +01:00
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
David Baker
2a68cce3d5 Merge pull request #1216 from matrix-org/dbkr/history_save_unload_nullcheck
Prevent exception on page unload
2017-07-13 12:38:28 +01:00
Richard van der Hoff
086304532e Merge pull request #1213 from matrix-org/rav/bluebird
Switch matrix-react-sdk to bluebird
2017-07-13 12:06:11 +01:00
David Baker
917133219f Remove sentHistory save altogether 2017-07-13 11:53:22 +01:00
Luke Barnard
ce0f9e8803 Merge pull request #1214 from matrix-org/luke/fix-rte-remove-old-disable-md-setting
Remove `disableMarkdown` setting
2017-07-13 11:33:42 +01:00
Luke Barnard
4d844ebc34 Merge pull request #1215 from matrix-org/luke/remove-old-composer
Remove MessageComposerInputOld
2017-07-13 11:33:23 +01:00
David Baker
1e80edb43c Prevent exception on page unload
Null check when saving sent history
2017-07-13 11:30:25 +01:00
Luke Barnard
04dd98e6e9 Remove references to tabComplete, which are now redundant
(since the old composer has been removed)
2017-07-13 10:16:59 +01:00
Luke Barnard
0e12e384cb Remove TabComplete-related files 2017-07-13 10:16:42 +01:00
Luke Barnard
441954c8c1 Remove i18n for "Unknown command" 2017-07-13 09:55:11 +01:00
Richard Lewis
9a1e7ad170 Hide widget panel while it is being deleted. 2017-07-13 00:27:03 +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
Richard van der Hoff
33f330d434 Manual fixup for remaining q incantaions
* don't try to use `finally` as a static method
* work around absence of `allSettled`
2017-07-12 18:05:40 +01:00
Richard van der Hoff
0d7cc59d99 replace q method calls with bluebird ones
```
find src test -name '*.js' |
    xargs perl -i -pe 's/q\.(all|defer|reject|delay|try|isFulfilled)\(/Promise.$1(/'
```
2017-07-12 18:05:40 +01:00
Richard van der Hoff
0254d2b3a2 q(...) -> Promise.resolve
```
find src test -name '*.js' | xargs perl -i -pe 's/\b[qQ]\(/Promise.resolve(/'
```
2017-07-12 18:05:08 +01:00
Richard van der Hoff
a06bd84213 replace imports of q with bluebird
update `package.json`

```
find src test -name '*.js' |
   xargs perl -i -pe 'if (/require\(.[qQ].\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'

find src test -name '*.js' |
   xargs perl -i -pe 'if (/import [qQ]/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
```
2017-07-12 18:05:08 +01:00
Luke Barnard
6ff924fc0d Remove MessageComposerInputOld 2017-07-12 18:03:13 +01:00
Alexey Murz Korepov
c668e754f1 Translated using Weblate (Russian)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/ru/
2017-07-12 16:59:58 +00:00
Luke Barnard
0585fa048f Remove disableMarkdown setting
This was used by the old composer to control whether to interpret text as markdown prior to sending.

The new setting is `MessageComposerInput.isRichTextEnabled`.
2017-07-12 17:35:19 +01:00
Luke Barnard
6547a55852 Update to reflect previous implementation
Which was originally a74bbb424c
2017-07-12 17:12:57 +01:00
Sri Lakshmi
9d56cbcf8f Translated using Weblate (Telugu)
Currently translated at 25.7% (236 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/te/
2017-07-12 14:43:13 +00: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
Dreamwhite
a05dbb1994 Translated using Weblate (Italian)
Currently translated at 1.0% (10 of 915 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/it/
2017-07-12 01:58:44 +00: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
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
Andrey
b830f82c65 Translated using Weblate (Russian)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/ru/
2017-07-11 13:16:05 +00: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
dfa97e8452 Add comment 2017-07-10 17:48:01 +01:00
Luke Barnard
6877b99435 Strip <img src="https?://..">s when transforming imgs 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
Travis Ralston
33e56de550 Translated using Weblate (English (United States))
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/en_US/
2017-07-10 15:05:54 +00: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
b104228a7b Remove redundant functions, bindings, props 2017-07-10 14:27:41 +01:00
David Baker
49ca29e422 Lint 2017-07-10 14:07:16 +01:00
David Baker
696c72be2b Merge remote-tracking branch 'origin/develop' into dbkr/groups_better_groupview 2017-07-10 14:03:30 +01:00
David Baker
0112afad3c Merge pull request #1199 from matrix-org/luke/fix-rte-emoji-prefixes
Only allow completion of emoji in certain circumstances
2017-07-10 14:02:01 +01:00
Luke Barnard
c9df079464 Merge pull request #1176 from matrix-org/luke/feature-enable-RTE
Take RTE out of labs! 🎉
2017-07-10 13:56:00 +01:00
Luke Barnard
9643f0c00b Merge pull request #1167 from matrix-org/dbkr/my_groups
Implement 'Groups' page
2017-07-10 09:37:06 +01:00
Sri Lakshmi
20672dde03 Translated using Weblate (Telugu)
Currently translated at 20.6% (189 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/te/
2017-07-10 07:04:18 +00:00
Carlos A. Carnero Delgado
d2ddb36203 Translated using Weblate (Spanish)
Currently translated at 68.2% (625 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/es/
2017-07-10 04:16:05 +00:00
David Baker
86e717f30d Fix indenting
Also autocomplete delay was duplicated
2017-07-09 12:34:50 +01:00
Alexandre Morignot
997c1e269a Translated using Weblate (French)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fr/
2017-07-08 16:38:21 +00:00
നിദര്‍ശ്
3d0c71b1a2 Translated using Weblate (Malayalam)
Currently translated at 3.6% (33 of 915 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/ml/
2017-07-08 02:49:38 +00:00
Nathan van Beelen
c7e818d1c5 Translated using Weblate (Dutch)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/nl/
2017-07-07 20:09:49 +00:00
Kelvin
0061757c91 Translated using Weblate (Malayalam)
Currently translated at 3.6% (33 of 915 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/ml/
2017-07-07 19:27:59 +00:00
Luke Barnard
4218308bef Merge pull request #1200 from matrix-org/luke/fix-invite-sync-type-error
Possibly fix accepting invites
2017-07-07 20:03:26 +01:00
Luke Barnard
62ee0f4e02 Fix accepting invites
Accepting an invite would cause a room to arrive via /sync only for it to throw an error in the auto complete code and cause the client to go wibbly (infinite spinner or preview bar).

The logs that lead to the debugging of this are https://github.com/matrix-org/riot-web-rageshakes/issues/239

Hopefully the error being throw isn't totally unrelated but looking at the sync handling for inviteRooms in sync.js, new rooms are stored and _then_ the Room event is emitted. The Room event could trigger setUserListFromRoom, which is where the bug was. So the room should have been stored regardless of this bug and the client should have been recoverable by swapping away and viewing the room again.
2017-07-07 19:43:30 +01:00
Luke Barnard
9a272d4965 Only allow completion of emoji in certain circumstances
Which are:
 - the emoji to complete is at the start of the query
 - there is a whitespace character before the emoji
 - there is an emoji before the emoji (so that several emoji can be input in-a-row)

Fixes https://github.com/vector-im/riot-web/issues/4498 (although it seems to be fixed through some other fix)
2017-07-07 19:02:51 +01:00
David Baker
1e713557bb PR feedback 2017-07-07 18:34:40 +01:00
Kegan Dougal
f2d243443b Suppress more errors from spurious postMessage calls on the demo instance 2017-07-07 17:44:25 +01:00
zottel
ea68cca233 Translated using Weblate (German)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/de/
2017-07-07 16:30:08 +00:00
Luke Barnard
7a8f524f4a Remove two possible sources for the "AutoComplete stays visible bug
which is now https://github.com/vector-im/riot-web/issues/4537 <- there.

This does two things:
 - Track which query was the most recent one requesting completion and only process completions for that one. (In this case the empty string "" doesn't have any completions but we still track it so that previous calls with non-empty queries would not race and cause completions to be shown when we actuall don't want any.)
 - Make the "do we want to show the AutoComplete box?" logic a bit more sane
2017-07-07 15:30:31 +01:00
Sri Lakshmi
82ee0d4106 Translated using Weblate (Telugu)
Currently translated at 12.5% (115 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/te/
2017-07-07 14:02:54 +00:00
David Baker
681fd512d7 Lint 2017-07-07 13:46:05 +01:00
David Baker
c1833f9833 Merge remote-tracking branch 'origin/dbkr/my_groups' into dbkr/groups_better_groupview 2017-07-07 13:44:35 +01:00
David Baker
c21f90338d Merge remote-tracking branch 'origin/develop' into dbkr/groups_better_groupview 2017-07-07 12:02:15 +01:00
David Baker
bc8c2d442b WithMatrixClient -> withMatrixClient
because we're using it as a function rather than a React component
2017-07-07 11:34:20 +01:00
Richard Lewis
e970b68859 Merge pull request #1194 from matrix-org/rxl881/apps
Use app ID for element key and pass screen parameter to scalar.
2017-07-07 11:28:39 +01:00
David Baker
fea0a941ce Fix lint 2017-07-07 11:01:54 +01:00
David Baker
183f45bc1f Fix lint errors 2017-07-07 10:41:59 +01:00
David Baker
45986306cc Merge remote-tracking branch 'origin/develop' into dbkr/my_groups 2017-07-07 10:32:37 +01:00
David Baker
1deb406294 Fix race 2017-07-07 10:12:06 +01:00
Luke Barnard
32a01b54b8 Merge branch 'develop' into erikj/group_server 2017-07-07 10:08:49 +01:00
Richard Lewis
0a1647e5c6 Merge branch 'develop' of https://github.com/matrix-org/matrix-react-sdk into rxl881/apps 2017-07-07 09:48:24 +01:00
Bamstam
b414db06e0 Translated using Weblate (German)
Currently translated at 100.0% (916 of 916 strings)

Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/de/
2017-07-07 07:27:02 +00:00
Luke Barnard
7fdbec4046 Merge pull request #1195 from matrix-org/luke/fix-rte-emoji-suggestions2
Alter EMOJI_REGEX to include end of string ($)
2017-07-06 21:59:44 +01:00
David Baker
fa37d03db6 Improve the Group View page
Show the rooms in the group in thir various categories, etc
2017-07-06 19:13:14 +01:00
Luke Barnard
0a4f8ffead Alter EMOJI_REGEX to include end of string ($)
Fixes https://github.com/vector-im/riot-web/issues/4529 because the match must include the remainder of the query.
2017-07-06 18:11:46 +01:00
David Baker
282b63d0cf Merge pull request #1193 from matrix-org/luke/fix-create-room-preview
Fix vector-im/riot-web#4526 by pretending to join when creating a room
2017-07-06 17:58:30 +01:00
Luke Barnard
a921059432 Fix vector-im/riot-web#4526 by pretending to join
I thought about adding separate dispatches to prevent confusion but if anyone adds anything that listens to existing dispatches, they really ought to be grep-ing the world for said dispatch actions.
2017-07-06 17:40:27 +01:00
Richard Lewis
d091550ccb Use app ID for element key and pass screen parameter to scalar. 2017-07-06 15:59:59 +01:00
Luke Barnard
6404f7603c Merge pull request #1192 from matrix-org/t3chguy/markdown_allow_u
Allow underline through MD and in RTE (MD) using <u> which works with CM
2017-07-06 14:08:01 +01:00
Luke Barnard
d9a67355d2 Merge pull request #1190 from matrix-org/luke/fix-rte-paste-html-md-on
Only insert HTML into the composer in RTE mode
2017-07-06 13:59:52 +01:00
Michael Telatynski
ff7ae5b995
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/markdown_allow_u 2017-07-06 13:56:20 +01:00
Michael Telatynski
fcd8321a63
Allow underline through MD and in RTE (MD) using <u> which works with CM
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-06 13:49:13 +01:00
Michael Telatynski
6149b37245
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/room-settings-unban-no-pl 2017-07-06 13:30:40 +01:00
Michael Telatynski
c6d9ec42a2
only show unban button in RoomSettings if user has sufficient PL to do so
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-06 12:51:55 +01:00
Luke Barnard
bdefb35c64 Only insert HTML into the composer in RTE mode
If MD mode is enabled, paste the plaintext equivalent.
2017-07-06 11:52:02 +01:00
Luke Barnard
3e93930dcc Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into develop 2017-07-06 11:18:10 +01:00
Luke Barnard
6b6af3f148 Remove RTE content_state logging 2017-07-06 11:17:54 +01:00
Richard van der Hoff
c29863362f Merge pull request #1189 from matrix-org/rav/fix_duplicate_preview_key
Fix a React duplicate key error
2017-07-06 11:08:03 +01:00
Richard van der Hoff
4f8d9d869e mention preserving ordering in comment 2017-07-06 10:47:15 +01:00
Kegan Dougal
42ba3ff410 Linting 2017-07-06 10:44:32 +01:00
Richard van der Hoff
6a2d6b2e6e Fix a React duplicate key error
If a single message contains the same link twice, we get an error from React
about the clashing keys. De-dup the links to keep it quiet.
2017-07-06 10:02:25 +01:00
Kegsay
e0e321783b Append the scalar_token to the widget URL if the widget URL is a scalar URL (#1182) 2017-07-06 09:28:48 +01:00
Luke Barnard
0bf1124f1b Merge pull request #1181 from matrix-org/luke/fix-rte-draft-persist
Implement MessageComposerStore to persist composer state when room switching
2017-07-05 18:24:27 +01:00
Luke Barnard
7f1d8e3c90 Merge pull request #1188 from matrix-org/luke/feature-rte-visual-bell
Add visual feedback for when there are no completions available
2017-07-05 18:23:10 +01:00
Luke Barnard
14ddf4e2aa Merge pull request #1187 from matrix-org/luke/fix-rte-emoji-filter-supported
Filter out unsupported emoji from the emoji meta data
2017-07-05 18:21:50 +01:00
Luke Barnard
29e793f591 Merge pull request #1180 from matrix-org/luke/fix-rte-force-immediately
When hitting "tab" use an autocompleteDelay of 0
2017-07-05 18:20:48 +01:00
Luke Barnard
89d0ec4de8 Merge pull request #1179 from matrix-org/luke/fix-query-matcher-empty-query
Don't try to match with an empty query string
2017-07-05 18:20:25 +01:00
Luke Barnard
d78168d407 Add visual feedback for when there are no completions available
Attempts to kep parity with old composer by using the same #faa colour but uses an animation instead of a js timeout.

Fixes https://github.com/vector-im/riot-web/issues/4490
2017-07-05 18:14:22 +01:00
Luke Barnard
2de4dd7b71 Filter out unsupported emoji from the emoji meta data
Because apparently emojione provides meta data for more than the emojis it supports itself.

Fixes https://github.com/vector-im/riot-web/issues/4504
2017-07-05 17:09:16 +01:00
Richard van der Hoff
a20ed2f632 Add some logging to track down flaky test
We had a test failure where apparently the MatrixClient failed to start
... let's try and figure out why.
2017-07-05 16:20:21 +01:00
Luke Barnard
b3db6344ae Fix import for Rooms so that DMs can be created 2017-07-05 15:00:50 +01:00