vendor/assets/javascripts/webshims/shims/combos/34.js in webshims-rails-1.14.5 vs vendor/assets/javascripts/webshims/shims/combos/34.js in webshims-rails-1.14.6

- old
+ new

@@ -58,11 +58,10 @@ })(window.webshims.$); //DOM-Extension helper webshims.register('dom-extend', function($, webshims, window, document, undefined){ "use strict"; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; - var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute; 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"); @@ -89,11 +88,10 @@ webshims.ready('WINDOWLOAD', switch$); } //shortcus - var modules = webshims.modules; var listReg = /\s*,\s*/; //proxying attribute var olds = {}; var havePolyfill = {}; @@ -474,12 +472,11 @@ } if($.isDOMReady){ (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); } }; - - var elementExtends = {}; + return { createTmpCache: function(nodeName){ if($.isDOMReady){ tempCache = tempCache || $( document.getElementsByTagName(nodeName) ); } @@ -527,10 +524,11 @@ descs.attr = {}; } }; $.extend(webshims, { + xProps: havePolyfill, getID: (function(){ var ID = new Date().getTime(); return function(elem){ elem = $(elem); var id = elem.prop('id'); @@ -540,10 +538,30 @@ elem.eq(0).prop('id', id); } return id; }; })(), + domPrefixes: ["ws", "webkit", "moz", "ms", "o"], + + prefixed: function (prop, obj){ + var i, testProp; + var ret = false; + if(obj[prop]){ + ret = prop; + } + if(!ret){ + prop = prop.charAt(0).toUpperCase() + prop.slice(1); + for(i = 0; i < webshims.domPrefixes.length; i++){ + testProp = webshims.domPrefixes[i]+prop; + if(testProp in obj){ + ret = testProp; + break; + } + } + } + return ret; + }, shadowClass: 'wsshadow-'+(Date.now()), implement: function(elem, type){ var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); if(data[type]){ webshims.warn(type +' already implemented for element #'+elem.id); @@ -1667,15 +1685,33 @@ } if(obj.kind == 'subtitles' && !obj.language){ webshims.error('you must provide a language for track in subtitles state'); } obj.__wsmode = obj.mode; + + webshims.defineProperty(obj, '_wsUpdateMode', { + value: function(){ + $(mediaelem).triggerHandler('updatetrackdisplay'); + }, + enumerable: false + }); } return obj; }; + if(!$.propHooks.mode){ + $.propHooks.mode = { + set: function(obj, value){ + obj.mode = value; + if(obj._wsUpdateMode && obj._wsUpdateMode.call){ + obj._wsUpdateMode(); + } + return obj.mode; + } + }; + } /* taken from: Captionator 0.5.1 [CaptionCrunch] Christopher Giffard, 2011 @@ -1922,10 +1958,10 @@ $.each(copyProps, function(i, copyProp){ var name = copyName[copyProp] || copyProp; webshims.onNodeNamesPropertyModify('track', copyProp, function(){ var trackData = webshims.data(this, 'trackData'); - var track = this; + if(trackData){ if(copyProp == 'kind'){ refreshTrack(this, trackData); } if(!supportTrackMod){