Commit graph

1592 commits

Author SHA1 Message Date
Bartosz Dziewoński 9273611a08 Remove unused 'use' definitions
I guess that at some point this class was meant to convert some
timestamps, but it does not (it returns them as strings in the
database format).

Change-Id: I33ee5e8807ee686b77819ef16f43509326c60762
2021-08-31 22:03:51 +02:00
Translation updater bot 20ce7f1815 Localisation updates from https://translatewiki.net.
Change-Id: I62eb99bed2b2a63e36547ebae67dccb5589d1be6
2021-08-31 08:15:40 +02: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
Translation updater bot 61d5b624ae Localisation updates from https://translatewiki.net.
Change-Id: Ia92bf13ab44a2ec8d55b1df4f059a0da8ab254da
2021-08-30 08:20:05 +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
Translation updater bot b2ba8b7b31 Localisation updates from https://translatewiki.net.
Change-Id: I7470c967dba7479a2a78385baf93f922c30254fa
2021-08-27 08:43:42 +02:00
jenkins-bot c68d0aeec1 Merge "Empty states for anon/IP user talk pages" 2021-08-26 20:20:20 +00:00
jenkins-bot 1f9a0c45d2 Merge "Empty state copy changes" 2021-08-26 20:20:18 +00:00
David Lynch 21600231d9 Empty states for anon/IP user talk pages
Bug: T287779
Bug: T288556
Change-Id: I9d01d1ac04c0cc443c4cbfe94d301db16f5b1ef6
2021-08-26 22:11:13 +02:00
jenkins-bot 35b3859ce9 Merge "Hide the top-level warningbox when the new discussion widget is open" 2021-08-26 19:30:10 +00: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 e85795446b Empty state copy changes
Bug: T288741
Change-Id: Ie8b8fc69d853bce21765926f36e2d1f730abbb5e
2021-08-26 12:03:50 -05:00
Translation updater bot fd6455f774 Localisation updates from https://translatewiki.net.
Change-Id: I813ea54544d4650b431f55947f6be3b3c81a9af6
2021-08-26 08:35:58 +02:00
Bartosz Dziewoński 4bbbdc9703 EventDispatcher: Try really, really hard to read from master
Follow-up to 37d6825c14.

Bug: T289717
Depends-On: I2a614915c7d9ffbc4f466204b2684478fb52f30e
Change-Id: Id2e040a19e457a2a8f4121b04ebd43bf6ea64181
2021-08-25 21:38:10 +02:00
Translation updater bot c960f41652 Localisation updates from https://translatewiki.net.
Change-Id: Ie0a9733577deffa4b0ee703bee5f955e1c6c1113
2021-08-24 12:38:41 +02:00
Translation updater bot c907cf4a43 Localisation updates from https://translatewiki.net.
Change-Id: If6420654e66fa1fc2131d26587e97b3fb503936f
2021-08-24 10:20:59 +02:00
jenkins-bot b1eb884966 Merge "Improve discussiontoolssubscribe API documentation" 2021-08-24 02:42:17 +00:00
jenkins-bot 5d9d28b280 Merge "ApiDiscussionToolsSubscribe: Remove redundant checks" 2021-08-24 02:41:26 +00:00
Bartosz Dziewoński 90d84a0504 Fix localisation files for 781576fd
Doing this manually, because otherwise the next WMF branch would have
broken translations, and it's a pain to backport localisation changes.

Find:           :{{ARTICLESPACE}}:{{PAGENAME}}
Replace with:   :{{SUBJECTPAGENAME}}

Find:           {{ARTICLESPACE}}:{{PAGENAME}}
Replace with:   :{{SUBJECTPAGENAME}}

Change-Id: Ie64e57f705721be463750a0d876b92a06ae2e37b
2021-08-24 00:50:30 +02:00
jenkins-bot 2086851d44 Merge "Load styles in ParserOutput too" 2021-08-23 20:50:20 +00:00
Bartosz Dziewoński 6dd90eda4a Improve discussiontoolssubscribe API documentation
Bug: T280314
Change-Id: I0987faac2cd8c5276a37869212fa968f0d642c09
2021-08-23 18:40:00 +00:00
Bartosz Dziewoński bb5054435f ApiDiscussionToolsSubscribe: Remove redundant checks
$user is guaranteed to be a User object.

Also, while we're here:
* Remove an unnecessary TODO. There's no need for a more specific
  error message, this one is just fine, other extensions use it too.
* Replace isAnon() with !isRegistered(). It'll probably be deprecated
  soon, because the new UserIdentity interface doesn't include it.

Change-Id: Ifbe98f4eccef79deee6bdb54c1bccf49807a9563
2021-08-23 20:39:18 +02:00
Bartosz Dziewoński 781576fd7c Fix broken link in empty state on article talk pages
`[[:{{ARTICLESPACE}}:{{PAGENAME}}]]` results in `[[::Foo]]`, which
is not a valid link.

Luckily, there's a magic word `{{SUBJECTPAGENAME}}`, which is the same
as `{{ARTICLESPACE}}:{{PAGENAME}}`, but without pesky leading colons.

Follow-up to bb0b65dc0c.

