왼쪽 패널에서 사용자 정의 패널 구성 id224JI200Y6F

다음 단계를 수행하여 웹 편집기의 왼쪽 패널 내에 사용자 지정 패널을 추가합니다.

  1. 만들기 clientlib 폴더를 만들고 이 폴더에 JavaScript 및 CSS 파일을 추가합니다.
  2. 의 카테고리 속성을 업데이트합니다. clientlib 값을 할당하여 폴더 만들기 apps.fmdita.xml_editor.page_overrides.

사용자 지정 패널을 구성하는 샘플 코드:

tcx.ready(function () { //Ready will call the callback after editor code is set for events and global variable excess


    // APP_ADD_AUTHOR_LEFT_TAB event will add a new left tab in the left panel, user can show hide it using editor settings
    tcx.eventHandler.next(tcx.eventHandler.KEYS.APP_ADD_AUTHOR_LEFT_TAB, {
            id: 'my_panel',
            class: 'my-panel-tab',
            icon: 'file', //Any valid Adobe Spectrum icon name https://spectrum.adobe.com/page/icons/
            label: 'My Tab',
            prevTabID: 'repository_panel' //Existing tab ids are 'collection_panel', 'repository_panel', 'map_panel', 'outline_panel', 'conref_panel', 'glossary_panel', 'condition_panel', 'subject_scheme_panel', 'snippet_panel', 'template_panel', 'search_panel'
    })

    // APP_PANEL_DID_MOUNT event will be called after user has selected the panel and panel is rendered in the DOM
    tcx.eventHandler.subscribe({
        key: tcx.eventHandler.KEYS.APP_PANEL_DID_MOUNT,
        next: function(opts) {
            // TODO create panel ui inside $el
            let $el = opts.$el //$el is Tab panel content html node
            let id = opts.id //id is tab panel id (my_panel)
            console.log("mounted", opts)
        }
    })

  // APP_PANEL_WILL_UNMOUNT will be called before destorying the new left panel
  tcx.eventHandler.subscribe({
        key: tcx.eventHandler.KEYS.APP_PANEL_WILL_UNMOUNT,
        next: function(opts) {
            //TODO do some cleanup
            let id = opts.id //id is tab panel id (my_panel)
            console.log("unmounted", opts)
        }
    })

});

상위 항목:​웹 편집기 사용자 지정

recommendation-more-help
11125c99-e1a1-4369-b5d7-fb3098b9b178