Perhaps in the future we could enhance this so that clicking a different edit
link queues that up for after the current activation finishes / aborts the
current activation cleanly.
Also, error-checking on setting an invalid progress state when loading.
Bug: T143160
Change-Id: I6c78cb19953df6fb564c06bac807e6897b63df19
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
When our remember-last preference changes work, alongside changing the
label of the edit tab, also change the label of the edit section links.
I seriously have no idea WTF I was thinking back in December when I
put some of this code into #activatePageTarget.
Bug: T137424
Change-Id: I581c0acf0a3ad11ad3bcf4e2e46242907ca9166f
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
* 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
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
The SupportCheck method asserts that the method is available so use it
instead of the confusingly named jQuery version.
Change-Id: I2105384cc4f6f2ec1cdb24a7bf3b0f4cce7672d3
On the client: getLastEditor in ve.init.mw.DesktopArticleTarget.init.js
On the server: VisualEditorHooks::getUserEditor in VisualEditorHooks.php
Change-Id: I9cc0f367aee2dda43cffc6918bfb042ac8ae3bb2
veswitched and wteswitched together cannot result in any sane behaviour.
To reproduce:
* Open VE (while having multi-tab pref?), switch into WTE
* Make a change
* Switch into VE
Change-Id: I90e19169e3fab60ab876c8e4d349801309db262f
Regression from 863a2c2974.
Sometimes when clicking "Switch to source mode" in the toolbar this
error is thrown and the interface freezes because setEditorPreference()
only returns a promise if the value is different.
> Uncaught TypeError: Cannot read property 'done' of undefined
> - ve.init.mw.DesktopArticleTarget.switchToWikitextEditor
Change-Id: Ie59f06a8ed9af9c4fb8199b013c06992d0c4f700
New changes:
0371bbe [BREAKING CHANGE] Refine VisualEditorSupportCheck call and document pattern
Local changes: Use new VisualEditorSupportCheck pattern
Change-Id: I7dc0c360b54a93397180b18d88d72532e439da5c
New changes:
c02ea46 Clarify documentation of directionality methods
43c9b6f Move initialisation browser support checking from downstream
c89be66 Localisation updates from https://translatewiki.net.
5fb7907 Follow-up c89be66: Fix build for added language 'nan'
fc74fab dm.ElementLinearData.compareElements: Add a few missed test cases
Local changes:
Use initialisation browser support checking from upstream
Depends-On: I27a8e7b4376647f01cee648de987dc3ca6a060d5
Change-Id: I3fc79422ee5e487cf5fae3929fe492f21cd2840a
hideLoading always gets called after activating, not just failing
Follows-up: I13058ae1
Bug: T127184
Change-Id: I47d1892feacbfcf832aa32f689f173601b76c4ba
* 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
* grunt-contrib-jshint: 0.11.3 -> 0.12.0
This version of the linter cleans up a number of options. 'es5' is now assumed to be
true by default, and replaced as 'esversion'; 'latedef' is extended to also cover
functions' defintions, disabled for us for now; 'futurehostile' is introduced to aid
future-incompatible names for ES6+ support.
I adjusted ve.init.mw.DesktopArticleTarget.init.js based on this, as this file is
meant to be loaded by all JS-capable clients to determine if it is (amongst other
things) capable of ES5, so now we assert ES3 compatibility via jshint.
* grunt-jscs: 2.5.0 -> 2.7.0
Minor version bump that doesn't affect us.
* grunt-jsonlint: 1.0.6 -> 1.0.7
Trivial version bump that doesn't affect us.
Change-Id: Ieb7b6748b0cecf275cfc284fc66617189372461f
* 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
Usually. Unless you load VE, because then you might be loading on
`action=edit` in remember-last mode and therefore the tab text needs to
be updated from "Edit source" to "Edit". Or "Create source" to "Create".
Or the equivalent with 'local description' in the case of pages from
foreign file repos, etc.
Bug: T120970
Change-Id: I8f07be6c8e415b40ad134ee82d0bda1d63cc4f96
Seems we need to make sure this returns before navigating to the target page.
This reverts commit 40807a0743.
Bug: T121122
Change-Id: I4edf03bc0d57b03897d9f1802eabd8f0dd9962b9
To use
.then( function ( opened ) { return opened; } )
.then( function ( closing ) { return closing; } )
.then( function ( data ) {
etc. instead of nesting them in .done functions
Change-Id: Ic8cee9639b90cb378ce0b7e58dc04eab0ff4cbc7
We can't handle these yet. There's also 'preview' but I think we probably
qualify as supporting that.
Bug: T121126
Change-Id: I4602992a77f460b9bfcbad0eac1bdd79d67df04d
This makes way for a base mw.Target class which is
not specific to articles (e.g. Flow boards).
Bug: T97166
Change-Id: If72650bdf87aa9f195b004da0a4d815f1a8063a3
Currently we assume that any document state from WE is modified
but that is not necessarily the case.
Change-Id: I085825152528ae5a5e973e8b44f68cb07ee92416
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
No point showing the icon if we don't have the functionality to
make it do anything. Also this reduces the number of RL requests
made as we never fetch OOUI separately.
Change-Id: Iac9aa6f34c485223e73981b3377c7d0cfd31dae9
Work around RESTBase problem that causes errors if we try to switch to
VE when the wikitext is empty. This would prevent non-power-users from
opening VE entirely.
This only solves the issue for new empty pages, and not when the user
intentionally empties the edit box. In that case, though, they get a
dialog where they can choose to "keep" or "discard" changes, and
discarding lets you open the editor.
Bug: T118152
Change-Id: Ie808bcaa9826deacac392dd6cbc90a9446602b79
This wasn't as bad as T112401 (that was blocking render), but we
still shouldn't be loading the module on page views.
Bug: T118088
Change-Id: If86701ed7ff4e8d6defb1c682aa9a38c211be0fa
VE already has a a switch icon in the options menu, so bring that
up to the main toolbar.
Append an OOUI button to the WikiEditor toolbar if present, and bind
to the same functon as the edit tab.
Bug: T49779
Change-Id: Ic1e83ea7b13c4fef68024bf05ffc244060666103
We want to flip the default of visualeditor-enable to true, but don't
necessarily want to turn it on for users who already have contributions but who
haven't already enabled it. Therefore we're considering adding such users to
this autodisable preference which they can self-remove (by explicitly enabling
VE) or we can target later, separate from betatempdisable users.
Bug: T112352
Change-Id: I1ce5e6c92055e30fdc82bc912a767e913b190ef6
It's just as usable as the alien extension inspector which
is currently shown, and has better messages.
Change-Id: Ifbce9df4aff77cf76a8445158987be716ba45302
The loading progress would not be reset upon failure, causing issues
when you tried to start loading again.
Bug: T96437
Change-Id: I7ec4be82304c101fa1bd634f60bc6b0047e2d53d
Collapsible relates to the Vector menu behaviour where an item
is moved into the dropdown menu if the window is narrow.
This should only apply to the secondary tab when there are two tabs.
If there is only one tab (non-VE, e.g. in a non-VE namespace) then
this tab should not be collapsible.
Server-side code handled this correctly, but client-side was
adding the class unconditionally.
Change-Id: Iecd195e92f43fe9f11b3938a1a24caed7b331e5f