This line isn't solely for supporting FF52, that is the order
in which it is called (move after attach, not before),
but that matches all our other widgets, so not sure
it needs commenting.
Change-Id: I6f3cc5687f1e4b995dff700d0765d14de1927d51
mw.storage catches errors, so we won't crash horribly when the user has
localStorage disabled / full.
Bug: T181822
Change-Id: I212994eb535b9a8fb5f6c09deaa10b16c3d7f10e
Accesskeys in this situation are unreliable cross-browser. Firefox won't
trigger the accesskey inside the dialog. We can manually simulate it, via the
existing trigger.
Bug: T121183
Change-Id: Ib919d8b9fcd9324a517037bcc6ef93a26d1488b9
We emit <span id="..." typeof="mw:FallbackId"></span> inside headings
when necessary to provide backward compatibility with pre-HTML5
section ids. These are mostly harmless inside VE --- they become hidden
alienated nodes, which are then safely ignored by Parsoid during html2wt
even if they manage to migrate outside of a heading --- but it's a
little safer to strip them.
Change-Id: I07d0fcf54427ab02d4930cff183d3e5579a99306
Tell browsers we explicitly want spellchecking on the section title. If
unspecified this is browser-dependent, so it was inconsistent.
This won't actually have an effect until the next OOjs-UI release (v0.24.3),
as this was a new feature added to TextInputWidget.
Bug: T179654
Depends-On: Ifdd44ead7d782288aaef0979322f0943f7304835
Change-Id: I588874efcff91c5be03da2fc03c268f883b718e2
We need this hack when visually editing articles, but not in e.g. the
Flow integration. Move it down so that mw.Target has a clean
parseDocument method that can be used by Flow without undesirable
newlines being introduced.
Change-Id: I52bba88b3d33c3d6d16c4cf832f23f970a243abf
Idea being: preload use case is often "load content, maybe with parameters,
immediately save it", so we can treat it as being already-modified for saving
purposes.
Bug: T179063
Change-Id: I35ff04bc9cb5172edf8174832624145973aa1fdb
We were reimplementing (incompletely) the setup from the .init version. Just
call the original, modified slightly so it doesn't over-setup on repeated
calls.
Bug: T151021
Change-Id: I65bd7c5ecf75c478d6babeb13e7fb2a76a9842c8
The whitelist isn't checked for blacklisted browsers,
so if all non-blacklisted browsers are whitelisted,
set the whitelist definition to all (null).
Change-Id: I8ee3569d9d5be2eda9153f1b087c1be385f93d9c
ve.init.Target sets up TriggerListeners based on getSurfaceConfig if there's
no Surface instantiated. As such, loading directly in source mode would have
those listeners present and assuming the document is in visual mode. So, if
there's not a Surface already, we'll assume we're going to get one created
with the defaultMode, and set things up expecting that.
Bug: T153959
Change-Id: Ia0afe32e6b63ea0d3418137ca5c8bc32c009ecfa
* Rename 'deactivate' to 'tryDeactivate' as it may prompts
the user to deactivate.
* Merge 'cancel' and 'teardownSurface' in to 'teardown',
extending the parent method.
* Rename elementsThatHadOurAccessKey to $saveAccessKeyElements
and move teardown to parent class where it is setup.
* Move toolbarSaveButton teardown to parent class where it is setup.
* Cleanup changeDocumentTitle
Depends-On: I9d97614695272dca6936ef6f3461178fcf0368a8
Change-Id: Ie998a04c21f6615b4415edf471310db5edca3b5a
This code is meant to fix up the tabs if wgVisualEditorTabPosition
was changed and we're seeing cached HTML with the tabs in wrong order.
But it seems it has never worked. `$caEdit[ 0 ].nextSibling` is a text
node and obviously not equal to `$caVeEdit[ 0 ]`, and vice versa for
the other case. The logic is actually correct, so let's fix it to skip
over text nodes.
Also, remove a stray 'eslint-enable' comment left over in
a0f934ed26.
Bug: T50017
Change-Id: I23663a9bfcfdbf52918452c878a128e6960b1191
Vector no longer does the silly thing where the tabs are reversed in
the HTML in RTL languages, so we must remove our hack to do the same,
since otherwise it reintroduces the issue it was intended to prevent.
This essentially reverts 2efd4f0061.
Bug: T50017
Change-Id: Ibeaa55bc34899bffab849ea8ad8b127fb5184d43
The default value of target#pageName is wgRelevantPageName
but other targets my override this, or change it dynamically
(e.g. ContentTranslation).
Also remove duplicate setter of pageName in mw.ArticleTarget,
already set in mw.Target.
Change-Id: Iebd1def1d4142978a673afec584a0b663644d176
* Tiny fix to 33dc60838c for PHP variable name
* Bigger fix to properly pass preloadparams in and split them up
Change-Id: I844db115f2563cb9ee1629c30d5f49d1ce58f5bd
This allows the use of the preload and preloadparams query parameters. They
should behave as they do in the old editor, loading substituted content in
visual and source modes.
Bug: T51622
Change-Id: I522fb5b480d17912f6d6116be6aa043ead855b52
Other page state is read directly, rather than passed in.
If we come up with a use case for passing this in at a later
date we can reconsider the best way to do this.
Change-Id: Iee7e608c969776b89dbb38b3b56a5177e48344af
Instead, use getCheckboxesDefinition(), and build our save form
checkboxes from that rather than extracting them from the HTML.
The ability to have non-checkbox fields there is removed, as that was
never intentional and is now impossible.
To avoid transient problems during deployment (old JS code cached in
the user's browser receiving the new format of API responses), the old
property is kept in the API response. We should remove it next week.
Bug: T174613
Bug: T174686
Change-Id: I5bfca5e116fe790302c3b6ac1357e80237fb1ed2
ve.init.mw.Target.static.parseDocument requires that its parameter be
a complete HTML document with a single root tag, otherwise some of its
workarounds break horribly in IE 11 (and possibly Firefox).
Bug: T171600
Change-Id: Iaacf24f7bef40a24230fcfa08e15bab31b1587c0
Implement special node types for language variant markup, so that they
display appropriately based on the currently-selected variant.
(Parsoid uses empty elements to represent this markup, so without this
patch anything in -{ ... }- is alienated and disappears.)
A follow-up patch will implement context items and inspectors to
allow editing these nodes. This patch is basic "read-only" support.
Depends on I4fcdebc2290ec35ba188f4c2e69d578791fbcd67 in Parsoid to
generate the appropriate markup, but this patch is safe to merge
independently.
Bug: T49411
Change-Id: Ie11e9301d2513bfe4a36036481cee9a047f46d37
This stops the welcome dialog from being displayed repeatedly if the user
edits the article multiple times in the same pageload.
Bug: T170983
Change-Id: I8cc5990e9acb1ac09a2d6dd95eef8042c70088c7
Selflinks with fragments aren't actually selflinks, and so shouldn't be styled
as such.
Bug: T170943
Change-Id: Icb67c81327769d09af6bcfe593843d9dd2bcc33c