添加插入表情及特殊符号菜单
This commit is contained in:
@@ -52,6 +52,9 @@ import { Link } from "./insert/Link.ts";
|
||||
import { Image } from "./insert/Image.ts";
|
||||
import { Video } from "./insert/Video.ts";
|
||||
import { Audio } from "./insert/Audio.ts";
|
||||
import { HardBreak } from "./insert/HardBreak.ts";
|
||||
import { Emoji } from "./insert/Emoji.ts";
|
||||
import { Symbol } from "./insert/Symbol.ts";
|
||||
|
||||
/**
|
||||
* 经典菜单栏
|
||||
@@ -114,6 +117,9 @@ export class Ribbon extends HTMLElement implements UAIEditorEventListener {
|
||||
insertMenuImage!: Image;
|
||||
insertMenuVideo!: Video;
|
||||
insertMenuAudio!: Audio;
|
||||
insertMenuHardBreak!: HardBreak;
|
||||
insertMenuEmoji!: Emoji;
|
||||
insertMenuSymbol!: Symbol;
|
||||
|
||||
constructor(defaultToolbarMenus: Record<string, any>[]) {
|
||||
super();
|
||||
@@ -315,6 +321,15 @@ export class Ribbon extends HTMLElement implements UAIEditorEventListener {
|
||||
|
||||
this.insertMenuAudio = new Audio({ menuType: "button", enable: true, huge: true });
|
||||
this.eventComponents.push(this.insertMenuAudio);
|
||||
|
||||
this.insertMenuHardBreak = new HardBreak({ menuType: "button", enable: true, huge: true });
|
||||
this.eventComponents.push(this.insertMenuHardBreak);
|
||||
|
||||
this.insertMenuEmoji = new Emoji({ menuType: "popup", enable: true, huge: true, hideText: false });
|
||||
this.eventComponents.push(this.insertMenuEmoji);
|
||||
|
||||
this.insertMenuSymbol = new Symbol({ menuType: "popup", enable: true, huge: true, hideText: false });
|
||||
this.eventComponents.push(this.insertMenuSymbol);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -470,5 +485,12 @@ export class Ribbon extends HTMLElement implements UAIEditorEventListener {
|
||||
group1.appendChild(this.insertMenuImage);
|
||||
group1.appendChild(this.insertMenuVideo);
|
||||
group1.appendChild(this.insertMenuAudio);
|
||||
|
||||
const group2 = document.createElement("div");
|
||||
group2.classList.add("uai-ribbon-virtual-group");
|
||||
this.ribbonMenuInsertGroup.appendChild(group2);
|
||||
group2.appendChild(this.insertMenuHardBreak);
|
||||
group2.appendChild(this.insertMenuEmoji);
|
||||
group2.appendChild(this.insertMenuSymbol);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user