Gilles has uploaded a new change for review. https://gerrit.wikimedia.org/r/209773
Change subject: Duplicate module definition for addModuleStyles ...................................................................... Duplicate module definition for addModuleStyles Follow-up to I7d9e793b4b36a9ca3f5da75480ad89cddf7d5bf8 Fixing the issue of modules that contain both JS and CSS and how they interact with addModuleStyles. Since we don't want the position definition to affect modules when they are added normally (without addModuleStyles), we have to redefine them when they have a dual purpose. A better solution might be to make modules added via addModuleStyles only contain CSS, but getting there requires a knowledge of Wikibase's client side I don't have. Bug: T97410 Change-Id: Ibf22aa509d205b4c632d186c8da56a87c5d16099 --- M repo/includes/EntityParserOutputGenerator.php M view/resources/jquery/wikibase/resources.php M view/resources/jquery/wikibase/toolbar/resources.php M view/resources/wikibase/resources.php 4 files changed, 50 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/73/209773/1 diff --git a/repo/includes/EntityParserOutputGenerator.php b/repo/includes/EntityParserOutputGenerator.php index 84efaa8..8cb1091 100644 --- a/repo/includes/EntityParserOutputGenerator.php +++ b/repo/includes/EntityParserOutputGenerator.php @@ -383,9 +383,9 @@ // make css available for JavaScript-less browsers $parserOutput->addModuleStyles( array( 'wikibase.common', - 'jquery.ui.core', - 'jquery.wikibase.statementview', - 'jquery.wikibase.toolbar', + 'jquery.ui.core.styles', + 'jquery.wikibase.statementview.styles', + 'jquery.wikibase.toolbar.styles', ) ); // make sure required client-side resources will be loaded diff --git a/view/resources/jquery/wikibase/resources.php b/view/resources/jquery/wikibase/resources.php index 4b39988..013c692 100644 --- a/view/resources/jquery/wikibase/resources.php +++ b/view/resources/jquery/wikibase/resources.php @@ -431,7 +431,6 @@ ), 'jquery.wikibase.statementview' => $moduleTemplate + array( - 'position' => 'top', 'scripts' => array( 'jquery.wikibase.statementview.js', 'jquery.wikibase.statementview.RankSelector.js', @@ -466,6 +465,30 @@ ), ), + // This declaration is redundant for the sake of addModuleStyles + 'jquery.wikibase.statementview.styles' => $moduleTemplate + array( + 'position' => 'top', + 'styles' => array( + 'themes/default/jquery.wikibase.statementview.RankSelector.css', + ), + 'dependencies' => array( + 'jquery.ui.EditableTemplatedWidget', + 'jquery.ui.menu', + 'jquery.ui.position', + 'jquery.ui.toggler', + 'util.inherit', + 'jquery.wikibase.listview', + 'jquery.wikibase.referenceview', + 'jquery.wikibase.snakview', + 'jquery.wikibase.snaklistview', + 'wikibase.datamodel.Claim', + 'wikibase.datamodel.ReferenceList', + 'wikibase.datamodel.SnakList', + 'wikibase.datamodel.Statement', + 'wikibase.utilities', + ), + ), + ); return array_merge( diff --git a/view/resources/jquery/wikibase/toolbar/resources.php b/view/resources/jquery/wikibase/toolbar/resources.php index 2dce035..588e76a 100644 --- a/view/resources/jquery/wikibase/toolbar/resources.php +++ b/view/resources/jquery/wikibase/toolbar/resources.php @@ -91,7 +91,6 @@ ), 'jquery.wikibase.toolbar' => $moduleTemplate + array( - 'position' => 'top', 'scripts' => array( 'jquery.wikibase.toolbar.js', ), @@ -103,6 +102,17 @@ ), ), + // This declaration is redundant for the sake of addModuleStyles + 'jquery.wikibase.toolbar.styles' => $moduleTemplate + array( + 'position' => 'top', + 'styles' => array( + 'themes/default/jquery.wikibase.toolbar.css', + ), + 'dependencies' => array( + 'jquery.wikibase.toolbaritem', + ), + ), + 'jquery.wikibase.toolbarbutton' => $moduleTemplate + array( 'scripts' => array( 'jquery.wikibase.toolbarbutton.js', diff --git a/view/resources/wikibase/resources.php b/view/resources/wikibase/resources.php index 3359133..4d9126e 100644 --- a/view/resources/wikibase/resources.php +++ b/view/resources/wikibase/resources.php @@ -70,6 +70,18 @@ ), ), + // This declaration is redundant for the sake of addModuleStyles + 'jquery.ui.core.styles' => array( + 'position' => 'top', + 'skinStyles' => array( + 'default' => array( + 'resources/lib/jquery.ui/themes/smoothness/jquery.ui.core.css', + 'resources/lib/jquery.ui/themes/smoothness/jquery.ui.theme.css', + ), + ), + 'group' => 'jquery.ui', + ), + ); if ( defined( 'ULS_VERSION' ) ) { -- To view, visit https://gerrit.wikimedia.org/r/209773 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf22aa509d205b4c632d186c8da56a87c5d16099 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Gilles <gdu...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits