Commit graph

107 commits

Author SHA1 Message Date
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 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
Bartosz Dziewoński 70ae5ca11d Assume 'redirect=no' for all page views with 'veaction', not just 'veaction=edit'
Bug: T181110
Change-Id: I7e22586d1b9bc02fae6dc0536d2c7efde77632dc
2018-11-02 12:00:22 +01:00
Bartosz Dziewoński a4666b3bea Update VE core submodule to master (caf188be0)
New changes:
a2dff3032 DesktopContext: Don't rely on selection#getDocument
4c1cc1640 Basic test for WindowAction open/close
0ab1e754c Update OOUI to v0.29.3
a8d96b850 Localisation updates from https://translatewiki.net.
b4fa3d230 ResizableNode: Add test for updateSizeLabel
caf188be0 TableNode: Test basic mouse events

Bug: T208228
Bug: T208382
Bug: T208515
Change-Id: I0db7b5e874ad6b23dad1f29bb1a58e126fea7a48
2018-11-02 08:52:57 +01:00
Alangi Derick 4fa5bb7c21 Fix phpDoc reference tags in VisualEditor
Should be "array" instead of "Array".

Change-Id: Ibdd4666e5cbab5a1ef0ceb8d52ffbd36390bba69
2018-10-31 19:05:59 +01:00
Bartosz Dziewoński 9e47873a65 Update VE core submodule to master (236effcd7)
New changes:
0e923fe1b Use initClass in test class
900962720 Add ve.deepFreeze for detecting inadvertent data modification during testing
0761cd90c Localisation updates from https://translatewiki.net.
0e44545b7 Update .gitignore
82b6b80bb Use consistent method for finding nearest cursor offset
0b604de30 ve.ce.TableArrowKeyDownHandler.test: Remove eww gross FIXME

Bug: T202359
Change-Id: I73c46edfbf66a0c76bc719010c017ef71670931b
2018-10-30 00:50:37 +01:00
jenkins-bot a022a27a30 Merge "Simplify handling of messages for section edit links" 2018-10-29 11:02:37 +00:00
jenkins-bot 89b061455d Merge "Use the right localisation message for edit tab on Vector skin" 2018-10-29 11:02:34 +00:00
Bartosz Dziewoński ac45e919ab Update VE core submodule to master (d89186159)
New changes:
d89186159 Add F2 keydown handler

Bug: T172042
Change-Id: I3bc2bb33bec2f5f08f26af49ab8b72e436dbe4cf
2018-10-24 20:51:36 +02:00
Ed Sanders ad3fc3c12d Add missing ce.Selection tests from core
Change-Id: I95f19bbf12e92b7062f3a332dc6c3d68cc6af492
2018-10-23 23:19:09 +01:00
Ed Sanders c895c60907 Add Promise.prototype.finally polyfill and restore failing tests
Change-Id: Ia6cdb85d33d2b3e0e2e868838defaa39ae60572a
2018-10-23 22:56:34 +01:00
James D. Forrester e4724b3f26 Update VE core submodule to master (6c288b44f)
New changes:
7c9fe89b8 Simplify ve.test.utils.runSurfaceHandleSpecialKeyTest API
0e3c75e66 Add more tests to LinearArrowKeyDownHandler
058362830 LinearArrowKeyDownHandler: Test Selection#extend fallback
8c6617d90 Keydown test refactor
91a909d63 Assert defaultPrevented state in KeyDown tests
003dacf3b LinearDeleteKeyDownHandler: Test shift+delete
1872158c5 LinearDeleteKeyDownHandler: Test delete next to link
b2af2a2c3 LinearEnterKeyDownHandler: Add more tests
4e5efa956 KeyDownTests: Remove unused constructor calls for all static classes
1cafb7328 KeyDown tests: Add tests for missing cases to cover tab/escape/enter
58af8d497 Add tests for ve.ce.AnnotationFactory/NodeFactory
617bc24a4 Delete unused ve.ce.modelChangeFromContentChange
50704fa1c Keydown tests: run asynchronously
af9a01b97 Use native promises instead of jQuery promises
df212669a Localisation updates from https://translatewiki.net.
f6af901dc Fix test in Chrome 70
9cc6dae7e Remove broken checks for DM code coverage
ce3a9199a LinearEnterKeyDownHandler: Add test for edge case
0a9dd3636 Remove false coverage of TableNode/TableSelection code
16679a3c0 Remove setupToolbar from DummyTarget to avoid false code coverage
7ac88df77 Basic tests for getClientRects in ve.ce.Selection and FocusableNode
78f14ac1f ve.ce.Selection: Add getDirection tests
7ec7efff0 KeyDown tests: Remove unnecessary setTimeout
26e022d23 KeyDown tests: Un-nest functions
df1e0af6c KeyDown tests: rename defer -> then
f03a9f90b Allow ES6 in tests
0ee55022b ES6 eslint follow-up
6c288b44f ve.ce.Surface tests: Trim when asserting expected text

Local changes.

Bug: T207077
Bug: T207078
Bug: T207079
Bug: T207080
Bug: T207083
Bug: T207654
Change-Id: I2e1f664d6f657e2ac26a271f401dc790c2a8b193
2018-10-23 11:49:34 -07:00
Bartosz Dziewoński 62273183a8 Simplify handling of messages for section edit links
Change-Id: I5b84fc3863747b4d092a7025475730bb28efeff2
2018-10-13 03:16:53 +02:00
Bartosz Dziewoński e048c3e188 Use the right localisation message for edit tab on Vector skin
Bug: T206892
Change-Id: If9494be10c684c1d8892a990dd7ba9c68caa4b69
2018-10-13 03:16:53 +02:00
Nasty 124addddaf Fix parse wikitext fragment in paction wikitext.
Whenever wikitext content is inserted by the hook `EditFormPreloadText`,
it is always parsed to visual editor markup even when in wikitext mode.

Bug: T206838
Change-Id: I56f0fb9d4e1519af01155c35d4d0068076de4600
2018-10-12 19:17:29 +00:00
Bartosz Dziewoński e354092417 Update VE core submodule to master (f9afaa3e4)
New changes:
3931cc33a Update OOUI to v0.29.1
5bcab0073 Move node-specific code into rebaser/
8aa80d88b Remove ES6 support for async/await
2536870f9 Separate files for protocol and transport server
b443b7a4f Update OOUI to v0.29.2
70b3ec210 Minor cleanup of ve.ui.MediaSizeWidget

Bug: T206236
Change-Id: Id3bbcd1a9ccb1563e4feb3572aa8f51932677693
2018-10-09 11:06:23 +01:00
jenkins-bot 542004dcb9 Merge "Require Parsoid HTML 2.0.0, and handle its <audio> tags" 2018-10-02 20:47:59 +00:00
Ed Sanders d5d23ee4be Require Parsoid HTML 2.0.0, and handle its <audio> tags
Bug: T201081
Depends-On: I6514b9b0a85588c7eaae5e6989789656cfc3253a
Change-Id: I6052dcf3e414d9506ff7ec7a6b5d8f4eeb4a703a
2018-10-02 12:15:45 -07:00
Ed Sanders 327f600ca1 Fix special page override
Bug: T204873
Change-Id: I463cbbbc5b6f284aa2794ceb2652911ef7053c2e
2018-09-19 21:26:49 +01:00
Ed Sanders 164ccecf4d CollabPad: Show current sub-page as separate tab
Change-Id: I15da5a3122e7a0dfeb5131e528efa498a7cd1356
2018-09-17 16:25:42 +00:00