Closes #15
This commit is contained in:
parent
c081bca2ca
commit
2f2702caed
30 changed files with 1686 additions and 2020 deletions
|
|
@ -23,8 +23,6 @@ MAIL_ADMIN=equipe.web@ldc.fr
|
|||
PROJECT_UUID=de795411-08a3-4318-ac29-d30a2bb0e460
|
||||
LDCWEB_API_TOKEN=
|
||||
MAIL_LIST_SERVICEWEB=
|
||||
# LDC MESSAGE PLUGIN
|
||||
LDC_MSG_PLUGIN_RECAPTCHA=
|
||||
# ALPHAVANTAGE
|
||||
ALPHAVANTAGE_API_KEY=
|
||||
# Matomo
|
||||
|
|
@ -33,3 +31,6 @@ MATOMO_SITE_ID=
|
|||
CRM_ENDPOINT=
|
||||
CRM_TOKEN=
|
||||
CRM_PASSWORD=
|
||||
# RECAPTCHA
|
||||
RECAPTCHA_V3_PUBLIC=
|
||||
RECAPTCHA_V3_SECRET=
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ function ContactAjx()
|
|||
|
||||
$gToken = $_POST['token'];
|
||||
|
||||
$secret = getenv('LDC_MSG_PLUGIN_RECAPTCHA');
|
||||
$secret = getenv('RECAPTCHA_V3_SECRET');
|
||||
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]) && $_SERVER["HTTP_X_FORWARDED_FOR"] != "") {
|
||||
if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) {
|
||||
$explode = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h2 class="contacts-page-subtitle subtitle_paint"><?= the_title(); ?></h2>
|
||||
<h2 class="contacts-page-subtitle subtitle_paint"><?= esc_html(the_title()); ?></h2>
|
||||
<div class="contacts-category-page wrapper">
|
||||
<div class="contact-page-tetx-block">
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h2 class="contacts-page-subtitle subtitle_paint"><?= the_title(); ?></h2>
|
||||
<h2 class="contacts-page-subtitle subtitle_paint"><?= esc_html(the_title()); ?></h2>
|
||||
<div class="contacts-category-page wrapper">
|
||||
<div class="back-button-wrapper">
|
||||
<a href="/nous-contacter/" class="back-button" title="Retour au choix de contact"><?php _e('Return to choice of contact', 'LDC Custom string'); ?></a>
|
||||
|
|
@ -9,51 +9,51 @@
|
|||
<div class="form-top-text"><?php _e('Are you a poultry farmer or would you like to become one and join us?', 'LDC Custom string'); ?>
|
||||
<br><?php _e('Describe your project as precisely as possible so that we can guide your ask to the appropriate contact person.', 'LDC Custom string'); ?>
|
||||
</div>
|
||||
<div class="form__row justify-content-center">
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Surname', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>" autocomplete="family-name" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('First name', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>" autocomplete="given-name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Telephone', 'LDC Custom string'); ?> *</div>
|
||||
<input type="tel" name="phone" size="20" class="form__input"
|
||||
placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" required>
|
||||
<input type="tel" name="phone" size="20" class="form__input" placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" autocomplete="tel" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Email address', 'LDC Custom string'); ?> *</div>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true"
|
||||
aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" required>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true" aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" autocomplete="email" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Type of breeding desired', 'LDC Custom string'); ?> * <span
|
||||
class="normal">(<?php _e('multiple choice', 'LDC Custom string'); ?>)</span></div>
|
||||
<div class="form__field-title"><?php _e('Type of breeding desired', 'LDC Custom string'); ?> * <span class="normal">(<?php _e('multiple choice', 'LDC Custom string'); ?>)</span></div>
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="types" value="Poulets/dindes/pintades" required>
|
||||
<input type="checkbox" name="typeelevage" value="Poulets/dindes/pintades" required>
|
||||
<span class="form__field-pseudocircle"><?php _e('Chickens / turkeys / guinea fowl', 'LDC Custom string'); ?></span>
|
||||
</label>
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="types" value="Canards" required>
|
||||
<input type="checkbox" name="typeelevage" value="Canards" required>
|
||||
<span class="form__field-pseudocircle"><?php _e('Ducks', 'LDC Custom string'); ?></span>
|
||||
</label>
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="types" value="Poules pondeuses" required>
|
||||
<input type="checkbox" name="typeelevage" value="Poules pondeuses" required>
|
||||
<span class="form__field-pseudocircle"><?php _e('Laying hens', 'LDC Custom string'); ?></span>
|
||||
</label>
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="types" value="Autres" required>
|
||||
<input type="checkbox" name="typeelevage" value="Autres" required>
|
||||
<span class="form__field-pseudocircle"><?php _e('Other', 'LDC Custom string'); ?></span>
|
||||
</label>
|
||||
<div class="form__error" id="<?= $post->ID; ?>_types" style="display: none;"><?php _e('This field is mandatory', 'LDC Custom string'); ?>
|
||||
<div class="form__error" id="<?= esc_attr($post->ID); ?>_types" style="display: none;"><?php _e('This field is mandatory', 'LDC Custom string'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -65,11 +65,35 @@
|
|||
<div class="geographic-checkboxes-result form__input"><span class="zones-wrapper"><?php _e('Drop-down list of departments', 'LDC Custom string'); ?></span>
|
||||
</div>
|
||||
<div class="geographic-checkboxes-list">
|
||||
<?php $dps = ["Ain", "Aisne", "Allier", "Alpes-de-Haute-Provence", "Alpes-Maritimes", "Ardèche", "Ardennes", "Ariège", "Aube", "Aude", "Aveyron", "Bas-Rhin", "Bouches-du-Rhône", "Calvados", "Cantal", "Charente", "Charente-Maritime", "Cher", "Corrèze", "Corse-du-Sud", "Côte-d'Or", "Côtes-d'Armor", "Creuse", "Deux-Sèvres", "Dordogne", "Doubs", "Drôme", "Essonne", "Eure", "Eure-et-Loir", "Finistère", "Gard", "Gers", "Gironde", "Guadeloupe", "Guyane", "Haut-Rhin", "Haute-Corse", "Haute-Garonne", "Haute-Loire", "Haute-Marne", "Haute-Saône", "Haute-Savoie", "Haute-Vienne", "Hautes-Alpes", "Hautes-Pyrénées", "Hauts-de-Seine", "Hérault", "Ille-et-Vilaine", "Indre", "Indre-et-Loire", "Isère", "Jura", "La,Réunion", "Landes", "Loir-et-Cher", "Loire", "Loire-Atlantique", "Loiret", "Lot", "Lot-et-Garonne", "Lozère", "Lyon,Metropolis", "Maine-et-Loire", "Manche", "Marne", "Martinique", "Mayenne", "Mayotte", "Meurthe-et-Moselle", "Meuse", "Morbihan", "Moselle", "Nièvre", "Nord", "Oise", "Orne", "Paris", "Pas-de-Calais", "Puy-de-Dôme", "Pyrénées-Atlantiques", "Pyrénées-Orientales", "Rhône", "Saône-et-Loire", "Sarthe", "Savoie", "Seine-Maritime", "Seine-et-Marne", "Seine-Saint-Denis", "Somme", "Tarn", "Tarn-et-Garonne", "Territoire,de,Belfort", "Var", "Val-d'Oise", "Val-de-Marne", "Vaucluse", "Vendée", "Vienne", "Vosges", "Yonne", "Yvelines"]; ?>
|
||||
<?php foreach ($dps as $dp): ?>
|
||||
<?php
|
||||
$dps = [
|
||||
"Ain", "Aisne", "Allier", "Alpes-de-Haute-Provence",
|
||||
"Alpes-Maritimes", "Ardèche", "Ardennes", "Ariège",
|
||||
"Aube", "Aude", "Aveyron", "Bas-Rhin", "Bouches-du-Rhône",
|
||||
"Calvados", "Cantal", "Charente", "Charente-Maritime", "Cher",
|
||||
"Corrèze", "Corse-du-Sud", "Côte-d'Or", "Côtes-d'Armor", "Creuse",
|
||||
"Deux-Sèvres", "Dordogne", "Doubs", "Drôme", "Essonne", "Eure",
|
||||
"Eure-et-Loir", "Finistère", "Gard", "Gers", "Gironde", "Guadeloupe",
|
||||
"Guyane", "Haut-Rhin", "Haute-Corse", "Haute-Garonne", "Haute-Loire",
|
||||
"Haute-Marne", "Haute-Saône", "Haute-Savoie", "Haute-Vienne",
|
||||
"Hautes-Alpes", "Hautes-Pyrénées", "Hauts-de-Seine", "Hérault",
|
||||
"Ille-et-Vilaine", "Indre", "Indre-et-Loire", "Isère", "Jura",
|
||||
"La,Réunion", "Landes", "Loir-et-Cher", "Loire", "Loire-Atlantique",
|
||||
"Loiret", "Lot", "Lot-et-Garonne", "Lozère", "Lyon,Metropolis",
|
||||
"Maine-et-Loire", "Manche", "Marne", "Martinique", "Mayenne", "Mayotte",
|
||||
"Meurthe-et-Moselle", "Meuse", "Morbihan", "Moselle", "Nièvre",
|
||||
"Nord", "Oise", "Orne", "Paris", "Pas-de-Calais", "Puy-de-Dôme",
|
||||
"Pyrénées-Atlantiques", "Pyrénées-Orientales", "Rhône",
|
||||
"Saône-et-Loire", "Sarthe", "Savoie", "Seine-Maritime",
|
||||
"Seine-et-Marne", "Seine-Saint-Denis", "Somme", "Tarn",
|
||||
"Tarn-et-Garonne", "Territoire,de,Belfort", "Var", "Val-d'Oise",
|
||||
"Val-de-Marne", "Vaucluse", "Vendée", "Vienne", "Vosges",
|
||||
"Yonne", "Yvelines"
|
||||
]; ?>
|
||||
<?php foreach ($dps as $dp) : ?>
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="geo" value="<?= $dp; ?>" required>
|
||||
<span class="form__field-pseudosquare"><?= $dp; ?></span>
|
||||
<input type="checkbox" name="zonegeo" value="<?= esc_attr($dp); ?>" required>
|
||||
<span class="form__field-pseudosquare"><?= esc_html($dp); ?></span>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
|
@ -81,20 +105,16 @@
|
|||
<div class="form__field-title"><?php _e('Your project', 'LDC Custom string'); ?> *</div>
|
||||
|
||||
<div class="form__field">
|
||||
<textarea name="message" cols="40" rows="10" class="form__input"
|
||||
placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
<textarea name="message" cols="40" rows="10" class="form__input" placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="agree">
|
||||
<span class="form__field-pseudosquare"><?php _e('I accept the conditions of use', 'LDC Custom string'); ?> *</span>
|
||||
</label>
|
||||
<!--<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="newsletter">
|
||||
<span class="form__field-pseudosquare"><?php /*_e('I would like to subscribe to the newsletter', 'LDC Custom string'); */?></span>
|
||||
</label>-->
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<span class="form__field-label-text">Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter <br> <a href="/politique-de-confidentialite/" target="_blank">la Charte de confidentialité</a></span>
|
||||
<?php else : ?>
|
||||
<span class="form__field-label-text">The information collected from this form is processed by the Data Controller to respond to your contact request. To know your rights, you can consult <br> <a href="/en/privacy-policy/" target="_blank">the Confidentiality Charter</a></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
|
|
@ -116,95 +136,60 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
$i18NCnList = [
|
||||
'must_activate_cookies' => ['Vous devez activer les cookies recaptcha', 'You must enable recaptcha cookies'],
|
||||
'succeed' => [
|
||||
'Bonjour. Nous vous remercions de nous avoir contactés pour nous rejoindre en tant qu\'éleveur. Notre équipe Élevage vous répondra dans les meilleurs délais.',
|
||||
'Hello. Thank you for contacting us to join us as a breeder. Our Livestock team will respond to you as soon as possible.'
|
||||
],
|
||||
'invalid_email' => ['Le format de l\'adresse email est invalide.', 'The email address format is invalid.'],
|
||||
'error' => ['Une erreur est survenue, veuillez recharger la page.', 'An error has occurred, please reload the page.']
|
||||
];
|
||||
?>
|
||||
<?php require_once(__DIR__ . '/ajax_contact.php') ?>
|
||||
|
||||
<script>
|
||||
const inputs = {
|
||||
required: {
|
||||
lastname: $("input[name=lastname]"),
|
||||
firstname: $("input[name=firstname]"),
|
||||
email: $("input[name=email]"),
|
||||
message: $("textarea[name=message]"),
|
||||
phone: $("input[name=phone]"),
|
||||
typeelevage: $('input[name=typeelevage]'),
|
||||
zonegeo: $('input[name=zonegeo]')
|
||||
},
|
||||
optional: {}
|
||||
};
|
||||
|
||||
let processing = false;
|
||||
let lastname = $("input[name=lastname]");
|
||||
let firstname = $("input[name=firstname]");
|
||||
let phone = $("input[name=phone]");
|
||||
let email = $("input[name=email]");
|
||||
let message = $("textarea[name=message]");
|
||||
let agree = $("input[name=agree]");
|
||||
// TODO : Gestion newsletter
|
||||
/*let newsletter = $("input[name=newsletter]");*/
|
||||
|
||||
function reset() {
|
||||
lastname.val('');
|
||||
firstname.val('');
|
||||
phone.val('');
|
||||
email.val('');
|
||||
message.val('');
|
||||
|
||||
$('input[name=types]').prop("checked", false);
|
||||
$('input[name=geo]').prop("checked", false);
|
||||
$('.geographic-checkboxes-result').html('');
|
||||
|
||||
agree.prop("checked", false);
|
||||
/*newsletter.prop("checked", false);*/
|
||||
}
|
||||
|
||||
$("input[type=submit]").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (processing === true)
|
||||
return;
|
||||
|
||||
let types = $('input[name=types]:checked').map(function (_, el) {
|
||||
return $(el).val();
|
||||
}).get();
|
||||
|
||||
let geo = $('input[name=geo]:checked').map(function (_, el) {
|
||||
return $(el).val();
|
||||
}).get();
|
||||
|
||||
|
||||
if (lastname.val().length > 0 && firstname.val().length > 0 && email.val().length > 0 && phone.val().length > 0 && message.val().length > 0 && types.length > 0 && geo.length > 0) {
|
||||
|
||||
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email.val())) {
|
||||
|
||||
$(".form__response").hide();
|
||||
|
||||
if (agree.is(':checked') === false) {
|
||||
alert("Vous devez accepter les conditions d'utilisation.");
|
||||
} else {
|
||||
processing = true;
|
||||
grecaptcha.ready(function () {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {action: 'contact'}).then(function (token) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: window.location.origin + '/wp-admin/admin-ajax.php',
|
||||
data: {
|
||||
'token': token,
|
||||
'action': 'ContactAjx',
|
||||
'id': <?= $post->ID; ?>,
|
||||
'firstname': firstname.val(),
|
||||
'lastname': lastname.val(),
|
||||
'email': email.val(),
|
||||
'phone': phone.val(),
|
||||
'message': message.val(),
|
||||
'zonegeo': geo,
|
||||
'typeelevage': types
|
||||
},
|
||||
success: function (response, textStatus, jqXHR) {
|
||||
reset();
|
||||
alert('Bonjour. Nous vous remercions de nous avoir contactés pour nous rejoindre en tant qu\'éleveur. Notre équipe Élevage vous répondra dans les meilleurs délais.');
|
||||
processing = false;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Une erreur est survenue, veuillez recharger la page.');
|
||||
processing = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
listenFormSubmit(
|
||||
// INPUTS
|
||||
inputs,
|
||||
// DATA
|
||||
() => Object.fromEntries([
|
||||
...[
|
||||
...Object.entries(inputs.required),
|
||||
...Object.entries(inputs.optional),
|
||||
].map(entry => [entry[0], entry[1].val()]),
|
||||
...Object.entries({
|
||||
typeelevage: inputs.required.typeelevage.filter((_, el) => el.checked).map((_, el) => el.value).get(),
|
||||
zonegeo: inputs.required.zonegeo.filter((_, el) => el.checked).map((_, el) => el.value).get()
|
||||
})
|
||||
]),
|
||||
// RESET
|
||||
() => {
|
||||
const resetFn = $input => {
|
||||
if ($input.is("input[type='checkbox']")) {
|
||||
$input.prop("checked", false);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
alert('Le format de l\'adresse email est invalide.');
|
||||
}
|
||||
|
||||
} else {
|
||||
$(".form__response").show();
|
||||
$input.val('');
|
||||
};
|
||||
[...Object.values(inputs.required)].forEach(resetFn);
|
||||
[...Object.values(inputs.optional)].forEach(resetFn);
|
||||
$('.geographic-checkboxes-result').html('');
|
||||
}
|
||||
|
||||
});
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h2 class="contacts-page-subtitle subtitle_paint"><?= the_title(); ?></h2>
|
||||
<h2 class="contacts-page-subtitle subtitle_paint"><?= esc_html(the_title()); ?></h2>
|
||||
<div class="contacts-category-page wrapper">
|
||||
<div class="back-button-wrapper">
|
||||
<a href="/nous-contacter/" class="back-button" title="Retour au choix de contact"><?php _e('Return to choice of contact', 'LDC Custom string'); ?></a>
|
||||
|
|
@ -6,16 +6,19 @@
|
|||
<div class="contacts-form__wrapper">
|
||||
<form class="form">
|
||||
<div class="form__container">
|
||||
<div class="form__row justify-content-center">
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Surname', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>" autocomplete="family-name" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('First name', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>" autocomplete="given-name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
|
|
@ -26,16 +29,16 @@
|
|||
</div>
|
||||
<div class="geographic-checkboxes-list">
|
||||
<?php
|
||||
// $typesList = ["Client", "Fournisseur", 'Autre'];
|
||||
$typesList = array();
|
||||
$typesList[] = __('Customer', 'LDC Custom string');
|
||||
$typesList[] = __('Supplier', 'LDC Custom string');
|
||||
$typesList[] = __('Other', 'LDC Custom string');
|
||||
?>
|
||||
<?php foreach ($typesList as $t): ?>
|
||||
/** ["Client", "Fournisseur", 'Autre'] */
|
||||
$typesList = array();
|
||||
$typesList[] = __('Customer', 'LDC Custom string');
|
||||
$typesList[] = __('Supplier', 'LDC Custom string');
|
||||
$typesList[] = __('Other', 'LDC Custom string');
|
||||
?>
|
||||
<?php foreach ($typesList as $t) : ?>
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="types" value="<?= $t; ?>" required>
|
||||
<span class="form__field-pseudosquare"><?= $t; ?></span>
|
||||
<input type="checkbox" name="type" value="<?= esc_attr($t); ?>" required>
|
||||
<span class="form__field-pseudosquare"><?= esc_html($t); ?></span>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
|
@ -45,28 +48,25 @@
|
|||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Postcode', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="postalcode" size="40" class="form__input"
|
||||
placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="postalcode" size="40" class="form__input" placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" autocomplete="postal-code" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Town', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" autocomplete="address-level2" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Country', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="country" size="40" class="form__input" placeholder="<?php _e('Your country', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="country" size="40" class="form__input" placeholder="<?php _e('Your country', 'LDC Custom string'); ?>" autocomplete="country" required>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Email address', 'LDC Custom string'); ?> *</div>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true"
|
||||
aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" required>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true" aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" autocomplete="email" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Telephone', 'LDC Custom string'); ?></div>
|
||||
<input type="tel" name="phone" size="20" class="form__input"
|
||||
placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>">
|
||||
<input type="tel" name="phone" size="20" class="form__input" placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" autocomplete="tel">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -74,20 +74,16 @@
|
|||
<div class="form__field-title"><?php _e('Message', 'LDC Custom string'); ?> *</div>
|
||||
|
||||
<div class="form__field">
|
||||
<textarea name="message" cols="40" rows="10" class="form__input"
|
||||
placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
<textarea name="message" cols="40" rows="10" class="form__input" placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="agree">
|
||||
<span class="form__field-pseudosquare"><?php _e('I accept the conditions of use', 'LDC Custom string'); ?> *</span>
|
||||
</label>
|
||||
<!--<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="newsletter">
|
||||
<span class="form__field-pseudosquare"><?php /*_e('I would like to subscribe to the newsletter', 'LDC Custom string'); */?></span>
|
||||
</label>-->
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<span class="form__field-label-text">Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter <br> <a href="/politique-de-confidentialite/" target="_blank">la Charte de confidentialité</a></span>
|
||||
<?php else : ?>
|
||||
<span class="form__field-label-text">The information collected from this form is processed by the Data Controller to respond to your contact request. To know your rights, you can consult <br> <a href="/en/privacy-policy/" target="_blank">the Confidentiality Charter</a></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
|
|
@ -109,96 +105,64 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
$i18NCnList = [
|
||||
'must_activate_cookies' => ['Vous devez activer les cookies recaptcha', 'You must enable recaptcha cookies'],
|
||||
'succeed' => [
|
||||
'Bonjour. Nous vous remercions de nous avoir contactés pour une demande liée à l\'Export. Notre équipe vous répondra dans les meilleurs délais.',
|
||||
'Hello. Thank you for contacting us for an Export-related request. Our team will respond to you as soon as possible.'
|
||||
],
|
||||
'invalid_email' => ['Le format de l\'adresse email est invalide.', 'The email address format is invalid.'],
|
||||
'error' => ['Une erreur est survenue, veuillez recharger la page.', 'An error has occurred, please reload the page.']
|
||||
];
|
||||
?>
|
||||
<?php require_once(__DIR__ . '/ajax_contact.php') ?>
|
||||
|
||||
<script>
|
||||
|
||||
let processing = false;
|
||||
let lastname = $("input[name=lastname]");
|
||||
let firstname = $("input[name=firstname]");
|
||||
let postalcode = $("input[name=postalcode]");
|
||||
let country = $("input[name=country]");
|
||||
let town = $("input[name=town]");
|
||||
let email = $("input[name=email]");
|
||||
let phone = $("input[name=phone]");
|
||||
let message = $("textarea[name=message]");
|
||||
let agree = $("input[name=agree]");
|
||||
// TODO : Gestion newsletter
|
||||
/*let newsletter = $("input[name=newsletter]");*/
|
||||
|
||||
function reset() {
|
||||
lastname.val('');
|
||||
firstname.val('');
|
||||
postalcode.val('');
|
||||
country.val('');
|
||||
town.val('');
|
||||
email.val('');
|
||||
phone.val('');
|
||||
message.val('');
|
||||
|
||||
$('input[name=types]').prop("checked", false);
|
||||
$('.geographic-checkboxes-result').html('');
|
||||
|
||||
agree.prop("checked", false);
|
||||
/*newsletter.prop("checked", false);*/
|
||||
}
|
||||
|
||||
$("input[type=submit]").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (processing === true)
|
||||
return;
|
||||
|
||||
let types = $('input[name=types]:checked').map(function (_, el) {
|
||||
return $(el).val();
|
||||
}).get();
|
||||
|
||||
if (lastname.val().length > 0 && firstname.val().length > 0 && postalcode.val().length > 0 && country.val().length > 0 && town.val().length > 0 && email.val().length > 0 && message.val().length > 0 && types.length > 0) {
|
||||
|
||||
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email.val())) {
|
||||
|
||||
$(".form__response").hide();
|
||||
|
||||
if (agree.is(':checked') === false) {
|
||||
alert("Vous devez accepter les conditions d'utilisation.");
|
||||
} else {
|
||||
processing = true;
|
||||
grecaptcha.ready(function () {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {action: 'contact'}).then(function (token) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: window.location.origin + '/wp-admin/admin-ajax.php',
|
||||
data: {
|
||||
'token': token,
|
||||
'action': 'ContactAjx',
|
||||
'id': <?= $post->ID; ?>,
|
||||
'firstname': firstname.val(),
|
||||
'lastname': lastname.val(),
|
||||
'postalcode': postalcode.val(),
|
||||
'country': country.val(),
|
||||
'town': town.val(),
|
||||
'email': email.val(),
|
||||
'phone': phone.val(),
|
||||
'message': message.val(),
|
||||
'type': types
|
||||
},
|
||||
success: function (response, textStatus, jqXHR) {
|
||||
reset();
|
||||
alert('Bonjour. Nous vous remercions de nous avoir contactés pour une demande liée à l\'Export. Notre équipe vous répondra dans les meilleurs délais.');
|
||||
processing = false;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Une erreur est survenue, veuillez recharger la page.');
|
||||
processing = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert('Le format de l\'adresse email est invalide.');
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const inputs = {
|
||||
required: {
|
||||
lastname: $("input[name=lastname]"),
|
||||
firstname: $("input[name=firstname]"),
|
||||
type: $('input[name=type]'),
|
||||
postalcode: $("input[name=postalcode]"),
|
||||
town: $("input[name=town]"),
|
||||
country: $("input[name=country]"),
|
||||
email: $("input[name=email]"),
|
||||
message: $("textarea[name=message]"),
|
||||
},
|
||||
optional: {
|
||||
phone: $("input[name=phone]"),
|
||||
}
|
||||
} else {
|
||||
$(".form__response").show();
|
||||
}
|
||||
};
|
||||
|
||||
listenFormSubmit(
|
||||
// INPUTS
|
||||
inputs,
|
||||
// DATA
|
||||
() => Object.fromEntries([
|
||||
...[
|
||||
...Object.entries(inputs.required),
|
||||
...Object.entries(inputs.optional),
|
||||
].map(entry => [entry[0], entry[1].val()]),
|
||||
...Object.entries({
|
||||
type: inputs.required.type.filter((_, el) => el.checked).map((_, el) => el.value).get()
|
||||
})
|
||||
]),
|
||||
// RESET
|
||||
() => {
|
||||
const resetFn = $input => {
|
||||
if ($input.is("input[type='checkbox']")) {
|
||||
$input.prop("checked", false);
|
||||
return;
|
||||
}
|
||||
$input.val('');
|
||||
};
|
||||
[...Object.values(inputs.required)].forEach(resetFn);
|
||||
[...Object.values(inputs.optional)].forEach(resetFn);
|
||||
$('.geographic-checkboxes-result').html('');
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h2 class="contacts-page-subtitle subtitle_paint"><?= the_title(); ?></h2>
|
||||
<h2 class="contacts-page-subtitle subtitle_paint"><?= esc_html(the_title()); ?></h2>
|
||||
<div class="contacts-category-page wrapper">
|
||||
<div class="back-button-wrapper">
|
||||
<a href="/nous-contacter/" class="back-button" title="Retour au choix de contact"><?php _e('Return to choice of contact', 'LDC Custom string'); ?></a>
|
||||
|
|
@ -6,78 +6,71 @@
|
|||
<div class="contacts-form__wrapper">
|
||||
<form class="form">
|
||||
<div class="form__container">
|
||||
<div class="form__row justify-content-center">
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Surname', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>" autocomplete="family-name" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('First name', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>" autocomplete="given-name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Address', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="address" size="40" class="form__input" placeholder="<?php _e('Your address', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="address" size="40" class="form__input" placeholder="<?php _e('Your address', 'LDC Custom string'); ?>" autocomplete="street-address" required>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Postcode', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="postalcode" size="40" class="form__input"
|
||||
placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="postalcode" size="40" class="form__input" placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" autocomplete="postal-code" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Town', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" autocomplete="address-level2" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Country', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="country" size="40" class="form__input" placeholder="<?php _e('Your country', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="country" size="40" class="form__input" placeholder="<?php _e('Your country', 'LDC Custom string'); ?>" autocomplete="country" required>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Email address', 'LDC Custom string'); ?> *</div>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true"
|
||||
aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" required>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true" aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" autocomplete="email" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Telephone', 'LDC Custom string'); ?></div>
|
||||
<input type="tel" name="phone" size="20" class="form__input"
|
||||
placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>">
|
||||
<input type="tel" name="phone" size="20" class="form__input" placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" autocomplete="tel">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Establishment', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="establishment" size="40" class="form__input"
|
||||
placeholder="Votre établissement" required>
|
||||
<input type="text" name="establishment" size="40" class="form__input" placeholder="Votre établissement" autocomplete="organization" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Type of catering / business', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="type" size="40" class="form__input"
|
||||
placeholder="<?php _e('Type of catering / business', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="type" size="40" class="form__input" placeholder="<?php _e('Type of catering / business', 'LDC Custom string'); ?>" required>
|
||||
</div>
|
||||
<div class="form__container">
|
||||
<div class="form__field-title"><?php _e('Message', 'LDC Custom string'); ?> *</div>
|
||||
|
||||
<div class="form__field">
|
||||
<textarea name="message" cols="40" rows="10" class="form__input"
|
||||
placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
<textarea name="message" cols="40" rows="10" class="form__input" placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="agree">
|
||||
<span class="form__field-pseudosquare"><?php _e('I accept the conditions of use', 'LDC Custom string'); ?> *</span>
|
||||
</label>
|
||||
<!-- <label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="newsletter">
|
||||
<span class="form__field-pseudosquare"><?php /*_e('I would like to subscribe to the newsletter', 'LDC Custom string'); */?></span>
|
||||
</label>-->
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<span class="form__field-label-text">Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter <br> <a href="/politique-de-confidentialite/" target="_blank">la Charte de confidentialité</a></span>
|
||||
<?php else : ?>
|
||||
<span class="form__field-label-text">The information collected from this form is processed by the Data Controller to respond to your contact request. To know your rights, you can consult <br> <a href="/en/privacy-policy/" target="_blank">the Confidentiality Charter</a></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
|
|
@ -99,98 +92,61 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$i18NCnList = [
|
||||
'must_activate_cookies' => ['Vous devez activer les cookies recaptcha', 'You must enable recaptcha cookies'],
|
||||
'succeed' => [
|
||||
'Bonjour. Nous vous remercions de nous avoir contactés pour une demande liée à l\'Export. Notre équipe vous répondra dans les meilleurs délais.',
|
||||
'Hello. Thank you for contacting us for an Export-related request. Our team will respond to you as soon as possible.'
|
||||
],
|
||||
'invalid_email' => ['Le format de l\'adresse email est invalide.', 'The email address format is invalid.'],
|
||||
'error' => ['Une erreur est survenue, veuillez recharger la page.', 'An error has occurred, please reload the page.']
|
||||
];
|
||||
?>
|
||||
<?php require_once(__DIR__ . '/ajax_contact.php') ?>
|
||||
|
||||
<script>
|
||||
|
||||
let processing = false;
|
||||
let lastname = $("input[name=lastname]");
|
||||
let firstname = $("input[name=firstname]");
|
||||
let address = $('input[name=address]');
|
||||
let postalcode = $("input[name=postalcode]");
|
||||
let country = $("input[name=country]");
|
||||
let town = $("input[name=town]");
|
||||
let email = $("input[name=email]");
|
||||
let phone = $("input[name=phone]");
|
||||
let establishment = $('input[name=establishment]');
|
||||
let type = $('input[name=type]');
|
||||
let message = $("textarea[name=message]");
|
||||
let agree = $("input[name=agree]");
|
||||
// TODO : Gestion newsletter
|
||||
/* let newsletter = $("input[name=newsletter]");*/
|
||||
|
||||
function reset() {
|
||||
lastname.val('');
|
||||
firstname.val('');
|
||||
address.val('');
|
||||
postalcode.val('');
|
||||
country.val('');
|
||||
town.val('');
|
||||
email.val('');
|
||||
phone.val('');
|
||||
establishment.val('');
|
||||
type.val('');
|
||||
message.val('');
|
||||
|
||||
agree.prop("checked", false);
|
||||
/* newsletter.prop("checked", false);*/
|
||||
}
|
||||
|
||||
$("input[type=submit]").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (processing === true)
|
||||
return;
|
||||
|
||||
if (lastname.val().length > 0 && firstname.val().length > 0 && address.val().length > 0 && postalcode.val().length > 0 && country.val().length > 0 && town.val().length > 0 && email.val().length > 0 && establishment.val().length > 0 && type.val().length > 0 && message.val().length > 0) {
|
||||
|
||||
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email.val())) {
|
||||
|
||||
$(".form__response").hide();
|
||||
|
||||
if (agree.is(':checked') === false) {
|
||||
alert("Vous devez accepter les conditions d'utilisation.");
|
||||
} else {
|
||||
processing = true;
|
||||
grecaptcha.ready(function () {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {action: 'contact'}).then(function (token) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: window.location.origin + '/wp-admin/admin-ajax.php',
|
||||
data: {
|
||||
'token': token,
|
||||
'action': 'ContactAjx',
|
||||
'id': <?= $post->ID; ?>,
|
||||
'firstname': firstname.val(),
|
||||
'lastname': lastname.val(),
|
||||
'address': address.val(),
|
||||
'postalcode': postalcode.val(),
|
||||
'country': country.val(),
|
||||
'town': town.val(),
|
||||
'email': email.val(),
|
||||
'phone': phone.val(),
|
||||
'establishment': establishment.val(),
|
||||
'type': type.val(),
|
||||
'message': message.val(),
|
||||
},
|
||||
success: function (response, textStatus, jqXHR) {
|
||||
reset();
|
||||
alert('Bonjour. Nous vous remercions de nous avoir contactés. Notre équipe commerciale vous répondra dans les meilleurs délais.');
|
||||
processing = false;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Une erreur est survenue, veuillez recharger la page.');
|
||||
processing = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert('Le format de l\'adresse email est invalide.');
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const inputs = {
|
||||
required: {
|
||||
lastname: $("input[name=lastname]"),
|
||||
firstname: $("input[name=firstname]"),
|
||||
type: $('input[name=type]'),
|
||||
postalcode: $("input[name=postalcode]"),
|
||||
town: $("input[name=town]"),
|
||||
country: $("input[name=country]"),
|
||||
email: $("input[name=email]"),
|
||||
establishment: $("input[name=establishment]"),
|
||||
message: $("textarea[name=message]"),
|
||||
},
|
||||
optional: {
|
||||
phone: $("input[name=phone]"),
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
$(".form__response").show();
|
||||
}
|
||||
|
||||
listenFormSubmit(
|
||||
// INPUTS
|
||||
inputs,
|
||||
// DATA
|
||||
() => Object.fromEntries([
|
||||
...[
|
||||
...Object.entries(inputs.required),
|
||||
...Object.entries(inputs.optional),
|
||||
].map(entry => [entry[0], entry[1].val()])
|
||||
]),
|
||||
// RESET
|
||||
() => {
|
||||
const resetFn = $input => {
|
||||
if ($input.is("input[type='checkbox']")) {
|
||||
$input.prop("checked", false);
|
||||
return;
|
||||
}
|
||||
$input.val('');
|
||||
};
|
||||
[...Object.values(inputs.required)].forEach(resetFn);
|
||||
[...Object.values(inputs.optional)].forEach(resetFn);
|
||||
$('.geographic-checkboxes-result').html('');
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h2 class="contacts-page-subtitle subtitle_paint"><?= the_title(); ?></h2>
|
||||
<h2 class="contacts-page-subtitle subtitle_paint"><?= esc_html(the_title()); ?></h2>
|
||||
<div class="contacts-category-page wrapper">
|
||||
<div class="back-button-wrapper">
|
||||
<a href="/nous-contacter/" class="back-button" title="Retour au choix de contact"><?php _e('Return to choice of contact', 'LDC Custom string'); ?></a>
|
||||
|
|
@ -6,59 +6,57 @@
|
|||
<div class="contacts-form__wrapper">
|
||||
<form class="form">
|
||||
<div class="form__container">
|
||||
<div class="form__row justify-content-center">
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Surname', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>" autocomplete="family-name" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('First name', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>" autocomplete="given-name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Postcode', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="postalcode" size="40" class="form__input"
|
||||
placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="postalcode" size="40" class="form__input" placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" autocomplete="postal-code" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Town', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" autocomplete="address-level2" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Email address', 'LDC Custom string'); ?> *</div>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true"
|
||||
aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" required>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true" aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" autocomplete="email" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Telephone', 'LDC Custom string'); ?></div>
|
||||
<input type="tel" name="phone" size="20" class="form__input"
|
||||
placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>">
|
||||
<input type="tel" name="phone" size="20" class="form__input" placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" autocomplete="tel">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__container">
|
||||
<div class="form__field-title"><?php _e('Message', 'LDC Custom string'); ?> *</div>
|
||||
|
||||
<div class="form__field">
|
||||
<textarea name="message" cols="40" rows="10" class="form__input"
|
||||
placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
<textarea name="message" cols="40" rows="10" class="form__input" placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="agree">
|
||||
<span class="form__field-pseudosquare"><?php _e('I accept the conditions of use', 'LDC Custom string'); ?> *</span>
|
||||
</label>
|
||||
<!--<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="newsletter">
|
||||
<span class="form__field-pseudosquare"><?php /*_e('I would like to subscribe to the newsletter', 'LDC Custom string'); */?></span>
|
||||
</label>-->
|
||||
<div class="form__field-label">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<span class="form__field-label-text">Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter <br> <a href="/politique-de-confidentialite/" target="_blank">la Charte de confidentialité</a></span>
|
||||
<?php else : ?>
|
||||
<span class="form__field-label-text">The information collected from this form is processed by the Data Controller to respond to your contact request. To know your rights, you can consult <br> <a href="/en/privacy-policy/" target="_blank">the Confidentiality Charter</a></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
|
|
@ -80,84 +78,59 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$i18NCnList = [
|
||||
'must_activate_cookies' => ['Vous devez activer les cookies recaptcha', 'You must enable recaptcha cookies'],
|
||||
'succeed' => [
|
||||
'Bonjour. Nous vous remercions de nous avoir contactés concernant la finance. Notre équipe vous répondra dans les meilleurs délais.',
|
||||
'Hello. Thank you for contacting us regarding finance. Our team will respond to you as soon as possible.'
|
||||
],
|
||||
'invalid_email' => ['Le format de l\'adresse email est invalide.', 'The email address format is invalid.'],
|
||||
'error' => ['Une erreur est survenue, veuillez recharger la page.', 'An error has occurred, please reload the page.']
|
||||
];
|
||||
?>
|
||||
<?php require_once(__DIR__ . '/ajax_contact.php') ?>
|
||||
|
||||
<script>
|
||||
|
||||
let processing = false;
|
||||
let lastname = $("input[name=lastname]");
|
||||
let firstname = $("input[name=firstname]");
|
||||
let postalcode = $("input[name=postalcode]");
|
||||
let town = $("input[name=town]");
|
||||
let email = $("input[name=email]");
|
||||
let phone = $("input[name=phone]");
|
||||
let message = $("textarea[name=message]");
|
||||
let agree = $("input[name=agree]");
|
||||
// TODO : Gestion newsletter
|
||||
/*let newsletter = $("input[name=newsletter]");*/
|
||||
|
||||
function reset() {
|
||||
lastname.val('');
|
||||
firstname.val('');
|
||||
postalcode.val('');
|
||||
town.val('');
|
||||
email.val('');
|
||||
phone.val('');
|
||||
message.val('');
|
||||
|
||||
agree.prop("checked", false);
|
||||
/*newsletter.prop("checked", false);*/
|
||||
}
|
||||
|
||||
$("input[type=submit]").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (processing === true)
|
||||
return;
|
||||
|
||||
if (lastname.val().length > 0 && firstname.val().length > 0 && postalcode.val().length > 0 && town.val().length > 0 && email.val().length > 0 && message.val().length > 0) {
|
||||
|
||||
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email.val())) {
|
||||
$(".form__response").hide();
|
||||
|
||||
if (agree.is(':checked') === false) {
|
||||
alert("Vous devez accepter les conditions d'utilisation.");
|
||||
} else {
|
||||
processing = true;
|
||||
grecaptcha.ready(function () {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {action: 'contact'}).then(function (token) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: window.location.origin + '/wp-admin/admin-ajax.php',
|
||||
data: {
|
||||
'token': token,
|
||||
'action': 'ContactAjx',
|
||||
'id': <?= $post->ID; ?>,
|
||||
'firstname': firstname.val(),
|
||||
'lastname': lastname.val(),
|
||||
'postalcode': postalcode.val(),
|
||||
'town': town.val(),
|
||||
'email': email.val(),
|
||||
'phone': phone.val(),
|
||||
'message': message.val(),
|
||||
},
|
||||
success: function (response, textStatus, jqXHR) {
|
||||
reset();
|
||||
alert('Bonjour. Nous vous remercions de nous avoir contactés concernant la finance. Notre équipe vous répondra dans les meilleurs délais.');
|
||||
processing = false;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Une erreur est survenue, veuillez recharger la page.');
|
||||
processing = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert('Le format de l\'adresse email est invalide.');
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const inputs = {
|
||||
required: {
|
||||
lastname: $("input[name=lastname]"),
|
||||
firstname: $("input[name=firstname]"),
|
||||
postalcode: $("input[name=postalcode]"),
|
||||
town: $("input[name=town]"),
|
||||
country: $("input[name=country]"),
|
||||
email: $("input[name=email]"),
|
||||
message: $("textarea[name=message]"),
|
||||
},
|
||||
optional: {
|
||||
phone: $("input[name=phone]"),
|
||||
}
|
||||
} else {
|
||||
$(".form__response").show();
|
||||
}
|
||||
};
|
||||
|
||||
listenFormSubmit(
|
||||
// INPUTS
|
||||
inputs,
|
||||
// DATA
|
||||
() => Object.fromEntries([
|
||||
...[
|
||||
...Object.entries(inputs.required),
|
||||
...Object.entries(inputs.optional),
|
||||
].map(entry => [entry[0], entry[1].val()])
|
||||
]),
|
||||
// RESET
|
||||
() => {
|
||||
const resetFn = $input => {
|
||||
if ($input.is("input[type='checkbox']")) {
|
||||
$input.prop("checked", false);
|
||||
return;
|
||||
}
|
||||
$input.val('');
|
||||
};
|
||||
[...Object.values(inputs.required)].forEach(resetFn);
|
||||
[...Object.values(inputs.optional)].forEach(resetFn);
|
||||
$('.geographic-checkboxes-result').html('');
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h2 class="contacts-page-subtitle subtitle_paint"><?= the_title(); ?></h2>
|
||||
<h2 class="contacts-page-subtitle subtitle_paint"><?= esc_html(the_title()); ?></h2>
|
||||
<div class="contacts-category-page wrapper">
|
||||
<div class="back-button-wrapper">
|
||||
<a href="/nous-contacter/" class="back-button" title="Retour au choix de contact"><?php _e('Return to choice of contact', 'LDC Custom string'); ?></a>
|
||||
|
|
@ -6,63 +6,54 @@
|
|||
<div class="contacts-form__wrapper">
|
||||
<form class="form">
|
||||
<div class="form__container">
|
||||
<div class="form__row justify-content-center">
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Surname', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>" autocomplete="family-name" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('First name', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>" autocomplete="given-name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Postcode', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="postalcode" size="40" class="form__input"
|
||||
placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="postalcode" size="40" class="form__input" placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" autocomplete="postal-code" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Town', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" autocomplete="address-level2" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Country', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="country" size="40" class="form__input" placeholder="<?php _e('Your country', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="country" size="40" class="form__input" placeholder="<?php _e('Your country', 'LDC Custom string'); ?>" autocomplete="country" required>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Email address', 'LDC Custom string'); ?> *</div>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true"
|
||||
aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" required>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true" aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" autocomplete="email" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Telephone', 'LDC Custom string'); ?></div>
|
||||
<input type="tel" name="phone" size="20" class="form__input"
|
||||
placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>">
|
||||
<input type="tel" name="phone" size="20" class="form__input" placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" autocomplete="tel">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__container">
|
||||
<div class="form__field-title"><?php _e('Message', 'LDC Custom string'); ?> *</div>
|
||||
|
||||
<div class="form__field">
|
||||
<textarea name="message" cols="40" rows="10" class="form__input"
|
||||
placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
<textarea name="message" cols="40" rows="10" class="form__input" placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="agree">
|
||||
<span class="form__field-pseudosquare"><?php _e('I accept the conditions of use', 'LDC Custom string'); ?> *</span>
|
||||
</label>
|
||||
<!--<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="newsletter">
|
||||
<span class="form__field-pseudosquare"><?php /*_e('I would like to subscribe to the newsletter', 'LDC Custom string'); */?></span>
|
||||
</label>-->
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
|
|
@ -84,87 +75,59 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$i18NCnList = [
|
||||
'must_activate_cookies' => ['Vous devez activer les cookies recaptcha', 'You must enable recaptcha cookies'],
|
||||
'succeed' => [
|
||||
'Bonjour. Nous vous remercions de nous avoir contactés au sujet de nos engagements. Notre équipe développement durable vous répondra dans les meilleurs délais.',
|
||||
'Hello. We thank you for contacting us regarding our commitments. Our sustainable development team will respond to you as soon as possible.'
|
||||
],
|
||||
'invalid_email' => ['Le format de l\'adresse email est invalide.', 'The email address format is invalid.'],
|
||||
'error' => ['Une erreur est survenue, veuillez recharger la page.', 'An error has occurred, please reload the page.']
|
||||
];
|
||||
?>
|
||||
<?php require_once(__DIR__ . '/ajax_contact.php') ?>
|
||||
|
||||
<script>
|
||||
|
||||
let processing = false;
|
||||
let lastname = $("input[name=lastname]");
|
||||
let firstname = $("input[name=firstname]");
|
||||
let postalcode = $("input[name=postalcode]");
|
||||
let town = $("input[name=town]");
|
||||
let country = $('input[name=country]');
|
||||
let email = $("input[name=email]");
|
||||
let phone = $("input[name=phone]");
|
||||
let message = $("textarea[name=message]");
|
||||
let agree = $("input[name=agree]");
|
||||
// TODO : Gestion newsletter
|
||||
/*let newsletter = $("input[name=newsletter]");*/
|
||||
|
||||
function reset() {
|
||||
lastname.val('');
|
||||
firstname.val('');
|
||||
postalcode.val('');
|
||||
town.val('');
|
||||
country.val('');
|
||||
email.val('');
|
||||
phone.val('');
|
||||
message.val('');
|
||||
|
||||
agree.prop("checked", false);
|
||||
/*newsletter.prop("checked", false);*/
|
||||
}
|
||||
|
||||
$("input[type=submit]").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (processing === true)
|
||||
return;
|
||||
|
||||
if (lastname.val().length > 0 && firstname.val().length > 0 && postalcode.val().length > 0 && town.val().length > 0 && country.val().length > 0 && email.val().length > 0 && message.val().length > 0) {
|
||||
|
||||
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email.val())) {
|
||||
$(".form__response").hide();
|
||||
|
||||
if (agree.is(':checked') === false) {
|
||||
alert("Vous devez accepter les conditions d'utilisation.");
|
||||
} else {
|
||||
processing = true;
|
||||
grecaptcha.ready(function () {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {action: 'contact'}).then(function (token) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: window.location.origin + '/wp-admin/admin-ajax.php',
|
||||
data: {
|
||||
'token': token,
|
||||
'action': 'ContactAjx',
|
||||
'id': <?= $post->ID; ?>,
|
||||
'firstname': firstname.val(),
|
||||
'lastname': lastname.val(),
|
||||
'postalcode': postalcode.val(),
|
||||
'town': town.val(),
|
||||
'country': country.val(),
|
||||
'email': email.val(),
|
||||
'phone': phone.val(),
|
||||
'message': message.val(),
|
||||
},
|
||||
success: function (response, textStatus, jqXHR) {
|
||||
reset();
|
||||
alert('Bonjour. Nous vous remercions de nous avoir contactés au sujet de nos engagements. Notre équipe développement durable vous répondra dans les meilleurs délais.');
|
||||
processing = false;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Une erreur est survenue, veuillez recharger la page.');
|
||||
processing = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert('Le format de l\'adresse email est invalide.');
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const inputs = {
|
||||
required: {
|
||||
lastname: $("input[name=lastname]"),
|
||||
firstname: $("input[name=firstname]"),
|
||||
postalcode: $("input[name=postalcode]"),
|
||||
town: $("input[name=town]"),
|
||||
country: $("input[name=country]"),
|
||||
email: $("input[name=email]"),
|
||||
message: $("textarea[name=message]"),
|
||||
},
|
||||
optional: {
|
||||
phone: $("input[name=phone]"),
|
||||
}
|
||||
} else {
|
||||
$(".form__response").show();
|
||||
}
|
||||
};
|
||||
|
||||
listenFormSubmit(
|
||||
// INPUTS
|
||||
inputs,
|
||||
// DATA
|
||||
() => Object.fromEntries([
|
||||
...[
|
||||
...Object.entries(inputs.required),
|
||||
...Object.entries(inputs.optional),
|
||||
].map(entry => [entry[0], entry[1].val()])
|
||||
]),
|
||||
// RESET
|
||||
() => {
|
||||
const resetFn = $input => {
|
||||
if ($input.is("input[type='checkbox']")) {
|
||||
$input.prop("checked", false);
|
||||
return;
|
||||
}
|
||||
$input.val('');
|
||||
};
|
||||
[...Object.values(inputs.required)].forEach(resetFn);
|
||||
[...Object.values(inputs.optional)].forEach(resetFn);
|
||||
$('.geographic-checkboxes-result').html('');
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h2 class="contacts-page-subtitle subtitle_paint"><?= the_title(); ?></h2>
|
||||
<h2 class="contacts-page-subtitle subtitle_paint"><?= esc_html(the_title()); ?></h2>
|
||||
<div class="contacts-category-page wrapper">
|
||||
<div class="back-button-wrapper">
|
||||
<a href="/nous-contacter/" class="back-button" title="Retour au choix de contact"><?php _e('Return to choice of contact', 'LDC Custom string'); ?></a>
|
||||
|
|
@ -6,63 +6,59 @@
|
|||
<div class="contacts-form__wrapper">
|
||||
<form class="form">
|
||||
<div class="form__container">
|
||||
<div class="form__row">
|
||||
<div class="form__row justify-content-center">
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row cn-inert">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Surname', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>" autocomplete="family-name" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('First name', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>"
|
||||
required>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>" autocomplete="given-name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__row cn-inert">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Postcode', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="postalcode" size="40" class="form__input"
|
||||
placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="postalcode" size="40" class="form__input" placeholder="<?php _e('Your postcode', 'LDC Custom string'); ?>" autocomplete="postal-code" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Town', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="town" size="40" class="form__input" placeholder="<?php _e('Your town', 'LDC Custom string'); ?>" autocomplete="address-level2" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field cn-inert">
|
||||
<div class="form__field-title"><?php _e('Country', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="country" size="40" class="form__input" placeholder="<?php _e('Your country', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="country" size="40" class="form__input" placeholder="<?php _e('Your country', 'LDC Custom string'); ?>" autocomplete="country" required>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__row cn-inert">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Email address', 'LDC Custom string'); ?> *</div>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true"
|
||||
aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" required>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true" aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" autocomplete="email" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Telephone', 'LDC Custom string'); ?></div>
|
||||
<input type="tel" name="phone" size="20" class="form__input"
|
||||
placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>">
|
||||
<input type="tel" name="phone" size="20" class="form__input" placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" autocomplete="phone">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__container">
|
||||
<div class="form__field-title"><?php _e('Message', 'LDC Custom string'); ?> *</div>
|
||||
|
||||
<div class="form__field">
|
||||
<textarea name="message" cols="40" rows="10" class="form__input"
|
||||
placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
<div class="form__field cn-inert">
|
||||
<textarea name="message" cols="40" rows="10" class="form__input" placeholder="<?php _e('Explain your project or request', 'LDC Custom string'); ?>" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="agree">
|
||||
<span class="form__field-pseudosquare"><?php _e('I accept the conditions of use', 'LDC Custom string'); ?> *</span>
|
||||
</label>
|
||||
<!--<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="newsletter">
|
||||
<span class="form__field-pseudosquare"><?php /*_e('I would like to subscribe to the newsletter', 'LDC Custom string'); */?></span>
|
||||
</label>-->
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<span class="form__field-label-text">Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter <br> <a href="/politique-de-confidentialite/" target="_blank">la Charte de confidentialité</a></span>
|
||||
<?php else : ?>
|
||||
<span class="form__field-label-text">The information collected from this form is processed by the Data Controller to respond to your contact request. To know your rights, you can consult <br> <a href="/en/privacy-policy/" target="_blank">the Confidentiality Charter</a></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
|
|
@ -73,7 +69,7 @@
|
|||
<div class="form__response" style="display: none;"><?php _e('One or more fields contain an error. Please check and try again.', 'LDC Custom string'); ?>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__row cn-inert">
|
||||
<div class="form-submit">
|
||||
<input type="submit" value="<?php _e('Send', 'LDC Custom string'); ?>" class="form-submit__btn btn">
|
||||
</div>
|
||||
|
|
@ -84,88 +80,48 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
$i18NCnList = [
|
||||
'must_activate_cookies' => ['Vous devez activer les cookies recaptcha', 'You must enable recaptcha cookies'],
|
||||
'succeed' => [
|
||||
'Bonjour. Nous vous remercions de nous avoir contactés. Notre équipe communication vous répondra dans les meilleurs délais.',
|
||||
'Hello. We thank you for contacting us. Our communications team will respond to you as soon as possible.'
|
||||
],
|
||||
'invalid_email' => ['Le format de l\'adresse email est invalide.', 'The email address format is invalid.'],
|
||||
'error' => ['Une erreur est survenue, veuillez recharger la page.', 'An error has occurred, please reload the page.']
|
||||
];
|
||||
?>
|
||||
<?php require_once(__DIR__ . '/ajax_contact.php') ?>
|
||||
|
||||
<script>
|
||||
|
||||
let processing = false;
|
||||
let lastname = $("input[name=lastname]");
|
||||
let firstname = $("input[name=firstname]");
|
||||
let postalcode = $("input[name=postalcode]");
|
||||
let town = $("input[name=town]");
|
||||
let country = $('input[name=country]');
|
||||
let email = $("input[name=email]");
|
||||
let phone = $("input[name=phone]");
|
||||
let message = $("textarea[name=message]");
|
||||
let agree = $("input[name=agree]");
|
||||
// TODO : Gestion newsletter
|
||||
/*let newsletter = $("input[name=newsletter]");*/
|
||||
|
||||
function reset() {
|
||||
lastname.val('');
|
||||
firstname.val('');
|
||||
postalcode.val('');
|
||||
town.val('');
|
||||
country.val('');
|
||||
email.val('');
|
||||
phone.val('');
|
||||
message.val('');
|
||||
|
||||
agree.prop("checked", false);
|
||||
/*newsletter.prop("checked", false);*/
|
||||
}
|
||||
|
||||
$("input[type=submit]").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (processing === true)
|
||||
return;
|
||||
|
||||
if (lastname.val().length > 0 && firstname.val().length > 0 && postalcode.val().length > 0 && town.val().length > 0 && country.val().length > 0 && email.val().length > 0 && message.val().length > 0) {
|
||||
|
||||
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email.val())) {
|
||||
|
||||
$(".form__response").hide();
|
||||
|
||||
if (agree.is(':checked') === false) {
|
||||
alert("Vous devez accepter les conditions d'utilisation.");
|
||||
} else {
|
||||
processing = true;
|
||||
grecaptcha.ready(function () {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {action: 'contact'}).then(function (token) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: window.location.origin + '/wp-admin/admin-ajax.php',
|
||||
data: {
|
||||
'token': token,
|
||||
'action': 'ContactAjx',
|
||||
'id': <?= $post->ID; ?>,
|
||||
'firstname': firstname.val(),
|
||||
'lastname': lastname.val(),
|
||||
'postalcode': postalcode.val(),
|
||||
'town': town.val(),
|
||||
'country': country.val(),
|
||||
'email': email.val(),
|
||||
'phone': phone.val(),
|
||||
'message': message.val(),
|
||||
},
|
||||
success: function (response, textStatus, jqXHR) {
|
||||
reset();
|
||||
alert('Bonjour. Nous vous remercions de nous avoir contactés. Notre équipe communication vous répondra dans les meilleurs délais.');
|
||||
processing = false;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Une erreur est survenue, veuillez recharger la page.');
|
||||
processing = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert('Le format de l\'adresse email est invalide.');
|
||||
}
|
||||
} else {
|
||||
$(".form__response").show();
|
||||
const inputs = {
|
||||
required: {
|
||||
lastname: $("input[name=lastname]"),
|
||||
firstname: $("input[name=firstname]"),
|
||||
postalcode: $("input[name=postalcode]"),
|
||||
town: $("input[name=town]"),
|
||||
country: $('input[name=country]'),
|
||||
email: $("input[name=email]"),
|
||||
message: $("textarea[name=message]")
|
||||
},
|
||||
optional: {
|
||||
phone: $("input[name=phone]"),
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
listenFormSubmit(
|
||||
// INPUTS
|
||||
inputs,
|
||||
// DATA
|
||||
() => Object.fromEntries([
|
||||
...Object.entries(inputs.required),
|
||||
...Object.entries(inputs.optional),
|
||||
].map(entry => [entry[0], entry[1].val()])),
|
||||
// RESET
|
||||
() => {
|
||||
[...Object.values(inputs.required)].forEach(input => input.val(''));
|
||||
[...Object.values(inputs.optional)].forEach(input => input.val(''));
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h2 class="contacts-page-subtitle subtitle_paint"><?= the_title(); ?></h2>
|
||||
<h2 class="contacts-page-subtitle subtitle_paint"><?= esc_html(the_title()); ?></h2>
|
||||
<div class="contacts-category-page wrapper">
|
||||
<div class="contact-page-tetx-block">
|
||||
<p>
|
||||
|
|
|
|||
92
content/themes/ldc/contacts/ajax_contact.php
Normal file
92
content/themes/ldc/contacts/ajax_contact.php
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
$i18n_cn = function ($key, $i18NCnList) {
|
||||
return addslashes(nl2br(ICL_LANGUAGE_CODE === 'fr' ? $i18NCnList[$key][0] : $i18NCnList[$key][1]));
|
||||
};
|
||||
$e_i18n_cn = function ($key, $i18NCnList) use ($i18n_cn) {
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $i18n_cn($key, $i18NCnList);
|
||||
};
|
||||
?>
|
||||
<script>
|
||||
/**
|
||||
* @param {number} postId
|
||||
* @param {string} action
|
||||
* @param {string} token
|
||||
* @param {Record<string,string>} data
|
||||
* @return {void}
|
||||
*/
|
||||
function ajaxContact(postId, action, token, data) {
|
||||
return $.ajax({
|
||||
type: "POST",
|
||||
url: window.location.origin + '/wp-admin/admin-ajax.php',
|
||||
data: {
|
||||
...{
|
||||
'action': action,
|
||||
'id': postId,
|
||||
token
|
||||
},
|
||||
...data
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** The form is actually sending */
|
||||
let processing = false;
|
||||
|
||||
const listenFormSubmit = (inputs, getData, reset, post_id = null) => {
|
||||
$("input[type=submit]").on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
const $formResponse = $(".form__response");
|
||||
|
||||
if (processing === true) {
|
||||
return;
|
||||
}
|
||||
processing = true;
|
||||
|
||||
$formResponse.hide();
|
||||
|
||||
const data = getData();
|
||||
|
||||
const formIsValid = [...Object.entries(getData())]
|
||||
.filter(entry => inputs.optional[entry[0]] === undefined)
|
||||
.reduce((prev, cur) => prev && cur[1].length > 0);
|
||||
const emailIsValid = emailRegex.test(inputs.required.email.val());
|
||||
|
||||
if (!formIsValid) {
|
||||
$formResponse.show();
|
||||
processing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!emailIsValid) {
|
||||
alert('<?php $e_i18n_cn('invalid_email', $i18NCnList) ?>');
|
||||
processing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!window.__CN_Recaptcha_Loaded_Callback) {
|
||||
console.warn('<?php $e_i18n_cn('must_activate_cookies', $i18NCnList) ?>');
|
||||
alert('<?php $e_i18n_cn('must_activate_cookies', $i18NCnList) ?>');
|
||||
processing = false;
|
||||
return;
|
||||
}
|
||||
window.__CN_Recaptcha_Loaded_Callback('contact', (token) => ajaxContact(
|
||||
post_id ?? <?= esc_attr($post->ID); ?>,
|
||||
'ContactAjx',
|
||||
token,
|
||||
data
|
||||
)
|
||||
.done((response, textStatus, jqXHR) => {
|
||||
reset();
|
||||
alert('<?php $e_i18n_cn('succeed', $i18NCnList) ?>');
|
||||
})
|
||||
.fail((jqXHR, textStatus, errorThrown) => {
|
||||
alert('<?php $e_i18n_cn('error', $i18NCnList) ?>');
|
||||
})
|
||||
.always(() => processing = false)
|
||||
);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
419
content/themes/ldc/cookie-notice/custom-template.php
Normal file
419
content/themes/ldc/cookie-notice/custom-template.php
Normal file
|
|
@ -0,0 +1,419 @@
|
|||
<?php
|
||||
|
||||
// * COOKIE
|
||||
|
||||
// * - STRINGS
|
||||
$site_name = get_bloginfo('name');
|
||||
$logo_picture_url = get_bloginfo('stylesheet_directory') . '/img/logo.png';
|
||||
$logo_alt_text = "Logo " . $site_name;
|
||||
$logo_title_text = "Logo " . $site_name;
|
||||
|
||||
$i18NCnList = [
|
||||
'modal_title' => ['Fenêtre de gestion de cookies', 'Cookie management window'],
|
||||
'button_customize_cookies' => ['Personnaliser les cookies', 'Customize cookies'],
|
||||
'button_close_cookies' => ['Fermer la fenêtre des cookies', 'Close cookie window'],
|
||||
'button_title_open_new_tab' => ['Ouvrir le lien dans un nouvel onglet', 'Open link in new tab'],
|
||||
'button_toggle_cookie' => ['Autoriser ou refuser', 'Accept or refuse'],
|
||||
'button_forbid_all' => [strtoupper('Tout refuser'), strtoupper('Refuse all')],
|
||||
'button_allow_all' => [strtoupper('Tout accepter'), strtoupper('Accept all')],
|
||||
'button_customize' => [strtoupper('Personnaliser'), strtoupper('Customize')],
|
||||
'button_forbid_all_title' => ['Refuser tous les cookies et fermer le panneau des cookies', 'Refuse all cookies and close the cookies panel'],
|
||||
'button_allow_all_title' => ['Accepter tous les cookies et fermer le panneau des cookies', 'Accept all cookies and close the cookies panel'],
|
||||
'button_validate_and_close' => [strtoupper('Valider et fermer'), strtoupper('Confirm and close')],
|
||||
'banner_title' => ['Le site internet ' . $site_name . ' utilise des cookies !', 'The ' . $site_name . ' website uses cookies!'],
|
||||
'banner_text' => [sprintf(
|
||||
"%s<br><br>%s",
|
||||
"Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. Vous pouvez changer d'avis à tout moment en cliquant sur l'icône présente sur chaque page de notre site. En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l'utilisation de technologies de suivi nécessaires à leur bon fonctionnement.",
|
||||
"<a class='cn-link' href='/politique-de-confidentialite/'>Charte de confidentialité</a>"
|
||||
), sprintf(
|
||||
"%s<br><br>%s",
|
||||
"We use cookies to ensure the proper functioning of our site and for analytical purposes.
|
||||
You can change your mind at any time by clicking on the icon on any page of our site.
|
||||
By authorizing these third-party services, you agree to the deposit and reading of cookies and the use of tracking technologies necessary for their proper operation.",
|
||||
"<a class='cn-link' href='/en/privacy-policy/'>Privacy Policy</a>"
|
||||
)],
|
||||
'panel_content' => ['Contenu du panneau des cookies', 'Cookie management panel conten'],
|
||||
'picture_cookie_title' => ['Image d’un bon gros cookie', 'Image of a nice big cookie'],
|
||||
'navigation_title' => ['Navigation du panneau des cookie', 'Cookies panel navigation'],
|
||||
|
||||
// * Cookie
|
||||
'learn_more' => ['En savoir +', 'learn more'],
|
||||
'matomo_description' => ['Les services de mesure d’audience permettent de générer des statistiques de fréquentation utiles à l’amélioration du site.', 'Audience measurement services make it possible to generate traffic statistics useful for improving the site.'],
|
||||
'recaptcha_description' => ['Les cookies qui sont déposés via le recaptcha sur les formulaires ont pour finalité d’empêcher que ceux-ci ne soient soumis par des robots.', 'The purpose of cookies placed via recaptcha on forms is to prevent them from being submitted by robots.'],
|
||||
'youtube_disabled' => ['Youtube est désactivé', 'Youtube is disabled'],
|
||||
'youtube_description' => ['Les cookies déposés par les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.', 'The purpose of cookies placed by video sharing services is to allow the user to view multimedia content directly on the site.'],
|
||||
'vimeo_disabled' => ['Vimeo est désactivé', 'Vimeo is disabled'],
|
||||
'vimeo_description' => ['Les cookies déposés par les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.', 'The purpose of cookies placed by video sharing services is to allow the user to view multimedia content directly on the site.']
|
||||
];
|
||||
|
||||
|
||||
$i18n_cn = function ($key) use ($i18NCnList) {
|
||||
return nl2br(ICL_LANGUAGE_CODE === 'fr' ? $i18NCnList[$key][0] : $i18NCnList[$key][1]);
|
||||
};
|
||||
$e_i18n_cn = function ($key) use ($i18NCnList, $i18n_cn) {
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $i18n_cn($key);
|
||||
};
|
||||
|
||||
// * - COOKIES
|
||||
|
||||
$cookieInline = function ($cookieName, $text, $subtext = '') {
|
||||
return <<<SCRIPT
|
||||
(() => {
|
||||
const cookieActivate = document.createElement("span");
|
||||
cookieActivate.classList.add("cn-cookie-activate");
|
||||
cookieActivate.dataset.cookieName = '{$cookieName}';
|
||||
|
||||
const childSpan = document.createElement("span");
|
||||
const childSpanSpan = document.createElement("span");
|
||||
const childSpanSmall = document.createElement("span");
|
||||
childSpanSpan.textContent = '{$text}';
|
||||
childSpanSmall.textContent = '{$subtext}';
|
||||
childSpan.appendChild(childSpanSpan);
|
||||
childSpan.appendChild(childSpanSmall);
|
||||
|
||||
const childBtn = document.createElement("button");
|
||||
childBtn.classList.add('btn','btn-red');
|
||||
childBtn.textContent = 'Autoriser';
|
||||
|
||||
cookieActivate.appendChild(childSpan);
|
||||
cookieActivate.appendChild(childBtn);
|
||||
return cookieActivate;
|
||||
})
|
||||
SCRIPT;
|
||||
};
|
||||
|
||||
$cookies = [];
|
||||
|
||||
// YOUTUBE
|
||||
$cookies['youtube'] = [
|
||||
'name' => 'VIDEOS - Youtube',
|
||||
'description' => $i18n_cn('youtube_description'),
|
||||
'link' => 'https://policies.google.com/technologies/cookies?hl=fr&utm_source=ucb',
|
||||
'labelLink' => $i18n_cn('learn_more'),
|
||||
'cookies' => ['NID', 'ENID', '_Secure-ENID', 'VISITOR_INFO1_LIVE', 'YEC', '__Secure-YEC', 'YSC', 'PREF', 'pm_sess', 'CGIC', 'SOCS', 'GPS', 'yt-player-bandwidth', 'yt-player-headers-readable']
|
||||
];
|
||||
$inlineYt = $cookieInline(
|
||||
'youtube',
|
||||
$i18n_cn('youtube_disabled')
|
||||
);
|
||||
|
||||
$cookies['youtube']['script'] = <<<SCRIPT
|
||||
function () {
|
||||
let youtubeVids = document.getElementsByClassName('cn-youtube');
|
||||
for (let item of youtubeVids) {
|
||||
let src = item.dataset.src;
|
||||
let title = item.dataset.title;
|
||||
let e = document.createElement('iframe');
|
||||
e.src = src;
|
||||
e.width = "100%";
|
||||
e.height = "600";
|
||||
e.frameBorder = "0";
|
||||
e.title = title;
|
||||
e.allow = "autoplay; fullscreen; picture-in-picture";
|
||||
e.allowFullscreen = true;
|
||||
item.innerHTML = "";
|
||||
item.appendChild(e);
|
||||
}
|
||||
}
|
||||
SCRIPT;
|
||||
$cookies['youtube']['fallback'] = <<<FALLBACK
|
||||
function () {
|
||||
let youtubeVids = document.getElementsByClassName('cn-youtube');
|
||||
for (let item of youtubeVids) {
|
||||
item.innerHTML = "";
|
||||
item.appendChild({$inlineYt}());
|
||||
setTimeout(() => window.listenInlineCnButtons(), 500);
|
||||
}
|
||||
}
|
||||
FALLBACK;
|
||||
|
||||
// VIMEO
|
||||
$cookies['vimeo'] = [
|
||||
'name' => 'VIDEOS - Vimeo',
|
||||
'description' => $i18n_cn('vimeo_description'),
|
||||
'link' => 'https://vimeo.com/cookie_policy',
|
||||
'labelLink' => $i18n_cn('learn_more'),
|
||||
'cookies' => ['vuid', '__utmt_player']
|
||||
];
|
||||
$inlineVo = $cookieInline(
|
||||
'vimeo',
|
||||
$i18n_cn('vimeo_disabled')
|
||||
);
|
||||
$cookies['vimeo']['script'] = <<<SCRIPT
|
||||
function () {
|
||||
let vimeoVids = document.getElementsByClassName('cn-vimeo');
|
||||
for (let item of vimeoVids) {
|
||||
let src = item.dataset.src;
|
||||
let e = document.createElement('iframe');
|
||||
e.src = src;
|
||||
e.width = "100%";
|
||||
e.height = "500";
|
||||
e.frameBorder = "0";
|
||||
e.allow = "autoplay; fullscreen; picture-in-picture";
|
||||
e.allowFullscreen = true;
|
||||
item.innerHTML = "";
|
||||
item.appendChild(e);
|
||||
}
|
||||
}
|
||||
SCRIPT;
|
||||
$cookies['vimeo']['fallback'] = <<<FALLBACK
|
||||
function () {
|
||||
let vimeoVids = document.getElementsByClassName('cn-vimeo');
|
||||
for (let item of vimeoVids) {
|
||||
item.innerHTML = "";
|
||||
item.appendChild({$inlineVo}());
|
||||
setTimeout(() => window.listenInlineCnButtons(), 500);
|
||||
}
|
||||
}
|
||||
FALLBACK;
|
||||
|
||||
// RECAPTCHA
|
||||
$cookies['recaptcha'] = [
|
||||
'name' => 'API - reCAPTACHA',
|
||||
'description' => $i18n_cn('recaptcha_description'),
|
||||
'link' => 'https://policies.google.com/privacy',
|
||||
'labelLink' => $i18n_cn('learn_more'),
|
||||
'cookies' => ['NID', '_grecaptcha', '_GRECAPTCHA', 'rc::c', 'rc::b', 'rc::a', 'itsec-recaptcha-opt-in-*']
|
||||
];
|
||||
|
||||
$cookies['recaptcha']['script'] = <<<SCRIPT
|
||||
function () {
|
||||
if (window.__CN_Recaptcha) {
|
||||
window.__CN_Recaptcha();
|
||||
}
|
||||
[...document.getElementsByClassName('cn-cookie-activate')].forEach(function(el) {
|
||||
if (el.dataset.cookieName === 'recaptcha') {
|
||||
el.classList.add('d-none');
|
||||
}
|
||||
});
|
||||
}
|
||||
SCRIPT;
|
||||
$cookies['recaptcha']['fallback'] = <<<FALLBACK
|
||||
function () {
|
||||
if (window.__CN_Recaptcha_Reset) {
|
||||
window.__CN_Recaptcha_Reset();
|
||||
}
|
||||
|
||||
[...document.getElementsByClassName('cn-cookie-activate')].forEach(function(el) {
|
||||
if (el.dataset.cookieName === 'recaptcha') {
|
||||
el.classList.remove('d-none');
|
||||
}
|
||||
});
|
||||
}
|
||||
FALLBACK;
|
||||
|
||||
// MATOMO
|
||||
$cookies['matomo'] = [
|
||||
'name' => 'Matomo',
|
||||
'description' => $i18n_cn('matomo_description'),
|
||||
'link' => 'https://fr.matomo.org/gdpr-analytics/',
|
||||
'labelLink' => $i18n_cn('learn_more'),
|
||||
'cookies' => ['_pk*']
|
||||
];
|
||||
|
||||
$cookies['matomo']['script'] = <<<SCRIPT
|
||||
function () {
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//yl.s-web.fr/";
|
||||
_paq.push(['setTrackerUrl', u+'rainbow']);
|
||||
_paq.push(['setSiteId', '
|
||||
SCRIPT;
|
||||
$cookies['matomo']['script'] .= MATOMO_SITE_ID;
|
||||
$cookies['matomo']['script'] .= <<<SCRIPT
|
||||
']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.async=true; g.src=u+'unicorn'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
}
|
||||
SCRIPT;
|
||||
|
||||
// * TEMPLATE
|
||||
?>
|
||||
<div id="cn-wrapper" title="<?php $e_i18n_cn('modal_title'); ?>" role="alertdialog" tabindex="-1">
|
||||
<button id="cn-cookie-btn" title="<?php $e_i18n_cn('button_customize_cookies'); ?>">
|
||||
<!-- COOKIE SVG -->
|
||||
<svg viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
<title><?php $e_i18n_cn('picture_cookie_title'); ?></title>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0001 2.93383C14.0001 4.16622 14.6159 5.25477 15.5567 5.90849C15.3526 6.46423 15.2412 7.06473 15.2412 7.69126C15.2412 10.5472 17.5564 12.8624 20.4123 12.8624C21.0807 12.8624 21.7195 12.7356 22.3059 12.5047C22.9456 13.527 24.0817 14.2069 25.3766 14.2069C26.1872 14.2069 26.9357 13.9404 27.539 13.4903C27.5453 13.6594 27.5484 13.8294 27.5484 14C27.5484 21.4826 21.4826 27.5484 14 27.5484C6.51748 27.5484 0.45166 21.4826 0.45166 14C0.45166 6.51748 6.51748 0.45166 14 0.45166C14.3209 0.45166 14.6391 0.462811 14.9543 0.484747C14.3618 1.12929 14.0001 1.98931 14.0001 2.93383ZM21.2176 2.53212C21.2195 2.54914 21.2213 2.56619 21.2229 2.58328C21.2569 2.58864 21.2909 2.59433 21.3247 2.60035C21.2891 2.57745 21.2534 2.5547 21.2176 2.53212ZM25.5171 6.86104C25.523 6.89745 25.5285 6.93399 25.5336 6.97066C25.5512 6.97141 25.5687 6.97228 25.5861 6.97328C25.5633 6.93574 25.5403 6.89833 25.5171 6.86104ZM12.5247 2.09283C12.4748 2.38291 12.4487 2.68118 12.4487 2.98553C12.4487 4.33316 12.9591 5.56158 13.7972 6.48802C13.7266 6.87842 13.6898 7.28054 13.6898 7.69126C13.6898 11.404 16.6996 14.4137 20.4123 14.4137C20.8725 14.4137 21.3219 14.3675 21.7562 14.2794C22.689 15.1941 23.9669 15.7582 25.3766 15.7582C25.5439 15.7582 25.7094 15.7503 25.8726 15.7347C25.0321 21.5385 20.0368 25.9971 14.0001 25.9971C7.37431 25.9971 2.00305 20.6258 2.00305 14.0001C2.00305 7.87378 6.59498 2.82 12.5247 2.09283Z" fill="#FF4E4E" />
|
||||
<circle cx="7.58784" cy="12.8624" r="1.96503" fill="#FF4E4E" />
|
||||
<circle cx="8.82887" cy="19.2745" r="1.3445" fill="#FF4E4E" />
|
||||
<circle cx="13.6897" cy="14.5171" r="1.03423" fill="#FF4E4E" />
|
||||
<circle cx="11.4144" cy="7.48439" r="0.930805" fill="#FF4E4E" />
|
||||
<circle cx="17.5164" cy="20.3089" r="1.86161" fill="#FF4E4E" />
|
||||
<circle cx="21.3432" cy="6.7604" r="0.930805" fill="#FF4E4E" />
|
||||
<circle cx="22.1706" cy="1.89958" r="1.44792" fill="#FF4E4E" />
|
||||
<circle cx="26.8245" cy="8.31185" r="0.72396" fill="#FF4E4E" />
|
||||
</svg>
|
||||
</button>
|
||||
<!-- BANNER -->
|
||||
<div id="cn-banner" tabindex="-1">
|
||||
<div class="cn-modal-top-line">
|
||||
<button id="cn-close-modal" title="<?php $e_i18n_cn('button_close_cookies'); ?>">X</button>
|
||||
</div>
|
||||
<!-- CONTENT VIEW -->
|
||||
<div class="cn-content" title="<?php $e_i18n_cn('panel_content'); ?>" tabindex="0">
|
||||
<!-- 1ST PAGE BANNER -->
|
||||
<div class="cn-banner-content">
|
||||
<div class="cn-banner-img">
|
||||
<img src="<?= esc_url($logo_picture_url); ?>" title="<?= esc_attr($logo_title_text); ?>" alt="<?= esc_attr($logo_alt_text); ?>">
|
||||
</div>
|
||||
<div class="cn-banner-text">
|
||||
<div class="cn-banner-title">
|
||||
<span><?php $e_i18n_cn('banner_title'); ?></span>
|
||||
</div>
|
||||
<div class="cn-banner-para-p">
|
||||
<p><?php $e_i18n_cn('banner_text'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 2ND PAGE CUSTOMIZE PANEL -->
|
||||
<div class="cn-modal-container d-none">
|
||||
<!-- COOKIES LIST -->
|
||||
<ul id="cn-modal-list"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- NAV BAR -->
|
||||
<div class="cn-nav" title="<?php $e_i18n_cn('navigation_title'); ?>" role="navigation">
|
||||
<button class="cn-banner-btn cn-deny" id="cn-deny-banner" title="<?php $e_i18n_cn('button_forbid_all_title'); ?>"><?php $e_i18n_cn('button_forbid_all'); ?></button>
|
||||
<button class="cn-banner-btn cn-accept" id="cn-accept-banner" title="<?php $e_i18n_cn('button_allow_all_title'); ?>"><?php $e_i18n_cn('button_allow_all'); ?></button>
|
||||
<button class="cn-banner-btn cn-custom" id="cn-settings-banner" data-open-modal="<?php $e_i18n_cn('button_validate_and_close'); ?>" data-close-modal="<?php $e_i18n_cn('button_customize'); ?>"><?php $e_i18n_cn('button_customize'); ?></button>
|
||||
</div>
|
||||
|
||||
<!-- COOKIE LIST LI TEMPLATE -->
|
||||
<div id="cn-li-template">
|
||||
<div class="cn-cookie-wrapper">
|
||||
<div class="cn-cookie-infos">
|
||||
<span class="cn-cookie-name">#name</span>
|
||||
<span class="cn-cookie-description">#description</span>
|
||||
<a class="cn-cookie-link" title="<?php $e_i18n_cn('button_title_open_new_tab'); ?>" target="blank">#link</a>
|
||||
</div>
|
||||
<div class="cn-cookie-buttons">
|
||||
<label class="cn-switch" role="checkbox" aria-label="<?php $e_i18n_cn('button_toggle_cookie') ?>" title="<?php $e_i18n_cn('button_toggle_cookie') ?>" aria-checked="undefined" tabindex="0">
|
||||
<input type="checkbox" tabindex="-1" />
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.LDCWebCN = {
|
||||
'youtube': {
|
||||
'name': "VIDEOS - Youtube",
|
||||
'description': '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Les cookies déposés via les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.<?php else : ?>The purpose of cookies deposited via video sharing services is to allow the user to view multimedia content directly on the site.<?php endif; ?>',
|
||||
'link': 'https://policies.google.com/technologies/cookies?hl=fr&utm_source=ucb',
|
||||
'cookies': ['NID', 'VISITOR_INFO1_LIVE', 'YSC'],
|
||||
'script': function() {
|
||||
let youtubeVids = document.getElementsByClassName('ldcweb-cn-youtube');
|
||||
for (let item of youtubeVids) {
|
||||
let id = item.dataset.id;
|
||||
let e = document.createElement('iframe');
|
||||
e.src = "https://www.youtube.com/embed/" + id;
|
||||
e.width = "640";
|
||||
e.height = "360";
|
||||
e.frameBorder = "0";
|
||||
e.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture";
|
||||
e.allowFullscreen = true;
|
||||
item.innerHTML = "";
|
||||
item.appendChild(e);
|
||||
}
|
||||
},
|
||||
fallback: function() {
|
||||
let youtubeVids = document.getElementsByClassName('ldcweb-cn-youtube');
|
||||
for (let item of youtubeVids) {
|
||||
let a = document.createElement('a');
|
||||
a.innerText = '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Autoriser<?php else : ?>Allow<?php endif; ?>';
|
||||
a.href = '#';
|
||||
a.classList.add('ldcweb-cn-cookieslink');
|
||||
a.onclick = function() {
|
||||
LDCWebCN.openModal();
|
||||
};
|
||||
|
||||
let e = document.createElement('p');
|
||||
e.innerHTML = '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Youtube est désactivé.<?php else : ?>Youtube is disabled.<?php endif; ?>';
|
||||
e.appendChild(a);
|
||||
item.appendChild(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
'vimeo': {
|
||||
'name': "VIDEOS - Vimeo",
|
||||
'description': '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Les cookies déposés via les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.<?php else : ?>The purpose of cookies deposited via video sharing services is to allow the user to view multimedia content directly on the site.<?php endif; ?>',
|
||||
'link': 'https://vimeo.com/cookie_policy',
|
||||
'cookies': [],
|
||||
'script': function() {
|
||||
let vimeoVids = document.getElementsByClassName('ldcweb-cn-vimeo');
|
||||
for (let item of vimeoVids) {
|
||||
let id = item.dataset.id;
|
||||
let e = document.createElement('iframe');
|
||||
e.src = "https://player.vimeo.com/video/" + id;
|
||||
e.width = "640";
|
||||
e.height = "360";
|
||||
e.frameBorder = "0";
|
||||
e.allow = "autoplay; fullscreen; picture-in-picture";
|
||||
e.allowFullscreen = true;
|
||||
item.innerHTML = "";
|
||||
item.appendChild(e);
|
||||
}
|
||||
},
|
||||
fallback: function() {
|
||||
let vimeoVids = document.getElementsByClassName('ldcweb-cn-vimeo');
|
||||
for (let item of vimeoVids) {
|
||||
let a = document.createElement('a');
|
||||
a.innerText = '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Autoriser<?php else : ?>Allow<?php endif; ?>';
|
||||
a.href = '#';
|
||||
a.classList.add('ldcweb-cn-cookieslink');
|
||||
a.onclick = function() {
|
||||
LDCWebCN.openModal();
|
||||
};
|
||||
|
||||
let e = document.createElement('p');
|
||||
e.innerHTML = '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Vimeo est désactivé.<?php else : ?>Vimeo is disabled.<?php endif; ?>';
|
||||
e.appendChild(a);
|
||||
item.appendChild(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<script nonce="{{ $nonce ?? '' }}">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
window.WebCookieNotice = {};
|
||||
<?php foreach ($cookies as $index_name => $cookie) { ?>
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'] = {};
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].tmp = {};
|
||||
// SCRIPT
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].tmp.script =
|
||||
<?=
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
$cookie['script'];
|
||||
?>;
|
||||
<?php unset($cookie['script']); ?>
|
||||
// FALLBACK
|
||||
<?php if (isset($cookie['fallback'])) { ?>
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].tmp.fallback =
|
||||
<?=
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
$cookie['fallback'];
|
||||
?>;
|
||||
<?php unset($cookie['fallback']); ?>
|
||||
<?php } ?>
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].conf = <?= wp_json_encode($cookie) ?>;
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].conf.script =
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].tmp.script;
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].conf.fallback =
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].tmp.fallback;
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'] =
|
||||
window.WebCookieNotice['<?= esc_textarea($index_name) ?>'].conf;
|
||||
<?php } ?>
|
||||
window.WebCookieNotice = new CookieNotice(window.WebCookieNotice);
|
||||
});
|
||||
</script>
|
||||
90
content/themes/ldc/css/cn-inline-buttons.css
Normal file
90
content/themes/ldc/css/cn-inline-buttons.css
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
.cn-cookie-activate {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// * Prevent weird theme override
|
||||
font-size: calc(0.9rem + 0.1vw) !important;
|
||||
background-color: #fff;
|
||||
padding: 0.6rem 1rem;
|
||||
border-radius: 1rem;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: #000;
|
||||
|
||||
&.w-100 {
|
||||
max-width: inherit !important;
|
||||
}
|
||||
|
||||
// * Prevent weird theme override
|
||||
span {
|
||||
font-size: calc(0.9rem + 0.1vw) !important;
|
||||
@include media(">phone") {
|
||||
font-size: calc(0.9rem + 0.1vw) !important;
|
||||
}
|
||||
}
|
||||
|
||||
@include media(">phone") {
|
||||
max-width: 80%;
|
||||
// * Prevent weird theme override
|
||||
font-size: calc(0.9rem + 0.1vw) !important;
|
||||
}
|
||||
@include media(">tablet") {
|
||||
flex-direction: row;
|
||||
max-width: 70%;
|
||||
}
|
||||
@include media(">desktop") {
|
||||
max-width: 50%;
|
||||
}
|
||||
|
||||
button {
|
||||
// * Prevent weird theme override
|
||||
font-size: 0.9rem !important;
|
||||
height: fit-content;
|
||||
padding: 0.8rem 0.6rem;
|
||||
border-width: 0.1rem;
|
||||
border-radius: 1rem;
|
||||
@include media(">phone") {
|
||||
// * Prevent weird theme override
|
||||
font-size: calc(0.9rem + 0.1vw) !important;
|
||||
}
|
||||
@include media(">tablet") {
|
||||
// * Prevent weird theme override
|
||||
font-size: calc(0.9rem - 0.1vw) !important;
|
||||
}
|
||||
@include media(">desktop") {
|
||||
// * Prevent weird theme override
|
||||
font-size: 0.9rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
> span {
|
||||
margin-bottom: 0.9rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #e11c1b;
|
||||
font-weight: bold;
|
||||
|
||||
@include media(">phone") {
|
||||
margin-bottom: initial;
|
||||
}
|
||||
|
||||
> small {
|
||||
color: initial;
|
||||
font-weight: initial;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
&.d-none {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.justify-content-center {
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
|
@ -1,451 +0,0 @@
|
|||
/* DEBUT DU PARAMETRAGE */
|
||||
/* - Choix des FONTS */
|
||||
/* - Changement des couleurs et des polices */
|
||||
|
||||
:root{
|
||||
/* PARTIE A RENSEIGNER */
|
||||
--primary-color: rgb(100, 100, 100);
|
||||
--secondary-color: #ff4e4e;
|
||||
--background-color: #ffffff;
|
||||
--shadow-color: 0px 3px 7px 0px rgb(0 0 0 / 35%);
|
||||
--title-font: "Satisfy", sans-serif;
|
||||
--title-size: 25px;
|
||||
--text-font: "Barlow", sans-serif;
|
||||
--text-size: 14px;
|
||||
--accept-color: #33aa33;
|
||||
--deny-color: #aa3333;
|
||||
--ldcweb-cn-position-left: 30px;
|
||||
--ldcweb-cn-position-bottom: 40px;
|
||||
|
||||
/* PARTIE A RENSEIGNER FACULTATIF */
|
||||
/* FENETRE D'ACCUEIL */
|
||||
--ck-bg-color: var(--background-color);
|
||||
|
||||
/* Title settings */
|
||||
--ck-w1-bgcolor-title: var(--background-color);
|
||||
--ck-w1-font-family-title: var(--title-font);
|
||||
--ck-w1-font-size-title: var(--title-size);
|
||||
--ck-w1-color-title: var(--secondary-color);
|
||||
|
||||
/* Text settings */
|
||||
--ck-w1-font-family-txt: var(--text-font);
|
||||
--ck-w1-font-size-txt: var(--text-size);
|
||||
--ck-w1-color-txt: var(--primary-color);
|
||||
--ck-w1-color-href-hover: var(--secondary-color);
|
||||
|
||||
/* Button settings */
|
||||
--ck-w1-color-btn: var(--secondary-color);
|
||||
--ck-w1-color-btn-hover: var(--secondary-color);
|
||||
--ck-w1-font-family-btn-txt: var(--text-font);
|
||||
--ck-w1-font-size-btn-txt: var(--text-size);
|
||||
--ck-w1-color-btn-txt: #ffffff;
|
||||
--ck-w1-color-btn-txt-hover: #ffffff;
|
||||
--ck-w1-color-btn-border: transparent;
|
||||
--ck-w1-color-btn-border-hover: transparent;
|
||||
|
||||
/* FENETRE DE PERSONNALISATION */
|
||||
--ck-bg-color-modal-wrapper: #ffffff;
|
||||
/* Title settings */
|
||||
--ck-w2-bgcolor-title: var(--background-color);
|
||||
--ck-w2-font-family-title: var(--title-font);
|
||||
--ck-w2-font-size-title: var(--title-size);
|
||||
--ck-w2-color-title: var(--secondary-color);
|
||||
|
||||
/* Text settings */
|
||||
--ck-w2-font-family-txt: var(--text-font);
|
||||
--ck-w2-font-size-txt: var(--text-size);
|
||||
--ck-w2-color-txt: var(--primary-color);
|
||||
--ck-w2-color-href-hover: #000000;
|
||||
|
||||
/* Accept/Deny btn settings */
|
||||
--ck-color-accept: #808080;
|
||||
--ck-color-accept-hover: var(--accept-color);
|
||||
--ck-color-deny: #808080;
|
||||
--ck-color-deny-hover: var(--deny-color);
|
||||
--ck-color-txt: #ffffff;
|
||||
--ck-color-txt-hover: #ffffff;
|
||||
|
||||
/* Cookies list settings */
|
||||
--ck-bgcolor-list: #e4e4e4;
|
||||
--ck-font-family-list: var(--text-font);
|
||||
--ck-font-size-list: var(--text-size);
|
||||
--ck-color-list: #000000;
|
||||
--ck-color-title: var(--secondary-color);
|
||||
|
||||
/* Scroll bar */
|
||||
--ck-scroll-bgcolor: var(--primary-color);
|
||||
--ck-scroll-barcolor: var(--secondary-color);
|
||||
}
|
||||
/* FIN DU PARAMETRAGE */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* MOBILE FIRST */
|
||||
#template{
|
||||
display: none;
|
||||
}
|
||||
#ldcweb-cn.open-banner .ldcweb-cn-banner{
|
||||
display: flex;
|
||||
}
|
||||
#ldcweb-cn.open-banner, #ldcweb-cn.open-modal{
|
||||
display: flex;
|
||||
}
|
||||
#ldcweb-cn p, #ldcweb-cn a{
|
||||
font-family: var(--ck-w1-font-family-txt);
|
||||
font-size: var(--ck-w1-font-size-txt);
|
||||
color: var(--ck-w1-color-txt);
|
||||
}
|
||||
#ldcweb-cn a{
|
||||
text-decoration: underline;
|
||||
transition: 0s;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-cn-banner, #ldcweb-cn-modal .modal-wrapper{
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-cn-banner{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding-top: 20px;
|
||||
background-color: var(--ck-bg-color);
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
position: fixed;
|
||||
left: var(--ldcweb-cn-position-left);
|
||||
bottom: calc(var(--ldcweb-cn-position-bottom) + 70px);
|
||||
width: 480px;
|
||||
height: auto;
|
||||
max-height: 80vh;
|
||||
border-radius: 10px;
|
||||
z-index: 99999999999999999999;
|
||||
opacity: 1;
|
||||
line-height: initial;
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-color);
|
||||
user-select: none;
|
||||
opacity: 1;
|
||||
transition: .3s;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-cn-banner-open{
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.ldcweb-banner-content, .ldcweb-banner-details{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0px 20px 0px 20px;
|
||||
}
|
||||
.ldcweb-banner-details{
|
||||
height: 0;
|
||||
transition: .3s;
|
||||
text-align: justify;
|
||||
overflow: hidden;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.ldcweb-banner-details-open{
|
||||
height: 120px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-img{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: auto;
|
||||
width: 150px;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-img img{
|
||||
width: 100%;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-text{
|
||||
flex: 2;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-title p{
|
||||
font-family: var(--ck-w1-font-family-title);
|
||||
font-size: var(--ck-w1-font-size-title);
|
||||
font-weight: bold;
|
||||
color: var(--ck-w1-color-title);
|
||||
text-align: left;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-para-p{
|
||||
text-align: justify;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btnDetails{
|
||||
width: 100%;
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btnDetails-p{
|
||||
cursor: pointer;
|
||||
color: var(--secondary-color);
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btns{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btn-flex{
|
||||
width: 66.5%;
|
||||
border-top: 1px solid grey;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
.ldcweb-banner-btn-personalize{
|
||||
width: 33.5%;
|
||||
border-top: 1px solid gray;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btn-flex div{
|
||||
width: 50%;
|
||||
}
|
||||
.ldcweb-banner-btn-accept{
|
||||
border-left: 1px solid gray;
|
||||
border-right: 1px solid gray;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btn-flex .ldcweb-cn-accept{
|
||||
font-weight: bolder;
|
||||
color: var(--secondary-color);
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btns-btn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background-color: var(--background-color);
|
||||
text-decoration: none;
|
||||
font-family: var(--ck-w1-font-family-btn-txt);
|
||||
font-size: var(--ck-w1-font-size-btn-txt);
|
||||
color: var(--primary-color);
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btns-btn:hover{
|
||||
color: var(--ck-w1-color-btn-txt-hover);
|
||||
background-color: var(--ck-w1-color-btn-hover);
|
||||
}
|
||||
.ldcweb-btn{
|
||||
position: fixed;
|
||||
left: var(--ldcweb-cn-position-left);
|
||||
bottom: var(--ldcweb-cn-position-bottom);
|
||||
z-index: 9999999999;
|
||||
background-color: white;
|
||||
padding: 13px;
|
||||
border-radius: 100%;
|
||||
cursor: pointer;
|
||||
box-shadow: var(--shadow-color);
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
.ldcweb-btn-icon path {
|
||||
fill: var(--secondary-color);
|
||||
}
|
||||
.ldcweb-btn-icon circle {
|
||||
fill: var(--secondary-color);
|
||||
}
|
||||
.visibility{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* MODAL */
|
||||
#ldcweb-cn-modal {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 200;
|
||||
opacity: 1;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-wrapper{
|
||||
position: relative;
|
||||
background-color: var(--ck-bg-color-modal-wrapper);
|
||||
max-height: 100vh;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-wrapper > div:not(:first-of-type){
|
||||
width: 100%;
|
||||
align-items: flex-end;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-title{
|
||||
padding: 0px 20px 0px 20px;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-title *{
|
||||
text-align: justify;
|
||||
margin: 0;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-title .description, #ldcweb-cn-modal .modal-btns{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-weight: normal;
|
||||
line-height: initial;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-title .description, #ldcweb-cn-modal .modal-btns p, #ldcweb-cn-modal .modal-btns a, #ldcweb-cn-modal .modal-title > .subTitle{
|
||||
font-family: var(--ck-w2-font-family-txt);
|
||||
font-size: var(--ck-w2-font-size-txt);
|
||||
color: var(--ck-w2-color-txt);
|
||||
}
|
||||
/* TITLE */
|
||||
#ldcweb-cn-modal .modal-title .title{
|
||||
font-family: var(--ck-w2-font-family-title);
|
||||
font-size: var(--ck-w2-font-size-title);
|
||||
font-weight: bold;
|
||||
color: var(--ck-w2-color-title);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-title > .subTitle{
|
||||
color: var(--ck-w2-color-title);
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-title .title, #ldcweb-cn-modal .modal-title > .subTitle{
|
||||
text-align: center;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-title a{width: fit-content;}
|
||||
|
||||
/* DETAILS */
|
||||
#ldcweb-cn-modal .modal-details{
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
overflow-y: scroll;
|
||||
margin: 6px 0;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details ul{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 20px;
|
||||
list-style: none;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details li > div{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
padding: 20px;
|
||||
border-radius: 20px;
|
||||
border: 1px solid var(--ck-bgcolor-list);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details li span,
|
||||
#ldcweb-cn-modal .modal-details li a,
|
||||
#ldcweb-cn-modal .modal-details li label{
|
||||
font-family: var(--ck-font-family-list);
|
||||
font-size: var(--ck-font-size-list);
|
||||
color: var(--ck-color-list);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-name{
|
||||
color: var(--ck-color-title);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-infos{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-infos span:first-of-type{
|
||||
font-size: calc(var(--ck-font-size-list) * 1.25);
|
||||
font-weight: bold;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-infos .ldcweb-cn-description{
|
||||
color: var(--ck-w2-color-txt);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-infos a{width: fit-content;}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons{
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
width: 200px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div:first-of-type,
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div:last-of-type{
|
||||
transition: all .3s;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div:first-of-type{
|
||||
background: var(--ck-color-accept);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div:last-of-type{
|
||||
background: var(--ck-color-deny);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div{
|
||||
width: 60px;
|
||||
display: table;
|
||||
text-align: center;
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div:first-of-type input:checked ~ label,
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div:first-of-type input ~label.active{
|
||||
background-color: var(--ck-color-deny-hover);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div:last-of-type input:checked ~ label,
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons div:last-of-type input ~ label.active{
|
||||
background-color: var(--ck-color-accept-hover);
|
||||
}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons input{display: none;}
|
||||
#ldcweb-cn-modal .modal-details .ldcweb-cn-buttons label{
|
||||
display: block;
|
||||
color: var(--ck-color-txt);
|
||||
transition: color .3s;
|
||||
padding: 6px 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* MEDIA QUERIES */
|
||||
@media (max-width: 535px) {
|
||||
.ldcweb-banner-content, #ldcweb-cn .ldcweb-banner-btns{
|
||||
flex-direction: column;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btn-flex, #ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btn-personalize{
|
||||
width: 100%;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btn-flex .ldcweb-banner-btn-deny,
|
||||
#ldcweb-cn .ldcweb-banner-btns .ldcweb-banner-btn-flex .ldcweb-banner-btn-accept{
|
||||
width: 50%;
|
||||
}
|
||||
.ldcweb-banner-btn-accept{
|
||||
border-left: 1px solid gray;
|
||||
border-right: none;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-cn-banner{
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-cn-banner{
|
||||
width: 100%;
|
||||
max-height: 100vh;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.ldcweb-banner-details-open {
|
||||
height: auto;
|
||||
}
|
||||
#ldcweb-cn .ldcweb-banner-title p{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
@media (max-width: 1024px) {
|
||||
:root{
|
||||
--ldcweb-cn-position-bottom: 120px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 479px) {
|
||||
:root{
|
||||
--ldcweb-cn-position-left: 10px;
|
||||
--ldcweb-cn-position-bottom: 100px;
|
||||
}
|
||||
}
|
||||
1
content/themes/ldc/css/cookies-ldc.min.css
vendored
Normal file
1
content/themes/ldc/css/cookies-ldc.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -32,7 +32,7 @@ global $tp;
|
|||
<span class="copyright__item">-</span>
|
||||
<a class="copyright__item" href="/politique-de-confidentialite/" title="Politique de confidentialité">Politique de confidentialité</a>
|
||||
<span class="copyright__item">-</span>
|
||||
<a class="copyright__item ldcweb-cn-cookie-link" href="#" title="Gestion des cookies">Gestion des cookies</a>
|
||||
<a class="copyright__item cn-cookie-link" href="#" title="Gestion des cookies">Gestion des cookies</a>
|
||||
<span class="copyright__item">-</span>
|
||||
<span class="copyright__item">Copyright LDC © <?= date('Y'); ?></span>
|
||||
<br><br>
|
||||
|
|
@ -50,7 +50,7 @@ global $tp;
|
|||
<span class="copyright__item">-</span>
|
||||
<a class="copyright__item" href="/en/privacy-policy/" title="Privacy policy">Privacy policy</a>
|
||||
<span class="copyright__item">-</span>
|
||||
<a class="copyright__item ldcweb-cn-cookie-link" href="#" title="Cookie settings">Cookie settings</a>
|
||||
<a class="copyright__item cn-cookie-link" href="#" title="Cookie settings">Cookie settings</a>
|
||||
<span class="copyright__item">-</span>
|
||||
<span class="copyright__item">Copyright LDC © <?= date('Y'); ?></span>
|
||||
<br><br>
|
||||
|
|
@ -77,279 +77,9 @@ global $tp;
|
|||
|
||||
<a href="#" class="back-to-top anchor-scroll" title="back to top"><img src="<?php echo $tp; ?>/img/back-to-top.png" alt="back-to-top" /></a>
|
||||
|
||||
<?php include(get_template_directory(). '/partials/recaptcha-form.php') ?>
|
||||
<?php include('cookie-notice/custom-template.php'); ?>
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
<div id="ldcweb-cn">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<a class="ldcweb-btn" title="Personnaliser les cookies">
|
||||
<?php else : ?>
|
||||
<a class="ldcweb-btn" title="Customize cookies">
|
||||
<?php endif; ?>
|
||||
<svg class="ldcweb-btn-icon" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0001 2.93383C14.0001 4.16622 14.6159 5.25477 15.5567 5.90849C15.3526 6.46423 15.2412 7.06473 15.2412 7.69126C15.2412 10.5472 17.5564 12.8624 20.4123 12.8624C21.0807 12.8624 21.7195 12.7356 22.3059 12.5047C22.9456 13.527 24.0817 14.2069 25.3766 14.2069C26.1872 14.2069 26.9357 13.9404 27.539 13.4903C27.5453 13.6594 27.5484 13.8294 27.5484 14C27.5484 21.4826 21.4826 27.5484 14 27.5484C6.51748 27.5484 0.45166 21.4826 0.45166 14C0.45166 6.51748 6.51748 0.45166 14 0.45166C14.3209 0.45166 14.6391 0.462811 14.9543 0.484747C14.3618 1.12929 14.0001 1.98931 14.0001 2.93383ZM21.2176 2.53212C21.2195 2.54914 21.2213 2.56619 21.2229 2.58328C21.2569 2.58864 21.2909 2.59433 21.3247 2.60035C21.2891 2.57745 21.2534 2.5547 21.2176 2.53212ZM25.5171 6.86104C25.523 6.89745 25.5285 6.93399 25.5336 6.97066C25.5512 6.97141 25.5687 6.97228 25.5861 6.97328C25.5633 6.93574 25.5403 6.89833 25.5171 6.86104ZM12.5247 2.09283C12.4748 2.38291 12.4487 2.68118 12.4487 2.98553C12.4487 4.33316 12.9591 5.56158 13.7972 6.48802C13.7266 6.87842 13.6898 7.28054 13.6898 7.69126C13.6898 11.404 16.6996 14.4137 20.4123 14.4137C20.8725 14.4137 21.3219 14.3675 21.7562 14.2794C22.689 15.1941 23.9669 15.7582 25.3766 15.7582C25.5439 15.7582 25.7094 15.7503 25.8726 15.7347C25.0321 21.5385 20.0368 25.9971 14.0001 25.9971C7.37431 25.9971 2.00305 20.6258 2.00305 14.0001C2.00305 7.87378 6.59498 2.82 12.5247 2.09283Z" fill="#FF4E4E" />
|
||||
<circle cx="7.58784" cy="12.8624" r="1.96503" fill="#FF4E4E" />
|
||||
<circle cx="8.82887" cy="19.2745" r="1.3445" fill="#FF4E4E" />
|
||||
<circle cx="13.6897" cy="14.5171" r="1.03423" fill="#FF4E4E" />
|
||||
<circle cx="11.4144" cy="7.48439" r="0.930805" fill="#FF4E4E" />
|
||||
<circle cx="17.5164" cy="20.3089" r="1.86161" fill="#FF4E4E" />
|
||||
<circle cx="21.3432" cy="6.7604" r="0.930805" fill="#FF4E4E" />
|
||||
<circle cx="22.1706" cy="1.89958" r="1.44792" fill="#FF4E4E" />
|
||||
<circle cx="26.8245" cy="8.31185" r="0.72396" fill="#FF4E4E" />
|
||||
</svg>
|
||||
</a>
|
||||
<div id="ldcweb-banner" class="ldcweb-cn-banner">
|
||||
<div class="ldcweb-banner-content">
|
||||
<div class="ldcweb-banner-img">
|
||||
<img src="<?php bloginfo('stylesheet_directory'); ?>/img/logo.png" alt="Logo" />
|
||||
</div>
|
||||
<div class="ldcweb-banner-text">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<div class="ldcweb-banner-title">
|
||||
<p aria-level="h1">Le site internet ldc utilise des cookies !</p>
|
||||
</div>
|
||||
<p class="ldcweb-banner-para-p" data-open="Ce site web stocke les cookies sur votre ordinateur. LDC utilise ces informations afin
|
||||
d’améliorer et de personnaliser votre expérience de navigation, ainsi que pour l'analyse et les indicateurs concernant nos
|
||||
visiteurs à la fois sur ce site web et sur d'autres supports. Vous pouvez cliquer sur « Tout accepter » si vous consentez à
|
||||
l’utilisation de ces cookies." data-close="Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques.
|
||||
En poursuivant votre navigation sur ce site ou en fermant ce bandeau, vous consentez à l’utilisation de ces
|
||||
cookies.">Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques.
|
||||
En poursuivant votre navigation sur ce site ou en fermant ce bandeau, vous consentez à l’utilisation de ces
|
||||
cookies.</p>
|
||||
<?php else : ?>
|
||||
<div class="ldcweb-banner-title">
|
||||
<p aria-level="h1">The ldc website uses cookies !</p>
|
||||
</div>
|
||||
<p class="ldcweb-banner-para-p" data-open="This website stores cookies on your computer. LDC uses this information to
|
||||
improve and personalize your browsing experience, as well as for analysis and metrics about our visitors
|
||||
visitors both on this website and in other media. You may click 'Accept All' if you consent to the use of
|
||||
the use of these cookies." data-close="We use cookies to ensure the proper functioning of our site and for analytical purposes.
|
||||
By continuing to browse this site or by closing this banner, you consent to the use of these
|
||||
cookies.">We use cookies to ensure the proper functioning of our site and for analytical purposes.
|
||||
By continuing to browse this site or by closing this banner, you consent to the use of these
|
||||
cookies.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ldcweb-banner-details">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<p>Si vous refusez l'utilisation des cookies, vos informations ne seront pas suivies lors de votre visite sur ce site.
|
||||
Un cookie sera utilisé dans votre navigateur afin de se souvenir de ne pas suivre vos préférences. Certaines fonctionnalités ne seront
|
||||
pas accessibles. Vous pouvez changer d’avis et modifier votre consentement à tout moment en revenant sur ce site.
|
||||
Pour en savoir plus sur les cookies que nous utilisons, consultez notre <a href="/politique-de-confidentialite">charte de confidentialité</a>.</p>
|
||||
<?php else : ?>
|
||||
<p>If you decline the use of cookies, your information will not be tracked when you visit this site.
|
||||
A cookie will be used in your browser to remember not to track your preferences. Some features will not be
|
||||
not be accessible. You can change your mind and modify your consent at any time by returning to this site.
|
||||
To learn more about the cookies we use, visit our <a href="/politique-de-confidentialite">privacy policy</a>.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="ldcweb-banner-btnDetails">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<p class="ldcweb-banner-btnDetails-p" data-open="Moins de détails..." data-close="Plus de détails...">Plus de détails...</p>
|
||||
<?php else : ?>
|
||||
<p class="ldcweb-banner-btnDetails-p" data-open="Less details..." data-close="More details...">More details...</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id="ldcweb-cn-modal" class="visibility">
|
||||
<div class="modal-wrapper">
|
||||
<div class="modal-title">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<p class="title" aria-level="h2">Panneau de gestion des cookies</p>
|
||||
<p class="subTitle">Le respect de votre vie privée est notre priorité</p>
|
||||
<p class="description">Les fonctionnalités de ce site s’appuient sur des services proposés par des tiers.
|
||||
<br>Si vous acceptez, ces tiers déposeront des cookies qui vous permettront de visualiser sur le site du contenu hébergé par ces tiers.
|
||||
<br>Via ces cookies, ces tiers collecteront et utiliseront vos données de navigation pour des finalités qui leur sont propres, conformément à leur
|
||||
politique de confidentialité. Cette page vous permet de donner ou de retirer votre consentement, soit globalement soit service par service.
|
||||
</p>
|
||||
<?php else : ?>
|
||||
<p class="title" aria-level="h2">Cookie management panel</p>
|
||||
<p class="subTitle">Your privacy is our priority</p>
|
||||
<p class="description">The functionality of this site relies on services provided by third parties.
|
||||
<br>If you agree, these third parties will set cookies that will allow you to view content on the site hosted by these third parties.
|
||||
<br>Through these cookies, these third parties will collect and use your browsing data for their own purposes, in accordance with their
|
||||
privacy policy. This page allows you to give or withdraw your consent, either in aggregate or on a service-by-service basis.
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="modal-details">
|
||||
<ul id="ldcweb-cn-list">
|
||||
</ul>
|
||||
<div id="template">
|
||||
<div>
|
||||
<div class="ldcweb-cn-infos">
|
||||
<span class="ldcweb-cn-name"></span>
|
||||
<span class="ldcweb-cn-description"></span>
|
||||
<a class="ldcweb-cn-link" href="#">En savoir plus</a>
|
||||
</div>
|
||||
<div class="ldcweb-cn-buttons">
|
||||
<div class="deny" id="deny-btn">
|
||||
<input type="radio" id="analytics2" name="analytics" data-name="analytics" data-status="false">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<label for="analytics2">Interdire</label>
|
||||
<?php else : ?>
|
||||
<label for="analytics2">Prohibit</label>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="accept" id="accept-btn">
|
||||
<input type="radio" id="analytics1" name="analytics" data-name="analytics" data-status="true">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<label for="analytics1">Autoriser</label>
|
||||
<?php else : ?>
|
||||
<label for="analytics1">Allow</label>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ldcweb-banner-btns">
|
||||
<div class="ldcweb-banner-btn-flex">
|
||||
<div class="ldcweb-banner-btn-deny">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<a id="ldcweb-cn-deny-banner" class="ldcweb-banner-btns-btn ldcweb-cn-deny">TOUT REFUSER</a>
|
||||
<?php else : ?>
|
||||
<a id="ldcweb-cn-deny-banner" class="ldcweb-banner-btns-btn ldcweb-cn-deny">REFUSE ALL</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="ldcweb-banner-btn-accept">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<a id="ldcweb-cn-accept-banner" class="ldcweb-banner-btns-btn ldcweb-cn-accept">TOUT ACCEPTER</a>
|
||||
<?php else : ?>
|
||||
<a id="ldcweb-cn-accept-banner" class="ldcweb-banner-btns-btn ldcweb-cn-accept">ACCEPT ALL</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ldcweb-banner-btn-personalize">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<a class="ldcweb-banner-btns-btn ldcweb-cn-personalize" data-open-modal="RETOUR" data-close-modal="PERSONNALISER">PERSONNALISER</a>
|
||||
<?php else : ?>
|
||||
<a class="ldcweb-banner-btns-btn ldcweb-cn-personalize" data-open-modal="BACK" data-close-modal="CUSTOMIZE">CUSTOMIZE</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
window.LDCWebCN = new LdcwebCn({
|
||||
'recaptcha': {
|
||||
'name': "API - reCAPTACHA",
|
||||
'description': '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Les cookies qui sont déposés via le recaptcha sur les formulaires ont pour finalité d\'empêcher que ceux-ci ne soient soumis par des robots.<?php else : ?>The cookies that are deposited via the recaptcha on the forms are intended to prevent them from being submitted by robots.<?php endif; ?>',
|
||||
'link': 'https://policies.google.com/privacy',
|
||||
'cookies': ['NID', '__Secure-3PAPISID', '__Secure-3PSID', '__Secure-3PSIDCC'],
|
||||
'script': function() {
|
||||
(function(d, t) {
|
||||
let g = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
g.src = 'https://www.google.com/recaptcha/api.js?render=6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX';
|
||||
s.parentNode.insertBefore(g, s)
|
||||
}(document, 'script'));
|
||||
}
|
||||
},
|
||||
'matomo': {
|
||||
'name': "Matomo",
|
||||
'description': '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Service d\'analyse d\'audience.<?php else : ?>Audience analysis service.<?php endif; ?>',
|
||||
'link': 'https://fr.matomo.org/gdpr-analytics/',
|
||||
'cookies': ['_pk'],
|
||||
'script': function() {
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u = "//yl.s-web.fr/";
|
||||
_paq.push(['setTrackerUrl', u + 'rainbow']);
|
||||
_paq.push(['setSiteId', '<?= MATOMO_SITE_ID; ?>']);
|
||||
var d = document,
|
||||
g = d.createElement('script'),
|
||||
s = d.getElementsByTagName('script')[0];
|
||||
g.async = true;
|
||||
g.src = u + 'unicorn';
|
||||
s.parentNode.insertBefore(g, s);
|
||||
})();
|
||||
}
|
||||
},
|
||||
'youtube': {
|
||||
'name': "VIDEOS - Youtube",
|
||||
'description': '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Les cookies déposés via les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.<?php else : ?>The purpose of cookies deposited via video sharing services is to allow the user to view multimedia content directly on the site.<?php endif; ?>',
|
||||
'link': 'https://policies.google.com/technologies/cookies?hl=fr&utm_source=ucb',
|
||||
'cookies': ['NID', 'VISITOR_INFO1_LIVE', 'YSC'],
|
||||
'script': function() {
|
||||
let youtubeVids = document.getElementsByClassName('ldcweb-cn-youtube');
|
||||
for (let item of youtubeVids) {
|
||||
let id = item.dataset.id;
|
||||
let e = document.createElement('iframe');
|
||||
e.src = "https://www.youtube.com/embed/" + id;
|
||||
e.width = "640";
|
||||
e.height = "360";
|
||||
e.frameBorder = "0";
|
||||
e.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture";
|
||||
e.allowFullscreen = true;
|
||||
item.innerHTML = "";
|
||||
item.appendChild(e);
|
||||
}
|
||||
},
|
||||
fallback: function() {
|
||||
let youtubeVids = document.getElementsByClassName('ldcweb-cn-youtube');
|
||||
for (let item of youtubeVids) {
|
||||
let a = document.createElement('a');
|
||||
a.innerText = '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Autoriser<?php else : ?>Allow<?php endif; ?>';
|
||||
a.href = '#';
|
||||
a.classList.add('ldcweb-cn-cookieslink');
|
||||
a.onclick = function() {
|
||||
LDCWebCN.openModal();
|
||||
};
|
||||
|
||||
let e = document.createElement('p');
|
||||
e.innerHTML = '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Youtube est désactivé.<?php else : ?>Youtube is disabled.<?php endif; ?>';
|
||||
e.appendChild(a);
|
||||
item.appendChild(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
'vimeo': {
|
||||
'name': "VIDEOS - Vimeo",
|
||||
'description': '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Les cookies déposés via les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.<?php else : ?>The purpose of cookies deposited via video sharing services is to allow the user to view multimedia content directly on the site.<?php endif; ?>',
|
||||
'link': 'https://vimeo.com/cookie_policy',
|
||||
'cookies': [],
|
||||
'script': function() {
|
||||
let vimeoVids = document.getElementsByClassName('ldcweb-cn-vimeo');
|
||||
for (let item of vimeoVids) {
|
||||
let id = item.dataset.id;
|
||||
let e = document.createElement('iframe');
|
||||
e.src = "https://player.vimeo.com/video/" + id;
|
||||
e.width = "640";
|
||||
e.height = "360";
|
||||
e.frameBorder = "0";
|
||||
e.allow = "autoplay; fullscreen; picture-in-picture";
|
||||
e.allowFullscreen = true;
|
||||
item.innerHTML = "";
|
||||
item.appendChild(e);
|
||||
}
|
||||
},
|
||||
fallback: function() {
|
||||
let vimeoVids = document.getElementsByClassName('ldcweb-cn-vimeo');
|
||||
for (let item of vimeoVids) {
|
||||
let a = document.createElement('a');
|
||||
a.innerText = '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Autoriser<?php else : ?>Allow<?php endif; ?>';
|
||||
a.href = '#';
|
||||
a.classList.add('ldcweb-cn-cookieslink');
|
||||
a.onclick = function() {
|
||||
LDCWebCN.openModal();
|
||||
};
|
||||
|
||||
let e = document.createElement('p');
|
||||
e.innerHTML = '<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>Vimeo est désactivé.<?php else : ?>Vimeo is disabled.<?php endif; ?>';
|
||||
e.appendChild(a);
|
||||
item.appendChild(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -96,11 +96,20 @@ function load_js_css()
|
|||
{
|
||||
wp_enqueue_style('fonts', get_template_directory_uri() . '/fonts/stylesheet.css');
|
||||
wp_enqueue_style('swiper', get_template_directory_uri() . '/css/swiper.min.css');
|
||||
wp_enqueue_style('cookie', get_template_directory_uri() . '/css/cookies-ldc.css');
|
||||
wp_enqueue_style('fancybox', get_template_directory_uri() . '/css/jquery.fancybox.min.css');
|
||||
wp_enqueue_style('styles', get_stylesheet_uri());
|
||||
wp_enqueue_style('media-styles', get_template_directory_uri() . '/css/media.css');
|
||||
$_style_media = '/css/media.css';
|
||||
wp_enqueue_style('media-styles', get_template_directory_uri() . $_style_media, [], filemtime(get_template_directory() . $_style_media));
|
||||
|
||||
// * COOKIES
|
||||
$_style_cookies = '/css/cookies-ldc.min.css';
|
||||
wp_enqueue_style('cookie', get_template_directory_uri() . $_style_cookies, [], filemtime(get_template_directory() . $_style_cookies));
|
||||
$_js_cookies = '/js/ldcweb-cn.min.js';
|
||||
wp_enqueue_script('cookie', get_template_directory_uri() . $_js_cookies, [], null, filemtime(get_template_directory() . $_js_cookies));
|
||||
$_style_inline_cookies = '/css/cn-inline-buttons.css';
|
||||
wp_enqueue_style('inline-cookie', get_template_directory_uri() . $_style_inline_cookies, [], filemtime(get_template_directory() . $_style_inline_cookies));
|
||||
$_js_inline_cookies = '/js/cn-inline-buttons.js';
|
||||
wp_enqueue_script('inline-cookie', get_template_directory_uri() . $_js_inline_cookies, ['cookie'], filemtime(get_template_directory() . $_js_inline_cookies), true);
|
||||
|
||||
/* wp_deregister_script('jquery');
|
||||
wp_register_script('jquery', get_template_directory_uri() . '/js/jquery-1.11.1.min.js');
|
||||
|
|
@ -122,7 +131,6 @@ function load_js_css()
|
|||
wp_enqueue_script('chart-js', get_template_directory_uri() . '/js/Chart.js', array(), null, false);
|
||||
|
||||
wp_enqueue_script('swiper', get_template_directory_uri() . '/js/swiper.min.js', array('jquery'), null, true);
|
||||
wp_enqueue_script('cookie', get_template_directory_uri() . '/js/ldcweb-cn.js', array('jquery'), null, true);
|
||||
wp_enqueue_script('fancybox', get_template_directory_uri() . '/js/jquery.fancybox.min.js', array('jquery'), null, true);
|
||||
//wp_enqueue_script('tagcanvas',get_template_directory_uri() . '/js/jquery.tagcanvas.min.js',array('jquery'),null,true);
|
||||
wp_enqueue_script('tagcanvas', get_template_directory_uri() . '/js/tagcanvas.min.js', array('jquery'), null, true);
|
||||
|
|
@ -576,7 +584,7 @@ function registerMailJobAlert()
|
|||
die();
|
||||
}
|
||||
|
||||
$secret = "6LePZvAUAAAAAHW0Upj3jRH9wTzGrMO1aWpg9ICn";
|
||||
$secret = getenv('RECAPTCHA_V3_SECRET');
|
||||
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]) && $_SERVER["HTTP_X_FORWARDED_FOR"] != "") {
|
||||
if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) {
|
||||
$explode = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
|
||||
|
|
|
|||
26
content/themes/ldc/js/cn-inline-buttons.js
Normal file
26
content/themes/ldc/js/cn-inline-buttons.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
document.addEventListener("DOMContentLoaded", function () {
|
||||
function handle(e) {
|
||||
e.preventDefault();
|
||||
const cookieEl = e.target.parentElement;
|
||||
window.WebCookieNotice.acceptCookie(cookieEl.dataset.cookieName);
|
||||
cookieEl.classList.add("d-none");
|
||||
}
|
||||
|
||||
if (!window.WebCookieNotice) {
|
||||
console.debug("Missing WebCookieNotice on window");
|
||||
return;
|
||||
}
|
||||
window.listenInlineCnButtons = () => {
|
||||
const cookieInlineActivation =
|
||||
document.getElementsByClassName("cn-cookie-activate");
|
||||
[...cookieInlineActivation].forEach((cookieEl) => {
|
||||
const cookieBtnActivation = cookieEl.querySelector("button");
|
||||
if (!cookieBtnActivation) {
|
||||
throw new Error("Invalid template cookie button");
|
||||
}
|
||||
cookieBtnActivation.removeEventListener("click", handle);
|
||||
cookieBtnActivation.addEventListener("click", handle);
|
||||
});
|
||||
};
|
||||
window.listenInlineCnButtons();
|
||||
});
|
||||
|
|
@ -1,372 +0,0 @@
|
|||
/**
|
||||
* LDC Service Web
|
||||
* Version 1.3
|
||||
*/
|
||||
|
||||
class LdcwebCn {
|
||||
constructor(config) {
|
||||
this.config = config;
|
||||
this.cookieContainer = document.getElementById("ldcweb-cn");
|
||||
this.bannerContainer = document.querySelector(".ldcweb-cn-banner");
|
||||
this.bannerBtn = document.querySelector(".ldcweb-banner-btnDetails-p");
|
||||
this.ldcwebBtn = document.querySelector(".ldcweb-btn");
|
||||
this.ldcwebBannerParaP = document.querySelector(".ldcweb-banner-para-p");
|
||||
this.ldcwebBannerContent = document.querySelector(".ldcweb-banner-content");
|
||||
this.ldcwebBannerDetails = document.querySelector(".ldcweb-banner-details");
|
||||
this.ldcwebBannerBtnDetails = document.querySelector(".ldcweb-banner-btnDetails");
|
||||
this.modalContainer = document.getElementById("ldcweb-cn-modal");
|
||||
this.acceptAllBtnBanner = document.getElementById("ldcweb-cn-accept-banner");
|
||||
this.denyAllBtnBanner = document.getElementById("ldcweb-cn-deny-banner");
|
||||
this.personalizeBtn = document.getElementsByClassName("ldcweb-cn-personalize");
|
||||
this.personalizeBtnBanner = document.querySelector(".ldcweb-cn-personalize")
|
||||
this.changeBtn = document.getElementsByClassName("ldcweb-cn-change");
|
||||
this.cookiesList = document.getElementById("ldcweb-cn-list");
|
||||
this.cookieLink = document.querySelector(".ldcweb-cn-cookie-link");
|
||||
this.modalDetails = document.querySelector('.modal-details');
|
||||
this.template = document.getElementById("template").cloneNode(true);
|
||||
this.modalBtnBoolean = 0;
|
||||
this.bannerBtnTextBoolean = 0;
|
||||
document.getElementById("template").remove();
|
||||
|
||||
let cookies = this.getLDCWebCookie("ldcwebcn-init");
|
||||
if (cookies === undefined) {
|
||||
let newCookie = [];
|
||||
|
||||
for (const [key, value] of Object.entries(this.config)) {
|
||||
newCookie.push(key + "=wait");
|
||||
}
|
||||
|
||||
this.saveLDCWebCookie(newCookie);
|
||||
} else {
|
||||
let test = cookies.split(",");
|
||||
test.forEach((elm) => {
|
||||
let test = elm.split("=");
|
||||
if (test[1] === "wait") {
|
||||
}
|
||||
else{
|
||||
this.bannerContainer.classList.add("ldcweb-cn-banner-open");
|
||||
}
|
||||
});
|
||||
}
|
||||
let accept = function (e) {
|
||||
e.preventDefault();
|
||||
for (const [key, value] of Object.entries(this.config)) {
|
||||
this.addCookie(key, value);
|
||||
}
|
||||
for (let acceptLabel of this.cookieContainer.querySelectorAll(
|
||||
".accept > label"
|
||||
)) {
|
||||
acceptLabel.classList.add("active");
|
||||
}
|
||||
for (let denyLabel of this.cookieContainer.querySelectorAll(
|
||||
".deny > label"
|
||||
)) {
|
||||
denyLabel.classList.remove("active");
|
||||
}
|
||||
this.updateAllCookiesButtonsActiveStatus();
|
||||
this.bannerContainer.classList.add("ldcweb-cn-banner-open");
|
||||
}.bind(this);
|
||||
this.acceptAllBtnBanner.addEventListener("click", accept);
|
||||
|
||||
let deny = function (e) {
|
||||
e.preventDefault();
|
||||
for (const [key, value] of Object.entries(this.config)) {
|
||||
this.removeCookie(key, value);
|
||||
}
|
||||
for (let acceptLabel of this.cookieContainer.querySelectorAll(
|
||||
".accept > label"
|
||||
)) {
|
||||
acceptLabel.classList.remove("active");
|
||||
}
|
||||
for (let denyLabel of this.cookieContainer.querySelectorAll(
|
||||
".deny > label"
|
||||
)) {
|
||||
denyLabel.classList.add("active");
|
||||
}
|
||||
this.updateAllCookiesButtonsActiveStatus();
|
||||
this.bannerContainer.classList.add("ldcweb-cn-banner-open");
|
||||
}.bind(this);
|
||||
this.denyAllBtnBanner.addEventListener("click", deny);
|
||||
|
||||
let openLdcwebCookies = function(e) {
|
||||
e.preventDefault();
|
||||
this.bannerContainer.classList.remove("ldcweb-cn-banner-open");
|
||||
this.ldcwebBannerContent.classList.add("visibility");
|
||||
this.ldcwebBannerDetails.classList.add("visibility");
|
||||
this.ldcwebBannerBtnDetails.classList.add("visibility");
|
||||
this.modalContainer.classList.remove("visibility");
|
||||
this.personalizeBtnBanner.innerHTML = this.personalizeBtnBanner.getAttribute("data-open-modal");
|
||||
this.modalBtnBoolean = 1;
|
||||
this.modalDetails.scrollTop = 0;
|
||||
this.openModal()
|
||||
}.bind(this)
|
||||
this.cookieLink.addEventListener("click", openLdcwebCookies);
|
||||
|
||||
let hideModal = function(e) {
|
||||
e.preventDefault();
|
||||
this.ldcwebBannerContent.classList.toggle("visibility");
|
||||
this.ldcwebBannerDetails.classList.toggle("visibility");
|
||||
this.ldcwebBannerBtnDetails.classList.toggle("visibility");
|
||||
this.modalContainer.classList.toggle("visibility");
|
||||
this.setCookieList();
|
||||
}.bind(this)
|
||||
this.personalizeBtnBanner.addEventListener("click", hideModal);
|
||||
|
||||
let changeBtnPersonalize = function(e){
|
||||
e.preventDefault();
|
||||
this.modalDetails.scrollTop = 0;
|
||||
if(this.modalBtnBoolean === 0){
|
||||
this.personalizeBtnBanner.innerHTML = this.personalizeBtnBanner.getAttribute("data-open-modal");
|
||||
this.modalBtnBoolean = 1;
|
||||
}
|
||||
else {
|
||||
this.personalizeBtnBanner.innerHTML = this.personalizeBtnBanner.getAttribute("data-close-modal");
|
||||
this.modalBtnBoolean = 0;
|
||||
}
|
||||
}.bind(this);
|
||||
this.personalizeBtnBanner.addEventListener("click", changeBtnPersonalize);
|
||||
|
||||
this.setListenerOnChange();
|
||||
|
||||
let cookie = this.getLDCWebCookie("ldcwebcn-init");
|
||||
let test = cookie.split(",");
|
||||
test.forEach((elm) => {
|
||||
let test = elm.split("=");
|
||||
if (test[1] === "true") {
|
||||
this.config[test[0]].script();
|
||||
}
|
||||
});
|
||||
|
||||
this.updateAllCookiesButtonsActiveStatus();
|
||||
|
||||
let changePara = function(e) {
|
||||
e.preventDefault();
|
||||
this.ldcwebBannerDetails.classList.toggle("ldcweb-banner-details-open");
|
||||
this.bannerBtn.classList.toggle("ldcweb-banner-btnDetails-p-open");
|
||||
if(this.bannerBtnTextBoolean === 0){
|
||||
e.target.innerHTML = e.target.getAttribute("data-open");
|
||||
this.ldcwebBannerParaP.innerHTML = this.ldcwebBannerParaP.getAttribute("data-open");
|
||||
this.ldcwebBannerDetails.style.height = this.ldcwebBannerDetails.children[0].clientHeight + "px"
|
||||
this.bannerBtnTextBoolean = 1;
|
||||
}
|
||||
else{
|
||||
e.target.innerHTML = e.target.getAttribute("data-close");
|
||||
this.ldcwebBannerParaP.innerHTML = this.ldcwebBannerParaP.getAttribute("data-close");
|
||||
this.ldcwebBannerDetails.style.height = "0px"
|
||||
this.bannerBtnTextBoolean = 0;
|
||||
}
|
||||
}.bind(this);
|
||||
this.bannerBtn.addEventListener("click", changePara);
|
||||
|
||||
let resetVue = function(e){
|
||||
e.preventDefault();
|
||||
this.bannerContainer.classList.toggle("ldcweb-cn-banner-open")
|
||||
if(!this.bannerContainer.classList.contains("ldcweb-cn-banner-open")){
|
||||
this.ldcwebBannerContent.classList.remove("visibility"),
|
||||
this.ldcwebBannerDetails.classList.remove("visibility"),
|
||||
this.ldcwebBannerBtnDetails.classList.remove("visibility"),
|
||||
this.modalContainer.classList.add("visibility");
|
||||
this.personalizeBtnBanner.innerHTML = this.personalizeBtnBanner.getAttribute("data-close-modal");
|
||||
this.modalBtnBoolean = 0;
|
||||
}
|
||||
}.bind(this);
|
||||
this.ldcwebBtn.addEventListener("click", resetVue);
|
||||
}
|
||||
|
||||
setCookieList() {
|
||||
this.cookiesList.innerHTML = "";
|
||||
let cookiesSite = this.getLDCWebCookie("ldcwebcn-init");
|
||||
let acceptInputEvent = function (acceptLabel, denyLabel, key, value) {
|
||||
return function (e) {
|
||||
acceptLabel.classList.add("active");
|
||||
denyLabel.classList.remove("active");
|
||||
this.updateAllCookiesButtonsActiveStatus();
|
||||
this.addCookie(key, value);
|
||||
}.bind(this, [acceptLabel, denyLabel, key, value]);
|
||||
};
|
||||
let denyInputEvent = function (acceptLabel, denyLabel, key, value) {
|
||||
return function (e) {
|
||||
acceptLabel.classList.remove("active");
|
||||
denyLabel.classList.add("active");
|
||||
this.updateAllCookiesButtonsActiveStatus();
|
||||
this.removeCookie(key, value);
|
||||
}.bind(this, [acceptLabel, denyLabel, key, value]);
|
||||
};
|
||||
|
||||
for (const [key, value] of Object.entries(this.config)) {
|
||||
let cookie = document.createElement("li");
|
||||
cookie.append(this.template.children.item(0).cloneNode(true));
|
||||
let name = cookie.querySelector("span.ldcweb-cn-name");
|
||||
let description = cookie.querySelector("span.ldcweb-cn-description");
|
||||
let link = cookie.querySelector("a.ldcweb-cn-link");
|
||||
let acceptInput = cookie.querySelector(".accept > input");
|
||||
let denyInput = cookie.querySelector(".deny > input");
|
||||
let acceptLabel = cookie.querySelector(".accept > label");
|
||||
let denyLabel = cookie.querySelector(".deny > label");
|
||||
|
||||
name.textContent = value.name;
|
||||
description.textContent = value.description;
|
||||
link.textContent = value.labelLink;
|
||||
link.setAttribute("href", value.link);
|
||||
acceptInput.id = key + "1";
|
||||
acceptInput.name = key;
|
||||
acceptInput.dataset.name = key;
|
||||
acceptLabel.htmlFor = key + "1";
|
||||
denyInput.id = key + "2";
|
||||
denyInput.name = key;
|
||||
denyInput.dataset.name = key;
|
||||
denyLabel.htmlFor = key + "2";
|
||||
|
||||
acceptInput.addEventListener(
|
||||
"click",
|
||||
acceptInputEvent.apply(this, [acceptLabel, denyLabel, key, value])
|
||||
);
|
||||
denyInput.addEventListener(
|
||||
"click",
|
||||
denyInputEvent.apply(this, [acceptLabel, denyLabel, key, value])
|
||||
);
|
||||
|
||||
this.cookiesList.append(cookie);
|
||||
|
||||
let cookiesArray = cookiesSite.split(",");
|
||||
for (const cookieEl of cookiesArray) {
|
||||
let name = cookieEl.slice(0, cookieEl.indexOf("="));
|
||||
let status = cookieEl.slice(cookieEl.indexOf("=") + 1);
|
||||
if (name === key) {
|
||||
acceptLabel.classList.remove("active");
|
||||
denyLabel.classList.remove("active");
|
||||
switch (status) {
|
||||
case "true":
|
||||
acceptLabel.classList.add("active");
|
||||
break;
|
||||
case "false":
|
||||
denyLabel.classList.add("active");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.cookieContainer.classList.add("ldcweb-cn-banner-open");
|
||||
this.setListenerOnChange();
|
||||
}
|
||||
|
||||
updateAllCookiesButtonsActiveStatus() {
|
||||
let acceptsButtons = this.cookieContainer.querySelectorAll("div.accept > label");
|
||||
let deniesButtons = this.cookieContainer.querySelectorAll("div.deny > label");
|
||||
let activeAcceptsButtons = this.cookieContainer.querySelectorAll("div.accept > label.active");
|
||||
let activeDeniesButtons = this.cookieContainer.querySelectorAll("div.deny > label.active");
|
||||
|
||||
if (acceptsButtons.length && acceptsButtons.length === activeAcceptsButtons.length) {
|
||||
}
|
||||
if (deniesButtons.length && deniesButtons.length === activeDeniesButtons.length) {
|
||||
}
|
||||
}
|
||||
|
||||
addCookie(key, value) {
|
||||
if (value.script) {
|
||||
value.script();
|
||||
}
|
||||
this.changeStatus(key, "true");
|
||||
}
|
||||
|
||||
removeCookie(key, value) {
|
||||
for (let cookieName of value.cookies) {
|
||||
this.deleteBrowserCookie(cookieName, "/", "." + location.host);
|
||||
}
|
||||
if (document.getElementById(key)) {
|
||||
document.getElementById(key).remove();
|
||||
}
|
||||
this.changeStatus(key, "false");
|
||||
}
|
||||
setListenerOnChange() {
|
||||
this.changeBtn = document.getElementsByClassName("ldcweb-cn-change");
|
||||
let itemClick = function (item) {
|
||||
return function () {
|
||||
this.changeStatus(
|
||||
item.getAttribute("data-name"),
|
||||
item.getAttribute("data-status")
|
||||
);
|
||||
}.bind(this);
|
||||
};
|
||||
for (let item of this.changeBtn) {
|
||||
this.addEvent(item, "click", itemClick.bind(this, [item]));
|
||||
}
|
||||
}
|
||||
|
||||
changeStatus(name, status) {
|
||||
let newCookie = [];
|
||||
|
||||
let cookie = this.getLDCWebCookie("ldcwebcn-init");
|
||||
let test = cookie.split(",");
|
||||
test.forEach((elm) => {
|
||||
let test = elm.split("=");
|
||||
if (test[0] === name) {
|
||||
newCookie.push(name + "=" + status);
|
||||
if (status === "false") {
|
||||
this.config[test[0]].cookies.forEach((elm) => {
|
||||
let cookies = this.getLDCWebCookie(elm);
|
||||
if (cookies !== undefined) {
|
||||
document.cookie =
|
||||
elm +
|
||||
"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; domain=" +
|
||||
document.domain +
|
||||
"; path=/";
|
||||
document.cookie =
|
||||
elm +
|
||||
"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; domain=." +
|
||||
document.domain +
|
||||
"; path=/";
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
newCookie.push(elm);
|
||||
}
|
||||
});
|
||||
|
||||
this.saveLDCWebCookie(newCookie);
|
||||
}
|
||||
|
||||
deleteBrowserCookie(name, path, domain) {
|
||||
if (this.getLDCWebCookie(name)) {
|
||||
document.cookie =
|
||||
name +
|
||||
"=" +
|
||||
(path ? ";path=" + path : "") +
|
||||
(domain ? ";domain=" + domain : "") +
|
||||
";expires=Thu, 01 Jan 1970 00:00:01 GMT";
|
||||
}
|
||||
}
|
||||
|
||||
getLDCWebCookie(name) {
|
||||
let matches = document.cookie.match(
|
||||
new RegExp(
|
||||
"(?:^|; )" +
|
||||
name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") +
|
||||
"=([^;]*)"
|
||||
)
|
||||
);
|
||||
return matches ? decodeURIComponent(matches[1]) : undefined;
|
||||
}
|
||||
|
||||
addEvent(element, evnt, funct) {
|
||||
if (element.attachEvent) return element.attachEvent("on" + evnt, funct);
|
||||
else return element.addEventListener(evnt, funct, false);
|
||||
}
|
||||
|
||||
saveLDCWebCookie(content) {
|
||||
let date = new Date();
|
||||
let newDate = new Date(date.setMonth(date.getMonth() + 13));
|
||||
document.cookie =
|
||||
"ldcwebcn-init=" +
|
||||
content +
|
||||
"; expires=" +
|
||||
newDate.toUTCString() +
|
||||
"; path=/;";
|
||||
}
|
||||
|
||||
openModal() {
|
||||
this.setCookieList();
|
||||
this.updateAllCookiesButtonsActiveStatus();
|
||||
}
|
||||
}
|
||||
2
content/themes/ldc/js/ldcweb-cn.min.js
vendored
2
content/themes/ldc/js/ldcweb-cn.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -26,8 +26,6 @@ $(document).ready(function () {
|
|||
});
|
||||
}*/
|
||||
|
||||
$(document).find('input').attr('autocomplete', 'new-password');
|
||||
|
||||
$(window).scroll(function () {
|
||||
if ($(this).scrollTop() > 0) {
|
||||
$('.header').addClass('fixed');
|
||||
|
|
|
|||
241
content/themes/ldc/package-lock.json
generated
Normal file
241
content/themes/ldc/package-lock.json
generated
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
{
|
||||
"name": "ldc",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ldc",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@ldc-web/cookie-notice": "^6.0.1",
|
||||
"sass": "^1.77.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@ldc-web/cookie-notice": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://lab.s-web.fr/api/v4/projects/50/packages/npm/@ldc-web/cookie-notice/-/@ldc-web/cookie-notice-6.0.1.tgz",
|
||||
"integrity": "sha1-cpqBtzjutcgrzXCcyoAVsv9oBpo=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/anymatch": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
||||
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"normalize-path": "^3.0.0",
|
||||
"picomatch": "^2.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/binary-extensions": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
|
||||
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/braces": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fill-range": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/chokidar": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
|
||||
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"anymatch": "~3.1.2",
|
||||
"braces": "~3.0.2",
|
||||
"glob-parent": "~5.1.2",
|
||||
"is-binary-path": "~2.1.0",
|
||||
"is-glob": "~4.0.1",
|
||||
"normalize-path": "~3.0.0",
|
||||
"readdirp": "~3.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://paulmillr.com/funding/"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/glob-parent": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-glob": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/immutable": {
|
||||
"version": "4.3.6",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.6.tgz",
|
||||
"integrity": "sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/is-binary-path": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
||||
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"binary-extensions": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-extglob": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-glob": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
||||
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-extglob": "^2.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/normalize-path": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
||||
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/readdirp": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
||||
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"picomatch": "^2.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sass": {
|
||||
"version": "1.77.4",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.77.4.tgz",
|
||||
"integrity": "sha512-vcF3Ckow6g939GMA4PeU7b2K/9FALXk2KF9J87txdHzXbUF9XRQRwSxcAs/fGaTnJeBFd7UoV22j3lzMLdM0Pw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chokidar": ">=3.0.0 <4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
"source-map-js": ">=0.6.2 <2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"sass": "sass.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
|
||||
"integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
content/themes/ldc/package.json
Normal file
17
content/themes/ldc/package.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "ldc",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"prod": "npm run cookieNotice",
|
||||
"cookieNotice": "npx sass --style=compressed --no-source-map ./sass/_cookies-notice.scss css/cookies-ldc.min.css && cp node_modules/@ldc-web/cookie-notice/dist/browser/cookie-cn.js js/ldcweb-cn.min.js"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@ldc-web/cookie-notice": "^6.0.1",
|
||||
"sass": "^1.77.4"
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ $general_meetings = get_field('general_meetings');
|
|||
<input id="newsletter_cta_email" type="email" class="form__input" placeholder="Renseignez votre email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required>
|
||||
<div class="newsletter-confirm-box">
|
||||
<button type="submit" class="btn">Valider</button>
|
||||
<span>Pour toute information complémentaire concernant vos données personnelles et vos droits, merci de consulter notre <a class='cn-link' href='/en/privacy-policy/'>Charte de confidentialité</a>.</span>
|
||||
<span>Pour toute information complémentaire concernant vos données personnelles et vos droits, merci de consulter notre <a class='cn-link' href='/politique-de-confidentialite/'>Charte de confidentialité</a>.</span>
|
||||
</div>
|
||||
</form>
|
||||
<?php else : ?>
|
||||
|
|
@ -110,7 +110,7 @@ $general_meetings = get_field('general_meetings');
|
|||
<input id="newsletter_cta_email" type="email" class="form__input" placeholder="Please enter your email address" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required>
|
||||
<div class="newsletter-confirm-box">
|
||||
<button type="submit" class="btn">Confirm</button>
|
||||
<span>Pour toute information complémentaire concernant vos données personnelles et vos droits, merci de consulter notre <a class='cn-link' href='/en/privacy-policy/'>Privacy Policy</a>.</span>
|
||||
<span>For any additional information regarding your personal data and your rights, please consult our <a class='cn-link' href='/en/privacy-policy/'>Privacy Policy</a>.</span>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
|
@ -567,7 +567,6 @@ $general_meetings = get_field('general_meetings');
|
|||
|
||||
<table class="dividend-history__table-mobile">
|
||||
<?php
|
||||
// var_dump('<pre>', $dividend_history['fields'] ,'</pre>'); die;
|
||||
$title_nums = array();
|
||||
?>
|
||||
<?php foreach ($dividend_history['fields'] as $k => $f) : ?>
|
||||
|
|
@ -597,13 +596,6 @@ $general_meetings = get_field('general_meetings');
|
|||
<?php endif; ?>
|
||||
<div id="finance_6">
|
||||
<div class="publications fw fw-container gray-bg">
|
||||
<!-- <div class="publications__wrapper wrapper">
|
||||
<h2 class="publications__title textblock__title title">
|
||||
<span class="title-text">Publications et informations</span>
|
||||
<span class="publications__subtitle subtitle-text textblock__subtitle subtitle subtitle_paint">Réglementées</span>
|
||||
</h2>
|
||||
</div> -->
|
||||
|
||||
<?php
|
||||
set_query_var('addclass', 'no-top-padding no-bottom-padding');
|
||||
set_query_var('text_block', $publications['text_block']);
|
||||
|
|
@ -744,4 +736,4 @@ $general_meetings = get_field('general_meetings');
|
|||
|
||||
</div>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
<?php get_footer(); ?>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ $form = get_field('contact_form');
|
|||
<?php if (!empty($description)) : ?>
|
||||
<div class="page-press-description fw fw-container">
|
||||
<div class="page-press-description__wrapper wrapper description">
|
||||
<?php echo $description; ?>
|
||||
<?= wp_kses_post($description); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
|
@ -32,7 +32,7 @@ $form = get_field('contact_form');
|
|||
$category = 'press';
|
||||
?>
|
||||
<div class="posts filter-posts">
|
||||
<div class="filter fw" data-posts="#<?php echo $category ?>" data-list="list-item-press" data-limit="6">
|
||||
<div class="filter fw" data-posts="#<?= esc_attr($category) ?>" data-list="list-item-press" data-limit="6">
|
||||
<div class="filter__wrapper wrapper">
|
||||
<div class="filter-menu">
|
||||
<div class="filter__select-wrap filter-select-wrap">
|
||||
|
|
@ -44,9 +44,7 @@ $form = get_field('contact_form');
|
|||
</ul>
|
||||
|
||||
<div class="filter-results-num">
|
||||
<?php _e('Results', 'LDC Custom string'); ?> : <span class="filter-results-num__wrap"><span
|
||||
class="filter-results-num__current"></span> <?php _e('documents of', 'LDC Custom string'); ?> <span
|
||||
class="filter-results-num__total"></span></span>
|
||||
<?php _e('Results', 'LDC Custom string'); ?> : <span class="filter-results-num__wrap"><span class="filter-results-num__current"></span> <?php _e('documents of', 'LDC Custom string'); ?> <span class="filter-results-num__total"></span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -54,9 +52,8 @@ $form = get_field('contact_form');
|
|||
<div class="active-filters">
|
||||
<div class="active-filters__list"></div>
|
||||
<div class="active-filters__clear-wrap">
|
||||
<div class="active-filters__item active-filters__item_clear"><a
|
||||
class="active-filters__item-remove clear-all"
|
||||
data-category="<?php echo $category ?>" title="Effacer les filtres">✖</a>
|
||||
<div class="active-filters__item active-filters__item_clear">
|
||||
<a class="active-filters__item-remove clear-all" data-category="<?= esc_attr($category) ?>" title="<?php _e('Clear filters', 'LDC Custom string') ?>">✖</a>
|
||||
<?php _e('Clear filters', 'LDC Custom string'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -79,11 +76,11 @@ $form = get_field('contact_form');
|
|||
<?php if (!empty($form['title']) || !empty($form['subtitle']['text'])) : ?>
|
||||
<h2 class="page-press-form__title textblock__title title">
|
||||
<?php if (!empty($form['title'])) : ?>
|
||||
<span class="title-text"><?php echo $form['title']; ?></span>
|
||||
<span class="title-text"><?= esc_html($form['title']) ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($form['subtitle'])) : ?>
|
||||
<span class="page-press-form__subtitle subtitle-text textblock__subtitle subtitle subtitle_paint"><?php echo $form['subtitle']; ?></span>
|
||||
<span class="page-press-form__subtitle subtitle-text textblock__subtitle subtitle subtitle_paint"><?= wp_kses_post($form['subtitle']) ?></span>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
|
|
@ -92,65 +89,61 @@ $form = get_field('contact_form');
|
|||
<form class="wpcf7-form">
|
||||
<div class="form__container">
|
||||
<div class="form__title subtitle"><?php _e('Your contact details', 'LDC Custom string'); ?></div>
|
||||
<div class="form__row justify-content-center">
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field form__field_flex">
|
||||
<div class="form__label"><?php _e('Subject', 'LDC Custom string'); ?> : </div>
|
||||
<span class="wpcf7-form-control-wrap">
|
||||
<select name="Subject" class="form__input form__input_notinput"
|
||||
aria-required="true" aria-invalid="false">
|
||||
<option value="" class="disabled"
|
||||
disabled="disabled"><?php _e('Select', 'LDC Custom string'); ?></option>
|
||||
<option value="Demander le logo du Groupe"><?php _e('Group logo request', 'LDC Custom string'); ?></option>
|
||||
<option value="Demander un logo de filiale-société "><?php _e('Subsidiary/company logo request', 'LDC Custom string'); ?></option>
|
||||
<option value="Demander un logo de marque "><?php _e('Brand logo request', 'LDC Custom string'); ?></option>
|
||||
<option value="Demande de photos"><?php _e('Photo request', 'LDC Custom string'); ?></option>
|
||||
<option value="Autre"><?php _e('Other', 'LDC Custom string'); ?></option>
|
||||
</select>
|
||||
</span>
|
||||
<select name="Subject" class="form__input form__input_notinput" aria-required="true" aria-invalid="false">
|
||||
<option value="" class="disabled" disabled="disabled"><?php _e('Select', 'LDC Custom string'); ?></option>
|
||||
<option value="Demander le logo du Groupe"><?php _e('Group logo request', 'LDC Custom string'); ?></option>
|
||||
<option value="Demander un logo de filiale-société "><?php _e('Subsidiary/company logo request', 'LDC Custom string'); ?></option>
|
||||
<option value="Demander un logo de marque "><?php _e('Brand logo request', 'LDC Custom string'); ?></option>
|
||||
<option value="Demande de photos"><?php _e('Photo request', 'LDC Custom string'); ?></option>
|
||||
<option value="Autre"><?php _e('Other', 'LDC Custom string'); ?></option>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Company', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="company" size="40" class="form__input"
|
||||
placeholder="<?php _e('Your company', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="company" size="40" class="form__input" placeholder="<?php _e('Your company', 'LDC Custom string'); ?>" autocomplete="organization" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Surname', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="lastname" size="40" class="form__input"
|
||||
placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="lastname" size="40" class="form__input" placeholder="<?php _e('Your surname', 'LDC Custom string'); ?>" autocomplete="given-name" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('First name', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="firstname" size="40" class="form__input"
|
||||
placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="firstname" size="40" class="form__input" placeholder="<?php _e('Your first name', 'LDC Custom string'); ?>" autocomplete="family-name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Postcode', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="postcode" size="40" class="form__input"
|
||||
placeholder="<?php _e('For example, TA7 8DL', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="postcode" size="40" class="form__input" placeholder="<?php _e('For example, TA7 8DL', 'LDC Custom string'); ?>" autocomplete="postal-code" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Town', 'LDC Custom string'); ?> *</div>
|
||||
<input type="text" name="city" size="40" class="form__input"
|
||||
placeholder="<?php _e('For example, Bridgwater', 'LDC Custom string'); ?>" required>
|
||||
<input type="text" name="city" size="40" class="form__input" placeholder="<?php _e('For example, Bridgwater', 'LDC Custom string'); ?>" autocomplete="address-level2" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Email address', 'LDC Custom string'); ?> *</div>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true"
|
||||
aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" required>
|
||||
<input type="email" name="email" size="40" class="form__input" aria-required="true" aria-invalid="false" placeholder="<?php _e('Firstname.surname@mail.fr', 'LDC Custom string'); ?>" autocomplete="email" required>
|
||||
</div>
|
||||
<div class="form__field">
|
||||
<div class="form__field-title"><?php _e('Telephone', 'LDC Custom string'); ?> *</div>
|
||||
<input type="tel" name="phone" size="20" class="form__input"
|
||||
placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" required>
|
||||
<input type="tel" name="phone" size="20" class="form__input" placeholder="<?php _e('For example, 02 43 62 70 00', 'LDC Custom string'); ?>" autocomplete="tel" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -159,22 +152,25 @@ $form = get_field('contact_form');
|
|||
<div class="form__field-title"><?php _e('Your message', 'LDC Custom string'); ?> *</div>
|
||||
|
||||
<div class="form__field">
|
||||
<textarea name="message" cols="40" rows="10" class="form__input"
|
||||
placeholder="<?php _e('Please specify what your request is', 'LDC Custom string'); ?>" required></textarea>
|
||||
<textarea name="message" cols="40" rows="10" class="form__input" placeholder="<?php _e('Please specify what your request is', 'LDC Custom string'); ?>" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form__row">
|
||||
<div class="form__field">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="agree">
|
||||
<span class="form__field-pseudosquare"><?php _e('I accept the conditions of use', 'LDC Custom string'); ?> *</span>
|
||||
</label>
|
||||
<label class="form__field-pseudolabel">
|
||||
<input type="checkbox" name="newsletter">
|
||||
<span class="form__field-pseudosquare"><?php _e('I would like to subscribe to the newsletter', 'LDC Custom string'); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
<?php if (ICL_LANGUAGE_CODE === 'fr') : ?>
|
||||
<span class="form__field-label-text">Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter <br> <a href="/politique-de-confidentialite/" target="_blank">la Charte de confidentialité</a></span>
|
||||
<?php else : ?>
|
||||
<span class="form__field-label-text">The information collected from this form is processed by the Data Controller to respond to your contact request. To know your rights, you can consult <br> <a href="/en/privacy-policy/" target="_blank">the Confidentiality Charter</a></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form__field">
|
||||
<div class="form__tip">* <?php _e('Compulsory fields', 'LDC Custom string'); ?></div>
|
||||
</div>
|
||||
|
|
@ -194,97 +190,66 @@ $form = get_field('contact_form');
|
|||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$i18NCnList = [
|
||||
'must_activate_cookies' => ['Vous devez activer les cookies recaptcha', 'You must enable recaptcha cookies'],
|
||||
'succeed' => ['Message envoyé !', 'Message sent !'],
|
||||
'invalid_email' => ['Le format de l\'adresse email est invalide.', 'The email address format is invalid.'],
|
||||
'error' => ['Une erreur est survenue, veuillez recharger la page.', 'An error has occurred, please reload the page.']
|
||||
];
|
||||
?>
|
||||
<?php require_once(__DIR__ . '/contacts/ajax_contact.php') ?>
|
||||
|
||||
<script>
|
||||
|
||||
let processing = false;
|
||||
let subject = $("select[name=Subject]");
|
||||
let company = $("input[name=company]");
|
||||
let lastname = $("input[name=lastname]");
|
||||
let firstname = $("input[name=firstname]");
|
||||
let postcode = $("input[name=postcode]");
|
||||
let city = $("input[name=city]");
|
||||
let phone = $("input[name=phone]");
|
||||
let email = $("input[name=email]");
|
||||
let message = $("textarea[name=message]");
|
||||
let agree = $("input[name=agree]");
|
||||
// TODO : Gestion newsletter
|
||||
let newsletter = $("input[name=newsletter]");
|
||||
|
||||
function reset() {
|
||||
subject.val('');
|
||||
company.val('');
|
||||
lastname.val('');
|
||||
firstname.val('');
|
||||
postcode.val('');
|
||||
city.val('');
|
||||
phone.val('');
|
||||
email.val('');
|
||||
message.val('');
|
||||
|
||||
$('.geographic-checkboxes-result').html('');
|
||||
|
||||
agree.prop("checked", false);
|
||||
newsletter.prop("checked", false);
|
||||
}
|
||||
|
||||
$("input[type=submit]").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (processing === true)
|
||||
return;
|
||||
|
||||
if (subject.val().length > 0 && company.val().length > 0 && lastname.val().length > 0 && firstname.val().length > 0 && postcode.val().length > 0 && city.val().length > 0 && phone.val().length > 0 && email.val().length > 0 && message.val().length > 0) {
|
||||
|
||||
if (/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email.val())) {
|
||||
|
||||
$(".form__response").hide();
|
||||
|
||||
if (agree.is(':checked') === false) {
|
||||
alert("Vous devez accepter les conditions d'utilisation.");
|
||||
} else {
|
||||
processing = true;
|
||||
grecaptcha.ready(function () {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {action: 'contact'}).then(function (token) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: window.location.origin + '/wp-admin/admin-ajax.php',
|
||||
data: {
|
||||
'token': token,
|
||||
'action': 'ContactAjx',
|
||||
'id': 14,
|
||||
'firstname': firstname.val(),
|
||||
'lastname': lastname.val(),
|
||||
'email': email.val(),
|
||||
'company': company.val(),
|
||||
'subject': subject.val(),
|
||||
'postcode': postcode.val(),
|
||||
'city': city.val(),
|
||||
'phone': phone.val(),
|
||||
'message': message.val()
|
||||
},
|
||||
success: function (response, textStatus, jqXHR) {
|
||||
reset();
|
||||
alert('Message envoyé !');
|
||||
processing = false;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Une erreur est survenue, veuillez recharger la page.');
|
||||
processing = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert('Le format de l\'adresse email est invalide.');
|
||||
<?php /** TODO: Gestion newsletter */ ?>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const inputs = {
|
||||
required: {
|
||||
subject: $("select[name=Subject]"),
|
||||
company: $("input[name=company]"),
|
||||
lastname: $("input[name=lastname]"),
|
||||
firstname: $("input[name=firstname]"),
|
||||
postcode: $("input[name=postcode]"),
|
||||
city: $("input[name=city]"),
|
||||
email: $("input[name=email]"),
|
||||
phone: $("input[name=phone]"),
|
||||
message: $("textarea[name=message]"),
|
||||
},
|
||||
optional: {
|
||||
newsletter: $("input[name=newsletter]")
|
||||
}
|
||||
} else {
|
||||
$(".form__response").show();
|
||||
}
|
||||
|
||||
};
|
||||
// 'id': 14,
|
||||
listenFormSubmit(
|
||||
// INPUTS
|
||||
inputs,
|
||||
// DATA
|
||||
() => Object.fromEntries([
|
||||
...[
|
||||
...Object.entries(inputs.required),
|
||||
...Object.entries(inputs.optional),
|
||||
].map(entry => [entry[0], entry[1].val()])
|
||||
]),
|
||||
// RESET
|
||||
() => {
|
||||
const resetFn = $input => {
|
||||
if ($input.is("input[type='checkbox']")) {
|
||||
$input.prop("checked", false);
|
||||
return;
|
||||
}
|
||||
if ($input.is("select")) {
|
||||
$input.val($input.children().eq(1).val())
|
||||
return;
|
||||
}
|
||||
$input.val('');
|
||||
};
|
||||
[...Object.values(inputs.required)].forEach(resetFn);
|
||||
[...Object.values(inputs.optional)].forEach(resetFn);
|
||||
},
|
||||
14
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -292,12 +257,10 @@ $form = get_field('contact_form');
|
|||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//$(document).find("select").val($("select option:first").attr('disabled', 'disabled'));
|
||||
//$(document).find('option:first').addClass('highlight');
|
||||
<script>
|
||||
$('.page-press-form').find("select option:first").addClass('disabled').attr('disabled', 'disabled');
|
||||
var _select = $('.page-press-form').find("select");
|
||||
_select.change(function () {
|
||||
_select.change(function() {
|
||||
_select.addClass('changed');
|
||||
});
|
||||
|
||||
|
|
@ -305,9 +268,8 @@ $form = get_field('contact_form');
|
|||
if (window.location.hash) {
|
||||
var hash = window.location.hash;
|
||||
|
||||
window.almComplete = function (alm) {
|
||||
console.log('sss');
|
||||
setTimeout(function () {
|
||||
window.almComplete = function(alm) {
|
||||
setTimeout(function() {
|
||||
var hh = $(document).find('.header').outerHeight();
|
||||
|
||||
$('html, body').animate({
|
||||
|
|
@ -316,8 +278,6 @@ $form = get_field('contact_form');
|
|||
}, 10);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
|||
22
content/themes/ldc/partials/inline-cookie.php
Normal file
22
content/themes/ldc/partials/inline-cookie.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
$i18NCnList = $i18NCnList ?? [
|
||||
'line1' => ['Vous devez accepter les cookies reCaptcha pour utiliser les formulaires.', 'You must accept reCaptcha cookies to use the forms.'],
|
||||
'line2' => ['Acceptez ce cookie pour utiliser les formulaires', 'Accept this cookie to use the forms'],
|
||||
'btn' => ['Autoriser', 'Authorize']
|
||||
];
|
||||
|
||||
$i18n_cn = function ($key) use ($i18NCnList) {
|
||||
return nl2br(ICL_LANGUAGE_CODE === 'fr' ? $i18NCnList[$key][0] : $i18NCnList[$key][1]);
|
||||
};
|
||||
$e_i18n_cn = function ($key) use ($i18NCnList, $i18n_cn) {
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $i18n_cn($key);
|
||||
};
|
||||
?>
|
||||
<span class="cn-cookie-activate" data-cookie-name="recaptcha">
|
||||
<span>
|
||||
<span><?php $e_i18n_cn('line1'); ?></span>
|
||||
<small><?php $e_i18n_cn('line2'); ?></small>
|
||||
</span>
|
||||
<button class="btn btn-red"><?php $e_i18n_cn('btn'); ?></button>
|
||||
</span>
|
||||
|
|
@ -43,6 +43,11 @@
|
|||
?>
|
||||
<form class="form form_small" method="POST" id="dr-form">
|
||||
<div class="form__container">
|
||||
<div>
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__text">Activate the alerts to receive by email the new offers corresponding to your criteria.</div>
|
||||
|
||||
<div class="form__field">
|
||||
|
|
@ -50,7 +55,7 @@
|
|||
<select id="dr-metiers" name="metiers" class="form__input" required>
|
||||
<option value="all">All jobs</option>
|
||||
<?php foreach ($metiers as $metier) : ?>
|
||||
<option value="<?php echo $metier->id; ?>"><?php echo $metier->name ?></option>
|
||||
<option value="<?= esc_attr($metier->id) ?>"><?= esc_html($metier->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -59,8 +64,8 @@
|
|||
<div class="form__field-title">Type of contract</div>
|
||||
<select id="dr-contrats" name="contrats" class="wpcf7-form-control wpcf7-select form__input" required>
|
||||
<option value="all">All types of contracts</option>
|
||||
<?php foreach ($types as $key => $type) : ?>
|
||||
<option value="<?php echo $type->id; ?>"><?php echo $type->name ?></option>
|
||||
<?php foreach ($types as $key => $jobType) : ?>
|
||||
<option value="<?= esc_attr($jobType->id) ?>"><?= esc_html($jobType->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -70,7 +75,7 @@
|
|||
<select id="dr-temps" name="temps" class="wpcf7-form-control wpcf7-select form__input" required>
|
||||
<option value="all">All working times</option>
|
||||
<?php foreach ($temps as $key => $temp) : ?>
|
||||
<option value="<?php echo $temp->id; ?>"><?php echo $temp->name ?></option>
|
||||
<option value="<?= esc_attr($temp->id) ?>"><?= esc_html($temp->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -82,11 +87,7 @@
|
|||
|
||||
<div class="form__field">
|
||||
<div class="form__field-label">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input id="dr-agree" type="checkbox" name="agree" required>
|
||||
<span class="form__field-pseudosquare"></span>
|
||||
<span class="form__field-label-text">I have read and accepted the privacy policy of the LDC site, the conditions of use and its use of cookies. <br>Read <a href="/politique-de-confidentialite/" target="_blank">the privacy policy</a></span>
|
||||
</label>
|
||||
<span class="form__field-label-text">The information collected from this form is processed by the Data Controller to respond to your contact request. To know your rights, you can consult <br> <a href="/en/privacy-policy/" target="_blank">the Confidentiality Charter</a></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -134,46 +135,60 @@
|
|||
$("#dr-form").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let metiers = $("#dr-metiers");
|
||||
let contrats = $("#dr-contrats");
|
||||
let temps = $("#dr-temps");
|
||||
let email = $("#dr-email");
|
||||
let agree = $("#dr-agree");
|
||||
const emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
|
||||
grecaptcha.ready(function() {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {
|
||||
action: 'submit'
|
||||
}).then(function(token) {
|
||||
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.val())) {
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'action': 'registerMailJobAlert',
|
||||
'metiers': metiers.val(),
|
||||
'types': contrats.val(),
|
||||
'temps': temps.val(),
|
||||
'email': email.val(),
|
||||
'token': token
|
||||
},
|
||||
success: function(result) {
|
||||
if (result === "ok") {
|
||||
alert('Job alert registered!');
|
||||
metiers.val('all');
|
||||
contrats.val('all');
|
||||
temps.val('all');
|
||||
email.val('');
|
||||
agree.attr('checked', false);
|
||||
} else {
|
||||
alert(result);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert('Invalid email address!');
|
||||
const metiers = $("#dr-metiers");
|
||||
const contrats = $("#dr-contrats");
|
||||
const temps = $("#dr-temps");
|
||||
const email = $("#dr-email");
|
||||
const agree = $("#dr-agree");
|
||||
|
||||
const reset = () => {
|
||||
metiers.val('all');
|
||||
contrats.val('all');
|
||||
temps.val('all');
|
||||
email.val('');
|
||||
agree.attr('checked', false);
|
||||
};
|
||||
|
||||
const emailIsValid = emailRegex.test(email.val());
|
||||
|
||||
if (!window.__CN_Recaptcha_Loaded_Callback) {
|
||||
console.warn('You must enable recaptcha cookies');
|
||||
alert('You must enable recaptcha cookies');
|
||||
return;
|
||||
}
|
||||
if (!emailIsValid) {
|
||||
alert('The email address format is invalid.');
|
||||
return;
|
||||
}
|
||||
|
||||
let processing = true;
|
||||
window.__CN_Recaptcha_Loaded_Callback('submit', (token) => $.ajax({
|
||||
url: ajaxurl,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'action': 'registerMailJobAlert',
|
||||
'metiers': metiers.val(),
|
||||
'types': contrats.val(),
|
||||
'temps': temps.val(),
|
||||
'email': email.val(),
|
||||
'token': token
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
.done((response, textStatus, jqXHR) => {
|
||||
if (response === "ok") {
|
||||
alert('Job alert registered !');
|
||||
reset();
|
||||
} else {
|
||||
alert(response);
|
||||
}
|
||||
})
|
||||
.fail((jqXHR, textStatus, errorThrown) => {
|
||||
alert('An error occurred');
|
||||
})
|
||||
.always(() => processing = false)
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@
|
|||
?>
|
||||
<form class="form form_small" method="POST" id="dr-form">
|
||||
<div class="form__container">
|
||||
<div>
|
||||
<div class="form__field text-center">
|
||||
<?php include(get_template_directory() . '/partials/inline-cookie.php') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form__text">Activez les alertes pour recevoir par email les nouvelles offres correspondant à vos critères</div>
|
||||
|
||||
<div class="form__field">
|
||||
|
|
@ -50,7 +55,7 @@
|
|||
<select id="dr-metiers" name="metiers" class="form__input" required>
|
||||
<option value="all">Tous les métiers</option>
|
||||
<?php foreach ($metiers as $metier) : ?>
|
||||
<option value="<?php echo $metier->id; ?>"><?php echo $metier->name ?></option>
|
||||
<option value="<?= esc_attr($metier->id); ?>"><?= esc_html($metier->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -59,8 +64,8 @@
|
|||
<div class="form__field-title">Type de contrat</div>
|
||||
<select id="dr-contrats" name="contrats" class="wpcf7-form-control wpcf7-select form__input" required>
|
||||
<option value="all">Tous les types de contrats</option>
|
||||
<?php foreach ($types as $key => $type) : ?>
|
||||
<option value="<?php echo $type->id; ?>"><?php echo $type->name ?></option>
|
||||
<?php foreach ($types as $key => $jobType) : ?>
|
||||
<option value="<?= esc_attr($jobType->id); ?>"><?= esc_html($jobType->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -70,7 +75,7 @@
|
|||
<select id="dr-temps" name="temps" class="wpcf7-form-control wpcf7-select form__input" required>
|
||||
<option value="all">Tous les temps de travail</option>
|
||||
<?php foreach ($temps as $key => $temp) : ?>
|
||||
<option value="<?php echo $temp->id; ?>"><?php echo $temp->name ?></option>
|
||||
<option value="<?= esc_attr($temp->id); ?>"><?= esc_html($temp->name) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -82,11 +87,7 @@
|
|||
|
||||
<div class="form__field">
|
||||
<div class="form__field-label">
|
||||
<label class="form__field-pseudolabel">
|
||||
<input id="dr-agree" type="checkbox" name="agree" required>
|
||||
<span class="form__field-pseudosquare"></span>
|
||||
<span class="form__field-label-text">J’ai lu et accepté la politique de confidentialité du site LDC, les conditions d’utilisation et son utilisation des cookies.<br>Lire <a href="/politique-de-confidentialite/" target="_blank">la politique de confidentialité</a></span>
|
||||
</label>
|
||||
<span class="form__field-label-text">Les informations recueillies à partir de ce formulaire sont traitées par le Responsable de Traitement pour donner suite à votre demande de contact. Pour connaître vos droits, vous pouvez consulter <br> <a href="/politique-de-confidentialite/" target="_blank">la Charte de confidentialité</a></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -134,46 +135,58 @@
|
|||
$("#dr-form").on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let metiers = $("#dr-metiers");
|
||||
let contrats = $("#dr-contrats");
|
||||
let temps = $("#dr-temps");
|
||||
let email = $("#dr-email");
|
||||
let agree = $("#dr-agree");
|
||||
const emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
|
||||
grecaptcha.ready(function() {
|
||||
grecaptcha.execute('6LePZvAUAAAAABs8uGHxhSkJVPVs4yCJ3amJ1HpX', {
|
||||
action: 'submit'
|
||||
}).then(function(token) {
|
||||
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.val())) {
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'action': 'registerMailJobAlert',
|
||||
'metiers': metiers.val(),
|
||||
'types': contrats.val(),
|
||||
'temps': temps.val(),
|
||||
'email': email.val(),
|
||||
'token': token
|
||||
},
|
||||
success: function(result) {
|
||||
if (result === "ok") {
|
||||
alert('Alerte job enregistrée !');
|
||||
metiers.val('all');
|
||||
contrats.val('all');
|
||||
temps.val('all');
|
||||
email.val('');
|
||||
agree.attr('checked', false);
|
||||
} else {
|
||||
alert(result);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert('Adresse email invalide !');
|
||||
const metiers = $("#dr-metiers");
|
||||
const contrats = $("#dr-contrats");
|
||||
const temps = $("#dr-temps");
|
||||
const email = $("#dr-email");
|
||||
|
||||
const reset = () => {
|
||||
metiers.val('all');
|
||||
contrats.val('all');
|
||||
temps.val('all');
|
||||
email.val('');
|
||||
};
|
||||
|
||||
const emailIsValid = emailRegex.test(email.val());
|
||||
|
||||
if (!window.__CN_Recaptcha_Loaded_Callback) {
|
||||
console.warn('Vous devez activer les cookies recaptcha');
|
||||
alert('Vous devez activer les cookies recaptcha');
|
||||
return;
|
||||
}
|
||||
if (!emailIsValid) {
|
||||
alert('Le format de l\'adresse email est invalide.');
|
||||
return;
|
||||
}
|
||||
|
||||
let processing = true;
|
||||
window.__CN_Recaptcha_Loaded_Callback('submit', (token) => $.ajax({
|
||||
url: ajaxurl,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'action': 'registerMailJobAlert',
|
||||
'metiers': metiers.val(),
|
||||
'types': contrats.val(),
|
||||
'temps': temps.val(),
|
||||
'email': email.val(),
|
||||
'token': token
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
.done((response, textStatus, jqXHR) => {
|
||||
if (response === "ok") {
|
||||
alert('Alerte job enregistrée !');
|
||||
reset();
|
||||
} else {
|
||||
alert(response);
|
||||
}
|
||||
})
|
||||
.fail((jqXHR, textStatus, errorThrown) => {
|
||||
alert('Une erreur est survenue');
|
||||
})
|
||||
.always(() => processing = false)
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
41
content/themes/ldc/partials/recaptcha-form.php
Normal file
41
content/themes/ldc/partials/recaptcha-form.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const initFormCaptcha = () => {
|
||||
[...document.querySelectorAll('.cn-inert')].forEach(el => {
|
||||
el.inert = true;
|
||||
});
|
||||
};
|
||||
window.__CN_Recaptcha = function() {
|
||||
initFormCaptcha();
|
||||
(function(d, t) {
|
||||
let g = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
g.src = 'https://www.recaptcha.net/recaptcha/api.js?onload=__CN_Recaptcha_Loaded&render=<?= esc_attr($_ENV['RECAPTCHA_V3_PUBLIC']) ?>';
|
||||
s.parentNode.insertBefore(g, s)
|
||||
}(document, 'script'));
|
||||
};
|
||||
window.__CN_Recaptcha_Reset = function() {
|
||||
[...document.querySelectorAll('.grecaptcha-badge')].forEach(el => {
|
||||
el.parentElement.remove();
|
||||
});
|
||||
window.recaptcha = undefined;
|
||||
window.grecaptcha = undefined;
|
||||
[...document.querySelectorAll('.cn-inert')].forEach(el => {
|
||||
el.inert = true;
|
||||
});
|
||||
window.__CN_Recaptcha_Loaded_Callback = undefined;
|
||||
};
|
||||
window.__CN_Recaptcha_Loaded = function() {
|
||||
[...document.querySelectorAll('.cn-inert')].forEach(el => {
|
||||
el.inert = false;
|
||||
});
|
||||
/** @type {(action: string, validated: (token:string) => void) => void} */
|
||||
const action = function(action, validated) {
|
||||
grecaptcha.execute('<?= esc_attr($_ENV['RECAPTCHA_V3_PUBLIC']); ?>', {
|
||||
action
|
||||
}).then(validated);
|
||||
};
|
||||
window.__CN_Recaptcha_Loaded_Callback = action;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
26
content/themes/ldc/sass/_cookies-notice.scss
Normal file
26
content/themes/ldc/sass/_cookies-notice.scss
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
@use "sass:color";
|
||||
|
||||
// * Cookie Notice
|
||||
$ck-primary-color: #646464;
|
||||
$ck-secondary-color: #ff4e4e;
|
||||
$ck-background-color: #ffffff;
|
||||
$ck-list-background-color: #e4e4e4;
|
||||
$ck-borders-color: #808080;
|
||||
$ck-title-font: "Satisfy", sans-serif;
|
||||
$ck-title-size: 2.4rem;
|
||||
$ck-text-font: "Barlow", sans-serif;
|
||||
$ck-text-size: 1rem;
|
||||
$cn-cookie-modal-max-height-desktop: 41rem;
|
||||
// Buttons
|
||||
$cn-button-bg-color: #fcfcfc;
|
||||
|
||||
.cn-cookie-link {
|
||||
cursor: pointer;
|
||||
}
|
||||
.cn-link {
|
||||
display: contents;
|
||||
color: $ck-secondary-color;
|
||||
}
|
||||
|
||||
// * VENDOR
|
||||
@import "./../node_modules/@ldc-web/cookie-notice/src/scss/themes/standard.scss";
|
||||
Loading…
Add table
Reference in a new issue