Commit Graph

385 Commits

Author SHA1 Message Date
Michael Telatynski
24599ace32
don't track error messages
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-08-10 13:49:11 +01:00
Luke Barnard
b2fd4be166 Merge pull request #1289 from matrix-org/luke/fix-quote-innerText
Quote by taking the innerText of eventTiles
2017-08-10 10:35:49 +01:00
Luke Barnard
678c472b75 Quote by taking the innerText of eventTiles
because using `body` gives inconsistent results - sometimes it will contain markdown and sometimes not, and this may not correspond with the `formatted_body`.

TODO: Do quoting proper - using `in_response_to`.
2017-08-10 10:14:14 +01:00
Luke Barnard
390e77ee22 Merge pull request #1288 from matrix-org/luke/track-richtext-mode
Track whether the user has richtext mode enabled
2017-08-10 09:31:09 +01:00
Luke Barnard
fc6977e68d Track RT mode once we've retrieved the setting from account data 2017-08-09 19:00:38 +01:00
Luke Barnard
e121440d05 Track whether the user has richtext mode enabled 2017-08-09 18:39:06 +01:00
Luke Barnard
2d47d3d2c3 Hide autocomplete when RTE selection state (cursor) changes 2017-08-09 17:36:35 +01:00
Luke Barnard
610b2a3a42 For mentions, always use rawDisplayName and remove (IRC) 2017-08-09 10:40:06 +01:00
Luke Barnard
503fa6a7b3 Always use message body when quoting
(not formatted_body)

This is because draft-js has regressed with a bug that causes some entities to not exist within a given ContentState - see vector-im/riot-web#4756
2017-08-08 14:59:56 +01:00
David Baker
ca2273519d Merge pull request #1277 from matrix-org/luke/feature-pills-hide-avatar-setting
Add optional setting for hiding avatars in <Pill>s
2017-08-08 14:01:34 +01:00
Luke Barnard
91a1cc4431 Mandate ctrl/meta ONLY for a subset of key bindings
Because by default dratf-js doesn't check that other modifiers are _not_ pressed.
2017-08-08 13:36:43 +01:00
Luke Barnard
b08d32371d Add optional setting for hiding avatars in <Pill>s
As part of https://github.com/vector-im/riot-web/issues/4640#issuecomment-316659445
2017-08-08 11:13:29 +01:00
Luke Barnard
7018deee44 Fix ctrl+a, backspace toggling block format
Now it will delete the selected range (and not toggle the block format). Fixes vector-im/riot-web#4753
2017-08-07 17:16:42 +01:00
Luke Barnard
641fda0162 Adjust comment 2017-08-07 16:29:22 +01:00
Luke Barnard
d9d8f2055f Allow default for ctrl+shift+b, ctrl+shift+u in RTE
fixes vector-im/riot-web#4750
2017-08-07 16:23:37 +01:00
Luke Barnard
a27eefd893 Fix a couple of more errors due to API changes 2017-08-03 15:20:44 +01:00
Luke Barnard
901cbf495d Update decorator strategy API in accordance with recent changes to 0.11.0
See 590cdc6c54, which is a change to the API not mentioned in the migration to v0.10 notes https://draftjs.org/docs/v0-10-api-migration.html
2017-08-03 12:02:29 +01:00
Luke Barnard
1d1cd5f691 Reflect API change for decorator strategy 2017-08-03 11:36:07 +01:00
Luke Barnard
fb5dc295aa Reflect API change for getting an Entity 2017-08-03 11:29:26 +01:00
Luke Barnard
124795006c Reflect API change for creating an Entity 2017-08-03 11:18:56 +01:00
Luke Barnard
7fcb8c5ff0 Merge pull request #1261 from matrix-org/luke/fix-agressive-emoji-auto-replace
Only auto-replace emoji following ^ or \s
2017-08-01 15:56:42 +01:00
Luke Barnard
438b63bee2 Only auto-replace emoji following ^ or \s
So as not to cause issues when typing e.g. `This is what was tested: ` (the "d:" used to be transformed into an emoji)
2017-08-01 14:26:30 +01:00
Michael Telatynski
4bdaa15c47
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/i18n_analytics 2017-07-28 21:01:59 +01:00
Luke Barnard
8a5f2bf2ca Interpret a split-block as format toggle for an empty block
(`split-block` is emitted when "return" is pressed)

