Commit graph

125 commits

Author SHA1 Message Date
jenkins-bot 9a8a0592de Merge "VisualEditorHooks: Remove redundant $resourceModules check" 2019-04-17 19:03:12 +00:00
Timo Tijhof ff5f688405 DataModule: Use module->getConfig instead of rl->getConfig
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
2019-04-17 17:33:53 +00:00
Timo Tijhof afdd1b5fca VisualEditorHooks: Remove redundant $resourceModules check
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
2019-04-17 15:20:13 +01:00
Timo Tijhof ef36f4b0a1 Move usePageImages/usePageDescriptions from page conf to site conf
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
2019-04-17 00:10:27 +01:00
Timo Tijhof cc599c2e36 init: Bundle wgVisualEditorUnsupportedEditParams with DesktopArticleTarget.init
Bug: T219342
Change-Id: I4b5a048779bd4b957cc5d99c3a7686363ffb3df9
2019-04-16 16:33:53 +02:00
Reedy 5a5af75c85 s/PreferencesForm/PreferencesFormOOUI/
Change-Id: I44a99ef1905c7c438da159d133b956d3488c0092
2019-04-14 01:47:03 +01:00
jenkins-bot 1b2c1425ee Merge "Allow external link pasting to be enabled by config" 2019-04-09 16:05:26 +00:00
James D. Forrester 4df2558910 Hooks: Don't set wgVisualEditorToolbarScrollOffset in RL when 0
We should also move this to packageFiles, but that's more work.

Bug: T220158
Change-Id: I438dc13802d744877921dc612b16cc22b0713e00
2019-04-05 11:42:05 -07:00
Aaron Schulz 1a5fc05dda Avoid keeping excess keys from storeInSerializationCache() in cache
Remove overkill $VisualEditorSerializationCacheTimeout config setting
and just use a simple constant instead (convention over configuration).

Bug: T203786
Change-Id: I94424088a03a3262fcea30132883a612465c546e
2019-04-03 18:34:07 +00:00
jenkins-bot aeeffb912a Merge "Treat ambiguous values in $wgVisualEditorAvailableNamespaces as names" 2019-04-02 15:20:59 +00:00
Derick Alangi 37e978d169 SpecialCollabPad: Remove unused variable $request
Change-Id: Ie5cce0771c2b7f1f5a521d3129deb2063b5cbf5b
2019-04-01 23:08:02 +01:00
Bartosz Dziewoński 018464a096 Treat ambiguous values in $wgVisualEditorAvailableNamespaces as names
The config option can contain either namespace names or IDs.

Bug: T219562
Change-Id: I6b3706ea7e26f69427ffac1603b093bcb8fdbd03
2019-03-29 01:08:03 +01:00
jenkins-bot d41366c452 Merge "Clean up serialization cache code a bit and add more metrics" 2019-03-28 17:49:51 +00:00
Aaron Schulz a56fbba6c3 Clean up serialization cache code a bit and add more metrics
Change-Id: Ib2024026a2b6f42ed0c56479a0cec2a8cbd1e3bc
2019-03-28 00:26:37 +00:00
Bartosz Dziewoński 21e9db7d13 Respect user preference for default thumbnail size while editing
Bug: T69047
Change-Id: Ibf90d290df5634cd89651a427a6aa1c6f9d7a553
2019-03-26 22:15:26 +01:00
Bartosz Dziewoński a5c5257e71 Directly call action=query&prop=langlinks from JS rather than PHP wrapper
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
2019-03-18 23:27:44 +01:00
Bartosz Dziewoński c0ab5133eb ApiVisualEditor: Fix PHP warning caused by unexpected API metadata
Bug: T218464
Change-Id: I272ca718932cb9cd57d121c9f564c64e11f9deff
2019-03-18 23:01:09 +01:00
Umherirrender de8b4b5d29 Use php null coalesce operator ??
Change-Id: I756fa99084cbb86357ac840b3338d296863eecc4
2019-03-12 21:27:47 +01:00
jenkins-bot f501a5238b Merge "Fix return type of ApiVisualEditorEdit::saveWikitext" 2019-03-08 20:50:04 +00:00
jenkins-bot 476ffbba68 Merge "Use DerivativeContext in ApiVisualEditorEdit" 2019-03-04 19:09:19 +00:00
Umherirrender c9a3bf9fa5 Use DerivativeContext in ApiVisualEditorEdit
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
2019-03-04 18:36:47 +00:00
Reedy 2fb0ed0269 Use ExtensionRegistry rather than class_exists
Change-Id: I6e8fb5e5f3a9ef5b8ba4787c43ee1216ea03bd7e
2019-03-02 23:29:09 +00:00
Umherirrender a07ad01594 Use ::class for class name resolution
Available since php5.5

