테스트 사이트 - 개발 중인 베타 버전입니다

template.xml 파일 로딩 중 오류가 발생하였습니다.

cheditor5 에디터를 사용할 때
익스플로러 11 환경에서 template.xml 관련 에러가 발생한다면 아래 내용을 참고해보세요.
QA에서 종종 질문이 올라오던데 참고하시라고 남깁니다.
그누4, 그누5 모두 해당될 겁니다. 전 익스11 에서 테스트를 해봐도 오류가 뜨지 않아 확인은 못해봤습니다.


출처 : 상단 관련링크 클릭


수정 파일: cheditor.js
수정 함수: loadTemplate, getCDATASection
위 두 개의 수정 함수를 아래 것으로 교체해 주십시오.

loadTemplate : function (xmlDoc) {
var cdata, container, dragHandle, html, modalFrame, popupWindow, tmpDiv, tmpl, toolbar;
tmpl = xmlDoc.getElementsByTagName('Template').item(0);
if (!tmpl) {
throw 'Template 노드를 설정할 수 없습니다.';
}
cdata = tmpl.getElementsByTagName('Container').item(0).getElementsByTagName('Html').item(0);
if (!cdata) {
throw 'XML CDATA 오류';
}
html = this.getCDATASection(cdata);
tmpDiv = document.createElement('div');
tmpDiv.innerHTML = html;
container = tmpDiv.firstChild;

toolbar = tmpl.getElementsByTagName('Toolbar').item(0);
this.createEditorElement(container, toolbar);

cdata = tmpl.getElementsByTagName('PopupWindow').item(0).getElementsByTagName('Html').item(0);
if (!cdata) {
throw 'XML CDATA 오류';
}
html = this.getCDATASection(cdata);
tmpDiv.innerHTML = html;
popupWindow = tmpDiv.firstChild;
this.cheditor.popupElem = popupWindow;

dragHandle = popupWindow.firstChild;
this.cheditor.dragHandle = dragHandle;
this.cheditor.popupTitle = dragHandle.getElementsByTagName('label')[0];
this.cheditor.popupFrameWrapper = dragHandle.nextSibling;
container.appendChild(popupWindow);

modalFrame = document.createElement('div');
modalFrame.className = 'cheditor-modalPopupTransparent';
this.cheditor.modalBackground = modalFrame;
this.cheditor.modalBackground.id = 'popupModalBackground';
this.cheditor.modalBackground.className = 'cheditor-popupModalBackground';
container.parentNode.insertBefore(modalFrame, container);

this.cheditor.htmlEditable = document.createElement('iframe');
this.cheditor.htmlEditable.style.display = 'none';
this.cheditor.htmlEditable.style.width = '1px';
this.cheditor.htmlEditable.style.height = '1px';
this.cheditor.htmlEditable.style.visibility = 'hidden';
container.appendChild(this.cheditor.htmlEditable);
},

getCDATASection : function (node) {
var text = node.textContent || node.text;
text = text.replace(/\n/g, '');
text = text.replace(/(\s+?)<([^>]*)>/g, '<$2>');
text = this.trimSpace(text);
return text;
},

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 1개

따끈따끈한 자료이군요. 감사합니다.
아직 오류발생한 것이 없지만 발생하면 참고하겠습니다.

게시판 목록

그누보드5 팁자료실

글쓰기
🐛 버그신고