Plugin Directory

source: featured-video-plus/tags/2.0.0/js/frontend.min.js @ 1172120

Last change on this file since 1172120 was 1172120, checked in by a.hoereth, 9 years ago

Tagging Version 2.0.0

File size: 2.2 KB
Line 
1!function(t){"use strict";function a(){t(".has-post-video a.post-thumbnail>.featured-video-plus,.has-post-video a.post-thumbnail>.fvp-dynamic,.has-post-video a.post-thumbnail>.fvp-overlay,.has-post-video a.post-thumbnail>.mejs-video,.has-post-video a.post-thumbnail>.wp-video").unwrap()}function e(){fvpdata.fitvids&&t(".featured-video-plus.fvp-responsive").fitVids({customSelector:["iframe","object","embed"]})}function i(){if(fvpdata.width&&!fvpdata.fitvids){t(".fvp-local .wp-video").css({width:fvpdata.width,height:"auto"});var a=t(".fvp-local .wp-video .wp-video-shortcode");a.attr({width:fvpdata.width,height:fvpdata.width/a.attr("width")*a.attr("heigth")})}}function o(){void 0===r&&[fvpdata.playicon,fvpdata.loadicon].forEach(function(a){t("body").append(t("<img/>",{src:a}).hide())}),r=r===v?s:v,c.css({backgroundImage:r})}function d(a){var e=t(a.currentTarget),i=e.children("img");0===e.find(".fvp-loader").length?(i.animate({opacity:fvpdata.opacity}),e.css({position:"relative"}).prepend(c.css({height:i.height(),width:i.width(),marginTop:-i.height()/2,marginLeft:-i.width()/2}))):r!==s&&(i.animate({opacity:1}),c.remove())}function n(a){a.preventDefault();var i=t(a.currentTarget),d=parseInt(i.attr("data-id"),10);o(),t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",nonce:fvpdata.nonce,id:d},function(a){a.success&&(i.replaceWith(a.html),t(".wp-audio-shortcode, .wp-video-shortcode").mediaelementplayer(),e()),o()})}function p(a){a.preventDefault();var e=t(a.currentTarget),o=parseInt(e.attr("data-id"),10);e.openDOMWindow({eventType:null,windowPadding:0,borderSize:0,windowBGColor:"transparent",overlayOpacity:100*fvpdata.opacity,width:"100%",height:"100%"}),t("#DOMWindow").css({backgroundImage:s});var d=t("#fvp-cache-"+o);0===d.html().length?t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",nonce:fvpdata.nonce,id:o},function(a){a.success&&(d.html(a.html),t("#DOMWindow").html(a.html),i(),t(window).trigger("scroll"))}):(t("#DOMWindow").html(d.html()),t(window).trigger("scroll"))}var r,c=t("<div />").addClass("fvp-loader"),v="url('"+fvpdata.playicon+"')",s="url('"+fvpdata.loadicon+"')";t(document).ready(function(){a(),setTimeout(a,1e3),e(),i(),t(".fvp-overlay, .fvp-dynamic").hover(d,d),o(),t(".fvp-dynamic").click(n),t(".fvp-overlay").click(p)})}(jQuery);
Note: See TracBrowser for help on using the repository browser.