Commit graph

3175 commits

Author SHA1 Message Date
jenkins-bot 84ea64e752 Merge "Use setExtensionData() instead of marker comments where possible (2/3)" 2023-02-12 01:09:10 +00:00
jenkins-bot 7452f9ae32 Merge "Use setExtensionData() instead of marker comments where possible (1/3)" 2023-02-12 01:08:07 +00:00
jenkins-bot 5a9cb0c358 Merge "Move TOC metadata generation to a post-processing step" 2023-02-12 01:06:57 +00:00
Bartosz Dziewoński ab40ef62c0 Use setExtensionData() instead of marker comments where possible (3/3)
We started using marker comments (HTML comments with special content
inserted into the page) for the reply buttons back in the day, because
we needed to indicate their location in the HTML. Later we used the
same idea for things which aren't actually tied to a specific location
in the HTML, such as boolean data like __DTEMPTYTALKPAGE__. There is a
better way to do this.

This commit stop writing the HTML comments, which are no longer used,
and cleans up the tests.

Bug: T328980
Change-Id: Ic0d336dfbeb932134ec94bc0e86bc2a26921d440
2023-02-11 20:35:06 +01:00
Bartosz Dziewoński 0ac420ecbc Use setExtensionData() instead of marker comments where possible (2/3)
We started using marker comments (HTML comments with special content
inserted into the page) for the reply buttons back in the day, because
we needed to indicate their location in the HTML. Later we used the
same idea for things which aren't actually tied to a specific location
in the HTML, such as boolean data like __DTEMPTYTALKPAGE__. There is a
better way to do this.

This commit starts reading from ParserOutput::getExtensionData(),
which was generated by the previous commit, and should be present
in all cached ParserOutput objects by the time we merge this.

Bug: T328980
Change-Id: I4bf81ef3fd904f4d920d0756370c9bfa0a10a774
2023-02-11 19:33:20 +00:00
Bartosz Dziewoński 8fb467896f Use setExtensionData() instead of marker comments where possible (1/3)
We started using marker comments (HTML comments with special content
inserted into the page) for the reply buttons back in the day, because
we needed to indicate their location in the HTML. Later we used the
same idea for things which aren't actually tied to a specific location
in the HTML, such as boolean data like __DTEMPTYTALKPAGE__. There is a
better way to do this.

This commit starts writing data to ParserOutput::setExtensionData(),
which will be used in a later commit to be merged separately to avoid
issues with cached ParserOutput objects.

Bug: T328980
Change-Id: Ieb7bc3f83a402f9ebb096ed63336c77073bd2e7c
2023-02-11 20:19:55 +01:00
Translation updater bot 543dc77259 Localisation updates from https://translatewiki.net.
Change-Id: Ie542772b2aa6c492293f4d20d83a08948c2e3a40
2023-02-10 08:43:48 +01:00
Translation updater bot cf65033dee Localisation updates from https://translatewiki.net.
Change-Id: I9d2e31086acb0be1e7df158f06523a5dd532707e
2023-02-09 10:11:33 +01:00
Translation updater bot f19fb989b2 Localisation updates from https://translatewiki.net.
Change-Id: I5aa724d03340f2fec95b89bac5110611ce559df4
2023-02-08 08:39:39 +01:00
Bartosz Dziewoński 8eadff3b0d Optimize selectors in mobile hacks
See T328452#8587912

Bug: T328452
Change-Id: I584ef836d84cfa52ed003aae217c5c3b4e4ddbdd
2023-02-07 02:56:05 +01:00
Bartosz Dziewoński fce317ace4 Move TOC metadata generation to a post-processing step
Instead of generating the TOC HTML additions immediately, store
the data we need using ParserOutput::setExtensionData(), and use
the OutputPageParserOutput hook to fetch it and generate the HTML.

We check that the stored data is present before using it to avoid
issues with cached ParserOutput objects.

Bug: T328122
Change-Id: I7d4988cd568f10b7995a4d744e0ec6e7ce081b0e
2023-02-07 02:39:11 +01:00
Bartosz Dziewoński d0fb22a686 Special case opening new topic tool when VE or 2017WTE is open
Depends-On: Ica75f8334ef32ffbcc59109a46624acdf271847d
Bug: T317035
Change-Id: I87dc4b85df8deae5b16ae30a2ed054bfdcfdaa73
2023-02-06 23:04:10 +00:00
jenkins-bot daff9f6c27 Merge "Special:TopicSubscriptions: Perform unsubscribe asynchronously" 2023-02-06 23:01:01 +00:00
Ed Sanders a00d1b7a87 Hide (un)subscribe buttons when JS disabled
These buttons require JS to do anything. We can consider
providing a fallback action for subscriptions at a later date.

Change-Id: I9da546b2968e06d80c515eb5a05656a462b8201d
2023-02-06 22:36:14 +00:00
Translation updater bot 6907b603d2 Localisation updates from https://translatewiki.net.
Change-Id: I692393095c97e568bcd264ce2943eec0598b597d
2023-02-06 08:44:48 +01:00
Ed Sanders 15a8074002 Special:TopicSubscriptions: Perform unsubscribe asynchronously
Bug: T327662
Change-Id: Ib7f5cf8b075f44ac06c0a014aa1e200ccda8fe26
2023-02-04 14:30:14 +00:00
Translation updater bot e89840cbae Localisation updates from https://translatewiki.net.
Change-Id: Ib77ead8a89895d79c9e3a411ee43a63f656f1bfb
2023-02-03 08:47:38 +01:00
jenkins-bot f42b6db413 Merge "Always reset ReplyLinksController before re-initializing" 2023-02-02 18:04:11 +00:00
jenkins-bot c5ac63f921 Merge "Add comments about unwrapping Parsoid sections" 2023-02-02 17:57:53 +00:00
jenkins-bot d7f30dcd19 Merge "Restore autosave for new topic when only title was provided" 2023-02-02 17:57:02 +00:00
jenkins-bot b30256d01b Merge "Fix summary when topic title is changed after restoring from autosave" 2023-02-02 17:56:41 +00:00
jenkins-bot 9a318bdc89 Merge "Remove dtenable API hack" 2023-02-02 17:52:57 +00:00
jenkins-bot b95faa7978 Merge "Remove __DTLATESTCOMMENTPAGE__ comment from output" 2023-02-02 17:52:23 +00:00
Ed Sanders a1217913ae Remove dtenable API hack
This hack isn't necessary any more as reply links are always
added and enabled/disabled by CSS.

Change-Id: Ifecdd4299396f6cab7b192cde18d3001b9553f61
2023-02-02 17:20:37 +00:00
Ed Sanders 3c04944a86 Remove __DTLATESTCOMMENTPAGE__ comment from output
Other DT markers are removed because we return the body text, but
in this case we return subtitle text to be inserted elsewhere.

Instead pass $text by reference so it can be modified directly.

Change-Id: I9fe4194681cd3737661dca3c8a16e30a6001bd73
2023-02-02 12:51:11 +00:00
jenkins-bot e55da35d44 Merge "Fix detection for the sticky "Add topic" being stuck" 2023-02-02 12:10:42 +00:00
jenkins-bot 2d7fd5cabc Merge "Fix interaction of "Add topic"/"Read as wiki page" buttons with categories" 2023-02-02 12:09:48 +00:00
jenkins-bot 1b3356ad33 Merge "NewTopicController: Attach after .mw-parser-output" 2023-02-02 12:09:46 +00:00
jenkins-bot 73bc8ecff0 Merge "Don't add custom attributes in unwrapParsoidSections()" 2023-02-02 09:23:46 +00:00
Translation updater bot 7b88bb3024 Localisation updates from https://translatewiki.net.
Change-Id: I993d129d4f6d43fe60ee05817b3cf5ec092d2961
2023-02-02 08:46:38 +01:00
Bartosz Dziewoński 579766b5ab Fix detection for the sticky "Add topic" being stuck
This fixes some animations when scrolling.

Change-Id: I5ed4a066436f673732227612c5b393ea47e16c45
2023-02-01 20:09:28 +01:00
Bartosz Dziewoński 52de4b0b1b Fix interaction of "Add topic"/"Read as wiki page" buttons with categories
Bug: T328452
Change-Id: Iabb52c73e4b4a83175d95d8d542ef752f6f961dc
2023-02-01 20:09:28 +01:00
Bartosz Dziewoński 8374094109 NewTopicController: Attach after .mw-parser-output
Bug: T328039
Change-Id: I32b07756f2a967fcbd26b44ebfbcfd5a608e9484
2023-02-01 20:09:28 +01:00
Bartosz Dziewoński b75112f5e2 Tiny CSS simplification
Change-Id: I2b554ae524f36da5c495eb853af027b8ab21ece7
2023-02-01 20:09:28 +01:00
Bartosz Dziewoński 4e69ae1a18 Fix double margin/padding on the mobile lede dialog
Change-Id: Ib5bf882c04d0979728fbfb65b4e9767ddbb4f6d2
2023-02-01 20:09:28 +01:00
Translation updater bot 45d63c7de0 Localisation updates from https://translatewiki.net.
Change-Id: I785a76567d2088b8ea4f030f1b05b76387f41086
2023-02-01 09:17:45 +01:00
Ed Sanders 34a120d53a Look for Vector 2022 sticky header class in new location
This class was moved from <body> to <html> in Id5afe2c60.

