Skip to content

Commit

Permalink
Change and improve the codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed Feb 19, 2015
1 parent 25d556e commit 0232c42
Show file tree
Hide file tree
Showing 6 changed files with 805 additions and 783 deletions.
5 changes: 1 addition & 4 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "double",
"smarttabs": true,
"trailing": true,
"quotmark": "single",
"unused": true
}
230 changes: 115 additions & 115 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,131 +1,131 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
// Import package manifest
pkg: grunt.file.readJSON("remodal.jquery.json"),
// Project configuration.
grunt.initConfig({

// Banner definitions
meta: {
banner: "/*\n" +
" * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n" +
" * <%= pkg.description %>\n" +
" * <%= pkg.homepage %>\n" +
" *\n" +
" * Made by <%= pkg.author.name %>\n" +
" * Under <%= pkg.licenses[0].type %> License\n" +
" */\n"
},
// Import package manifest
pkg: grunt.file.readJSON('remodal.jquery.json'),

connect: {
server: {
options: {
port: 7770
}
}
},
meta: {
banner: '/*\n' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n' +
' * <%= pkg.description %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Made by <%= pkg.author.name %>\n' +
' * Under <%= pkg.licenses[0].type %> License\n' +
' */\n'
},

jshint: {
gruntfile: {
src: "Gruntfile.js"
},
src: {
src: "src/**/*.js"
},
test: {
src: "test/**/*.js"
},
options: {
jshintrc: ".jshintrc"
}
},
connect: {
server: {
options: {
port: 7770
}
}
},

jscs: {
gruntfile: {
src: "Gruntfile.js"
},
src: {
src: "src/**/*.js"
},
test: {
src: "test/**/*.js"
},
options: {
preset: "jquery",
requireSpacesInsideArrayBrackets: null
}
},
jshint: {
gruntfile: {
src: 'Gruntfile.js'
},
src: {
src: 'src/**/*.js'
},
test: {
src: 'test/**/*.js'
},
options: {
jshintrc: '.jshintrc'
}
},

csscomb: {
all: {
files: {
"src/jquery.remodal.css": "src/jquery.remodal.css"
}
}
},
jscs: {
gruntfile: {
src: 'Gruntfile.js'
},
src: {
src: 'src/**/*.js'
},
test: {
src: 'test/**/*.js'
},
options: {
preset: 'airbnb',
safeContextKeyword: null
}
},

qunit: {
all: {
options: {
urls: [
"jquery/dist/jquery.js",
"jquery2/dist/jquery.js",
"zepto/zepto.js"
].map(function(library) {
return "http://localhost:" +
"<%= connect.server.options.port %>" +
"/test/remodal.html?lib=" + library;
})
}
}
},
csscomb: {
all: {
files: {
'src/jquery.remodal.css': 'src/jquery.remodal.css'
}
}
},

concat: {
dist: {
files: {
"dist/jquery.remodal.js": "src/jquery.remodal.js",
"dist/jquery.remodal.css": "src/jquery.remodal.css"
},
options: {
banner: "<%= meta.banner %>"
}
}
},
qunit: {
all: {
options: {
urls: [
'jquery/dist/jquery.js',
'jquery2/dist/jquery.js',
'zepto/zepto.js'
].map(function(library) {
return 'http://localhost:' +
'<%= connect.server.options.port %>' +
'/test/remodal.html?lib=' + library;
})
}
}
},

uglify: {
remodal: {
files: {
"dist/jquery.remodal.min.js": "src/jquery.remodal.js"
}
},
options: {
banner: "<%= meta.banner %>"
}
concat: {
dist: {
files: {
'dist/jquery.remodal.js': 'src/jquery.remodal.js',
'dist/jquery.remodal.css': 'src/jquery.remodal.css'
},
options: {
banner: '<%= meta.banner %>'
}
}
},

githooks: {
all: {
"pre-commit": "lint"
},
options: {
command: "node_modules/.bin/grunt"
}
uglify: {
remodal: {
files: {
'dist/jquery.remodal.min.js': 'src/jquery.remodal.js'
}
});
},
options: {
banner: '<%= meta.banner %>'
}
},

githooks: {
all: {
'pre-commit': 'lint'
},
options: {
command: 'node_modules/.bin/grunt'
}
}
});

grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-csscomb");
grunt.loadNpmTasks("grunt-githooks");
grunt.loadNpmTasks("grunt-jscs");
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-csscomb');
grunt.loadNpmTasks('grunt-githooks');
grunt.loadNpmTasks('grunt-jscs');

// Tasks.
grunt.registerTask("lint", [ "jshint", "jscs" ]);
grunt.registerTask("test", [ "connect", "lint", "qunit" ]);
grunt.registerTask("default", [
"connect", "csscomb", "jshint", "jscs", "qunit", "concat", "uglify", "githooks"
]);
// Tasks.
grunt.registerTask('lint', ['jshint', 'jscs']);
grunt.registerTask('test', ['connect', 'lint', 'qunit']);
grunt.registerTask('default', [
'connect', 'csscomb', 'jshint', 'jscs', 'qunit', 'concat', 'uglify', 'githooks'
]);
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"grunt-cli": "^0.1.13",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-qunit": "^0.5.2",
"grunt-contrib-uglify": "^0.7.0",
"grunt-contrib-uglify": "^0.8.0",
"grunt-csscomb": "^3.0.0",
"grunt-githooks": "^0.3.1",
"grunt-jscs": "1.2.0"
"grunt-jscs": "^1.5.0"
},
"scripts": {
"postinstall": "./node_modules/.bin/bower install; ./node_modules/.bin/grunt githooks",
Expand Down
Loading

0 comments on commit 0232c42

Please sign in to comment.