Commit graph

401 commits

Author SHA1 Message Date
jenkins-bot 740e6eb174 Merge "Edit API for replies" 2020-07-27 23:56:10 +00:00
Ed Sanders 9d0fc184fe Use transcluded from API to avoid ever fetching Parsoid DOM in client
Bug: T252558
Depends-On: I015ac183a0c25dafb9b95c577edd4ef59c112d43
Change-Id: I6090c99429bf6eceb57870e3d449de6754063353
2020-07-28 00:50:15 +02:00
Ed Sanders 8829a1a412 Edit API for replies
Bug: T252558
Change-Id: Iac43b5bb0315ceaad7698fb2b708b7c3cde403f8
2020-07-27 21:19:58 +01:00
jenkins-bot 377a1159ae Merge "Add ime-position-inside ULS class to reply widgets" 2020-07-24 22:50:45 +00:00
jenkins-bot 12ddb69c9e Merge "Better handle HTML comments following replies" 2020-07-23 16:45:36 +00:00
Bartosz Dziewoński 31e371e944 Better handle HTML comments following replies
Bug: T257651
Change-Id: I07e995beca4f031be062958ff7d75727afa8e606
2020-07-23 18:18:21 +02:00
Ed Sanders 0dbda50781 Make getNativeRange a method of ThreadItem
Change-Id: Icdf9e4560ca6116f35fecf034a4e059dc7ed893e
2020-07-22 21:56:48 +01:00
jenkins-bot 765a1d27bc Merge "Improve detecting template-generated multi-line comments" 2020-07-22 15:04:00 +00:00
jenkins-bot 889de1bcdf Merge "Improve detecting typed signatures" 2020-07-22 01:43:40 +00:00
jenkins-bot 7eff952cb2 Merge "Signature handling in visual mode" 2020-07-22 01:42:47 +00:00
jenkins-bot 3db53080e8 Merge "Don't allow switching when unsupported content used" 2020-07-21 23:14:08 +00:00
Bartosz Dziewoński 80e52e1155 Improve detecting typed signatures
* Remove the existing approach for detecting signatures that only
  worked in source mode; remove autoSignWikitext()

* Use the same approach for auto-signing in source mode as we have
  already used in visual

* In both modes, detect whether the user has already typed a signature
  at the end of their comment in the modifier, and if so, don't add a
  signature

* Add test cases for the detection

Bug: T255738
Change-Id: I791d3035cb1ffc33ce3966d4617a25d08700c35b
2020-07-22 00:00:53 +02:00
jenkins-bot e010dc560c Merge "VisualEditorFeatureUse: trackdebug logging consistent with EditAttemptStep" 2020-07-21 21:51:34 +00:00
jenkins-bot 79195b9fb7 Merge "Refactor CommentParser" 2020-07-21 21:40:29 +00:00
Bartosz Dziewoński 569db3603c Improve detecting template-generated multi-line comments
Bug: T252058
Change-Id: Ic010b8aeff9b177031184f02f92fcdea5280dc36
2020-07-21 22:26:45 +01:00
Ed Sanders a2431fe006 Refactor CommentParser
* Pass rootNode to the constructor
* Rename getters to match CommentItem/HeadingItem/ThreadItem
  value classes.
* Always build the thread tree so CommentItem's always have
  and ID and replies/parent.

Change-Id: I508be9534de59016ff806e3d84edcbb1c76cb0c6
2020-07-20 23:38:10 +01:00
David Lynch 72680471ef VisualEditorFeatureUse: trackdebug logging consistent with EditAttemptStep
The defaults weren't being included in the log output.

Change-Id: I455370cdb40e300efa6f41902b434affd32dc405
2020-07-20 17:26:53 -05:00
jenkins-bot e89f58eddf Merge "Customise abandon edit dialog copy" 2020-07-20 18:29:12 +00:00
jenkins-bot 6dcbaca9c1 Merge "Disable blockquote command" 2020-07-20 17:13:34 +00:00
jenkins-bot 271124d5cb Merge "Create a PingNode so user pings are single focusable nodes" 2020-07-20 17:13:32 +00:00
Ed Sanders a4636d39fc Move #getTranscludedFrom from parser to ThreadItem
Also requires moving getTitleFromUrl to CommentUtils

Change-Id: I9cb83a3fdd456eba66899433b866ce7a7f00eeb5
2020-07-20 15:56:48 +01:00
Ed Sanders 7ae5bbf384 Move #getAuthors from parser to ThreadItem
Change-Id: I16e513000e5366b3044b17a99da07d8d0f47a61f
2020-07-20 15:13:59 +01:00
Ed Sanders b32f991913 Documentation fixes
Change-Id: I2c7ccecbf8a50bd4d658b0f17f4a21fe90a3c399
2020-07-20 13:34:08 +01: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
Ed Sanders 854c8e4b28 Customise abandon edit dialog copy
Bug: T257069
Change-Id: I2770b53f826b5af689051cc681a75f9608e85de9
2020-07-17 23:04:44 +01:00
jenkins-bot e2573f7787 Merge "Increase padding around warning icon" 2020-07-17 15:51:53 +00: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 092cfd6075 Parser: Replace findTimestamps with findTimestamp
Instead of doing a separate tree walk and finding all timestamps
separately, make it part of the getComments tree walk, and find
timestamps one at a time.

Change-Id: I47f466eaf228504faa189fd99e07493bc7f022cd
2020-07-15 21:34:22 +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
jenkins-bot 01ce5afaa9 Merge "Fix highlighter styles: match sig/timestamps border sizes" 2020-07-15 15:29:33 +00:00
Ed Sanders 3ef4c30e63 Fix highlighter styles: match sig/timestamps border sizes
Change-Id: Ie7b9809ca21c72a88487f208b9a9c41f65d4fe11
2020-07-14 23:17:29 +01:00
Ed Sanders 00042d8499 Remove DiscussionToolsEnableVisual config
Defaults to true and has no need to be disabled anymore.

Change-Id: I3cf9b5accea0fd1f175c75057641657742d8fa1b
2020-07-13 15:51:47 +01:00
Ed Sanders 58aa412fa3 Don't allow switching when unsupported content used
Bug: T256150
Change-Id: I9b57996f069a1c0c05ef396cfe0ed81495a1d9ec
2020-07-09 13:05:09 +01:00
jenkins-bot 0bd5371737 Merge "Add getHeading method to CommentItem" 2020-07-03 03:23:16 +00:00
jenkins-bot 0be56305fe Merge "Move wikitext modifiers to modifier.js" 2020-07-03 03:23:14 +00:00
jenkins-bot 0f184c42b5 Merge "Move createCommentContainer to modifier" 2020-07-03 03:23:12 +00:00
jenkins-bot c716ca9c7b Merge "Move some postReply logic to modifier.js" 2020-07-03 03:23:11 +00:00
jenkins-bot ddee6b600d Merge "CommentController: Refactor postReply" 2020-07-03 03:23:09 +00:00
jenkins-bot 92481deeac Merge "Wait for API response before updating suggestion list" 2020-07-02 16:38:49 +00:00
Ed Sanders f650440445 Don't calculate call getValue on every keystroke in visual mode
This is a regression from when we added a wikitext parameter to
preparePreview. Calling getValue in visual mode converts the whole
DM to HTML, which is fairly expensive, especially as there are
no previews in visual mode.

Change-Id: Ieed61b0d7741e7204a942a7181923da0502981cd
2020-07-02 16:36:57 +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 94511c6bad Add getHeading method to CommentItem
Change-Id: I14ccdbb432e835fe74760a52f07de172df2aba27
2020-07-01 17:21:15 +01:00
Ed Sanders 6459e7dc82 Move wikitext modifiers to modifier.js
Re-create methods in PHP.

Change-Id: Iae6117b65e3b8f50ecc68e1e3ea17c8359bdcb06
2020-07-01 17:06:02 +01:00
Ed Sanders 978eae5547 Move createCommentContainer to modifier
Refactor and create PHP versions.

