Commit graph

51 commits

Author SHA1 Message Date
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
Ed Sanders b581883e7c Show relevant user in local suggestions on user talk pages
Bug: T273324
Change-Id: I60e550efbea3d9e250dcaf13080407094a23aad3
2021-02-09 21:51:28 +00:00
Bartosz Dziewoński bca14cbe03 Move the '@' prefix into the PingNode, rather than plain text
Depends-On: I49733aa6aa2c1e61a88e7c88e84f1f4338acfac1
Change-Id: I9586d07ded0e41afdcfbd6e46364bb1f837cf1c0
2021-01-04 21:43:42 +00:00
Ed Sanders a87d60228f Don't include the logged in user in local suggestions
Bug: T267680
Change-Id: I1b2d185de390b73e1b389fc4139735069e7a65dc
2020-11-16 22:48:21 +00:00
Ed Sanders 3b31aa669d Create controller.getApi method with defaults
Only share API objects when it is safe to do so.

Change-Id: I4810f59ce41c43f78e0b42db6b36620b2aca1cec
2020-10-23 12:30:37 +01:00
Ed Sanders 6790e5c41c Disable find-and-replace
Bug: T263570
Change-Id: I075c1696f179eed2e0143c12082cee048c200227
2020-09-25 15:17:15 +01:00
Ed Sanders d36ffeaa3d build: Update eslint-config-wikimedia to 0.17.0
Remove variable shadowing, and fix some documentation.

Change-Id: I08a7cbbdc0a1a409f9c4415b36c62c89535e12eb
2020-08-26 23:46:34 +01:00
Bartosz Dziewoński e0312957e6 Fix crash when trying to mention invalid usernames
Change-Id: I1e7213c38067e3c3107752705c4d3e4ed64a9258
2020-08-16 22:50:32 +02:00
Ed Sanders cc8b43b678 Allow the mention prefix to be configured via a message
Bug: T250332
Change-Id: I83c59fc665bbfe1027149bcb1cbce3f69d90c7ff
2020-08-12 18:45:25 +01:00
jenkins-bot b681eec8e4 Merge "Allow reply widget header and footer to wrap when it's narrow" 2020-08-10 22:27:51 +00:00
Ed Sanders d43d66a5a4 Username suggestion header
Bug: T252084
Depends-On: Ie57dbe76725cc7d4c9a1c959623349ad707d0b88
Change-Id: I5e8b7582199d6b5674bdf8e9328c881a8c7c7673
2020-08-10 17:34:04 +00:00
Bartosz Dziewoński 74560f216e Allow reply widget header and footer to wrap when it's narrow
The footer was already laid out using flexbox and just required some
CSS tweaks to enable wrapping.

The header required some DOM changes, now also uses flexbox, and wraps
in a similar manner.

Bug: T259320
Change-Id: I6f6a86932a108037bf1d70f077c372654318be26
2020-08-07 20:25:23 +00:00
Bartosz Dziewoński 80c58fe356 Do not auto-add "Mention a user" to "Insert" menu
Bug: T259039
Change-Id: I831b47d7a2192df3bc0c460eca9ef944661deb40
2020-07-28 21:42:33 +02:00
jenkins-bot 377a1159ae Merge "Add ime-position-inside ULS class to reply widgets" 2020-07-24 22:50:45 +00:00
jenkins-bot 7eff952cb2 Merge "Signature handling in visual mode" 2020-07-22 01:42:47 +00:00
jenkins-bot 6dcbaca9c1 Merge "Disable blockquote command" 2020-07-20 17:13:34 +00:00
Ed Sanders e4c11035a7 Disable blockquote command
Bug: T258194
Change-Id: I600abe0767f53c51e6f78f11a8087a6e29d4877f
2020-07-17 23:25:15 +01:00
Ed Sanders e6f7a9e679 Create a PingNode so user pings are single focusable nodes
Bug: T252083
Change-Id: I168e036d201b924e7fc9bda2f2f58e48ad2dbac0
2020-07-17 23:17:41 +01:00
Bartosz Dziewoński ee69365b82 Signature handling in visual mode
Load 'ext.visualEditor.mwsignature' (which implements VE's existing
handling for signatures), then subclass and override a bunch of things
in order to:

* Replace the context menu with a note that you don't need to type the
  signature when commenting using the reply widget

* Override the sequence/command to insert signature so that it selects
  it afterwards and thus displays the context menu

* Treat signatures as signature nodes when switching from wikitext,
  instead of the normal pre-save transform turning them into regular
  links and text

Bug: T255738
Change-Id: Icb542451c2307ab51e56bd627804096c7b5552c8
2020-07-16 01:32:19 +02:00
Ed Sanders 981d3326aa Add ime-position-inside ULS class to reply widgets
Bug: T255191
Depends-On: Ibcf7a4f076ceb86b91e81310bcb2fa64abc551dd
Change-Id: I0729933551cf5b73ca99718d54635caefdd0ee94
2020-07-15 18:27:02 +01:00
Ed Sanders c15399568f Wait for API response before updating suggestion list
We can update the local filtered list before then, but then we would
have to do two updates for each keystroke, one to do an instant local
filter and another to back-fill the list when the remote results
become available. Currently CompletionAction is not set up for this,
and this might be confusing behaviour.

Bug: T256974
Change-Id: I6194cdcd6459be17fb142e644d73c9ec4036ba08
2020-07-02 15:12:30 +01:00
Ed Sanders 58f6d8ca56 Trigger username sequence even when deleting
This is helpful when you ping the wrong person and need to correct your input.

Logically depends on I4c34e9368692b0ee4e7ca0f18ba2940406c62a9a

Change-Id: Iea89bdb5d93fe64902b692f04dd3a2e84e5517c3
2020-06-26 17:19:10 +01:00
jenkins-bot dc07a5c2b1 Merge "Fire window-open-from-tool event for username completion from toolbar" 2020-06-25 20:29:18 +00:00
Ed Sanders 8ca9da66fd UsernameCompletionTool: Use 'userAdd' icon
Depends-On: I6de36ca2ba279dc11d18bdff3c5d138444a13361
Change-Id: Ic09e18bf284b97bb135c3e8b0129fb9bc96cf72f
2020-06-24 12:33:33 +01:00
David Lynch 02fafccd23 Fire window-open-from-tool event for username completion from toolbar
The automatic event from core didn't catch this, because it's not an action
method called "open".

Bug: T255638
Change-Id: Ifa456e850a8edb374df098e21b46bb872416ae55
2020-06-23 10:25:03 -05:00