Add config menu framework
Options don't do anything as of now, but they are saved and loaded
This commit is contained in:
parent
6bca12c934
commit
fc4ce8e69e
3 changed files with 127 additions and 2 deletions
12
src/index.ts
12
src/index.ts
|
@ -8,15 +8,23 @@ import {
|
|||
} from "@/helper";
|
||||
import {migrate} from "@/migration";
|
||||
import {EditorManager, PluginEditor} from "@/editor";
|
||||
import {PluginConfig, PluginConfigViewer} from "@/config";
|
||||
|
||||
export default class DrawJSPlugin extends Plugin {
|
||||
|
||||
onload() {
|
||||
config: PluginConfig;
|
||||
|
||||
async onload() {
|
||||
|
||||
loadIcons(this);
|
||||
EditorManager.registerTab(this);
|
||||
migrate()
|
||||
|
||||
this.config = new PluginConfig();
|
||||
await this.config.load();
|
||||
let configViewer = new PluginConfigViewer(this.config, this);
|
||||
await configViewer.load();
|
||||
|
||||
this.protyleSlash = [{
|
||||
id: "insert-drawing",
|
||||
filter: ["Insert Drawing", "Add drawing", "whiteboard", "freehand", "graphics", "jsdraw"],
|
||||
|
@ -31,7 +39,7 @@ export default class DrawJSPlugin extends Plugin {
|
|||
|
||||
this.eventBus.on("open-menu-image", (e: any) => {
|
||||
const ids = imgSrcToIDs(findImgSrc(e.detail.element));
|
||||
if(ids === null) return;
|
||||
if (ids === null) return;
|
||||
e.detail.menu.addItem({
|
||||
icon: "iconDraw",
|
||||
label: "Edit with js-draw",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue