From 057c54816e88e44dad04e73befe0aa209d9d6bb7 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 2 Sep 2016 19:19:43 +0200 Subject: [PATCH] acemode --- htdocs/themes/default/js/stikked.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/themes/default/js/stikked.js b/htdocs/themes/default/js/stikked.js index 6bd8845..5f66c29 100644 --- a/htdocs/themes/default/js/stikked.js +++ b/htdocs/themes/default/js/stikked.js @@ -256,6 +256,9 @@ ST.ace_init = function() { $code.after('
'); $code.hide(); + // init modes + ST.ace_modes = $.parseJSON($('#ace_modes').text()); + // init ace ace.config.set("basePath", base_url + "themes/default/js/ace"); ST.ace_editor = ace.edit("editor"); @@ -272,7 +275,8 @@ ST.ace_init = function() { ST.ace_setlang = function() { var lang = $('#lang').val(); - ST.ace_editor.getSession().setMode("ace/mode/" + lang); + var mode = ST.ace_modes[lang]; + ST.ace_editor.getSession().setMode("ace/mode/" + mode); } ST.codemirror_init = function() { @@ -294,7 +298,7 @@ ST.codemirror_init = function() { ST.codemirror_setlang = function() { var lang = $('#lang').val(); - mode = ST.cm_modes[lang]; + var mode = ST.cm_modes[lang]; $.get(base_url + 'main/get_cm_js/' + lang, function(data) {