PageSourceSearch

https://jsamarketingco.com/wp-content/plugins/trx_addons/addons/el…/AdvancedTitle/assets/AdvancedTitle.js

js jsamarketingco.com collected 2026-10-02 00:31:51 UTC 3,989 bytes, 101 lines download raw bytes

1"use strict";
2jQuery( document ).ready( function() {
3	if ( typeof elementorFrontend == 'undefined' ) {
4		return;
5	}
6	// Add animation for the SVG paths after the timeout to allow the animation script breaks the text into words or chars
7	setTimeout( function() {
8		if ( ! elementorFrontend.isEditMode() ) {
9			// Paint in Frontend only after the element comes into the view
10			jQuery( '.elementor-widget-trx_elm_advanced_title.trx-addons-animate .trx-addons-advanced-title').each( function() {
11				var $self = jQuery( this ),
12					delay = $self.data( 'delay' ) || 0;
13				$self.find( '.trx-addons-svg-wrapper path,.trx-addons-advanced-title-item.trx-addons-advanced-title-color' ).each( function( idx ) {
14					var $path = jQuery( this );
15					var handler = function() {
16						if ( ! $path.hasClass( 'trx-addons-animate-complete' ) ) {
17							setTimeout( function() {
18								$path.addClass( 'trx-addons-animate-complete' );
19								if ( $path.is( 'path' ) ) {
20									$path.css( 'animation-play-state', 'running' );
21								}
22							}, 300 * idx + 400 + parseInt( delay ) );
23						}
24					};
25					if ( 'undefined' !== typeof elementorFrontend.waypoint ) {
26						elementorFrontend.waypoint( $path.get(0), handler, { offset: '90%', triggerOnce: true } );					
27					} else {
28						trx_addons_intersection_observer_add( $path, function( item, enter ) {
29							if ( enter ) {
30								trx_addons_intersection_observer_remove( item );
31								handler();
32							}
33						} );
34					}
35				} );
36			} );
37		} else {
38			// Repaint after the elementor is changed in the Editor
39			elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function( $cont ) {
40				$cont.find( '.trx-addons-advanced-title' ).each( function() {
41					var $self = jQuery( this ),
42						delay = $self.data( 'delay' ) || 0;
43					$self.find( '.trx-addons-svg-wrapper path,.trx-addons-advanced-title-item.trx-addons-advanced-title-color' ).each( function( idx ) {
44						var $path = jQuery( this );
45						if ( $path.hasClass( 'trx-addons-animate-complete' ) ) {
46							$path.removeClass( 'trx-addons-animate-complete' );
47						}
48						setTimeout( function() {
49							$path.addClass( 'trx-addons-animate-complete' );
50							if ( $path.is( 'path' ) ) {
51								$path.css( 'animation-play-state', 'running' );
52							}
53						}, 300 * idx + 400 + parseInt( delay ) );
54					} );
55				} );
56			} );
57		}
58	}, 100 );
59
60	// Remove wrappers .sc_item_animated_block and .sc_item_word around svg inside .trx-addons-svg-wrapper
61	trx_addons_add_filter( 'trx_addons_filter_animation_wrap_items', function( html ) {
62		if ( html.indexOf( 'class="trx-addons-svg-wrapper' ) >= 0 ) {
63			var $obj = jQuery( html );
64			$obj.find( '.trx-addons-svg-wrapper' ).each( function() {
65				var $wrap = jQuery( this );
66				if ( $wrap.find( '.sc_item_animated_block' ).length > 0 || $wrap.find( '.sc_item_word' ).length > 0 ) {
67					var $svg = $wrap.find( 'svg' );
68					if ( $svg.length ) {
69						html = html.replace( $wrap.html(), $svg.get(0).outerHTML );
70					}
71				}
72			} );
73		}
74		return html;
75	} );
76
77	// Swap images inside the items with the type 'gallery'
78	jQuery( document ).on( 'action.init_hidden_elements', function( e, $cont ) {
79		if ( $cont === undefined ) container = jQuery( 'body' );
80		$cont.find( '.trx-addons-advanced-title-item-gallery:not(.trx-addons-advanced-title-item-gallery-inited)' ).each( function() {
81			var $self = jQuery( this ).addClass( 'trx-addons-advanced-title-item-gallery-inited' ),
82				$images = $self.find( 'img' ),
83				interval = $self.data( 'gallery-interval' ) || 4000,
84				delay = $self.data( 'gallery-delay' ) || 0,
85				timer = $self.data( 'gallery-timer' ) || 0;
86			if ( timer ) {
87				clearInterval( timer );
88			}
89			setTimeout( function() {
90				setInterval( function() {
91					var idx = $self.data( 'gallery-index' ) || 0;
92					$images.eq( idx ).hide();
93					idx = ( idx + 1 ) % $images.length;
94					$self.data( 'gallery-index', idx );
95					$images.eq( idx ).show();
96				}, interval );
97			}, delay );
98		} );
99	} );
100
101} );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.