Split off basic styles from the JavaScript module 'mediawiki.action.history'
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 16 Jun 2016 12:25:02 +0000 (14:25 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 17 Jun 2016 00:02:19 +0000 (00:02 +0000)
Since d629541076c the .updatedmarker element was styled via a JavaScript
module - which caused a flash of unstyled content on the history page
for most users, and was left unstyled for noscript users.

Bug: T137383
Change-Id: I362abacf51160a8305b2b0013f65e89deb2ffc93

includes/actions/HistoryAction.php
resources/Resources.php
resources/src/mediawiki.action/mediawiki.action.history.css
resources/src/mediawiki.action/mediawiki.action.history.styles.css [new file with mode: 0644]

index 5ec10e6..63fe97b 100644 (file)
@@ -116,6 +116,7 @@ class HistoryAction extends FormlessAction {
                // Setup page variables.
                $out->setFeedAppendQuery( 'action=history' );
                $out->addModules( 'mediawiki.action.history' );
+               $out->addModuleStyles( 'mediawiki.action.history.styles' );
                if ( $config->get( 'UseMediaWikiUIEverywhere' ) ) {
                        $out = $this->getOutput();
                        $out->addModuleStyles( [
index c2724af..e31e77e 100644 (file)
@@ -1461,10 +1461,13 @@ return [
                ],
        ],
        'mediawiki.action.history' => [
-               'position' => 'top',
                'scripts' => 'resources/src/mediawiki.action/mediawiki.action.history.js',
                'styles' => 'resources/src/mediawiki.action/mediawiki.action.history.css',
        ],
+       'mediawiki.action.history.styles' => [
+               'position' => 'top',
+               'styles' => 'resources/src/mediawiki.action/mediawiki.action.history.styles.css',
+       ],
        'mediawiki.action.history.diff' => [
                'position' => 'top',
                'styles' => [
index 95e92ae..fd5dbc9 100644 (file)
@@ -1,8 +1,6 @@
+/* Styles for the JavaScript enhancements of the history page */
+
 #pagehistory li.before input[name="oldid"],
 #pagehistory li.after input[name="diff"] {
        visibility: hidden;
 }
-
-.updatedmarker {
-       background-color: #b7f430;
-}
diff --git a/resources/src/mediawiki.action/mediawiki.action.history.styles.css b/resources/src/mediawiki.action/mediawiki.action.history.styles.css
new file mode 100644 (file)
index 0000000..269db8e
--- /dev/null
@@ -0,0 +1,5 @@
+/* Basic styles for the history page */
+
+.updatedmarker {
+       background-color: #b7f430;
+}