Commit graph

75 commits

Author SHA1 Message Date
Ed Sanders a74c00ba8c Prefer arrow functions for callbacks
This allows us to remove our `this` bindings.

Change-Id: Ie8c8c38d36af8a033b5181870c39f8981a57b939
2024-04-19 12:34:23 +01:00
David Lynch 87c8a26483 Require is still required to load CommentTarget
Follow-up to d647870dca.

Change-Id: I63dbedbbd156a8b1619849170eac9dc6da262ddd
2024-01-23 14:58:23 -06:00
Ed Sanders d647870dca Use ve.init.mw.targetFactory.create()
Change-Id: Ie30d813ba933e03e9c712f78eac155a41052d4b0
2024-01-23 19:42:10 +00:00
Ed Sanders 584dc08020 Remove file headers and @copyright tags, not used consistently in this repo
Change-Id: I3c074c7cbae52d1775b14e1e6dae22c4276b8236
2023-12-04 12:30:56 +00:00
Ed Sanders af6b4443a1 MWUsernameCompletionAction: Fix text for exact match
This broke when we introduced matching to display names.

Bug: T344399
Change-Id: I30512e09edafe0e7e170a17a9a02446c71650d0b
2023-08-17 12:49:15 +01:00
Ed Sanders 42b588c087 UsernameCompletionAction: Use @inheritdoc
Change-Id: Ic7b0eaead64cfc30e2c93b598bfbe4b9dee666f8
2023-07-24 18:53:47 +01:00
Ed Sanders d7e56679a4 UsernameCompletionAction: Tell widget to remove characters when using insertAndOpen
Change-Id: Iefad1e10feeb67b9c80580d62bd6215e839c2303
2023-06-02 14:22:37 +01:00
jenkins-bot c28bcaaabd Merge "UsernameCompletionAction: Document constructor and pass all args" 2023-05-24 19:02:22 +00:00
Ed Sanders 919bdf2a22 UsernameCompletionAction: Document constructor and pass all args
Change-Id: Ie1e37f423d68082be35df2aa7b08b7e372af25c5
2023-05-24 18:57:03 +00:00
David Lynch 5568761377 Username completions: always abandon if the first input is a space
This has been added to the core behavior of shouldAbandon as well, but
the way it's overridden here needs to be changed since the
multiple-words check would override that.

Depends-On: If130cdc1df595e6ab12d531ce603cc42c8b3b5f3
Change-Id: Ie7bdc4a4702514fcb7d500924dad18729198b9e8
2023-05-20 09:47:40 +03:00
Ed Sanders 37614a136f Show usernames when display names are matched
Also make our filter function match any substring of
the suggestion index (username + display names), as display
names often contain leading punctuation.

Bug: T266401
Depends-On: I69e5f54f7a8b7ca4126cc3ea513fc96e0a8606fb
Change-Id: I4e7429f8a88c3a82e981f37eb107c2b011482d73
2023-03-16 20:23:42 +01:00
Ed Sanders 79a62f539d ThreadItem: Add display names to getAuthorsBelow
Change-Id: I4195f982d7071fea0d0334908535639a11cdcae9
2023-02-23 23:03:35 +00:00
Ed Sanders 317b8244dd Move username completion tool after special character tool in toolbar
Bug: T322455
Change-Id: I19bfe4500850512411615b326b07ba0a47dcfd5f
2022-11-07 13:01:11 +00:00
Ed Sanders 292725e864 Add 'specialCharacter' tool to toolbar
Bug: T249072
Change-Id: I9db0954db05f825adaa311bb3777c5e4493172b6
2022-10-20 12:22:19 +00:00
Bartosz Dziewoński e5abfdbe8a Re-enable keyboard sequences for template, table etc. in new topic tool
They were only disabled in the reply tool, because their wikitext
markup doesn't work when indented. This is not a concern in the new
topic tool.

Rename our sequences that display the wikitext warning to avoid these
items showing up in the command help dialog, and remove overrides for
global ve.ui.commandHelpRegistry. (As a result, the dialog now lists
the blockquote command, which was previously missing even though it
was enabled, but only with the 'Ctrl+8' shortcut and not 'Type ":"'.)

Also remove filtering rules for external paste.

Bug: T311653
Change-Id: I4557c376fcf099d81e91ae5c2b18301d97921180
2022-07-31 02:40:12 +02:00
Ed Sanders 9d9dc7f26a Halve the initial height of the reply widget on mobile
Vertical space is at a premium on mobile with the virtual keyboard.
The widget will auto-size when more text is entered.