part of fixing https://github.com/vector-im/riot-web/issues/4580
2017-07-28 14:46:57 +01:00
Luke Barnard
6cb8b12cda Instead of inserting MD for completion, convert the Entity later
This makes sure that the length of the range for a completed Entity = the length of the text in the decoration, which apparently draftjs assumes when calculating selection state offsets.

Fixes https://github.com/vector-im/riot-web/issues/4666
2017-07-27 18:17:41 +01:00
Michael Telatynski
bf98c0da7c
un-i18n Modal Analytics
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-07-27 17:19:18 +01:00
Luke Barnard
5c7891a25b Remove logs 2017-07-27 15:26:36 +01:00
Luke Barnard
e71df44fc9 Fix /join #alias command in markdown mode
Tab-completing a room alias inserts a markdown link, which is now stripped before a command is parsed. We also strip the MD links when doing the autocompletion itself (getAutocompleteQuery).

There is still an issue where `/invite` will not work at all with tab-completion - the text of a user Pill is not the userID but rather the display name, which cannot be used as an argument to the command.
2017-07-27 15:18:06 +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
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
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
Luke Barnard
e315b30f6a Merge branch 'develop' into luke/fix-rte-pt-md-mentions 2017-07-21 18:06:31 +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
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
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
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
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
Luke Barnard
352f70f9ce Implement old composer feature that inserts ': ' or ' '
after a user completion
2017-07-20 11:52:18 +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
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
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
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
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
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
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
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
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
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
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
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
Luke Barnard
b104228a7b Remove redundant functions, bindings, props 2017-07-10 14:27:41 +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
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
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
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
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
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
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
3d5b3ed7ad Use ContentState instead and persist over localStorage 2017-07-05 11:49:34 +01:00
Luke Barnard
084a933dbd Implement MessageComposerStore to persist composer state across room switching
This behaviour was present in the old composer but implemented using local storage. This is unecessary as we don't really care about our drafts across clients, the important thing is that our draft is kept when switching rooms.

As a bonus, ifnore vertical arrow key presses when a modifier key is pressed so that the room switching keys (alt + up/down arrow) don't also cause history browsing (or autocomplete browsing).
2017-07-05 10:24:55 +01:00
Luke Barnard
77348e6201 Remove spurious, unused code 2017-07-04 15:20:00 +01:00
Luke Barnard
664f3acc3c Only move through history if caret at start or end of line
As suggested by @dbkr (because this is what we do for the old composer), only move through history when the caret is that the beginning of the first line (block) or end of the last.

This has the nice property of being able to move the caret up to a really long message: fixes https://github.com/vector-im/riot-web/issues/4471
2017-07-04 10:12:06 +01:00
David Baker
72eed70a84 Merge pull request #1173 from matrix-org/luke/fix-rte-forgets-me
Strip out "/me" after committing to RTE history
2017-07-03 15:59:07 +01:00
Luke Barnard
775f5a0e5b Strip out "/me" after committing to RTE history
So that history can include emotes

Fixes https://github.com/vector-im/riot-web/issues/4472
2017-07-03 15:47:03 +01:00
Luke Barnard
86889b8e8c When formatting with MD enabled, move selection inside ** or equivalent
Fixes https://github.com/vector-im/riot-web/issues/3225

Also insert `\n` after code-block and blockquote to fix https://github.com/vector-im/riot-web/issues/2746
2017-07-03 15:23:24 +01:00
Luke Barnard
6bc40a112c Always store sent MD messages as MD in history
Because converting them to HTML when they got sent as HTML seems a bit pointless when they're just going to get transformed back again when retrieved from history.

Fixes regression https://github.com/vector-im/riot-web/issues/4465
2017-06-30 15:47:48 +01:00
Luke Barnard
15cfe5b8e4 Only allow history selection when on the first or last line
(of a multi-line or otherwise message in the editor)
2017-06-30 14:27:26 +01:00
Luke Barnard
e7a2c3b975 Only send HTML when using RTE when necessary
When there are no styled blocks or inline styles applied within blocks, just send text instead of HTML.

Also, don't add <br /> for the last <p> (the last block).

