Commit Graph

385 Commits

Author SHA1 Message Date
Bruno Windels
716719187d only capture enter if something was selected in completions 2019-05-31 15:05:09 +02:00
Travis Ralston
d81804e0fe Merge branch 'develop' into matthew/low_bandwidth 2019-05-30 19:42:09 -06:00
Bruno Windels
e1d1c8f99c
Merge pull request #2968 from npny/npny/autocomplete-prevent-send-on-enter
Hide autocomplete on Enter key press instead of sending message
2019-05-28 09:17:28 +00:00
Bruno Windels
e193522db1 PR feedback: put findPrev/NextEditableEvent in one function with flag 2019-05-27 16:22:55 +02:00
Bruno Windels
bd3dbd1a89 remove edit history from main composer 2019-05-24 14:42:57 +02:00
Bruno Windels
3591eedcfa move between editable events with arrow keys 2019-05-24 14:42:33 +02:00
Matthew Hodgson
81338306b0 fix lint 2019-05-19 21:00:14 +01:00
Matthew Hodgson
64e2de5b47 make autocomplete work again 2019-05-19 20:56:07 +01:00
Matthew Hodgson
dbc6815abf make EmojiProvider and stripped-emoji.json work 2019-05-19 20:48:18 +01:00
Matthew Hodgson
a8297a7698 fix build 2019-05-19 16:11:12 +01:00
Matthew Hodgson
dc72641264 replace emojione with twemoji. completely untested & debugged & unoptimised 2019-05-19 15:23:43 +01:00
Pierre Boyer
a62f68bd39 Hide autocomplete on Enter key press instead of sending message 2019-05-14 13:44:01 +02:00
Ross Brandes
15e68c3ba1
Make alt-enter insert new line on macOS
Alt-enter is a common macOS shortcut for inserting a new line in an
input that has a separate action tied to the enter key.

Signed-off-by: Ross Brandes <ross.brandes@gmail.com>
2019-04-15 21:15:38 -04:00
David Baker
c8ba7d3434 Fix a few bugs introduced in file upload rework
* Fix the widget picture_snapshot command (not that I can find
   anything that uses it)
 * Remove unused prop
 * Fix plural on ContentMessages
2019-04-05 15:09:07 +01:00
David Baker
5b2cee2fc1 Implement redesigned upload confirmation screens
Also fairly significant refactor of the uploading code: there are
a number of different ways of triggerring a file upload and each
went through a different code path (the media config size limit
worked on one of those paths). Basically take a lot of code out
of the views and put it into ContentMessages.

Sorry about the size of this patch.

https://github.com/vector-im/riot-web/issues/7565
2019-04-01 16:42:41 +01:00
Bruno Windels
f71a9f10dd remove onChildResize in RoomView as it's unused 2019-03-15 10:16:21 +01:00
Michael Telatynski
6b07195b63 Add missing permalinkCreator prop
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-03-01 09:36:36 +00:00
Bruno Windels
fb672ffb28 change handling of event permalinks in replies 2019-02-25 18:43:08 +01:00
J. Ryan Stinnett
150c941340
Merge pull request #2682 from jryans/simplify-composer-state-change
Remove duplicated conversion from `enableRichText`
2019-02-22 16:57:37 +00:00
J. Ryan Stinnett
f5c477bbc8 Remove duplicated conversion from enableRichText
`enableRichText` would convert the editor state between rich and md versions
explicitly, but then it would also call `createEditorState`, which can do the
same thing.

This removes the duplication, and also supplies the right arguments to
`createEditorState` so it can do its work correctly.
2019-02-22 15:48:44 +00:00
J. Ryan Stinnett
ccd4dee0d2 Isolate rich text notifications from other input changes
The step that would notify parent components of rich text state changes was
stirred into the input's change handler, which leads to race which the parent is
sometimes notified of the old rich text state instead of the new.

Here we avoid this complication by using a separate path for sending the rich
text state when we know we have updated it correctly.
2019-02-22 15:18:24 +00:00
J. Ryan Stinnett
3e6199c0f7 Change Markdown buttons to onClick
`AccessibleButton` expects click handlers, which we can use here, as long we
make some additional changes to avoid race processing the new state (see
subsequent patch).

Fixes https://github.com/vector-im/riot-web/issues/8866
2019-02-22 15:18:06 +00:00
J. Ryan Stinnett
5fb990eb5f Convert Markdown button to SVG mask
This makes it easier to theme via CSS, which helps with the dark theme.
2019-02-18 18:26:52 +00:00
Matthew Hodgson
ce24165e19 port over low_bandwidth mode to develop 2019-02-08 16:44:03 +00:00
Travis Ralston
cb6f415a05 Be more positive with setting labels
Fixes https://github.com/vector-im/riot-web/issues/6435

