diff --git a/modules/editor/editor.admin.controller.php b/modules/editor/editor.admin.controller.php index baf7750a3..fa2660fd4 100644 --- a/modules/editor/editor.admin.controller.php +++ b/modules/editor/editor.admin.controller.php @@ -146,25 +146,30 @@ class editorAdminController extends editor $configVars = Context::getRequestVars(); $config = new stdClass; - if($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N'; - else $config->font_defined = 'Y'; - - if($config->font_defined == 'Y') - $config->content_font = $configVars->content_font_defined; - else - $config->content_font = $configVars->content_font; - $config->editor_skin = $configVars->editor_skin; $config->editor_height = $configVars->editor_height; $config->comment_editor_skin = $configVars->comment_editor_skin; $config->comment_editor_height = $configVars->comment_editor_height; $config->content_style = $configVars->content_style; - - $config->content_font_size= $configVars->content_font_size.'px'; $config->sel_editor_colorset= $configVars->sel_editor_colorset; $config->sel_comment_editor_colorset= $configVars->sel_comment_editor_colorset; + + if ($configVars->font_defined === 'Y') + { + $config->font_defined = 'Y'; + $config->content_font = $configVars->content_font_defined; + } + else + { + $config->font_defined = $configVars->font_defined = 'N'; + $config->content_font = $configVars->content_font; + } + $config->content_font_size = intval($configVars->content_font_size) . 'px'; + $config->content_line_height = intval($configVars->content_line_height) . '%'; + $config->content_paragraph_spacing = intval($configVars->content_paragraph_spacing) . 'px'; + $config->content_word_break = $configVars->content_word_break; - $oModuleController->insertModuleConfig('editor',$config); + $oModuleController->insertModuleConfig('editor', $config); $this->setRedirectUrl(Context::get('error_return_url')); } diff --git a/modules/editor/editor.admin.view.php b/modules/editor/editor.admin.view.php index 48e3c1383..e90ba5649 100644 --- a/modules/editor/editor.admin.view.php +++ b/modules/editor/editor.admin.view.php @@ -74,7 +74,7 @@ class editorAdminView extends editor { if($packages[$xml_info->package_srl]) $xml_info->need_update = $packages[$xml_info->package_srl]->need_update; } - $editor_config_default = array( "editor_height" => "300", "comment_editor_height" => "100","content_font_size"=>"13"); + $editor_config_default = array('editor_height' => 300, 'comment_editor_height' => 100); //editor preview $config = $oEditorModel->getEditorConfig(); @@ -84,6 +84,9 @@ class editorAdminView extends editor $option->content_style = $config->content_style; $option->content_font = $config->content_font; $option->content_font_size = $config->content_font_size; + $option->content_line_height = $config->content_line_height; + $option->content_paragraph_spacing = $config->content_paragraph_spacing; + $option->content_word_break = $config->content_word_break; $option->enable_autosave = false; $option->enable_default_component = true; $option->enable_component = true; @@ -102,6 +105,9 @@ class editorAdminView extends editor $option_com->content_style = $config->content_style; $option_com->content_font = $config->content_font; $option_com->content_font_size = $config->content_font_size; + $option_com->content_line_height = $config->content_line_height; + $option_com->content_paragraph_spacing = $config->content_paragraph_spacing; + $option_com->content_word_break = $config->content_word_break; $option_com->enable_autosave = false; $option_com->enable_default_component = true; $option_com->enable_component = true; diff --git a/modules/editor/editor.controller.php b/modules/editor/editor.controller.php index 0d6243113..74f322fbf 100644 --- a/modules/editor/editor.controller.php +++ b/modules/editor/editor.controller.php @@ -186,15 +186,35 @@ class editorController extends editor } $content_font = $editor_config->content_font; $content_font_size = $editor_config->content_font_size; - if($content_font || $content_font_size) + $content_line_height = $editor_config->content_line_height; + $content_paragraph_spacing = $editor_config->content_paragraph_spacing; + $content_word_break = $editor_config->content_word_break; + $buff = array(); + $buff[] = ''; - Context::addHtmlHeader(implode('', $buff)); + $buff[] = "font-family: $content_font;"; } + if ($content_font_size) + { + $buff[] = "font-size: $content_font_size;"; + } + if ($content_line_height) + { + $buff[] = "line-height: $content_line_height;"; + } + if ($content_word_break === 'none') + { + $buff[] = 'white-space: nowrap;'; + } + else + { + $buff[] = 'word-break: ' . ($content_word_break ?: 'normal') . '; word-wrap: break-word;'; + } + $buff[] = '}'; + if ($content_paragraph_spacing) $buff[] = ".xe_content p { margin: 0 0 $content_paragraph_spacing 0; }"; + $buff[] = ''; + Context::addHtmlHeader(implode(' ', $buff)); } $content = $this->transComponent($content); diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php index c50bd57cb..fb71bffdf 100644 --- a/modules/editor/editor.model.php +++ b/modules/editor/editor.model.php @@ -83,6 +83,18 @@ class editorModel extends editor { $editor_config->content_font_size = $editor_default_config->content_font_size; } + if((!$editor_config->content_line_height && $editor_default_config->content_line_height) || $editor_config->default_editor_settings === 'Y') + { + $editor_config->content_line_height = $editor_default_config->content_line_height; + } + if((!$editor_config->content_paragraph_spacing && $editor_default_config->content_paragraph_spacing) || $editor_config->default_editor_settings === 'Y') + { + $editor_config->content_paragraph_spacing = $editor_default_config->content_paragraph_spacing; + } + if((!$editor_config->content_word_break && $editor_default_config->content_word_break) || $editor_config->default_editor_settings === 'Y') + { + $editor_config->content_word_break = $editor_default_config->content_word_break; + } if((!$editor_config->sel_editor_colorset && $editor_default_config->sel_editor_colorset) || $editor_config->default_editor_settings === 'Y') { $editor_config->sel_editor_colorset = $editor_default_config->sel_editor_colorset; @@ -218,8 +230,11 @@ class editorModel extends editor Context::set('content_style', $option->content_style); Context::set('content_style_path', $this->module_path . 'styles/' . $option->content_style); // Default font setting - Context::set('content_font', addslashes($option->content_font)); + Context::set('content_font', $option->content_font); Context::set('content_font_size', $option->content_font_size); + Context::set('content_line_height', $option->content_line_height); + Context::set('content_paragraph_spacing', $option->content_paragraph_spacing); + Context::set('content_word_break', $option->content_word_break); // Option setting to allow auto-save if(!$option->enable_autosave) $enable_autosave = false; @@ -379,6 +394,9 @@ class editorModel extends editor $config->content_style = $editor_config->content_style; $config->content_font = $editor_config->content_font; $config->content_font_size = $editor_config->content_font_size; + $config->content_line_height = $editor_config->content_line_height; + $config->content_paragraph_spacing = $editor_config->content_paragraph_spacing; + $config->content_word_break = $editor_config->content_word_break; $config->sel_editor_colorset = $editor_config->sel_editor_colorset; $config->upload_file_grant = $editor_config->upload_file_grant; $config->enable_default_component_grant = $editor_config->enable_default_component_grant; @@ -393,6 +411,9 @@ class editorModel extends editor $config->content_style = $editor_config->comment_content_style; $config->content_font = $editor_config->content_font; $config->content_font_size = $editor_config->content_font_size; + $config->content_line_height = $editor_config->content_line_height; + $config->content_paragraph_spacing = $editor_config->content_paragraph_spacing; + $config->content_word_break = $editor_config->content_word_break; $config->sel_editor_colorset = $editor_config->sel_comment_editor_colorset; $config->upload_file_grant = $editor_config->comment_upload_file_grant; $config->enable_default_component_grant = $editor_config->enable_comment_default_component_grant; @@ -418,6 +439,9 @@ class editorModel extends editor $option->content_style = $config->content_style; $option->content_font = $config->content_font; $option->content_font_size = $config->content_font_size; + $option->content_line_height = $config->content_line_height; + $option->content_paragraph_spacing = $config->content_paragraph_spacing; + $option->content_word_break = $config->content_word_break; $option->colorset = $config->sel_editor_colorset; // Permission check for file upload $option->allow_fileupload = false; diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index 272a014f9..01f8b5da9 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -161,6 +161,9 @@ class editorView extends editor $option_com->content_style = $config->content_style; $option_com->content_font = $config->content_font; $option_com->content_font_size = $config->content_font_size; + $option_com->content_line_height = $config->content_line_height; + $option_com->content_paragraph_spacing = $config->content_paragraph_spacing; + $option_com->content_word_break = $config->content_word_break; $option_com->enable_autosave = false; $option_com->enable_default_component = true; $option_com->enable_component = true; @@ -180,6 +183,9 @@ class editorView extends editor $option->content_style = $config->content_style; $option->content_font = $config->content_font; $option->content_font_size = $config->content_font_size; + $option->content_line_height = $config->content_line_height; + $option->content_paragraph_spacing = $config->content_paragraph_spacing; + $option->content_word_break = $config->content_word_break; $option->enable_autosave = false; $option->enable_default_component = true; $option->enable_component = true; diff --git a/modules/editor/lang/en.php b/modules/editor/lang/en.php index 5cf1f7597..922619eaa 100644 --- a/modules/editor/lang/en.php +++ b/modules/editor/lang/en.php @@ -2,14 +2,22 @@ $lang->editor_component = 'Editor Component'; $lang->main_editor = 'Main editor'; $lang->comment_editor = 'Comment editor'; -$lang->editor_option = 'Editor Option'; -$lang->guide_choose_main_editor = 'Main editor.'; -$lang->guide_set_height_main_editor = 'Height of the main editor.'; -$lang->guide_choose_comment_editor = 'Comment editor.'; -$lang->guide_set_height_comment_editor = 'Height of the comment editor.'; -$lang->guide_choose_text_formatting = 'Text formatting'; -$lang->guide_choose_font_body = 'Font body'; -$lang->guide_choose_font_size_body = 'Size body'; +$lang->editor_option = 'Editor Options'; +$lang->guide_choose_main_editor = 'Main editor'; +$lang->guide_set_height_main_editor = 'Main editor height'; +$lang->guide_choose_comment_editor = 'Comment editor'; +$lang->guide_set_height_comment_editor = 'Comment editor height'; +$lang->guide_choose_text_formatting = 'Text formatting style'; +$lang->guide_choose_font_preview = 'Preview'; +$lang->guide_choose_font_body = 'Default font'; +$lang->guide_choose_font_size_body = 'Default font size'; +$lang->guide_choose_line_height = 'Line spacing'; +$lang->guide_choose_paragraph_spacing = 'Paragraph spacing'; +$lang->guide_choose_word_break = 'Line wrapping'; +$lang->word_break_normal = 'Wrap Asian scripts at character boundary and Latin scripts at word boundary (default)'; +$lang->word_break_keep_all = 'Wrap at word boundary'; +$lang->word_break_break_all = 'Wrap at character boundary'; +$lang->word_break_none = 'Do not wrap long lines'; $lang->font_preview = 'The quick brown fox jumps over the lazy dog. いろはにほへと / ちりぬるを / わかよたれそ / つねならむ / うゐのおくやま / けふこえて / あさきゆめみし / ゑひもせす 키스의 고유 조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다.'; diff --git a/modules/editor/lang/ko.php b/modules/editor/lang/ko.php index 847580e6b..6920d0740 100644 --- a/modules/editor/lang/ko.php +++ b/modules/editor/lang/ko.php @@ -9,8 +9,16 @@ $lang->guide_set_height_main_editor = '본문 에디터 높이'; $lang->guide_choose_comment_editor = '댓글 에디터'; $lang->guide_set_height_comment_editor = '댓글 에디터 높이'; $lang->guide_choose_text_formatting = '본문 서식'; +$lang->guide_choose_font_preview = '미리보기'; $lang->guide_choose_font_body = '본문 글꼴'; -$lang->guide_choose_font_size_body = '본문 글꼴크기'; +$lang->guide_choose_font_size_body = '글꼴 크기'; +$lang->guide_choose_line_height = '줄 간격'; +$lang->guide_choose_paragraph_spacing = '문단 간격'; +$lang->guide_choose_word_break = '줄바꿈 방식'; +$lang->word_break_normal = '한글은 글자 단위로 줄바꿈, 영문은 단어 단위로 줄바꿈 (기본값)'; +$lang->word_break_keep_all = '모든 언어를 단어 단위로 줄바꿈'; +$lang->word_break_break_all = '모든 언어를 글자 단위로 줄바꿈'; +$lang->word_break_none = '줄을 바꾸지 않음'; $lang->font_preview = 'The quick brown fox jumps over the lazy dog. いろはにほへと / ちりぬるを / わかよたれそ / つねならむ / うゐのおくやま / けふこえて / あさきゆめみし / ゑひもせす 키스의 고유 조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다.'; diff --git a/modules/editor/skins/ckeditor/editor.html b/modules/editor/skins/ckeditor/editor.html index ad3149792..1e04ea5d6 100755 --- a/modules/editor/skins/ckeditor/editor.html +++ b/modules/editor/skins/ckeditor/editor.html @@ -14,17 +14,14 @@ var auto_saved_msg = "{$lang->msg_auto_saved}"; {@ $css_content = null } - {@ $css_content = '.xe_content.editable p { margin: 0;'. chr(125); } - {@ $css_content .= ' .xe_content.editable { '} - - {@ $css_content .= 'font-family:' . $content_font . ';';} - - - - {@ $css_content .= 'font-size:' . $content_font_size . ';';} - + {@ $css_content .= 'font-family:' . $content_font . ';';} + {@ $css_content .= 'font-size:' . $content_font_size . ';';} + {@ $css_content .= 'line-height:' . $content_line_height . ';';} + {@ $css_content .= 'white-space: nowrap;';} + {@ $css_content .= 'word-break:' . ($content_word_break ?: 'normal') . '; word-wrap: break-word;';} {@ $css_content .= chr(125);} + {@ $css_content .= '.xe_content.editable p { margin: 0 0 ' . $content_paragraph_spacing . ' 0;' . chr(125);} @@ -52,7 +49,7 @@ var auto_saved_msg = "{$lang->msg_auto_saved}"; ckeconfig: { height: '{$editor_height}', skin: '{$colorset}', - contentsCss: '{$content_style_path}/editor.css', + contentsCss: '{$content_style_path}/editor.css?{date("YmdHis", @filemtime($content_style_path."/editor.css"))}', xe_editor_sequence: {$editor_sequence}, toolbarCanCollapse: true, language: "{str_replace('jp','ja',$lang_type)}" diff --git a/modules/editor/styles/ckeditor_light/editor.css b/modules/editor/styles/ckeditor_light/editor.css index 62fff8f8f..0c896c0f9 100644 --- a/modules/editor/styles/ckeditor_light/editor.css +++ b/modules/editor/styles/ckeditor_light/editor.css @@ -1,6 +1,6 @@ @charset "utf-8"; /* NAVER (developers@xpressengine.com) */ -.xe_content.editable {color:#000;font-size:13px;font-family:sans-serif;line-height:1.5;word-break:break-all;word-wrap:break-word} +.xe_content.editable { } .xe_content.editable img{border:0;max-width:100%;} .xe_content.editable blockquote.q1, .xe_content.editable blockquote.q2, @@ -17,4 +17,3 @@ .xe_content.editable blockquote.q6{border:1px dashed #707070} .xe_content.editable blockquote.q7{border:1px dashed #707070;background:#fbfbfb} .xe_content.editable table .xe_selected_cell{background-color:#d6e9ff} -.xe_content.editable p{margin:0} diff --git a/modules/editor/styles/ckeditor_light/skin.xml b/modules/editor/styles/ckeditor_light/skin.xml index 9d52c13f8..ab06ded8e 100644 --- a/modules/editor/styles/ckeditor_light/skin.xml +++ b/modules/editor/styles/ckeditor_light/skin.xml @@ -1,8 +1,9 @@ - XE CKEditor 기본 서식 - 1.8 - 2014-02-27 + Rhymix 기본 서식 + Rhymix Default + 1.9 + 2016-04-27 NAVER diff --git a/modules/editor/styles/ckeditor_light/style.css b/modules/editor/styles/ckeditor_light/style.css index af512236a..16c39fb0b 100755 --- a/modules/editor/styles/ckeditor_light/style.css +++ b/modules/editor/styles/ckeditor_light/style.css @@ -16,4 +16,3 @@ .xe_content blockquote.q6{border:1px dashed #707070} .xe_content blockquote.q7{border:1px dashed #707070;background:#fbfbfb} .xe_content p{margin:0} - diff --git a/modules/editor/styles/ckeditor_light/style.ini b/modules/editor/styles/ckeditor_light/style.ini index e8c7365cf..8b1378917 100644 --- a/modules/editor/styles/ckeditor_light/style.ini +++ b/modules/editor/styles/ckeditor_light/style.ini @@ -1 +1 @@ -style.css + diff --git a/modules/editor/styles/ckeditor_recommend/editor.css b/modules/editor/styles/ckeditor_recommend/editor.css deleted file mode 100644 index bb51a135a..000000000 --- a/modules/editor/styles/ckeditor_recommend/editor.css +++ /dev/null @@ -1,19 +0,0 @@ -@charset "utf-8"; -/* NAVER (developers@xpressengine.com) */ -.xe_content.editable {color:#000;font-size:14px;font-family:sans-serif;line-height:1.6;word-break:break-all;word-wrap:break-word} -.xe_content.editable img{border:0;max-width:100%;} -.xe_content.editable blockquote.q1, -.xe_content.editable blockquote.q2, -.xe_content.editable blockquote.q3, -.xe_content.editable blockquote.q4, -.xe_content.editable blockquote.q5, -.xe_content.editable blockquote.q6, -.xe_content.editable blockquote.q7{padding:10px;margin:0 15px} -.xe_content.editable blockquote.q1{padding:0 10px;border-left:2px solid #ccc} -.xe_content.editable blockquote.q2{padding:0 10px;background:url(./img/bg_qmark.gif) no-repeat left top} -.xe_content.editable blockquote.q3{border:1px solid #d9d9d9} -.xe_content.editable blockquote.q4{border:1px solid #d9d9d9;background:#fbfbfb} -.xe_content.editable blockquote.q5{border:2px solid #707070} -.xe_content.editable blockquote.q6{border:1px dashed #707070} -.xe_content.editable blockquote.q7{border:1px dashed #707070;background:#fbfbfb} -.xe_content.editable table .xe_selected_cell{background-color:#d6e9ff} diff --git a/modules/editor/styles/ckeditor_recommend/editor.html b/modules/editor/styles/ckeditor_recommend/editor.html deleted file mode 100755 index 976795b75..000000000 --- a/modules/editor/styles/ckeditor_recommend/editor.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -Rhymix - - - - diff --git a/modules/editor/styles/ckeditor_recommend/img/bg_qmark.gif b/modules/editor/styles/ckeditor_recommend/img/bg_qmark.gif deleted file mode 100644 index 5a8a44625..000000000 Binary files a/modules/editor/styles/ckeditor_recommend/img/bg_qmark.gif and /dev/null differ diff --git a/modules/editor/styles/ckeditor_recommend/skin.xml b/modules/editor/styles/ckeditor_recommend/skin.xml deleted file mode 100644 index f485bf0ae..000000000 --- a/modules/editor/styles/ckeditor_recommend/skin.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - XE CKEditor 권장 서식 - 1.8 - 2014-02-27 - - NAVER - - diff --git a/modules/editor/styles/ckeditor_recommend/style.css b/modules/editor/styles/ckeditor_recommend/style.css deleted file mode 100755 index 3aa6448fd..000000000 --- a/modules/editor/styles/ckeditor_recommend/style.css +++ /dev/null @@ -1,17 +0,0 @@ -@charset "utf-8"; -/* NAVER (developers@xpressengine.com) */ -.xe_content {color:#000;font-size:14px;font-family:sans-serif;line-height:1.6} -.xe_content blockquote.q1, -.xe_content blockquote.q2, -.xe_content blockquote.q3, -.xe_content blockquote.q4, -.xe_content blockquote.q5, -.xe_content blockquote.q6, -.xe_content blockquote.q7{padding:10px;margin:0 15px} -.xe_content blockquote.q1{padding:0 10px;border-left:2px solid #ccc} -.xe_content blockquote.q2{padding:0 10px;background:url(./img/bg_qmark.gif) no-repeat left top} -.xe_content blockquote.q3{border:1px solid #d9d9d9} -.xe_content blockquote.q4{border:1px solid #d9d9d9;background:#fbfbfb} -.xe_content blockquote.q5{border:2px solid #707070} -.xe_content blockquote.q6{border:1px dashed #707070} -.xe_content blockquote.q7{border:1px dashed #707070;background:#fbfbfb} diff --git a/modules/editor/styles/ckeditor_recommend/style.ini b/modules/editor/styles/ckeditor_recommend/style.ini deleted file mode 100644 index e8c7365cf..000000000 --- a/modules/editor/styles/ckeditor_recommend/style.ini +++ /dev/null @@ -1 +0,0 @@ -style.css diff --git a/modules/editor/tpl/admin_index.html b/modules/editor/tpl/admin_index.html index b99743896..1fc73cd62 100644 --- a/modules/editor/tpl/admin_index.html +++ b/modules/editor/tpl/admin_index.html @@ -87,32 +87,64 @@ +
+ +
+ +
+
- {@ - if($editor_config->content_font_size) $fontSize = str_replace('px','',$editor_config->content_font_size); - else $fontSize = str_replace('px','',$editor_config_default['content_font_size']); - } -
- -
- +
- px + px +
+
+
+ +
+ % +
+
+
+ +
+ px +
+
+
+ +
+ + + +
@@ -192,16 +224,21 @@ jQuery(function($){ var fontPreview = $('.fontPreview'); var fontSelector = $('.fontSelector'); var checkedFont = fontSelector.filter(':checked').css('fontFamily'); - var changedSize = $('#fontSize').val(); + var changedSize = $('#font_size').val(); //change event fontSelector.change(function(){ - var myFont = $(this).css('fontFamily'); - fontPreview.css('fontFamily',myFont); + var myFont = $(this).css('font-family'); + if ($(this).val() === 'Y') { + myFont = $("input[name='content_font_defined']").val(); + } + fontPreview.css('font-family', myFont); }); - $('#fontSize').keyup(function(){ - var mySize = $(this).val(); - fontPreview.css('fontSize',mySize+'px'); + $('#font_size').keyup(function(){ + fontPreview.css('font-size', $(this).val() + 'px'); + }).change(function(){$(this).keyup()}); + $('#line_height').keyup(function(){ + fontPreview.css('line-height', $(this).val() + '%'); }).change(function(){$(this).keyup()}); $('input[name=font_defined]').click(function(){