vendor/assets/javascripts/webshims/shims/form-shim-extend.js in webshims-rails-1.10.9 vs vendor/assets/javascripts/webshims/shims/form-shim-extend.js in webshims-rails-1.10.10

- old
+ new

@@ -255,12 +255,20 @@ webshims.addInputType('email', { mismatch: (function(){ //taken from http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address - var test = cfg.emailReg || /^[a-zA-Z0-9.!#$%&'*+-\/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; + var test = cfg.emailReg || /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; return function(val){ + // optional punycode support: https://github.com/bestiejs/punycode.js + if(window.punycode && punycode.toASCII){ + try { + if( test.test(punycode.toASCII(val)) ){ + return false; + } + } catch(er){} + } return !test.test(val); }; })() }); @@ -1762,13 +1770,10 @@ focusout: unbind, 'input updateInput change': trigger }); } ; - if($.event.customEvent){ - $.event.customEvent.updateInput = true; - } - + $(doc) .on('focusin', function(e){ if( e.target && !e.target.readOnly && !e.target.disabled && (e.target.nodeName || '').toLowerCase() == 'input' && !noInputTypes[e.target.type] && !(webshims.data(e.target, 'implemented') || {}).inputwidgets){ observe($(e.target)); }