diff --git a/index.js b/index.js index e1722fb..1351131 100644 --- a/index.js +++ b/index.js @@ -9,10 +9,6 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), { lineWrapping: true }); -function applyColors() { - $("body").attr("style" ,"--foreground:" + $(".CodeMirror").css("color") + "; --background:" + $(".CodeMirror").css("background-color") + ";"); -} - // CodeMirror theme selector var input = document.getElementById("select-theme"); function selectTheme() { @@ -23,7 +19,6 @@ function selectTheme() { } editor.setOption("theme", theme); document.cookie = "theme=" + theme + ";max-age=172800"; - applyColors(); } // ProgrammingFonts font selector @@ -39,9 +34,8 @@ function selectFont() { $("textarea").css({ fontFamily: font + ", monospace" }); $(".CodeMirror").css({ fontFamily: font + ", monospace" }); } - - $("#font-info p").hide(); - $("#font-info ." + font).show(); + $("#select-font a[data-value]").removeClass("active"); + $("#select-font a[data-value='" + font + "']").addClass("active"); document.cookie = "font=" + font + ";max-age=172800"; } @@ -100,13 +94,12 @@ $(document).ready(function(){ } selectTheme(); - applyColors(); setSize(); setSpacing(); setAntialiasing(); selectLanguage(); - var icon = '' + var icon = '' $.getJSON("fonts.json", function(data) { $.each(data, function(k,v) { @@ -117,11 +110,6 @@ $(document).ready(function(){ "" + " " + icon + "" ); - $("#font-info").append( - "
" + - "Get " + v.name + " " + icon + "" + - "
" - ); }); selectFont(); });