Commit graph

412 commits

Author SHA1 Message Date
Kunal Mehta 70777051ed build: Update mediawiki/mediawiki-codesniffer to 0.11.1
Change-Id: I12e117267450539ca9051b22f4f41040b53889b2
2017-08-16 01:23:51 -07:00
C. Scott Ananian 9ee713d480 Display LanguageConverter markup in VisualEditor
Implement special node types for language variant markup, so that they
display appropriately based on the currently-selected variant.

(Parsoid uses empty elements to represent this markup, so without this
patch anything in -{ ... }- is alienated and disappears.)

A follow-up patch will implement context items and inspectors to
allow editing these nodes.  This patch is basic "read-only" support.

Depends on I4fcdebc2290ec35ba188f4c2e69d578791fbcd67 in Parsoid to
generate the appropriate markup, but this patch is safe to merge
independently.

Bug: T49411
Change-Id: Ie11e9301d2513bfe4a36036481cee9a047f46d37
2017-07-25 15:26:41 +00:00
Ed Sanders cedf3758d2 Update mediawiki-codesniffer 0.10.0 -> 0.10.1
Change-Id: I40707991ff2931593ae44046369f2d7955ff324e
2017-07-25 15:49:56 +01:00
Ed Sanders 602b8b7782 Only enable VisualDiff on VE-supported content models
Change-Id: I71ea11aaed207c4f67cfd69455b90d87e5f14498
2017-07-18 23:09:04 +01:00
Mukunda Modell c14b1c46a9 Set onDiffViewHeader argument defaults = null
As suggested by Bartosz in https://gerrit.wikimedia.org/r/#/c/361938/
Just set a default value but keep the type hint. This should avoid
the logspam while retaining type safety.

Bug: T169132
Change-Id: I1221357746f5d4ba1430bcf0bfe773202484eebc
2017-06-28 16:16:20 -05:00
James D. Forrester 27467c32d4 VisualEditorHooks#onDiffViewHeader: Don't add type hint as the hook sucks
It'd be nice if the hook didn't.

Bug: T169132
Change-Id: Iabe75448bbedebf8164d9c8223a4d59d0281e66e
2017-06-28 20:42:37 +01:00
Jforrester 15c6011875 Merge "Ensure MWInlineImages get the ve-ce-leafNode class" 2017-06-27 17:15:44 +00:00
Ed Sanders c4f93b1411 Ensure MWInlineImages get the ve-ce-leafNode class
Without this class, offset calculations fail and model/view
sync can be lost.

Bug: T167009
Change-Id: Ie7b6551ac5a532949c14122b9ee7584a794af0f2
2017-06-26 12:43:23 +00:00
Ed Sanders 0e6d8d5fff Show visual diffs on DiffPage
Only shown if VisualEditorEnableDiffPage is set, or query
string param 'visualdiff' is present.

Currently:
* All VE javascript is loaded (could be cut down to just DM code)
* The entire Parsoid HTML of both revisions being compared is loaded
* Both Parsoid HTML docs are parsed into VE DM trees and diffed

Bug: T167508
Change-Id: I151fc9bab3d3032f50c8d11be6b54e45a06fcc34
2017-06-16 19:29:19 +01:00
Ed Sanders 574baf2e8e Provide VE-rebaser in MediaWiki as Special:CollabPad
Change-Id: I3ffe0e2b6af43d4018dcd79877f4f27ed7d6a7e7
2017-05-20 19:51:09 +00:00
Ed Sanders 63c36c87da Always prefer wikitext for action=edit on non-SET wikis
Ideally we could use the preferred editor, but this breaks
tab switching to the old editor.

