Commit graph

189 commits

Author SHA1 Message Date
Travis Ralston
d56f0f2a25 Convert many imports to handle ES6 exports
Reliant upon https://github.com/matrix-org/matrix-react-sdk/pull/3761
2019-12-22 21:04:42 -07:00
Michael Telatynski
d4d51dc61f Rip out the remainder of Bluebird 2019-11-18 10:03:05 +00:00
Michael Telatynski
54dcaf1302 Replace bluebird specific promise things. Fix uses of sync promise code.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-11-14 13:52:17 +00:00
Michael Telatynski
c882b7f332 Improve A11Y for Autocomplete Commands and DDG
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-10-14 10:37:10 +01:00
Travis Ralston
7d1a04cb12
Merge pull request #3500 from matrix-org/travis/permalinks
Support local permalinks for unfederated instances
2019-10-01 08:41:23 -06:00
Travis Ralston
fc66e69c02 Rename RoomPermalinkCreator -> Permalinks due to scope
The file handles more than just a RoomPermalinkCreator, so we should name it accordingly.
2019-09-30 20:39:58 -06:00
Travis Ralston
64aa6695f5 Move matrix-to.js to utils/permalinks/RoomPermalinkCreator
Just a little bit of refactoring to make the feature of custom prefixes a bit easier.
2019-09-30 12:16:46 -06:00
Michael Telatynski
f299f7e092 delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-09-30 14:32:42 +01:00
Michael Telatynski
f160a308b4 Make Autocomplete more accessible to screen reader users
Use ARIA to:
 + notate that the composer has an autocomplete
 + notate the open/closed state of the autocomplete
 + notate the name of the open autocomplete options
 + notate the ID of the highlighted autocomplete option
 + improve naming of emoji autocomplete options for screen readers

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-09-30 14:04:39 +01:00
Bruno Windels
228905bec2 insert command completion as command part (instead of plain)
this prevents the command being sent as plain text

this adds a `type` property to completions to decide which
parts should be inserted into the composer, hence deciding how
they will be rendered.
2019-09-23 14:39:19 +02:00
Matthew Hodgson
e3d3b155d6 remove errant debug 2019-05-20 10:08:34 +01:00
Matthew Hodgson
b0ec594c5a comment on the futility of stripped-emoji.json 2019-05-19 21:19:20 +01:00
Matthew Hodgson
81338306b0 fix lint 2019-05-19 21:00:14 +01:00
Matthew Hodgson
dbc6815abf make EmojiProvider and stripped-emoji.json work 2019-05-19 20:48:18 +01:00
Matthew Hodgson
497be91c4d combine regexps correctly 2019-05-19 17:53:36 +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
Travis Ralston
85c8d4d0e5 Remove extra debug lines 2019-03-27 13:03:25 -06:00
Travis Ralston
340c24cfa7 Filter out upgraded rooms from autocomplete results
Fixes https://github.com/vector-im/riot-web/issues/9289

Theory is that this shouldn't happen in the first place (aliases should be transferred), but there's evidently some cases where this doesn't work, or gets state reset.
2019-03-26 15:13:20 -06: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
David Baker
77efa0881e Gah, onjects 2019-01-11 14:09:29 +00:00
David Baker
fe4778b28b De-lint a few more files
& remove them from the ignored list
2019-01-11 13:54:11 +00:00
David Baker
8e4d8ccca7 Add spaces back to async arrow functions
As per https://github.com/matrix-org/matrix-js-sdk/pull/821

Requires https://github.com/matrix-org/matrix-js-sdk/pull/821
2019-01-09 18:10:35 +00: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
9c8c84485a Fix user autocompleting
This rewrites quite a lot of QueryMatcher.
 * Remove FuzzyMatcher which was a whole file of commented out code
   that just deferred to QueryMatcher
 * Simplify & remove some cruft from QueryMatcher, eg. most of the
   KeyMap stuff was completely unused.
 * Don't rely on object iteration order, which fixes a bug where
   users whose display names were entirely numeric would always
   appear first...
 * Add options.funcs to QueryMatcher to allow for indexing by things
   other than keys on the objects
 * Use above to index users by username minus the leading '@'
 * Don't include the '@' in the query when autocomple is triggered
   by typing '@'.

Fixes https://github.com/vector-im/riot-web/issues/6782
2018-10-11 18:34:01 +01:00
David Baker
b267798010 Kill FuzzyMatcher
This has been commented out for ages. Just remove it and make things
use QueryMatcher directly rather than looking like they do fuzzy matching
but not.
2018-10-10 19:18:06 +01:00
Will Hunt
1e5101aa0c
The comment can go 2018-10-03 19:39:47 +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
a00c2b753a
Merge pull request #2085 from matrix-org/t3chguy/emoji_aliases
allow autocompleting Emoji by common aliases, e.g 👍 to 👍
2018-07-25 10:40:59 +01:00
Michael Telatynski
07f0713a56
allow autocompleting Emoji by common aliases, e.g 👍 to 👍
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-24 17:06:45 +01:00
Michael Telatynski
ef39327073
fix CommandMap typo
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-24 13:21:36 +01:00
Michael Telatynski
7c3873b449
fix @room pill href=undefined and @room parsing breaking subsequent pills
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-24 12:18:10 +01:00
David Baker
3c895e5a0d
Merge pull request #2074 from matrix-org/t3chguy/hide_ddg_me_after_space
hide some commands after space as they have special semantics
2018-07-19 13:51:05 +01:00
Michael Telatynski
5867fe73dd
hide some commands after space as they have special semantics
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-18 15:38:21 +01:00
Michael Telatynski
5b79e3bcd5
fix user autocomplete not adding : if at the start
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-17 11:56:24 +01:00
Michael Telatynski
8bcb987f50
delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-09 20:14:37 +01:00
Matthew Hodgson
021409aafe
apply review feedback from @lukebarnard1
(cherry picked from commit 37d4bce)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-09 19:54:57 +01:00
Matthew Hodgson
efdc5430d7 merge develop 2018-07-09 17:50:07 +01:00
David Baker
7ef4377e57
Merge pull request #2007 from matrix-org/t3chguy/accent_insensitive_userprovider
accent insensitive autocomplete
2018-06-25 12:13:20 +01:00
Michael Telatynski
f21f7eff45
add word boundary to Community,Room,User provider regexps
to stop the autocompleter firing mid-word
and remove any unused capture groups

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-25 09:32:51 +01:00
Michael Telatynski
6a84a7ab32
apply stripDiacritics to QueryMatcher instead of individually
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-23 02:22:07 +01:00
Michael Telatynski
7cdc91856b
retain pre-stripped text so it can be used for rendering
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-23 02:12:01 +01:00
Michael Telatynski
54bccd2016
make Accent Insensitive match more generic and apply to rooms too
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-23 02:10:31 +01:00
Michael Telatynski
104e8d9cba
delint and add flow annotations to make my editor happy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-23 02:00:36 +01:00
Michael Telatynski
ce04c745e5
strip diacritics for user autocomplete
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-23 01:56:24 +01:00
Michael Telatynski
9ee78de7e5
pr iteration, don't assume js-sdk stores group stuff other than groupId
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-22 12:05:46 +01:00
Michael Telatynski
561b9699fc
Merge branch 'develop' into t3chguy/community_autocomplete 2018-06-22 12:00:34 +01:00
Michael Telatynski
884fa3b913
use existing command hashmap over linear array search
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-20 17:25:23 +01:00
Michael Telatynski
7d9d17145c
change so that if someone enters invalid command with args we strict match
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-20 17:21:06 +01:00