popcornjs-rails 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -0
- data/Gemfile +0 -0
- data/README.md +10 -4
- data/Rakefile +0 -0
- data/lib/popcornjs-rails/version.rb +1 -1
- data/lib/popcornjs-rails.rb +0 -0
- data/popcornjs-rails.gemspec +0 -0
- data/vendor/assets/javascripts/popcorn-complete.js +1512 -910
- data/vendor/assets/javascripts/popcorn-complete.min.js +188 -178
- data/vendor/assets/javascripts/popcorn-ie8.js +2849 -0
- data/vendor/assets/javascripts/popcorn-ie8.min.js +64 -0
- data/vendor/assets/javascripts/popcorn.js +207 -511
- data/vendor/assets/javascripts/popcorn.min.js +37 -42
- metadata +5 -3
@@ -1,50 +1,45 @@
|
|
1
1
|
/*
|
2
|
-
* popcorn.js version 1.
|
2
|
+
* popcorn.js version 1.2
|
3
3
|
* http://popcornjs.org
|
4
4
|
*
|
5
5
|
* Copyright 2011, Mozilla Foundation
|
6
6
|
* Licensed under the MIT license
|
7
7
|
*/
|
8
8
|
|
9
|
-
(function(r
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
b)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
this
|
35
|
-
|
36
|
-
p
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
"
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
a.success,a.dataType==="script");else{a=c.extend({},P,a);a.ajax=a.xhr();if(a.ajax){if(a.type==="GET"&&a.data){a.url+=(O.test(a.url)?"&":"?")+a.data;a.data=null}a.ajax.open(a.type,a.url,a.async);a.ajax.send(a.data||null);return c.xhr.httpData(a)}}};c.xhr.httpData=function(a){var b,d=null,e,f=null;a.ajax.onreadystatechange=function(){if(a.ajax.readyState===4){try{d=JSON.parse(a.ajax.responseText)}catch(g){}b={xml:a.ajax.responseXML,text:a.ajax.responseText,json:d};if(!b.xml||!b.xml.documentElement){b.xml=
|
46
|
-
null;try{e=new DOMParser;f=e.parseFromString(a.ajax.responseText,"text/xml");if(!f.getElementsByTagName("parsererror").length)b.xml=f}catch(h){}}if(a.dataType)b=b[a.dataType];a.success.call(a.ajax,b)}};return b};c.xhr.getJSONP=function(a,b,d){var e=s.head||s.getElementsByTagName("head")[0]||s.documentElement,f=s.createElement("script"),g=a.split("?")[1],h=false,m=[],j,l;if(g&&!d)m=g.split("&");if(m.length)l=m[m.length-1].split("=");j=m.length?l[1]?l[1]:l[0]:"jsonp";if(!g&&!d)a+="?callback="+j;if(j&&
|
47
|
-
!d){if(window[j])j=c.guid(j);window[j]=function(o){b&&b(o);h=true};a=a.replace(l.join("="),l[0]+"="+j)}f.onload=function(){d&&b&&b();h&&delete window[j];e.removeChild(f)};f.src=a;e.insertBefore(f,e.firstChild)};c.getJSONP=c.xhr.getJSONP;c.getScript=c.xhr.getScript=function(a,b){return c.xhr.getJSONP(a,b,true)};c.util={toSeconds:function(a,b){var d=/^([0-9]+:){0,2}[0-9]+([.;][0-9]+)?$/,e,f,g;if(typeof a==="number")return a;typeof a==="string"&&!d.test(a)&&c.error("Invalid time format");d=a.split(":");
|
48
|
-
e=d.length-1;f=d[e];if(f.indexOf(";")>-1){f=f.split(";");g=0;if(b&&typeof b==="number")g=parseFloat(f[1],10)/b;d[e]=parseInt(f[0],10)+g}e=d[0];return{1:parseFloat(e,10),2:parseInt(e,10)*60+parseFloat(d[1],10),3:parseInt(e,10)*3600+parseInt(d[1],10)*60+parseFloat(d[2],10)}[d.length||1]}};var B=C(r.navigator.userLanguage||r.navigator.language);c.locale={get:function(){return B},set:function(a){B=C(a);c.locale.broadcast();return B},broadcast:function(a){var b=c.instances,d=b.length,e=0,f;for(a=a||"locale:changed";e<
|
49
|
-
d;e++){f=b[e];a in f.data.events&&f.trigger(a)}}};c.p.cue=c.p.exec;c.protect={natives:function(){var a,b=[];if(Object.keys)b=Object.keys(c.p);else for(a in c.p)z.call(c.p,a)&&b.push(a);return b.join(",").toLowerCase().split(",")}()};r.Popcorn=c}else{r.Popcorn={isSupported:false};for(v="forEach extend effects error guid sizeOf isArray nop position disable enable destroy addTrackEvent removeTrackEvent getTrackEvents getTrackEvent getLastTrackEventId timeUpdate plugin removePlugin compose effect parser xhr getJSONP getScript".split(/\s+/);v.length;)r.Popcorn[v.shift()]=
|
9
|
+
(function(q,r){function F(a,b){return function(){if(c.plugin.debug)return a.apply(this,arguments);try{return a.apply(this,arguments)}catch(d){c.plugin.errors.push({plugin:b,thrown:d,source:a.toString()});this.emit("error",c.plugin.errors)}}}if(r.addEventListener){var u=Array.prototype,y=Object.prototype,z=u.forEach,A=u.slice,x=y.hasOwnProperty,B=y.toString,G=q.Popcorn,H=/^(#([\w\-\_\.]+))$/,w=[],C=false,v={events:{hash:{},apis:{}}},D=function(){return q.requestAnimationFrame||q.webkitRequestAnimationFrame||
|
10
|
+
q.mozRequestAnimationFrame||q.oRequestAnimationFrame||q.msRequestAnimationFrame||function(a){q.setTimeout(a,16)}}(),E=function(a){var b=a.media.currentTime,d=a.options.frameAnimation,e=a.data.disabled,f=a.data.trackEvents,g=f.animating,h=f.startIndex,k=c.registryByName,j=0,n,m;for(h=Math.min(h+1,f.byStart.length-2);h>0&&f.byStart[h];){j=f.byStart[h];m=(n=j._natives)&&n.type;if(!n||k[m]||a[m])if(j.start<=b&&j.end>b&&e.indexOf(m)===-1){if(!j._running){j._running=true;n.start.call(a,null,j);d&&j&&j._running&&
|
11
|
+
j.natives.frame&&n.frame.call(a,null,j,b)}}else if(j._running===true){j._running=false;n.end.call(a,null,j);if(d&&j._natives.frame){j=g.indexOf(j);j>=0&&g.splice(j,1)}}h--}},c=function(a,b){return new c.p.init(a,b||null)};c.version="1.2";c.isSupported=true;c.instances=[];c.p=c.prototype={init:function(a,b){var d,e=this;if(typeof a==="function")if(r.readyState==="complete")a(r,c);else{w.push(a);if(!C){C=true;var f=function(){r.removeEventListener("DOMContentLoaded",f,false);for(var h=0,k=w.length;h<
|
12
|
+
k;h++)w[h].call(r,c);w=null};r.addEventListener("DOMContentLoaded",f,false)}}else{this.media=(d=H.exec(a))&&d.length&&d[2]?r.getElementById(d[2]):a;this[this.media.nodeName&&this.media.nodeName.toLowerCase()||"video"]=this.media;c.instances.push(this);this.options=b||{};this.isDestroyed=false;this.data={timeUpdate:c.nop,disabled:[],events:{},hooks:{},history:[],state:{volume:this.media.volume},trackRefs:{},trackEvents:{byStart:[{start:-1,end:-1}],byEnd:[{start:-1,end:-1}],animating:[],startIndex:0,
|
13
|
+
endIndex:0,previousUpdateTime:-1}};var g=function(){e.media.removeEventListener("loadeddata",g,false);var h;h=e.media.duration;h=h!=h?Number.MAX_VALUE:h+1;c.addTrackEvent(e,{start:h,end:h});if(e.options.frameAnimation){e.data.timeUpdate=function(){c.timeUpdate(e,{});e.emit("timeupdate");!e.isDestroyed&&D(e.data.timeUpdate)};!e.isDestroyed&&D(e.data.timeUpdate)}else{e.data.timeUpdate=function(k){c.timeUpdate(e,k)};e.isDestroyed||e.media.addEventListener("timeupdate",e.data.timeUpdate,false)}};e.media.readyState>=
|
14
|
+
2?g():e.media.addEventListener("loadeddata",g,false);return this}}};c.p.init.prototype=c.p;c.forEach=function(a,b,d){if(!a||!b)return{};d=d||this;var e,f;if(z&&a.forEach===z)return a.forEach(b,d);if(B.call(a)==="[object NodeList]"){e=0;for(f=a.length;e<f;e++)b.call(d,a[e],e,a);return a}for(e in a)x.call(a,e)&&b.call(d,a[e],e,a);return a};c.extend=function(a){var b=A.call(arguments,1);c.forEach(b,function(d){for(var e in d)a[e]=d[e]});return a};c.extend(c,{noConflict:function(a){if(a)q.Popcorn=G;return c},
|
15
|
+
error:function(a){throw Error(a);},guid:function(a){c.guid.counter++;return(a?a:"")+(+new Date+c.guid.counter)},sizeOf:function(a){var b=0,d;for(d in a)b++;return b},isArray:Array.isArray||function(a){return B.call(a)==="[object Array]"},nop:function(){},position:function(a){a=a.getBoundingClientRect();var b={},d=r.documentElement,e=r.body,f,g,h;f=d.clientTop||e.clientTop||0;g=d.clientLeft||e.clientLeft||0;h=q.pageYOffset&&d.scrollTop||e.scrollTop;d=q.pageXOffset&&d.scrollLeft||e.scrollLeft;f=Math.ceil(a.top+
|
16
|
+
h-f);g=Math.ceil(a.left+d-g);for(var k in a)b[k]=Math.round(a[k]);return c.extend({},b,{top:f,left:g})},disable:function(a,b){var d=a.data.disabled;d.indexOf(b)===-1&&d.push(b);E(a);return a},enable:function(a,b){var d=a.data.disabled,e=d.indexOf(b);e>-1&&d.splice(e,1);E(a);return a},destroy:function(a){var b=a.data.events,d,e,f;for(e in b){d=b[e];for(f in d)delete d[f];b[e]=null}if(!a.isDestroyed){a.data.timeUpdate&&a.media.removeEventListener("timeupdate",a.data.timeUpdate,false);a.isDestroyed=
|
17
|
+
true}}});c.guid.counter=1;c.extend(c.p,function(){var a={};c.forEach("load play pause currentTime playbackRate volume duration preload playbackRate autoplay loop controls muted buffered readyState seeking paused played seekable ended".split(/\s+/g),function(b){a[b]=function(d){if(typeof this.media[b]==="function"){if(d!=null&&/play|pause/.test(b))this.media.currentTime=c.util.toSeconds(d);this.media[b]();return this}if(d!=null){this.media[b]=d;return this}return this.media[b]}});return a}());c.forEach("enable disable".split(" "),
|
18
|
+
function(a){c.p[a]=function(b){return c[a](this,b)}});c.extend(c.p,{roundTime:function(){return-~this.media.currentTime},exec:function(a,b){c.addTrackEvent(this,{start:a,end:a+1,_running:false,_natives:{start:b||c.nop,end:c.nop,type:"cue"}});return this},mute:function(a){a=a==null||a===true?"muted":"unmuted";if(a==="unmuted"){this.media.muted=false;this.media.volume=this.data.state.volume}if(a==="muted"){this.data.state.volume=this.media.volume;this.media.muted=true}this.emit(a);return this},unmute:function(a){return this.mute(a==
|
19
|
+
null?false:!a)},position:function(){return c.position(this.media)},toggle:function(a){return c[this.data.disabled.indexOf(a)>-1?"enable":"disable"](this,a)},defaults:function(a,b){if(c.isArray(a)){c.forEach(a,function(d){for(var e in d)this.defaults(e,d[e])},this);return this}if(!this.options.defaults)this.options.defaults={};this.options.defaults[a]||(this.options.defaults[a]={});c.extend(this.options.defaults[a],b);return this}});c.Events={UIEvents:"blur focus focusin focusout load resize scroll unload",
|
20
|
+
MouseEvents:"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave click dblclick",Events:"loadstart progress suspend emptied stalled play pause loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange"};c.Events.Natives=c.Events.UIEvents+" "+c.Events.MouseEvents+" "+c.Events.Events;v.events.apiTypes=["UIEvents","MouseEvents","Events"];(function(a,b){for(var d=v.events.apiTypes,e=a.Natives.split(/\s+/g),
|
21
|
+
f=0,g=e.length;f<g;f++)b.hash[e[f]]=true;d.forEach(function(h){b.apis[h]={};for(var k=a[h].split(/\s+/g),j=k.length,n=0;n<j;n++)b.apis[h][k[n]]=true})})(c.Events,v.events);c.events={isNative:function(a){return!!v.events.hash[a]},getInterface:function(a){if(!c.events.isNative(a))return false;var b=v.events,d=b.apiTypes;b=b.apis;for(var e=0,f=d.length,g,h;e<f;e++){h=d[e];if(b[h][a]){g=h;break}}return g},all:c.Events.Natives.split(/\s+/g),fn:{trigger:function(a,b){var d;if(this.data.events[a]&&c.sizeOf(this.data.events[a])){if(d=
|
22
|
+
c.events.getInterface(a)){d=r.createEvent(d);d.initEvent(a,true,true,q,1);this.media.dispatchEvent(d);return this}c.forEach(this.data.events[a],function(e){e.call(this,b)},this)}return this},listen:function(a,b){var d=this,e=true,f=c.events.hooks[a],g;if(!this.data.events[a]){this.data.events[a]={};e=false}if(f){f.add&&f.add.call(this,{},b);if(f.bind)a=f.bind;if(f.handler){g=b;b=function(h){f.handler.call(d,h,g)}}e=true;if(!this.data.events[a]){this.data.events[a]={};e=false}}this.data.events[a][b.name||
|
23
|
+
b.toString()+c.guid()]=b;!e&&c.events.all.indexOf(a)>-1&&this.media.addEventListener(a,function(h){c.forEach(d.data.events[a],function(k){typeof k==="function"&&k.call(d,h)})},false);return this},unlisten:function(a,b){if(this.data.events[a]&&this.data.events[a][b]){delete this.data.events[a][b];return this}this.data.events[a]=null;return this}},hooks:{canplayall:{bind:"canplaythrough",add:function(a,b){var d=false;if(this.media.readyState){b.call(this,a);d=true}this.data.hooks.canplayall={fired:d}},
|
24
|
+
handler:function(a,b){if(!this.data.hooks.canplayall.fired){b.call(this,a);this.data.hooks.canplayall.fired=true}}}}};c.forEach([["trigger","emit"],["listen","on"],["unlisten","off"]],function(a){c.p[a[0]]=c.p[a[1]]=c.events.fn[a[0]]});c.addTrackEvent=function(a,b){if(b&&b._natives&&b._natives.type&&a.options.defaults&&a.options.defaults[b._natives.type])b=c.extend({},a.options.defaults[b._natives.type],b);if(b._natives){b._id=!b.id?c.guid(b._natives.type):b.id;a.data.history.push(b._id)}b.start=
|
25
|
+
c.util.toSeconds(b.start,a.options.framerate);b.end=c.util.toSeconds(b.end,a.options.framerate);var d=a.data.trackEvents.byStart,e=a.data.trackEvents.byEnd,f;for(f=d.length-1;f>=0;f--)if(b.start>=d[f].start){d.splice(f+1,0,b);break}for(d=e.length-1;d>=0;d--)if(b.end>e[d].end){e.splice(d+1,0,b);break}if(b._natives&&(c.registryByName[b._natives.type]||a[b._natives.type])){e=a.media.currentTime;if(b.end>e&&b.start<=e&&a.data.disabled.indexOf(b._natives.type)===-1){b._running=true;b._natives.start.call(a,
|
26
|
+
null,b);if(a.options.frameAnimation&&b._natives.frame){a.data.trackEvents.animating.push(b);b._natives.frame.call(a,null,b,e)}}}f<=a.data.trackEvents.startIndex&&b.start<=a.data.trackEvents.previousUpdateTime&&a.data.trackEvents.startIndex++;d<=a.data.trackEvents.endIndex&&b.end<a.data.trackEvents.previousUpdateTime&&a.data.trackEvents.endIndex++;this.timeUpdate(a,null,true);b._id&&c.addTrackEvent.ref(a,b)};c.addTrackEvent.ref=function(a,b){a.data.trackRefs[b._id]=b;return a};c.removeTrackEvent=function(a,
|
27
|
+
b){for(var d,e,f=a.data.history.length,g=a.data.trackEvents.byStart.length,h=0,k=0,j=[],n=[],m=[],i=[];--g>-1;){d=a.data.trackEvents.byStart[h];e=a.data.trackEvents.byEnd[h];if(!d._id){j.push(d);n.push(e)}if(d._id){d._id!==b&&j.push(d);e._id!==b&&n.push(e);if(d._id===b){k=h;d._natives._teardown&&d._natives._teardown.call(a,d)}}h++}g=a.data.trackEvents.animating.length;h=0;if(g)for(;--g>-1;){d=a.data.trackEvents.animating[h];d._id||m.push(d);d._id&&d._id!==b&&m.push(d);h++}k<=a.data.trackEvents.startIndex&&
|
28
|
+
a.data.trackEvents.startIndex--;k<=a.data.trackEvents.endIndex&&a.data.trackEvents.endIndex--;a.data.trackEvents.byStart=j;a.data.trackEvents.byEnd=n;a.data.trackEvents.animating=m;for(g=0;g<f;g++)a.data.history[g]!==b&&i.push(a.data.history[g]);a.data.history=i;c.removeTrackEvent.ref(a,b)};c.removeTrackEvent.ref=function(a,b){delete a.data.trackRefs[b];return a};c.getTrackEvents=function(a){var b=[];a=a.data.trackEvents.byStart;for(var d=a.length,e=0,f;e<d;e++){f=a[e];f._id&&b.push(f)}return b};
|
29
|
+
c.getTrackEvents.ref=function(a){return a.data.trackRefs};c.getTrackEvent=function(a,b){return a.data.trackRefs[b]};c.getTrackEvent.ref=function(a,b){return a.data.trackRefs[b]};c.getLastTrackEventId=function(a){return a.data.history[a.data.history.length-1]};c.timeUpdate=function(a,b){var d=a.media.currentTime,e=a.data.trackEvents.previousUpdateTime,f=a.data.trackEvents,g=f.animating,h=f.endIndex,k=f.startIndex,j=0,n=f.byStart.length,m=f.byEnd.length,i=c.registryByName,l,p,o;if(e<=d){for(;f.byEnd[h]&&
|
30
|
+
f.byEnd[h].end<=d;){l=f.byEnd[h];o=(e=l._natives)&&e.type;if(!e||i[o]||a[o]){if(l._running===true){l._running=false;e.end.call(a,b,l);a.emit("trackend",c.extend({},l,{plugin:o,type:"trackend"}))}h++}else{c.removeTrackEvent(a,l._id);return}}for(;f.byStart[k]&&f.byStart[k].start<=d;){p=f.byStart[k];o=(e=p._natives)&&e.type;if(!e||i[o]||a[o]){if(p.end>d&&p._running===false&&a.data.disabled.indexOf(o)===-1){p._running=true;e.start.call(a,b,p);a.emit("trackstart",c.extend({},p,{plugin:o,type:"trackstart"}));
|
31
|
+
a.options.frameAnimation&&p&&p._running&&p._natives.frame&&g.push(p)}k++}else{c.removeTrackEvent(a,p._id);return}}if(a.options.frameAnimation)for(;j<g.length;){i=g[j];if(i._running){i._natives.frame.call(a,b,i,d);j++}else g.splice(j,1)}}else if(e>d){for(;f.byStart[k]&&f.byStart[k].start>d;){p=f.byStart[k];o=(e=p._natives)&&e.type;if(!e||i[o]||a[o]){if(p._running===true){p._running=false;e.end.call(a,b,p);a.emit("trackend",c.extend({},l,{plugin:o,type:"trackend"}))}k--}else{c.removeTrackEvent(a,p._id);
|
32
|
+
return}}for(;f.byEnd[h]&&f.byEnd[h].end>d;){l=f.byEnd[h];o=(e=l._natives)&&e.type;if(!e||i[o]||a[o]){if(l.start<=d&&l._running===false&&a.data.disabled.indexOf(o)===-1){l._running=true;e.start.call(a,b,l);a.emit("trackstart",c.extend({},p,{plugin:o,type:"trackstart"}));a.options.frameAnimation&&l&&l._running&&l._natives.frame&&g.push(l)}h--}else{c.removeTrackEvent(a,l._id);return}}if(a.options.frameAnimation)for(;j<g.length;){i=g[j];if(i._running){i._natives.frame.call(a,b,i,d);j++}else g.splice(j,
|
33
|
+
1)}}f.endIndex=h;f.startIndex=k;f.previousUpdateTime=d;f.byStart.length<n&&f.startIndex--;f.byEnd.length<m&&f.endIndex--};c.extend(c.p,{getTrackEvents:function(){return c.getTrackEvents.call(null,this)},getTrackEvent:function(a){return c.getTrackEvent.call(null,this,a)},getLastTrackEventId:function(){return c.getLastTrackEventId.call(null,this)},removeTrackEvent:function(a){c.removeTrackEvent.call(null,this,a);return this},removePlugin:function(a){c.removePlugin.call(null,this,a);return this},timeUpdate:function(a){c.timeUpdate.call(null,
|
34
|
+
this,a);return this},destroy:function(){c.destroy.call(null,this);return this}});c.manifest={};c.registry=[];c.registryByName={};c.plugin=function(a,b,d){if(c.protect.natives.indexOf(a.toLowerCase())>=0)c.error("'"+a+"' is a protected function name");else{var e=["start","end"],f={},g=typeof b==="function",h=["_setup","_teardown","start","end","frame"],k=function(m,i){m=m||c.nop;i=i||c.nop;return function(){m.apply(this,arguments);i.apply(this,arguments)}};c.manifest[a]=d=d||b.manifest||{};h.forEach(function(m){b[m]=
|
35
|
+
F(b[m]||c.nop,a)});var j=function(m,i){if(!i)return this;var l=i._natives={},p="",o;c.extend(l,m);i._natives.type=a;i._running=false;l.start=l.start||l["in"];l.end=l.end||l.out;l._teardown=k(function(){var s=A.call(arguments);s.unshift(null);s[1]._running&&l.end.apply(this,s)},l._teardown);i.compose=i.compose&&i.compose.split(" ")||[];i.effect=i.effect&&i.effect.split(" ")||[];i.compose=i.compose.concat(i.effect);i.compose.forEach(function(s){p=c.compositions[s]||{};h.forEach(function(t){l[t]=k(l[t],
|
36
|
+
p[t])})});i._natives.manifest=d;if(!("start"in i))i.start=i["in"]||0;if(!i.end&&i.end!==0)i.end=i.out||Number.MAX_VALUE;if(!x.call(i,"toString"))i.toString=function(){var s=["start: "+i.start,"end: "+i.end,"id: "+(i.id||i._id)];i.target!=null&&s.push("target: "+i.target);return a+" ( "+s.join(", ")+" )"};if(!i.target){o="options"in d&&d.options;i.target=o&&"target"in o&&o.target}i._natives._setup&&i._natives._setup.call(this,i);c.addTrackEvent(this,c.extend(i,i));c.forEach(m,function(s,t){t!=="type"&&
|
37
|
+
e.indexOf(t)===-1&&this.on(t,s)},this);return this};c.p[a]=f[a]=function(m){m=c.extend({},this.options.defaults&&this.options.defaults[a]||{},m);return j.call(this,g?b.call(this,m):b,m)};var n={fn:f[a],definition:b,base:b,parents:[],name:a};c.registry.push(c.extend(f,n,{type:a}));c.registryByName[a]=n;return f}};c.plugin.errors=[];c.plugin.debug=false;c.removePlugin=function(a,b){if(!b){b=a;a=c.p;if(c.protect.natives.indexOf(b.toLowerCase())>=0){c.error("'"+b+"' is a protected function name");return}var d=
|
38
|
+
c.registry.length,e;for(e=0;e<d;e++)if(c.registry[e].name===b){c.registry.splice(e,1);delete c.registryByName[b];delete c.manifest[b];delete a[b];return}}d=a.data.trackEvents.byStart;e=a.data.trackEvents.byEnd;var f=a.data.trackEvents.animating,g,h;g=0;for(h=d.length;g<h;g++){if(d[g]&&d[g]._natives&&d[g]._natives.type===b){d[g]._natives._teardown&&d[g]._natives._teardown.call(a,d[g]);d.splice(g,1);g--;h--;if(a.data.trackEvents.startIndex<=g){a.data.trackEvents.startIndex--;a.data.trackEvents.endIndex--}}e[g]&&
|
39
|
+
e[g]._natives&&e[g]._natives.type===b&&e.splice(g,1)}g=0;for(h=f.length;g<h;g++)if(f[g]&&f[g]._natives&&f[g]._natives.type===b){f.splice(g,1);g--;h--}};c.compositions={};c.compose=function(a,b,d){c.manifest[a]=d||b.manifest||{};c.compositions[a]=b};c.plugin.effect=c.effect=c.compose;var I=/\?/,J={url:"",data:"",dataType:"",success:c.nop,type:"GET",async:true,xhr:function(){return new q.XMLHttpRequest}};c.xhr=function(a){a.dataType=a.dataType&&a.dataType.toLowerCase()||null;if(a.dataType&&(a.dataType===
|
40
|
+
"jsonp"||a.dataType==="script"))c.xhr.getJSONP(a.url,a.success,a.dataType==="script");else{a=c.extend({},J,a);a.ajax=a.xhr();if(a.ajax){if(a.type==="GET"&&a.data){a.url+=(I.test(a.url)?"&":"?")+a.data;a.data=null}a.ajax.open(a.type,a.url,a.async);a.ajax.send(a.data||null);return c.xhr.httpData(a)}}};c.xhr.httpData=function(a){var b,d=null,e,f=null;a.ajax.onreadystatechange=function(){if(a.ajax.readyState===4){try{d=JSON.parse(a.ajax.responseText)}catch(g){}b={xml:a.ajax.responseXML,text:a.ajax.responseText,
|
41
|
+
json:d};if(!b.xml||!b.xml.documentElement){b.xml=null;try{e=new DOMParser;f=e.parseFromString(a.ajax.responseText,"text/xml");if(!f.getElementsByTagName("parsererror").length)b.xml=f}catch(h){}}if(a.dataType)b=b[a.dataType];a.success.call(a.ajax,b)}};return b};c.xhr.getJSONP=function(a,b,d){var e=r.head||r.getElementsByTagName("head")[0]||r.documentElement,f=r.createElement("script"),g=a.split("?")[1],h=false,k=[],j,n;if(g&&!d)k=g.split("&");if(k.length)n=k[k.length-1].split("=");j=k.length?n[1]?
|
42
|
+
n[1]:n[0]:"jsonp";if(!g&&!d)a+="?callback="+j;if(j&&!d){if(window[j])j=c.guid(j);window[j]=function(m){b&&b(m);h=true};a=a.replace(n.join("="),n[0]+"="+j)}f.addEventListener("load",function(){d&&b&&b();h&&delete window[j];e.removeChild(f)},false);f.src=a;e.insertBefore(f,e.firstChild)};c.getJSONP=c.xhr.getJSONP;c.getScript=c.xhr.getScript=function(a,b){return c.xhr.getJSONP(a,b,true)};c.util={toSeconds:function(a,b){var d=/^([0-9]+:){0,2}[0-9]+([.;][0-9]+)?$/,e,f,g;if(typeof a==="number")return a;
|
43
|
+
typeof a==="string"&&!d.test(a)&&c.error("Invalid time format");d=a.split(":");e=d.length-1;f=d[e];if(f.indexOf(";")>-1){f=f.split(";");g=0;if(b&&typeof b==="number")g=parseFloat(f[1],10)/b;d[e]=parseInt(f[0],10)+g}e=d[0];return{1:parseFloat(e,10),2:parseInt(e,10)*60+parseFloat(d[1],10),3:parseInt(e,10)*3600+parseInt(d[1],10)*60+parseFloat(d[2],10)}[d.length||1]}};c.p.cue=c.p.exec;c.protect={natives:function(a){return Object.keys?Object.keys(a):function(b){var d,e=[];for(d in b)x.call(b,d)&&e.push(d);
|
44
|
+
return e}(a)}(c.p).map(function(a){return a.toLowerCase()})};c.forEach({listen:"on",unlisten:"off",trigger:"emit",exec:"cue"},function(a,b){var d=c.p[b];c.p[b]=function(){if(typeof console!=="undefined"&&console.warn){console.warn("Deprecated method '"+b+"', "+(a==null?"do not use.":"use '"+a+"' instead."));c.p[b]=d}return c.p[a].apply(this,[].slice.call(arguments))}});q.Popcorn=c}else{q.Popcorn={isSupported:false};for(u="removeInstance addInstance getInstanceById removeInstanceById forEach extend effects error guid sizeOf isArray nop position disable enable destroyaddTrackEvent removeTrackEvent getTrackEvents getTrackEvent getLastTrackEventId timeUpdate plugin removePlugin compose effect xhr getJSONP getScript".split(/\s+/);u.length;)q.Popcorn[u.shift()]=
|
50
45
|
function(){}}})(window,window.document);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: popcornjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Simple wrapper for HTML5 Video library popcorn.js
|
15
15
|
email:
|
@@ -27,6 +27,8 @@ files:
|
|
27
27
|
- popcornjs-rails.gemspec
|
28
28
|
- vendor/assets/javascripts/popcorn-complete.js
|
29
29
|
- vendor/assets/javascripts/popcorn-complete.min.js
|
30
|
+
- vendor/assets/javascripts/popcorn-ie8.js
|
31
|
+
- vendor/assets/javascripts/popcorn-ie8.min.js
|
30
32
|
- vendor/assets/javascripts/popcorn.js
|
31
33
|
- vendor/assets/javascripts/popcorn.min.js
|
32
34
|
homepage: https://github.com/jaimie-van-santen/popcornjs-rails
|
@@ -49,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
51
|
version: '0'
|
50
52
|
requirements: []
|
51
53
|
rubyforge_project: popcornjs-rails
|
52
|
-
rubygems_version: 1.8.
|
54
|
+
rubygems_version: 1.8.24
|
53
55
|
signing_key:
|
54
56
|
specification_version: 3
|
55
57
|
summary: popcorn.js asset pipeline provider/wrapper
|