* Ignore getLogoData() which is a one-line proxy to ::getLogo,
that can't really be tested because static methods can't be stubbed.
It exists so that this method can be stubbed instead. The actual
method is already covered.
* Simplify @covers for getStyles() to allow indirect coverage within
the class because it's intended as a higher-level integration tests.
The other tests in the suite still cover a specific method only.
Change-Id: I1445a016c1f12a6d8ceaaf745023a28cf20e5371
SVGs could already be used through $wgLogo. However, if a PNG fallback
is desired for older browsers, using SVGs was previously not possible.
This commit adds support for using an SVG image in $wgLogoHD and,
using $wgLogo as the fallback image.
Usage example:
> $wgLogo = '/path/to/png';
> $wgLogoHD = [
> 'svg' => 'path/to/svg',
> ];
Note: When the 'svg' key is set in $wgLogoHD, any '1.5x' and '2x' keys will
no longer be used because SVGs can render optimally on any screen sizes.
@Reedy, @Krinkle and @Brion VIBBER helped me alot with this.
Bug: T86229
Change-Id: I6197d96ce9110f4711ef2c4b198445bc5c6ae110
If any of the styles given in its module definition (in the
'styles' or 'skinStyles' properties) used the same media queries
as the module's own CSS (e.g. 'all'), the module would fail with
"PHP Fatal error: [] operator not supported for strings" because
FileModule defaults to merging all the stylesheets into a single
string.
Fix this by ensuring they are arrays before trying to extend them.
This previously made it impossible to use $wgResourceModuleSkinStyles
for modules that use SkinModule (instead of plain FileModule), such as
the 'mediawiki.skinning.interface' module.
Bug: T168088
Change-Id: I3effcaa4982728e707fbf9efeec4e5e78fc8aab6
If a skin is using this class, it's likely to be pretty new.
The targets system was mostly created for older code.
Let's make this the default so skins don't need to do anything
additional to work on mobile.
This simple change makes the Timeless skin work on mobile
when MobileFrontend is installed: ?useformat=mobile&useskin=timeless
It looks beautiful :)
Change-Id: I2ab8a1a634bdc0b5b2084d227c7388b5382e93e8
Follows-up 5f55e9c9c2.
If the logo url is from within /w, then ResourceLoaderSkinModule
will (as it should) apply a file hash query to it.
The preloader didn't do that, so it specified the wrong url.
Refactored SkinModule to make this logic re-usable.
Bug: T100999
Change-Id: I1ba11f7c70d1a725ad72754fee4a3f33c2a4c1be
This greatly increases the priority of loading
the logo on browsers that support rel="preload".
Bug: T100999
Change-Id: I0738fcc0a575153dab65016fa87faaa9b8b97a9d
Use getDefinitionSummary instead, which uses a single serialisation
pass instead of requiring every stage to be a string. This way
we don't need to call json_encode and md5() multiple times.
getModifiedHash() was deprecated in MediaWiki 1.26.
Change-Id: If9e9caa3d12976c99543ad53ab280355b70acb17
Keep in CSSMin as-is for back-compat and to ensure library remains
independent of MediaWiki.
Moved down a few lines as there is no need to compute the md5 hash when we're
returning a data URI. Previously md5_file was called twice during module builds
(once for the fallback url, and another time when producing the embedded data uri).
Applied to logo in SkinModule as example. To be applied elsewhere as needed.
Without it, fallback is current behaviour (no cache invalidation).
Bug: T99096
Change-Id: I7f38bfc1bea5c241bc4f8ec4f4b640fd65f2c04f
- Removed space after casts
- Removed spaces in array index
- Added spaces around string concat
- Added space after words: switch, foreach
- else if -> elseif
- Removed parentheses around require_once, because it is not a function
- Added newline at end of file
- Removed double spaces
- Added spaces around operations
- Removed repeated newlines
Bug: T102609
Change-Id: Ib860222b24f8ad8e9062cd4dc42ec88dc63fb49e
Follows-up f37cee996e which replaced the getHashMtime() and
getDefinitionMtime() methods with dummies that always return 1.
These getModifiedTime() implementations were only tracking the
definition summary or custom hash, which is already tracked
by getVersionHash().
Notes:
* SpecialCharacterDataModule: This one was odd as it was tracking
both the mtime *and* the file contents.
* UserCSSPrefsModule/UserOptionsModule: Remove redundant caching.
Already taken care of by getVersionHash() as of f37cee996e.
Bug: T94074
Change-Id: I6e37c3c2f85ef4599a8643b0efabc18de2f51ec4
Done using an array $wgLogoHD, which expects something like the following:
$wgLogoHD = array(
"1.5x" => "path/to/1.5x_version.png",
"2x" => "path/to/2x_version.png"
);
This is still horrible, but I dunno how to make it less horrible. Help.
Bug: T37337
Change-Id: Iee3e73c1f96b81c2094418986cf1c267d93d1bdd
The former is by far the most common.
Skipped:
* resources/lib/jquery.ui/jquery.ui.datepicker.js
* resources/src/mediawiki.special/mediawiki.special.upload.js
Change-Id: I73c93797e745128ba703e4865080c36784caa474
Requires skins use the 'mw-wiki-logo' class on the logo element for the styles
to apply and to load the 'mediawiki.skinning.interface' module (or implement
their own skin module that uses the ResourceLoaderSkinModule class).
This is backwards compatible with skins using inline styles as the class only
applies when used.
Bug: 56257
Change-Id: I4e6db89a688843ac24539f8fd1b408c0d04881b3