Skip to content

Commit

Permalink
fix up datapreview in master (integrate latest recline and vendor dep…
Browse files Browse the repository at this point in the history
…s and port fixes from 2733 branch).
  • Loading branch information
rufuspollock authored and tobes committed Sep 19, 2012
1 parent 49cae90 commit 13e8739
Show file tree
Hide file tree
Showing 17 changed files with 14,898 additions and 2,817 deletions.
13 changes: 8 additions & 5 deletions ckan/public/base/datapreview/datapreview.js
Expand Up @@ -212,8 +212,8 @@ CKAN.DataPreview = function ($, my) {
}

// 4 situations
// a) webstore_url is active (something was posted to the datastore)
// b) csv or xls (but not webstore)
// a) something was posted to the datastore - need to check for this
// b) csv or xls (but not datastore)
// c) can be treated as plain text
// d) none of the above but worth iframing (assumption is
// that if we got here (i.e. preview shown) worth doing
Expand All @@ -232,9 +232,12 @@ CKAN.DataPreview = function ($, my) {
}
}

if (resourceData.webstore_url) {
resourceData.url = '/api/data/' + resourceData.id;
resourceData.backend = 'elasticsearch';
// Set recline CKAN backend API endpoint to right location (so it can locate
// CKAN DataStore)
recline.Backend.Ckan.API_ENDPOINT = ckan.API_ROOT + '/api';

if (resourceData.datastore_active) {
resourceData.backend = 'ckan';
var dataset = new recline.Model.Dataset(resourceData);
var errorMsg = CKAN.Strings.errorLoadingPreview + ': ' + CKAN.Strings.errorDataStore;
dataset.fetch()
Expand Down
11 changes: 6 additions & 5 deletions ckan/public/base/datapreview/resource.config
@@ -1,6 +1,7 @@
[IE conditional]

lte IE 8 = vendor/leaflet/0.3.1/leaflet.ie.css
lte IE 8 = vendor/leaflet/0.4.4/leaflet.ie.css
lte IE 8 = vendor/flotr2/excanvas.js

[depends]

Expand All @@ -19,17 +20,17 @@ datapreview =
vendor/slickgrid/2.0.1/jquery-ui-1.8.16.custom.js
vendor/slickgrid/2.0.1/jquery.event.drag-2.0.js
vendor/slickgrid/2.0.1/slick.grid.js
vendor/flot/0.7/jquery.flot.js
vendor/flotr2/flotr2.js
vendor/moment/1.6.2/moment.js
vendor/leaflet/0.3.1/leaflet.js
vendor/leaflet/0.4.4/leaflet.js

vendor/recline/recline.js
datapreview.js

vendor/slickgrid/2.0.1/slick.grid.css
vendor/leaflet/0.3.1/leaflet.css
vendor/leaflet/0.4.4/leaflet.css

vendor/leaflet/0.3.1/leaflet.ie.css
vendor/leaflet/0.4.4/leaflet.ie.css

vendor/recline/css/recline.css
css/datapreview.css
2,599 changes: 0 additions & 2,599 deletions ckan/public/base/datapreview/vendor/flot/0.7/jquery.flot.js

This file was deleted.

0 comments on commit 13e8739

Please sign in to comment.