Bug: T311836
Change-Id: I03ff7217f9ffe217f93a3dc95db2df018bd0d221
2022-07-01 15:05:00 +01:00
Ed Sanders c8570b95f9 Fix CSS selector after upstream changes to CompletionWidget
Bug: T307712
Depends-On: Ie590eb6b6c38531b959eadc1fcd5ba108180fdc8
Change-Id: Id39e680cbea54d77f061936c8876ecf7ed28e8b2
2022-05-31 20:39:39 +00:00
Bartosz Dziewoński d7209b13b9 CommentTarget: Clean up toolbar actions
When moving the edit mode switcher outside of the toolbar actions,
we apparently forgot that we can disable this feature entirely.

Also remove $overlay: true, which isn't needed after the changes
from T307849.

Change-Id: I005cf18853305edd162c613f60b1ac45f42c3093
2022-05-21 20:28:54 +00:00
Ed Sanders 1cc94f91bc CommentTargetWidget: Exclude save commands
Bug: T308709
Change-Id: Id614c8ecbdcdab237828d998fe898dcb9517ff47
2022-05-19 00:58:40 +01:00
jenkins-bot 521760ecdc Merge "Redesign "new comments" warning" 2022-05-12 17:21:23 +00:00
Ed Sanders cf3e7c49d8 Redesign "new comments" warning
Bug: T300560
Change-Id: I5abf22b5a11c2639392a3d571c987ed5afaac2d6
2022-05-12 18:02:32 +01:00
Ed Sanders b76cf89b9b Add missing 'undo' button on mobile
Bug: T308033
Change-Id: If3126cb213fb4a22a419b9b85fdca32b20863f03
2022-05-11 17:37:08 +01:00
David Lynch dccaa5bf65 Add an optional suffix message to mentions
Wikis like jawiki will then be able to customize the message to include
honorifics as they think appropriate.

Bug: T268588
Change-Id: I213fb9fd0a9ed6592ce3548a5b2c3b11a55c1abc
2022-01-19 10:29:10 -06:00
Ed Sanders 423983f26e Filter username suggestions to accounts with edits
Bug: T294774
Change-Id: I7346a7986d7caba473d31151495bb2263e43ca44
2021-12-22 23:57:15 +00:00
Ed Sanders 900a01772f Support reply tool on mobile
Bug: T270536
Change-Id: I94d04e9cd442f9a4e0c5924da67c43a768417a8b
2021-11-03 17:49:06 +00:00
Ed Sanders 54471b5037 UsernameCompletion: Disable fragment auto-select
This causes the username to be selected on mobile, when
we want to place the cursor after it.

Bug: T294616
Change-Id: I29012ecd04cd553bf78ffff477babafacfeabb31
2021-11-02 23:35:29 +00:00
Ed Sanders 9b902bc46a UsernameCompletion: Fix limit parameter
`this.limit` is never set, which mean the API default of 10
was used.

The client limit is actually `defaultLimit` which is set to 8.
Double this so we can filter blocked users and still probably
have some results.

Change-Id: I8184fa0ce1527280f4503bcf638372421287f51a
2021-11-01 17:25:15 +00:00
Ed Sanders 62bc24cb86 UsernameCompletion: Filter out users with indefinite sitewide blocks from API results
Such users will never be able to reply to you on most pages,
so we shouldn't suggest pinging them. The may be able to reply
on their own user talk page, but in that case they will be
included in localUsers.

In the best case they just clog up your search results, in the
worst case they are offensive names which haven't yet been hidden.

Bug: T294783
Change-Id: I2445ed6dc98c10f8580b2c36106dd3e98bb876d6
2021-11-01 17:25:01 +00:00
Ed Sanders f4c12e120a Define documentable types in eslintrc instead of inline
These types can be passed a parameters to any file without
creating a dependency, so it makes more sense to allow
the globally.

Change-Id: I5504465fd997b46547642e7046993b370b85586e
2021-10-17 14:38:39 +01:00
Bartosz Dziewoński 384fc2aa8d Re-enable wikitext paste conversion in source mode
The current experience (implemented in T282789) is unobtrusive and
maybe even helpful.

This reverts commit 35e97c24fe.

Bug: T281009
Change-Id: I0514e8f8960600edf12b51fff6de305e46cf8c34
2021-10-09 03:38:11 +02:00
Fomafix c1371b7416 Remove uppercase of first character of auprefix
Since Id9afb2dd0212e4b871bb6a7a9d8762e1bcb81d6a included in core since
MediaWiki 1.38 the uppercase of the first character of the parameter
auprefix is not needed anymore.

Bug: T291339
Depends-On: Id9afb2dd0212e4b871bb6a7a9d8762e1bcb81d6a
Change-Id: Ic14ca9c9c61d2a50bdbaff50b56302a60ed17a96
2021-09-20 07:28:34 +00:00
Ed Sanders a76539e19b Disallow horizontal rule (----) in reply tool
These also don't work when indented.

