Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/94875
Change subject: CSS should be shown to non-JS users
......................................................................
CSS should be shown to non-JS users
Having just addModules() will require JS to load all styles, via resourceloader.
Change-Id: I55f416e94d1929f142b902d5f79665c3addf44ff
---
M includes/Block/Header.php
M includes/Block/Topic.php
M includes/Block/TopicList.php
M includes/View.php
4 files changed, 12 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/75/94875/1
diff --git a/includes/Block/Header.php b/includes/Block/Header.php
index a90fd6c..26a1afe 100644
--- a/includes/Block/Header.php
+++ b/includes/Block/Header.php
@@ -91,7 +91,8 @@
// Render board history view in header block, topiclist block
will not be renderred
// when action = 'board-history'
if ( $this->action === 'board-history' ) {
- $templating->getOutput()->addModules(
'ext.flow.history' );
+ $templating->getOutput()->addModuleStyles( array(
'ext.flow.history' ) );
+ $templating->getOutput()->addModules( array(
'ext.flow.history' ) );
$tplVars = array(
'title' => wfMessage( 'flow-board-history',
$this->workflow->getArticleTitle() )->escaped(),
'historyExists' => false,
@@ -106,7 +107,8 @@
$templating->render( "flow:board-history.html.php",
$tplVars );
} else {
- $templating->getOutput()->addModules( 'ext.flow.header'
);
+ $templating->getOutput()->addModuleStyles( array(
'ext.flow.history' ) );
+ $templating->getOutput()->addModules( array(
'ext.flow.header' ) );
$templateName = ( $this->action == 'edit-header' ) ?
'edit-header' : 'header';
$templating->render( "flow:$templateName.html.php",
array(
'block' => $this,
diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php
index f3c1c06..bf7a38c 100644
--- a/includes/Block/Topic.php
+++ b/includes/Block/Topic.php
@@ -318,16 +318,19 @@
}
public function render( Templating $templating, array $options, $return
= false ) {
- $templating->getOutput()->addModules( 'ext.flow.discussion' );
+ $templating->getOutput()->addModuleStyles( array(
'ext.flow.discussion' ) );
+ $templating->getOutput()->addModules( array(
'ext.flow.discussion' ) );
$prefix = '';
switch( $this->action ) {
case 'post-history':
- $templating->getOutput()->addModules(
'ext.flow.history' );
+ $templating->getOutput()->addModuleStyles( array(
'ext.flow.history' ) );
+ $templating->getOutput()->addModules( array(
'ext.flow.history' ) );
return $prefix . $this->renderPostHistory( $templating,
$options, $return );
case 'topic-history':
- $templating->getOutput()->addModules(
'ext.flow.history' );
+ $templating->getOutput()->addModuleStyles( array(
'ext.flow.history' ) );
+ $templating->getOutput()->addModules( array(
'ext.flow.history' ) );
$history = $this->loadTopicHistory();
if ( !$this->permissions->isAllowed( reset( $history ),
'post-history' ) ) {
throw new \MWException( 'Not Allowed' );
diff --git a/includes/Block/TopicList.php b/includes/Block/TopicList.php
index 7821605..64255f9 100644
--- a/includes/Block/TopicList.php
+++ b/includes/Block/TopicList.php
@@ -102,6 +102,7 @@
public function render( Templating $templating, array $options ) {
// Don't render the topcilist block for some actions, eg:
board-history
if ( !in_array( $this->action, $this->suppressedActions, true )
) {
+ $templating->getOutput()->addModuleStyles( array(
'ext.flow.discussion' ) );
$templating->getOutput()->addModules( array(
'ext.flow.discussion' ) );
if ( $this->workflow->isNew() ) {
$templating->render( "flow:topiclist.html.php",
array(
diff --git a/includes/View.php b/includes/View.php
index d43f1b5..93756d9 100644
--- a/includes/View.php
+++ b/includes/View.php
@@ -19,7 +19,7 @@
}
public function show( WorkflowLoader $loader, $action ) {
- $this->output->addModuleStyles( array( 'mediawiki.ui' ) );
+ $this->output->addModuleStyles( array( 'mediawiki.ui',
'ext.flow.base' ) );
$this->output->addModules( array( 'ext.flow.base',
'ext.flow.editor' ) );
$workflow = $loader->getWorkflow();
--
To view, visit https://gerrit.wikimedia.org/r/94875
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I55f416e94d1929f142b902d5f79665c3addf44ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits