Commit graph

1621 commits

Author SHA1 Message Date
jenkins-bot
44ce690880 Merge "apisandbox.js - split ParamLabelWidget to separate file" 2021-02-17 00:22:32 +00:00
jenkins-bot
a1a84dcfed Merge "apisandbox.js - split BooleanToggleSwitchParamWidget to separate file" 2021-02-17 00:22:25 +00:00
Timo Tijhof
1605864fb5 mediawiki.action.edit: Convert module to packageFiles
Change-Id: Ib34e55a6a26ee783e3b41659189c236d5148bf0e
2021-02-13 00:07:02 +00:00
Timo Tijhof
6cf36e5ddd mediawiki.action.edit: Fold watchlistExpiry.js into this module
Bug: T274688
Change-Id: Ieaac857a201eaa6d4fb2d7a910ccf45d1792fcf6
2021-02-12 23:56:27 +00:00
Timo Tijhof
a0593248d8 mediawiki.action.edit: Set desktop/mobile target
This module is queued by EditPage for the action=edit interface.

This generic module contains almost nothing and, while this is
disabled on mobile today, its dependency (oojs-ui-core) and
sibling modules (edit.editWarning, and edit.watchlistExpiry)
are already explicitly enabled for mobile on EditPage today, so
most of what one would expect from this module is already
working as expected.

What will start working for mobile action=edit:

1. Edit summmary character limit.
   If you have typed more than 900 of the 1000 allowed characters,
   a countdown from 100 will display in grey text on the right
   side within the input field.

2. Edit stashing ajax.
   Some time before the user submits the form, an ajax background
   request will start pre-parsing the wikitext to reduce latency
   and improve edit timing.

Having said all that, none of this matters in all likelihood since
we don't actually expose action=edit on mobile to users with
Grade A browsers (where this JS would run). On mobile, the
action=edit interface is generally only seen when using a Grade C
browser or when JS failed to load or was disabled.

Enabling this module helps unblock T127268 (to no longer suggest
that this code is unsafe for mobile) and T274688 (to fold the
the other edit* modules that are already enabled on mobile into
this one).

Bug: T274688
Bug: T127268
Change-Id: I953ea0a60ab7cacd174e09fa52288f3e1d811611
2021-02-12 23:31:27 +00:00
Roan Kattouw
03f5f05c50 Add WVUI (0.1.0)
Adding WVUI Wikimedia Vue.js based user-interface library as external resource
in a security-reviewed pre-release. As currently needed for search widget
within Desktop Improvements project.

Bug: T271353
Change-Id: I91db16946e7ea46f69a6b57b116962f77ce3cd20
2021-02-11 17:36:15 -08:00
DannyS712
737020513d apisandbox.js - split ParamLabelWidget to separate file
Bug: T269952
Change-Id: I6900429bf8bd77df6d4b3d4f464e70e16cf45eb7
2021-02-11 02:37:46 +00:00
DannyS712
e9f89cc500 apisandbox.js - split BooleanToggleSwitchParamWidget to separate file
Allows removing WidgetMethods.toggleSwitchWidget

UtilMixin.js is added so that the parameter widgets
that currently call Util.apiBool() won't need to
duplicate the logic

Bug: T269952
Change-Id: I39a1b0fda8eb6fce6b8a2052d25e2e81b6d48dd9
2021-02-11 02:20:52 +00:00
Reedy
c82e4b21a0 Resources.php: Mark some closures as static
Bug: T274036
Change-Id: I72deb0f7795d32216e0f253c53406517cf96c04b
2021-02-07 02:20:26 +00:00
jenkins-bot
39817c1ea3 Merge "Convert Special:Import to OOUI" 2021-02-04 01:48:00 +00:00
jenkins-bot
631d7e45ef Merge "Introduce possibility to override logout link selector" 2021-02-02 22:19:20 +00:00
Piotr Miazga (polishdeveloper)
9b0c4a968c Introduce possibility to override logout link selector
Some skins, like MinervaNeue provide a different structure
for menu. Therefore the logout link can be placed in different
places and might not be a default #pt-logout element.
This patch allows to modify the logout button selector via
SkinPageReadyConfig hook.

Bug: T259200
Change-Id: Id313337c85229a5e8d0aada3a67d722048709597
2021-02-02 21:52:51 +00:00
brandonxlf
1262ca1897 Use OOUI for protection form
Breaking changes:
  * Ids 'mwProtectSet', 'mw-protect-table3', and
    'mw-protect-table-$action' are no longer present on page.
  * Module 'mediawiki.legacy.protect' has been removed and replace by
    'mediawiki.action.protect'.

