webshims-rails 1.10.6 → 1.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +8 -8
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/webshims/polyfiller.js +14 -7
  4. data/vendor/assets/javascripts/webshims/shims/color-picker.js +1 -0
  5. data/vendor/assets/javascripts/webshims/shims/combos/1.js +153 -155
  6. data/vendor/assets/javascripts/webshims/shims/combos/10.js +168 -136
  7. data/vendor/assets/javascripts/webshims/shims/combos/11.js +116 -44
  8. data/vendor/assets/javascripts/webshims/shims/combos/12.js +100 -95
  9. data/vendor/assets/javascripts/webshims/shims/combos/13.js +100 -95
  10. data/vendor/assets/javascripts/webshims/shims/combos/14.js +51 -91
  11. data/vendor/assets/javascripts/webshims/shims/combos/15.js +129 -232
  12. data/vendor/assets/javascripts/webshims/shims/combos/16.js +228 -326
  13. data/vendor/assets/javascripts/webshims/shims/combos/17.js +116 -44
  14. data/vendor/assets/javascripts/webshims/shims/combos/18.js +116 -44
  15. data/vendor/assets/javascripts/webshims/shims/combos/19.js +210 -214
  16. data/vendor/assets/javascripts/webshims/shims/combos/2.js +204 -246
  17. data/vendor/assets/javascripts/webshims/shims/combos/20.js +210 -214
  18. data/vendor/assets/javascripts/webshims/shims/combos/21.js +59 -28
  19. data/vendor/assets/javascripts/webshims/shims/combos/23.js +100 -95
  20. data/vendor/assets/javascripts/webshims/shims/combos/24.js +2 -2
  21. data/vendor/assets/javascripts/webshims/shims/combos/25.js +210 -214
  22. data/vendor/assets/javascripts/webshims/shims/combos/26.js +51 -91
  23. data/vendor/assets/javascripts/webshims/shims/combos/28.js +110 -119
  24. data/vendor/assets/javascripts/webshims/shims/combos/29.js +6 -0
  25. data/vendor/assets/javascripts/webshims/shims/combos/3.js +126 -156
  26. data/vendor/assets/javascripts/webshims/shims/combos/30.js +126 -155
  27. data/vendor/assets/javascripts/webshims/shims/combos/31.js +104 -151
  28. data/vendor/assets/javascripts/webshims/shims/combos/4.js +73 -96
  29. data/vendor/assets/javascripts/webshims/shims/combos/5.js +116 -44
  30. data/vendor/assets/javascripts/webshims/shims/combos/6.js +116 -44
  31. data/vendor/assets/javascripts/webshims/shims/combos/7.js +226 -250
  32. data/vendor/assets/javascripts/webshims/shims/combos/8.js +226 -250
  33. data/vendor/assets/javascripts/webshims/shims/combos/9.js +168 -136
  34. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +51 -91
  35. data/vendor/assets/javascripts/webshims/shims/form-core.js +53 -60
  36. data/vendor/assets/javascripts/webshims/shims/form-message.js +22 -5
  37. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +87 -30
  38. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +2 -76
  39. data/vendor/assets/javascripts/webshims/shims/form-validation.js +2 -2
  40. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +1 -1
  41. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-fr.js +18 -8
  42. data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +100 -95
  43. data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +59 -28
  44. data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +9 -2
  45. data/vendor/assets/javascripts/webshims/shims/range-ui.js +29 -14
  46. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +21 -7
  47. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +30 -15
  48. data/vendor/assets/javascripts/webshims/shims/track-ui.js +6 -0
  49. metadata +2 -2
@@ -32,52 +32,55 @@
32
32
  });
33
33
  webshims.loader.loadList(['mediaelement-native-fix']);
34
34
  }
