From 82f6ebaa8efa91293782f72705cbd43861107022 Mon Sep 17 00:00:00 2001 From: Ben Boyle Date: Thu, 3 Apr 2014 12:19:18 +1000 Subject: [PATCH] update bower - use latest jquery - use latest generate-id - simplified ignore - add explicit tests for jquery 1.7.2 - bump versions --- Gruntfile.js | 11 +++++++++++ bower.json | 11 +++++------ dist/form-validation.js | 2 +- dist/form-validation.min.js | 2 +- libs/jquery-loader.js | 2 +- package.json | 2 +- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e777ef7..16ad1eb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -76,6 +76,17 @@ module.exports = function( grunt ) { 'http://localhost:8000/test/submit-suppression.html?jquery=1.4.4', 'http://localhost:8000/test/submit.html?jquery=1.4.4', 'http://localhost:8000/test/validationMessage.html?jquery=1.4.4', + // 1.7.2 + 'http://localhost:8000/test/alert.html?jquery=1.7.2', + 'http://localhost:8000/test/groups.html?jquery=1.7.2', + 'http://localhost:8000/test/hints.html?jquery=1.7.2', + 'http://localhost:8000/test/invalid.html?jquery=1.7.2', + 'http://localhost:8000/test/labels.html?jquery=1.7.2', + 'http://localhost:8000/test/markup.html?jquery=1.7.2', + 'http://localhost:8000/test/questions.html?jquery=1.7.2', + 'http://localhost:8000/test/submit-suppression.html?jquery=1.7.2', + 'http://localhost:8000/test/submit.html?jquery=1.7.2', + 'http://localhost:8000/test/validationMessage.html?jquery=1.7.2', // 2.1.0 'http://localhost:8000/test/alert.html?jquery=2.1.0', 'http://localhost:8000/test/groups.html?jquery=2.1.0', diff --git a/bower.json b/bower.json index d5bceb4..124a90f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "form-validation", - "version": "1.0.3", + "version": "1.0.4", "homepage": "https://github.com/bboyle/form-validation", "authors": [ "Ben Boyle " @@ -20,19 +20,18 @@ "private": true, "ignore": [ "**/.*", - "bower.json", + "*.json", "CONTRIBUTING.md", "Gruntfile.js", - "package.json", + "bower_components", "libs", "node_modules", - "bower_components", "src", "test" ], "dependencies": { - "jquery": "1.7.2", - "generate-id": "https://github.com/bboyle/Generate-ID.git#~0.1.1", + "jquery": "*", + "generate-id": "https://github.com/bboyle/Generate-ID.git", "html5-constraint-validation-API": "https://github.com/bboyle/html5-constraint-validation-API.git" } } diff --git a/dist/form-validation.js b/dist/form-validation.js index 0a6ee17..fab4d47 100644 --- a/dist/form-validation.js +++ b/dist/form-validation.js @@ -1,4 +1,4 @@ -/*! Form validation - v1.0.2 - 2014-04-03 +/*! Form validation - v1.0.4 - 2014-04-03 * https://github.com/bboyle/form-validation * Copyright (c) 2014 Ben Boyle; Licensed MIT */ (function( $ ) { diff --git a/dist/form-validation.min.js b/dist/form-validation.min.js index f692931..8a13db6 100644 --- a/dist/form-validation.min.js +++ b/dist/form-validation.min.js @@ -1,4 +1,4 @@ -/*! Form validation - v1.0.2 - 2014-04-03 +/*! Form validation - v1.0.4 - 2014-04-03 * https://github.com/bboyle/form-validation * Copyright (c) 2014 Ben Boyle; Licensed MIT */ !function(a){"use strict";var b=1e4,c='

Please check your answers

    ',d="input, select, textarea",e=function(){return!(this.disabled||this.validity.valid)},f="formValidation",g=function(a,b){var c=this.data(f)||this.data(f,{}).data(f);return"undefined"!=typeof a?"undefined"!=typeof b?(c[a]=b,b):"undefined"!=typeof c[a]?c[a]:null:c},h=function(b,c){return this.map(function(d,e){var f=a(e),g=null,h=null;return"object"==typeof c&&"group"===c.level?h=f.formValidation("group").find(b)[0]:f.is(":radio, :checkbox")?h=f.closest("fieldset").find(b)[0]:(g=f.closest("form").find('label[for="'+e.id+'"]'),h=g.children(b)[0],h||".hint"===b&&(g.append(''),h=g.children(b)[0])),h})},i=function(){var b,c,f=a(this),g=f.formValidation("alert");this.validity.valid?(f.formValidation("question").find(".alert").filter(g).length>0?g.remove():(c=f.formValidation("group").find(d).filter(e),c.length>0?g.text(c.formValidation("getValidationMessage")):g.remove()),f.parentsUntil("form",".invalid").filter(function(){return 0===a(this).find(d).filter(e).length}).removeClass("invalid").find(".alert").remove()):(0===g.length&&(g=a('')),g.text(f.formValidation("getValidationMessage")),f.formValidation("group").hasClass("atomic")&&(b={level:"group"}),f.formValidation("label",b).parent().find('.label, abbr[title="(required)"]').eq(-1).after(g))},j=function(){var b=a(this).closest("form"),e=b.find(d).filter(function j(){if(this.disabled)return!1;if(j.cache){if(j.cache[this.name]===!0)return!1}else j.cache={};return j.cache[this.name]=!0,this.validity&&!this.validity.valid}),f=g.call(b,"summaryElement")||g.call(b,"summaryElement",a(c)),h=f.find("ol"),i=!0;return e.length>0&&(h.find("li").remove(),e.each(function(){var b,c,d=a(this),e=d.formValidation("group"),f=d.formValidation("label",{level:e.length>0?"group":null});b=f.length>0?f[0].id||f.generateId("label-"+this.id)[0].id:this.name,c=g.call(d,"summaryElement")||g.call(d,"summaryElement",a('
  1. ')),0===e.length||e[0]!==i?(i=e[0],c.find("a").text(f.text().replace(/\?$/,"")+": "+d.formValidation("getValidationMessage")).end().appendTo(h)):c.remove()})),e.length},k=function(b){var c=j.call(this),f=a(this);return f.find(".invalid").filter(function(){return 0===a(this).find(d).filter(e).length}).removeClass("invalid").find(".alert").remove(),c>0?(b.stopImmediatePropagation(),b.preventDefault(),function(b){var c=g.call(b,"summaryElement");b.prev(".status").not(c).remove(),b.before(c.fadeIn()),a(window).scrollTop(c.offset().top)}(f),f.find(d).filter(e).each(function(){i.call(this)}).parentsUntil("form",".questions > li").not(".section, .compact").addClass("invalid"),f.trigger("x-invalid"),!1):void 0},l=function(c){var d,e=c.timeStamp||a.now(),f=a(this),h=g.call(f,"summaryElement");return h&&h.remove(),d=g.call(f,"lastSubmitTimeStamp"),d&&b>e-d?(c.stopImmediatePropagation(),c.preventDefault(),!1):void g.call(f,"lastSubmitTimeStamp",e)},m={alert:function(){return this.map(function(b,c){var d,e=a(c);return e.is(":radio, :checkbox")===!0?e.closest("fieldset").find("legend > .alert")[0]:(d=e.formValidation("group").filter(".atomic"),d.length>0?d.find("legend > .alert")[0]:a('label[for="'+c.id+'"] > .alert')[0])})},label:function(a){return h.call(this,".label",a)},hint:function(a){return h.call(this,".hint",a)},question:function(b){return"object"==typeof b&&"group"===b.level?this.formValidation("group"):this.map(function(b,c){return a(c).parentsUntil("form",".questions > li")[0]})},group:function(){return this.map(function(b,c){return a(c).parentsUntil("form",".group").filter(function(){return a(this).children("fieldset").length>0})[0]})},validate:function(){return this.each(function(){a(this).closest("form").attr("novalidate",!0).unbind("submit",l).unbind("submit",k).bind("submit",k).bind("submit",l).find(d).unbind("change",i).bind("change",i)})},getValidationMessage:function(){var a=this[0].validity;return"undefined"==typeof a||a.valid===!0?"":a.valueMissing?"Must be completed":a.customError?this[0].validationMessage:a.typeMismatch?"Must be an email address":a.patternMismatch?"Must use the format shown":"Must be a valid answer"}};a.fn.formValidation=function(b){return m[b]?m[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?void a.error("Method "+b+" does not exist on jQuery.formValidation"):m.init.apply(this,arguments)},a.fn.forcesForms=a.fn.formValidation}(jQuery); \ No newline at end of file diff --git a/libs/jquery-loader.js b/libs/jquery-loader.js index 7de63c5..f746ee4 100644 --- a/libs/jquery-loader.js +++ b/libs/jquery-loader.js @@ -1,6 +1,6 @@ (function() { // Default to the local version. - var path = '../bower_components/jquery/jquery.js'; + var path = '../bower_components/jquery/dist/jquery.js'; // Get any jquery=___ param from the query string. var jqversion = location.search.match(/[?&]jquery=(.*?)(?=&|$)/); // If a version was specified, use that version from code.jquery.com. diff --git a/package.json b/package.json index bd251ad..b6b6391 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "form-validation", "title": "Form validation", "description": "Validation UI for web forms using the HTML5 constraint validation API", - "version": "1.0.3", + "version": "1.0.4", "homepage": "https://github.com/bboyle/form-validation", "author": { "name": "Ben Boyle",