Commit graph

661 commits

Author SHA1 Message Date
Ed Sanders e995332d77 Fix eslint doc type warnings
Change-Id: Iaadc500609db3b462ef8de663f7ec34f46dc0434
2021-04-27 22:52:11 +01:00
jenkins-bot 60e1fa334f Merge "Remove deprecated dt- classes" 2021-04-23 17:35:51 +00:00
Bartosz Dziewoński 534f907d33 Fix topic subscriptions button
Follow-up to a3f665e816.

Change-Id: I4df324bb6b60a0a840ddfe483aa10143e218bdf8
2021-04-22 20:43:02 +02:00
Ed Sanders eae0c1e6e1 Implement hidden tag for source mode with toolbar
Bug: T279157
Change-Id: I0244530580c7243e4db33848d36c336d8e5e8a08
2021-04-22 17:44:00 +00:00
Ed Sanders 1893405635 Code style: Move var declarations inline
Change-Id: I1686603388b050ba4ec22eff23e4806cdf262b87
2021-04-22 17:43:46 +00:00
Bartosz Dziewoński 4bbfe6cb5d Rename CommentFormatter::addReplyLinks
Bug: T280351
Change-Id: I0d7627d63407e11cca6091f78e4d440eec6efa91
2021-04-21 11:24:03 +00:00
Bartosz Dziewoński a3f665e816 Remove <header> tags around headings for compat with MobileFrontend
We added it because the initial designs for the subscribe action were
much easier to implement like this, and topic "containers" (T269950)
would have required it.

However, the latest design of the subscribe action will not need it
(T279149), and topic containers are still very far away, so let's
remove it for now.

Bug: T280433
Change-Id: I21a23e9bea43f24d265750926fbd62b99038d3f1
2021-04-19 17:47:43 +02:00
jenkins-bot ab41904d91 Merge "Migrate cookie hack users to beta feature" 2021-04-16 12:23:41 +00:00
jenkins-bot 58fc1753fe Merge "Include comment names in 'transcludedfrom' API response" 2021-04-16 11:30:22 +00:00
Bartosz Dziewoński 2352fefb58 Migrate cookie hack users to beta feature
Bug: T277783
Change-Id: I455cab2acd0729b1c117b65cc1ede0ad9eb651cf
2021-04-14 20:36:32 +02:00
Bartosz Dziewoński 6bf75b4752 Fire the 'wikipage.content' hook on previews
We already fire it after saving the reply/topic.

Bug: T279141
Change-Id: I4ecbea877035f61d9642dded9ca54e5bff795099
2021-04-08 21:38:45 +02:00
Bartosz Dziewoński bfe6a36514 Include comment names in 'transcludedfrom' API response
As of 7ad6328223, we also use this data
to check whether comments exist on the page, not only whether they're
transcluded.

Follow-up to 42ce942c86.

Bug: T275821
Bug: T273413
Change-Id: I95eb85354e7b84cc10ab703d28315d0667696f4c
2021-04-07 22:46:36 +02:00
Ed Sanders eb7e682d2f Topic subscription front end
Bug: T276996
Change-Id: Ifb62c04c2a0ea8399749b22021d6a1c5a079bf94
2021-04-06 23:28:28 +02:00
jenkins-bot f702e094a8 Merge "Remove compatibility code for 'data-mw-comment-start' change" 2021-04-06 13:48:19 +00:00
jenkins-bot 9bf9977369 Merge "Fix switching interface getting stuck after failing to switch" 2021-04-03 12:59:21 +00:00
Ed Sanders 4c27187500 Make the source mode toolbar a user preference feature
Bug: T275950
Change-Id: I099af342f378215c68092d165dd88de1807d29d2
2021-03-31 22:40:53 +02:00
Bartosz Dziewoński 5dae22e93a Fix switching interface getting stuck after failing to switch
Follow-up to 58c078437d.

Bug: T274423
Change-Id: Ie410b61e2b64d9ef2bb20d5df9f95d2c90392323
2021-03-29 21:22:07 +02:00
jenkins-bot 4e956d11b9 Merge "ReplyWidget: Separate out switching logic into switch method" 2021-03-29 19:17:27 +00:00
jenkins-bot c27071a2e7 Merge "Check if you can edit the page before opening the tools" 2021-03-25 22:11:38 +00:00
Bartosz Dziewoński 253da36101 Check if you can edit the page before opening the tools
The information is already included in the VisualEditor metadata request.

Bug: T276393
Bug: T270803
Change-Id: I45a232dcd23418da0711834bcc369a9a718006b0
2021-03-25 17:04:31 +01:00
jenkins-bot 151e9ca79b Merge "Trim wikitext for preview" 2021-03-24 22:02:58 +00:00
jenkins-bot 027f8983a2 Merge "modifier: Fix whitespace trim inconsistency" 2021-03-24 22:02:57 +00:00
jenkins-bot c2ebb93d8a Merge "ReplyWidget: Defer scrollElementIntoView" 2021-03-24 20:00:58 +00:00
jenkins-bot b023f59e53 Merge "UsernameCompletion: Use ve.ce.Surface.findMatchingSequences" 2021-03-24 18:21:43 +00:00
jenkins-bot a2c8a2ca4d Merge "Don't insert multiple '@' when clicking the mention toolbar button multiple times" 2021-03-24 18:13:34 +00:00
Ed Sanders 86fe745724 UsernameCompletion: Use ve.ce.Surface.findMatchingSequences
Depends-On: I7a9b9abaa5a518f21f9965a16803e0a4c82b436f
Depends-On: I48e1137150dee024ebdc96f0e780a88bff6b8177
Change-Id: I06d31694c9fddb3795e61dccecf812b7e1a783b2
2021-03-24 17:56:20 +00:00
Bartosz Dziewoński 566d4d92db Trim wikitext for preview
And change some uses of trim() to htmlTrim() for consistency.

Bug: T276612
Change-Id: I1f55f4793af8f3dda597288c9e3427abe31c37c9
2021-03-24 18:53:41 +01:00
Bartosz Dziewoński 3ac540af95 modifier: Fix whitespace trim inconsistency
The JS and PHP trim() methods remove different characters.

Change-Id: I8ae5526ea5033e345b6a6b63ea447c394956d988
2021-03-24 18:53:21 +01:00
Ed Sanders 822472a6ec ReplyWidget: Separate out switching logic into switch method
Keep implementation-sepcific modeTabSelect handling in
modeTabSelect event handler.

Change-Id: I183bc80eb9f0e2a69aa30e5de82026983e3006be
2021-03-24 14:09:09 +00:00
Ed Sanders d5450abe39 ReplyWidget: Defer scrollElementIntoView
Prevents VE from cancelling this scroll, and so not full scrolling the
widget into view.

