webshims-rails 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/webshims-rails/version.rb +2 -2
- data/vendor/assets/javascripts/webshims/extras/custom-validity.js +253 -261
- data/vendor/assets/javascripts/webshims/extras/modernizr-custom.js +534 -534
- data/vendor/assets/javascripts/webshims/extras/mousepress.js +60 -60
- data/vendor/assets/javascripts/webshims/minified/extras/custom-validity.js +1 -10
- data/vendor/assets/javascripts/webshims/minified/extras/modernizr-custom.js +1 -20
- data/vendor/assets/javascripts/webshims/minified/extras/mousepress.js +1 -2
- data/vendor/assets/javascripts/webshims/minified/polyfiller.js +1 -30
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/canvas2png.js +1 -42
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/flashcanvas.js +1 -28
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/flashcanvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/proxy.php +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvas/save.php +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/canvas2png.js +1 -42
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/flash10canvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/flash9canvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/flashcanvas.js +1 -31
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/proxy.php +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/FlashCanvasPro/save.php +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/combos/1.js +1 -38
- data/vendor/assets/javascripts/webshims/minified/shims/combos/10.js +1 -80
- data/vendor/assets/javascripts/webshims/minified/shims/combos/11.js +1 -45
- data/vendor/assets/javascripts/webshims/minified/shims/combos/12.js +1 -44
- data/vendor/assets/javascripts/webshims/minified/shims/combos/13.js +1 -28
- data/vendor/assets/javascripts/webshims/minified/shims/combos/14.js +1 -19
- data/vendor/assets/javascripts/webshims/minified/shims/combos/15.js +1 -10
- data/vendor/assets/javascripts/webshims/minified/shims/combos/16.js +1 -58
- data/vendor/assets/javascripts/webshims/minified/shims/combos/17.js +1 -66
- data/vendor/assets/javascripts/webshims/minified/shims/combos/18.js +1 -62
- data/vendor/assets/javascripts/webshims/minified/shims/combos/19.js +1 -64
- data/vendor/assets/javascripts/webshims/minified/shims/combos/2.js +1 -73
- data/vendor/assets/javascripts/webshims/minified/shims/combos/20.js +1 -42
- data/vendor/assets/javascripts/webshims/minified/shims/combos/21.js +1 -54
- data/vendor/assets/javascripts/webshims/minified/shims/combos/22.js +1 -57
- data/vendor/assets/javascripts/webshims/minified/shims/combos/23.js +1 -70
- data/vendor/assets/javascripts/webshims/minified/shims/combos/24.js +1 -80
- data/vendor/assets/javascripts/webshims/minified/shims/combos/25.js +1 -60
- data/vendor/assets/javascripts/webshims/minified/shims/combos/26.js +1 -79
- data/vendor/assets/javascripts/webshims/minified/shims/combos/27.js +1 -101
- data/vendor/assets/javascripts/webshims/minified/shims/combos/3.js +1 -95
- data/vendor/assets/javascripts/webshims/minified/shims/combos/4.js +1 -27
- data/vendor/assets/javascripts/webshims/minified/shims/combos/5.js +1 -34
- data/vendor/assets/javascripts/webshims/minified/shims/combos/59.js +1 -56
- data/vendor/assets/javascripts/webshims/minified/shims/combos/6.js +1 -33
- data/vendor/assets/javascripts/webshims/minified/shims/combos/7.js +1 -40
- data/vendor/assets/javascripts/webshims/minified/shims/combos/8.js +1 -39
- data/vendor/assets/javascripts/webshims/minified/shims/combos/9.js +1 -65
- data/vendor/assets/javascripts/webshims/minified/shims/details.js +1 -5
- data/vendor/assets/javascripts/webshims/minified/shims/dom-extend.js +1 -23
- data/vendor/assets/javascripts/webshims/minified/shims/es5.js +1 -15
- data/vendor/assets/javascripts/webshims/minified/shims/excanvas.js +1 -21
- data/vendor/assets/javascripts/webshims/minified/shims/form-core.js +1 -19
- data/vendor/assets/javascripts/webshims/minified/shims/form-datalist.js +1 -22
- data/vendor/assets/javascripts/webshims/minified/shims/form-message.js +1 -8
- data/vendor/assets/javascripts/webshims/minified/shims/form-native-extend.js +1 -7
- data/vendor/assets/javascripts/webshims/minified/shims/form-number-date-api.js +1 -10
- data/vendor/assets/javascripts/webshims/minified/shims/form-number-date-ui.js +1 -23
- data/vendor/assets/javascripts/webshims/minified/shims/form-shim-extend.js +1 -46
- data/vendor/assets/javascripts/webshims/minified/shims/geolocation.js +1 -5
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-ar.js +1 -7
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-ch-ZN.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-de.txt +33 -33
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-el.js +1 -7
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-en.txt +34 -34
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-es.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-fr.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-he.js +1 -6
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-hi.js +1 -6
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-hu.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-it.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-ja.js +1 -4
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-nl.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-pt-PT.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-ru.js +1 -8
- data/vendor/assets/javascripts/webshims/minified/shims/i18n/errormessages-sv.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/json-storage.js +1 -14
- data/vendor/assets/javascripts/webshims/minified/shims/jwplayer/license.txt +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/jwplayer/player.swf +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/jwplayer/readme.html +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-core.js +1 -16
- data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-jaris.js +1 -23
- data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-native-fix.js +1 -3
- data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-swf.js +1 -26
- data/vendor/assets/javascripts/webshims/minified/shims/mediaelement-yt.js +1 -14
- data/vendor/assets/javascripts/webshims/minified/shims/range-ui.js +1 -0
- data/vendor/assets/javascripts/webshims/minified/shims/styles/details-arrows.png +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/styles/forms.png +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/styles/polyfill-loader.gif +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/styles/shim.css +1 -689
- data/vendor/assets/javascripts/webshims/minified/shims/swf/JarisFLVPlayer.swf +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/swf/jwwebshims.swf +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/swf/localStorage.swf +0 -0
- data/vendor/assets/javascripts/webshims/minified/shims/track-ui.js +1 -9
- data/vendor/assets/javascripts/webshims/minified/shims/track.js +1 -21
- data/vendor/assets/javascripts/webshims/polyfiller.js +1188 -1191
- data/vendor/assets/javascripts/webshims/{minified/shims → shims}/FlashCanvas/README +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/canvas2png.js +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.js +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/proxy.php +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/save.php +0 -0
- data/vendor/assets/javascripts/webshims/{minified/shims → shims}/FlashCanvasPro/README +82 -82
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/canvas2png.js +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash10canvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash9canvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flashcanvas.js +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/proxy.php +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/save.php +0 -0
- data/vendor/assets/javascripts/webshims/shims/combos/1.js +1752 -1754
- data/vendor/assets/javascripts/webshims/shims/combos/10.js +3311 -3247
- data/vendor/assets/javascripts/webshims/shims/combos/11.js +1631 -1633
- data/vendor/assets/javascripts/webshims/shims/combos/12.js +1697 -1636
- data/vendor/assets/javascripts/webshims/shims/combos/13.js +1098 -1100
- data/vendor/assets/javascripts/webshims/shims/combos/14.js +477 -476
- data/vendor/assets/javascripts/webshims/shims/combos/15.js +317 -316
- data/vendor/assets/javascripts/webshims/shims/combos/16.js +2155 -2095
- data/vendor/assets/javascripts/webshims/shims/combos/17.js +2320 -2259
- data/vendor/assets/javascripts/webshims/shims/combos/18.js +1326 -1322
- data/vendor/assets/javascripts/webshims/shims/combos/19.js +2238 -2239
- data/vendor/assets/javascripts/webshims/shims/combos/2.js +2341 -2339
- data/vendor/assets/javascripts/webshims/shims/combos/20.js +1558 -1493
- data/vendor/assets/javascripts/webshims/shims/combos/21.js +1734 -1733
- data/vendor/assets/javascripts/webshims/shims/combos/22.js +2361 -2295
- data/vendor/assets/javascripts/webshims/shims/combos/23.js +2332 -2269
- data/vendor/assets/javascripts/webshims/shims/combos/24.js +2836 -2775
- data/vendor/assets/javascripts/webshims/shims/combos/25.js +1549 -1489
- data/vendor/assets/javascripts/webshims/shims/combos/26.js +2156 -2095
- data/vendor/assets/javascripts/webshims/shims/combos/27.js +3313 -3248
- data/vendor/assets/javascripts/webshims/shims/combos/3.js +3022 -3020
- data/vendor/assets/javascripts/webshims/shims/combos/4.js +771 -770
- data/vendor/assets/javascripts/webshims/shims/combos/5.js +1027 -1025
- data/vendor/assets/javascripts/webshims/shims/combos/59.js +1709 -1706
- data/vendor/assets/javascripts/webshims/shims/combos/6.js +387 -386
- data/vendor/assets/javascripts/webshims/shims/combos/7.js +643 -641
- data/vendor/assets/javascripts/webshims/shims/combos/8.js +1547 -1488
- data/vendor/assets/javascripts/webshims/shims/combos/9.js +2508 -2445
- data/vendor/assets/javascripts/webshims/shims/details.js +148 -148
- data/vendor/assets/javascripts/webshims/shims/dom-extend.js +949 -952
- data/vendor/assets/javascripts/webshims/shims/es5.js +802 -802
- data/vendor/assets/javascripts/webshims/shims/excanvas.js +924 -924
- data/vendor/assets/javascripts/webshims/shims/form-core.js +606 -606
- data/vendor/assets/javascripts/webshims/shims/form-datalist.js +681 -681
- data/vendor/assets/javascripts/webshims/shims/form-message.js +164 -164
- data/vendor/assets/javascripts/webshims/shims/form-native-extend.js +255 -255
- data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +383 -383
- data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +2 -2
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +1568 -1569
- data/vendor/assets/javascripts/webshims/shims/geolocation.js +168 -168
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-ar.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-ch-ZN.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-de.txt +33 -33
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-el.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-en.txt +34 -34
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-es.js +31 -31
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-fr.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-he.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-hi.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-hu.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-it.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-ja.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-nl.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-pt-PT.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-ru.js +31 -31
- data/vendor/assets/javascripts/webshims/shims/i18n/errormessages-sv.js +32 -32
- data/vendor/assets/javascripts/webshims/shims/json-storage.js +308 -308
- data/vendor/assets/javascripts/webshims/shims/jwplayer/license.txt +0 -0
- data/vendor/assets/javascripts/webshims/shims/jwplayer/player.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/jwplayer/readme.html +0 -0
- data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +597 -536
- data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +891 -860
- data/vendor/assets/javascripts/webshims/shims/mediaelement-native-fix.js +98 -98
- data/vendor/assets/javascripts/webshims/shims/mediaelement-swf.js +960 -957
- data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +543 -543
- data/vendor/assets/javascripts/webshims/shims/range-ui.js +66 -0
- data/vendor/assets/javascripts/webshims/shims/styles/details-arrows.png +0 -0
- data/vendor/assets/javascripts/webshims/shims/styles/forms.png +0 -0
- data/vendor/assets/javascripts/webshims/shims/styles/polyfill-loader.gif +0 -0
- data/vendor/assets/javascripts/webshims/shims/styles/shim.css +697 -689
- data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/swf/jwwebshims.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/swf/localStorage.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/track-ui.js +0 -0
- data/vendor/assets/javascripts/webshims/shims/track.js +0 -0
- metadata +6 -4
Binary file
|
File without changes
|
File without changes
|
@@ -1,9 +1 @@
|
|
1
|
-
jQuery.webshims.register("track-ui",function(
|
2
|
-
g),i.docObserve();a.hasDirtyTrackDisplay&&g.triggerHandler("forceupdatetrackdisplay");this.showCues(a)}}else this.hide(a)},showCues:function(a){var g=b('<span class="cue-wrapper" />');b.each(a.displayedActiveCues,function(c,d){var e=b('<span class="cue-line"><span '+(d.id?'id="cue-id-'+d.id+'"':"")+' class="cue" /></span>').find("span").html(d.getCueAsHTML()).end();"descriptions"==d.track.kind?setTimeout(function(){b("span.description-cues",a.trackDisplay).html(e)},0):g.prepend(e)});b("span.cue-wrapper",
|
3
|
-
a.trackDisplay).remove();a.trackDisplay.append(g)},addEvents:function(a,b){if(k.positionDisplay){var c,d=function(c){if(a.displayedActiveCues.length||!0===c){a.trackDisplay.css({display:"none"});var d=b.getShadowElement();d.offsetParent();var c=d.innerHeight(),e=d.innerWidth(),d=d.position();a.trackDisplay.css({left:d.left,width:e,height:c-45,top:d.top,display:"block"});a.trackDisplay.css("fontSize",Math.max(Math.round(c/30),7));a.hasDirtyTrackDisplay=!1}else a.hasDirtyTrackDisplay=!0},e=function(){d(!0)};
|
4
|
-
b.on("updateshadowdom playerdimensionchange mediaelementapichange updatetrackdisplay updatemediaelementdimensions swfstageresize",function(){clearTimeout(c);c=setTimeout(d,0)});b.on("forceupdatetrackdisplay",e);e()}},hide:function(a){if(a.trackDisplay&&a.displayedActiveCues.length)a.displayedActiveCues=[],b("span.cue-wrapper",a.trackDisplay).remove(),b("span.description-cues",a.trackDisplay).empty()}};b.extend(b.event.customEvent,{updatetrackdisplay:!0,forceupdatetrackdisplay:!0});j.trackDisplay=
|
5
|
-
n;if(!j.createCueList){var o={getCueById:function(a){for(var b=null,c=0,d=this.length;c<d;c++)if(this[c].id===a){b=this[c];break}return b}};j.createCueList=function(){return b.extend([],o)}}j.getActiveCue=function(a,g,c,d){if(!a._lastFoundCue)a._lastFoundCue={index:0,time:0};if(Modernizr.track&&!k.override&&!a._shimActiveCues)a._shimActiveCues=j.createCueList();for(var e=0,f;e<a.shimActiveCues.length;e++)f=a.shimActiveCues[e],f.startTime>c||f.endTime<c?(a.shimActiveCues.splice(e,1),e--,f.pauseOnExit&&
|
6
|
-
b(g).pause(),b(a).triggerHandler("cuechange"),b(f).triggerHandler("exit")):"showing"==a.mode&&l[a.kind]&&-1==b.inArray(f,d.activeCues)&&d.activeCues.push(f);g=a.cues.length;for(e=a._lastFoundCue.time<c?a._lastFoundCue.index:0;e<g;e++){f=a.cues[e];if(f.startTime<=c&&f.endTime>=c&&-1==b.inArray(f,a.shimActiveCues))a.shimActiveCues.push(f),"showing"==a.mode&&l[a.kind]&&d.activeCues.push(f),b(a).triggerHandler("cuechange"),b(f).triggerHandler("enter"),a._lastFoundCue.time=c,a._lastFoundCue.index=e;if(f.startTime>
|
7
|
-
c)break}};!k.override&&Modernizr.track&&function(){var a,g=function(c){setTimeout(function(){a=!0;b(c).triggerHandler("updatetrackdisplay");a=!1},9)},c=function(c,e,f){var m="_sup"+f,h={prop:{}},j;h.prop[f]=function(){!a&&!k.override&&Modernizr.track&&g(b(this).closest("audio, video"));return j.prop[m].apply(this,arguments)};j=i.defineNodeNameProperty(c,e,h)};c("track","track","get");["audio","video"].forEach(function(a){c(a,"textTracks","get");c("nodeName","addTextTrack","value")})}();i.addReady(function(a,
|
8
|
-
g){b("video, audio",a).add(g.filter("video, audio")).each(function(){var a=b(this),d=function(){var b,d;if(!h||!g)if(h=a.prop("textTracks"),g=i.data(a[0],"mediaelementBase")||i.data(a[0],"mediaelementBase",{}),!g.displayedActiveCues)g.displayedActiveCues=[];if(h&&((d=a.prop("currentTime"))||0===d)){g.activeCues=[];for(var e=0,f=h.length;e<f;e++)b=h[e],"disabled"!=b.mode&&b.cues&&b.cues.length&&j.getActiveCue(b,a,d,g);n.update(g,a)}},e=function(a){clearTimeout(l);a&&"timeupdate"==a.type?(d(),setTimeout(e,
|
9
|
-
90)):l=setTimeout(d,9)},f=function(){a.off(".trackview").on("play.trackview timeupdate.trackview updatetrackdisplay.trackview",e)},g,h,l;if(!k.override&&Modernizr.track)a.on("mediaelementapichange trackapichange",function(){k.override||!Modernizr.track||a.is(".nonnative-api-active")?f():(h=a.prop("textTracks"),g=i.data(a[0],"mediaelementBase")||i.data(a[0],"mediaelementBase",{}),b.each(h,function(a,b){b._shimActiveCues&&delete b._shimActiveCues}),n.hide(g),a.unbind(".trackview"))});else f()})})});
|
1
|
+
jQuery.webshims.register("track-ui",function(e,t,n,r,i){"use strict";function h(e,t){var n=!0,r=0,i=e.length;if(i!=t.length)n=!1;else for(;r<i;r++)if(e[r]!=t[r]){n=!1;break}return n}var s=t.cfg.track,o={type:"enter"},u={type:"exit"},a={subtitles:1,captions:1,descriptions:1},f=t.mediaelement,l=function(){return!s.override&&Modernizr.track},c={update:function(n,r){n.activeCues.length?h(n.displayedActiveCues,n.activeCues)||(n.displayedActiveCues=n.activeCues,n.trackDisplay||(n.trackDisplay=e('<div class="cue-display"><span class="description-cues" aria-live="assertive" /></div>').insertAfter(r),this.addEvents(n,r),t.docObserve()),n.hasDirtyTrackDisplay&&r.triggerHandler("forceupdatetrackdisplay"),this.showCues(n)):this.hide(n)},showCues:function(t){var n=e('<span class="cue-wrapper" />');e.each(t.displayedActiveCues,function(r,i){var s=i.id?'id="cue-id-'+i.id+'"':"",o=e('<span class="cue-line"><span '+s+' class="cue" /></span>').find("span").html(i.getCueAsHTML()).end();i.track.kind=="descriptions"?setTimeout(function(){e("span.description-cues",t.trackDisplay).html(o)},0):n.prepend(o)}),e("span.cue-wrapper",t.trackDisplay).remove(),t.trackDisplay.append(n)},addEvents:function(e,t){if(s.positionDisplay){var n,r=function(n){if(e.displayedActiveCues.length||n===!0){e.trackDisplay.css({display:"none"});var r=t.getShadowElement(),i=r.offsetParent(),s=r.innerHeight(),o=r.innerWidth(),u=r.position(),a=s*o;e.trackDisplay.css({left:u.left,width:o,height:s-45,top:u.top,display:"block"}),e.trackDisplay.css("fontSize",Math.max(Math.round(s/30),7)),e.hasDirtyTrackDisplay=!1}else e.hasDirtyTrackDisplay=!0},i=function(e){clearTimeout(n),n=setTimeout(r,0)},o=function(){r(!0)};t.on("updateshadowdom playerdimensionchange mediaelementapichange updatetrackdisplay updatemediaelementdimensions swfstageresize",i),t.on("forceupdatetrackdisplay",o),o()}},hide:function(t){t.trackDisplay&&t.displayedActiveCues.length&&(t.displayedActiveCues=[],e("span.cue-wrapper",t.trackDisplay).remove(),e("span.description-cues",t.trackDisplay).empty())}};e.extend(e.event.customEvent,{updatetrackdisplay:!0,forceupdatetrackdisplay:!0}),f.trackDisplay=c;if(!f.createCueList){var p={getCueById:function(e){var t=null;for(var n=0,r=this.length;n<r;n++)if(this[n].id===e){t=this[n];break}return t}};f.createCueList=function(){return e.extend([],p)}}f.getActiveCue=function(t,n,r,i){t._lastFoundCue||(t._lastFoundCue={index:0,time:0}),Modernizr.track&&!s.override&&!t._shimActiveCues&&(t._shimActiveCues=f.createCueList());var o=0,u,l;for(;o<t.shimActiveCues.length;o++)l=t.shimActiveCues[o],l.startTime>r||l.endTime<r?(t.shimActiveCues.splice(o,1),o--,l.pauseOnExit&&e(n).pause(),e(t).triggerHandler("cuechange"),e(l).triggerHandler("exit")):t.mode=="showing"&&a[t.kind]&&e.inArray(l,i.activeCues)==-1&&i.activeCues.push(l);u=t.cues.length,o=t._lastFoundCue.time<r?t._lastFoundCue.index:0;for(;o<u;o++){l=t.cues[o],l.startTime<=r&&l.endTime>=r&&e.inArray(l,t.shimActiveCues)==-1&&(t.shimActiveCues.push(l),t.mode=="showing"&&a[t.kind]&&i.activeCues.push(l),e(t).triggerHandler("cuechange"),e(l).triggerHandler("enter"),t._lastFoundCue.time=r,t._lastFoundCue.index=o);if(l.startTime>r)break}},l()&&function(){var n,r=function(t){setTimeout(function(){n=!0,e(t).triggerHandler("updatetrackdisplay"),n=!1},9)},i=function(i,s,o){var u="_sup"+o,a={prop:{}},f;a.prop[o]=function(){return!n&&l()&&r(e(this).closest("audio, video")),f.prop[u].apply(this,arguments)},f=t.defineNodeNameProperty(i,s,a)};i("track","track","get"),["audio","video"].forEach(function(e){i(e,"textTracks","get"),i("nodeName","addTextTrack","value")})}(),t.addReady(function(n,r){e("video, audio",n).add(r.filter("video, audio")).each(function(){var n=e(this),r=function(e){var r,i;if(!u||!o)u=n.prop("textTracks"),o=t.data(n[0],"mediaelementBase")||t.data(n[0],"mediaelementBase",{}),o.displayedActiveCues||(o.displayedActiveCues=[]);if(!u)return;i=n.prop("currentTime");if(!i&&i!==0)return;o.activeCues=[];for(var s=0,a=u.length;s<a;s++)r=u[s],r.mode!="disabled"&&r.cues&&r.cues.length&&f.getActiveCue(r,n,i,o);c.update(o,n)},i=function(e){clearTimeout(a),e&&e.type=="timeupdate"?(r(),setTimeout(i,90)):a=setTimeout(r,9)},s=function(){n.off(".trackview").on("play.trackview timeupdate.trackview updatetrackdisplay.trackview",i)},o,u,a;l()?n.on("mediaelementapichange trackapichange",function(){!l()||n.is(".nonnative-api-active")?s():(u=n.prop("textTracks"),o=t.data(n[0],"mediaelementBase")||t.data(n[0],"mediaelementBase",{}),e.each(u,function(e,t){t._shimActiveCues&&delete t._shimActiveCues}),c.hide(o),n.unbind(".trackview"))}):s()})})});
|
@@ -1,21 +1 @@
|
|
1
|
-
jQuery.webshims.register("track",function(d,h,r,s){var i=h.mediaelement;(new Date).getTime();var u={subtitles:1,captions:1,descriptions:1},v=d("<track />"),m=Modernizr.ES5&&Modernizr.objectAccessor,p=function(a){var b={};a.addEventListener=function(a,g){b[a]&&h.error("always use $.on to the shimed event: "+a+" already bound fn was: "+b[a]+" your fn was: "+g);b[a]=g};a.removeEventListener=function(a,g){b[a]&&b[a]!=g&&h.error("always use $.on/$.off to the shimed event: "+a+" already bound fn was: "+
|
2
|
-
b[a]+" your fn was: "+g);b[a]&&delete b[a]};return a},w={getCueById:function(a){for(var b=null,e=0,g=this.length;e<g;e++)if(this[e].id===a){b=this[e];break}return b}},x={"0":"disabled",1:"hidden",2:"showing"},y={shimActiveCues:null,_shimActiveCues:null,activeCues:null,cues:null,kind:"subtitles",label:"",language:"",mode:"disabled",readyState:0,oncuechange:null,toString:function(){return"[object TextTrack]"},addCue:function(a){if(this.cues){var b=this.cues[this.cues.length-1];b&&b.startTime>a.startTime&&
|
3
|
-
h.error("cue startTime higher than previous cue's startTime")}else this.cues=i.createCueList();a.track&&a.track.removeCue&&a.track.removeCue(a);a.track=this;this.cues.push(a)},removeCue:function(a){var b=this.cues||[],e=0,g=b.length;if(a.track!=this)h.error("cue not part of track");else{for(;e<g;e++)if(b[e]===a){b.splice(e,1);a.track=null;break}a.track&&h.error("cue not part of track")}},DISABLED:"disabled",OFF:"disabled",HIDDEN:"hidden",SHOWING:"showing",ERROR:3,LOADED:2,LOADING:1,NONE:0},n=["kind",
|
4
|
-
"label","srclang"],o={srclang:"language"},z=Function.prototype.call.bind(Object.prototype.hasOwnProperty),l=function(a,b){var e=[],g=[],c=[],f,j;a||(a=h.data(this,"mediaelementBase")||h.data(this,"mediaelementBase",{}));if(!b)a.blockTrackListUpdate=!0,b=d.prop(this,"textTracks"),a.blockTrackListUpdate=!1;clearTimeout(a.updateTrackListTimer);d("track",this).each(function(){var a=d.prop(this,"track");c.push(a);-1==b.indexOf(a)&&g.push(a)});if(a.scriptedTextTracks)for(f=0,j=a.scriptedTextTracks.length;f<
|
5
|
-
j;f++)c.push(a.scriptedTextTracks[f]),-1==b.indexOf(a.scriptedTextTracks[f])&&g.push(a.scriptedTextTracks[f]);for(f=0,j=b.length;f<j;f++)-1==c.indexOf(b[f])&&e.push(b[f]);if(e.length||g.length){b.splice(0);for(f=0,j=c.length;f<j;f++)b.push(c[f]);for(f=0,j=e.length;f<j;f++)d([b]).triggerHandler(d.Event({type:"removetrack",track:e[f]}));for(f=0,j=g.length;f<j;f++)d([b]).triggerHandler(d.Event({type:"addtrack",track:g[f]}));(a.scriptedTextTracks||e.length)&&d(this).triggerHandler("updatetrackdisplay")}},
|
6
|
-
t=function(a,b){b||(b=h.data(a,"trackData"));if(b&&!b.isTriggering)b.isTriggering=!0,setTimeout(function(){(b.track||{}).readyState?d(a).closest("audio, video").triggerHandler("updatetrackdisplay"):d(a).triggerHandler("checktrackmode");b.isTriggering=!1},1)},q=d("<div />")[0];r.TextTrackCue=function(a,b,e){3!=arguments.length&&h.error("wrong arguments.length for TextTrackCue.constructor");this.startTime=a;this.endTime=b;this.text=e;this.id="";this.pauseOnExit=!1;p(this)};r.TextTrackCue.prototype=
|
7
|
-
{onenter:null,onexit:null,pauseOnExit:!1,getCueAsHTML:function(){var a="",b="",e=s.createDocumentFragment(),g;if(!z(this,"getCueAsHTML"))g=this.getCueAsHTML=function(){var c,f;if(a!=this.text){a=this.text;b=i.parseCueTextToHTML(a);q.innerHTML=b;for(c=0,f=q.childNodes.length;c<f;c++)e.appendChild(q.childNodes[c].cloneNode(!0))}return e.cloneNode(!0)};return g?g.apply(this,arguments):e.cloneNode(!0)},track:null,id:""};i.createCueList=function(){return d.extend([],w)};i.parseCueTextToHTML=function(){var a=
|
8
|
-
/(<\/?[^>]+>)/ig,b=/^(?:c|v|ruby|rt|b|i|u)/,e=/\<\s*\//,g=function(a,b,c,g){e.test(g)?a="</"+a+">":(c.splice(0,1),a="<"+a+" "+b+'="'+c.join(" ").replace(/\"/g,""")+'">');return a},c=function(a){var c=a.replace(/[<\/>]+/ig,"").split(/[\s\.]+/);c[0]&&(c[0]=c[0].toLowerCase(),b.test(c[0])?"c"==c[0]?a=g("span","class",c,a):"v"==c[0]&&(a=g("q","title",c,a)):a="");return a};return function(b){return b.replace(a,c)}}();i.loadTextTrack=function(a,b,e,g){var c=e.track,f=function(){var e=d.prop(b,"src"),
|
9
|
-
g,k;if("disabled"!=c.mode&&e&&d.attr(b,"src")&&(d(a).unbind("play playing timeupdate updatetrackdisplay",f),d(b).unbind("checktrackmode",f),!c.readyState)){g=function(){c.readyState=3;c.cues=null;c.activeCues=c.shimActiveCues=c._shimActiveCues=null;d(b).triggerHandler("error")};c.readyState=1;try{c.cues=i.createCueList(),c.activeCues=c.shimActiveCues=c._shimActiveCues=i.createCueList(),k=d.ajax({dataType:"text",url:e,success:function(f){"text/vtt"!=k.getResponseHeader("content-type")&&h.error("set the mime-type of your WebVTT files to text/vtt. see: http://dev.w3.org/html5/webvtt/#text/vtt");
|
10
|
-
i.parseCaptions(f,c,function(f){f&&"length"in f?(c.readyState=2,d(b).triggerHandler("load"),d(a).triggerHandler("updatetrackdisplay")):g()})},error:g})}catch(l){g(),h.warn(l)}}};c.readyState=0;c.shimActiveCues=null;c._shimActiveCues=null;c.activeCues=null;c.cues=null;d(a).unbind("play playing timeupdate updatetrackdisplay",f);d(b).unbind("checktrackmode",f);d(a).on("play playing timeupdate updatetrackdisplay",f);d(b).on("checktrackmode",f);if(g)c.mode=u[c.kind]?"showing":"hidden",f()};i.createTextTrack=
|
11
|
-
function(a,b){var e,g;if(b.nodeName&&(g=h.data(b,"trackData")))t(b,g),e=g.track;if(!e)e=p(h.objectCreate(y)),m||n.forEach(function(a){var f=d.prop(b,a);f&&(e[o[a]||a]=f)}),b.nodeName?(m&&n.forEach(function(a){h.defineProperty(e,o[a]||a,{get:function(){return d.prop(b,a)}})}),g=h.data(b,"trackData",{track:e}),i.loadTextTrack(a,b,g,d.prop(b,"default")&&d(b).siblings("track[default]").andSelf()[0]==b)):(m&&n.forEach(function(a){h.defineProperty(e,o[a]||a,{value:b[a],writeable:!1})}),e.cues=i.createCueList(),
|
12
|
-
e.activeCues=e._shimActiveCues=e.shimActiveCues=i.createCueList(),e.mode="hidden",e.readyState=2);return e};i.parseCaptionChunk=function(){var a=/^(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s+\-\-\>\s+(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s*(.*)/,b=/^(DEFAULTS|DEFAULT)\s+\-\-\>\s+(.*)/g,e=/^(STYLE|STYLES)\s+\-\-\>\s*\n([\s\S]*)/g,g=/^(COMMENT|COMMENTS)\s+\-\-\>\s+(.*)/g;return function(c){var f,d,i,k;if(b.exec(c)||e.exec(c)||g.exec(c))return null;for(c=c.split(/\n/g);!c[0].replace(/\s+/ig,"").length&&0<c.length;)c.shift();
|
13
|
-
for(c[0].match(/^\s*[a-z0-9-\_]+\s*$/ig)&&(i=""+c.shift().replace(/\s*/ig,""));0<c.length;){if(k=a.exec(c[0]))d=k.slice(1),f=parseInt(3600*(d[0]||0),10)+parseInt(60*(d[1]||0),10)+parseInt(d[2]||0,10)+parseFloat("0."+(d[3]||0)),d=parseInt(3600*(d[4]||0),10)+parseInt(60*(d[5]||0),10)+parseInt(d[6]||0,10)+parseFloat("0."+(d[7]||0));c=c.slice(0,0).concat(c.slice(1));break}if(!f&&!d)return h.warn("couldn't extract time information: "+[f,d,c.join("\n"),i].join(" ; ")),null;c=c.join("\n");f=new TextTrackCue(f,
|
14
|
-
d,c);if(i)f.id=i;return f}}();i.parseCaptions=function(a,b,d){i.createCueList();var g,c,f,j,l;a?(f=/^WEBVTT(\s*FILE)?/ig,c=function(k,m){for(;k<m;k++){g=a[k];if(f.test(g))l=!0;else if(g.replace(/\s*/ig,"").length){if(!l){h.error("please use WebVTT format. This is the standard");d(null);break}(g=i.parseCaptionChunk(g,k))&&b.addCue(g)}if(j<(new Date).getTime()-30){k++;setTimeout(function(){j=(new Date).getTime();c(k,m)},90);break}}k>=m&&(l||h.error("please use WebVTT format. This is the standard"),
|
15
|
-
d(b.cues))},a=a.replace(/\r\n/g,"\n"),setTimeout(function(){a=a.replace(/\r/g,"\n");setTimeout(function(){j=(new Date).getTime();a=a.split(/\n\n+/g);c(0,a.length)},9)},9)):h.error("Required parameter captionData not supplied.")};i.createTrackList=function(a,b){b=b||h.data(a,"mediaelementBase")||h.data(a,"mediaelementBase",{});if(!b.textTracks)b.textTracks=[],h.defineProperties(b.textTracks,{onaddtrack:{value:null},onremovetrack:{value:null}}),p(b.textTracks);return b.textTracks};Modernizr.track||
|
16
|
-
(h.defineNodeNamesBooleanProperty(["track"],"default"),h.reflectProperties(["track"],["srclang","label"]),h.defineNodeNameProperties("track",{src:{reflect:!0,propType:"src"}}));h.defineNodeNameProperties("track",{kind:{attr:Modernizr.track?{set:function(a){var b=h.data(this,"trackData");this.setAttribute("data-kind",a);if(b)b.attrKind=a},get:function(){var a=h.data(this,"trackData");return a&&"attrKind"in a?a.attrKind:this.getAttribute("kind")}}:{},reflect:!0,propType:"enumarated",defaultValue:"subtitles",
|
17
|
-
limitedTo:["subtitles","captions","descriptions","chapters","metadata"]}});d.each(n,function(a,b){var e=o[b]||b;h.onNodeNamesPropertyModify("track",b,function(){var a=h.data(this,"trackData"),c=this;if(a)"kind"==b&&t(this,a),m||(a.track[e]=d.prop(this,b)),clearTimeout(a.changedTrackPropTimer),a.changedTrackPropTimer=setTimeout(function(){d(c).trigger("updatesubtitlestate")},1)})});h.onNodeNamesPropertyModify("track","src",function(a){if(a){var a=h.data(this,"trackData"),b;a&&(b=d(this).closest("video, audio"),
|
18
|
-
b[0]&&i.loadTextTrack(b,this,a))}});h.defineNodeNamesProperties(["track"],{ERROR:{value:3},LOADED:{value:2},LOADING:{value:1},NONE:{value:0},readyState:{get:function(){return(d.prop(this,"track")||{readyState:0}).readyState},writeable:!1},track:{get:function(){return i.createTextTrack(d(this).closest("audio, video")[0],this)},writeable:!1}},"prop");h.defineNodeNamesProperties(["audio","video"],{textTracks:{get:function(){var a=h.data(this,"mediaelementBase")||h.data(this,"mediaelementBase",{}),b=
|
19
|
-
i.createTrackList(this,a);a.blockTrackListUpdate||l.call(this,a,b);return b},writeable:!1},addTextTrack:{value:function(a,b,d){a=i.createTextTrack(this,{kind:v.prop("kind",a||"").prop("kind"),label:b||"",srclang:d||""});b=h.data(this,"mediaelementBase")||h.data(this,"mediaelementBase",{});if(!b.scriptedTextTracks)b.scriptedTextTracks=[];b.scriptedTextTracks.push(a);l.call(this);return a}}},"prop");d(s).on("emptied ended updatetracklist",function(a){if(d(a.target).is("audio, video")){var b=h.data(a.target,
|
20
|
-
"mediaelementBase");if(b)clearTimeout(b.updateTrackListTimer),b.updateTrackListTimer=setTimeout(function(){l.call(a.target,b)},0)}});h.addReady(function(a,b){var e=b.filter("video, audio, track").closest("audio, video");d("video, audio",a).add(e).each(function(){l.call(this)}).each(function(){if(Modernizr.track){var a=this.textTracks;d.prop(this,"textTracks").length!=a.length&&h.error("textTracks couldn't be copied");d("track",this).each(function(){var a=d.prop(this,"track"),b=this.track,e,g;if(b){e=
|
21
|
-
d.prop(this,"kind");g=b.readyState||this.readyState;if(b.mode||g)a.mode=x[b.mode]||b.mode;if("descriptions"!=e)b.mode="string"==typeof b.mode?"disabled":0,this.kind="metadata",d(this).attr({kind:e})}}).on("load error",function(a){a.originalEvent&&a.stopImmediatePropagation()})}});e.each(function(){var a=this,b=h.data(a,"mediaelementBase");if(b)clearTimeout(b.updateTrackListTimer),b.updateTrackListTimer=setTimeout(function(){l.call(a,b)},9)})});Modernizr.track&&d("video, audio").trigger("trackapichange")});
|
1
|
+
jQuery.webshims.register("track",function(e,t,n,r,i){"use strict";var s=t.mediaelement,o=(new Date).getTime(),u={subtitles:1,captions:1,descriptions:1},a=function(){t.error("not implemented yet")},f=e("<track />"),l=Modernizr.ES5&&Modernizr.objectAccessor,c=function(e){var n={};return e.addEventListener=function(e,r){n[e]&&t.error("always use $.on to the shimed event: "+e+" already bound fn was: "+n[e]+" your fn was: "+r),n[e]=r},e.removeEventListener=function(e,r){n[e]&&n[e]!=r&&t.error("always use $.on/$.off to the shimed event: "+e+" already bound fn was: "+n[e]+" your fn was: "+r),n[e]&&delete n[e]},e},h={getCueById:function(e){var t=null;for(var n=0,r=this.length;n<r;n++)if(this[n].id===e){t=this[n];break}return t}},p={0:"disabled",1:"hidden",2:"showing"},d={shimActiveCues:null,_shimActiveCues:null,activeCues:null,cues:null,kind:"subtitles",label:"",language:"",mode:"disabled",readyState:0,oncuechange:null,toString:function(){return"[object TextTrack]"},addCue:function(e){if(!this.cues)this.cues=s.createCueList();else{var n=this.cues[this.cues.length-1];n&&n.startTime>e.startTime&&t.error("cue startTime higher than previous cue's startTime")}e.track&&e.track.removeCue&&e.track.removeCue(e),e.track=this,this.cues.push(e)},removeCue:function(e){var n=this.cues||[],r=0,i=n.length;if(e.track!=this){t.error("cue not part of track");return}for(;r<i;r++)if(n[r]===e){n.splice(r,1),e.track=null;break}if(e.track){t.error("cue not part of track");return}},DISABLED:"disabled",OFF:"disabled",HIDDEN:"hidden",SHOWING:"showing",ERROR:3,LOADED:2,LOADING:1,NONE:0},v=["kind","label","srclang"],m={srclang:"language"},g=Function.prototype.call.bind(Object.prototype.hasOwnProperty),y=function(n,r){var i=[],s=[],o=[],u,a;n||(n=t.data(this,"mediaelementBase")||t.data(this,"mediaelementBase",{})),r||(n.blockTrackListUpdate=!0,r=e.prop(this,"textTracks"),n.blockTrackListUpdate=!1),clearTimeout(n.updateTrackListTimer),e("track",this).each(function(){var t=e.prop(this,"track");o.push(t),r.indexOf(t)==-1&&s.push(t)});if(n.scriptedTextTracks)for(u=0,a=n.scriptedTextTracks.length;u<a;u++)o.push(n.scriptedTextTracks[u]),r.indexOf(n.scriptedTextTracks[u])==-1&&s.push(n.scriptedTextTracks[u]);for(u=0,a=r.length;u<a;u++)o.indexOf(r[u])==-1&&i.push(r[u]);if(i.length||s.length){r.splice(0);for(u=0,a=o.length;u<a;u++)r.push(o[u]);for(u=0,a=i.length;u<a;u++)e([r]).triggerHandler(e.Event({type:"removetrack",track:i[u]}));for(u=0,a=s.length;u<a;u++)e([r]).triggerHandler(e.Event({type:"addtrack",track:s[u]}));(n.scriptedTextTracks||i.length)&&e(this).triggerHandler("updatetrackdisplay")}},b=function(n,r){r||(r=t.data(n,"trackData")),r&&!r.isTriggering&&(r.isTriggering=!0,setTimeout(function(){(r.track||{}).readyState?e(n).closest("audio, video").triggerHandler("updatetrackdisplay"):e(n).triggerHandler("checktrackmode"),r.isTriggering=!1},1))},w=e("<div />")[0];n.TextTrackCue=function(e,n,r){arguments.length!=3&&t.error("wrong arguments.length for TextTrackCue.constructor"),this.startTime=e,this.endTime=n,this.text=r,this.id="",this.pauseOnExit=!1,c(this)},n.TextTrackCue.prototype={onenter:null,onexit:null,pauseOnExit:!1,getCueAsHTML:function(){var e="",t="",n=r.createDocumentFragment(),i;return g(this,"getCueAsHTML")||(i=this.getCueAsHTML=function(){var r,i;if(e!=this.text){e=this.text,t=s.parseCueTextToHTML(e),w.innerHTML=t;for(r=0,i=w.childNodes.length;r<i;r++)n.appendChild(w.childNodes[r].cloneNode(!0))}return n.cloneNode(!0)}),i?i.apply(this,arguments):n.cloneNode(!0)},track:null,id:""},s.createCueList=function(){return e.extend([],h)},s.parseCueTextToHTML=function(){var e=/(<\/?[^>]+>)/ig,t=/^(?:c|v|ruby|rt|b|i|u)/,n=/\<\s*\//,r=function(e,t,r,i){var s;return n.test(i)?s="</"+e+">":(r.splice(0,1),s="<"+e+" "+t+'="'+r.join(" ").replace(/\"/g,""")+'">'),s},i=function(e){var n=e.replace(/[<\/>]+/ig,"").split(/[\s\.]+/);return n[0]&&(n[0]=n[0].toLowerCase(),t.test(n[0])?n[0]=="c"?e=r("span","class",n,e):n[0]=="v"&&(e=r("q","title",n,e)):e=""),e};return function(t){return t.replace(e,i)}}(),s.loadTextTrack=function(n,r,i,o){var a="play playing timeupdate updatetrackdisplay",f=i.track,l=function(){var i=e.prop(r,"src"),o,u;if(f.mode!="disabled"&&i&&e.attr(r,"src")){e(n).unbind(a,l),e(r).unbind("checktrackmode",l);if(!f.readyState){o=function(){f.readyState=3,f.cues=null,f.activeCues=f.shimActiveCues=f._shimActiveCues=null,e(r).triggerHandler("error")},f.readyState=1;try{f.cues=s.createCueList(),f.activeCues=f.shimActiveCues=f._shimActiveCues=s.createCueList(),u=e.ajax({dataType:"text",url:i,success:function(i){u.getResponseHeader("content-type")!="text/vtt"&&t.error("set the mime-type of your WebVTT files to text/vtt. see: http://dev.w3.org/html5/webvtt/#text/vtt"),s.parseCaptions(i,f,function(t){t&&"length"in t?(f.readyState=2,e(r).triggerHandler("load"),e(n).triggerHandler("updatetrackdisplay")):o()})},error:o})}catch(c){o(),t.warn(c)}}}};f.readyState=0,f.shimActiveCues=null,f._shimActiveCues=null,f.activeCues=null,f.cues=null,e(n).unbind(a,l),e(r).unbind("checktrackmode",l),e(n).on(a,l),e(r).on("checktrackmode",l),o&&(f.mode=u[f.kind]?"showing":"hidden",l())},s.createTextTrack=function(n,r){var i,o;return r.nodeName&&(o=t.data(r,"trackData"),o&&(b(r,o),i=o.track)),i||(i=c(t.objectCreate(d)),l||v.forEach(function(t){var n=e.prop(r,t);n&&(i[m[t]||t]=n)}),r.nodeName?(l&&v.forEach(function(n){t.defineProperty(i,m[n]||n,{get:function(){return e.prop(r,n)}})}),o=t.data(r,"trackData",{track:i}),s.loadTextTrack(n,r,o,e.prop(r,"default")&&e(r).siblings("track[default]").andSelf()[0]==r)):(l&&v.forEach(function(e){t.defineProperty(i,m[e]||e,{value:r[e],writeable:!1})}),i.cues=s.createCueList(),i.activeCues=i._shimActiveCues=i.shimActiveCues=s.createCueList(),i.mode="hidden",i.readyState=2)),i},s.parseCaptionChunk=function(){var e=/^(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s+\-\-\>\s+(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s*(.*)/,n=/^([\d\.]+)\s+\+([\d\.]+)\s*(.*)/,r=/^(DEFAULTS|DEFAULT)\s+\-\-\>\s+(.*)/g,i=/^(STYLE|STYLES)\s+\-\-\>\s*\n([\s\S]*)/g,s=/^(COMMENT|COMMENTS)\s+\-\-\>\s+(.*)/g;return function(n,o){var u=[],a,f,l,c,h,p,d="",v,m,g,y;if(m=r.exec(n))return null;if(m=i.exec(n))return null;if(m=s.exec(n))return null;a=n.split(/\n/g);while(!a[0].replace(/\s+/ig,"").length&&a.length>0)a.shift();a[0].match(/^\s*[a-z0-9-\_]+\s*$/ig)&&(v=String(a.shift().replace(/\s*/ig,"")));for(p=0;p<a.length;p++){var b=a[p];if(g=e.exec(b))h=g.slice(1),f=parseInt((h[0]||0)*60*60,10)+parseInt((h[1]||0)*60,10)+parseInt(h[2]||0,10)+parseFloat("0."+(h[3]||0)),l=parseInt((h[4]||0)*60*60,10)+parseInt((h[5]||0)*60,10)+parseInt(h[6]||0,10)+parseFloat("0."+(h[7]||0));a=a.slice(0,p).concat(a.slice(p+1));break}return!f&&!l?(t.warn("couldn't extract time information: "+[f,l,a.join("\n"),v].join(" ; ")),null):(c=a.join("\n"),y=new TextTrackCue(f,l,c),v&&(y.id=v),y)}}(),s.parseCaptions=function(e,n,r){var i=s.createCueList(),o,u,a,f,l;e?(a=/^WEBVTT(\s*FILE)?/ig,u=function(i,c){for(;i<c;i++){o=e[i];if(a.test(o))l=!0;else if(o.replace(/\s*/ig,"").length){if(!l){t.error("please use WebVTT format. This is the standard"),r(null);break}o=s.parseCaptionChunk(o,i),o&&n.addCue(o)}if(f<(new Date).getTime()-30){i++,setTimeout(function(){f=(new Date).getTime(),u(i,c)},90);break}}i>=c&&(l||t.error("please use WebVTT format. This is the standard"),r(n.cues))},e=e.replace(/\r\n/g,"\n"),setTimeout(function(){e=e.replace(/\r/g,"\n"),setTimeout(function(){f=(new Date).getTime(),e=e.split(/\n\n+/g),u(0,e.length)},9)},9)):t.error("Required parameter captionData not supplied.")},s.createTrackList=function(e,n){return n=n||t.data(e,"mediaelementBase")||t.data(e,"mediaelementBase",{}),n.textTracks||(n.textTracks=[],t.defineProperties(n.textTracks,{onaddtrack:{value:null},onremovetrack:{value:null}}),c(n.textTracks)),n.textTracks},Modernizr.track||(t.defineNodeNamesBooleanProperty(["track"],"default"),t.reflectProperties(["track"],["srclang","label"]),t.defineNodeNameProperties("track",{src:{reflect:!0,propType:"src"}})),t.defineNodeNameProperties("track",{kind:{attr:Modernizr.track?{set:function(e){var n=t.data(this,"trackData");this.setAttribute("data-kind",e),n&&(n.attrKind=e)},get:function(){var e=t.data(this,"trackData");return e&&"attrKind"in e?e.attrKind:this.getAttribute("kind")}}:{},reflect:!0,propType:"enumarated",defaultValue:"subtitles",limitedTo:["subtitles","captions","descriptions","chapters","metadata"]}}),e.each(v,function(n,r){var i=m[r]||r;t.onNodeNamesPropertyModify("track",r,function(){var n=t.data(this,"trackData"),s=this;n&&(r=="kind"&&b(this,n),l||(n.track[i]=e.prop(this,r)),clearTimeout(n.changedTrackPropTimer),n.changedTrackPropTimer=setTimeout(function(){e(s).trigger("updatesubtitlestate")},1))})}),t.onNodeNamesPropertyModify("track","src",function(n){if(n){var r=t.data(this,"trackData"),i;r&&(i=e(this).closest("video, audio"),i[0]&&s.loadTextTrack(i,this,r))}}),t.defineNodeNamesProperties(["track"],{ERROR:{value:3},LOADED:{value:2},LOADING:{value:1},NONE:{value:0},readyState:{get:function(){return(e.prop(this,"track")||{readyState:0}).readyState},writeable:!1},track:{get:function(){return s.createTextTrack(e(this).closest("audio, video")[0],this)},writeable:!1}},"prop"),t.defineNodeNamesProperties(["audio","video"],{textTracks:{get:function(){var e=this,n=t.data(e,"mediaelementBase")||t.data(e,"mediaelementBase",{}),r=s.createTrackList(e,n);return n.blockTrackListUpdate||y.call(e,n,r),r},writeable:!1},addTextTrack:{value:function(e,n,r){var i=s.createTextTrack(this,{kind:f.prop("kind",e||"").prop("kind"),label:n||"",srclang:r||""}),o=t.data(this,"mediaelementBase")||t.data(this,"mediaelementBase",{});return o.scriptedTextTracks||(o.scriptedTextTracks=[]),o.scriptedTextTracks.push(i),y.call(this),i}}},"prop"),e(r).on("emptied ended updatetracklist",function(n){if(e(n.target).is("audio, video")){var r=t.data(n.target,"mediaelementBase");r&&(clearTimeout(r.updateTrackListTimer),r.updateTrackListTimer=setTimeout(function(){y.call(n.target,r)},0))}});var E=function(e,t){return t.readyState||e.readyState};t.addReady(function(n,r){var i=r.filter("video, audio, track").closest("audio, video");e("video, audio",n).add(i).each(function(){y.call(this)}).each(function(){if(Modernizr.track){var n=e.prop(this,"textTracks"),r=this.textTracks;n.length!=r.length&&t.error("textTracks couldn't be copied"),e("track",this).each(function(){var t=e.prop(this,"track"),n=this.track,r,i;if(n){r=e.prop(this,"kind"),i=E(this,n);if(n.mode||i)t.mode=p[n.mode]||n.mode;r!="descriptions"&&(n.mode=typeof n.mode=="string"?"disabled":0,this.kind="metadata",e(this).attr({kind:r}))}}).on("load error",function(e){e.originalEvent&&e.stopImmediatePropagation()})}}),i.each(function(){var e=this,n=t.data(e,"mediaelementBase");n&&(clearTimeout(n.updateTrackListTimer),n.updateTrackListTimer=setTimeout(function(){y.call(e,n)},9))})}),Modernizr.track&&e("video, audio").trigger("trackapichange")});
|
@@ -1,1191 +1,1188 @@
|
|
1
|
-
(function (factory) {
|
2
|
-
|
3
|
-
if(window.jQuery){
|
4
|
-
factory(jQuery);
|
5
|
-
factory = jQuery.noop;
|
6
|
-
}
|
7
|
-
if (typeof define === 'function' && define.amd && define.amd.jQuery) {
|
8
|
-
define('polyfiller', ['jquery'], factory);
|
9
|
-
}
|
10
|
-
}(function($){
|
11
|
-
"use strict";
|
12
|
-
var DOMSUPPORT = 'dom-support';
|
13
|
-
var jScripts = $(document.scripts || 'script');
|
14
|
-
var special = $.event.special;
|
15
|
-
var emptyJ = $([]);
|
16
|
-
var Modernizr = window.Modernizr;
|
17
|
-
var asyncWebshims = window.asyncWebshims;
|
18
|
-
var addTest = Modernizr.addTest;
|
19
|
-
var browserVersion = parseFloat($.browser.version, 10);
|
20
|
-
var Object = window.Object;
|
21
|
-
var html5 = window.html5 || {};
|
22
|
-
var needModernizr = function(tests, fn){
|
23
|
-
var run = true;
|
24
|
-
$.each(tests.split(' '), function(i, name){
|
25
|
-
if(!(name in Modernizr)){
|
26
|
-
webshims.error('webshims needs Modernizr.'+name + ' to implement feature.');
|
27
|
-
run = false;
|
28
|
-
}
|
29
|
-
});
|
30
|
-
if(run && fn){
|
31
|
-
fn();
|
32
|
-
}
|
33
|
-
};
|
34
|
-
|
35
|
-
Modernizr.advancedObjectProperties = Modernizr.objectAccessor = Modernizr.ES5 = !!('create' in Object && 'seal' in Object);
|
36
|
-
|
37
|
-
|
38
|
-
var webshims = {
|
39
|
-
version: '1.9.
|
40
|
-
cfg: {
|
41
|
-
useImportantStyles: true,
|
42
|
-
//addCacheBuster: false,
|
43
|
-
waitReady: true,
|
44
|
-
extendNative: true,
|
45
|
-
loadStyles: true,
|
46
|
-
disableShivMethods: true,
|
47
|
-
basePath: (function(){
|
48
|
-
var script = jScripts.filter('[src*="polyfiller.js"]');
|
49
|
-
var path;
|
50
|
-
script = script[0] || script.end()[script.end().length - 1];
|
51
|
-
path = ( ($.support.hrefNormalized) ? script.src : script.getAttribute("src", 4) ).split('?')[0];
|
52
|
-
path = path.slice(0, path.lastIndexOf("/") + 1) + 'shims/';
|
53
|
-
return path;
|
54
|
-
})()
|
55
|
-
},
|
56
|
-
bugs: {},
|
57
|
-
browserVersion: browserVersion,
|
58
|
-
/*
|
59
|
-
* some data
|
60
|
-
*/
|
61
|
-
modules: {},
|
62
|
-
features: {},
|
63
|
-
featureList: [],
|
64
|
-
setOptions: function(name, opts){
|
65
|
-
if (typeof name == 'string' && opts !== undefined) {
|
66
|
-
webCFG[name] = (!$.isPlainObject(opts)) ? opts : $.extend(true, webCFG[name] || {}, opts);
|
67
|
-
} else if (typeof name == 'object') {
|
68
|
-
$.extend(true, webCFG, name);
|
69
|
-
}
|
70
|
-
},
|
71
|
-
addPolyfill: function(name, cfg){
|
72
|
-
cfg = cfg || {};
|
73
|
-
var feature = cfg.f || name;
|
74
|
-
if (!webshimsFeatures[feature]) {
|
75
|
-
webshimsFeatures[feature] = [];
|
76
|
-
webshimsFeatures[feature].delayReady = 0;
|
77
|
-
webshims.featureList.push(feature);
|
78
|
-
webCFG[feature] = {};
|
79
|
-
}
|
80
|
-
webshimsFeatures[feature].push(name);
|
81
|
-
cfg.options = $.extend(webCFG[feature], cfg.options);
|
82
|
-
|
83
|
-
addModule(name, cfg);
|
84
|
-
if (cfg.methodNames) {
|
85
|
-
$.each(cfg.methodNames, function(i, methodName){
|
86
|
-
webshims.addMethodName(methodName);
|
87
|
-
});
|
88
|
-
}
|
89
|
-
},
|
90
|
-
|
91
|
-
polyfill: (function(){
|
92
|
-
var firstPolyfillCall = function(features){
|
93
|
-
var addClass = [];
|
94
|
-
var onReadyEvts = features;
|
95
|
-
var timer;
|
96
|
-
|
97
|
-
if(webCFG.disableShivMethods){
|
98
|
-
html5.shivMethods = false;
|
99
|
-
}
|
100
|
-
|
101
|
-
var removeLoader = function(){
|
102
|
-
$('html').removeClass('loading-polyfills long-loading-polyfills');
|
103
|
-
$(window).unbind('.lP');
|
104
|
-
clearTimeout(timer);
|
105
|
-
};
|
106
|
-
|
107
|
-
$(window).on('load.lP error.lP', removeLoader);
|
108
|
-
|
109
|
-
addClass.push('loading-polyfills');
|
110
|
-
timer = setTimeout(function(){
|
111
|
-
$('html').addClass('long-loading-polyfills');
|
112
|
-
}, 600);
|
113
|
-
|
114
|
-
if (webCFG.waitReady && $.isReady) {
|
115
|
-
webshims.warn('Call webshims.polyfill before DOM-Ready or set waitReady to false.');
|
116
|
-
}
|
117
|
-
onReady(features, removeLoader);
|
118
|
-
if (webCFG.useImportantStyles) {
|
119
|
-
addClass.push('polyfill-important');
|
120
|
-
}
|
121
|
-
if (addClass[0]) {
|
122
|
-
$('html').addClass(addClass.join(' '));
|
123
|
-
}
|
124
|
-
if(webCFG.loadStyles){
|
125
|
-
loader.loadCSS('styles/shim.css');
|
126
|
-
}
|
127
|
-
//remove function
|
128
|
-
firstPolyfillCall = $.noop;
|
129
|
-
};
|
130
|
-
var loadedFormBase;
|
131
|
-
return function(features){
|
132
|
-
|
133
|
-
var toLoadFeatures = [];
|
134
|
-
|
135
|
-
features = features || webshims.featureList;
|
136
|
-
|
137
|
-
if (typeof features == 'string') {
|
138
|
-
features = features.split(' ');
|
139
|
-
}
|
140
|
-
if(!loadedFormBase){
|
141
|
-
loadedFormBase = $.inArray('forms', features) !== -1;
|
142
|
-
if(!loadedFormBase && $.inArray('forms-ext', features) !== -1){
|
143
|
-
features.push('forms');
|
144
|
-
loadedFormBase = true;
|
145
|
-
}
|
146
|
-
}
|
147
|
-
|
148
|
-
if (webCFG.waitReady) {
|
149
|
-
$.readyWait++;
|
150
|
-
onReady(features, function(){
|
151
|
-
$.ready(true);
|
152
|
-
});
|
153
|
-
}
|
154
|
-
|
155
|
-
$.each(features, function(i, feature){
|
156
|
-
if(!webshimsFeatures[feature]){
|
157
|
-
webshims.error("could not find webshims-feature (aborted): "+ feature);
|
158
|
-
isReady(feature, true);
|
159
|
-
return;
|
160
|
-
}
|
161
|
-
if (feature !== webshimsFeatures[feature][0]) {
|
162
|
-
onReady(webshimsFeatures[feature], function(){
|
163
|
-
isReady(feature, true);
|
164
|
-
});
|
165
|
-
}
|
166
|
-
toLoadFeatures = toLoadFeatures.concat(webshimsFeatures[feature]);
|
167
|
-
});
|
168
|
-
|
169
|
-
firstPolyfillCall(features);
|
170
|
-
loadList(toLoadFeatures);
|
171
|
-
|
172
|
-
};
|
173
|
-
})(),
|
174
|
-
|
175
|
-
/*
|
176
|
-
* handle ready modules
|
177
|
-
*/
|
178
|
-
reTest: (function(){
|
179
|
-
var resList;
|
180
|
-
var noDelayReady;
|
181
|
-
var reTest = function(i, name){
|
182
|
-
var module = modules[name];
|
183
|
-
var readyName = name+'Ready';
|
184
|
-
var feature;
|
185
|
-
if(module && !module.loaded && !( (module.test && $.isFunction(module.test) ) ? module.test([]) : module.test )){
|
186
|
-
if(special[readyName]){
|
187
|
-
delete special[readyName];
|
188
|
-
}
|
189
|
-
feature = webshimsFeatures[module.f];
|
190
|
-
if(feature && !noDelayReady){
|
191
|
-
feature.delayReady++;
|
192
|
-
onReady(name, function(){
|
193
|
-
feature.delayReady--;
|
194
|
-
isReady(module.f, feature.callReady);
|
195
|
-
});
|
196
|
-
}
|
197
|
-
resList.push(name);
|
198
|
-
}
|
199
|
-
};
|
200
|
-
return function(moduleNames, _noDelay){
|
201
|
-
noDelayReady = _noDelay;
|
202
|
-
if(typeof moduleNames == 'string'){
|
203
|
-
moduleNames = moduleNames.split(' ');
|
204
|
-
}
|
205
|
-
resList = [];
|
206
|
-
$.each(moduleNames, reTest);
|
207
|
-
loadList(resList);
|
208
|
-
};
|
209
|
-
})(),
|
210
|
-
isReady: function(name, _set){
|
211
|
-
if(webshimsFeatures[name] && webshimsFeatures[name].delayReady > 0){
|
212
|
-
if(_set){
|
213
|
-
webshimsFeatures[name].callReady = true;
|
214
|
-
}
|
215
|
-
return false;
|
216
|
-
}
|
217
|
-
name = name + 'Ready';
|
218
|
-
if (_set) {
|
219
|
-
if (special[name] && special[name].add) {
|
220
|
-
return true;
|
221
|
-
}
|
222
|
-
|
223
|
-
special[name] = $.extend(special[name] || {}, {
|
224
|
-
add: function(details){
|
225
|
-
details.handler.call(this, name);
|
226
|
-
}
|
227
|
-
});
|
228
|
-
$.event.trigger(name);
|
229
|
-
}
|
230
|
-
return !!(special[name] && special[name].add) || false;
|
231
|
-
},
|
232
|
-
ready: function(events, fn /*, _created*/){
|
233
|
-
var _created = arguments[2];
|
234
|
-
var evt = events;
|
235
|
-
if (typeof events == 'string') {
|
236
|
-
events = events.split(' ');
|
237
|
-
}
|
238
|
-
|
239
|
-
if (!_created) {
|
240
|
-
events = $.map($.grep(events, function(evt){
|
241
|
-
return !isReady(evt);
|
242
|
-
}), function(evt){
|
243
|
-
return evt + 'Ready';
|
244
|
-
});
|
245
|
-
}
|
246
|
-
if (!events.length) {
|
247
|
-
fn($, webshims, window, document);
|
248
|
-
return;
|
249
|
-
}
|
250
|
-
var readyEv = events.shift(), readyFn = function(){
|
251
|
-
onReady(events, fn, true);
|
252
|
-
};
|
253
|
-
|
254
|
-
$(document).one(readyEv, readyFn);
|
255
|
-
},
|
256
|
-
|
257
|
-
/*
|
258
|
-
* basic DOM-/jQuery-Helpers
|
259
|
-
*/
|
260
|
-
|
261
|
-
|
262
|
-
capturingEvents: function(names, _maybePrevented){
|
263
|
-
if (!document.addEventListener) {
|
264
|
-
return;
|
265
|
-
}
|
266
|
-
if (typeof names == 'string') {
|
267
|
-
names = [names];
|
268
|
-
}
|
269
|
-
$.each(names, function(i, name){
|
270
|
-
var handler = function(e){
|
271
|
-
e = $.event.fix(e);
|
272
|
-
if (_maybePrevented && webshims.capturingEventPrevented) {
|
273
|
-
webshims.capturingEventPrevented(e);
|
274
|
-
}
|
275
|
-
return $.event.handle.call(this, e);
|
276
|
-
};
|
277
|
-
special[name] = special[name] || {};
|
278
|
-
if (special[name].setup || special[name].teardown) {
|
279
|
-
return;
|
280
|
-
}
|
281
|
-
$.extend(special[name], {
|
282
|
-
setup: function(){
|
283
|
-
this.addEventListener(name, handler, true);
|
284
|
-
},
|
285
|
-
teardown: function(){
|
286
|
-
this.removeEventListener(name, handler, true);
|
287
|
-
}
|
288
|
-
});
|
289
|
-
});
|
290
|
-
},
|
291
|
-
register: function(name, fn){
|
292
|
-
var module = modules[name];
|
293
|
-
if (!module) {
|
294
|
-
webshims.
|
295
|
-
return;
|
296
|
-
}
|
297
|
-
if (module.noAutoCallback) {
|
298
|
-
var ready = function(){
|
299
|
-
fn($, webshims, window, document, undefined, module.options);
|
300
|
-
isReady(name, true);
|
301
|
-
};
|
302
|
-
if (module.d) {
|
303
|
-
onReady(module.d, ready);
|
304
|
-
}
|
305
|
-
else {
|
306
|
-
ready();
|
307
|
-
}
|
308
|
-
}
|
309
|
-
},
|
310
|
-
c: {},
|
311
|
-
/*
|
312
|
-
* loader
|
313
|
-
*/
|
314
|
-
loader: {
|
315
|
-
|
316
|
-
addModule: function(name, ext){
|
317
|
-
modules[name] = ext;
|
318
|
-
ext.name = ext.name || name;
|
319
|
-
if(!ext.c){
|
320
|
-
ext.c = [];
|
321
|
-
}
|
322
|
-
$.each(ext.c, function(i, comboname){
|
323
|
-
if(!webshims.c[comboname]){
|
324
|
-
webshims.c[comboname] = [];
|
325
|
-
}
|
326
|
-
webshims.c[comboname].push(name);
|
327
|
-
});
|
328
|
-
},
|
329
|
-
loadList: (function(){
|
330
|
-
|
331
|
-
var loadedModules = [];
|
332
|
-
var loadScript = function(src, names){
|
333
|
-
if (typeof names == 'string') {
|
334
|
-
names = [names];
|
335
|
-
}
|
336
|
-
$.merge(loadedModules, names);
|
337
|
-
loader.loadScript(src, false, names);
|
338
|
-
};
|
339
|
-
|
340
|
-
var noNeedToLoad = function(name, list){
|
341
|
-
if (isReady(name) || $.inArray(name, loadedModules) != -1) {
|
342
|
-
return true;
|
343
|
-
}
|
344
|
-
var module = modules[name];
|
345
|
-
var cfg = webCFG[module.f || name] || {};
|
346
|
-
var supported;
|
347
|
-
if (module) {
|
348
|
-
supported = (module.test && $.isFunction(module.test)) ? module.test(list) : module.test;
|
349
|
-
if (supported) {
|
350
|
-
isReady(name, true);
|
351
|
-
return true;
|
352
|
-
} else {
|
353
|
-
return false;
|
354
|
-
}
|
355
|
-
}
|
356
|
-
return true;
|
357
|
-
};
|
358
|
-
|
359
|
-
var setDependencies = function(module, list){
|
360
|
-
if (module.d && module.d.length) {
|
361
|
-
var addDependency = function(i, dependency){
|
362
|
-
if (!noNeedToLoad(dependency, list) && $.inArray(dependency, list) == -1) {
|
363
|
-
list.push(dependency);
|
364
|
-
}
|
365
|
-
};
|
366
|
-
$.each(module.d, function(i, dependency){
|
367
|
-
if (modules[dependency]) {
|
368
|
-
addDependency(i, dependency);
|
369
|
-
}
|
370
|
-
else
|
371
|
-
if (webshimsFeatures[dependency]) {
|
372
|
-
$.each(webshimsFeatures[dependency], addDependency);
|
373
|
-
onReady(webshimsFeatures[dependency], function(){
|
374
|
-
isReady(dependency, true);
|
375
|
-
});
|
376
|
-
}
|
377
|
-
});
|
378
|
-
if (!module.noAutoCallback) {
|
379
|
-
module.noAutoCallback = true;
|
380
|
-
}
|
381
|
-
}
|
382
|
-
};
|
383
|
-
|
384
|
-
return function(list, combo){
|
385
|
-
var module;
|
386
|
-
var loadCombos = [];
|
387
|
-
var i;
|
388
|
-
var len;
|
389
|
-
var foundCombo;
|
390
|
-
var loadCombo = function(j, combo){
|
391
|
-
foundCombo = combo;
|
392
|
-
$.each(webshims.c[combo], function(i, moduleName){
|
393
|
-
if($.inArray(moduleName, loadCombos) == -1 || $.inArray(moduleName, loadedModules) != -1){
|
394
|
-
foundCombo = false;
|
395
|
-
return false;
|
396
|
-
}
|
397
|
-
});
|
398
|
-
if(foundCombo){
|
399
|
-
loadScript('combos/'+foundCombo, webshims.c[foundCombo]);
|
400
|
-
return false;
|
401
|
-
}
|
402
|
-
};
|
403
|
-
|
404
|
-
//length of list is dynamically
|
405
|
-
for (i = 0; i < list.length; i++) {
|
406
|
-
module = modules[list[i]];
|
407
|
-
if (!module || noNeedToLoad(module.name, list)) {
|
408
|
-
if (!module) {
|
409
|
-
webshims.warn('could not find: ' + list[i]);
|
410
|
-
}
|
411
|
-
continue;
|
412
|
-
}
|
413
|
-
if (module.css) {
|
414
|
-
loader.loadCSS(module.css);
|
415
|
-
}
|
416
|
-
|
417
|
-
if (module.loadInit) {
|
418
|
-
module.loadInit();
|
419
|
-
}
|
420
|
-
|
421
|
-
module.loaded = true;
|
422
|
-
setDependencies(module, list);
|
423
|
-
loadCombos.push(module.name);
|
424
|
-
}
|
425
|
-
|
426
|
-
for(i = 0, len = loadCombos.length; i < len; i++){
|
427
|
-
foundCombo = false;
|
428
|
-
|
429
|
-
module = loadCombos[i];
|
430
|
-
|
431
|
-
if($.inArray(module, loadedModules) == -1){
|
432
|
-
if(webshims.debug != 'noCombo'){
|
433
|
-
$.each(modules[module].c, loadCombo);
|
434
|
-
}
|
435
|
-
if(!foundCombo){
|
436
|
-
loadScript(modules[module].src || module, module);
|
437
|
-
}
|
438
|
-
}
|
439
|
-
}
|
440
|
-
};
|
441
|
-
})(),
|
442
|
-
|
443
|
-
makePath: function(src){
|
444
|
-
if (src.indexOf('//') != -1 || src.indexOf('/') === 0) {
|
445
|
-
return src;
|
446
|
-
}
|
447
|
-
|
448
|
-
if (src.indexOf('.') == -1) {
|
449
|
-
src += '.js';
|
450
|
-
}
|
451
|
-
if (webCFG.addCacheBuster) {
|
452
|
-
src += webCFG.addCacheBuster;
|
453
|
-
}
|
454
|
-
return webCFG.basePath + src;
|
455
|
-
},
|
456
|
-
|
457
|
-
loadCSS: (function(){
|
458
|
-
var parent, loadedSrcs = [];
|
459
|
-
return function(src){
|
460
|
-
src = this.makePath(src);
|
461
|
-
if ($.inArray(src, loadedSrcs) != -1) {
|
462
|
-
return;
|
463
|
-
}
|
464
|
-
parent = parent || $('link, style')[0] || $('script')[0];
|
465
|
-
loadedSrcs.push(src);
|
466
|
-
$('<link rel="stylesheet" />').insertBefore(parent).attr({
|
467
|
-
href: src
|
468
|
-
});
|
469
|
-
};
|
470
|
-
})(),
|
471
|
-
|
472
|
-
loadScript: (function(){
|
473
|
-
var loadedSrcs = [];
|
474
|
-
var scriptLoader;
|
475
|
-
return function(src, callback, name){
|
476
|
-
|
477
|
-
src = loader.makePath(src);
|
478
|
-
if ($.inArray(src, loadedSrcs) != -1) {return;}
|
479
|
-
var complete = function(){
|
480
|
-
|
481
|
-
complete = null;
|
482
|
-
if (callback) {
|
483
|
-
callback();
|
484
|
-
}
|
485
|
-
|
486
|
-
if (name) {
|
487
|
-
if (typeof name == 'string') {
|
488
|
-
name = name.split(' ');
|
489
|
-
}
|
490
|
-
$.each(name, function(i, name){
|
491
|
-
if (!modules[name]) {
|
492
|
-
return;
|
493
|
-
}
|
494
|
-
if (modules[name].afterLoad) {
|
495
|
-
modules[name].afterLoad();
|
496
|
-
}
|
497
|
-
isReady(!modules[name].noAutoCallback ? name : name + 'FileLoaded', true);
|
498
|
-
});
|
499
|
-
|
500
|
-
}
|
501
|
-
};
|
502
|
-
|
503
|
-
loadedSrcs.push(src);
|
504
|
-
if(window.require){
|
505
|
-
require([src], complete);
|
506
|
-
} else if (window.sssl) {
|
507
|
-
sssl(src, complete);
|
508
|
-
} else if (window.yepnope) {
|
509
|
-
yepnope.injectJs(src, complete);
|
510
|
-
} else if (window.steal) {
|
511
|
-
steal(src).then(complete);
|
512
|
-
}
|
513
|
-
};
|
514
|
-
})()
|
515
|
-
}
|
516
|
-
};
|
517
|
-
|
518
|
-
/*
|
519
|
-
* shortcuts
|
520
|
-
*/
|
521
|
-
$.webshims = webshims;
|
522
|
-
var protocol = (location.protocol == 'https:') ? 'https://' : 'http://';
|
523
|
-
var googleAPIs = protocol + 'ajax.googleapis.com/ajax/libs/';
|
524
|
-
var uiLib = googleAPIs + 'jqueryui/1.8.24/';
|
525
|
-
var webCFG = webshims.cfg;
|
526
|
-
var webshimsFeatures = webshims.features;
|
527
|
-
var isReady = webshims.isReady;
|
528
|
-
var onReady = webshims.ready;
|
529
|
-
var addPolyfill = webshims.addPolyfill;
|
530
|
-
var modules = webshims.modules;
|
531
|
-
var loader = webshims.loader;
|
532
|
-
var loadList = loader.loadList;
|
533
|
-
var addModule = loader.addModule;
|
534
|
-
var bugs = webshims.bugs;
|
535
|
-
var removeCombos = [];
|
536
|
-
var importantLogs = {
|
537
|
-
warn: 1,
|
538
|
-
error: 1
|
539
|
-
};
|
540
|
-
|
541
|
-
webshims.addMethodName = function(name){
|
542
|
-
name = name.split(':');
|
543
|
-
var prop = name[1];
|
544
|
-
if (name.length == 1) {
|
545
|
-
prop = name[0];
|
546
|
-
name = name[0];
|
547
|
-
} else {
|
548
|
-
name = name[0];
|
549
|
-
}
|
550
|
-
|
551
|
-
$.fn[name] = function(){
|
552
|
-
return this.callProp(prop, arguments);
|
553
|
-
};
|
554
|
-
};
|
555
|
-
$.fn.callProp = function(prop, args){
|
556
|
-
var ret;
|
557
|
-
if(!args){
|
558
|
-
args = [];
|
559
|
-
}
|
560
|
-
this.each(function(){
|
561
|
-
var fn = $.prop(this, prop);
|
562
|
-
|
563
|
-
if (fn && fn.apply) {
|
564
|
-
ret = fn.apply(this, args);
|
565
|
-
if (ret !== undefined) {
|
566
|
-
return false;
|
567
|
-
}
|
568
|
-
} else {
|
569
|
-
webshims.warn(prop+ " is not a method of "+ this);
|
570
|
-
}
|
571
|
-
});
|
572
|
-
return (ret !== undefined) ? ret : this;
|
573
|
-
};
|
574
|
-
|
575
|
-
//activeLang will be overridden
|
576
|
-
|
577
|
-
|
578
|
-
// set current Lang:
|
579
|
-
// - webshims.activeLang(lang:string);
|
580
|
-
// get current lang
|
581
|
-
// - webshims.activeLang();
|
582
|
-
// - webshims.activeLang({
|
583
|
-
// module: moduleName:string,
|
584
|
-
// callback: callback:function,
|
585
|
-
// langObj: languageObj:array/object
|
586
|
-
// });
|
587
|
-
|
588
|
-
webshims.activeLang = (function(){
|
589
|
-
var curLang = navigator.browserLanguage || navigator.language || '';
|
590
|
-
onReady('webshimLocalization', function(){
|
591
|
-
webshims.activeLang(curLang);
|
592
|
-
|
593
|
-
});
|
594
|
-
return function(lang){
|
595
|
-
if(lang){
|
596
|
-
if (typeof lang == 'string' ) {
|
597
|
-
curLang = lang;
|
598
|
-
} else if(typeof lang == 'object'){
|
599
|
-
var args = arguments;
|
600
|
-
var that = this;
|
601
|
-
onReady('webshimLocalization', function(){
|
602
|
-
webshims.activeLang.apply(that, args);
|
603
|
-
});
|
604
|
-
}
|
605
|
-
}
|
606
|
-
return curLang;
|
607
|
-
};
|
608
|
-
})();
|
609
|
-
|
610
|
-
$.each(['log', 'error', 'warn', 'info'], function(i, fn){
|
611
|
-
webshims[fn] = function(message){
|
612
|
-
if(( (importantLogs[fn] && webshims.debug !== false) || webshims.debug) && window.console && console.log){
|
613
|
-
return console[(console[fn]) ? fn : 'log'](message);
|
614
|
-
}
|
615
|
-
};
|
616
|
-
});
|
617
|
-
|
618
|
-
|
619
|
-
//Overwrite DOM-Ready and implement a new ready-method
|
620
|
-
(function(){
|
621
|
-
$.isDOMReady = $.isReady;
|
622
|
-
if(!$.isDOMReady){
|
623
|
-
var $Ready = $.ready;
|
624
|
-
$.ready = function(unwait){
|
625
|
-
if(unwait !== true && !$.isDOMReady){
|
626
|
-
if(document.body){
|
627
|
-
$.isDOMReady = true;
|
628
|
-
isReady('DOM', true);
|
629
|
-
$.ready = $Ready;
|
630
|
-
} else {
|
631
|
-
setTimeout(function(){
|
632
|
-
$.ready(unwait);
|
633
|
-
}, 13);
|
634
|
-
}
|
635
|
-
}
|
636
|
-
return $Ready.apply(this, arguments);
|
637
|
-
};
|
638
|
-
$.ready.promise = $Ready.promise;
|
639
|
-
} else {
|
640
|
-
isReady('DOM', true);
|
641
|
-
}
|
642
|
-
$(function(){
|
643
|
-
$.isDOMReady = true;
|
644
|
-
isReady('DOM', true);
|
645
|
-
setTimeout(function(){
|
646
|
-
isReady('WINDOWLOAD', true);
|
647
|
-
}, 9999);
|
648
|
-
});
|
649
|
-
$(window).load(function(){
|
650
|
-
$.isDOMReady = true;
|
651
|
-
isReady('DOM', true);
|
652
|
-
isReady('WINDOWLOAD', true);
|
653
|
-
});
|
654
|
-
})();
|
655
|
-
|
656
|
-
/*
|
657
|
-
* jQuery-plugins for triggering dom updates can be also very usefull in conjunction with non-HTML5 DOM-Changes (AJAX)
|
658
|
-
* Example:
|
659
|
-
* $.webshims.addReady(function(context, insertedElement){
|
660
|
-
* $('div.tabs', context).add(insertedElement.filter('div.tabs')).tabs();
|
661
|
-
* });
|
662
|
-
*
|
663
|
-
* $.ajax({
|
664
|
-
* success: function(html){
|
665
|
-
* $('#main').htmlPolyfill(html);
|
666
|
-
* }
|
667
|
-
* });
|
668
|
-
*/
|
669
|
-
|
670
|
-
(function(){
|
671
|
-
var readyFns = [];
|
672
|
-
$.extend(webshims, {
|
673
|
-
addReady: function(fn){
|
674
|
-
var readyFn = function(context, elem){
|
675
|
-
webshims.ready('DOM', function(){fn(context, elem);});
|
676
|
-
};
|
677
|
-
readyFns.push(readyFn);
|
678
|
-
readyFn(document, emptyJ);
|
679
|
-
},
|
680
|
-
triggerDomUpdate: function(context){
|
681
|
-
if(!context || !context.nodeType){
|
682
|
-
if(context && context.jquery){
|
683
|
-
context.each(function(){
|
684
|
-
webshims.triggerDomUpdate(this);
|
685
|
-
});
|
686
|
-
}
|
687
|
-
return;
|
688
|
-
}
|
689
|
-
var type = context.nodeType;
|
690
|
-
if(type != 1 && type != 9){return;}
|
691
|
-
var elem = (context !== document) ? $(context) : emptyJ;
|
692
|
-
$.each(readyFns, function(i, fn){
|
693
|
-
fn(context, elem);
|
694
|
-
});
|
695
|
-
}
|
696
|
-
});
|
697
|
-
|
698
|
-
$.fn.htmlPolyfill = function(a){
|
699
|
-
var ret = $.fn.html.call(this, a);
|
700
|
-
if(ret === this && $.isDOMReady){
|
701
|
-
this.each(function(){
|
702
|
-
if(this.nodeType == 1){
|
703
|
-
webshims.triggerDomUpdate(this);
|
704
|
-
}
|
705
|
-
});
|
706
|
-
}
|
707
|
-
return ret;
|
708
|
-
};
|
709
|
-
|
710
|
-
|
711
|
-
$.each(['after', 'before', 'append', 'prepend', 'replaceWith'], function(i, name){
|
712
|
-
$.fn[name+'Polyfill'] = function(a){
|
713
|
-
a = $(a);
|
714
|
-
$.fn[name].call(this, a);
|
715
|
-
if($.isDOMReady){
|
716
|
-
a.each(function(){
|
717
|
-
if (this.nodeType == 1) {
|
718
|
-
webshims.triggerDomUpdate(this);
|
719
|
-
}
|
720
|
-
});
|
721
|
-
}
|
722
|
-
return this;
|
723
|
-
};
|
724
|
-
|
725
|
-
});
|
726
|
-
|
727
|
-
$.each(['insertAfter', 'insertBefore', 'appendTo', 'prependTo', 'replaceAll'], function(i, name){
|
728
|
-
$.fn[name.replace(/[A-Z]/, function(c){return "Polyfill"+c;})] = function(){
|
729
|
-
$.fn[name].apply(this, arguments);
|
730
|
-
if($.isDOMReady){
|
731
|
-
webshims.triggerDomUpdate(this);
|
732
|
-
}
|
733
|
-
return this;
|
734
|
-
};
|
735
|
-
});
|
736
|
-
|
737
|
-
$.fn.updatePolyfill = function(){
|
738
|
-
if($.isDOMReady){
|
739
|
-
webshims.triggerDomUpdate(this);
|
740
|
-
}
|
741
|
-
return this;
|
742
|
-
};
|
743
|
-
|
744
|
-
$.each(['getNativeElement', 'getShadowElement', 'getShadowFocusElement'], function(i, name){
|
745
|
-
$.fn[name] = function(){
|
746
|
-
return this;
|
747
|
-
};
|
748
|
-
});
|
749
|
-
|
750
|
-
})();
|
751
|
-
|
752
|
-
//this might be extended by ES5 shim feature
|
753
|
-
(function(){
|
754
|
-
var defineProperty = 'defineProperty';
|
755
|
-
var has = Object.prototype.hasOwnProperty;
|
756
|
-
var descProps = ['configurable', 'enumerable', 'writable'];
|
757
|
-
var extendUndefined = function(prop){
|
758
|
-
for(var i = 0; i < 3; i++){
|
759
|
-
if(prop[descProps[i]] === undefined && (descProps[i] !== 'writable' || prop.value !== undefined)){
|
760
|
-
prop[descProps[i]] = true;
|
761
|
-
}
|
762
|
-
}
|
763
|
-
};
|
764
|
-
var extendProps = function(props){
|
765
|
-
if(props){
|
766
|
-
for(var i in props){
|
767
|
-
if(has.call(props, i)){
|
768
|
-
extendUndefined(props[i]);
|
769
|
-
}
|
770
|
-
}
|
771
|
-
}
|
772
|
-
};
|
773
|
-
if(Object.create){
|
774
|
-
webshims.objectCreate = function(proto, props, opts){
|
775
|
-
extendProps(props);
|
776
|
-
var o = Object.create(proto, props);
|
777
|
-
if(opts){
|
778
|
-
o.options = $.extend(true, {}, o.options || {}, opts);
|
779
|
-
opts = o.options;
|
780
|
-
}
|
781
|
-
if(o._create && $.isFunction(o._create)){
|
782
|
-
o._create(opts);
|
783
|
-
}
|
784
|
-
return o;
|
785
|
-
};
|
786
|
-
}
|
787
|
-
if(Object[defineProperty]){
|
788
|
-
webshims[defineProperty] = function(obj, prop, desc){
|
789
|
-
extendUndefined(desc);
|
790
|
-
return Object[defineProperty](obj, prop, desc);
|
791
|
-
};
|
792
|
-
}
|
793
|
-
if(Object.defineProperties){
|
794
|
-
webshims.defineProperties = function(obj, props){
|
795
|
-
extendProps(props);
|
796
|
-
return Object.defineProperties(obj, props);
|
797
|
-
};
|
798
|
-
}
|
799
|
-
webshims.getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
800
|
-
|
801
|
-
webshims.getPrototypeOf = Object.getPrototypeOf;
|
802
|
-
})();
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
/*
|
808
|
-
* Start Features
|
809
|
-
*/
|
810
|
-
|
811
|
-
/* general modules */
|
812
|
-
/* change path $.webshims.modules[moduleName].src */
|
813
|
-
|
814
|
-
addModule('jquery-ui', {
|
815
|
-
src: uiLib+'jquery-ui.min.js',
|
816
|
-
test: function(){return !!($.widget && $.Widget);}
|
817
|
-
});
|
818
|
-
|
819
|
-
addModule('input-widgets', {
|
820
|
-
src: '',
|
821
|
-
test: function(){
|
822
|
-
return !this.src || !($.widget && !($.fn.datepicker && $.fn.slider));
|
823
|
-
}
|
824
|
-
});
|
825
|
-
|
826
|
-
addModule('swfobject', {
|
827
|
-
src: googleAPIs+'swfobject/2.2/swfobject.js',
|
828
|
-
test: function(){return ('swfobject' in window);}
|
829
|
-
});
|
830
|
-
|
831
|
-
|
832
|
-
/*
|
833
|
-
* polyfill-Modules
|
834
|
-
*/
|
835
|
-
|
836
|
-
// webshims lib uses a of http://github.com/kriskowal/es5-shim/ to implement
|
837
|
-
addPolyfill('es5', {
|
838
|
-
test: !!(Modernizr.ES5 && Function.prototype.bind),
|
839
|
-
c: [27, 10, 1, 22]
|
840
|
-
});
|
841
|
-
|
842
|
-
addPolyfill('dom-extend', {
|
843
|
-
f: DOMSUPPORT,
|
844
|
-
noAutoCallback: true,
|
845
|
-
d: ['es5'],
|
846
|
-
c: [27, 10, 9, 12, 17, 26, 16, 25, 8, 1, 24, 19, 11, 13]
|
847
|
-
});
|
848
|
-
|
849
|
-
|
850
|
-
//<localstorage
|
851
|
-
needModernizr('localstorage');
|
852
|
-
addPolyfill('json-storage', {
|
853
|
-
test: Modernizr.localstorage && 'sessionStorage' in window && 'JSON' in window,
|
854
|
-
loadInit: function(){
|
855
|
-
loadList(['swfobject']);
|
856
|
-
},
|
857
|
-
noAutoCallback: true,
|
858
|
-
c: [14]
|
859
|
-
});
|
860
|
-
//>localstorage
|
861
|
-
|
862
|
-
|
863
|
-
//<geolocation
|
864
|
-
needModernizr('geolocation');
|
865
|
-
addPolyfill('geolocation', {
|
866
|
-
test: Modernizr.geolocation,
|
867
|
-
options: {
|
868
|
-
destroyWrite: true
|
869
|
-
// ,confirmText: ''
|
870
|
-
},
|
871
|
-
d: ['json-storage'],
|
872
|
-
c: [14, 15]
|
873
|
-
});
|
874
|
-
//>
|
875
|
-
|
876
|
-
//<canvas
|
877
|
-
needModernizr('canvas', function(){
|
878
|
-
var flashCanvas;
|
879
|
-
addPolyfill('canvas', {
|
880
|
-
src: 'excanvas',
|
881
|
-
test: Modernizr.canvas,
|
882
|
-
options: {type: 'flash'}, //excanvas | flash | flashpro
|
883
|
-
noAutoCallback: true,
|
884
|
-
loadInit: function(){
|
885
|
-
var type = this.options.type;
|
886
|
-
var src;
|
887
|
-
if(type && type.indexOf('flash') !== -1 && (!window.swfobject || swfobject.hasFlashPlayerVersion('9.0.0'))){
|
888
|
-
window.FlashCanvasOptions = window.FlashCanvasOptions || {};
|
889
|
-
flashCanvas = FlashCanvasOptions;
|
890
|
-
if(type == 'flash'){
|
891
|
-
$.extend(flashCanvas, {
|
892
|
-
swfPath: webCFG.basePath + 'FlashCanvas/'
|
893
|
-
});
|
894
|
-
this.src = 'FlashCanvas/flashcanvas';
|
895
|
-
src = flashCanvas.swfPath + 'flashcanvas.swf';
|
896
|
-
} else {
|
897
|
-
$.extend(flashCanvas, {swfPath: webCFG.basePath + 'FlashCanvasPro/'});
|
898
|
-
this.src = 'FlashCanvasPro/flashcanvas';
|
899
|
-
//assume, that the user has flash10+
|
900
|
-
src = flashCanvas.swfPath + 'flash10canvas.swf';
|
901
|
-
}
|
902
|
-
//todo: implement cachbuster for flashcanvas
|
903
|
-
// if(webCFG.addCacheBuster){
|
904
|
-
// src += webCFG.addCacheBuster;
|
905
|
-
// }
|
906
|
-
}
|
907
|
-
},
|
908
|
-
afterLoad: function(){
|
909
|
-
webshims.addReady(function(context, elem){
|
910
|
-
if(context == document){
|
911
|
-
if(window.G_vmlCanvasManager && G_vmlCanvasManager.init_ ){
|
912
|
-
G_vmlCanvasManager.init_(document);
|
913
|
-
}
|
914
|
-
}
|
915
|
-
$('canvas', context).add(elem.filter('canvas')).each(function(){
|
916
|
-
var hasContext = this.getContext;
|
917
|
-
if(!hasContext && window.G_vmlCanvasManager){
|
918
|
-
G_vmlCanvasManager.initElement(this);
|
919
|
-
}
|
920
|
-
});
|
921
|
-
if(context == document){
|
922
|
-
isReady('canvas', true);
|
923
|
-
}
|
924
|
-
});
|
925
|
-
},
|
926
|
-
methodNames: ['getContext'],
|
927
|
-
d: [DOMSUPPORT]
|
928
|
-
});
|
929
|
-
});
|
930
|
-
//>
|
931
|
-
|
932
|
-
|
933
|
-
//<forms
|
934
|
-
needModernizr('input inputtypes', function(){
|
935
|
-
var modernizrInputAttrs = Modernizr.input;
|
936
|
-
var modernizrInputTypes = Modernizr.inputtypes;
|
937
|
-
var formvalidation = 'formvalidation';
|
938
|
-
var
|
939
|
-
var
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
addTest(
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
}
|
1001
|
-
|
1002
|
-
|
1003
|
-
}
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
}
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
if(
|
1091
|
-
return false;
|
1092
|
-
}
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
override
|
1141
|
-
},
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
//>
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
if(asyncWebshims.
|
1182
|
-
webshims.
|
1183
|
-
}
|
1184
|
-
if(asyncWebshims
|
1185
|
-
webshims.
|
1186
|
-
}
|
1187
|
-
|
1188
|
-
|
1189
|
-
}
|
1190
|
-
}
|
1191
|
-
}));
|
1
|
+
(function (factory) {
|
2
|
+
|
3
|
+
if(window.jQuery){
|
4
|
+
factory(jQuery);
|
5
|
+
factory = jQuery.noop;
|
6
|
+
}
|
7
|
+
if (typeof define === 'function' && define.amd && define.amd.jQuery) {
|
8
|
+
define('polyfiller', ['jquery'], factory);
|
9
|
+
}
|
10
|
+
}(function($){
|
11
|
+
"use strict";
|
12
|
+
var DOMSUPPORT = 'dom-support';
|
13
|
+
var jScripts = $(document.scripts || 'script');
|
14
|
+
var special = $.event.special;
|
15
|
+
var emptyJ = $([]);
|
16
|
+
var Modernizr = window.Modernizr;
|
17
|
+
var asyncWebshims = window.asyncWebshims;
|
18
|
+
var addTest = Modernizr.addTest;
|
19
|
+
var browserVersion = parseFloat($.browser.version, 10);
|
20
|
+
var Object = window.Object;
|
21
|
+
var html5 = window.html5 || {};
|
22
|
+
var needModernizr = function(tests, fn){
|
23
|
+
var run = true;
|
24
|
+
$.each(tests.split(' '), function(i, name){
|
25
|
+
if(!(name in Modernizr)){
|
26
|
+
webshims.error('webshims needs Modernizr.'+name + ' to implement feature.');
|
27
|
+
run = false;
|
28
|
+
}
|
29
|
+
});
|
30
|
+
if(run && fn){
|
31
|
+
fn();
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
Modernizr.advancedObjectProperties = Modernizr.objectAccessor = Modernizr.ES5 = !!('create' in Object && 'seal' in Object);
|
36
|
+
|
37
|
+
|
38
|
+
var webshims = {
|
39
|
+
version: '1.9.4',
|
40
|
+
cfg: {
|
41
|
+
useImportantStyles: true,
|
42
|
+
//addCacheBuster: false,
|
43
|
+
waitReady: true,
|
44
|
+
extendNative: true,
|
45
|
+
loadStyles: true,
|
46
|
+
disableShivMethods: true,
|
47
|
+
basePath: (function(){
|
48
|
+
var script = jScripts.filter('[src*="polyfiller.js"]');
|
49
|
+
var path;
|
50
|
+
script = script[0] || script.end()[script.end().length - 1];
|
51
|
+
path = ( ($.support.hrefNormalized) ? script.src : script.getAttribute("src", 4) ).split('?')[0];
|
52
|
+
path = path.slice(0, path.lastIndexOf("/") + 1) + 'shims/';
|
53
|
+
return path;
|
54
|
+
})()
|
55
|
+
},
|
56
|
+
bugs: {},
|
57
|
+
browserVersion: browserVersion,
|
58
|
+
/*
|
59
|
+
* some data
|
60
|
+
*/
|
61
|
+
modules: {},
|
62
|
+
features: {},
|
63
|
+
featureList: [],
|
64
|
+
setOptions: function(name, opts){
|
65
|
+
if (typeof name == 'string' && opts !== undefined) {
|
66
|
+
webCFG[name] = (!$.isPlainObject(opts)) ? opts : $.extend(true, webCFG[name] || {}, opts);
|
67
|
+
} else if (typeof name == 'object') {
|
68
|
+
$.extend(true, webCFG, name);
|
69
|
+
}
|
70
|
+
},
|
71
|
+
addPolyfill: function(name, cfg){
|
72
|
+
cfg = cfg || {};
|
73
|
+
var feature = cfg.f || name;
|
74
|
+
if (!webshimsFeatures[feature]) {
|
75
|
+
webshimsFeatures[feature] = [];
|
76
|
+
webshimsFeatures[feature].delayReady = 0;
|
77
|
+
webshims.featureList.push(feature);
|
78
|
+
webCFG[feature] = {};
|
79
|
+
}
|
80
|
+
webshimsFeatures[feature].push(name);
|
81
|
+
cfg.options = $.extend(webCFG[feature], cfg.options);
|
82
|
+
|
83
|
+
addModule(name, cfg);
|
84
|
+
if (cfg.methodNames) {
|
85
|
+
$.each(cfg.methodNames, function(i, methodName){
|
86
|
+
webshims.addMethodName(methodName);
|
87
|
+
});
|
88
|
+
}
|
89
|
+
},
|
90
|
+
|
91
|
+
polyfill: (function(){
|
92
|
+
var firstPolyfillCall = function(features){
|
93
|
+
var addClass = [];
|
94
|
+
var onReadyEvts = features;
|
95
|
+
var timer;
|
96
|
+
|
97
|
+
if(webCFG.disableShivMethods){
|
98
|
+
html5.shivMethods = false;
|
99
|
+
}
|
100
|
+
|
101
|
+
var removeLoader = function(){
|
102
|
+
$('html').removeClass('loading-polyfills long-loading-polyfills');
|
103
|
+
$(window).unbind('.lP');
|
104
|
+
clearTimeout(timer);
|
105
|
+
};
|
106
|
+
|
107
|
+
$(window).on('load.lP error.lP', removeLoader);
|
108
|
+
|
109
|
+
addClass.push('loading-polyfills');
|
110
|
+
timer = setTimeout(function(){
|
111
|
+
$('html').addClass('long-loading-polyfills');
|
112
|
+
}, 600);
|
113
|
+
|
114
|
+
if (webCFG.waitReady && $.isReady) {
|
115
|
+
webshims.warn('Call webshims.polyfill before DOM-Ready or set waitReady to false.');
|
116
|
+
}
|
117
|
+
onReady(features, removeLoader);
|
118
|
+
if (webCFG.useImportantStyles) {
|
119
|
+
addClass.push('polyfill-important');
|
120
|
+
}
|
121
|
+
if (addClass[0]) {
|
122
|
+
$('html').addClass(addClass.join(' '));
|
123
|
+
}
|
124
|
+
if(webCFG.loadStyles){
|
125
|
+
loader.loadCSS('styles/shim.css');
|
126
|
+
}
|
127
|
+
//remove function
|
128
|
+
firstPolyfillCall = $.noop;
|
129
|
+
};
|
130
|
+
var loadedFormBase;
|
131
|
+
return function(features){
|
132
|
+
|
133
|
+
var toLoadFeatures = [];
|
134
|
+
|
135
|
+
features = features || webshims.featureList;
|
136
|
+
|
137
|
+
if (typeof features == 'string') {
|
138
|
+
features = features.split(' ');
|
139
|
+
}
|
140
|
+
if(!loadedFormBase){
|
141
|
+
loadedFormBase = $.inArray('forms', features) !== -1;
|
142
|
+
if(!loadedFormBase && $.inArray('forms-ext', features) !== -1){
|
143
|
+
features.push('forms');
|
144
|
+
loadedFormBase = true;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
if (webCFG.waitReady) {
|
149
|
+
$.readyWait++;
|
150
|
+
onReady(features, function(){
|
151
|
+
$.ready(true);
|
152
|
+
});
|
153
|
+
}
|
154
|
+
|
155
|
+
$.each(features, function(i, feature){
|
156
|
+
if(!webshimsFeatures[feature]){
|
157
|
+
webshims.error("could not find webshims-feature (aborted): "+ feature);
|
158
|
+
isReady(feature, true);
|
159
|
+
return;
|
160
|
+
}
|
161
|
+
if (feature !== webshimsFeatures[feature][0]) {
|
162
|
+
onReady(webshimsFeatures[feature], function(){
|
163
|
+
isReady(feature, true);
|
164
|
+
});
|
165
|
+
}
|
166
|
+
toLoadFeatures = toLoadFeatures.concat(webshimsFeatures[feature]);
|
167
|
+
});
|
168
|
+
|
169
|
+
firstPolyfillCall(features);
|
170
|
+
loadList(toLoadFeatures);
|
171
|
+
|
172
|
+
};
|
173
|
+
})(),
|
174
|
+
|
175
|
+
/*
|
176
|
+
* handle ready modules
|
177
|
+
*/
|
178
|
+
reTest: (function(){
|
179
|
+
var resList;
|
180
|
+
var noDelayReady;
|
181
|
+
var reTest = function(i, name){
|
182
|
+
var module = modules[name];
|
183
|
+
var readyName = name+'Ready';
|
184
|
+
var feature;
|
185
|
+
if(module && !module.loaded && !( (module.test && $.isFunction(module.test) ) ? module.test([]) : module.test )){
|
186
|
+
if(special[readyName]){
|
187
|
+
delete special[readyName];
|
188
|
+
}
|
189
|
+
feature = webshimsFeatures[module.f];
|
190
|
+
if(feature && !noDelayReady){
|
191
|
+
feature.delayReady++;
|
192
|
+
onReady(name, function(){
|
193
|
+
feature.delayReady--;
|
194
|
+
isReady(module.f, feature.callReady);
|
195
|
+
});
|
196
|
+
}
|
197
|
+
resList.push(name);
|
198
|
+
}
|
199
|
+
};
|
200
|
+
return function(moduleNames, _noDelay){
|
201
|
+
noDelayReady = _noDelay;
|
202
|
+
if(typeof moduleNames == 'string'){
|
203
|
+
moduleNames = moduleNames.split(' ');
|
204
|
+
}
|
205
|
+
resList = [];
|
206
|
+
$.each(moduleNames, reTest);
|
207
|
+
loadList(resList);
|
208
|
+
};
|
209
|
+
})(),
|
210
|
+
isReady: function(name, _set){
|
211
|
+
if(webshimsFeatures[name] && webshimsFeatures[name].delayReady > 0){
|
212
|
+
if(_set){
|
213
|
+
webshimsFeatures[name].callReady = true;
|
214
|
+
}
|
215
|
+
return false;
|
216
|
+
}
|
217
|
+
name = name + 'Ready';
|
218
|
+
if (_set) {
|
219
|
+
if (special[name] && special[name].add) {
|
220
|
+
return true;
|
221
|
+
}
|
222
|
+
|
223
|
+
special[name] = $.extend(special[name] || {}, {
|
224
|
+
add: function(details){
|
225
|
+
details.handler.call(this, name);
|
226
|
+
}
|
227
|
+
});
|
228
|
+
$.event.trigger(name);
|
229
|
+
}
|
230
|
+
return !!(special[name] && special[name].add) || false;
|
231
|
+
},
|
232
|
+
ready: function(events, fn /*, _created*/){
|
233
|
+
var _created = arguments[2];
|
234
|
+
var evt = events;
|
235
|
+
if (typeof events == 'string') {
|
236
|
+
events = events.split(' ');
|
237
|
+
}
|
238
|
+
|
239
|
+
if (!_created) {
|
240
|
+
events = $.map($.grep(events, function(evt){
|
241
|
+
return !isReady(evt);
|
242
|
+
}), function(evt){
|
243
|
+
return evt + 'Ready';
|
244
|
+
});
|
245
|
+
}
|
246
|
+
if (!events.length) {
|
247
|
+
fn($, webshims, window, document);
|
248
|
+
return;
|
249
|
+
}
|
250
|
+
var readyEv = events.shift(), readyFn = function(){
|
251
|
+
onReady(events, fn, true);
|
252
|
+
};
|
253
|
+
|
254
|
+
$(document).one(readyEv, readyFn);
|
255
|
+
},
|
256
|
+
|
257
|
+
/*
|
258
|
+
* basic DOM-/jQuery-Helpers
|
259
|
+
*/
|
260
|
+
|
261
|
+
|
262
|
+
capturingEvents: function(names, _maybePrevented){
|
263
|
+
if (!document.addEventListener) {
|
264
|
+
return;
|
265
|
+
}
|
266
|
+
if (typeof names == 'string') {
|
267
|
+
names = [names];
|
268
|
+
}
|
269
|
+
$.each(names, function(i, name){
|
270
|
+
var handler = function(e){
|
271
|
+
e = $.event.fix(e);
|
272
|
+
if (_maybePrevented && webshims.capturingEventPrevented) {
|
273
|
+
webshims.capturingEventPrevented(e);
|
274
|
+
}
|
275
|
+
return $.event.handle.call(this, e);
|
276
|
+
};
|
277
|
+
special[name] = special[name] || {};
|
278
|
+
if (special[name].setup || special[name].teardown) {
|
279
|
+
return;
|
280
|
+
}
|
281
|
+
$.extend(special[name], {
|
282
|
+
setup: function(){
|
283
|
+
this.addEventListener(name, handler, true);
|
284
|
+
},
|
285
|
+
teardown: function(){
|
286
|
+
this.removeEventListener(name, handler, true);
|
287
|
+
}
|
288
|
+
});
|
289
|
+
});
|
290
|
+
},
|
291
|
+
register: function(name, fn){
|
292
|
+
var module = modules[name];
|
293
|
+
if (!module) {
|
294
|
+
webshims.error("can't find module: " + name);
|
295
|
+
return;
|
296
|
+
}
|
297
|
+
if (module.noAutoCallback) {
|
298
|
+
var ready = function(){
|
299
|
+
fn($, webshims, window, document, undefined, module.options);
|
300
|
+
isReady(name, true);
|
301
|
+
};
|
302
|
+
if (module.d) {
|
303
|
+
onReady(module.d, ready);
|
304
|
+
}
|
305
|
+
else {
|
306
|
+
ready();
|
307
|
+
}
|
308
|
+
}
|
309
|
+
},
|
310
|
+
c: {},
|
311
|
+
/*
|
312
|
+
* loader
|
313
|
+
*/
|
314
|
+
loader: {
|
315
|
+
|
316
|
+
addModule: function(name, ext){
|
317
|
+
modules[name] = ext;
|
318
|
+
ext.name = ext.name || name;
|
319
|
+
if(!ext.c){
|
320
|
+
ext.c = [];
|
321
|
+
}
|
322
|
+
$.each(ext.c, function(i, comboname){
|
323
|
+
if(!webshims.c[comboname]){
|
324
|
+
webshims.c[comboname] = [];
|
325
|
+
}
|
326
|
+
webshims.c[comboname].push(name);
|
327
|
+
});
|
328
|
+
},
|
329
|
+
loadList: (function(){
|
330
|
+
|
331
|
+
var loadedModules = [];
|
332
|
+
var loadScript = function(src, names){
|
333
|
+
if (typeof names == 'string') {
|
334
|
+
names = [names];
|
335
|
+
}
|
336
|
+
$.merge(loadedModules, names);
|
337
|
+
loader.loadScript(src, false, names);
|
338
|
+
};
|
339
|
+
|
340
|
+
var noNeedToLoad = function(name, list){
|
341
|
+
if (isReady(name) || $.inArray(name, loadedModules) != -1) {
|
342
|
+
return true;
|
343
|
+
}
|
344
|
+
var module = modules[name];
|
345
|
+
var cfg = webCFG[module.f || name] || {};
|
346
|
+
var supported;
|
347
|
+
if (module) {
|
348
|
+
supported = (module.test && $.isFunction(module.test)) ? module.test(list) : module.test;
|
349
|
+
if (supported) {
|
350
|
+
isReady(name, true);
|
351
|
+
return true;
|
352
|
+
} else {
|
353
|
+
return false;
|
354
|
+
}
|
355
|
+
}
|
356
|
+
return true;
|
357
|
+
};
|
358
|
+
|
359
|
+
var setDependencies = function(module, list){
|
360
|
+
if (module.d && module.d.length) {
|
361
|
+
var addDependency = function(i, dependency){
|
362
|
+
if (!noNeedToLoad(dependency, list) && $.inArray(dependency, list) == -1) {
|
363
|
+
list.push(dependency);
|
364
|
+
}
|
365
|
+
};
|
366
|
+
$.each(module.d, function(i, dependency){
|
367
|
+
if (modules[dependency]) {
|
368
|
+
addDependency(i, dependency);
|
369
|
+
}
|
370
|
+
else
|
371
|
+
if (webshimsFeatures[dependency]) {
|
372
|
+
$.each(webshimsFeatures[dependency], addDependency);
|
373
|
+
onReady(webshimsFeatures[dependency], function(){
|
374
|
+
isReady(dependency, true);
|
375
|
+
});
|
376
|
+
}
|
377
|
+
});
|
378
|
+
if (!module.noAutoCallback) {
|
379
|
+
module.noAutoCallback = true;
|
380
|
+
}
|
381
|
+
}
|
382
|
+
};
|
383
|
+
|
384
|
+
return function(list, combo){
|
385
|
+
var module;
|
386
|
+
var loadCombos = [];
|
387
|
+
var i;
|
388
|
+
var len;
|
389
|
+
var foundCombo;
|
390
|
+
var loadCombo = function(j, combo){
|
391
|
+
foundCombo = combo;
|
392
|
+
$.each(webshims.c[combo], function(i, moduleName){
|
393
|
+
if($.inArray(moduleName, loadCombos) == -1 || $.inArray(moduleName, loadedModules) != -1){
|
394
|
+
foundCombo = false;
|
395
|
+
return false;
|
396
|
+
}
|
397
|
+
});
|
398
|
+
if(foundCombo){
|
399
|
+
loadScript('combos/'+foundCombo, webshims.c[foundCombo]);
|
400
|
+
return false;
|
401
|
+
}
|
402
|
+
};
|
403
|
+
|
404
|
+
//length of list is dynamically
|
405
|
+
for (i = 0; i < list.length; i++) {
|
406
|
+
module = modules[list[i]];
|
407
|
+
if (!module || noNeedToLoad(module.name, list)) {
|
408
|
+
if (!module) {
|
409
|
+
webshims.warn('could not find: ' + list[i]);
|
410
|
+
}
|
411
|
+
continue;
|
412
|
+
}
|
413
|
+
if (module.css) {
|
414
|
+
loader.loadCSS(module.css);
|
415
|
+
}
|
416
|
+
|
417
|
+
if (module.loadInit) {
|
418
|
+
module.loadInit();
|
419
|
+
}
|
420
|
+
|
421
|
+
module.loaded = true;
|
422
|
+
setDependencies(module, list);
|
423
|
+
loadCombos.push(module.name);
|
424
|
+
}
|
425
|
+
|
426
|
+
for(i = 0, len = loadCombos.length; i < len; i++){
|
427
|
+
foundCombo = false;
|
428
|
+
|
429
|
+
module = loadCombos[i];
|
430
|
+
|
431
|
+
if($.inArray(module, loadedModules) == -1){
|
432
|
+
if(webshims.debug != 'noCombo'){
|
433
|
+
$.each(modules[module].c, loadCombo);
|
434
|
+
}
|
435
|
+
if(!foundCombo){
|
436
|
+
loadScript(modules[module].src || module, module);
|
437
|
+
}
|
438
|
+
}
|
439
|
+
}
|
440
|
+
};
|
441
|
+
})(),
|
442
|
+
|
443
|
+
makePath: function(src){
|
444
|
+
if (src.indexOf('//') != -1 || src.indexOf('/') === 0) {
|
445
|
+
return src;
|
446
|
+
}
|
447
|
+
|
448
|
+
if (src.indexOf('.') == -1) {
|
449
|
+
src += '.js';
|
450
|
+
}
|
451
|
+
if (webCFG.addCacheBuster) {
|
452
|
+
src += webCFG.addCacheBuster;
|
453
|
+
}
|
454
|
+
return webCFG.basePath + src;
|
455
|
+
},
|
456
|
+
|
457
|
+
loadCSS: (function(){
|
458
|
+
var parent, loadedSrcs = [];
|
459
|
+
return function(src){
|
460
|
+
src = this.makePath(src);
|
461
|
+
if ($.inArray(src, loadedSrcs) != -1) {
|
462
|
+
return;
|
463
|
+
}
|
464
|
+
parent = parent || $('link, style')[0] || $('script')[0];
|
465
|
+
loadedSrcs.push(src);
|
466
|
+
$('<link rel="stylesheet" />').insertBefore(parent).attr({
|
467
|
+
href: src
|
468
|
+
});
|
469
|
+
};
|
470
|
+
})(),
|
471
|
+
|
472
|
+
loadScript: (function(){
|
473
|
+
var loadedSrcs = [];
|
474
|
+
var scriptLoader;
|
475
|
+
return function(src, callback, name){
|
476
|
+
|
477
|
+
src = loader.makePath(src);
|
478
|
+
if ($.inArray(src, loadedSrcs) != -1) {return;}
|
479
|
+
var complete = function(){
|
480
|
+
|
481
|
+
complete = null;
|
482
|
+
if (callback) {
|
483
|
+
callback();
|
484
|
+
}
|
485
|
+
|
486
|
+
if (name) {
|
487
|
+
if (typeof name == 'string') {
|
488
|
+
name = name.split(' ');
|
489
|
+
}
|
490
|
+
$.each(name, function(i, name){
|
491
|
+
if (!modules[name]) {
|
492
|
+
return;
|
493
|
+
}
|
494
|
+
if (modules[name].afterLoad) {
|
495
|
+
modules[name].afterLoad();
|
496
|
+
}
|
497
|
+
isReady(!modules[name].noAutoCallback ? name : name + 'FileLoaded', true);
|
498
|
+
});
|
499
|
+
|
500
|
+
}
|
501
|
+
};
|
502
|
+
|
503
|
+
loadedSrcs.push(src);
|
504
|
+
if(window.require){
|
505
|
+
require([src], complete);
|
506
|
+
} else if (window.sssl) {
|
507
|
+
sssl(src, complete);
|
508
|
+
} else if (window.yepnope) {
|
509
|
+
yepnope.injectJs(src, complete);
|
510
|
+
} else if (window.steal) {
|
511
|
+
steal(src).then(complete);
|
512
|
+
}
|
513
|
+
};
|
514
|
+
})()
|
515
|
+
}
|
516
|
+
};
|
517
|
+
|
518
|
+
/*
|
519
|
+
* shortcuts
|
520
|
+
*/
|
521
|
+
$.webshims = webshims;
|
522
|
+
var protocol = (location.protocol == 'https:') ? 'https://' : 'http://';
|
523
|
+
var googleAPIs = protocol + 'ajax.googleapis.com/ajax/libs/';
|
524
|
+
var uiLib = googleAPIs + 'jqueryui/1.8.24/';
|
525
|
+
var webCFG = webshims.cfg;
|
526
|
+
var webshimsFeatures = webshims.features;
|
527
|
+
var isReady = webshims.isReady;
|
528
|
+
var onReady = webshims.ready;
|
529
|
+
var addPolyfill = webshims.addPolyfill;
|
530
|
+
var modules = webshims.modules;
|
531
|
+
var loader = webshims.loader;
|
532
|
+
var loadList = loader.loadList;
|
533
|
+
var addModule = loader.addModule;
|
534
|
+
var bugs = webshims.bugs;
|
535
|
+
var removeCombos = [];
|
536
|
+
var importantLogs = {
|
537
|
+
warn: 1,
|
538
|
+
error: 1
|
539
|
+
};
|
540
|
+
|
541
|
+
webshims.addMethodName = function(name){
|
542
|
+
name = name.split(':');
|
543
|
+
var prop = name[1];
|
544
|
+
if (name.length == 1) {
|
545
|
+
prop = name[0];
|
546
|
+
name = name[0];
|
547
|
+
} else {
|
548
|
+
name = name[0];
|
549
|
+
}
|
550
|
+
|
551
|
+
$.fn[name] = function(){
|
552
|
+
return this.callProp(prop, arguments);
|
553
|
+
};
|
554
|
+
};
|
555
|
+
$.fn.callProp = function(prop, args){
|
556
|
+
var ret;
|
557
|
+
if(!args){
|
558
|
+
args = [];
|
559
|
+
}
|
560
|
+
this.each(function(){
|
561
|
+
var fn = $.prop(this, prop);
|
562
|
+
|
563
|
+
if (fn && fn.apply) {
|
564
|
+
ret = fn.apply(this, args);
|
565
|
+
if (ret !== undefined) {
|
566
|
+
return false;
|
567
|
+
}
|
568
|
+
} else {
|
569
|
+
webshims.warn(prop+ " is not a method of "+ this);
|
570
|
+
}
|
571
|
+
});
|
572
|
+
return (ret !== undefined) ? ret : this;
|
573
|
+
};
|
574
|
+
|
575
|
+
//activeLang will be overridden
|
576
|
+
|
577
|
+
|
578
|
+
// set current Lang:
|
579
|
+
// - webshims.activeLang(lang:string);
|
580
|
+
// get current lang
|
581
|
+
// - webshims.activeLang();
|
582
|
+
// - webshims.activeLang({
|
583
|
+
// module: moduleName:string,
|
584
|
+
// callback: callback:function,
|
585
|
+
// langObj: languageObj:array/object
|
586
|
+
// });
|
587
|
+
|
588
|
+
webshims.activeLang = (function(){
|
589
|
+
var curLang = navigator.browserLanguage || navigator.language || '';
|
590
|
+
onReady('webshimLocalization', function(){
|
591
|
+
webshims.activeLang(curLang);
|
592
|
+
|
593
|
+
});
|
594
|
+
return function(lang){
|
595
|
+
if(lang){
|
596
|
+
if (typeof lang == 'string' ) {
|
597
|
+
curLang = lang;
|
598
|
+
} else if(typeof lang == 'object'){
|
599
|
+
var args = arguments;
|
600
|
+
var that = this;
|
601
|
+
onReady('webshimLocalization', function(){
|
602
|
+
webshims.activeLang.apply(that, args);
|
603
|
+
});
|
604
|
+
}
|
605
|
+
}
|
606
|
+
return curLang;
|
607
|
+
};
|
608
|
+
})();
|
609
|
+
|
610
|
+
$.each(['log', 'error', 'warn', 'info'], function(i, fn){
|
611
|
+
webshims[fn] = function(message){
|
612
|
+
if(( (importantLogs[fn] && webshims.debug !== false) || webshims.debug) && window.console && console.log){
|
613
|
+
return console[(console[fn]) ? fn : 'log'](message);
|
614
|
+
}
|
615
|
+
};
|
616
|
+
});
|
617
|
+
|
618
|
+
|
619
|
+
//Overwrite DOM-Ready and implement a new ready-method
|
620
|
+
(function(){
|
621
|
+
$.isDOMReady = $.isReady;
|
622
|
+
if(!$.isDOMReady){
|
623
|
+
var $Ready = $.ready;
|
624
|
+
$.ready = function(unwait){
|
625
|
+
if(unwait !== true && !$.isDOMReady){
|
626
|
+
if(document.body){
|
627
|
+
$.isDOMReady = true;
|
628
|
+
isReady('DOM', true);
|
629
|
+
$.ready = $Ready;
|
630
|
+
} else {
|
631
|
+
setTimeout(function(){
|
632
|
+
$.ready(unwait);
|
633
|
+
}, 13);
|
634
|
+
}
|
635
|
+
}
|
636
|
+
return $Ready.apply(this, arguments);
|
637
|
+
};
|
638
|
+
$.ready.promise = $Ready.promise;
|
639
|
+
} else {
|
640
|
+
isReady('DOM', true);
|
641
|
+
}
|
642
|
+
$(function(){
|
643
|
+
$.isDOMReady = true;
|
644
|
+
isReady('DOM', true);
|
645
|
+
setTimeout(function(){
|
646
|
+
isReady('WINDOWLOAD', true);
|
647
|
+
}, 9999);
|
648
|
+
});
|
649
|
+
$(window).load(function(){
|
650
|
+
$.isDOMReady = true;
|
651
|
+
isReady('DOM', true);
|
652
|
+
isReady('WINDOWLOAD', true);
|
653
|
+
});
|
654
|
+
})();
|
655
|
+
|
656
|
+
/*
|
657
|
+
* jQuery-plugins for triggering dom updates can be also very usefull in conjunction with non-HTML5 DOM-Changes (AJAX)
|
658
|
+
* Example:
|
659
|
+
* $.webshims.addReady(function(context, insertedElement){
|
660
|
+
* $('div.tabs', context).add(insertedElement.filter('div.tabs')).tabs();
|
661
|
+
* });
|
662
|
+
*
|
663
|
+
* $.ajax({
|
664
|
+
* success: function(html){
|
665
|
+
* $('#main').htmlPolyfill(html);
|
666
|
+
* }
|
667
|
+
* });
|
668
|
+
*/
|
669
|
+
|
670
|
+
(function(){
|
671
|
+
var readyFns = [];
|
672
|
+
$.extend(webshims, {
|
673
|
+
addReady: function(fn){
|
674
|
+
var readyFn = function(context, elem){
|
675
|
+
webshims.ready('DOM', function(){fn(context, elem);});
|
676
|
+
};
|
677
|
+
readyFns.push(readyFn);
|
678
|
+
readyFn(document, emptyJ);
|
679
|
+
},
|
680
|
+
triggerDomUpdate: function(context){
|
681
|
+
if(!context || !context.nodeType){
|
682
|
+
if(context && context.jquery){
|
683
|
+
context.each(function(){
|
684
|
+
webshims.triggerDomUpdate(this);
|
685
|
+
});
|
686
|
+
}
|
687
|
+
return;
|
688
|
+
}
|
689
|
+
var type = context.nodeType;
|
690
|
+
if(type != 1 && type != 9){return;}
|
691
|
+
var elem = (context !== document) ? $(context) : emptyJ;
|
692
|
+
$.each(readyFns, function(i, fn){
|
693
|
+
fn(context, elem);
|
694
|
+
});
|
695
|
+
}
|
696
|
+
});
|
697
|
+
|
698
|
+
$.fn.htmlPolyfill = function(a){
|
699
|
+
var ret = $.fn.html.call(this, a);
|
700
|
+
if(ret === this && $.isDOMReady){
|
701
|
+
this.each(function(){
|
702
|
+
if(this.nodeType == 1){
|
703
|
+
webshims.triggerDomUpdate(this);
|
704
|
+
}
|
705
|
+
});
|
706
|
+
}
|
707
|
+
return ret;
|
708
|
+
};
|
709
|
+
|
710
|
+
|
711
|
+
$.each(['after', 'before', 'append', 'prepend', 'replaceWith'], function(i, name){
|
712
|
+
$.fn[name+'Polyfill'] = function(a){
|
713
|
+
a = $(a);
|
714
|
+
$.fn[name].call(this, a);
|
715
|
+
if($.isDOMReady){
|
716
|
+
a.each(function(){
|
717
|
+
if (this.nodeType == 1) {
|
718
|
+
webshims.triggerDomUpdate(this);
|
719
|
+
}
|
720
|
+
});
|
721
|
+
}
|
722
|
+
return this;
|
723
|
+
};
|
724
|
+
|
725
|
+
});
|
726
|
+
|
727
|
+
$.each(['insertAfter', 'insertBefore', 'appendTo', 'prependTo', 'replaceAll'], function(i, name){
|
728
|
+
$.fn[name.replace(/[A-Z]/, function(c){return "Polyfill"+c;})] = function(){
|
729
|
+
$.fn[name].apply(this, arguments);
|
730
|
+
if($.isDOMReady){
|
731
|
+
webshims.triggerDomUpdate(this);
|
732
|
+
}
|
733
|
+
return this;
|
734
|
+
};
|
735
|
+
});
|
736
|
+
|
737
|
+
$.fn.updatePolyfill = function(){
|
738
|
+
if($.isDOMReady){
|
739
|
+
webshims.triggerDomUpdate(this);
|
740
|
+
}
|
741
|
+
return this;
|
742
|
+
};
|
743
|
+
|
744
|
+
$.each(['getNativeElement', 'getShadowElement', 'getShadowFocusElement'], function(i, name){
|
745
|
+
$.fn[name] = function(){
|
746
|
+
return this;
|
747
|
+
};
|
748
|
+
});
|
749
|
+
|
750
|
+
})();
|
751
|
+
|
752
|
+
//this might be extended by ES5 shim feature
|
753
|
+
(function(){
|
754
|
+
var defineProperty = 'defineProperty';
|
755
|
+
var has = Object.prototype.hasOwnProperty;
|
756
|
+
var descProps = ['configurable', 'enumerable', 'writable'];
|
757
|
+
var extendUndefined = function(prop){
|
758
|
+
for(var i = 0; i < 3; i++){
|
759
|
+
if(prop[descProps[i]] === undefined && (descProps[i] !== 'writable' || prop.value !== undefined)){
|
760
|
+
prop[descProps[i]] = true;
|
761
|
+
}
|
762
|
+
}
|
763
|
+
};
|
764
|
+
var extendProps = function(props){
|
765
|
+
if(props){
|
766
|
+
for(var i in props){
|
767
|
+
if(has.call(props, i)){
|
768
|
+
extendUndefined(props[i]);
|
769
|
+
}
|
770
|
+
}
|
771
|
+
}
|
772
|
+
};
|
773
|
+
if(Object.create){
|
774
|
+
webshims.objectCreate = function(proto, props, opts){
|
775
|
+
extendProps(props);
|
776
|
+
var o = Object.create(proto, props);
|
777
|
+
if(opts){
|
778
|
+
o.options = $.extend(true, {}, o.options || {}, opts);
|
779
|
+
opts = o.options;
|
780
|
+
}
|
781
|
+
if(o._create && $.isFunction(o._create)){
|
782
|
+
o._create(opts);
|
783
|
+
}
|
784
|
+
return o;
|
785
|
+
};
|
786
|
+
}
|
787
|
+
if(Object[defineProperty]){
|
788
|
+
webshims[defineProperty] = function(obj, prop, desc){
|
789
|
+
extendUndefined(desc);
|
790
|
+
return Object[defineProperty](obj, prop, desc);
|
791
|
+
};
|
792
|
+
}
|
793
|
+
if(Object.defineProperties){
|
794
|
+
webshims.defineProperties = function(obj, props){
|
795
|
+
extendProps(props);
|
796
|
+
return Object.defineProperties(obj, props);
|
797
|
+
};
|
798
|
+
}
|
799
|
+
webshims.getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
800
|
+
|
801
|
+
webshims.getPrototypeOf = Object.getPrototypeOf;
|
802
|
+
})();
|
803
|
+
|
804
|
+
|
805
|
+
|
806
|
+
|
807
|
+
/*
|
808
|
+
* Start Features
|
809
|
+
*/
|
810
|
+
|
811
|
+
/* general modules */
|
812
|
+
/* change path $.webshims.modules[moduleName].src */
|
813
|
+
|
814
|
+
addModule('jquery-ui', {
|
815
|
+
src: uiLib+'jquery-ui.min.js',
|
816
|
+
test: function(){return !!($.widget && $.Widget);}
|
817
|
+
});
|
818
|
+
|
819
|
+
addModule('input-widgets', {
|
820
|
+
src: '',
|
821
|
+
test: function(){
|
822
|
+
return !this.src || !($.widget && !($.fn.datepicker && $.fn.slider));
|
823
|
+
}
|
824
|
+
});
|
825
|
+
|
826
|
+
addModule('swfobject', {
|
827
|
+
src: googleAPIs+'swfobject/2.2/swfobject.js',
|
828
|
+
test: function(){return ('swfobject' in window);}
|
829
|
+
});
|
830
|
+
|
831
|
+
|
832
|
+
/*
|
833
|
+
* polyfill-Modules
|
834
|
+
*/
|
835
|
+
|
836
|
+
// webshims lib uses a of http://github.com/kriskowal/es5-shim/ to implement
|
837
|
+
addPolyfill('es5', {
|
838
|
+
test: !!(Modernizr.ES5 && Function.prototype.bind),
|
839
|
+
c: [27, 10, 1, 22]
|
840
|
+
});
|
841
|
+
|
842
|
+
addPolyfill('dom-extend', {
|
843
|
+
f: DOMSUPPORT,
|
844
|
+
noAutoCallback: true,
|
845
|
+
d: ['es5'],
|
846
|
+
c: [27, 10, 9, 12, 17, 26, 16, 25, 8, 1, 24, 19, 11, 13]
|
847
|
+
});
|
848
|
+
|
849
|
+
|
850
|
+
//<localstorage
|
851
|
+
needModernizr('localstorage');
|
852
|
+
addPolyfill('json-storage', {
|
853
|
+
test: Modernizr.localstorage && 'sessionStorage' in window && 'JSON' in window,
|
854
|
+
loadInit: function(){
|
855
|
+
loadList(['swfobject']);
|
856
|
+
},
|
857
|
+
noAutoCallback: true,
|
858
|
+
c: [14]
|
859
|
+
});
|
860
|
+
//>localstorage
|
861
|
+
|
862
|
+
|
863
|
+
//<geolocation
|
864
|
+
needModernizr('geolocation');
|
865
|
+
addPolyfill('geolocation', {
|
866
|
+
test: Modernizr.geolocation,
|
867
|
+
options: {
|
868
|
+
destroyWrite: true
|
869
|
+
// ,confirmText: ''
|
870
|
+
},
|
871
|
+
d: ['json-storage'],
|
872
|
+
c: [14, 15]
|
873
|
+
});
|
874
|
+
//>
|
875
|
+
|
876
|
+
//<canvas
|
877
|
+
needModernizr('canvas', function(){
|
878
|
+
var flashCanvas;
|
879
|
+
addPolyfill('canvas', {
|
880
|
+
src: 'excanvas',
|
881
|
+
test: Modernizr.canvas,
|
882
|
+
options: {type: 'flash'}, //excanvas | flash | flashpro
|
883
|
+
noAutoCallback: true,
|
884
|
+
loadInit: function(){
|
885
|
+
var type = this.options.type;
|
886
|
+
var src;
|
887
|
+
if(type && type.indexOf('flash') !== -1 && (!window.swfobject || swfobject.hasFlashPlayerVersion('9.0.0'))){
|
888
|
+
window.FlashCanvasOptions = window.FlashCanvasOptions || {};
|
889
|
+
flashCanvas = FlashCanvasOptions;
|
890
|
+
if(type == 'flash'){
|
891
|
+
$.extend(flashCanvas, {
|
892
|
+
swfPath: webCFG.basePath + 'FlashCanvas/'
|
893
|
+
});
|
894
|
+
this.src = 'FlashCanvas/flashcanvas';
|
895
|
+
src = flashCanvas.swfPath + 'flashcanvas.swf';
|
896
|
+
} else {
|
897
|
+
$.extend(flashCanvas, {swfPath: webCFG.basePath + 'FlashCanvasPro/'});
|
898
|
+
this.src = 'FlashCanvasPro/flashcanvas';
|
899
|
+
//assume, that the user has flash10+
|
900
|
+
src = flashCanvas.swfPath + 'flash10canvas.swf';
|
901
|
+
}
|
902
|
+
//todo: implement cachbuster for flashcanvas
|
903
|
+
// if(webCFG.addCacheBuster){
|
904
|
+
// src += webCFG.addCacheBuster;
|
905
|
+
// }
|
906
|
+
}
|
907
|
+
},
|
908
|
+
afterLoad: function(){
|
909
|
+
webshims.addReady(function(context, elem){
|
910
|
+
if(context == document){
|
911
|
+
if(window.G_vmlCanvasManager && G_vmlCanvasManager.init_ ){
|
912
|
+
G_vmlCanvasManager.init_(document);
|
913
|
+
}
|
914
|
+
}
|
915
|
+
$('canvas', context).add(elem.filter('canvas')).each(function(){
|
916
|
+
var hasContext = this.getContext;
|
917
|
+
if(!hasContext && window.G_vmlCanvasManager){
|
918
|
+
G_vmlCanvasManager.initElement(this);
|
919
|
+
}
|
920
|
+
});
|
921
|
+
if(context == document){
|
922
|
+
isReady('canvas', true);
|
923
|
+
}
|
924
|
+
});
|
925
|
+
},
|
926
|
+
methodNames: ['getContext'],
|
927
|
+
d: [DOMSUPPORT]
|
928
|
+
});
|
929
|
+
});
|
930
|
+
//>
|
931
|
+
|
932
|
+
|
933
|
+
//<forms
|
934
|
+
needModernizr('input inputtypes', function(){
|
935
|
+
var modernizrInputAttrs = Modernizr.input;
|
936
|
+
var modernizrInputTypes = Modernizr.inputtypes;
|
937
|
+
var formvalidation = 'formvalidation';
|
938
|
+
var select = $('<select required="" name="a"><option disabled="" /></select>')[0];
|
939
|
+
var bustedValidity = false;
|
940
|
+
var formExtend, formOptions;
|
941
|
+
|
942
|
+
|
943
|
+
addTest(formvalidation, function(){
|
944
|
+
return !!(modernizrInputAttrs.required && modernizrInputAttrs.pattern);
|
945
|
+
});
|
946
|
+
addTest('fieldsetdisabled', function(){
|
947
|
+
var fieldset = $('<fieldset />')[0];
|
948
|
+
return 'elements' in fieldset && 'disabled' in fieldset;
|
949
|
+
});
|
950
|
+
|
951
|
+
if(Modernizr[formvalidation]){
|
952
|
+
bugs.bustedValidity = bustedValidity = Modernizr.formattribute === false || !Modernizr.fieldsetdisabled || !('value' in document.createElement('output')) || !($('<input type="date" value="1488-12-11" />')[0].validity || {valid: true}).valid || !('required' in select) || (select.validity || {}).valid;
|
953
|
+
}
|
954
|
+
|
955
|
+
formExtend = Modernizr[formvalidation] && !bustedValidity ? 'form-native-extend' : 'form-extend';
|
956
|
+
|
957
|
+
addTest('styleableinputrange', function(){
|
958
|
+
if(!modernizrInputTypes.range){
|
959
|
+
return false;
|
960
|
+
}
|
961
|
+
var input = document.createElement('input');
|
962
|
+
input.setAttribute('type', 'range');
|
963
|
+
return input.style.WebkitAppearance !== undefined;
|
964
|
+
});
|
965
|
+
|
966
|
+
|
967
|
+
webshims.validationMessages = webshims.validityMessages = [];
|
968
|
+
webshims.inputTypes = {};
|
969
|
+
|
970
|
+
addPolyfill('form-core', {
|
971
|
+
f: 'forms',
|
972
|
+
d: ['es5'],
|
973
|
+
test: function(toLoad){
|
974
|
+
if(formOptions.lightweightDatalist && !this.datalistLoaded){
|
975
|
+
this.datalistLoaded = true;
|
976
|
+
modules['form-datalist'].f = 'forms';
|
977
|
+
webshims.reTest(['form-datalist']);
|
978
|
+
}
|
979
|
+
return false;
|
980
|
+
},
|
981
|
+
options: {
|
982
|
+
placeholderType: 'value',
|
983
|
+
langSrc: 'i18n/errormessages-',
|
984
|
+
lightweightDatalist: true,
|
985
|
+
availabeLangs: ['ar', 'ch-ZN', 'el', 'es', 'fr', 'he', 'hi', 'hu', 'it', 'ja', 'nl', 'pt-PT', 'ru', 'sv'] //en and de are directly implemented in core
|
986
|
+
// ,customMessages: false,
|
987
|
+
// overrideMessages: false,
|
988
|
+
// replaceValidationUI: false
|
989
|
+
},
|
990
|
+
methodNames: ['setCustomValidity','checkValidity'],
|
991
|
+
c: [3, 2, 59, 17, 26, 16, 5, 4, 24, 19]
|
992
|
+
});
|
993
|
+
|
994
|
+
formOptions = webCFG.forms;
|
995
|
+
|
996
|
+
addPolyfill('form-native-extend', {
|
997
|
+
f: 'forms',
|
998
|
+
test: function(toLoad){
|
999
|
+
return (!Modernizr[formvalidation] || bustedValidity) || ((modules['form-number-date-api'].test() || $.inArray('form-number-date-api', toLoad || []) == -1) && !formOptions.overrideMessages );
|
1000
|
+
},
|
1001
|
+
d: ['form-core', DOMSUPPORT, 'form-message'],
|
1002
|
+
c: [18, 7, 59, 5]
|
1003
|
+
});
|
1004
|
+
|
1005
|
+
addPolyfill('form-shim-extend', {
|
1006
|
+
f: 'forms',
|
1007
|
+
test: function(){
|
1008
|
+
return Modernizr[formvalidation] && !bustedValidity;
|
1009
|
+
},
|
1010
|
+
d: ['form-core', DOMSUPPORT],
|
1011
|
+
c: [3, 2, 23, 21]
|
1012
|
+
});
|
1013
|
+
|
1014
|
+
addPolyfill('form-message', {
|
1015
|
+
f: 'forms',
|
1016
|
+
test: function(toLoad){
|
1017
|
+
return !( formOptions.customMessages || !Modernizr[formvalidation] || bugs.validationMessage || bustedValidity || !modules[formExtend].test(toLoad) );
|
1018
|
+
},
|
1019
|
+
d: [DOMSUPPORT],
|
1020
|
+
c: [3, 2, 23, 21, 59, 17, 5, 4]
|
1021
|
+
});
|
1022
|
+
|
1023
|
+
addPolyfill('form-number-date-api', {
|
1024
|
+
f: 'forms-ext',
|
1025
|
+
uiTest: function(){return (modernizrInputTypes.range && modernizrInputTypes.date && modernizrInputTypes.time && modernizrInputTypes.number);},
|
1026
|
+
test: function(toLoad){
|
1027
|
+
return this.uiTest();
|
1028
|
+
},
|
1029
|
+
d: ['forms', DOMSUPPORT],
|
1030
|
+
c: [18, 7, 6]
|
1031
|
+
});
|
1032
|
+
|
1033
|
+
addPolyfill('form-number-date-ui', {
|
1034
|
+
f: 'forms-ext',
|
1035
|
+
test: function(){return modules['form-number-date-api'].test() && !this.options.replaceUI;},
|
1036
|
+
d: ['forms', DOMSUPPORT, 'form-number-date-api'],
|
1037
|
+
loadInit: function(){
|
1038
|
+
loadList(['jquery-ui']);
|
1039
|
+
if(modules['input-widgets'].src){
|
1040
|
+
loadList(['input-widgets']);
|
1041
|
+
}
|
1042
|
+
},
|
1043
|
+
options: {
|
1044
|
+
stepArrows: {number: 1, time: 1},
|
1045
|
+
calculateWidth: true,
|
1046
|
+
slider: {},
|
1047
|
+
datepicker: {},
|
1048
|
+
langSrc: uiLib+'i18n/jquery.ui.datepicker-',
|
1049
|
+
lazyDate: true
|
1050
|
+
// ,replaceUI: false
|
1051
|
+
},
|
1052
|
+
c: [18, 7, 6]
|
1053
|
+
});
|
1054
|
+
|
1055
|
+
addPolyfill('form-datalist', {
|
1056
|
+
f: 'forms-ext',
|
1057
|
+
test: function(){
|
1058
|
+
return modernizrInputAttrs.list && !formOptions.customDatalist;
|
1059
|
+
},
|
1060
|
+
d: ['form-core', DOMSUPPORT],
|
1061
|
+
c: [3, 59, 18, 24, 19, 11]
|
1062
|
+
});
|
1063
|
+
});
|
1064
|
+
//>
|
1065
|
+
|
1066
|
+
//<details
|
1067
|
+
if(!('details' in Modernizr)){
|
1068
|
+
addTest('details', function(){
|
1069
|
+
return ('open' in document.createElement('details'));
|
1070
|
+
});
|
1071
|
+
}
|
1072
|
+
addPolyfill('details', {
|
1073
|
+
test: Modernizr.details,
|
1074
|
+
d: [DOMSUPPORT],
|
1075
|
+
options: {
|
1076
|
+
// animate: false,
|
1077
|
+
text: 'Details'
|
1078
|
+
},
|
1079
|
+
c: [12, 13, 15]
|
1080
|
+
});
|
1081
|
+
//>
|
1082
|
+
|
1083
|
+
//<mediaelement
|
1084
|
+
needModernizr('audio video texttrackapi', function(){
|
1085
|
+
webshims.mediaelement = {};
|
1086
|
+
var swfTest = function(){
|
1087
|
+
if(!Modernizr.audio || !Modernizr.video){
|
1088
|
+
return false;
|
1089
|
+
}
|
1090
|
+
if(webshims.mediaelement.loadSwf){
|
1091
|
+
return false;
|
1092
|
+
}
|
1093
|
+
var options = this.options;
|
1094
|
+
var hasToPlay = options.hasToPlay;
|
1095
|
+
return !( (!window.swfobject || window.swfobject.hasFlashPlayerVersion('9.0.115')) && (options.preferFlash || (hasToPlay != 'any' && !Modernizr.video[hasToPlay] && !Modernizr.audio[hasToPlay])));
|
1096
|
+
};
|
1097
|
+
var deps = ['swfobject', DOMSUPPORT];
|
1098
|
+
|
1099
|
+
addPolyfill('mediaelement-core', {
|
1100
|
+
f: 'mediaelement',
|
1101
|
+
noAutoCallback: true,
|
1102
|
+
options: {
|
1103
|
+
hasToPlay: 'any',
|
1104
|
+
preferFlash: false,
|
1105
|
+
player: 'jwplayer',
|
1106
|
+
vars: {},
|
1107
|
+
params: {},
|
1108
|
+
attrs: {},
|
1109
|
+
changeSWF: $.noop
|
1110
|
+
},
|
1111
|
+
methodNames: ['play', 'pause', 'canPlayType', 'mediaLoad:load'],
|
1112
|
+
d: deps,
|
1113
|
+
c: [27, 10, 9, 12, 17, 26, 16, 25, 8, 22, 23, 24, 20]
|
1114
|
+
});
|
1115
|
+
addPolyfill('mediaelement-swf', {
|
1116
|
+
f: 'mediaelement',
|
1117
|
+
d: deps,
|
1118
|
+
test: function(){
|
1119
|
+
return this.options.player != 'jwplayer' ? true : swfTest.apply(this, arguments);
|
1120
|
+
},
|
1121
|
+
c: [27, 10, 9, 22, 20]
|
1122
|
+
});
|
1123
|
+
|
1124
|
+
addPolyfill('mediaelement-jaris', {
|
1125
|
+
f: 'mediaelement',
|
1126
|
+
d: deps,
|
1127
|
+
test: function(){
|
1128
|
+
return this.options.player == 'jwplayer' ? true : swfTest.apply(this, arguments);
|
1129
|
+
}
|
1130
|
+
});
|
1131
|
+
|
1132
|
+
bugs.track = (Modernizr.track && (!Modernizr.texttrackapi || typeof (document.createElement('track').track || {}).mode != 'string'));
|
1133
|
+
|
1134
|
+
addPolyfill('track', {
|
1135
|
+
options: {
|
1136
|
+
positionDisplay: true,
|
1137
|
+
override: bugs.track
|
1138
|
+
},
|
1139
|
+
test: function(){
|
1140
|
+
return Modernizr.track && !this.options.override && !bugs.track;
|
1141
|
+
},
|
1142
|
+
d: ['mediaelement', DOMSUPPORT],
|
1143
|
+
methodNames: ['addTextTrack'],
|
1144
|
+
c: [27, 26, 25]
|
1145
|
+
});
|
1146
|
+
|
1147
|
+
addModule('track-ui', {
|
1148
|
+
d: ['track']
|
1149
|
+
});
|
1150
|
+
});
|
1151
|
+
//>
|
1152
|
+
|
1153
|
+
|
1154
|
+
//>removeCombos<
|
1155
|
+
addPolyfill('feature-dummy', {
|
1156
|
+
test: true,
|
1157
|
+
loaded: true,
|
1158
|
+
c: removeCombos
|
1159
|
+
});
|
1160
|
+
|
1161
|
+
|
1162
|
+
jScripts
|
1163
|
+
.filter('[data-polyfill-cfg]')
|
1164
|
+
.each(function(){
|
1165
|
+
try {
|
1166
|
+
webshims.setOptions( $(this).data('polyfillCfg') );
|
1167
|
+
} catch(e){
|
1168
|
+
webshims.warn('error parsing polyfill cfg: '+e);
|
1169
|
+
}
|
1170
|
+
})
|
1171
|
+
.end()
|
1172
|
+
.filter('[data-polyfill]')
|
1173
|
+
.each(function(){
|
1174
|
+
webshims.polyfill( $.trim( $(this).data('polyfill') || '' ) );
|
1175
|
+
})
|
1176
|
+
;
|
1177
|
+
if(asyncWebshims){
|
1178
|
+
if(asyncWebshims.cfg){
|
1179
|
+
webshims.setOptions(asyncWebshims.cfg);
|
1180
|
+
}
|
1181
|
+
if(asyncWebshims.lang){
|
1182
|
+
webshims.activeLang(asyncWebshims.lang);
|
1183
|
+
}
|
1184
|
+
if('polyfill' in asyncWebshims){
|
1185
|
+
webshims.polyfill(asyncWebshims.polyfill);
|
1186
|
+
}
|
1187
|
+
}
|
1188
|
+
}));
|