diff --git a/modules/editor/components/urllink/lang/ko.lang.php b/modules/editor/components/urllink/lang/ko.lang.php index 8ae878a41..b166124f6 100644 --- a/modules/editor/components/urllink/lang/ko.lang.php +++ b/modules/editor/components/urllink/lang/ko.lang.php @@ -5,4 +5,6 @@ * @brief 위지윅에디터(editor) 모듈 > urllink 컴포넌트의 언어팩 **/ + $lang->urllink_title = "제목"; + $lang->urllink_url = "URL"; ?> diff --git a/modules/editor/components/urllink/tpl/urllink.css b/modules/editor/components/urllink/tpl/urllink.css new file mode 100644 index 000000000..7ea384f70 --- /dev/null +++ b/modules/editor/components/urllink/tpl/urllink.css @@ -0,0 +1,15 @@ +.urllink_title { + width:400px; +} + +.urllink_title textarea { + width:300px; +} + +.urllink_url { + width:400px; +} + +.urllink_url input { + width:300px; +} diff --git a/modules/editor/components/urllink/tpl/urllink.html b/modules/editor/components/urllink/tpl/urllink.html index 84a06479e..891f11745 100644 --- a/modules/editor/components/urllink/tpl/urllink.html +++ b/modules/editor/components/urllink/tpl/urllink.html @@ -1,41 +1,14 @@ + - -
- -
- - - - - - - - - - - - - - - - - - - - - - -
text
url"/>
bold
type - -
- -
+ + + +
+
diff --git a/modules/editor/components/urllink/tpl/urllink.js b/modules/editor/components/urllink/tpl/urllink.js index 0efee59b8..8ab1872b6 100644 --- a/modules/editor/components/urllink/tpl/urllink.js +++ b/modules/editor/components/urllink/tpl/urllink.js @@ -1,22 +1,35 @@ -function setText() { +/** + * popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여 + * 있으면 가져와서 원하는 곳에 삽입 + **/ +function getText() { if(typeof(opener)=="undefined") return; var text = opener.editorGetSelectedHtml(opener.editorPrevSrl); - var fo_obj = xGetElementById("fo"); + var fo_obj = xGetElementById("fo_component"); if(fo_obj.text.value) return; fo_obj.text.value = text; self.focus(); } -function insertUrl() { -if(typeof(opener)=="undefined") return; - var fo_obj = xGetElementById("fo"); +/** + * 부모창의 위지윅에디터에 데이터를 삽입 + **/ +function setText() { + if(typeof(opener)=="undefined") return; + + var fo_obj = xGetElementById("fo_component"); + var text = fo_obj.text.value; var url = fo_obj.url.value; - var link_type = fo_obj.link_type.options[fo_obj.link_type.selectedIndex].value; - if(fo_obj.bold.checked) link_type = "bold "+link_type; - if(text && url) opener.editorInsertUrl(text, url, link_type); + + var link = text; + if(url) link = ""+text+""; + + var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl) + opener.editorReplaceHTML(iframe_obj, link); opener.focus(); self.close(); } -xAddEventListener(window, "load", setText); + +xAddEventListener(window, "load", getText); diff --git a/modules/editor/tpl/js/editor.js b/modules/editor/tpl/js/editor.js index 32c8c772d..95811fc94 100755 --- a/modules/editor/tpl/js/editor.js +++ b/modules/editor/tpl/js/editor.js @@ -152,6 +152,7 @@ function editorReplaceHTML(iframe_obj, html) { range.deleteContents(); range.insertNode(range.createContextualFragment(html)); } + iframe_obj.contentWindow.focus(); } // 입력 키에 대한 이벤트 체크 @@ -347,19 +348,6 @@ function editorDoInsertUrl(link, upload_target_srl) { editorReplaceHTML(iframe_obj, link); } -function editorInsertUrl(text, url, link_type) { - if(!text || !url) return; - //if(!/^(http|ftp)/i.test(url)) url = 'http://'+url; - - var link = ''; - if(!link_type) link = ""+text+""; - else link = ""+text+""; - - editorFocus(editorPrevSrl); - var obj = editorGetIFrame(editorPrevSrl) - editorReplaceHTML(obj, link); -} - function editorInsertImage(url, src_align) { if(!url) return; //if(!/^(http|ftp)/i.test(url)) url = 'http://'+url;