You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/7.6.0-release-notes.adoc
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -267,6 +267,32 @@ tinymce.init({
267
267
=== New `QuickbarInsertImage` command that is executed by the `quickimage` button.
268
268
// #TINY-11399
269
269
270
+
The **Quickbars** Plugin now allows integrators to overwrite the `+QuickbarInsertImage+` command, enabling customization of the quickimage button's behavior.
271
+
272
+
.Example of how to override the `+QuickbarInsertImage+` command:
273
+
[source,js]
274
+
----
275
+
tinymce.init({
276
+
selector: 'textarea',
277
+
plugins: 'quickbars',
278
+
toolbar: false,
279
+
setup: (editor) => {
280
+
editor.addCommand('QuickbarInsertImage', () => { // Add a custom command to the editor named "QuickbarInsertImage"
281
+
const input = document.createElement('input'); // Create a new <input> element for file selection
282
+
input.type = 'file'; // Set the input type to "file" for uploading files
283
+
input.accept = 'image/*'; // Restrict the input to accept only image files
284
+
input.onchange = (e) => { // Add an event listener to handle the file selection event
285
+
const file = (e.target as HTMLInputElement).files?.[0]; // Get the selected file from the input element
0 commit comments