PageSourceSearch

https://bynh.sa/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/video/video.js

js bynh.sa collected 2026-09-24 13:03:34 UTC 2,520 bytes, 99 lines download raw bytes

1(function($)
2{
3	"use strict";
4
5
6	$('body').on( 'click', '.av-lazyload-video-embed .av-click-to-play-overlay', function(e)
7	{
8		var clicked = $(this);
9
10		//	check if videos are disabled by user setting via cookie - or user must opt in.
11		var cookie_check = $('html').hasClass('av-cookies-needs-opt-in') || $('html').hasClass('av-cookies-can-opt-out');
12		var allow_continue = true;
13		var silent_accept_cookie = $('html').hasClass('av-cookies-user-silent-accept');
14
15		if( cookie_check && ! silent_accept_cookie )
16		{
17			if( ! document.cookie.match(/aviaCookieConsent/) || $('html').hasClass('av-cookies-session-refused') )
18			{
19				allow_continue = false;
20			}
21			else
22			{
23				if( ! document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/) )
24				{
25					allow_continue = false;
26				}
27				else if( ! document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/) )
28				{
29					allow_continue = false;
30				}
31				else if( document.cookie.match(/aviaPrivacyVideoEmbedsDisabled/) )
32				{
33					allow_continue = false;
34				}
35			}
36		}
37
38		//	allow 3-rd party plugins to hook (see enfold\config-cookiebot\cookiebot.js)
39		if( window['wp'] && wp.hooks )
40		{
41			allow_continue = wp.hooks.applyFilters( 'aviaCookieConsent_allow_continue', allow_continue );
42		}
43
44		var container = clicked.parents( '.av-lazyload-video-embed' );
45		if( container.hasClass( 'avia-video-lightbox' ) && container.hasClass( 'avia-video-standard-html' ) )
46		{
47			allow_continue = true;
48		}
49
50		if( ! allow_continue )
51		{
52			if( typeof e.originalEvent == 'undefined' ) { return; } //human click only
53
54			var src_url = container.data('original_url');
55			if( src_url ) window.open( src_url , '_blank', 'noreferrer noopener' );
56
57			return;
58		}
59
60
61		var video = container.find('.av-video-tmpl').html();
62		var link = '';
63
64		if( container.hasClass( 'avia-video-lightbox' ) )
65		{
66			link = container.find( 'a.lightbox-link' );
67			if( link.length == 0 )
68			{
69				container.append( video );
70
71				// DOM not ready
72				setTimeout(function(){
73							link = container.find( 'a.lightbox-link' );
74							if( $( 'html' ).hasClass( 'av-default-lightbox' ) )
75							{
76								link.addClass( 'lightbox-added' ).magnificPopup( $.avia_utilities.av_popup );
77								link.trigger( 'click' );
78							}
79							else
80							{
81								link.trigger( 'avia-open-video-in-lightbox' );
82							}
83					}, 100 );
84			}
85			else
86			{
87				link.trigger( 'click' );
88			}
89		}
90		else
91		{
92			container.html( video );
93		}
94
95	});
96
97	$('.av-lazyload-immediate .av-click-to-play-overlay').trigger('click');
98
99}(jQuery));

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.