From 795afa896fc60342c698ac35412ae2c7a4ca4efb Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Sat, 29 Jul 2017 11:36:07 +0200 Subject: [PATCH] cookie max age --- index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index bfb32b4..fb55d02 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,7 @@ var input = document.getElementById("select-theme"); function selectTheme() { var theme = input.options[input.selectedIndex].innerHTML; editor.setOption("theme", theme); - document.cookie = "theme=" + theme; + document.cookie = "theme=" + theme + ";max-age=172800"; applyColors(); } @@ -39,7 +39,7 @@ function selectFont() { $("#font-info p").hide(); $("#font-info ." + font).show(); - document.cookie = "font=" + font; + document.cookie = "font=" + font + ";max-age=172800"; } window.onhashchange = selectFont; @@ -47,26 +47,26 @@ window.onhashchange = selectFont; function setSize() { var size = $("#size").val(); $(".CodeMirror").css({ fontSize: size + "px" }); - document.cookie = "size=" + size; + document.cookie = "size=" + size + ";max-age=172800"; } function setSpacing() { var spacing = $("#spacing").val(); $(".CodeMirror").css({ lineHeight: spacing }); - document.cookie = "spacing=" + spacing; + document.cookie = "spacing=" + spacing + ";max-age=172800"; } function setAntialiasing() { if ($("#aliasing").is(":checked")) { $(".CodeMirror").removeClass("no-smooth"); - document.cookie = "antialiasing=smooth"; + document.cookie = "antialiasing=smooth" + ";max-age=172800"; } else { $(".CodeMirror").addClass("no-smooth"); - document.cookie = "antialiasing=no-smooth"; + document.cookie = "antialiasing=no-smooth" + ";max-age=172800"; } } function selectLanguage() { var lang = $("#select-language").val(); editor.setOption("mode", lang.toLowerCase()); - document.cookie = "language=" + lang; + document.cookie = "language=" + lang + ";max-age=172800"; } $(document).ready(function(){