Change-Id: I0ae9785e5fa86bcc1ac6eef9bce4088d7507dd33
2020-07-01 17:06:02 +01:00
Ed Sanders fb0d2cbe7f Move some postReply logic to modifier.js
Re-create the function in PHP

Change-Id: I1c8b505542c3b82c10b7b258e48054bc59cb4836
2020-07-01 17:06:02 +01:00
Ed Sanders 6d4d0962ef CommentController: Refactor postReply
Separate out conversion to DOM nodes, and update
now that postReply doesn't need to return a promise.

Change-Id: Iab6192ba252244009d2374c9423d14279e8d1c4f
2020-07-01 17:06:02 +01:00
Ed Sanders b1fe481324 Increase padding around warning icon
Bug: T255558
Change-Id: Ie9c384a3233e5079dcb49fbf295a8c81596dc83d
2020-06-30 15:19:13 +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 ea20ec6257 Merge "Improve ThreadItem documentation" 2020-06-26 13:12:58 +00:00
Ed Sanders d5376e28fc Improve ThreadItem documentation
Change-Id: Ia266fc22b02af0edbb32f356b4e0d92fe3a4da5f
2020-06-26 14:56:19 +02:00
jenkins-bot dc07a5c2b1 Merge "Fire window-open-from-tool event for username completion from toolbar" 2020-06-25 20:29:18 +00:00
jenkins-bot c7b7fe5d66 Merge "Another attempt to fix page re-initialization after updating" 2020-06-24 21:48:14 +00:00
jenkins-bot dafb465481 Merge "Allow non-lists to be passed to unwrapList" 2020-06-24 21:09:45 +00:00
jenkins-bot b51799ec2e Merge "Load VisualEditor plugin modules with ReplyWidgetVisual" 2020-06-24 21:09:36 +00:00
Bartosz Dziewoński ffafc1a752 Another attempt to fix page re-initialization after updating
* Run the 'wikipage.content' hook before our initialization.
  This way collapsible elements and other changes to the page layout
  are processed before we measure where the new reply is and try to
  highlight and scroll it into view. (T252903)

* Remove the code dealing with 'mw-parser-output' and 'dt-init-done'.
  This was needed to avoid initializing twice on the same element,
  which can't happen now. (T254807)

This is much closer to the original approach Ed proposed in
I05a3c766668999f05cfe06473652429025595196 before I changed it:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/550693/7..8

Bug: T252903
Bug: T254807
Change-Id: Ibc3fcbd3c92c8eceda19b68cee9e69f6e92456f5
2020-06-24 22:56:40 +02:00
jenkins-bot e55ac1ef79 Merge "Scroll the after-reply highlight into view" 2020-06-24 19:24:55 +00:00
Ed Sanders 811f8bdf02 Allow non-lists to be passed to unwrapList
Bug: T256292
Change-Id: I036e0fdf3dde51c33f64abb7df142e26ebe66554
2020-06-24 19:19:06 +01:00
Ed Sanders e4645a47e6 Scroll the after-reply highlight into view
Bug: T252903
Change-Id: If9db634153572a045dd468cfa7f6316e93fddccd
2020-06-24 20:15:52 +02:00
Ed Sanders e7a9185ab1 Load VisualEditor plugin modules with ReplyWidgetVisual
Bug: T256292
Change-Id: Id05ad1871093e8941e54b2db8c9a76cecaac1033
2020-06-24 19:09:27 +01: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
Bartosz Dziewoński b6edd8ddef CommentController: Apply pre-save transform when switching to visual
Parsoid doesn't understand syntax expanded during pre-save transform,
e.g. [[User:Foo|]] or ~~~~, and it gets nowikied when switching back.

