jenkins-bot has submitted this change and it was merged.
Change subject: Unbreak styles for installer
......................................................................
Unbreak styles for installer
The installer hardcodes and expects to find a "skin.vector.styles"
module in skin.json, so moving it into a hook broke the styles. Moved it
back into skin.json, and left a comment so future developers don't make
the same mistake.
The responsive code is now a separate module,
"skins.vector.styles.responsive", which is only added to the page output
if VectorResponsive is enabled.
Bug: T106747
Change-Id: I7540b7871531ef650e799f012477cef6cdd32fb7
---
M SkinVector.php
D Vector.hooks.php
M skin.json
3 files changed, 22 insertions(+), 37 deletions(-)
Approvals:
Brian Wolff: Looks good to me, approved
Catrope: Looks good to me, but someone else must approve
Jack Phoenix: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/SkinVector.php b/SkinVector.php
index 24c73bd..5d14628 100644
--- a/SkinVector.php
+++ b/SkinVector.php
@@ -48,6 +48,7 @@
if ( $this->vectorConfig->get( 'VectorResponsive' ) ) {
$out->addMeta( 'viewport', 'width=device-width,
initial-scale=1' );
+ $out->addModuleStyles( 'skins.vector.styles.responsive'
);
}
// Append CSS which includes IE only behavior fixes for hover
support -
diff --git a/Vector.hooks.php b/Vector.hooks.php
deleted file mode 100644
index 98b9bed..0000000
--- a/Vector.hooks.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-class VectorHooks {
- /**
- * Register the 'skins.vector.styles' hook. This is temporary until
responsive
- * mode becomes the default.
- */
- public static function onResourceLoaderRegisterModules( ResourceLoader
$rl ) {
- $config = ConfigFactory::getDefaultInstance()->makeConfig(
'vector' );
- $definition = array(
- 'position' => 'top',
- 'styles' => array(
- 'screen.less' => array(
- 'media' => 'screen',
- ),
- 'screen-hd.less' => array(
- 'media' => 'screen and (min-width:
982px)',
- ),
- ),
- 'localBasePath' => __DIR__,
- 'remoteSkinPath' => 'Vector'
- );
- if ( $config->get( 'VectorResponsive' ) ) {
- $definition['styles']['responsive.less'] = array(
'media' => 'screen and (max-width: 768px)' );
- }
-
- $rl->register( 'skins.vector.styles', $definition );
- }
-}
diff --git a/skin.json b/skin.json
index c8093e8..535d257 100644
--- a/skin.json
+++ b/skin.json
@@ -23,16 +23,29 @@
},
"AutoloadClasses": {
"SkinVector": "SkinVector.php",
- "VectorTemplate": "VectorTemplate.php",
- "VectorHooks": "Vector.hooks.php"
+ "VectorTemplate": "VectorTemplate.php"
},
- "Hooks": {
- "ResourceLoaderRegisterModules": [
- "VectorHooks::onResourceLoaderRegisterModules"
- ]
- },
- "@note": "skins.vector.styles module registered via a hook",
+ "@note": "When modifying skins.vector.styles definition, make sure the
installer still works",
"ResourceModules": {
+ "skins.vector.styles": {
+ "position": "top",
+ "styles": {
+ "screen.less": {
+ "media": "screen"
+ },
+ "screen-hd.less": {
+ "media": "screen and (min-width: 982px)"
+ }
+ }
+ },
+ "skins.vector.styles.responsive": {
+ "position": "top",
+ "styles": {
+ "responsive.less": {
+ "media": "screen and (max-width: 768px)"
+ }
+ }
+ },
"skins.vector.js": {
"scripts": [
"collapsibleTabs.js",
--
To view, visit https://gerrit.wikimedia.org/r/226656
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7540b7871531ef650e799f012477cef6cdd32fb7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Bartosz DziewoĆski <[email protected]>
Gerrit-Reviewer: Brian Wolff <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Edokter <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits