Commit graph

86 commits

Author SHA1 Message Date
Ed Sanders 61a79ecb5e Remove unnecessary context variable
Change-Id: Ibfc0fc82f13f8268b8f4d48fd7d5f435c2e402f6
2024-11-25 17:15:58 +00:00
David Lynch da47997ef4 Fix attachment of toolbar dialogs
getToolbarDialogs defaults to the `side` position, but we actually want
the `above` one here.

Bug: T371341
Change-Id: Ib42f6a4877d3b0efb87199f60cce7a7416ce9b8a
2024-08-06 11:39:44 -05:00
Ed Sanders 177639f5be Use Array#push instead of Array#concat
Change-Id: I605e726fce1cf1acf39ffdcfe8c7cd51c032a372
2024-05-24 17:28:37 +00:00
Ed Sanders ea5639b20b ESLint: Enforce prefer-const
Change-Id: I5985d1b532988bb3b71ff1aa24eae57ac2e1b9c5
2024-05-24 16:50:13 +01:00
Ed Sanders 44303de9cf ESLint: Replace some lets with consts by moving declarations
Change-Id: I710bff5fe04268172a40af75eb6ff5910eaf0255
2024-05-24 16:50:13 +01:00
Ed Sanders dda9227947 ESLint: Manually fix remaining no-var violations
Change-Id: I4474bd0205e7a1ed8e60147e52675e3e0b93ccd9
2024-05-24 16:50:11 +01:00
Ed Sanders ca5157156a ESLint: Autofix no-var rule
Leave rule off for now as manual fixes are required.

Also temporarily disable prefer-const rule as that
will also require some manual fixes.

Change-Id: I8c3478f26f51287acb943bd38c9c1020c06b9f39
2024-05-24 16:49:36 +01:00
jenkins-bot 5689650a6a Merge "Replace $.extend with Object.assign" 2024-05-02 21:42:02 +00:00
Ed Sanders 1e0aa2171f Replace $.extend with Object.assign
Change-Id: Id559ab68451a1d767e92ed17b1ef0832a5f243af
2024-05-02 16:49:43 +01:00
Ed Sanders 2dd73f935c JSDoc: {Mixed} -> {any}
Change-Id: I78bdc1ec8767dca05e979d8c6ebfed72573acc6f
2024-05-02 10:36:24 +01:00
Bartosz Dziewoński d4c5aebd8f Prefer short arrow functions
When an arrow function body contains just a single `return` statement,
the braces can be omitted.

(Changes are mostly made by `grunt eslint --fix`, with only some line
breaks added by hand.)

Change-Id: I37f259f87085c8d20ed09cfa58a8456dd36cdc38
2024-04-20 00:08:51 +02:00
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