Index: trunk/extensions/SemanticResultFormats/SemanticResultFormats.php |
— | — | @@ -38,6 +38,10 @@ |
39 | 39 | // Require the settings file. |
40 | 40 | require dirname( __FILE__ ) . '/SRF_Settings.php'; |
41 | 41 | |
| 42 | +if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) { |
| 43 | + require dirname( __FILE__ ) . '/SRF_Resources.php'; |
| 44 | +} |
| 45 | + |
42 | 46 | // Initialize the formats later on, so the $srfgFormats setting can be manipulated in LocalSettings. |
43 | 47 | $wgExtensionFunctions[] = 'srffInitFormats'; |
44 | 48 | |
— | — | @@ -99,7 +103,7 @@ |
100 | 104 | $wgAutoloadClasses['SRFArray'] = $formatDir . 'Array/SRF_Array.php'; |
101 | 105 | $wgAutoloadClasses['SRFHash'] = $formatDir . 'Array/SRF_Array.php'; |
102 | 106 | $wgAutoloadClasses['SRFValueRank'] = $formatDir . 'ValueRank/SRF_ValueRank.php'; |
103 | | - $wgAutoloadClasses['SRFD3Line'] = $formatDir . 'D3/SRF_d3Line.php'; |
| 107 | + $wgAutoloadClasses['SRFD3Line'] = $formatDir . 'D3/SRF_D3Line.php'; |
104 | 108 | $wgAutoloadClasses['SRFD3Bar'] = $formatDir . 'D3/SRF_D3Bar.php'; |
105 | 109 | $wgAutoloadClasses['SRFD3Treemap'] = $formatDir . 'D3/SRF_D3Treemap.php'; |
106 | 110 | |
Index: trunk/extensions/SemanticResultFormats/SRF_Settings.php |
— | — | @@ -41,11 +41,14 @@ |
42 | 42 | 'tagcloud', |
43 | 43 | 'valuerank', |
44 | 44 | 'array', |
45 | | - 'D3Line', |
46 | | - 'D3Bar', |
47 | | - 'D3Treemap', |
48 | 45 | ); |
49 | 46 | |
| 47 | +if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) { |
| 48 | + $srfgFormats[] = 'D3Line'; |
| 49 | + $srfgFormats[] = 'D3Bar'; |
| 50 | + $srfgFormats[] = 'D3Treemap'; |
| 51 | +} |
| 52 | + |
50 | 53 | # load hash format only if HashTables extension is initialised, otherwise 'Array' format is enough |
51 | 54 | if( isset( $wgHashTables ) ) { |
52 | 55 | $srfgFormats[] = 'hash'; |
Index: trunk/extensions/SemanticResultFormats/D3/SRF_D3Treemap.php |
— | — | @@ -12,59 +12,10 @@ |
13 | 13 | |
14 | 14 | protected static $m_barchartnum = 1; |
15 | 15 | |
16 | | - protected $m_charttitle; |
17 | | - protected $m_barcolor; |
18 | | - protected $m_bardirection; |
19 | | - protected $m_numbersaxislabel; |
20 | | - |
21 | | - /** |
22 | | - * (non-PHPdoc) |
23 | | - * @see SMWResultPrinter::handleParameters() |
24 | | - */ |
25 | | - protected function handleParameters( array $params, $outputmode ) { |
26 | | - parent::handleParameters( $params, $outputmode ); |
27 | | - |
28 | | - $this->m_charttitle = $this->m_params['charttitle']; |
29 | | - $this->m_barcolor = $this->m_params['barcolor']; |
30 | | - $this->m_bardirection = $this->m_params['bardirection']; |
31 | | - $this->m_numbersaxislabel = $this->m_params['numbersaxislabel']; |
32 | | - } |
33 | | - |
34 | 16 | public function getName() { |
35 | 17 | return wfMsg( 'srf_printername_D3Treemap' ); |
36 | 18 | } |
37 | 19 | |
38 | | - public static function registerResourceModules() { |
39 | | - global $wgResourceModules, $srfgIP; |
40 | | - |
41 | | - $resourceTemplate = array( |
42 | | - 'localBasePath' => $srfgIP . '/D3', |
43 | | - 'remoteExtPath' => 'SemanticResultFormats/D3' |
44 | | - ); |
45 | | - $wgResourceModules['ext.srf.d3'] = $resourceTemplate + array( |
46 | | - 'scripts' => array( |
47 | | - 'd3.js', |
48 | | - ), |
49 | | - 'styles' => array( |
50 | | - 'd3.css', |
51 | | - ), |
52 | | - ); |
53 | | - |
54 | | - $wgResourceModules['ext.srf.d3treemap'] = $resourceTemplate + array( |
55 | | - 'scripts' => array( |
56 | | - 'd3.layout.min.js', |
57 | | - ), |
58 | | - 'dependencies' => array( |
59 | | - 'ext.srf.d3', |
60 | | - ), |
61 | | - ); |
62 | | - } |
63 | | - |
64 | | - protected function loadJavascriptAndCSS() { |
65 | | - global $wgOut; |
66 | | - $wgOut->addModules( 'ext.srf.d3treemap' ); |
67 | | - } |
68 | | - |
69 | 20 | /** |
70 | 21 | * Add the JS and CSS resources needed by this chart. |
71 | 22 | * |
— | — | @@ -75,16 +26,8 @@ |
76 | 27 | return; |
77 | 28 | } |
78 | 29 | |
79 | | - // MW 1.17 + |
80 | | - if ( class_exists( 'ResourceLoader' ) ) { |
81 | | - $this->loadJavascriptAndCSS(); |
82 | | - return; |
83 | | - } |
84 | | - global $wgOut, $srfgJQPlotIncluded; |
85 | | - global $srfgScriptPath; |
86 | | - |
87 | | - $scripts = array(); |
88 | | - $wgOut->includeJQuery(); |
| 30 | + global $wgOut; |
| 31 | + $wgOut->addModules( 'ext.srf.d3treemap' ); |
89 | 32 | } |
90 | 33 | |
91 | 34 | /** |
— | — | @@ -109,7 +52,7 @@ |
110 | 53 | } |
111 | 54 | |
112 | 55 | foreach ( $data as $i => &$nr ) { |
113 | | - if ( $this->m_bardirection == 'horizontal' ) { |
| 56 | + if ( $this->params['bardirection'] == 'horizontal' ) { |
114 | 57 | $nr = array( $nr, $i ); |
115 | 58 | } |
116 | 59 | } |
— | — | @@ -126,7 +69,7 @@ |
127 | 70 | $angle_val = -40; |
128 | 71 | $barmargin = 6; |
129 | 72 | |
130 | | - if ( $this->m_bardirection == 'horizontal' ) { |
| 73 | + if ( $this->params['bardirection'] == 'horizontal' ) { |
131 | 74 | $labels_axis = 'yaxis'; |
132 | 75 | $numbers_axis = 'xaxis'; |
133 | 76 | $angle_val = 0; |
— | — | @@ -285,9 +228,6 @@ |
286 | 229 | $params['min']->setMessage( 'srf-paramdesc-minvalue' ); |
287 | 230 | $params['min']->setDefault( false, false ); |
288 | 231 | |
289 | | -# $params['pointlabels'] = new Parameter( 'pointlabels', Parameter::TYPE_BOOLEAN, false ); |
290 | | -# $params['pointlabels']->setMessage( 'srf-paramdesc-pointlabels' ); |
291 | | - |
292 | 232 | return $params; |
293 | 233 | } |
294 | 234 | |
Index: trunk/extensions/SemanticResultFormats/D3/SRF_D3Bar.php |
— | — | @@ -12,52 +12,10 @@ |
13 | 13 | |
14 | 14 | protected static $m_barchartnum = 1; |
15 | 15 | |
16 | | - protected $m_charttitle; |
17 | | -# protected $m_barcolor; |
18 | | -# protected $m_bardirection; |
19 | | -# protected $m_numbersaxislabel; |
20 | | - |
21 | | - /** |
22 | | - * (non-PHPdoc) |
23 | | - * @see SMWResultPrinter::handleParameters() |
24 | | - */ |
25 | | - protected function handleParameters( array $params, $outputmode ) { |
26 | | - parent::handleParameters( $params, $outputmode ); |
27 | | - |
28 | | - $this->m_charttitle = $this->m_params['charttitle']; |
29 | | -# $this->m_barcolor = $this->m_params['barcolor']; |
30 | | -# $this->m_bardirection = $this->m_params['bardirection']; |
31 | | -# $this->m_numbersaxislabel = $this->m_params['numbersaxislabel']; |
32 | | - } |
33 | | - |
34 | 16 | public function getName() { |
35 | 17 | return wfMsg( 'srf_printername_D3Bar' ); |
36 | 18 | } |
37 | 19 | |
38 | | - public static function registerResourceModules() { |
39 | | - global $wgResourceModules, $srfgIP; |
40 | | - |
41 | | - $resourceTemplate = array( |
42 | | - 'localBasePath' => $srfgIP . '/D3', |
43 | | - 'remoteExtPath' => 'SemanticResultFormats/D3' |
44 | | - ); |
45 | | - $wgResourceModules['ext.srf.d3core'] = $resourceTemplate + array( |
46 | | - 'scripts' => array( |
47 | | - 'd3.js', |
48 | | - ), |
49 | | - 'styles' => array( |
50 | | - 'd3.css', |
51 | | - ), |
52 | | - ); |
53 | | - |
54 | | - } |
55 | | - |
56 | | - protected function loadJavascriptAndCSS() { |
57 | | - global $wgOut; |
58 | | - $wgOut->addModules( 'ext.srf.d3core' ); |
59 | | - |
60 | | - } |
61 | | - |
62 | 20 | /** |
63 | 21 | * Add the JS and CSS resources needed by this chart. |
64 | 22 | * |
— | — | @@ -68,16 +26,8 @@ |
69 | 27 | return; |
70 | 28 | } |
71 | 29 | |
72 | | - // MW 1.17 + |
73 | | - if ( class_exists( 'ResourceLoader' ) ) { |
74 | | - $this->loadJavascriptAndCSS(); |
75 | | - return; |
76 | | - } |
77 | | - global $wgOut, $srfgJQPlotIncluded; |
78 | | - global $srfgScriptPath; |
79 | | - |
80 | | - $scripts = array(); |
81 | | - $wgOut->includeJQuery(); |
| 30 | + global $wgOut; |
| 31 | + $wgOut->addModules( 'ext.srf.d3core' ); |
82 | 32 | } |
83 | 33 | |
84 | 34 | /** |
— | — | @@ -101,12 +51,6 @@ |
102 | 52 | $minValue = $this->params['min']; |
103 | 53 | } |
104 | 54 | |
105 | | - foreach ( $data as $i => &$nr ) { |
106 | | -# if ( $this->m_bardirection == 'horizontal' ) { |
107 | | -# $nr = array( $nr, $i ); |
108 | | -# } |
109 | | - } |
110 | | - |
111 | 55 | $barID = 'bar' . self::$m_barchartnum; |
112 | 56 | self::$m_barchartnum++; |
113 | 57 | |
— | — | @@ -119,13 +63,6 @@ |
120 | 64 | $angle_val = -40; |
121 | 65 | $barmargin = 6; |
122 | 66 | |
123 | | -# if ( $this->m_bardirection == 'horizontal' ) { |
124 | | -# $labels_axis = 'yaxis'; |
125 | | -# $numbers_axis = 'xaxis'; |
126 | | -# $angle_val = 0; |
127 | | -# $barmargin = 8 ; |
128 | | -# } |
129 | | - |
130 | 67 | $barwidth = 20; // width of each bar |
131 | 68 | $bardistance = 4; // distance between two bars |
132 | 69 | |
— | — | @@ -172,7 +109,7 @@ |
173 | 110 | |
174 | 111 | $width = $this->params['width']; |
175 | 112 | $height = $this->params['height']; |
176 | | - |
| 113 | + $charttitle = $this->patams['charttitle']; |
177 | 114 | |
178 | 115 | $js_bar =<<<END |
179 | 116 | <script type="text/javascript"> |
— | — | @@ -247,7 +184,7 @@ |
248 | 185 | .attr("x", 0) |
249 | 186 | .attr("y", 25 ) |
250 | 187 | .attr("class", "chartitle") |
251 | | - .text('{$this->m_charttitle}'); |
| 188 | + .text('{$charttitle}'); |
252 | 189 | |
253 | 190 | rules.append("svg:line") |
254 | 191 | .attr("y1", h) |
— | — | @@ -301,23 +238,10 @@ |
302 | 239 | $params['charttitle'] = new Parameter( 'charttitle', Parameter::TYPE_STRING, ' ' ); |
303 | 240 | $params['charttitle']->setMessage( 'srf_paramdesc_charttitle' ); |
304 | 241 | |
305 | | -# $params['barcolor'] = new Parameter( 'barcolor', Parameter::TYPE_STRING, '#85802b' ); |
306 | | -# $params['barcolor']->setMessage( 'srf_paramdesc_barcolor' ); |
307 | | - |
308 | | -# $params['bardirection'] = new Parameter( 'bardirection', Parameter::TYPE_STRING, 'vertical' ); |
309 | | -# $params['bardirection']->setMessage( 'srf_paramdesc_bardirection' ); |
310 | | -# $params['bardirection']->addCriteria( new CriterionInArray( 'horizontal', 'vertical' ) ); |
311 | | - |
312 | | -# $params['numbersaxislabel'] = new Parameter( 'numbersaxislabel', Parameter::TYPE_STRING, ' ' ); |
313 | | -# $params['numbersaxislabel']->setMessage( 'srf_paramdesc_barnumbersaxislabel' ); |
314 | | - |
315 | 242 | $params['min'] = new Parameter( 'min', Parameter::TYPE_INTEGER ); |
316 | 243 | $params['min']->setMessage( 'srf-paramdesc-minvalue' ); |
317 | 244 | $params['min']->setDefault( false, false ); |
318 | 245 | |
319 | | -# $params['pointlabels'] = new Parameter( 'pointlabels', Parameter::TYPE_BOOLEAN, false ); |
320 | | -# $params['pointlabels']->setMessage( 'srf-paramdesc-pointlabels' ); |
321 | | - |
322 | 246 | return $params; |
323 | 247 | } |
324 | 248 | |
Index: trunk/extensions/SemanticResultFormats/D3/SRF_D3Line.php |
— | — | @@ -12,52 +12,10 @@ |
13 | 13 | |
14 | 14 | protected static $m_barchartnum = 1; |
15 | 15 | |
16 | | - protected $m_charttitle; |
17 | | - protected $m_barcolor; |
18 | | -# protected $m_bardirection; |
19 | | -# protected $m_numbersaxislabel; |
20 | | - |
21 | | - /** |
22 | | - * (non-PHPdoc) |
23 | | - * @see SMWResultPrinter::handleParameters() |
24 | | - */ |
25 | | - protected function handleParameters( array $params, $outputmode ) { |
26 | | - parent::handleParameters( $params, $outputmode ); |
27 | | - |
28 | | - $this->m_charttitle = $this->m_params['charttitle']; |
29 | | - $this->m_barcolor = $this->m_params['barcolor']; |
30 | | -# $this->m_bardirection = $this->m_params['bardirection']; |
31 | | -# $this->m_numbersaxislabel = $this->m_params['numbersaxislabel']; |
32 | | - } |
33 | | - |
34 | 16 | public function getName() { |
35 | 17 | return wfMsg( 'srf_printername_D3Line' ); |
36 | 18 | } |
37 | 19 | |
38 | | - public static function registerResourceModules() { |
39 | | - global $wgResourceModules, $srfgIP; |
40 | | - |
41 | | - $resourceTemplate = array( |
42 | | - 'localBasePath' => $srfgIP . '/D3', |
43 | | - 'remoteExtPath' => 'SemanticResultFormats/D3' |
44 | | - ); |
45 | | - $wgResourceModules['ext.srf.d3core'] = $resourceTemplate + array( |
46 | | - 'scripts' => array( |
47 | | - 'd3.js', |
48 | | - ), |
49 | | - 'styles' => array( |
50 | | - 'd3.css', |
51 | | - ), |
52 | | - ); |
53 | | - |
54 | | - } |
55 | | - |
56 | | - protected function loadJavascriptAndCSS() { |
57 | | - global $wgOut; |
58 | | - $wgOut->addModules( 'ext.srf.d3core' ); |
59 | | - |
60 | | - } |
61 | | - |
62 | 20 | /** |
63 | 21 | * Add the JS and CSS resources needed by this chart. |
64 | 22 | * |
— | — | @@ -68,16 +26,8 @@ |
69 | 27 | return; |
70 | 28 | } |
71 | 29 | |
72 | | - // MW 1.17 + |
73 | | - if ( class_exists( 'ResourceLoader' ) ) { |
74 | | - $this->loadJavascriptAndCSS(); |
75 | | - return; |
76 | | - } |
77 | | - global $wgOut, $srfgJQPlotIncluded; |
78 | | - global $srfgScriptPath; |
79 | | - |
80 | | - $scripts = array(); |
81 | | - $wgOut->includeJQuery(); |
| 30 | + global $wgOut; |
| 31 | + $wgOut->addModules( 'ext.srf.d3core' ); |
82 | 32 | } |
83 | 33 | |
84 | 34 | /** |
— | — | @@ -101,12 +51,6 @@ |
102 | 52 | $minValue = $this->params['min']; |
103 | 53 | } |
104 | 54 | |
105 | | - foreach ( $data as $i => &$nr ) { |
106 | | -# if ( $this->m_bardirection == 'horizontal' ) { |
107 | | -# $nr = array( $nr, $i ); |
108 | | -# } |
109 | | - } |
110 | | - |
111 | 55 | $lineID = 'line' . self::$m_barchartnum; |
112 | 56 | self::$m_barchartnum++; |
113 | 57 | |
— | — | @@ -119,13 +63,6 @@ |
120 | 64 | $angle_val = -40; |
121 | 65 | $barmargin = 6; |
122 | 66 | |
123 | | -# if ( $this->m_bardirection == 'horizontal' ) { |
124 | | -# $labels_axis = 'yaxis'; |
125 | | -# $numbers_axis = 'xaxis'; |
126 | | -# $angle_val = 0; |
127 | | -# $barmargin = 8 ; |
128 | | -# } |
129 | | - |
130 | 67 | $barwidth = 20; // width of each bar |
131 | 68 | $bardistance = 4; // distance between two bars |
132 | 69 | |
— | — | @@ -173,7 +110,6 @@ |
174 | 111 | $width = $this->params['width']; |
175 | 112 | $height = $this->params['height']; |
176 | 113 | |
177 | | - |
178 | 114 | $js_line =<<<END |
179 | 115 | <script type="text/javascript"> |
180 | 116 | $(document).ready(function() { |
— | — | @@ -267,20 +203,10 @@ |
268 | 204 | $params['barcolor'] = new Parameter( 'barcolor', Parameter::TYPE_STRING, '#85802b' ); |
269 | 205 | $params['barcolor']->setMessage( 'srf_paramdesc_barcolor' ); |
270 | 206 | |
271 | | -# $params['bardirection'] = new Parameter( 'bardirection', Parameter::TYPE_STRING, 'vertical' ); |
272 | | -# $params['bardirection']->setMessage( 'srf_paramdesc_bardirection' ); |
273 | | -# $params['bardirection']->addCriteria( new CriterionInArray( 'horizontal', 'vertical' ) ); |
274 | | - |
275 | | -# $params['numbersaxislabel'] = new Parameter( 'numbersaxislabel', Parameter::TYPE_STRING, ' ' ); |
276 | | -# $params['numbersaxislabel']->setMessage( 'srf_paramdesc_barnumbersaxislabel' ); |
277 | | - |
278 | 207 | $params['min'] = new Parameter( 'min', Parameter::TYPE_INTEGER ); |
279 | 208 | $params['min']->setMessage( 'srf-paramdesc-minvalue' ); |
280 | 209 | $params['min']->setDefault( false, false ); |
281 | 210 | |
282 | | -# $params['pointlabels'] = new Parameter( 'pointlabels', Parameter::TYPE_BOOLEAN, false ); |
283 | | -# $params['pointlabels']->setMessage( 'srf-paramdesc-pointlabels' ); |
284 | | - |
285 | 211 | return $params; |
286 | 212 | } |
287 | 213 | |
Index: trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php |
— | — | @@ -383,24 +383,4 @@ |
384 | 384 | return $params; |
385 | 385 | } |
386 | 386 | |
387 | | - /** |
388 | | - * Register the resource modules used by this result printer. |
389 | | - * |
390 | | - * @since 1.5.2 |
391 | | - */ |
392 | | - public static function registerResourceModules() { |
393 | | - global $wgResourceModules, $srfgScriptPath; |
394 | | - |
395 | | - $moduleTemplate = array( |
396 | | - 'localBasePath' => dirname( __FILE__ ), |
397 | | - 'remoteBasePath' => $srfgScriptPath . '/Timeline', |
398 | | - 'group' => 'ext.srf' |
399 | | - ); |
400 | | - |
401 | | - $wgResourceModules['ext.srf.timeline'] = $moduleTemplate + array( |
402 | | - 'scripts' => array( 'SRF_timeline.js', 'SimileTimeline/timeline-api.js' ), |
403 | | - 'dependencies' => array( 'mediawiki.legacy.wikibits' ) |
404 | | - ); |
405 | | - } |
406 | | - |
407 | 387 | } |
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php |
— | — | @@ -35,36 +35,6 @@ |
36 | 36 | return wfMsg( 'srf_printername_jqplotpie' ); |
37 | 37 | } |
38 | 38 | |
39 | | - public static function registerResourceModules() { |
40 | | - global $wgResourceModules, $srfgIP; |
41 | | - |
42 | | - $resourceTemplate = array( |
43 | | - 'localBasePath' => $srfgIP . '/jqPlot', |
44 | | - 'remoteExtPath' => 'SemanticResultFormats/jqPlot' |
45 | | - ); |
46 | | - $wgResourceModules['ext.srf.jqplot'] = $resourceTemplate + array( |
47 | | - 'scripts' => array( |
48 | | - 'jquery.jqplot.js', |
49 | | - ), |
50 | | - 'styles' => array( |
51 | | - 'jquery.jqplot.css', |
52 | | - ), |
53 | | - 'dependencies' => array( |
54 | | - ), |
55 | | - ); |
56 | | - $wgResourceModules['ext.srf.jqplotpie'] = $resourceTemplate + array( |
57 | | - 'scripts' => array( |
58 | | - 'jqplot.pieRenderer.js', |
59 | | - 'excanvas.js', |
60 | | - ), |
61 | | - 'styles' => array( |
62 | | - ), |
63 | | - 'dependencies' => array( |
64 | | - 'ext.srf.jqplot', |
65 | | - ), |
66 | | - ); |
67 | | - } |
68 | | - |
69 | 39 | protected function loadJavascriptAndCSS() { |
70 | 40 | global $wgOut; |
71 | 41 | $wgOut->addModules( 'ext.srf.jqplot' ); |
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotBar.php |
— | — | @@ -37,45 +37,6 @@ |
38 | 38 | return wfMsg( 'srf_printername_jqplotbar' ); |
39 | 39 | } |
40 | 40 | |
41 | | - public static function registerResourceModules() { |
42 | | - global $wgResourceModules, $srfgIP; |
43 | | - |
44 | | - $resourceTemplate = array( |
45 | | - 'localBasePath' => $srfgIP . '/jqPlot', |
46 | | - 'remoteExtPath' => 'SemanticResultFormats/jqPlot' |
47 | | - ); |
48 | | - $wgResourceModules['ext.srf.jqplot'] = $resourceTemplate + array( |
49 | | - 'scripts' => array( |
50 | | - 'jquery.jqplot.js', |
51 | | - ), |
52 | | - 'styles' => array( |
53 | | - 'jquery.jqplot.css', |
54 | | - ), |
55 | | - ); |
56 | | - |
57 | | - $wgResourceModules['ext.srf.jqplotbar'] = $resourceTemplate + array( |
58 | | - 'scripts' => array( |
59 | | - 'jqplot.categoryAxisRenderer.js', |
60 | | - 'jqplot.barRenderer.js', |
61 | | - 'jqplot.canvasAxisTickRenderer.js', |
62 | | - 'jqplot.canvasTextRenderer.js', |
63 | | - 'excanvas.js', |
64 | | - ), |
65 | | - 'dependencies' => array( |
66 | | - 'ext.srf.jqplot', |
67 | | - ), |
68 | | - ); |
69 | | - |
70 | | - $wgResourceModules['ext.srf.jqplotpointlabels'] = $resourceTemplate + array( |
71 | | - 'scripts' => array( |
72 | | - 'jqplot.pointLabels.min.js', |
73 | | - ), |
74 | | - 'dependencies' => array( |
75 | | - 'ext.srf.jqplotbar', |
76 | | - ), |
77 | | - ); |
78 | | - } |
79 | | - |
80 | 41 | protected function loadJavascriptAndCSS() { |
81 | 42 | global $wgOut; |
82 | 43 | $wgOut->addModules( 'ext.srf.jqplotbar' ); |
Index: trunk/extensions/SemanticResultFormats/SRF_Resources.php |
— | — | @@ -0,0 +1,89 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * The resource module definitions for the Semantic Result Formats extension. |
| 6 | + * |
| 7 | + * @since 1.7 |
| 8 | + * |
| 9 | + * @file SRF_Resources.php |
| 10 | + * @ingroup SemanticResultFormats |
| 11 | + * |
| 12 | + * @licence GNU GPL v3 |
| 13 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
| 14 | + */ |
| 15 | + |
| 16 | +$moduleTemplate = array( |
| 17 | + 'localBasePath' => dirname( __FILE__ ) . '/', |
| 18 | + 'remoteExtPath' => 'SemanticResultFormats/' |
| 19 | +); |
| 20 | + |
| 21 | +$wgResourceModules['ext.srf.jqplot'] = $moduleTemplate + array( |
| 22 | + 'scripts' => array( |
| 23 | + 'jqPlot/jquery.jqplot.js', |
| 24 | + ), |
| 25 | + 'styles' => array( |
| 26 | + 'jqPlot/jquery.jqplot.css', |
| 27 | + ), |
| 28 | +); |
| 29 | + |
| 30 | +$wgResourceModules['ext.srf.jqplotbar'] = $moduleTemplate + array( |
| 31 | + 'scripts' => array( |
| 32 | + 'jqPlot/jqplot.categoryAxisRenderer.js', |
| 33 | + 'jqPlot/jqplot.barRenderer.js', |
| 34 | + 'jqPlot/jqplot.canvasAxisTickRenderer.js', |
| 35 | + 'jqPlot/jqplot.canvasTextRenderer.js', |
| 36 | + 'jqPlot/excanvas.js', |
| 37 | + ), |
| 38 | + 'dependencies' => array( |
| 39 | + 'ext.srf.jqplot', |
| 40 | + ), |
| 41 | +); |
| 42 | + |
| 43 | +$wgResourceModules['ext.srf.jqplotpointlabels'] = $moduleTemplate + array( |
| 44 | + 'scripts' => array( |
| 45 | + 'jqPlot/jqplot.pointLabels.min.js', |
| 46 | + ), |
| 47 | + 'dependencies' => array( |
| 48 | + 'ext.srf.jqplotbar', |
| 49 | + ), |
| 50 | +); |
| 51 | + |
| 52 | +$wgResourceModules['ext.srf.jqplotpie'] = $moduleTemplate + array( |
| 53 | + 'scripts' => array( |
| 54 | + 'jqPlot/jqplot.pieRenderer.js', |
| 55 | + 'jqPlot/excanvas.js', |
| 56 | + ), |
| 57 | + 'dependencies' => array( |
| 58 | + 'ext.srf.jqplot', |
| 59 | + ), |
| 60 | +); |
| 61 | + |
| 62 | +$wgResourceModules['ext.srf.timeline'] = $moduleTemplate + array( |
| 63 | + 'scripts' => array( |
| 64 | + 'Timeline/SRF_timeline.js', |
| 65 | + 'Timeline/SimileTimeline/timeline-api.js' |
| 66 | + ), |
| 67 | + 'dependencies' => array( |
| 68 | + 'mediawiki.legacy.wikibits' |
| 69 | + ) |
| 70 | +); |
| 71 | + |
| 72 | +$wgResourceModules['ext.srf.d3core'] = $moduleTemplate + array( |
| 73 | + 'scripts' => array( |
| 74 | + 'D3/d3.js', |
| 75 | + ), |
| 76 | + 'styles' => array( |
| 77 | + 'D3/d3.css', |
| 78 | + ), |
| 79 | +); |
| 80 | + |
| 81 | +$wgResourceModules['ext.srf.d3treemap'] = $moduleTemplate + array( |
| 82 | + 'scripts' => array( |
| 83 | + 'D3/d3.layout.min.js', |
| 84 | + ), |
| 85 | + 'dependencies' => array( |
| 86 | + 'ext.srf.d3core', |
| 87 | + ), |
| 88 | +); |
| 89 | + |
| 90 | +unset( $moduleTemplate ); |
Property changes on: trunk/extensions/SemanticResultFormats/SRF_Resources.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 91 | + native |