* Fix focus and resize/scroll into view after the
captcha has loaded (so after the image has loaded
for FancyCaptch).
* Add margin between input and captcha
* Enable enter-to-submit on captch input field.
* Unify code for simple/math/questy and correctly
render math as HTML (by looking at the mime type)
Change-Id: I10433cefbfea8569674c120dde5b489570e20966
* Do not try to load the editor on protected pages, or if the user
doesn't have permission to edit pages.
* Move the check for required DOM elements after the check for
pages without the editor (T162411) and after DOM ready (T163307).
Bug: T162411
Bug: T163307
Change-Id: I8149694ba8155682701f2cda6ca212d60f446caa
Expanding from a single if-expression lets us make the
code much more readable, and reveals some minor bugs.
Change-Id: I49e57bfc093e019c837a73eab5c25fdbd14de0af
Follows-up 914eb1cde3; reverts the logic to have the label change, but
sticks with new "-current" i18n messages, so the "X editing" instead of
"Switch to X editing"; the old i18n messages are now dropped entirely.
Bug: T162864
Change-Id: Icdad6c5bb06ff86e9b8976840bb1a94b939609a8
Sites like to customize 'readonlywarning' with things that we can't parse.
Instead, use 'apierror-readonly'. The old message is still shown in edit
notices.
Bug: T163455
Change-Id: I592accde17b256ecee27820df12d9d312499f8f7
If we retry and get another 'badtoken' error, something is very wrong,
and trying again and again is probably pointless. This behavior also
matches how mw.Api#postWithToken handles bad tokens.
Bug: T163493
Change-Id: I488fd7e74e37922044491695d6c9025a45531281
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