rate-it/public/js/mootools/mediabox/mediabox-rateit.js

1 line
21 KiB
JavaScript
Raw Normal View History

2014-10-01 07:19:14 +02:00
var Mediabox;(function(){function q(){v.setStyles({top:window.getScrollTop(),left:window.getScrollLeft()})}function R(){f=window.getWidth();l=window.getHeight();v.setStyles({width:f,height:l})}function U(t){if(Browser.firefox){["object",window.ie?"select":"embed"].forEach(function(e){Array.forEach($$(e),function(e){if(t)e._mediabox=e.style.visibility;e.style.visibility=t?"hidden":e._mediabox})})}v.style.display=t?"":"none";var n=t?"addEvent":"removeEvent";if(Browser.Platform.ios||Browser.ie6)window[n]("scroll",q);window[n]("resize",R);if(e.keyboard)document[n]("keydown",z)}function z(t){if(e.keyboardAlpha){switch(t.code){case 27:case 88:case 67:G();break;case 37:case 80:W();break;case 39:case 78:X()}}else{switch(t.code){case 27:G();break;case 37:W();break;case 39:X()}}if(e.keyboardStop){return false}}function W(){return V(r)}function X(){return V(i)}function V(s){if(s>=0){g.set("html","");n=s;r=(n||!e.loop?n:t.length)-1;i=n+1;if(i==t.length)i=e.loop?0:-1;Q();m.className="mbLoading";if(h&&H=="inline"&&!e.inlineClone)h.adopt(g.getChildren());if(!t[s][2])t[s][2]="";O=t[s][2].split(" ");M=O.length;if(M>1){D=O[M-2].match("%")?window.getWidth()*O[M-2].replace("%","")*.01+"px":O[M-2]+"px";P=O[M-1].match("%")?window.getHeight()*O[M-1].replace("%","")*.01+"px":O[M-1]+"px"}else{D="";P=""}o=t[s][0];b=t[n][1].split("::");if(o.match(/quietube\.com/i)){B=o.split("v.php/");o=B[1]}else if(o.match(/\/\/yfrog/i)){H=o.substring(o.length-1);if(H.match(/b|g|j|p|t/i))H="image";if(H=="s")H="flash";if(H.match(/f|z/i))H="video";o=o+":iphone"}if(o.match(/\.gif|\.jpg|\.jpeg|\.png|twitpic\.com/i)||H=="image"){H="img";o=o.replace(/twitpic\.com/i,"twitpic.com/show/full");h=new Image;h.onload=$;h.src=o}else if(o.match(/\.flv|\.mp4/i)||H=="video"){H="obj";D=D||e.defaultWidth;P=P||e.defaultHeight;var o=(new URI(o)).toAbsolute();if(e.useNB){h=new Swiff(""+e.playerpath+"?mediaURL="+o+"&allowSmoothing=true&autoPlay="+e.autoplay+"&buffer=6&showTimecode="+e.showTimecode+"&loop="+e.medialoop+"&controlColor="+e.controlColor+"&controlBackColor="+e.controlBackColor+"&defaultVolume="+e.volume+"&scaleIfFullScreen=true&showScalingButton=true&crop=false",{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}})}else{h=new Swiff(""+e.JWplayerpath+"?file="+o+"&backcolor="+e.backcolor+"&frontcolor="+e.frontcolor+"&lightcolor="+e.lightcolor+"&screencolor="+e.screencolor+"&autostart="+e.autoplay+"&controlbar="+e.controlbar,{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}})}$()}else if(o.match(/\.mp3|\.aac|tweetmic\.com|tmic\.fm/i)||H=="audio"){H="obj";D=D||e.defaultWidth;P=P||"20px";if(o.match(/tweetmic\.com|tmic\.fm/i)){o=o.split("/");o[4]=o[4]||o[3];o="http://media4.fjarnet.net/tweet/tweetmicapp-"+o[4]+".mp3"}if(e.useNB){h=new Swiff(""+e.playerpath+"?mediaURL="+o+"&allowSmoothing=true&autoPlay="+e.autoplay+"&buffer=6&showTimecode="+e.showTimecode+"&loop="+e.medialoop+"&controlColor="+e.controlColor+"&controlBackColor="+e.controlBackColor+"&defaultVolume="+e.volume+"&scaleIfFullScreen=true&showScalingButton=true&crop=false",{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}})}else{h=new Swiff(""+e.JWplayerpath+"?file="+o+"&backcolor="+e.backcolor+"&frontcolor="+e.frontcolor+"&lightcolor="+e.lightcolor+"&screencolor="+e.screencolor+"&autostart="+e.autoplay,{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}})}$()}else if(o.match(/\.swf/i)||H=="flash"){H="obj";D=D||e.defaultWidth;P=P||e.defaultHeight;h=new Swiff(o,{id:"MediaboxSWF",width:D,height:P,params:{wmode:e.wmode,bgcolor:e.bgcolor,allowscriptaccess:e.scriptaccess,allowfullscreen:e.fullscreen}});$()}else if(o.match(/\.mov|\.m4v|\.m4a|\.aiff|\.avi|\.caf|\.dv|\.mid|\.m3u|\.mp3|\.mp2|\.mp4|\.qtz/i)||H=="qt"){H="qt";D=D||e.defaultWidth;P=parseInt(P)+16+"px"||e.defaultHeight;h=new Q