We were already using it for almost all interactions with the editing
area, except for this code which restores the selection after closing
a dialog.
Bug: T254612
Change-Id: I26d22d9c5d64fe8c861405e65cd4464c349aeac9
Additional changes:
* Removed phan-taint-check-plugin from extra, now inherited from mediawiki-phan-config.
Change-Id: I2a6fcd0a1ebb3c5174e6c6a919d72d4be49a3261
composer:
* mediawiki/mediawiki-codesniffer: 29.0.0 → 30.0.0
The following sniffs now pass and were enabled:
* MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
npm:
* eslint-config-wikimedia: 0.15.0 → 0.15.3
The following rules are failing and were disabled:
* mediawiki/class-doc
* grunt-stylelint: 0.14.0 → 0.15.0
* stylelint-config-wikimedia: 0.9.0 → 0.10.1
Change-Id: I892964b1b124914f76d75173a23aec54baf03257
Using an event introduces a race condition where the extension
adding the listener has to do so before WikiEditor finishes loading.
Change-Id: I5a8dc6f8fd1b1939b5d98307b20ef1fd355cee99
Remove use of mw.loader.getVersion, which I'm planning to remove
from the public API. The only valid use case I found of it (not
in WMF repos) is to check if a module exists, for which one can
use mw.loader.getState() already.
The code path here handles with the 'icon' property of a
WikiEditor "toolbar group tool". In other words, the buttons
you can click in the toolbar to open a dialog or insert markup.
I found two ways to reach this code path:
* For the built-in tools and icons that are part of WikiEditor.
These are all based on OOUI now and no longer use inline styles
with background-image etc., they are class-based instead, with
the URLs and language variants handled server-side by RL.
* For user scripts that register a custom tool and icon.
To try this, copy snippets to the console on an edit page from
<https://meta.wikimedia.org/wiki/User:Krinkle/Scripts/InsertWikiEditorButton>
These pass urls as the 'icon' property and thus don't satisfy
the hasOwn condition in this code. And even if they did, there'd
be no reason for the module version to be helpful to the thumbnail
url the user would have passed.
This line of code has existed with the mw.loader.getVersion() call
since the repository's very first commit in 2010 (9d278e8dee).
The worst that can happen is if there are stil some internal icons
hitting this path, they'll be cached for 1 hour instead of 7 days
(per /w/static.php rules in production). For third parties, there
would be no difference and such static paths have no caching by
default either way (outside WMF).
Change-Id: I6ec29abde0085d04b662b56b5ebcc2bd7fa267f8