Change-Id: I5b242fa2c60b87a52935f86f95d6c0efde2b74bc
2021-03-24 12:59:25 +00:00
Bartosz Dziewoński 3e723f5310 Don't insert multiple '@' when clicking the mention toolbar button multiple times
Bug: T275906
Change-Id: I7a4e914b8ae491de240efa97c7f001b57c9d8acc
2021-03-24 11:08:19 +00:00
Bartosz Dziewoński 42ce942c86 Introduce comment "names" to identify comments across revisions/pages
The existing comment IDs can't be used to find the same comment on
a different revision or page (when it's transcluded), because they
depend on the comment's parent and its position on the page.

Comment names depend only on the author and timestamp. The trade-off
is that they can't distinguish comments posted within the same minute,
or in the same edit, so we will still need the IDs sometimes.

Prefer using comment names when replying, if they're not ambiguous.
This fixes T273413 and T275821.

Heading names depend on the author and timestamp of the oldest comment.
This way we don't have to detect changes to the heading text, but we
can't distinguish headings without any comments.

Bug: T274685
Bug: T273413
Bug: T275821
Change-Id: Id85c50ba38d1e532cec106708c077b908a3fcd49
2021-03-23 16:08:42 +00:00
Ed Sanders b0a94405dc Remove deprecated dt- classes
Change-Id: I4fb59f187bf3e31fd9c31841576b3f69aec23634
2021-03-23 12:39:34 +00:00
Bartosz Dziewoński 9e255d82ca Remove compatibility code for 'data-mw-comment-start' change
No longer needed.

This reverts commit f727c988a0.

Change-Id: Ib67d30890c6542bd0235dac6e49870c038d5dd86
2021-03-22 21:17:34 +00:00
Bartosz Dziewoński f727c988a0 Fix "TypeError: Cannot read property 'hasAttribute' of null" when loading on cached pages
Follow-up to c4de603ef9.

Change-Id: I05dfb142e95e02715b56c2bd7c73bcfbb342fbfe
2021-03-22 21:06:34 +01:00
jenkins-bot 536f50c293 Merge "Give comments IDs so they can be scrolled to with hash links" 2021-03-22 12:40:06 +00:00
jenkins-bot abb14d091a Merge "ReplyWidget: Hide external links icons in the anon warning" 2021-03-20 17:41:36 +00:00
jenkins-bot c0b221126d Merge "Add accessibility labels to a few controls" 2021-03-20 16:50:33 +00:00
jenkins-bot 9d65658858 Merge "Improve mode selector keyboard interactions" 2021-03-20 16:50:31 +00:00
jenkins-bot 74980b78b5 Merge "Ensure ReplyWidgetVisual#getMode always returns a mode" 2021-03-20 16:39:49 +00:00
Ed Sanders c4de603ef9 Give comments IDs so they can be scrolled to with hash links
Bug: T265268
Change-Id: Idb985ed38bdb74e23cb7840899a61dc919f05f6f
2021-03-20 15:43:23 +00:00
Ed Sanders 4a0802065c Make IDs (to be used as URL hashes) wikitext safe
* Use hyphens instead of pipes a separators
* Use underscores for spaces in usernames

Change-Id: I6efd9739fc73e45002e50e64c43ce0de1c2f1239
2021-03-18 20:45:21 +01:00
Bartosz Dziewoński 9da3949c47 Add accessibility labels to a few controls
Topic title field and old wikitext reply field had only placeholders,
but no labels.

Mode selector had labels on individual items, but not on the main
control.

Change-Id: I422e7e5baa8711340a1bb82255e788f2272c45c9
2021-03-18 15:15:40 +01:00
Bartosz Dziewoński 58c078437d Improve mode selector keyboard interactions
When there are just two modes, using arrow keys to switch between
them is not intuitive. The focus moving from the selector to the
body widget afterwards is even less intuitive.

Override default TabOptionWidget to allow options to be highlightable
(not just immediately selectable), and mark the current mode's tab as
disabled instead of selected (but make it look selected).

This results in intuitive keyboard interactions (tabbing to the widget
highlights the other tab rather than the current one, pressing enter
switches to it).

Bug: T274423
Change-Id: I9d358d5f301cbf081380ef5d34ccc8c4e146652e
2021-03-18 15:15:40 +01:00
Bartosz Dziewoński 1dbe907011 Ensure ReplyWidgetVisual#getMode always returns a mode
In some situations we didn't pass the mode in the config.

Simplify some redundant code that got messed up when we
introduced the NWE source mode.

Change-Id: Ia838fc6752d411f70c8cc6a36d84d2a851fd68bd
2021-03-18 15:15:40 +01:00
Bartosz Dziewoński 522b7932d7 ReplyWidget: Hide external links icons in the anon warning
Similar to 282c987efa.

Change-Id: I0f6ca2d4aef114d7c8853df19140bbd27c20325a
2021-03-17 15:50:34 +01:00
Ed Sanders ece8ff69ff Change dt- class prefix to ext-discussiontools-
Longer, but follows the style guide and less likely to conflict.

We need to account for init classes in the cache being around for
a while.

Change-Id: I738bc93393850db320fdbda2b003ca8ac40556da
2021-03-13 14:42:39 +00:00
Bartosz Dziewoński 1a52f06daf Tweak signature formatting in previews for more accurate results
When posting a new topic, if your comment ends with a template
that has trailing line breaks, the signature will be added as a
preformatted text (which is arguably a bug: T255741).

Preview, however, did not reflect this bug, because of the <span>
markup added to fade out the automatic signature.

Change-Id: I062b01a035e22edfca752a49c5e2433b3f7fb4f6
2021-03-09 01:08:59 +01:00
Bartosz Dziewoński 44f2209abf Trim signatures when added in an empty existing node, too
Add unit tests for appendSignature().

Bug: T276612
Change-Id: Ic44c52f4d54492e092f9396c626380e2637b6f0f
2021-03-08 23:38:46 +00:00
Ed Sanders 5324e60e84 Tracking changes from VE source mode
Change-Id: I5cafa7a21a0ab90fab9d09e44b7525ee07f56709
2021-03-08 21:13:10 +00:00