From 446266a79b78327ae48642ea86f5eee2d2fd1574 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 22 Jul 2016 12:25:42 +0200 Subject: [PATCH] remember the last language used on a particular pad --- www/code/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/code/main.js b/www/code/main.js index a106b532b..d4decf89f 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -322,10 +322,12 @@ define([ }); $rightside.append($forgetPad); + var lastLanguage = Cryptpad.getPadAttribute('language') || 'javascript'; + /* Let the user select different syntax highlighting modes */ var syntaxDropdown = ''; @@ -347,6 +349,7 @@ define([ var $language = module.$language = $bar.find('#language-mode').on('change', function () { var mode = $language.val(); setMode(mode); + Cryptpad.setPadAttribute('language', mode); }); $rightside.append(themeDropdown);