PageSourceSearch

https://vinsdebandol.com/modules/gdprcompliancy/views/js/front.js

js vinsdebandol.com collected 2026-10-02 11:50:59 UTC 4,200 bytes, 163 lines download raw bytes

1/*
2 
3 ******************************************
4 *              EOLIA SHOP                *
5 *         https://eoliashop.com          *
6 *              2011 - 2018               *
7 ******************************************
8 
9 * @gdprcompliancy module for Prestashop
10 * @Help to make your shop GDPR compliant
11 * @Category frontoffice
12 * @Author Eolia - [email protected]
13 * @Version 2018-05-20
14 * @Prestashop modules
15 * @Copyright © 2011-2018, Devcustom.net
16 * @Commercial license 
17 * All rights reserved - Copying, duplication strictly prohibited
18 * Compatibility: PS version: 1.5 & 1.6
19 *
20 **/
21 
22function validPolicy() {
23	$('input#gdprcompliancy_agree_checkbox').prop('checked', true);
24	$('#uniform-gdprcompliancy_agree_checkbox span').addClass('checked');
25	$('#modal-policy').hide();
26}
27function refusePolicy() {
28	$('input#gdprcompliancy_agree_checkbox').click();
29	$('input#gdprcompliancy_agree_checkbox').prop('checked', false);
30	$('#uniform-gdprcompliancy_agree_checkbox span').removeClass('checked');
31	$('#modal-policy').hide();
32}	
33function refuseGDPR() {
34	$.ajax({
35		type: 'POST',
36		url: gdprcompliancy_url,
37		data: {
38			ajax: true,
39			action: 'Decline',
40			id_customer: gdprcompliancy_id_customer,
41			id_module: gdprcompliancy_id_module,
42		},
43		success: function(data) {
44			window.location = baseUri;
45		},
46		error: function(error) {
47			console.log(error);   
48		}
49	});
50}
51function validGDPR() {
52	var agree = $('[name="agree_gdpr"]');
53	var age = $('[name="age_gdpr"]');
54	if(agree.is(':checked') && age.is(':checked')) {
55		$.ajax({
56			type: 'POST',
57			url: gdprcompliancy_url,
58			data: {
59				ajax: true,
60				action: 'Consent',
61				id_customer: gdprcompliancy_id_customer,
62				id_module: gdprcompliancy_id_module,
63			},
64			success: function(data) {
65				$('.gdprcompliancy').fadeOut();
66				displayMess(greetMessage);
67				setTimeout( function() {
68					$.magnificPopup.close(); 
69					}, 2000
70				);
71			},
72			error: function(error) {
73				console.log(error);   
74			}
75		});
76	}
77	else {
78		if(!agree.is(':checked'))
79			displayMess(notAgreeMessage); 
80		else if(!age.is(':checked'))
81			displayMess(notAgeMessage); 
82	}
83}
84function displayMess(message)  {
85	$.magnificPopup.open({
86	  items: {
87		src: '<div class="white-popup-block">' + message + '</div>',
88		type: 'inline'
89	  }
90	});
91}
92function checkInput(elem, id) {
93	if($(elem).is(':checked')) {
94		$('#modal_'+id).fadeOut();
95	}
96	$('#module_check_'+id).css('color', '#3c9237');
97}
98$(document).ready(function() {
99	$('.close-modal').on('click', function() { 
100		var target = $(this).data('target');
101        $('#'+ target).hide(); 
102    });
103	$('[name="agree_gdpr"]').on('change', function() {
104		if($(this).is(':checked')) {
105			$('#modal-policy').show();
106		}
107		else {
108			$('#modal-policy').hide();	
109		}
110	});
111	$('form').each(function() {
112		var inputs = $(this).find(':input');
113		inputs.each(function(){
114			if($(this).hasClass('gdprcompliancy_consent_checkbox'))
115				$(this.form).addClass('verify');
116		});
117	});
118	$('form').on('submit', function(e) {
119		var thisForm = $(this);
120		if($(this).hasClass('verify')) {
121			var inputs = $(this).find(':input');
122			inputs.each(function(){
123				if($(this).hasClass('gdprcompliancy_consent_checkbox')) {
124					var gdprcompliancy_id_module = $(this).data('module');
125					if(!$(this).is(':checked')) {
126						e.preventDefault();
127						e.stopPropagation();
128						if($('#modal_'+gdprcompliancy_id_module).length > 0 && $('#modal_'+gdprcompliancy_id_module+':visible').length == 0) {
129							return $('#modal_'+gdprcompliancy_id_module).show();						
130						}
131						$('#module_check_'+gdprcompliancy_id_module+' *').css('color', 'red');
132					}
133					else {	
134						AddLog(e, gdprcompliancy_id_module, thisForm.find('input[name="email"]').val());
135					}
136				}
137			});
138		}
139	});
140});
141function AddLog(event, idModule, email) {
142	$.ajax({
143		type: 'POST',
144		url: gdprcompliancy_url,
145		data: {
146			ajax: true,
147			action: 'AddLog',
148			id_customer: gdprcompliancy_id_customer,
149			id_guest: gdprcompliancy_id_guest,
150			id_module: idModule,
151			email: email,
152		},
153		success: function(data) {
154			console.log(data);
155			displayMess(data);
156		},
157		error: function (error) {
158			event.preventDefault();
159			event.stopPropagation();
160			console.log(error);
161		}
162	});	
163}

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.