Previously we completely disabled the loading of notices
when switching, instead of just not showing them (so they
don't clash with the "switched" popup).
Bug: T162812
Change-Id: I3f8e787630e196cee1dbb1aa449b3558b74fcd04
New changes:
57f8064b6 tests: Enforce dm unit test coverage at 20% per file and 80% globally
6f757c670 LinkAnnotation: add a getFragment method for consistency with MWInternalLinkAnnotation
c40a3f152 Drop the classList polyfill for IE9
d1af6c6bb Update OOjs UI to v0.21.1
bfb35aaef Localisation updates from https://translatewiki.net.
Bug: T162277
Change-Id: I5146bc421bb88e56bafadccefc7bbdee106504ea
This is run after the targetPromise completes (via the platform-agnostic
setDefaultMode proxy), which is the correct time to do so. We should not
do this twice, and we definitely shouldn't do this before the target has
successfully loaded, lest a user ends up with us setting their option to
"prefer" an editor that they actually can't load. Whoops.
Bug: T156316
Change-Id: Icf4b5ddd9c8265ade55f43328f807344b41db350
* Pass a wikitext promise, instead of wikitext
* Handle writing of content to the dialog from within
the dialog.
* Handle diff errors within the dialog.
* Never disable the 'Return to save form' (approve) button
* Remove redundant messages
Change-Id: Ibd76e8951998f751abfb4f407682202c2f73ac7e
New changes:
dc0cad28c tests: Factor out ve.dm.TestRebaseClient/Server into their own files
98061108b Convert RebaseServer tests to data provider
3e746a51b Update OOjs to v2.0.0
16231a812 [BREAKING CHANGE] Drop support for Internet Explorer 9
64daeb4b5 Localisation updates from https://translatewiki.net.
3310e876c Update DOMPurify to 0.8.5
579033a83 Follow-up 16231a81: Drop IE9 support in createDocumentFromHtmlUsingIframe
Bug: T162277
Change-Id: If17c6a3fac0920db29f80069f344ffd6be46c3c9
This will be required later when we have to fetch the original
document from the server before running a visual diff.
Change-Id: I351688f4d1fec892bc297f40c209939cbb2ccf95
Since the PopupWidget rewrite, margins for aligning popup anchors
should be set on the anchor itself, not on the popup.
Change-Id: If8237ae5edbc2e8c5cb99147f392aae52e642765
The styles are not specific to the Vector and MonoBook skins, but rather
to the MediaWiki and Apex themes of OOjs UI. Rename them to reflect that.
Change-Id: I757e8d96625feb8290cbf7837b5d801961cda344
Provide a utility funcition in ve.init.mw.LinkCache to do this.
Also use this in ve.ce.MWTransclusionNode/ve.ui.MWPreviewElement, and
introduce to ve.ce.MWExtenionNode
Bug: T73900
Bug: T153535
Change-Id: Ieb9a0274b8c5ae1932c431546f09d18000fa6dd9
This is a little inelegant, but it works in both CE and transclusion
content.
Bug: T52497
Depends-On: If058843924c3b30c116df2520aef93a004d98a5d
Change-Id: I88d45aad2aaa45e71b433350986b19764603a1f2
The bare minimum of elements that must be present on the page for
VisualEditor to start and mostly work is:
* '#content' to attach our interface (toolbar etc.)
* '#mw-content-text' to replace with the editing surface
* '#ca-edit' to start up the editor
When those elements are missing (and we expect them to be present,
e.g. we're not on a special page), we print a console warning.
For example, VisualEditor now launches on Timeless and CologneBlue.
It does not launch and prints a warning on Modern and Erudite.
(It is actually possible to edit and save pages on CologneBlue,
although various pieces of the interface look funny.)
This does not change which skins we claim to support: these are still
currently only Vector, MonoBook and Apex. But it allows third-party
skin developers to more easily test the editor and fiddle with their
CSS to make it look right.
Bug: T161373
Change-Id: I97c786f3c8c795c238b10bef332a129ea26f86c2
The element has both the class and the id set to 'catlinks'. This is
just for consistency, I have no preference on which to use.
Change-Id: Ic96b0f21fe790d0aa03bfd6366ba246e8493a038
Redirect pages have two extra things not present on normal pages:
* Redirect subtitle: the "Redirect page" shown under the page heading.
* Redirect page content header: the "↳ Foo" at the beginning of content.
Our handling was pretty messy and had some bugs (T161614).
Notable behavior changes:
* Update 'wgIsRedirect' in mw.config after saving the page.
* Use #mw-content-text rather than .mw-jump for inserting the fake .redirectMsg.
.mw-jump is not guaranteed to exist on the page (it's a skin feature).
* Never replace the real .redirectMsg existing on the page, except by the
new HTML after a page is saved. Our fake is separate now.
Bug: T161614
Change-Id: I96a5e45a71bf10bf6a2b501dc0cf81e6c37060ec
To reproduce: start editing a page, turn it into a redirect,
cancel editing and go back to view mode. The "Redirect page"
subtitle under the page title should disappear.
Note that #redirectsub is correctly spelled all lowercase,
unlike #contentSub.
This reverts commit 0e1bc7309b
and fixes the code instead.
Change-Id: Ibacd73122dfec63268a77794bc77c4b88876d3ee
As it happens, #redirectsub is correctly spelled all lowercase,
unlike #contentSub. This line does nothing. We remove #redirectsub
correctly elsewhere; I don't think this was ever meant to be here.
Follows-up 96421b283c.
Change-Id: I3e4c6eb2ff94f363b488477b3ddd248e571e723a
Stops us including "[edit]" in the summary when people have marked whole
headings for translation.
Bug: T160911
Change-Id: I906398e6bf45433d904795847f59b5bf0148092f
Running setNotices( [] ) makes MWNoticesTool run this.destroy() to avoid taking
up extra space in the toolbar when not needed.
Also, make setNotices() bail earlier.
Change-Id: I492fd59a1e15e8f296bf7f03d9b0035c40dafa59
This avoids an OOui deprecation warning for trying to toggle a popup which
isn't connected to anything.
Bug: T160161
Change-Id: I9ad97785f0de4ecf81d189985459689644e25923
Distinguish between the initial summary state, and a value stored from the
summary when switching modes. This lets us avoid overwriting a stored value
when section-editing, or assuming a stored value after a switch was never
edited.
Bug: T159686
Change-Id: Ie7640538140a14bbafd539b3a45928f5c55cf804
Switching modes recreates the toolbar, so if someone has already edited the
save summary it shouldn't update the initialEditSummary to that.
Bug: T159686
Change-Id: I4109442853916bebae2bce804fcd6777e3eb6d34
The non-FullRestbaseURL branch didn't handle converting the provided wikitext,
causing data loss when switching from source to visual modes.
Bug: T158692
Change-Id: I283afc4be1e322228d6ec572bfa8542ba8fd9ce7
Switching from visual to source reruns setupUnloadHandlers, which caused an
infinite loop where it thought it was its own fallback pre-existing handler.
Bug: T153346
Change-Id: I8df55a5395ede02fc34ec47a94f2c780dc08595f
Since December, the handler now expects to be passed the mode we're switching
to. Since we're filtering for just the edit link and not edit source, we can
hardcode 'visual' here.
Bug: T159374
Change-Id: I160045dd59ff1b4c2d180dbbe37280a1839886df
* Ensure DAT styles are fully scoped to DAT instances
* Ensure that generic desktop target rules are in the correct file
* Remove old unused rules
Change-Id: I466a0547ff9a0fa1102aac0b1e501a6ba6863ca3
Pencil is the icon we use for 'edit' elsewhere in the UI.
Use the eye icon for the VE tool to specify 'visual'.
Bug: T116417
Change-Id: I12b6bab2a52758685abde04579b274a32d651174
This will make it easier for third parties to load the required
modules for an article-like target.
Also cleanup mobileArticleTarget to better match desktopArticleTarget.
Change-Id: Idb75e2bd99d8cf2c298e101cf92e8af4f85f5ad5
Refactor saveFail's badtoken handling out so it can be reused by
getWikitextFragment.
Bug: T156991
Change-Id: I686cddb5be4484211fa69640044db1bc34eacefc
These are now computed upstream based on position of toolbar.
The menu tool now needs its indicator explicitly hidden.
Change-Id: Id2280f70553e1e45f3a42af45684c5808797925c
This is just dead code. We never call `.showMessage( 'captcha', ... )`
(the CAPTCHA is shown in the 'api-save-error' message).
Change-Id: I48f51e89d5b366384d184e2ed505be9e7b8f3401
As for the Translate extension this will read a global set by the
TwoColConflict extension to disable the VisualEditor and its hooks
on the modified edit conflict page there.
Bug: T156251
Change-Id: I164d1546c9d98d8715650e13c63a01d06c76315d
Refactor save dialog setup so logic for canPreview/canReview
is external and passed in.
'Show preview' will show in the VE command help dialog until
I56c1036e6 is merged in core.
Bug: T149914
Change-Id: Id718ad622be43c03df61d12b8688d53462c59f36
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
New changes:
f1297b8 [BREAKING CHANGE] Allow target widgets to be re-used
Local changes:
Re-use target widgets
Change-Id: I5decb918f398704d4b6c108a16fbc1cc073ef077
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
Otherwise if the target was already loaded the mode will
not be changed, which can cause the wrong editor to load
in multi edit tab mode.
Change-Id: I64071dfdfc8511cce51bda20b9c62d7fc126c528
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
Gives us extra functionality like checking for
isUnmodifiedLeftClick which makes CTRL+click on SET
not change the current page, as expected.
Change-Id: Icb37d7383374ee63798443659a2bcb2f1545c8c5
* ext.visualEditor.mwwikitext does not have mobile target
* We call mw.libs.ve.setEditorPreference from ArticleTarget
Change-Id: Ifae6e951155c83b13f3111732b0dc500349b1df2
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
This prevents the discard warning from being shown if the user
switches back to NWE then back to VE, as by this point they
have left section editing.
Change-Id: I734684c54a8900aab3332ed8421cb42f7f845738
New changes:
e4c8003 Bring in target 'mode' property from MW
Local changes:
Use upstream Target#setMode functionality
Depends-On: I9d501cb77c714fbd299b5816d302b0bdde7833cd
Change-Id: I2fcda6ca7d82d880101d9ba2a027d4ef066aa238
Transform rules mess up the z-index context, so this
puts the toolbar dropdowns back in front of the content.
Change-Id: I7ba2cf295c83c55e5b1eead3a04760ea53390d37
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