diff --git a/modules/editor/components/colorpicker_bg/colorpicker_bg.class.php b/modules/editor/components/colorpicker_bg/colorpicker_bg.class.php index cf581c76d..fd7396d6a 100644 --- a/modules/editor/components/colorpicker_bg/colorpicker_bg.class.php +++ b/modules/editor/components/colorpicker_bg/colorpicker_bg.class.php @@ -2,7 +2,7 @@ /** * @class colorpicker_bg * @author zero (zero@nzeo.com) - * @brief 에디터에서 url링크하는 기능 제공. 단순 팝업. + * @brief 글자 배경색을 지정하는 컴포넌트 **/ class colorpicker_bg extends EditorHandler { @@ -20,22 +20,7 @@ } /** - * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. - * execute의 경우 2가지 경우가 생긴다. - * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 - * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 - **/ - function execute() { - - $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=colorpicker_bg', $this->upload_target_srl); - - $this->add('tpl', ''); - $this->add('open_window', 'Y'); - $this->add('popup_url', $url); - } - - /** - * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 **/ function getPopupContent() { // 템플릿을 미리 컴파일해서 컴파일된 소스를 return diff --git a/modules/editor/components/colorpicker_text/colorpicker_text.class.php b/modules/editor/components/colorpicker_text/colorpicker_text.class.php index 1fb564219..bead2adcb 100644 --- a/modules/editor/components/colorpicker_text/colorpicker_text.class.php +++ b/modules/editor/components/colorpicker_text/colorpicker_text.class.php @@ -2,7 +2,7 @@ /** * @class colorpicker_text * @author zero (zero@nzeo.com) - * @brief 에디터에서 url링크하는 기능 제공. 단순 팝업. + * @brief 글자색 변경하는 컴포넌트 **/ class colorpicker_text extends EditorHandler { @@ -20,22 +20,7 @@ } /** - * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. - * execute의 경우 2가지 경우가 생긴다. - * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 - * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 - **/ - function execute() { - - $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=colorpicker_text', $this->upload_target_srl); - - $this->add('tpl', ''); - $this->add('open_window', 'Y'); - $this->add('popup_url', $url); - } - - /** - * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 **/ function getPopupContent() { // 템플릿을 미리 컴파일해서 컴파일된 소스를 return diff --git a/modules/editor/components/emoticon/emoticon.class.php b/modules/editor/components/emoticon/emoticon.class.php index 39adb02b2..6414ed992 100644 --- a/modules/editor/components/emoticon/emoticon.class.php +++ b/modules/editor/components/emoticon/emoticon.class.php @@ -2,7 +2,7 @@ /** * @class emoticon * @author zero (zero@nzeo.com) - * @brief 에디터에서 url링크하는 기능 제공. 단순 팝업. + * @brief 이모티콘 이미지 연결 컴포넌트 **/ class emoticon extends EditorHandler { @@ -20,22 +20,7 @@ } /** - * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. - * execute의 경우 2가지 경우가 생긴다. - * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 - * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 - **/ - function execute() { - - $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=emoticon', $this->upload_target_srl); - - $this->add('tpl', ''); - $this->add('open_window', 'Y'); - $this->add('popup_url', $url); - } - - /** - * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 **/ function getPopupContent() { // 템플릿을 미리 컴파일해서 컴파일된 소스를 return diff --git a/modules/editor/components/html_editor/html_editor.class.php b/modules/editor/components/html_editor/html_editor.class.php index 4f2c63221..5492a719f 100644 --- a/modules/editor/components/html_editor/html_editor.class.php +++ b/modules/editor/components/html_editor/html_editor.class.php @@ -2,7 +2,7 @@ /** * @class html_editor * @author zero (zero@nzeo.com) - * @brief 에디터에서 url링크하는 기능 제공. 단순 팝업. + * @brief 직접 html code를 수정할 수 있는 컴포넌트 **/ class html_editor extends EditorHandler { @@ -20,22 +20,7 @@ } /** - * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. - * execute의 경우 2가지 경우가 생긴다. - * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 - * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 - **/ - function execute() { - - $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=html_editor', $this->upload_target_srl); - - $this->add('tpl', ''); - $this->add('open_window', 'Y'); - $this->add('popup_url', $url); - } - - /** - * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 **/ function getPopupContent() { // 템플릿을 미리 컴파일해서 컴파일된 소스를 return diff --git a/modules/editor/components/image_link/image_link.class.php b/modules/editor/components/image_link/image_link.class.php index c9d7adfa6..b26a615d3 100644 --- a/modules/editor/components/image_link/image_link.class.php +++ b/modules/editor/components/image_link/image_link.class.php @@ -2,7 +2,7 @@ /** * @class image_link * @author zero (zero@nzeo.com) - * @brief 에디터에서 url링크하는 기능 제공. 단순 팝업. + * @brief 이미지를 추가하거나 속성을 수정하는 컴포넌트 **/ class image_link extends EditorHandler { @@ -20,22 +20,7 @@ } /** - * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. - * execute의 경우 2가지 경우가 생긴다. - * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 - * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 - **/ - function execute() { - - $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=image_link', $this->upload_target_srl); - - $this->add('tpl', ''); - $this->add('open_window', 'Y'); - $this->add('popup_url', $url); - } - - /** - * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 **/ function getPopupContent() { // 템플릿을 미리 컴파일해서 컴파일된 소스를 return diff --git a/modules/editor/components/image_link/tpl/popup.html b/modules/editor/components/image_link/tpl/popup.html index f8a2df4ff..07e9c9b3a 100644 --- a/modules/editor/components/image_link/tpl/popup.html +++ b/modules/editor/components/image_link/tpl/popup.html @@ -8,7 +8,7 @@
{$lang->imagelink}
{$lang->image_url}
-
+
{$lang->image_scale}
diff --git a/modules/editor/components/image_link/tpl/popup.js b/modules/editor/components/image_link/tpl/popup.js index a5ee6b33a..7cfb2694f 100644 --- a/modules/editor/components/image_link/tpl/popup.js +++ b/modules/editor/components/image_link/tpl/popup.js @@ -7,7 +7,10 @@ function getImage() { if(typeof(opener)=="undefined") return; var node = opener.editorPrevNode; - if(!node || node.nodeName != "IMG") return; + if(!node || node.nodeName != "IMG") { + getImageScale(); + return; + } var src = node.getAttribute("src"); var border = node.getAttribute("border"); var align = node.getAttribute("align"); diff --git a/modules/editor/components/multimedia_link/multimedia_link.class.php b/modules/editor/components/multimedia_link/multimedia_link.class.php index 330fb820f..3f0ebfadb 100644 --- a/modules/editor/components/multimedia_link/multimedia_link.class.php +++ b/modules/editor/components/multimedia_link/multimedia_link.class.php @@ -2,7 +2,7 @@ /** * @class multimedia_link * @author zero (zero@nzeo.com) - * @brief 에디터에서 url링크하는 기능 제공. 단순 팝업. + * @brief 본문에 멀티미디어 자료를 연결하는 컴포넌트 **/ class multimedia_link extends EditorHandler { @@ -20,22 +20,7 @@ } /** - * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. - * execute의 경우 2가지 경우가 생긴다. - * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 - * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 - **/ - function execute() { - - $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=multimedia_link', $this->upload_target_srl); - - $this->add('tpl', ''); - $this->add('open_window', 'Y'); - $this->add('popup_url', $url); - } - - /** - * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 **/ function getPopupContent() { // 템플릿을 미리 컴파일해서 컴파일된 소스를 return diff --git a/modules/editor/components/multimedia_link/tpl/popup.html b/modules/editor/components/multimedia_link/tpl/popup.html index 2f360b5df..180d1dcc4 100644 --- a/modules/editor/components/multimedia_link/tpl/popup.html +++ b/modules/editor/components/multimedia_link/tpl/popup.html @@ -7,7 +7,7 @@
{$lang->multimedia}
{$lang->multimedia_url}
-
+
{$lang->multimedia_caption}
diff --git a/modules/editor/components/quotation/quotation.class.php b/modules/editor/components/quotation/quotation.class.php index 370037a04..5767eabb2 100644 --- a/modules/editor/components/quotation/quotation.class.php +++ b/modules/editor/components/quotation/quotation.class.php @@ -2,7 +2,7 @@ /** * @class quotation * @author zero (zero@nzeo.com) - * @brief 에디터에서 인용문 기능 제공. 단순 팝업. + * @brief 에디터에서 인용문 기능 제공. **/ class quotation extends EditorHandler { @@ -20,22 +20,7 @@ } /** - * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. - * execute의 경우 2가지 경우가 생긴다. - * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 - * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 - **/ - function execute() { - - $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=quotation', $this->upload_target_srl); - - $this->add('tpl', ''); - $this->add('open_window', 'Y'); - $this->add('popup_url', $url); - } - - /** - * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 **/ function getPopupContent() { // 템플릿을 미리 컴파일해서 컴파일된 소스를 return diff --git a/modules/editor/components/url_link/tpl/popup.html b/modules/editor/components/url_link/tpl/popup.html index 02827e7c7..3e326c070 100644 --- a/modules/editor/components/url_link/tpl/popup.html +++ b/modules/editor/components/url_link/tpl/popup.html @@ -9,7 +9,7 @@
{$lang->urllink_url}
-
+
{$lang->urllink_open_window}
diff --git a/modules/editor/components/url_link/url_link.class.php b/modules/editor/components/url_link/url_link.class.php index a33fd924b..a41856e3f 100644 --- a/modules/editor/components/url_link/url_link.class.php +++ b/modules/editor/components/url_link/url_link.class.php @@ -2,7 +2,7 @@ /** * @class url_link * @author zero (zero@nzeo.com) - * @brief 에디터에서 url링크하는 기능 제공. 단순 팝업. + * @brief 에디터에서 url링크하는 기능 제공. **/ class url_link extends EditorHandler { @@ -20,22 +20,7 @@ } /** - * @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다. - * execute의 경우 2가지 경우가 생긴다. - * 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데 - * popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다 - **/ - function execute() { - - $url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=url_link', $this->upload_target_srl); - - $this->add('tpl', ''); - $this->add('open_window', 'Y'); - $this->add('popup_url', $url); - } - - /** - * @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다 + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 **/ function getPopupContent() { // 템플릿을 미리 컴파일해서 컴파일된 소스를 return diff --git a/modules/editor/conf/module.xml b/modules/editor/conf/module.xml index 3c9b73c73..a8d3669bc 100644 --- a/modules/editor/conf/module.xml +++ b/modules/editor/conf/module.xml @@ -2,7 +2,6 @@ - diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index f5f061d26..f3f9fcf68 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -40,35 +40,14 @@ return $oTemplate->compile($tpl_path, $tpl_file); } - /** - * @brief 컴포넌트 실행하여 결과 return - **/ - function dispComponent() { - // 변수 정리 - $component = Context::get('component'); - $upload_target_srl = Context::get('upload_target_srl'); - - // component 객체를 받음 - $oComponent = &$this->getComponentObject($component, $upload_target_srl); - if(!$oComponent->toBool()) return $oComponent; - - // 컴포넌트 실행 - $oComponent->execute(); - - $this->add('component', $component); - $this->add('upload_target_srl', $upload_target_srl); - $this->add('tpl', $oComponent->get('tpl')); - $this->add('open_window', $oComponent->get('open_window')); - $this->add('popup_url', $oComponent->get('popup_url')); - } - /** * @brief 컴포넌트의 팝업 출력을 요청을 받는 action **/ function dispPopup() { // 변수 정리 - $component = Context::get('component'); $upload_target_srl = Context::get('upload_target_srl'); + $component = Context::get('component'); + $manual_url = Context::get('manual_url'); // component 객체를 받음 $oComponent = &$this->getComponentObject($component, $upload_target_srl); diff --git a/modules/editor/tpl/css/editor.css b/modules/editor/tpl/css/editor.css index e4eb3c444..2b7525a74 100644 --- a/modules/editor/tpl/css/editor.css +++ b/modules/editor/tpl/css/editor.css @@ -68,125 +68,58 @@ div.editor_drag_down_area { margin-top:10px; } -.editor_pop_body { - padding:4px 4px 4px 4px; - margin:0px; - border:0px; - background-color:#FFFFFF; -} - -.editor_window { - background-color : #EFEFEF; -} - -textarea.editor_small_textarea { - font-family:tahoma; - border : 1px solid #CCCCCC; - background-color : #FFFFFF; - font-size : 8pt; - width:99%; - height:100px; -} - -textarea.editor_textarea { - font-family:tahoma; - border : 1px solid #CCCCCC; - background-color : #FFFFFF; - font-size : 8pt; - width:100%; - height:450px; -} - -input.editor_submit { - border : 1px solid #555555; - background-color : #AAAAAA; - color : #000000; - font-weight:bold; - font-family:verdana; - width : 100%; - height : 20px; - font-size : 8pt; -} - -div.quotation_box { - font-size:8pt; - font-family:tahoma; - margin-bottom:8px; - padding-bottom:5px; - border-bottom:1px dotted #AAAAAA; -} - -#quotation th { width:80px; font-size:8pt; font-family:tahoma; } - -img.color_icon { - width:15px; - height:15px; - border:1px solid #FFFFFF; -} - -img.color_icon_over { - width:15px; - height:15px; - border:1px solid #000000; - cursor:pointer; -} - -td.editor_field { - font-family:tahoma; - font-size:8pt; - font-weight:bold; - background-color : #CCCCCC; - text-align : center; -} - -input.editor_input { - font-family:tahoma; - border : 1px solid #CCCCCC; - background-color : #FFFFFF; - width : 330px; - height : 18px; - padding : 1px; - font-size : 8pt; -} - .editor_uploader_box { - margin:10px 0px 0px 0px; - border:0px; + margin:10px 0px 0px 5px; + border:0; padding:0px; clear:both; + height:130px; +} + +.editor_preview_uploaded { + float:left; + width:110px; + height:110px; + padding:5px; + border:1px solid #AAAAAA; + margin-right:10px; + text-align:center; } .editor_uploader { - margin-right:10px; - padding-right:5px; - border-right:1px dotted #AAAAAA; - width:255px; float:left; + width:300px; + height:120px; + margin-right:10px; + padding-right:10px; + border-right:1px dotted #AAAAAA; } .uploaded_file_list { - width:250px; - height:120px; + width:100%; + height:122px; + border:1px solid #AAAAAA; } -.editor_component { +.editor_uploader_input_area { + width:150px; float:left; + clear:right; } -.uploaded_file_preview_box { - border:1px solid #EEEEEE; - width:120px; - height:120px; - float:left; - margin-right:10px; +.editor_uploader_file_input { + display:none; + height:18px; + border:1px solid #AAAAAA; + background-color:#FFFFFF; + position:relative; } -.editor_align_icon { - margin:0px 0px 6px 5px; - font-size:9pt; -} - -.editor_align_icon img { - vertical-align:middle; - cursor:pointer; +.editor_uploader_input { + display:block; + width:90px; + height:18px; + border:1px solid #AAAAAA; + background-color:#FFFFFF; + margin-bottom:10px; } diff --git a/modules/editor/tpl/editor.html b/modules/editor/tpl/editor.html index 14985f60d..6f8097a47 100644 --- a/modules/editor/tpl/editor.html +++ b/modules/editor/tpl/editor.html @@ -83,40 +83,23 @@ editor_upload_init("{$upload_target_srl}"); - - -
+ + + + +
preview
+
-
-
- - +
- - -
-
-
-
- {$lang->edit->icon_align_article} - {$lang->edit->icon_align_article} -
-
- {$lang->edit->icon_align_left} - {$lang->edit->icon_align_left} -
-
- {$lang->edit->icon_align_middle} - {$lang->edit->icon_align_middle} -
-
- {$lang->edit->icon_align_right} - {$lang->edit->icon_align_right} -
-
+
+ + + +
diff --git a/modules/editor/tpl/js/editor.js b/modules/editor/tpl/js/editor.js index 6f6910306..1a5489265 100755 --- a/modules/editor/tpl/js/editor.js +++ b/modules/editor/tpl/js/editor.js @@ -262,38 +262,20 @@ function editorEventCheck(evt) { // 추가 컴포넌트의 경우 서버에 요청을 시도 default : - editorPrevSrl = upload_target_srl; - - var params = new Array(); - params['component'] = component_name; - params['upload_target_srl'] = upload_target_srl; - - var response_tags = new Array('error', 'message', 'component', 'upload_target_srl', 'tpl', 'open_window', 'popup_url'); - exec_xml('editor', 'dispComponent', params, editorProcComponent, response_tags, editor_form_list[upload_target_srl]); + openComponent(component_name, upload_target_srl); break; } return; } -// 컴포넌트 요청 후 결과를 처리할 함수 -function editorProcComponent(ret_obj, response_tags) { - var upload_target_srl = ret_obj['upload_target_srl']; - var tpl = ret_obj['tpl']; - var open_window = ret_obj['open_window']; - var popup_url = ret_obj['popup_url']; +// 컴포넌트 팝업 열기 +function openComponent(component_name, upload_target_srl, manual_url) { + editorPrevSrl = upload_target_srl; + var popup_url = "./?module=editor&act=dispPopup&upload_target_srl="+upload_target_srl+"&component="+component_name; + if(typeof(manual_url)!="undefined" && manual_url) popup_url += "&manual_url="+escape(manual_url); - // 컴포넌트의 동작이 새창 열기 일 경우 - if(open_window == 'Y') { - var win_left = 10; - var win_top = 10; - winopen(popup_url, 'editorComponent', 'left='+win_left+',top='+win_top+',width=10,height=10,toolbars=no,scrollbars=no'); - - // 새창 열기가 아니면 정해진 영역에 innerHTML로 tpl 입력 - } else { - var zone = xGetElementById("editor_component_area_"+upload_target_srl); - xInnerHtml(zone, tpl); - } + winopen(popup_url, 'editorComponent', 'left=10,top=10,width=10,height=10,toolbars=no,scrollbars=no'); } // 본문내에 포함된 컴포넌트를 찾는 함수 (더블클릭시) @@ -348,14 +330,7 @@ function editorSearchComponent(evt) { var upload_target_srl = tobj.getAttribute("upload_target_srl"); // 해당 컴포넌트를 찾아서 실행 - editorPrevSrl = upload_target_srl; - - var params = new Array(); - params['component'] = editor_component; - params['upload_target_srl'] = upload_target_srl; - - var response_tags = new Array('error', 'message', 'component', 'upload_target_srl', 'tpl', 'open_window', 'popup_url'); - exec_xml('editor', 'dispComponent', params, editorProcComponent, response_tags, editor_form_list[upload_target_srl]); + openComponent(editor_component, upload_target_srl); } // focus diff --git a/modules/editor/tpl/js/uploader.js b/modules/editor/tpl/js/uploader.js index e18160e7e..126d1e543 100755 --- a/modules/editor/tpl/js/uploader.js +++ b/modules/editor/tpl/js/uploader.js @@ -13,6 +13,20 @@ function editor_upload_init(upload_target_srl) { // upload_target_srl에 해당하는 form의 action을 iframe으로 변경 function editor_upload_form_set(upload_target_srl) { + // input type=file의 위치 및 설정 변경 + var uploader = xGetElementById("file_uploader_"+upload_target_srl); + + if(xIE4Up) { + xLeft(uploader, -40); + xTop(uploader, -85); + uploader.style.filter = "alpha(opacity=0)"; + } else { + xLeft(uploader, -15); + xTop(uploader, -85); + uploader.style.opacity = 0; + } + uploader.style.display = "block"; + // 업로드용 iframe을 생성 if(!xGetElementById('tmp_upload_iframe')) { if(xIE4Up) { @@ -104,7 +118,7 @@ function editor_preview(sel_obj, upload_target_srl) { var obj = uploaded_files[file_srl]; if(typeof(obj)=='undefined'||!obj) return; var uploaded_filename = obj.uploaded_filename; - var preview_obj = xGetElementById('uploaded_file_preview_box_'+upload_target_srl); + var preview_obj = xGetElementById('preview_uploaded_'+upload_target_srl); if(!uploaded_filename) { xInnerHtml(preview_obj, ''); @@ -115,16 +129,16 @@ function editor_preview(sel_obj, upload_target_srl) { // 플래쉬 동영상의 경우 if(/\.flv$/i.test(uploaded_filename)) { - html = ""; + html = ""; // 플래쉬 파일의 경우 } else if(/\.swf$/i.test(uploaded_filename)) { - html = ""; + html = ""; // wmv, avi, mpg, mpeg등의 동영상 파일의 경우 } else if(/\.(wmv|avi|mpg|mpeg|asx|asf|mp3)$/i.test(uploaded_filename)) { - html = ""; + html = ""; // 이미지 파일의 경우 } else if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) { - html = ""; + html = ""; } xInnerHtml(preview_obj, html); } @@ -151,7 +165,7 @@ function editor_remove_file(upload_target_srl) { } // 업로드 목록의 선택된 파일을 내용에 추가 -function editor_insert_file(upload_target_srl, align) { +function editor_insert_file(upload_target_srl) { var obj = xGetElementById('uploaded_file_list_'+upload_target_srl); if(obj.options.length<1) return; var file_srl = obj.options[obj.selectedIndex].value; @@ -160,58 +174,28 @@ function editor_insert_file(upload_target_srl, align) { var filename = file_obj.filename; var sid = file_obj.sid; var uploaded_filename = file_obj.uploaded_filename; - editorPrevSrl = upload_target_srl; // 바로 링크 가능한 파일의 경우 (이미지, 플래쉬, 동영상 등..) - if(uploaded_filename && typeof(align)!='undefined') { + if(uploaded_filename) { - var type = ""; - - // 이미지 파일의 경우 + // 이미지 파일의 경우 image_link 컴포넌트 열결 if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) { + openComponent("image_link", upload_target_srl, uploaded_filename); - editorFocus(editorPrevSrl); - - var html = "\""+filename+"\""; - - var iframe_obj = editorGetIFrame(editorPrevSrl); - editorReplaceHTML(iframe_obj, html); + openComponent("multimedia_link", upload_target_srl, uploaded_filename); } - // binary파일의 경우 다운로드 링크를 추가 + // binary파일의 경우 url_link 컴포넌트 연결 } else { var fo_obj = obj; while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; } var mid = fo_obj.mid.value; var upload_target_srl = fo_obj.upload_target_srl.value; - var url = "./?mid="+mid+"&act=procDownload&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl+"&sid="+sid; - - var x = (screen.availWidth - 400)/2; - var y = (screen.availHeight - 220)/2; - winopen(editor_path+"popup/add_url.php?title="+escape(filename)+"&url="+escape(url),"_editorPopup","top="+y+",left="+x+",width=400,height=220,resizable=no,toolbars=no,scrollbars=no"); + var url = "./?mid="+mid+"&act=procDownloadFile&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl+"&sid="+sid; + openComponent("url_link", upload_target_srl, url); } - } /** diff --git a/modules/editor/tpl/lang/ko.lang.php b/modules/editor/tpl/lang/ko.lang.php index edb20aa90..311b5195a 100644 --- a/modules/editor/tpl/lang/ko.lang.php +++ b/modules/editor/tpl/lang/ko.lang.php @@ -44,8 +44,9 @@ BR태그가 적용됩니다."; $lang->edit->upload = '첨부'; - $lang->edit->link_selected = '다운로드 링크 추가'; - $lang->edit->delete_selected = '선택파일 삭제'; + $lang->edit->upload_file = '파일 첨부'; + $lang->edit->link_file = '본문 삽입'; + $lang->edit->delete_selected = '선택 삭제'; $lang->edit->icon_align_article = '한 문단을 차지'; $lang->edit->icon_align_left = '글의 왼쪽으로';