%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/plugins/fusion-builder/front-end/views/elements/
Upload File :
Create Path :
Current File : //dom645759/wp-content/plugins/fusion-builder/front-end/views/elements/view-youtube.js

/* eslint no-useless-escape: 0 */
var FusionPageBuilder = FusionPageBuilder || {};

( function() {

	jQuery( document ).ready( function() {

		// Vimeo Element View.
		FusionPageBuilder.fusion_youtube = FusionPageBuilder.ElementView.extend( {

			/**
			 * Runs after view DOM is patched.
			 *
			 * @since 2.0
			 * @return {void}
			 */
			afterPatch: function() {

				this._refreshJs();
			},

			/**
			 * Modify template attributes.
			 *
			 * @since 2.0
			 * @param {Object} atts - The attributes.
			 * @return {Object}
			 */
			filterTemplateAtts: function( atts ) {
				var attributes = {};

				// Validate values.
				this.validateValues( atts.values, atts.params );

				// Create attribute objects
				attributes.attr       = this.buildAttr( atts.values );

				// Any extras that need passed on.
				attributes.id              = atts.values.id;
				attributes.api_params      = atts.values.api_params;
				attributes.title_attribute = ! _.isEmpty( atts.values.title_attribute ) ? atts.values.title_attribute : 'YouTube video player ' + this.model.get( 'cid' );
				attributes.width           = atts.values.width;
				attributes.height          = atts.values.height;

				// With a preview image the facade is shown, as on the front end.
				attributes.facadeImage = 'on' === atts.values.video_facade ? atts.values.preview_image : '';
				attributes.facadeClass = parseFloat( atts.values.height ) > parseFloat( atts.values.width ) ? 'portrait' : 'landscape';
				attributes.noCookie    = atts.values.video_facade_no_cookie;

				return attributes;
			},

			/**
			 * Modifies the values.
			 *
			 * @since 2.0
			 * @param {Object} values - The values object.
			 * @return {void}
			 */
			validateValues: function( values, params ) {
				var regExp      = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,
					aspectRatio = _.awbGetAspectRatioFactor( values.aspect_ratio, values.custom_aspect_ratio ),
					match;

				// Make videos 16:9 by default, values.width already set to params.width.
				if ( 'undefined' !== typeof params.width && '' !== params.width && ( 'undefined' === typeof params.height || '' === params.height ) ) {
					values.height = Math.round( params.width * 9 / 16 );
				}

				// values.height already set to params.height.
				if ( 'undefined' !== typeof params.height && '' !== params.height && ( 'undefined' === typeof params.width || '' === params.width ) ) {
					values.width = Math.round( params.height * 16 / 9 );
				}

				values.height = _.fusionValidateAttrValue( values.height, '' );
				values.width  = _.fusionValidateAttrValue( values.width, '' );

				// A set aspect ratio calculates the height from the width.
				if ( aspectRatio && 0 < parseFloat( values.width ) ) {
					values.height = Math.round( parseFloat( values.width ) * aspectRatio );
				}

				// Make sure only the video ID is passed to the iFrame.
				match = values.id.match( regExp );
				if ( match && 11 === match[ 2 ].length ) {
					values.id = match[ 2 ];
				}

				if ( 'undefined' !== typeof values.loop && 'true' === values.loop ) {
					if ( -1 === values.api_params.indexOf( 'loop=1' ) ) {
						values.api_params += '&loop=1&playlist=' + values.id;
					}
				}

				if ( 'undefined' !== typeof values.controls && 'false' === values.controls ) {
					if ( -1 === values.api_params.indexOf( 'controls=0' ) ) {
						values.api_params += '&controls=0';
					}
				}

				if ( 'undefined' !== typeof values.start_time && '' !== values.start_time ) {
					if ( -1 === values.api_params.indexOf( 'start=' ) ) {
						values.api_params += '&start=' + values.start_time;
					}
				}

				if ( 'undefined' !== typeof values.end_time && '' !== values.end_time ) {
					if ( -1 === values.api_params.indexOf( 'end=' ) ) {
						values.api_params += '&end=' + values.end_time;
					}
				}

				values.margin_bottom = _.fusionValidateAttrValue( values.margin_bottom, 'px' );
				values.margin_top    = _.fusionValidateAttrValue( values.margin_top, 'px' );
			},

			/**
			 * Builds attributes.
			 *
			 * @since 2.0
			 * @param {Object} values - The values object.
			 * @return {Object}
			 */
			buildAttr: function( values ) {
				// Attributes.
				var attrYoutube = _.fusionVisibilityAtts( values.hide_on_mobile, {
					class: 'fusion-video fusion-youtube',
					style: this.getStyleVars( values )
				} );

				if ( 'yes' === values.center ) {
					attrYoutube[ 'class' ] += ' center-video';
				}

				if ( '' !== values.alignment ) {
					attrYoutube[ 'class' ] += ' fusion-align' + values.alignment;
				}

				if ( 'true' == values.autoplay || 'yes' === values.autoplay ) {
					attrYoutube[ 'data-autoplay' ] = '1';
				}

				attrYoutube = _.fusionAnimations( values, attrYoutube );

				if ( values[ 'class' ] && '' !== values[ 'class' ] ) {
					attrYoutube[ 'class' ] += ' ' + values[ 'class' ];
				}

				if ( '' !== values.css_id ) {
					attrYoutube.id = values.css_id;
				}

				return attrYoutube;
			},

			getStyleVars: function( values ) {
				var cssVars,
					customCssVars = {},
					sideMargins   = '';
				this.values = values;

				cssVars = [
					'margin_top',
					'margin_bottom'
				];

				if ( 'yes' !== values.center ) {
					customCssVars[ 'max-width' ]  = values.width + 'px';
					customCssVars[ 'max-height' ] = values.height + 'px';
				}

				if ( '' !== values.alignment ) {
					customCssVars.width = '100%';
				}

				if ( 0 < parseFloat( values.border_size ) ) {
					customCssVars[ 'border-size' ]  = parseFloat( values.border_size ) + 'px';
					customCssVars[ 'border-style' ] = values.border_style;

					if ( '' !== values.border_color ) {
						customCssVars[ 'border-color' ] = values.border_color;
					}
				}

				_.each( [ 'top_left', 'top_right', 'bottom_right', 'bottom_left' ], function( corner ) {
					if ( values[ 'border_radius_' + corner ] ) {
						customCssVars[ 'border-' + corner.replace( '_', '-' ) + '-radius' ] = _.fusionGetValueWithUnit( values[ 'border_radius_' + corner ] );
					}
				} );

				// The video facade has a fixed ratio, a set aspect ratio overrides it.
				if ( _.awbGetAspectRatioFactor( values.aspect_ratio, values.custom_aspect_ratio ) && 0 < parseFloat( values.width ) ) {
					customCssVars[ 'aspect-ratio-padding' ] = ( Math.round( values.height / values.width * 10000 ) / 100 ) + '%';
				}

				// Side margins are set directly, so the alignment margins only get replaced when set.
				_.each( [ 'margin_left', 'margin_right' ], function( side ) {
					if ( 'undefined' !== typeof values[ side ] && '' !== values[ side ] ) {
						sideMargins += side.replace( '_', '-' ) + ':' + _.fusionGetValueWithUnit( values[ side ] ) + ';';
					}
				} );

				return this.getCssVarsForOptions( cssVars ) + this.getCustomCssVars( customCssVars ) + _.awbGetBoxShadowCssVar( '--awb-box-shadow', values ) + sideMargins;
			}
		} );
	} );
}( jQuery ) );

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap635.xml 2026-12-01 https://louisvillegop.com/sitemap426.xml 2026-12-01 https://louisvillegop.com/sitemap423.xml 2026-12-01 https://louisvillegop.com/sitemap304.xml 2026-12-01 https://louisvillegop.com/sitemap189.xml 2026-12-01 https://louisvillegop.com/sitemap366.xml 2026-12-01 https://louisvillegop.com/sitemap400.xml 2026-12-01 https://louisvillegop.com/sitemap153.xml 2026-12-01 https://louisvillegop.com/sitemap412.xml 2026-12-01 https://louisvillegop.com/sitemap294.xml 2026-12-01 https://louisvillegop.com/sitemap359.xml 2026-12-01 https://louisvillegop.com/sitemap199.xml 2026-12-01 https://louisvillegop.com/sitemap334.xml 2026-12-01 https://louisvillegop.com/sitemap326.xml 2026-12-01 https://louisvillegop.com/sitemap758.xml 2026-12-01 https://louisvillegop.com/sitemap515.xml 2026-12-01 https://louisvillegop.com/sitemap225.xml 2026-12-01 https://louisvillegop.com/sitemap215.xml 2026-12-01 https://louisvillegop.com/sitemap222.xml 2026-12-01 https://louisvillegop.com/sitemap688.xml 2026-12-01 https://louisvillegop.com/sitemap36.xml 2026-12-01 https://louisvillegop.com/sitemap119.xml 2026-12-01 https://louisvillegop.com/sitemap950.xml 2026-12-01 https://louisvillegop.com/sitemap885.xml 2026-12-01 https://louisvillegop.com/sitemap852.xml 2026-12-01 https://louisvillegop.com/sitemap276.xml 2026-12-01 https://louisvillegop.com/sitemap723.xml 2026-12-01 https://louisvillegop.com/sitemap392.xml 2026-12-01 https://louisvillegop.com/sitemap999.xml 2026-12-01 https://louisvillegop.com/sitemap350.xml 2026-12-01 https://louisvillegop.com/sitemap876.xml 2026-12-01 https://louisvillegop.com/sitemap482.xml 2026-12-01 https://louisvillegop.com/sitemap787.xml 2026-12-01 https://louisvillegop.com/sitemap372.xml 2026-12-01 https://louisvillegop.com/sitemap307.xml 2026-12-01 https://louisvillegop.com/sitemap685.xml 2026-12-01 https://louisvillegop.com/sitemap646.xml 2026-12-01 https://louisvillegop.com/sitemap589.xml 2026-12-01 https://louisvillegop.com/sitemap547.xml 2026-12-01 https://louisvillegop.com/sitemap835.xml 2026-12-01 https://louisvillegop.com/sitemap286.xml 2026-12-01 https://louisvillegop.com/sitemap780.xml 2026-12-01 https://louisvillegop.com/sitemap49.xml 2026-12-01 https://louisvillegop.com/sitemap170.xml 2026-12-01 https://louisvillegop.com/sitemap713.xml 2026-12-01 https://louisvillegop.com/sitemap512.xml 2026-12-01 https://louisvillegop.com/sitemap818.xml 2026-12-01 https://louisvillegop.com/sitemap408.xml 2026-12-01 https://louisvillegop.com/sitemap16.xml 2026-12-01 https://louisvillegop.com/sitemap141.xml 2026-12-01 https://louisvillegop.com/sitemap996.xml 2026-12-01 https://louisvillegop.com/sitemap867.xml 2026-12-01 https://louisvillegop.com/sitemap843.xml 2026-12-01 https://louisvillegop.com/sitemap915.xml 2026-12-01 https://louisvillegop.com/sitemap884.xml 2026-12-01 https://louisvillegop.com/sitemap727.xml 2026-12-01 https://louisvillegop.com/sitemap355.xml 2026-12-01 https://louisvillegop.com/sitemap433.xml 2026-12-01 https://louisvillegop.com/sitemap406.xml 2026-12-01 https://louisvillegop.com/sitemap840.xml 2026-12-01 https://louisvillegop.com/sitemap692.xml 2026-12-01 https://louisvillegop.com/sitemap907.xml 2026-12-01 https://louisvillegop.com/sitemap398.xml 2026-12-01 https://louisvillegop.com/sitemap614.xml 2026-12-01 https://louisvillegop.com/sitemap603.xml 2026-12-01 https://louisvillegop.com/sitemap255.xml 2026-12-01 https://louisvillegop.com/sitemap802.xml 2026-12-01 https://louisvillegop.com/sitemap924.xml 2026-12-01 https://louisvillegop.com/sitemap172.xml 2026-12-01 https://louisvillegop.com/sitemap468.xml 2026-12-01