Commit graph

3993 commits

Author SHA1 Message Date
Ed Sanders 4da2ecf32f Hide section collapse button in preview.
In general we are hiding non-content elements in the preview
and this matches the behvaviour of the article editor.

Change-Id: I6669d8cc737214d464b662ccc6900ccce229b3d7
2022-07-29 14:09:56 +01:00
Translation updater bot ef3da04807 Localisation updates from https://translatewiki.net.
Change-Id: I7a44132e208ae9feb4bbf1bf1cd5f0a0fe3157ba
2022-07-29 08:52:57 +02:00
jenkins-bot a18c5c3e3a Merge "Don't show empty page state on redirect pages" 2022-07-28 22:26:11 +00:00
Ed Sanders fcdd6b0ed5 Don't show empty page state on redirect pages
Add the redirect check to shouldShowNewSectionTab.

Try to run cheaper checks before more expensive ones.

Depends-On: I5755863243d8ad336ad20626f439d70eb3b31f32
Bug: T312599
Change-Id: I6848e529a2537d4058613db0c3b900bc9f4f59f8
2022-07-29 00:15:42 +02:00
jenkins-bot 508e6446c5 Merge "API ThreadItemsHTML: improve generation of othercontent" 2022-07-28 21:56:56 +00:00
Bartosz Dziewoński f4a9d5b8f9 Fire new 'wikipage.tableOfContents' hook to update TOC after save
Bug: T294950
Depends-On: Icaeda68ded94a04edef7a3629385eeb232048684
Depends-On: I1644a74370b42b04d0db167879f7de2207ebfcf5
Change-Id: Ic3ef4e332ade8918778b6aaaa8eaf7e98f0a8d7d
2022-07-28 23:37:29 +02:00
Bartosz Dziewoński 9425f75f47 Initialize on live preview and real-time preview too
Bug: T309423
Change-Id: I661dfb2b9159fe56edffabd9fba00cd2c56343cd
2022-07-28 19:06:32 +02:00
jenkins-bot 6330816a1c Merge "More consistently handle new topic tool vs empty state" 2022-07-28 13:41:24 +00:00
jenkins-bot c13926de8a Merge "Don't show new topic tool empty state on existing non-talk pages" 2022-07-28 13:40:43 +00:00
David Lynch ec0e2920ae API ThreadItemsHTML: improve generation of othercontent
Othercontent would often contain the opening tag of the next heading /
section. By looking for the closest node with a previousSibling we can
more-reliably escape the heading.

Also, only add the initial placeholder if there's content before the
first heading. We do this by testing for any siblings before the
startContainer of the first heading -- if there are any, assume this
means there's some sort of content. (This can still result in a
placeholder with `othercontent:""` if there's only whitespace before
the first heading.)

Bug: T313850
Change-Id: I080205b74413c46d3cf3442e79276145aaa9439c
2022-07-28 02:51:18 -05:00
Translation updater bot ec2c4acf85 Localisation updates from https://translatewiki.net.
Change-Id: I7963edecb0b436a6c608c88766fbd4ef2f11d5ed
2022-07-28 08:56:50 +02:00
Bartosz Dziewoński e1499c0291 More consistently handle new topic tool vs empty state
We had different logic for the empty state on pages that exist and
those that don't. For the second case, we relied on the new topic tool
becoming unavailable in some cases, but that could cause complications
elsewhere (e.g. if the page also had a custom button to add a new
section).

The new topic tool is now available regardless of the page. Instead,
the empty state is controlled separately, by the same method in both
cases.

As far as I can tell, the effect is exactly the same as before.

Change-Id: I5b36e6f027cf76dd0e3a8ee3cb5156fe1eaac8a8
2022-07-28 02:16:07 +02:00
Bartosz Dziewoński 34e755c623 Don't show new topic tool empty state on existing non-talk pages
Bug: T312599
Change-Id: Ie691498f7b89cb34a414cb8dfae9337f1b706685
2022-07-28 01:57:32 +02:00
jenkins-bot 131f00c464 Merge "Add topic containers HTML to parser cache even when feature is disabled" 2022-07-27 19:19:48 +00:00
jenkins-bot 5dad5e63c2 Merge "Visual enhancements: Fix loading of icons" 2022-07-27 16:33:28 +00:00
Ed Sanders 5e2b209314 Add topic containers HTML to parser cache even when feature is disabled
Remove hacks marked as 'TEMPORARY' now that we consider the
HTML to be stable enough.

This will avoid issues with HTML/CSS being out of sync in future deployments.

Bug: T313560
Change-Id: Ie00ff38a422f241add19d500adaf22dfeee10e8c
2022-07-27 17:26:33 +01:00
Ed Sanders 06d14d8c8f Visual enhancements: Fix loading of icons
* clock, userAvatar, speechBubble were dropped before topic
  containers was merged
* Load ellipsis & edit icons on mobile only
* Load bell & bellOutline for topic subscriptions button

Change-Id: I77d1336627b564be756e3ec50b4686b8f9ac72dc
2022-07-27 18:24:54 +02:00
Ed Sanders 2f44d99184 Simplify CSS selectors for [reply] and [subscribe] links
:first-of-type selectors refer to the node name, so just
use :first-child and :last-child for the open and close brackets.

Change-Id: I2e8ca7e99d1262522ed2d3b5133093817af8ad29
2022-07-27 16:22:11 +00:00
jenkins-bot a9ad7dbb24 Merge "Move subscribe button up on desktop" 2022-07-27 14:16:14 +00:00
jenkins-bot b81e60e9cb Merge "Prepend subscribe links to headings" 2022-07-27 14:13:37 +00:00
Ed Sanders 2960853088 Move subscribe button up on desktop
Bug: T312674
Change-Id: I419883b5f9a4291b4bf575d57195d553fd5e291e
2022-07-27 13:55:03 +01:00
Ed Sanders df1cd6be80 Prepend subscribe links to headings
This ensures they stay aligned with the top of the heading when text wraps.

Bug: T313406
Change-Id: Ifd8f93f63a1b3e3e4bd38a1d74f9afed647f7e68
2022-07-27 13:48:28 +01:00
Translation updater bot 821eb1a518 Localisation updates from https://translatewiki.net.
Change-Id: I20dd03614f52838172291eddf30afed7b4f69089
2022-07-27 08:26:06 +02:00
jenkins-bot 61f76003d1 Merge "Show empty state on mobile when there is only non-discussion content" 2022-07-26 13:24:29 +00:00
Ed Sanders 1d1df63cab Show empty state on mobile when there is only non-discussion content
Bug: T313801
Change-Id: I4e9910ef7d63c6ce330da1a896f518a9a22a12cd
2022-07-26 13:52:22 +01:00
Translation updater bot 1419b79063 Localisation updates from https://translatewiki.net.
Change-Id: Id9dd8d67000382a097d2d68ac2f7bd335a173464
2022-07-26 08:25:00 +02:00
Bartosz Dziewoński e7bbc9864c ReplyWidget: Scroll save error into view after showing it
Bug: T298263
Change-Id: Ibe488bf9184dc9d9c3c8b2c3491c0baf6676ba16
2022-07-25 18:16:13 +02:00
Translation updater bot c93edc44b7 Localisation updates from https://translatewiki.net.
Change-Id: I75c18ff9a66c2c0595bdfb778523aa60690eae05
2022-07-25 09:50:22 +02:00
Translation updater bot 122972e1c2 Localisation updates from https://translatewiki.net.
Change-Id: I6de47853e045689ac68aa5b30835a3ccd31d46d1
2022-07-25 08:36:09 +02:00
Ed Sanders 6d9b0ec6b4 Show topic container even if heading is unsubscribable
Bug: T312140
Change-Id: Ie0412b9f238d5ff8e54fd2ea358c1c26e303f4e1
2022-07-23 01:21:52 +02:00
Bartosz Dziewoński dc342291b5 highlighter: Fix exception when trying to highlight an unknown comment
If some content is loaded without re-initializing DiscussionTools
(this currently happens on live preview), then a link to a comment is
clicked, we will not find the comment, which previously caused an
exception. Just ignore this, other code paths in highlighter already
handled this situation in this way.

