Index: trunk/extensions/SemanticResultFormats/SemanticResultFormats.php |
— | — | @@ -121,6 +121,10 @@ |
122 | 122 | foreach ( $srfgFormats as $format ) { |
123 | 123 | if ( array_key_exists( $format, $formatClasses ) ) { |
124 | 124 | $smwgResultFormats[$format] = $formatClasses[$format]; |
| 125 | + |
| 126 | + if ( method_exists( $formatClasses[$format], 'registerResourceModules' ) ) { |
| 127 | + call_user_func( array( $formatClasses[$format], 'registerResourceModules' ) ); |
| 128 | + } |
125 | 129 | } |
126 | 130 | else { |
127 | 131 | wfDebug( "There is not result format class associated with the format '$format'." ); |
Index: trunk/extensions/SemanticResultFormats/RELEASE-NOTES |
— | — | @@ -1,6 +1,11 @@ |
2 | 2 | For a documentation of all features, see |
3 | 3 | http://semantic-mediawiki.org/wiki/Semantic_Result_Formats |
4 | 4 | |
| 5 | + |
| 6 | +== SRF 1.5.2 == |
| 7 | + |
| 8 | + |
| 9 | + |
5 | 10 | == SRF 1.5.1 == |
6 | 11 | |
7 | 12 | Released on August 26 2010. |
Index: trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php |
— | — | @@ -57,12 +57,30 @@ |
58 | 58 | } |
59 | 59 | |
60 | 60 | protected function getResultText( $res, $outputmode ) { |
61 | | - global $smwgIQRunningNumber, $wgScriptPath; |
| 61 | + global $smwgIQRunningNumber, $srfgScriptPath; |
62 | 62 | |
63 | 63 | SMWOutputs::requireHeadItem( SMW_HEADER_STYLE ); |
64 | | - SMWOutputs::requireHeadItem( 'smw_tlhelper', '<script type="text/javascript" src="' . $wgScriptPath . '/extensions/SemanticResultFormats/Timeline/SRF_timeline.js"></script>' ); |
65 | | - SMWOutputs::requireHeadItem( 'smw_tl', '<script type="text/javascript" src="' . $wgScriptPath . '/extensions/SemanticResultFormats/Timeline/SimileTimeline/timeline-api.js"></script>' ); |
| 64 | + |
| 65 | + // MediaWiki 1.17 introduces the Resource Loader. |
| 66 | + if ( method_exists( 'OutputPage', 'addModules' ) && method_exists( 'SMWOutputs', 'requireResource' ) ) { |
| 67 | + SMWOutputs::requireResource( 'ext.srf.timeline' ); |
| 68 | + SMWOutputs::requireResource( 'ext.srf.timeline.api' ); |
| 69 | + } |
| 70 | + else { |
| 71 | + SMWOutputs::requireHeadItem( |
| 72 | + 'smw_tlhelper', |
| 73 | + '<script type="text/javascript" src="' . $srfgScriptPath . |
| 74 | + '/Timeline/SRF_timeline.js"></script>' |
| 75 | + ); |
| 76 | + SMWOutputs::requireHeadItem( |
| 77 | + 'smw_tl', |
| 78 | + '<script type="text/javascript" src="' . $srfgScriptPath . |
| 79 | + '/Timeline/SimileTimeline/timeline-api.js"></script>' |
| 80 | + ); |
| 81 | + } |
| 82 | + |
66 | 83 | |
| 84 | + |
67 | 85 | $eventline = ( 'eventline' == $this->mFormat ); |
68 | 86 | |
69 | 87 | if ( !$eventline && ( $this->m_tlstart == '' ) ) { // seek defaults |
— | — | @@ -256,4 +274,22 @@ |
257 | 275 | return $params; |
258 | 276 | } |
259 | 277 | |
| 278 | + public function registerResourceModules() { |
| 279 | + global $wgResourceModules, $srfgScriptPath; |
| 280 | + |
| 281 | + $moduleTemplate = array( |
| 282 | + 'localBasePath' => dirname( __FILE__ ), |
| 283 | + 'remoteBasePath' => $srfgScriptPath . '/Timeline', |
| 284 | + 'group' => 'ext.srf' |
| 285 | + ); |
| 286 | + |
| 287 | + $wgResourceModules['ext.srf.timeline'] = $moduleTemplate + array( |
| 288 | + 'styles' => 'SRF_timeline.js' |
| 289 | + ); |
| 290 | + |
| 291 | + $wgResourceModules['ext.srf.timeline.api'] = $moduleTemplate + array( |
| 292 | + 'styles' => 'SimileTimeline/timeline-api.js' |
| 293 | + ); |
| 294 | + } |
| 295 | + |
260 | 296 | } |