-
+
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;