webshims-rails 1.10.6 → 1.10.9

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -509,10 +509,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
509
509
  if(!$.parseHTML){
510
510
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
511
511
  }
512
+
513
+ if(webshims.cfg.extendNative == 1){
514
+ 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");
515
+ }
516
+
512
517
  if (!webshims.cfg.no$Switch) {
513
518
  var switch$ = function(){
514
519
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
515
- webshims.error("jQuery was included more than once. Make sure to include it only once! Webshims and other Plugins might not work properly.");
520
+ 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..");
516
521
  if (window.$) {
517
522
  window.$ = webshims.$;
518
523
  }
@@ -530,7 +535,10 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
530
535
  };
531
536
  switch$();
532
537
  setTimeout(switch$, 90);
538
+ webshims.ready('DOM', switch$);
533
539
  $(switch$);
540
+ webshims.ready('WINDOWLOAD', switch$);
541
+
534
542
  }
535
543
  // (function(){
536
544
  // var hostNames = {
@@ -638,6 +646,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
638
646
  $(evtDel).off(evt, fn);
639
647
  }
640
648
  });
649
+ return this;
641
650
  };
642
651
 
643
652
  var dataID = '_webshimsLib'+ (Math.round(Math.random() * 1000));
@@ -672,57 +681,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
672
681
  };
673
682
  });
674
683
 
675
- if($.Tween.propHooks._default && $.css){
676
- (function(){
677
- var isjQ8 = false;
678
- try {
679
- isjQ8 = $.css($('<b style="width: 10px" />')[0], 'width', '') == '10px';
680
- } catch(er){
681
- webshims.error(er);
682
- }
683
- var css = isjQ8 ?
684
- function(elem, prop){
685
- return $.css( elem, prop, false, "" );
686
- } :
687
- function(elem, prop){
688
- return $.css( elem, prop, "" );
689
- }
690
- ;
691
-
692
- $.extend($.Tween.propHooks._default, {
693
- get: function( tween ) {
694
- var result;
695
-
696
- if ( (tween.elem[ tween.prop ] != null || havePolyfill[ tween.prop ]) &&
697
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
698
- return havePolyfill[ tween.prop ] ? $.prop(tween.elem, tween.prop) : tween.elem[ tween.prop ];
699
- }
700
-
701
- // passing an empty string as a 3rd parameter to .css will automatically
702
- // attempt a parseFloat and fallback to a string if the parse fails
703
- // so, simple values such as "10px" are parsed to Float.
704
- // complex values such as "rotate(1rad)" are returned as is.
705
- result = css( tween.elem, tween.prop );
706
- // Empty strings, null, undefined and "auto" are converted to 0.
707
- return !result || result === "auto" ? 0 : result;
708
- },
709
- set: function( tween ) {
710
- // use step hook for back compat - use cssHook if its there - use .style if its
711
- // available and use plain properties where available
712
- if ( jQuery.fx.step[ tween.prop ] ) {
713
- jQuery.fx.step[ tween.prop ]( tween );
714
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
715
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
716
- } else if( !havePolyfill[ tween.prop ] ) {
717
- tween.elem[ tween.prop ] = tween.now;
718
- } else {
719
- $.prop(tween.elem, tween.prop, tween.now);
720
- }
721
- }
722
- });
723
- })();
724
- }
725
-
726
684
 
727
685
  ['removeAttr', 'prop', 'attr'].forEach(function(type){
728
686
  olds[type] = $[type];
@@ -1126,48 +1084,50 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1126
1084
  });
1127
1085
  };
1128
1086
  return function(nativeElem, shadowElem, opts){
1129
- opts = opts || {};
1130
- if(nativeElem.jquery){
1131
- nativeElem = nativeElem[0];
1132
- }
1133
- if(shadowElem.jquery){
1134
- shadowElem = shadowElem[0];
1135
- }
1136
- var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
1137
- var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
1138
- var shadowFocusElementData = {};
1139
- if(!opts.shadowFocusElement){
1140
- opts.shadowFocusElement = shadowElem;
1141
- } else if(opts.shadowFocusElement){
1142
- if(opts.shadowFocusElement.jquery){
1143
- opts.shadowFocusElement = opts.shadowFocusElement[0];
1087
+ if(nativeElem && shadowElem){
1088
+ opts = opts || {};
1089
+ if(nativeElem.jquery){
1090
+ nativeElem = nativeElem[0];
1144
1091
  }
1145
- shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
1146
- }
1147
-
1148
- $(nativeElem).on('remove', function(e){
1149
- if (!e.originalEvent) {
1150
- $(shadowElem).remove();
1092
+ if(shadowElem.jquery){
1093
+ shadowElem = shadowElem[0];
1151
1094
  }
1152
- });
1153
-
1154
- nativeData.hasShadow = shadowElem;
1155
- shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
1156
- shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
1157
- nativeElement: nativeElem,
1158
- shadowElement: shadowElem,
1159
- shadowFocusElement: opts.shadowFocusElement
1160
- };
1161
- if(opts.shadowChilds){
1162
- opts.shadowChilds.each(function(){
1163
- elementData(this, 'shadowData', shadowData.shadowData);
1095
+ var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
1096
+ var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
1097
+ var shadowFocusElementData = {};
1098
+ if(!opts.shadowFocusElement){
1099
+ opts.shadowFocusElement = shadowElem;
1100
+ } else if(opts.shadowFocusElement){
1101
+ if(opts.shadowFocusElement.jquery){
1102
+ opts.shadowFocusElement = opts.shadowFocusElement[0];
1103
+ }
1104
+ shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
1105
+ }
1106
+
1107
+ $(nativeElem).on('remove', function(e){
1108
+ if (!e.originalEvent) {
1109
+ $(shadowElem).remove();
1110
+ }
1164
1111
  });
1112
+
1113
+ nativeData.hasShadow = shadowElem;
1114
+ shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
1115
+ shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
1116
+ nativeElement: nativeElem,
1117
+ shadowElement: shadowElem,
1118
+ shadowFocusElement: opts.shadowFocusElement
1119
+ };
1120
+ if(opts.shadowChilds){
1121
+ opts.shadowChilds.each(function(){
1122
+ elementData(this, 'shadowData', shadowData.shadowData);
1123
+ });
1124
+ }
1125
+
1126
+ if(opts.data){
1127
+ shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
1128
+ }
1129
+ opts = null;
1165
1130
  }
1166
-
1167
- if(opts.data){
1168
- shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
1169
- }
1170
- opts = null;
1171
1131
  webshims.docObserve();
1172
1132
  };
1173
1133
  })(),
@@ -1451,7 +1411,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1451
1411
  // register: moduleName:string,
1452
1412
  // callback: callback:function
1453
1413
  // });
1454
- // get/set including removeLang
1414
+ // get/set including remoteLang
1455
1415
  // - webshims.activeLang({
1456
1416
  // module: moduleName:string,
1457
1417
  // callback: callback:function,
@@ -1703,12 +1663,13 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1703
1663
  $.expr[":"][name] = $.expr.filters[name+"-element"];
1704
1664
  });
1705
1665
 
1706
-
1707
- $.expr[":"].focus = function( elem ) {
1666
+ var pseudoFocus = $.expr[":"].focus;
1667
+ $.expr[":"].focus = function(){
1708
1668
  try {
1709
- var doc = elem.ownerDocument;
1710
- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus());
1711
- } catch(e){}
1669
+ return pseudoFocus.apply(this, arguments);
1670
+ } catch(e){
1671
+ webshims.error(e);
1672
+ }
1712
1673
  return false;
1713
1674
  };
1714
1675
 
@@ -1723,7 +1684,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1723
1684
  });
1724
1685
  };
1725
1686
 
