PageSourceSearch

https://chatcapital.ai/wp-content/plugins/wptd-video-popup/assets/js/wptd-video-popup.js?ver=1.0

js chatcapital.ai collected 2026-10-05 11:54:03 UTC 4,012 bytes, 143 lines download raw bytes

1
2(function( $ ) {
3	
4	"use strict";
5	
6	/* Shortcode CSS Append */
7	if( $(document).find('.wptd-inline-css').length ){
8		var css_out = '';
9		$(document).find( ".wptd-inline-css" ).each(function() {
10			var shortcode = $( this );
11			if( shortcode.attr("data-css") ){
12				var shortcode_css = shortcode.attr("data-css");		
13				css_out += ($).parseJSON( shortcode_css );
14				//shortcode.removeAttr("data-css");
15			}
16		});
17		if( css_out != '' ){
18			$('head').append( '<style id="wptd-shortcode-styles">'+ css_out +'</style>' );
19		}
20	}
21	
22	// Normal Shortcode
23	if( $(document).find('.wptd-popup-video, .wptd-popup-video').length ){
24		
25		var _t_class = '';
26		$(document).find('.wptd-popup-video, .wptd-popup-video').on("click", function(){
27			if( $(this).data("id") ){
28				_t_class = $(this).data("id");
29			}
30		});
31					
32		$(document).find('.wptd-popup-video, .wptd-popup-video').magnificPopup({
33			//disableOn: 700,
34			type: 'iframe',
35			mainClass: 'mfp-fade',
36			removalDelay: 160,
37			preloader: false,
38			fixedContentPos: false,
39			iframe: {
40				markup: '<div class="mfp-iframe-scaler">' +
41					'<div class="mfp-close"></div>' +
42					'<iframe class="mfp-iframe" frameborder="0" allow="autoplay" allowfullscreen></iframe>' +
43					'</div>',
44				patterns: {
45					youtube: {
46						index: 'youtube.com/',
47						id: 'v=',
48						src: 'https://www.youtube.com/embed/%id%?autoplay=0'
49					},
50					vimeo: {
51						index: 'vimeo.com/',
52						id: '/',
53						src: '//player.vimeo.com/video/%id%?autoplay=1&loop=1&autopause=0'
54					},
55				}
56			},
57			callbacks: {
58				open: function() {
59					$("body").addClass(_t_class);
60				},
61				close: function() {
62					$("body").removeClass(_t_class);
63				}
64			}
65		});
66	}
67	
68	// Elementor Video popup handler
69	var wptd_video_popup_handler = function( $scope, $ ) {
70		if( $scope.find(".wptd-video-popup-trigger").length ){
71			$scope.find( '.wptd-video-popup-trigger' ).each(function() {
72				wptd_popup_fun( this, $scope.attr("data-id") );
73			});		
74		}
75	};
76	
77	// Init event on elementor frontend
78	$( window ).on( 'elementor/frontend/init', function() {
79		elementorFrontend.hooks.addAction( 'frontend/element_ready/wptd_video_popup.default', wptd_video_popup_handler );	
80	});
81	
82	// Call magnific popup
83	function wptd_popup_fun( _ele, _scope_id ){
84		
85		/* Shortcode CSS Append */
86		if( $(document).find('.wptd-video-popup-inline-css').length ){
87			var css_out = ''; $("#wptd-elementor-shortcode-styles").remove();
88			$(document).find( ".wptd-video-popup-inline-css" ).each(function() {
89				var shortcode = $( this );
90				if( shortcode.attr("data-css") ){
91					var shortcode_css = shortcode.attr("data-css");		
92					css_out += ($).parseJSON( shortcode_css );
93					shortcode.remove();
94				}
95			});
96			if( css_out != '' ){
97				$('head').append( '<style id="wptd-elementor-shortcode-styles">'+ css_out +'</style>' );
98			}
99		}
100		
101		var _wptd_video_popup_class = '';
102		$(_ele).on( "click", function(){
103			_wptd_video_popup_class = 'wptd-video-popup-'+ _scope_id;
104		});
105		var _ele = $(_ele);
106		_ele.magnificPopup({
107			//disableOn: 700,
108			type: 'iframe',
109			mainClass: 'mfp-fade',
110			removalDelay: 160,
111			preloader: false,
112			fixedContentPos: false,
113			iframe: {
114				markup: '<div class="mfp-iframe-scaler">' +
115					'<div class="mfp-close"></div>' +
116					'<iframe class="mfp-iframe" frameborder="0" allow="autoplay" allowfullscreen></iframe>' +
117					'</div>',
118				patterns: {
119					youtube: {
120						index: 'youtube.com/',
121						id: 'v=',
122						src: 'https://www.youtube.com/embed/%id%?autoplay=0'
123					},
124					vimeo: {
125						index: 'vimeo.com/',
126						id: '/',
127						src: '//player.vimeo.com/video/%id%?autoplay=1&loop=1&autopause=0'
128					},
129				}
130			},
131			callbacks: {
132				open: function() {
133					$("body").addClass(_wptd_video_popup_class);
134				},
135				close: function() {
136					$("body").removeClass(_wptd_video_popup_class);
137				}
138			}
139		});
140	}
141			
142})( jQuery );
143

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.