Change-Id: Id2f1b14f434f8527f1391ebf056aeb80c7023feb
2021-06-17 21:30:48 +01:00
Ed Sanders 54f2dcf030 Unregister sequence help for unavailable commands
Bug: T284758
Change-Id: I85fe9332ec723e44b5cb508f9b53a59c9e9b61d9
2021-06-17 21:30:40 +01:00
Ed Sanders c41dab81c4 Reply tool: Disable preformatted command
Preformatted text can't be rendered in wikitext when indented.

Change-Id: I2269471dd76630661cdb459322df591c6b3e6a50
2021-06-08 23:02:59 +01:00
Bartosz Dziewoński c51638e940 Update surface styles for VE changes
The .ve-init-mw-target-surface class is no longer added since
Ic5320f6747907542285674d386c7a59c9e857f0a.

Also apply changes similar to I8d20a830dc48f6a098b0f9e9a7c7c1656de0fe56
to avoid potential styling issues with nested surfaces.

Bug: T284567
Change-Id: I58a49f0137e8804fbd73de20048eb2ffdbbfbe77
2021-06-08 18:04:21 +02:00
jenkins-bot 3bea7fe77b Merge "Remove unused 'inTargetWidget' config" 2021-05-24 20:53:20 +00:00
Ed Sanders 35e97c24fe Disable wikitext paste conversion in source mode
Bug: T280745
Depends-On: Icc716563e5536b4ef33a48ba10a72f3a39bdec35
Change-Id: I5875d8aa12dee694c3e5bd7e1a980da284343722
2021-05-03 14:52:19 +01:00
Ed Sanders 799754a3cf Remove unused 'inTargetWidget' config
Change-Id: I713c3bdd80ec375e9683441c289ba22ed9b7057a
2021-04-29 15:46:26 +01:00
Ed Sanders 1893405635 Code style: Move var declarations inline
Change-Id: I1686603388b050ba4ec22eff23e4806cdf262b87
2021-04-22 17:43:46 +00:00
Ed Sanders 86fe745724 UsernameCompletion: Use ve.ce.Surface.findMatchingSequences
Depends-On: I7a9b9abaa5a518f21f9965a16803e0a4c82b436f
Depends-On: I48e1137150dee024ebdc96f0e780a88bff6b8177
Change-Id: I06d31694c9fddb3795e61dccecf812b7e1a783b2
2021-03-24 17:56:20 +00:00
Bartosz Dziewoński 3e723f5310 Don't insert multiple '@' when clicking the mention toolbar button multiple times
Bug: T275906
Change-Id: I7a4e914b8ae491de240efa97c7f001b57c9d8acc
2021-03-24 11:08:19 +00:00
Ed Sanders ece8ff69ff Change dt- class prefix to ext-discussiontools-
Longer, but follows the style guide and less likely to conflict.

We need to account for init classes in the cache being around for
a while.

Change-Id: I738bc93393850db320fdbda2b003ca8ac40556da
2021-03-13 14:42:39 +00:00
Ed Sanders 998bd206ae Follow-up I60e550ef: Don't show relevant user in mention list if it is you
We have logic above to exclude mentioning yourself, but this
is overridden if you are commenting on your own talk page.

Change-Id: I2858c79bd9f1cb733f105825e17f9df75859e40a
2021-03-04 20:59:00 +00:00
Ed Sanders 665f68f838 Fix toolbar dialog placement
There are no available tools that use this, but it
can be tested using:

ve.init.target.surface.executeCommand('specialCharacter')

Change-Id: I853e6a3b9bd3caff018b6fe22cea9b1c6a428dff
2021-02-28 22:18:58 +00:00
Ed Sanders f5c3da2a86 Pass replyWidget to target
This allows the target to access $headerWrapper directly
instead of using flaky DOM traversal.

Change-Id: I81f6616ea8fa7cbfb58e576fd5b2739c6158a216
2021-02-28 22:07:51 +00:00
Ed Sanders f62ce55671 Fix wikitext command registry inheritance
This fixes some missing commands in source mode, such as undo.

Change-Id: Ie470bd351e2fd67bcbb8cc839e70c3efcaaf1564
2021-02-27 18:24:36 +00:00
Ed Sanders 01ac28540a Support the enable2017Wikitext option
Bug: T257391
Change-Id: If2511609035c26063203512f4b860bd0060e08af
2021-02-26 19:13:54 +00:00
jenkins-bot f6cb81ce21 Merge "Show wikitext warnings for sequences not in reply tools" 2021-02-19 00:27:12 +00:00
Ed Sanders 6afb92d940 Show wikitext warnings for sequences not in reply tools
Bug: T274923
Change-Id: I56adc6524398805d3d6d582572e7524af8ba86a7
2021-02-18 22:52:35 +00:00
Bartosz Dziewoński 9ae59e6ddb Disable VE indentation commands to allow tabbing out of the widget
Bug: T172694
Change-Id: I458271a82a2aba475007d94901bd14f405bccb24
2021-02-17 19:30:23 +00:00