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
@@ -816,10 +816,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
816
816
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
817
817
  }
818
818
 
819
- if(webshims.cfg.extendNative === undefined){
820
- 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");
821
- }
822
-
823
819
  if (!webshims.cfg.no$Switch) {
824
820
  var switch$ = function(){
825
821
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
@@ -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
  if(!Modernizr.formvalidation || webshims.bugs.bustedValidity){
@@ -2688,6 +2634,7 @@ try {
2688
2634
  var isOver = (webshims.cfg.forms.placeholderType == 'over');
2689
2635
  var isResponsive = (webshims.cfg.forms.responsivePlaceholder);
2690
2636
  var polyfillElements = ['textarea'];
2637
+ var debug = webshims.debug !== false;
2691
2638
  if(!Modernizr.input.placeholder || bustedPlaceholder){
2692
2639
  polyfillElements.push('input');
2693
2640
  }
@@ -2778,6 +2725,11 @@ try {
2778
2725
  data = $.data(elem, 'placeHolder');
2779
2726
  if(!data){return;}
2780
2727
  }
2728
+ var isVisible = $(elem).hasClass('placeholder-visible');
2729
+ if(placeholderTxt === false){
2730
+ placeholderTxt = $.attr(elem, 'placeholder') || '';
2731
+ }
2732
+
2781
2733
  $(elem).unbind('.placeholderremove');
2782
2734
 
2783
2735
  if(value === false){
@@ -2785,7 +2737,7 @@ try {
2785
2737
  }
2786
2738
 
2787
2739
  if(!value && (type == 'focus' || (!type && $(elem).is(':focus')))){
2788
- if(elem.type == 'password' || isOver || $(elem).hasClass('placeholder-visible')){
2740
+ if(elem.type == 'password' || isOver || isVisible){
2789
2741
  hidePlaceholder(elem, data, '', true);
2790
2742
  }
2791
2743
  return;
@@ -2795,9 +2747,7 @@ try {
2795
2747
  hidePlaceholder(elem, data, value);
2796
2748
  return;
2797
2749
  }
2798
- if(placeholderTxt === false){
2799
- placeholderTxt = $.attr(elem, 'placeholder') || '';
2800
- }
2750
+
2801
2751
  if(placeholderTxt && !value){
2802
2752
  showPlaceholder(elem, data, placeholderTxt);
2803
2753
  } else {
@@ -2905,6 +2855,7 @@ try {
2905
2855
  var reset = function(e){
2906
2856
  if($(elem).hasClass('placeholder-visible')){
2907
2857
  hidePlaceholder(elem, data, '');
2858
+
2908
2859
  setTimeout(function(){
2909
2860
  if(!e || e.type != 'submit' || e.isDefaultPrevented()){
2910
2861
  changePlaceholderVisibility(elem, false, false, data );
@@ -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
  if(!Modernizr.formvalidation || webshims.bugs.bustedValidity){
@@ -3140,6 +3086,7 @@ try {
3140
3086
  var isOver = (webshims.cfg.forms.placeholderType == 'over');
3141
3087
  var isResponsive = (webshims.cfg.forms.responsivePlaceholder);
3142
3088
  var polyfillElements = ['textarea'];
3089
+ var debug = webshims.debug !== false;
3143
3090
  if(!Modernizr.input.placeholder || bustedPlaceholder){
3144
3091
  polyfillElements.push('input');
3145
3092
  }
@@ -3230,6 +3177,11 @@ try {
3230
3177
  data = $.data(elem, 'placeHolder');
3231
3178
  if(!data){return;}
3232
3179
  }
3180
+ var isVisible = $(elem).hasClass('placeholder-visible');
3181
+ if(placeholderTxt === false){
3182
+ placeholderTxt = $.attr(elem, 'placeholder') || '';
3183
+ }
3184
+
3233
3185
  $(elem).unbind('.placeholderremove');
3234
3186
 
3235
3187
  if(value === false){
@@ -3237,7 +3189,7 @@ try {
3237
3189
  }
3238
3190
 
3239
3191
  if(!value && (type == 'focus' || (!type && $(elem).is(':focus')))){
3240
- if(elem.type == 'password' || isOver || $(elem).hasClass('placeholder-visible')){
3192
+ if(elem.type == 'password' || isOver || isVisible){
3241
3193
  hidePlaceholder(elem, data, '', true);
3242
3194
  }
3243
3195
  return;
@@ -3247,9 +3199,7 @@ try {
3247
3199
  hidePlaceholder(elem, data, value);
3248
3200
  return;
3249
3201
  }
3250
- if(placeholderTxt === false){
3251
- placeholderTxt = $.attr(elem, 'placeholder') || '';
3252
- }
3202
+
3253
3203
  if(placeholderTxt && !value){
3254
3204
  showPlaceholder(elem, data, placeholderTxt);
3255
3205
  } else {
@@ -3357,6 +3307,7 @@ try {
3357
3307
  var reset = function(e){
3358
3308
  if($(elem).hasClass('placeholder-visible')){
3359
3309
  hidePlaceholder(elem, data, '');
3310
+
3360
3311
  setTimeout(function(){
3361
3312
  if(!e || e.type != 'submit' || e.isDefaultPrevented()){
3362
3313
  changePlaceholderVisibility(elem, false, false, data );
@@ -4120,6 +4071,7 @@ webshims.register('form-datalist', function($, webshims, window, document, undef
4120
4071
  if(hasNative){
4121
4072
  var videoElem = document.createElement('video');
4122
4073
  Modernizr.videoBuffered = ('buffered' in videoElem);
4074
+ Modernizr.mediaDefaultMuted = ('defaultMuted' in videoElem);
4123
4075
  supportsLoop = ('loop' in videoElem);
4124
4076
 
4125
4077
  webshims.capturingEvents(['play', 'playing', 'waiting', 'paused', 'ended', 'durationchange', 'loadedmetadata', 'canplay', 'volumechange']);
@@ -4133,20 +4085,15 @@ webshims.register('form-datalist', function($, webshims, window, document, undef
4133
4085
 
4134
4086
  if(!options.preferFlash){
4135
4087
  var noSwitch = {
4136
- 1: 1,
4137
- 2: 1
4088
+ 1: 1
4138
4089
  };
4139
4090
  var switchOptions = function(e){
4140
4091
  var media, error, parent;
4141
4092
  if(!options.preferFlash &&
4142
4093
  ($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source:last', parent)[0] == e.target)) &&
4143
- (media = $(e.target).closest('audio, video')) && !noSwitch[(error = media.prop('error'))]
4094
+ (media = $(e.target).closest('audio, video')) && (error = media.prop('error')) && !noSwitch[error.code]
4144
4095
  ){
4145
- if(error == null){
4146
- webshims.warn("There was an unspecified error on a mediaelement");
4147
- return;
4148
-
4149
- }
4096
+
4150
4097
  $(function(){
4151
4098
  if(hasSwf && !options.preferFlash){
4152
4099
  loadSwf();
@@ -4158,7 +4105,7 @@ webshims.register('form-datalist', function($, webshims, window, document, undef
4158
4105
  $('audio, video').each(function(){
4159
4106
  webshims.mediaelement.selectSource(this);
4160
4107
  });
4161
- webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error'));
4108
+ webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error')+ 'first error: '+ error);
4162
4109
  }
4163
4110
  }, 9);
4164
4111
  });
@@ -4364,7 +4311,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
4364
4311
  if(src.indexOf('rtmp') === 0){
4365
4312
  return nodeName+'/rtmp';
4366
4313
  }
4367
- src = src.split('?')[0].split('.');
4314
+ src = src.split('?')[0].split('#')[0].split('.');
4368
4315
  src = src[src.length - 1];
4369
4316
  var mt;
4370
4317
 
@@ -4483,7 +4430,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
4483
4430
  webshims.error('mediaelementError: '+ message);
4484
4431
  setTimeout(function(){
4485
4432
  if($(elem).data('mediaerror')){
4486
- $(elem).trigger('mediaerror');
4433
+ $(elem).addClass('media-error').trigger('mediaerror');
4487
4434
  }
4488
4435
  }, 1);
4489
4436
  }
@@ -4547,6 +4494,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
4547
4494
  var parent = elem.parentNode;
4548
4495
 
4549
4496
  clearTimeout(baseData.loadTimer);
4497
+ $(elem).removeClass('media-error');
4550
4498
  $.data(elem, 'mediaerror', false);
4551
4499
 
4552
4500
  if(!_srces.length || !parent || parent.nodeType != 1 || stopParent.test(parent.nodeName || '')){return;}
@@ -4574,7 +4522,9 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
4574
4522
  var testFixMedia = function(){
4575
4523
  if(webshims.implement(this, 'mediaelement')){
4576
4524
  selectSource(this);
4577
-
4525
+ if(!Modernizr.mediaDefaultMuted && $.attr(this, 'muted') != null){
4526
+ $.prop(this, 'muted', true);
4527
+ }
4578
4528
  //fixes for FF 12 and IE9/10 || does not hurt, if run in other browsers
4579
4529
  if(hasNative && (!supportsLoop || ('ActiveXObject' in window))){
4580
4530
  var bufferTimer;
@@ -768,7 +768,17 @@ webshims.register('form-number-date-api', function($, webshims, window, document
768
768
  this.value(this.options.value, true);
769
769
  },
770
770
  step: function(val){
771
- this.options.step = val == 'any' ? 'any' : retDefault(val, 1);
771
+ var o = this.options;
772
+ var step = val == 'any' ? 'any' : retDefault(val, 1);
773
+
774
+ if(o.stepping){
775
+ if(step != 'any' && o.stepping % step){
776
+ webshims.error('wrong stepping value for type range:'+ (o.stepping % step));
777
+ } else {
778
+ step = o.stepping;
779
+ }
780
+ }
781
+ o.step = step;
772
782
  this.value(this.options.value);
773
783
  },
774
784
 
@@ -1489,6 +1499,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1489
1499
  fVal[0] = tmp;
1490
1500
  }
1491
1501
  val = this.date(fVal[0], o) +'T'+ this.time(fVal[1], o);
1502
+ } else if (fVal.length == 3) {
1503
+ val = this.date(fVal[0], o) +'T'+ this.time(fVal[1]+fVal[2], o);
1492
1504
  }
1493
1505
  return val;
1494
1506
  },
@@ -2345,7 +2357,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2345
2357
 
2346
2358
  picker._actions = {
2347
2359
  changeInput: function(val, popover, data){
2348
- picker._actions.cancel(val, popover, data);
2360
+ if(!data.options.noChangeDismiss){
2361
+ picker._actions.cancel(val, popover, data);
2362
+ }
2349
2363
  data.setChange(val);
2350
2364
  },
2351
2365
  cancel: function(val, popover, data){
@@ -2892,7 +2906,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2892
2906
  });
2893
2907
  }
2894
2908
 
2895
- var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && (/MSIE 1[0|1]\.\d/.test(navigator.userAgent) || /Trident\/7\.0/.test(navigator.userAgent));
2909
+ var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)));
2896
2910
  ['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){
2897
2911
  if(!modernizrInputTypes[name] || options.replaceUI || (name == 'number' && isStupid)){
2898
2912
  extendType(name, {
@@ -1571,7 +1571,17 @@ webshims.register('form-number-date-api', function($, webshims, window, document
1571
1571
  this.value(this.options.value, true);
1572
1572
  },
1573
1573
  step: function(val){
1574
- this.options.step = val == 'any' ? 'any' : retDefault(val, 1);
1574
+ var o = this.options;
1575
+ var step = val == 'any' ? 'any' : retDefault(val, 1);
1576
+
1577
+ if(o.stepping){
1578
+ if(step != 'any' && o.stepping % step){
1579
+ webshims.error('wrong stepping value for type range:'+ (o.stepping % step));
1580
+ } else {
1581
+ step = o.stepping;
1582
+ }
1583
+ }
1584
+ o.step = step;
1575
1585
  this.value(this.options.value);
1576
1586
  },
1577
1587
 
@@ -2292,6 +2302,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2292
2302
  fVal[0] = tmp;
2293
2303
  }
2294
2304
  val = this.date(fVal[0], o) +'T'+ this.time(fVal[1], o);
2305
+ } else if (fVal.length == 3) {
2306
+ val = this.date(fVal[0], o) +'T'+ this.time(fVal[1]+fVal[2], o);
2295
2307
  }
2296
2308
  return val;
2297
2309
  },
@@ -3148,7 +3160,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3148
3160
 
3149
3161
  picker._actions = {
3150
3162
  changeInput: function(val, popover, data){
3151
- picker._actions.cancel(val, popover, data);
3163
+ if(!data.options.noChangeDismiss){
3164
+ picker._actions.cancel(val, popover, data);
3165
+ }
3152
3166
  data.setChange(val);
3153
3167
  },
3154
3168
  cancel: function(val, popover, data){
@@ -3695,7 +3709,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3695
3709
  });
3696
3710
  }
3697
3711
 
3698
- var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && (/MSIE 1[0|1]\.\d/.test(navigator.userAgent) || /Trident\/7\.0/.test(navigator.userAgent));
3712
+ var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)));
3699
3713
  ['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){
3700
3714
  if(!modernizrInputTypes[name] || options.replaceUI || (name == 'number' && isStupid)){
3701
3715
  extendType(name, {
@@ -1268,10 +1268,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1268
1268
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
1269
1269
  }
1270
1270
 
1271
- if(webshims.cfg.extendNative === undefined){
1272
- 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");
1273
- }
1274
-
1275
1271
  if (!webshims.cfg.no$Switch) {
1276
1272
  var switch$ = function(){
1277
1273
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
@@ -2373,6 +2369,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2373
2369
  if(hasNative){
2374
2370
  var videoElem = document.createElement('video');
2375
2371
  Modernizr.videoBuffered = ('buffered' in videoElem);
2372
+ Modernizr.mediaDefaultMuted = ('defaultMuted' in videoElem);
2376
2373
  supportsLoop = ('loop' in videoElem);
2377
2374
 
2378
2375
  webshims.capturingEvents(['play', 'playing', 'waiting', 'paused', 'ended', 'durationchange', 'loadedmetadata', 'canplay', 'volumechange']);
@@ -2386,20 +2383,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2386
2383
 
2387
2384
  if(!options.preferFlash){
2388
2385
  var noSwitch = {
2389
- 1: 1,
2390
- 2: 1
2386
+ 1: 1
2391
2387
  };
2392
2388
  var switchOptions = function(e){
2393
2389
  var media, error, parent;
2394
2390
  if(!options.preferFlash &&
2395
2391
  ($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source:last', parent)[0] == e.target)) &&
2396
- (media = $(e.target).closest('audio, video')) && !noSwitch[(error = media.prop('error'))]
2392
+ (media = $(e.target).closest('audio, video')) && (error = media.prop('error')) && !noSwitch[error.code]
2397
2393
  ){
2398
- if(error == null){
2399
- webshims.warn("There was an unspecified error on a mediaelement");
2400
- return;
2401
-
2402
- }
2394
+
2403
2395
  $(function(){
2404
2396
  if(hasSwf && !options.preferFlash){
2405
2397
  loadSwf();
@@ -2411,7 +2403,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2411
2403
  $('audio, video').each(function(){
2412
2404
  webshims.mediaelement.selectSource(this);
2413
2405
  });
2414
- webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error'));
2406
+ webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.src+" Mediaerror: "+ media.prop('error')+ 'first error: '+ error);
2415
2407
  }
2416
2408
  }, 9);
2417
2409
  });
@@ -2617,7 +2609,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2617
2609
  if(src.indexOf('rtmp') === 0){
2618
2610
  return nodeName+'/rtmp';
2619
2611
  }
2620
- src = src.split('?')[0].split('.');
2612
+ src = src.split('?')[0].split('#')[0].split('.');
2621
2613
  src = src[src.length - 1];
2622
2614
  var mt;
2623
2615
 
@@ -2736,7 +2728,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2736
2728
  webshims.error('mediaelementError: '+ message);
2737
2729
  setTimeout(function(){
2738
2730
  if($(elem).data('mediaerror')){
2739
- $(elem).trigger('mediaerror');
2731
+ $(elem).addClass('media-error').trigger('mediaerror');
2740
2732
  }
2741
2733
  }, 1);
2742
2734
  }
@@ -2800,6 +2792,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2800
2792
  var parent = elem.parentNode;
2801
2793
 
2802
2794
  clearTimeout(baseData.loadTimer);
2795
+ $(elem).removeClass('media-error');
2803
2796
  $.data(elem, 'mediaerror', false);
2804
2797
 
2805
2798
  if(!_srces.length || !parent || parent.nodeType != 1 || stopParent.test(parent.nodeName || '')){return;}
@@ -2827,7 +2820,9 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
2827
2820
  var testFixMedia = function(){
2828
2821
  if(webshims.implement(this, 'mediaelement')){
2829
2822
  selectSource(this);
2830
-
2823
+ if(!Modernizr.mediaDefaultMuted && $.attr(this, 'muted') != null){
2824
+ $.prop(this, 'muted', true);
2825
+ }
2831
2826
  //fixes for FF 12 and IE9/10 || does not hurt, if run in other browsers
2832
2827
  if(hasNative && (!supportsLoop || ('ActiveXObject' in window))){
2833
2828
  var bufferTimer;
@@ -3051,6 +3046,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
3051
3046
  networkState: 0,
3052
3047
  videoHeight: 0,
3053
3048
  videoWidth: 0,
3049
+ seeking: false,
3054
3050
  error: null,
3055
3051
  buffered: {
3056
3052
  start: function(index){
@@ -3154,7 +3150,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
3154
3150
  }
3155
3151
  data.readyState = readyState;
3156
3152
  };
3157
-
3153
+ var callSeeked = function(data){
3154
+ if(data.seeking && Math.abs(data.currentTime - data._lastSeektime) < 2){
3155
+ data.seeking = false;
3156
+ $(data._elem).triggerHandler('seeked');
3157
+ }
3158
+ };
3158
3159
 
3159
3160
 
3160
3161
  mediaelement.jarisEvent = {};
@@ -3183,6 +3184,20 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
3183
3184
  }
3184
3185
  }
3185
3186
  },
3187
+ onSeek: function(jaris, data){
3188
+ data._lastSeektime = jaris.seekTime;
3189
+
3190
+ data.seeking = true;
3191
+ $(data._elem).triggerHandler('seeking');
3192
+ clearTimeout(data._seekedTimer);
3193
+ data._seekedTimer = setTimeout(function(){
3194
+ callSeeked(data);
3195
+ data.seeking = false;
3196
+ }, 300);
3197
+ },
3198
+ onConnectionFailed: function(){
3199
+ webshims.error('media error');
3200
+ },
3186
3201
  onNotBuffering: function(jaris, data){
3187
3202
  setReadyState(3, data);
3188
3203
  },
@@ -3238,7 +3253,9 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
3238
3253
  setReadyState(3, data);
3239
3254
  trigger(data._elem, 'playing');
3240
3255
  }
3241
-
3256
+ if(data.seeking){
3257
+ callSeeked(data);
3258
+ }
3242
3259
  trigger(data._elem, 'timeupdate');
3243
3260
  },
3244
3261
  onProgress: function(jaris, data){
@@ -3294,6 +3311,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
3294
3311
 
3295
3312
  return function(jaris, data){
3296
3313
  var i = 0;
3314
+
3297
3315
  var doneFn = function(){
3298
3316
  if(i > 9){
3299
3317
  data.tryedReframeing = 0;
@@ -3453,11 +3471,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
3453
3471
 
3454
3472
 
3455
3473
  var resetSwfProps = (function(){
3456
- var resetProtoProps = ['_calledMeta', 'lastDuration', '_bufferedEnd', '_bufferedStart', '_ppFlag', 'currentSrc', 'currentTime', 'duration', 'ended', 'networkState', 'paused', 'videoHeight', 'videoWidth'];
3474
+ var resetProtoProps = ['_calledMeta', 'lastDuration', '_bufferedEnd', '_bufferedStart', '_ppFlag', 'currentSrc', 'currentTime', 'duration', 'ended', 'networkState', 'paused', 'seeking', 'videoHeight', 'videoWidth'];
3457
3475
  var len = resetProtoProps.length;
3458
3476
  return function(data){
3459
3477
 
3460
3478
  if(!data){return;}
3479
+ clearTimeout(data._seekedTimer);
3461
3480
  var lenI = len;
3462
3481
  var networkState = data.networkState;
3463
3482
  setReadyState(0, data);
@@ -3899,6 +3918,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
3899
3918
  descs[key].set = setFn;
3900
3919
  };
3901
3920
 
3921
+ createGetSetProp('seeking');
3922
+
3902
3923
  createGetSetProp('volume', function(v){
3903
3924
  var data = getSwfDataFromElem(this);
3904
3925
  if(data){
@@ -4009,8 +4030,26 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
4009
4030
  });
4010
4031
 
4011
4032
  mediaSup = webshims.defineNodeNameProperties(nodeName, descs, 'prop');
4033
+
4034
+ if(!Modernizr.mediaDefaultMuted){
4035
+ webshims.defineNodeNameProperties(nodeName, {
4036
+ defaultMuted: {
4037
+ get: function(){
4038
+ return $.attr(this, 'muted') != null;
4039
+ },
4040
+ set: function(val){
4041
+ if(val){
4042
+ $.attr(this, 'muted', '');
4043
+ } else {
4044
+ $(this).removeAttr('muted');
4045
+ }
4046
+ }
4047
+ }
4048
+ }, 'prop');
4049
+ }
4012
4050
  });
4013
4051
 
4052
+
4014
4053
  if(hasFlash && $.cleanData){
4015
4054
  var oldClean = $.cleanData;
4016
4055
  var flashNames = {