Bug: T165238
Change-Id: I5f5ee5566cdd2080ba7c89d43cf127b457537768
2017-05-15 12:48:30 +01:00
James D. Forrester 7819eda622 build: Enable MediaWiki.Commenting.FunctionComment.MissingParamComment
Change-Id: I29bd2c3dcc3a90a52036ab7e6bf2227af61703d7
2017-05-11 21:20:37 +00:00
James D. Forrester 2a81a95782 build: Enable MediaWiki.Commenting.FunctionComment.MissingParamTag
Change-Id: Ia6d758bebd45d31143a3dfd3357cc4687449a1cb
2017-05-11 08:19:44 -07:00
James D. Forrester 59715b66c2 build: Enable MediaWiki.Commenting.FunctionComment.MissingParamName
Change-Id: Id0b92c026690799db84f53402ce29913754bba0b
2017-05-11 08:19:44 -07:00
James D. Forrester 307a8f0ed7 build: Enable MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment
Change-Id: Id11360a266b5a5269856a9adbf3cd27cda52f178
2017-05-11 08:19:44 -07:00
James D. Forrester 945719f43e build: Enable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
Change-Id: Ib1e607addcb13c8fced2058ef5a80a96c95ff31e
2017-05-11 08:19:44 -07:00
James D. Forrester 9a27f80b3e build: Enable MediaWiki.Commenting.FunctionComment.MissingReturn
Change-Id: I714220880e91583a6e3cc575810fe02e3e822538
2017-05-11 08:19:44 -07:00
James D. Forrester e12651b1c2 build: Enable MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
Change-Id: Ie1c745c4ea6ddaad6d41285ad444e7a91dc48cc9
2017-05-11 08:19:44 -07:00
James D. Forrester 56bfb7828c build: Bump mediawiki-codesniffer to 0.8.0 and make pass
Change-Id: If509e5ba639bcda497fe7898f6eb79265967139d
2017-05-11 08:19:44 -07:00
James D. Forrester f016f3dc9a Un-blacklist the lintid parameter
Bug: T160102
Depends-On: I59a7e0a3e8be32e4689cbf41c4904970902c4dff
Change-Id: Ie0e8d82db2dc3589c58a90a600ac0feb06159ed3
2017-05-02 07:41:11 -07:00
James D. Forrester 314bb053c7 Re-sync tests from VE-core into ext.visualEditor.test
Newly added:
* 'lib/ve/tests/ve.EventSequencer.test.js'
* 'lib/ve/tests/ve.Scheduler.test.js'
* 'lib/ve/tests/ve.Range.test.js'
* 'lib/ve/tests/dm/ve.dm.Annotation.test.js'
* 'lib/ve/tests/dm/ve.dm.TransactionBuilder.test.js'
* 'lib/ve/tests/dm/ve.dm.SourceSurfaceFragment.test.js'
* 'lib/ve/tests/dm/ve.dm.Scalable.test.js'
* 'lib/ve/tests/dm/selections/ve.dm.LinearSelection.test.js'
* 'lib/ve/tests/dm/selections/ve.dm.NullSelection.test.js'
* 'lib/ve/tests/dm/selections/ve.dm.TableSelection.test.js'
* 'lib/ve/tests/ce/ve.ce.RangeState.test.js'
* 'lib/ve/tests/ce/ve.ce.TextState.test.js'
* 'lib/ve/tests/ce/nodes/ve.ce.TableNode.test.js'
* 'lib/ve/tests/ui/ve.ui.Trigger.test.js'
* 'lib/ve/tests/ui/ve.ui.DiffElement.test.js'
* 'lib/ve/tests/ui/actions/ve.ui.ContentAction.test.js'
* 'lib/ve/tests/ui/actions/ve.ui.TableAction.test.js'
* 'lib/ve/tests/ui/ve.ui.DataTransferHandlerFactory.test.js'

Moved:
* 'lib/ve/tests/dm/ve.dm.LinkAnnotation.test.js' (up)
* 'lib/ve/tests/dm/ve.dm.LinearData.test.js' (down)

Ones skipped because they're currently broken:
* 'lib/ve/tests/dm/ve.dm.Change.test.js',
* 'lib/ve/tests/dm/ve.dm.TestRebaseClient.js',
* 'lib/ve/tests/dm/ve.dm.TestRebaseServer.js',
* 'lib/ve/tests/dm/ve.dm.RebaseServer.test.js',
* 'lib/ve/tests/init/ve.init.sa.Platform.test.js',
* 'lib/ve/tests/ui/dialogs/ve.ui.FindAndReplaceDialog.test.js'

Change-Id: I8343a67ffdb7255710e70bb9c822b9b006ae5aa7
2017-05-01 15:24:56 -07:00
James D. Forrester 84ec8739e3 Update VE core submodule to master (3b8a164a3)
New changes:
c61044a89 tests: Cover LinkAnnotation#getFragment()
a18e7bd75 tests: Cover <bdi> tags
4e6b991e2 VisualDiff: Don't describe internalItem changes
572ca6d09 VisualDiff: Don't try to render empty node changes
f794e511e LinkAnnotation: fix getFragment behavior
a5deb2b73 tests: Test rich annotations' describeChange()
88e1493a9 [BREAKING CHANGE] QUnit: Remove all code for counting tests
bbabdc425 Remove eslint:fix
31e6b40ce ve.dm.ElementLinearData.test: Cover getAnnotationIndexesFromOffset
97f7eda77 Transaction#isNoOp: Simple code is simple
dd97c627b MergeCellsContextItem: Make sure we're on a TableSelection

