Commit graph

710 commits

Author SHA1 Message Date
Bartosz Dziewoński 1846b72998 Remove some hardcoded CAPTCHA support code
While we pretend that the ConfirmEdit CAPTCHA support is added by
ve.init.mw.CaptchaSaveErrorHandler in the ConfirmEdit extension,
we still have a bunch of code here required for it to work.

This commit removes some of it, no longer needed after
I6605017fd31a4f96c529dd0beb69e9f4433cebc1.

Depends-On: I6605017fd31a4f96c529dd0beb69e9f4433cebc1
Change-Id: I41e032fd754927b7ea6cfb767eb9f21b522ccacd
2020-04-15 13:18:47 +00:00
Timo Tijhof 48c4dfd59e Remove redundant dependency on 'mediawiki.notify'
The 1 line of code this module contained (to lazy-load
'mediawiki.notification', and forward the function call) was
moved to 'mediawiki.base' and requires no dependency.

Bug: T233676
Change-Id: Ifcb1bca030bede62065a87dc7a8594fe17e017cc
2020-04-08 17:47:21 +01:00
Ed Sanders de47496b19 Move MWutils to preinit and rename to parsoid utils
Bring in ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref
and ve.resolveUrl, so that the file has no dependencies on VE.

Change-Id: I03bc455d5484a6c51f3fa2397c64936b829fe7e3
2020-03-24 23:13:16 +01:00
Ed Sanders 788c57a3ea Update VE core submodule to master (cf72879d2)
New changes:
cf72879d2 Show sum/average when selecting multiple numeric cells

Local changes:
Implement number parsing/formatting for table summing

Bug: T247877
Change-Id: I52af622dc8cfe7e77fd7ce88428be092d5b092a2
2020-03-19 12:26:26 -07:00
C. Scott Ananian ce094c72d4 Remove X-Parsoid-Variant configuration value, which is no longer needed
Reverts Ib1403638b12ec5808f6b81bd114949043aa9ac2e.

Bug: T229074
Change-Id: I9bbc02821d5ee82c9944516ab07d3cb380d2f3a8
2020-03-11 13:24:43 -04:00
Bartosz Dziewoński 59cc4b10aa Update VE core submodule to master (f7f72b5c5)
New changes:
42fea96be Add some accessibility labels to buttons on mobile

Change-Id: I37f03d547b1891c05b50fb1761620e7af9209e2b
2020-03-06 15:09:44 +01:00
Akinwale Alagbe d3292378cc Fix:Internal and External Link annotation widget
Adding the ability to special aria-label for the link annotation widgets
in order to aid accessibility to visually impaired audience

Bug: T245294
Change-Id: I3e1fd4a3e3a951092b5212397acc38b2b89a23c2
2020-02-24 16:40:19 -08:00
Bartosz Dziewoński 9119e57a2e Improve rendering of audio files (for real this time)
ve.dm.MWImageNode:
* Define sensible scalable properties for audio files. They are now
  scalable to any width but have a fixed height. (Ideally they would
  have no concept of height, but that would require many more changes.)
  This prevents them from resetting to 0x0 when resized.

ve.ce.MWBlockImageNode:
* Remove override for #isResizable, audio files can be resized now.
* Move #updateMediaType to MWImageNode mixin so it applies to
  MWInlineImageNode as well.

ve.ce.MWImageNode:
* Add #updateMediaType from MWBlockImageNode.
* Hide the real image 'src' using CSS rather than changing the
  attribute. It seems the previous solution depended on the order in
  which methods are called, because it stopped working when I moved
  the code here. (This depends on VE/VE change If5b1b5b5d.)

audioPlayer.svg:
* Make the file nicely resizeable. The dimensions of the "play" icon
  and time are fixed, the bar adjusts to the width of the container.

Bug: T206022
Change-Id: Ia0f38ca11e0d55a5b725fd9aeb6c79ec1345376d
2020-02-14 04:18:28 +01:00
Bartosz Dziewoński c95be08cc4 Localize remaining hardcoded English error messages
Bug: T227325
Change-Id: Ibee27bd8457f83910da03ecb8801e5f26bdb3b2a
2020-02-12 22:18:40 +01:00
Bartosz Dziewoński 6d993fee49 ArticleTargetSaver: Fix error messages
Follow-up to 5f1c68945d, which renamed
these messages while moving them into MediaWiki core.

