diff --git a/common/css/rhymix.less b/common/css/rhymix.less index 7c8dbff14..4548b8bbd 100644 --- a/common/css/rhymix.less +++ b/common/css/rhymix.less @@ -107,6 +107,32 @@ a img { } } +/* Editable Preview */ +.editable_preview { + width: 100%; + min-height: 240px; + max-height: 440px; + box-sizing: border-box; + margin: 0; + padding: 6px; + border: 1px solid #ccc; + border-radius: 4px; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + overflow-y: auto; + cursor: text; + p { + margin-bottom: @default_paragraph_spacing !important; + } +} +.editable_preview_iframe { + width: 100%; + height: 440px; + box-sizing: border-box; + margin: 0 0 -4px 0; + padding: 0; + border: 0; +} + /* Message */ .message { position: relative; diff --git a/common/js/common.js b/common/js/common.js index b1ed8e432..62543c9c4 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -281,6 +281,25 @@ jQuery(function($) { } }); + /* Editor preview replacement */ + $(".editable_preview").addClass("xe_content").attr("tabindex", 0); + $(".editable_preview").on("click", function() { + var input = $(this).siblings(".editable_preview_content"); + if (input.size()) { + $(this).off("click").off("focus").remove(); + input = input.first(); + if (input.attr("type") !== "hidden") { + input.hide(); + } + var iframe = $(''); + iframe.attr("src", current_url.setQuery("module", "editor").setQuery("act", "dispEditorFrame").setQuery("parent_input_id", input.attr("id")).replace(/^https?:/, '')); + iframe.insertAfter(input); + } + }); + $(".editable_preview").on("focus", function() { + $(this).triggerHandler("click"); + }); + /* select - option의 disabled=disabled 속성을 IE에서도 체크하기 위한 함수 */ if(navigator.userAgent.match(/MSIE/)) { $('select').each(function(i, sels) { diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index 660ab3828..4cdd7b79a 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -22,6 +22,7 @@ class editorView extends editor { // Check parent input ID $parent_input_id = Context::get('parent_input_id'); + Context::set('parent_input_id', preg_replace('/[^a-z0-9_]/i', '', $parent_input_id)); Context::addBodyClass('disable_debug_panel'); // Load editor diff --git a/modules/editor/tpl/editor_frame.html b/modules/editor/tpl/editor_frame.html index 74805996f..3c96e7ca2 100644 --- a/modules/editor/tpl/editor_frame.html +++ b/modules/editor/tpl/editor_frame.html @@ -1,22 +1,8 @@ diff --git a/modules/editor/tpl/js/editor.app.js b/modules/editor/tpl/js/editor.app.js index 8e4fcaf87..619753685 100644 --- a/modules/editor/tpl/js/editor.app.js +++ b/modules/editor/tpl/js/editor.app.js @@ -145,6 +145,19 @@ function getAutoSavedSrl(ret_obj, response_tags, c) { instance.on('instanceReady', function(e) { $containerEl.css("min-height", 0); + if(window.editor_resize_iframe && window.editor_copy_input) + { + e.editor.setData(editor_copy_input.val()); + e.editor.on("resize", function(e){ + var height = e.data.outerHeight; + editor_resize_iframe.height(height); + }); + e.editor.on("change", function() { + var content = e.editor.getData(); + editor_copy_input.val(content); + }); + editor_resize_iframe.height($(".cke_chrome").parent().height()); + } }); instance.on('paste', function(e) { diff --git a/modules/member/tpl/agreements_config.html b/modules/member/tpl/agreements_config.html index 3864658a0..adf34abe4 100644 --- a/modules/member/tpl/agreements_config.html +++ b/modules/member/tpl/agreements_config.html @@ -18,8 +18,8 @@