Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
improved gruntfile, jshint passed, changed CS (see .editorconfig), si…
Browse files Browse the repository at this point in the history
…mplified doc files in one, and other minor changes
  • Loading branch information
Javier Aguilar committed Jun 21, 2015
1 parent 2c501c7 commit 1f7e48a
Show file tree
Hide file tree
Showing 19 changed files with 2,721 additions and 3,077 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# EditorConfig is awesome: http://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
ehthumbs.db
Thumbs.db
*.log
/ignore*
/node_modules/
/bower_components/
/nbproject/
static_server.js
*.php
.idea
.idea
6 changes: 3 additions & 3 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"bitwise": true,
"bitwise": false,
"browser": true,
"curly": true,
"eqeqeq": true,
Expand All @@ -11,8 +11,8 @@
"newcap": true,
"noarg": true,
"node": true,
"strict": false,
"strict": true,
"trailing": true,
"undef": true,
"predef" : ["Modernizr"]
"predef" : ["define"]
}
33 changes: 24 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
## Submitting issues
For feature requests, suggestions or ideas, add `[SUGGESTION]` before the title of the issue, for anything else follow the following guidelines.
# Contributing

### Guidelines
- Try to reproduce your problem in a separated environment, like in JSFiddle, [here is a template for it](http://jsfiddle.net/mjolnic/0vopxm13/), that you can fork in the same page. It already includes the required JS and CSS files.
## Support

The issue tracker is not the place for support requests. If you get stuck with bootstrap-colorpicker, it's very likely
that the fine folks at [StackOverflow](http://stackoverflow.com/) will be able to help you; simply describe the problem
you're having and provide them a link to the repo (so they know what code you're using).


## Issues
For feature requests, suggestions or ideas, add `[SUGGESTION]` before the title of the issue, for anything else follow
the following guidelines.

### Steps to submit an issue
- Try to reproduce your problem in a separated environment, like in JSFiddle,
[here is a template for it](http://jsfiddle.net/mjolnic/0vopxm13/), that you can fork in the same page.
It already includes the required JS and CSS files.
- Before posting your issue, consider adding this information:
* Expected behaviour: what should happen?
* Actual behaviour: what happens instead?
* Your context: Where it happens? In which browser and version (if applicable)?
* Plugin version (and/or commit reference).
* jQuery version you use and list of all other plugins/scripts you are using with this one and may cause some conflict.
* A link to your JSFiddle (or similar tool) demo where you reproduced the problem (if applicable).

## Contributing to Source Code

Thanks for wanting to contribute source code to this project. That's great!
## Pull Requests

Patches and new features are welcome!

- Before starting developing the plugin, you need to run `npm install` and `bower install` inside the plugin folder.
- Fork this project
- Before start developing, you need to run `npm install` and `bower install` inside the plugin folder.
- Before your commits run always `grunt` inside the plugin folders, to update the dist files (don't modify them manually).
- Do not change the plugin coding style.
- Check that the index.html demos aren't broken (modify if necessary).
- Test your code at least in Chrome, Firefox and IE >= 10.
- Test your code at least in Chrome, Firefox and IE >= 10 / Edge.
- Any new feature should come with updated docs
- Push to your fork and submit the pull request
242 changes: 121 additions & 121 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,129 +1,129 @@
'use strict';
module.exports = function(grunt) {
module.exports = function (grunt) {

grunt.initConfig({
recess: {
dist: {
options: {
compile: true,
compress: false
},
files: {
'dist/css/bootstrap-colorpicker.css': [
'src/less/colorpicker.less'
]
}
},
distMin: {
options: {
compile: true,
compress: true
},
files: {
'dist/css/bootstrap-colorpicker.min.css': [
'src/less/colorpicker.less'
]
}
}
grunt.initConfig({
recess: {
dist: {
options: {
compile: true,
compress: false
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
files: [
'Gruntfile.js',
'src/js/commits.js',
'src/js/docs.js',
'dist/js/*.js'
]
},
jsbeautifier: {
htmlFiles: ['index.html'],
srcFiles: ['src/js/*.js'],
distFiles: ['dist/js/bootstrap-colorpicker.js']
},
combine: {
dist: {
input: 'src/js/colorpicker.js',
output: 'dist/js/bootstrap-colorpicker.js',
tokens: [{
token: "'{{color}}';",
file: 'src/js/colorpicker-color.js',
}]
}
},
uglify: {
dist: {
files: {
'dist/js/bootstrap-colorpicker.min.js': [
'dist/js/bootstrap-colorpicker.js'
]
}
}
},
bake: {
options: {
condense: true,
indent: 4
},
dist: {
files: {
'index.html': ['src/docs.html']
}
}
},
watch: {
less: {
files: [
'src/less/*.less'
],
tasks: ['recess']
},
js: {
files: [
'src/js/*.js'
],
tasks: ['jsbeautifier:srcFiles', 'combine', 'jsbeautifier:distFiles', 'uglify', 'jshint']
},
html: {
files: [
'src/*.html'
],
tasks: ['bake', 'jsbeautifier:htmlFiles']
}
files: {
'dist/css/bootstrap-colorpicker.css': [
'src/less/colorpicker.less'
]
}
},
distMin: {
options: {
compile: true,
compress: true
},
clean: {
dist: [
'index.html',
'dist/css',
'dist/js/*.js'
]
files: {
'dist/css/bootstrap-colorpicker.min.css': [
'src/less/colorpicker.less'
]
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
files: [
'Gruntfile.js',
'src/js/docs.js',
'dist/js/bootstrap-colorpicker.js'
]
},
jsbeautifier: {
options: {
js: {
braceStyle: "collapse",
breakChainedMethods: false,
e4x: false,
evalCode: false,
indentChar: " ",
indentLevel: 0,
indentSize: 2,
indentWithTabs: false,
jslintHappy: false,
keepArrayIndentation: false,
keepFunctionIndentation: false,
maxPreserveNewlines: 10,
preserveNewlines: true,
spaceBeforeConditional: true,
spaceInParen: false,
unescapeStrings: false,
wrapLineLength: 0,
endWithNewline: true
}
},
srcFiles: ['src/js/*.js'],
distFiles: ['dist/js/bootstrap-colorpicker.js']
},
combine: {
dist: {
input: 'src/js/colorpicker.js',
output: 'dist/js/bootstrap-colorpicker.js',
tokens: [{
token: "'{{color}}';",
file: 'src/js/colorpicker-color.js'
}]
}
},
uglify: {
dist: {
files: {
'dist/js/bootstrap-colorpicker.min.js': [
'dist/js/bootstrap-colorpicker.js'
]
}
});
}
},
watch: {
less: {
files: [
'src/less/*.less'
],
tasks: ['recess']
},
js: {
files: [
'src/js/*.js'
],
tasks: ['jsbeautifier:srcFiles', 'combine', 'jsbeautifier:distFiles', 'uglify', 'jshint']
}
},
clean: {
dist: [
'dist/css',
'dist/js/*.js'
]
}
});

// Load tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-bake');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-combine');
// Load tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-combine');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');

// Register tasks
grunt.registerTask('default', [
'clean',
'recess',
'jsbeautifier:srcFiles',
'combine',
'jsbeautifier:distFiles',
'uglify',
'bake',
'jsbeautifier:htmlFiles'
]);
grunt.registerTask('dev', [
'watch'
]);
// Register tasks
grunt.registerTask('default', [
'clean',
'recess',
'jsbeautifier:srcFiles',
'combine',
'jsbeautifier:distFiles',
'uglify',
'jshint'
]);
grunt.registerTask('dev', [
'watch'
]);

};
};
35 changes: 18 additions & 17 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "mjolnic-bootstrap-colorpicker",
"version": "2.1.2",
"main": [
"dist/css/bootstrap-colorpicker.css",
"dist/js/bootstrap-colorpicker.js"
],
"dependencies": {
"jquery": "^1.10",
"bootstrap": ">=2"
},
"ignore": [
"\\.*",
"/src",
"index.html",
"/package.json",
"/Gruntfile.js"
]
"name": "mjolnic-bootstrap-colorpicker",
"version": "2.2.0",
"main": [
"dist/css/bootstrap-colorpicker.css",
"dist/js/bootstrap-colorpicker.js"
],
"dependencies": {
"jquery": ">=1.10",
"bootstrap": ">=2"
},
"ignore": [
"\\.*",
"/src",
"/index.html",
"/package.json",
"/composer.json",
"/Gruntfile.js"
]
}
Loading

0 comments on commit 1f7e48a

Please sign in to comment.