Commit graph

11364 commits

Author SHA1 Message Date
Ed Sanders 8f49bb391a WelcomeDialog: Check at least one editor is available
Bug: T201928
Change-Id: Ibac6cf921fdc3daba2d671d9bd668fa7bcb9e7a2
2018-08-23 14:21:40 +01:00
David Lynch 26f6429702 TemplateStyles support
MWTransclusionNode will preserve TemplateData <style> in its generated content.

Disable TemplateStyles stylesheets in the original page content, and reenable
them when the surface deactivates.

Remaining TODO: if multiple copies of a template with deduplicated styles are
on the page, and the one containing the actual <style> is removed, all will
lose their styling.

Bug: T197563
Change-Id: Ibd8939eef7d8eb532719f4ee0ce200600449ef81
Depends-On: Ia9f2afcdba5456238e3ef444c202c9b0c78838bf
2018-08-22 17:03:27 +00:00
Bartosz Dziewoński 1481f70b9e ve.ui.MWSettingsPage: Fix missing icon (renamed in OOUI)
Bug: T202101
Change-Id: I3ed199269e1f4452739628ae8d51a04fb911cc04
2018-08-21 00:26:01 +02:00
jenkins-bot 9498b6a72b Merge "Export to page using action=submit" 2018-08-19 12:02:48 +00:00
jenkins-bot 564909cbb5 Merge "Store more edit metadata after import" 2018-08-19 11:40:09 +00:00
Ed Sanders cb10316a7b Export to page using action=submit
Change-Id: I0d719905203d24a545d9b7dcea5bb9d032f10a76
2018-08-19 11:25:17 +00:00
Ed Sanders 85b33a9c5f Store more edit metadata after import
Change-Id: Ib6f1a77ef61982ea54de0bfc1ddf1dd78afd4a6f
2018-08-17 15:26:09 +01:00
jenkins-bot e6d89cd1ec Merge "Show signatures in NWE visual diff" 2018-08-17 13:29:41 +00:00
jenkins-bot 4d78073001 Merge "Replace 'settings' by renamed 'pageSettings' icon" 2018-08-17 00:28:05 +00:00
Volker E 07f58084cd Replace 'settings' by renamed 'pageSettings' icon
Bug: T190581
Change-Id: Ie0307ebc16d516463302773ef4226f2ba2dbd16c
2018-08-16 17:00:38 -07:00
Ed Sanders 20662e6dde Fix icons broken by OOUI update
Change-Id: I44edf30dc578787935c0052e8675bfde7fdd746d
2018-08-16 22:41:31 +01:00
Thalia 4a1d52ccb3 Show signatures in NWE visual diff
Parse document with pre-save transform for the diff.

Bug: T184166
Change-Id: Iffc9ed8ba88dcb55bef73f1708118663b0c38068
2018-08-16 21:45:28 +01:00
James D. Forrester 4755d7f1be build: Upgrade eslint-config-wikimedia to 0.7.2 and simplify config
Change-Id: Ib78c51a177b9f4b4764587232c7d32ffcfdd8aca
2018-08-14 11:02:20 -07:00
jenkins-bot 2270987788 Merge "ve.init.mw.MobileArticleTarget: Tweak toolbar items' height" 2018-08-14 17:03:48 +00:00
jenkins-bot ad675d06d7 Merge "Add Converter test cases for captions in images and gallery images" 2018-08-14 17:03:45 +00:00
jenkins-bot 2b43a24eea Merge "ve.init.mw.ArticleTarget: Skip prompt when switching to VE from NWE section editing if unchanged" 2018-08-14 16:09:49 +00:00
Bartosz Dziewoński 2512baa68e Add Converter test cases for captions in images and gallery images
Many of the details of the behavior don't really matter, but
I suppose it doesn't hurt to document them.

We really want to test two things:
* When converting from DOM to model data, a <mwImageCaption>
  or <mwGalleryImageCaption> is always generated, even if
  DOM has no caption.
