#119 파이어폭스에서 에디터에 포커스가 이동되어도 커서가 나타나지 않던 문제 해결.

#117 위지윅 에디터의 스킨화를 위한 분리 및 검사 완료. 단 모듈에서 에디터 스킨을 선택하는 부분에 대한 기획 필요.
에디터 tpl내의 언어파일을 에디터 모듈의 공통 언어로 합쳐서 수정.
에디터 iframe을 window.onload후 객체 생성을 하지 않고 바로 html태그로 출력하여 브라우저의 버벅거림을 살짝 줄임.



git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2406 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-08-24 06:08:23 +00:00
parent 67039ea3a1
commit 5574ab94b7
40 changed files with 548 additions and 278 deletions

View file

@ -19,22 +19,11 @@ function editorGetIFrame(upload_target_srl) {
return xGetElementById(obj_id);
}
// editor 초기화를 onload이벤트 후에 시작시킴
function editorInit(upload_target_srl, resizable, height) {
xAddEventListener(window, 'load', function() { editorStart(upload_target_srl, resizable, height); });
}
// editor 시작 (upload_target_srl로 iframe객체를 얻어서 쓰기 모드로 전환)
function editorStart(upload_target_srl, resizable, height) {
if(typeof(height)=="undefined"||!height) height = 350;
function editorStart(upload_target_srl, resizable, editor_height) {
if(typeof(resizable)=="undefined"||!resizable) resizable = false;
else resizable = true;
// iframe_area를 찾음
var iframe_area = xGetElementById("editor_iframe_area_"+upload_target_srl);
//xHeight(iframe_area, height+10);
xInnerHtml(iframe_area, '<iframe id="editor_iframe_'+upload_target_srl+'" frameBorder="0" style="background-color:transparent;width:100%;height:'+height+'px;"></iframe>');
// iframe obj를 찾음
var iframe_obj = editorGetIFrame(upload_target_srl);
if(!iframe_obj) return;
@ -42,6 +31,7 @@ function editorStart(upload_target_srl, resizable, height) {
// 현 에디터를 감싸고 있는 form문을 찾아서 content object를 찾아서 내용 sync
var fo_obj = iframe_obj.parentNode;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
// saved document에 대한 체크
if(typeof(fo_obj._saved_doc_title)!="undefined" ) {
var saved_title = fo_obj._saved_doc_title.value;
@ -61,21 +51,19 @@ function editorStart(upload_target_srl, resizable, height) {
// 대상 form의 content object에서 데이터를 구함
var content = fo_obj.content.value;
if(!content && !xIE4Up) content = "<br />";
// iframe내의 document object
var contentDocument = iframe_obj.contentWindow.document;
// editing가능하도록 설정 시작
// 기본 내용 작성
var contentHtml = ''+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+
'<html lang="ko" xmlns="http://www.w3.org/1999/xhtml><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/>'+
'<link rel="stylesheet" href="'+request_uri+'/common/css/default.css" type="text/css" />'+
'<link rel="stylesheet" href="'+request_uri+editor_path+'/css/editor.css" type="text/css" />'+
'<style>'+
'html {position:static}'+
'body {margin:0px}'+
'<style style="text/css">'+
'body {margin:0px; height:'+editor_height+'px;}'+
'</style>'+
'</head><body upload_target_srl="'+upload_target_srl+'">'+
content+
@ -84,6 +72,7 @@ function editorStart(upload_target_srl, resizable, height) {
contentDocument.designMode = 'on';
try {
contentDocument.execCommand("undo", false, null);
contentDocument.execCommand("useCSS", false, true);
} catch (e) {
}
contentDocument.open("text/html","replace");
@ -114,7 +103,6 @@ function editorStart(upload_target_srl, resizable, height) {
// 크기 변경 불가일 경우 드래그바 숨김
if(resizable == false) xGetElementById("editor_drag_bar_"+upload_target_srl).style.display = "none";
if(typeof(fixAdminLayoutFooter)=='function') fixAdminLayoutFooter(height);
}
// 여러개의 편집기를 예상하여 전역 배열 변수에 form, iframe의 정보를 넣음
@ -702,8 +690,8 @@ function eOptionClick(obj) {
}
// Editor Info Close
function closeEditorInfo() {
xGetElementById('editorInfo').style.display='none';
function closeEditorInfo(upload_target_srl) {
xGetElementById('editorInfo_'+upload_target_srl).style.display='none';
var expire = new Date();
expire.setTime(expire.getTime()+ (7000 * 24 * 3600000));
xSetCookie('EditorInfo', '1', expire);

View file

@ -93,7 +93,7 @@ function editor_display_uploaded_file(upload_target_srl) {
_prev_upload_target_srl = 0;
} else return;
}
var url = "./?act=procFileDelete&upload_target_srl="+upload_target_srl+"&mid="+current_url.getQuery('mid');
var url = request_uri + "?act=procFileDelete&upload_target_srl="+upload_target_srl+"&mid="+current_url.getQuery('mid');
// iframe에 url을 보내버림
var iframe_obj = xGetElementById('tmp_upload_iframe');
@ -160,7 +160,7 @@ function editor_upload_clear_list(upload_target_srl) {
while(obj.options.length) {
obj.remove(0);
}
var preview_obj = xGetElementById('uploaded_file_preview_box_'+upload_target_srl);
var preview_obj = xGetElementById('preview_uploaded_'+upload_target_srl);
xInnerHtml(preview_obj,'')
}
@ -230,7 +230,7 @@ function editor_remove_file(upload_target_srl) {
var fo_obj = obj;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
var mid = fo_obj.mid.value;
var url = "./?act=procFileDelete&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl+"&mid="+current_url.getQuery('mid');
var url = request_uri+"/?act=procFileDelete&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl+"&mid="+current_url.getQuery('mid');
// iframe에 url을 보내버림
var iframe_obj = xGetElementById('tmp_upload_iframe');
@ -238,7 +238,7 @@ function editor_remove_file(upload_target_srl) {
iframe_obj.contentWindow.document.location.href=url;
var preview_obj = xGetElementById('uploaded_file_preview_box_'+upload_target_srl);
var preview_obj = xGetElementById('preview_uploaded_'+upload_target_srl);
xInnerHtml(preview_obj, "");
}
@ -269,7 +269,7 @@ function editor_insert_file(upload_target_srl) {
var fo_obj = obj;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
var mid = fo_obj.mid.value;
var url = "./?module=file&amp;act=procFileDownload&amp;file_srl="+file_srl+"&amp;sid="+sid;
var url = request_uri+"/?module=file&amp;act=procFileDownload&amp;file_srl="+file_srl+"&amp;sid="+sid;
openComponent("url_link", upload_target_srl, url);
}
}