Commit graph

552 commits

Author SHA1 Message Date
Thalia a5c5bc5116 ve.dm.MWExtensionNode: check for body in describeChanges
Bug: T210257
Change-Id: Iffda3dc0b5b9dc84d294240546193e4b55c45bb7
2018-11-23 12:27:13 +00:00
Ed Sanders 1a3e8a958c build: Use eslint-config-wikimedia v0.9.0 and make pass
Change-Id: Idb57fc12e7822cf17e10dbb726480fc7de0ae199
2018-11-21 16:51:20 +00:00
Ed Sanders 3564006e91 $.extend -> ve.extendObject
Change-Id: I1def4d63c231da153a52a649e7bab584e789b6d1
2018-11-07 16:51:39 +00:00
jenkins-bot 6016cad43f Merge "ve.dm.MWImageModel: Drop back-compatibility with old versions of VE selections" 2018-11-07 11:23:27 +00:00
James D. Forrester 17377ce65c ve.dm.MWImageModel: Drop back-compatibility with old versions of VE selections
Change-Id: I38b309ca240b8305a0b29e11f822e1ad6e1ed3da
2018-11-05 12:44:57 -08:00
Ed Sanders 66972356cf MWTransclusionNode: Change HTML messages to plain DOM
Bug: T208732
Change-Id: I61a958292984586dc90262989ebb6c181f28a605
2018-11-05 16:28:11 +00:00
jenkins-bot 62c81905e6 Merge "Use changed ve.dm.Selection interface, if present" 2018-11-01 13:39:18 +00:00
David Chan 2c3e33b759 Use changed ve.dm.Selection interface, if present
Bug: T208228
Change-Id: Ie2027c4d16e0ac591512e90dbdeea012f11ff875
2018-10-31 12:07:14 +08:00
James D. Forrester c36f3d2214 Revert "Update VE core submodule to master (02f5f0ca4)"
This reverts commit be628a5b7e.

87b20f9b Revert "[BREAKING CHANGE] Do not cache document model data in DM selections"

Change-Id: I47bbf757a4ad227346d3734f6e50d928a2de1409
2018-10-30 15:12:30 -07:00
jenkins-bot b2c529e499 Merge ".eslintrc: Enable and fix "max-statements-per-line": 1" 2018-10-30 15:46:05 +00:00
Ed Sanders be628a5b7e Update VE core submodule to master (02f5f0ca4)
New changes:
ccb4de82c [BREAKING CHANGE] Do not cache document model data in DM selections

Bug: T208228
Change-Id: I564399ad864751d1690077b45a06e098b5509a93
2018-10-30 08:11:02 -07:00
Bartosz Dziewoński e7fd1ac847 .eslintrc: Enable and fix "max-statements-per-line": 1
I am surprised this was disabled. I investigated this after reviewing
some code by a new contributor which I was certain should have failed
the lint check, but passed.

Change-Id: I5b3c837b8ca3292f6e268b3922443bd9587eadbe
2018-10-30 00:19:16 +01:00
David Lynch 8c2a34b732 Handle mw:MediaLink
Bug: T198511
Change-Id: Ia7fbb9db79c9b776e0cf44b065c03b1aa090da79
2018-10-17 21:43:07 -05:00
David Lynch e2cf367a95 Make RDF attribute splits more robust
Split on regexp for whitespace instead of a single space. Avoids multiple-
spaces causing `'foo  bar'` to become `['foo', '', 'bar']`.

See also: I1f467f51017e2deae30905163bf5e6b07048cecf

Change-Id: Id7a887a20fac99715b79045f01e861b4efe9f2c7
2018-10-02 16:11:58 -05: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 349c2f3638 Avoid jQuery in ve.dm.Model.static.describeChange(s)
Change-Id: Ide3ad119f8c111b78b9adfe4a07079d143070fd1
2018-09-27 20:26:47 +01:00
Bartosz Dziewoński 42ebd10090 Correct some doc comments' syntax
I ran Closure Compiler over the codebase just to see what would happen,
and it printed some useful warnings.

