Commit graph

273 commits

Author SHA1 Message Date
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 f2d3a00a7b Follow-up Icb14766: Fix formatversion:2 param
Bug: T255083
Change-Id: I5636e8e21f45c50df31d05d535227cf909a45269
2020-06-11 18:27:30 +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 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
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
Ed Sanders 0d14fcea6a wt->visual: Don't unwrap template lists
Bug: T253150
Change-Id: I1584d9834e29c38edf4234f2f022c1c48bfd485f
2020-06-01 22:32:23 +01:00
Ed Sanders da433037a3 Move getTranscludedFromElement to Utils
Change-Id: I8bdd757f949c013ba426150a192d71243fadf45d
2020-06-01 22:32:23 +01:00
jenkins-bot 576fe0ca36 Merge "Use current preference each time we open a new reply widget" 2020-06-01 19:10:59 +00: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
Ed Sanders 03a94badfe Use current preference each time we open a new reply widget
TODO: Switch already setup widgets when we re-open them.

Bug: T253888
Change-Id: I6c541f27edbfe373f62b8508381bb5182681bda4
2020-05-29 13:06:36 +01:00
Bartosz Dziewoński 79ae8a32c5 Support parsing when timestamp is wrapped in a link
Bug: T252059
Change-Id: Ib8952fb80503bad407e8d0fe725103a0fae12a6a
2020-05-27 22:47:17 +02:00
Bartosz Dziewoński 01b4a8f4f4 Support replying when timestamp is template-generated
* Move modifier#getFullyCoveredWrapper to utils
* Use that method to find the node where we start searching for
  template wrappers, rather than using endContainer

Bug: T252058
Change-Id: I55de58102f3468fce01290bd413a7fdc96d322d6
2020-05-27 21:16:03 +02:00
Bartosz Dziewoński c7575b49f6 Work around invalid ranges in #getNativeRange
Change-Id: I46a54654acb15fb1ef7b80495cf1be8103b7688f
2020-05-27 21:16:03 +02:00
jenkins-bot 9f2ead06eb Merge "Insert replies outside of decorative comment frames" 2020-05-25 19:30:28 +00:00
jenkins-bot bb0a4c80d8 Merge "Remove empty lines in visual mode too" 2020-05-25 17:15:50 +00:00
jenkins-bot 08e6db455d Merge "Use the faster childIndexOf() approach in JS too" 2020-05-25 16:37:17 +00:00
Ed Sanders e064f43499 Remove empty lines in visual mode too
We already do this in source mode (sanitizeWikitextLinebreaks).

Bug: T253402
Change-Id: I10390b3173d22e8db735f5cd60180b1f48b94fff
2020-05-22 20:21:46 +01:00
Ed Sanders ac476eb4cf Initialize tab state to avoid flicker
Also set 'defaultMode' before calling parent constructor.

Bug: T234403
Change-Id: I08320bd539419ddf7ba22a5dc316177d751bcb8d
2020-05-22 18:25:04 +00:00
Bartosz Dziewoński 8f583a23be Use the faster childIndexOf() approach in JS too
I was wondering if the different approach to childIndexOf()
implemented in PHP in b8d7a75c34 would
be faster in JS as well, and yes, it is.

Our test suite now takes (on my machine):
* Chrome: 8337 ms → 7355 ms (average over 5 tries)
* Firefox: 5321 ms → 5044 ms (average over 5 tries)

Change-Id: I71963eeb92dcea9bfd59cbf01a7aa0b7de5d9cf1
2020-05-22 19:33:35 +02:00
Bartosz Dziewoński 420c514091 Insert replies outside of decorative comment frames
When there is a wrapper element whose range matches the range of
a comment, any replies will now be added outside of that wrapper,
instead of directly after the comment (inside the wrapper).

Bug: T250126
Change-Id: I6b42c4db019ae998e91eebd324f9cbd2aa791b4f
2020-05-22 15:01:12 +01:00
Bartosz Dziewoński fbd6338331 ReplyWidget: Avoid buttons shifting when switching to source
When the preview loads, the "Reply" / "Cancel" buttons shift downwards,
which looks ugly. Try to wait for the preview before showing the source
editor interface.

Bug: T234403
Change-Id: I70989fb9fbcac17e1a0672eda8d34bf26003bb96
2020-05-21 23:43:51 +02:00
jenkins-bot 54db24f1f5 Merge "Don't allow users to switch to a mode they are already in" 2020-05-21 18:21:42 +00:00
Ed Sanders 2d9a760d4e ReplyWidget: Use interface dir for UI
* Reset to content dir for preview.
* <textarea> gets dir from the `.sitedir-* textarea` rule.
* VE already sets the content dir in the editor.

Bug: T253255
Change-Id: I76df093490e86a730ccd5610c43c9b3fc7e07a54
2020-05-21 18:28:03 +01:00
Ed Sanders ade5f7cb6c Visual: Use createModelFromDom when setting document
Ensures that MW target sets the correct dir and lang on the document.

We should consider upstreaming this.

Bug: T253258
Change-Id: Ibc9ae7b4b105055291c941ce932f499bd6e13657
2020-05-21 18:26:59 +01:00
Ed Sanders 406aed0577 Don't allow users to switch to a mode they are already in
Change-Id: I082108c81ab871b64df76b6f9ba5cf4314ce6458
2020-05-21 18:26:08 +01:00
jenkins-bot d0dd4cf036 Merge "Add autosave support to visual mode" 2020-05-21 17:06:39 +00:00
jenkins-bot c53cecac10 Merge "Create a user preference to store visual/source mode" 2020-05-21 16:21:34 +00:00
Ed Sanders 9fbafef652 Add autosave support to visual mode
Bug: T240257
Change-Id: I87f8b68a5afee8d03c81cb283c9bee68ef9d4a5d
2020-05-20 22:16:20 +01: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
Ed Sanders 66d3c95f23 Prefix '@' to username auto-complete output
Bug: T252460
Change-Id: I932ccddcacbe15efe9ea08d6a6d028cd84d8815c
2020-05-20 12:28:31 +01:00
Bartosz Dziewoński 515af82061 Reduce duplication between PHP parser and data gen for JS parser
Also, make the handling of TranslateNumerals and digitsRegexp the same
between PHP and JS.

Change-Id: I1d81343d0b59ab3ecd59ba1c2ad99a729d983ac4
2020-05-19 20:54:44 +02:00
jenkins-bot f5ac86528b Merge "Show real error message when an exception is thrown" 2020-05-18 23:08:34 +00:00