1726
-
1687
+ var transClass = ('transitionDelay' in document.documentElement.style) ? '' : ' no-transition';
1727
1688
  webshims.wsPopover = {
1728
1689
  id: 0,
1729
1690
  _create: function(){
@@ -1731,7 +1692,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1731
1692
  this.id = webshims.wsPopover.id++;
1732
1693
  this.eventns = '.wsoverlay' + this.id;
1733
1694
  this.timers = {};
1734
- 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>');
1695
+ 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>');
1735
1696
  this.contentElement = $('.ws-po-box', this.element);
1736
1697
  this.lastElement = $([]);
1737
1698
  this.bindElement();
@@ -1770,47 +1731,6 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1770
1731
  };
1771
1732
 
1772
1733
 
1773
- /* extension, but also used to fix native implementation workaround/bugfixes */
1774
- (function(){
1775
- var firstEvent,
1776
- invalids = [],
1777
- stopSubmitTimer,
1778
- form
1779
- ;
1780
-
1781
- $(document).on('invalid', function(e){
1782
- if(e.wrongWebkitInvalid){return;}
1783
- var jElm = $(e.target);
1784
-
1785
-
1786
- if(!firstEvent){
1787
- //trigger firstinvalid
1788
- firstEvent = $.Event('firstinvalid');
1789
- firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1790
- var firstSystemInvalid = $.Event('firstinvalidsystem');
1791
- $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1792
- jElm.trigger(firstEvent);
1793
- }
1794
-
1795
- //if firstinvalid was prevented all invalids will be also prevented
1796
- if( firstEvent && firstEvent.isDefaultPrevented() ){
1797
- e.preventDefault();
1798
- }
1799
- invalids.push(e.target);
1800
- e.extraData = 'fix';
1801
- clearTimeout(stopSubmitTimer);
1802
- stopSubmitTimer = setTimeout(function(){
1803
- var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1804
- //reset firstinvalid
1805
- firstEvent = false;
1806
- invalids = [];
1807
- $(e.target).trigger(lastEvent, lastEvent);
1808
- }, 9);
1809
- jElm = null;
1810
- });
1811
- })();
1812
-
1813
-
1814
1734
  webshims.getContentValidationMessage = function(elem, validity, key){
1815
1735
  var message = $(elem).data('errormessage') || elem.getAttribute('x-moz-errormessage') || '';
1816
1736
  if(key && message[key]){
@@ -1844,19 +1764,13 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1844
1764
  };
1845
1765
 
1846
1766
 
1847
- webshims.ready('forms', function(){
1848
- $(document).on('focusin.lazyloadvalidation', function(e){
1849
- if('form' in e.target && $(e.target).is(':invalid')){
1850
- lazyLoad();
1851
- }
1852
- });
1767
+ $(document).on('focusin.lazyloadvalidation', function(e){
1768
+ if('form' in e.target && $(e.target).is(':invalid')){
1769
+ lazyLoad();
1770
+ }
1853
1771
  });
1854
1772
  webshims.ready('WINDOWLOAD', lazyLoad);
1855
- if(options.overrideMessages){
1856
- options.customMessages = true;
1857
- webshims.reTest('form-message');
1858
- webshims.error('overrideMessages is deprecated. use customMessages instead.');
1859
- }
1773
+
1860
1774
  if(options.replaceValidationUI){
1861
1775
  webshims.ready('DOM forms', function(){
1862
1776
  $(document).on('firstinvalid', function(e){
@@ -1867,8 +1781,47 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1867
1781
  });
1868
1782
  });
1869
1783
  }
1870
- });
1784
+
1785
+ /* extension, but also used to fix native implementation workaround/bugfixes */
1786
+ (function(){
1787
+ var firstEvent,
1788
+ invalids = [],
1789
+ stopSubmitTimer,
1790
+ form
1791
+ ;
1792
+
1793
+ $(document).on('invalid', function(e){
1794
+ if(e.wrongWebkitInvalid){return;}
1795
+ var jElm = $(e.target);
1796
+
1797
+
1798
+ if(!firstEvent){
1799
+ //trigger firstinvalid
1800
+ firstEvent = $.Event('firstinvalid');
1801
+ firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1802
+ var firstSystemInvalid = $.Event('firstinvalidsystem');
1803
+ $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1804
+ jElm.trigger(firstEvent);
1805
+ }
1871
1806
 
1807
+ //if firstinvalid was prevented all invalids will be also prevented
1808
+ if( firstEvent && firstEvent.isDefaultPrevented() ){
1809
+ e.preventDefault();
1810
+ }
1811
+ invalids.push(e.target);
1812
+ e.extraData = 'fix';
1813
+ clearTimeout(stopSubmitTimer);
1814
+ stopSubmitTimer = setTimeout(function(){
1815
+ var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1816
+ //reset firstinvalid
1817
+ firstEvent = false;
1818
+ invalids = [];
1819
+ $(e.target).trigger(lastEvent, lastEvent);
1820
+ }, 9);
1821
+ jElm = null;
1822
+ });
1823
+ })();
1824
+ });
1872
1825
 
1873
1826
  if(!Modernizr.formvalidation || webshims.bugs.bustedValidity){
1874
1827
  webshims.register('form-shim-extend', function($, webshims, window, document, undefined, options){
@@ -2613,6 +2566,8 @@ if(Modernizr.inputtypes.date && /webkit/i.test(navigator.userAgent)){
2613
2566
  fixInputTypes = {
2614
2567
  date: 1,
2615
2568
  time: 1,
2569
+ month: 1,
2570
+ week: 1,
2616
2571
  "datetime-local": 1
2617
2572
  },
2618
2573
  noFocusEvents = {
@@ -2682,83 +2637,7 @@ if(Modernizr.inputtypes.date && /webkit/i.test(navigator.userAgent)){
2682
2637
  ;
2683
2638
  }
2684
2639
  ;
2685
- if($.event.customEvent){
2686
- $.event.customEvent.updateInput = true;
2687
- }
2688
2640
 
2689
- (function(){
2690
-
2691
- var correctValue = function(elem){
2692
- var i = 1;
2693
- var len = 3;
2694
- var abort, val;
2695
- if(elem.type == 'date' && (isSubmit || !$(elem).is(':focus'))){
2696
- val = elem.value;
2697
- if(val && val.length < 10 && (val = val.split('-')) && val.length == len){
2698
- for(; i < len; i++){
2699
- if(val[i].length == 1){
2700
- val[i] = '0'+val[i];
2701
- } else if(val[i].length != 2){
2702
- abort = true;
2703
- break;
2704
- }
2705
- }
2706
- if(!abort){
2707
- val = val.join('-');
2708
- $.prop(elem, 'value', val);
2709
- return val;
2710
- }
2711
- }
2712
- }
2713
- };
2714
- var inputCheckValidityDesc, formCheckValidityDesc, inputValueDesc, inputValidityDesc;
2715
-
2716
- inputCheckValidityDesc = webshims.defineNodeNameProperty('input', 'checkValidity', {
2717
- prop: {
2718
- value: function(){
2719
- correctValue(this);
2720
- return inputCheckValidityDesc.prop._supvalue.apply(this, arguments);
2721
- }
2722
- }
2723
- });
2724
-
2725
- formCheckValidityDesc = webshims.defineNodeNameProperty('form', 'checkValidity', {
2726
- prop: {
2727
- value: function(){
2728
- $('input', this).each(function(){
2729
- correctValue(this);
2730
- });
2731
- return formCheckValidityDesc.prop._supvalue.apply(this, arguments);
2732
- }
2733
- }
2734
- });
2735
-
2736
- inputValueDesc = webshims.defineNodeNameProperty('input', 'value', {
2737
- prop: {
2738
- set: function(){
2739
- return inputValueDesc.prop._supset.apply(this, arguments);
2740
- },
2741
- get: function(){
2742
- return correctValue(this) || inputValueDesc.prop._supget.apply(this, arguments);
2743
- }
2744
- }
2745
- });
2746
-
2747
- inputValidityDesc = webshims.defineNodeNameProperty('input', 'validity', {
2748
- prop: {
2749
- writeable: false,
2750
- get: function(){
2751
- correctValue(this);
2752
- return inputValidityDesc.prop._supget.apply(this, arguments);
2753
- }
2754
- }
2755
- });
2756
-
2757
- $(document).on('change', function(e){
2758
- correctValue(e.target);
2759
- });
2760
-
2761
- })();
2762
2641
 
2763
2642
  $(document)
2764
2643
  .on('focusin', function(e){
@@ -3779,8 +3658,15 @@ webshims.register('form-message', function($, webshims, window, document, undefi
3779
3658
  validityMessages.en.rangeOverflow[type] = validityMessages.en.rangeOverflow[type] || 'Value must be at or before {%max}.';
3780
3659
  });
3781
3660
  }
3782
-
3783
- validityMessages['en-US'] = validityMessages['en-US'] || validityMessages.en;
3661
+ if(!validityMessages['en-US']){
3662
+ validityMessages['en-US'] = $.extend(true, {}, validityMessages.en);
3663
+ }
3664
+ if(!validityMessages['en-GB']){
3665
+ validityMessages['en-GB'] = $.extend(true, {}, validityMessages.en);
3666
+ }
3667
+ if(!validityMessages['en-AU']){
3668
+ validityMessages['en-AU'] = $.extend(true, {}, validityMessages.en);
3669
+ }
3784
3670
  validityMessages[''] = validityMessages[''] || validityMessages['en-US'];
3785
3671
 
3786
3672
  validityMessages.de = $.extend(true, {
@@ -3880,12 +3766,22 @@ webshims.register('form-message', function($, webshims, window, document, undefi
3880
3766
 
3881
3767
  webshims.activeLang({
3882
3768
  langObj: validityMessages,
3883
- module: 'form-core',
3769
+ module: 'form-core',
3884
3770
  callback: function(langObj){
3885
-
3886
3771
  currentValidationMessage = langObj;
3887
3772
  }
3888
3773
  });
3774
+ webshims.activeLang({
3775
+ register: 'form-core',
3776
+ callback: function(val){
3777
+ $.each(validityMessages, function(i, val){
3778
+ if(validityMessages[val]){
3779
+ currentValidationMessage = validityMessages[val];
3780
+ return false;
3781
+ }
3782
+ });
3783
+ }
3784
+ });
3889
3785
 
3890
3786
  implementProperties.forEach(function(messageProp){
3891
3787
  webshims.defineNodeNamesProperty(['fieldset', 'output', 'button'], messageProp, {
@@ -3932,6 +3828,7 @@ webshims.register('form-message', function($, webshims, window, document, undefi
3932
3828
 
3933
3829
  });
3934
3830
  });
3831
+
3935
3832
  webshims.register('form-datalist', function($, webshims, window, document, undefined, options){
3936
3833
  "use strict";
3937
3834
  var doc = document;
@@ -4255,52 +4152,55 @@ webshims.register('form-datalist', function($, webshims, window, document, undef
4255
4152
  });
4256
4153
  webshims.loader.loadList(['mediaelement-native-fix']);
4257
4154
  }
4258
- }
4259
-
4260
- if(hasNative && !options.preferFlash){
4261
- var noSwitch = {
4262
- 1: 1,
4263
- 2: 1
4264
- };
4265
- var switchOptions = function(e){
4266
- var media;
4267
- var parent;
4268
- if(!options.preferFlash &&
4155
+
4156
+ if(!options.preferFlash){
4157
+ var noSwitch = {
4158
+ 1: 1,
4159
+ 2: 1
4160
+ };
4161
+ var switchOptions = function(e){
4162
+ var media, error, parent;
4163
+ if(!options.preferFlash &&
4269
4164
  ($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source:last', parent)[0] == e.target)) &&
4270
- (media = $(e.target).closest('audio, video')) && !noSwitch[media.prop('error')]
4165
+ (media = $(e.target).closest('audio, video')) && !noSwitch[(error = media.prop('error'))]
4271
4166
  ){
4272
- $(function(){
4273
- if(hasSwf && !options.preferFlash){
4274
- loadSwf();
4275
- webshims.ready('WINDOWLOAD '+swfType, function(){
4276
- setTimeout(function(){
4277
- if(!options.preferFlash && webshims.mediaelement.createSWF && !media.is('.nonnative-api-active')){
4278
- options.preferFlash = true;
4279
- document.removeEventListener('error', switchOptions, true);
4280
- $('audio, video').each(function(){
4281
- webshims.mediaelement.selectSource(this);
4282
- });
4283
- webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error'));
4284
- }
4285
- }, 9);
4286
- });
4287
- } else{
4288
- document.removeEventListener('error', switchOptions, true);
4167
+ if(error == null){
4168
+ webshims.warn("There was an unspecified error on a mediaelement");
4169
+ return;
4170
+
4289
4171
  }
4290
- });
4291
- }
4292
- };
4293
- document.addEventListener('error', switchOptions, true);
4294
- $('audio, video').each(function(){
4295
- var error = $.prop(this, 'error');
4296
- if(error && !noSwitch[error]){
4297
- switchOptions({target: this});
4298
- return false;
4299
- }
4300
- });
4172
+ $(function(){
4173
+ if(hasSwf && !options.preferFlash){
4174
+ loadSwf();
4175
+ webshims.ready('WINDOWLOAD '+swfType, function(){
4176
+ setTimeout(function(){
4177
+ if(!options.preferFlash && webshims.mediaelement.createSWF && !media.is('.nonnative-api-active')){
4178
+ options.preferFlash = true;
4179
+ document.removeEventListener('error', switchOptions, true);
4180
+ $('audio, video').each(function(){
4181
+ webshims.mediaelement.selectSource(this);
4182
+ });
4183
+ webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error'));
4184
+ }
4185
+ }, 9);
4186
+ });
4187
+ } else{
4188
+ document.removeEventListener('error', switchOptions, true);
4189
+ }
4190
+ });
4191
+ }
4192
+ };
4193
+ document.addEventListener('error', switchOptions, true);
4194
+ $('audio, video').each(function(){
4195
+ var error = $.prop(this, 'error');
4196
+ if(error && !noSwitch[error]){
4197
+ switchOptions({target: this});
4198
+ return false;
4199
+ }
4200
+ });
4201
+ }
4301
4202
  }
4302
4203
 
4303
-
4304
4204
  if(Modernizr.track && !bugs.track){
4305
4205
  (function(){
4306
4206
 
@@ -4681,63 +4581,14 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
4681
4581
 
4682
4582
  });
4683
4583
 
4684
- webshims.ready('dom-support', function(){
4685
- if(!supportsLoop){
4686
- webshims.defineNodeNamesBooleanProperty(['audio', 'video'], 'loop');
4687
- }
4688
-
4689
- ['audio', 'video'].forEach(function(nodeName){
4690
- var supLoad = webshims.defineNodeNameProperty(nodeName, 'load', {
4691
- prop: {
4692
- value: function(){
4693
- var data = webshims.data(this, 'mediaelement');
4694
- selectSource(this, data);
4695
- if(hasNative && (!data || data.isActive == 'html5') && supLoad.prop._supvalue){
4696
- supLoad.prop._supvalue.apply(this, arguments);
4697
- }
4698
- }
4699
- }
4700
- });
4701
- nativeCanPlayType[nodeName] = webshims.defineNodeNameProperty(nodeName, 'canPlayType', {
4702
- prop: {
4703
- value: function(type){
4704
- var ret = '';
4705
- if(hasNative && nativeCanPlayType[nodeName].prop._supvalue){
4706
- ret = nativeCanPlayType[nodeName].prop._supvalue.call(this, type);
4707
- if(ret == 'no'){
4708
- ret = '';
4709
- }
4710
- }
4711
- if(!ret && hasSwf){
4712
- type = $.trim((type || '').split(';')[0]);
4713
- if(mediaelement.swfMimeTypes.indexOf(type) != -1){
4714
- ret = 'maybe';
4715
- }
4716
- }
4717
- return ret;
4718
- }
4719
- }
4720
- });
4721
- });
4722
- webshims.onNodeNamesPropertyModify(['audio', 'video'], ['src', 'poster'], {
4723
- set: function(){
4724
- var elem = this;
4725
- var baseData = webshims.data(elem, 'mediaelementBase') || webshims.data(elem, 'mediaelementBase', {});
4726
- clearTimeout(baseData.loadTimer);
4727
- baseData.loadTimer = setTimeout(function(){
4728
- selectSource(elem);
4729
- elem = null;
4730
- }, 9);
4731
- }
4732
- });
4733
- });
4734
-
4584
+ var handleMedia = false;
4735
4585
  var initMediaElements = function(){
4736
4586
  var testFixMedia = function(){
4737
4587
  if(webshims.implement(this, 'mediaelement')){
4738
4588
  selectSource(this);
4739
4589
 
4740
- if(hasNative){
4590
+ //fixes for FF 12 and IE9/10 || does not hurt, if run in other browsers
4591
+ if(hasNative && (!supportsLoop || ('ActiveXObject' in window))){
4741
4592
  var bufferTimer;
4742
4593
  var lastBuffered;
4743
4594
  var elem = this;
@@ -4766,7 +4617,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
4766
4617
  lastBuffered = getBufferedString();
4767
4618
  }
4768
4619
  clearTimeout(bufferTimer);
4769
- bufferTimer = setTimeout(testBuffer, 999);
4620
+ bufferTimer = setTimeout(testBuffer, 400);
4770
4621
  },
4771
4622
  'emptied stalled mediaerror abort suspend': function(e){
4772
4623
  if(e.type == 'emptied'){
@@ -4783,11 +4634,62 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
4783
4634
  }
4784
4635
 
4785
4636
  };
4786
- var handleMedia = false;
4637
+
4787
4638
 
4788
4639
 
4789
4640
  webshims.ready('dom-support', function(){
4790
4641
  handleMedia = true;
4642
+
4643
+ if(!supportsLoop){
4644
+ webshims.defineNodeNamesBooleanProperty(['audio', 'video'], 'loop');
4645
+ }
4646
+
4647
+ ['audio', 'video'].forEach(function(nodeName){
4648
+ var supLoad = webshims.defineNodeNameProperty(nodeName, 'load', {
4649
+ prop: {
4650
+ value: function(){
4651
+ var data = webshims.data(this, 'mediaelement');
4652
+ selectSource(this, data);
4653
+ if(hasNative && (!data || data.isActive == 'html5') && supLoad.prop._supvalue){
4654
+ supLoad.prop._supvalue.apply(this, arguments);
4655
+ }
4656
+ }
4657
+ }
4658
+ });
4659
+ nativeCanPlayType[nodeName] = webshims.defineNodeNameProperty(nodeName, 'canPlayType', {
4660
+ prop: {
4661
+ value: function(type){
4662
+ var ret = '';
4663
+ if(hasNative && nativeCanPlayType[nodeName].prop._supvalue){
4664
+ ret = nativeCanPlayType[nodeName].prop._supvalue.call(this, type);
4665
+ if(ret == 'no'){
4666
+ ret = '';
4667
+ }
4668
+ }
4669
+ if(!ret && hasSwf){
4670
+ type = $.trim((type || '').split(';')[0]);
4671
+ if(mediaelement.swfMimeTypes.indexOf(type) != -1){
4672
+ ret = 'maybe';
4673
+ }
4674
+ }
4675
+ return ret;
4676
+ }
4677
+ }
4678
+ });
4679
+ });
4680
+ webshims.onNodeNamesPropertyModify(['audio', 'video'], ['src', 'poster'], {
4681
+ set: function(){
4682
+ var elem = this;
4683
+ var baseData = webshims.data(elem, 'mediaelementBase') || webshims.data(elem, 'mediaelementBase', {});
4684
+ clearTimeout(baseData.loadTimer);
4685
+ baseData.loadTimer = setTimeout(function(){
4686
+ selectSource(elem);
4687
+ elem = null;
4688
+ }, 9);
4689
+ }
4690
+ });
4691
+
4692
+
4791
4693
  webshims.addReady(function(context, insertedElement){
4792
4694
  var media = $('video, audio', context)
4793
4695
  .add(insertedElement.filter('video, audio'))