mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
xquared 확장콤포넌트 사용가능하도록 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3062 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
61c1c53634
commit
cc46a20754
7 changed files with 260 additions and 226 deletions
|
|
@ -907,6 +907,7 @@
|
|||
$oXmlParser = new XmlParser();
|
||||
$xml_doc = $oXmlParser->parse($buff);
|
||||
if($xml_doc->div) $xml_doc = $xml_doc->div;
|
||||
else if($xml_doc->img) $xml_doc = $xml_doc->img;
|
||||
|
||||
$xml_doc->body = $matches[3];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
@charset "utf-8";
|
||||
.xeEditor .editor_info .editor_autosaved_message { color:#888888; text-align:right; }
|
||||
.xeEditor .optionDE { width:100%; clear:both; overflow:hidden; background:#f8f8f8; border-bottom:1px solid #e1e1e1; height:29px;}
|
||||
.xeEditor .optionDE .buttonGroup { white-space:nowrap; position:relative; display:block; float:left; height:21px; overflow:hidden; padding-left:2px;}
|
||||
.xeEditor .optionDE img { float:left; display:block; margin-right:.5em; cursor:pointer;}
|
||||
.xeEditor .optionD { padding:.5em 0 .5em .8em; overflow:hidden; float:left; border-right:1px solid #e0e0e0;}
|
||||
.xeEditor .optionE { padding:4px 0 0 8px; overflow:hidden; border-left:1px solid #ffffff; float:left;}
|
||||
.xeEditor .textAreaDragIndicator { text-align:center; background:url(../images/lineTextAreaDrag.gif) repeat-x left center; padding:5px 0 5px 0; }
|
||||
.xeEditor .textAreaDragIndicatorBar { background:url(../images/buttonTextAreaDrag.gif) no-repeat center; cursor:move;height:14px;}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,21 @@
|
|||
|
||||
<!-- 에디터 -->
|
||||
<div class="xeEditor" style="margin-top:5px; margin-bottom:5px;">
|
||||
<!--@if($enable_component)-->
|
||||
<!-- 확장 컴포넌트 출력 -->
|
||||
<div class="optionDE">
|
||||
<div class="optionE">
|
||||
<div class="buttonGroup" id="editor_component_{$editor_sequence}">
|
||||
<!--@foreach($component_list as $component_name => $component)-->
|
||||
<!--@if(substr($component_name,0,11)!="colorpicker")-->
|
||||
<img src="../../components/{$component_name}/icon.gif" alt="{$component->title}" title="{$component->title}" id="component_{$editor_sequence}_{$component_name}" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
|
||||
<!-- HTML 모드 사용 기능 및 자동저장 메세지 출력용 -->
|
||||
<div class="editor_info">
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@ function editorGetContent_xq(editor_sequence) {
|
|||
|
||||
function editorStart_xq(editor, element, editor_sequence, content_key, editor_height, primary_key) {
|
||||
editor = new xq.Editor(element);
|
||||
var additionalAttributes = ['editor_component', 'poll_srl','multimedia_src', 'auto_start', 'link_url', 'editor_sequence'];
|
||||
var additionalTags = ['embed', 'param', 'object'];
|
||||
additionalAttributes.each( function (item, index) {
|
||||
editor.config.allowedAttributes.push(item); } );
|
||||
additionalTags.each( function (item, index) { editor.config.allowedTags.push(item); } );
|
||||
|
||||
editorRelKeys[editor_sequence] = new Array();
|
||||
editorRelKeys[editor_sequence]['editor'] = editor;
|
||||
|
|
@ -62,8 +67,15 @@ function editorStart_xq(editor, element, editor_sequence, content_key, editor_he
|
|||
editor.loadStylesheet(request_uri+editor_path+"/examples/css/xq_contents.css");
|
||||
editor.getFrame().style.width = "100%";
|
||||
editor.getFrame().parentNode.style.height = editor_height;
|
||||
editor.getBody().setAttribute('editor_sequence', editor_sequence);
|
||||
editor.addAutocompletions(getAdditionalAutocompletions());
|
||||
|
||||
// 위젯 감시를 위한 더블클릭 이벤트 걸기
|
||||
try {
|
||||
xAddEventListener(editor.getFrame().contentWindow.document,'dblclick',editorSearchComponent);
|
||||
} catch(e) {
|
||||
}
|
||||
|
||||
if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, editor_sequence);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
/**
|
||||
* 에디터 사용시 사용되는 이벤트 연결 함수 호출
|
||||
**/
|
||||
xAddEventListener(document, 'mouseup', editorEventCheck);
|
||||
|
||||
/**
|
||||
* 에디터의 상태나 객체를 구하기 위한 함수
|
||||
|
|
@ -44,21 +43,6 @@ function editorGetContent_xe(editor_sequence) {
|
|||
return html;
|
||||
}
|
||||
|
||||
// 에디터 내의 선택된 부분의 html 코드를 return
|
||||
function editorGetSelectedHtml(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(xIE4Up) {
|
||||
var range = iframe_obj.contentWindow.document.selection.createRange();
|
||||
var html = range.htmlText;
|
||||
return html;
|
||||
} else {
|
||||
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
|
||||
var dummy = xCreateElement('div');
|
||||
dummy.appendChild(range.cloneContents());
|
||||
var html = xInnerHtml(dummy);
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
||||
// 에디터 내의 선택된 부분의 NODE를 return
|
||||
function editorGetSelectedNode(editor_sequence) {
|
||||
|
|
@ -193,47 +177,7 @@ function editorStart(editor_sequence, primary_key, content_key, editor_height) {
|
|||
* 에디터의 세부 설정과 데이터 핸들링을 정의한 함수들
|
||||
**/
|
||||
|
||||
// 에디터에 포커스를 줌
|
||||
function editorFocus(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
iframe_obj.contentWindow.focus();
|
||||
}
|
||||
|
||||
// 에디터 내의 선택된 부분의 html코드를 변경
|
||||
function editorReplaceHTML(iframe_obj, html) {
|
||||
// 에디터가 활성화 되어 있는지 확인 후 비활성화시 활성화
|
||||
var editor_sequence = iframe_obj.contentWindow.document.body.getAttribute("editor_sequence");
|
||||
|
||||
// iframe 에디터에 포커스를 둠
|
||||
iframe_obj.contentWindow.focus();
|
||||
|
||||
if(xIE4Up) {
|
||||
var range = iframe_obj.contentWindow.document.selection.createRange();
|
||||
if(range.pasteHTML) {
|
||||
range.pasteHTML(html);
|
||||
} else if(editorPrevNode) {
|
||||
editorPrevNode.outerHTML = html;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
try {
|
||||
if(iframe_obj.contentWindow.getSelection().focusNode.tagName == "HTML") {
|
||||
var range = iframe_obj.contentDocument.createRange();
|
||||
range.setStart(iframe_obj.contentDocument.body,0);
|
||||
range.setEnd(iframe_obj.contentDocument.body,0);
|
||||
range.insertNode(range.createContextualFragment(html));
|
||||
} else {
|
||||
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
|
||||
range.deleteContents();
|
||||
range.insertNode(range.createContextualFragment(html));
|
||||
}
|
||||
} catch(e) {
|
||||
xInnerHtml(iframe_obj.contentWindow.document.body, html+xInnerHtml(iframe_obj.contentWindow.document.body));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 키 또는 마우스 이벤트 핸들링 정의 함수
|
||||
|
|
@ -430,161 +374,6 @@ function editorChangeHeader(obj,srl) {
|
|||
obj.selectedIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 에디터 컴포넌트 구현 부분
|
||||
**/
|
||||
|
||||
// 에디터 상단의 컴포넌트 버튼 클릭시 action 처리 (마우스다운 이벤트 발생시마다 요청이 됨)
|
||||
var editorPrevSrl = null;
|
||||
function editorEventCheck(evt) {
|
||||
editorPrevNode = null;
|
||||
|
||||
// 이벤트가 발생한 object의 ID를 구함
|
||||
var e = new xEvent(evt);
|
||||
var target_id = e.target.id;
|
||||
if(!target_id) return;
|
||||
|
||||
// editor_sequence와 component name을 구함 (id가 포맷과 다르면 return)
|
||||
var info = target_id.split('_');
|
||||
if(info[0]!="component") return;
|
||||
var editor_sequence = info[1];
|
||||
var component_name = target_id.replace(/^component_([0-9]+)_/,'');
|
||||
if(!editor_sequence || !component_name) return;
|
||||
|
||||
if(editorMode[editor_sequence]=='html') return;
|
||||
|
||||
switch(component_name) {
|
||||
|
||||
// 기본 기능에 대한 동작 (바로 실행)
|
||||
case 'Bold' :
|
||||
case 'Italic' :
|
||||
case 'Underline' :
|
||||
case 'StrikeThrough' :
|
||||
case 'undo' :
|
||||
case 'redo' :
|
||||
case 'JustifyLeft' :
|
||||
case 'JustifyCenter' :
|
||||
case 'JustifyRight' :
|
||||
case 'JustifyFull' :
|
||||
case 'Indent' :
|
||||
case 'Outdent' :
|
||||
case 'InsertOrderedList' :
|
||||
case 'InsertUnorderedList' :
|
||||
case 'SaveAs' :
|
||||
case 'Print' :
|
||||
case 'Copy' :
|
||||
case 'Cut' :
|
||||
case 'Paste' :
|
||||
case 'RemoveFormat' :
|
||||
case 'Subscript' :
|
||||
case 'Superscript' :
|
||||
editorDo(component_name, '', editor_sequence);
|
||||
break;
|
||||
|
||||
// 추가 컴포넌트의 경우 서버에 요청을 시도
|
||||
default :
|
||||
openComponent(component_name, editor_sequence);
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 컴포넌트 팝업 열기
|
||||
function openComponent(component_name, editor_sequence, manual_url) {
|
||||
editorPrevSrl = editor_sequence;
|
||||
if(editorMode[editor_sequence]=='html') return;
|
||||
|
||||
var popup_url = request_uri+"?module=editor&act=dispEditorPopup&editor_sequence="+editor_sequence+"&component="+component_name;
|
||||
if(typeof(manual_url)!="undefined" && manual_url) popup_url += "&manual_url="+escape(manual_url);
|
||||
|
||||
popopen(popup_url, 'editorComponent');
|
||||
}
|
||||
|
||||
// 더블클릭 이벤트 발생시에 본문내에 포함된 컴포넌트를 찾는 함수
|
||||
var editorPrevNode = null;
|
||||
function editorSearchComponent(evt) {
|
||||
var e = new xEvent(evt);
|
||||
|
||||
editorPrevNode = null;
|
||||
var obj = e.target;
|
||||
|
||||
// 위젯인지 일단 체크
|
||||
if(obj.getAttribute("widget")) {
|
||||
// editor_sequence을 찾음
|
||||
var tobj = obj;
|
||||
while(tobj && tobj.nodeName != "BODY") {
|
||||
tobj = xParent(tobj);
|
||||
}
|
||||
if(!tobj || tobj.nodeName != "BODY" || !tobj.getAttribute("editor_sequence")) {
|
||||
editorPrevNode = null;
|
||||
return;
|
||||
}
|
||||
var editor_sequence = tobj.getAttribute("editor_sequence");
|
||||
var widget = obj.getAttribute("widget");
|
||||
editorPrevNode = obj;
|
||||
|
||||
if(editorMode[editor_sequence]=='html') return;
|
||||
popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget+"&module_srl="+editor_sequence,'GenerateCodeInPage');
|
||||
return;
|
||||
}
|
||||
|
||||
// 선택되어진 object부터 상단으로 이동하면서 editor_component attribute가 있는지 검사
|
||||
if(!obj.getAttribute("editor_component")) {
|
||||
while(obj && !obj.getAttribute("editor_component")) {
|
||||
if(obj.parentElement) obj = obj.parentElement;
|
||||
else obj = xParent(obj);
|
||||
}
|
||||
}
|
||||
|
||||
if(!obj) obj = e.target;
|
||||
|
||||
var editor_component = obj.getAttribute("editor_component");
|
||||
|
||||
// editor_component를 찾지 못했을 경우에 이미지/텍스트/링크의 경우 기본 컴포넌트와 연결
|
||||
if(!editor_component) {
|
||||
// 이미지일 경우
|
||||
if(obj.nodeName == "IMG") {
|
||||
editor_component = "image_link";
|
||||
editorPrevNode = obj;
|
||||
|
||||
// 테이블의 td일 경우
|
||||
} else if(obj.nodeName == "TD") {
|
||||
editor_component = "table_maker";
|
||||
editorPrevNode = obj;
|
||||
|
||||
// 링크거나 텍스트인 경우
|
||||
} else if(obj.nodeName == "A" || obj.nodeName == "BODY" || obj.nodeName.indexOf("H")==0 || obj.nodeName == "LI" || obj.nodeName == "P") {
|
||||
editor_component = "url_link";
|
||||
editorPrevNode = obj;
|
||||
}
|
||||
} else {
|
||||
editorPrevNode = obj;
|
||||
}
|
||||
|
||||
// 아무런 editor_component가 없다면 return
|
||||
if(!editor_component) {
|
||||
editorPrevNode = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// editor_sequence을 찾음
|
||||
var tobj = obj;
|
||||
while(tobj && tobj.nodeName != "BODY") {
|
||||
tobj = xParent(tobj);
|
||||
}
|
||||
if(!tobj || tobj.nodeName != "BODY" || !tobj.getAttribute("editor_sequence")) {
|
||||
editorPrevNode = null;
|
||||
return;
|
||||
}
|
||||
var editor_sequence = tobj.getAttribute("editor_sequence");
|
||||
|
||||
// 해당 컴포넌트를 찾아서 실행
|
||||
openComponent(editor_component, editor_sequence);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HTML 편집 기능 활성/비활성
|
||||
**/
|
||||
|
|
@ -624,21 +413,6 @@ function editorChangeMode(obj, editor_sequence) {
|
|||
|
||||
}
|
||||
|
||||
|
||||
// Editor Option Button
|
||||
function eOptionOver(obj) {
|
||||
obj.style.marginTop='-21px';
|
||||
obj.style.zIndex='99';
|
||||
}
|
||||
function eOptionOut(obj) {
|
||||
obj.style.marginTop='0';
|
||||
obj.style.zIndex='1';
|
||||
}
|
||||
function eOptionClick(obj) {
|
||||
obj.style.marginTop='-42px';
|
||||
obj.style.zIndex='99';
|
||||
}
|
||||
|
||||
// Editor Info Close
|
||||
function closeEditorInfo(editor_sequence) {
|
||||
xGetElementById('editorInfo_'+editor_sequence).style.display='none';
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ var editorDragObj = {isDrag:false, y:0, obj:null, id:'', det:0, source_height:0}
|
|||
/**
|
||||
* 에디터 사용시 사용되는 이벤트 연결 함수 호출
|
||||
**/
|
||||
xAddEventListener(document, 'mouseup', editorEventCheck);
|
||||
xAddEventListener(document, 'mousedown', editorDragStart);
|
||||
xAddEventListener(document, 'mouseup', editorDragStop);
|
||||
|
||||
|
|
@ -16,6 +17,12 @@ function editorGetContent(editor_sequence) {
|
|||
return editorRelKeys[editor_sequence]["func"](editor_sequence);
|
||||
}
|
||||
|
||||
// 에디터에 포커스를 줌
|
||||
function editorFocus(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
iframe_obj.contentWindow.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* 자동 저장 기능
|
||||
**/
|
||||
|
|
@ -141,3 +148,222 @@ function editorDragStop(evt) {
|
|||
editorDragObj.obj = null;
|
||||
editorDragObj.id = '';
|
||||
}
|
||||
|
||||
// Editor Option Button
|
||||
function eOptionOver(obj) {
|
||||
obj.style.marginTop='-21px';
|
||||
obj.style.zIndex='99';
|
||||
}
|
||||
function eOptionOut(obj) {
|
||||
obj.style.marginTop='0';
|
||||
obj.style.zIndex='1';
|
||||
}
|
||||
function eOptionClick(obj) {
|
||||
obj.style.marginTop='-42px';
|
||||
obj.style.zIndex='99';
|
||||
}
|
||||
|
||||
/**
|
||||
* 에디터 컴포넌트 구현 부분
|
||||
**/
|
||||
|
||||
// 에디터 상단의 컴포넌트 버튼 클릭시 action 처리 (마우스다운 이벤트 발생시마다 요청이 됨)
|
||||
var editorPrevSrl = null;
|
||||
function editorEventCheck(evt) {
|
||||
editorPrevNode = null;
|
||||
|
||||
// 이벤트가 발생한 object의 ID를 구함
|
||||
var e = new xEvent(evt);
|
||||
var target_id = e.target.id;
|
||||
if(!target_id) return;
|
||||
|
||||
// editor_sequence와 component name을 구함 (id가 포맷과 다르면 return)
|
||||
var info = target_id.split('_');
|
||||
if(info[0]!="component") return;
|
||||
var editor_sequence = info[1];
|
||||
var component_name = target_id.replace(/^component_([0-9]+)_/,'');
|
||||
if(!editor_sequence || !component_name) return;
|
||||
|
||||
if(editorMode[editor_sequence]=='html') return;
|
||||
|
||||
switch(component_name) {
|
||||
|
||||
// 기본 기능에 대한 동작 (바로 실행)
|
||||
case 'Bold' :
|
||||
case 'Italic' :
|
||||
case 'Underline' :
|
||||
case 'StrikeThrough' :
|
||||
case 'undo' :
|
||||
case 'redo' :
|
||||
case 'JustifyLeft' :
|
||||
case 'JustifyCenter' :
|
||||
case 'JustifyRight' :
|
||||
case 'JustifyFull' :
|
||||
case 'Indent' :
|
||||
case 'Outdent' :
|
||||
case 'InsertOrderedList' :
|
||||
case 'InsertUnorderedList' :
|
||||
case 'SaveAs' :
|
||||
case 'Print' :
|
||||
case 'Copy' :
|
||||
case 'Cut' :
|
||||
case 'Paste' :
|
||||
case 'RemoveFormat' :
|
||||
case 'Subscript' :
|
||||
case 'Superscript' :
|
||||
editorDo(component_name, '', editor_sequence);
|
||||
break;
|
||||
|
||||
// 추가 컴포넌트의 경우 서버에 요청을 시도
|
||||
default :
|
||||
openComponent(component_name, editor_sequence);
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 컴포넌트 팝업 열기
|
||||
function openComponent(component_name, editor_sequence, manual_url) {
|
||||
editorPrevSrl = editor_sequence;
|
||||
if(editorMode[editor_sequence]=='html') return;
|
||||
|
||||
var popup_url = request_uri+"?module=editor&act=dispEditorPopup&editor_sequence="+editor_sequence+"&component="+component_name;
|
||||
if(typeof(manual_url)!="undefined" && manual_url) popup_url += "&manual_url="+escape(manual_url);
|
||||
|
||||
popopen(popup_url, 'editorComponent');
|
||||
}
|
||||
|
||||
// 더블클릭 이벤트 발생시에 본문내에 포함된 컴포넌트를 찾는 함수
|
||||
var editorPrevNode = null;
|
||||
function editorSearchComponent(evt) {
|
||||
var e = new xEvent(evt);
|
||||
|
||||
editorPrevNode = null;
|
||||
var obj = e.target;
|
||||
|
||||
// 위젯인지 일단 체크
|
||||
if(obj.getAttribute("widget")) {
|
||||
// editor_sequence을 찾음
|
||||
var tobj = obj;
|
||||
while(tobj && tobj.nodeName != "BODY") {
|
||||
tobj = xParent(tobj);
|
||||
}
|
||||
if(!tobj || tobj.nodeName != "BODY" || !tobj.getAttribute("editor_sequence")) {
|
||||
editorPrevNode = null;
|
||||
return;
|
||||
}
|
||||
var editor_sequence = tobj.getAttribute("editor_sequence");
|
||||
var widget = obj.getAttribute("widget");
|
||||
editorPrevNode = obj;
|
||||
|
||||
if(editorMode[editor_sequence]=='html') return;
|
||||
popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget+"&module_srl="+editor_sequence,'GenerateCodeInPage');
|
||||
return;
|
||||
}
|
||||
|
||||
// 선택되어진 object부터 상단으로 이동하면서 editor_component attribute가 있는지 검사
|
||||
if(!obj.getAttribute("editor_component")) {
|
||||
while(obj && !obj.getAttribute("editor_component")) {
|
||||
if(obj.parentElement) obj = obj.parentElement;
|
||||
else obj = xParent(obj);
|
||||
}
|
||||
}
|
||||
|
||||
if(!obj) obj = e.target;
|
||||
|
||||
var editor_component = obj.getAttribute("editor_component");
|
||||
|
||||
// editor_component를 찾지 못했을 경우에 이미지/텍스트/링크의 경우 기본 컴포넌트와 연결
|
||||
if(!editor_component) {
|
||||
// 이미지일 경우
|
||||
if(obj.nodeName == "IMG") {
|
||||
editor_component = "image_link";
|
||||
editorPrevNode = obj;
|
||||
|
||||
// 테이블의 td일 경우
|
||||
} else if(obj.nodeName == "TD") {
|
||||
editor_component = "table_maker";
|
||||
editorPrevNode = obj;
|
||||
|
||||
// 링크거나 텍스트인 경우
|
||||
} else if(obj.nodeName == "A" || obj.nodeName == "BODY" || obj.nodeName.indexOf("H")==0 || obj.nodeName == "LI" || obj.nodeName == "P") {
|
||||
editor_component = "url_link";
|
||||
editorPrevNode = obj;
|
||||
}
|
||||
} else {
|
||||
editorPrevNode = obj;
|
||||
}
|
||||
|
||||
// 아무런 editor_component가 없다면 return
|
||||
if(!editor_component) {
|
||||
editorPrevNode = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// editor_sequence을 찾음
|
||||
var tobj = obj;
|
||||
while(tobj && tobj.nodeName != "BODY") {
|
||||
tobj = xParent(tobj);
|
||||
}
|
||||
if(!tobj || tobj.nodeName != "BODY" || !tobj.getAttribute("editor_sequence")) {
|
||||
editorPrevNode = null;
|
||||
return;
|
||||
}
|
||||
var editor_sequence = tobj.getAttribute("editor_sequence");
|
||||
|
||||
// 해당 컴포넌트를 찾아서 실행
|
||||
openComponent(editor_component, editor_sequence);
|
||||
}
|
||||
|
||||
// 에디터 내의 선택된 부분의 html코드를 변경
|
||||
function editorReplaceHTML(iframe_obj, html) {
|
||||
// 에디터가 활성화 되어 있는지 확인 후 비활성화시 활성화
|
||||
var editor_sequence = iframe_obj.contentWindow.document.body.getAttribute("editor_sequence");
|
||||
|
||||
// iframe 에디터에 포커스를 둠
|
||||
iframe_obj.contentWindow.focus();
|
||||
|
||||
if(xIE4Up) {
|
||||
var range = iframe_obj.contentWindow.document.selection.createRange();
|
||||
if(range.pasteHTML) {
|
||||
range.pasteHTML(html);
|
||||
} else if(editorPrevNode) {
|
||||
editorPrevNode.outerHTML = html;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
try {
|
||||
if(iframe_obj.contentWindow.getSelection().focusNode.tagName == "HTML") {
|
||||
var range = iframe_obj.contentDocument.createRange();
|
||||
range.setStart(iframe_obj.contentDocument.body,0);
|
||||
range.setEnd(iframe_obj.contentDocument.body,0);
|
||||
range.insertNode(range.createContextualFragment(html));
|
||||
} else {
|
||||
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
|
||||
range.deleteContents();
|
||||
range.insertNode(range.createContextualFragment(html));
|
||||
}
|
||||
} catch(e) {
|
||||
xInnerHtml(iframe_obj.contentWindow.document.body, html+xInnerHtml(iframe_obj.contentWindow.document.body));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 에디터 내의 선택된 부분의 html 코드를 return
|
||||
function editorGetSelectedHtml(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(xIE4Up) {
|
||||
var range = iframe_obj.contentWindow.document.selection.createRange();
|
||||
var html = range.htmlText;
|
||||
return html;
|
||||
} else {
|
||||
var range = iframe_obj.contentWindow.getSelection().getRangeAt(0);
|
||||
var dummy = xCreateElement('div');
|
||||
dummy.appendChild(range.cloneContents());
|
||||
var html = xInnerHtml(dummy);
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ function doPoll(fo_obj) {
|
|||
|
||||
var poll_srl_indexes = "";
|
||||
for(var poll_srl_index in checkcount) {
|
||||
if(!checkcount.hasOwnProperty(poll_srl_index)) continue;
|
||||
var count = checkcount[poll_srl_index];
|
||||
var items = item[poll_srl_index];
|
||||
if(items.length < 1 || count < items.length) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue