PageSourceSearch

https://www.confesercenti.it/wp-content/plugins/gdpr-cookie-compli…/assets/js/gdpr_cc_addon.js?ver=3.5.2

js confesercenti.it collected 2026-09-24 18:18:29 UTC 9,266 bytes, 273 lines download raw bytes

1(function($) {
2  $(document).ready(function() {
3  	var addon_script_delay_2 = typeof  moove_frontend_gdpr_scripts !== 'undefined' && typeof moove_frontend_gdpr_scripts.script_delay !== 'undefined' && parseInt( moove_frontend_gdpr_scripts.script_delay ) ? parseInt( moove_frontend_gdpr_scripts.script_delay ) : 0;
4
5  	function addon_script_2_init() {
6  		try	{
7
8	  		if ( typeof moove_frontend_gdpr_scripts.ifbc !== 'undefined' ) {
9	  			if ( typeof moove_frontend_gdpr_scripts.ifbc_excl !== 'undefined' ) {
10						var ifb_excl 	= JSON.parse( moove_frontend_gdpr_scripts.ifbc_excl );
11					} else {
12						var ifb_excl = {};
13					}
14	  			function gdpr_ifbc_js_block_iframes( ) {
15	  				$(document).find('iframe').each(function() {
16	  					if ( ! $(this).attr('data-gdpr-iframesrc') ) {
17	  						var src 			= $(this).attr('src');
18	  						if ( src ) {
19	  							var change_iframe = true;
20	  							for (var i = ifb_excl.length - 1; i >= 0; i--) {
21	  								if (  src.indexOf( ifb_excl[i] ) >= 0 ) {
22	  									change_iframe = false;
23	  								}
24	  							}
25
26	  							if ( change_iframe ) {
27		    						var gdpr_src 	= moove_frontend_gdpr_scripts.ajaxurl;
28		    						var block_src = gdpr_src + '?action=gdpr_iframe_blocker&src=' + src;
29		    						$(this).attr('src', block_src);
30		    						$(this).attr('data-gdpr-iframesrc', src);
31		    						$(this).closest('.fb-video').addClass('fb-blocked-gdpr');
32		    					}
33	    					}
34	  					}
35	  				});
36	  			}
37	  			
38	  			function gdpr_restrict_iframes() {
39	  				if ( typeof $(document).moove_gdpr_read_cookies !== 'undefined' ) {
40		    			var cookies = $(document).moove_gdpr_read_cookies();
41		    			if ( cookies ) {
42			          if ( moove_frontend_gdpr_scripts.ifbc === 'strict' && cookies && parseInt( cookies.strict ) === 0 ) {
43			          	gdpr_ifbc_js_block_iframes();
44			          }
45
46			          if ( moove_frontend_gdpr_scripts.ifbc === 'thirdparty' && cookies && parseInt( cookies.thirdparty ) === 0 ) {
47			          	gdpr_ifbc_js_block_iframes();
48			          }
49
50			          if ( moove_frontend_gdpr_scripts.ifbc === 'advanced' && cookies && parseInt( cookies.advanced ) === 0 ) {
51			          	gdpr_ifbc_js_block_iframes();
52			          }
53			        } else {
54			        	gdpr_ifbc_js_block_iframes();
55			        }
56			      }
57	  			}
58	  			gdpr_restrict_iframes();
59
60		      var gdpr_observe_DOM = (function(){
61				  var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
62
63				  return function( obj, callback ){
64				    if( !obj || obj.nodeType !== 1 ) return; 
65
66				    if( MutationObserver ){
67				      // define a new observer
68				      var mutationObserver = new MutationObserver(callback)
69
70				      // have the observer observe for changes in children
71				      mutationObserver.observe( obj, { childList:true, subtree:true })
72				      return mutationObserver
73				    }
74				    
75				    // browser support fallback
76				    else if( window.addEventListener ){
77				      obj.addEventListener('DOMNodeInserted', callback, false)
78				      obj.addEventListener('DOMNodeRemoved', callback, false)
79				    }
80				  }
81				})();
82
83				gdpr_observe_DOM( document.getElementsByTagName("html")[0], function(m){ 
84				  var addedNodes = [];
85
86				  m.forEach(record => record.addedNodes.length & addedNodes.push(...record.addedNodes))
87				   
88				  if ( addedNodes && addedNodes.length > 0 ) {
89				  	addedNodes.forEach(item => {
90				  		if ( item.tagName === 'IFRAME' ) {
91				  			gdpr_restrict_iframes();
92				  		}
93				  	});
94				  }
95				});
96
97	      }
98	  	} catch( err ) {
99	  		console.warn(err);
100	  	}
101
102	  	function gdpr_cookie_compliance_setup_get_session( event_type ) {
103	  		var gdpr_uvid_session = false;
104	  		
105	  		if ( typeof( sessionStorage ) !== "undefined" ) {
106	  			gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid");
107	  			if ( ! gdpr_uvid_session ) {
108	  				sessionStorage.setItem( "gdpr_uvid", moove_frontend_gdpr_scripts.gdpr_uvid );
109	  				gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid");
110	  			}				
111				}
112			
113				return gdpr_uvid_session;
114	  	}
115	  	
116	  	function gdpr_cookie_compliance_get_cookies(){
117		  	var pairs = document.cookie.split(";");
118		  	var cookies = {};
119		  	for (var i=0; i<pairs.length; i++){
120		    	var pair = pairs[i].split("=");
121		    	cookies[(pair[0]+'').trim()] = unescape(pair[1]);
122		  	}
123		  	return cookies;
124			}
125
126			$(document).on('click','.gdpr-cd-details-toggle', function(e){
127				e.preventDefault();
128				var _this = $(this);
129				var text = _this.text();
130				var text2 = _this.attr('data-close');
131				_this.text(text2).append('<span></span>');
132				_this.attr('data-close',text);
133				_this.toggleClass('cd-details-open');
134				_this.parent().find('.gdpr-table-responsive-cnt').toggle();
135
136			});
137
138			function gdpr_cookie_compliance_set_cookies(name, value, days){
139		  	var expires;
140	      if (days) {
141	        var date = new Date();
142	        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
143	        expires = "; expires=" + date.toGMTString();
144	      } else {
145	        expires = "";
146	      }
147
148	      document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + expires + "; path=/";
149	      (JSON.parse(value));
150			}
151
152			var started = false;
153			var timeout_req = 2000;
154			var gdpr_timeout = 0;
155			var analytics_inserted = [];
156			$.fn.gdpr_cookie_compliance_analytics = function(event, extras) {
157				if ( typeof ( analytics_inserted[event] ) === 'undefined' || analytics_inserted[event] !== JSON.stringify( extras ) ) {
158					analytics_inserted[event] = JSON.stringify( extras );
159					if ( moove_frontend_gdpr_scripts.stats_enabled ) {
160						var gdpr_uvid_session = gdpr_cookie_compliance_setup_get_session( event );				
161						if ( !started ) {
162							gdpr_timeout = 0;
163						} else {
164							gdpr_timeout = gdpr_timeout + timeout_req;
165						}
166						started = true;
167
168						if ( event === 'script_inject' ) {
169				    		if ( typeof( localStorage ) !== "undefined" ) {
170				    			gdpr_uvid_session = localStorage.getItem("gdpr_uvid");
171				    			if ( ! gdpr_uvid_session ) {
172				    				localStorage.setItem( "gdpr_uvid", moove_frontend_gdpr_scripts.gdpr_uvid );
173				    				gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid");
174				    			} else {
175				    				if ( typeof( sessionStorage ) !== "undefined" ) {
176						    			_gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid");
177						    			if ( ! _gdpr_uvid_session ) {
178						    				_gdpr_uvid_session.setItem( "gdpr_uvid", moove_frontend_gdpr_scripts.gdpr_uvid );
179						    				gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid");
180						    			}
181						    			_event 		= 'existing_session';
182						    			_extras 	= '';
183						    			try {
184						            jQuery().gdpr_cookie_compliance_analytics_with_uvid( _event, _extras, _gdpr_uvid_session );
185						            jQuery().gdpr_cookie_compliance_analytics_with_uvid( 'script_injected', extras, _gdpr_uvid_session );
186							        } catch(err) {
187							        	// error
188							        }
189										}		
190				    			}				
191							}				
192						} 
193						setTimeout( function(){	
194							if ( gdpr_uvid_session && event ) {
195								$.post(
196					              	moove_frontend_gdpr_scripts.ajaxurl,
197					              	{
198						                action: 	"moove_gdpr_premium_save_analytics",
199						                event: 		event,
200						                extras: 	extras,
201						                gdpr_uvid: 	gdpr_uvid_session,
202						            },
203					              	function( msg ) {
204					              		// console.warn(gdpr_uvid_session);
205					              		if ( gdpr_timeout >= timeout_req ) {
206					              			gdpr_timeout = gdpr_timeout - timeout_req;
207					              		}
208					              	}
209					            );
210							}
211						}, gdpr_timeout );	
212					}
213				}
214			}	
215
216			$.fn.gdpr_cookie_compliance_consent_log = function( value ) {
217				if ( moove_frontend_gdpr_scripts.consent_log_enabled ) {
218					$.post(
219	        	moove_frontend_gdpr_scripts.ajaxurl,
220	        	{
221	            action: 	"save_consent_log",
222	            extras: 	value,
223	        	},
224	        	function( msg ) {
225	        		console.warn( msg );
226	        	}
227	      	);
228				}
229			}	
230
231			$.fn.gdpr_cookie_compliance_analytics_with_uvid = function(event, extras, uvid) {
232				if ( moove_frontend_gdpr_scripts.stats_enabled ) {
233					var gdpr_uvid_session = uvid;				
234					if ( !started ) {
235						gdpr_timeout = 0;
236					} else {
237						gdpr_timeout = gdpr_timeout + timeout_req;
238					}
239					started = true;
240
241					setTimeout( function(){	
242						if ( gdpr_uvid_session && event ) {
243							$.post(
244	            	moove_frontend_gdpr_scripts.ajaxurl,
245	            	{
246	                action: 	"moove_gdpr_premium_save_analytics",
247	                event: 		event,
248	                extras: 	extras,
249	                gdpr_uvid: 	gdpr_uvid_session,
250	            	},
251	            	function( msg ) {
252	            		// console.warn(gdpr_uvid_session);
253	            		if ( gdpr_timeout >= timeout_req ) {
254	            			gdpr_timeout = gdpr_timeout - timeout_req;
255	            		}
256	            	}
257	          	);
258						}
259					}, gdpr_timeout );
260					
261				}
262			}
263  	}
264
265  	if ( addon_script_delay_2 > 0 ) {
266			setTimeout( function(){
267				addon_script_2_init()
268			}, addon_script_delay_2 );
269		} else {
270			addon_script_2_init();
271		}
272 	});
273})(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.