Change-Id: I791426d9d6c0a1399b1e95039b11e43a3e5bf79f
2020-06-22 21:01:55 +02:00
Ed Sanders 03665de09e Move VE components to dt-ve
Change-Id: I4fba23e83d9ace833b55e67d1c3ef8b8da5ed19f
2020-06-22 20:09:18 +02:00
jenkins-bot a2b31efb19 Merge "Remove unsupported argument from getWikitextFragment" 2020-06-22 17:59:57 +00:00
Ed Sanders b38e380ebf insertAndOpen: Call this.open directly now there is no precedingCharacter check
Change-Id: I82b2fdd58fe512638a8f69d4df9adc4be98e814e
2020-06-22 12:22:08 +01:00
David Lynch d7557d5ab3 Don't try to avoid username completion appearing in email addresses
Current code breaks in other languages which don't use whitespace as a
word separator. The word-separator message is (for reasons) not reliably
set to something other than " " on wikis for those languages, so we
can't use it as a trigger for just not caring.

Bug: T255153
Change-Id: I1ff929811af59fd7a7bf7e8dfc1cd121a2c4db4e
2020-06-22 12:21:32 +01:00
Ed Sanders 83968e4c00 Remove unsupported argument from getWikitextFragment
This was removed upstream due to a regression.

We don't need it right now, but may need it in the future to
support editing, so replace with a TODO.

Change-Id: Ia73657080241319df309f3b6566ac0ac36a5909d
2020-06-20 13:07:49 +01:00
jenkins-bot e4fc21ad37 Merge "Check the right page for lint errors by title" 2020-06-16 16:14:47 +00:00
jenkins-bot c678fffd49 Merge "Add user mention tool" 2020-06-15 19:46:19 +00:00
James D. Forrester d6c3df31f5 Remove various phan suppressions and fix issues
Change-Id: I73b535f284566a0a8876a3198b9784b47567fac6
2020-06-12 20:35:59 +01:00
Ed Sanders 7be0cc3209 Create ThreadItem classes
Change-Id: Id2c5324d74eccb1209ccb76768c557722c6d9400
2020-06-12 20:35:59 +01:00
jenkins-bot b6695dae58 Merge "Strip RESTBase IDs when switching to VE" 2020-06-12 18:49:20 +00:00
jenkins-bot 02d049affe Merge "Only re-focus the reply link when reply is abandoned" 2020-06-12 18:17:13 +00:00
jenkins-bot f115f3ce3d Merge "Tweak appearance of find-and-replace toolbar" 2020-06-12 18:16:48 +00:00
jenkins-bot 6eb9824e8c Merge "Add square brackets around reply link and use lower case (when possible)" 2020-06-12 18:11:20 +00:00
Ed Sanders 38d85268f0 Add user mention tool
Uses userAvatar for now while we wait on userAdd to be upstreamed.

Bug: T254366
Change-Id: Ifa512c518efa9740a138d3d42fc607f2840b4040
2020-06-11 20:53:49 +01:00
Ed Sanders f2d3a00a7b Follow-up Icb14766: Fix formatversion:2 param
Bug: T255083
Change-Id: I5636e8e21f45c50df31d05d535227cf909a45269
2020-06-11 18:27:30 +01:00
Ed Sanders 09857e13f1 Only re-focus the reply link when reply is abandoned
Bug: T252903
Change-Id: Iabac3eb2258ecd48f61e027950446f59dca68df3
2020-06-11 17:36:00 +01:00
Ed Sanders de84a27e88 Tweak appearance of find-and-replace toolbar
Change-Id: Ia61e765217ee9d4c249af0a2494ba427e29a0d54
2020-06-11 16:02:37 +01:00
Ed Sanders d6d9aec3ee Strip RESTBase IDs when switching to VE
Bug: T253584
Depends-On: If5d15dd4e7e0d3704ca8d75c0a25c529b06f17fb
Change-Id: Ia310fcc873960d0d3c1b17410e33dc4f47c5c734
2020-06-11 14:06:07 +00:00
Ed Sanders a4d767d97c CommentModifier.php: Remove unnecessary toLowerCase
We only need .toLowerCase() or strtolower() when doing
case insensitive comparisons.

