Commit graph

830 commits

Author SHA1 Message Date
Bartosz Dziewoński 79e16e218f ve.ui.MWGalleryDialog: Improve modification checks
Undoing the changes to an image caption or alt text, or to the gallery
caption, or to the order of images, or removing a previously added
image, will now disable the "Apply" button again.

The following cases will *not* disable the button again, and it is not
feasible to implement them:
* Re-adding a previously removed image with identical options
* Changing any caption to the old value by other means than "Undo"
* Changing image caption or alt text to the old value after switching
  to a different image and then back

Bug: T206534
Change-Id: I7c19600e741211a6ba61837513497facbafc5cef
2018-11-15 22:16:26 +01:00
Bartosz Dziewoński a66f57643c ve.ui.MWGalleryDialog: Update "Apply" button when image added
Use 'change' event instead of 'reorder' to respond to this event.
This also covers removing images now, so delete that code.

Bug: T206534
Bug: T209451
Change-Id: I9eda383be2ca7f02b42814d43e6b42961b9b96e7
2018-11-15 20:56:39 +01:00
Thalia 70c3bc65d9 ve.ui.MWGalleryDialog: Improve how dialog actions are enabled
Enable the Apply changes/Done action if (i) the current contents
of the dialog inputs would change the gallery node or (ii) if the
user has interacted with inputs that alter the gallery caption or
images (including dragging/dropping or removing an image).

Bug: T206534
Change-Id: Ia6c1cc60d4f32ac66778e6973e2d400491f74128
2018-11-13 19:14:33 +00:00
jenkins-bot ef5ad0052a Merge "SaveDialog: Remove scrollable property from nested panels" 2018-11-05 20:46:22 +00:00
jenkins-bot 3f97176f7c Merge "Use upstream AbandonEditDialog" 2018-11-05 18:19:23 +00:00
Ed Sanders 956c28bf56 SaveDialog: Remove scrollable property from nested panels
Scrolling is handled by oo-ui-window-body.

Change-Id: If074b5de859b5a9dbad76d6715739e4d37e68c90
2018-11-02 20:32:23 +00:00
jenkins-bot 74a744327e Merge "ve.ui.MWMetaDialog: Wait for each page to set up (especially 'category')" 2018-11-01 23:02:59 +00:00
jenkins-bot 9ac196777a Merge "Blocked apply if redirect address is invalid" 2018-11-01 22:17:03 +00:00
flutters f847880292 Blocked apply if redirect address is invalid
Extracted extractValue to a separate method
Added checkValidRedirect method to MWSettingsPage
Added errors when redirect address is invalid
Added 1 error message to localisation strings
Added 1 TODO (more precise error messages)

Bug: T74971
Change-Id: I8bcf16e97e5211671759acdf0846243df2c03fc2
2018-11-01 21:20:01 +01:00
jenkins-bot 62c81905e6 Merge "Use changed ve.dm.Selection interface, if present" 2018-11-01 13:39:18 +00:00
jenkins-bot c1871d0216 Merge "ve.ui.MWMediaDialog: Open to the "Upload" tab when dropping/pasting file" 2018-11-01 11:48:46 +00:00
Ed Sanders 1f7b239fbb Reset scroll and tab state when closing dialogs
Bug: T205948
Depends-On: I993455b648b62b97164f55146c75a53da70c322b
Change-Id: I30336caf76e8ff4de4c4dbd3728211c9a58d724e
2018-11-01 04:11:28 +00:00
Ed Sanders eab2b728e9 Use upstream AbandonEditDialog
Bug: T192333
Depends-On: Ib581528363a3fe5461529515835bd7fb1ce66e56
Change-Id: I206366e096aafc02102357648b9f85f879479500
2018-10-31 13:38:31 +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
Bartosz Dziewoński b5e430a3fc ve.ui.MWMetaDialog: Wait for each page to set up (especially 'category')
The initial value for the categories field is set asynchronously
(after potentially querying the MediaWiki API about the categories).

