Commit graph

104 commits

Author SHA1 Message Date
Ed Sanders 03665de09e Move VE components to dt-ve
Change-Id: I4fba23e83d9ace833b55e67d1c3ef8b8da5ed19f
2020-06-22 20:09:18 +02:00
jenkins-bot c678fffd49 Merge "Add user mention tool" 2020-06-15 19:46:19 +00:00
Ed Sanders 7be0cc3209 Create ThreadItem classes
Change-Id: Id2c5324d74eccb1209ccb76768c557722c6d9400
2020-06-12 20:35:59 +01: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 c794e49df0 Increase VE dependency
Depends-On: I382aee3563cdcccd2f872c0f1b0ebd0feff6859c
Change-Id: I183ecd36699505ddd9a4adaacbfc216fd32b2753
2020-06-04 22:37:31 +01:00
David Lynch 068ff29e88 Depend on Linter
Depends-On: I8b183d816748245722ca1a459203333614f58f32
Change-Id: If2252d54a39a9d12744ccdee08e334a211f41d46
2020-06-04 18:23:57 +02:00
jenkins-bot 431ba1c87f Merge "Make signature prefix customisable" 2020-06-01 17:18:04 +00:00
Ed Sanders dada23e0f4 Make signature prefix customisable
Bug: T249861
Change-Id: I506a0c1b803275f5505fdf8ee29cc535814d7742
2020-06-01 18:55:04 +02:00
Bartosz Dziewoński 43a7e82ed0 Tests covering fr.wp unsigned comment templates
Bug: T252058
Bug: T252059
Change-Id: Ica7426055e73562a98b99d6ea06e257df77b7493
2020-05-28 00:13:07 +02:00
jenkins-bot c53cecac10 Merge "Create a user preference to store visual/source mode" 2020-05-21 16:21:34 +00:00
Ed Sanders 5feb69612f Create a user preference to store visual/source mode
Bug: T250523
Depends-On: I5b3b47feeeca2085fcd283d55d7e9ceafa73be70
Change-Id: I18f5d38f9d694b12e5f983be7b3b165f135a890d
2020-05-20 22:16:19 +01:00
Bartosz Dziewoński c64bb6b5b7 Add the test for getAuthors() in JS too
Change-Id: Id7dabc535b6bb688602c0d55fc3696f662cb10c7
2020-05-19 21:13:52 +02:00
Bartosz Dziewoński e12aea2f77 Add test case for unwrapParsoidSections()
Covers the bug fixed in I9133d4365a71d6db1fa58b69ae3b970166d15c1e.

Depends-On: I9133d4365a71d6db1fa58b69ae3b970166d15c1e
Bug: T252238
Change-Id: I92831696864e04384eb514ab69f14563cceafc19
2020-05-18 21:36:48 +00:00
Ed Sanders c5d1029b25 Move /cases and /data up to /tests
Theses are no longer QUnit specific.

Change-Id: I5f3cca1ff686922e0cdaaedb80858f37df04799a
2020-05-18 21:47:17 +01:00
Ed Sanders b1427163af Parser.php: Add tests for getTranscludedFrom
Requires an implementation of unwrapParsoidSections

Change-Id: I96c929b1117ba652dbd5af6a1ee37a5f9e87ed1e
2020-05-18 19:53:01 +00:00
Ed Sanders b78fb3f4c1 Move all PHP to the MediaWiki\Extension\DiscussionTools namespace
Change-Id: I654ebb3e646a6d8d62f7bd14d48805e39f836d7e
2020-05-15 21:57:13 +02:00
Ed Sanders 340572bc05 Create a Utils class in PHP
Also move htmlTrim to utils in JS.

Change-Id: Ia5356d713c1c5d521c396cc28bcd4ecc7ee5bbbb
2020-05-15 00:25:32 +01:00
Ed Sanders a3889fd400 Port modifier.js to PHP
Change-Id: I03b9e4377cb3ce6a5ca9d06e49dca9b2516f4979
2020-05-15 00:20:41 +01:00
Ed Sanders 745101c02b PHP tests: Move some test utils to a parent class
Change-Id: I6ae5aa85f8aaa02e1b9323820a841c06c5d62b64
2020-05-12 12:33:04 +01:00
Roan Kattouw 7b7a2cd69c The Great Parser JS to PHP port of 2020!*
* Not to be confused with the Parsing Team's
"Great Parser JS to PHP port of 2019"

