\n
\n
\n \n \n '
)
.concat(
cookie.label ? cookie.label : "",
"\n \n "
)
.concat(
cookie.description
? "
".concat(cookie.description, "
")
: "",
"\n
"
);
}
},
config.options
);
this.opened = false;
this.acceptedCookies = getCookie("cookie-accepted") === "accepted";
this.optionalCookies = {};
this.optionalCookiesByName = [];
config.optionalCookies.forEach(function (ck) {
var cookieName = ck.cookieName || "cookie-".concat(ck.name);
/* get saved value from cookies */
var savedCookie = getCookie(cookieName);
var cookie = _objectSpread({}, ck, {
cookieName: cookieName,
/* set accepted value according to saved or default value */
accepted:
savedCookie === _this.options.revokeValue
? false
: savedCookie === _this.options.acceptValue || ck.accepted
});
/* initial save to cookies if default accepted and not saved */
!savedCookie &&
cookie.accepted &&
setCookie(
cookie.cookieName,
_this.options.acceptValue,
_this.options.lifetime,
_this.options.domain
);
_this.optionalCookies[cookie.name] = cookie;
_this.optionalCookiesByName.push(cookie.name);
/* call onAccept or onRevoke functions */
cookie.accepted
? cookie.onAccept && cookie.onAccept()
: cookie.onRevoke && cookie.onRevoke();
});
}
_createClass(CookieControl, [
{
key: "init",
value: function init() {
/* initialize plugin */
if (!this.el) return;
this.renderOptional();
this.setupEvents();
!this.acceptedCookies &&
window.setTimeout(this.pending.bind(this), this.options.timeout);
}
},
{
key: "setupEvents",
value: function setupEvents() {
var _this2 = this;
/* toggle show/hide cookie window */
_toConsumableArray(
document.getElementsByClassName("cookie-toggle")
).forEach(function (el) {
el.addEventListener("click", function (e) {
e.preventDefault();
return _this2.opened ? _this2.close() : _this2.open();
});
});
/* close cookie window */
_toConsumableArray(
document.getElementsByClassName("cookie-close")
).forEach(function (el) {
el.addEventListener("click", _this2.pending.bind(_this2));
});
/* open cookie window */
_toConsumableArray(
document.getElementsByClassName("js-open-cookie")
).forEach(function (el) {
el.addEventListener("click", _this2.open.bind(_this2));
});
/* accept cookies */
_toConsumableArray(
document.getElementsByClassName("cookie-accept")
).forEach(function (el) {
el.addEventListener("click", _this2.accept.bind(_this2));
});
/* turn on/off cookie group */
_toConsumableArray(
this.el.getElementsByClassName("cookie-optional-checkbox")
).forEach(function (checkbox) {
checkbox.addEventListener(
"change",
_this2.toggleCookie.bind(_this2)
);
});
}
},
{
key: "pending",
value: function pending(e) {
e && e.preventDefault();
this.el.removeAttribute("open");
this.el.setAttribute("pending", "");
}
},
{
key: "open",
value: function open(e) {
e && e.preventDefault();
this.el.removeAttribute("pending");
this.el.setAttribute("open", "");
this.opened = true;
}
},
{
key: "close",
value: function close(e) {
e && e.preventDefault();
this.el.removeAttribute("pending");
this.el.removeAttribute("open");
this.opened = false;
document.getElementById('cookie').style.display = 'none';
}
},
{
key: "renderOptional",
value: function renderOptional() {
var _this3 = this;
/* render optional cookie groups to cookie window */
var optionalHtml = "";
this.optionalCookiesByName.forEach(function (cookieName) {
var cookie = _this3.optionalCookies[cookieName];
optionalHtml += _this3.options.optionCookieHtml(cookie);
});
this.el.querySelector(
".cookie-optional-list"
).outerHTML = optionalHtml;
}
},
{
key: "toggleCookie",
value: function toggleCookie(e) {
/* turn on/off cookie group and save to cookie */
this.optionalCookies[e.target.dataset.name].accepted =
e.target.checked;
this.saveCookie(this.optionalCookies[e.target.dataset.name]);
/* call onChange function if defined */
this.options.onChange && this.options.onChange(e, this);
}
},
{
key: "saveAll",
value: function saveAll() {
var _this4 = this;
this.optionalCookiesByName.forEach(function (name) {
return _this4.saveCookie(_this4.optionalCookies[name]);
});
}
},
{
key: "saveCookie",
value: function saveCookie(cookie) {
setCookie(
cookie.cookieName,
cookie.accepted
? this.options.acceptValue
: this.options.revokeValue,
this.options.lifetime,
this.options.domain
);
}
},
{
key: "accept",
value: function accept(e) {
e && e.preventDefault();
setCookie(
"cookie-accepted",
"accepted",
this.options.lifetime,
this.options.domain
);
this.saveAll();
this.close();
/* call onAccept function if defined */
this.options.onAccept && this.options.onAccept(this);
}
},
{
key: "set",
value: function set(option, value) {
this.options[option] = value;
}
}
]);
return CookieControl;
})();
(function () {
var ccConfig = {
options: {
lifetime: 30,
domain: moduleParams.httpCookieDomain
},
optionalCookies: [
{
name: "analytics",
label: moduleParams.titleAnalytics,
description: moduleParams.contentAnalytics,
accepted: false,
onRevoke: function onRevoke() {
window["ga-disable-XX-XXXXX-X"] = true;
}
},
{
name: "marketing",
label: moduleParams.titleMarketing,
description: moduleParams.contentMarketing,
accepted: false
},
{
name: "socialsharing",
label: moduleParams.titleSocials,
description: moduleParams.contentSocials,
accepted: false,
onAccept: function onAccept() {
(function (d, s, id) {
var js,
fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src =
"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.0";
fjs.parentNode.insertBefore(js, fjs);
})(document, "script", "facebook-jssdk");
}
}
]
}; // create new cookie control instance
var cookieControl = new CookieControl(ccConfig); // initialize the plugin
cookieControl.init();
if (cookieControl.acceptedCookies) document.getElementById('cookie').style.display = 'none';
})();
}(jQuery));
(function ($) {
var moduleParams = {"markupMode":"table","autoSwitchDevice":false,"mobileStatus":true,"mobileIsV16":false,"languagesCode":"fr","pwaEnabled":false,"isSnapchatiOs":0,"httpServer":"","mobileOn":false,"caisseOn":false,"bookingsOn":false};
// Lazy loading
var jQueryUnveil = jQuery().unveil;
function lazyLoad() {
if (jQueryUnveil) {
$("img.lazy").unveil();
}
};
$('body').on('ajaxListingProductsLoaded', function () {
lazyLoad();
});
$(window).on('load', function () {
lazyLoad();
});
// Smooth Scroll marquee
if ($('marquee.defilante-smooth').length > 0) {
$('marquee.defilante-smooth').on('load', function () {
$('marquee.defilante-smooth').marquee().mouseover(function () {
$(this).trigger('stop');
})
.mouseout(function () {
$(this).trigger('start');
})
.mousemove(function (event) {
if ($(this).data('drag') == true) {
this.scrollLeft = $(this)
.data('scrollX') + ($(this)
.data('x') - event.clientX);
}
})
.mousedown(function (event) {
$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
})
.mouseup(function () {
$(this).data('drag', false);
});
});
}
// https://developers.google.com/recaptcha/docs/display#explicit_render
CaptchaCallback = function () {
$('.g-recaptcha').each(function () {
var $this = $(this);
grecaptcha.render(this, {'sitekey': $this.data('sitekey'), 'stoken': $this.data('stoken')});
});
};
/*
* RECAPTCHA V2
*/
recaptchaV2CurrentIndex = 0; // index du captcha qui est traité
// Fonction exécutée par le recaptcha v2 si valide
CaptchaV2Submit = function (token) {
var $form = $('#recaptcha_' + recaptchaV2CurrentIndex).closest('form');
$form.find('input[name="g-recaptcha-response"]').val(token); // On rempli le champ qui sert de traitement en PHP.
$form.submit(); // On renvoi le formulaire après validation
}
// Fonction exécutée au chargement de la page si le captcha v2 est activé
CaptchaV2Callback = function () {
// Envoi du formulaire recaptcha v2
$('.g-recaptcha').closest('form').submit(function () {
var $form = $(this);
recaptchaV2CurrentIndex = $form.find('.g-recaptcha').data('index');
if ($form.find('input[name="g-recaptcha-response"]').val() != '') {
return true; // Si captcha validé, tout est OK, on peut envoyer le formulaire
}
grecaptcha.execute(recaptchaV2CurrentIndex); // Contrôle de captcha. Si c'est OK, CaptchaV2Submit sera appelé et cette même fonction (submit) sera appelée
return false;
});
}
/*
* RECAPTCHA V2 - FIN
*/
//Chargement de la version mobile à la volée en dessous de 768px et chargement de la version PC sur mobile si > 768px
//Ne fonctionne que sur PC , le device MObile prend le dessus.
//Ne fonctionne pas si la version mobile est à OFF ou en V1
if (moduleParams.autoSwitchDevice && moduleParams.mobileStatus && moduleParams.mobileIsV16 && $.browser.desktop) {
function checkWidth() {
if ((window.innerWidth < 768 && !moduleParams.mobileOn) || (window.innerWidth >= 768 && moduleParams.