This caused the existing categories to "pop in" after the dialog was
opened (if you were on a slow network and it took more than 250ms to
query their information).

Additionally, it caused the "Apply" button to always be enabled if the 
page had any categories on it (since the categories field was still
empty when extractSettings() was executed).

Bug: T207719
Change-Id: I46475a1eead91707edb8efe8cb7221a734818e16
2018-10-30 20:55:43 +01:00
Bartosz Dziewoński f0d30ad59f ve.ui.MWMetaDialog: Consider category sortkeys when checking for changes
I forgot about them when reviewing 79253bb0c8.
Oops.

Bug: T207719
Change-Id: I11fd396883132a2dfb79ded6f04983fd5b7fbf61
2018-10-30 20:55:43 +01:00
jenkins-bot afb49f7f1f Merge "ve.ui.MWMetaDialog: "Apply changes" is now only enabled after making changes" 2018-10-30 19:29:05 +00:00
flutters 79253bb0c8 ve.ui.MWMetaDialog: "Apply changes" is now only enabled after making changes
Added 5 methods for MetaDialog (documented in code comments)
extractSettings
compareSettings
getAllWidgets
assignEvents
updateActions

Added 2 fields to MetaDialog
oldSettings
widgetList

Apply changes button now is only enabled when there are new changes

Added getFieldsets method to all subpages

Bug: T207719
Change-Id: Id51acf6c754d9a2572811775d83983e6ab9395b7
2018-10-30 19:12:52 +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 af1a898380 ve.ui.MWMediaDialog: Open to the "Upload" tab when dropping/pasting file
Bug: T208286
Change-Id: I1f203b3a9b9401de22420e21f5553c78321cdbf8
2018-10-30 03:07:30 +01:00
jenkins-bot 54abc29ca1 Merge "Improve the gallery dialog layout for mobile" 2018-10-15 10:19:41 +00:00
Thalia 88875b1b8f Improve the gallery dialog layout for mobile
Bug: T203477
Change-Id: I0adc851b71362267d1d06d9a8b5483c1ee114c26
2018-10-12 16:58:48 +01:00
Volker E a5a3d829a9 Update user avatar icon and make use of OOUI's built-in
Bug: T123810
Change-Id: I3ed04d3037836b47706d9f7284eeb9668712bdcb
2018-10-10 18:34:27 -07:00
Ed Sanders bb369a0b48 Wrap editPanel & searchPanel in a StackLayout
Change-Id: Ib069a41c7855647b1cd85546fc83b30d65b27443
2018-10-05 22:17:14 +01:00
jenkins-bot 95eb279cc6 Merge "ve.ui.MWGalleryDialog: Fix setting of expanded/scrollable panels" 2018-10-04 21:45:24 +00:00
jenkins-bot c43f1589d4 Merge "ve.ui.MWGalleryDialog: Switch innerMenuPanel/innerContentPanel" 2018-10-04 21:38:41 +00:00
Ed Sanders 485b257278 ve.ui.MWGalleryDialog: Fix setting of expanded/scrollable panels
There are 4 scrollable panels:
* Image list content
* Edit panel
* Search panel
* Options panel

Remove non-existent 'expandable' property.

Change-Id: Ia0d0a66be8a2bcb243a39ef632151d7fb99486ef
2018-10-04 21:23:10 +00:00
Ed Sanders 61cfce8c32 ve.ui.MWGalleryDialog: Switch innerMenuPanel/innerContentPanel
These two panels were named the wrong way around.

Also change 'inner' prefix to 'imageList'.

Change-Id: Ie1c3e2160c81b898795fb1fd4d0a027e8f06c4d4
2018-10-04 21:22:05 +00:00
jenkins-bot 0a4cee1cd6 Merge "Use correct OOUI hierarchy in gallery dialog" 2018-10-04 20:41:13 +00:00
Thalia f422ae2dcc Use correct OOUI hierarchy in gallery dialog
Make sure fieldset layouts contain field layouts. Also remove
meaningless parameter icons.

