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 @@
{$lang->cmd_agreement_content}
- -
{$config->agreements[$i]->content}
+ +
{$config->agreements[$i]->content}
diff --git a/modules/member/tpl/css/config.less b/modules/member/tpl/css/config.less deleted file mode 100644 index d05f6b613..000000000 --- a/modules/member/tpl/css/config.less +++ /dev/null @@ -1,26 +0,0 @@ -.editor_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; -} - -.editor_preview p { - margin-bottom: @default_paragraph_spacing !important; -} - -.editor_iframe { - width: 100%; - height: 440px; - box-sizing: border-box; - margin: 0 0 -4px 0; - padding: 0; - border: 0; -} diff --git a/modules/member/tpl/header.html b/modules/member/tpl/header.html index 5ea8a6d69..ec5a73030 100644 --- a/modules/member/tpl/header.html +++ b/modules/member/tpl/header.html @@ -1,5 +1,3 @@ - -

{$lang->cmd_member_config} {$lang->help}

diff --git a/modules/member/tpl/js/config.js b/modules/member/tpl/js/config.js index 4d4b1ef3a..e69de29bb 100644 --- a/modules/member/tpl/js/config.js +++ b/modules/member/tpl/js/config.js @@ -1,29 +0,0 @@ - -(function($) { - - // Editor replacement callback function - var editor_replace = function(input) { - var iframe = $(''); - iframe.attr("src", current_url.setQuery("module", "editor").setQuery("act", "dispEditorFrame").setQuery("parent_input_id", input.attr("id"))); - iframe.insertAfter(input); - input.siblings(".editor_preview").hide(); - if (input.attr("type") !== "hidden") { - input.hide(); - } - }; - - // Editor replacement - $(function() { - $(".editor_preview").on("click", function() { - var input = $(this).siblings(".editor_content"); - if (input.size()) { - $(this).off("click").off("focus"); - editor_replace(input.first()); - } - }); - $(".editor_preview").on("focus", function() { - $(this).triggerHandler("click"); - }); - }); - -})(jQuery);