Skip to content

Commit

Permalink
Run source through jshint before concatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vicchi committed Mar 13, 2015
1 parent 512dbd8 commit 84d70d6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
7 changes: 5 additions & 2 deletions Gruntfile.js
Expand Up @@ -21,6 +21,9 @@ module.exports = function(grunt) {
dest: 'assets/js/rude.js'
}
},
jshint: {
beforeconcat: ['src/js/rude.js']
},
copy: {
csstoscss: {
files: [
Expand Down Expand Up @@ -135,7 +138,7 @@ module.exports = function(grunt) {
},
js: {
files: ['src/js/*'],
tasks: ['concat']
tasks: ['concat', 'jshint']
},
sass: {
files: ['src/sass/*'],
Expand All @@ -153,6 +156,6 @@ module.exports = function(grunt) {
grunt.file.delete(file);
});
});
grunt.registerTask('build', ['nodsstore', 'concat', 'copy:csstoscss', 'copy:img', 'copy:fonts', 'jsonmin', 'shell', 'sass']);
grunt.registerTask('build', ['nodsstore', 'concat', 'jshint', 'copy:csstoscss', 'copy:img', 'copy:fonts', 'jsonmin', 'shell', 'sass']);
grunt.registerTask('deploy', ['build', 'copy:deploy', 'shell:deploy']);
};
Binary file modified assets/data/rude-en.zip
Binary file not shown.
Binary file modified assets/data/rude-it.zip
Binary file not shown.
9 changes: 5 additions & 4 deletions assets/js/rude.js
Expand Up @@ -25081,7 +25081,7 @@ icon = new L.Icon({
iconURLs = {
en: 'assets/img/United-Kingdom32.png',
it: 'assets/img/Italy32.png'
}
};

var PlaceIcon = L.Icon.extend({
options: {
Expand Down Expand Up @@ -25280,14 +25280,15 @@ $(document).one('ajaxStop', function() {
rebuildFeatureList(englishLabels);

if (permaLink.id && permaLink.lang) {
var datum;
if (permaLink.lang === 'en' && englishLabels.hasOwnProperty(permaLink.id)) {
if (!map.hasLayer(englishLayer)) {
map.addLayer(englishLayer);
}
if (map.hasLayer(italianLayer)) {
map.removeLayer(italianLayer);
}
var datum = englishLabels[permaLink.id]
datum = englishLabels[permaLink.id];
map.setView(datum.layer.getLatLng(), 10);
datum.layer.fire('click');
}
Expand All @@ -25299,7 +25300,7 @@ $(document).one('ajaxStop', function() {
if (map.hasLayer(englishLayer)) {
map.removeLayer(englishLayer);
}
var datum = italianLabels[permaLink.id]
datum = italianLabels[permaLink.id];
map.setView(datum.layer.getLatLng(), 10);
datum.layer.fire('click');
}
Expand Down Expand Up @@ -25387,7 +25388,7 @@ function syncSidebar() {
}

function sortLabels(labels) {
labels = $.grep(labels,function(n){ return(n) });
labels = $.grep(labels,function(n){ return(n); });

labels.sort(function(a, b) {
if (a.feature.properties.label < b.feature.properties.label) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -20,6 +20,7 @@
"grunt": "^0.4.5",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-sass": "^0.9.2",
"grunt-contrib-watch": "^0.6.1",
"grunt-jsonmin": "^0.2.4",
Expand Down
9 changes: 5 additions & 4 deletions src/js/rude.js
Expand Up @@ -38,7 +38,7 @@ icon = new L.Icon({
iconURLs = {
en: 'assets/img/United-Kingdom32.png',
it: 'assets/img/Italy32.png'
}
};

var PlaceIcon = L.Icon.extend({
options: {
Expand Down Expand Up @@ -237,14 +237,15 @@ $(document).one('ajaxStop', function() {
rebuildFeatureList(englishLabels);

if (permaLink.id && permaLink.lang) {
var datum;
if (permaLink.lang === 'en' && englishLabels.hasOwnProperty(permaLink.id)) {
if (!map.hasLayer(englishLayer)) {
map.addLayer(englishLayer);
}
if (map.hasLayer(italianLayer)) {
map.removeLayer(italianLayer);
}
var datum = englishLabels[permaLink.id]
datum = englishLabels[permaLink.id];
map.setView(datum.layer.getLatLng(), 10);
datum.layer.fire('click');
}
Expand All @@ -256,7 +257,7 @@ $(document).one('ajaxStop', function() {
if (map.hasLayer(englishLayer)) {
map.removeLayer(englishLayer);
}
var datum = italianLabels[permaLink.id]
datum = italianLabels[permaLink.id];
map.setView(datum.layer.getLatLng(), 10);
datum.layer.fire('click');
}
Expand Down Expand Up @@ -344,7 +345,7 @@ function syncSidebar() {
}

function sortLabels(labels) {
labels = $.grep(labels,function(n){ return(n) });
labels = $.grep(labels,function(n){ return(n); });

labels.sort(function(a, b) {
if (a.feature.properties.label < b.feature.properties.label) {
Expand Down

0 comments on commit 84d70d6

Please sign in to comment.