Commit graph

145 commits

Author SHA1 Message Date
jenkins-bot 6e86365b81 Merge "Add parameter search to sidebar of VE TemplateDialog" 2021-07-16 10:06:15 +00:00
Svantje Lilienthal 066c663864 Add parameter search to sidebar of VE TemplateDialog
Bug: T272481
Change-Id: If044e5d134f1b24f939c4786949e6ca34fb79e1e
2021-07-16 09:48:29 +00:00
Andrew Kostka 9ffdd51f04 Show ellipsis when sidebar parameter names are too long
Bug: T285044
Change-Id: I6bf53ec4d6d45888ed7e9ba1d67848e41224de63
2021-07-15 17:35:42 +02:00
Thiemo Kreuz eb1f1e28a3 Make new template editor sidebar items actual ButtonElements
Actually reusing this OOUI mixin gives us a lot of well
developed functionality we need anyway. Most notably proper
event management, e.g. click events.

The number of CSS properties we need to override is managable,
I would argue. Let's see:
* Our buttons are not inline-elements, but should use the full
  width.
* No focus-border left and right for the same reason.
* We want much more inner padding.
* We want a stronger hover effect.
* We need to fine-tune the position of the icon. This is
  because of the inner padding.
* Need to get rid of a negative margin that's only relevant
  for inline-buttons.

I currently feel like the benefits are worth living with
slightly more brittle code. Note that we can undo this change
any time because all this is well encapsulated in this new
class.

Bug: T274544
Change-Id: I33f275a958964d49e803e56bf74a6fa961093da1
2021-07-14 13:31:40 +02:00
Thiemo Kreuz 170ca9d58a Reuse generic button widget for elements in the new sidebar
This introduces another generic "button-like" class that can
be reused in multiple places in the new sidebar. The main
change in this patch is the "add more information" button
which is now an instance of this new class as well.

This patch also simplifies over-complicated setup code in
related widgets.

Bug: T274544
Change-Id: I0cfe7675d02fdd5c5dc8d9198bb3f4aec9abf397
2021-07-13 17:23:27 +00:00
Thiemo Kreuz 28049425ec Various design tweaks to the new template dialog sidebar
Still far from being finished, but much closer to the mocks
already.

Bug: T274544
Change-Id: I1feee06e43a4b9c10a2d9443b6d816595bead64d
2021-07-13 13:00:37 +00:00
Thiemo Kreuz 226e2657ef More robust debug container for new template editor sitebar
Before, the new sidebar was hacked in a place where it confused
the BookletLayout logic. This became visible when using the
up/down buttons to move elements in the sidebar.

This new container wraps the new and the old sidebar. It also
uses a temporary color to make it easier to see where one ends
and the other starts.

Bug: T274544
Change-Id: I4e5b40b1d1556886fc85cff9e926a02e4888f032
2021-07-13 09:11:57 +02:00
Thiemo Kreuz 5edf7dac18 Full add/delete support for all 3 types in template sidebar
From now on you can remove and add all 3 types of content from
the new sidebar.

Bug: T274544
Change-Id: If1e04ff503d72cbe9ea07c8036c9e3a0547cc0d0
2021-07-12 10:15:14 +00:00
Thiemo Kreuz a1384f34f3 Add template outline widgets for all content types
The two new widgets are pretty trivial now, thanks to the base
class.

Note there is still no code to delete the widgets. That's also
why you will always see a placeholder widget at the top. This
will be fixed with the next patches.

This patch also renames most of the "…TemplateOutline…" classes
to "…TransclusionOutline…" The reason is that these widgets are
not for a single template, but part of the container widget for
a more complex transclusion (i.e. a sequence of multiple
templates and wikitext snippets).

Bug: T274544
Change-Id: If4219b0b8ad4d1969ab1ec5ec4db0728811bab35
2021-07-12 09:19:06 +02:00
Thiemo Kreuz 2854be165e Move template outline item header into the base class
The icon and the name of the template are now created by the
base class. This is meant to be reused for other elements
that are not templates.

