Commit graph

8845 commits

Author SHA1 Message Date
jenkins-bot
82f5a51309 Merge "Stub threshold: Remove CSS" 2021-09-24 18:02:18 +00:00
Ammarpad
d5e40efb64 Stub threshold: Remove CSS
Follow-up for: I5c9ea04a9deca136bb7210f07200d18f97fd6686

Bug: T284917
Change-Id: Ia465db6232622dcd74088bf2b5f6ba674882d555
2021-09-24 16:47:08 +01:00
Bartosz Dziewoński
d1edf04720 Remove stylelint-disable-next-line plugin/no-unsupported-browser-features
It is causing build failures as follows:

    Running "stylelint:src" (stylelint) task

    resources/src/mediawiki.special.preferences.styles.ooui.less
     33:2  ✖  Needless disable for "plugin/no-unsupported-browser-features"  --report-needless-disables
     35:2  ✖  Needless disable for "plugin/no-unsupported-browser-features"  --report-needless-disables
     48:2  ✖  Needless disable for "plugin/no-unsupported-browser-features"  --report-needless-disables

I don't know why or how they became needless.

Change-Id: I14d9fdcc97b260b1fd67e67349214c7947733324
2021-09-24 15:38:02 +02:00
jenkins-bot
edad7b3b41 Merge "resourceloader: Document reasons for forced downgrades to Basic" 2021-09-24 09:15:41 +00:00
Timo Tijhof
5140e05363 resourceloader: Document reasons for forced downgrades to Basic
Bug: T283726
Bug: T178356
Change-Id: I08f47cea318829c04c1aac248b3a6172b38a51fe
2021-09-24 03:34:37 +00:00
DannyS712
33d542a319 checkboxShift.js: fix @class documentation
Should be "mw.plugin.page.ready" not "mw.plugin.pageready"

Change-Id: Iea0f166d21c738b377948ac88dd6d29ee230f546
2021-09-24 03:00:12 +00:00
DannyS712
2d1c35caca resourceloader: drop some unneeded startup compatibility checks
Remove check for window.JSON, redundant to check for es5
strict mode.

Remove check for window.addEventListener, we also check for
querySelector which is a newer part of the same API.

Bug: T290293
Change-Id: I95e62c7c1ed8f98f9df9e94fef86dda9aa77326b
2021-09-23 23:15:00 +00:00
jenkins-bot
e532630b11 Merge "mediawiki.util: Update addPortletLink to support 'text-wrapper' option" 2021-09-23 22:47:39 +00:00
jenkins-bot
96ad399733 Merge "htmlform: Fix checkmatrix row vertical alignment" 2021-09-23 18:52:11 +00:00
Bartosz Dziewoński
b7b1ea669e htmlform: Fix checkmatrix row vertical alignment
The labels were not aligned with the info icons.

Change-Id: Ife0accc5bf88d486a0ef6ca4e5c2303a251869f5
2021-09-23 18:19:22 +00:00
bwang
d4d7635979 mediawiki.util: Update addPortletLink to support 'text-wrapper' option
- Add Skin::getOptions and Skin::getPortletLinkOptions, which are used
  to provide skin options to mw.util.
- Add SkinFactory::getSkinOptions, which is used by
  Skin::getPortletLinkOptions.

Depends-On: Ib23360e3439abc828404c1de8e0906915ee7d8b6
Bug: T289163
Change-Id: I801e7d583cb0b0c7da51f4da503268be736bb60c
2021-09-23 19:03:36 +01:00
jenkins-bot
62d96c38c7 Merge "Revert "resourceloader: add local variable for mw.loader"" 2021-09-23 02:11:53 +00:00
jenkins-bot
7dbf025e76 Merge "resourceloader: Move mw.loader.getModuleNames to mediawiki.base" 2021-09-23 00:59:10 +00:00
jenkins-bot
9dcdb87f6f Merge "resourceloader: remove return from mw.Message constructor" 2021-09-23 00:54:43 +00:00
Krinkle
28173a23b7 Revert "resourceloader: add local variable for mw.loader"
This reverts commit 0faa22fc6d.

Reason for revert: Gzip is usually (and in this case) more efficient at
natively deduplicating repeated strings when transferring code from
server to client, than is possible through manual abbreviating through
a variable.

Fresnel confirmed this patch reduces JS transfer size by 10B. Not much,
but enough for the optimisation to not be needed.

Change-Id: I4ad22ca1220f33f018a6bc7e3da8389246cf5f9c
2021-09-23 00:45:48 +00:00
DannyS712
220932ef0f resourceloader: remove return from mw.Message constructor
When invoked as a constructor, the created object gets returned
anyway. When not invoked as a construct (eg with
`var demo = mw.Message( mw.messages, 'brackets', [ 'param' ] )`
the `this` value is the global `mw` object, which is unexpected.

Using mw.Message as a method call is not supported, and it
causes other problems (the .format, .map, .key, and .parameters
properties get set on the global `mw` object) but those are left
to be dealt with separately.

This follows-up r89076 (6a408d444c) where it was added for no
apparent reason.

Change-Id: Ie25758f92df0a33e66c266e007a1b81f077a9790
2021-09-23 00:33:07 +00:00
DannyS712
5b8b5bfb84 resourceloader: Move mw.loader.getModuleNames to mediawiki.base
It's not needed as part of the startup code, just for some modules
(in core the only place its used is in the mediawiki.inspect module)
and thus does not need to be defined so early, it can go in the
mediawiki.base module that is an implicit dependency of all
regular modules, where it can be loaded concurrently and take
advantage of the ResourceLoader module caching system.

Also tweak the documentation, the returned array is known to be
an array of strings.

Should have no effect on the functionality.

Change-Id: I18f5fae876a8b90f66b9c555d393169a5525f1af
2021-09-22 23:47:33 +00:00
jdlrobson
6f4b4eb36e Hiding fallback button depends on HTML order
Bug: T291272
Change-Id: Ib164b71e415f85a5976e1dd050586d7f3d0c2ece
2021-09-21 08:44:59 -07:00
Volker E
de9db98b19 mediawiki.widgets: Remove obsolete -moz- vendor prefixed rules
Bug: T278670
Change-Id: Ie0ec0a9b39ede27594e164542414243e010087f6
2021-09-21 05:08:33 +00:00
Volker E
206beaad66 mediawiki.mixins: Remove 2009 Flexbox spec support
Only supported by Android 4.3 as remaining basic supported browser.
Not worth to send down the wire from current usage across our products.

Bug: T278670
Bug: T290935
Change-Id: I3b5fb20b12f4f8d228c10ec8a03661df30426473
2021-09-20 11:36:41 -07:00
jenkins-bot
0e4a564aad Merge "mediawiki.mixins: Remove deprecated .box-shadow() mixin" 2021-09-20 18:09:27 +00:00
Volker E
48cd9551b1 mediawiki.mixins: Remove deprecated .box-shadow() mixin
Deprecated in MW 1.36 and replaced with standard `box-shadow`
properties in all code repositories on our radar since.

Bug: T277819
Depends-On: Id199b33339e417792837384d28ef7f8d125bea60
Change-Id: I4adeb975dbf4e203c9a41d6564b1a68c10094019
2021-09-20 10:35:59 -07:00
Bartosz Dziewoński
10e76de555 Set watch star to half-filled when temp. watched by any interface
The code to set the half-filled state was only included in:
* SkinTemplate.php (used when reloading the whole page, e.g. after
  saving in the wikitext editor)
* WatchlistExpiryWidget (the special dropdown that appears inside a
  notification after clicking the watch star)

If a page was temporarily watched by some other interface, for example
while making an edit with VisualEditor, the watch star would not
appear half-filled.

Bug: T251348
Change-Id: Ib8ccfbbde6c5fecb4a3db0f285893bb419c82c1e
2021-09-20 10:23:44 +00:00
jenkins-bot
47e10b87b1 Merge "mediawiki.Title: Support Unicode characters out of BMP" 2021-09-19 20:49:06 +00:00
jenkins-bot
d019dce161 Merge "mediawiki.feedlink: add mobile target" 2021-09-19 20:17:33 +00:00
Fomafix
9714316ed1 jquery.tablesorter: Reuse existing local variable
Change-Id: I8277c41a948979763ae502a2527ea1bdd2d3b350
2021-09-18 16:36:30 +00:00
Fomafix
7ca4c6365e mediawiki.Title: Support Unicode characters out of BMP
Unicode characters out of the BMP (starting at U+10000) have in a
JavaScript string two UTF-16 surrogates.

On uppercase of the first character of a title this must be supported.

This change also adds test cases to verify this.

Bug: T291321
Change-Id: I88c4ddbd39000aa09455f67ca8435ce704b98bf8
2021-09-18 11:46:18 +00:00
jenkins-bot
55c8edcd23 Merge "Rename diff-related classes for LTR compatibility" 2021-09-17 23:40:28 +00:00
Daimona Eaytoy
25e10bb38a Rename diff-related classes for LTR compatibility
Nothing in the code expects things to be on the left/right, it was just
a naming convention. However, it caused some issues because CSSJanus
flips the attributes in the stylesheet for RTL languages.

So just use more descriptive names that also avoid issues with RTL
languages.

Bug: T290731
Change-Id: I8a383cd1e3981dc8a826ff60eee523d9f71d1d3d
2021-09-17 22:58:44 +00:00
AntiCompositeNumber
6f7255a568
mediawiki.feedlink: add mobile target
Previously, switching to mobile styling in responsive Monobook would show
the feed icon, but loading a page in mobile format would not. This patch allows
the styles to be loaded in mobile or desktop, fixing that inconsistency.

Bug: T291274
Change-Id: I897b85d3e77233b858ee85be263a14e401fe5fd2
2021-09-17 15:15:19 -04:00
Timo Tijhof
65b40721bd mediawiki.confirmCloseWindow: Remove support for custom 'message'
Between 2015 and 2016, all major browsers removed support for this
due to abuse by pop-up ads and such. As such, we're invoking the
client-side wikitext message parser before the onbeforeunload event
can return, but not actually using its string anywhere except in IE11.

Remove this and let IE11 do the same native thing as all other
browsers have been doing regrardless. This is not a breaking change,
because any callers to confirmCloseWindow() passing a 'message' option
will still work and create the same behaviour as before. It just means
that in IE11 the "extra text" message is now ignored the same as it
was in other browsers already.

Browsers correctly understood that virtually the only legitimate use
of this feature was to remind users of unsaved changes, and their
default localised prompt reflects that understanding.

* Update callers to not bundle and pass down a custom message.

* Keep the message bundled with confirmCloseWindow.js for use in
  the trigger() method. This no longer supports the override, but it
  does still need a default localised string there since this method
  uses a prompt() which unlike 'onbeforeunload' has no default.

  I have moved the message parsing down to that method to still remove
  its overhead from the most common code path.

Bug: T283193
Change-Id: I7b3c0579272f97243c9795c63d7193fefc3eddbe
2021-09-16 19:25:25 +00:00
jenkins-bot
4d5e08a979 Merge "Vue: Split off error logger into its own plugin" 2021-09-16 16:41:53 +00:00
jenkins-bot
ed13eb01c4 Merge "Update Special:Block UI" 2021-09-16 16:36:53 +00:00
Roan Kattouw
15e8d65b89 Vue: Split off error logger into its own plugin
Change-Id: Idbbaf2a5fb174aabefa9206d889c62c71846ac5f
2021-09-16 08:37:57 -07:00
Fomafix
bea70565d9 mediawiki.page.ready: Introduce wikipage.indicators hook
This new hook allows extensions and gadgets to enhance indicators on
page load and on live preview. This is useful for the Kartographer
extension.

The hook gets fired only if there is at least one indicator present.

The new hook gets fired before `wikipage.content` fires, to have the
same order like in the DOM.

Bug: T280363
Change-Id: I154ebbf049fbce1e872548651953adb1419b6cba
2021-09-16 13:11:04 +00:00
Timo Tijhof
008b6528b6 resourceloader: Skip version hash calculation in debug mode
=== Why

* More speed

  In debug mode, the server should regenerate the startup manifest
  on each page view to ensure immediate effect of changes. But,
  this also means more version recomputation work on the server.

  For most modules, this was already quite fast on repeat views
  because of OS-level file caches, and our file-hash caches and
  LESS compile caches in php-apcu from ResourceLoader.
  But, this makes it even faster.

* Better integration with browser devtools.

  Breakpoints stay more consistently across browsers when the
  URL stays the same even after you have changed the file and
  reloaded the page. For static files, I believe most browsers ignore
  query parameters. But for package files that come from load.php,
  this was harder for browsers to guess correctly which old script URL
  is logically replaced by a different one on the next page view.

=== How

Change Module::getVersionHash to return empty strings in debug mode.

I considered approaching this from StartupModule::getModuleRegistrations
instead to make the change apply only to the client-side manifest.

I decided against this because we have other calls to getVersionHash
on the server-side (such as for E-Tag calculation, and formatting
cross-wiki URLs) which would then not match the version queries that
mw.loader formats in debug mode.

Also, those calls would still be incurring some the avoidable costs.

=== Notes

* The two test cases for verifying the graceful fallback in production
  if version hash computations throw an exception, were moved to a
  non-debug test case as no longer happen now during the debug
  (unminified) test cases.

* Avoid "PHP Notice: Undefined offset 0" in testMakeModuleResponseStartupError
  by adding a fallback to empty string so that if the test fails,
  it fails in a more useful way instead of aborting with this error
  before the assertion happens. (Since PHPUnit generally stops on the
  first error.)

* In practice, there are still "version" query parameters and E-Tag
  headers in debug mode. These are not module versions, but URL
  "combined versions" crafted by getCombinedVersion() in JS and PHP.
  These return the constant "ztntf" in debug mode, which is the hash
  of an empty string. We could alter these methods to special-case
  when all inputs are and join to a still-empty string, or maybe we
  just leave them be. I've done the latter for now.

Bug: T235672
Bug: T85805
Change-Id: I0e63eef4f85b13089a0aa3806a5b6f821d527a92
2021-09-15 18:13:09 -07:00
jenkins-bot
04820b38cd Merge "Disable hidden radio buttons on page history to fix behavior on Firefox" 2021-09-14 21:49:22 +00:00
Volker E
ea72c9b690 mediawiki.mixins: Deprecate various mixins
Deprecating different mixins, where we forecast basic supported
browser will be unprefixed at time of MediaWiki 1.38.

Change-Id: I4dc902aa9d7eb6a42085b91fd78bb4281b8a933f
2021-09-14 01:11:57 +00:00
jenkins-bot
de1ebf69e4 Merge "resourceloader: inline mw.loader.store.MODULE_SIZE_MAX" 2021-09-14 00:33:20 +00:00
jenkins-bot
b405e9dcac Merge "resourceloader: Drop mw.loader.store.prune() oversized modules check" 2021-09-14 00:32:14 +00:00
jdlrobson
6960b650ea Fix the mw-ui-icon-with-label-desktop class
The mw-ui-icon-with-label-desktop class allows a label to hide
at mobile resolutions and display at desktop resolutions.

it was broken by the recent change to mw-ui-button.mw-ui-icon-element
so this code needs to be slightly adjusted for its existence so it
can be used in Minerva.

Bug: T288678
Depends-On: I4675be1e0b4b2a2a34507d85c551cc3234f1a9f6
Change-Id: I4eb28eae4c4e23d58f1f85bc41c0caf77197d8a1
2021-09-13 22:12:58 +00:00
DannyS712
8fb627f49b resourceloader: inline mw.loader.store.MODULE_SIZE_MAX
Only used in a single place in the store, the other usage was just
removed. Has no references from outside of the store.

Follow-up: I19721db51b2edf5f416f3a6b629d6ee002f608ec
Change-Id: I5b931a7d51b924a121d165bd42f0be28c6415842
2021-09-13 21:15:17 +00:00
DannyS712
366bb91c7e resourceloader: Drop mw.loader.store.prune() oversized modules check
In 2015, when we stopped storing modules that were larger than
100kB, we also started checking the size of existing stored modules
on each prune() call to handle any oversized modules already
stored. This check should no longer be needed, because
any oversized module still stored from back then would be pruned
for having an outdated version anyway (versions changed from 7
characters to 5 in 2019, so even if the code hasn't changed the
version hash has).

Bug: T290705
Change-Id: I19721db51b2edf5f416f3a6b629d6ee002f608ec
2021-09-13 21:10:41 +00:00
Nardog
aba792cc58 Disable hidden radio buttons on page history to fix behavior on Firefox
The radio buttons on page history hidden by CSS/JavaScript could still
be selected with arrow keys on Firefox, so this makes sure they are
disabled, not just hidden.

Bug: T290709
Change-Id: I400189792e0e9503b21d3d9ef7c8fb282ee4d47b
2021-09-12 10:32:26 +09:00
Volker E
5f2acead21 Replace obsolete LESS box-shadow() mixin
With unprefixed property.

Bug: T277819
Change-Id: I71ec0a13bb3c56913eee1f7b40db29a4152d6f2d
2021-09-10 23:02:23 -07:00
Timo Tijhof
2c8e429e10 resourceloader: Inline a variable in mw.Map#set
Change-Id: Ie2c11b0ea71714590acaecfc78fd38357a91185a
2021-09-10 21:34:04 +00:00
DannyS712
4eb7982021 resourceloader: update documentation for mw.loader.implement
If the script given is a string, this is executed via the `domEval()`
function - the documentation still referred to execution via
`$.globalEval()`. This was changed in 2018, when the startup code
was refactored to no longer depend on jQuery, see T192623.

Follow-up: Icdd5d76546a6c265a8e941c4e9b28f73bf9dd028
Change-Id: Ic3853a30ec50aafad55ac551a4848fe9db9b35cf
2021-09-10 03:23:31 +00:00
jenkins-bot
c8e1aa0fc1 Merge "resourceloader: add local variable for mw.loader" 2021-09-10 03:12:35 +00:00
DannyS712
0faa22fc6d resourceloader: add local variable for mw.loader
In mediawiki.loader.js, use a local variable for references to
the overall loader object, which helps to both reduce the output size
and simplify interactions.

Should be a no-op in terms of functionality.

Change-Id: I1d72c24b7a81ad00210056384a5f602c8f317667
2021-09-10 02:38:37 +00:00
jenkins-bot
1f9e1d24d3 Merge "resourceloader: Optimize ES6 module detection in registerOne()" 2021-09-10 02:36:36 +00:00