Commit graph

2046 commits

Author SHA1 Message Date
Translation updater bot 0f51909e36 Localisation updates from https://translatewiki.net.
Change-Id: I1e24632298572eecc1aace5e0ca6a2543b9741c7
2022-02-23 08:18:51 +01:00
jenkins-bot e48e058202 Merge "Mobile config: Always enable reply/newtopic tools on mobile, disable subscriptions" 2022-02-22 22:30:38 +00:00
Ed Sanders b4f10c5638 Mobile config: Always enable reply/newtopic tools on mobile, disable subscriptions
Bug: T302326
Change-Id: I64ffc904046f7d9d2fa651c086876add35061e0a
2022-02-22 23:24:28 +01:00
Ed Sanders d1b1745908 Avoid undefined index for mobileformat
Bug: T302344
Change-Id: I32844c61eeaf05771df2dd8b88e3c98f069cfada
2022-02-22 21:24:19 +00:00
Ed Sanders ae554cdd66 Fix legacy hint URI on mobile
Bug: T302307
Change-Id: I7ce370bb011f0b30505c1b195bf6c96317b159e7
2022-02-22 15:31:13 +00:00
Translation updater bot 1d40be1dd2 Localisation updates from https://translatewiki.net.
Change-Id: If8bf6c7e2f324f2550b6c96e47aafb61683480bd
2022-02-22 14:20:18 +01:00
Translation updater bot 54f2de2c45 Localisation updates from https://translatewiki.net.
Change-Id: I5db6282f24aa8721c04454e5606146e1fbe935df
2022-02-22 08:11:31 +01:00
jenkins-bot 1a48f8cd7e Merge "CommentParser: Inject a forgotten service" 2022-02-21 19:30:55 +00:00
Bartosz Dziewoński 85165543f4 CommentParser: Inject a forgotten service
Also sort alphabetically.

Change-Id: I9e77c4aa1fba930f382e3c4f17ac0504c2f06668
2022-02-21 20:15:54 +01:00
Bartosz Dziewoński aea36bab3a CommentParser: Fix a small use of global state
Also, in ThreadItem::getSinglePageTransclusionTitle(), we don't need
this terribly complicated method.

Change-Id: If02c09aaa2f4dd66b2bc253a1edec4ea107564ee
2022-02-21 18:15:31 +00:00
jenkins-bot aeabff63c9 Merge "Split off ThreadItemSet from CommentParser" 2022-02-21 16:33:58 +00:00
Bartosz Dziewoński 8e44b43df0 Split off ThreadItemSet from CommentParser
Goal:
-----
Finishing the work from Iadb7757debe000025e52770ca51ebcf24ca8ee66
by changing CommentParser::parse() to return a data object, instead of
the whole parser.

Changes:
--------
ThreadItemSet.php:
ThreadItemSet.js:
* New data class to access the results of parsing a discussion. Most
  methods and properties are moved from CommentParser with no changes.

CommentParser.php:
Parser.js:
* parse() returns a new ThreadItemSet.
* Remove methods moved to ThreadItemSet.
* Placeholder headings are generated slightly differently, as we process
  things in a different order.
* Grouping threads and computing IDs/names is no longer lazy. We always
  needed IDs/names anyway.
* computeId() explicitly uses a ThreadItemSet to check the existing IDs
  when de-duplicating.

controller.js:
* Move the code for turning some nodes annotated by CommentFormatter
  into a ThreadItemSet (previously a Parser) from controller#init to
  ThreadItemSet.static.newFromAnnotatedNodes, and rewrite it to handle
  assigning parents/replies and recalculating legacy IDs more nicely.
* mw.dt.pageThreads is now a ThreadItemSet.

Change-Id: I49bfe019aa460651447fd383f73eafa9d7180a92
2022-02-21 16:22:32 +00:00
Translation updater bot 59acf9a5cc Localisation updates from https://translatewiki.net.
Change-Id: Ia25a5ea1aeb42c1b5ae0ed7a1843759203dd6358
2022-02-21 08:15:37 +01:00
jenkins-bot b6e930a101 Merge "Change CommentParser into a service" 2022-02-20 14:01:11 +00:00
jenkins-bot ff6dbe0ed1 Merge "CommentParser: Remove unused method getThreadItemsByName()" 2022-02-20 13:45:06 +00:00
jenkins-bot c29c1eebd2 Merge "Split Data class into ResourceLoaderData and LanguageData" 2022-02-20 13:44:56 +00:00
jenkins-bot 4713986eb7 Merge "Various code quality tweaks" 2022-02-20 13:27:10 +00:00
Bartosz Dziewoński 4613ae78e7 Change CommentParser into a service
Goal:
-----
To have a method like CommentParser::parse(), which just takes a node
to parse and a title and returns plain data, so that we don't need to
keep track of the config to construct a CommentParser object (the
required config like content language is provided by services) and
we don't need to keep that object around after parsing.

