Commit graph

2095 commits

Author SHA1 Message Date
Ed Sanders 025130fcd2 Don't prompt to reload the page if the reply widget is open
Only show the reload prompt if the 'disappeared' error is detected
when the reply widget is loading. Don't show it if we failed
to save, as it suggests you will not lose content if you reload.

Change-Id: I106f274e180dc97b540d729e31aae575c43f29f0
2022-02-07 22:45:35 +00:00
Ed Sanders 3d0849112a ReplyWidget: Factor out #createErrorMessage
Change-Id: Ie7e34154d74c24ce8379552fdf13feba31fd401f
2022-02-07 22:44:09 +00:00
jenkins-bot 4ac8e94084 Merge "ReplyWidget: Introduce a 'refresh' teardown mode that preserves auto-save" 2022-02-07 21:45:13 +00:00
Bartosz Dziewoński 909f1383d4 Don't clear target comment highlight when Ctrl-clicking
It annoys me when Ctrl-click clears it but middle-click does not.

Change-Id: I8636140df25d44ac79cb2bc0d1aebecc62c4db5d
2022-02-07 21:29:01 +00:00
jenkins-bot 6a23be0bb5 Merge "Move ApiDiscussionTools to ApiDiscussionToolsPageInfo" 2022-02-07 20:43:26 +00:00
jenkins-bot 283aa46865 Merge "extension.json: Sort ApiModules" 2022-02-07 20:43:24 +00:00
Ed Sanders 7cad692afa Move ApiDiscussionTools to ApiDiscussionToolsPageInfo
Also remove 'paction' param, and instead make 'transcludedFrom' a
property of the result object.

Change-Id: I0a289f6d71e4708afff0b52066b1ed6faf76b9ae
2022-02-07 16:50:02 +00:00
Ed Sanders ee2749d34a extension.json: Sort ApiModules
Change-Id: I0fea49bd7f86dd6ca48fb1960e47c62abeaf41aa
2022-02-07 16:49:40 +00:00
Translation updater bot 413b7bd487 Localisation updates from https://translatewiki.net.
Change-Id: I0ad51f8f4a6c5501a5def55689fbcd5622031dac
2022-02-07 08:21:57 +01:00
libraryupgrader faab80cd8d build: Updating nanoid to 3.2.0
* https://github.com/advisories/GHSA-qrpm-p2h7-hrv2

Change-Id: I397685f0d9b0f77fcfd6f9f9524136d718870320
2022-02-06 09:18:30 +00:00
jenkins-bot c86029397e Merge "Remove DiscussionToolsEnableTopicSubscriptionBackend config" 2022-02-05 00:49:17 +00:00
Bartosz Dziewoński 5945a4a0eb Fix some typos in comments
Change-Id: I699d9d105b8706cef0800ccc086cde687de54078
2022-02-04 20:36:28 +01:00
Bartosz Dziewoński 13ab1db6da Don't count leading/trailing whitespace against signature scan limit
It's an arbitrary limit, it seems harmless to relax it to support the
use case in the task, even if it's weird.

Bug: T300949
Change-Id: I7c895c7019726758bbae3183b9c3ecbd9eabcf38
2022-02-04 19:35:29 +00:00
Ed Sanders 0b42aea276 CommentParser: Cache variables in getUsernameFromLink
Change-Id: I625e6ded3badd75a7a658c8d000576d0d165a18b
2022-02-04 19:35:18 +00:00
Ed Sanders 8ad1df7dc8 CommentParser: Name parts of return value from findSignature
Change-Id: I3a5ad36df0afdedc0aa9a15e5d83c5426b03b790
2022-02-04 19:34:18 +00:00
C. Scott Ananian fe35a7324c Replace use of deprecated OutputPage::enableClientCache( false )
Replaced with the more readable ::disableClientCache() method, added
in 1.38.  Minimum MW version for this extension is already at 1.38.

Depends-On: I7c89e20528a0d91173f0edcb997dcae631935ee5
Change-Id: Idf1cf2fac3311f50ed3cbc420f7772b5c71b1992
2022-02-04 14:30:33 -05:00
Ed Sanders 6d655dee0a Remove DiscussionToolsEnableTopicSubscriptionBackend config
This is now deployed on all wikis, and going forward I don't think
we need to make this configurable.

Change-Id: I231976267ba6cdfeec622efaa15983a84c330649
2022-02-04 18:22:10 +00:00
jenkins-bot 37c09cd3ac Merge "Improve CommentModifier::addReply() API for re-use and testing" 2022-02-04 18:12:59 +00:00
Translation updater bot c1160b0dae Localisation updates from https://translatewiki.net.
Change-Id: I4bcd77c31de2fb44c441ee3796eb1125b7b2a3a9
2022-02-04 08:22:02 +01:00
Bartosz Dziewoński 165ca9b847 Improve CommentModifier::addReply() API for re-use and testing
Goal: To be able to re-use or test the transformations we previously
  performed in addWikitextReply() / addHtmlReply(), without requiring
  a Comment object or adding the result as a reply.

Change-Id: I040c4be9b6b9bddba661f30fd0566f8850673074
2022-02-03 21:12:48 +00:00
Translation updater bot 14b28f6483 Localisation updates from https://translatewiki.net.
Change-Id: Ibfe6f2196800dfe948dedad2df52571147cf02f4
2022-02-03 08:43:56 +01:00
Ed Sanders e2f3c2f264 ReplyWidget: Introduce a 'refresh' teardown mode that preserves auto-save
Change-Id: Ibb04f7c2813b9d3cf2bb2434a414c86eb0a7f644
2022-02-02 18:38:22 +00:00
jenkins-bot b0b965512e Merge "Create MemoryStorage wrapper around mw.SafeStorage" 2022-02-02 17:27:37 +00:00
jenkins-bot fabe580343 Merge "Limit where whitespaceParsoidHack() is used" 2022-02-02 17:25:02 +00:00
jenkins-bot fef06b195e Merge "Remove empty lines in visual mode in some more cases" 2022-02-02 17:23:07 +00:00
jenkins-bot 11892a9369 Merge "Remove unused code in JS modifier" 2022-02-02 17:21:37 +00:00
Ed Sanders 9e43f5c261 ReplyWidgetVisual: Fully clear sessionStorage when clearing
Clearing the widget removes all the surfaces, meaning there are
no doc-state variables to cleanup. Switch the order of these
two calls.

Change-Id: I6c095a171096cd700ce4cd31b08fa3b982ab2401
2022-02-02 16:46:57 +00:00
Ed Sanders cb5d585b93 Update wgCurRevisionId/wgRevisionId when refreshing the page
Change-Id: I2b1a7a6fe539a8a4bd5e3f865e4bb7464913d9e0
2022-02-02 16:46:57 +00:00
Ed Sanders dd9d37b555 Create MemoryStorage wrapper around mw.SafeStorage
This means we can guarantee we will be able to recover
auto-saves if we don't reload the page.

Change-Id: Ic867ae6df0c949f35cb32ec4b835688778db29ef
2022-02-02 14:59:47 +00:00
Bartosz Dziewoński fb474efb2b controller: Separate updating page contents from saving the page
Bug: T300502
Change-Id: I52c0a648ee15cc61890413a269708a6cb2bd4df8
2022-02-02 00:42:41 +01:00
Ed Sanders 7381d9d963 Cleanup CommentController and document
* Document all methods
* Rename comment to threadItem
* Use this.threadItem instead of passing in identical
  threadItem in various methods.
* Don't pass threadItem to ReplyWidget as we already
  pass the whole CommentController.

Change-Id: If9aad0bcf9f0e4ebf3342b75631ddac8b57f7d87
2022-02-02 00:05:19 +01:00
Translation updater bot dd9b3d517e Localisation updates from https://translatewiki.net.
Change-Id: Ifae61fbc15016e3947fdf6d7da05c227ea066b83
2022-02-01 08:26:56 +01:00
jenkins-bot 1fdefedc69 Merge "Clear autosave when following links from the legacy hint" 2022-01-31 20:16:21 +00:00
Ed Sanders 6af617ef99 CommentItem: Fix typo in documentation
Change-Id: I95fc9f4ca904a9315fc665618085c6c250b21a2e
2022-01-31 17:01:03 +00:00
Ed Sanders cb828828e2 controller: Fix typo in documentation
Change-Id: Ia68bcac6be0c59146655c5cbce872ea9b9304e37
2022-01-31 15:03:05 +00:00
Translation updater bot 3f77a74c29 Localisation updates from https://translatewiki.net.
Change-Id: Ie027da39e63a932825c9ff89621eb55685cbaff5
2022-01-31 08:21:53 +01:00
Bartosz Dziewoński 15f0867b75 Limit where whitespaceParsoidHack() is used
* We don't need it anywhere in JS, since we're not sending that HTML
  to Parsoid.
