cookie max age

This commit is contained in:
Koen Lageveen 2017-07-29 11:36:07 +02:00
parent 55beda47f1
commit 795afa896f
1 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,7 @@ var input = document.getElementById("select-theme");
function selectTheme() { function selectTheme() {
var theme = input.options[input.selectedIndex].innerHTML; var theme = input.options[input.selectedIndex].innerHTML;
editor.setOption("theme", theme); editor.setOption("theme", theme);
document.cookie = "theme=" + theme; document.cookie = "theme=" + theme + ";max-age=172800";
applyColors(); applyColors();
} }
@ -39,7 +39,7 @@ function selectFont() {
$("#font-info p").hide(); $("#font-info p").hide();
$("#font-info ." + font).show(); $("#font-info ." + font).show();
document.cookie = "font=" + font; document.cookie = "font=" + font + ";max-age=172800";
} }
window.onhashchange = selectFont; window.onhashchange = selectFont;
@ -47,26 +47,26 @@ window.onhashchange = selectFont;
function setSize() { function setSize() {
var size = $("#size").val(); var size = $("#size").val();
$(".CodeMirror").css({ fontSize: size + "px" }); $(".CodeMirror").css({ fontSize: size + "px" });
document.cookie = "size=" + size; document.cookie = "size=" + size + ";max-age=172800";
} }
function setSpacing() { function setSpacing() {
var spacing = $("#spacing").val(); var spacing = $("#spacing").val();
$(".CodeMirror").css({ lineHeight: spacing }); $(".CodeMirror").css({ lineHeight: spacing });
document.cookie = "spacing=" + spacing; document.cookie = "spacing=" + spacing + ";max-age=172800";
} }
function setAntialiasing() { function setAntialiasing() {
if ($("#aliasing").is(":checked")) { if ($("#aliasing").is(":checked")) {
$(".CodeMirror").removeClass("no-smooth"); $(".CodeMirror").removeClass("no-smooth");
document.cookie = "antialiasing=smooth"; document.cookie = "antialiasing=smooth" + ";max-age=172800";
} else { } else {
$(".CodeMirror").addClass("no-smooth"); $(".CodeMirror").addClass("no-smooth");
document.cookie = "antialiasing=no-smooth"; document.cookie = "antialiasing=no-smooth" + ";max-age=172800";
} }
} }
function selectLanguage() { function selectLanguage() {
var lang = $("#select-language").val(); var lang = $("#select-language").val();
editor.setOption("mode", lang.toLowerCase()); editor.setOption("mode", lang.toLowerCase());
document.cookie = "language=" + lang; document.cookie = "language=" + lang + ";max-age=172800";
} }
$(document).ready(function(){ $(document).ready(function(){