Add upstream

This commit is contained in:
root
2019-10-24 00:12:05 +02:00
parent 85d41e4216
commit ac980f592c
3504 changed files with 1049983 additions and 29971 deletions

View File

@@ -0,0 +1,10 @@
.jetpack-video-wrapper {
margin-bottom: 1.6em;
}
.jetpack-video-wrapper > embed,
.jetpack-video-wrapper > iframe,
.jetpack-video-wrapper > object,
.jetpack-video-wrapper > .wp-video {
margin-bottom: 0;
}

View File

@@ -0,0 +1,63 @@
( function( $ ) {
var resizeTimer;
function responsiveVideos() {
$( '.jetpack-video-wrapper' )
.find( 'embed, iframe, object' )
.each( function() {
var _this, videoWidth, videoHeight, videoRatio, videoWrapper, videoMargin, containerWidth;
_this = $( this );
videoMargin = 0;
if (
_this
.parents( '.jetpack-video-wrapper' )
.prev( 'p' )
.css( 'text-align' ) === 'center'
) {
videoMargin = '0 auto';
}
if ( ! _this.attr( 'data-ratio' ) ) {
_this
.attr( 'data-ratio', this.height / this.width )
.attr( 'data-width', this.width )
.attr( 'data-height', this.height )
.css( {
display: 'block',
margin: videoMargin,
} );
}
videoWidth = _this.attr( 'data-width' );
videoHeight = _this.attr( 'data-height' );
videoRatio = _this.attr( 'data-ratio' );
videoWrapper = _this.parent();
containerWidth = videoWrapper.width();
if ( videoRatio === 'Infinity' ) {
videoWidth = '100%';
}
_this.removeAttr( 'height' ).removeAttr( 'width' );
if ( videoWidth > containerWidth ) {
_this.width( containerWidth ).height( containerWidth * videoRatio );
} else {
_this.width( videoWidth ).height( videoHeight );
}
} );
}
$( document ).ready( function() {
$( window )
.on( 'load.jetpack', responsiveVideos )
.on( 'resize.jetpack', function() {
clearTimeout( resizeTimer );
resizeTimer = setTimeout( responsiveVideos, 500 );
} )
.on( 'post-load.jetpack', responsiveVideos )
.resize();
} );
} )( jQuery );

View File

@@ -0,0 +1 @@
!function(t){function a(){t(".jetpack-video-wrapper").find("embed, iframe, object").each(function(){var a,e,i,r,h,d,o;a=t(this),d=0,"center"===a.parents(".jetpack-video-wrapper").prev("p").css("text-align")&&(d="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:d}),e=a.attr("data-width"),i=a.attr("data-height"),r=a.attr("data-ratio"),h=a.parent(),o=h.width(),"Infinity"===r&&(e="100%"),a.removeAttr("height").removeAttr("width"),e>o?a.width(o).height(o*r):a.width(e).height(i)})}var e;t(document).ready(function(){t(window).on("load.jetpack",a).on("resize.jetpack",function(){clearTimeout(e),e=setTimeout(a,500)}).on("post-load.jetpack",a).resize()})}(jQuery);