Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel2

이벤트 종류

...

Event Type

에디터가 초기화되었을 때 발생합니다
Event NameVersionDescription

initialized

Status
title릴리즈 Release 2.1.0 이상

or Above

This event occurs when the Editor is initialized.

beforeUploadImage

Status
title릴리즈 Release 2.2.0 이상

이미지를 업로드 하기 전에 발생합니다

or Above

This event occurs before an image is uploaded.
afterUploadImage

Status
title릴리즈 Release 2.2.0 이상

이미지 업로드가 완료된 후 발생합니다

or Above

This event occurs after an image is uploaded.
beforeUploadVideo

Status
title릴리즈 Release 2.2.0 이상

비디오를 업로드 하기 전에 발생합니다

or Above

This event occurs before a video is uploaded.
afterUploadVideo

Status
title릴리즈 Release 2.2.0 이상

비디오 업로드가 완료된 후 발생합니다

or Above

This event occurs after a video is uploaded.
beforeUploadFile

Status
title릴리즈 Release 2.2.0 이상

파일을 업로드 하기 전에 발생합니다

or Above

This event occurs before a file is uploaded.
afterUploadFile

Status
title릴리즈 Release 2.2.0 이상

파일 업로드가 완료된 후 발생합니다

or Above

This event occurs after a file is uploaded.
beforeOpenDocument

Status
title릴리즈 Release 2.3.0 이상

문서를 열기 전(임포트 전) 발생합니다

or Above

This event occurs before a document is opened (imported).
afterOpenDocument

Status
title릴리즈 Release 2.3.0 이상

문서가 열린 후(임포트 이후) 발생합니다

or Above

This event occurs after a document is opened (imported).
beforeNewDocument

Status
title릴리즈 Release 2.4.1 이상

새문서를 하기 전 발생합니다

or Above

This event occurs before creating a new document.
afterNewDocument

Status
title릴리즈 Release 2.4.1 이상

새문서를 한 이후 발생합니다.

이벤트 등록 

...

or Above

This event occurs after creating a new document. 
onSelection

Status
titleRelease 2.6.0 or Above

This event occurs when performing a selection operation such as moving the caret and expanding the selection.
beforePaste

Status
colourYellow
titleRelease 2.10.0 or Above

This event occurs before pasting.
afterPaste

Status
colourYellow
titleRelease 2.10.0 or Above

This event occurs after pasting.
afterEdit

Status
colourYellow
titleRelease 2.10.0 or Above

This event occurs after all editing actions.


Adding Events

Using API

editor.setEventListener()

이벤트를 등록 할 때 사용하는 API입니다. API used to add an event.

Code Block
languagejs
editor.setEventListener('이벤트이름Event Name', function(e) {
});

...


Adding at the Editor Initialization

Code Block
languagejs
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
    '이벤트이름Event Name': function (e) {
    }
};

new SynapEditor(editorId, editorConfig, html, eventListeners);

...


Using Functions

Code Block
languagejs
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';

function SynapEditorEvent SynapEditor이벤트이름Name(e) {
    // 이벤트 이름은 첫자가 대문자The first letter of the event name shall be capitalized
    // ex: initialized => SynapEditorInitialized
    // ex: beforeUploadImage => SynapEditorBeforeUploadImage
}

new SynapEditor(editorId, editorConfig, html);

...

Removing Events

Using API

...

editor.removeEventListener()

등록한 이벤트를 제거 할 때 사용하는 API 입니다API used to remove an event..

Code Block
languagejs
editor.removeEventListener('이벤트이름Event Name');

...


Object Delivered by Functions

Code Block
languagejs
{
	editor: {에디터Editor 객체Object}, // 에디터Editor
	eventType: 'initialized', // 이벤트Event 이름Name
	cancelable: false, // 이벤트Whether the 취소event 가능is 여부cancelable
	returnValue: null, // 반환Return Value
	....  

}
  • editor: 이벤트가 발생한 에디터입니다Editor in which the event is occurred.
  • eventType: 이벤트 이름입니다Event name.
  • cancelable: 이벤트 취소 가능 여부입니다Whether the event is cancelable.
  • returValue: 반환 값입니다. 이벤트 취소가 가능한 이벤트의 경우 Return value. As for cancelable events, the events can be cancelled by delivering (cancelable: true) false를 전달하면 이벤트 진행 취소가 가능합니다false.

이벤트 진행 취소

...


Cancelling Events

When cancelable is set to true, you may cancel the event by setting returnValue to false.

Code Block
languagejs
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
    'beforeUploadImage': function (e) {
		e.returnValue = false; // 업로드가 더이상 진행되지 않습니다Upload will be no longer proceed.
    }
};

new SynapEditor(editorId, editorConfig, html, eventListeners);

...