From f8732a8b3d9b3cbed2b3a0e5bfaa1dbd42918dac Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 16 Jan 2014 14:03:48 -0500 Subject: [PATCH] Internationalize the forums post Markdown editor This includes removing the "PREVIEW" label for the preview pane from CSS and adding it to the generated DOM. --- .../views/thread_response_view.coffee | 4 +- lms/static/coffee/src/customwmd.coffee | 7 +- lms/static/js/Markdown.Editor.js | 50 +++--- lms/static/sass/_discussion.scss | 144 ++++++------------ 4 files changed, 78 insertions(+), 127 deletions(-) diff --git a/common/static/coffee/src/discussion/views/thread_response_view.coffee b/common/static/coffee/src/discussion/views/thread_response_view.coffee index 0b2647bdbf..3f15791c84 100644 --- a/common/static/coffee/src/discussion/views/thread_response_view.coffee +++ b/common/static/coffee/src/discussion/views/thread_response_view.coffee @@ -35,7 +35,7 @@ if Backbone? hideEditorChrome: -> @$('.wmd-button-row').hide() - @$('.wmd-preview').hide() + @$('.wmd-preview-container').hide() @$('.wmd-input').css({ height: '35px', padding: '5px' @@ -44,7 +44,7 @@ if Backbone? showEditorChrome: -> @$('.wmd-button-row').show() - @$('.wmd-preview').show() + @$('.wmd-preview-container').show() @$('.comment-post-control').show() @$('.wmd-input').css({ height: '125px', diff --git a/lms/static/coffee/src/customwmd.coffee b/lms/static/coffee/src/customwmd.coffee index 2dabc3ed15..8307ecd396 100644 --- a/lms/static/coffee/src/customwmd.coffee +++ b/lms/static/coffee/src/customwmd.coffee @@ -132,11 +132,14 @@ $ -> $elem.empty() _append = appended_id || "" wmdInputId = "wmd-input#{_append}" + $wmdPreviewContainer = $("
").addClass("wmd-preview-container") + .append($("
").addClass("wmd-preview-label").text(gettext("Preview"))) + .append($("
").attr("id", "wmd-preview#{_append}").addClass("wmd-panel wmd-preview")) $wmdPanel = $("
").addClass("wmd-panel") .append($("
").attr("id", "wmd-button-bar#{_append}")) - .append($("