diff --git a/cms/static/coffee/src/views/unit.coffee b/cms/static/coffee/src/views/unit.coffee index 91740a2b04..e7cb5574eb 100644 --- a/cms/static/coffee/src/views/unit.coffee +++ b/cms/static/coffee/src/views/unit.coffee @@ -98,6 +98,9 @@ class CMS.Views.UnitEdit extends Backbone.View @$editor = $($('#html-editor').html()) $preview = $('
') initHTMLEditor(@$editor, $preview) + when 'discussion' + @$editor = $($('#discussion-editor').html()) + $preview = $($('#discussion-preview').html()) @$editor.find('.save-button, .cancel-button').bind('click', => @$componentItem.removeClass('editing') @@ -108,6 +111,7 @@ class CMS.Views.UnitEdit extends Backbone.View @$componentItem.append(@$editor) @$componentItem.append($preview) + @$componentItem.append($componentActions) @$componentItem.hide() @$newComponentItem.before(@$componentItem) diff --git a/cms/static/img/new-post-icon.png b/cms/static/img/new-post-icon.png new file mode 100644 index 0000000000..bf16b9da89 Binary files /dev/null and b/cms/static/img/new-post-icon.png differ diff --git a/cms/static/img/show-hide-discussion-icon.png b/cms/static/img/show-hide-discussion-icon.png new file mode 100644 index 0000000000..17d3193780 Binary files /dev/null and b/cms/static/img/show-hide-discussion-icon.png differ diff --git a/cms/static/js/html-editor.js b/cms/static/js/html-editor.js index 9d530b6199..9a84e26820 100644 --- a/cms/static/js/html-editor.js +++ b/cms/static/js/html-editor.js @@ -5,7 +5,6 @@ var htmlEditor; function initHTMLEditor($editor, $prev) { $htmlEditor = $editor; - console.log($editor.find('.edit-box')); htmlEditor = CodeMirror.fromTextArea($editor.find('.edit-box')[0], { lineWrapping: true, mode: 'xml', @@ -15,9 +14,13 @@ function initHTMLEditor($editor, $prev) { currentEditor = htmlEditor; - $(htmlEditor.getWrapperElement()).css('background', '#fff'); - - $(htmlEditor.getWrapperElement()).bind('click', setFocus); + $(htmlEditor.getWrapperElement()).css({ + 'background': '#fff' + }); + $(htmlEditor.getWrapperElement()).bind('click', function() { + $(htmlEditor).focus(); + }); + $(htmlEditor).focus(); $htmlPreview = $prev; } diff --git a/cms/static/js/speed-editor.js b/cms/static/js/speed-editor.js index b2499324cb..cfd2b96419 100644 --- a/cms/static/js/speed-editor.js +++ b/cms/static/js/speed-editor.js @@ -155,7 +155,7 @@ function updateXML() { xml = xml.replace(/\{\{video\s(.*)\}\}/g, '
+ + + +