From 4a79643fde639fc40ededcbab59f9631bd750800 Mon Sep 17 00:00:00 2001 From: cahrens Date: Wed, 23 Jan 2013 16:43:49 -0500 Subject: [PATCH 1/2] Make code inline instead of block. --- common/lib/xmodule/xmodule/js/src/html/edit.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/html/edit.coffee b/common/lib/xmodule/xmodule/js/src/html/edit.coffee index 39f1d8edef..ea02d78e63 100644 --- a/common/lib/xmodule/xmodule/js/src/html/edit.coffee +++ b/common/lib/xmodule/xmodule/js/src/html/edit.coffee @@ -22,11 +22,13 @@ class @HTMLEditingDescriptor schema: "html5", # TODO: we should share this CSS with studio (and LMS) content_css : "/static/css/tiny-mce.css", - # Disable h4, h5, and h6 styles as we don't have CSS for them. formats : { + # Disable h4, h5, and h6 styles as we don't have CSS for them. h4: {}, h5: {}, - h6: {} + h6: {}, + # tinyMCE does block level for code by default + code: {inline: 'code'} }, # Disable visual aid on borderless table. visual:false, @@ -50,7 +52,7 @@ class @HTMLEditingDescriptor @setupTinyMCE: (ed) -> ed.addButton('wrapAsCode', { - title : 'Code Block', + title : 'Code', image : '/static/images/ico-tinymce-code.png', onclick : () -> ed.formatter.toggle('code') From 711cc9a041f707cf6658eccb0b3b695a1e1962ab Mon Sep 17 00:00:00 2001 From: cahrens Date: Wed, 23 Jan 2013 20:18:28 -0500 Subject: [PATCH 2/2] Tell tinyMCE to not change image paths. #143 --- common/lib/xmodule/xmodule/js/src/html/edit.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/lib/xmodule/xmodule/js/src/html/edit.coffee b/common/lib/xmodule/xmodule/js/src/html/edit.coffee index ea02d78e63..fa83343d7a 100644 --- a/common/lib/xmodule/xmodule/js/src/html/edit.coffee +++ b/common/lib/xmodule/xmodule/js/src/html/edit.coffee @@ -20,6 +20,8 @@ class @HTMLEditingDescriptor theme : "advanced", skin: 'studio', schema: "html5", + # Necessary to preserve relative URLs to our images. + convert_urls : false, # TODO: we should share this CSS with studio (and LMS) content_css : "/static/css/tiny-mce.css", formats : {