jenkins-bot has submitted this change and it was merged.
Change subject: Promote and flag the new action bar styles
......................................................................
Promote and flag the new action bar styles
Changes:
* If the $wgMinervaUsePageActionBarV2 configuration variable is truthy,
then add a CSS feature flag that enables the new action bar styles
* Deliver styles for the new and old action styles as the complexity of
conditionally delivering an asset is outweighed by the fact that the
feature flag is a temporary measure and that the increase in
compressed file size is ~240 bytes
Bug: T140260
Change-Id: I4f4ddf9ec313605c90ff76d22bf0eeaaad6ba7d8
---
M README.md
M extension.json
M includes/MobileFrontend.hooks.php
M includes/skins/SkinMinervaBeta.php
M resources/skins.minerva.base.styles/pageactions.less
D resources/skins.minerva.beta.styles/pageactions.less
6 files changed, 104 insertions(+), 70 deletions(-)
Approvals:
Jhernandez: Looks good to me, approved
jenkins-bot: Verified
diff --git a/README.md b/README.md
index f359f85..513cb7b 100644
--- a/README.md
+++ b/README.md
@@ -734,3 +734,14 @@
"image/svg+xml",
]
```
+
+#### $wgMinervaUsePageActionBarV2
+
+Whether or not to use the v2 styles for the page action bar – the set of icons
+displayed near to the title of the page.
+
+When enabled the page actions will appear horizontally below the title at
mobile widths and to the
+right of the title at tablet widths. The language switcher will always be the
leftmost page action.
+
+* Type: `Boolean`
+* Default: `false`
diff --git a/extension.json b/extension.json
index 28baae7..4bc0150 100644
--- a/extension.json
+++ b/extension.json
@@ -133,16 +133,6 @@
"resources/skins.minerva.base.styles/print.less"
]
},
- "skins.minerva.beta.styles": {
- "targets": [
- "mobile",
- "desktop"
- ],
- "position": "top",
- "styles": [
-
"resources/skins.minerva.beta.styles/pageactions.less"
- ]
- },
"skins.minerva.content.styles": {
"targets": [
"mobile",
@@ -1915,6 +1905,9 @@
"OutputPageParserOutput": [
"MobileFrontendHooks::onOutputPageParserOutput"
],
+ "OutputPageBodyAttributes": [
+ "MobileFrontendHooks::onOutputPageBodyAttributes"
+ ],
"HTMLFileCache::useFileCache": [
"MobileFrontendHooks::onHTMLFileCache_useFileCache"
],
@@ -2052,6 +2045,7 @@
"MFAllowNonJavaScriptEditing": false,
"MinervaAlwaysShowLanguageButton": true,
"MinervaBottomLanguageButton": true,
+ "MinervaUsePageActionBarV2": false,
"MFStripResponsiveImages": true,
"MFResponsiveImageWhitelist": [
"image/svg+xml"
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 1c61ada..433555b 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -1266,6 +1266,32 @@
}
/**
+ * OutputPageBodyAttributes hook handler.
+ *
+ * If the new action bar is enabled, via the
<code>$wgMinervaUsePageActionBarV2</code>, then the
+ * <code>feature-action-bar-v2</code> CSS feature flag is added to the
<code>body</code> tag.
+ *
+ * @see
https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageBodyAttributes
+ *
+ * @param OutputPage $outputPage
+ * @param Skin $skin
+ * @param array $bodyAttrs
+ */
+ public static function onOutputPageBodyAttributes(
+ OutputPage $outputPage,
+ Skin $skin,
+ array &$bodyAttributes
+ ) {
+ $context = MobileContext::singleton();
+ $config = $context->getMFConfig();
+
+ // TODO: Remove this when the new action bar is actually
considered stable (see T130849).
+ if ( $config->get( 'MinervaUsePageActionBarV2' ) ||
$context->isBetaGroupMember() ) {
+ $bodyAttributes['class'] .= '
feature-page-action-bar-v2';
+ }
+ }
+
+ /**
* HTMLFileCache::useFileCache hook handler
* Disables file caching for mobile pageviews
* @see
https://www.mediawiki.org/wiki/Manual:Hooks/HTMLFileCache::useFileCache
diff --git a/includes/skins/SkinMinervaBeta.php
b/includes/skins/SkinMinervaBeta.php
index b5ef653..f1bcde4 100644
--- a/includes/skins/SkinMinervaBeta.php
+++ b/includes/skins/SkinMinervaBeta.php
@@ -127,7 +127,6 @@
if ( $title->isMainPage() ) {
$styles[] = 'skins.minerva.mainPage.beta.styles';
}
- $styles[] = 'skins.minerva.beta.styles';
$styles[] = 'skins.minerva.content.styles.beta';
$styles[] = 'skins.minerva.icons.beta.images';
diff --git a/resources/skins.minerva.base.styles/pageactions.less
b/resources/skins.minerva.base.styles/pageactions.less
index f5b1a33..012a863 100644
--- a/resources/skins.minerva.base.styles/pageactions.less
+++ b/resources/skins.minerva.base.styles/pageactions.less
@@ -95,3 +95,66 @@
}
}
}
+
+// FIXME: Merge these styles with those above as part of T130849.
+.feature-page-action-bar-v2 {
+ .heading-holder {
+ @pageActionsHeight: @pageActionFontSize + (2 *
@iconGutterWidth);
+
+ overflow: hidden;
+ position: relative;
+ padding-bottom: @pageActionsHeight;
+ }
+
+ #page-actions {
+ position: absolute;
+ float: none;
+ bottom: 0;
+ width: 100%;
+
+ border-top: 1px solid @colorGray14;
+ border-bottom: 1px solid @colorGray12;
+
+ padding: 0.5em 0;
+
+ li {
+ display: inline-block;
+ margin-bottom: 0;
+ float: right;
+
+ &:first-child {
+ margin-top: 0;
+ }
+ }
+
+ .language-selector {
+ float: left;
+ margin-left: -@iconGutterWidth;
+
+ &.disabled {
+ cursor: default;
+ opacity: 0.25;
+ }
+ }
+
+ #ca-edit {
+ margin-right: -@iconGutterWidth;
+ }
+ }
+}
+
+@media all and ( min-width: @deviceWidthTablet ) {
+ .feature-page-action-bar-v2 {
+ #page-actions {
+ position: initial;
+ float: right;
+ width: auto;
+ border: 0;
+ margin: 0 0 @iconGutterWidth @iconGutterWidth;
+ }
+
+ .language-selector {
+ float: none;
+ }
+ }
+}
diff --git a/resources/skins.minerva.beta.styles/pageactions.less
b/resources/skins.minerva.beta.styles/pageactions.less
deleted file mode 100644
index 01f03ce..0000000
--- a/resources/skins.minerva.beta.styles/pageactions.less
+++ /dev/null
@@ -1,59 +0,0 @@
-@import 'minerva.variables';
-
-.heading-holder {
- @pageActionsHeight: @pageActionFontSize + (2 * @iconGutterWidth);
-
- overflow: hidden;
- position: relative;
- padding-bottom: @pageActionsHeight;
-}
-
-#page-actions {
- position: absolute;
- float: none;
- bottom: 0;
- width: 100%;
-
- border-top: 1px solid @colorGray14;
- border-bottom: 1px solid @colorGray12;
-
- padding: 0.5em 0;
-
- li {
- display: inline-block;
- margin-bottom: 0;
- float: right;
-
- &:first-child {
- margin-top: 0;
- }
- }
-
- .language-selector {
- float: left;
- margin-left: -@iconGutterWidth;
-
- &.disabled {
- cursor: default;
- opacity: 0.25;
- }
- }
-
- #ca-edit {
- margin-right: -@iconGutterWidth;
- }
-}
-
-@media all and ( min-width: @deviceWidthTablet ) {
- #page-actions {
- position: initial;
- float: right;
- width: auto;
- border: 0;
- margin: 0 0 @iconGutterWidth @iconGutterWidth;
- }
-
- .language-selector {
- float: none;
- }
-}
--
To view, visit https://gerrit.wikimedia.org/r/301352
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4f4ddf9ec313605c90ff76d22bf0eeaaad6ba7d8
Gerrit-PatchSet: 12
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jhernandez <[email protected]>
Gerrit-Reviewer: Jhobs <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits