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
@@ -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];
589
+ if(nativeElem && shadowElem){
590
+ opts = opts || {};
591
+ if(nativeElem.jquery){
592
+ nativeElem = nativeElem[0];
646
593
  }
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();
594
+ if(shadowElem.jquery){
595
+ shadowElem = shadowElem[0];
653
596
  }
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);
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);
607
+ }
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,
@@ -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];
589
+ if(nativeElem && shadowElem){
590
+ opts = opts || {};
591
+ if(nativeElem.jquery){
592
+ nativeElem = nativeElem[0];
646
593
  }
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();
594
+ if(shadowElem.jquery){
595
+ shadowElem = shadowElem[0];
653
596
  }
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);
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);
607
+ }
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,
@@ -1136,6 +1096,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1136
1096
  var hasNative = Modernizr.audio && Modernizr.video;
1137
1097
  var hasFlash = swfmini.hasFlashPlayerVersion('9.0.115');
1138
1098
  var loadedSwf = 0;
1099
+ var needsLoadPreload = 'ActiveXObject' in window && hasNative;
1139
1100
  var getProps = {
1140
1101
  paused: true,
1141
1102
  ended: false,
@@ -1249,12 +1210,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1249
1210
  data.readyState = readyState;
1250
1211
  };
1251
1212
 
1252
- $.extend($.event.customEvent, {
1253
- updatemediaelementdimensions: true,
1254
- flashblocker: true,
1255
- swfstageresize: true,
1256
- mediaelementapichange: true
1257
- });
1213
+
1258
1214
 
1259
1215
  mediaelement.jarisEvent = {};
1260
1216
  var localConnectionTimer;
@@ -1503,8 +1459,13 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1503
1459
  var isNativeHTML5 = ( event.originalEvent && event.originalEvent.type === event.type );
1504
1460
  if( isNativeHTML5 == (data.activating == 'third') ){
1505
1461
  event.stopImmediatePropagation();
1506
- if(stopEvents[event.type] && data.isActive != data.activating){
1507
- $(event.target).pause();
1462
+
1463
+ if(stopEvents[event.type]){
1464
+ if(data.isActive != data.activating){
1465
+ $(event.target).pause();
1466
+ } else if(isNativeHTML5){
1467
+ ($.prop(event.target, 'pause')._supvalue || $.noop).apply(event.target);
1468
+ }
1508
1469
  }
1509
1470
  }
1510
1471
  };
@@ -1568,15 +1529,18 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1568
1529
  })();
1569
1530
 
1570
1531
  var setElementDimension = function(data, hasControls){
1532
+ var cAttr;
1571
1533
  var elem = data._elem;
1572
1534
  var box = data.shadowElem;
1535
+
1573
1536
  $(elem)[hasControls ? 'addClass' : 'removeClass']('webshims-controls');
1574
1537
  if(data._elemNodeName == 'audio' && !hasControls){
1575
1538
  box.css({width: 0, height: 0});
1576
1539
  } else {
1540
+
1577
1541
  box.css({
1578
- width: elem.style.width || $(elem).width(),
1579
- height: elem.style.height || $(elem).height()
1542
+ width: elem.style.width || ((cAttr = $(elem).attr('width')) && cAttr+'px') || $(elem).width(),
1543
+ height: elem.style.height|| ((cAttr = $(elem).attr('height')) && cAttr+'px') || $(elem).height()
1580
1544
  });
1581
1545
  }
1582
1546
  };
@@ -1605,7 +1569,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1605
1569
  replaceVar = function(val){
1606
1570
  return (val.replace) ? val.replace(regs.A, '%26').replace(regs.a, '%26').replace(regs.e, '%3D').replace(regs.q, '%3F') : val;
1607
1571
  };
1608
-
1572
+
1609
1573
  mediaelement.createSWF = function( elem, canPlaySrc, data ){
1610
1574
  if(!hasFlash){
1611
1575
  setTimeout(function(){
@@ -1613,7 +1577,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1613
1577
  }, 1);
1614
1578
  return;
1615
1579
  }
1616
-
1580
+
1617
1581
  if(loadedSwf < 1){
1618
1582
  loadedSwf = 1;
1619
1583
  } else {
@@ -1624,7 +1588,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1624
1588
  }
1625
1589
 
1626
1590
  if($.attr(elem, 'height') || $.attr(elem, 'width')){
1627
- webshims.warn("width or height content attributes used. Webshims only uses CSS (computed styles or inline styles) to detect size of a video/audio");
1591
+ webshims.warn("width or height content attributes used. Webshims prefers the usage of CSS (computed styles or inline styles) to detect size of a video/audio. It's really more powerfull.");
1628
1592
  }
1629
1593
 
1630
1594
  var isRtmp = canPlaySrc.type == 'audio/rtmp' || canPlaySrc.type == 'video/rtmp';
@@ -1721,6 +1685,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1721
1685
  }
1722
1686
  }
1723
1687
  }));
1688
+
1724
1689
  setElementDimension(data, hasControls);
1725
1690
 
1726
1691
  box.insertBefore(elem);
@@ -1730,16 +1695,31 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1730
1695
  }
1731
1696
 
1732
1697
  webshims.addShadowDom(elem, box);
1698
+ if(!webshims.data(elem, 'mediaelement')){
1699
+ webshims.data(elem, 'mediaelement', data);
1700
+ }
1733
1701
  addMediaToStopEvents(elem);
1702
+
1734
1703
  mediaelement.setActive(elem, 'third', data);
1704
+
1735
1705
  $(elem)
1736
1706
  .on({'updatemediaelementdimensions': setDimension})
1737
1707
  .onWSOff('updateshadowdom', setDimension)
1708
+ .on('remove', function(e){
1709
+ if(!e.originalEvent && mediaelement.jarisEvent[data.id] && mediaelement.jarisEvent[data.id].elem == elem){
1710
+ delete mediaelement.jarisEvent[data.id];
1711
+ clearTimeout(localConnectionTimer);
1712
+ clearTimeout(data.flashBlock);
1713
+ }
1714
+ box.remove();
1715
+ })
1738
1716
  ;
1739
1717
  }
1740
1718
 
1741
- if(!mediaelement.jarisEvent[data.id]){
1719
+
1720
+ if(!mediaelement.jarisEvent[data.id] || mediaelement.jarisEvent[data.id].elem != elem){
1742
1721
  mediaelement.jarisEvent[data.id] = function(jaris){
1722
+
1743
1723
  if(jaris.type == 'ready'){
1744
1724
  var onReady = function(){
1745
1725
  if(data.api){
@@ -1772,8 +1752,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1772
1752
  }
1773
1753
  data.duration = jaris.duration;
1774
1754
  }
1775
-
1776
1755
  };
1756
+ mediaelement.jarisEvent[data.id].elem = elem;
1777
1757
  }
1778
1758
 
1779
1759
  $.extend(vars,
@@ -1799,27 +1779,27 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1799
1779
  clearTimeout(data.flashBlock);
1800
1780
 
1801
1781
  swfmini.embedSWF(playerSwfPath, elemId, "100%", "100%", "9.0.115", false, vars, params, attrs, function(swfData){
1802
-
1803
1782
  if(swfData.success){
1804
-
1805
- data.api = swfData.ref;
1806
-
1807
- if(!hasControls){
1808
- $(swfData.ref).attr('tabindex', '-1').css('outline', 'none');
1809
- }
1810
-
1811
- data.flashBlock = setTimeout(function(){
1783
+ var fBlocker = function(){
1812
1784
  if((!swfData.ref.parentNode && box[0].parentNode) || swfData.ref.style.display == "none"){
1813
1785
  box.addClass('flashblocker-assumed');
1814
1786
  $(elem).trigger('flashblocker');
1815
1787
  webshims.warn("flashblocker assumed");
1816
1788
  }
1817
1789
  $(swfData.ref).css({'minHeight': '2px', 'minWidth': '2px', display: 'block'});
1818
- }, 9);
1790
+ };
1791
+ data.api = swfData.ref;
1792
+
1793
+ if(!hasControls){
1794
+ $(swfData.ref).attr('tabindex', '-1').css('outline', 'none');
1795
+ }
1796
+
1797
+ data.flashBlock = setTimeout(fBlocker, 99);
1819
1798
 
1820
1799
  if(!localConnectionTimer){
1821
1800
  clearTimeout(localConnectionTimer);
1822
1801
  localConnectionTimer = setTimeout(function(){
1802
+ fBlocker();
1823
1803
  var flash = $(swfData.ref);
1824
1804
  if(flash[0].offsetWidth > 1 && flash[0].offsetHeight > 1 && location.protocol.indexOf('file:') === 0){
1825
1805
  webshims.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html");
@@ -1973,12 +1953,23 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
1973
1953
  }
1974
1954
  });
1975
1955
 
1956
+
1976
1957
  webshims.onNodeNamesPropertyModify(nodeName, 'preload', function(val){
1977
- var data = getSwfDataFromElem(this);
1958
+ var data, baseData, elem;
1978
1959
 
1979
1960
 
1980
- if(data && bufferSrc(this)){
1981
- queueSwfMethod(this, 'api_preload', [], data);
1961
+ if(bufferSrc(this)){
1962
+ data = getSwfDataFromElem(this);
1963
+ if(data){
1964
+ queueSwfMethod(this, 'api_preload', [], data);
1965
+ } else if(needsLoadPreload && this.paused && !this.error && !$.data(this, 'mediaerror') && !this.readyState && !this.networkState && !this.autoplay && $(this).is(':not(.nonnative-api-active)')){
1966
+ elem = this;
1967
+ baseData = webshims.data(elem, 'mediaelementBase') || webshims.data(elem, 'mediaelementBase', {});
1968
+ clearTimeout(baseData.loadTimer);
1969
+ baseData.loadTimer = setTimeout(function(){
1970
+ $(elem).mediaLoad();
1971
+ }, 9);
1972
+ }
1982
1973
  }
1983
1974
  });
1984
1975