35
- }
36
-
37
- if(hasNative && !options.preferFlash){
38
- var noSwitch = {
39
- 1: 1,
40
- 2: 1
41
- };
42
- var switchOptions = function(e){
43
- var media;
44
- var parent;
45
- if(!options.preferFlash &&
35
+
36
+ if(!options.preferFlash){
37
+ var noSwitch = {
38
+ 1: 1,
39
+ 2: 1
40
+ };
41
+ var switchOptions = function(e){
42
+ var media, error, parent;
43
+ if(!options.preferFlash &&
46
44
  ($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source:last', parent)[0] == e.target)) &&
47
- (media = $(e.target).closest('audio, video')) && !noSwitch[media.prop('error')]
45
+ (media = $(e.target).closest('audio, video')) && !noSwitch[(error = media.prop('error'))]
48
46
  ){
49
- $(function(){
50
- if(hasSwf && !options.preferFlash){
51
- loadSwf();
52
- webshims.ready('WINDOWLOAD '+swfType, function(){
53
- setTimeout(function(){
54
- if(!options.preferFlash && webshims.mediaelement.createSWF && !media.is('.nonnative-api-active')){
55
- options.preferFlash = true;
56
- document.removeEventListener('error', switchOptions, true);
57
- $('audio, video').each(function(){
58
- webshims.mediaelement.selectSource(this);
59
- });
60
- webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error'));
61
- }
62
- }, 9);
63
- });
64
- } else{
65
- document.removeEventListener('error', switchOptions, true);
47
+ if(error == null){
48
+ webshims.warn("There was an unspecified error on a mediaelement");
49
+ return;
50
+
66
51
  }
67
- });
68
- }
69
- };
70
- document.addEventListener('error', switchOptions, true);
71
- $('audio, video').each(function(){
72
- var error = $.prop(this, 'error');
73
- if(error && !noSwitch[error]){
74
- switchOptions({target: this});
75
- return false;
76
- }
77
- });
52
+ $(function(){
53
+ if(hasSwf && !options.preferFlash){
54
+ loadSwf();
55
+ webshims.ready('WINDOWLOAD '+swfType, function(){
56
+ setTimeout(function(){
57
+ if(!options.preferFlash && webshims.mediaelement.createSWF && !media.is('.nonnative-api-active')){
58
+ options.preferFlash = true;
59
+ document.removeEventListener('error', switchOptions, true);
60
+ $('audio, video').each(function(){
61
+ webshims.mediaelement.selectSource(this);
62
+ });
63
+ webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error'));
64
+ }
65
+ }, 9);
66
+ });
67
+ } else{
68
+ document.removeEventListener('error', switchOptions, true);
69
+ }
70
+ });
71
+ }
72
+ };
73
+ document.addEventListener('error', switchOptions, true);
74
+ $('audio, video').each(function(){
75
+ var error = $.prop(this, 'error');
76
+ if(error && !noSwitch[error]){
77
+ switchOptions({target: this});
78
+ return false;
79
+ }
80
+ });
81
+ }
78
82
  }
79
83
 
80
-
81
84
  if(Modernizr.track && !bugs.track){
82
85
  (function(){
83
86
 
@@ -458,63 +461,14 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
458
461
 
459
462
  });
460
463
 
461
- webshims.ready('dom-support', function(){
462
- if(!supportsLoop){
463
- webshims.defineNodeNamesBooleanProperty(['audio', 'video'], 'loop');
464
- }
465
-
466
- ['audio', 'video'].forEach(function(nodeName){
467
- var supLoad = webshims.defineNodeNameProperty(nodeName, 'load', {
468
- prop: {
469
- value: function(){
470
- var data = webshims.data(this, 'mediaelement');
471
- selectSource(this, data);
472
- if(hasNative && (!data || data.isActive == 'html5') && supLoad.prop._supvalue){
473
- supLoad.prop._supvalue.apply(this, arguments);
474
- }
475
- }
476
- }
477
- });
478
- nativeCanPlayType[nodeName] = webshims.defineNodeNameProperty(nodeName, 'canPlayType', {
479
- prop: {
480
- value: function(type){
481
- var ret = '';
482
- if(hasNative && nativeCanPlayType[nodeName].prop._supvalue){
483
- ret = nativeCanPlayType[nodeName].prop._supvalue.call(this, type);
484
- if(ret == 'no'){
485
- ret = '';
486
- }
487
- }
488
- if(!ret && hasSwf){
489
- type = $.trim((type || '').split(';')[0]);
490
- if(mediaelement.swfMimeTypes.indexOf(type) != -1){
491
- ret = 'maybe';
492
- }
493
- }
494
- return ret;
495
- }
496
- }
497
- });
498
- });
499
- webshims.onNodeNamesPropertyModify(['audio', 'video'], ['src', 'poster'], {
500
- set: function(){
501
- var elem = this;
502
- var baseData = webshims.data(elem, 'mediaelementBase') || webshims.data(elem, 'mediaelementBase', {});
503
- clearTimeout(baseData.loadTimer);
504
- baseData.loadTimer = setTimeout(function(){
505
- selectSource(elem);
506
- elem = null;
507
- }, 9);
508
- }
509
- });
510
- });
511
-
464
+ var handleMedia = false;
512
465
  var initMediaElements = function(){
513
466
  var testFixMedia = function(){
514
467
  if(webshims.implement(this, 'mediaelement')){
515
468
  selectSource(this);
516
469
 
517
- if(hasNative){
470
+ //fixes for FF 12 and IE9/10 || does not hurt, if run in other browsers
471
+ if(hasNative && (!supportsLoop || ('ActiveXObject' in window))){
518
472
  var bufferTimer;
519
473
  var lastBuffered;
520
474
  var elem = this;
@@ -543,7 +497,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
543
497
  lastBuffered = getBufferedString();
544
498
  }
545
499
  clearTimeout(bufferTimer);
546
- bufferTimer = setTimeout(testBuffer, 999);
500
+ bufferTimer = setTimeout(testBuffer, 400);
547
501
  },
548
502
  'emptied stalled mediaerror abort suspend': function(e){
549
503
  if(e.type == 'emptied'){
@@ -560,11 +514,62 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
560
514
  }
561
515
 
562
516
  };
563
- var handleMedia = false;
517
+
564
518
 
565
519
 
566
520
  webshims.ready('dom-support', function(){
567
521
  handleMedia = true;
522
+
523
+ if(!supportsLoop){
524
+ webshims.defineNodeNamesBooleanProperty(['audio', 'video'], 'loop');
525
+ }
526
+
527
+ ['audio', 'video'].forEach(function(nodeName){
528
+ var supLoad = webshims.defineNodeNameProperty(nodeName, 'load', {
529
+ prop: {
530
+ value: function(){
531
+ var data = webshims.data(this, 'mediaelement');
532
+ selectSource(this, data);
533
+ if(hasNative && (!data || data.isActive == 'html5') && supLoad.prop._supvalue){
534
+ supLoad.prop._supvalue.apply(this, arguments);
535
+ }
536
+ }
537
+ }
538
+ });
539
+ nativeCanPlayType[nodeName] = webshims.defineNodeNameProperty(nodeName, 'canPlayType', {
540
+ prop: {
541
+ value: function(type){
542
+ var ret = '';
543
+ if(hasNative && nativeCanPlayType[nodeName].prop._supvalue){
544
+ ret = nativeCanPlayType[nodeName].prop._supvalue.call(this, type);
545
+ if(ret == 'no'){
546
+ ret = '';
547
+ }
548
+ }
549
+ if(!ret && hasSwf){
550
+ type = $.trim((type || '').split(';')[0]);
551
+ if(mediaelement.swfMimeTypes.indexOf(type) != -1){
552
+ ret = 'maybe';
553
+ }
554
+ }
555
+ return ret;
556
+ }
557
+ }
558
+ });
559
+ });
560
+ webshims.onNodeNamesPropertyModify(['audio', 'video'], ['src', 'poster'], {
561
+ set: function(){
562
+ var elem = this;
563
+ var baseData = webshims.data(elem, 'mediaelementBase') || webshims.data(elem, 'mediaelementBase', {});
564
+ clearTimeout(baseData.loadTimer);
565
+ baseData.loadTimer = setTimeout(function(){
566
+ selectSource(elem);
567
+ elem = null;
568
+ }, 9);
569
+ }
570
+ });
571
+
572
+
568
573
  webshims.addReady(function(context, insertedElement){
569
574
  var media = $('video, audio', context)
570
575
  .add(insertedElement.filter('video, audio'))
@@ -814,10 +814,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
814
814
  if(!$.parseHTML){
815
815
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
816
816
  }
817
+
818
+ if(webshims.cfg.extendNative == 1){
819
+ webshims.warn("extendNative configuration will be set to false by default with next release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
820
+ }
821
+
817
822
  if (!webshims.cfg.no$Switch) {
818
823
  var switch$ = function(){
819
824
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
820
- webshims.error("jQuery was included more than once. Make sure to include it only once! Webshims and other Plugins might not work properly.");
825
+ webshims.error("jQuery was included more than once. Make sure to include it only once or try the $.noConflict(extreme) feature! Webshims and other Plugins might not work properly..");
821
826
  if (window.$) {
822
827
  window.$ = webshims.$;
823
828
  }
@@ -835,7 +840,10 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
835
840
  };
836
841
  switch$();
837
842
  setTimeout(switch$, 90);
843
+ webshims.ready('DOM', switch$);
838
844
  $(switch$);
845
+ webshims.ready('WINDOWLOAD', switch$);
846
+
839
847
  }
840
848
  // (function(){
841
849
  // var hostNames = {
@@ -943,6 +951,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
943
951
  $(evtDel).off(evt, fn);
944
952
  }
945
953
  });
954
+ return this;
946
955
  };
947
956
 
948
957
  var dataID = '_webshimsLib'+ (Math.round(Math.random() * 1000));
@@ -977,57 +986,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
977
986
  };
978
987
  });
979
988
 
980
- if($.Tween.propHooks._default && $.css){
981
- (function(){
982
- var isjQ8 = false;
983
- try {
984
- isjQ8 = $.css($('<b style="width: 10px" />')[0], 'width', '') == '10px';
985
- } catch(er){
986
- webshims.error(er);
987
- }
988
- var css = isjQ8 ?
989
- function(elem, prop){
990
- return $.css( elem, prop, false, "" );
991
- } :
992
- function(elem, prop){
993
- return $.css( elem, prop, "" );
994
- }
995
- ;
996
-
997
- $.extend($.Tween.propHooks._default, {
998
- get: function( tween ) {
999
- var result;
1000
-
1001
- if ( (tween.elem[ tween.prop ] != null || havePolyfill[ tween.prop ]) &&
1002
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
1003
- return havePolyfill[ tween.prop ] ? $.prop(tween.elem, tween.prop) : tween.elem[ tween.prop ];
1004
- }
1005
-
1006
- // passing an empty string as a 3rd parameter to .css will automatically
1007
- // attempt a parseFloat and fallback to a string if the parse fails
1008
- // so, simple values such as "10px" are parsed to Float.
1009
- // complex values such as "rotate(1rad)" are returned as is.
1010
- result = css( tween.elem, tween.prop );
1011
- // Empty strings, null, undefined and "auto" are converted to 0.
1012
- return !result || result === "auto" ? 0 : result;
1013
- },
1014
- set: function( tween ) {
1015
- // use step hook for back compat - use cssHook if its there - use .style if its
1016
- // available and use plain properties where available
1017
- if ( jQuery.fx.step[ tween.prop ] ) {
1018
- jQuery.fx.step[ tween.prop ]( tween );
1019
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
1020
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
1021
- } else if( !havePolyfill[ tween.prop ] ) {
1022
- tween.elem[ tween.prop ] = tween.now;
1023
- } else {
1024
- $.prop(tween.elem, tween.prop, tween.now);
1025
- }
1026
- }
1027
- });
1028
- })();
1029
- }
1030
-
1031
989
 
1032
990
  ['removeAttr', 'prop', 'attr'].forEach(function(type){
1033
991
  olds[type] = $[type];
@@ -1431,48 +1389,50 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1431
1389
  });
1432
1390
  };
1433
1391
  return function(nativeElem, shadowElem, opts){
1434
- opts = opts || {};
1435
- if(nativeElem.jquery){
1436
- nativeElem = nativeElem[0];
1437
- }
1438
- if(shadowElem.jquery){
1439
- shadowElem = shadowElem[0];
1440
- }
1441
- var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
1442
- var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
1443
- var shadowFocusElementData = {};
1444
- if(!opts.shadowFocusElement){
1445
- opts.shadowFocusElement = shadowElem;
1446
- } else if(opts.shadowFocusElement){
1447
- if(opts.shadowFocusElement.jquery){
1448
- opts.shadowFocusElement = opts.shadowFocusElement[0];
1392
+ if(nativeElem && shadowElem){
1393
+ opts = opts || {};
1394
+ if(nativeElem.jquery){
1395
+ nativeElem = nativeElem[0];
1449
1396
  }
1450
- shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
1451
- }
1452
-
1453
- $(nativeElem).on('remove', function(e){
1454
- if (!e.originalEvent) {
1455
- $(shadowElem).remove();
1397
+ if(shadowElem.jquery){
1398
+ shadowElem = shadowElem[0];
1456
1399
  }
1457
- });
1458
-
1459
- nativeData.hasShadow = shadowElem;
1460
- shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
1461
- shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
1462
- nativeElement: nativeElem,
1463
- shadowElement: shadowElem,
1464
- shadowFocusElement: opts.shadowFocusElement
1465
- };
1466
- if(opts.shadowChilds){
1467
- opts.shadowChilds.each(function(){
1468
- elementData(this, 'shadowData', shadowData.shadowData);
1400
+ var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
1401
+ var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
1402
+ var shadowFocusElementData = {};
1403
+ if(!opts.shadowFocusElement){
1404
+ opts.shadowFocusElement = shadowElem;
1405
+ } else if(opts.shadowFocusElement){
1406
+ if(opts.shadowFocusElement.jquery){
1407
+ opts.shadowFocusElement = opts.shadowFocusElement[0];
1408
+ }
1409
+ shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
1410
+ }
1411
+
1412
+ $(nativeElem).on('remove', function(e){
1413
+ if (!e.originalEvent) {
1414
+ $(shadowElem).remove();
1415
+ }
1469
1416
  });
1417
+
1418
+ nativeData.hasShadow = shadowElem;
1419
+ shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
1420
+ shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
1421
+ nativeElement: nativeElem,
1422
+ shadowElement: shadowElem,
1423
+ shadowFocusElement: opts.shadowFocusElement
1424
+ };
1425
+ if(opts.shadowChilds){
1426
+ opts.shadowChilds.each(function(){
1427
+ elementData(this, 'shadowData', shadowData.shadowData);
1428
+ });
1429
+ }
1430
+
1431
+ if(opts.data){
1432
+ shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
1433
+ }
1434
+ opts = null;
1470
1435
  }
1471
-
1472
- if(opts.data){
1473
- shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
1474
- }
1475
- opts = null;
1476
1436
  webshims.docObserve();
1477
1437
  };
1478
1438
  })(),
@@ -1756,7 +1716,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1756
1716
  // register: moduleName:string,
1757
1717
  // callback: callback:function
1758
1718
  // });
1759
- // get/set including removeLang
1719
+ // get/set including remoteLang
1760
1720
  // - webshims.activeLang({
1761
1721
  // module: moduleName:string,
1762
1722
  // callback: callback:function,
@@ -11,10 +11,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
11
11
  if(!$.parseHTML){
12
12
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
13
13
  }
14
+
15
+ if(webshims.cfg.extendNative == 1){
16
+ webshims.warn("extendNative configuration will be set to false by default with next release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
17
+ }
18
+
14
19
  if (!webshims.cfg.no$Switch) {
15
20
  var switch$ = function(){
16
21
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
17
- webshims.error("jQuery was included more than once. Make sure to include it only once! Webshims and other Plugins might not work properly.");
22
+ webshims.error("jQuery was included more than once. Make sure to include it only once or try the $.noConflict(extreme) feature! Webshims and other Plugins might not work properly..");
18
23
  if (window.$) {
19
24
  window.$ = webshims.$;
20
25
  }
@@ -32,7 +37,10 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
32
37
  };
33
38
  switch$();
34
39
  setTimeout(switch$, 90);
40
+ webshims.ready('DOM', switch$);
35
41
  $(switch$);
42
+ webshims.ready('WINDOWLOAD', switch$);
43
+
36
44
  }
37
45
  // (function(){
38
46
  // var hostNames = {
@@ -140,6 +148,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
140
148
  $(evtDel).off(evt, fn);
141
149
  }
142
150
  });
151
+ return this;
143
152
  };
144
153
 
145
154
  var dataID = '_webshimsLib'+ (Math.round(Math.random() * 1000));
@@ -174,57 +183,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
174
183
  };
175
184
  });
176
185
 
177
- if($.Tween.propHooks._default && $.css){
178
- (function(){
179
- var isjQ8 = false;
180
- try {
181
- isjQ8 = $.css($('<b style="width: 10px" />')[0], 'width', '') == '10px';
182
- } catch(er){
183
- webshims.error(er);
184
- }
185
- var css = isjQ8 ?
186
- function(elem, prop){
187
- return $.css( elem, prop, false, "" );
188
- } :
189
- function(elem, prop){
190
- return $.css( elem, prop, "" );
191
- }
192
- ;
193
-
194
- $.extend($.Tween.propHooks._default, {
195
- get: function( tween ) {
196
- var result;
197
-
198
- if ( (tween.elem[ tween.prop ] != null || havePolyfill[ tween.prop ]) &&
199
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
200
- return havePolyfill[ tween.prop ] ? $.prop(tween.elem, tween.prop) : tween.elem[ tween.prop ];
201
- }
202
-
203
- // passing an empty string as a 3rd parameter to .css will automatically
204
- // attempt a parseFloat and fallback to a string if the parse fails
205
- // so, simple values such as "10px" are parsed to Float.
206
- // complex values such as "rotate(1rad)" are returned as is.
207
- result = css( tween.elem, tween.prop );
208
- // Empty strings, null, undefined and "auto" are converted to 0.
209
- return !result || result === "auto" ? 0 : result;
210
- },
211
- set: function( tween ) {
212
- // use step hook for back compat - use cssHook if its there - use .style if its
213
- // available and use plain properties where available
214
- if ( jQuery.fx.step[ tween.prop ] ) {
215
- jQuery.fx.step[ tween.prop ]( tween );
216
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
217
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
218
- } else if( !havePolyfill[ tween.prop ] ) {
219
- tween.elem[ tween.prop ] = tween.now;
220
- } else {
221
- $.prop(tween.elem, tween.prop, tween.now);
222
- }
223
- }
224
- });
225
- })();
226
- }
227
-
228
186
 
