From 06fd0fa34b277c255dc7b4923f8be2d16f8e2557 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 25 Sep 2014 14:54:08 -0400 Subject: [PATCH] ace editor --- public/less/admin/admin.less | 6 +++++ .../src/forum/admin/appearance/customise.js | 25 ++++++++++++++++--- src/views/admin/appearance/customise.tpl | 7 ++++-- src/views/admin/header.tpl | 13 +++++----- 4 files changed, 39 insertions(+), 12 deletions(-) diff --git a/public/less/admin/admin.less b/public/less/admin/admin.less index bdb9753ab7..6df3265cad 100644 --- a/public/less/admin/admin.less +++ b/public/less/admin/admin.less @@ -364,6 +364,12 @@ color: black; } } + + #customCSS, #customHTML { + width: 100%; + height: 450px; + display: block; + } } diff --git a/public/src/forum/admin/appearance/customise.js b/public/src/forum/admin/appearance/customise.js index 536816b0f4..51b56e3364 100644 --- a/public/src/forum/admin/appearance/customise.js +++ b/public/src/forum/admin/appearance/customise.js @@ -5,12 +5,29 @@ define('forum/admin/appearance/customise', ['forum/admin/settings'], function(Se var Customise = {}; Customise.init = function() { - var customCSSEl = $('textarea[data-field]')[0]; - tabIndent.config.tab = ' '; - tabIndent.render(customCSSEl); + Settings.prepare(function() { + $('#customCSS').text($('#customCSS-holder').val()); + $('#customHTML').text($('#customHTML-holder').val()); + + var customCSS = ace.edit("customCSS"); + customHTML = ace.edit("customHTML"); - Settings.prepare(); + customCSS.setTheme("ace/theme/twilight"); + customCSS.getSession().setMode("ace/mode/css"); + + customCSS.on('change', function(e) { + $('#customCSS-holder').val(customCSS.getValue()); + }); + + customHTML.setTheme("ace/theme/twilight"); + customHTML.getSession().setMode("ace/mode/html"); + + customHTML.on('change', function(e) { + $('#customHTML-holder').val(customHTML.getValue()); + }); + }); }; return Customise; }); + \ No newline at end of file diff --git a/src/views/admin/appearance/customise.tpl b/src/views/admin/appearance/customise.tpl index 5e1fbdd546..9d91a631ed 100644 --- a/src/views/admin/appearance/customise.tpl +++ b/src/views/admin/appearance/customise.tpl @@ -5,7 +5,8 @@

You may also opt to enter your own CSS declarations here, which will be applied after all other styles.

- +
+
@@ -20,7 +21,9 @@

You can enter custom HTML here (ex. JavaScript, Meta Tags, etc.) which will be appended to the <head> section of your forum's markup.

- + +
+
diff --git a/src/views/admin/header.tpl b/src/views/admin/header.tpl index 37a82c1f90..a8b94dd16a 100644 --- a/src/views/admin/header.tpl +++ b/src/views/admin/header.tpl @@ -19,11 +19,12 @@ - - - - - + + + + + +