Change-Id: I56d40b11e6d1dd7ce68a5e59da511f66e928647f
2018-09-26 14:49:52 +02:00
jenkins-bot bb6afe3e8b Merge "MWTemplateSpecModel: Factor out getLocalValue, avoid isPlainObject" 2018-09-24 18:48:50 +00:00
Ed Sanders e2a5bfd224 MWTemplateSpecModel: Factor out getLocalValue, avoid isPlainObject
Change-Id: I0fe009c899e8b6f44658253bf5c21c3b767067da
2018-09-24 18:36:31 +00:00
jenkins-bot add7b4d96f Merge "Change type from 'frame' to 'thumb' when resizing" 2018-09-24 16:07:19 +00:00
Ed Sanders 985a94777a Change type from 'frame' to 'thumb' when resizing
Bug: T204185
Change-Id: If40c70a074263b870aee4e5c87c3f4b5e98d0c4b
2018-09-24 15:31:58 +01:00
Thalia bbed4307d7 Separate node classes into individual files
Bug: T205231
Change-Id: I84a6f2f7a842ab44e1f7103c0f288deda0451e79
2018-09-24 12:44:45 +01:00
David Lynch e050bb9ecf dm.MWTableNode: include paragraph in suggestedParentNodeTypes
This allows cleanup of empty paragraphs following block-level insertions to
work.

Bug: T201573
Change-Id: Id537d86c72c01ab2c71d2043e906f4c32ef755eb
2018-09-17 09:26:38 -05:00
Ed Sanders 4ee09f75af Replace Bugzilla numbers with Phab numbers
Change-Id: I0e91d63b3872520b8f66002615967b2cfe235bf5
2018-08-09 15:11:27 +01:00
Bartosz Dziewoński 86f2057c81 Always generate empty wrapper paragraph inside image captions (slugs begone!)
While all of the following are valid in the model:

1. <mwBlockImage></mwBlockImage>
   Image with no caption. Must use the media dialog to insert one.
2. <mwBlockImage><mwImageCaption></mwImageCaption></mwBlockImage>
   Image with empty caption. There is a slug to insert a paragraph.
3. <mwBlockImage><mwImageCaption><paragraph></paragraph></mwImageCaption></mwBlockImage>
   Image with caption with empty paragraph. Nice and intuitive!

(Same for <mwGalleryImage> / <mwGalleryImageCaption>.)

The third option is the most convenient for the user. We should always
generate that when converting documents from HTML and from the editing
tools (MWGalleryDialog, MWMediaDialog/MWImageModel).

Previously, the editing tools generated option 2 if no caption text
was entered, and the converter generated option 2 if there was no
caption node or if it was empty. Curiously, option 1 was never used.

Wikitext for manual testing:

```
[[File:Foo.png|thumb]]
[[File:Foo.png|thumb|]]
[[File:Foo.png|thumb|Caption]]

<gallery mode="packed">
File:Foo.png
File:Foo.png|
File:Foo.png|Caption
</gallery>
```

Bug: T200387
Change-Id: Ie82fb339f6bd8ae1b289235bf5402490722d9a7c
2018-08-01 05:40:57 +02:00
petarpetkovic 50d556e8d2 Make link annotations more flexible
* When ve.ui.MWLinkAnnotationInspector is being initialized,
internal and external annotation inspectors are hardcoded to
new ve.ui.MWInternalLinkAnnotationWidget and
new ve.ui.MWExternalLinkAnnotationWidget. Make this creation
more flexible by creating these inspectors through a method,
which inheriting classes can override.
* In ve.ui.MWLinkAnnotationInspector.getAnnotationFromFragment,
factor out the creation of link annotations, so overriding
classes have the ability to provide different internal and
external annotations.
* In newFromTitle, static method of MWInternalLinkAnnotation,
creation of `element` isn't flexible for reusability with
slight changes to attributes passed to the constructor. By
factoring out the creation of attributes, inheriting classes
can reuse the existing structure and alter the attributes if
needed.

Bug: T195064
Change-Id: I2037464a7be77783837e9810691c8e372c8197c6
2018-07-26 15:12:19 +02:00
Santhosh Thottingal 2eb493bfcf
ve.dm.MWInlineImageNode: Fix undefined data-mw in toDomElements output
Bug: T198941
Change-Id: I52c670dcc1a4dfe03c954b053d344c22e7b48a8d
2018-07-18 16:46:07 +05:30
Ed Sanders 5cdbc17899 Pass video thumbtime to thumbnail metadata request
Bug: T198150
Change-Id: Ic8895c359a92fcc60ac486e3daf86db02599d3ff
2018-06-28 15:52:50 +01:00
Ed Sanders 534b3d66cb Update VE core submodule to master (a1fd90540)
New changes:
71baf1c02 Create an 'htmlMsg' function for HTML messages with HTML or DOM arguments
9a7af223e Use ve.htmlMsg to highlight values in attribute changes
a1fd90540 DiffElement: Refactor describeChanges tests

Local changes:
Implement getHtmlMessage in mw.Platform and use for DiffElement