Changes:
--------
CommentParser.php:
* …is now a service. Constructor only takes services as arguments.
  The node and title are passed to a new parse() method.
* parse() should return plain data, but I split this part to a separate
  patch for ease of review: I49bfe019aa460651447fd383f73eafa9d7180a92.
* CommentParser still cheats and accesses global state in a few places,
  e.g. calling Title::makeTitleSafe or CommentUtils::getTitleFromUrl,
  so we can't turn its tests into true unit tests. This work is left
  for future commits.

LanguageData.php:
* …is now a service, instead of a static class.

Parser.js:
* …is not a real service, but it's changed to behave in a similar way.
  Constructor takes only the required config as argument,
  and node and title are instead passed to a new parse() method.

CommentParserTest.php:
parser.test.js:
* Can be simplified, now that we don't need a useless node and title
  to test internal methods that don't use them.

testUtils.js:
* Can be simplified, now that we don't need to override internal
  ResourceLoader stuff just to change the parser config.

Change-Id: Iadb7757debe000025e52770ca51ebcf24ca8ee66
2022-02-19 19:51:57 +01:00
Bartosz Dziewoński f51f3a1051 CommentParser: Remove unused method getThreadItemsByName()
Follow-up to a5099739a6.

Change-Id: I53cbf6a7a2c9b95674998734689b3930dfe74149
2022-02-19 19:51:57 +01:00
Bartosz Dziewoński 99b5de8038 Split Data class into ResourceLoaderData and LanguageData
The Data class contained utilities for two unrelated purposes.
Split each half to a separate class.

Notably, this improves the signature of the getLocalData() function.

Change-Id: Icde615fb9d483fee1f352c34909b37f8ffde8081
2022-02-19 19:37:34 +01:00
Bartosz Dziewoński ae9f26a9e5 Various code quality tweaks
(suggested by PhpStorm)

composer.json:
* Document required PHP extensions

Parser.js:
* Remove incorrect param documentation
* Fix some typos in comments (missing parentheses)

CommentParser.php:
* Fix some typos in comments (missing parentheses)

ImmutableRange.php:
* Remove unused property
* Add a `throw` to indicate that code path is unreachable

SubscribedNewCommentPresentationModel.php:
* Add missing `return false`

CommentParserTest.php:
* Remove unnecessary pass-by-reference

CommentModifierTest.php:
* Remove unused variable

CommentParserTest.php:
* Don't construct Element objects directly. PHP's DOMElement allows
  it, but Parsoid/Dodo's doesn't, and we use the latter for static
  analysis. This generates all kinds of confusing warnings.

Change-Id: Ia9598ebea0e99830dd485296e94a9d96acc4b258
2022-02-19 19:36:52 +01:00
Ed Sanders d1e56c7dc5 ApiDiscussionToolsEdit: Pass useskin & mobileformat to ApiVisualEditorEdit
From there they are passed on ApiParse.

