Commit graph

157 commits

Author SHA1 Message Date
Bruno Windels
d73f547f55 reapply pills, link preview, code highlighting, ... after edit 2019-05-15 15:55:03 +01:00
Bruno Windels
5805a88ab9 adjust to js-sdk changes of marking original event as replaced 2019-05-15 11:54:26 +01:00
Michael Telatynski
d6f31bef8e Disable big emoji for m.emote messages as it looks weird
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-03-18 23:25:11 +00:00
Bruno Windels
4e382b1dd9 rename onWidgetLoad to onHeightChanged
as it's easy to confuse it with room widgets, but has nothing to do with it.
2019-03-07 17:02:19 +01:00
Bastian
23971b3d0d Refactor to use HtmlUtils for linkifying and sanitizing
Signed-off-by: Bastian <matrix@noxware.de>
2019-01-31 22:36:08 +01: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
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
Luke Barnard
6345fcb8f2 Fix incorrectly positioned copy button on <pre> blocks 2018-06-27 11:31:55 +01:00
David Baker
e67dae704a Take replies out of labs! 2018-06-20 09:57:11 +01:00
Michael Telatynski
3ebec92ac5
replace hardcoded matrix.to with reference to const in matrix-to
for easier changing

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-16 08:27:47 +01:00
Michael Telatynski
64bcf6fd7e
allow ContextualMenu to run without background, for tooltips & fix copy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-12 11:22:01 +01:00
Luke Barnard
ff0254d346 Fix ContextualMenu imports for TagTile and code block copy button 2018-05-14 17:36:57 +01:00
Michael Telatynski
41af9f7a96
fix changed method name
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-04-29 08:23:35 +01:00
Michael Telatynski
b5ed08eba2
Merge
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-03-24 17:52:49 +00:00
Michael Telatynski
023632e7e4
only strip reply fallbacks if the lab is enabled
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-03-09 23:12:13 +00:00
Michael Telatynski
df56a67fda
Add reply fallback and run gen-i18n
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-03-04 12:39:34 +00:00
adi1
f2e1c0ebca
Fix TextualBody.js to remove NodeList.forEach()
Not all browsers support forEach() on NodeList objects. This causes crashes on some browsers, such as IE and FF<50.
2018-02-22 13:59:37 +01:00
Michael Telatynski
fbb950e064
mass s/Quote/Reply
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-02-10 12:38:25 +00:00
Michael Telatynski
1c3d8cbe6e
initial refactor of Replies to use B explicit over-the-wire format
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-02-10 11:19:43 +00:00
Michael Telatynski
3b1d69edbb
Change Quotes to be linearly rendered rather than recursively nested
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-01-22 16:34:47 +00:00
Michael Telatynski
9e2238e884
remove unused imports
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-01-10 11:56:36 +00:00
Michael Telatynski
1bc9d344ae
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/nvl/rich_quoting
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

# Conflicts:
#	src/components/views/messages/TextualBody.js
2018-01-10 11:54:58 +00:00
Michael Telatynski
454fd23f25
fix typo shsape->shape
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-01-10 11:51:48 +00:00
Aidan Gauland
35780f5ae0 Remove use of deprecated React.PropTypes
Replace all uses of React.PropTypes with PropTypes and importing PropTypes from
'prop-types'.
2017-12-26 14:03:18 +13:00
Michael Telatynski
47d4e5f8d1
nest quotes, but only when people want to click through them
loads pre-emptively

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-18 19:28:01 +00:00
Michael Telatynski
9603b21199
s/Quote/Reply/ and ES6 tweaks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-17 20:20:45 +00:00
Michael Telatynski
0ad0c0e9f7
finish i18n, and add a Date Sep to quote if it needs it
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-15 18:39:01 +00:00
Michael Telatynski
4666ac7c83
hide rich quoting behind flags, retaining original quoting for now
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-12 23:29:43 +00:00
Michael Telatynski
0f85391587
Implement Rich Quoting/Replies
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-10 12:50:41 +00:00
Travis Ralston
c5c346f0b7 Merge branch 'develop' into travis/granular-settings 2017-11-13 12:18:41 -07:00
David Baker
ff5e00d244 Don't crash if there isn't a room notif rule 2017-11-10 11:50:00 +00:00
Travis Ralston
893c39bfbe Merge branch 'develop' into travis/granular-settings 2017-11-03 22:00:07 -06:00
David Baker
802ab16746 Fix multiple pills on one line 2017-11-03 14:06:59 +00:00
David Baker
4f8d6d8fbe Pillify room notifs in the timeline
This scans text nodes in the DOM for room notifications and turns
them into pills. Changes the pillification code around a bit so it
works with text nodes. Uses the push processor directly to test
the event against the room notifiation rule so we know whether
this event would actually trigger a room notification (needs to
hook into push at a lower level because otherwise our own room
notifications would not pillify since our own events never
generate notifications).