229
187
  ['removeAttr', 'prop', 'attr'].forEach(function(type){
230
188
  olds[type] = $[type];
@@ -628,48 +586,50 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
628
586
  });
629
587
  };
630
588
  return function(nativeElem, shadowElem, opts){
631
- opts = opts || {};
632
- if(nativeElem.jquery){
633
- nativeElem = nativeElem[0];
634
- }
635
- if(shadowElem.jquery){
636
- shadowElem = shadowElem[0];
637
- }
638
- var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
639
- var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
640
- var shadowFocusElementData = {};
641
- if(!opts.shadowFocusElement){
642
- opts.shadowFocusElement = shadowElem;
643
- } else if(opts.shadowFocusElement){
644
- if(opts.shadowFocusElement.jquery){
645
- opts.shadowFocusElement = opts.shadowFocusElement[0];
646
- }
647
- shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
648
- }
649
-
650
- $(nativeElem).on('remove', function(e){
651
- if (!e.originalEvent) {
652
- $(shadowElem).remove();
589
+ if(nativeElem && shadowElem){
590
+ opts = opts || {};
591
+ if(nativeElem.jquery){
592
+ nativeElem = nativeElem[0];
593
+ }
594
+ if(shadowElem.jquery){
595
+ shadowElem = shadowElem[0];
596
+ }
597
+ var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
598
+ var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
599
+ var shadowFocusElementData = {};
600
+ if(!opts.shadowFocusElement){
601
+ opts.shadowFocusElement = shadowElem;
602
+ } else if(opts.shadowFocusElement){
603
+ if(opts.shadowFocusElement.jquery){
604
+ opts.shadowFocusElement = opts.shadowFocusElement[0];
605
+ }
606
+ shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
653
607
  }
654
- });
655
-
656
- nativeData.hasShadow = shadowElem;
657
- shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
658
- shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
659
- nativeElement: nativeElem,
660
- shadowElement: shadowElem,
661
- shadowFocusElement: opts.shadowFocusElement
662
- };
663
- if(opts.shadowChilds){
664
- opts.shadowChilds.each(function(){
665
- elementData(this, 'shadowData', shadowData.shadowData);
608
+
609
+ $(nativeElem).on('remove', function(e){
610
+ if (!e.originalEvent) {
611
+ $(shadowElem).remove();
612
+ }
666
613
  });
614
+
615
+ nativeData.hasShadow = shadowElem;
616
+ shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
617
+ shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
618
+ nativeElement: nativeElem,
619
+ shadowElement: shadowElem,
620
+ shadowFocusElement: opts.shadowFocusElement
621
+ };
622
+ if(opts.shadowChilds){
623
+ opts.shadowChilds.each(function(){
624
+ elementData(this, 'shadowData', shadowData.shadowData);
625
+ });
626
+ }
627
+
628
+ if(opts.data){
629
+ shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
630
+ }
631
+ opts = null;
667
632
  }
668
-
669
- if(opts.data){
670
- shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
671
- }
672
- opts = null;
673
633
  webshims.docObserve();
674
634
  };
675
635
  })(),
