-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from openearth/feat/cookie-welcome-dialog
Feat/cookie welcome dialog
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export function setCookie(cname, cvalue, exdays) { | ||
const d = new Date(); | ||
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); | ||
let expires = "expires="+d.toUTCString(); | ||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; | ||
} | ||
|
||
export function getCookie(cname) { | ||
let name = cname + "="; | ||
let ca = document.cookie.split(';'); | ||
for (let i = 0; i < ca.length; i++) { | ||
let c = ca[i]; | ||
while (c.charAt(0) == ' ') { | ||
c = c.substring(1); | ||
} | ||
if (c.indexOf(name) == 0) { | ||
return c.substring(name.length, c.length); | ||
} | ||
} | ||
return ""; | ||
} | ||
|
f84a72b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://data.openearth.nl as production
🚀 Deployed on https://67a1e6d98afa7fd040f5893a--deltares-viewer.netlify.app
f84a72b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://nl2120.netlify.app as production
🚀 Deployed on https://67a1e6d8198bf118af9b626f--nl2120.netlify.app
f84a72b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://viewer.openearth.nl as production
🚀 Deployed on https://67a1e6e22615c0e03a199562--rws-viewer.netlify.app