Skip to content

Commit

Permalink
Merge pull request #337 from leongersen/grunt
Browse files Browse the repository at this point in the history
Grunt
  • Loading branch information
leongersen committed Sep 6, 2014
2 parents 47312fa + 2131b56 commit 127be4f
Show file tree
Hide file tree
Showing 36 changed files with 1,123 additions and 1,086 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/compiler
/distribute
/node_modules
*.log
*.zip
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "libLink"]
path = libLink
url = https://github.com/leongersen/libLink
[submodule "wnumb"]
path = wnumb
[submodule "submodules/wNumb"]
path = submodules/wNumb
url = https://github.com/leongersen/wnumb
[submodule "submodules/libLink"]
path = submodules/libLink
url = https://github.com/leongersen/libLink
130 changes: 130 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
module.exports = function(grunt) {

var VERSION_TEMPLATE = '/*! <%= pkg.name %> - <%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd HH:MM:ss") %> */' +
'\n\n';

function getFiles ( append ) {

var files = [
'src/js/helpers/intro.js',
'src/js/helpers.js',
'src/js/constants.js',
'src/js/range.js',
'src/js/options.js',
'src/js/structure.js',
'src/js/scope_start.js',
'src/js/scope_helpers.js',
'src/js/scope_link.js',
'src/js/scope_events.js',
'src/js/scope.js',
'src/js/scope_end.js',
'src/js/interface.js'
];

if ( append ) {
files = files.concat(append);
}

files.push('src/js/helpers/outro.js');

return files;
}

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
banner: VERSION_TEMPLATE
},
basic: {
src: getFiles(),
dest: 'distribute/jquery.nouislider.js',
nonull: true
},
all: {
src: ['submodules/wNumb/wNumb.js', 'submodules/libLink/jquery.libLink.js'].concat(getFiles('src/js/pips.js')),
dest: 'distribute/jquery.nouislider.all.js',
nonull: true
},
},
cssmin: {
all: {
options: {
banner: VERSION_TEMPLATE
},
files: {
'distribute/jquery.nouislider.min.css': ['src/jquery.nouislider.css'],
'distribute/jquery.nouislider.pips.min.css': ['src/jquery.nouislider.pips.css']
}
}
},
'string-replace': {
version: {
files: {
'nouislider.jquery.json': 'src/jquery.json'
},
options: {
replacements: [{
pattern: /{{VERSION}}/g,
replacement: '<%= pkg.version %>'
}]
}
}
},
jshint: {
options: {
browser: true,
indent: false,
laxbreak: true,
laxcomma: true,
validthis: true,
newcap: false
},
basic: ['distribute/jquery.nouislider.js'],
all: ['distribute/jquery.nouislider.all.js']
},
uglify: {
all: {
files: {
'distribute/jquery.nouislider.min.js': 'distribute/jquery.nouislider.js',
'distribute/jquery.nouislider.all.min.js': 'distribute/jquery.nouislider.all.js'
}
}
},
compress: {
all: {
options: {
archive: 'noUiSlider.<%= pkg.version %>.zip'
},
files: [
{ src: ['**/*'], dest: '', cwd: 'distribute/', expand: true },
{ src: ['**/*.css'], dest: '', cwd: 'src/', expand: true },
{ src: ['**/archive.md'], rename: function(){ return 'README.md'; }, dest: '', cwd: 'src/', expand: true }
]
}
}
});

// https://github.com/gruntjs/grunt-contrib-concat
grunt.loadNpmTasks('grunt-contrib-concat');

// https://github.com/gruntjs/grunt-contrib-uglify
grunt.loadNpmTasks('grunt-contrib-uglify');

// https://github.com/gruntjs/grunt-contrib-jshint
grunt.loadNpmTasks('grunt-contrib-jshint');

// https://github.com/erickrdch/grunt-string-replace
grunt.loadNpmTasks('grunt-string-replace');

// https://github.com/gruntjs/grunt-contrib-cssmin
grunt.loadNpmTasks('grunt-contrib-cssmin');

// https://github.com/gruntjs/grunt-contrib-compress
grunt.loadNpmTasks('grunt-contrib-compress');

grunt.registerTask('default', ['concat', 'jshint']);
grunt.registerTask('create', ['concat', 'jshint', 'uglify', 'cssmin']);
grunt.registerTask('release', ['string-replace', 'compress']);
};
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@

noUiSlider is lightweight plugin, developed to be a jQuery UI alternative. It features cross-browser support, a `just-another-input-type` style of getting and setting values, a wide range of options and support for a bunch of touch devices. It works wonders on Android phones, iPhone & iPad, Windows phone and touch-screen laptops and tablets. It works excellent on the desktop too; All modern browsers and IE7+ are supported. The end result? A lean, extendible and bloat-less plugin that'll just do its job. To add even more flexibility, noUiSlider is compatible with both jQuery and Zepto.js. Oh, and the licensing terms are simple: [just do what you want](http://www.wtfpl.net/about/).

Documentation
-------
An extensive documentation, including **examples**, **options** and **configuration details**, is available here: [noUiSlider documentation](http://refreshless.com/nouislider/).

Changelog
---------
Latest changes:
+ Fixed an issue with the handle `z-index`. (#333)
+ Added pips formatting. (#330)
+ Added Grunt-based tasks.

**Note for Bower users:**
The repository no longers contains any minified files. As you are using npm anyway, simply run `npm install` & `grunt create` to generate them.

noUiSlider is currently on version 7.0. This version contains significant changes from 6.2, improving various aspects and moving some features in their own module.
noUiSlider is currently on version 7. This version contains significant changes from 6, improving various aspects and moving some features in their own module.
+ All serialization features are now supported by my new project, [libLink](http://refreshless.com/liblink/).
+ All number formatting features have been moved into the [wNumb formatting library](http://refreshless.com/wnumb/).
+ The val method now only takes values, as all additional options are now automaticly detected.
Expand All @@ -18,11 +29,6 @@ noUiSlider is currently on version 7.0. This version contains significant change
+ Added generation of pips/range points (#254, #260).
+ Fixed `tap` ignoring `margin` (#265).


Documentation
-------
An extensive documentation, including **examples**, **options** and **configuration details**, is available here: [noUiSlider documentation](http://refreshless.com/nouislider/).

Unit Testing
------------
Unit tests where overhauled for noUiSlider 7. Most code is now covered, with events testing being slightly lacking due to it's browser dependant nature.
Expand All @@ -32,8 +38,7 @@ Version numbering
Version numbering follows the 'Semantic versioning' style.
You'll find an excellent documentation at [Semver.org](http://semver.org/).

Compression and error checking
Contributing
------------------------------
The plugin code is checked using ([JsLint](http://jslint.com/)). Any remaining errors and warnings are intentional.

The plugin is compressed using the ([Google Closure Compiler](http://closure-compiler.appspot.com/home)). The source was initialy adapted to facilitate the `ADVANCED_OPTIMIZATIONS` level, but the risks this poses regarding to unintented renaming proved problematic. On Windows, the BAT script in this repository can be used to run the compiler. On OS X or Linux enviroments, simply run the `java -jar` command from the command line.
The plugin code can be managed using a Grunt-based task runner.
Use `npm install` to fetch all dependancies, then `grunt concat` to merge all files.
4 changes: 0 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"input",
"slide"
],
"main": [
"jquery.nouislider.min.js",
"jquery.nouislider.css"
],
"dependencies": {
"jquery": ">= 1.7.0"
},
Expand Down
42 changes: 0 additions & 42 deletions compile.bat

This file was deleted.

Loading

0 comments on commit 127be4f

Please sign in to comment.