Bug: T163945
Bug: T164199
Change-Id: Iba64f64373e05f2dbe56d07dc9e8a8fe282887a9
2017-05-01 11:31:21 -07:00
Ed Sanders cd8b059e7d Synchronise VE availability checks in frontend and backend
Adds better support for NWE loading on action=edit.

Change-Id: I35208cce0696607377378a1b58d426e914a3ba7d
2017-04-28 17:45:27 +01:00
Ed Sanders fefb76eebc Rewrite logic for choosing initial editor
Expanding from a single if-expression lets us make the
code much more readable, and reveals some minor bugs.

Change-Id: I49e57bfc093e019c837a73eab5c25fdbd14de0af
2017-04-26 12:07:51 -07:00
jenkins-bot babba81a66 Merge "Fix logic for redirecting unsupported browsers to old editor" 2017-04-19 21:45:44 +00:00
jenkins-bot 459dac8de2 Merge "Make onUserLoggedIn() check read-only mode" 2017-04-19 18:03:05 +00:00
Aaron Schulz e7f430e5a0 Make onUserLoggedIn() check read-only mode
Also try to defer the master connection to post-send.

Change-Id: I6c8f5b2e48493cd09de3c93604b3a546d7fa1454
2017-04-19 08:15:06 -07:00
Bartosz Dziewoński 21bd2a5b18 Fix logic for redirecting unsupported browsers to old editor
Browsers that support JavaScript, but that get served a no-JS
experience by MediaWiki (for example, IE 6), would always get
redirected to an URL with &venoscript=1 - even when it was unnecessary
because we're not in single-tab mode, and even when the form was
previously submitted, causing the loss of user input.

Follow-up to 188ec0f5d2.

Bug: T163226
Change-Id: I212baa0f4305559fa6f6abdfa230b76c122d4909
2017-04-18 20:05:25 +02:00
Bartosz Dziewoński ae8b0a1f36 Replace $wgVisualEditorSupportedSkins with a check for required elements
The bare minimum of elements that must be present on the page for
VisualEditor to start and mostly work is:

* '#content' to attach our interface (toolbar etc.)
* '#mw-content-text' to replace with the editing surface
* '#ca-edit' to start up the editor