Also, parse HTML in them. This is consistent with real API error
messages, and with the behavior of mw.Api#getErrorMessage. (And also
fixes potential HTML escaping issues.)

Change-Id: I307ca9873e245169a0d4b43499317acbac69fb9b
2020-02-12 22:18:40 +01:00
jenkins-bot 5b2ba08c44 Merge "Use WMUI styled WikiEditor switcher when in Vector" 2020-02-08 02:37:12 +00:00
Ed Sanders eebe103fe4 Use WMUI styled WikiEditor switcher when in Vector
Bug: T223155
Change-Id: I6cf305e77cfeda96e7736dc26f1d7feff6fb3911
2020-02-07 18:20:39 -08:00
David Lynch 0d6f984cc5 Change tags method so anon edits will go through
It turns out anonymous users can't apply change tags, so change
I2c1d0f8d69bc03e5c1877c790247e165f160e966 broke editing for them.

Bug: T242184
Change-Id: I7c27e4d9995428e213a980819810f235fdfe9435
2020-02-06 15:31:45 -06:00
David Lynch 078fbcf737 Update VE core submodule to master (e1760b7f7)
New changes:
fb4f0a83b Completion framework

Local changes to wire in the completion framework

Bug: T232601
Depends-On: If6aee9df67e7a1234d47c0ba0c2f05ef47e5bd51
Change-Id: I075cac9aa195574c3d416a40bbdc5ec2d64424e2
2020-02-06 12:05:48 -08:00
jenkins-bot d5ea567039 Merge "Match WikiEditor switching widget to Apex toolbar theme" 2020-02-05 22:40:59 +00:00
Ed Sanders 787d16f512 Match WikiEditor switching widget to Apex toolbar theme
Bug: T223155
Change-Id: I5c14f28ba3c341c74875bac090c6106655c6b4c7
2020-02-04 17:25:59 -08:00
jenkins-bot 124ae7a444 Merge "Tag VE edits from the client-side" 2020-02-04 16:43:59 +00:00
Máté Szabó ff4f382322 Use autogenerated parameter info for templates without TemplateData
When a template does not have user-provided TemplateData documentation,
the TemplateData API falls back to extracting possible parameters from the raw wikitext
to generate an API response with a list of potential parameters. However, it also
sets the "notemplatedata" field in the response, causing the VisualEditor to think
the response contains no useful information and ignore it. This appears to have been
an unintended side-effect of I97a1bfc9f9ead082a673a91b9d2053630a90309c.

This patch ensures that the VisualEditor will correctly consider such responses from
TemplateData by modifying ve.dm.MWTransclusionModel to check if the response contains
a parameter map. Some unit tests were added for the class to verify this behavior.

Bug: T243868
Change-Id: I72005880d9301a53224473900efe2917379e8708
2020-01-31 13:43:56 +01:00
David Lynch d85d30f9b3 Tag VE edits from the client-side
This opens up the API so that other tools can use it without being
forced to tag those edits as being from VE.

Also, document that tags is a working parameter that can be passed
through to the edit API.

Bug: T242184
Change-Id: I2c1d0f8d69bc03e5c1877c790247e165f160e966
2020-01-29 21:55:07 -08:00
Bartosz Dziewoński c1ea108327 Enable visual diff code on mobile
Bug: T242351
Change-Id: I4cf6c9ef846d24847a844d443952c7026fcd306b
2020-01-29 11:15:18 -08:00
jenkins-bot 9e6a40a827 Merge "Use mw.Api#getErrorMessage instead of custom handling" 2020-01-10 14:22:14 +00:00
Ed Sanders 8e20c1c66b Update VE core submodule to master (6bed6aaa5)
New changes:
06ad0c769 git-build: Fix name of grunt.log.error
6bed6aaa5 CommentAnnotation: Replace 'reply' with 'comment'

Change-Id: If7e298eaafdd7cf9ab07b6314cb9c214a2072229
2019-12-20 16:22:33 +00:00
jenkins-bot 7452bcca73 Merge "rebaser: Add missing message" 2019-12-20 15:52:36 +00:00
Ed Sanders 90eb775978 rebaser: Add missing message
Change-Id: Id9fbbe47d0e886a235d5fcafefcb768e8c28e666
2019-12-20 15:38:13 +00:00
Ed Sanders f2a5c10dee Update VE core submodule to master (0aa09c12e)
New changes:
0aa09c12e Make CommentAnnotation use replyable threads

