webshims-rails 1.10.11 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +8 -8
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/readme.textile +14 -1
  4. data/vendor/assets/javascripts/webshims/polyfiller.js +2 -1
  5. data/vendor/assets/javascripts/webshims/shims/combos/1.js +12 -63
  6. data/vendor/assets/javascripts/webshims/shims/combos/10.js +17 -7
  7. data/vendor/assets/javascripts/webshims/shims/combos/11.js +17 -3
  8. data/vendor/assets/javascripts/webshims/shims/combos/12.js +11 -12
  9. data/vendor/assets/javascripts/webshims/shims/combos/13.js +11 -12
  10. data/vendor/assets/javascripts/webshims/shims/combos/14.js +0 -4
  11. data/vendor/assets/javascripts/webshims/shims/combos/15.js +10 -59
  12. data/vendor/assets/javascripts/webshims/shims/combos/16.js +21 -71
  13. data/vendor/assets/javascripts/webshims/shims/combos/17.js +17 -3
  14. data/vendor/assets/javascripts/webshims/shims/combos/18.js +17 -3
  15. data/vendor/assets/javascripts/webshims/shims/combos/19.js +58 -19
  16. data/vendor/assets/javascripts/webshims/shims/combos/2.js +12 -67
  17. data/vendor/assets/javascripts/webshims/shims/combos/20.js +58 -19
  18. data/vendor/assets/javascripts/webshims/shims/combos/21.js +47 -3
  19. data/vendor/assets/javascripts/webshims/shims/combos/23.js +11 -12
  20. data/vendor/assets/javascripts/webshims/shims/combos/24.js +324 -79
  21. data/vendor/assets/javascripts/webshims/shims/combos/25.js +63 -21
  22. data/vendor/assets/javascripts/webshims/shims/combos/26.js +5 -6
  23. data/vendor/assets/javascripts/webshims/shims/combos/27.js +5 -2
  24. data/vendor/assets/javascripts/webshims/shims/combos/28.js +47 -7
  25. data/vendor/assets/javascripts/webshims/shims/combos/3.js +1 -55
  26. data/vendor/assets/javascripts/webshims/shims/combos/30.js +1 -55
  27. data/vendor/assets/javascripts/webshims/shims/combos/31.js +1 -55
  28. data/vendor/assets/javascripts/webshims/shims/combos/4.js +0 -4
  29. data/vendor/assets/javascripts/webshims/shims/combos/5.js +17 -3
  30. data/vendor/assets/javascripts/webshims/shims/combos/6.js +17 -3
  31. data/vendor/assets/javascripts/webshims/shims/combos/7.js +12 -67
  32. data/vendor/assets/javascripts/webshims/shims/combos/8.js +12 -67
  33. data/vendor/assets/javascripts/webshims/shims/combos/9.js +17 -7
  34. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +0 -4
  35. data/vendor/assets/javascripts/webshims/shims/filereader.js +5 -2
  36. data/vendor/assets/javascripts/webshims/shims/form-core.js +1 -51
  37. data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +24 -15
  38. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +6 -2
  39. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +9 -4
  40. data/vendor/assets/javascripts/webshims/shims/form-validation.js +135 -24
  41. data/vendor/assets/javascripts/webshims/shims/form-validators.js +189 -55
  42. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +4 -1
  43. data/vendor/assets/javascripts/webshims/shims/jpicker/jpicker.css +3 -1
  44. data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +11 -12
  45. data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +47 -3
  46. data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +28 -8
  47. data/vendor/assets/javascripts/webshims/shims/mediagroup.js +29 -0
  48. data/vendor/assets/javascripts/webshims/shims/range-ui.js +11 -1
  49. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +17 -4
  50. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +17 -6
  51. data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
  52. metadata +3 -3
  53. data/vendor/assets/javascripts/webshims/shims/swf/jwwebshims.swf +0 -0
@@ -13,10 +13,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
13
13
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
14
14
  }
15
15
 
