Commit graph

2061 commits

Author SHA1 Message Date
Bartosz Dziewoński aa137ef2ad Move styles that are not theme-wide out of themes/
Reasons why these files should not be in a directory named "themes/":
* They are specific to MediaWiki skins, not OOUI themes
* They are specific to one module, rather than affecting many widgets

The new locations/filenames are consistent with other modules that
have skin-specific styles.

Note that we have one more themes/ directory elsewhere in this repo
(and another in VE core) and that is okay.

Bug: T96704
Change-Id: I70bb61e339aeccb3afea657f665785ceaa091777
2018-10-23 05:04:27 +02: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
jenkins-bot 1afd5651ab Merge "Don't add body attribute to an extension node with an empty body" 2018-10-08 23:16:16 +00:00
Thalia 1d845aab1c Don't add body attribute to an extension node with an empty body
Map nodes with an empty body don't have a body property on their
'mw' attribute; so don't add one when checking if the node has
been modified.

Bug: T206473
Change-Id: I24fb8d5f012c417996c8d420fa25af9d13528d18
2018-10-08 17:29:58 +01:00
jenkins-bot 93523f5a15 Merge "Wrap editPanel & searchPanel in a StackLayout" 2018-10-08 16:17:54 +00:00
Ed Sanders d44e7fb3e8 Mobile target improvements
Change-Id: If55097a45ae812b712a74f41af350bfaa69f6135
2018-10-07 12:47:53 +01: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
jenkins-bot f8ab6b188e Merge "ui.MWParameterPage: multiline inputs for line if newlines already present" 2018-09-13 12:02:47 +00:00
David Lynch d30e6925bf ui.MWParameterPage: multiline inputs for line if newlines already present
TemplateData doesn't always match up with the way the template is being used.
If a field has the `line` type, but is provided with newlines, we should avoid
mangling it by forcing it into a single-line field. As-is, any edit to the
template, even if the user only thinks they touched unrelated parameters,
would cause this.

Bug: T190191
Change-Id: I4f2a0b6c46532dcc268288cb209d0260b18f3ad7
2018-09-12 12:01:03 -05:00
Volker E 40b8c0da5c Replace deprecated 'advanced' by renamed to 'settings' icon
Bug: T190581
Change-Id: Ie598c703ca03adb98ca05ed3ab227aba2b5ab971
2018-09-07 19:46:12 -07:00
jenkins-bot 15df919bc1 Merge "Replace jQuery.grep with Array.prototype.filter" 2018-09-03 15:40:49 +00:00
jenkins-bot 3023ca8e90 Merge "Match width of template lookupMenu to input" 2018-09-03 15:40:44 +00:00
Ed Sanders 222ad828bd Don't assume commandGroup has a demote property set
Bug: T203282
Change-Id: Ic67dcfb2a473559d5e5d457072cda101844fe1e9
2018-08-31 22:20:36 +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
jenkins-bot bf9d3c1b06 Merge "Template dialog: Lazy resize multiline text inputs on first focus" 2018-08-27 20:43:38 +00:00
Ed Sanders 7bf56a3bd4 Update VE core submodule to master (e69a4a07c)
New changes:
3b62827b8 Remove negative margin from mobile context action buttons
694705894 Implement a simple notification system to fill in for mw.notify
461283560 Validate history start when applying/unapplying change

Bug: T202514
Change-Id: I203dc5101bc31988df2d3986da4300a318e5e889
2018-08-25 18:08:48 +01:00
petarpetkovic 30f099382a Replace jQuery.grep with Array.prototype.filter
Change-Id: I912fb68060d88b618cb2a2502417c1bccc5fecec
2018-08-25 00:11:30 +02:00
Ed Sanders 23ec1973d8 Match width of template lookupMenu to input
Bug: T196117
Change-Id: I58909b2f0138b512df03a8990d3c19cb0b184cad
2018-08-24 14:22:00 +01:00
Ed Sanders 0f81aae133 Template dialog: Lazy resize multiline text inputs on first focus
Bug: T134814
Bug: T200834
Change-Id: I3ec84ad01db1ed896c41ac8ef38cce8eddb0b8c2
2018-08-23 17:34:25 +01: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 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
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
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
Ed Sanders efaf98d414 Wikitext surface getCaretPosition: Handle null ranges
Bug: T199484
Change-Id: Ica84a87c7cda7135c062f38d3f5b671d6dc3d049
2018-08-08 18:52:39 +00:00
jenkins-bot 9a3d759c00 Merge "Always generate empty wrapper paragraph inside image captions (slugs begone!)" 2018-08-05 18:23:05 +00: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
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
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