(function($) { $('#cookie_policy_modal').on('show.bs.modal', function () { $('#cookie_policy_modal .column').css('height',$( window ).height()*0.6); }); var $cookie_banner = ""; if ( $cookie_banner.length === 0 ){ console.log('here'); $('#cookie-banner').fadeIn(); } })(jQuery); function SetBannerCookie(e, o, t) { var $name = e; $.get( "/ajax/session-set/"+$name+"?"+$name+"="+escape(o) ); } $(document).on('submit', '#cookieAcceptForm,#cookieDeclineForm', function(e){ e.preventDefault(); // submit form with ajax here var $self = $(this); var formData = new FormData(this); $("button[type=submit]", $self).prop("disabled", true); $.ajax({ type: "post", dataType: "json", data: formData, success: function (response) { console.log(response); SetBannerCookie("cookie_banner", "yes", 365); $('#cookie-banner').fadeOut(); $('#cookie_policy_modal').modal('hide'); }, cache: false, contentType: false, processData: false }); }); function set_sessionStorage(e, o, t) { if (typeof(Storage) !== "undefined") { sessionStorage.setItem(e, o); } } function get_sessionStorage(cname, def = '') { var ret = ''; if (typeof(Storage) !== "undefined") { ret = sessionStorage.getItem(cname); } if (ret == '' || ret == undefined || ret == null) { ret = def; } return ret; } function set_cookie(e, o, t) { // let's set session variables anyhoo var $name = e; $.get( "/ajax/session-set/"+$name+"?"+$name+"="+escape(o) ); } function get_cookie(cname, def = '') { var $name = cname; $.get( "/ajax/session-get/"+$name, function( data ) { return data; }); }