When switching from the old wikitext editor to VE, we stored "editing..." as
the original page title. Then restored that when saving / switching to "read".
Instead, detect if we're on top of the classic editor, and use the pagename
message to make a plausibly-correct title.
Bug: T126077
Change-Id: Ib0289de71c3ae947ca0a3e45fe1e620378689c35
This wasn't such a big deal in VE because we load the full
page anyway, but in NWE it is more annoying if you reload the
page and are dumped in a different edit area.
Change-Id: If49569cbe1a2759d8cbbd7ee42dd1b88da39a946
Provide a common function to parsing, and always pass
section to the target, instead of having the target
re-compute it itself.
Change-Id: If9fc24ffa51507cd969fa1b4dfc1519a0b50a572
This has to go to the API, because it's skinnable. Also, separates out a few
of the initial page setup functions so they can be re-applied to the new
content inserted.
Bug: T151651
Change-Id: I8d5a6504edc2e0486a0b4f016d8ee6d9a6228de9
Create a new MWSaveDialogAction, which can be hooked up to triggers. Switch
the existing save dialog accesskey to just use the trigger system.
(Maintaining all the accesskey logic, so we don't change the shortcut on
people.)
Bug: T149914
Change-Id: I9b4ef8504148703556f802b266a517dd5098c06b
New changes:
f58ddea DiffElement: Use document slices with full internal lists
83800c0 DebugBar: Remove hard-coded i18n
b4f89e1 Update OOjs UI to v0.18.1
40c7bf6 Factor out active node functionality from SectionNode for captions
2d967be Move 'mode' property to surface, rename target property to 'defaultMode'
5d8c214 wrapAllNodes in sourcefragment
dd3d9e5 Refactor ve.dm.Transaction
9d61aca Use canonical ve.dm.TransactionBuilder.static.newFrom* methods
df4f72a Make table caption node an active node
b79f72d Core source mode
7533ac4 Localisation updates from https://translatewiki.net.
ae30d71 SourceSurfaceFragment: Check range is not collapsed
Local changes:
Get edit mode from surface where possible
Depends-On: Iec758c1892d518ad4bc2c0d1aaf6ca00fa354323
Change-Id: Ifaf6a26078b2731b374aaad2cb40c08928de9c84
This is set to 'true' in mw.Target#setupSurface(), but not initialised or
used there in that class.
It was previous initialised in an indirect subclass (DesktopArticleTarget).
Move this to the parent class instead for clarity.
Change-Id: Ie3e12d254aa4b689fdce64620e110164311bc60a
Reject the activating deferred making handleLoadFailure
redundant.
Fix logic for switching back to OWE aware of NWE.
Change-Id: I328fc944bb6b9152752742fe35c56b95e3255b88
We should avoid using alert()s as much as possible due to their unhealthy
interaction patterns with any other open tabs or user tasks.
Change-Id: Ib6a217c988322ad17bc7e649c3281eb053b54bbc
Just use the normal section parameter, haven't been able to figure out why VE
would need to be special about that.
Bug: T149958
Change-Id: I9338d0f1498fbb579fa8c340d6e7274c6d48155b
NWE can return data in 'visualeditoredit' instead of
'visualeditor'. We may want to change this later.
Also restore removed hack code that popuplates missing
VE API data when requesting wikitext.
Change-Id: I9a782a85444d37a3e21c071db7e175ee9b0b1c4f
Get rid of the 504 Gateway Timeout handling while we're here, in preparation
for bug T135748 where that kind of thing will be made normal.
Change-Id: Ia4abb1a68ff7ab7ff365c7348bf4d2ad35c43a27
transformPage() makes significant changes to the DOM, so measuring the
scroll position synchronously right after that results in a slow forced reflow.
Instead, measure the scroll position before reorganizing half the DOM.
Change-Id: I3baee5c11ca228696ddbfb30789745f5f0faa20a
Instead of getting wikitext from the HTML, which is probably
slower and leads to issues with the whitespace stripping hack,
override getDocToSave and get text from the linmod directly.
Bug: T144621
Change-Id: I6b6cf16ee8f3720398ba8f5c85e7715c2e68329f
To align with the linked patch in MediaWiki core. Taking advantage of
the opportunity to use core's messages for these, and remove some dead
wood old messages that were never used like "restore" items in mobile.
Bug: T139033
Depends-On: Ie81b5edd275963a965cd44d0fd325cae9ee2f1a6
Change-Id: Ie00e94cc77cb750a7e8d1104366bb3dad65af8a4
If you viewed a page with an ?oldid= query parameter set to the ID
of the current revision, some parts of VE would believe we were
in oldid mode (because there's an oldid present), but others
wouldn't (because the revid we're editing equals the newest revid).
This caused bugs when opening the editor a second time after saving
(which is normally impossible to do after an oldid-mode edit, because
we navigate to a new page after an oldid save, but we don't do that
in this case).
Ensure that:
* The internal state of DesktopArticleTarget is updated correctly
after saving in this case
* The ?oldid= parameter is removed from the URL after saving
* DesktopArticleTarget.init doesn't preload the article HTML
on a second/subsequent editor load: this causes issues because
it caches the oldid, and generally speaking the Target's internal
state is not considered
Bug: T141330
Change-Id: I74034328797c59f7249f1f6f4f53a92ee1c26334
If you deactivate without saving (e.g. using the back button), the page
contents aren't replaced and so adding the page click handlers is pointless
and harmful because they will run twice.
This was my fault in Iad1713e1
Bug: T135387
Change-Id: I3c83009bfc0f42125cdcde7f7a51de9bc2f72abf
So if the user supplies a summary in VE, WTE with the "Prompt me when entering
a blank edit summary" preference won't moan.
Bug: T135979
Change-Id: I0e2d2b6f8fb03bb56d600f1118daf82fb3715b66
In case we were switching to source.
Normally MWWikitextSwitchConfirmDialog#getActionProcess would do this for us,
but this closeWindow call doesn't trigger that, we can't get it by overriding
MWWikitextSwitchConfirmDialog#close either.
Bug: T134333
Change-Id: I66a12ff6d13601250b9d470e1be54fe38a1ef06c
* Ensure ve-loading isn't removed early
* Quickly detach then reattach the loading bar during
activation so it doesn't get moved and marked as original content
Change-Id: I263c9627348953a11966f8bcc435d0d89b0b6084
T52720 (link corruption in FF13/14) appears to be fixed.
T52780 (editor not loading in FF11/12) appears to be fixed.
FF11 has a new issue where templates are normalised even
when not touched (T136607)
Change-Id: I34358e3d90b8186e6b89c04c038ab79c908fc81b
Define $editableContent on target construction, and mark
all non-ancestor nodes between that at the target container
as uneditable (50% opacity, no pointer events).
Bug: T58289
Change-Id: I7fe51104bd5aa1bd53ffc604e5f02752c7553578
You can still open VE with prefer-wt mode by going to veaction=edit, and
T116406 proposes making it accessible with a keyboard shortcut as well.
Change-Id: Ifc25b5147a96a200ac3a7de465d5cdf67e2e255b
transitionend events seem like a neater solution, but we should
migrate all of our code at once, and provide a polyfill for
browsers which don't support it (IE9).
Change-Id: If6ae030856f8e69cc8bb26f21bfed30d5d22775c
Place things like the page title and redirect link inside a new
container $originalContent, which is appended to the surface
when ready. Replace margins with padding in various places.
This will allow us to surface-height-matching sidebar for dialogs.
Change-Id: I60d80fb303bdaf93e9d121f62d534ee3a3056e59
wgTitle is basically just $title->getText()
wgPageName is $title->getPrefixedDBkey()
So we need to take wgPageName and run getPrefixedText (difference is underscores
get replaced by spaces)
Change-Id: Ib99f0d20f1ba99338f80bbbf39cffd544887c3fa
Warn the user about an empty edit summary when the "edit section"
link is used to trigger VE.
Re-does Ic7b456ca a different way.
Bug: T114857
Change-Id: I319c9c5bed47140a81eb409d490c9f82b89a49fe
* Try to hide loading bar on failure
* Don't set wgAction back to 'view' if we're dropping the user back to the
wikitext editor
Bug: T125580
Change-Id: I13058ae131a1dda3b172e78d9b143d70831c47f1
* Ensure activating classes are removed by rejecting activatedDeferred
as soon as teardown starts.
* Try to teardown surfaces is surfaces exist, not just if the target is active.
* Remove noop teardownDebugBar. The debugbar lives inside the surface now.
* Ensure progress bar is always reset, even if target setup is aborted.
Bug: T99139
Change-Id: I16a071c0d4bc8bbc6af2e03e63ee0ffc18d55c75
Seems we need to make sure this returns before navigating to the target page.
This reverts commit 40807a0743.
Bug: T121122
Change-Id: I4edf03bc0d57b03897d9f1802eabd8f0dd9962b9
Move over logic which isn't specific to the article
implementation of VE (e.g. nothing related to loading/saving).
Refactors setupSurface to use an abstract tracking method (which
does nothing by default), and moves surface CSS classes to #createSurface.
Breaking change:
* Rename onSurfaceReady to surfaceReady. We shouldn't need to listen
to our own events.
* Rename onReady to documentReady. onReady is not a listener.
Bug: T97166
Change-Id: I7242b1bb5501b7755a18a13d13e166c30cac9cdd
This makes way for a base mw.Target class which is
not specific to articles (e.g. Flow boards).
Bug: T97166
Change-Id: If72650bdf87aa9f195b004da0a4d815f1a8063a3
In addition to the couple of TODOs inline, we should do the following in
follow-up commits:
* Prevent FOUC due to changing things only on the client
* Make section link behaviour sensible
Bug: T58337
Change-Id: I65d966270491ffe017cb11a0daa915628fadf65c