Deprecations:
  * ProtectionForm::buildForm has been replaced by
    ProtectionForm::addFormFields with backwards compatibility.

Other changes:
  * Expiry is no longer editable when "Allow all users" is selected
  * When "Unlock further protect options" is disabled, the expiry of
    the first section is used for the other sections
  * Legacy form elements added by extensions are added to a separate
    section which uses a blank i18n string as the header
  * Unprivileged users see the expiry selector instead of the expiry
    text input as it has the expiry date

Changes to ProtectionForm.php are based off of
I95d0289acceaa7ede789d5a6ea094fae757af6dc.

Bug: T235424
Bug: T236218
Change-Id: Ib22a3b53c1933e107ef5609bb2262aa44b5abb7a
2021-01-30 00:19:02 -05:00
Ed Sanders
86911aabec Convert Special:Import to OOUI
Also include small style overrides to OOUIHTMLForm with own stylesheet.

Bug: T108792
Change-Id: I77550ff40f51d4a748fed385cddcd70d5b64399e
2021-01-27 04:56:36 -08:00
Ed Sanders
ee4f008be9 Move select file messages from oojs-ui-widgets to oojs-ui-core
These messages are now used by SelectFileInputWidget which is
part of core, not widgets (as it has a PHP version).

Change-Id: I062e12b8dd80b34b3aad54dd65e5026de3c69dbe
2021-01-22 14:52:17 +00:00
Krinkle
34ab93a6b8 Revert "Provide native support to dismiss sitenotice in core."
This reverts commit 14ce139f94.

Bug: T271365
Bug: T259903
Change-Id: I31ed9488297e516920a2183e4311357ffdd098a7
2021-01-06 15:45:15 -08:00
Ammar Abdulhamid
14ce139f94 Provide native support to dismiss sitenotice in core.
This patch adds a private method and other mechanisms to handle
generation of dismiss button for site notices (which are already
generated by core).

It also adds the $wgDismissableSiteNoticeForAnons global with its
default as set in the DismissableSiteNotice extension. The plan is,
however, to deprecate it later.

Native support will streamline the sitenotice processing and helps
towards more optimum default MediaWiki experience. It will also
eventually obsoletes the need for an extension to provide this crucial
button as well as remove the overhead of managing such extensions.

Bug: T262118
Bug: T259903
Depends-On: Ib80fc24c84eb333daa016c9816fdf91cc60d3983
Change-Id: I276325dc55fd475655e0212fc256b95ebb41b276
2020-12-22 08:04:44 +01:00
DannyS712
f6863777cc apisandbox.js - rename UploadParamWidget to UploadSelectFileParamWidget
More informative, since it extends SelectFileWidget
Per code review on prior patch

Bug: T269952
Change-Id: I2a579c3b48822f34b378addc586d3cff1e789a48
2020-12-16 17:32:25 +00:00
DannyS712
6f1515ee28 apisandbox.js - split UploadParamWidget to separate file
Bug: T269952
Change-Id: I13b05f91b008cf31c70ff26b6f29889c42d08fc1
2020-12-15 23:04:01 +00:00
jenkins-bot
b1f69cc6dd Merge "Merge mediawiki.special.undelete into mediawiki.misc-authed-ooui" 2020-12-15 22:37:13 +00:00
DannyS712
1473989a35 Merge mediawiki.special.undelete into mediawiki.misc-authed-ooui
Keep the former as a deprecated alias for now

Change-Id: Ib6fb6493ad5f7b2f3aae5607a5a94c0fd0738a0a
2020-12-15 21:41:03 +00:00
jenkins-bot
773c223ac4 Merge "mediawiki.action.edit: Move module files to their own subdirectory" 2020-12-14 23:52:31 +00:00
jenkins-bot
04fb8689b4 Merge "apisandbox.js - split OptionalParamWidget to separate file" 2020-12-14 23:45:39 +00:00
Timo Tijhof
9ba5c1dd5b mediawiki.action.edit: Move module files to their own subdirectory
This makes it easier to understand which files belong together,
which ones can "see" each other, and to find the files through
code browsers and text editors without having to look up
in Resources.php.

Bug: T193826
Bug: T270141
Change-Id: Id87c11f66cbd8c699c9bb01261523f2500df718d
2020-12-14 22:52:25 +00:00
jenkins-bot
17c9533b45 Merge "Split mw.Feedback.Dialog class into its own file" 2020-12-11 20:01:41 +00:00
DannyS712
7ccfddc050 apisandbox.js - split OptionalParamWidget to separate file
Bug: T269952
Change-Id: I43b71ddfa59d47fd27f1840b7728e9c42b795965
2020-12-11 18:32:03 +00:00
DannyS712
6f1b9b326e Split mw.Feedback.Dialog class into its own file
Independent of the rest of mw.Feedback, cleaner/clearer
to define separately.

Change-Id: Iac12ea3764472fd2e65ee15e6907c383d1011c12
2020-12-11 18:09:47 +00:00
Arlo Breault
a6c769e976 Share Parsoid's media styling with content
Since the legacy parser will also be emitting the new media structure
that requires these styles.  For now, the feature is only shipped by
default when $wgUseNewMediaStructure is enabled.

Bug: T51097
Bug: T266148
Change-Id: Id20d716ce145e0bae37621fd6e218a793b5332ae
2020-12-11 11:47:00 -05:00
Petr Pchelko
76d200b83f Add baseline MW REST API client for frontend
Bug: T268680
Change-Id: Ib09bf6b1e8cbfb3c51cfed24fc2e1e5bfc14a6eb
2020-12-09 23:05:15 +00:00
jdlrobson
384939260d Deprecate mediawiki.toc.styles
The only known usage is Cargo skin.
Note, that Minerva references the module but only to remove it from
the page. This is removed in 0e61c55ea.

Follow up to db3c8ea16b

Bug: T252774
Change-Id: I05d79f073f5303b036e47c2a0b37e9bfbaf0d2d1
2020-12-09 16:42:26 +00:00
jdlrobson
63c4125a29 The mediawiki.skinning.content.externallinks styles are moved into ResourceLoaderSkinModule
Going forward all skins will have a single ResourceLoader module
defining their styles.

This deprecates the module moving its functionality into ResourceLoaderSkinModule.
Skins can continue to get those styles by enabling the new feature in their
main module.

Bug: T267577
Change-Id: I27c9f2c6ed9e4014afb231f690190c67b03b5d02
2020-11-23 11:26:01 +00:00
jdlrobson
db3c8ea16b Add new 'toc' feature to ResourceLoaderSkinModule
The table of content styles will now be loaded on all pages rather than
just pages which have it. This will lead to less stylesheet fragmentation
across page views.

Skins in WMF production were updated long ago to automatically opt
into new features so will automatically gain this module:
I98b7e49b8a3bcba31284385d2f45e0164df2fbb4
I50afd035360ff2eccd5a934a02a218d093f9583d
I5b3920ae6e98111582b93e60a2b9950c478bff7d
If9283742a83ecfbe8c4246e3624022a56be8f161
If9ae25c41b91a8b47c154f0fd98984eac526654f

Skins that are using ResourceLoaderSkinModule with opt-in approach or
the existing mediawiki.skinning.interface, will automatically get these
new styles. Skins that are use neither of these mechanisms will need to
be modified if they wish to retain the collapsing functionality of the
table of contents. As of now, I am not aware of any such skins.

Note in a follow-up, the mediawiki.toc.styles module will be marked as
deprecated in 1.35. This is done separately to allow WMF caches
some time to roll over to the new code first.

Bug: T252774
Change-Id: Ie28b7e732664eb332be795d7e33cd9a227c21370
2020-11-16 20:33:05 +00:00
jenkins-bot
e836dfa404 Merge "Support the WebRequest / WebResponse SameSite behavior on the JS side" 2020-11-10 03:08:10 +00:00
jenkins-bot
b8c277c932 Merge "Add API validator for titles" 2020-11-07 00:22:42 +00:00
Gergő Tisza
84e9702349
Add API validator for titles
The ISMULTI logic is copied from UserDef.

Change-Id: I794e2277c462b86cb5c3888d1ba509b11fad62aa
2020-11-06 14:09:04 -08:00
Bartosz Dziewoński
9c02f572bc mediawiki.action.edit.preview: Add versionCallback to improve startup perf
Bug: T266311
Change-Id: I4486ae32cffd803e0c86e8499101cd4a250f7d99
2020-11-04 20:30:14 +01:00
Bartosz Dziewoński
42351616f2 mediawiki.action.edit.preview: Parse 'previewnote' message on the server
It appears that many Wikimedia wikis have complex overrides for
this message. Only a small set of wikitext syntax is supported in
messages that are used client-side [1]. So, parse it on the server.
'packageFiles' and callbacks make this almost convenient.

