vendor/assets/javascripts/webshims/shims/combos/31.js in webshims-rails-1.14.3 vs vendor/assets/javascripts/webshims/shims/combos/31.js in webshims-rails-1.14.4
- old
+ new
@@ -60,11 +60,11 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty;
- webshims.assumeARIA = supportGetSetAttribute || Modernizr.canvas || Modernizr.video || Modernizr.boxsizing;
+ webshims.assumeARIA = true;
if($('<input type="email" />').attr('type') == 'text' || $('<form />').attr('novalidate') === "" || ('required' in $('<input />')[0].attributes)){
webshims.error("IE browser modes are busted in IE10+. Please test your HTML/CSS/JS with a real IE version or at least IETester or similiar tools");
}
@@ -79,19 +79,10 @@
if (window.$) {
window.$ = webshims.$;
}
window.jQuery = webshims.$;
}
- if(webshims.M != Modernizr){
- webshims.error("Modernizr was included more than once. Make sure to include it only once! Webshims and other scripts might not work properly.");
- for(var i in Modernizr){
- if(!(i in webshims.M)){
- webshims.M[i] = Modernizr[i];
- }
- }
- Modernizr = webshims.M;
- }
};
switch$();
setTimeout(switch$, 90);
webshims.ready('DOM', switch$);
$(switch$);
@@ -416,11 +407,11 @@
var extendNativeValue = (function(){
var UNKNOWN = webshims.getPrototypeOf(document.createElement('foobar'));
//see also: https://github.com/lojjic/PIE/issues/40 | https://prototype.lighthouseapp.com/projects/8886/tickets/1107-ie8-fatal-crash-when-prototypejs-is-loaded-with-rounded-cornershtc
- var isExtendNativeSave = Modernizr.advancedObjectProperties && Modernizr.objectAccessor;
+ var isExtendNativeSave = webshims.support.advancedObjectProperties && webshims.support.objectAccessor;
return function(nodeName, prop, desc){
var elem , elemProto;
if( isExtendNativeSave && (elem = document.createElement(nodeName)) && (elemProto = webshims.getPrototypeOf(elem)) && UNKNOWN !== elemProto && ( !elem[prop] || !has.call(elem, prop) ) ){
var sup = elem[prop];
desc._supvalue = function(){
@@ -727,11 +718,11 @@
docObserve.handler({type: 'boxsizing'});
}
});
}
webshims.ready('WINDOWLOAD', this.test);
- $(document).on('updatelayout.webshim pageinit popupafteropen panelbeforeopen tabsactivate collapsibleexpand shown.bs.modal shown.bs.collapse slid.bs.carousel', this.handler);
+ $(document).on('updatelayout.webshim pageinit popupafteropen panelbeforeopen tabsactivate collapsibleexpand shown.bs.modal shown.bs.collapse slid.bs.carousel playerdimensionchange', this.handler);
$(window).on('resize', this.handler);
}
}
};
@@ -1237,17 +1228,14 @@
return !!(isDefaultPrevented.apply(this, arguments) || $.data(e.target, e.type + 'DefaultPrevented') || false);
};
e._isPolyfilled = true;
}
};
-
- if(Modernizr.formvalidation && !webshims.bugs.bustedValidity){
- //create delegatable events
- webshims.capturingEvents(['invalid'], true);
- }
+
var modules = webshims.modules;
+ var support = webshims.support;
var isValid = function(elem){
return ($.prop(elem, 'validity') || {valid: 1}).valid;
};
var lazyLoad = function(){
var toLoad = ['form-validation'];
@@ -1297,11 +1285,11 @@
},
"required-element": function(elem){
return !!($.prop(elem, 'willValidate') && $.prop(elem, 'required'));
},
"user-error": function(elem){
- return ($.prop(elem, 'willValidate') && $(elem).hasClass('user-error'));
+ return ($.prop(elem, 'willValidate') && $(elem).getShadowElement().hasClass((options.iVal.errorClass || 'user-error')));
},
"optional-element": function(elem){
return !!($.prop(elem, 'willValidate') && $.prop(elem, 'required') === false);
}
});
@@ -1309,11 +1297,11 @@
['valid', 'invalid', 'required', 'optional'].forEach(function(name){
exp[name] = $.expr[":"][name+"-element"];
});
// sizzle/jQuery has a bug with :disabled/:enabled selectors
- if(Modernizr.fieldsetdisabled && !$('<fieldset disabled=""><input /><input /></fieldset>').find(':disabled').filter(':disabled').is(':disabled')){
+ if(support.fieldsetdisabled && !$('<fieldset disabled=""><input /><input /></fieldset>').find(':disabled').filter(':disabled').is(':disabled')){
matches = $.find.matches;
matchesOverride = {':disabled': 1, ':enabled': 1};
$.find.matches = function(expr, elements){
if(matchesOverride[expr]){
return matches.call(this, '*'+expr, elements);
@@ -1363,10 +1351,14 @@
addModule('form-validation', $.extend({d: ['form-message']}, formExtras));
addModule('form-validators', $.extend({}, formExtras));
+ if(support.formvalidation && !webshims.bugs.bustedValidity){
+ //create delegatable events
+ webshims.capturingEvents(['invalid'], true);
+ }
if($.expr.filters){
extendSels();
} else {
webshims.ready('sizzle', extendSels);
@@ -1508,11 +1500,11 @@
}
});
webshims.ready('WINDOWLOAD', lazyLoad);
- if(modules['form-number-date-ui'].loaded && !options.customMessages && (modules['form-number-date-api'].test() || (Modernizr.inputtypes.range && Modernizr.inputtypes.color))){
+ if(modules['form-number-date-ui'].loaded && !options.customMessages && (modules['form-number-date-api'].test() || (support.inputtypes.range && support.inputtypes.color))){
webshims.isReady('form-number-date-ui', true);
}
webshims.ready('DOM', function(){
if(document.querySelector('.ws-custom-file')){
@@ -1590,11 +1582,11 @@
/*
* Implements datalist element and list attribute
*/
(function(){
- var formsCFG = $.webshims.cfg.forms;
- var listSupport = Modernizr.input.list;
+ var formsCFG = webshims.cfg.forms;
+ var listSupport = webshims.support.datalist;
if(listSupport && !formsCFG.customDatalist){return;}
var initializeDatalist = function(){
var updateDatlistAndOptions = function(){