Change-Id: I8411379694961868c2540c42739fb4f5d7b61972
2022-02-18 16:40:38 +00:00
Translation updater bot 1df44c5102 Localisation updates from https://translatewiki.net.
Change-Id: I6e315a582403ccb25c6250c5d4f672c9c408ca36
2022-02-18 08:40:35 +01:00
David Lynch 7094cc592c Don't autosubscribe flagged bots
Bug: T301933
Change-Id: Icabee260a16ed2686a95250bad2aa1b92881566e
2022-02-17 11:54:14 -06:00
Translation updater bot 4f5293f5bc Localisation updates from https://translatewiki.net.
Change-Id: I9a6247d859298451199ef0e457ff9b209268c496
2022-02-17 08:11:41 +01:00
Translation updater bot 77034e77c2 Localisation updates from https://translatewiki.net.
Change-Id: I2f0cac5dd1cefeb2af78920aa0096882bbcfb64f
2022-02-16 08:12:56 +01:00
Translation updater bot 881faf0788 Localisation updates from https://translatewiki.net.
Change-Id: Ic91fe369d927fc079a64dec957ecd6fd7073c9a5
2022-02-15 08:17:11 +01:00
jenkins-bot 902a389474 Merge "Prevent floated content from leaking out of the preview container" 2022-02-14 21:07:53 +00:00
jenkins-bot 2645cf0757 Merge "Log talk_page_edit events for adding a new topic" 2022-02-14 21:06:41 +00:00
Bartosz Dziewoński f9f7aeb295 Prevent floated content from leaking out of the preview container
Change-Id: Ic4c5267cbe44fa22537a708f66e08503d0c1f816
2022-02-14 20:47:39 +01:00
David Lynch d1e62d364d Log talk_page_edit events for adding a new topic
Bug: T301496
Change-Id: I618339f254c89db45891ee403f037c555afdda6e
2022-02-14 11:48:16 -06:00
Translation updater bot b86c291422 Localisation updates from https://translatewiki.net.
Change-Id: I5939ff3e24d2d36268991ff3dda82e373b5415b0
2022-02-14 08:14:10 +01:00
jenkins-bot c49d518ff1 Merge "Update references to warningbox class" 2022-02-11 21:20:49 +00:00
Translation updater bot 0ded0d5bfb Localisation updates from https://translatewiki.net.
Change-Id: I10d162707ecc233f37d3c7c6d5bc175b1a7eb00a
2022-02-11 08:41:25 +01:00
Translation updater bot 92e3a5bb42 Localisation updates from https://translatewiki.net.
Change-Id: I1acdee01d5cfe2b22f99c73df8068f86a1f3529d
2022-02-10 08:41:31 +01:00
jenkins-bot 8bcaf75372 Merge "Replace use of deprecated OutputPage::enableClientCache( false )" 2022-02-10 07:01:26 +00:00
Bartosz Dziewoński 4ff65cf5e2 Update references to warningbox class
Bug: T301401
Depends-On: I632e42ee9065b38dca443beae1cb01ef714cae7b
Depends-On: I7a7046bf9b9765cbb82ec3caa1530de7f05e0da4
Change-Id: Ia42cf9cd5b63cfe679bdf90bfcbf528f14f9ebcc
2022-02-09 21:36:50 +01:00
jenkins-bot 548c0d12c9 Merge "build: Update eslint-config-wikimedia to 0.22.1" 2022-02-09 15:38:41 +00:00
jenkins-bot aa64257169 Merge "Don't refer to non-existent fields when using 'hide-if'" 2022-02-09 15:37:30 +00:00
Bartosz Dziewoński 8b6ffc945f Don't refer to non-existent fields when using 'hide-if'
Bug: T301317
Change-Id: I40577b41e0c957281a45b71802808ec535b65653
2022-02-09 15:38:47 +01:00
Ed Sanders f0940557ee build: Update eslint-config-wikimedia to 0.22.1
Change-Id: I18a5ceae9e8fdc6398cd27c24c1a97fe87e3c016
2022-02-09 13:50:55 +00:00
Translation updater bot a88dafba19 Localisation updates from https://translatewiki.net.
Change-Id: I4e4ceaed5a09c6713c4669aba7a054dfc5113db9
2022-02-09 08:12:45 +01:00
jenkins-bot 9b2b887675 Merge "ThreadItem: Use DOMUtils to get HTML of DocumentFragment" 2022-02-09 00:53:43 +00:00
Ed Sanders 16c24d6f0a ThreadItem: Use DOMUtils to get HTML of DocumentFragment
This fixes a warning this was thrown when the fragment
was empty (e.g. a placeholder heading).

Change-Id: I5d44993014280b210f48be6be8db0c58ab8e0352
2022-02-08 23:51:38 +00:00
jenkins-bot 362206e572 Merge "Improve check for HTML comments after multiple line breaks" 2022-02-08 20:17:26 +00:00
jenkins-bot e8e9ba5f98 Merge "Fix some typos in comments" 2022-02-08 20:00:11 +00:00
jenkins-bot 4593a9fe91 Merge "Don't count leading/trailing whitespace against signature scan limit" 2022-02-08 20:00:08 +00:00
jenkins-bot e82a4d86f3 Merge "Don't clear target comment highlight when Ctrl-clicking" 2022-02-08 19:49:44 +00:00
Ed Sanders aa03dc971e Add discussiontoolscompare API
For two given revisions, this API tells us which comments have
been added and which have been removed.

Can be used to highlight new comments, or check if the page
has been updated since we first loaded it.

Bug: T281624
Bug: T300504
Change-Id: Ia4d95ffe3b7cf2317cd8e7c0f034e09f64777ef3
2022-02-08 15:53:27 +00:00
Translation updater bot f8c7887adf Localisation updates from https://translatewiki.net.
Change-Id: I4baeb2087e91695285486af51734ac759eb88d59
2022-02-08 08:28:29 +01:00