diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2016-06-22 20:52:57 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2016-06-22 20:52:57 -0400 |
commit | f7f019456122473c53bd3661b910e09fe4fbc92a (patch) | |
tree | 7349a3b80b9ea5e7bfbc9039926dfba34eba8bfb /plugins/jetpack/modules/theme-tools | |
parent | Update plugin wordpress-mobile-pack to 2.2.4 (diff) | |
download | blogs-gentoo-f7f019456122473c53bd3661b910e09fe4fbc92a.tar.gz blogs-gentoo-f7f019456122473c53bd3661b910e09fe4fbc92a.tar.bz2 blogs-gentoo-f7f019456122473c53bd3661b910e09fe4fbc92a.zip |
Update plugin jecpack to 4.0.4
Diffstat (limited to 'plugins/jetpack/modules/theme-tools')
-rw-r--r-- | plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js | 107 |
1 files changed, 1 insertions, 106 deletions
diff --git a/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js b/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js index e315891f..ee468c33 100644 --- a/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js +++ b/plugins/jetpack/modules/theme-tools/responsive-videos/responsive-videos.min.js @@ -1,106 +1 @@ -/** - * This file was unminified in Jetpack 4.0 to address an issue wherein ClamAV - * was flagging the minified version of this file with a false-positive virus warning. - * - * This file will be re-minified in a future Jetpack release once ClamAV corrects their - * incorrect definition. - */ - -( function( $ ) { - - /** - * A function to help debouncing. - */ - var debounce = function( func, wait ) { - - var timeout, args, context, timestamp; - - return function() { - - context = this; - args = [].slice.call( arguments, 0 ); - timestamp = new Date(); - - var later = function() { - - var last = ( new Date() ) - timestamp; - - if ( last < wait ) { - timeout = setTimeout( later, wait - last ); - } else { - timeout = null; - func.apply( context, args ); - } - - }; - - if ( ! timeout ) { - timeout = setTimeout( later, wait ); - } - - }; - - }; - - /** - * A function to resize videos. - */ - function responsive_videos() { - - $( '.jetpack-video-wrapper' ).find( 'embed, iframe, object' ).each( function() { - var video_element, video_width, video_height, video_ratio, video_wrapper, video_margin, container_width; - - video_element = $( this ); - video_margin = 0; - - if ( video_element.parents( '.jetpack-video-wrapper' ).prev( 'p' ).css( 'text-align' ) === 'center' ) { - video_margin = '0 auto'; - } - - if ( ! video_element.attr( 'data-ratio' ) ) { - video_element - .attr( 'data-ratio', this.height / this.width ) - .attr( 'data-width', this.width ) - .attr( 'data-height', this.height ) - .css( { - 'display' : 'block', - 'margin' : video_margin - } ); - } - - video_width = video_element.attr( 'data-width' ); - video_height = video_element.attr( 'data-height' ); - video_ratio = video_element.attr( 'data-ratio' ); - video_wrapper = video_element.parent(); - container_width = video_wrapper.width(); - - if ( video_ratio === 'Infinity' ) { - video_width = '100%'; - } - - video_element - .removeAttr( 'height' ) - .removeAttr( 'width' ); - - if ( video_width > container_width ) { - video_element - .width( container_width ) - .height( container_width * video_ratio ); - } else { - video_element - .width( video_width ) - .height( video_height ); - } - - } ); - - } - - /** - * Load responsive_videos(). - * Trigger resize to make sure responsive_videos() is loaded after IS. - */ - $( window ).load( responsive_videos ).resize( debounce( responsive_videos, 100 ) ).trigger( 'resize' ); - $( document ).on( 'post-load', responsive_videos ); - -} )( jQuery ); +!function(t){function a(){t(".jetpack-video-wrapper").find("embed, iframe, object").each(function(){var a,e,i,r,h,n,d;a=t(this),n=0,"center"===a.parents(".jetpack-video-wrapper").prev("p").css("text-align")&&(n="0 auto"),a.attr("data-ratio")||a.attr("data-ratio",this.height/this.width).attr("data-width",this.width).attr("data-height",this.height).css({display:"block",margin:n}),e=a.attr("data-width"),i=a.attr("data-height"),r=a.attr("data-ratio"),h=a.parent(),d=h.width(),"Infinity"===r&&(e="100%"),a.removeAttr("height").removeAttr("width"),e>d?a.width(d).height(d*r):a.width(e).height(i)})}var e=function(t,a){var e,i,r,h;return function(){r=this,i=[].slice.call(arguments,0),h=new Date;var n=function(){var d=new Date-h;a>d?e=setTimeout(n,a-d):(e=null,t.apply(r,i))};e||(e=setTimeout(n,a))}};t(window).load(a).resize(e(a,100)).trigger("resize"),t(document).on("post-load",a)}(jQuery); |