-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* DOC-2578: Add Labels and Groups for Context Toolbar Buttons. * Update antora.yml
- Loading branch information
1 parent
5a98843
commit 50e87a4
Showing
4 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
modules/ROOT/examples/live-demos/context-toolbar-labels/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<textarea id="context-toolbar-labels"> | ||
<p>Clicking on the example image below will show the newly configured context toolbar.</p> | ||
|
||
{{logofordemoshtml}} | ||
|
||
<p>Select a word in this sentence, to see the other newly configured context toolbar.</p> | ||
|
||
<p>Clicking on text should not invoke the context toolbar</p> | ||
</textarea> |
34 changes: 34 additions & 0 deletions
34
modules/ROOT/examples/live-demos/context-toolbar-labels/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
tinymce.init({ | ||
selector: 'textarea#context-toolbar-labels', | ||
height: 350, | ||
setup: (editor) => { | ||
editor.ui.registry.addContextToolbar('imagealignment', { | ||
predicate: (node) => node.nodeName.toLowerCase() === 'img', | ||
position: 'node', | ||
scope: 'node', | ||
items: [ | ||
{ | ||
name: 'Formatting', | ||
items: ['alignleft', 'aligncenter', 'alignright'] | ||
}, | ||
{ | ||
label: 'Copy', | ||
items: ['copy', 'paste'] | ||
} | ||
], | ||
}); | ||
|
||
editor.ui.registry.addContextToolbar('textselection', { | ||
predicate: (node) => !editor.selection.isCollapsed(), | ||
position: 'selection', | ||
scope: 'node', | ||
items: [ | ||
{ | ||
name: 'Format', | ||
items: ['bold', 'italic', 'underline'] | ||
}, | ||
], | ||
}); | ||
}, | ||
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters