...
이벤트 이름 | 버전 | 설명 | ||||||
---|---|---|---|---|---|---|---|---|
initialized |
| 에디터가 초기화되었을 때 발생합니다 | ||||||
beforeUploadImage |
| 이미지를 업로드 하기 전에 발생합니다 | ||||||
afterUploadImage |
| 이미지 업로드가 완료된 후 발생합니다. | ||||||
beforeUploadVideo |
| 비디오를 업로드 하기 전에 발생합니다 | ||||||
afterUploadVideo |
| 비디오 업로드가 완료된 후 발생합니다 | ||||||
beforeUploadFile |
| 파일을 업로드 하기 전에 발생합니다 | ||||||
afterUploadFile |
| 파일 업로드가 완료된 후 발생합니다 | ||||||
beforeOpenDocument |
| 문서를 열기 전(임포트 전) 발생합니다 | ||||||
afterOpenDocument |
| 문서가 열린 후(임포트 이후) 발생합니다. |
이벤트 등록
API 사용
editor.setEventListener()
...
Code Block | ||||
---|---|---|---|---|
| ||||
// release 2.2.0
{
editor: SynapEditor,
eventType: "afterUploadFile",
cancelable: false,
returnValue: null,
path: "/upload/path/filename.zip" // 업로드된 경로
}
// release 2.2.1 이상
{
editor: SynapEditor,
eventType: "afterUploadFile",
cancelable: false,
returnValue: null,
fileType: "file", // [2.2.1] 파일 타입
path: "/upload/path/filename.zip"
} |
8. beforeOpenDocument
Status | ||
---|---|---|
|
문서를 열기 전(임포트 전) 발생합니다.
이벤트 등록: API 사용
Code Block | ||
---|---|---|
| ||
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var editor = new SynapEditor(editorId, editorConfig, html);
editor.setEventListener('beforeOpenDocument', function (e) {
}); |
이벤트 등록: 함수방식
Code Block | ||
---|---|---|
| ||
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
function SynapEditorBeforeOpenDocument(e) {
}
new SynapEditor(editorId, editorConfig, html); |
이벤트 등록: 에디터 초기화시 등록
Code Block | ||
---|---|---|
| ||
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
beforeOpenDocument: function (e) {
}
};
new SynapEditor(editorId, editorConfig, html, eventListeners); |
함수로 전달되는 객체 형태
함수로 전달되는 파라미터 e의 형식
Code Block | ||||
---|---|---|---|---|
| ||||
{
editor: SynapEditor,
eventType: "beforeOpenDocument",
cancelable: true,
returnValue: null,
fileType: "WORD", // 파일 타입 ("HTML", "WORD", "CELL", ...)
fileName: "filename.docx" // 파일 이름
} |
9. afterOpenDocument
Status | ||
---|---|---|
|
문서가 열린 후(임포트 이후) 발생합니다.
이벤트 등록: API 사용
Code Block | ||
---|---|---|
| ||
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var editor = new SynapEditor(editorId, editorConfig, html);
editor.setEventListener('afterOpenDocument', function (e) {
}); |
이벤트 등록: 함수방식
Code Block | ||
---|---|---|
| ||
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
function SynapEditorAfterOpenDocument(e) {
}
new SynapEditor(editorId, editorConfig, html); |
이벤트 등록: 에디터 초기화시 등록
Code Block | ||
---|---|---|
| ||
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
afterOpenDocument: function (e) {
}
};
new SynapEditor(editorId, editorConfig, html, eventListeners); |
함수로 전달되는 객체 형태
함수로 전달되는 파라미터 e의 형식
Code Block | ||||
---|---|---|---|---|
| ||||
{
editor: SynapEditor,
eventType: "afterOpenDocument",
cancelable: true,
returnValue: null,
fileType: "WORD", // 파일 타입 ("HTML", "WORD", "CELL", ...)
path: "/upload/path/filename.docx", // 임포트 경로
...... // 서버로부터 전달받은 Data (importPath, serializedData, .....)
} |