* Model data that doesn't have <mwImageCaption> or
  <mwGalleryImageCaption> is nevertheless still valid and
  converting it to DOM doesn't fail.

Follow-up to Ie82fb339f6bd8ae1b289235bf5402490722d9a7c.

Change-Id: I0a10351e9c1589afbee76d8a85f869987de3de22
2018-08-14 11:02:09 +02: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
Bartosz Dziewoński 835b68db2a ve.init.mw.MobileArticleTarget: Tweak toolbar items' height
This padding needs to come out to an exact integer pixel value (14px),
otherwise things are off by less than a pixel and look ugly: F24664180

1em = 16px
0.875em = (14/16)em = 14px

Bug: T190596
Change-Id: Ieb292ed14e0b9205d15254667e97613fbf339260
2018-08-14 07:12:51 +02:00
Ed Sanders 5be3be4ba4 Store importTitle in document, and display in sub heading
Change-Id: I431b721d8af3180b78a565e322a45745d06f67a1
2018-08-12 16:13:00 +01:00
Ed Sanders 68f83cab37 Pop pending when API call fails
Change-Id: I633355d48f6e684be09f8bdeed5c1745cdcb43e0
2018-08-11 18:15:14 +01:00
Bartosz Dziewoński a387778ac3 ve.init.mw.ArticleTarget: Skip prompt when switching to VE from NWE section editing if unchanged
Bug: T136267
Change-Id: I30eae20baca2e16fa5f710485eab213edd5c4a08
2018-08-10 18:07:59 +00:00
jenkins-bot c0c94668c9 Merge "DesktopArticleTarget.init: always bind to #ca-edit" 2018-08-09 22:18:55 +00:00
David Lynch e99749aa80 DesktopArticleTarget.init: always bind to #ca-edit
Refactoring in 92c4e23 didn't account for the case where there are multiple
tabs and source mode isn't NWE, which caused the "edit source" tab to just be
a page- navigation that always discarded changes. onEditTabClick handles this
case fine, so just always bind the handler.

Bug: T199655
Change-Id: I3dca87a7a3b0ea88ef0008be89cd1f6007167916
2018-08-09 23:36:08 +02:00
jenkins-bot 083d436a4b Merge "Replace Bugzilla numbers with Phab numbers" 2018-08-09 16:03:32 +00:00
Ed Sanders 4ee09f75af Replace Bugzilla numbers with Phab numbers
Change-Id: I0e91d63b3872520b8f66002615967b2cfe235bf5
2018-08-09 15:11:27 +01:00
jenkins-bot 60982f3369 Merge "Include wpUltimateParam when switching from VE to source editor" 2018-08-08 20:23:16 +00:00
David Lynch 51beff9327 Include wpUltimateParam when switching from VE to source editor
Bug: T199554
Change-Id: I032f822a11840ca16687322bfa051418bc7e9c06
2018-08-08 21:50:59 +02:00
jenkins-bot e171ca96ce Merge "Wikitext surface getCaretPosition: Handle null ranges" 2018-08-08 19:33:14 +00:00
Ed Sanders efaf98d414 Wikitext surface getCaretPosition: Handle null ranges
Bug: T199484
Change-Id: Ica84a87c7cda7135c062f38d3f5b671d6dc3d049
2018-08-08 18:52:39 +00:00
Ed Sanders 8d56212632 rebaser: Use upstream username persistence
Change-Id: Id07b3d829e4662df9c51dcf122a5d050a92bb2fa
Depends-On: I3bd55a910cc306c3c22fe349b6193f5a3f165495
2018-08-07 19:36:32 +00:00
jenkins-bot 68b8bfd92e Merge "rebaser: Fix disable of refs while not supported" 2018-08-06 21:50:17 +00:00
jenkins-bot 9a3d759c00 Merge "Always generate empty wrapper paragraph inside image captions (slugs begone!)" 2018-08-05 18:23:05 +00:00
Ed Sanders 1220efd9e4 rebaser: Fix disable of refs while not supported
Some tools were still showing in the 'insert' menu.

