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

· 2017-05-24 (수) 08:44:33 · 9135 · 1
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 팁자료실

2,788건
+
제목 글쓴이 날짜 조회
17-06-20 조회 7,446
17-06-19 조회 1.9만
17-06-18 조회 6,906
17-06-17 조회 7,653
17-06-15 조회 9,226
17-06-15 조회 7,097
17-06-09 조회 8,896
17-06-07 조회 9,888
17-06-07 조회 9,564
17-06-07 조회 5,704
17-06-07 조회 5,718
17-06-07 조회 5,666
17-06-05 조회 1.1만
17-06-04 조회 5,963
17-06-03 조회 5,623
17-06-02 조회 6,236
17-06-02 조회 8,485
17-06-02 조회 8,638
17-06-01 조회 6,035
17-05-31 조회 7,103
17-05-30 조회 6,827
17-05-29 조회 5,704
17-05-29 조회 7,030
17-05-27 조회 6,450
17-05-27 조회 9,305
17-05-27 조회 5,918
17-05-27 조회 9,735
17-05-24 조회 9,136
17-05-23 조회 7,583
17-05-22 조회 5,657