* We only need it on the nodes directly containing our reply lines in
  PHP, not all over the place.

Change-Id: I0a04388225f32654dda2f599442cd27a303b5d0a
2022-01-29 22:42:46 +00:00
Bartosz Dziewoński 6572e108f9 Remove empty lines in visual mode in some more cases
After switching from source mode to visual mode, there will be some
Parsoid-generated white space between block nodes, which remains when
the reply is posted in visual mode.

Follow-up to e064f43499.

Bug: T300439
Change-Id: Ia5d2c06f0a4125e9f148eddd3235f95138c9d37f
2022-01-29 22:42:41 +00:00
Bartosz Dziewoński bacf6a8fc6 Remove unused code in JS modifier
I don't think we're going to need this in the client again.

Change-Id: Id38405c14edfd7ac45afad8f32cad64594ae7bc0
2022-01-29 21:39:45 +00:00
David Lynch 3fdaf7ee58 Clear autosave when following links from the legacy hint
Bug: T299270
Change-Id: Ife590b4bea359168f07aa308128425cfb46f71cb
2022-01-27 11:48:42 -06:00
Translation updater bot 4495475fa1 Localisation updates from https://translatewiki.net.
Change-Id: Ie62004aead0918d6db2bfa800c0469b545e82b69
2022-01-27 08:38:38 +01:00
Translation updater bot 883f68920a Localisation updates from https://translatewiki.net.
Change-Id: Ib167106ebb30a4243f3390affc8d12422b3c9e49
2022-01-26 08:24:53 +01:00
Translation updater bot 03344f2f5c Localisation updates from https://translatewiki.net.
Change-Id: I45832232e047fba9c238ab8e1931959e6c55f0a7
2022-01-25 08:32:35 +01:00
jenkins-bot 0b52563b53 Merge "One more tweak for comparing comment ranges to transclusion/DOM ranges" 2022-01-24 23:37:07 +00:00
jenkins-bot 4679dd27b3 Merge "Use class list everywhere for adding/checking CSS classes" 2022-01-24 23:37:05 +00:00
jenkins-bot 51e4fdea9f Merge "Don't try to parse section titles as wikitext in subscription notifs" 2022-01-24 23:23:34 +00:00
jenkins-bot 9892008135 Merge "Simplify handling of sections in bundled notification links" 2022-01-24 23:21:54 +00:00
Bartosz Dziewoński 110a59200f One more tweak for comparing comment ranges to transclusion/DOM ranges
When we encounter a node that doesn't represent comment contents, e.g.:
* a [reply] link we inserted (T297034#7641334)
* an {{outdent}} template (see changed test case)

…we should ignore it together with its descendants (like in
Parser#nextInterestingLeafNode), instead of processing descendants
and possibly detecting comment contents in them.

Follow-up to 8de940b587,
72b9c2c6f5.

Bug: T297034
Change-Id: Ib2fa40c5fa389572b0e88ef558728fa06e3621b0
2022-01-24 17:42:18 +00:00
Bartosz Dziewoński f15693eefa Use class list everywhere for adding/checking CSS classes
In PHP, use DOMCompat::getClassList(), provided by Parsoid.
In JS, use `.classList`, available in all supported browsers.

This may fix some bugs where we were incorrectly checking for exactly
one class. The change in isOurGeneratedNode() is needed for
Ib2fa40c5fa389572b0e88ef558728fa06e3621b0.

Change-Id: Ia28d31678fd3d617b69280c4b7857755300fa515
2022-01-24 18:40:00 +01:00
Translation updater bot ea54d68f2d Localisation updates from https://translatewiki.net.
Change-Id: I4f0fd50eb877b4d2caa90b5f8607458ff7f8c223
2022-01-24 08:27:03 +01:00