vendor/assets/javascripts/webshims/shims/combos/34.js in webshims-rails-1.14.6 vs vendor/assets/javascripts/webshims/shims/combos/34.js in webshims-rails-1.15.2
- old
+ new
@@ -62,17 +62,13 @@
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true;
if($('<input type="email" />').attr('type') == 'text' || $('<form />').attr('novalidate') === "" || ('required' in $('<input />')[0].attributes)){
- webshims.error("IE browser modes are busted in IE10+. Please test your HTML/CSS/JS with a real IE version or at least IETester or similiar tools");
+ webshims.error("IE browser modes are busted in IE10+. Make sure to run IE in edge mode (X-UA-Compatible). Please test your HTML/CSS/JS with a real IE version or at least IETester or similar tools. ");
}
- if('debug' in webshims){
- webshims.error('Use webshims.setOptions("debug", true||false||"noCombo"); to debug flag');
- }
-
if (!webshims.cfg.no$Switch) {
var switch$ = function(){
if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
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. Or set webshims.cfg.no$Switch to 'true'.");
if (window.$) {
@@ -679,38 +675,42 @@
} else {
docObserve.runs = 0;
}
},
handler: (function(){
+ var evt;
var trigger = function(){
- $(document).triggerHandler('updateshadowdom');
+ $(document).triggerHandler('updateshadowdom', [evt]);
};
- return function(e){
- clearTimeout(resizeTimer);
- resizeTimer = setTimeout(function(){
- if(e.type == 'resize'){
- var width = $window.width();
- var height = $window.width();
+ var timed = function(){
+ if(evt && evt.type == 'resize'){
+ var width = $window.width();
+ var height = $window.width();
- if(height == lastHeight && width == lastWidth){
- return;
- }
- lastHeight = height;
- lastWidth = width;
-
- docObserve.height = docObserve.getHeight();
- docObserve.width = docObserve.getWidth();
+ if(height == lastHeight && width == lastWidth){
+ return;
}
+ lastHeight = height;
+ lastWidth = width;
+ }
- if(window.requestAnimationFrame){
- requestAnimationFrame(trigger);
- } else {
- setTimeout(trigger, 0);
- }
-
- }, (e.type == 'resize' && !window.requestAnimationFrame) ? 50 : 9);
+ if(evt && evt.type != 'docresize'){
+ docObserve.height = docObserve.getHeight();
+ docObserve.width = docObserve.getWidth();
+ }
+
+ if(window.requestAnimationFrame){
+ requestAnimationFrame(trigger);
+ } else {
+ setTimeout(trigger, 0);
+ }
};
+ return function(e){
+ clearTimeout(resizeTimer);
+ evt = e;
+ resizeTimer = setTimeout(timed, (e.type == 'resize' && !window.requestAnimationFrame) ? 50 : 9);
+ };
})(),
_create: function(){
$.each({ Height: "getHeight", Width: "getWidth" }, function(name, type){
var body = document.body;
var doc = document.documentElement;
@@ -1295,12 +1295,16 @@
this.cues = mediaelement.createCueList();
} else {
var lastCue = this.cues[this.cues.length-1];
if(lastCue && lastCue.startTime > cue.startTime){
webshims.error("cue startTime higher than previous cue's startTime");
+ return;
}
}
+ if(cue.startTime >= cue.endTime ){
+ webshim.error('startTime >= endTime of cue: '+ cue.text);
+ }
if(cue.track && cue.track.removeCue){
cue.track.removeCue(cue);
}
cue.track = this;
this.cues.push(cue);
@@ -1388,10 +1392,11 @@
$([trackList]).triggerHandler($.Event({type: 'removetrack', track: removed[i]}));
}
for(i = 0, len = added.length; i < len; i++){
$([trackList]).triggerHandler($.Event({type: 'addtrack', track: added[i]}));
}
+ //todo: remove
if(baseData.scriptedTextTracks || removed.length){
$(this).triggerHandler('updatetrackdisplay');
}
}
};
@@ -1404,11 +1409,11 @@
if(trackData && !trackData.isTriggering){
trackData.isTriggering = true;
setTimeout(function(){
$(track).closest('audio, video').triggerHandler('updatetrackdisplay');
trackData.isTriggering = false;
- }, 1);
+ }, 9);
}
};
var isDefaultTrack = (function(){
var defaultKinds = {
subtitles: {
@@ -1597,18 +1602,13 @@
});
},
error: error
});
};
- if($.ajax && $.ajaxSettings.xhr){
- if(isDisabled){
- setTimeout(createAjax, loadingTracks * 2);
- } else {
- createAjax();
- }
+ if(isDisabled){
+ setTimeout(createAjax, loadingTracks * 2);
} else {
- webshims.ready('jajax', createAjax);
- webshims.loader.loadList(['jajax']);
+ createAjax();
}
} catch(er){
error();
webshims.error(er);
}