Commit graph

3 commits

Author SHA1 Message Date
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