Merge "Apply the pseudo-css selector rules to diff and changelist pages"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 22 Feb 2019 00:32:52 +0000 (00:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 22 Feb 2019 00:32:52 +0000 (00:32 +0000)
includes/actions/HistoryAction.php
includes/changes/ChangesList.php
includes/changes/EnhancedChangesList.php
includes/diff/DifferenceEngine.php
includes/specialpage/ChangesListSpecialPage.php
includes/specials/SpecialContributions.php
resources/Resources.php
resources/src/mediawiki.diff.styles/header.less [deleted file]
resources/src/mediawiki.interface.helpers.styles.less [new file with mode: 0644]
resources/src/mediawiki.special.changeslist.less

index fdf4f85..39bc830 100644 (file)
@@ -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',
                ] );
index b8ab971..bf275b3 100644 (file)
@@ -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 '<div class="mw-changeslist">';
        }
index 51a26ba..3e98f65 100644 (file)
@@ -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',
                ] );
index 87863a4..8e2b96d 100644 (file)
@@ -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() );
                        }
index faa2e70..c96cf8e 100644 (file)
@@ -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',
                ] );
index 3a180db..8a48aa6 100644 (file)
@@ -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',
                ] );
index a19926d..ec7da1c 100644 (file)
@@ -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 (file)
index d41ea08..0000000
+++ /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 (file)
index 0000000..cfabab6
--- /dev/null
@@ -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}';
+       }
+}
index db33f4a..ce43855 100644 (file)
 .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}';
-       }
-}