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;
},
익스플로러 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개
8년 전
따끈따끈한 자료이군요. 감사합니다.
아직 오류발생한 것이 없지만 발생하면 참고하겠습니다.
아직 오류발생한 것이 없지만 발생하면 참고하겠습니다.
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4429 | ||
| 2694 | 2개월 전 | 200 | ||
| 2693 | 2개월 전 | 157 | ||
| 2692 | 2개월 전 | 164 | ||
| 2691 | 2개월 전 | 179 | ||
| 2690 | 2개월 전 | 332 | ||
| 2689 | 2개월 전 | 243 | ||
| 2688 |
|
2개월 전 | 445 | |
| 2687 | 2개월 전 | 298 | ||
| 2686 |
선택과집중
|
2개월 전 | 335 | |
| 2685 | 3개월 전 | 298 | ||
| 2684 | 3개월 전 | 357 | ||
| 2683 | 3개월 전 | 488 | ||
| 2682 | 3개월 전 | 282 | ||
| 2681 | 3개월 전 | 307 | ||
| 2680 |
선택과집중
|
3개월 전 | 281 | |
| 2679 | 3개월 전 | 336 | ||
| 2678 |
|
3개월 전 | 434 | |
| 2677 |
|
3개월 전 | 506 | |
| 2676 | 3개월 전 | 332 | ||
| 2675 | 3개월 전 | 309 | ||
| 2674 |
선택과집중
|
3개월 전 | 484 | |
| 2673 |
|
3개월 전 | 325 | |
| 2672 | 3개월 전 | 342 | ||
| 2671 | 3개월 전 | 290 | ||
| 2670 | 3개월 전 | 265 | ||
| 2669 | 3개월 전 | 378 | ||
| 2668 | 3개월 전 | 294 | ||
| 2667 |
선택과집중
|
3개월 전 | 491 | |
| 2666 |
선택과집중
|
3개월 전 | 474 | |
| 2665 |
선택과집중
|
4개월 전 | 412 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기