Bug: T274544
Change-Id: I76bbc0e8c0420e9c6357d093d5f5e1651a0c2719
2021-07-12 09:17:30 +02:00
Thiemo Kreuz 1849924eff Rename CSS classes in new template dialog sidebar code
This matches the existing naming scheme better. I also plan to
re-use this class for other types that are not templates.
That's why the name is the more generic "transclusion" now.

This patch also removes a `padding: 2px` that's not that
helpful. We will need paddings later, but need to choose them
much more carfully.

Bug: T274544
Change-Id: I6f0f630da2230b023b3fb065e5ad86d8211bb7b3
2021-07-09 15:29:29 +02:00
Adam Wight cc95ed8ef3 Label for each template in sidebar
Bug: T274545
Change-Id: I1731373a63f96eda0e43fe042746eaed40bfe6fb
2021-06-24 12:50:05 +02:00
jenkins-bot 3fbd568b07 Merge "ve.ui.MWSaveDialog: Tweak margins of checkboxes" 2021-06-21 22:30:23 +00:00
Adam Wight 988cda65dd Template dialog checkbox list
Introduces new widgets forming the backbone of the experimental
template dialog sidebar.

FIXME: `text-overflow: ellipsis` is not working yet, the container
styles need adjustment.

Bug: T274543
Change-Id: Ie81b84be288553343017c4aaf8691c4e266995f5
2021-06-17 08:47:47 +00:00
Thiemo Kreuz 190237ee28 Rename sidebar state to distinguish from multiple transclusion
This dramatically simplifies the "mode" flag in
MWTransclusionDialog. The main reason to touch this code is:
The flag appears like it will be "single" when the dialog
contains a single template, and "multiple" when there are
multiple templates. But this is not true.

What the flag really does is show/hide the sidebar. The sidebar
is needed to be able to create multi-part templates. But a
dialog that already contains multiple templates can be set to
"single" mode (i.e. the user can collapse the sidebar), and
vice versa.

This patch focuses on private details inside of this class, but
keeps the terminology of a "mode" in some places. E.g. the
messages are not renamed to not cause unnecessary trouble for
translators.

Change-Id: Ib029fd48b393d2ab7d7cff6c842789e22989e944
2021-06-09 09:44:08 +02:00
Bartosz Dziewoński 53c59f35f6 ve.ui.MWSaveDialog: Tweak margins of checkboxes
Previously, if the checkboxes were shown on multiple lines (e.g. due
to a FlaggedRevs checkbox), there would be uneven margin at the
bottom. There was a special case to fix this only for the watchlist
expiry not-checkbox.

Change-Id: I006049cf23e6d42519bfa15b7ec30ea1bc5d08ac
2021-06-08 20:16:44 +00:00
Ed Sanders 857014fae9 Support watchlist expiry
Bug: T251348
Change-Id: I017a54784c758c5e97fb640721bd456adc0fbab5
2021-06-08 20:14:45 +00:00
Thiemo Kreuz 621bca1df4 Show redirects as part of description in template search
These are the most minimal (and therefor most stable,
hopefully) hacks I could come up with so far.

Bug: T274903
Change-Id: I28ba414dd34aad756e29400eb656f0942291a923
2021-05-27 12:40:51 +02:00
jenkins-bot 13f8d7db67 Merge "Remove obsolete vendor prefixed properties" 2021-05-18 01:25:08 +00:00
Adam Wight 9cac71676e Invert template search result highlighting
Bug: T275048
Change-Id: I50fc7407b4357e2cea9d5421d0de46a81d39c69d
2021-05-17 14:12:02 +02:00
Adam Wight f89301bedf Optional verbose template search
Renames "Add a template" to "Template Search" in most cases and
provides inline help for the workflow.

Bug: T277028
Change-Id: I3fee87cb89b5044e785596e71ef3f1a18f2694ce
2021-05-10 12:45:12 +00:00
Adam Wight abdbb7d7ff Internally rename container for adding an undocumented paramter
The internal name "more" conflicts with new collapsible buttons.

