init() {
    eventProxy.on('disableEditor', () => this._disableEditor());
    eventProxy.on('enableEditor', () => this._enableEditor());
    eventProxy.on('updatePrismStyle', () => this._updatePrismStyle());
    eventProxy.on('insertADTLink', () => this._insertADTLink());
    eventProxy.on('insertIcon', () => this._insertIcon());
    eventProxy.on('setCustomStyle', (updateBaseFontSize = true) =>
      this._setCustomEditorStyle(updateBaseFontSize)
    );
    eventProxy.on('deactivateCustomEditorStyle', () => this._updatePrismStyle());
    eventProxy.on('activateCustomEditorStyle', () => this._updatePrismStyle());

    this._setCustomEditorStyle();
    this.updateEditMode();
    keyListener.start();

    eventProxy.on('navigateToHeading', headingIdSelector => {
      history.pushState({ headingId: headingIdSelector }, '', headingIdSelector);
      this._scrollToElementInWorkspace(headingIdSelector);
    });
    window.addEventListener('beforeunload', evt => {
      history.replaceState(
        { workspaceTop: $(`#${config.elements.workspaceElementId}`).scrollTop() },
        '',
        '#'
      );
    });
    window.addEventListener('popstate', evt => {
      this._scrollToStateLocation(evt.state);
    });
  }
/**
   * Main initialisation for the editor functions
   */
Main initialisation for the editor functions
Main initialisation for the editor functions
init() {
    eventProxy.on('disableEditor', () => this._disableEditor());
    eventProxy.on('enableEditor', () => this._enableEditor());
    eventProxy.on('updatePrismStyle', () => this._updatePrismStyle());
    eventProxy.on('insertADTLink', () => this._insertADTLink());
    eventProxy.on('insertIcon', () => this._insertIcon());
    eventProxy.on('setCustomStyle', (updateBaseFontSize = true) =>
      this._setCustomEditorStyle(updateBaseFontSize)
    );
    eventProxy.on('deactivateCustomEditorStyle', () => this._updatePrismStyle());
    eventProxy.on('activateCustomEditorStyle', () => this._updatePrismStyle());
    this._setCustomEditorStyle();
    this.updateEditMode();
    keyListener.start();
    eventProxy.on('navigateToHeading', headingIdSelector => {
      history.pushState({ headingId: headingIdSelector }, '', headingIdSelector);
      this._scrollToElementInWorkspace(headingIdSelector);
    });
    window.addEventListener('beforeunload', evt => {
      history.replaceState(
        { workspaceTop: $(`#${config.elements.workspaceElementId}`).scrollTop() },
        '',
        '#'
      );
    });
    window.addEventListener('popstate', evt => {
      this._scrollToStateLocation(evt.state);
    });
  }
init ( ) { eventProxy . on ( 'disableEditor' , ( ) => this . _disableEditor ( ) ) ; eventProxy . on ( 'enableEditor' , ( ) => this . _enableEditor ( ) ) ; eventProxy . on ( 'updatePrismStyle' , ( ) => this . _updatePrismStyle ( ) ) ; eventProxy . on ( 'insertADTLink' , ( ) => this . _insertADTLink ( ) ) ; eventProxy . on ( 'insertIcon' , ( ) => this . _insertIcon ( ) ) ; eventProxy . on ( 'setCustomStyle' , ( updateBaseFontSize = true ) => this . _setCustomEditorStyle ( updateBaseFontSize ) ) ; eventProxy . on ( 'deactivateCustomEditorStyle' , ( ) => this . _updatePrismStyle ( ) ) ; eventProxy . on ( 'activateCustomEditorStyle' , ( ) => this . _updatePrismStyle ( ) ) ; this . _setCustomEditorStyle ( ) ; this . updateEditMode ( ) ; keyListener . start ( ) ; eventProxy . on ( 'navigateToHeading' , headingIdSelector => { history . pushState ( { headingId : headingIdSelector } , '' , headingIdSelector ) ; this . _scrollToElementInWorkspace ( headingIdSelector ) ; } ) ; window . addEventListener ( 'beforeunload' , evt => { history . replaceState ( { workspaceTop : $ ( ` ${ config . elements . workspaceElementId } ` ) . scrollTop ( ) } , '' , '#' ) ; } ) ; window . addEventListener ( 'popstate' , evt => { this . _scrollToStateLocation ( evt . state ) ; } ) ; }
Main initialisation for the editor functions
Main initialisation for the editor functions