Restore Timeless 1.35 support

Change-Id: I882f4d76df4c437ad6cc5883c243ec08a40f34fb
isekai
jdlrobson 4 years ago committed by Jdlrobson
parent 4ddf48c2e0
commit f804f27167

@ -5,19 +5,33 @@
* @ingroup Skins
*/
class SkinTimeless extends SkinTemplate {
/** @var string */
public $stylename = 'Timeless';
/** @var string */
public $template = 'TimelessTemplate';
/**
* @param OutputPage $out
* Provide support for < 1.36. Can be deleted when no longer supported.
* @inheritDoc
*/
public function initPage( OutputPage $out ) {
parent::initPage( $out );
public function __construct(
array $options = []
) {
global $wgVersion;
$out = $this->getOutput();
// This code block can be removed when 1.35 is no longer supported.
if ( version_compare( $wgVersion, '1.36', '<' ) ) {
// Add external links - this is replaced by `content-links` feature in 1.36
$out->addModuleStyles( [
'mediawiki.skinning.content.externallinks'
] );
// Make responsive - this is replaced by `responsive` option in 1.36
$out->addMeta( 'viewport',
'width=device-width, initial-scale=1.0, ' .
'user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0'
);
// Associate template - this is replaced by `template` option in 1.36
$this->template = 'TimelessTemplate';
}
// Basic IE support without flexbox
$out->addStyle( $this->stylename . '/resources/IE9fixes.css', 'screen', 'IE' );
parent::__construct( $options );
}
}

@ -3,6 +3,23 @@
* ResourceLoader module to set some LESS variables for the skin
*/
class TimelessVariablesModule extends ResourceLoaderSkinModule {
/**
* Add compatibility to < 1.36
* @inheritDoc
*/
public function __construct(
array $options = [],
$localBasePath = null,
$remoteBasePath = null
) {
global $wgVersion;
if ( version_compare( $wgVersion, '1.36', '<' ) ) {
$options['features'] = [ "logo", "legacy" ];
}
parent::__construct( $options, $localBasePath, $remoteBasePath );
}
/**
* Add our LESS variables
*

@ -8,7 +8,7 @@
"license-name": "GPL-2.0-or-later",
"type": "skin",
"requires": {
"MediaWiki": ">= 1.36"
"MediaWiki": ">= 1.35"
},
"ValidSkinNames": {
"timeless": {
@ -17,6 +17,7 @@
"args": [
{
"name": "timeless",
"template": "TimelessTemplate",
"responsive": true,
"styles": [
"skins.timeless"

Loading…
Cancel
Save