Change-Id: I992bdb8807c665561cad58997017aab5a6c1d8e8
2021-08-23 17:36:13 +00:00
Translation updater bot 9018cc9997 Localisation updates from https://translatewiki.net.
Change-Id: Iaa5643ff5e3e46abf6aa821acea285ce26c6f037
2021-08-23 09:03:52 +02:00
Raymond bb0b65dc0c Add colon to avoid loading the file on file talk pages
example: https://commons.wikimedia.org/w/index.php?title=File_talk:Vorstellung_Projekt_MuLI,_KVB-Haltestelle_Bocklem%C3%BCnd-3380.jpg&action=edit&redlink=1
Change-Id: I9067390a7861cfb328fedfe6f5e56384ac141aeb
2021-08-20 22:49:03 +02:00
David Lynch 503d2f1f76 Enforce no text-indent on our reply button
Change-Id: Ie26d7632ec4845cc9048c0261b51ff2a1b6b51e2
2021-08-20 13:46:23 -05:00
Bartosz Dziewoński 3e19fce67a Load styles in ParserOutput too
We load them in OutputPage, because we need that to handle the
query parameter 'dtenable=1', but do it here as well just in case
the pages are somehow shown without involving OutputPage.

Per code review:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/713681/1/includes/Hooks/ParserHooks.php#90

Change-Id: I3f287a9e146de7fd4d37c47dfa47eeb03eeb8cf1
2021-08-20 18:49:04 +02:00
Translation updater bot 39e9016b87 Localisation updates from https://translatewiki.net.
Change-Id: Iae1baaa0acea6b44067eb5c1d5ff15724d27e8fa
2021-08-20 08:24:00 +02:00
jenkins-bot ccd2769b17 Merge "Remove remnants of the cookie hack for loading unavailable tools" 2021-08-19 16:32:10 +00: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 52ff6ef77e Merge "HookUtils: Simplify check for your own talk page" 2021-08-19 16:32:07 +00:00
jenkins-bot e2ef5764da Merge "Minor cleanups in topic subscription code" 2021-08-19 16:32:04 +00:00
jenkins-bot b7978be7ed Merge "Remove repetition in "Discussion pages" preferences" 2021-08-19 14:46:57 +00:00
Translation updater bot 92ae198a81 Localisation updates from https://translatewiki.net.
Change-Id: I8ba37de1e240352a1e5bcbcdc8797502abedec75
2021-08-19 08:13:22 +02:00
Bartosz Dziewoński c8fa10770a Remove remnants of the cookie hack for loading unavailable tools
Follow-up to ee524d6bd6.

Change-Id: I1b4dc587e6b629b05ca0581dcd384a2bc7f01d2a
2021-08-18 20:45:02 +02:00
Bartosz Dziewoński 75d63bb056 Remove repetition in "Discussion pages" preferences
Bug: T289187
Change-Id: Id6c90546e4b57754e13b55f7c61610b51de87966
2021-08-18 20:20:34 +02:00
Translation updater bot 232dc64246 Localisation updates from https://translatewiki.net.
Change-Id: Iedd5754ddb1619b34fc7cb66aa1d78a3d4ee04b5
2021-08-18 08:13:26 +02:00
Bartosz Dziewoński 4aca61990a HookUtils: Simplify check for your own talk page
This approach is used in our new topic tool empty state code and is
much nicer. Also fix typo in a comment nearby.

Change-Id: I80755ef0960a172b0f370c36c1979a86498d6fa9
2021-08-17 22:22:15 +02:00
Bartosz Dziewoński bcd92a5d33 Minor cleanups in topic subscription code
For automatic topic subscriptions, I plan to introduce a third
subscription state to indicate them. This patch includes minor tweaks
I wanted to add while working on that:

* Introduce constants instead of numbers
* Remove a TODO that doesn't seem like a good idea any more
* Remove a `"length": 1` on sub_state that did not do anything
  (but it might have been meant to indicate that it was supposed
  to be a boolean, which would be wrong)

Bug: T284836
Change-Id: I6e6096968ad38510102287bccd349090b6ca4280
2021-08-17 22:22:15 +02: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
Translation updater bot 7bcb5f195e Localisation updates from https://translatewiki.net.
Change-Id: Ie1e58b3aa4711b2d5039871beccac100e6183069
2021-08-17 08:19:16 +02:00
jenkins-bot 781992de2d Merge "Create a hidden revision tag for talk page comments" 2021-08-17 02:07:10 +00:00
jenkins-bot e090c455cc Merge "EventDispatcher: Fix ignoring level 3+ headings" 2021-08-16 22:08:42 +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 76b2f5bcbc Clarify the references to talk pages in notification preferences
Bug: T286954
Change-Id: I3ba3b76a74f2673f790745f385963b868ca711f6
2021-08-16 21:58:53 +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
Bartosz Dziewoński ad04b24ffd Create a hidden revision tag for talk page comments
Bug: T262107
Depends-On: I21159d03eebaf46ad94f4273ba698a59b8019185
Change-Id: Iceddfaf6a4bcc5e8b5c85c8cd5638bf14aa7db03
2021-08-16 15:42:51 +00:00
Bartosz Dziewoński 47510a22f3 EventDispatcher: Fix ignoring level 3+ headings
The code (prior to d25825a754) assumed
that level 3+ headings would always follow a level 2 heading or the
placeholder heading, but we don't generate a placeholder heading if
there are no comments in section zero.

Add more tests to confirm that comments under level 3+ headings (that
are not sub-headings of level 2), and level 1 headings, are ignored
when generating notifications, and do not mess with normal headings.

Bug: T288775
Change-Id: Ic57b56752a4797cb01234f66e0ed7b849752bd70
2021-08-16 15:42:06 +00:00