Change-Id: Iad64abb02839c376d2f8955a0889f9ff0658a98c
2023-01-31 15:51:12 +00:00
jenkins-bot 5861393c9a Merge "Hide "Add topic" footer on talk pages when empty state is shown" 2023-01-31 15:14:28 +00:00
Bartosz Dziewoński 3624d89c8b Don't add custom attributes in unwrapParsoidSections()
This code was unnecessarily copied from VE. It's not needed for
anything in this extension, and it causes the headings to be treated
as modified by selser, which in turn causes dirty diffs.

Bug: T328268
Change-Id: Ibdbed430f2ff28d0ea2e67644075c1621d9fae53
2023-01-31 01:32:02 +01:00
Translation updater bot bbf5fe6287 Localisation updates from https://translatewiki.net.
Change-Id: I065ba3ce2cf5c769a59282300bf61db913638d95
2023-01-30 08:29:45 +01:00
Bartosz Dziewoński 5ad0a7bfcb Add comments about unwrapping Parsoid sections
Follow-up to c9deff179f.

Change-Id: Ib32442020749103012ec508d870d40b7b96f05a0
2023-01-27 17:07:56 +01:00
jenkins-bot e97d9c3dfa Merge "Don't rely on ParserOutput::getTOCHTML() to determine if ToC is present" 2023-01-27 10:13:37 +00:00
C. Scott Ananian 086ce6550f Don't rely on ParserOutput::getTOCHTML() to determine if ToC is present
ParserOutput::getTOCHTML() is being deprecated, and all skins are now
generating the TOC from the TOCData returned by
ParserOutput::getTOCData().  The SHOW_TOC flag was introduced in core
to determine if the TOC should be shown, but Vector-2022 *may* begin to
use other heuristics to determine whether to show the TOC (T315862).
We're conservatively going to process the TOC as long as there is
TOC present to process.

Bug: T328072
Change-Id: I38b439c6752157dbee9b09c9f5443a740dbaabf4
2023-01-27 09:58:47 +00:00
Translation updater bot cf10fb1566 Localisation updates from https://translatewiki.net.
Change-Id: I7d3496310e708d0af4e10b8002f5ceef70de28c3
2023-01-27 08:36:01 +01:00
Bartosz Dziewoński c9deff179f ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing
Otherwise, when a transclusion covers a section boundary, both whole
sections are considered to be transcluded.

We already use this method everywhere else (by way of
HookUtils::parseRevisionParsoidHtml), and VisualEditor also applies
the same transformation (mw.libs.ve.unwrapParsoidSections) before
opening the page for editing.

Bug: T327704
Change-Id: I9d8288e2740d816edb9cbc01d7e5642d52c610d3
2023-01-26 19:26:14 +00:00
Bartosz Dziewoński ff77db5ef4 Temporarily disable failing test
Bug: T328072
Change-Id: I6613cb8c2673be82ccd030639015bb626b2fe21b
2023-01-26 20:25:23 +01:00
Translation updater bot 3224d23c95 Localisation updates from https://translatewiki.net.
Change-Id: If1da3c196fa978bcfe11fa987469d5a4fe453902
2023-01-26 08:51:21 +01:00
Bartosz Dziewoński 06919f9444 Always reset ReplyLinksController before re-initializing
Previously we only did it when re-initializing after saving a reply
using our tools, but it could happen for a different reason, such as a
NWE edit.

Bug: T317035
Change-Id: Ia8152fc83f74689802f8dbbc20607c9026a2a5ab
2023-01-24 16:42:43 +01:00
Bartosz Dziewoński a5a026ceba Restore autosave for new topic when only title was provided
Bug: T315730
Change-Id: Ib68ebd23d3c4ef8e577023465236b4391b00bf2c
2023-01-24 14:28:17 +01:00
Bartosz Dziewoński 1fb67ef63d Fix summary when topic title is changed after restoring from autosave
Previously, we would restore the title and the summary generated from
it, but we wouldn't restore `prevTitleText`, so we would lose track of
the fact that it was automatically generated, and stop updating it
because of that.

Instead of adding it to the stored data, let's instead stop storing
automatically generated summaries, and tweak the code to support
generating them when restoring.

Bug: T315730
Change-Id: I96420bc0a3e34373190d2c2c0db2e2175ad3156d
2023-01-24 14:28:17 +01:00