webshims-rails 1.12.3 → 1.12.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webshims-rails/version.rb +2 -2
- data/vendor/assets/javascripts/webshims/polyfiller.js +75 -31
- data/vendor/assets/javascripts/webshims/shims/color-picker.js +14 -14
- data/vendor/assets/javascripts/webshims/shims/combos/1.js +83 -459
- data/vendor/assets/javascripts/webshims/shims/combos/10.js +92 -69
- data/vendor/assets/javascripts/webshims/shims/combos/11.js +90 -54
- data/vendor/assets/javascripts/webshims/shims/combos/12.js +104 -494
- data/vendor/assets/javascripts/webshims/shims/combos/13.js +66 -228
- data/vendor/assets/javascripts/webshims/shims/combos/14.js +2 -0
- data/vendor/assets/javascripts/webshims/shims/combos/15.js +42 -40
- data/vendor/assets/javascripts/webshims/shims/combos/16.js +105 -494
- data/vendor/assets/javascripts/webshims/shims/combos/17.js +90 -54
- data/vendor/assets/javascripts/webshims/shims/combos/18.js +90 -54
- data/vendor/assets/javascripts/webshims/shims/combos/19.js +123 -471
- data/vendor/assets/javascripts/webshims/shims/combos/2.js +85 -474
- data/vendor/assets/javascripts/webshims/shims/combos/20.js +85 -205
- data/vendor/assets/javascripts/webshims/shims/combos/21.js +103 -45
- data/vendor/assets/javascripts/webshims/shims/combos/22.js +41 -40
- data/vendor/assets/javascripts/webshims/shims/combos/23.js +63 -454
- data/vendor/assets/javascripts/webshims/shims/combos/24.js +52 -36
- data/vendor/assets/javascripts/webshims/shims/combos/25.js +123 -471
- data/vendor/assets/javascripts/webshims/shims/combos/26.js +2 -15
- data/vendor/assets/javascripts/webshims/shims/combos/27.js +38 -266
- data/vendor/assets/javascripts/webshims/shims/combos/28.js +20 -20
- data/vendor/assets/javascripts/webshims/shims/combos/3.js +24 -20
- data/vendor/assets/javascripts/webshims/shims/combos/30.js +24 -20
- data/vendor/assets/javascripts/webshims/shims/combos/31.js +22 -20
- data/vendor/assets/javascripts/webshims/shims/combos/4.js +4 -15
- data/vendor/assets/javascripts/webshims/shims/combos/5.js +90 -54
- data/vendor/assets/javascripts/webshims/shims/combos/6.js +90 -54
- data/vendor/assets/javascripts/webshims/shims/combos/7.js +87 -474
- data/vendor/assets/javascripts/webshims/shims/combos/8.js +87 -474
- data/vendor/assets/javascripts/webshims/shims/combos/9.js +92 -69
- data/vendor/assets/javascripts/webshims/shims/combos/99.js +1724 -0
- data/vendor/assets/javascripts/webshims/shims/dom-extend.js +2 -15
- data/vendor/assets/javascripts/webshims/shims/form-core.js +19 -4
- data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +39 -5
- data/vendor/assets/javascripts/webshims/shims/form-message.js +2 -0
- data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +69 -37
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +18 -20
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +34 -16
- data/vendor/assets/javascripts/webshims/shims/form-validation.js +12 -9
- data/vendor/assets/javascripts/webshims/shims/form-validators.js +21 -5
- data/vendor/assets/javascripts/webshims/shims/forms-picker.js +16 -13
- data/vendor/assets/javascripts/webshims/shims/geolocation.js +3 -3
- data/vendor/assets/javascripts/webshims/shims/jajax.js +1262 -0
- data/vendor/assets/javascripts/webshims/shims/jme/b.js +576 -0
- data/vendor/assets/javascripts/webshims/shims/jme/c.js +1148 -0
- data/vendor/assets/javascripts/webshims/shims/jme/controls.css +373 -0
- data/vendor/assets/javascripts/webshims/shims/jme/controls.scss +711 -0
- data/vendor/assets/javascripts/webshims/shims/jme/jme.eot +0 -0
- data/vendor/assets/javascripts/webshims/shims/jme/jme.svg +36 -0
- data/vendor/assets/javascripts/webshims/shims/jme/jme.ttf +0 -0
- data/vendor/assets/javascripts/webshims/shims/jme/jme.woff +0 -0
- data/vendor/assets/javascripts/webshims/shims/jpicker/jpicker.css +16 -18
- data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +25 -188
- data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +58 -2
- data/vendor/assets/javascripts/webshims/shims/mediaelement-native-fix.js +130 -66
- data/vendor/assets/javascripts/webshims/shims/range-ui.js +21 -17
- data/vendor/assets/javascripts/webshims/shims/sizzle.js +1634 -1613
- data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +5 -5
- data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +5 -1
- data/vendor/assets/javascripts/webshims/shims/styles/shim.css +13 -9
- data/vendor/assets/javascripts/webshims/shims/swfmini-embed.js +136 -0
- data/vendor/assets/javascripts/webshims/shims/swfmini.js +38 -266
- data/vendor/assets/javascripts/webshims/shims/track-ui.js +1 -3
- data/vendor/assets/javascripts/webshims/shims/track.js +41 -40
- metadata +13 -2
@@ -616,7 +616,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
616
616
|
$.each({ Height: "getHeight", Width: "getWidth" }, function(name, type){
|
617
617
|
var body = document.body;
|
618
618
|
var doc = document.documentElement;
|
619
|
-
docObserve[type] = function(){
|
619
|
+
docObserve[type] = function (){
|
620
620
|
return Math.max(
|
621
621
|
body[ "scroll" + name ], doc[ "scroll" + name ],
|
622
622
|
body[ "offset" + name ], doc[ "offset" + name ],
|
@@ -631,24 +631,11 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
631
631
|
this._create();
|
632
632
|
this.height = docObserve.getHeight();
|
633
633
|
this.width = docObserve.getWidth();
|
634
|
-
setInterval(this.test,
|
634
|
+
setInterval(this.test, 999);
|
635
635
|
$(this.test);
|
636
636
|
webshims.ready('WINDOWLOAD', this.test);
|
637
637
|
$(document).on('updatelayout.webshim pageinit popupafteropen panelbeforeopen tabsactivate collapsibleexpand shown.bs.modal shown.bs.collapse slid.bs.carousel', this.handler);
|
638
638
|
$(window).on('resize', this.handler);
|
639
|
-
(function(){
|
640
|
-
var oldAnimate = $.fn.animate;
|
641
|
-
var animationTimer;
|
642
|
-
|
643
|
-
$.fn.animate = function(){
|
644
|
-
clearTimeout(animationTimer);
|
645
|
-
animationTimer = setTimeout(function(){
|
646
|
-
docObserve.test();
|
647
|
-
}, 99);
|
648
|
-
|
649
|
-
return oldAnimate.apply(this, arguments);
|
650
|
-
};
|
651
|
-
})();
|
652
639
|
}
|
653
640
|
}
|
654
641
|
};
|
@@ -1143,8 +1130,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
1143
1130
|
|
1144
1131
|
})();
|
1145
1132
|
});
|
1146
|
-
;
|
1147
|
-
webshims.register('form-core', function($, webshims, window, document, undefined, options){
|
1133
|
+
;webshims.register('form-core', function($, webshims, window, document, undefined, options){
|
1148
1134
|
"use strict";
|
1149
1135
|
|
1150
1136
|
webshims.capturingEventPrevented = function(e){
|
@@ -1170,6 +1156,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1170
1156
|
webshims.capturingEvents(['invalid'], true);
|
1171
1157
|
}
|
1172
1158
|
|
1159
|
+
var modules = webshims.modules;
|
1173
1160
|
var isValid = function(elem){
|
1174
1161
|
return ($.prop(elem, 'validity') || {valid: 1}).valid;
|
1175
1162
|
};
|
@@ -1179,10 +1166,12 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1179
1166
|
options.customMessages = true;
|
1180
1167
|
toLoad.push('form-message');
|
1181
1168
|
}
|
1182
|
-
|
1169
|
+
|
1170
|
+
if(webshims._getAutoEnhance(options.customDatalist)){
|
1183
1171
|
options.fD = true;
|
1184
1172
|
toLoad.push('form-datalist');
|
1185
1173
|
}
|
1174
|
+
|
1186
1175
|
if(options.addValidators){
|
1187
1176
|
toLoad.push('form-validators');
|
1188
1177
|
}
|
@@ -1196,7 +1185,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1196
1185
|
var hasInvalid = function(elem){
|
1197
1186
|
var ret = false;
|
1198
1187
|
$(elem).jProp('elements').each(function(){
|
1199
|
-
if(!rElementsGroup.test(
|
1188
|
+
if(!rElementsGroup.test(this.nodeName || '')){
|
1200
1189
|
ret = $(this).is(':invalid');
|
1201
1190
|
if(ret){
|
1202
1191
|
return false;
|
@@ -1391,14 +1380,27 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1391
1380
|
}
|
1392
1381
|
return message;
|
1393
1382
|
};
|
1394
|
-
|
1383
|
+
|
1384
|
+
$.event.special.valuevalidation = {
|
1385
|
+
setup: function(){
|
1386
|
+
var data = $(this).data() || $.data(this, {});
|
1387
|
+
if(!('valuevalidation' in data)){
|
1388
|
+
data.valuevalidation = true;
|
1389
|
+
}
|
1390
|
+
}
|
1391
|
+
};
|
1395
1392
|
|
1396
1393
|
$(document).on('focusin.lazyloadvalidation', function(e){
|
1397
1394
|
if('form' in e.target){
|
1398
1395
|
lazyLoad();
|
1399
1396
|
}
|
1400
1397
|
});
|
1398
|
+
|
1401
1399
|
webshims.ready('WINDOWLOAD', lazyLoad);
|
1400
|
+
|
1401
|
+
if(modules['form-number-date-ui'].loaded && modules['form-number-date-api'].test()){
|
1402
|
+
webshims.isReady('form-number-date-ui', true);
|
1403
|
+
}
|
1402
1404
|
});
|
1403
1405
|
;webshims.register('form-message', function($, webshims, window, document, undefined, options){
|
1404
1406
|
"use strict";
|
@@ -1534,9 +1536,11 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1534
1536
|
['value', 'min', 'max', 'title', 'maxlength', 'minlength', 'label'].forEach(function(attr){
|
1535
1537
|
if(message.indexOf('{%'+attr) === -1){return;}
|
1536
1538
|
var val = ((attr == 'label') ? $.trim($('label[for="'+ elem.id +'"]', elem.form).text()).replace(/\*$|:$/, '') : $.prop(elem, attr)) || '';
|
1539
|
+
val = ''+val;
|
1537
1540
|
if(name == 'patternMismatch' && attr == 'title' && !val){
|
1538
1541
|
webshims.error('no title for patternMismatch provided. Always add a title attribute.');
|
1539
1542
|
}
|
1543
|
+
|
1540
1544
|
if(valueVals[attr]){
|
1541
1545
|
if(!widget){
|
1542
1546
|
widget = $(elem).getShadowElement().data('wsWidget'+ (type = $.prop(elem, 'type')));
|
@@ -616,7 +616,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
616
616
|
$.each({ Height: "getHeight", Width: "getWidth" }, function(name, type){
|
617
617
|
var body = document.body;
|
618
618
|
var doc = document.documentElement;
|
619
|
-
docObserve[type] = function(){
|
619
|
+
docObserve[type] = function (){
|
620
620
|
return Math.max(
|
621
621
|
body[ "scroll" + name ], doc[ "scroll" + name ],
|
622
622
|
body[ "offset" + name ], doc[ "offset" + name ],
|
@@ -631,24 +631,11 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
631
631
|
this._create();
|
632
632
|
this.height = docObserve.getHeight();
|
633
633
|
this.width = docObserve.getWidth();
|
634
|
-
setInterval(this.test,
|
634
|
+
setInterval(this.test, 999);
|
635
635
|
$(this.test);
|
636
636
|
webshims.ready('WINDOWLOAD', this.test);
|
637
637
|
$(document).on('updatelayout.webshim pageinit popupafteropen panelbeforeopen tabsactivate collapsibleexpand shown.bs.modal shown.bs.collapse slid.bs.carousel', this.handler);
|
638
638
|
$(window).on('resize', this.handler);
|
639
|
-
(function(){
|
640
|
-
var oldAnimate = $.fn.animate;
|
641
|
-
var animationTimer;
|
642
|
-
|
643
|
-
$.fn.animate = function(){
|
644
|
-
clearTimeout(animationTimer);
|
645
|
-
animationTimer = setTimeout(function(){
|
646
|
-
docObserve.test();
|
647
|
-
}, 99);
|
648
|
-
|
649
|
-
return oldAnimate.apply(this, arguments);
|
650
|
-
};
|
651
|
-
})();
|
652
639
|
}
|
653
640
|
}
|
654
641
|
};
|
@@ -1143,8 +1130,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
1143
1130
|
|
1144
1131
|
})();
|
1145
1132
|
});
|
1146
|
-
;
|
1147
|
-
webshims.register('form-core', function($, webshims, window, document, undefined, options){
|
1133
|
+
;webshims.register('form-core', function($, webshims, window, document, undefined, options){
|
1148
1134
|
"use strict";
|
1149
1135
|
|
1150
1136
|
webshims.capturingEventPrevented = function(e){
|
@@ -1170,6 +1156,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1170
1156
|
webshims.capturingEvents(['invalid'], true);
|
1171
1157
|
}
|
1172
1158
|
|
1159
|
+
var modules = webshims.modules;
|
1173
1160
|
var isValid = function(elem){
|
1174
1161
|
return ($.prop(elem, 'validity') || {valid: 1}).valid;
|
1175
1162
|
};
|
@@ -1179,10 +1166,12 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1179
1166
|
options.customMessages = true;
|
1180
1167
|
toLoad.push('form-message');
|
1181
1168
|
}
|
1182
|
-
|
1169
|
+
|
1170
|
+
if(webshims._getAutoEnhance(options.customDatalist)){
|
1183
1171
|
options.fD = true;
|
1184
1172
|
toLoad.push('form-datalist');
|
1185
1173
|
}
|
1174
|
+
|
1186
1175
|
if(options.addValidators){
|
1187
1176
|
toLoad.push('form-validators');
|
1188
1177
|
}
|
@@ -1196,7 +1185,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1196
1185
|
var hasInvalid = function(elem){
|
1197
1186
|
var ret = false;
|
1198
1187
|
$(elem).jProp('elements').each(function(){
|
1199
|
-
if(!rElementsGroup.test(
|
1188
|
+
if(!rElementsGroup.test(this.nodeName || '')){
|
1200
1189
|
ret = $(this).is(':invalid');
|
1201
1190
|
if(ret){
|
1202
1191
|
return false;
|
@@ -1391,14 +1380,27 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1391
1380
|
}
|
1392
1381
|
return message;
|
1393
1382
|
};
|
1394
|
-
|
1383
|
+
|
1384
|
+
$.event.special.valuevalidation = {
|
1385
|
+
setup: function(){
|
1386
|
+
var data = $(this).data() || $.data(this, {});
|
1387
|
+
if(!('valuevalidation' in data)){
|
1388
|
+
data.valuevalidation = true;
|
1389
|
+
}
|
1390
|
+
}
|
1391
|
+
};
|
1395
1392
|
|
1396
1393
|
$(document).on('focusin.lazyloadvalidation', function(e){
|
1397
1394
|
if('form' in e.target){
|
1398
1395
|
lazyLoad();
|
1399
1396
|
}
|
1400
1397
|
});
|
1398
|
+
|
1401
1399
|
webshims.ready('WINDOWLOAD', lazyLoad);
|
1400
|
+
|
1401
|
+
if(modules['form-number-date-ui'].loaded && modules['form-number-date-api'].test()){
|
1402
|
+
webshims.isReady('form-number-date-ui', true);
|
1403
|
+
}
|
1402
1404
|
});
|
1403
1405
|
;webshims.register('form-message', function($, webshims, window, document, undefined, options){
|
1404
1406
|
"use strict";
|
@@ -1534,9 +1536,11 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1534
1536
|
['value', 'min', 'max', 'title', 'maxlength', 'minlength', 'label'].forEach(function(attr){
|
1535
1537
|
if(message.indexOf('{%'+attr) === -1){return;}
|
1536
1538
|
var val = ((attr == 'label') ? $.trim($('label[for="'+ elem.id +'"]', elem.form).text()).replace(/\*$|:$/, '') : $.prop(elem, attr)) || '';
|
1539
|
+
val = ''+val;
|
1537
1540
|
if(name == 'patternMismatch' && attr == 'title' && !val){
|
1538
1541
|
webshims.error('no title for patternMismatch provided. Always add a title attribute.');
|
1539
1542
|
}
|
1543
|
+
|
1540
1544
|
if(valueVals[attr]){
|
1541
1545
|
if(!widget){
|
1542
1546
|
widget = $(elem).getShadowElement().data('wsWidget'+ (type = $.prop(elem, 'type')));
|
@@ -616,7 +616,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
616
616
|
$.each({ Height: "getHeight", Width: "getWidth" }, function(name, type){
|
617
617
|
var body = document.body;
|
618
618
|
var doc = document.documentElement;
|
619
|
-
docObserve[type] = function(){
|
619
|
+
docObserve[type] = function (){
|
620
620
|
return Math.max(
|
621
621
|
body[ "scroll" + name ], doc[ "scroll" + name ],
|
622
622
|
body[ "offset" + name ], doc[ "offset" + name ],
|
@@ -631,24 +631,11 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
631
631
|
this._create();
|
632
632
|
this.height = docObserve.getHeight();
|
633
633
|
this.width = docObserve.getWidth();
|
634
|
-
setInterval(this.test,
|
634
|
+
setInterval(this.test, 999);
|
635
635
|
$(this.test);
|
636
636
|
webshims.ready('WINDOWLOAD', this.test);
|
637
637
|
$(document).on('updatelayout.webshim pageinit popupafteropen panelbeforeopen tabsactivate collapsibleexpand shown.bs.modal shown.bs.collapse slid.bs.carousel', this.handler);
|
638
638
|
$(window).on('resize', this.handler);
|
639
|
-
(function(){
|
640
|
-
var oldAnimate = $.fn.animate;
|
641
|
-
var animationTimer;
|
642
|
-
|
643
|
-
$.fn.animate = function(){
|
644
|
-
clearTimeout(animationTimer);
|
645
|
-
animationTimer = setTimeout(function(){
|
646
|
-
docObserve.test();
|
647
|
-
}, 99);
|
648
|
-
|
649
|
-
return oldAnimate.apply(this, arguments);
|
650
|
-
};
|
651
|
-
})();
|
652
639
|
}
|
653
640
|
}
|
654
641
|
};
|
@@ -1143,8 +1130,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
1143
1130
|
|
1144
1131
|
})();
|
1145
1132
|
});
|
1146
|
-
;
|
1147
|
-
webshims.register('form-core', function($, webshims, window, document, undefined, options){
|
1133
|
+
;webshims.register('form-core', function($, webshims, window, document, undefined, options){
|
1148
1134
|
"use strict";
|
1149
1135
|
|
1150
1136
|
webshims.capturingEventPrevented = function(e){
|
@@ -1170,6 +1156,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1170
1156
|
webshims.capturingEvents(['invalid'], true);
|
1171
1157
|
}
|
1172
1158
|
|
1159
|
+
var modules = webshims.modules;
|
1173
1160
|
var isValid = function(elem){
|
1174
1161
|
return ($.prop(elem, 'validity') || {valid: 1}).valid;
|
1175
1162
|
};
|
@@ -1179,10 +1166,12 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1179
1166
|
options.customMessages = true;
|
1180
1167
|
toLoad.push('form-message');
|
1181
1168
|
}
|
1182
|
-
|
1169
|
+
|
1170
|
+
if(webshims._getAutoEnhance(options.customDatalist)){
|
1183
1171
|
options.fD = true;
|
1184
1172
|
toLoad.push('form-datalist');
|
1185
1173
|
}
|
1174
|
+
|
1186
1175
|
if(options.addValidators){
|
1187
1176
|
toLoad.push('form-validators');
|
1188
1177
|
}
|
@@ -1196,7 +1185,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1196
1185
|
var hasInvalid = function(elem){
|
1197
1186
|
var ret = false;
|
1198
1187
|
$(elem).jProp('elements').each(function(){
|
1199
|
-
if(!rElementsGroup.test(
|
1188
|
+
if(!rElementsGroup.test(this.nodeName || '')){
|
1200
1189
|
ret = $(this).is(':invalid');
|
1201
1190
|
if(ret){
|
1202
1191
|
return false;
|
@@ -1391,14 +1380,27 @@ webshims.register('form-core', function($, webshims, window, document, undefined
|
|
1391
1380
|
}
|
1392
1381
|
return message;
|
1393
1382
|
};
|
1394
|
-
|
1383
|
+
|
1384
|
+
$.event.special.valuevalidation = {
|
1385
|
+
setup: function(){
|
1386
|
+
var data = $(this).data() || $.data(this, {});
|
1387
|
+
if(!('valuevalidation' in data)){
|
1388
|
+
data.valuevalidation = true;
|
1389
|
+
}
|
1390
|
+
}
|
1391
|
+
};
|
1395
1392
|
|
1396
1393
|
$(document).on('focusin.lazyloadvalidation', function(e){
|
1397
1394
|
if('form' in e.target){
|
1398
1395
|
lazyLoad();
|
1399
1396
|
}
|
1400
1397
|
});
|
1398
|
+
|
1401
1399
|
webshims.ready('WINDOWLOAD', lazyLoad);
|
1400
|
+
|
1401
|
+
if(modules['form-number-date-ui'].loaded && modules['form-number-date-api'].test()){
|
1402
|
+
webshims.isReady('form-number-date-ui', true);
|
1403
|
+
}
|
1402
1404
|
});
|
1403
1405
|
;webshims.register('form-datalist', function($, webshims, window, document, undefined, options){
|
1404
1406
|
"use strict";
|
@@ -616,7 +616,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
616
616
|
$.each({ Height: "getHeight", Width: "getWidth" }, function(name, type){
|
617
617
|
var body = document.body;
|
618
618
|
var doc = document.documentElement;
|
619
|
-
docObserve[type] = function(){
|
619
|
+
docObserve[type] = function (){
|
620
620
|
return Math.max(
|
621
621
|
body[ "scroll" + name ], doc[ "scroll" + name ],
|
622
622
|
body[ "offset" + name ], doc[ "offset" + name ],
|
@@ -631,24 +631,11 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
631
631
|
this._create();
|
632
632
|
this.height = docObserve.getHeight();
|
633
633
|
this.width = docObserve.getWidth();
|
634
|
-
setInterval(this.test,
|
634
|
+
setInterval(this.test, 999);
|
635
635
|
$(this.test);
|
636
636
|
webshims.ready('WINDOWLOAD', this.test);
|
637
637
|
$(document).on('updatelayout.webshim pageinit popupafteropen panelbeforeopen tabsactivate collapsibleexpand shown.bs.modal shown.bs.collapse slid.bs.carousel', this.handler);
|
638
638
|
$(window).on('resize', this.handler);
|
639
|
-
(function(){
|
640
|
-
var oldAnimate = $.fn.animate;
|
641
|
-
var animationTimer;
|
642
|
-
|
643
|
-
$.fn.animate = function(){
|
644
|
-
clearTimeout(animationTimer);
|
645
|
-
animationTimer = setTimeout(function(){
|
646
|
-
docObserve.test();
|
647
|
-
}, 99);
|
648
|
-
|
649
|
-
return oldAnimate.apply(this, arguments);
|
650
|
-
};
|
651
|
-
})();
|
652
639
|
}
|
653
640
|
}
|
654
641
|
};
|
@@ -1277,9 +1264,11 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
|
1277
1264
|
['value', 'min', 'max', 'title', 'maxlength', 'minlength', 'label'].forEach(function(attr){
|
1278
1265
|
if(message.indexOf('{%'+attr) === -1){return;}
|
1279
1266
|
var val = ((attr == 'label') ? $.trim($('label[for="'+ elem.id +'"]', elem.form).text()).replace(/\*$|:$/, '') : $.prop(elem, attr)) || '';
|
1267
|
+
val = ''+val;
|
1280
1268
|
if(name == 'patternMismatch' && attr == 'title' && !val){
|
1281
1269
|
webshims.error('no title for patternMismatch provided. Always add a title attribute.');
|
1282
1270
|
}
|
1271
|
+
|
1283
1272
|
if(valueVals[attr]){
|
1284
1273
|
if(!widget){
|
1285
1274
|
widget = $(elem).getShadowElement().data('wsWidget'+ (type = $.prop(elem, 'type')));
|
@@ -815,8 +815,8 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
815
815
|
}
|
816
816
|
|
817
817
|
});;(function($){
|
818
|
-
|
819
|
-
|
818
|
+
"use strict";
|
819
|
+
|
820
820
|
var isNumber = function(string){
|
821
821
|
return (typeof string == 'number' || (string && string == string * 1));
|
822
822
|
};
|
@@ -831,7 +831,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
831
831
|
_create: function(){
|
832
832
|
var i;
|
833
833
|
|
834
|
-
this.element.addClass('ws-range').attr({role: 'slider'}).append('<span class="ws-range-min ws-range-progress" /><span class="ws-range-rail ws-range-track"><span class="ws-range-thumb"><span><span data-value="" data-valuetext="" /></span></span></span>');
|
834
|
+
this.element.addClass(this.options.baseClass || 'ws-range').attr({role: 'slider'}).append('<span class="ws-range-min ws-range-progress" /><span class="ws-range-rail ws-range-track"><span class="ws-range-thumb"><span><span data-value="" data-valuetext="" /></span></span></span>');
|
835
835
|
this.trail = $('.ws-range-track', this.element);
|
836
836
|
this.range = $('.ws-range-progress', this.element);
|
837
837
|
this.thumb = $('.ws-range-thumb', this.trail);
|
@@ -1016,10 +1016,12 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
1016
1016
|
},
|
1017
1017
|
min: function(val){
|
1018
1018
|
this.options.min = retDefault(val, 0);
|
1019
|
+
this.element.attr('aria-valuemin', this.options.min);
|
1019
1020
|
this.value(this.options.value, true);
|
1020
1021
|
},
|
1021
1022
|
max: function(val){
|
1022
1023
|
this.options.max = retDefault(val, 100);
|
1024
|
+
this.element.attr('aria-valuemax', this.options.max);
|
1023
1025
|
this.value(this.options.value, true);
|
1024
1026
|
},
|
1025
1027
|
step: function(val){
|
@@ -1192,8 +1194,6 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
1192
1194
|
if(e.target == window){remove();}
|
1193
1195
|
};
|
1194
1196
|
var add = function(e){
|
1195
|
-
var outerWidth;
|
1196
|
-
|
1197
1197
|
if(isActive || (e.type == 'touchstart' && (!e.originalEvent || !e.originalEvent.touches || e.originalEvent.touches.length != 1))){
|
1198
1198
|
return;
|
1199
1199
|
}
|
@@ -1208,7 +1208,6 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
1208
1208
|
leftOffset = that.element.offset();
|
1209
1209
|
widgetUnits = that.element[that.dirs.innerWidth]();
|
1210
1210
|
if(!widgetUnits || !leftOffset){return;}
|
1211
|
-
outerWidth = that.thumb[that.dirs.outerWidth]();
|
1212
1211
|
leftOffset = leftOffset[that.dirs.pos];
|
1213
1212
|
widgetUnits = 100 / widgetUnits;
|
1214
1213
|
|
@@ -1325,8 +1324,13 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
1325
1324
|
webshims.ready('WINDOWLOAD', function(){
|
1326
1325
|
webshims.ready('dom-support', function(){
|
1327
1326
|
if ($.fn.onWSOff) {
|
1328
|
-
|
1327
|
+
var timer;
|
1328
|
+
var update = function(){
|
1329
1329
|
that.updateMetrics();
|
1330
|
+
};
|
1331
|
+
that.element.onWSOff('updateshadowdom', function(){
|
1332
|
+
clearTimeout(timer);
|
1333
|
+
timer = setTimeout(update, 100);
|
1330
1334
|
});
|
1331
1335
|
}
|
1332
1336
|
});
|
@@ -1337,26 +1341,26 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
1337
1341
|
}
|
1338
1342
|
},
|
1339
1343
|
posCenter: function(elem, outerWidth){
|
1340
|
-
var temp;
|
1344
|
+
var temp, eS;
|
1345
|
+
|
1341
1346
|
if(this.options.calcCenter && (!this._init || this.element[0].offsetWidth)){
|
1342
1347
|
if(!elem){
|
1343
1348
|
elem = this.thumb;
|
1344
1349
|
}
|
1350
|
+
eS = elem[0].style;
|
1345
1351
|
if(!outerWidth){
|
1346
1352
|
outerWidth = elem[this.dirs.outerWidth]();
|
1347
1353
|
}
|
1348
1354
|
outerWidth = outerWidth / -2;
|
1349
|
-
|
1350
|
-
|
1355
|
+
eS[this.dirs.marginLeft] = outerWidth +'px';
|
1356
|
+
|
1351
1357
|
if(this.options.calcTrail && elem[0] == this.thumb[0]){
|
1352
1358
|
temp = this.element[this.dirs.innerHeight]();
|
1353
|
-
|
1354
|
-
this.range.
|
1359
|
+
eS[this.dirs.marginTop] = ((elem[this.dirs.outerHeight]() - temp) / -2) + 'px';
|
1360
|
+
this.range[0].style[this.dirs.marginTop] = ((this.range[this.dirs.outerHeight]() - temp) / -2 ) +'px';
|
1355
1361
|
outerWidth *= -1;
|
1356
|
-
this.trail
|
1357
|
-
|
1358
|
-
.css(this.dirs.right, outerWidth)
|
1359
|
-
;
|
1362
|
+
this.trail[0].style[this.dirs.left] = outerWidth +'px';
|
1363
|
+
this.trail[0].style[this.dirs.right] = outerWidth +'px';
|
1360
1364
|
}
|
1361
1365
|
}
|
1362
1366
|
},
|
@@ -1400,7 +1404,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
1400
1404
|
value: 50,
|
1401
1405
|
input: $.noop,
|
1402
1406
|
change: $.noop,
|
1403
|
-
_change: $.noop,
|
1407
|
+
_change: $.noop,
|
1404
1408
|
showLabels: true,
|
1405
1409
|
options: {},
|
1406
1410
|
calcCenter: true,
|
@@ -1430,7 +1434,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
1430
1434
|
if(!curCfg[selectName]){
|
1431
1435
|
var labels = curCfg.date[opts.monthNames] || monthDigits;
|
1432
1436
|
curCfg[selectName] = ('<option value=""></option>')+$.map(monthDigits, function(val, i){
|
1433
|
-
return '<option value="'+val+'"
|
1437
|
+
return '<option value="'+val+'">'+labels[i]+'</option>';
|
1434
1438
|
}).join('');
|
1435
1439
|
}
|
1436
1440
|
return curCfg[selectName];
|
@@ -1834,8 +1838,12 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
1834
1838
|
var names;
|
1835
1839
|
var p = val.split('-');
|
1836
1840
|
if(p[0] && p[1]){
|
1837
|
-
|
1838
|
-
|
1841
|
+
|
1842
|
+
if(!options || !options.monthSelect){
|
1843
|
+
names = curCfg.date[options.monthNames] || curCfg.date.monthNames;
|
1844
|
+
p[1] = names[(p[1] * 1) - 1];
|
1845
|
+
}
|
1846
|
+
|
1839
1847
|
if(options && options.splitInput){
|
1840
1848
|
val = [p[0] || '', p[1] || ''];
|
1841
1849
|
} else if(p[1]){
|
@@ -2028,6 +2036,10 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
2028
2036
|
var type = (typeof val == 'object') ? 'valueAsDate' : 'valueAsNumber';
|
2029
2037
|
return input.prop(type, val).prop('value');
|
2030
2038
|
},
|
2039
|
+
asDate: function(val){
|
2040
|
+
var type = (typeof val == 'number') ? 'valueAsNumber' : 'value';
|
2041
|
+
return input.prop(type, val).prop('valueAsDate');
|
2042
|
+
},
|
2031
2043
|
isValid: function(val, attrs){
|
2032
2044
|
if(attrs && (attrs.nodeName || attrs.jquery)){
|
2033
2045
|
attrs = {
|
@@ -2301,6 +2313,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
2301
2313
|
this.asNumber = helper.asNumber;
|
2302
2314
|
this.asValue = helper.asValue;
|
2303
2315
|
this.isValid = helper.isValid;
|
2316
|
+
this.asDate = helper.asDate;
|
2304
2317
|
|
2305
2318
|
|
2306
2319
|
wsWidgetProto._create.apply(this, arguments);
|
@@ -2899,53 +2912,75 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
2899
2912
|
return $.css(this, 'display') != 'none';
|
2900
2913
|
};
|
2901
2914
|
var sizeInput = function(data){
|
2902
|
-
var init;
|
2915
|
+
var init, parent, lastWidth, left, right, isRtl, hasButtons;
|
2916
|
+
var oriStyleO = data.orig.style;
|
2917
|
+
var styleO = data.element[0].style;
|
2918
|
+
if($.support.boxSizing == null && !$.isReady){
|
2919
|
+
$(function(){
|
2920
|
+
parent = data.orig.parentNode;
|
2921
|
+
});
|
2922
|
+
} else {
|
2923
|
+
parent = data.orig.parentNode;
|
2924
|
+
}
|
2903
2925
|
var updateStyles = function(){
|
2904
|
-
|
2905
|
-
$.style( data.orig, 'display', '' );
|
2906
|
-
var hasButtons, marginR, marginL, left, right, isRtl;
|
2926
|
+
var curWidth, marginR, marginL, assignWidth;
|
2907
2927
|
var correctWidth = 0.8;
|
2908
|
-
|
2909
|
-
|
2910
|
-
|
2911
|
-
|
2912
|
-
|
2913
|
-
|
2914
|
-
|
2915
|
-
|
2916
|
-
|
2917
|
-
|
2928
|
+
|
2929
|
+
if(parent){
|
2930
|
+
curWidth = parent.offsetWidth;
|
2931
|
+
}
|
2932
|
+
|
2933
|
+
if(!init || (curWidth && curWidth != lastWidth)){
|
2934
|
+
lastWidth = curWidth;
|
2935
|
+
oriStyleO.display = '';
|
2936
|
+
styleO.display = 'none';
|
2937
|
+
|
2938
|
+
if(!init){
|
2939
|
+
hasButtons = data.buttonWrapper && data.buttonWrapper.filter(isVisible).length;
|
2940
|
+
isRtl = hasButtons && data.buttonWrapper.css('direction') == 'rtl';
|
2941
|
+
if(isRtl){
|
2942
|
+
left = 'Right';
|
2943
|
+
right = 'Left';
|
2944
|
+
} else {
|
2945
|
+
left = 'Left';
|
2946
|
+
right = 'Right';
|
2947
|
+
}
|
2948
|
+
if(hasButtons){
|
2949
|
+
data.buttonWrapper[isRtl ? 'addClass' : 'removeClass']('ws-is-rtl');
|
2950
|
+
}
|
2918
2951
|
}
|
2919
|
-
|
2952
|
+
|
2920
2953
|
marginR = $.css( data.orig, 'margin'+right);
|
2921
|
-
|
2922
|
-
data.
|
2923
|
-
|
2924
|
-
|
2925
|
-
;
|
2954
|
+
|
2955
|
+
styleO['margin'+left] = $.css( data.orig, 'margin'+left);
|
2956
|
+
styleO['margin'+right] = hasButtons ? '0px' : marginR;
|
2957
|
+
|
2926
2958
|
|
2927
2959
|
if(hasButtons){
|
2928
|
-
|
2960
|
+
|
2929
2961
|
marginL = (parseInt(data.buttonWrapper.css('margin'+left), 10) || 0);
|
2930
|
-
|
2931
|
-
|
2962
|
+
styleO['padding'+right] = '';
|
2963
|
+
|
2932
2964
|
if(marginL < 0){
|
2933
2965
|
marginR = (parseInt(marginR, 10) || 0) + ((data.buttonWrapper.outerWidth() + marginL) * -1);
|
2934
|
-
data.buttonWrapper.
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2938
|
-
;
|
2966
|
+
data.buttonWrapper[0].style['margin'+right] = marginR+'px';
|
2967
|
+
|
2968
|
+
styleO['padding'+right] = ((parseInt( data.element.css('padding'+right), 10) || 0) + data.buttonWrapper.outerWidth()) +'px';
|
2969
|
+
|
2939
2970
|
} else {
|
2940
|
-
data.buttonWrapper.
|
2971
|
+
data.buttonWrapper[0].style['margin'+right] = marginR;
|
2941
2972
|
correctWidth = data.buttonWrapper.outerWidth(true) + correctWidth;
|
2942
2973
|
}
|
2943
2974
|
}
|
2944
|
-
|
2945
|
-
|
2975
|
+
|
2976
|
+
assignWidth = $(data.orig).outerWidth() - correctWidth;
|
2977
|
+
|
2978
|
+
styleO.display = '';
|
2979
|
+
data.element.outerWidth(assignWidth);
|
2980
|
+
oriStyleO.display = 'none';
|
2981
|
+
init = true;
|
2946
2982
|
}
|
2947
|
-
|
2948
|
-
$(data.orig).addClass('ws-important-hide');
|
2983
|
+
|
2949
2984
|
};
|
2950
2985
|
data.element.onWSOff('updateshadowdom', updateStyles, true);
|
2951
2986
|
};
|
@@ -3009,6 +3044,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
3009
3044
|
cNames = $.prop(this, 'className');
|
3010
3045
|
if(opts.classes){
|
3011
3046
|
cNames += ' '+opts.classes;
|
3047
|
+
$(this).addClass(opts.classes);
|
3012
3048
|
}
|
3013
3049
|
|
3014
3050
|
if(opts.splitInput || type == 'range'){
|
@@ -3081,7 +3117,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
|
3081
3117
|
if(opts.calculateWidth){
|
3082
3118
|
sizeInput(data.shim);
|
3083
3119
|
} else {
|
3084
|
-
$(this).
|
3120
|
+
$(this).css('display', 'none');
|
3085
3121
|
}
|
3086
3122
|
}
|
3087
3123
|
|