Skip to content

Commit

Permalink
Rework Filtered format (#227)
Browse files Browse the repository at this point in the history
- Rework of format `filtered`
- Add view `map`
- Add filter `number`
- Add `HtmlValidator` for Json test script
  • Loading branch information
s7eph4n authored Jun 12, 2017
1 parent f6e07a7 commit 6077519
Show file tree
Hide file tree
Showing 77 changed files with 22,690 additions and 2,413 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
composer.lock
composer.phar

npm-debug.log

vendor/
extensions/
extensions/
node_modules/
114 changes: 64 additions & 50 deletions Resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,73 +718,87 @@

// Filtered
'ext.srf.filtered' => $formatModule + [
'scripts' => [
'Filtered/libs/ext.srf.filtered.js',
],
'styles' => [
'Filtered/skins/ext.srf.filtered.css',
'scripts' => [
'filtered/resources/js/ext.srf.filtered.js',
],
'styles' => [
'filtered/resources/css/ext.srf.filtered.css',
],
'dependencies' => [
'ext.srf',
],
],
],

//
'ext.srf.filtered.list-view' => $formatModule + [
'scripts' => [
'Filtered/libs/ext.srf.filtered.list-view.js',
],
'dependencies' => [
'ext.srf.filtered'
'dependencies' => [
'ext.srf.filtered',
],
],
],


'ext.srf.filtered.table-view' => $formatModule + [
'scripts' => [
'Filtered/libs/ext.srf.filtered.table-view.js',
],
'dependencies' => [
'ext.srf.filtered'
'ext.srf.filtered',
],
],

//
'ext.srf.filtered.calendar-view' => $formatModule + $calendarMessages + [
'scripts' => [
'Filtered/libs/ext.srf.filtered.calendar-view.js',
],
'styles' => [
'Filtered/skins/ext.srf.filtered.calendar-view.css',

'ext.srf.filtered.calendar-view.messages' => $formatModule + $calendarMessages,

'ext.srf.filtered.calendar-view' => $formatModule + array(
'styles' => array(
'filtered/resources/css/ext.srf.filtered.calendar-view.css',
),
'dependencies' => array(
'ext.srf.filtered',
'ext.srf.filtered.calendar-view.messages',
'ext.jquery.fullcalendar'
),
),

'ext.srf.filtered.map-view.leaflet' => $formatModule + [
'scripts' => [
'filtered/resources/js/ext.srf.filtered.leaflet.js',
],
'styles' => [
'filtered/resources/css/ext.srf.filtered.leaflet.css',
],
],
'dependencies' => [
'ext.srf.filtered',
'ext.jquery.fullcalendar'

'ext.srf.filtered.map-view' => $formatModule + [
'styles' => [
'filtered/resources/css/ext.srf.filtered.map-view.css',
],
'dependencies' => [
'ext.srf.filtered',
'ext.srf.filtered.map-view.leaflet',
],
],
],

//
'ext.srf.filtered.value-filter' => $formatModule + [
'scripts' => [
'Filtered/libs/ext.srf.filtered.value-filter.js',
],
'styles' => [
'Filtered/skins/ext.srf.filtered.value-filter.css',
],
'dependencies' => [
'ext.srf.filtered'
'styles' => [
'filtered/resources/css/ext.srf.filtered.value-filter.css',
],
'dependencies' => [
'ext.srf.filtered',
],
],
],

//
'ext.srf.filtered.distance-filter' => $formatModule + [
'scripts' => [
'Filtered/libs/ext.srf.filtered.distance-filter.js',
],
'styles' => [
'Filtered/skins/ext.srf.filtered.distance-filter.css',
'styles' => [ 'filtered/resources/css/ext.srf.filtered.distance-filter.css' ],
'dependencies' => [
'ext.srf.filtered',
'jquery.ui.slider',
],
],
'dependencies' => [
'ext.srf.filtered',
'jquery.ui.slider'

'ext.srf.filtered.number-filter' => $formatModule + [
'styles' => [
'filtered/resources/css/ext.srf.filtered.number-filter.css',
],
'dependencies' => [
'ext.srf.filtered',
'jquery.ui.slider',
],
],
],

// Slideshow
'ext.srf.slideshow' => $formatModule + [
Expand Down
1 change: 1 addition & 0 deletions SemanticResultFormats.hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public static function registerQUnitTests( array &$testModules, ResourceLoader &
// Formats
'tests/qunit/formats/ext.srf.formats.eventcalendar.tests.js',
'tests/qunit/formats/ext.srf.formats.datatables.test.js',
'tests/qunit/formats/ext.srf.formats.filtered.test.js',
'tests/qunit/formats/ext.srf.formats.gallery.test.js',
'tests/qunit/formats/ext.srf.formats.media.test.js',
'tests/qunit/formats/ext.srf.formats.tagcloud.test.js',
Expand Down
6 changes: 5 additions & 1 deletion SemanticResultFormats.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public static function registerHooks() {
$GLOBALS['wgHooks']['ResourceLoaderTestModules'][] = 'SRFHooks::registerQUnitTests';
$GLOBALS['wgHooks']['ResourceLoaderGetConfigVars'][] = 'SRFHooks::onResourceLoaderGetConfigVars';

// Format hooks
$GLOBALS['wgHooks']['OutputPageParserOutput'][] = 'SRF\Filtered\Hooks::onOutputPageParserOutput';
$GLOBALS['wgHooks']['MakeGlobalVariablesScript'][] = 'SRF\Filtered\Hooks::onMakeGlobalVariablesScript';

// register API modules
$GLOBALS['wgAPIModules']['ext.srf.slideshow.show'] = 'SRFSlideShowApi';

Expand Down Expand Up @@ -171,7 +175,7 @@ public static function onExtensionFunction() {
'tree' => 'SRF\Formats\Tree\TreeResultPrinter',
'ultree' => 'SRF\Formats\Tree\TreeResultPrinter',
'oltree' => 'SRF\Formats\Tree\TreeResultPrinter',
'filtered' => 'SRFFiltered',
'filtered' => 'SRF\Filtered\Filtered',
'latest' => 'SRFTime',
'earliest' => 'SRFTime',
'slideshow' => 'SRFSlideShow',
Expand Down
8 changes: 7 additions & 1 deletion build/travis/install-semantic-result-formats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ function installToMediaWikiRoot {
installPHPUnitWithComposer
composer require mediawiki/semantic-result-formats "dev-master" --dev

# FIXME: Remove once "nicmart/tree" made it to packagist
# Add optional packages
composer require "data-values/geo" "^1.1"

# FIXME: Remove once request for "symfony/css-selector" made it to packagist
composer require "symfony/css-selector" "^3.3"

# FIXME: Remove once request for "nicmart/tree" made it to packagist
composer require "nicmart/tree" "^0.2.7"

cd extensions
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@
"nicmart/tree": "^0.2.7"
},
"require-dev": {
"mediawiki/semantic-media-wiki": "@dev"
"mediawiki/semantic-media-wiki": "@dev",
"symfony/css-selector": "^3.3"
},
"suggest": {
"phpoffice/phpexcel": "Required for 'format=excel'",
"mediawiki/graph-viz": "Required for 'format=graph' and 'format=process'"
"mediawiki/graph-viz": "Required for 'format=graph' and 'format=process'",
"data-values/geo": "Required for 'format=filtered' with map view and/or distance filter"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 6077519

Please sign in to comment.