Requires https://github.com/matrix-org/matrix-js-sdk/pull/565
2017-11-01 19:42:47 +00:00
Travis Ralston
ae10a11ac4 Convert synced settings to granular settings
Signed-off-by: Travis Ralston <travpc@gmail.com>
2017-10-29 01:43:52 -06:00
Michael Telatynski
c1edc0c32e
add option to disable BigEmoji
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-10-14 19:40:45 +01:00
Luke Barnard
d3f9a3aeb5 Run eslint --fix
Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
2017-10-11 17:56:17 +01:00
Michael Telatynski
fea7af11b4
Merge remote-tracking branch 'origin/t3chguy/on_copy_tooltip' into t3chguy/on_copy_tooltip 2017-09-13 14:18:56 +01:00
Michael Telatynski
d3bfdf495c
initialize value with false to prevent undefined.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-09-13 14:18:31 +01:00
Michael Telatynski
0580d536ad Merge branch 'develop' into t3chguy/on_copy_tooltip 2017-09-10 18:54:52 +01:00
David Baker
05a986334d Separate function to add code copy button
For neatness and also so it can show up separately in the profiler.
2017-09-10 15:58:17 +01:00
David Baker
876257f4e2 Consolidate the code copy button
Adding the code code button was done by manipulating the HTML of
the event body to add a span tag, then adding the onclick handler
after the thing was mounted. Apart from splitting the code between
two places, adding the span tag was, according to Chrome's
profiler, taking up quite a lot of CPU cycles (apparently as soon
as you set the innerHTML on a div). Instead, just build the whole
lot together after the component mounts.
2017-09-10 14:23:33 +01:00
Michael Telatynski
b10b0e573d
i18n and change message depending on success of copy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-09-06 11:29:55 +01:00
Michael Telatynski
269f1f33e3
show response on copy so you don't mash it
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-09-06 11:27:25 +01:00
Michael Telatynski
b19c1010aa
Merge branches 'develop' and 't3chguy/i18n_analytics' of github.com:matrix-org/matrix-react-sdk into t3chguy/i18n_analytics
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

# Conflicts:
#	src/Analytics.js
2017-08-10 13:54:55 +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
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
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
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
08cc0c421d insert_displayname -> insert_mention 2017-07-20 18:02:54 +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
2f293adad5 Fix userId undefined in pillifyLinks 2017-07-19 18:21:26 +01:00
Luke Barnard
5d1b33d2a8 Merge branch 'develop' into luke/feature-mention-pill 2017-07-19 17:22:03 +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
Luke Barnard
d207ee5244 Expand groups into variables with readable names 2017-07-17 19:31:36 +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
Richard van der Hoff
4f8d9d869e mention preserving ordering in comment 2017-07-06 10:47:15 +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
Johannes Löthberg
48c32172fd TextualBody: only highlight code block if language was specified
The highlight.js autodetection is finicky and often wrong, so disable
highlighting unless the language was explicitly specified, or if the
user has explicitly enabled it in the settings.