Gasp as OR hacks are changed to null coalescing operators.
Applaud as variable declarations are dropped.
Cheer as parameters and return values are type-hinted.
Shudder as DomNodeLists have no indexOf method.

Moving discussion parsing to the server should allow
us to implement much cleaner APIs for commenting.

Bug: T252252
Co-authored-by: Ed Sanders <esanders@wikimedia.org>
Change-Id: Ic1438d516e223db462cb227f6668e856672f538c
2020-05-12 12:33:04 +01:00
Ed Sanders 4397bda8cb Modifier: Separate out test data
Change-Id: I63d868a47daebee180c229b424311d10b80d2e89
2020-05-11 16:58:00 +01:00
Ed Sanders 41d5aa1d37 Separate out more data from parser.tests.js
Change-Id: Ib1c3ec30796dd6bff36835e4555b6974e2a5b376
2020-05-08 12:12:11 +01:00
jenkins-bot f0f457562d Merge "Handle &nbsp; and other entities in the timestamp/timezone" 2020-05-07 19:44:12 +00:00
Ed Sanders 9fab4add17 Config: Separate useVisualEditor into enableVisual and use2017Wikitext
Currently use2017Wikitext is missing some implementations.

Change-Id: Ib5f9bcc588561a80ca11de85518e6fae64e5b104
2020-05-06 18:03:36 +01:00
Ed Sanders 56d8721fd7 Switching between VE & wikitext (plain)
Bug: T234403
Change-Id: I84a639ab8e31ec9f683a63b0ecf184f426df09dd
2020-05-06 18:03:36 +01:00
Bartosz Dziewoński 0269626adc Handle &nbsp; and other entities in the timestamp/timezone
Bug: T251838
Change-Id: Iba8d7c71e332c63229eec4bc7c80b10627135784
2020-05-05 22:38:16 +02:00
David Lynch b7ad053105 @Username completion in VE (source or visual) mode
Bug: T232601
Depends-On: I075cac9aa195574c3d416a40bbdc5ec2d64424e2
Change-Id: Ie605e783b333be0f81099d8d953725c38eb4cee1
2020-05-05 09:44:08 -05:00
Ed Sanders 5271b3eafd Move CommentController to separate file
Change-Id: I6dbf16801058e7e41d38a0ce5753c298d380b780
2020-04-30 17:05:04 +01:00
jenkins-bot 922443f68f Merge "ConfirmEdit CAPTCHA support" 2020-04-29 12:04:44 +00:00
jenkins-bot 5fdf6ae466 Merge "Fix inserting replies inside a <pre>" 2020-04-28 22:31:45 +00:00
Ed Sanders 04f8e21554 Implement auto-save for ReplyWidgetPlain
Bug: T240257
Change-Id: Ica51fb51a5091b11aceb3cd5c484ef9c71b98af2
2020-04-28 20:32:20 +02:00
Bartosz Dziewoński 047e8eb82c Fix inserting replies inside a <pre>
In the future, we should think about a better solution that also
handles other elements (T250126), but this is an easy fix for now.

Bug: T250512
Change-Id: I1321f0da523ddb4a999b8c453b9094a267b38ae2
2020-04-27 23:23:31 +02:00
Bartosz Dziewoński 7ef3bffb1e Show error on pages with fostered content to avoid page corruption in Parsoid
When the user clicks a "Reply" link on a page that is affected by the
'fostered' lint error (indicating fostered content in the HTML
representation), display an error and refuse to edit it, as Parsoid's
transformations will damage the page content.

The error message includes a link to documentation about lint errors,
and a link to the editor that will highlight the error location.

Depends-On: I723ec766d1244d117f8d624440026fe5af0d3403
Bug: T246481
Change-Id: Ic60cb58f98d10dc9b113469e5d3bbfb2d2b0564f
2020-04-21 17:40:39 +00:00
Bartosz Dziewoński 40c18508ec ConfirmEdit CAPTCHA support
Depends-On: I6605017fd31a4f96c529dd0beb69e9f4433cebc1
Bug: T247513
Change-Id: If9b3162969aa6ee67baff80aa84fa719bd3c3720
2020-04-21 18:55:38 +02:00
Ed Sanders ba89657994 Add a share feedback link
Bug: T249016
Change-Id: I64abeebeea332a7a4a37fd4bfd6d5f9a5defc8b5
2020-04-14 23:04:18 +00:00
Ed Sanders f04abd02d4 Improve autosign handling of 3/5 tilde sigs and add tests
3 or 5 tilde signatures will be assumed to be erroneous and fixed
to 4 tilde signatures. This will be visible in the preview so shouldn't
come as a suprise to users.

Bug: T245628
Change-Id: I741f0761a6fb10c99cf3239ac5c6c7e1a2b872c7
2020-04-14 20:29:31 +00:00
David Lynch e38aad96e4 Add override config for instrumentation rates
Bug: T250086
Change-Id: I32fbf3d6562fb0a93698a24bbd8177149a19fed3
2020-04-13 12:38:40 -05:00
Bartosz Dziewoński 55b43a70d4 Fix skipping to the end of the paragraph when there is no wrapper
Bug: T249217
Change-Id: I77847901d98f56dbcbcf379c6c17f41e06a3a939
2020-04-03 18:11:59 +00:00
jenkins-bot 660c9421f7 Merge "Remove Parsoid section wrappers before finding transclusions" 2020-04-03 14:07:46 +00:00
jenkins-bot 6b70d7b652 Merge "Remove dependency on 'ext.visualEditor.core.utils'" 2020-04-03 14:07:46 +00:00
jenkins-bot fecc23ecd7 Merge "Rename tests/qunit/utils.js to .../testUtils.js" 2020-04-03 14:07:45 +00:00
jenkins-bot 6020bef2b6 Merge "Save the reply directly to the transcluded page" 2020-04-03 14:07:44 +00:00
Ed Sanders 13777278ff Bump MW dependency to 1.35
For example we are using Id7565018.

Change-Id: Idc453dd6b770e4a67e88b0d576dfa06ffcc136f0
2020-04-02 19:17:21 +01:00
Bartosz Dziewoński a14293c8e7 Remove Parsoid section wrappers before finding transclusions
The section wrappers can be marked as template-affected when the
previous or next section is transcluded, causing comments to be
unnecessarily uneditable. The new test case demonstrates this.

Depends-On: I03bc455d5484a6c51f3fa2397c64936b829fe7e3
Change-Id: I895a04990d79a3475d778b4fef054ea0bb076f0b
2020-03-24 23:31:21 +01:00
Bartosz Dziewoński bb2b2f2648 Remove dependency on 'ext.visualEditor.core.utils'
We only need ve.resolveUrl, which has been moved
to 'ext.visualEditor.core.utils.parsing'
in Ib2911aaed02250e79a2238ce0a6080a34165d636.

Depends-On: Ib2911aaed02250e79a2238ce0a6080a34165d636
Change-Id: I054026fbfd67f9a64cc0d748b57693fc2237ff08
2020-03-24 22:30:02 +00:00
Bartosz Dziewoński 216516f719 Rename tests/qunit/utils.js to .../testUtils.js
We now also have modules/utils.js and I found the identical name confusing.

Change-Id: I6895748528241e0368a79eab9dcf3123afaf5f87
2020-03-24 22:29:48 +00:00
Bartosz Dziewoński 807afd1ec0 Save the reply directly to the transcluded page
* When we discover the comment comes from a transcluded page, follow
  the transclusion to find the source page. We follow transclusions
  recursively, up to an arbitrary limit of 10.
* In the reply widget, display the title of the page where we will
  save the reply, to avoid users confused why their edit won't show up
  in the history. In the wikitext workflow this is done by redirecting
  the user to the edited page at the end, but it seems less surprising
  to stay on the current page.
* After saving the reply, we must purge the current page, otherwise
  the new content will not be immediately visible on it.

Bug: T247535
Change-Id: I1c6631aa65a2fce6c1c2f0dd4a8c7aa6389caf94
2020-03-24 22:29:42 +00:00
Bartosz Dziewoński e9b583d1c3 parser: Improve merging multiple comments on one line
Now also works if the "follow-up" comment is wrapped in e.g. `<small>`.

Change-Id: Ic37cb6afdb42021f109a1818f5c4299d907ed094
2020-03-14 13:34:42 +00:00
Bartosz Dziewoński 04365c0188 Merge RL modules which are only loaded by 'ext.discussionTools.init'
Bug: T240474
Change-Id: I1b83aa18666be8f1ea6a3602b299f92574d42cb7
2020-03-14 14:33:23 +01:00
Bartosz Dziewoński 92c3f079b8 controller: Make edit summary use the wiki's content language
Bug: T246043
Change-Id: I591e1a3ed3e7c8b68f5e203a0c77d057793fc767
2020-03-14 14:17:29 +01:00