Commit graph

772 commits

Author SHA1 Message Date
Bartosz Dziewoński 3dbc5749ea Adjust use of 'plainlinks' class to fix button styling in some cases
It was previously applied on the whole wrapper of the anon
warning, including the buttons. In some cases (on mobile, and
on some sites with weird customized site CSS), this causes the
buttons to lose some styling. Apply it only on the label.
Follow-up to 522b7932d7.

Bug: T270536
Bug: T291000
Change-Id: Ia4bc99fc219a80efbf46a7cc196ea29720a34de8
2021-09-18 03:16:43 +00:00
Bartosz Dziewoński 9c20efcd4d Record timing for 'saveSuccess' and 'saveFailure' events
Bug: T290931
Change-Id: Id4ead2e0cc72174eec5f3849d8182d660905daea
2021-09-13 23:47:30 +00:00
Bartosz Dziewoński b52699ad35 Log more precise error codes for timeout etc. (and HTTP statuses)
Inspired by the code in mw.Api#getErrorMessage handling these cases.

Bug: T290514
Change-Id: I2eea17198dafaf9d3c4754cfb630de0ed7162daf
2021-09-09 23:46:44 +02:00
Bartosz Dziewoński 085ea2e8d1 Remove client-side timeout when saving pages (again)
Previously: e3e36e11ac (April 2020),
regressed: 3b31aa669d (October 2020).

Bug: T290514
Change-Id: Ifb09d62145e0b62c5b59708552a3a63b920e5b2f
2021-09-09 23:46:44 +02:00
Bartosz Dziewoński 89aebfee07 New topic tool: Show empty title warning only when focussing the description
Currently the message appears too often when the user is not really
intending to interact with the widget.

Bug: T287901
Bug: T288316
Change-Id: I38b4c0b8817b9a9238fb6adc91ab2d1231650eff
2021-09-02 19:27:30 +00:00
jenkins-bot 82cd8f6578 Merge "Fix finding topmost comment when there are 3+ highlighted" 2021-08-30 16:03:35 +00:00
Bartosz Dziewoński 6bec44a236 Fix finding topmost comment when there are 3+ highlighted
This code made no sense.

Follow-up to db28a3d3a7.

Bug: T286620
Bug: T290006
Change-Id: I08712e31824315da231d15098073e3ec5be273e4
2021-08-30 15:59:20 +02:00
David Lynch 90bbcb904d Hide top-level error when new discussion widget is open as well
This will hide the user-not-registered warning, stopping it appearing
duplicated in the notices.

Change-Id: I508b5fc4161cb7e109f9a5a83f6188675c8be83a
2021-08-27 10:12:51 -05:00
David Lynch dcd3d23d31 Hide the top-level warningbox when the new discussion widget is open
Bug: T289354
Change-Id: I251bed09764a0d6389dbb62403ebacbf1abd41c3
2021-08-26 13:19:14 -05:00
David Lynch 503d2f1f76 Enforce no text-indent on our reply button
Change-Id: Ie26d7632ec4845cc9048c0261b51ff2a1b6b51e2
2021-08-20 13:46:23 -05:00
jenkins-bot d77353d93e Merge "Remove unnecessary contentType: 'multipart/form-data' from an API query" 2021-08-19 16:32:08 +00:00
jenkins-bot 359b80ed70 Merge "When opening new topic tool using any link, always activate the link in page tabs too" 2021-08-17 15:51:29 +00:00
jenkins-bot 2cd97c4be5 Merge "Handle highlighting and scrolling to comments for bundled notifications" 2021-08-16 20:43:37 +00:00
Bartosz Dziewoński db28a3d3a7 Handle highlighting and scrolling to comments for bundled notifications
Notifications are bundled by section, so instead of linking to the
comment, link to the section.

Additionally, add a parameter to the URL listing all the comment IDs
from the bundle, and highlight them all and scroll to the topmost one.

