Enabled strict mode, and fixed issues raised.
This commit is contained in:
parent
773e03c9c7
commit
b72dd0fb62
@ -4,10 +4,11 @@ this.recline.Backend.CSV = this.recline.Backend.CSV || {};
|
||||
|
||||
// Note that provision of jQuery is optional (it is **only** needed if you use fetch on a remote file)
|
||||
(function(my) {
|
||||
"use strict";
|
||||
my.__type__ = 'csv';
|
||||
|
||||
// use either jQuery or Underscore Deferred depending on what is available
|
||||
var Deferred = _.isUndefined(this.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
var Deferred = _.isUndefined(window.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
|
||||
// ## fetch
|
||||
//
|
||||
|
||||
@ -3,6 +3,7 @@ this.recline.Backend = this.recline.Backend || {};
|
||||
this.recline.Backend.DataProxy = this.recline.Backend.DataProxy || {};
|
||||
|
||||
(function(my) {
|
||||
"use strict";
|
||||
my.__type__ = 'dataproxy';
|
||||
// URL for the dataproxy
|
||||
my.dataproxy_url = '//jsonpdataproxy.appspot.com';
|
||||
@ -12,7 +13,7 @@ this.recline.Backend.DataProxy = this.recline.Backend.DataProxy || {};
|
||||
|
||||
|
||||
// use either jQuery or Underscore Deferred depending on what is available
|
||||
var Deferred = _.isUndefined(this.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
var Deferred = _.isUndefined(window.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
|
||||
// ## load
|
||||
//
|
||||
|
||||
@ -3,10 +3,11 @@ this.recline.Backend = this.recline.Backend || {};
|
||||
this.recline.Backend.ElasticSearch = this.recline.Backend.ElasticSearch || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
my.__type__ = 'elasticsearch';
|
||||
|
||||
// use either jQuery or Underscore Deferred depending on what is available
|
||||
var Deferred = _.isUndefined(this.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
var Deferred = _.isUndefined(window.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
|
||||
// ## ElasticSearch Wrapper
|
||||
//
|
||||
@ -200,8 +201,8 @@ this.recline.Backend.ElasticSearch = this.recline.Backend.ElasticSearch || {};
|
||||
fields: fieldData
|
||||
});
|
||||
})
|
||||
.fail(function(arguments) {
|
||||
dfd.reject(arguments);
|
||||
.fail(function(args) {
|
||||
dfd.reject(args);
|
||||
});
|
||||
return dfd.promise();
|
||||
};
|
||||
|
||||
@ -3,10 +3,11 @@ this.recline.Backend = this.recline.Backend || {};
|
||||
this.recline.Backend.GDocs = this.recline.Backend.GDocs || {};
|
||||
|
||||
(function(my) {
|
||||
"use strict";
|
||||
my.__type__ = 'gdocs';
|
||||
|
||||
// use either jQuery or Underscore Deferred depending on what is available
|
||||
var Deferred = _.isUndefined(this.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
var Deferred = _.isUndefined(window.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
|
||||
// ## Google spreadsheet backend
|
||||
//
|
||||
|
||||
@ -3,10 +3,11 @@ this.recline.Backend = this.recline.Backend || {};
|
||||
this.recline.Backend.Memory = this.recline.Backend.Memory || {};
|
||||
|
||||
(function(my) {
|
||||
"use strict";
|
||||
my.__type__ = 'memory';
|
||||
|
||||
// private data - use either jQuery or Underscore Deferred depending on what is available
|
||||
var Deferred = _.isUndefined(this.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
var Deferred = _.isUndefined(window.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
|
||||
// ## Data Wrapper
|
||||
//
|
||||
|
||||
@ -3,9 +3,10 @@ this.recline = this.recline || {};
|
||||
this.recline.Model = this.recline.Model || {};
|
||||
|
||||
(function(my) {
|
||||
"use strict";
|
||||
|
||||
// use either jQuery or Underscore Deferred depending on what is available
|
||||
var Deferred = _.isUndefined(this.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
var Deferred = _.isUndefined(window.jQuery) ? _.Deferred : jQuery.Deferred;
|
||||
|
||||
// ## <a id="dataset">Dataset</a>
|
||||
my.Dataset = Backbone.Model.extend({
|
||||
@ -298,7 +299,7 @@ my.Record = Backbone.Model.extend({
|
||||
//
|
||||
// NB: if field is undefined a default '' value will be returned
|
||||
getFieldValue: function(field) {
|
||||
val = this.getFieldValueUnrendered(field);
|
||||
var val = this.getFieldValueUnrendered(field);
|
||||
if (field && !_.isUndefined(field.renderer)) {
|
||||
val = field.renderer(val, field, this.toJSON());
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
|
||||
"use strict";
|
||||
// ## Graph view for a Dataset using Flot graphing library.
|
||||
//
|
||||
// Initialization arguments (in a hash in first parameter):
|
||||
|
||||
@ -4,6 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
// ## (Data) Grid Dataset View
|
||||
//
|
||||
// Provides a tabular view on a Dataset.
|
||||
|
||||
@ -4,7 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
|
||||
"use strict";
|
||||
// ## Map view for a Dataset using Leaflet mapping library.
|
||||
//
|
||||
// This view allows to plot gereferenced records on a map. The location
|
||||
@ -123,7 +123,7 @@ my.Map = Backbone.View.extend({
|
||||
// }
|
||||
infobox: function(record) {
|
||||
var html = '';
|
||||
for (key in record.attributes){
|
||||
for (var key in record.attributes){
|
||||
if (!(this.state.get('geomField') && key == this.state.get('geomField'))){
|
||||
html += '<div><strong>' + key + '</strong>: '+ record.attributes[key] + '</div>';
|
||||
}
|
||||
@ -172,8 +172,7 @@ my.Map = Backbone.View.extend({
|
||||
// Also sets up the editor fields and the map if necessary.
|
||||
render: function() {
|
||||
var self = this;
|
||||
|
||||
htmls = Mustache.render(this.template, this.model.toTemplateJSON());
|
||||
var htmls = Mustache.render(this.template, this.model.toTemplateJSON());
|
||||
$(this.el).html(htmls);
|
||||
this.$map = this.el.find('.panel.map');
|
||||
this.redraw();
|
||||
@ -326,7 +325,7 @@ my.Map = Backbone.View.extend({
|
||||
if (!(docs instanceof Array)) docs = [docs];
|
||||
|
||||
_.each(docs,function(doc){
|
||||
for (key in self.features._layers){
|
||||
for (var key in self.features._layers){
|
||||
if (self.features._layers[key].feature.properties.cid == doc.cid){
|
||||
self.features.removeLayer(self.features._layers[key]);
|
||||
}
|
||||
@ -560,7 +559,7 @@ my.MapMenu = Backbone.View.extend({
|
||||
// Also sets up the editor fields and the map if necessary.
|
||||
render: function() {
|
||||
var self = this;
|
||||
htmls = Mustache.render(this.template, this.model.toTemplateJSON());
|
||||
var htmls = Mustache.render(this.template, this.model.toTemplateJSON());
|
||||
$(this.el).html(htmls);
|
||||
|
||||
if (this._geomReady() && this.model.fields.length){
|
||||
|
||||
@ -5,6 +5,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
// ## MultiView
|
||||
//
|
||||
// Manage multiple views together along with query editor etc. Usage:
|
||||
@ -519,7 +520,7 @@ my.parseQueryString = function(q) {
|
||||
|
||||
// Parse the query string out of the URL hash
|
||||
my.parseHashQueryString = function() {
|
||||
q = my.parseHashUrl(window.location.hash).query;
|
||||
var q = my.parseHashUrl(window.location.hash).query;
|
||||
return my.parseQueryString(q);
|
||||
};
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
// ## SlickGrid Dataset View
|
||||
//
|
||||
// Provides a tabular view on a Dataset, based on SlickGrid.
|
||||
|
||||
@ -4,6 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
// turn off unnecessary logging from VMM Timeline
|
||||
if (typeof VMM !== 'undefined') {
|
||||
VMM.debug = false;
|
||||
|
||||
@ -4,6 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
|
||||
// ## FacetViewer
|
||||
//
|
||||
|
||||
@ -20,7 +20,8 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
|
||||
"use strict";
|
||||
|
||||
my.Fields = Backbone.View.extend({
|
||||
className: 'recline-fields-view',
|
||||
template: ' \
|
||||
|
||||
@ -4,6 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
|
||||
my.FilterEditor = Backbone.View.extend({
|
||||
className: 'recline-filter-editor well',
|
||||
|
||||
@ -4,6 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
|
||||
my.QueryEditor = Backbone.View.extend({
|
||||
className: 'recline-query-editor',
|
||||
|
||||
@ -4,6 +4,7 @@ this.recline = this.recline || {};
|
||||
this.recline.View = this.recline.View || {};
|
||||
|
||||
(function($, my) {
|
||||
"use strict";
|
||||
|
||||
my.ValueFilter = Backbone.View.extend({
|
||||
className: 'recline-filter-editor well',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user