From 9681347b8e9f6059c3f5f02528e0893bef5acca4 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 18 Sep 2020 12:22:26 -0400 Subject: Move webcards to seperate repo --- webcards/scripts/cookie.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 webcards/scripts/cookie.js (limited to 'webcards/scripts/cookie.js') diff --git a/webcards/scripts/cookie.js b/webcards/scripts/cookie.js deleted file mode 100644 index d614af7..0000000 --- a/webcards/scripts/cookie.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -class Cookies { - static getCookie(name){ - let cookies = document.cookie.split(";"); - for(let i in cookies) { - let cname = cookies[i].trim().split("=")[0]; - if(cname == name){ - return cookies[i].trim().slice(name.length + 1); - } - } - return ""; - } - - static setCookie(name, value, data = {}) { - let extra = ""; - - for(let key in data) - { - extra += "; " + key + "=" + data[key]; - } - - document.cookie = name + "=" + value + extra; - } - - static setYearCookie(name, value) { - var date = new Date(Date.now()); - date.setFullYear(date.getFullYear() + 1); - Cookies.setCookie(name, value, {expires: date.toUTCString()}); - } - - static removeCookie(name) { - var date = new Date(0); - Cookies.setCookie(name, "", {expires: date.toUTCString()}); - } -} -- cgit v1.2.3