TODO: looks like TemplatePage has an analogous field?

Change-Id: I10b24758316a6cc3fbd236c77daffa014fcdafc6
2021-05-04 16:23:53 +02:00
Volker E c468f529fc Remove obsolete vendor prefixed properties
With updated basic support, let's remove obsolete vendor prefixed
properties.

Bug: T278670
Change-Id: I13ceec520559745c877588200024ebce16944da1
2021-05-03 08:09:01 -07:00
Adam Wight ded8c40915 Optional feature makes the transclusion dialog bigger
When $wgVisualEditorTransclusionDialogInlineDescriptions is set to
true, the template dialog will use a larger format.

Bug: T273971
Change-Id: Iad3c3f4d65125c83e35414ce15f793f6a1b192ef
2021-05-03 16:53:27 +02:00
Ed Sanders 87ab649e9d Add mw-content-container, mw-body classes to preview
Bug: T272751
Change-Id: I96440806ec9bce28cfb1b833c8fd913ba6770903
2021-02-18 21:33:36 +00:00
Ed Sanders 1ec49384dc MWSaveDialog: Use MessageWidget (inline, warning) to show save dialog warnings
This is the same style that is recommended for form warnings.

Change-Id: I163f5180c66b9eb165a610184b153bb1da99caab
2021-01-20 19:41:17 +00:00
Ed Sanders e20decc77c MWSaveDialog: Remove wrap option from showMessage
This was used when we used to pass API errors to showMessage, but
is now unused by the two remaining users (missing edit summary, and
"press ctrl+enter to submit").

Change-Id: I8a6b4db78d4e451cf3ec85fcdfd8293328aaaa3c
2021-01-16 16:22:23 +00:00
James D. Forrester 688edf1d64 build: Use "Grade A" rules for stylelint
Change-Id: I54b16407450960fefd5522a25cb733853d2f9372
2020-12-01 08:35:03 -08:00
Ed Sanders 5e1e619949 Tweak alignment of save checkboxes
Change-Id: Id48eb28535ecc2decc1f3203ac92237137738f2f
2020-10-27 21:43:53 +00:00
Bartosz Dziewoński adc4346652 ve.ui.MWGalleryDialog: Allow "Add new image" button label to wrap
The interface has enough space for 2 or 3 lines of text.

(On mobile, the button has only an icon and no label.)

Bug: T260074
Change-Id: I50b08029f843e91d10b8c81985f6dfacbb96c8e7
2020-08-11 16:07:13 +02:00
Lucas Werkmeister fd974c25c2 SaveDialog: only allow vertical resize of summary
By default, many browsers permit resizing the textarea in both
dimensions; however, the SaveDialog doesn’t handle horizontal resizing
very well (the textarea is no longer centered and the options don’t
adapt to the new width), so add some CSS to limit the resizing to
vertical only.

Change-Id: I91bf63357237ddc2e3ede8e661480ab0cb48d10e
2020-05-23 11:22:13 +02:00
Bartosz Dziewoński 1846b72998 Remove some hardcoded CAPTCHA support code
While we pretend that the ConfirmEdit CAPTCHA support is added by
ve.init.mw.CaptchaSaveErrorHandler in the ConfirmEdit extension,
we still have a bunch of code here required for it to work.

This commit removes some of it, no longer needed after
I6605017fd31a4f96c529dd0beb69e9f4433cebc1.

Depends-On: I6605017fd31a4f96c529dd0beb69e9f4433cebc1
Change-Id: I41e032fd754927b7ea6cfb767eb9f21b522ccacd
2020-04-15 13:18:47 +00:00
Ed Sanders e3d3e0869d Move checkbox widget creation to mw.libs.ve
So this can be used other VE API users (e.g. DiscussionTools).