Bug: T309423
Change-Id: Ie46fd782b8a45907dc6fc604691575c4b55d08ce
2022-07-22 17:47:09 +02:00
Translation updater bot f484a708c4 Localisation updates from https://translatewiki.net.
Change-Id: I8eb820f72d1a7bed69491f693ed19f0e7238fb81
2022-07-21 09:03:35 +02:00
Translation updater bot ef82e80ca6 Localisation updates from https://translatewiki.net.
Change-Id: I3b64feedfef6177b6889e421f85c81ef335d846a
2022-07-20 08:27:34 +02:00
jenkins-bot d15a8c931a Merge "Separate ContentThreadItem and DatabaseThreadItem etc." 2022-07-19 16:03:02 +00:00
Translation updater bot 419f48bab8 Localisation updates from https://translatewiki.net.
Change-Id: I1b5731e8683331e0609b4c21d61f24658c3eb68f
2022-07-19 08:16:22 +02:00
jenkins-bot 6e57e3ba78 Merge "Show a "Return to reply/new topic" button when widget is scrolled off the screen" 2022-07-18 16:09:54 +00:00
Ed Sanders 2c2e57fd47 Show a "Return to reply/new topic" button when widget is scrolled off the screen
Bug: T310967
Change-Id: I3d1626162eb5c66ac35560792a81ce09455e86a8
2022-07-18 13:20:12 +01:00
Translation updater bot 7906e25adb Localisation updates from https://translatewiki.net.
Change-Id: Ic2d769a225f7c9c4f881cc4cdc6b82ae9c8e16eb
2022-07-18 08:14:28 +02:00
Translation updater bot 250bfd9af0 Localisation updates from https://translatewiki.net.
Change-Id: Id9802bb904f47efd2dd6f2c6cbb5534a9fbe8abb
2022-07-15 08:43:14 +02:00
Translation updater bot 3c9afa1c67 Localisation updates from https://translatewiki.net.
Change-Id: Ib68567c505ea55d9aa13de614aa7f9015a10766c
2022-07-14 08:47:56 +02:00
jenkins-bot 873ea3cd38 Merge "Avoid localized digits in internal timestamps in JS" 2022-07-13 17:35:46 +00:00
Translation updater bot bb3a35ed90 Localisation updates from https://translatewiki.net.
Change-Id: I0fde9ec977949bbc470c3d5d8f81325134e8f7ec
2022-07-13 08:17:29 +02:00
Bartosz Dziewoński 2d3b497a21 Avoid localized digits in internal timestamps in JS
Unlike PHP DateTime, and unlike the .toISOString() method,
the Moment.js .format() method will output localized digits.

Bug: T312828
Change-Id: I49a250b1ad74d9395bf3f994379613cc121b5be4
2022-07-13 02:33:24 +02:00
Bartosz Dziewoński f51d26fd3a Parse 'DiscussionToolsTimestampFormatSwitchTime' config value as UTC
When the input to moment() doesn't define a timezone, it
defaults to the local timezone (as defined on the device,
not in user preferences).

Bug: T312828
Change-Id: I8d2e1c2f6feb5584af4bbf9fef39567eb87780ff
2022-07-12 14:10:09 +02:00
Translation updater bot 79a93ae397 Localisation updates from https://translatewiki.net.
Change-Id: Icb4c4fef2056e30ee5ffb54a85a03104540efbe5
2022-07-12 08:14:45 +02:00
jenkins-bot d35ff76d81 Merge "Don't enable visual enhancements CSS on mobile when feature is "unavailable"" 2022-07-12 00:26:22 +00:00
Ed Sanders c3efa2fd89 ImmutableRange: Fix setStart/setEnd to avoid backwards range
The new behaviour better matches the DOM spec.

Change-Id: Ib795e99cdaeedfb1d9e03eb888dd0a243028a61e
2022-07-11 21:40:09 +00:00
Translation updater bot a71a33153b Localisation updates from https://translatewiki.net.
Change-Id: Ie5dce0c0ff7898a5f1989228eac09afd10ed05c1
2022-07-11 09:49:29 +02:00
Ed Sanders f739160fb4 Fix infinite recursion when checking for the new topic tool on empty pages
Bug: T312689
Change-Id: Iaf5033a55e3840ef65be0c4994f8b6c00fe2551b
2022-07-09 12:48:17 +01:00
Ed Sanders 09a84e81e5 Don't enable visual enhancements CSS on mobile when feature is "unavailable"
Bug: T312683
Change-Id: Ifa66a62f335b5c2eee9c59284a0f4b851a83b94b
2022-07-08 22:42:39 +01:00