If the Parsoid document has an invalid base URI or none at all,
construct one based on wgArticlePath so link href resolution
still works properly. This is needed especially when creating
a new page, because the "Parsoid HTML" is an empty document
in that case.
Bug: T94315
Change-Id: I5d9709725ef471c7ce1987ce887708ac5ee4259a
Also use an array instead of an object. The keys were already
meaningless (index numbers). A "wikimedia/*" Git search did not
show any usage outside MWNoticesPopupTool. However, the array is
backward-compatible with any code using it as an object for keys
or looping (just in case).
This should also make the order more reliable.
Bug: T87412
Change-Id: I683cc902bda5ba768e962af6725e657871b79b9a
VE core changes would be needed for the remaining 9. (To deal with 3 titles in
the UI, and 6 encapsulating the selected text with one character before and one
after).
Change-Id: Id7c0fa06b1c873ab286cffb7a83016a2d37ab744
When deactivating, verify first that the welcome dialog was
initialized before calling 'close' on it.
Change-Id: Ife98b396f3d8641e2bd313c549fe867bcd84db9b
This is not pretty and probably isn't optimal, but it works well
enough. The bug about getting rid of this all is T91152.
Bug: T94071
Change-Id: If926286f1d0c7835489914ed653a0d65ed24f53a
Stripped out X-Parsoid Performance Headers, previously used to gather and
forward Parsoid's performance information, from ApiVisualEditor.php,
ve.init.mw.Target.js and ve.init.mw.TargetLoader.js. Change I936ada7b1 strips
out the corresponding X-Parsoid Performance Headers from Parsoid. Parsoid's
current performance instrumentation is achieved using Graphite and txstatsd.
Change-Id: I57d6f866a7d8287a5115e6236b0fb25bc4d0eabd
It's much less likely we'll get another conflict if we retry
with ?oldid=12345 than if we retry omitting the oldid again.
Change-Id: I10e40f714fd44d7f0ac16c9d0dc6239a95c0ec51
Also introduces paction=metadata in ApiVisualEditor which
doesn't hit Parsoid but gets all the other information we need.
Bug: T90374
Change-Id: I71edbc0f8dc15a6f8d3672c10ca3c641cc172be7
Split up beta and meta dialog show methods so that beta dialog
is displayed as soon as possible, regardless of the surface being
ready. Also make sure that we destroy the temporary window
manager on destroy.
Bug: T90454
Change-Id: Ib8f94518af431487ce940a74a8c268dbdbe403d2
With RESTbase we'll be able to retry the older one, but right now we have to do
both with the same request.
This commit retries loading once, then starts emitting errors.
Bug: T92993
Change-Id: Ifbf44b777279dafbe31ab438838d70acd44de726
Due to changes in the way VisualEditor is loaded, the trace.activate.{enter,exit}
events no longer enclose the entire VisualEditor initialization process. This
change ensures that trace.activate.enter is emitted as soon as the user clicks
on an edit link / tab and that the trace.activate.exit is not emitted until the
toolbar has been fully activated.
Change-Id: Ief798faa95a58898b9ae4dcbbbd30506c5dbd9a7
On short pages which don't extend below the fold, the progress
bar should center within the #content element.
Change-Id: I0b99e42f5bab8177d3b4ca6dd372d6403ae9b136
When we moved to mw.Api, edit conflict errors stopped going via onSave and
started going to onSaveError instead. So the case to check for them in onSave
would not have worked - instead, they would go through onSaveError and get
picked up by our unknown error code, which just picks out error.info and shows
it, instead of showing our edit conflict screen.
Also return in a couple of other error cases where we probably should've been
(but not necessarily must've been... that didn't necessarily show to the user
if another error emit already caused saveDeferred to be rejected)
Change-Id: Iae7a66a8aa96ee777e9fa780005feeb429129d5f
We're currently rewriting "mwtiming.performance.system.domLoad" to
"timing.ve.undefined.performance.system.domLoad". The "undefined" comes from
the missing targetName property on the event. I'm not sure why it is missing,
but having it default to 'mwTarget' will Do the Right Thing™.
Task: T93156
Change-Id: If70ff601b6c54ec8f95171cbc43c82c87a177508
Relies on I69cf0a88
Using our own new message because TitleBlacklist's own one includes text that
we can't parse on the client and relies on a parameter we don't get from the
API.
This relies on WikimediaMessages' version of the Edit schema being updated at
the same time.
Change-Id: I4c75369b8b97973b72899bfaecbd5a996a440c68
Set 've-activated' as soon as edit is clicked, with a 've-loading' state.
This necessitates moving the relevant styles to mw.ViewPageTarget.init.css.
Change-Id: Ic9757cdbf63a2f72eda0dd03ff5588d79028ba0e
Move requestPageData from mw.Target to TargetLoader, call it
in init init, and pass the promise it returns into load()
via activate().
Bug: T90372
Change-Id: I828b8474e5a76b3d0d7d08735b4d865c29d2f820
This introduces TargetLoader, which manages plugins and RL modules
in a slightly more generic fashion so that Targets themselves don't
have to. This allows us to load all RL modules in one load.php
request, rather than first loading ViewPageTarget which then
loads the other modules.
TargetLoader loads in the bottom queue, so it will be loaded
as part of the main load.php request, but in VPT.init.js we
still have to wait for it with using() because it might not
have arrived yet. This also degrades gracefully on cached pages
where TargetLoader isn't in the bottom queue: it'll be loaded
as a separate request instead, which is suboptimal but no
worse that what we were doing before.
Right now TargetLoader is small enough that it could also be in
the top queue, but in the future we want to add things like
the action=visualeditor API request to it, and mw.Api is
relatively big.
Note: this also makes a breaking change to the plugin API:
plugin callbacks no longer receive the target instance
as a parameter, as they're now executed before the target
has been constructed rather than after. In the long term,
if we want to give plugins access to the target instance,
we could give them the target promise somehow. For now,
I've killed this feature because nothing used it and
the change from a direct object reference to a promise
would have been a breaking change anyway.
Also fixed incorrect documentation index for ve.init.mw.ViewPageTarget.init.
Bug: T53569
Change-Id: Ibfa6abbeaf872ae2aadc6ed9d5beba7473ea441a
ve-ce-surface is a child of ve-ui-surface. The ve-ui-surface has
margins that would remain in the document flow causing a temporary
growth outwards to the bottom during deactivation (causing the
white area and blue border on Vector's grey background to move down)
after which it would restore again.
Follows-up 77f016a.
Bug: T91442
Change-Id: I5b999b580c968fcd24f07d9a895cfa17afc80c0d