template.xml 파일 로딩 중 오류가 발생하였습니다. > 그누보드5 팁자료실

그누보드5 팁자료실

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

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

댓글 1개

전체 33 |RSS
그누보드5 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT