From: jenkins-bot Date: Fri, 22 Feb 2019 00:32:52 +0000 (+0000) Subject: Merge "Apply the pseudo-css selector rules to diff and changelist pages" X-Git-Tag: 1.34.0-rc.0~2753 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=19aa197cf261bc483ade0a08e0bcd6016223a298;hp=c32087b1ef05195110344c0529526be9cc923c52;p=lhc%2Fweb%2Fwiklou.git Merge "Apply the pseudo-css selector rules to diff and changelist pages" --- diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index fdf4f85336..39bc830ddc 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -133,6 +133,7 @@ class HistoryAction extends FormlessAction { $out->setFeedAppendQuery( 'action=history' ); $out->addModules( 'mediawiki.action.history' ); $out->addModuleStyles( [ + 'mediawiki.interface.helpers.styles', 'mediawiki.action.history.styles', 'mediawiki.special.changeslist', ] ); diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index b8ab971b94..bf275b36d3 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -289,7 +289,10 @@ class ChangesList extends ContextSource { $this->rcCacheIndex = 0; $this->lastdate = ''; $this->rclistOpen = false; - $this->getOutput()->addModuleStyles( 'mediawiki.special.changeslist' ); + $this->getOutput()->addModuleStyles( [ + 'mediawiki.interface.helpers.styles', + 'mediawiki.special.changeslist' + ] ); return '
'; } diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index 51a26baab7..3e98f650e6 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -78,6 +78,7 @@ class EnhancedChangesList extends ChangesList { $this->rclistOpen = false; $this->getOutput()->addModuleStyles( [ 'mediawiki.icon', + 'mediawiki.interface.helpers.styles', 'mediawiki.special.changeslist', 'mediawiki.special.changeslist.enhanced', ] ); diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 87863a4c12..8e2b96d080 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -956,7 +956,10 @@ class DifferenceEngine extends ContextSource { */ public function showDiffStyle() { if ( !$this->isSlotDiffRenderer ) { - $this->getOutput()->addModuleStyles( 'mediawiki.diff.styles' ); + $this->getOutput()->addModuleStyles( [ + 'mediawiki.interface.helpers.styles', + 'mediawiki.diff.styles' + ] ); foreach ( $this->getSlotDiffRenderers() as $slotDiffRenderer ) { $slotDiffRenderer->addModules( $this->getOutput() ); } diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index faa2e7037c..c96cf8e765 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -1700,6 +1700,7 @@ abstract class ChangesListSpecialPage extends SpecialPage { $out = $this->getOutput(); // Styles and behavior for the legend box (see makeLegend()) $out->addModuleStyles( [ + 'mediawiki.interface.helpers.styles', 'mediawiki.special.changeslist.legend', 'mediawiki.special.changeslist', ] ); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 3a180db60e..8a48aa6374 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -42,6 +42,7 @@ class SpecialContributions extends IncludableSpecialPage { $out = $this->getOutput(); // Modules required for viewing the list of contributions (also when included on other pages) $out->addModuleStyles( [ + 'mediawiki.interface.helpers.styles', 'mediawiki.special', 'mediawiki.special.changeslist', ] ); diff --git a/resources/Resources.php b/resources/Resources.php index a19926d96f..ec7da1cf21 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -914,9 +914,15 @@ return [ ], ], 'mediawiki.diff.styles' => [ + // FIXME: Remove class and lessMessages + // when I6aad563e48f41c783df8b176a4f437e60a1255cc has + // been in production for 1 week. 'class' => ResourceLoaderLessVarFileModule::class, 'styles' => [ - 'resources/src/mediawiki.diff.styles/header.less', + // Remove resources/src/mediawiki.interface.helpers.styles.less + // when I6aad563e48f41c783df8b176a4f437e60a1255cc has + // been in production for 1 week. + 'resources/src/mediawiki.interface.helpers.styles.less', 'resources/src/mediawiki.diff.styles/diff.css', 'resources/src/mediawiki.diff.styles/print.css' => [ 'media' => 'print' @@ -925,6 +931,7 @@ return [ 'lessMessages' => [ 'parentheses-start', 'parentheses-end', + 'pipe-separator' ], 'targets' => [ 'desktop', 'mobile' ], ], @@ -2010,6 +2017,20 @@ return [ 'oojs-ui.styles.icons-media', ], ], + 'mediawiki.interface.helpers.styles' => [ + 'class' => ResourceLoaderLessVarFileModule::class, + 'lessMessages' => [ + 'parentheses-start', + 'parentheses-end', + 'pipe-separator' + ], + 'styles' => [ + 'resources/src/mediawiki.interface.helpers.styles.less', + ], + 'targets' => [ + 'desktop', 'mobile' + ], + ], 'mediawiki.special' => [ 'styles' => [ 'resources/src/mediawiki.special/special.less', @@ -2125,13 +2146,21 @@ return [ 'targets' => [ 'desktop', 'mobile' ], ], 'mediawiki.special.changeslist' => [ + // FIXME: Remove class and lessMessages + // when I6aad563e48f41c783df8b176a4f437e60a1255cc has + // been in production for 1 week. 'class' => ResourceLoaderLessVarFileModule::class, 'lessMessages' => [ 'parentheses-start', 'parentheses-end', 'pipe-separator' ], - 'styles' => 'resources/src/mediawiki.special.changeslist.less', + 'styles' => [ + // FIXME: Remove this line when I6aad563e48f41c783df8b176a4f437e60a1255cc has + // been in production for 1 week. + 'resources/src/mediawiki.interface.helpers.styles.less', + 'resources/src/mediawiki.special.changeslist.less', + ], 'targets' => [ 'desktop', 'mobile' ], ], 'mediawiki.special.changeslist.enhanced' => [ diff --git a/resources/src/mediawiki.diff.styles/header.less b/resources/src/mediawiki.diff.styles/header.less deleted file mode 100644 index d41ea08e21..0000000000 --- a/resources/src/mediawiki.diff.styles/header.less +++ /dev/null @@ -1,9 +0,0 @@ -.mw-tag-markers { - &:before { - content: '@{msg-parentheses-start}'; - } - - &:after { - content: '@{msg-parentheses-end}'; - } -} diff --git a/resources/src/mediawiki.interface.helpers.styles.less b/resources/src/mediawiki.interface.helpers.styles.less new file mode 100644 index 0000000000..cfabab6838 --- /dev/null +++ b/resources/src/mediawiki.interface.helpers.styles.less @@ -0,0 +1,32 @@ +/** + * Helper classes used across special pages + */ + +/* Content dividers */ +/* @todo FIXME: Hard coded ". .". Is there a message for this? Should there be? */ +.mw-changeslist-separator:empty:before { + content: '. .'; +} + +.comment--without-parentheses, +.mw-changeslist-links, +.mw-diff-bytes, +/* Needed by pages calling ChangeTags::formatSummaryRow (T212613) */ +.mw-tag-markers, +.mw-uctop { + &:before { + content: '@{msg-parentheses-start}'; + } + + &:after { + content: '@{msg-parentheses-end}'; + } +} + +.mw-changeslist-links { + display: inline-block; + + > span:not( :first-child ):before { + content: '@{msg-pipe-separator}'; + } +} diff --git a/resources/src/mediawiki.special.changeslist.less b/resources/src/mediawiki.special.changeslist.less index db33f4abf7..ce43855681 100644 --- a/resources/src/mediawiki.special.changeslist.less +++ b/resources/src/mediawiki.special.changeslist.less @@ -60,31 +60,3 @@ .mw-rcfilters-ui-highlights { display: none; } - -/* Content dividers */ -/* @todo FIXME: Hard coded ". .". Is there a message for this? Should there be? */ -.mw-changeslist-separator:empty:before { - content: '. .'; -} - -.comment--without-parentheses, -.mw-changeslist-links, -.mw-diff-bytes, -.mw-tag-markers, -.mw-uctop { - &:before { - content: '@{msg-parentheses-start}'; - } - - &:after { - content: '@{msg-parentheses-end}'; - } -} - -.mw-changeslist-links { - display: inline-block; - - > span:not( :first-child ):before { - content: '@{msg-pipe-separator}'; - } -}