Change-Id: Idaadecace168a0c19741a231b887578274902a86
2019-12-20 14:57:14 +00:00
Thiemo Kreuz 326944402d Simplify Hooks section in extension.json
It is possible, but very rare to have more than a single hook handler
per hook in a single extension. The value can be an array or string in
both version 1 and 2 of extension.json.

Change-Id: Idab5bb1ee606fe07c0886c8f6ae180bad1f9a4e3
2019-12-18 08:20:28 +01:00
Bartosz Dziewoński 5f1c68945d Use mw.Api#getErrorMessage instead of custom handling
Bug: T240519
Depends-On: Ie18666b41f4aff1ab4bcf93f9df6e3000ac7b500
Change-Id: I69d9432162f195dcfe9470485b549a1b007617ff
2019-12-14 17:01:35 +00:00
jenkins-bot 95a46f1666 Merge "Exactly match collapsible logic of jquery.makeCollapsible" 2019-12-13 15:42:46 +00:00
Ed Sanders a007781e81 Support wikitext link editing
Depends-On: I3eb2d5ee0da52942db1de75ef9f8b0ae2632657e
Change-Id: I7ad61899a221a198a06e206614d907a331861dbb
2019-12-12 02:33:35 +01:00
James D. Forrester 015f796b63 Update VE core submodule to master (3b3dcad84)
New changes:
7017efbce Sanitize HTML on paste

Bug: T239209
Change-Id: I5f59d537d39b64838a222ab0637957429860508f
2019-12-02 17:26:58 -08:00
Bartosz Dziewoński 092d0c332b MWSaveDialog: Fix error handling for diffs
In case of HTTP errors we'd crash and show no message.

Change-Id: Ideeff4ce75e7ca82ce63bf7ede6dff03eaa1c5d7
2019-11-24 09:51:43 +00:00
jenkins-bot a1b6c47962 Merge "Localize some hardcoded English error messages" 2019-11-19 21:18:04 +00:00
Bartosz Dziewoński a8ab487876 Localize some hardcoded English error messages
Bug: T227325
Change-Id: I5a43b34a4492c20cab4b4ef3eceafaf669e89730
2019-11-19 15:23:58 -05:00
jenkins-bot 2e6e75233f Merge "Remove unused message 'visualeditor-loaderror-title'" 2019-11-19 16:09:11 +00:00
Roan Kattouw eebe4cd993 Unbreak instrumentation of init events
ve.track.js was being loaded twice, once early on as part of the
ext.visualEditor.track module, and again later on as part of the
ext.visualEditor.core.utils module (which it was added to by b676b22).
This caused ve.trackSubscribe()'s buffer to be reset. Recording the
first init event relies on this buffer, because it's logged with
ve.track() before the logger subscribes with ve.trackSubscribe().
Subsequent init events did get logged. Some performance logging during
initialization was also dropped, but the 'ready' event and subsequent
events were logged correctly.

Fix this by loading ve.track.js only once, as part of the
ext.visualEditor.track module. Make ext.visualEditor.core.utils depend
on ext.visualEditor.track, rather than also adding ve.track.js to it.

Change-Id: I781595d27edb2dc0ad662fcc8e3c7cb0ddae78f1
2019-11-18 17:19:16 -08:00
Bartosz Dziewoński 99cd4e26e9 Remove unused message 'visualeditor-loaderror-title'
Introduced in 7653dec439 (2015),
has never actually been used.

Change-Id: I35d06b50fbfdfdfbfdcfd0acbe094895a4f7698d
2019-11-18 15:25:45 -05:00
Bartosz Dziewoński 050227aee6 Remove unused message 'visualeditor-loadwarning-token'
No longer used since a701e87caa (2013).

Change-Id: I7708453ac321a92893a1d92c3082023f9ebe769c
2019-11-18 15:18:36 -05:00
Bartosz Dziewoński c8fa50c3b2 Exactly match collapsible logic of jquery.makeCollapsible
Bug: T236247
Change-Id: Iaf8e8515585989fd8ca64ffd33b02399a69278b4
2019-11-13 23:26:08 +00:00
Ed Sanders 545c6f1301 Add missing FragmentInspector tests to MW
Requires unregistering MWLinkAnnotationInspector

