From deb63d244734b87dab95c98987e8f02452d06646 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 5 Aug 2016 15:03:42 +0200 Subject: [PATCH] share syntax highlighting selection with peers --- www/code/main.js | 61 +++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/www/code/main.js b/www/code/main.js index f284c8ae8..29a04ae6f 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -150,6 +150,9 @@ define([ // append the userlist to the hyperjson structure obj.metadata = userList; + // set mode too... + obj.highlightMode = module.highlightMode; + // stringify the json and send it into chainpad var shjson = stringify(obj); @@ -370,37 +373,25 @@ define([ }); $rightside.append($forgetPad); - // TODO use cb var configureLanguage = function (cb) { // FIXME this is async so make it happen as early as possible - Cryptpad.getPadAttribute('language', function (err, lastLanguage) { - if (err) { - console.log("Unable to get pad language"); - } - - lastLanguage = lastLanguage || 'javascript'; - - /* Let the user select different syntax highlighting modes */ - var syntaxDropdown = ''; - setMode(lastLanguage); - - $rightside.append(syntaxDropdown); + /* Let the user select different syntax highlighting modes */ + var $language = module.$language = $('