Is it possible to launch a new dialog from a custom mark. I have created a custom mark plugin, that launches the link existing dialog, but I need a dialog where you can only pick from one page. I can’t find any example or docs for this, but think it might be possible with V4?
This is what I have so far:
window.panel.plugin("oc/terms", {
writerMarks: {
terms: {
get button() {
return {
icon: "book",
};
},
commands() {
return () => {
this.editor.emit("link", this.editor);
this.toggle();
};
},
get name() {
return "terms";
},
get schema() {
return {
parseDOM: [{ tag: "u" }],
toDOM: () => ["u", { class: "highlight" }, 0],
};
},
},
},
});
2 Likes
Moucky
February 14, 2024, 3:00am
2
I’m also interested in doing something similar, does anyone know if it’s possible to create custom dialogs?
1 Like
Any hints or directions for this issue?
1 Like
Interested in doing something similar. Did any of you found a solution for this?
BeAn
September 12, 2024, 12:00pm
5
I am trying to do a similar thing:
In order to create inline Buttons in a writer field I want to add a custom mark. The goal for me is to have a mark wich adds a span element with a class around the selected text. Following the Docs this works fine.
The problem is that I need two different Marks (Filter A / Filter B). If I create two custom marks wich both create a span (with different classes), all marked text ends up being the first mark in the plugin. I guess this has to do with the priority
definition of the parseDOM
(Discussed here: Classes added by Custom Nodes are stripped out of the Writer field when refreshing the page/ProseMirror re-rendering the Writer · Issue #6587 · getkirby/kirby · GitHub ).
So my idea for a solution is to create a custom mark wich creates a span but let me select a class name in a Popup. Similar to the link mark.
I found a similar topic but so far without a solution: Custom marks with pop-up
Any hints wich part of the custom mark creates the popup, any directions? I am quite new to custom marks.