Follow up to I02ea8421e468635ba6297bb5cda488a5a79c9a1d the depends on
I7a5c24f6ffc15ff0455adf5b025b695ee71501b6 in Parsoid.
Note that the mediaTag isn't currently being passed around for gallery
image nodes so, for example, a <video> becomes an <img> as is. But,
that's independent of this patch, and a follow up will fix it.
Noted in T348703#9278332
Bug: T348703
Bug: T214603
Change-Id: I5f7d3dfe0a41fac1568c97dccc41209c14e741d0
Replacing several values with MediaWiki skin variables featuring new
Codex design tokens, available since >= v1.41.0.
The values are 1:1 visual replacements in the default Codex
'WikimediaUI' theme, a continuation of the base vars, and the default
for Vector and MinervaNeue skins.
Also replacing
- other static color values with variables
- and outline value as the Codex default brings an accessibility
advancement for free
Bug: T334934
Change-Id: I512427803cffce1c16879015c45cf1e35fe17480
After the other changes in T346944, desktop Minerva can display
multiple edit tabs and section edit links without these hacks.
Bug: T346944
Change-Id: I3721f9387303386493664366988961242a26dba5
Video thumbnails have no alt attributes, and so we were causing dirty
diffs in any edit of a page that had a gallery containing a video.
Bug: T348703
Change-Id: I02ea8421e468635ba6297bb5cda488a5a79c9a1d
Some wikis customize messages, e.g. 'skin-view-create-local', in ways
that are not compatible with the client-side message parser.
Bug: T306807
Change-Id: Ie2f2ba4bba3b5b6f4fd6dbed6773d87f096a8944
* Remove incorrect overrides in VisualEditorTabMessages. Since
I44bd632682d5cc52b2660ad72a492f95a04be36e, the interface should use
'skin-view-edit-local' and 'skin-view-create-local' respectively.
* Fix the fallback mechanism in DesktopArticleTarget.init.js
to handle these keys correctly.
Change-Id: I7dad7e3a6fb920c5caf175e0e7500fd0c4b4d0ae
saveProcessDeferred will only exist if content was actually added. This
wasn't causing any functional issues, just an error in the console after
you save.
This issue was introduced via I1dccc3c.
Bug: T344382
Change-Id: Icb0c29b64d960308343ddbb3f9d2ee641552b814
This JS code duplicates the PHP implementation in VisualEditorHooks
in order to allow changes to the configuration of edit tabs
(e.g. wgVisualEditorUseSingleEditTab and wgVisualEditorTabPosition)
to take effect for logged-out users immediately, without waiting
for the HTML caches to clear.
It was worthwhile 10 years ago when VisualEditor was being rolled out
to new wikis or reconfigured daily, but it is not today when we hardly
ever change these settings.
It proved difficult to maintain as the skins change, it has several
known bugs (T292125, T306807, T346944), and probably several more
unknown ones, given that it hasn't been tested in about 10 years.
Let's remove it and save ourselves the headache. (Also also reduce the
amount of code we ship on all page views by almost a kilobyte.)
Bug: T292125
Bug: T306807
Bug: T346944
Change-Id: Ib82f5402872a2429445463a1e1ef92806d3326f9
Allow Core to handle the toggling for Wikitext when the inline switch is
present to avoid duplicated functionality.
Bug: T345836
Bug: T346213
Bug: T346299
Depends-On: Ib88836f13cdb5cd2344e3ba12f6c942baa0fc1f1
Change-Id: I3bb9fcabe17a20c9934274766e3335f63d51aac4
There's no product need for anything other than an upper limit
on edit count. If one arises in the future we can adjust accordingly,
but better to keep the JSON, and any UI implementation, simple
for now.
Change-Id: I892847ad78b19695f0f0f664002d3c566f7806de
Assume that the next window closing promise is from
the plain "Cite" dialog and use that data to resolve
the edit check promise, instead of resolving it
as soon as a manual type is selected.
Bug: T346405
Change-Id: I5b7f084269c9e870446529f63aed27f8ed995e8c
This creates a message called `editcheck-config.json` which will be
loaded and sent to the `modules/editcheck/config.json` packageFile.
Bug: T330112
Change-Id: Idc58ddf1045fcc0491701a739f3778c8cf4dd955
VisualEditorFeatureUse as feature: notices, action: show.
This doesn't distinguish between the automatic on-load show and manually
showing them from the toolbar.
Bug: T344465
Change-Id: I5a0d7e87592c286afe51e02ae8436f7d2ce71021
I apparently forgot to pass the parameter to fireHookOnPageReload()
that I introduced exactly for this purpose. As a result, the basic
post-edit popup appeared, but the temp user popup did not.
Also rearrange code so that fireHookOnPageReload() is still called if
we need to redirect to complete creation of the temp user.
Bug: T344879
Change-Id: I36c64f27d2b8866ca88642621a135e7e25a91ce1
Abortable promises are definitely among my least favorite things.
It takes all of this bookkeeping to make .abort() work consistently
(so that it always aborts a request if one is in flight, and always
causes the final promise to be rejected even if we didn't start a
request yet or it has already finished). But, if you squint and ignore
every line with the word "abort", it's like a normal promise chain.
Depends-On: Iec8a15dadd595bed0f7e54f907fbb8e192b45cf3
Bug: T331397
Change-Id: I67309c79e6d211d69630fe89cbf5402f8fbd350c
A new hook `ve.preSaveProcess` is triggered to give other code the
chance to add steps to the process. The save dialog won't show until
the process completes. A step can be failed to return to normal
editing.
Change-Id: Id0740ff58ba9d9519c81174100ef1b8f8740870b
When the document store has no entries (e.g. an empty page)
we don't initialise completeHistory with a retain transaction.
Bug: T333710
Change-Id: I5cc4ab3ea5f63a7eab804831df62d5c7ce2447e9
This method was only called, and the message was only shown, when
retrying after the first 'badtoken' error and refreshing the token
fails again.
If this happens, it usually indicates some terrible problem with
the wiki, and it is not something that can be fixed by logging in
again (or anything else the user can do).
Let the default API error message appear ("Invalid CSRF token.").
While not very helpful to the user, it should be more helpful to
the site administrator trying to unbreak their wiki.
Remove the "visualeditor-savedialog-identify-trylogin" message.
Keep "visualeditor-savedialog-error-badtoken", which is re-used
in another error message. I'll fix that separately.
Change-Id: Ib680218bce5ae38aa52d7d941218a6410ab7e09e
This has not been used for many, many years, since we started using
mw.Api#postWithToken, which automatically retries on 'badtoken' errors.
Most of our code for it was removed (e.g. save() is never called
with three parameters), but some comments and parameters remained.
Change-Id: Ibca2a222f808e6e2796ed6a61e9587a646afcf31
Occasionally we end up logging error codes like
"abusefilter-disallowed,abusefilter-disallowed,abusefilter-warning"
when someone hits a bunch of different filtes.
Change-Id: I967d374d13473ca684412b380d732653a3ceaff3
TODO comments suggested using the VE helper util, but
that is no longer necessary since all our browsers
support passive events.
Change-Id: Idb7e702d58931208d555a3f994cd0b73abec2e20
This makes it easier for 3rd parties to insert extra tools
in sensible places.
Change-Id: I6c8d0c96f53655d8f9ae9f01e5d0e1a1678d29a1
Depends-On: Ib8882fa6319915d291b345a69ab95f362739ad7b
This affects logging behavior -- notifying WikiEditor lets its logging
clean up after itself before the init event for VE fires. This was only
an issue when switching *with* changes, because that path resulted in
the timings being cleared, making future events whose timing depended
on the init event have NaN timings.
(This wasn't an issue before we centralized the logging code into
WikimediaEvents, as before that WikiEditor and VE were maintaining
separate timing registries.)
Bug: T237063
Change-Id: Icdb307fa0ce0d1dac3744e4bab41b3588f14777f
Instead of passing a "teardown callback" to a specific dialog,
run the command as usual and clear the loading message once
the dialog has successfully opened.
Change-Id: Icacabb298f1a0d7a587ab8b992759b04ff59c5c3
* Be more specific about the type of context which a
context item belongs to.
* Make grammar clearer.
Change-Id: Ic480411cead80a1651c61ce9841dfbdc24a7b915
The popup contains three buttons, one of which already exists
in core as a tool. By converting them all to tools we can reduce
some duplication, and better integrate with other features
that use the tool factory, such as HelpCompletionAction.
Bug: T339153
Change-Id: I81d217bc1ab9a1a6a9bf7c7ad588c2a3216b10db
Using the OOUI class name is an established pattern outside of
OOUI widgets, so it's easier to stick with it for the diff page
hiding and showing (switching to and from inline/table diffs, etc.).
Depends-On: I805b6b71d8e137eaa3e000b15455557df42af838
Bug: T324759
Change-Id: I0300b40d4e79319592bfc1f57912460f65c7051c
React to hooks fired by core when the inline diff type switch is
present. VE needs to be able to disable the inline switch
when 'visual' mode is selected and enable the switch when 'wikitext'
mode is selected. When the 'wikitext' mode is selected and there is an
inline switch, the interface needs to show the diff type format previously
selected.
Toggle using new `mw-diff-element-hidden` class that is used by core so
that there's no clashes when hidding and showing the diffs.
Bug: T331589
Depends-On: Ie6a48e495f2bb299d8b984e7c40363d534c7915b
Change-Id: I4f790370dbfeb521f3b61c4d604245f77094abe9
After the demise of RESTBase we are always able to switch from
wikitext to visual mode with changes, and we no longer need to
support these two poor experiences.
Bug: T339871
Bug: T339872
Change-Id: I2be4068447b21e16c87db0e56d6422ea64ba4708
Sometimes we call this API and then reload the page (or navigate to
another URL), without using the page content it returns. Save some
work and some data transfer and don't generate it in those cases.
Change-Id: Ic5fac61f3ef9b2dfce6ff757f1d414a9f41f217d
Undo some changes from 95454e710f1b619f7c538bc1dc88f238409719ca,
as this functionality is now provided by the core code.
Depends-On: I1c9020b2efb2785279f5c09539a49208a310ccf7
Depends-On: Ifeffcf214719f0d5c1371dc7d51a410fb313c978
Bug: T338003
Change-Id: I90a618897699c844f9c558bbeb4d1563f8050fe3
The user has already seen the notices, and getting hit with yet
another popup doesn't feel nice.
Bug: T169179
Change-Id: I421e42d32cb67ea210644b705e9c6e5af74e75ee