Permalink
Browse files

Moved over to grunt.js build system

- Changed license to just MIT
- Updated qunit to latest version
- Did some adjustments based on JSHint feedback, most `===` changes
- Removed closure compiler, build directory and Makefile
  • Loading branch information...
1 parent 2d8791e commit 63c82660fa8ca76c9805207e52c817d64bb65b88 @ryanseddon committed Jun 1, 2012
Showing with 2,535 additions and 26 deletions.
  1. +22 −0 LICENSE-MIT
  2. +1 −1 demo/index.html
  3. +61 −0 grunt.js
  4. +9 −14 h5f.js
  5. +4 −10 h5f.min.js
  6. +232 −0 libs/qunit/qunit.css
  7. +1,659 −0 libs/qunit/qunit.js
  8. +25 −0 package.json
  9. +3 −1 readme.md
  10. +332 −0 src/H5F.js
  11. +67 −0 test/H5F.html
  12. +120 −0 test/H5F_test.js
View
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Ryan Seddon
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
View
@@ -7,7 +7,7 @@
<link rel="stylesheet" type="text/css" href="_styles.css" media="screen" />
- <script type="text/javascript" src="../h5f.js"></script>
+ <script type="text/javascript" src="../H5F.min.js"></script>
<script type="text/javascript">
window.onload = function() {
/*
View
@@ -0,0 +1,61 @@
+/*global module:false*/
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: '<json:package.json>',
+ meta: {
+ banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
+ '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
+ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
+ ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
+ },
+ concat: {
+ dist: {
+ src: ['<banner:meta.banner>', '<file_strip_banner:src/<%= pkg.name %>.js>'],
+ dest: '<%= pkg.name %>.js'
+ }
+ },
+ min: {
+ dist: {
+ src: ['<banner:meta.banner>', '<config:concat.dist.dest>'],
+ dest: '<%= pkg.name %>.min.js'
+ }
+ },
+ qunit: {
+ files: ['test/**/*.html']
+ },
+ lint: {
+ files: ['grunt.js', 'src/**/*.js', 'test/**/*.js']
+ },
+ watch: {
+ files: '<config:lint.files>',
+ tasks: 'lint qunit'
+ },
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ boss: true,
+ eqnull: true,
+ browser: true,
+ regexdash: true
+ },
+ globals: {
+ jQuery: true
+ }
+ },
+ uglify: {}
+ });
+
+ // Default task.
+ grunt.registerTask('default', 'lint qunit concat min');
+
+};
View
23 h5f.js
@@ -1,11 +1,6 @@
-/*
- * HTML5 Forms Chapter JavaScript Library
- * http://thecssninja.com/javascript/H5F
- *
- * Copyright (c) 2010-2011 Ryan Seddon - http://thecssninja.com/
- * Dual-licensed under the BSD and MIT licenses.
- * http://thecssninja.com/H5F/license.txt
- */
+/*! H5F - v1.0.0 - 2012-06-01
+* https://github.com/ryanseddon/H5F/
+* Copyright (c) 2012 Ryan Seddon; Licensed MIT */
var H5F = H5F || {};
@@ -29,9 +24,9 @@ var H5F = H5F || {};
placeholderClass : "placeholder"
};
- if(typeof settings == "object") {
+ if(typeof settings === "object") {
for (var i in opts) {
- if(typeof settings[i] == "undefined") { settings[i] = opts[i]; }
+ if(typeof settings[i] === "undefined") { settings[i] = opts[i]; }
}
}
@@ -308,26 +303,26 @@ var H5F = H5F || {};
removeClass = function (e,c) {
var re, m, arr = (typeof c === "object") ? c.length : 1, len = arr;
if (e.className) {
- if (e.className == c) {
+ if (e.className === c) {
e.className = '';
}
else {
while(arr--) {
re = new RegExp('(^|\\s)' + ((len > 1) ? c[arr] : c) + '(\\s|$)');
m = e.className.match(re);
- if (m && m.length == 3) { e.className = e.className.replace(re, (m[1] && m[2])?' ':''); }
+ if (m && m.length === 3) { e.className = e.className.replace(re, (m[1] && m[2])?' ':''); }
}
}
}
};
isHostMethod = function(o, m) {
var t = typeof o[m], reFeaturedMethod = new RegExp('^function|object$', 'i');
- return !!((reFeaturedMethod.test(t) && o[m]) || t == 'unknown');
+ return !!((reFeaturedMethod.test(t) && o[m]) || t === 'unknown');
};
// Since all methods are only used internally no need to expose globally
window["H5F"] = {
setup: setup
};
-})(document);
+}(document));
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 63c8266

Please sign in to comment.