Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php |
— | — | @@ -34,6 +34,17 @@ |
35 | 35 | protected static $resourceModules = array(); |
36 | 36 | |
37 | 37 | /** |
| 38 | + * Adds a resource module to the parser output. |
| 39 | + * |
| 40 | + * @since 1.5.3 |
| 41 | + * |
| 42 | + * @param string $moduleName |
| 43 | + */ |
| 44 | + public static function requireResource( $moduleName ) { |
| 45 | + self::$resourceModules[$moduleName] = $moduleName; |
| 46 | + } |
| 47 | + |
| 48 | + /** |
38 | 49 | * Adds rousource loader modules or other head items. |
39 | 50 | * Falls back on requireHeadItemOld if the Resource Loader (MW >1.17) is not available. |
40 | 51 | * |
— | — | @@ -53,13 +64,13 @@ |
54 | 65 | |
55 | 66 | switch ( $id ) { |
56 | 67 | case SMW_HEADER_TOOLTIP: |
57 | | - self::$resourceModules['smw_tt'] = 'ext.smw.tooltips'; |
| 68 | + self::requireResource( 'ext.smw.tooltips' ); |
58 | 69 | break; |
59 | 70 | case SMW_HEADER_SORTTABLE: |
60 | | - self::$resourceModules['smw_st'] = 'ext.smw.sorttable'; |
| 71 | + self::requireResource( 'ext.smw.sorttable' ); |
61 | 72 | break; |
62 | 73 | case SMW_HEADER_STYLE: |
63 | | - self::$resourceModules['smw_css'] = 'ext.smw.style'; |
| 74 | + self::requireResource( 'ext.smw.style' ); |
64 | 75 | break; |
65 | 76 | } |
66 | 77 | } |
— | — | @@ -175,7 +186,7 @@ |
176 | 187 | |
177 | 188 | // Check if the resource loader can be used or not. |
178 | 189 | if ( method_exists( 'OutputPage', 'addModules' ) ) { |
179 | | - $parserOutput->addModules( self::$resourceModules ); |
| 190 | + $parserOutput->addModules( array_values( self::$resourceModules ) ); |
180 | 191 | } |
181 | 192 | |
182 | 193 | self::$resourceModules = array(); |
Index: trunk/extensions/SemanticMediaWiki/skins/SMW_sorttable.js |
— | — | @@ -2,7 +2,6 @@ |
3 | 3 | // from http://www.kryogenix.org/code/browser/sorttable/ |
4 | 4 | // Modified for SMW (in fact, we might rewrite the code since we |
5 | 5 | // usually have very special tables to sort) |
6 | | - |
7 | 6 | addOnloadHook( smw_sortables_init ); |
8 | 7 | |
9 | 8 | var SORT_COLUMN_INDEX; |
Index: trunk/extensions/SemanticMediaWiki/SMW_Settings.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | # of your wiki). No final slash. |
26 | 26 | ## |
27 | 27 | $smwgScriptPath = ( |
28 | | - ( version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath ) |
| 28 | + ( /*version_compare( $wgVersion, '1.16', '>=' ) && */isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath ) |
29 | 29 | ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' |
30 | 30 | ) . '/SemanticMediaWiki'; |
31 | 31 | ## |