Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$(() => {
const $timeoutModal = $("#timeoutModal");
const timeoutInSeconds = parseInt($timeoutModal.data("session-timeout"), 10);
const secondsUntilTimeoutPath = $timeoutModal.data("seconds-until-timeout-path");
const interval = $timeoutModal.data("session-timeouter-interval");
let endsAt = moment().add(timeoutInSeconds, "seconds");
const popup = new Foundation.Reveal($timeoutModal);
const $continueSessionButton = $("#continueSession");
// Ajax request is made at timeout_modal.html.erb
$continueSessionButton.on("click", () => {
$("#timeoutModal").foundation("close")
// In admin panel we have to hide all overlays
$(".reveal-overlay").css("display", "none");
})
if (!timeoutInSeconds) {
return;
}
const setTimer = (secondsUntilExpiration) => {
if (!secondsUntilExpiration) {
return;
$(document).ready(function(){
// Create the Reveal modal for the initial cookie message
var $cookiemodal = new Foundation.Reveal($('#inti-cookie-policy'), {
vOffset: 'auto',
// overlay: false,
closeOnClick: false
});
// Next, check to see if the visitor has been here before, if they have,
// they'll have the needed-cookies cookie, if not it'll be undefined
if (typeof Cookies.get('needed-cookies') === "undefined" || typeof Cookies.get('functional-cookies') === "undefined") {
// First time visitor
// Open cookie message modal
$cookiemodal.open();
// Set initial recommended cookie settings for 1 minute
Cookies.set('needed-cookies', true, { expires: 1/24/60 });
Cookies.set('functional-cookies', true, { expires: 1/24/60 });