* Use binds rather than onFoo functions which aren't actually
handler functions themselves but return them
* Rename onKeyUp to moveSelectionDown etc,, reserving onKeyUp
for "a key has been released" rather than, "the up arrow key
has been pressed"
* Implement simple team-based registration
Config required goes in the `teams` top-level property in config.json. This consists of an array of team objects:
```json
{
"name": "University of Bath",
"emailSuffix": "bath.ac.uk"
}
```
These can be selected on registration and require a user to have a certain email address in order to register as part of a team. This is for vector-im/riot-web#2940. The next step would be sending users with emails matching the emailSuffix of a team to the correct welcome page as in vector-im/riot-web#2430.
We still need to parse "plaintext" messages through the markdown
renderer so that escappes are rendered properly.
Fixesvector-im/riot-web#2870.
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Add Modal.createDialogAsync, which can be used to display asynchronously-loaded
React components. Also make EncryptedEventDialog use it as a handy
demonstration.
Transition pairs joined,left and left,joined are now transformed into single meta-transitions "joined_and_left" and "left_and_joined" respectively. These are described as "joined and left", "left and rejoined".
Treat consecutive sequences of transitions as repetitions, and handle any arbitrary repetitions of transitions:
...,joined,left,joined,left,joined,left,...
is canonicalised into
...,joined_and_left, joined_and_left, joined_and_left,...
which is truncated and described as
... , joined and left 3 times, ...
This also works if there are multiple consecutive sequences separated by other transitions:
..., banned, banned, banned, joined, unbanned, unbanned, unbanned,...
becomes
... was banned 3 times, joined, was unbanned 3 times ...
The MELS can now deal with arbitrary sequences of transitions per user, where a transition is a change in membership. A transition can be joined, left, invite_reject, invite_withdrawal, invited, banned, unbanned or kicked.
Repeated segments (modulo 1 and 2), such as joined,left,joined,left,joined will be handled and will be rendered as " ... and 10 others joined and left 2 times and then joined". The repeated segments are assumed to be at the beginning of the sequence. This could be improved to handle arbitrary repeated sequences.
This will happen anyway when they follow email verification links.
make captchas poll for success so if they are completed elsewhere, electron moves on
This was causing rendering of MemberEventListSummary to be quite slow. Instead of creating two date objects, just check to see if they represent timestamps that happened on different days.
- The MessagePanel now uses the same key for the MELS instances rendered so that entirely new instances are not created, they are simply passed new props (namely when new events arrive).
- MELS itself now uses `shouldComponentUpdate` so that it only updates if it is given a different number of events to previous or if it is toggled to expand.
* Render attachments inside iframes.
* Fix up the image and video views
* Fix m.audio
* Comments, and only use the cross domain renderer if the attachment is encrypted
* Fix whitespace
* Don't decrypt file attachments immediately
* Use https://usercontent.riot.im/v1.html by default
* typos
* Put the config in the React context.
Use it in MFileBody to configure the cross origin renderer URL.
* Call it appConfig in the context
* Return the promises so they don't get dropped
`onWidgetLoad` is now being called when an image has been decrypted so that the ScrollPanel maintains its scroll position (whether it's stuckAtBottom or not). This attempts to fix https://github.com/vector-im/riot-web/issues/2624
This increases `UNPAGINATION_PADDING` (see the ASCII on ScrollPanel.js, `_getExcessHeight`), and also debounces unfilling requests made for 200ms. This forces unfilling requests not to be sent unless the next 200ms has no scrolling, effectively.
Fix pagination issue where recent events are lost
Scrolling up a few pages followed by scrolling down to the most recent events previously caused some events to go missing. A test has been modified in conjunction with this fix to make sure that this failure mode is tested for in future. This commit should fix the issue, and the most recent events should be paginated back in.
Also, the net change of nil is detected as having the first and last events being _different_. The summary should only include those that have their first and last events being the _same_ because that is a net change (within the block of member events).
* Fix join/part collapsing regressions
* Simplify loop
* Explain e,e
* Explain return null in _renderSummary
* Kill it properly
* Move . to _renderSummary
* Only use the first and last events to decide whether a net change has occured
* Do not sort events by TS before summarising
* fix loop and comment
* remove data-number-events
* Better explanation comment in _renderSummary
* Less tortuous comment
Instead of using a window of a fixed number of events, unpaginate based on the distance of the viewport from the end of the scroll range.
The ScrollPanel uses the scrollTokens to convey to its parent (the TimelinePanel, in this case) the point to unpaginate up to. The TimelinePanel then takes a chunk of events off the front or back of `this.state.events` using `timelineWindow.unpaginate`.
Fixes https://github.com/vector-im/vector-web/issues/2020
* Use a list of callbacks for things that need tinting.
Rather than gutwrenching the internals of TintableSVG inside the Tinter.
* Share a data: url for the tinted download svg in MFileBody
* Check image exists before tinting
* Add comments
* Use fetch+DomParser rather than XMLHttpRequest
* Remove comment about XMLHttpRequest
* Send a thumbnail when sending a m.image
* Use the 'thumbnail_file' when displaying encrypted images
* Whitespace
* Generate thumbnails for m.video
* Fix docstring, remove unused vars, use const
* Don't change the upload promise behaviour
* Polyfill for Canvas.toBlob to support older browsers
* Lowercase for integer types in jsdoc