diff --git a/modules/editor/skins/xpresseditor/editor.html b/modules/editor/skins/xpresseditor/editor.html index 3fb8f3e2d..e1f749bf4 100644 --- a/modules/editor/skins/xpresseditor/editor.html +++ b/modules/editor/skins/xpresseditor/editor.html @@ -458,7 +458,7 @@ var auto_saved_msg = "{$lang->msg_auto_saved}"; var oEditor; jQuery(function(){ - oEditor = editorStart_xe("{$editor_sequence}", "{$editor_primary_key_name}", "{$editor_content_key_name}", "{$editor_height}", "{$colorset}", "{$content_style}",'{$content_font}','{$content_font_size}'); + oEditor = editorStart_xe("{$editor_sequence}", "{$editor_primary_key_name}", "{$editor_content_key_name}", "{$editor_height}", "{$colorset}", "{$content_style}", '{$content_font}', '{$content_font_size}', '{$content_line_height}', '{$content_paragraph_spacing}', '{$content_word_break}'); diff --git a/modules/editor/skins/xpresseditor/js/xe_interface.js b/modules/editor/skins/xpresseditor/js/xe_interface.js index 3d8884403..2de25d180 100644 --- a/modules/editor/skins/xpresseditor/js/xe_interface.js +++ b/modules/editor/skins/xpresseditor/js/xe_interface.js @@ -2,11 +2,14 @@ if (!window.xe) xe = {}; xe.Editors = []; -function editorStart_xe(editor_sequence, primary_key, content_key, editor_height, colorset, content_style, content_font, content_font_size) { +function editorStart_xe(editor_sequence, primary_key, content_key, editor_height, colorset, content_style, content_font, content_font_size, content_line_height, content_paragraph_spacing, content_word_break) { if(typeof(colorset)=='undefined') colorset = 'white'; if(typeof(content_style)=='undefined') content_style = 'xeStyle'; if(typeof(content_font)=='undefined') content_font= ''; if(typeof(content_font_size)=='undefined') content_font_size= ''; + if(typeof(content_line_height)=='undefined') content_line_height= ''; + if(typeof(content_paragraph_spacing)=='undefined') content_paragraph_spacing= ''; + if(typeof(content_word_break)=='undefined') content_word_break= ''; var target_src = request_uri+'modules/editor/styles/'+content_style+'/editor.html'; @@ -132,7 +135,36 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height if(content_font_size && !doc.body.style.fontSize) { doc.body.style.fontSize = content_font_size; } - + if(content_line_height && !doc.body.style.lineHeight) { + doc.body.style.lineHeight = content_line_height; + } + if(content_word_break === "none") { + doc.body.style.whiteSpace = "nowrap"; + } else { + doc.body.style.wordBreak = content_word_break ? content_word_break : "normal"; + doc.body.style.wordWrap = "break-word"; + } + + var paragraph_css; + if(!content_paragraph_spacing) { + paragraph_css = '.xe_content.editable p { margin: 0; }'; + } else { + paragraph_css = '.xe_content.editable p { margin: 0 0 ' + content_paragraph_spacing + ' 0; }'; + } + var style = doc.createElement('style'); + style.type = 'text/css'; + if (style.styleSheet){ + style.styleSheet.cssText = paragraph_css; + } else { + style.appendChild(doc.createTextNode(paragraph_css)); + } + var head = doc.head || doc.getElementsByTagName('head')[0]; + head.appendChild(style); + + if(content_style === "ckeditor_light") { + doc.body.style.margin = "0"; + } + // run oEditor.run(); } catch(e) {