Fixes https://github.com/vector-im/riot-web/issues/3147
2017-06-30 11:27:00 +01:00
Luke Barnard
8b8260c509 Move cursor to end of editor when quoting
When quoting a message, move the selection to the end of the input box. Fixes https://github.com/vector-im/riot-web/issues/2336
2017-06-29 17:22:34 +01:00
Luke Barnard
e5e7dec131 Fix #4422 by persisting the "currently composed" message
This allows for browsing through history without losing the message currently being composed.
2017-06-29 17:02:19 +01:00
Luke Barnard
6bd7284161 Be sensible about handling up/down vs tab/tab-shift
Fixes https://github.com/vector-im/riot-web/issues/4445
2017-06-29 15:07:06 +01:00
Luke Barnard
8912400675 Add XXX for https://github.com/vector-im/riot-web/issues/4445 2017-06-28 18:05:39 +01:00
Luke Barnard
d5585e29b1 Merge pull request #1155 from matrix-org/luke/fix-rte-cursor-at-start-of-history
Fix issue where the cursor is put at the start of selected history item
2017-06-28 17:17:56 +01:00
Luke Barnard
d696373bc2 Fix issue where the cursor is put at the start of selected history item
Leading to strange behaviour when selecting all and deleting it.

Fixes https://github.com/vector-im/riot-web/issues/4450
2017-06-28 15:29:07 +01:00
Luke Barnard
bcb67bb273 Refactor shared code between onUpArrow and onDownArrow 2017-06-28 15:20:16 +01:00
Luke Barnard
f73fa4b49b Move processing into renamed function processHtmlforSending
And explain why this fix is necessary
2017-06-28 11:49:50 +01:00
Luke Barnard
1523d304f2 WIP to prevent RTE from deleting current message input when up arrow pressed 2017-06-28 10:30:59 +01:00
Luke Barnard
69589c19e7 Work around draft-js-export-html#62 by post-processing <br>\n
Fixes https://github.com/vector-im/riot-web/issues/4446 by post-processing the output HTML from draft-js-export-html by replacing `<br>\n` with `<br>`. This works for content within or outside of `<pre>`. If we replace with `\n` instead, the newlines only apply in `<pre>` tags so we use `<br>`.
2017-06-27 18:33:45 +01:00
Luke Barnard
5307731dfd Overide default draft-js handling of pasting text/html
This is surprisingly needed to avoid an issue with draft-js that causes multi-line madness when pasting code and then applying format-as-code to it - https://github.com/vector-im/riot-web/issues/2120#issuecomment-271735729.

The issue sounds like it is https://github.com/facebook/draft-js/issues/170#issuecomment-195026203 and the suggstion is to override the text pasting handler https://github.com/facebook/draft-js/issues/170#issuecomment-215983216. Meanwhile they haven't modified the default pasting behaviour afaics.

I've discovered a separate issue that is apparent even after this suggested fix. (https://github.com/vector-im/riot-web/issues/4446)
2017-06-27 17:10:28 +01:00
Luke Barnard
ba31a32440 Allow toggling of dev tools when RTE focussed 2017-06-27 15:17:57 +01:00
Luke Barnard
9404dd30c5 Use <del> for strikeout
We've swapped to commonmark, which uses <del> instead of ~~ for strikeout, so make the RTE insert <del> when we apply strikeout. Also, when ~~ is inserted, transform them into <del> for simplicity. This means giving an input of ~~test~~ is effectively the same as giving an input of <del>test</del>.
2017-06-23 18:19:06 +01:00
Luke Barnard
89afcfd897 Linting 2017-06-23 17:35:07 +01:00
Luke Barnard
87609582c6 Merge branch 'develop' into rte-fixes2
Conflicts:
	package.json
	src/autocomplete/CommandProvider.js
	src/autocomplete/UserProvider.js
	src/components/structures/RoomView.js
	src/components/structures/UserSettings.js
	src/components/views/rooms/MessageComposerInput.js
2017-06-23 15:30:06 +01:00
Matthew Hodgson
c173861b27 Merge pull request #1021 from Bitim/feature/rtl-languages-support
Better RTL support
2017-06-08 14:43:18 +01:00
saul.kredi@krutt.org
159a920dc8 Better RTL support 2017-06-03 18:52:45 +03:00
Michael Telatynski
4032a820f0 move KEY_M to KeyCode
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-02 21:46:08 +01:00
Michael Telatynski
464863acd6 remove unused imports
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-06-02 21:35:55 +01:00
Kegan Dougal
547f10bcbb Add translations for slash command failures 2017-06-01 15:44:56 +01:00
David Baker
443ab1add7 Put back default strings on dialogs
But make them work by calling _t in render rather than
getDefaultProps().

