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
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
Several of the messages talk about clicking the reply links, which
seems unhelpful. Also, showing a fullscreen popup on page load seems
very unhelpful too. (Itoldyouso that we shouldn't use popups.)
Bug: T268069
Change-Id: Id1312cf06200fb45a28b39481a99cc2c96603fa4
We'd like the [reply] links to behave differently if other
CommentControllers are already active, but each CommentController
doesn't know anything about others; only the main controller.js does.
Change-Id: Ic21b2d40d213a325509822f703709f52aa8dc8d7
1. Extend the JS modifier to allow adding top-level comments
(that is, replies to headings). PHP modifier doesn't do this
because we'll save the changes using paction=addtopic instead.
2. Subclass CommentController to allow adding a new heading and a
top-level comment underneath it at the same time.
3. A lot of ugly code in ReplyWidget to customize the interface
for this case. Much of it should probably be moved to
CommentController/NewTopicController.
Bug: T267595
Change-Id: I9c707bb7f7aae1b92c72fb4dee436490f8c8409b
The same ReplyWidget instance can be re-used when the user cancels
replying and then starts replying again to the same comment.
Previously, the initial values passed to the constructor (when switching
modes) would still persist in this case, even if they were incorrect.
Bug: T263061
Change-Id: I3dff007456bfd4f3149c718ae72fbf373a2e2913
This got lost when the watchlist updating code was refactored
out into controller.js, as it assumes that 'data' (the post data)
is still available.
Bug: T261362
Change-Id: Id274e7b8518b62dddbc3d4095d9f6cab17aa17cd
Causes page corruption, in a new way we haven't seen before.
* Revert "Move page updating logic to controller.js"
This reverts commit 54fdc6de06.
* Revert "ReplyWidget: Move clear methods from #teardown to #clear"
This reverts commit 9b811a94e0.
* Revert "ApiDiscussionToolsEdit: Do not pass 'basetimestamp'"
This reverts commit 7de5938a6f.
* Revert "Use DOMCompat::getOuterHTML instead of doc->saveHTML()"
This reverts commit 7b2448d2f0.
* Revert "CommentController: Remove remains of client-side edit conflict handling"
This reverts commit 2d038af705.
* Revert "Restore error message for when comment is deleted while replying"
This reverts commit 655c0526d6.
* Revert "Use transcluded from API to avoid ever fetching Parsoid DOM in client"
This reverts commit 9d0fc184fe.
* Revert "Create a 'transcludedfrom' API endpoint"
This reverts commit 5d8f3b9051.
* Revert "Edit API for replies"
This reverts commit 8829a1a412.
Bug: T259855
Change-Id: I6419408c6194ec0afa6b8ee604b12c1a24c6ac7b
In commit 8829a1a412 we kept this code
when adding the reply API, but on second thought it doesn't actually
make sense.
The reply API should never fail with an edit conflict normally, since
it makes the edit on the latest version of the page. If it does fail,
I think it's better to just show the error message. Current behavior
is to retry, and if that doesn't actually solve the problem, this ends
up in an infinite loop.
Bug: T252558
Change-Id: I5e0dcb2c42e5de4f18e99b8a761ca048a430b31e
This reverts commit 96953647c3.
* Re-apply "Edit API for replies"
This applies commit 8829a1a412.
* Re-apply "Create a 'transcludedfrom' API endpoint"
This applies commit 5d8f3b9051.
* Re-apply "Use transcluded from API to avoid ever fetching Parsoid DOM in client"
This applies commit 9d0fc184fe.
* Re-apply "Restore error message for when comment is deleted while replying"
This applies commit 655c0526d6.
Change-Id: Id20d21899f87464636022aa0683f8c03e0060117
Causes page corruption.
* Revert "Restore error message for when comment is deleted while replying"
This reverts commit 655c0526d6.
* Revert "Use transcluded from API to avoid ever fetching Parsoid DOM in client"
This reverts commit 9d0fc184fe.
* Revert "Create a 'transcludedfrom' API endpoint"
This reverts commit 5d8f3b9051.
* Revert "Edit API for replies"
This reverts commit 8829a1a412.
Bug: T259855
Change-Id: I98036f14dd900b51f20e98696e31b9b618eceee1
* Remove the existing approach for detecting signatures that only
worked in source mode; remove autoSignWikitext()
* Use the same approach for auto-signing in source mode as we have
already used in visual
* In both modes, detect whether the user has already typed a signature
at the end of their comment in the modifier, and if so, don't add a
signature
* Add test cases for the detection
Bug: T255738
Change-Id: I791d3035cb1ffc33ce3966d4617a25d08700c35b
Load 'ext.visualEditor.mwsignature' (which implements VE's existing
handling for signatures), then subclass and override a bunch of things
in order to:
* Replace the context menu with a note that you don't need to type the
signature when commenting using the reply widget
* Override the sequence/command to insert signature so that it selects
it afterwards and thus displays the context menu
* Treat signatures as signature nodes when switching from wikitext,
instead of the normal pre-save transform turning them into regular
links and text
Bug: T255738
Change-Id: Icb542451c2307ab51e56bd627804096c7b5552c8
Separate out conversion to DOM nodes, and update
now that postReply doesn't need to return a promise.
Change-Id: Iab6192ba252244009d2374c9423d14279e8d1c4f
Parsoid doesn't understand syntax expanded during pre-save transform,
e.g. [[User:Foo|]] or ~~~~, and it gets nowikied when switching back.
Change-Id: I791426d9d6c0a1399b1e95039b11e43a3e5bf79f
This was removed upstream due to a regression.
We don't need it right now, but may need it in the future to
support editing, so replace with a TODO.
Change-Id: Ia73657080241319df309f3b6566ac0ac36a5909d