Bug: T245222
Change-Id: I1e0e9bb9da53a62f8a20126e579dcd6300bd2376
2020-03-13 18:00:44 +00:00
James D. Forrester 2c77e88d2c doc: Bump copyright year for 2020
Change-Id: I30539877543dc2a57bd1428a00d10ac46d8fc294
2020-01-08 09:13:24 -08:00
Ed Sanders 085764ddd6 SaveDialog: Hide options bar when empty
Since I7f6fd7ee9 it is now possible for the options bar to be
completely empty if the user is logged out. In this case hide
it and only show it again when the character limit needs to be
show.

Ideally we wouldn't have the height change, but it is quite rare
that a user gets to 400 chars and is logged out.

Bug: T228165
Change-Id: Ifbdf352afcbf4e549889e04fdb70fd30ce233aad
2019-07-16 14:28:25 +01:00
Ed Sanders 5461c56380 stylelint: Enforce class name pattern
Change-Id: Ia41a08424f840d353eb7fc213815f7992da4a2ef
2019-01-13 15:14:53 +00:00
jenkins-bot 3d4fabd3de Merge "Move save error messages above save footer" 2019-01-03 16:55:40 +00:00
James D. Forrester 3c293ea00c doc: Bump copyright year for 2019
Change-Id: I8991b97c980d4149f53eb5601036220ef3c0c440
2019-01-01 13:24:23 +00:00
Ed Sanders f2ac575ee2 Move save error messages above save footer
Keeps the more important information higher up the page.

Bug: T72266
Change-Id: Iaf29a5190af5f72c88eb1bfdacce199cd046eee4
2018-12-12 12:53:55 +00:00
Volker E 3949712ec0 TransclusionDialog: Fix removeButton position
Change-Id: I886c64f51fe54483d24c6cfa925b698db7bf4e7e
2018-12-11 16:05:33 -08:00
James D. Forrester 309d05cb38 build: Upgrade stylelint-config-wikimedia to 0.5.0 and make pass
Change-Id: I4c547757ed5a32ff98b1cf2670010db302bd8467
2018-12-03 13:06:59 -08:00
Ed Sanders 2149de7bb0 Fix margin/padding on save dialog enter prompt
Non integer px values were resulting in scrollbars.

Bug: T208947
Change-Id: Ifeefbcc6068b086a3b351706827b34129b7d0227
2018-11-07 13:50:18 +00:00
Thalia 88875b1b8f Improve the gallery dialog layout for mobile
Bug: T203477
Change-Id: I0adc851b71362267d1d06d9a8b5483c1ee114c26
2018-10-12 16:58:48 +01: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
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 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
James D. Forrester ba3e5a3690 MWWelcomeDialog: Shrink the background image by 1/3 so the CTAs show
Bug: T191095
Change-Id: Id1fd76a37d02a9572cc29909409cd53e28ce0bb9
2018-07-05 20:04:57 +02:00
Bartosz Dziewoński b4456cc482 MWWelcomeDialog: Refactor splash image to allow resizing it
We relied on some white space baked into the background-image
to "reserve the space" for the text. If we tried to make the image
smnaller, the text would start overlapping it.

Remove 100px of vertical white space from the image files, adjust
the styles so that text is displayed below the image rather than
overlapping it.

Bug: T191095
Change-Id: I2f19128a2044b3505cdea93c3f587fe62553071d
2018-07-05 20:04:57 +02:00
Bartosz Dziewoński 6840ac4dd1 ve.ui.MWSaveDialog: Remove unnecessary margin after last checkbox
Patch proposed on T196375 by Jack_who_built_the_house.

Bug: T196375
Change-Id: I30548650eab3d14e7c0de29c954ededcfa44648a
2018-06-08 09:57:01 +00:00
David Lynch 110fdf1fcb MWSaveDialog: Display of limit behavior unified with old editor
T190570 (I54d75ab6061de0de79b7a8112eb859a4c8a5e22a) changed old editor's
display of the limit to only show when there's <= 99 remaining. Bring same
behavior into this dialog.

Bug: T194458
Change-Id: I7f6fd7ee95348c39b107131a7e297d158a07c00e
2018-05-19 19:09:57 +02:00