16
- if(webshims.cfg.extendNative === undefined){
17
- webshims.warn("extendNative configuration was set to false by default with this release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
18
- }
19
-
20
16
  if (!webshims.cfg.no$Switch) {
21
17
  var switch$ = function(){
22
18
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
@@ -1297,62 +1293,12 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1297
1293
 
1298
1294
 
1299
1295
  $(document).on('focusin.lazyloadvalidation', function(e){
1300
- if('form' in e.target && $(e.target).is(':invalid')){
1296
+ if('form' in e.target && (e.target.list || $(e.target).is(':invalid'))){
1301
1297
  lazyLoad();
1302
1298
  }
1303
1299
  });
1304
1300
  webshims.ready('WINDOWLOAD', lazyLoad);
1305
1301
 
1306
- if(options.replaceValidationUI){
1307
- webshims.ready('DOM forms', function(){
1308
- $(document).on('firstinvalid', function(e){
1309
- if(!e.isInvalidUIPrevented()){
1310
- e.preventDefault();
1311
- webshims.validityAlert.showFor( e.target );
1312
- }
1313
- });
1314
- });
1315
- }
1316
-
1317
- /* extension, but also used to fix native implementation workaround/bugfixes */
1318
- (function(){
1319
- var firstEvent,
1320
- invalids = [],
1321
- stopSubmitTimer,
1322
- form
1323
- ;
1324
-
1325
- $(document).on('invalid', function(e){
1326
- if(e.wrongWebkitInvalid){return;}
1327
- var jElm = $(e.target);
1328
-
1329
-
1330
- if(!firstEvent){
1331
- //trigger firstinvalid
1332
- firstEvent = $.Event('firstinvalid');
1333
- firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1334
- var firstSystemInvalid = $.Event('firstinvalidsystem');
1335
- $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1336
- jElm.trigger(firstEvent);
1337
- }
1338
-
1339
- //if firstinvalid was prevented all invalids will be also prevented
1340
- if( firstEvent && firstEvent.isDefaultPrevented() ){
1341
- e.preventDefault();
1342
- }
1343
- invalids.push(e.target);
1344
- e.extraData = 'fix';
1345
- clearTimeout(stopSubmitTimer);
1346
- stopSubmitTimer = setTimeout(function(){
1347
- var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1348
- //reset firstinvalid
1349
- firstEvent = false;
1350
- invalids = [];
1351
- $(e.target).trigger(lastEvent, lastEvent);
1352
- }, 9);
1353
- jElm = null;
1354
- });
1355
- })();
1356
1302
  });
1357
1303
 
1358
1304
  webshims.register('form-datalist', function($, webshims, window, document, undefined, options){
@@ -13,10 +13,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
13
13
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
14
14
  }
15
15
 
16
- if(webshims.cfg.extendNative === undefined){
17
- webshims.warn("extendNative configuration was set to false by default with this release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
18
- }
19
-
20
16
  if (!webshims.cfg.no$Switch) {
21
17
  var switch$ = function(){
22
18
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
@@ -980,7 +980,17 @@ webshims.register('form-number-date-api', function($, webshims, window, document
980
980
  this.value(this.options.value, true);
981
981
  },
982
982
  step: function(val){
983
- this.options.step = val == 'any' ? 'any' : retDefault(val, 1);
983
+ var o = this.options;
984
+ var step = val == 'any' ? 'any' : retDefault(val, 1);
985
+
986
+ if(o.stepping){
987
+ if(step != 'any' && o.stepping % step){
988
+ webshims.error('wrong stepping value for type range:'+ (o.stepping % step));
989
+ } else {
990
+ step = o.stepping;
991
+ }
992
+ }
993
+ o.step = step;
984
994
  this.value(this.options.value);
985
995
  },
986
996
 
@@ -1701,6 +1711,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1701
1711
  fVal[0] = tmp;
1702
1712
  }
1703
1713
  val = this.date(fVal[0], o) +'T'+ this.time(fVal[1], o);
1714
+ } else if (fVal.length == 3) {
1715
+ val = this.date(fVal[0], o) +'T'+ this.time(fVal[1]+fVal[2], o);
1704
1716
  }
1705
1717
  return val;
1706
1718
  },
@@ -2557,7 +2569,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2557
2569
 
2558
2570
  picker._actions = {
2559
2571
  changeInput: function(val, popover, data){
2560
- picker._actions.cancel(val, popover, data);
2572
+ if(!data.options.noChangeDismiss){
2573
+ picker._actions.cancel(val, popover, data);
2574
+ }
2561
2575
  data.setChange(val);
2562
2576
  },
2563
2577
  cancel: function(val, popover, data){
@@ -3104,7 +3118,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3104
3118
  });
3105
3119
  }
3106
3120
 
3107
- var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && (/MSIE 1[0|1]\.\d/.test(navigator.userAgent) || /Trident\/7\.0/.test(navigator.userAgent));
3121
+ var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)));
3108
3122
  ['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){
3109
3123
  if(!modernizrInputTypes[name] || options.replaceUI || (name == 'number' && isStupid)){
3110
3124
  extendType(name, {
@@ -980,7 +980,17 @@ webshims.register('form-number-date-api', function($, webshims, window, document
980
980
  this.value(this.options.value, true);
981
981
  },
982
982
  step: function(val){
983
- this.options.step = val == 'any' ? 'any' : retDefault(val, 1);
983
+ var o = this.options;
984
+ var step = val == 'any' ? 'any' : retDefault(val, 1);
985
+
986
+ if(o.stepping){
987
+ if(step != 'any' && o.stepping % step){
988
+ webshims.error('wrong stepping value for type range:'+ (o.stepping % step));
989
+ } else {
990
+ step = o.stepping;
991
+ }
992
+ }
993
+ o.step = step;
984
994
  this.value(this.options.value);
985
995
  },
986
996
 
@@ -1701,6 +1711,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1701
1711
  fVal[0] = tmp;
1702
1712
  }
1703
1713
  val = this.date(fVal[0], o) +'T'+ this.time(fVal[1], o);
1714
+ } else if (fVal.length == 3) {
1715
+ val = this.date(fVal[0], o) +'T'+ this.time(fVal[1]+fVal[2], o);
1704
1716
  }
1705
1717
  return val;
1706
1718
  },
@@ -2557,7 +2569,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2557
2569
 
2558
2570
  picker._actions = {
2559
2571
  changeInput: function(val, popover, data){
2560
- picker._actions.cancel(val, popover, data);
2572
+ if(!data.options.noChangeDismiss){
2573
+ picker._actions.cancel(val, popover, data);
2574
+ }
2561
2575
  data.setChange(val);
2562
2576
  },
2563
2577
  cancel: function(val, popover, data){
@@ -3104,7 +3118,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3104
3118
  });
3105
3119
  }
3106
3120
 
3107
- var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && (/MSIE 1[0|1]\.\d/.test(navigator.userAgent) || /Trident\/7\.0/.test(navigator.userAgent));
3121
+ var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)));
3108
3122
  ['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){
3109
3123
  if(!modernizrInputTypes[name] || options.replaceUI || (name == 'number' && isStupid)){
3110
3124
  extendType(name, {
@@ -465,10 +465,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
465
465
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
466
466
  }
467
467
 
468
- if(webshims.cfg.extendNative === undefined){
469
- webshims.warn("extendNative configuration was set to false by default with this release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
470
- }
471
-
472
468
  if (!webshims.cfg.no$Switch) {
473
469
  var switch$ = function(){
474
470
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
@@ -1749,62 +1745,12 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1749
1745
 
1750
1746
 
1751
1747
  $(document).on('focusin.lazyloadvalidation', function(e){
1752
- if('form' in e.target && $(e.target).is(':invalid')){
1748
+ if('form' in e.target && (e.target.list || $(e.target).is(':invalid'))){
1753
1749
  lazyLoad();
1754
1750
  }
1755
1751
  });
1756
1752
  webshims.ready('WINDOWLOAD', lazyLoad);
1757
1753
 
1758
- if(options.replaceValidationUI){
1759
- webshims.ready('DOM forms', function(){
1760
- $(document).on('firstinvalid', function(e){
1761
- if(!e.isInvalidUIPrevented()){
1762
- e.preventDefault();
1763
- webshims.validityAlert.showFor( e.target );
1764
- }
1765
- });
1766
- });
1767
- }
1768
-
1769
- /* extension, but also used to fix native implementation workaround/bugfixes */
1770
- (function(){
1771
- var firstEvent,
1772
- invalids = [],
1773
- stopSubmitTimer,
1774
- form
1775
- ;
1776
-
1777
- $(document).on('invalid', function(e){
1778
- if(e.wrongWebkitInvalid){return;}
1779
- var jElm = $(e.target);
1780
-
1781
-
1782
- if(!firstEvent){
1783
- //trigger firstinvalid
1784
- firstEvent = $.Event('firstinvalid');
1785
- firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1786
- var firstSystemInvalid = $.Event('firstinvalidsystem');
1787
- $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1788
- jElm.trigger(firstEvent);
1789
- }
1790
-
1791
- //if firstinvalid was prevented all invalids will be also prevented
1792
- if( firstEvent && firstEvent.isDefaultPrevented() ){
1793
- e.preventDefault();
1794
- }
1795
- invalids.push(e.target);
1796
- e.extraData = 'fix';
1797
- clearTimeout(stopSubmitTimer);
1798
- stopSubmitTimer = setTimeout(function(){
1799
- var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1800
- //reset firstinvalid
1801
- firstEvent = false;
1802
- invalids = [];
1803
- $(e.target).trigger(lastEvent, lastEvent);
1804
- }, 9);
1805
- jElm = null;
1806
- });
1807
- })();
1808
1754
  });
1809
1755
 
1810
1756
  webshims.register('form-message', function($, webshims, window, document, undefined, options){
@@ -2327,6 +2273,7 @@ webshims.register('form-datalist', function($, webshims, window, document, undef
2327
2273
  if(hasNative){
2328
2274
  var videoElem = document.createElement('video');
2329
2275
  Modernizr.videoBuffered = ('buffered' in videoElem);
2276
+ Modernizr.mediaDefaultMuted = ('defaultMuted' in videoElem);
2330
2277
  supportsLoop = ('loop' in videoElem);
2331
2278
 
2332
2279
  webshims.capturingEvents(['play', 'playing', 'waiting', 'paused', 'ended', 'durationchange', 'loadedmetadata', 'canplay', 'volumechange']);
@@ -2340,20 +2287,15 @@ webshims.register('form-datalist', function($, webshims, window, document, undef
2340
2287
 
2341
2288
  if(!options.preferFlash){
2342
2289
  var noSwitch = {
2343
- 1: 1,
2344
- 2: 1
2290
+ 1: 1
2345
2291
  };
2346
2292
  var switchOptions = function(e){
2347
2293
  var media, error, parent;
2348
2294
  if(!options.preferFlash &&
2349
2295
  ($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source:last', parent)[0] == e.target)) &&
2350
- (media = $(e.target).closest('audio, video')) && !noSwitch[(error = media.prop('error'))]
2296
+ (media = $(e.target).closest('audio, video')) && (error = media.prop('error')) && !noSwitch[error.code]
2351
2297
  ){
2352
- if(error == null){
2353
- webshims.warn("There was an unspecified error on a mediaelement");
2354
- return;
2355
-
2356
- }
2298
+
2357
2299
  $(function(){
2358
2300
  if(hasSwf && !options.preferFlash){
2359
2301
  loadSwf();
@@ -2365,7 +2307,7 @@ webshims.register('form-datalist', function($, webshims, window, document, undef
2365
2307
  $('audio, video').each(function(){
2366
2308
  webshims.mediaelement.selectSource(this);
2367
2309
  });
2368
- webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error'));
2310
+ webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error')+ 'first error: '+ error);
2369
2311
  }
2370
2312
  }, 9);
2371
2313
  });
@@ -2571,7 +2513,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2571
2513
  if(src.indexOf('rtmp') === 0){
2572
2514
  return nodeName+'/rtmp';
2573
2515
  }
2574
- src = src.split('?')[0].split('.');
2516
+ src = src.split('?')[0].split('#')[0].split('.');
2575
2517
  src = src[src.length - 1];
2576
2518
  var mt;
2577
2519
 
@@ -2690,7 +2632,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2690
2632
  webshims.error('mediaelementError: '+ message);
2691
2633
  setTimeout(function(){
2692
2634
  if($(elem).data('mediaerror')){
2693
- $(elem).trigger('mediaerror');
2635
+ $(elem).addClass('media-error').trigger('mediaerror');
2694
2636
  }
2695
2637
  }, 1);
2696
2638
  }
@@ -2754,6 +2696,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2754
2696
  var parent = elem.parentNode;
2755
2697
 
2756
2698
  clearTimeout(baseData.loadTimer);
2699
+ $(elem).removeClass('media-error');
2757
2700
  $.data(elem, 'mediaerror', false);
2758
2701
 
2759
2702
  if(!_srces.length || !parent || parent.nodeType != 1 || stopParent.test(parent.nodeName || '')){return;}
@@ -2781,7 +2724,9 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2781
2724
  var testFixMedia = function(){
2782
2725
  if(webshims.implement(this, 'mediaelement')){
2783
2726
  selectSource(this);
2784
-
2727
+ if(!Modernizr.mediaDefaultMuted && $.attr(this, 'muted') != null){
2728
+ $.prop(this, 'muted', true);
2729
+ }
2785
2730
  //fixes for FF 12 and IE9/10 || does not hurt, if run in other browsers
2786
2731
  if(hasNative && (!supportsLoop || ('ActiveXObject' in window))){
2787
2732
  var bufferTimer;
@@ -465,10 +465,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
465
465
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
466
466
  }
467
467
 
468
- if(webshims.cfg.extendNative === undefined){
469
- webshims.warn("extendNative configuration was set to false by default with this release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
470
- }
471
-
472
468
  if (!webshims.cfg.no$Switch) {
473
469
  var switch$ = function(){
474
470
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
@@ -1749,62 +1745,12 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1749
1745
 
1750
1746
 
1751
1747
  $(document).on('focusin.lazyloadvalidation', function(e){
1752
- if('form' in e.target && $(e.target).is(':invalid')){
1748
+ if('form' in e.target && (e.target.list || $(e.target).is(':invalid'))){
1753
1749
  lazyLoad();
1754
1750
  }
1755
1751
  });
1756
1752
  webshims.ready('WINDOWLOAD', lazyLoad);
1757
1753
 
1758
- if(options.replaceValidationUI){
1759
- webshims.ready('DOM forms', function(){
1760
- $(document).on('firstinvalid', function(e){
1761
- if(!e.isInvalidUIPrevented()){
1762
- e.preventDefault();
1763
- webshims.validityAlert.showFor( e.target );
1764
- }
1765
- });
1766
- });
1767
- }
1768
-
1769
- /* extension, but also used to fix native implementation workaround/bugfixes */
1770
- (function(){
1771
- var firstEvent,
1772
- invalids = [],
1773
- stopSubmitTimer,
1774
- form
1775
- ;
1776
-
1777
- $(document).on('invalid', function(e){
1778
- if(e.wrongWebkitInvalid){return;}
1779
- var jElm = $(e.target);
1780
-
1781
-
1782
- if(!firstEvent){
1783
- //trigger firstinvalid
1784
- firstEvent = $.Event('firstinvalid');
1785
- firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1786
- var firstSystemInvalid = $.Event('firstinvalidsystem');
1787
- $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1788
- jElm.trigger(firstEvent);
1789
- }
1790
-
1791
- //if firstinvalid was prevented all invalids will be also prevented
1792
- if( firstEvent && firstEvent.isDefaultPrevented() ){
1793
- e.preventDefault();
1794
- }
1795
- invalids.push(e.target);
1796
- e.extraData = 'fix';
1797
- clearTimeout(stopSubmitTimer);
1798
- stopSubmitTimer = setTimeout(function(){
1799
- var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1800
- //reset firstinvalid
1801
- firstEvent = false;
1802
- invalids = [];
1803
- $(e.target).trigger(lastEvent, lastEvent);
1804
- }, 9);
1805
- jElm = null;
1806
- });
1807
- })();
1808
1754
  });
1809
1755
 
1810
1756
  webshims.register('form-message', function($, webshims, window, document, undefined, options){
@@ -2066,6 +2012,7 @@ webshims.register('form-message', function($, webshims, window, document, undefi
2066
2012
  if(hasNative){
2067
2013
  var videoElem = document.createElement('video');
2068
2014
  Modernizr.videoBuffered = ('buffered' in videoElem);
2015
+ Modernizr.mediaDefaultMuted = ('defaultMuted' in videoElem);
2069
2016
  supportsLoop = ('loop' in videoElem);
2070
2017
 
2071
2018
  webshims.capturingEvents(['play', 'playing', 'waiting', 'paused', 'ended', 'durationchange', 'loadedmetadata', 'canplay', 'volumechange']);
@@ -2079,20 +2026,15 @@ webshims.register('form-message', function($, webshims, window, document, undefi
2079
2026
 
2080
2027
  if(!options.preferFlash){
2081
2028
  var noSwitch = {
2082
- 1: 1,
2083
- 2: 1
2029
+ 1: 1
2084
2030
  };
2085
2031
  var switchOptions = function(e){
2086
2032
  var media, error, parent;
2087
2033
  if(!options.preferFlash &&
2088
2034
  ($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source:last', parent)[0] == e.target)) &&
2089
- (media = $(e.target).closest('audio, video')) && !noSwitch[(error = media.prop('error'))]
2035
+ (media = $(e.target).closest('audio, video')) && (error = media.prop('error')) && !noSwitch[error.code]
2090
2036
  ){
2091
- if(error == null){
2092
- webshims.warn("There was an unspecified error on a mediaelement");
2093
- return;
2094
-
2095
- }
2037
+
2096
2038
  $(function(){
2097
2039
  if(hasSwf && !options.preferFlash){
2098
2040
  loadSwf();
@@ -2104,7 +2046,7 @@ webshims.register('form-message', function($, webshims, window, document, undefi
2104
2046
  $('audio, video').each(function(){
2105
2047
  webshims.mediaelement.selectSource(this);
2106
2048
  });
2107
- webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error'));
2049
+ webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error')+ 'first error: '+ error);
2108
2050
  }
2109
2051
  }, 9);
2110
2052
  });
@@ -2310,7 +2252,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2310
2252
  if(src.indexOf('rtmp') === 0){
2311
2253
  return nodeName+'/rtmp';
2312
2254
  }
2313
- src = src.split('?')[0].split('.');
2255
+ src = src.split('?')[0].split('#')[0].split('.');
2314
2256
  src = src[src.length - 1];
2315
2257
  var mt;
2316
2258
 
@@ -2429,7 +2371,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2429
2371
  webshims.error('mediaelementError: '+ message);
2430
2372
  setTimeout(function(){
2431
2373
  if($(elem).data('mediaerror')){
2432
- $(elem).trigger('mediaerror');
2374
+ $(elem).addClass('media-error').trigger('mediaerror');
2433
2375
  }
2434
2376
  }, 1);
2435
2377
  }
@@ -2493,6 +2435,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2493
2435
  var parent = elem.parentNode;
2494
2436
 
2495
2437
  clearTimeout(baseData.loadTimer);
2438
+ $(elem).removeClass('media-error');
2496
2439
  $.data(elem, 'mediaerror', false);
2497
2440
 
2498
2441
  if(!_srces.length || !parent || parent.nodeType != 1 || stopParent.test(parent.nodeName || '')){return;}
@@ -2520,7 +2463,9 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2520
2463
  var testFixMedia = function(){
2521
2464
  if(webshims.implement(this, 'mediaelement')){
2522
2465
  selectSource(this);
2523
-
2466
+ if(!Modernizr.mediaDefaultMuted && $.attr(this, 'muted') != null){
2467
+ $.prop(this, 'muted', true);
2468
+ }
2524
2469
  //fixes for FF 12 and IE9/10 || does not hurt, if run in other browsers
2525
2470
  if(hasNative && (!supportsLoop || ('ActiveXObject' in window))){
2526
2471
  var bufferTimer;