From 95911d5e0c941577c05ba166a0ee7fc9a5040467 Mon Sep 17 00:00:00 2001 From: Derrick Ko Date: Tue, 19 Jul 2016 18:19:34 -0700 Subject: [PATCH] Bump version along with new 1.1.2 min version. --- mailcheck.jquery.json | 2 +- package.json | 8 ++++---- src/mailcheck.js | 2 +- src/mailcheck.min.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mailcheck.jquery.json b/mailcheck.jquery.json index 37ca293..f26464e 100644 --- a/mailcheck.jquery.json +++ b/mailcheck.jquery.json @@ -7,7 +7,7 @@ "email", "spell-check" ], - "version": "1.1.1", + "version": "1.1.2", "author": { "name": "Derrick Ko", "url": "http://derrickko.com", diff --git a/package.json b/package.json index e55edf3..f7cbddb 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "mailcheck", "title": "mailcheck", - "description": "A standalone module that suggests a right domain when your users misspell it in an email address.", + "description": "Reduce misspelled email addresses in your forms.", "keywords": [ "form", "email", "spell check" ], - "version": "1.1.1", + "version": "1.1.2", "author": { "name": "Derrick Ko", "url": "http://derrickko.com", @@ -32,8 +32,8 @@ "dependencies": {}, "devDependencies": { "jasmine-node": "1.x", - "grunt": "0.4.x", - "grunt-contrib-uglify": "~0.2.4", + "grunt": "~0.4", + "grunt-contrib-uglify": "~0.2", "grunt-jasmine-node": "~0.1.0", "grunt-cli": "~0.1.9" }, diff --git a/src/mailcheck.js b/src/mailcheck.js index c4ab69e..3e6ff94 100644 --- a/src/mailcheck.js +++ b/src/mailcheck.js @@ -5,7 +5,7 @@ * * Released under the MIT License. * - * v 1.1.1 + * v 1.1.2 */ var Mailcheck = { diff --git a/src/mailcheck.min.js b/src/mailcheck.min.js index 6742b58..3f58378 100644 --- a/src/mailcheck.min.js +++ b/src/mailcheck.min.js @@ -1 +1 @@ -/*! mailcheck v1.1.1 @licence MIT */var Mailcheck={domainThreshold:2,secondLevelThreshold:2,topLevelThreshold:2,defaultDomains:["msn.com","bellsouth.net","telus.net","comcast.net","optusnet.com.au","earthlink.net","qq.com","sky.com","icloud.com","mac.com","sympatico.ca","googlemail.com","att.net","xtra.co.nz","web.de","cox.net","gmail.com","ymail.com","aim.com","rogers.com","verizon.net","rocketmail.com","google.com","optonline.net","sbcglobal.net","aol.com","me.com","btinternet.com","charter.net","shaw.ca"],defaultSecondLevelDomains:["yahoo","hotmail","mail","live","outlook","gmx"],defaultTopLevelDomains:["com","com.au","com.tw","ca","co.nz","co.uk","de","fr","it","ru","net","org","edu","gov","jp","nl","kr","se","eu","ie","co.il","us","at","be","dk","hk","es","gr","ch","no","cz","in","net","net.au","info","biz","mil","co.jp","sg","hu"],run:function(a){a.domains=a.domains||Mailcheck.defaultDomains,a.secondLevelDomains=a.secondLevelDomains||Mailcheck.defaultSecondLevelDomains,a.topLevelDomains=a.topLevelDomains||Mailcheck.defaultTopLevelDomains,a.distanceFunction=a.distanceFunction||Mailcheck.sift3Distance;var b=function(a){return a},c=a.suggested||b,d=a.empty||b,e=Mailcheck.suggest(Mailcheck.encodeEmail(a.email),a.domains,a.secondLevelDomains,a.topLevelDomains,a.distanceFunction);return e?c(e):d()},suggest:function(a,b,c,d,e){a=a.toLowerCase();var f=this.splitEmail(a);if(c&&d&&-1!==c.indexOf(f.secondLevelDomain)&&-1!==d.indexOf(f.topLevelDomain))return!1;var g=this.findClosestDomain(f.domain,b,e,this.domainThreshold);if(g)return g==f.domain?!1:{address:f.address,domain:g,full:f.address+"@"+g};var h=this.findClosestDomain(f.secondLevelDomain,c,e,this.secondLevelThreshold),i=this.findClosestDomain(f.topLevelDomain,d,e,this.topLevelThreshold);if(f.domain){var g=f.domain,j=!1;if(h&&h!=f.secondLevelDomain&&(g=g.replace(f.secondLevelDomain,h),j=!0),i&&i!=f.topLevelDomain&&(g=g.replace(new RegExp(f.topLevelDomain+"$"),i),j=!0),1==j)return{address:f.address,domain:g,full:f.address+"@"+g}}return!1},findClosestDomain:function(a,b,c,d){d=d||this.topLevelThreshold;var e,f=99,g=null;if(!a||!b)return!1;c||(c=this.sift3Distance);for(var h=0;he&&(f=e,g=b[h])}return d>=f&&null!==g?g:!1},sift3Distance:function(a,b){if(null==a||0===a.length)return null==b||0===b.length?0:b.length;if(null==b||0===b.length)return a.length;for(var c=0,d=0,e=0,f=0,g=5;c+dh;h++){if(c+he&&(f=e,g=b[h])}return d>=f&&null!==g?g:!1},sift3Distance:function(a,b){if(null==a||0===a.length)return null==b||0===b.length?0:b.length;if(null==b||0===b.length)return a.length;for(var c=0,d=0,e=0,f=0,g=5;c+dh;h++){if(c+h