Skip to content
This repository was archived by the owner on Feb 4, 2024. It is now read-only.

Commit 2efb54e

Browse files
committed
MediaWiki 1.35 support
* Our version of Mustache does not support the `for` watch indicator * The use of setupSkinUserCss is deprecated. Will break in future versions. Use skin registration instead (much cleaner and available since 1.35) * Prefix skin name with 's'. Skin keys that are numbers are not currently supported * Update to manifest version 2
1 parent e6a51e9 commit 2efb54e

File tree

4 files changed

+20
-33
lines changed

4 files changed

+20
-33
lines changed

includes/Skin2018.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,5 @@
66
*/
77
class Skin2018 extends SkinTemplate {
88
public $skinname = '2018';
9-
public $stylename = '2018';
109
public $template = 'Skin2018Template';
11-
12-
/**
13-
* Add CSS via ResourceLoader
14-
*
15-
* @param $out OutputPage
16-
*/
17-
public function initPage( OutputPage $out ) {
18-
$out->addMeta( 'viewport', 'width=device-width, initial-scale=1.0' );
19-
20-
$out->addModuleStyles( [
21-
// 'mediawiki.skinning.elements',
22-
// 'mediawiki.skinning.content',
23-
// 'mediawiki.skinning.interface',
24-
'mediawiki.skinning.content.externallinks',
25-
'skins.2018'
26-
] );
27-
$out->addModules( [
28-
'skins.2018.js'
29-
] );
30-
}
31-
32-
/**
33-
* @param $out OutputPage
34-
*/
35-
function setupSkinUserCss( OutputPage $out ) {
36-
parent::setupSkinUserCss( $out );
37-
}
3810
}

includes/Skin2018Template.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public function execute() {
1212
// Rearrange parts of $this->data for easier handling in the template
1313
unset( $this->data['nav_urls']['mainpage'] );
1414
if ( isset( $this->data['content_navigation']['actions']['watch'] ) ) {
15-
$this->data['watch_indicator']['watch'] = $this->data['content_navigation']['actions']['watch'];
15+
$this->data['watch_indicator'] = $this->data['content_navigation']['actions']['watch'];
1616
unset( $this->data['content_navigation']['actions']['watch'] );
1717
} else {
18-
$this->data['watch_indicator']['unwatch'] = $this->data['content_navigation']['actions']['unwatch'];
18+
$this->data['watch_indicator'] = $this->data['content_navigation']['actions']['unwatch'];
1919
unset( $this->data['content_navigation']['actions']['unwatch'] );
2020
}
2121

resources/templates/main.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
</div>
5858
<div>
5959
<ul class="uk-nav uk-navbar-dropdown-nav">
60-
{{#each watch_indicator}}<li><a href="{{{href}}}">{{text}}</a></li>{{/watch_indicator}}
60+
{{#watch_indicator}}<li><a href="{{{href}}}">{{text}}</a></li>{{/watch_indicator}}
6161
<li><a id="copy-permalink" data-clipboard-text="{{{serverurl}}}{{{nav_urls.permalink.href}}}">{{nav_urls.permalink.text}}</a></li>
6262
<li><a href="{{{nav_urls.upload.href}}}">Upload file</a></li>
6363
<li><a href="{{{content_navigation.actions.move.href}}}">{{content_navigation.actions.move.text}}</a></li>

skin.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,22 @@
88
"license-name": "MIT",
99
"type": "skin",
1010
"ValidSkinNames": {
11-
"2018": "2018"
11+
"s2018": {
12+
"class": "Skin2018",
13+
"args": [
14+
{
15+
"name": "2018",
16+
"responsive": true,
17+
"styles": [
18+
"mediawiki.skinning.content.externallinks",
19+
"skins.2018"
20+
],
21+
"scripts": [
22+
"skins.2018.js"
23+
]
24+
}
25+
]
26+
}
1227
},
1328
"MessagesDirs": {
1429
"2018": [
@@ -47,5 +62,5 @@
4762
"Skin2018": "includes/Skin2018.php",
4863
"Skin2018Template": "includes/Skin2018Template.php"
4964
},
50-
"manifest_version": 1
65+
"manifest_version": 2
5166
}

0 commit comments

Comments
 (0)