Also sort out some 'Warning!' strings
2017-05-25 18:20:48 +01:00
David Baker
5c359e63ab Bulk change counterpart imports
to use languageHandler wrapper func
2017-05-25 11:39:08 +01:00
David Baker
d419c42a4f Squash merge https://github.com/matrix-org/matrix-react-sdk/pull/801 2017-05-23 15:16:31 +01:00
Richard van der Hoff
8695397abb Support for pasting files into normal composer
We don't seem to be in any danger of getting a working RTE any time soon, so
implement file pasting in the normal composer too.
2017-05-17 01:43:13 +01:00
Michael Telatynski
d7c88a9813 only removed /me , remove anyway to fix vector-im/riot-web#3733
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-05-13 15:20:31 +01:00
Luke Barnard
f5a23c14df Remove redundant bind 2017-05-08 17:32:26 +01:00
Luke Barnard
fe121126f5 Merge branch 'develop' into rte-fixes
Conflicts:
	src/UserSettingsStore.js
	src/autocomplete/EmojiProvider.js
	src/components/views/rooms/MessageComposerInput.js
2017-05-08 17:08:59 +01:00
Michael Telatynski
6cbd04045d change the now working defaults
to what they effectively were when defaultValue was broken
(hopefully tests now pass)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-04-25 22:17:25 +01:00
Matthew Hodgson
db996f678c show better errors when slash commands fail 2017-04-23 01:32:51 +01:00
turt2live
64e416e117 Add option to not send typing notifications
Addresses vector-im/riot-web#3220

Fix applies to both the RTE and plain editor.

Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-04-21 14:50:26 -06:00
Matthew Hodgson
bf8973ad33 avoid leading space in HTML /me too 2017-03-19 21:33:18 +00:00
Lieuwe Rooijakkers
c697b48f99 fix leading extraneous space in emotes 2017-03-19 21:52:24 +01:00
Matthew Hodgson
3aaf37df1a beautify a tonne more errors 2017-03-12 22:59:41 +00:00
Aviral Dasgupta
8dc7f8efe2
rte: remove logging and fix new history 2017-03-10 21:10:27 +05:30
Aviral Dasgupta
6004f6d610
rte: fix history 2017-03-10 20:34:31 +05:30
Matthew Hodgson
6c7b191577 Merge pull request #605 from SijmenSchoon/feature/pastefiles
Add support for pasting files into the text box
2017-03-09 17:55:58 +00:00
Aviral Dasgupta
79f481f81e
rte: special return handling for some block types 2017-03-07 04:40:25 +05:30
Aviral Dasgupta
f5b52fb488
rte: change list behaviour in markdown mode 2017-03-07 04:15:28 +05:30
Aviral Dasgupta
3a07fc1601
fix code-block for markdown mode 2017-03-07 04:09:27 +05:30
Aviral Dasgupta
5fbe06ed91
force editor rerender when we swap editorStates 2017-03-07 04:09:26 +05:30
Aviral Dasgupta
46d30c378d
fix tab focus issue in MessageComposerInput
onTab was incorrectly implemented causing forceComplete instead of
focusing the editor
2017-03-07 04:09:26 +05:30
Aviral Dasgupta
aaac06c6d3
run eslint --fix over MessageComposerInput 2017-03-07 04:09:25 +05:30
Aviral Dasgupta
48376a32c2
refactor: MessageComposer.setEditorState to overridden setState
The old approach led to a confusing proliferation of repeated
setState calls.
2017-03-07 04:09:25 +05:30
Aviral Dasgupta
f4c0baaa2f
refactor MessageComposerInput: bind -> class props 2017-03-07 04:09:25 +05:30
Luke Barnard
fd146a732b Clarify non-e2e vs. e2e /w composers placeholder
For E2E rooms, display "Send an encrypted message…" otherwise display "Send a plaintext message…" as the placeholder for the input box in [old] message composer.
2017-02-21 15:33:44 +00:00
Richard van der Hoff
67bd2cf9dd Merge branch 'matthew/warn-unknown-devices' into matthew/blacklist-unverified 2017-01-26 14:09:25 +00:00
Richard van der Hoff
70190be65c Factor out common onSendMessageFailed 2017-01-25 22:23:21 +00:00
Matthew Hodgson
7bc3fc8696 make UnknownDeviceDialog work again, other than the mess of vector-im/vector-web#3020 2017-01-22 01:28:43 +01:00
Matthew Hodgson
071e364be2 improve the verify warning if blacklisting is unabled 2017-01-21 17:56:48 +00:00
Matthew Hodgson
2e15e8f9b4 very barebones support for warning users when rooms contain unknown devices 2017-01-21 05:13:36 +00:00
Matthew Hodgson
937f13d578 fix a bunch of dark-theme buttons 2017-01-20 21:00:22 +00:00
David Baker
18d4d3392a Fix a bunch of linting errors
eslint --fix and a few manual ones
2017-01-20 14:22:27 +00:00
Johannes Löthberg
9c1c657a1e Markdown: delete remaining pre-split relics
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-01-19 11:55:36 +01:00
Johannes Löthberg
30bd01cdf2 Markdown: Split up render function into toHTML/toPlaintext
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-01-18 19:29:11 +01:00
Johannes Löthberg
893a5c971f Fix escaping markdown by rendering plaintext
We still need to parse "plaintext" messages through the markdown
renderer so that escappes are rendered properly.

