It was broken on desktop and on mobile, but for different reasons:
Desktop: In change 5f1c68945d,
I removed some code from DesktopArticleTarget that was checking for
`typeof errorDetails === 'string'`. I thought it was unused, but it
was actually needed for this code.
Mobile: overlay.reportError() doesn't work here: that method displays
the error inside the save panel, which is not visible at this point.
This is now solved by treating those errors as if they were API errors,
which is something we were already doing in ArticleTargetSaver.
Change-Id: I5207836f56d65171b1240cef02fc17b9956036ef
Explanation of what this code was for: T227628#5339392
As noted on that task, our behavior is actually unintuitive and
distracting, and iOS Safari limitations prevent us from doing it
better.
This reverts commit 600e369347.
Bug: T227628
Change-Id: Id1a5eebd06e4218e3e102165c60791999293d273
We've just displayed an error message in it, so don't close it.
I'm not sure if this code matters at all though. Usually when
there's an error during loading, code in MobileFrontend will close
the overlay and display an error message in a different way, so our
message won't be visible to the user. But maybe there's some case
I'm missing, and it's harmless. Closing the overlay was messing with
the MobileFrontend code though.
(found when working on I5146b726c5ce213992febb23f24c5937db0b9bfe)
Change-Id: Id1ea44d7bf6ef0f4fc0285e9e606dd415ed0a947
* Add a postWikitext method and split out postContent
from postHtml
* Move saveSuccess handling into postContent promise
* Connect promise directly to saveComplete instead
* Pass whole response.visualeditoredit object, instead
of splitting into variadic arguments for saveComplete.
* [DEPRECATION] Make serialize return the postHtml promise
and deprecate passing a callback.
Change-Id: I905737515578000b2b87214c92e8b9fe9e82f6b7
With this patch, the toolbar slides into place place nicely after
scrolling again, but it still occasionally flickers during the scroll.
* window.innerHeight is now smaller or something, and we have to
twiddle the scroll position by a larger value.
* document.body.scrollTop no longer works for setting or getting the
scroll position, so use different methods.
* requestAnimationFrame() now generates an insufficient delay to make
scrolling happen, so use setTimeout() instead. We actually have to
add a nonzero delay there, otherwise the toolbar sometimes doesn't
animate like it should or flashes in random places on the screen.
This delay is bad because the user can't start scrolling again
during that time, but I think we can live with that.
Bug: T233470
Change-Id: I6c40ee8ce5994e12eadb085bbffd120ef160d4ee
New changes:
4af3f84f7 Mark surface as "showAsDeactivated" when opening a window
79eb0e4e5 ve.ce.Surface: Guard against focusing a un-initialized surface
4124c275e [BREAKING CHANGE] ve.ui.TargetWidget: Construct a real target inside the widget
Local changes:
* Use new target widget
* Remove calls to deprecated methods
* 'surfaceReady' event was upstreamed
Bug: T236400
Change-Id: I765d657c172d96c3b2e2ae5998083e4926a31f15
As of commit c65ed0e7a8ac5f32a3a6e4cb2760dae03e4fca22 in MobileFrontend,
it uses errorformat=html queries (the same as we do), so we no longer
need to massage the responses to make it happy. The same commit also
turned parseSaveError() into a no-op, so we can remove that as well.
Change-Id: I4f0109ce120ebf94e5709d47d775a8178ce216fa
The call to selectFirstContentOffset() below would re-activate the
surface and (attempt to) show the keyboard if the surface was
deactivated, but not shown as deactivated.
This might have worked correctly by accident before
I39fe44eee8eab7129340bcff796b6b9b3a59a398 in VE core.
Change-Id: I500309cc0aa8cd794175ae683a17c2614fd58cc9
Some post-save scrolling would try to access the view before the
handlers were cleaned up.
Bug: T232347
Change-Id: I30433ef027c52d541351972f8ebb09fe6d45e436
As of I6c043e039fbef62a56f475b0dc365e171ab7bf59, this method is never
called. It was previously used to update the size of the toolbar when
context menus were displayed inside it, but they are now displayed
elsewhere.
Change-Id: I53030de1203a7f0d75780ae796bbb10082d5ef7a
As of I2f2495ab6c10116a6660f4361e49272cb95b988a in MobileFrontend,
the overlay never uses the default spinner.
Change-Id: Ie0aa624e33a5bd21fc20459697cca175d9de5606
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:
854a1fa2c Distinguish active link styling
Local changes:
* Pull through active link styling
Bug: T228220
Change-Id: I925f88d32a514a749b96f501a211003bc4c924f0
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
* Remove animation for toolbar sliding into place. It now happens on
the fake toolbar in MobileFrontend shown before the real toolbar
loads, and our toolbar just transparently replaces it.
Bug: T217784
Depends-On: If21aa0ea619ec2500ce5fca6fe81eb27f26bb047
Change-Id: Ib6ff7594e1982d1b46e9ca89d6b9722d025e8207
Abandon warnings are already handled by the code in MobileFrontend's
EditorOverlayBase. Using window.history.back() causes that code to run.
Having a duplicate way to trigger them only results in inconsistencies
because our dialogs animate in a different way.
Bug: T222315
Change-Id: I19c5616a6aeecf0ac63f37a564ef44f11df010b0
* Remove 'discardChanges' from switchToWikitext. This was
intended to discard changes even when the document was
modified, but it is no longer used as we always keep
changes if we can.
* Remove 'leaveVE' param, it was only used once and has
been replaced with a direct call to switchToFallbackWikitextEditor.
* Don't reset 'section' if there are no changes.
Bug: T221981
Change-Id: Ia39345da44d203ba67ae331917c8d5ece7d42ef7