Page tree

Versions Compared

Key

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

Table of Contents

...

이벤트


이벤트 이름버전설명

initialized

Status
title릴리즈 2.1.0 이상

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

Status
title릴리즈 2.2.0 이상

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

Status
title릴리즈 2.2.0 이상

이미지를 업로드 한 후 발생합니다
beforeUploadVideo

Status
title릴리즈 2.2.0 이상

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

Status
title릴리즈 2.2.0 이상

비디오를 업로드 한 후 발생합니다
beforeUploadFile

Status
title릴리즈 2.2.0 이상

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

Status
title릴리즈 2.2.0 이상

파일을 업로드 한 후 발생합니다


이벤트 등록 

API 사용

editor.setEventListener()

...

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

function SynapEditor이벤트이름(e) {
    // 이벤트 이름은 첫자가 대문자
    // ex: initialized => SynapEditorInitialized
    // ex: beforeUploadImage => SynapEditorBeforeUploadImage
}

new SynapEditor(editorId, editorConfig, html);

이벤트 해제

API 사용

editor.removeEventListener()

...

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


함수로 전달되는 객체 형태

Code Block
languagejs
{
	editor: {에디터 객체}, // 에디터
	eventType: 'initialized', // 이벤트 이름
	cancelable: false, // 이벤트 취소 가능 여부
	returnValue: null, // 반환 값
	....  

}

...

2. beforeUploadImage

Status
title릴리즈 2.12.0 이상

이미지를 업로드 하기 전에 발생합니다. 이벤트 진행 취소가 가능합니다.

이벤트 등록: 함수방식

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

function SynapEditorBeforeUploadImage(e) {
}

new SynapEditor(editorId, editorConfig, html);

...

Code Block
languagejs
titlee
{
	editor: SynapEditor,
	eventType:  "beforeUploadImage",
	cancelable: true,
	returnValue: null,
	fileName: "filename.png",
	isBackground: false
}



4. beforeUploadVideo


Status
title릴리즈 2.2.0 이상

비디오를 업로드 하기 전에 발생합니다. 이벤트 진행 취소가 가능합니다.

이벤트 등록: 함수방식

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

function SynapEditorBeforeUploadVideo(e) {
}

new SynapEditor(editorId, editorConfig, html);

이벤트 등록: 에디터 초기화시 등록

Code Block
languagejs
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
    beforeUploadVideo: function (e) {
    }
};

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

함수로 전달되는 객체 형태

함수로 전달되는 파라미터 e의 형식

Code Block
languagejs
titlee
{
	editor: SynapEditor,
	eventType:  "beforeUploadVideo",
	cancelable: true,
	returnValue: null,


	fileName: "filename.mp4"
}


6. beforeUploadFile

Status
title릴리즈 2.2.0 이상

파일을 업로드 하기 전에 발생합니다. 이벤트 진행 취소가 가능합니다.

이벤트 등록: 함수방식

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

function SynapEditorBeforeUploadFile(e) {
}

new SynapEditor(editorId, editorConfig, html);

이벤트 등록: 에디터 초기화시 등록

Code Block
languagejs
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
    beforeUploadFile: function (e) {
    }
};

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

함수로 전달되는 객체 형태

함수로 전달되는 파라미터 e의 형식

Code Block
languagejs
titlee
{
	editor: SynapEditor,
	eventType:  "beforeUploadFile",
	cancelable: true,
	returnValue: null,


	fileName: "filename.zip"
}