When those elements are missing (and we expect them to be present,
e.g. we're not on a special page), we print a console warning.

For example, VisualEditor now launches on Timeless and CologneBlue.
It does not launch and prints a warning on Modern and Erudite.
(It is actually possible to edit and save pages on CologneBlue,
although various pieces of the interface look funny.)

This does not change which skins we claim to support: these are still
currently only Vector, MonoBook and Apex. But it allows third-party
skin developers to more easily test the editor and fiddle with their
CSS to make it look right.

Bug: T161373
Change-Id: I97c786f3c8c795c238b10bef332a129ea26f86c2
2017-03-29 18:13:05 +00:00
David Lynch 217640624a DesktopArticleTarget: Make the waiting module list extensible
So that GlobalCssJs and other extensions can hook in.

Bug: T156899
Change-Id: I045c7b045ce28047298b28a05e77ef27749c1ee1
2017-03-16 17:48:03 -07:00
James D. Forrester c07a6df74c Don't load VE or NWE on lint-targetted pages (until that works)
Bug: T160102
Change-Id: Ibb364ff2d89975d5907fa887cca666eee6e78d37
2017-03-15 14:23:17 -07:00
Ed Sanders f51d86df20 Update VE core submodule to master (8211ebc70)
New changes:
c99e7f0b6 Diacritic insensitive search in find & replace dialog

Bug: T154195
Depends-On: I95eb851c10a44e18382a6a4a0cb22559db6752b7
Change-Id: I6b74fc3dbaa27de67a565a3c2c6bf8a951b24364
2017-02-28 16:30:22 -08:00
James D. Forrester 667dc5231b Allow the signature button to work in NWE as well as VE
Previously we were only letting the button work in VE-enabled namespaces,
which means that on namespaces where you can use NWE but not VE (oh, you
know, most of them) the signature button was always disabled, which was
somewhat discombobulating.

Bug: T159211
Change-Id: I4ffffb3a7e14df78a45a6e3afa49718c0329ca55
2017-02-28 13:38:26 -08:00
James D. Forrester 3302ba9203 Update VE core submodule to master (c1884680a)
New changes:
778dd0709 Destroy unicorns properly when cursoring to another branch node
2877cbbbc dm.Document: Make tree validation stricter
342a71e05 Update OOjs UI to v0.19.1
d2df4b6d4 Explain that Escape/Ctrl+Enter can be used to cancel/confirm a dialog
d978507f0 Move platform handling from CommandHelpDialog to CommandHelpRegistry
4dbceb403 Honorably discharge ve.dm.DocumentSynchronizer
0eb0e4214 Localisation updates from https://translatewiki.net.

Bug: T157019
Change-Id: I5066b1d2c60e116bc3b80b9a8242a72db243d8cf
2017-02-09 08:46:29 -08:00
Ed Sanders 1d7f929a91 Update VE core submodule to master (139bdf7)
New changes:
d79138b Overwrite selected content when pasting via DataTransferItem
3c4737f Ensure clipboard is never empty text
3b1339e Create dummy platform and target for tests
4d63c8e Pass text as string to insertDocument when detected as plain text

Local change:
Remove VE standalone module

Flow used to use it, but not anymore. Going forward no one should
be using it in MW.

Bug: T154020
Bug: T156302
Bug: T156498
Depends-On: I078c244ef524669da477a43f9b37c847252e5ad7
Change-Id: Ifc4be16269f819890f2dcdddbbdebf9694ad2868
2017-01-29 18:50:47 +00:00
WMDE-Fisch 5852080e74 Add missing return in doc block
Change-Id: Ia1f23c19c3ae26fce45d7ebdaafe91012b1684f1
2017-01-27 11:11:40 +01:00
jenkins-bot a973528d67 Merge "Don't block VE/NWE from loading if 'editintro' is specified" 2017-01-03 20:13:29 +00:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
Ed Sanders fe85ee1ba6 Don't block VE/NWE from loading if 'editintro' is specified
Later we should actually show the edit intro, but that is a
separate issue (T56029).

Bug: T153481
Change-Id: I97622a3d86b975866305aaa745bac51f6b55f217
2016-12-31 15:22:11 +00:00
Alex Monk 807cb6b54e Move NWE URL changes into JS
Bug: T148077
Change-Id: Ic9b94184a48026254cf4a0a812fe6fc8455841b5
2016-11-11 18:31:22 +00:00
Alex Monk 7c80976f5b Remove 'vesection' parameter
Just use the normal section parameter, haven't been able to figure out why VE
would need to be special about that.

Bug: T149958
Change-Id: I9338d0f1498fbb579fa8c340d6e7274c6d48155b
2016-11-05 02:08:13 +00:00
jenkins-bot 64f85a2ef7 Merge "Cleanup dependency graph" 2016-11-02 21:33:45 +00:00
jenkins-bot 65236ae67f Merge "Try to make client and server code to get last editor work the same" 2016-11-02 20:07:07 +00:00
Ed Sanders 0304b7e730 Cleanup dependency graph
* Remove mwsig's direct dependency on core. Everything depends on core.
* Remove language from 'experimental', it isn't anymore.

Bug: T145139
Change-Id: I28b6e95f32d6276956269e24222586f49567e706
2016-10-31 17:26:53 +00:00
Alex Monk 70bf00e9b0 More NWE-SET integration fixes
Also stop calling $skin->getUser() so much, store the result

Change-Id: Ic91a660bc4b97a82f1d2b0bffb55425564696da1
2016-10-13 22:46:16 +01:00
Alex Monk 418bd32217 NWE: Use a different change tag to the visual editor
Bug: T147587
Change-Id: If9b466ff8449ceeb0e71f9d36ea0b4ec8c1bae2d
2016-10-12 01:11:15 +01:00
jenkins-bot c7399b5ab9 Merge "When we have multiple tabs and NWE enabled, set the edit tab's URL to NWE" 2016-09-30 20:49:54 +00:00
cenarium 0dfadc057d Use RecentChange::addTags rather than ChangeTags::addTags
To avoid consecutive DB writes on changetag table.
See I8df2fd983c12632337e8d2922fa357808482338c

Change-Id: I246b26ff1506b0ba82ef4eb08e06e3ef59ff8cad
2016-09-28 00:33:48 +02:00
Alex Monk dd1e4cf8fb When we have multiple tabs and NWE enabled, set the edit tab's URL to NWE
For middle click/ctrl+click

Bug: T146323
Change-Id: I66d75d222cad2183beebd49759a35ee8d85969b2
2016-09-24 23:40:27 +01:00
Ed Sanders e56ed2274d Only show NWE beta feature if enabled in config
Change-Id: Iaa2e3620ab15ece136fe425e61b72f33c8d2f4b4
2016-09-21 13:24:04 -07:00