ETC
editor.execCommand를 통해 실행되는 기타 에디터 명령어.
명령어
command - insertBookmarkcommand - insertAbsolutePositionDivcommand - insertDivcommand - insertFilecommand - insertHorizontalLinecommand - insertPageBreakcommand - undocommand - redo
command - insertBookmark
캐럿 위치에 책갈피를 삽입합니다.
| 이름 | 타입 | 설명 |
|---|---|---|
actionName | string | 명령 이름 |
id | string | 삽입할 책갈피 id |
editor.execCommand('insertBookmark', 'id');
command - insertAbsolutePositionDiv
절대 위치 레이어를 삽입합니다.
| 이름 | 타입 | 설명 |
|---|---|---|
actionName | string | 명령 이름 |
rect | object | { x: Number, y: Number, width: Number, height: Number } — 레이어의 위치와 크기 |
editor.execCommand('insertAbsolutePositionDiv', { x: 100, y: 100, width: 200, height: 200 });
command - insertDiv
캐럿 위치에 블록 레이어를 삽입합니다. 선택 영역이 있으면 먼저 선택된 범위가 제거된 후 블록 레이어가 삽입됩니다.
| 이름 | 타입 | 설명 |
|---|---|---|
actionName | string | 명령 이름 |
editor.execCommand('insertDiv');
command - insertFile
캐럿 위치에 파일을 링크로 삽입합니다. 삽입된 파일은 서버에 업로드됩니다.
참조: 임포트 & 업로드 API
| 이름 | 타입 | 설명 |
|---|---|---|
actionName | string | 명령 이름 |
files | File[] | 업로드할 파일 |
editor.execCommand('insertFile', [file]);
command - insertHorizontalLine
캐럿 위치에 가로줄을 삽입합니다. 캐럿이 문단 사이에 있으면 문단이 분할되고 그 사이에 가로줄이 삽입됩니다. 문단이 선택된 경우, 선택이 해제된 후 가로줄이 삽입됩니다.
| 이름 | 타입 | 설명 |
|---|---|---|
actionName | string | 명령 이름 |
editor.execCommand('insertHorizontalLine');
command - insertPageBreak
캐럿 위치에 페이지 나누기(인쇄 시 페이지 구분자로 사용됨)를 삽입합니다. 캐럿이 문단 사이에 있으면, 문단이 분할되고 그 사이에 페이지 나누기가 삽입됩니다. 선택 영역이 있으면, 페이지 나누기를 삽입하기 전에 선택 영역이 제거됩니다.
| 이름 | 타입 | 설명 |
|---|---|---|
actionName | string | 명령 이름 |
editor.execCommand('insertPageBreak');
command - undo
Performs undo.
| 이름 | 타입 | 설명 |
|---|---|---|
actionName | string | 명령 이름 |
editor.execCommand('undo');
command - redo
Performs redo.
| 이름 | 타입 | 설명 |
|---|---|---|
actionName | string | 명령 이름 |
editor.execCommand('redo');