Bonus: Remove unnecessary list of unregsiters as
teardownOverrides is run on init.

Change-Id: I3e36ab7736cc8479ab53f40d2eb24c0fa15d3dc0
2019-11-12 13:52:35 +00:00
Ed Sanders 3542799ab4 tests: Have MWDummyTarget create the correct surface type
Change-Id: I3cd025d726e9db56a2391ef52852d1cb2f4305a0
2019-11-11 20:22:33 +00:00
David Lynch 46e7b3ba19 Config value for X-Parsoid-Variant
Bug: T229074
Change-Id: Ib1403638b12ec5808f6b81bd114949043aa9ac2e
2019-11-05 10:56:10 -06:00
Ed Sanders bfdb664ef7 Add missing dependency for parsing utils
Change-Id: If231b00db6b562fd529c1d0a5143a4613c9835c4
2019-11-04 16:20:51 +00:00
Ed Sanders 381b58585c Factor out save logic into ArticleTargetSaver
Change-Id: I63fa04598e0d703fe1ba715c9c5a0abbb0d7ba5b
2019-11-01 15:45:27 +00:00
Ed Sanders 1bb72f0bb5 Replace deprecated easy-deflate.deflate with mediawiki.deflate
Change-Id: I5c77d4818074fd3dc937d7688d449952b92ee358
2019-10-30 19:13:47 +00:00
Bartosz Dziewoński 372f04fc6f Tweak dependency on 'mediawiki.diff.styles'
It's only needed for the save dialog.

Change-Id: Ifada463e95e2e911161f6ba898de6656412b4f83
2019-10-24 18:35:53 +02:00
Ed Sanders b676b2295b Update VE core submodule to master (3fac5f1f2)
New changes:
8cbedc3c8 build: Update linters
a211e9fd8 TargetWidget: Use surface view focus/blur events
57aeb8b38 Separate utilities required for DOM parsing into separate file

Local changes:
* Setup modules for new parsing utils files

Change-Id: Ie4e59650fdb869e7e4148c97cd03d79ce35187dc
2019-10-23 18:34:17 +02:00
Bartosz Dziewoński 3f0f302577 Enforce that some files must not use the ve global
Previously, the ve-mw/init/ directory contained two kinds of files:
those that were used when initializing VE, and those that may be
loaded even if VE is not going to be initialized at all. The latter
kind must not use the `ve` global variable.

After moving those files to ve-mw/preinit/ we can enforce this with
.eslintrc.json in that directory. This would have prevented T228684.

(Technically they merely must not use `ve.init`, and may use `ve`,
but that's harder to enforce. We should instead move the few non-init
methods out of `ve`: now, track, trackSubscribe, trackSubscribeAll).

Also, group some files under ve-mw/init/: targets/ now (only)
contains ve.init.mw.Target and its subclasses, apiresponsecache/
now contains ve.init.mw.ApiResponseCache and its subclasses.

Bug: T228684
Change-Id: I945249a27f6a0fa10a432d5c5dc57bc7e0461fd8
2019-10-10 15:15:40 +00:00
James D. Forrester 673d2bc657 Update VE core submodule to master (163767591)
New changes:
05306a572 ve.ui.SpecialCharacterPage: Remove unused icon handling
738244b1f Localisation updates from https://translatewiki.net.
7527b151c Upgrade DOMPurify 1.0.10 -> 2.0.0
ff5c1def9 Catch errors when applying initial history

Change-Id: I43c2668ddf1c2a15d724b24532256fc2d222facd
2019-10-01 14:37:01 -07:00
Timo Tijhof aae62a87be Remove cache group setting from styles modules
Follows-up 35eead0f3. This caused an extra stylesheet and HTTP
request to be added to all page views, because
'ext.visualEditor.desktopArticleTarget.noscript' is a styles
module, which should be allowed to join the regular batch.

Also remove it from other styles-only modules known to be loaded
with addModuleStyles().

Bug: T233095
Change-Id: Iea1f33199ec8dc83a42ac7102595a033300e33e6
2019-09-17 19:06:23 +01:00
jenkins-bot cc5a5dfaff Merge "Break up our massive load.php request to work around network issues" 2019-08-30 22:25:16 +00:00