Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Clean up code with jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed Nov 7, 2013
1 parent 0cd54e3 commit 39d75c2
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 84 deletions.
4 changes: 2 additions & 2 deletions .jshintrc
Expand Up @@ -10,12 +10,12 @@
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"quotmark": true,
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": true
"white": false
}
153 changes: 74 additions & 79 deletions Gruntfile.js
@@ -1,85 +1,80 @@
// Generated on 2013-11-05 using generator-bespokeplugin v0.1.3

module.exports = function(grunt) {
/*global module:true */

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*!\n' +
' * <%= pkg.title || pkg.name %> v<%= pkg.version %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %>\n' +
' * This content is released under the' +
' <%= _.pluck(pkg.licenses, "type").join(", ") %> license<%= pkg.licenses.length === 1 ? "" : "s" %>\n' +
'' +
' */\n\n',
microbanner: '/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> ' +
'© <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>, ' +
'Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n'
},
clean: {
files: ['dist']
},
concat: {
options: {
banner: '<%= meta.banner %>',
stripBanners: true
},
dist: {
src: ['src/<%= pkg.name %>.js'],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '<%= meta.microbanner %>'
},
dist: {
src: ['<%= concat.dist.dest %>'],
dest: 'dist/<%= pkg.name %>.min.js'
}
},
jasmine: {
src: ['src/**/*.js'],
options: {
vendor: ['node_modules/bespoke/dist/bespoke.js', 'node_modules/bespoke-convenient/dist/bespoke-convenient.js'],
specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js'
}
},
jshint: {
src: [
'Gruntfile.js',
'src/**/*.js',
'spec/**/*.js',
'demo/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
micro: {
src: '<%= uglify.dist.dest %>',
options: {
limit: 1024,
gzip: true
}
},
watch: {
files: '<%= jshint.src %>',
tasks: ['default']
}
});
(function(module) {
'use strict';

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-micro');
module.exports = function(grunt) {

grunt.registerTask('default', ['clean', 'jasmine', 'concat', 'uglify', 'micro']);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*!\n' + ' * <%= pkg.title || pkg.name %> v<%= pkg.version %>\n' + ' * <%= pkg.homepage %>\n' + ' *\n' + ' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %>\n' + ' * This content is released under the' + ' <%= _.pluck(pkg.licenses, "type").join(", ") %> license<%= pkg.licenses.length === 1 ? "" : "s" %>\n' + '' + ' */\n\n',
microbanner: '/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> ' + '© <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>, ' + 'Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n'
},
clean: {
files: ['dist']
},
concat: {
options: {
banner: '<%= meta.banner %>',
stripBanners: true
},
dist: {
src: ['src/<%= pkg.name %>.js'],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '<%= meta.microbanner %>'
},
dist: {
src: ['<%= concat.dist.dest %>'],
dest: 'dist/<%= pkg.name %>.min.js'
}
},
jasmine: {
src: ['src/**/*.js'],
options: {
vendor: ['node_modules/bespoke/dist/bespoke.js', 'node_modules/bespoke-convenient/dist/bespoke-convenient.js'],
specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js'
}
},
jshint: {
src: [
'Gruntfile.js',
'src/**/*.js',
'spec/**/*.js',
'demo/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
micro: {
src: '<%= uglify.dist.dest %>',
options: {
limit: 1024,
gzip: true
}
},
watch: {
files: '<%= jshint.src %>',
tasks: ['default']
}
});

};
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-micro');

grunt.registerTask('default', ['clean', 'jasmine', 'jshint', 'concat', 'uglify', 'micro']);
};
}(module));
2 changes: 1 addition & 1 deletion demo/demo.js
Expand Up @@ -3,7 +3,7 @@
(function(bespoke) {
"use strict";

var deck = bespoke.horizontal.from("article", {
bespoke.horizontal.from("article", {
convenient: true,
jumpy: true
});
Expand Down
4 changes: 2 additions & 2 deletions src/bespoke-jumpy.js
Expand Up @@ -100,8 +100,8 @@
digit,
index;

eventHandled = eventHandled || (e.which == KeyConstants.END && cv.fire(deck, "end", e) && !deck.last());
eventHandled = eventHandled || (e.which == KeyConstants.HOME && cv.fire(deck, "home", e) && !deck.first());
eventHandled = eventHandled || (e.which === KeyConstants.END && cv.fire(deck, "end", e) && !deck.last());
eventHandled = eventHandled || (e.which === KeyConstants.HOME && cv.fire(deck, "home", e) && !deck.first());

if (isDigitKey(e.which)) {
// TODO: support multi-digit slide numbers with a timeout
Expand Down

0 comments on commit 39d75c2

Please sign in to comment.