Custom textarea buttons
panel.plugin("getkirby/custom-textarea-buttons", {
textareaButtons: {
marquee: {
label: "Marquee",
icon: "wand",
command(input, selection) {
this.command("insert", (input, selection) => {
if (["<marquee>", "</marquee>"].some(tag => selection.includes(tag))) {
return selection.replace(/\<marquee\>|\<\/marquee\>/g, '');
}
return "<marquee>" + selection + "</marquee>";
});
},
shortcut: "m"
}
},
});