This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write).

To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name.

This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-24 20:57:40 -07:00
J. Ryan Stinnett
20e296b20e Convert image URLs in React to require calls
This allows Webpack to insert the proper image URL after builds steps like
adding a hash and so on. The path you supply to `require` is relative to the JS
source file, just like any other would be.
2019-01-17 22:06:49 -06:00
Bruno Windels
8c30d05eb8 Revert "Merge pull request #2348 from matrix-org/bwindels/roomgridview-experimental"
This reverts commit ece5cb1fcc, reversing
changes made to 64a3d2521c.
2019-01-17 10:29:37 +01:00
David Baker
9903c61a21 Fix lint errors in MessageComposerInput
and remove from ignored files

Missed a load of the async arrows functions when changing them because
they were in the ignored files, so trying to chip away at this.

A lot of these were unused imports / variables. Probably the only
interesting one was a 'this' in a non-member function which I've moved
to be a member function.
2019-01-10 09:41:26 +00:00
David Baker
b9719abbc2 Oops, missed some asyncs 2019-01-09 19:36:34 +00:00
David Baker
f269b5fbbc Fix spaceless async in ignored files too 2019-01-09 19:14:30 +00:00
Bruno Windels
254427461d fix PR feedback 2019-01-09 12:48:13 +01:00
Bruno Windels
c8243357ea disable editor history/persistence when in grid to avoid pesky bug 2018-12-13 13:01:59 +01:00
Bruno Windels
44200a6f78 only listen and dispatch to room-local dispatcher in room view, composer 2018-12-13 13:01:59 +01:00
Bruno Windels
df8539d6bc pass the RoomViewStore down with a prop instead of global var.
this will allow to have more than 1 RoomView further on
2018-12-13 12:59:18 +01:00
Aaron Raimist
49ce4ef117
eslint --fix src/
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-26 22:50:38 -05:00
David Baker
156ffd1334 Fix autoreplacement of ascii emoji
More slate API updates in code paths I didn't test

Fixes https://github.com/vector-im/riot-web/issues/7509
2018-10-26 17:01:44 +01:00
David Baker
5e81e5b8b8 Fix variable scope 2018-10-25 15:07:19 +01:00
David Baker
401f6333ed Do...while loops are a thing 2018-10-25 14:54:32 +01:00
David Baker
78d8d22457 Fix emoji replacement in composer
* Re-scan the slate document tree on each emoji replacement since
   doing a replacement will invalidate all the offsets we have.
 * Reset the emoji regex each time we use it.

Fixes https://github.com/vector-im/riot-web/issues/7550
2018-10-24 16:46:06 +01:00
Aaron Raimist
a66dbccef8
Fix lint errors in MessageComposerInput.js
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-11 22:46:55 -05:00
David Baker
3efc09586b More API changes 2018-10-11 10:47:36 +01:00
David Baker
4d1f2cdfa9 Fix quote post slate update
Missed API update
2018-10-11 10:29:55 +01:00
David Baker
4e1fabd140 Remove spurious ...atributes in the wrong place
We already have it above
2018-10-09 16:05:14 +01:00
David Baker
c1f51a76dd Update to new version of slate
Lots of fixes here as a lot of the API has changed (eg. anchorKey /
offsetKey are now anchor.key and offset.key, and collapseFocusToThing
is moveFocusToThing).

Also changes the ref to a function (sorry for lumping this into the
same PR).

Hopefully will fix https://github.com/vector-im/riot-web/issues/7105
2018-10-09 10:55:55 +01:00
Will Hunt
17915b5082
Merge branch 'develop' into hs/purge-irc-hack 2018-10-03 19:39:14 +01:00
Will Hunt
fe788486b7 Drop (IRC) suffix hacks 2018-10-03 19:34:06 +01:00
David Baker
9e64a22884 s/DidMount/WillMount/ in MessageComposerInput
This fixes the tests that broke with https://github.com/matrix-org/matrix-js-sdk/pull/717

This is because of https://github.com/vector-im/riot-web/blob/master/test/app-tests/joining.js#L63
which prevents the DOM nodes from actually ending up in the DOM, even though the react components
get rendered. This means that WillMount and WillUnmount are called, but not DidMount.

Using WillMount is more symmertrical anyway since the resulting teardown code must be in
WillUnmount (since there is no DidUnmount).
2018-09-06 11:44:13 +01:00
Michael Telatynski
f264075369
null-guard history properly
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-26 17:11:32 +01:00
Michael Telatynski
265e4267b8
remove faulty onBlur/onFocus code which caused selection to rollback
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-26 15:00:43 +01:00
Michael Telatynski
020e714b85
fix focus and too many <p>s after a Event>Quote in RT mode
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-24 15:54:24 +01:00