|
@@ -104,22 +104,20 @@
|
|
|
$(document).ready(() => {
|
|
|
// Load data from server
|
|
|
loadData(true).then((data) => {
|
|
|
- // Get username
|
|
|
- const username = getCookie('username');
|
|
|
// Set up data and print
|
|
|
scope = binder({
|
|
|
card: data
|
|
|
});
|
|
|
- scope.username = username ? username : 'Utilisateur';
|
|
|
+ scope.username = localStorage.username ? localStorage.username : 'Utilisateur';
|
|
|
printContent(scope);
|
|
|
// Show page
|
|
|
setTimeout(() => {
|
|
|
pageLoader(false);
|
|
|
//Show discovery the first time
|
|
|
- if (!getCookie('discovery')) {
|
|
|
+ if (!localStorage.discovery) {
|
|
|
// Load discovery
|
|
|
const discovery = M.TapTarget.init(document.querySelectorAll('.tap-target'), {onClose: () => {
|
|
|
- document.cookie = "discovery=closed";
|
|
|
+ localStorage.setItem('discovery', true)
|
|
|
}})[0];
|
|
|
setTimeout(() => {discovery.open();}, 500);
|
|
|
}
|
|
@@ -187,9 +185,9 @@
|
|
|
|
|
|
function saveUserName(input) {
|
|
|
if (input.value.trim() === '') {
|
|
|
- document.cookie = 'username=Utilisateur';
|
|
|
+ localStorage.removeItem('username');
|
|
|
} else {
|
|
|
- document.cookie = `username=${input.value}`;
|
|
|
+ localStorage.setItem('username', input.value);
|
|
|
}
|
|
|
}
|
|
|
|