@@ -953,7 +913,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
953
913
  // register: moduleName:string,
954
914
  // callback: callback:function
955
915
  // });
956
- // get/set including removeLang
916
+ // get/set including remoteLang
957
917
  // - webshims.activeLang({
958
918
  // module: moduleName:string,
959
919
  // callback: callback:function,
@@ -1205,12 +1165,13 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1205
1165
  $.expr[":"][name] = $.expr.filters[name+"-element"];
1206
1166
  });
1207
1167
 
1208
-
1209
- $.expr[":"].focus = function( elem ) {
1168
+ var pseudoFocus = $.expr[":"].focus;
1169
+ $.expr[":"].focus = function(){
1210
1170
  try {
1211
- var doc = elem.ownerDocument;
1212
- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus());
1213
- } catch(e){}
1171
+ return pseudoFocus.apply(this, arguments);
1172
+ } catch(e){
1173
+ webshims.error(e);
1174
+ }
1214
1175
  return false;
1215
1176
  };
1216
1177
 
@@ -1225,7 +1186,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1225
1186
  });
1226
1187
  };
1227
1188
 
1228
-
1189
+ var transClass = ('transitionDelay' in document.documentElement.style) ? '' : ' no-transition';
1229
1190
  webshims.wsPopover = {
1230
1191
  id: 0,
1231
1192
  _create: function(){
@@ -1233,7 +1194,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1233
1194
  this.id = webshims.wsPopover.id++;
1234
1195
  this.eventns = '.wsoverlay' + this.id;
1235
1196
  this.timers = {};
1236
- this.element = $('<div class="ws-popover" tabindex="-1"><div class="ws-po-outerbox"><div class="ws-po-arrow"><div class="ws-po-arrowbox" /></div><div class="ws-po-box" /></div></div>');
1197
+ this.element = $('<div class="ws-popover'+transClass+'" tabindex="-1"><div class="ws-po-outerbox"><div class="ws-po-arrow"><div class="ws-po-arrowbox" /></div><div class="ws-po-box" /></div></div>');
1237
1198
  this.contentElement = $('.ws-po-box', this.element);
1238
1199
  this.lastElement = $([]);
1239
1200
  this.bindElement();
@@ -1272,47 +1233,6 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1272
1233
  };
1273
1234
 
1274
1235
 
1275
- /* extension, but also used to fix native implementation workaround/bugfixes */
1276
- (function(){
1277
- var firstEvent,
1278
- invalids = [],
1279
- stopSubmitTimer,
1280
- form
1281
- ;
1282
-
1283
- $(document).on('invalid', function(e){
1284
- if(e.wrongWebkitInvalid){return;}
1285
- var jElm = $(e.target);
1286
-
1287
-
1288
- if(!firstEvent){
1289
- //trigger firstinvalid
1290
- firstEvent = $.Event('firstinvalid');
1291
- firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1292
- var firstSystemInvalid = $.Event('firstinvalidsystem');
1293
- $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1294
- jElm.trigger(firstEvent);
1295
- }
1296
-
1297
- //if firstinvalid was prevented all invalids will be also prevented
1298
- if( firstEvent && firstEvent.isDefaultPrevented() ){
1299
- e.preventDefault();
1300
- }
1301
- invalids.push(e.target);
1302
- e.extraData = 'fix';
1303
- clearTimeout(stopSubmitTimer);
1304
- stopSubmitTimer = setTimeout(function(){
1305
- var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1306
- //reset firstinvalid
1307
- firstEvent = false;
1308
- invalids = [];
1309
- $(e.target).trigger(lastEvent, lastEvent);
1310
- }, 9);
1311
- jElm = null;
1312
- });
1313
- })();
1314
-
1315
-
1316
1236
  webshims.getContentValidationMessage = function(elem, validity, key){
1317
1237
  var message = $(elem).data('errormessage') || elem.getAttribute('x-moz-errormessage') || '';
1318
1238
  if(key && message[key]){
@@ -1346,19 +1266,13 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1346
1266
  };
1347
1267
 
1348
1268
 
1349
- webshims.ready('forms', function(){
1350
- $(document).on('focusin.lazyloadvalidation', function(e){
1351
- if('form' in e.target && $(e.target).is(':invalid')){
1352
- lazyLoad();
1353
- }
1354
- });
1269
+ $(document).on('focusin.lazyloadvalidation', function(e){
1270
+ if('form' in e.target && $(e.target).is(':invalid')){
1271
+ lazyLoad();
1272
+ }
1355
1273
  });
1356
1274
  webshims.ready('WINDOWLOAD', lazyLoad);
1357
- if(options.overrideMessages){
1358
- options.customMessages = true;
1359
- webshims.reTest('form-message');
1360
- webshims.error('overrideMessages is deprecated. use customMessages instead.');
1361
- }
1275
+
1362
1276
  if(options.replaceValidationUI){
1363
1277
  webshims.ready('DOM forms', function(){
1364
1278
  $(document).on('firstinvalid', function(e){
@@ -1369,8 +1283,47 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1369
1283
  });
1370
1284
  });
1371
1285
  }
1372
- });
1286
+
1287
+ /* extension, but also used to fix native implementation workaround/bugfixes */
1288
+ (function(){
1289
+ var firstEvent,
1290
+ invalids = [],
1291
+ stopSubmitTimer,
1292
+ form
1293
+ ;
1294
+
1295
+ $(document).on('invalid', function(e){
1296
+ if(e.wrongWebkitInvalid){return;}
1297
+ var jElm = $(e.target);
1298
+
1299
+
1300
+ if(!firstEvent){
1301
+ //trigger firstinvalid
1302
+ firstEvent = $.Event('firstinvalid');
1303
+ firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1304
+ var firstSystemInvalid = $.Event('firstinvalidsystem');
1305
+ $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1306
+ jElm.trigger(firstEvent);
1307
+ }
1373
1308
 
1309
+ //if firstinvalid was prevented all invalids will be also prevented
1310
+ if( firstEvent && firstEvent.isDefaultPrevented() ){
1311
+ e.preventDefault();
1312
+ }
1313
+ invalids.push(e.target);
1314
+ e.extraData = 'fix';
1315
+ clearTimeout(stopSubmitTimer);
1316
+ stopSubmitTimer = setTimeout(function(){
1317
+ var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1318
+ //reset firstinvalid
1319
+ firstEvent = false;
1320
+ invalids = [];
1321
+ $(e.target).trigger(lastEvent, lastEvent);
1322
+ }, 9);
1323
+ jElm = null;
1324
+ });
1325
+ })();
1326
+ });
1374
1327
 
