Goals:
* Allow other extensions to reuse these methods (maybe upstream them
to MediaWiki core later)
* Allow ApiVisualEditorEdit to extend ApiEditPage. We'll be able to
reuse its definitions for API parameters instead of duplicating
them, and we won't have to pass around unrecognized parameters.
Bug: T252573
Change-Id: If5c8d95560cbb078ae4980f4a912cbaeafe53d3e
We go through all this trouble to pass the config to the API modules,
and then we don't use it at all (we removed the uses recently in
ce094c72d and d85d30f9b).
If we end up needing the config there again, we can just get it by using
MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'visualeditor' )
anywhere we want, like we do all over the place in VisualEditorHooks.
Change-Id: I9d254a9946f0d24783baf68c409b10291a8fd1b3
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
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
Bring in ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref
and ve.resolveUrl, so that the file has no dependencies on VE.
Change-Id: I03bc455d5484a6c51f3fa2397c64936b829fe7e3
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
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
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
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
It turns out anonymous users can't apply change tags, so change
I2c1d0f8d69bc03e5c1877c790247e165f160e966 broke editing for them.
Bug: T242184
Change-Id: I7c27e4d9995428e213a980819810f235fdfe9435
New changes:
fb4f0a83b Completion framework
Local changes to wire in the completion framework
Bug: T232601
Depends-On: If6aee9df67e7a1234d47c0ba0c2f05ef47e5bd51
Change-Id: I075cac9aa195574c3d416a40bbdc5ec2d64424e2
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
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
New changes:
06ad0c769 git-build: Fix name of grunt.log.error
6bed6aaa5 CommentAnnotation: Replace 'reply' with 'comment'
Change-Id: If7e298eaafdd7cf9ab07b6314cb9c214a2072229
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
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
Requires unregistering MWLinkAnnotationInspector
Bonus: Remove unnecessary list of unregsiters as
teardownOverrides is run on init.
Change-Id: I3e36ab7736cc8479ab53f40d2eb24c0fa15d3dc0
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
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
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
Context items can be created for specific template titles. Titles
are mapped to context items using an on-wiki message.
Bug: T211243
Change-Id: Icfc39e350452da238d0e0c17cb2305c60d9ca16a
When saving fails for a reason we don't handle explicitly, the error
message will have HTML formatting and will respect any on-wiki
overridden messages, rather than being plain text generic message.
Extensions providing custom SaveErrorHandlers may need to be updated.
The only one in Gerrit that requires a fix is TitleBlacklist:
Ibeae79c95557a7af699716c9d921f34c310bee6d.
* Remove handling for errors returned in .visualeditoredit.edit.info
rather than .errors (.error in old format). AFAIK this is only used
by some extensions, it is probably incorrect to do (T229539) and all
extensions I know of that do this (AbuseFilter, SpamBlacklist,
ConfirmEdit) have custom SaveErrorHandlers.
* Remove custom error messages for 'readonly' (identical to API
response) and for 'hookaborted' (very unhelpful and there is a
chance that the API response is better, if the extension causing
this error generates any error message).
* Add a silly shim for MobileFrontend integration, because we allow it
to handle error responses, and it expects them in the old format.
This is probably subtly wrong in many ways, but MobileFrontend code
only uses this for logging, so it shouldn't explode. In the future
we will hopefully change it to use errorformat=html (T228897#5366960).
Bug: T229532
Change-Id: I3b9c4fefc0869ef7999c21cef754434febd852ec
New changes:
28aea2e4d Edit cards v2 design
739017973 Track usage of the new "close context" button
Local changes:
* Edit cards v2 pull through
Bug: T222396
Change-Id: I1ca885e8d8127e7827a059755315ed789a7b9210
New changes:
a06204317 Fix TableNode unit test getOffsetFromCoords failure on Firefox
dfe0eb025 Refactor mobile context logic into ve.ui.MobileContext
Local changes:
* Pull through for edit cards refactor
Bug: T227532
Bug: T228767
Change-Id: I6c043e039fbef62a56f475b0dc365e171ab7bf59
New changes:
1a7460058 Remove ve.newMobileContext feature flag
Local changes:
* Remove ve.newMobileContext feature flag
Change-Id: Ia8def997b7cba4623866080752b06068d2118cc3
We also show this dialog on the old wikitext editor, where
ve.init.target is not set, because the relevant code is not loaded.
Follow-up to 478b0bcbb9.
Similar to e88cd81f94, which fixed the
same issue in a different file.
I checked all uses of ve.init.target in files under ve-mw/init/ and I
think this was the only remaining mistake.
Bug: T228684
Change-Id: I15551870cdb01d570e24ba9668e67330b8072e01
This module is now needed to correctly display log excerpts,
like in our edit notices popup for protected pages.
Bug: T227190
Change-Id: I19dec69a33a2b3246ff1abe6bec90b2359ac36a4
New changes:
6cd9ba63f Localisation updates from https://translatewiki.net.
c9cebed32 Update OOUI to v0.33.2
65c66b8a6 Localisation updates from https://translatewiki.net.
8d94ad13f Replace unrendered parts of the view tree with a stub node
213b79783 Basic unit tests for attachedRoot functionality
Bug: T215717
Change-Id: I7bd8106a82e4fa7c912ce9f8d4fab86bfb546702
I suspect that the size of our singular load.php request (~600 KB
after gzip, depending on the installed extensions) is somehow
triggering the network problems on T213214. To test this theory,
break it up by putting some modules (all that start with
'ext.visualEditor.') into a separate ResourceLoader group.
Now we have two load.php requests (~300 KB each after gzip).
This may increase load times (it will be interesting to see by
how much), but may also fix T213214.
Bug: T213214
Bug: T221197
Change-Id: I0b1a65963267ba52d7962ce31db5a8e6f913322d
New changes:
a3d860daf Localisation updates from https://translatewiki.net.
0421bf6f0 Gather annotations from clicked node where possible
2d2491877 Change#squash: Compact multiple transactions into one
dc0e4650e Fix documentation of ve.dm.Change#serialize
a40f8314f Fix contexedAnnotations equality check
ec62ccb34 Use 16px font size on SA mobile demo
57984c072 Update OOUI to v0.33.1
Add lib/ve/src/dm/ve.dm.TransactionSquasher.js to debugScripts.
Bug: T188026
Bug: T226708
Change-Id: I6eb4ab50ef2c6774963f692f600f059662bf0ac3
* Change the query in ve.init.mw.ArticleTargetLoader#requestParsoidData
so that in non-RESTBase mode with wikitext it still returns the
metadata required to initialize the editor, using the backend API
code added in I1b35b28e428a1f86d2e34d90ddbe73361ce14818. This fixes
the exception from T222312.
* Introduce new configuration option $wgVisualEditorAllowLossySwitching
to control this feature. It is enabled by default, fixing T214542.
We allow it to be disabled because switching in non-RESTBase mode may
cause "dirty diffs" (non-semantic changes to the wikitext), which are
undesirable on wikis where users carefully review all changes.
Bug: T214542
Bug: T222312
Change-Id: I58879cba5612002c70c24731306214d2577c2c52
New changes:
8df948f5d TableLineContext: add context for the entire table
aae86a822 TableNode: Change mobile behavior so initial tap enters the cell
195d8cb3a Check resizeable node is focused before rendering handles
Bug: T211240
Change-Id: Ib2430c521abb4e59aaa2c5e4f9b26a16437db02e
The method ApiQueryUserInfo::getBlockInfo() was removed in unannounced
breaking change in MW core: I84ed21641c44b2f65ebe1980b0893d1846db3b34.
Apparently we're supposed to use the method from ApiBlockInfoTrait now.
Bug: T209599
Change-Id: I7ab5492310980b1527c7329faf65655330b8bef0
This message was upstreamed to core and later renamed.
Use the upstreamed dialog itself when switching sections.
Bug: T222525
Change-Id: Ibd2d75ec503e92b5ddec2105f762b0c9f0dc96fb
New changes:
9b162a5da Localisation updates from https://translatewiki.net.
10dbdabf4 Remove valid-jsdoc exceptions for @chainable
a424f804d Make blockquote a non-content branch node
Local changes:
* Update stuff for making blockquote a non-content branch node
Bug: T76426
Change-Id: I95ae25f20d3d102da69bf5ffdff55335f6c07635
They will now apply for other skins not mentioned here, e.g. Timeless.
The most noticeable change is proper styling for target widgets.
Change-Id: Ibf4c080aaaeedd65144ac5e95ed2f48a1cd17635