Skip to content

Commit

Permalink
Include Grunt files
Browse files Browse the repository at this point in the history
  • Loading branch information
aliask committed May 9, 2016
1 parent 90ce5c8 commit c9e09d8
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
43 changes: 43 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/js/<%= pkg.name %>.js',
dest: 'dist/js/<%= pkg.name %>.min.js'
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'src/css',
src: ['*.css', '!*.min.css'],
dest: 'dist/css',
ext: '.min.css'
}]
}
},
jscs: {
src: "src/js/*.js",
options: {
config: ".jscsrc",
esnext: true, // If you use ES6 http://jscs.info/overview.html#esnext
verbose: true // If you need output with rule names http://jscs.info/overview.html#verbose
}
}
});

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks("grunt-jscs");

// Default task(s).
grunt.registerTask('default', ['uglify', 'cssmin']);

};
1 change: 1 addition & 0 deletions dist/css/fuzzycomplete.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/js/fuzzycomplete.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "fuzzycomplete",
"version": "0.1.0",
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-uglify": "^1.0.1",
"grunt-jscs": "^2.8.0"
}
}
6 changes: 3 additions & 3 deletions src/js/fuzzycomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
return;
}

if(typeof(Fuse) == 'undefinied') {
if(typeof(Fuse) == 'undefined') {
console.warn('fuzzyComplete plugin requires Fuse.js');
return;
}
Expand Down Expand Up @@ -87,15 +87,15 @@

resultsBox.empty();

if(results.length == 0) {
if(results.length === 0) {
selectBox.val(null);
}

results.forEach(function(e, i) {
if(i >= 4)
return;

if(i == 0)
if(i === 0)
selectBox.val(e.id);

resultsBox.append(
Expand Down

0 comments on commit c9e09d8

Please sign in to comment.