Change-Id: I19caca50139a42d86ff20e1ee0224cd3deb0d092
2020-06-10 22:06:16 +01:00
jenkins-bot edba40b1b6 Merge "Always use API formatversion: 2" 2020-06-09 19:25:15 +00:00
Ed Sanders 06eab3d961 Add square brackets around reply link and use lower case (when possible)
Bug: T249578
Change-Id: I5846106b10dc82231250d04a1f9ff025cfc1ca30
2020-06-09 19:55:14 +01:00
Bartosz Dziewoński 745b65f254 Check the right page for lint errors by title
Bug: T254930
Depends-On: Ic34617e2f56d1055388ea6e8a93ff641f0342240
Change-Id: I86679ce0f641f12bd9d99e4b7baed1294103e3a2
2020-06-09 20:52:51 +02:00
Ed Sanders efd847c7df build: Update devDependencies
Change-Id: I94a455e52f2c216ccab40e360ce24fc0adc332a0
2020-06-09 19:42:05 +01:00
jenkins-bot 5907cde5e5 Merge "ReplyWidgetVisual: Disable template sequence" 2020-06-09 15:54:08 +00:00
Ed Sanders 0cfc84aa29 Always use API formatversion: 2
Change-Id: Icb14766488beab76e24d1fedcc4b6214c6b04d98
2020-06-09 00:32:11 +00:00
David Lynch 36cd435895 Tweak editor-switch mode label so it's consistent with the naming in VisualEditor
Bug: T254291
Change-Id: Iab800561f6a5e81e1e48907366e874b44924d60a
2020-06-08 17:59:05 -05:00
David Lynch 5fa7d713d8 Logging: editor_interface should be visualeditor not visual.
Also, it should switch when the editor switches.

Bug: T254291
Change-Id: I2550529f51a8417586d6f0791d958fcf4b9d4fc6
2020-06-08 17:22:35 -05:00
jenkins-bot e4da8b10f3 Merge "Track more events for VisualEditorFeatureUse" 2020-06-08 22:12:17 +00:00
jenkins-bot 0179e00197 Merge "Hook up VisualEditorFeatureUse logging" 2020-06-08 22:12:13 +00:00
David Lynch c92fad4fe7 Track more events for VisualEditorFeatureUse
* Track editor mode switching between visual and source (plain)
* Track interactions with checkboxes
* Fix the tracking of firstChange when switching with content

Bug: T254291
Change-Id: I0e243e393b02952684f34dbbe1697633c0b2561a
2020-06-04 12:19:46 -05:00
jenkins-bot 94bbaa846f Merge "Depend on Linter" 2020-06-04 16:46:57 +00:00
jenkins-bot 203df3aabc Merge "Call the linter API directly if installed" 2020-06-04 16:24:36 +00:00
David Lynch 068ff29e88 Depend on Linter
Depends-On: I8b183d816748245722ca1a459203333614f58f32
Change-Id: If2252d54a39a9d12744ccdee08e334a211f41d46
2020-06-04 18:23:57 +02:00
David Lynch 5ccb0538fd Hook up VisualEditorFeatureUse logging
Bug: T252924
Depends-On: I77b2dabc39b730bc50c67029e67fedc1f173d248
Change-Id: I0189038d09ffe023b6c06be8250b412dc06d9b81
2020-06-04 09:53:20 -05:00
Ed Sanders e9f2bb80d1 Call the linter API directly if installed
If the Linter extension is not installed, just allow the page
to be edited.

Bug: T253799
Change-Id: Id3e4c9c2d48aa7ab0b270f41d33ec19184af9a48
2020-06-04 09:46:07 -05:00
Ed Sanders 70fb4a6a10 ReplyWidgetVisual: Disable template sequence
Any template that outputs wikitext spanning more than one line
will break. As we can't enforce that in VE, we should just disable
all templates for now. The can still be inserted in source mode,
and will be eventually supported when we have multi-line syntax.

Bug: T253667
Change-Id: I72a7e4c09f83bcfc2a9cc7ab33a3d5303ced851d
2020-06-03 19:28:21 +01:00
Ed Sanders 62c0080850 Fix whitespace handling in unwrapList
Update 'referenceNode' before modifying the DOM.

Bug: T254308
Change-Id: I76af898e238c1e6d3db96d3e6156e80e55c87820
2020-06-03 13:54:36 +01:00