r75615 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75614‎ | r75615 | r75616 >
Date:15:11, 28 October 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed incorrect use of the resource loader
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/SMW.hooks.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/skins/SMW_custom_rtl.css (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php
@@ -50,13 +50,13 @@
5151
5252 switch ( $id ) {
5353 case SMW_HEADER_TOOLTIP:
54 - $wgOut->addModules( 'ext.smw.tooltips' );
 54+ self::$mHeadItems['smw_tt'] = 'ext.smw.tooltips';
5555 break;
5656 case SMW_HEADER_SORTTABLE:
57 - $wgOut->addModules( 'ext.smw.sorttable' );
 57+ self::$mHeadItems['smw_st'] = 'ext.smw.sorttable';
5858 break;
5959 case SMW_HEADER_STYLE:
60 - $wgOut->addModules( 'ext.smw.style' );
 60+ self::$mHeadItems['smw_css'] = 'ext.smw.style';
6161 break;
6262 }
6363 }
@@ -166,10 +166,16 @@
167167 * @param ParserOutput $parserOutput
168168 */
169169 static public function commitToParserOutput( ParserOutput $parserOutput ) {
170 - foreach ( self::$mHeadItems as $key => $item ) {
171 - $parserOutput->addHeadItem( "\t\t" . $item . "\n", $key );
 170+ // Check if the resource loader can be used or not.
 171+ if ( method_exists( 'OutputPage', 'addModules' ) ) {
 172+ $parserOutput->addModules( array_values( self::$mHeadItems ) );
172173 }
173 -
 174+ else {
 175+ foreach ( self::$mHeadItems as $key => $item ) {
 176+ $parserOutput->addHeadItem( "\t\t" . $item . "\n", $key );
 177+ }
 178+ }
 179+
174180 self::$mHeadItems = array();
175181 }
176182
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php
@@ -14,7 +14,7 @@
1515 * @ingroup SMW
1616 */
1717
18 -define( 'SMW_VERSION', '1.5.3-light rc1' );
 18+define( 'SMW_VERSION', '1.5.3-light rc2' );
1919
2020 require_once( 'SMW_GlobalFunctions.php' );
2121
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -8,7 +8,7 @@
99 */
1010
1111 // The SMW version number.
12 -define( 'SMW_VERSION', '1.5.3 rc1' );
 12+define( 'SMW_VERSION', '1.5.3 rc2' );
1313
1414 // A flag used to indicate SMW defines a semantic extension type for extension crdits.
1515 define( 'SEMANTIC_EXTENSION_TYPE', true );
Index: trunk/extensions/SemanticMediaWiki/skins/SMW_custom_rtl.css
@@ -1,3 +1,8 @@
 2+/*
 3+ * Note: this file is not needed since the introduction of the MediaWiki resource loader,
 4+ * so it can be removed as soon as the minimun MW compatibility becomes >= 1.17.
 5+ */
 6+
27 /* tables for inline queries */
38 table.smwtable th, table.smwtable td {
49 text-align: right;
Index: trunk/extensions/SemanticMediaWiki/SMW.hooks.php
@@ -29,8 +29,7 @@
3030
3131 $modules = array(
3232 'ext.smw.style' => array(
33 - // FIXME: Won't work right, ResourceLoader does RTL flipping itself
34 - 'styles' => ( $wgContLang->isRTL() ? 'SMW_custom_rtl.css' : 'SMW_custom.css' )
 33+ 'styles' => 'SMW_custom.css'
3534 ),
3635 'ext.smw.tooltips' => array(
3736 'scripts' => 'SMW_tooltip.js',
@@ -50,7 +49,8 @@
5150 $name,
5251 new ResourceLoaderFileModule(
5352 array_merge_recursive( $resources, array( 'group' => 'ext.smw' ) ),
54 - dirname( __FILE__ ) . '/skins', $smwgScriptPath . '/skins'
 53+ dirname( __FILE__ ) . '/skins',
 54+ $smwgScriptPath . '/skins'
5555 )
5656 );
5757 }

Status & tagging log