PageSourceSearch

https://lavoce.info/wp-content/plugins/popup-anything-on-click/ass…/js/popupaoc-public.js?ver=2.8.8.1790236575

js lavoce.info collected 2026-09-24 08:43:30 UTC 8,600 bytes, 275 lines download raw bytes

1var paoc_ideal_timer = 0;
2
3(function($) {
4
5	"use strict";
6
7	/* Add Wrap of iframe */
8	$('.paoc-popup iframe[src*="vimeo.com"]').wrap('<div class="paoc-iframe-wrap" />');
9	$('.paoc-popup iframe[src*="dailymotion.com"]').wrap('<div class="paoc-iframe-wrap" />');
10	$('.paoc-popup iframe[src*="youtube.com"]').wrap('<div class="paoc-iframe-wrap" />');
11	$('.paoc-popup iframe[src*="m.youtube.com"]').wrap('<div class="paoc-iframe-wrap" />');
12	$('.paoc-popup iframe[src*="youtu.be"]').wrap('<div class="paoc-iframe-wrap" />');
13	$('.paoc-popup iframe[src*="screencast-o-matic.com"]').wrap('<div class="paoc-iframe-wrap" />');
14	$('.paoc-popup iframe[src*="videopress.com"]').wrap('<div class="paoc-iframe-wrap" />');
15	$('.paoc-popup iframe[src*="video.wordpress.com"]').wrap('<div class="paoc-iframe-wrap" />');
16	$('.paoc-popup iframe[src*="fast.wistia.net"]').wrap('<div class="paoc-iframe-wrap" />');
17
18	/* Zero the idle timer on mouse movement */
19	$(document).on('mousemove keypress scroll click touchstart touchmove', function() {
20		paoc_ideal_timer = 0;
21	});
22
23	/* Welcome Popup for Bar & Modal (Page Load Popup) */
24	$('.paoc-popup-page-load.paoc-popup-js').each(function(index) {
25
26		var target = $(this).attr('id');
27
28		if( typeof( target ) !== 'undefined' ) {
29
30			var options				= $('#'+target).data('popup-conf');
31			var data_opts			= $('#'+target).data('conf');
32			var paoc_active_flag	= popupaoc_popup_active_flag( index, target, data_opts, options );
33
34			if( paoc_active_flag == 1 ) {
35
36				setTimeout(function() {
37
38					/* Open popup & fire events */
39					popupaoc_open_popup( target, options, data_opts );
40
41				}, data_opts.open_delay);
42			}
43
44			return false;
45		}
46	});
47
48	/* On Click Popup Link, Button, Image */
49	$(document).on('click', '[class*="paoc-popup-cust-"]', function() {
50
51		var html_classes = $(this).attr("class").split(' ');
52
53		$.each(html_classes, function( class_key, class_val ) {
54
55			var normal_cls_pos = class_val.indexOf('paoc-popup-cust-');
56
57			/* Popup custom classes is not there */
58			if( normal_cls_pos < 0 ) {
59				return;
60			}
61
62			var target		= class_val.replace("paoc-popup-cust-", "paoc-popup-");
63				target		= target.trim();
64			var popup_ele	= $('.'+target).attr('id');
65			var options		= $('#'+ popup_ele).data('popup-conf');
66			var data_opts	= $('#'+ popup_ele).data('conf');
67
68			if( typeof( popup_ele ) !== 'undefined' && ( data_opts.popup_type == 'simple_link' || data_opts.popup_type == 'button' || data_opts.popup_type == 'image' ) ) {
69
70				var paoc_active_flag = popupaoc_popup_active_flag( class_key, popup_ele, data_opts, options );
71
72				if( paoc_active_flag == 1 ) {
73
74					/* Open popup & fire events */
75					setTimeout(function() {
76						popupaoc_open_popup( popup_ele, options, data_opts );
77					}, data_opts.open_delay);
78				}
79			}
80		});
81
82		return false;
83	});
84
85	/* Popup close event */
86	$(document).on('click', '.paoc-popup-close', function() {
87
88		/* Remove Class from Popup */
89		$('.custombox-content').removeClass( 'paoc-cb-popup-complete' );
90		$('html').removeClass( 'custombox-lock' );
91
92		Custombox.modal.close();
93	});
94})(jQuery);
95
96/* Function to get popup & fire the events */
97function popupaoc_open_popup( target, options, data_opts ) {
98
99	var paoc_popup_open	= 1;
100
101	if (typeof popupaoc_popup_befoer_open === "function") {
102		paoc_popup_open = popupaoc_popup_befoer_open( paoc_popup_open, target, options, data_opts );
103	}
104
105	if( paoc_popup_open != 1 ) {
106		return;
107	}
108
109	/* Popup Events */
110	popupaoc_set_popup_events( target, options, data_opts );
111
112	/* Popup Open */
113	new Custombox.modal(options).open();
114}
115
116/* Function to set Popup Events */
117function popupaoc_set_popup_events( target, options, data_opts ) {
118
119	/* Tweak for Content onOpen Event */
120	options.content.onOpen = function() {
121
122								/* Add Class for hide body scroll */
123								jQuery('html').addClass('custombox-lock');
124
125								jQuery('.custombox-overlay, .custombox-content').removeClass('paoc-popup-active');
126
127								/* Add Classes for overlay */
128								jQuery('.custombox-overlay').not('.paoc-popup-overlay').addClass('paoc-popup-active paoc-popup-overlay paoc-popup-overlay-'+ data_opts.id);
129
130								/* Add Classes from Popup Content */
131								jQuery('.custombox-content').not('.paoc-cb-popup').addClass( 'paoc-popup-active paoc-cb-popup paoc-cb-popup-'+data_opts.id+' paoc-popup-'+options.content.positionX+'-'+options.content.positionY );
132
133								if( options.overlay.active == false && options.content.fullscreen == false ) {
134									jQuery('.custombox-content.paoc-popup-active').addClass( 'paoc-hide-overlay' );
135								}
136
137								/* Ovarlay Background Hide */
138								if( options.overlay.active == false ) {
139									jQuery('html').css({'overflow':'auto', 'margin-right':'0'});
140								}
141
142								/* Slick Slider Tweak */
143								var slick_slider_id = jQuery('.slick-slider').attr('id');
144								if( typeof(slick_slider_id) !== 'undefined' && slick_slider_id != '' ) {
145									jQuery('#'+slick_slider_id).slick( 'setPosition' );
146								}
147
148								/* Trigger fires right before begins to open */
149								jQuery(document.body).trigger('paoc_popup_open', [target, options]);
150							};
151
152	/* Tweak for Content onComplete Event */
153	options.content.onComplete = function() {
154
155								/* Add Classes for Popup Content */
156								jQuery('.custombox-content').addClass( 'paoc-cb-popup-complete' );
157
158								/* Popup Disapper */
159								if( data_opts.disappear != 0 ) {
160
161									if( data_opts.disappear_mode == 'normal' ) {
162
163										var IdleInterval = setInterval(function() {
164
165											paoc_ideal_timer = paoc_ideal_timer + 1;
166
167											if( paoc_ideal_timer >= data_opts.disappear ) {
168
169												Custombox.modal.close();
170
171												clearInterval( IdleInterval );
172											}
173										}, 1000);
174
175									} else if( data_opts.disappear_mode == 'force' ) {
176
177										setTimeout(function() {
178
179											Custombox.modal.close();
180
181										}, ( data_opts.disappear * 1000 ) );
182									}
183								}
184
185								/* Tweak for Window Resize */
186								jQuery(window).trigger('resize');
187
188								/* Trigger fires right after loaded content is displayed */
189								jQuery(document.body).trigger('paoc_popup_complete', [target, options]);
190							};
191
192	/* Tweak for Content onClose Event */
193	options.content.onClose = function() {
194
195		/* Add Overflow Class in HTML Tag */
196		jQuery('html').removeClass('custombox-lock');
197
198		var cookie_name = data_opts.cookie_prefix +'_'+ data_opts.id;
199
200		/* Set Cookie */
201		if( data_opts.cookie_expire !== '' ) {
202			popupaoc_create_cookie( cookie_name, 1, data_opts.cookie_expire, data_opts.cookie_unit, 'Lax' );
203		}
204
205		/* Trigger fires once is closed */
206		jQuery(document.body).trigger('paoc_popup_close', [target, options]);
207	};
208}
209
210/* Function to check Popup active flag */
211function popupaoc_popup_active_flag( index, $this, data_opts, options ) {
212
213	var paoc_check_active = false;
214
215	/* Return 0 if cookie expire is there & cookie value is also there */
216	if( typeof( data_opts.cookie_expire ) !== 'undefined' && data_opts.cookie_expire !== '' && popupaoc_get_cookie_value( data_opts.cookie_prefix +'_'+ data_opts.id ) != null ) {
217		return 0;
218	}
219
220	paoc_check_active = 1;
221
222	return paoc_check_active;
223}
224
225/* Function to Create Cookie */
226function popupaoc_create_cookie(name, value, time_val, type, samesite) {
227
228	var date, expires, expire_time, samesite;
229
230	time_val	= time_val	? time_val	: false;
231	type		= type		? type		: 'day';
232	samesite	= samesite	? ";SameSite="+samesite : '';
233
234	if( type == 'hour' ) {
235		expire_time = (time_val * 60 * 60 * 1000);
236
237	} else if( type == 'minutes' ) {
238		expire_time = (time_val * 60 * 1000);
239
240	} else {
241		expire_time = (time_val * 24 * 60 * 60 * 1000);
242	}
243
244	if ( time_val ) {
245		date = new Date();
246		date.setTime( date.getTime() + expire_time );
247		expires = "; expires="+date.toGMTString();
248	} else {
249		expires = "";
250	}
251	document.cookie = encodeURIComponent(name) + "=" + value + expires + "; path=/"+samesite;
252}
253
254/* Function to get cookie value */
255function popupaoc_get_cookie_value( cookie_name ) {
256
257	var result		= null;
258	var nameEQ		= cookie_name + "=";
259	var get_cookie	= document.cookie.split(';');
260
261	for (var i = 0; i < get_cookie.length; i++) {
262
263		var c = get_cookie[i];
264
265		while (c.charAt(0)==' ') {
266			c = c.substring( 1, c.length );
267		}
268
269		if (c.indexOf(nameEQ) == 0) {
270			result = c.substring(nameEQ.length,c.length);
271		}
272	}
273
274	return result;
275}

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.