Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 63fc99d

Browse files
committed
pushing all files up - first pass at organizing this thing
1 parent bf126f9 commit 63fc99d

29 files changed

+12366
-3
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
/node_modules/

.jshintrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"curly": true,
3+
"eqeqeq": true,
4+
"immed": true,
5+
"latedef": true,
6+
"newcap": true,
7+
"noarg": true,
8+
"sub": true,
9+
"undef": true,
10+
"unused": true,
11+
"boss": true,
12+
"eqnull": true,
13+
"node": true
14+
}

COMPONENTNAME.jquery.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "validator",
3+
"title": "validator",
4+
"description": "validator description",
5+
"version": "0.1.0",
6+
"homepage": "https://github.com/filamentgroup/validator",
7+
"author": {
8+
"name": "Filament Group",
9+
"email": "[email protected]",
10+
"url": "http://www.filamentgroup.com"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/filamentgroup/validator.git"
15+
},
16+
"bugs": "https://github.com/filamentgroup/validator/issues",
17+
"licenses": [
18+
{
19+
"type": "MIT",
20+
"url": "https://github.com/filamentgroup/validator/blob/master/LICENSE-MIT"
21+
}
22+
],
23+
"dependencies": {
24+
"jquery": "*"
25+
},
26+
"keywords": []
27+
}

CONTRIBUTING.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing
2+
3+
## Important notes
4+
Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory!
5+
6+
### Code style
7+
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.**
8+
9+
### PhantomJS
10+
While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers.
11+
12+
## Modifying the code
13+
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.
14+
15+
Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started).
16+
17+
1. Fork and clone the repo.
18+
1. Run `npm install` to install all dependencies (including Grunt).
19+
1. Run `grunt` to grunt this project.
20+
21+
Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.
22+
23+
## Submitting pull requests
24+
25+
1. Create a new branch, please don't work in your `master` branch directly.
26+
1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail.
27+
1. Fix stuff.
28+
1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done.
29+
1. Open `test/*.html` unit test file(s) in actual browser to ensure tests pass everywhere.
30+
1. Update the documentation to reflect any changes.
31+
1. Push to your fork and submit a pull request.

README.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
1-
validation
2-
==========
1+
# Validator
32

4-
Form validation goodies
3+
Description
4+
5+
## Getting Started
6+
Download the [production version][min] or the [development version][max].
7+
8+
[min]: https://raw.github.com/filamentgroup/validator/master/dist/validator.min.js
9+
[max]: https://raw.github.com/filamentgroup/validator/master/dist/validator.js
10+
11+
In your web page:
12+
13+
```html
14+
<script src="jquery.js"></script>
15+
<script src="dist/validator.min.js"></script>
16+
<script>
17+
jQuery(function($) {
18+
$( document ).bind( "enhance", function(){
19+
$( "body" ).addClass( "enhanced" );
20+
});
21+
22+
$( document ).trigger( "enhance" );
23+
});
24+
</script>
25+
```
26+
27+
## Demo
28+
Check the demo [here](http://filamentgroup.github.io/validator/)
29+
30+
## Release History
31+
v0.1.0 - First release

examples/index.html

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>validator Examples</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<style>
8+
body {
9+
font-family: sans-serif;
10+
}
11+
12+
</style>
13+
<link rel="stylesheet" href="../src/validator.css" />
14+
</head>
15+
<body>
16+
17+
<!-- markup here -->
18+
19+
20+
<!-- normally you would concatenate these -->
21+
<script src="../libs/jquery/jquery.js"></script>
22+
<script src="../src/validator.config.json"></script>
23+
<script src="../src/validator.js"></script>
24+
<script src="../src/validator-init.js"></script>
25+
<script src="init.js"></script>
26+
</body>
27+
</html>

examples/init.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// DOM-ready auto-init of plugins.
2+
// Many plugins bind to an "enhance" event to init themselves on dom ready, or when new markup is inserted into the DOM
3+
(function( $ ){
4+
$( function(){
5+
$( document ).bind( "enhance", function(){
6+
$( "body" ).addClass( "enhanced" );
7+
});
8+
9+
$( document ).trigger( "enhance" );
10+
});
11+
}( jQuery ));

gruntfile.js

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*global module:true*/
2+
(function(){
3+
'use strict';
4+
5+
module.exports = function(grunt) {
6+
7+
// Project configuration.
8+
grunt.initConfig({
9+
// Metadata.
10+
pkg: grunt.file.readJSON('validator.jquery.json'),
11+
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
12+
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
13+
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
14+
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
15+
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
16+
// Task configuration.
17+
clean: {
18+
files: ['dist']
19+
},
20+
concat: {
21+
options: {
22+
banner: '<%= banner %>',
23+
stripBanners: true
24+
},
25+
dist: {
26+
src: ['src/<%= pkg.name %>.js'],
27+
dest: 'dist/<%= pkg.name %>.js'
28+
}
29+
},
30+
uglify: {
31+
options: {
32+
banner: '<%= banner %>'
33+
},
34+
dist: {
35+
src: ['<%= concat.dist.src %>'],
36+
dest: 'dist/<%= pkg.name %>.min.js'
37+
}
38+
},
39+
qunit: {
40+
files: ['test/**/*.html']
41+
},
42+
jshint: {
43+
gruntfile: {
44+
options: {
45+
jshintrc: '.jshintrc'
46+
},
47+
src: 'Gruntfile.js'
48+
},
49+
src: {
50+
options: {
51+
jshintrc: 'src/.jshintrc'
52+
},
53+
src: ['src/**/*.js']
54+
},
55+
test: {
56+
options: {
57+
jshintrc: 'test/.jshintrc'
58+
},
59+
src: ['test/**/*.js']
60+
}
61+
},
62+
watch: {
63+
gruntfile: {
64+
files: '<%= jshint.gruntfile.src %>',
65+
tasks: ['jshint:gruntfile']
66+
},
67+
src: {
68+
files: '<%= jshint.src.src %>',
69+
tasks: ['jshint:src', 'qunit']
70+
},
71+
test: {
72+
files: '<%= jshint.test.src %>',
73+
tasks: ['jshint:test', 'qunit']
74+
}
75+
}
76+
});
77+
78+
// These plugins provide necessary tasks.
79+
grunt.loadNpmTasks('grunt-contrib-clean');
80+
grunt.loadNpmTasks('grunt-contrib-concat');
81+
grunt.loadNpmTasks('grunt-contrib-uglify');
82+
grunt.loadNpmTasks('grunt-contrib-qunit');
83+
grunt.loadNpmTasks('grunt-contrib-jshint');
84+
grunt.loadNpmTasks('grunt-contrib-watch');
85+
86+
// Default task.
87+
grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify']);
88+
89+
};
90+
})();

0 commit comments

Comments
 (0)