Bug: T205615
Change-Id: Ia104cd60ffa9f5d636bee5611f265a2bb5ac0051
2018-10-03 22:22:25 +01:00
Thalia a4f033a1e6 Use correct OOUI hierarchy in media dialog
In the "advanced settings" tab, make sure widgets are wrapped in
field layouts, then fieldset layouts.

Bug: T205615
Change-Id: I141f9954e482f9d5afd84bfa63384b90a2911d00
2018-10-03 21:54:41 +01:00
Thalia 56cd18e674 Refactor media dialog initialize method
Change-Id: Ida7b50a89ab454ba023334cd2203d2e2e6150931
2018-10-03 20:50:36 +01:00
Bartosz Dziewoński 7a18889ddd ve.ui.MWMediaDialog: Remove unused CSS
This rule was being overridden by a more specific rule from OOUI with
the selector `.oo-ui-fieldLayout.oo-ui-labelElement`. I don't think
the margin tweak would be useful.

Change-Id: If6321ba7ea1cfad83f65f137b2a440957bf2fea6
2018-10-02 00:02:03 +02:00
Thalia dc6e7027a8 Make extension dialog done action messages match other dialogs
Bug: T205807
Change-Id: Icd7e4fddcee8687d9c3dbbda144aa0989d659ac8
2018-09-30 21:18:18 +01:00
Bartosz Dziewoński 9cf5515ccb ve.ui.MWMediaDialog: Remove unused widget and messages
* visualeditor-dialog-media-size-originalsize-error
  Unused since 37b3c07b26.

* visualeditor-dialog-media-originaldimensions
  Never used (introduced in 4947420650).

Change-Id: I22f37b457cc6fbac03593fece003e97f4f5a2ccf
2018-09-27 18:31:20 +02:00
Thalia 9813d876e1 Enable the media dialog on mobile visual editor
Also make improvements to the layout, so that the dialog works
in desktop and mobile - most importantly, change from booklet
to index layout.

Bug: T190885
Bug: T118710
Change-Id: I1915d06c9b0e4b7907136e645f60be96e30cc287
2018-09-27 13:21:15 +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
Ed Sanders 985a94777a Change type from 'frame' to 'thumb' when resizing
Bug: T204185
Change-Id: If40c70a074263b870aee4e5c87c3f4b5e98d0c4b
2018-09-24 15:31:58 +01:00
Ed Sanders 76d0b95af3 Re-order MWCommandHelpDialog and promote/demote insert tools
Change-Id: I3ac4e556e06e2ab899d8bc07ca79d847146952e6
Depends-On: Ic12bc1c3ac96a1feb79e277e65aaf2d29af4f03f
2018-08-29 10:51:00 +00: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
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
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
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
Ed Sanders f80b029444 Fix doc in GalleryDialog and add todo
Change-Id: I4e1ad8ec3d7a1c85a600bf1dafc449054c115203
2018-07-09 22:03:52 +01:00
James D. Forrester 3c6ca93b92 build: Enable and make pass no-prototype-builtins
Including a spectacular whoops in MWGalleryDialog.

Change-Id: Id9863f6dc3701cb0df6684380fa5ecac4526d37d
2018-07-06 10:58:18 -07:00
jenkins-bot 43d5e767e8 Merge "De-duplicate and fix updating of file link in media dialog" 2018-07-03 17:27:37 +00:00
Ed Sanders 6bf9210abe De-duplicate and fix updating of file link in media dialog
Bug: T198565
Change-Id: I7d06d3316b317fb85edb9461080f5f2e5cd439fe
2018-07-03 17:59:43 +01:00
Ed Sanders 452545fa2e Fix window target when opening feedbackUrl
'_new' should be '_blank', but '_blank' is also the
default, so just remove the argument.

Change-Id: I8f922b835b2bc14e5641e0ab29bf002b32301490
2018-07-03 17:36:35 +01:00