1375
1328
  if(!Modernizr.formvalidation || webshims.bugs.bustedValidity){
1376
1329
  webshims.register('form-shim-extend', function($, webshims, window, document, undefined, options){
@@ -2115,6 +2068,8 @@ if(Modernizr.inputtypes.date && /webkit/i.test(navigator.userAgent)){
2115
2068
  fixInputTypes = {
2116
2069
  date: 1,
2117
2070
  time: 1,
2071
+ month: 1,
2072
+ week: 1,
2118
2073
  "datetime-local": 1
2119
2074
  },
2120
2075
  noFocusEvents = {
@@ -2184,83 +2139,7 @@ if(Modernizr.inputtypes.date && /webkit/i.test(navigator.userAgent)){
2184
2139
  ;
2185
2140
  }
2186
2141
  ;
2187
- if($.event.customEvent){
2188
- $.event.customEvent.updateInput = true;
2189
- }
2190
2142
 
2191
- (function(){
2192
-
2193
- var correctValue = function(elem){
2194
- var i = 1;
2195
- var len = 3;
2196
- var abort, val;
2197
- if(elem.type == 'date' && (isSubmit || !$(elem).is(':focus'))){
2198
- val = elem.value;
2199
- if(val && val.length < 10 && (val = val.split('-')) && val.length == len){
2200
- for(; i < len; i++){
2201
- if(val[i].length == 1){
2202
- val[i] = '0'+val[i];
2203
- } else if(val[i].length != 2){
2204
- abort = true;
2205
- break;
2206
- }
2207
- }
2208
- if(!abort){
2209
- val = val.join('-');
2210
- $.prop(elem, 'value', val);
2211
- return val;
2212
- }
2213
- }
2214
- }
2215
- };
2216
- var inputCheckValidityDesc, formCheckValidityDesc, inputValueDesc, inputValidityDesc;
2217
-
2218
- inputCheckValidityDesc = webshims.defineNodeNameProperty('input', 'checkValidity', {
2219
- prop: {
2220
- value: function(){
2221
- correctValue(this);
2222
- return inputCheckValidityDesc.prop._supvalue.apply(this, arguments);
2223
- }
2224
- }
2225
- });
2226
-
2227
- formCheckValidityDesc = webshims.defineNodeNameProperty('form', 'checkValidity', {
2228
- prop: {
2229
- value: function(){
2230
- $('input', this).each(function(){
2231
- correctValue(this);
2232
- });
2233
- return formCheckValidityDesc.prop._supvalue.apply(this, arguments);
2234
- }
2235
- }
2236
- });
2237
-
2238
- inputValueDesc = webshims.defineNodeNameProperty('input', 'value', {
2239
- prop: {
2240
- set: function(){
2241
- return inputValueDesc.prop._supset.apply(this, arguments);
2242
- },
2243
- get: function(){
2244
- return correctValue(this) || inputValueDesc.prop._supget.apply(this, arguments);
2245
- }
2246
- }
2247
- });
2248
-
2249
- inputValidityDesc = webshims.defineNodeNameProperty('input', 'validity', {
2250
- prop: {
2251
- writeable: false,
2252
- get: function(){
2253
- correctValue(this);
2254
- return inputValidityDesc.prop._supget.apply(this, arguments);
2255
- }
2256
- }
2257
- });
2258
-
2259
- $(document).on('change', function(e){
2260
- correctValue(e.target);
2261
- });
2262
-
2263
- })();
2264
2143
 
2265
2144
  $(document)
2266
2145
  .on('focusin', function(e){
@@ -3281,8 +3160,15 @@ webshims.register('form-message', function($, webshims, window, document, undefi
3281
3160
  validityMessages.en.rangeOverflow[type] = validityMessages.en.rangeOverflow[type] || 'Value must be at or before {%max}.';
3282
3161
  });
3283
3162
  }
3284
-
3285
- validityMessages['en-US'] = validityMessages['en-US'] || validityMessages.en;
3163
+ if(!validityMessages['en-US']){
3164
+ validityMessages['en-US'] = $.extend(true, {}, validityMessages.en);
3165
+ }
3166
+ if(!validityMessages['en-GB']){
3167
+ validityMessages['en-GB'] = $.extend(true, {}, validityMessages.en);
3168
+ }
3169
+ if(!validityMessages['en-AU']){
3170
+ validityMessages['en-AU'] = $.extend(true, {}, validityMessages.en);
3171
+ }
3286
3172
  validityMessages[''] = validityMessages[''] || validityMessages['en-US'];
3287
3173
 
3288
3174
  validityMessages.de = $.extend(true, {
@@ -3382,12 +3268,22 @@ webshims.register('form-message', function($, webshims, window, document, undefi
3382
3268
 
3383
3269
  webshims.activeLang({
3384
3270
  langObj: validityMessages,
3385
- module: 'form-core',
3271
+ module: 'form-core',
3386
3272
  callback: function(langObj){
3387
-
3388
3273
  currentValidationMessage = langObj;
3389
3274
  }
3390
3275
  });
3276
+ webshims.activeLang({
3277
+ register: 'form-core',
3278
+ callback: function(val){
3279
+ $.each(validityMessages, function(i, val){
3280
+ if(validityMessages[val]){
3281
+ currentValidationMessage = validityMessages[val];
3282
+ return false;
3283
+ }
3284
+ });
3285
+ }
3286
+ });
3391
3287
 
3392
3288
  implementProperties.forEach(function(messageProp){
3393
3289
  webshims.defineNodeNamesProperty(['fieldset', 'output', 'button'], messageProp, {
@@ -3434,6 +3330,7 @@ webshims.register('form-message', function($, webshims, window, document, undefi
3434
3330
 
3435
3331
  });
3436
3332
  });
3333
+
3437
3334
  webshims.register('form-datalist', function($, webshims, window, document, undefined, options){
3438
3335
  "use strict";
3439
3336
  var doc = document;