The latter is being deprecated as of I74a9535918e because it was
almost never used intentionally. When module objects are created,
the appropriate context object is injected via setConfig. That is
the one the modules should use.
The context object has a reference to the ResourceLoader object
(although unsure why actually), but shouldn't be used for this
purpose as there could be a 1 to many relationships further down
towards modules.
Change-Id: Icab0f12141a46476618f984d4548a82fdae33275
For a while now, the 'ResourceLoaderRegisterModules' hook is
the last oppertunity to register modules. Therefore, the
isModuleRegistered() check covers everything it needs to.
In addition, at this point modifications to ResourceModules would
be ignored even if it did contain additional entries.
Change-Id: I77714fca0f561f5817a45dd3be5fd8d3ba42f969
These do not vary by user or page, and can thus be loaded asynchronously
via the startup module, rather than blocking rendering and fetching
of modules on all pages.
In a future change, it might be better to go a step further and bundle
these with a module so that they only load as-needed instead of still
on all page views, but this should be an improvement nonetheless.
Change-Id: Icae3712ac5546a90bc7ffd787b0f3285dff6a26f
Remove overkill $VisualEditorSerializationCacheTimeout config setting
and just use a simple constant instead (convention over configuration).
Bug: T203786
Change-Id: I94424088a03a3262fcea30132883a612465c546e
When this code was written in 2013 (1a5bdd5bd2),
the langlinks API did not have a way to return the language names (autonyms).
This has been added in 2014 (4ba3a9aea96ee21c035c69999be23580e23f4e0a).
Change-Id: I70edb846d94b1108b079caf5915532234190da8f
Using DerivativeContext also makes the code easier to read.
getContext() returns an IContextSource, in this interface has no
setRequest() method and this can fail for some kinds of IContextSource.
$view is a ContextSource, which implements setContext().
This also allows us pass in a new context with the right request object,
and also to set the title so we don't have different titles
on $view and the main context.
Change-Id: Ia575cd6163defeb423a542e342034cac5eb6108c
Generating the templatesUsed list is relative slow, and is only
used in an obscure part of the editor, so only generate it when
needed.
Bug: T209078
Change-Id: I1cecdad65b80c4c9b1746e752ea4b41bc0fc0037
Red-link metadata was added to Parsoid 18 months ago.
On long pages evaluating this information is very slow
(hundreds of milliseconds) and completely redundant.
Bug: T64803
Bug: T209078
Change-Id: I5b6c6da588301ed59fb21e1ce930f5b72db48e67
The following sniffs are failing and were disabled:
* MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgParser
* MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle
The following sniffs was renamed:
* MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle
Change-Id: Iabe2a787bae7fe299bed548c0097613ff5493a0d
onDiffViewHeader() method returns a void per "return;" which is valid
from PHP 7.1 and above. This method doesn't return bool per it's definition.
Change-Id: Ifee65dfce3af104d89ba3c91602501da6bbbc20c
Show log extract if the user is sitewide blocked or is partially
blocked and not allowed to edit their user page or user talk page.
The check on the block type is being added to keep it in sync with
what it is currently being done on core.
Bug: T203171
Change-Id: I00ebb5cbcb1ec14e778c2936187cbcebc0829163
* Also make sure block notices have type 'block'.
* Remove old flag for tracking since we'll be using one
from core
Change-Id: I4b66e73c8a4c4dd7bffd7c0239b1d5ec06eed12f
Depends-On: I6bd1c95548616677e1f72ba6bcfc6f2b551c1ca6
When an edit notice is passed through from the API, allow
a type to be specified, and specify type 'block' if the
notice is a block notice.
If VisualEditorTrackBlockNotices config is true, track
when a message with type 'block' is shown.
Bug: T209633
Change-Id: If5fecc2c2c1c39f4b7245b9a215e1120c93b2b22
Tracking is behind $VisualEditorTrackBlockNotices config flag
which is set to false by default. Additional data will be logged
into a different bucket on the client and both metrics will be
considered with their known limitations.
The reason behind this is to get an idea on how frequently blocked
users attempt to edit a page. Similar tracking is being added to
MobileFrontend and mediawiki/core.
Bug: T201718
Change-Id: I51576276b97be0716c2c22348eaa756ffb04fe50
Our behavior is now closer to the core wikitext editor.
This results in two minor changes:
* `<li>` elements are now correctly wrapped in an `<ul>`.
* "View full log" link is now only shown if there are more entries.
Change-Id: I3f30446fca5cab83155ce26ee4e5ab213fc5847a