Fixes vector-im/riot-web#2870.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-01-17 16:23:58 +01:00
Sijmen Schoon
ef88e02931 Add support for pasting into the text box
Only supports the new rich-text-supporting text editor
2017-01-08 02:21:36 +01:00
Richard van der Hoff
03988015aa Fix 'Quote' for e2e messages
Fixes https://github.com/vector-im/vector-web/issues/2612
2016-11-21 09:19:40 +00:00
Richard van der Hoff
78c3d5943a Fix a load of warnings in the tests
Stub things out to make the tests not throw warnings, so we can see the actual
problems.
2016-10-11 14:20:40 +01:00
David Baker
bbfc05b0c0 Fix name of text emote sending & fix tests 2016-09-26 10:20:56 +01:00
David Baker
bf037ed6c7 Add comment 2016-09-23 19:09:32 +01:00
David Baker
db3f0d298a Make RTE mode use the new Markdown wrapper class
Equivalent of https://github.com/matrix-org/matrix-react-sdk/pull/492 for rich text mode
2016-09-23 18:50:25 +01:00
Aviral Dasgupta
44217422d0 Force-hide autocomplete after sending message.
Fixes vector-im/vector-web#2128
2016-09-21 07:28:07 +05:30
Aviral Dasgupta
6befb09509 Replace <p>s with <br/>s consistently
Also, allow newlines in /commands.
Fixes vector-im/vector-web#2114, vector-im/vector-web#2165.
2016-09-16 21:40:00 +05:30
Matthew Hodgson
8bb9422907 Merge pull request #466 from aviraldg/feature-autocomplete-behaviour
Improve autocomplete behaviour
2016-09-13 16:17:23 +01:00
Aviral Dasgupta
79e5e6f6fe Fix force completion and hide rooms with no alias 2016-09-13 18:02:33 +05:30
Aviral Dasgupta
fbf2d5f96c Fix tests (wip) 2016-09-13 16:46:20 +05:30
Aviral Dasgupta
b62622a814 Improve autocomplete behaviour
Fixes vector-im/vector-web#1761
2016-09-13 15:46:02 +05:30
Remi Rampin
8cab40d987 Disable markdown line breaks
Stop combinations of - and _ turning into a line break.
2016-09-12 17:51:59 -04:00
Aviral Dasgupta
fec1e4d4c1 Add some tests for the rich text editor 2016-09-09 18:07:42 +05:30
Aviral Dasgupta
8da7b98ad0 RTE: Remove dead code, fix <del> styling 2016-09-08 11:21:39 +05:30
Aviral Dasgupta
c11232742b Fix focus and toggling issues in formatting bar 2016-09-08 02:46:56 +05:30
Aviral Dasgupta
8974442084 Hide empty autocomplete and remove word counter 2016-09-08 00:43:10 +05:30
Aviral Dasgupta
802ec1169f Fix Markdown conversion to not add extra \n
Fixes vector-im/vector-web#2094
2016-09-08 00:03:55 +05:30
Aviral Dasgupta
f0f20beae0 RTE format bar enhancements 2016-09-08 00:03:54 +05:30
Aviral Dasgupta
0c0c44b050 Formatting toggle, markdown indicator, quoting
Fixes vector-im/vector-web#1825
2016-09-08 00:02:55 +05:30
Aviral Dasgupta
71251293e4 RTE formatbar (wip)
Fixes vector-im/vector-web#2024
2016-09-08 00:02:16 +05:30
David Baker
1b39f02141 Merge pull request #335 from aviraldg/feature-composer-emoji
feat: code cleanup & emoji replacement in composer
2016-08-03 16:18:56 +01:00
David Baker
efdcc6da98 Merge pull request #384 from aviraldg/fix-composer-up-down
fix: allow up/down normally for no completions
2016-08-03 13:55:13 +01:00
Aviral Dasgupta
a2d64f5119 fix: allow up/down normally for no completions
Autocomplete current eats up up/down key events by unconditionally returning
true for onUpArrow and onDownArrow. Instead, only do that if there are completions actually visible.
2016-08-03 18:04:52 +05:30
Aviral Dasgupta
1f9a396fa5 fix: autocomplete to use tab instead of return 2016-08-03 17:51:40 +05:30
Aviral Dasgupta
b334522168 feat: code cleanup & emoji replacement in composer 2016-07-08 12:54:28 +05:30
Aviral Dasgupta
cccc58b47f feat: implement autocomplete replacement 2016-07-03 22:15:13 +05:30
Aviral Dasgupta
a74db3a815 Get basic keyboard selection working 2016-06-21 18:33:39 +05:30
Aviral Dasgupta
fb6eec0f7d Hide/show autocomplete based on selection state 2016-06-21 15:46:20 +05:30
Aviral Dasgupta
4af983ed90 Style changes and improvements in autocomplete 2016-06-20 13:52:55 +05:30
Aviral Dasgupta
b9d7743e5a Emoji provider, DDG working, style improvements 2016-06-17 04:58:09 +05:30
Aviral Dasgupta
8b1332cd29 Use different keys for new MessageComposerInput 2016-06-16 14:46:09 +05:30
Aviral Dasgupta
3f1b57b35b Fix cursor bug, persist editor mode & rte default 2016-06-15 00:13:34 +05:30
Aviral Dasgupta
ba69e4365d more RTE fixes 2016-06-14 19:28:51 +05:30
Aviral Dasgupta
8cb086ef31 use constants for keycodes in RTE 2016-06-14 19:14:09 +05:30
Pedro Ferreira
8f45f168d5 Fix highlighting behaviour on switch
Hopefully made the code a little bit clearer.
2016-06-12 01:08:31 +02:00
Pedro Ferreira
a5a3e4e915 Basic Markdown highlighting 2016-06-12 01:07:16 +02:00
Aviral Dasgupta
c0d7629980 get /commands working again 2016-06-12 00:11:27 +05:30
Aviral Dasgupta
b960d220d2 cleanup, better comments, markdown hotkeys 2016-06-11 22:24:09 +05:30
Aviral Dasgupta
e4217c3fb7 rte improvements, markdown mode 2016-06-11 15:52:08 +05:30
Aviral Dasgupta
4e0720db12 Fix MessageComposerInput.setLastTextEntry 2016-06-10 00:03:40 +05:30
Aviral Dasgupta
29cdd1fc41 user and room decorators, history & typing notifs 2016-06-09 23:53:09 +05:30
Aviral Dasgupta
fe76eb9f73 minor improvements
- use <p> for unstyled blocks
- fix return key bug
- editor placeholder
2016-05-28 12:02:35 +05:30
Aviral Dasgupta
001011df27 Initial version of rich text editor 2016-05-27 10:15:55 +05:30
Richard van der Hoff
8b8ee21765 Catch pageup/down and ctrl-home/end at the top level
Make the scroll keys work when the focus is outside the message panel.
2016-04-05 13:40:36 +01:00
Richard van der Hoff
6ff41c40b6 Split a textinput component out of MessageComposer
Split the text entry section out of MessageComposer: it has a lot of stuff
which won't be needed if we disable input
2016-03-24 11:25:41 +00:00