Change-Id: I755e234641623fccd893e78fc3d9973a8a19eb44
2018-08-04 09:41:12 -04:00
David Lynch 5dc09c5cd7 Add horizontal rule sequence (----)
Bug: T199925
Change-Id: I9f76e1e10ff8511252c3b9e5fbe7a9b94dade427
Depends-On: I7a41fa64f2b14ce58aca91feddc791b8648995d0
Depends-On: Ifb7bd4f75aeba38f3ae63fe6ba81cf7fe086461a
2018-08-01 19:28:14 +00: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
jenkins-bot b487c3f9a4 Merge "CollabTarget: Add convert to wikitext dialog" 2018-07-28 16:06:36 +00:00
Ed Sanders 5b043520c0 CollabTarget: Add convert to wikitext dialog
Change-Id: I49841fd17dd106154a2f53df2e051c6dc0cc3910
2018-07-26 10:46:12 -04: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
Bartosz Dziewoński 668ce071fa ve.ui.MWTemplateDialog: Prevent focus changes in the setup process
This is similar to the hack in ve.ui.MWMetaDialog, except uglier :(
We already explicitly focus the right field in the ready process.

I am not really sure why the focus change causes the issue, but
preventing it definitely fixes it. It would make sense if we changed
the value of the field after focussing it (as setValue() restores the
validity flag cleared by onFocus()), but we don't seem to do it.

Bug: T199838
Change-Id: Ia602551ee0b0885cefbd4cb2fc00d569ff42da67
2018-07-19 01:43:31 +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
jenkins-bot db8c585f11 Merge "Apply edit surface jQuery.makeCollapsible overrides to visual diffs too" 2018-07-18 06:36:55 +00:00
Bartosz Dziewoński fc91623b94 ve.ui.MWMediaDialog: Fix confusion between #getSetupProcess and #getReadyProcess
Follow-up to 13675e4a81.

Bug: T185944
Bug: T199841
Change-Id: I2bf08bc0a3684dbfdb9574ea6df0352e8d9d8fd7
2018-07-18 06:30:46 +02:00
jenkins-bot ffaab335ce Merge "Move some styles from mw.ArticleTarget to mw.Target" 2018-07-16 23:16:56 +00:00
jenkins-bot 9dc7d55975 Merge "Fix confusion between #getSetupProcess and #getReadyProcess" 2018-07-16 23:16:53 +00:00
Ed Sanders fbb8837a88 Fix import button events
Change-Id: Iecb6e663cdf2cc53f6053a21707aff1ff2911181
2018-07-16 19:46:14 +00:00
Bartosz Dziewoński 13675e4a81 Fix confusion between #getSetupProcess and #getReadyProcess
The #getReadyProcess method should be used pretty much only to focus
a field inside the dialog after it is opened. It runs after the window
opening animation finishes, so if you add stuff to the window here,
that will be visibly delayed.

The #getSetupProcess method should be used pretty much for everything
else that depends on the opening `data`. It runs before the window
opening animation, so if you add stuff to the window here, it will be
visible while animating it.

Bug: T185944
Change-Id: I71ea5b6e1e1947c1cf8fd749100e854953a8ef3c
2018-07-11 23:47:55 +02:00
David Lynch 9d8d4255cc init.mw.ArticleTarget: make sure renderCategories preserves order
The linkCache fetch can push the categories out of order unless everything is
already in cache. As such, remember the initial order and enforce it after the
promises have resolved.

Bug: T197759
Change-Id: I9ea8d5e642f62c96475d0713f2c79258abb33b19
2018-07-10 12:30:30 -05:00
Ed Sanders f80b029444 Fix doc in GalleryDialog and add todo
Change-Id: I4e1ad8ec3d7a1c85a600bf1dafc449054c115203
2018-07-09 22:03:52 +01:00
jenkins-bot 1d17c089d5 Merge "init.mw.ArticleTarget: sort categories correctly in renderCategories" 2018-07-09 17:50:09 +00:00