Fixes vector-im/riot-web#508.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-06-26 17:45:40 +02:00
David Baker
71eb405859 Add comments & remove redundant check 2017-06-08 14:53:21 +01:00
David Baker
b40636a425 Merge pull request #1040 from ollieh/issues/1974
Added button that copies code to clipboard
2017-06-08 14:45:58 +01:00
Oliver Hunt
dd6171a39e Review changes
Signed-off-by: Oliver Hunt <oliver@hunt.bz>
2017-06-06 12:34:03 +01:00
Oliver Hunt
a640e943f7 Added button that copies code to clipboard
Signed-off-by: Oliver Hunt <oliver@hunt.bz>
2017-06-06 12:33:44 +01:00
Matthew Hodgson
48a2ad93da fix {integrationsUrl} thinko 2017-05-30 20:32:12 +01:00
Marcel
70e7d81093 More i18n strings (#963)
* Add i18n for E2E import and Export Dialogs

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add various previous missing i18n strings

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Translate CreateRoomButton

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add ChatInviteDialog and fix missing to.

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add ConfitmRedactDialog translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add DeactivateAccountDialog translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add DeviceVerifyDialog translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add SessionRestoreErrorDialog translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add SetDisplayNameDialog translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add UnknownDeviceDialog translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add AddressTile translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add DeviceVerifyButtons translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add Dropdown translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add UserSelector translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add CaptchaForm translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add CasLogin translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add CustomServerDialog translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add InteractiveAuthEntryComponents translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add LoginFooter translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add RegistrationForm translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add ServerConfig translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add MAudioBody translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add MImageBody translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add MVideoBody translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add TextualBody translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add UnknownBody translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add UrlPreviewSettings translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add AuxPanel translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* Add PresenceLabel translations

Signed-off-by: MTRNord <mtrnord1@gmail.com>

* fix syntax error

* weird space :P

* missing ','

* fix missing value

* fix json fail

* remove acidential added file

* fix another json fail
2017-05-30 15:09:57 +01:00
Luke Barnard
7ae13f5889 Merge pull request #762 from lieuwex/hide-link-preview-quote
Don't show link preview when link is inside of a quote
2017-04-12 15:31:43 +01:00
Luke Barnard
6c09a08a7d Click emote sender -> insert display name into composer
Also, fix the imports TextualBody.
2017-04-06 14:08:59 +01:00
Lieuwe Rooijakkers
b3fc1844e8 don't show link preview when link is inside of a quote
Signed-off-by: Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com>
2017-03-18 11:50:49 +01:00
Luke Barnard
0303a42fc7 Fix typo with Scalar popup 2017-02-14 15:35:14 +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
Richard van der Hoff
4476b09ce7 Get rid of always-on labs settings
If the setting is on by default, it's not much use as a Labs setting. The E2e
setting was only confusing everyone anyway.
2016-11-21 10:25:48 +00:00
David Baker
5c2c01d414 Fix function to consistently return boolean 2016-11-07 11:45:55 +00:00
David Baker
2bb7aec0de Don't do URL previews for matrix.to 2016-11-07 10:57:08 +00:00
David Baker
8cf273a460 Run highlight.js asynchronously
Move the very minimal logic of highlightDOM into TextualBody
because then we can avoid scheduling a lot of timeouts which
would ultimately do nothing (ie. any messages that don't have code
blocks).
2016-10-26 18:41:28 +01:00
Matthew Hodgson
9d303712f2 more s/Vector/Riot/ 2016-10-03 10:18:43 +01:00
Kegan Dougal
56ac0004e5 Use href='#' hack to make link text look like a link 2016-09-05 09:10:15 +01:00
Kegan Dougal
45ada1887d Implement starter link support
This involves modal dialogs because browsers are *terrible*.
2016-09-02 16:36:43 +01:00
Kegan Dougal
6ec7e5df28 Move scalar auth stuff to ScalarAuthClient from RoomSettings 2016-09-02 16:03:24 +01:00
Aviral Dasgupta
4c1dcb924b reskindex and use sdk.getComponent for EmojiText 2016-08-11 07:55:12 +05:30
Aviral Dasgupta
09e8a45cde Add EmojiText component for emoji replacement. 2016-08-10 00:31:51 +05:30
Aviral Dasgupta
dbbea63227 Various fixes and improvements to emojification.
- Use locally hosted emoji
- Emojify SenderProfile and m.emote
- Add emoji shortcodes as titles
2016-08-09 22:09:28 +05:30
Matthew Hodgson
1365f18829 many stupid thinkos and bugfixes; make it work 2016-07-20 12:03:13 +01:00
Matthew Hodgson
ebdac4ee50 first cut (untested) 2016-07-18 01:35:42 +01:00
Matthew Hodgson
b74d690035 Merge pull request #290 from matrix-org/matthew/multipreview
multiple URL preview support
2016-05-31 19:42:21 +01:00
Matthew Hodgson
b3638f9169 PR review 2016-05-31 19:42:00 +01:00
Matthew Hodgson
d5e6e961fd fix url previews firing incorrectly on Matrix.org 2016-05-27 10:09:17 +01:00
Matthew Hodgson
39a3d6fdd4 multiple URL preview support 2016-05-24 00:54:20 +01:00
Matthew Hodgson
4d399a3640 Refactor out isLinkPreviewable 2016-04-21 18:00:39 +01:00
Matthew Hodgson
ee11838537 fix comment paren 2016-04-21 17:19:24 +01:00
Matthew Hodgson
c5a76dec1c add heuristics to hide URL previews other than for URLs where the user has explicitly identified the target as a link: i.e. by including a URI scheme prefix, or by including URI path components, or by doing an explicit markdown hyperlink. ignore previews of URLs within pre or code blocks 2016-04-21 17:14:27 +01:00
Matthew Hodgson
92f58b6927 don't try to do preview URLs of matrix IDs (yet :D) 2016-04-13 01:54:06 +01:00
Matthew Hodgson
9845e5ef0e move all the localstorage crap to TextualBody 2016-04-11 23:53:36 +01:00
Matthew Hodgson
6c372d37f7 add the concept of eventTileOps for managing widget visibility based on vdh's PR feedback 2016-04-08 21:42:29 +01:00
Matthew Hodgson
4abc5d0d36 add comment 2016-04-08 20:21:12 +01:00
Matthew Hodgson
1d8b08040e incorporate PR feedback 2016-04-07 18:58:50 +01:00
Matthew Hodgson
0eb7b627fc ugly impl to track whether to hide the widget or not 2016-04-03 23:30:48 +01:00
Matthew Hodgson
e61c99f7f3 support cancelling previews 2016-04-03 02:50:36 +01:00
Matthew Hodgson
f9c914c40e specify timestamps for historical previews 2016-04-03 01:21:56 +01:00
Matthew Hodgson
4388334e30 fix up scroll behaviour when loading widgets 2016-04-02 00:36:19 +01:00
Matthew Hodgson
e6842eab94 WIP url previewing 2016-03-31 18:38:01 +01:00