Having to handle both URL fragments and URL query parameters makes
this code kind of a mess :(

Also, some unexpected changes became necessary:

* EventDispatcher.php: Store the section title in events using
  HeadingItem::getLinkableTitle() instead of ThreadItem::getText().
  The result is mostly the same, except in case of wacky markup like
  images or extension tags. We can more reliably use it to link to the
  section on the page, and we already use getLinkableTitle() when
  generating edit summaries in the reply tool for this reason.

* dt.init.less: Change the mix-blend-mode for the highlights from
  'multiply' to 'darken', so that multiple overlapping highlights do
  not look more opaque. This affects how the highlights look on
  non-white backgrounds and images (they're less blue, and on darker
  backgrounds entirely invisible), but it seems worth it.

Bug: T286620
Change-Id: I21bb5c003abc2747f0350d3f3af558dfb55693e9
2021-08-16 22:03:30 +02:00
Bartosz Dziewoński a129899971 Remove unnecessary contentType: 'multipart/form-data' from an API query
This was copied from somewhere else (probably VisualEditor), but it is
not needed here.

Using the multipart/form-data encoding is beneficial when sending long
binary data (such as the compressed HTML VisualEditor sends), and is
also required when uploading files, but it is not helpful when sending
a short query like we do here.

Also rename a variable.

Change-Id: I9bcce2ce1ca7c218e4cd147960d1070dd23ea9fa
2021-08-16 21:33:59 +02:00
David Lynch 642fede864 Apply design tweaks to empty states
Bug: T274831
Bug: T274832
Bug: T277329
Change-Id: I0dcdb3479ba668b78cf247856a8ec00d5ea37ab4
2021-08-11 14:33:43 -05:00
David Lynch 0cb756f248 Don't detach the reply widget when posting to an empty page
This will avoid a flash of the empty-state while we're reloading the
page to get new tabs.

Refactor out the new topic controller's clear behavior from its teardown
behavior, so we can still wipe out the storage when redirecting.

Bug: T288314
Bug: T288320
Change-Id: I6a5313b5e5b3bc9925e5cdaea04d8fbd3dc796af
2021-08-06 15:18:17 -05:00
Bartosz Dziewoński 7fcaae95b7 When opening new topic tool using any link, always activate the link in page tabs too
Bug: T288267
Bug: T277371
Change-Id: I1854c82853abf16d9552765df983b4490fcd4b30
2021-08-05 19:09:05 +00:00
David Lynch 91af0594b5 Apply an empty-state to pages with the new topic tool enabled
This includes the dtrepliedto URL functionality from
I3f81e4d77faed367606e47678b8896051982359d.

Bug: T274831
Bug: T274832
Bug: T277329
Change-Id: I035d04f30c8312b0cb42902d3bf940df1482ffb3
2021-08-04 18:46:28 -05:00
jenkins-bot d4f4e49c7e Merge "Allow the new topic tool to handle URLs like action=edit&section=new" 2021-08-03 16:14:21 +00:00
jenkins-bot 1f4706a308 Merge "Recognize links to add a new topic that use Special:NewSection" 2021-08-02 17:42:30 +00:00
Bartosz Dziewoński cfbf437d9d Allow the new topic tool to handle URLs like action=edit&section=new
Depends-On: Ib9302e2fda7dadf1edc43c0107db7234eb4bdf7a
Depends-On: Ic7dd677ea219938969f60bab91387c2e03ebdbe6
Bug: T282204
Change-Id: I2e7b2682da7beb3c1c469bb784a9a8ec3998aeb9
2021-07-30 09:25:21 +02:00
jenkins-bot e9ff4695ad Merge "Change updating page content after saving to avoid losing footers" 2021-07-28 16:59:05 +00:00
Bartosz Dziewoński 4ebf05d802 Recognize links to add a new topic that use Special:NewSection
Bug: T277371
Change-Id: I40a13d8bf87bcd3ecea1427b444b6b7b621213c4
2021-07-22 22:25:11 +02:00
Bartosz Dziewoński 4e8e1bda67 Change updating page content after saving to avoid losing footers
This is the same method as used by VisualEditor
(ve.init.mw.DesktopArticleTarget.prototype.replacePageContent).

Bug: T275698
Change-Id: Idcf7c79b8d5565b0ae36c6e9d42b66662c1acc8d
2021-07-22 21:43:10 +02:00
Bartosz Dziewoński 709a7e5c4a Do not teardown newtopictool interface if it was not setup
Bug: T287035
Change-Id: Ib7c6c564ff197e0c8c8cf79680513f9415d108f9
2021-07-20 22:32:25 +02:00
Bartosz Dziewoński b3a2941575 Remove comment highlight after user clicks anywhere on the page
Bug: T285430
Change-Id: I32fc04a440c807211c5e4f121e58757466ee55bf
2021-07-13 02:38:40 +02:00
Bartosz Dziewoński 650c7dd1d3 Avoid exception when trying to highlight hidden comment
(e.g. if the comment is inside a node with 'display: none')

Change-Id: I23a38fd877b1f9f1554962f7f08f7e2732d8f560
2021-07-13 00:00:30 +02:00
Bartosz Dziewoński f35bf487ef Take over extra links to add a new topic added by gadgets/templates
* Move getTitleFromUrl() from parser to utils. It's a generic method,
  the PHP equivalent is already in utils.

Bug: T277371
Change-Id: Id960e5f60af02bdeb0a3a68f43b7a695eb035139
2021-06-30 18:06:39 +02:00
Bartosz Dziewoński dce09e61b7 Improve how new topic tool avoids conflicts with NWE new section
I noticed that the NWE new section editor would open sometimes even
though we attempt to prevent it. This way seems to work more reliably.

Change-Id: I0ce1640b8c1dd098bf3f0d41dc4fdc276a0c5fd5
2021-06-30 18:00:34 +02:00
Bartosz Dziewoński a2c662d3b2 Move reply link handling out of CommentController
Problems with the current setup:

* Each CommentController must have exactly one link.
  For T277371 we want multiple, and for T282205 we might want zero.

* CommentController objects must be constructed immediately.
  They are implemented to make this pretty fast, but it's still
  unnecessary work to do on page load.

* Only one link may be activated at a time, and activating one affects
  the styling of others, so CommentController has to use global state
  to check if it can set up and to update them.

Instead introduce ReplyLinksController, which knows about all reply
links and which one is active, and emits events that allow
CommentControllers to be constructed on demand.

Change-Id: Iabdeded2e71e598ae78703a6ff9410d0cfba397c
2021-06-30 17:05:55 +02:00
Bartosz Dziewoński a36d6ad5c6 Show edit notices in the new discussion tool
Considerations:
* Using the same edit notices as VisualEditor, except 'anoneditwarning'
* No extra frame/styling is added (on Wikimedia wikis, the notices
  often already have them)
* 'talkpagetext' message is not shown (on Wikimedia wikis, they are
  mostly about signing your posts with tildes, which is not necessary)

Bug: T269033
Change-Id: Idc5ff29f093c75a14c3a3479888295d5bf630f6d
2021-06-22 21:40:51 +02:00
Bartosz Dziewoński ea68e1a8f0 Introduce CommentDetails to group up and document stuff we pass around
Change-Id: I809524ea8d89130548964ba9e5a73f00f6089ff4
2021-06-21 22:12:18 +02:00
Ed Sanders a76539e19b Disallow horizontal rule (----) in reply tool
These also don't work when indented.

Change-Id: Id2f1b14f434f8527f1391ebf056aeb80c7023feb
2021-06-17 21:30:48 +01:00
Ed Sanders 54f2dcf030 Unregister sequence help for unavailable commands
Bug: T284758
Change-Id: I85fe9332ec723e44b5cb508f9b53a59c9e9b61d9
2021-06-17 21:30:40 +01:00
Ed Sanders c41dab81c4 Reply tool: Disable preformatted command
Preformatted text can't be rendered in wikitext when indented.

Change-Id: I2269471dd76630661cdb459322df591c6b3e6a50
2021-06-08 23:02:59 +01:00
Bartosz Dziewoński c51638e940 Update surface styles for VE changes
The .ve-init-mw-target-surface class is no longer added since
Ic5320f6747907542285674d386c7a59c9e857f0a.

Also apply changes similar to I8d20a830dc48f6a098b0f9e9a7c7c1656de0fe56
to avoid potential styling issues with nested surfaces.

Bug: T284567
Change-Id: I58a49f0137e8804fbd73de20048eb2ffdbbfbe77
2021-06-08 18:04:21 +02:00
jenkins-bot c5c4c86185 Merge "Change how highlights are positioned to work better with unaware tools" 2021-06-03 12:11:25 +00:00
Ed Sanders 6a24ceaeca Subscribe/unsubscribe with plain text links
Bug: T279149
Bug: T279151
Change-Id: Ie7d46ea2e8d458fcdad4f91bb89ba038969f6b62
2021-06-01 20:37:47 +02:00
Bartosz Dziewoński 9c58c0a203 Change how highlights are positioned to work better with unaware tools
Previously, our highlights were placed in a node at the end of
the page, and positioned absolutely in relation to the whole
page. Now we insert the highlight in the DOM near the comment,
and position it in relation to that.

This way it remains positioned correctly when the page shifts
(e.g. collapsing the table of contents), and disappears when
the page content is hidden (e.g. opening visual editor).

Bug: T281471
Change-Id: I60afc4b94b2e23376105638542563e595a1811d9
2021-05-31 23:07:02 +02:00
Bartosz Dziewoński 90fdd12efd Swap DOM order of summary and watch checkbox
This is to achieve the same tabbing order as the wikitext editor.

Bug: T271773
Change-Id: I7e167ed8a5aa9b9862f215cba7539b7f79315037
2021-05-27 23:24:25 +02:00
Bartosz Dziewoński 7b21e29405 Follow-up: Adjust comment ranges to exclude the start marker *only*
The modifier crashes if endContainer is a <p>/<dd>/<li> node, and
it often is if we try to exclude the end marker from the range.
It doesn't matter for T281471, so let's just leave it that way.
(This is also more similar to the range produced by our parser.)

Follow-up to c4ba8e921a. No idea how
I missed this when testing that patch.

Also, improve comments.

Bug: T281471
Change-Id: If6aba34acf29c37d06fb0ca92547f78b58695597
2021-05-27 21:28:39 +02:00
Bartosz Dziewoński c4ba8e921a Adjust comment ranges to exclude the start/end markers
This produces nicer results when we call Range#getBoundingClientRect
on them later, when drawing comment highlights (using Firefox).

I'm not sure how this will affect everything in modifier, but it
doesn't seem to be causing issues. If it does cause trouble, then we
should instead adjust the range this way in controller#highlight.

Bug: T281471
Change-Id: I6f204b858990023f42f564cca7a2d24d322f872e
2021-05-27 15:19:08 +00:00
jenkins-bot 04df0fc9fb Merge "Highlight target comment when following a link or notification" 2021-05-26 19:46:56 +00:00
jenkins-bot 939810f8fe Merge "Change feedback link for new topic tool" 2021-05-26 18:59:28 +00:00
jenkins-bot ef413b73e6 Merge "Limit number of topic subscriptions per user" 2021-05-26 13:01:06 +00:00
Ed Sanders 2b3345af11 Change feedback link for new topic tool
Bug: T279400
Change-Id: I5d72552f45a63199c0fbb516dc94aef19945c95e
2021-05-26 11:27:01 +00:00
jenkins-bot e56a8ad756 Merge "Allow the widget to be squished next to floating elements" 2021-05-25 20:55:16 +00:00
jenkins-bot 90528f2b49 Merge "Fix adding comments in lists containing <dt> tags" 2021-05-25 19:19:49 +00:00
jenkins-bot 86732c56dd Merge "modifier: Guard against infinite loop" 2021-05-25 19:17:53 +00:00
Bartosz Dziewoński 0968d2203b Allow the widget to be squished next to floating elements
Bug: T278476
Change-Id: I8e997bbd9ee7bc50baf4e69bde2dda286505b006
2021-05-25 18:44:43 +00:00
Bartosz Dziewoński ee524d6bd6 Remove cookie hack for loading unavailable tools
Bug: T277783
Change-Id: I521db842b4b7a98d8d255d418abd0ccb167c5aa0
2021-05-25 20:27:46 +02:00
Bartosz Dziewoński 6a50d1203c Limit number of topic subscriptions per user
Per Manuel Arostegui in T263817#7033384. The limit is 5000.
(I picked it arbitrarily, there's no real rationale for it.)

Also log a warning when any user reaches half of the limit,
so that we might make a decision about changing this mechanism
before it starts affecting users. Maybe at that time we'll
have data to show that it's safe to remove the limit.

Bug: T263817
Change-Id: I18a8ee0ad7383759229c5721d5253fb591457d4d
2021-05-25 17:16:24 +02:00
jenkins-bot 3bea7fe77b Merge "Remove unused 'inTargetWidget' config" 2021-05-24 20:53:20 +00:00
jenkins-bot e8b51899a8 Merge "NewTopicController: Fix tag list construction" 2021-05-04 03:05:03 +00:00
Ed Sanders b4f72b7516 NewTopicController: Fix tag list construction
Bug: T279157
Change-Id: I2fa8042878d0f24385a8528ef0ba26bd4689a387
2021-05-03 18:42:16 +01:00
Ed Sanders 35e97c24fe Disable wikitext paste conversion in source mode
Bug: T280745
Depends-On: Icc716563e5536b4ef33a48ba10a72f3a39bdec35
Change-Id: I5875d8aa12dee694c3e5bd7e1a980da284343722
2021-05-03 14:52:19 +01:00
Bartosz Dziewoński db3c1b25cc Highlight target comment when following a link or notification
Bug: T281471
Change-Id: I8a5bca70d86364f3fade76f72d32d2bf1b9aaf37
2021-04-29 20:13:41 +02:00
Ed Sanders 799754a3cf Remove unused 'inTargetWidget' config
Change-Id: I713c3bdd80ec375e9683441c289ba22ed9b7057a
2021-04-29 15:46:26 +01:00
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 ffd680ee7f Fix adding comments in lists containing <dt> tags
The issue occurred when replying to a comment consisting of multiple
list items, starting with a <dt> (instead of the expected <dd>), so
that the comment is considered to be unindented.

Modifier tried to add the reply directly inside the list (<dl>) rather
than inside the last list item (<dt>), which caused it to be confused
about indentation levels and try to un-indent more times than there
were indentations.

The simplest solution, given the existing code, is to add the reply
outside the list instead, in a new list. This results in a "list gap"
(<dl><dt>...</dt><dd>...</dd></dl><dl><dd>...</dd></dl>), but I think
it's acceptable for this rare case.

There are separate tests cases for old Parser and for Parsoid HTML,
because they parse the original wikitext differently (with the old
Parser producing HTML with a list gap too).

Bug: T279445
Change-Id: Ie0ee960e7090cf051ee547b480c980e9530eda51
2021-04-21 16:00:07 +02:00
Bartosz Dziewoński f6b7c69736 modifier: Guard against infinite loop
If curLevel or desiredLevel are calculated incorrectly, this loop
could never end.

In JS, something would throw an exception before going infinite, but
PHP is happy to trot along despite accessing properties of null and
attaching multiple children to a document node.

Bug: T279445
Change-Id: I1784f550ec3a23dcded4f2b1def97e51cb414b7b
2021-04-21 13:43:45 +02: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