Commit graph

73 commits

Author SHA1 Message Date
Umherirrender e1442aa343 Add phan
Change-Id: I7352036536c1c8415b681f48f3ee0dcec315c035
2019-05-31 14:48:22 +00:00
Bartosz Dziewoński 8ae4925676 Allow switching from WTE to VE with changes in non-RESTBase mode
* Change the query in ve.init.mw.ArticleTargetLoader#requestParsoidData
  so that in non-RESTBase mode with wikitext it still returns the
  metadata required to initialize the editor, using the backend API
  code added in I1b35b28e428a1f86d2e34d90ddbe73361ce14818. This fixes
  the exception from T222312.

* Introduce new configuration option $wgVisualEditorAllowLossySwitching
  to control this feature. It is enabled by default, fixing T214542.
  We allow it to be disabled because switching in non-RESTBase mode may
  cause "dirty diffs" (non-semantic changes to the wikitext), which are
  undesirable on wikis where users carefully review all changes.

Bug: T214542
Bug: T222312
Change-Id: I58879cba5612002c70c24731306214d2577c2c52
2019-05-30 20:18:53 +02:00
Umherirrender c9c4b68d25 Remove class_exists by ExtensionRegistry check for ConfirmEdit extension
Change-Id: I6ffb1842600316f2a6309a0028e96e75fe75f0c8
2019-05-29 12:10:02 -07:00
Ed Sanders 4a692e762d Special-case redlink URLs to load preferred editor
In general action=edit could be bound to a wikitext-specific
edit link, but in the case of redlinks we can use the
preferred editor instead.

Bug: T223793
Change-Id: Ib0851e9e2ce441ae93311153801e2c3de0a2063d
2019-05-26 17:55:38 +01:00
Bartosz Dziewoński 222ada6a8e VisualEditorHooks: Mark the 'preview' parameter as unsupported
We don't currently support it in NWE. It has a very different design
for previews that wouldn't really do what users expect. Let the old
editor handle this.

Bug: T195914
Change-Id: If0c0312347c212447bd8da7336c80bd4a1cb246a
2019-05-18 19:08:31 +02:00
Bartosz Dziewoński a76d3daf54 DesktopArticleTarget.init: Allow veaction=edit to override namespace settings
Prior to 80bfbfc54b this worked by
accident, and with a number of bugs depending on your settings (see
T219457). It turns out that Wikipedia users have invented various
workflows that depended on this bug (mostly involving sandbox pages in
namespaces where VE is not enabled). Restore it as a supported
feature, and in a way that avoids the problems it previously caused.

Bug: T221892
Change-Id: I62714b6f2905efd1d1b34c7a13b9917cb6c609fc
2019-05-14 00:18:47 +02:00
Bartosz Dziewoński e48e7d95ec VisualEditorHooks: Use isVisualAvailable() when changing tabs/editsections
Change-Id: I93f00005eb3f58302d46c14259016c4cee625a18
2019-05-14 00:18:35 +02:00
Derick Alangi cf663a40b4 Replace usage of deprecated ConfigFactory::getDefaultInstance()
Is replaced by MediaWikiServices::getInstance()->getConfigFactory().
Also, did a few minor cleanups where necessary such as; objects are
passed as references by default etc.

Change-Id: I42cd242ebdbc0b091a99e771289020d498bf2bba
2019-05-04 22:02:29 +01:00
Dayllan Maza 96de1353d3 Remove block notice tracking
This is a clean up after collecting the necessary data related to
blocks and how often users see the block notices

See: https://phabricator.wikimedia.org/T189724

Bug: T214214
Change-Id: I532a0cd95009109ba25caa8dd31badd5c1900da7
2019-04-23 11:31:37 -04: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
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
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
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
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
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 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
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
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
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
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 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
Ed Sanders 7eb836adbc Update VE core submodule to master (7420443fe)
New changes:
a273ba69c [BREAKING CHANGE] Implement a SourceConverter

Local changes:
* Use SourceConverter
* Handle `this.doc` being a string in source mode now

Bug: T203114
Bug: T203156
Change-Id: I7bce7b57668e0c1dd511803a54178ae69694a86d
2018-09-14 11:42:34 +01:00
Bartosz Dziewoński 39208b7d40 Update VE core submodule to master (2859146e5)
New changes:
fa5d35054 Only re-use session token if docname matches
58d7cd280 Localisation updates from https://translatewiki.net.
d0716d8e7 Update files generated with new l10n language 'my'
2cc7a4423 Create unit tests for sequences
873fdd01e Upstream horizontalRule sequence and fix command

Local changes:
* Register unit test file for sequences
* Remove duplicate horizontal rule sequence

Change-Id: Ibc65cf5c086428bb0d13c8e2f2de5819e1e23d43
2018-08-14 09:20:07 +02:00
Kunal Mehta 53f8f32895 Don't use PAGE_IMAGES_INSTALLED
Bug: T200381
Change-Id: I0b9725fa4b3c4ce4fbb1004cfd3570ba39865fc1
2018-07-25 16:19:09 -07:00