Skip to content

Commit

Permalink
Merge pull request #17 from NYPD/feature-remove-zepto
Browse files Browse the repository at this point in the history
Removed ritsu-zepto and related code

Closes #15
  • Loading branch information
NYPD committed Sep 29, 2016
2 parents 0eff525 + 81eed91 commit 5b37884
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 617 deletions.
95 changes: 44 additions & 51 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ module.exports = function(grunt) {
grunt.initConfig({

pkg: grunt.file.readJSON('package.json'),
banner: '/* ritsu.js v<%= pkg.version %> \n' +
' * Created <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * Licensed under the <%= pkg.license %> license\n' +
' * Source code can be found here: <%= pkg.repository.url %> \n' +
' */\n',

/* grunt stamp ************************************************************/
stamp: {
options: {
banner: '<%= banner %>'
},
yourTarget: {
files: {
src: 'dist/**'
}
}
},

/* css minify Task ********************************************************/
cssmin: {
Expand All @@ -19,74 +36,49 @@ module.exports = function(grunt) {

/* Uglify Task *************************************************************/
uglify: {
options: {
preserveComments: false
},
base: {
options: {
banner: '/* ritsu.js v<%= pkg.version %> \n' +
' * Created <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * Licensed under the <%= pkg.license %> license\n' +
' * Source code can be found here: <%= pkg.repository.url %> \n' +
' */\n'
},
files: {
'dist/min/ritsu.min.js': ['dist/ritsu.js']
}
},
zepto: {
options: {
banner: '/* ritsu-zepto.js v<%= pkg.version %> \n' +
' * Created <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * Licensed under the <%= pkg.license %> license\n' +
' * Source code can be found here: <%= pkg.repository.url %> \n' +
' */\n'
},
files: {
'dist/min/ritsu-zepto.min.js': ['dist/ritsu-zepto.js']
}
options: {
preserveComments: false
},
base: {
files: {
'dist/min/ritsu.min.js': ['dist/ritsu.js']
}
}
},

/* Concat Task **************************************************************/
/* Concat Task **************************************************************/
concat: {
base: {
src: ['src/rules.js', 'src/core.js'],
dest: 'dist/ritsu.js'
},
zepto: {
src: ['vendor/zepto.min.js', 'src/rules.js', 'src/core.js'],
dest: 'dist/ritsu-zepto.js'
}
},

/* Copy Task **************************************************************/
copy: {
main: {
files: [
{
src: 'src/validation-styles.css',
dest: 'dist/ritsu.css'
}
]
files: [{
src: 'src/validation-styles.css',
dest: 'dist/ritsu.css'
}]
},
},

/* Watch Task **************************************************************/
watch: {
configFiles: {
files: ['Gruntfile.js'],
tasks: ['concat','uglify','copy','cssmin']
},
css: {
files: ['src/*.css'],
tasks: ['cssmin','copy']
},
configFiles: {
files: ['Gruntfile.js'],
tasks: ['concat', 'uglify', 'copy', 'cssmin', 'stamp']
},
css: {
files: ['src/*.css'],
tasks: ['cssmin', 'copy', 'stamp']
},
scripts: {
files: ['src/*.js'],
tasks: ['concat','uglify','copy']
}
}
files: ['src/*.js'],
tasks: ['concat', 'uglify', 'copy', 'stamp']
}
}
});

// Load dem plugins
Expand All @@ -95,8 +87,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-stamp');

//Register dem tasks
grunt.registerTask('default',['watch']);
grunt.registerTask('build',['copy','concat','uglify','cssmin']);
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['copy', 'concat', 'uglify', 'cssmin', 'stamp']);
};
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# ritsu.js
HTML form validation
HTML form validation and utilities.

## What is this?
A dumb and simple little HTML form validator. It relies heavily on HTML classes to make it very simple to validate input fields.

## Why?
This all started as a need to easily validate my own forms without being able to use someone else's validation plug-in. The result was a mini validation library that has worked pretty well for my projects.
This all started as a need to easily validate my own forms fields without being able to use someone else's validation plug-in. The result was a mini validation library that has worked pretty well for my projects.

Perhaps someone else will find this useful.

## Which?
The ritsu.js will assume you are using jQuery in your projects. Works with jQuery 1.7.2 + and I think should work with jQuery 1.6 as well.
## Dependencies?
ritsu.js requires jQuery `v1.2.3` or greater to be included in your project. It also will try to with jQuery-compatible API's like [Zepto.js](http://zeptojs.com/).

The ritsu-zepto.js will use the [Zepto.js](http://zeptojs.com/) JavaScript library as substitution for jQuery if you do not have that in your project. Keep in mind the Zepto.js [supported browsers.](http://zeptojs.com/#browsers)

Ritsu.js uses [Bootstrap ](http://getbootstrap.com/) default styling class names. If Bootstrap is not being used in your project, include the ritsu.min.css / ritsu.css file in your page or copy the styles in there. Feel free to adapt your own styles.
As far as styling is concerned, ritsu.js uses [Bootstrap](http://getbootstrap.com/) default styling class names. If Bootstrap is not being used in your project, include the ritsu.min.css / ritsu.css file in your page. Feel free to adapt your own styles if you want by implementing the CSS styles used in ritsu.js.

## Documentation
Read the [wiki.](https://github.com/NYPD/ritsu.js/wiki)

## Anything else?
Down the road I am planning to remove the jQuery dependency and go with a pure JavaScript approach.
7 changes: 0 additions & 7 deletions dist/min/ritsu-zepto.min.js

This file was deleted.

8 changes: 7 additions & 1 deletion dist/min/ritsu.min.css
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
.has-error{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.error-label{color:#a94442}
/* ritsu.js v0.1.1
* Created 2016-09-29
* Licensed under the MIT license
* Source code can be found here: https://github.com/NYPD/ritsu
*/

.has-error{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.error-label{color:#a94442}
Loading

0 comments on commit 5b37884

Please sign in to comment.