From c0aa93a3c1277b2545f27d17157a628cf875da51 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 18 Oct 2024 18:39:38 -0400 Subject: [PATCH] Fixes #20 core.cookie.remove now sets the value and the date of the date object to null which deletes the cookie. --- public/assets/scaffolding-min.js | 20 +------------------- src/js/core/_core.js | 18 +----------------- src/js/scaffolding.js | 3 +-- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/public/assets/scaffolding-min.js b/public/assets/scaffolding-min.js index 2220f34..7eda73a 100644 --- a/public/assets/scaffolding-min.js +++ b/public/assets/scaffolding-min.js @@ -75,23 +75,6 @@ var showMessage = function showMessage(m, s) { status.remove(); }, 1000); }; - -// const oneClickSelect = (e, t = e.currentTarget) => { -// // In here, "this" is the element -// var range, selection; -// if (window.getSelection) { -// selection = window.getSelection(); -// range = document.createRange(); -// range.selectNodeContents(t); -// selection.removeAllRanges(); -// selection.addRange(range); -// } else if (document.body.createTextRange) { -// range = document.body.createTextRange(); -// range.moveToElementText(t); -// range.select(); -// } -// } - var getURLVars = function getURLVars() { var oResult = {}; if (location.search.length > 0) { @@ -146,7 +129,7 @@ module.exports = { return ""; }, remove: function remove(cname) { - module.exports.cookie.set(cname, "", -1); + module.exports.cookie.set(cname, null, new Date(null)); } }, oneClickSelect: function oneClickSelect(e) { @@ -3411,7 +3394,6 @@ var flipInfoSwitch = function flipInfoSwitch(e) { }); break; case "breakpoints": - console.log("here"); _core_core_js__WEBPACK_IMPORTED_MODULE_0__.cookie.set("show-breakpoints", s.getAttribute("aria-checked"), 30, "/"); document.querySelector("html").classList[s.getAttribute("aria-checked") == "true" ? "add" : "remove"]("show-breakpoints"); break; diff --git a/src/js/core/_core.js b/src/js/core/_core.js index 49d34e0..bc62a3c 100644 --- a/src/js/core/_core.js +++ b/src/js/core/_core.js @@ -71,22 +71,6 @@ const showMessage = (m, s) => { }, 1000); } -// const oneClickSelect = (e, t = e.currentTarget) => { -// // In here, "this" is the element -// var range, selection; -// if (window.getSelection) { -// selection = window.getSelection(); -// range = document.createRange(); -// range.selectNodeContents(t); -// selection.removeAllRanges(); -// selection.addRange(range); -// } else if (document.body.createTextRange) { -// range = document.body.createTextRange(); -// range.moveToElementText(t); -// range.select(); -// } -// } - const getURLVars = () => { var oResult = {}; if (location.search.length > 0) { @@ -146,7 +130,7 @@ module.exports = { return ""; }, remove: (cname) => { - module.exports.cookie.set(cname, "", -1); + module.exports.cookie.set(cname, null, new Date(null)); }, }, oneClickSelect: (e, t = e.currentTarget) => { diff --git a/src/js/scaffolding.js b/src/js/scaffolding.js index 5dc1423..36d6421 100644 --- a/src/js/scaffolding.js +++ b/src/js/scaffolding.js @@ -24,6 +24,7 @@ core.init({ } }); + // deprecated switch handler const flipInfoSwitch = (e, s = e.currentTarget) => { @@ -37,12 +38,10 @@ const flipInfoSwitch = (e, s = e.currentTarget) => { break; case "breakpoints" : - console.log("here") core.cookie.set("show-breakpoints", s.getAttribute("aria-checked"), 30, "/"); document.querySelector("html").classList[( s.getAttribute("aria-checked") == "true" ? "add" : "remove" )]("show-breakpoints"); break; } - } // create a pure JS mouse click event