From 0e3ed0fea0dd4b1cd79a146f2713788471e93382 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 3 Jul 2023 11:05:11 +0200 Subject: [PATCH] Resolve #1192 --- dev/External/SquireUI.js | 2 ++ plugins/README.md | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/dev/External/SquireUI.js b/dev/External/SquireUI.js index 826e23020..ca38eee92 100644 --- a/dev/External/SquireUI.js +++ b/dev/External/SquireUI.js @@ -289,6 +289,8 @@ class SquireUI this.plain = plain; this.wysiwyg = wysiwyg; + dispatchEvent(new CustomEvent('squire-toolbar', {detail:{squire:this,actions:actions}})); + toolbar.className = 'squire-toolbar btn-toolbar'; let group, action/*, touchTap*/; for (group in actions) { diff --git a/plugins/README.md b/plugins/README.md index 9774ec445..e594453a0 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -440,6 +440,22 @@ and called in JavaScript using rl.pluginRemoteRequest(). event.detail = 'screenname' cancelable using preventDefault() +### squire-toolbar + event.detail = { squire: SquireUI, actions: object } + `actions` is the toolbar structure. + ```javascript + block-of-buttons: { + button-name: { + select: ['selectbox options'], + html: 'button text', + cmd: () => `command to execute`, + key: 'keyboard shortcut', + matches: 'HTML elements that match' + } + } + ``` + See [SquireUI.js](https://github.com/the-djmaze/snappymail/blob/master/dev/External/SquireUI.js) + for all default toolbar actions. # JavaScript `rl` object