Change-Id: I9392155193275d20a82bde8eb7964d466e190f6b
2019-03-02 23:46:12 +01:00
Umherirrender 8c1eda388e Fix return type of ApiVisualEditorEdit::saveWikitext
Change-Id: I523d8097b39d80fc7082c64009b49b36f8a296a7
2019-03-02 18:04:14 +00:00
Ed Sanders 2092529fb1 Allow external link pasting to be enabled by config
Bug: T129546
Change-Id: I3346c842cf56fb79fb65a8bd7d716c22134636b9
2019-02-27 19:54:55 +00:00
Ed Sanders e3bb0b9e8b ApiVisualEditor: Separate out templatesUsed from metadata
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
2019-02-25 13:01:43 +00:00
Ed Sanders 1890530b89 ApiVisualEditor: Remove red-link cache warming
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
2019-02-22 17:49:11 +00:00
jenkins-bot 8846e65e44 Merge "Support only surfacing part of the document" 2019-02-20 19:06:30 +00:00
James D. Forrester f6a9dc8d85 tests: Register TestModules via extension.json
The 'ext.visualEditor.test' module is no more.

Change-Id: I25e047ca4de7d9082a5a86efa0ea0d403dc1b0fb
2019-02-13 21:55:41 +00:00
Ed Sanders 3269d53632 Support only surfacing part of the document
Bug: T76541
Depends-On: I227a0d704b9b337cff2102d424be9795d6362ed7
Change-Id: Iac71a51c8696434658f24fbb41c8142237bd810e
2019-02-13 19:03:44 +00:00
libraryupgrader 36ef6d856f build: Updating mediawiki/mediawiki-codesniffer to 24.0.0
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
2019-02-06 18:33:13 +00:00
James D. Forrester 5826a6b89c Tests: Duplicate module to test.VisualEditor ahead of next phase
Change-Id: If6e0450ec73051d9b1d9111aed808fee26b45705
2019-02-05 14:16:10 -08:00
jenkins-bot 748d25237e Merge "Remove "return true" legacy behavior from hook handler functions" 2019-02-02 22:37:26 +00:00
Derick Alangi 8d6c7a6648 Remove "return true" legacy behavior from hook handler functions
Change-Id: I18fee692f6cd247c41ffb9b357047a6be0facb11
2019-02-02 21:04:04 +01:00
Derick Alangi 68d196c3e9 Fix PHPDoc comments to the canonical format (@param [Type] [name])
Change-Id: I105af4a02c8823698d3437159eb1886b9a71f76a
2019-02-02 20:50:26 +01:00
Umherirrender 57d00b7197 Improve param docs
Change-Id: Ib8e22c6029cb11635d6fe9cce17775f67a2a589a
2019-01-26 14:50:22 +01:00
Umherirrender e833cabc07 Use RecentChange::getAttribute instead of property access
Change-Id: I9a4250db1fdf6a8a2a34e08701c39cce5852c23b
2019-01-11 20:35:48 +01:00
James D. Forrester 3c293ea00c doc: Bump copyright year for 2019
Change-Id: I8991b97c980d4149f53eb5601036220ef3c0c440
2019-01-01 13:24:23 +00:00
Alangi Derick ca84615538 Fix incorrect return PHPDoc annotation VisualEditorHooks.php
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
2018-12-09 16:26:30 +01:00
James D. Forrester dab9c26c4d Drop EducationProgram hacks, now that it's undeployed
Change-Id: I65030e3e1b5ce006a458cfbe65a97e738a00a4c3
2018-12-06 12:14:03 -08:00
Dayllan Maza ee02653eaf Change rules when displaying block log extract
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
2018-12-05 00:35:38 -05:00
jenkins-bot fc126c1260 Merge "Rename configs for tracking block notices on visual editor" 2018-11-29 00:43:31 +00:00
Thalia 2516753c53 Rename configs for tracking block notices on visual editor
* 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
2018-11-28 15:26:15 -05:00
jenkins-bot 23c6c3b6e0 Merge "Use mw.Title.wantSignaturesNamespace" 2018-11-27 19:31:13 +00:00
Ed Sanders 0d54a62858 Use mw.Title.wantSignaturesNamespace
Change-Id: I60187f0a3eb9cf5d56a4fdaa3401b107758bd8e3
Depends-On: Ib2faa22c429096d545ddb829a6b4025427ad6071
2018-11-27 18:42:44 +00:00
Bartosz Dziewoński c9ddb8b204 ApiVisualEditorEdit: Add a comment to a tiny but important line
Code added in 393807462e.

Change-Id: I0393a68939c8b103f09d4b25585637faeb76090d
2018-11-26 23:11:29 +01:00
Thalia 883e0c23a5 Track when block notices are shown on visual editor
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
2018-11-21 11:22:50 +00:00
Dayllan Maza 3269bb136c Track when block notices are returned on the api
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
2018-11-19 23:02:02 -05:00
Bartosz Dziewoński 155f0d0337 ApiVisualEditor: Reuse core code for showing log extract
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
2018-11-05 22:25:07 +01:00
jenkins-bot 6b022f9aee Merge "Update VE core submodule to master (caf188be0)" 2018-11-03 21:34:10 +00:00