[1] https://www.mediawiki.org/wiki/Manual:Messages_API#Feature_support_in_JavaScript

Bug: T266311
Change-Id: If3d675ac0232c378feca825e989ea9cd7daee8cc
2020-10-28 03:04:50 +01:00
Ed Sanders
e96d76ea42 ApiSandbox: Use LESS
Change-Id: I5368ff7b43c8eb504b4d1a0699eac0d1a031c447
2020-10-22 10:50:19 +01:00
Gergő Tisza
22c0986019 Support the WebRequest / WebResponse SameSite behavior on the JS side
Provide the equivalent functionality of WebRequest::getCrossSiteCookie()
and the sameSite and sameSiteLegacy options in WebResponse::setCookie()
in mediawiki.cookie.

Bug: T257936
Change-Id: I88a970bb00c672a9c23569ec791be51d07cae59d
2020-10-19 06:50:29 +00:00
jenkins-bot
7702eafcd8 Merge "Add new OOUI messages to the module definition" 2020-10-15 16:55:51 +00:00
Bartosz Dziewoński
5a99685af7 Add new OOUI messages to the module definition
New messages were added in OOUI v0.40.4.

Follow-up to b4edfa6d9b.

Change-Id: Ife0f8bc9ce6c0b3e9dda8ede232ebb586158c4be
2020-10-15 16:06:08 +00:00
Derk-Jan Hartman
7e9cac27d1 LivePreview: Show parse warnings and preview header/warning
Bug: T91167
Bug: T190120
Change-Id: Ifec1e8fa12f1d774bef2722eaf963f1fba4d6223
2020-10-15 14:33:24 +00:00
jenkins-bot
d7280851ec Merge "Add days left messages to changes-lists' clock icons" 2020-10-06 17:14:57 +00:00
Nardog
c40211cf4c LivePreview: Show "Templates used in this preview" when creating a new page or editing a section
mediawiki.action.edit.preview.js now reconstructs "Templates used in
this preview" beneath the edit box if it doesn't exist, so that the list
of transclusions in the preview returned by the Parse API will now be
available to the user even when creating a new page or editing a
section. It also now correctly replaces the label "Templates used on
this page" with "Templates used in this preview", or "Template" if there
is only one, thus more closely matching the default PHP behavior.

Bug: T102286
Change-Id: I9976067d9c3a42d2a93d56da677354a8f352eb2f
2020-10-03 07:30:47 +00:00
jenkins-bot
e3039adc22 Merge "WatchlistExpiryWidget: Move focus to expiry dropdown after hitting Tab" 2020-09-29 05:38:54 +00:00
MusikAnimal
c857e76480 WatchlistExpiryWidget: Move focus to expiry dropdown after hitting Tab
This commit allows the user to tab into the expiry dropdown directly
from the watch link. This reason for this is becuase there is limited
time to get to the popup before it is automatically dismissed.

To avoid redundantly listening to keystrokes for the entire session, the
listener is only valid for the initial keystroke after the popup is
shown.

So the workflow for someone with motor impairment might be to hit
[alt-shift-w] to watch via the watch link, then hit [tab] to jump to the
expiry dropdown and change the expiry as desired.

Hitting [tab] again when focus is on the dropdown will move focus bcak
to the watch link. This is because we can't be certain what elements
follow #ca-unwatch across all skins (also scripts and gadgets could
cause conflicts).

Bug: T261430
Change-Id: Ia7d3f8d963810821f7915690dc62a66c7c778de3
2020-09-28 12:41:03 -04:00
Sam Wilson
070ffce218 Add days left messages to changes-lists' clock icons
Add a new resource module for watchlist expiry behaviour in
changes lists, to add a message when the clock is clicked on
mobile.

Bug: T261415
Change-Id: I621b1571b57686beb9fb5802533b1e70d293bc2a
2020-09-16 12:00:32 +08:00
jenkins-bot
36f8470453 Merge "Make ApiSandbox copyable URL absolute" 2020-09-14 08:56:19 +00:00
Gergő Tisza
987c72388c
Make ApiSandbox copyable URL absolute
These URLs are typically used with curl or a similar tool; having
to manually turn them into an absolute URL is an annoyance.

Change-Id: I3c3229e228e9ccb25c4b1b8642736b7e9d213ff2
2020-09-13 16:57:37 -07:00
jenkins-bot
59dbeee852 Merge "resourceloader: Give SkinModule 'features' option an extensible default" 2020-09-09 22:37:47 +00:00