Skip to content

Commit

Permalink
Cookies: define sameSite value
Browse files Browse the repository at this point in the history
  • Loading branch information
MJacred committed Jan 31, 2023
1 parent 6c2f92d commit edf2dba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions assets/invi/partials/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Sidebar Styles
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid $cp-container-3; // FIXME: lighten($cp-container-3, 5%); -> variable is hex string, not color
border-bottom: 1px solid $cp-container-3; // FIXME (https://github.com/gohugoio/hugo/issues/10632): lighten($cp-container-3, 5%); -> variable is hex string, not color
padding: 0 20px;

img {
Expand Down Expand Up @@ -160,9 +160,9 @@ Sidebar Styles

li {
a {
background-color: $cp-container-3; // FIXME: darken($cp-container-3, 5%); -> variable is hex string, not color
background-color: $cp-container-3; // FIXME (https://github.com/gohugoio/hugo/issues/10632): darken($cp-container-3, 5%); -> variable is hex string, not color
padding-left: 62px;
border-bottom: 1px solid $cp-container-3-border;// FIXME: lighten($cp-container-3-border, 2%); -> variable is hex string, not color
border-bottom: 1px solid $cp-container-3-border;// FIXME (https://github.com/gohugoio/hugo/issues/10632): lighten($cp-container-3-border, 2%); -> variable is hex string, not color
font-size: .8rem;

&:hover {
Expand Down
9 changes: 3 additions & 6 deletions static/js/invi.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ $(document).ready(function () {
var notification = $('#cookie-notification');
if (notification.length) {
var allow_other_cookies = Cookies.get("allow-nonfunctional-website-cookies");
if (allow_other_cookies === null || typeof allow_other_cookies === "undefined") {
// TODO: change html.background-color to `whitesmoke`
} else {
if (allow_other_cookies !== null && typeof allow_other_cookies !== "undefined") {
notification.hide();
}
}
Expand Down Expand Up @@ -213,20 +211,19 @@ $(document).ready(function () {
* @return {boolean} whether to accept cookies beyond the necessary functional ones.
*/
function handleWebsiteCookies(accept) {
Cookies.set("allow-nonfunctional-website-cookies", accept, { expires: 730 }); // i.e. in 2 years
Cookies.set("allow-nonfunctional-website-cookies", accept, { expires: 730, sameSite: 'lax' }); // i.e. in 2 years

var notification = $("#cookie-notification");
if (notification.length) {
notification.hide();
}
// TODO: change html.background-color to `#444F60`
}

/**
* acceptCookiesAndShowYouTubeVideo user clicked on youtube cookie consent button beneath video placeholder.
*/
function acceptCookiesAndShowYouTubeVideo() {
Cookies.set("allow-youtube-cookies", true, { expires: 730 }); // i.e. in 2 years
Cookies.set("allow-youtube-cookies", true, { expires: 730, sameSite: 'lax' }); // i.e. in 2 years

// hide consent notification
var notification = document.getElementsByClassName("video-embed-notification")[0];
Expand Down

0 comments on commit edf2dba

Please sign in to comment.