From 244b35e0715d2253fd4800da1d77bcd9dc91cc68 Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 7 Mar 2022 15:10:31 +0100 Subject: [PATCH] removed jquery cookie --- frontend/src/scripts/account/result-filters.ts | 1 - frontend/src/scripts/config.ts | 1 - frontend/src/scripts/controllers/tag-controller.ts | 8 -------- frontend/static/js/jquery.cookie-1.4.1.min.js | 2 -- 4 files changed, 12 deletions(-) delete mode 100644 frontend/static/js/jquery.cookie-1.4.1.min.js diff --git a/frontend/src/scripts/account/result-filters.ts b/frontend/src/scripts/account/result-filters.ts index abffc9b67..09f5a04ae 100644 --- a/frontend/src/scripts/account/result-filters.ts +++ b/frontend/src/scripts/account/result-filters.ts @@ -67,7 +67,6 @@ function save(): void { } export function load(): void { - // let newTags = $.cookie("activeTags"); console.log("loading filters"); try { const newResultFilters = window.localStorage.getItem("resultFilters"); diff --git a/frontend/src/scripts/config.ts b/frontend/src/scripts/config.ts index b2c1ec003..a976ea2c8 100644 --- a/frontend/src/scripts/config.ts +++ b/frontend/src/scripts/config.ts @@ -1830,7 +1830,6 @@ export function reset(): void { export function loadFromLocalStorage(): void { console.log("loading localStorage config"); - // let newConfig = $.cookie("config"); const newConfigString = window.localStorage.getItem("config"); let newConfig: MonkeyTypes.Config; if ( diff --git a/frontend/src/scripts/controllers/tag-controller.ts b/frontend/src/scripts/controllers/tag-controller.ts index afe757c76..b4e27e166 100644 --- a/frontend/src/scripts/controllers/tag-controller.ts +++ b/frontend/src/scripts/controllers/tag-controller.ts @@ -10,13 +10,6 @@ export function saveActiveToLocalStorage(): void { tags.push(tag._id); } }); - // let d = new Date(); - // d.setFullYear(d.getFullYear() + 1); - // $.cookie("activeTags", null); - // $.cookie("activeTags", JSON.stringify(tags), { - // expires: d, - // path: "/", - // }); window.localStorage.setItem("activeTags", JSON.stringify(tags)); } catch (e) {} } @@ -66,7 +59,6 @@ export function toggle(tagid: string, nosave = false): void { } export function loadActiveFromLocalStorage(): void { - // let newTags = $.cookie("activeTags"); let newTags: string[] | string = window.localStorage.getItem( "activeTags" ) as string; diff --git a/frontend/static/js/jquery.cookie-1.4.1.min.js b/frontend/static/js/jquery.cookie-1.4.1.min.js deleted file mode 100644 index c0f19d8a3..000000000 --- a/frontend/static/js/jquery.cookie-1.4.1.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jquery.cookie v1.4.1 | MIT */ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}}); \ No newline at end of file