Bug: T195243
Depends-On: Ib4ad16858e4241d33d018830dbcfded63ff703af
Change-Id: Ib5fa39e4f2f529948354b03a141542e23d169fe0
2018-06-20 12:53:43 +02:00
jenkins-bot 59e59a5fdf Merge "VisualDiff: Don't compare images with different src's" 2018-06-11 17:44:48 +00:00
jenkins-bot c04e934361 Merge "Simplify conversion of images" 2018-06-07 20:51:51 +00:00
Ed Sanders b79c98f1e3 Simplify conversion of images
Assume that images provided by Parsoid will adhere to the DOMspec.

Change-Id: I52eb4f27e6b1e1cd092133c3e27e42021ae83783
2018-06-05 13:05:40 +01:00
Ed Sanders bb6cd33821 VisualDiff: Don't compare images with different src's
Bug: T196343
Change-Id: I99ddce806e044ca427bf01b41d164c89dd2e15fd
2018-06-04 18:49:18 +01:00
Ed Sanders cb36c6ded3 Fix parsing of external links, now Parsoid adds 'external' classes
Bug: T196025
Bug: T188656
Change-Id: I89b8ba378108bde6c8db0144ed306cbc8471111b
2018-06-01 08:47:46 +00:00
Ed Sanders 9386d54be9 Fix template param diff when value is empty string
Bug: T195764
Change-Id: I0bd5fe71996a2ffeaa201e549f8515439c07996d
2018-05-28 14:56:53 +01:00
Ed Sanders eb70a1c371 $.isEmptyObject -> ve.isEmptyObject
Change-Id: I309337fcffce7b1759bfca32215461171e869c5c
2018-05-20 12:00:09 +02:00
jenkins-bot 6cc9e81238 Merge "dm.MWInternalLinkAnnotation: account for ? in fragment" 2018-05-18 18:48:16 +00:00
jenkins-bot 3999f76346 Merge "Use ve.ce.nodeFactory.createFromModel" 2018-05-18 18:27:31 +00:00
jenkins-bot e0e8f84322 Merge "Use CE rendering for invisible templates" 2018-05-18 18:27:29 +00:00
David Lynch 909aecbd26 dm.MWInternalLinkAnnotation: account for ? in fragment
It was failing to properly ignore the fragment if it contained a ?. This
resulted in such fragment-selflinks being considered a link to a wikipage with
a title of their full URL. As such, only consider the pre-# section for ?s.

Bug: T194463
Change-Id: I205f86d2b4abcf91dd6a84e3013e899e953a6842
2018-05-18 19:58:21 +02:00
Ed Sanders 3c1ef8cff8 Simplify valign code with a loop
Change-Id: I90cc74d19b46ea2f5a603b1fd39393debefc8e7c
2018-05-15 11:57:41 +00:00
Ed Sanders 7254fbe2cf Use better align change descriptions
Adds support for align=none.

Also don't show changes from class names.

Change-Id: Ia00a51dd52af73183e98c8a87f4c60ee5380d81f
Depends-On: Ic668454c4b4b069dab46a608530c85a5bb7e7ad8
2018-05-15 11:57:33 +00:00
Ed Sanders d7d4eb3126 Use ve.ce.nodeFactory.createFromModel
Change-Id: I1a826c3c0985ef0d8ad0b669886e29aa021c90c1
Depends-On: I259face33154b795143c8820abdfb6b4a495f141
2018-05-11 17:05:09 +00:00
Ed Sanders c2e16186a0 Use CE rendering for invisible templates
Bug: T170107
Change-Id: I7bce9e7b77ce22953bb0141d81871b53a4f005db
2018-05-11 17:05:03 +00:00
Ed Sanders 478b0bcbb9 Create getters for localised APIs (getContentApi/getLocalApi)
Pass through the current document when available, otherwise
assume the current surface's document.

Also add a getter for getPageName, so that can vary based
on the target document.

Bug: T193856
Change-Id: Ifdc951fdc6a43b924d102e3fcd7e59e52023757b
2018-05-05 14:32:55 +01:00
Ed Sanders 1bd430c9d1 Convert most uses of isForClipboard to doesModeNeedRendering
Depends-On: I0f1b90056e9d1a4fa0e188700604709297593924
Change-Id: I6fa1cde51ffc859b57ab557e3ddf8a76d92bf94f
2018-04-30 16:10:27 +00:00
Ed Sanders 95258a9969 Visual diff: Describe redirect changes
Change-Id: Id31e8399556dab9b47bc1d21c62cb82af3a0e7bb
2018-04-27 21:07:41 +01:00
jenkins-bot 5ae421d715 Merge "Refactor ve.dm.MWTransclusionNode.static.describeChanges" 2018-04-18 07:26:10 +00:00
jenkins-bot bc12e25b35 Merge "MWExtensionNode: Diff mw.attrs" 2018-04-18 07:26:08 +00:00