How to migrate custom buttons and dialogs to TinyMCE 5


Gypsy

I have a 3rd party Bootstrap plugin (probably EOL) that adds buttons to the toolbar which in turn open a dialog where Bootstrap elements can be selected to add to the content.

It uses the following code:

var insertBtn = tinymce.ui.Factory.create({
    type: elType,
    classes: elClass,
    text: bsText['button'],
    icon: 'icon-btn',
    name: 'insertBtnBtn',
    tooltip: bsTip['button'],
    onclick: function() {
        showDialog('bootstrap-btn.php', 'Add button', 580, 'bsBtn');
    }
});
bsItems.push(insertBtn);

But it says Factory is undefined, or create is a function that doesn't exist. What can I use to make this work, showing the button as well as the dialog when clicked? I have updated the following code to view bsItems:

editor.ui.registry.addButton('bootstrap', {
    type: 'buttongroup',
    classes: 'bs-btn',
    items: bsItems
});

I tried several other possibilities to find the create function:

editor.ui.registry.create()
editor.ui.Factory.create()
editor.ui.create()
tinymce.ui.registry.create()
tinymce.ui.Factory.create()
tinymce.ui.create()

to no avail

little lincoln

In version 5, TinyMCE uses a new UI framework. Third-party plugins that provide custom UI control elements written for version 4.x may not work with version 5.

As mentioned in this GitHub issue thread , tinymce.ui.Factoryit is deprecated and will not be reimplemented, so it is no longer possible to create a control factory.

The method of adding UI elements such as buttons has also been changed from v4 to v5. The official migration guide goes into a fair amount of detail about the new location and configuration signatures for these methods.

tl;dr This particular plugin may not work with v5's new UI framework, but there are still ways to customize the UI with the new system.

Related


How to migrate custom buttons and dialogs to TinyMCE 5

Gypsy I have a 3rd party Bootstrap plugin (probably EOL) that adds buttons to the toolbar which in turn open a dialog where Bootstrap elements can be selected to add to the content. It uses the following code: var insertBtn = tinymce.ui.Factory.create({ ty

Summernote custom dialogs and buttons

Penguin I try to implement Summertnote editor. Here is the JS code: $(document).ready(function() { //Summernote //var te_markdown = document.getElementById("code-markdown");. var textarea = document.getElementById("code"); var HelloButton = function (context)

Buttons in custom dialogs | Android

Paramount After I click the "SMS" button, I get a popup dialog. The SMS button only works if the length of the text field is greater than 0. (non empty...) This is how the "SMS" button calls onClick. private void smsPopUp() { // TODO Auto-generated met

Buttons in custom dialogs | Android

Paramount After I click the "SMS" button, I get a popup dialog. The SMS button only works if the length of the text field is greater than 0. (non empty...) This is how the "SMS" button calls onClick. private void smsPopUp() { // TODO Auto-generated met

How to show all toolbar buttons in Tinymce 5?

sunil20000 I recently migrated from tinymce 4.8.1 to 5.3.1 community version. After making some changes everything looks fine except for one thing and clicking the "More" button. It only shows one row of toolbar buttons, to see the rest I have to click the MOR

How to show all toolbar buttons in Tinymce 5?

sunil20000 I recently migrated from tinymce 4.8.1 to 5.3.1 community version. After making some changes everything looks fine except for one thing and clicking the "More" button. It only shows one row of toolbar buttons, to see the rest I have to click the MOR

How to show all toolbar buttons in Tinymce 5?

sunil20000 I recently migrated from tinymce 4.8.1 to 5.3.1 community version. After making some changes everything looks fine except for one thing and clicking the "More" button. It only shows one row of toolbar buttons, to see the rest I have to click the MOR

How to show all toolbar buttons in Tinymce 5?

sunil20000 I recently migrated from tinymce 4.8.1 to 5.3.1 community version. After making some changes everything looks fine except for one thing and clicking the "More" button. It only shows one row of toolbar buttons, to see the rest I have to click the MOR

How to show all toolbar buttons in Tinymce 5?

sunil20000 I recently migrated from tinymce 4.8.1 to 5.3.1 community version. After making some changes everything looks fine except for one thing and clicking the "More" button. It only shows one row of toolbar buttons, to see the rest I have to click the MOR

How to show all toolbar buttons in Tinymce 5?

sunil20000 I recently migrated from tinymce 4.8.1 to 5.3.1 community version. After making some changes everything looks fine except for one thing and clicking the "More" button. It only shows one row of toolbar buttons, to see the rest I have to click the MOR

How to separate polymer buttons and dialogs

Chris Pepper 1989 In the polymer dialog demo they have code like this: <script src= https://github.com/webcomponents/webcomponentsjs/blob/master/webcomponents.js> <link rel="import" href="https://github.com/Polymer/polymer/blob/master/polymer.html"> <link re

How to Add Custom Shortcode Buttons in TinyMCE Editor WordPress

Harun R Rayhan Hi, I am using the latest version of WordPress. I want to add my shortcode in TinyMCE editor like this image : http://prntscr.com/72ycrs My shortcode is: [my_tabs] [my_tab title = "Tab One Title"]Tab One Content Goes Here[/my_tab] [my_tab title

How to Add Custom Shortcode Buttons in TinyMCE Editor WordPress

Harun R Rayhan Hi, I am using the latest version of WordPress. I want to add my shortcode in TinyMCE editor like this image : http://prntscr.com/72ycrs My shortcode is: [my_tabs] [my_tab title = "Tab One Title"]Tab One Content Goes Here[/my_tab] [my_tab title

How to Add Custom Shortcode Buttons in TinyMCE Editor WordPress

Harun R Rayhan Hi, I am using the latest version of WordPress. I want to add my shortcode in TinyMCE editor with an image like this : http://prntscr.com/72ycrs My shortcode is: [my_tabs] [my_tab title = "Tab One Title"]Tab One Content Goes Here[/my_tab] [my_ta

How to Add Custom Shortcode Buttons in TinyMCE Editor WordPress

Harun R Rayhan Hi, I am using the latest version of WordPress. I want to add my shortcode in TinyMCE editor with an image like this : http://prntscr.com/72ycrs My shortcode is: [my_tabs] [my_tab title = "Tab One Title"]Tab One Content Goes Here[/my_tab] [my_ta

Add Custom Buttons to TinyMCE in WordPress

John Smith I want to add a new button with a popup to TinyMCE. But I never see the button. I may be doing something wrong with this modification. How can I insert a new button on that TinyMCE code? I have this TinyMCE code to display in Wordpress frontend:

How to make better custom dialogs?

Zoe I am creating a game and I use a lot of dialogs in it. Dialogs make up the main menu with simpler settings, and then make up the entire activity for it. The dialogs, although they have a grey outline, are really annoying, and when going from one dialog to

How to combine slash commands, buttons and dialogs for menus?

Eric Calcoken My Slack app starts with a slash command and then posts a temporary menu message to the user. The menu has some information and three message buttons. example: The first button allows the user to close the menu The second button allows the user t

Is it possible to add classes to custom tinyMCE buttons?

Pym Action I have a web page in which I am using jQuery UI with tinyMCE. I've added a custom button for the purpose of dragging a draggable textfield with this button: Code: editor.addButton('drag', { text: 'Drag', icon: false,

Is it possible to add classes to custom tinyMCE buttons?

Pym Action I have a web page in which I am using jQuery UI with tinyMCE. I've added a custom button for the purpose of dragging a draggable textfield with this button: Code: editor.addButton('drag', { text: 'Drag', icon: false,

How to create custom expandable dialogs with ControlsFX

Anton Antonov I want to create the same dialog that I create when using Dialogs.showException(), but instead of showing the stacktrace, I want to show my custom preformatted text. The functionality I want is the "details" button behavior. What I want is: But n

How to create custom expandable dialogs with ControlsFX

Anton Antonov I want to create the same dialog that I create when using Dialogs.showException(), but instead of showing the stacktrace, I want to show my custom preformatted text. The functionality I want is the "details" button behavior. What I want is: But n

Custom html5 audio tag, how to add volume buttons?

No I'm just creating a directive to set up live streaming based on HTML5 tags, but I need to add a volume button, how to achieve it? see instructions var app = angular.module('app', []); app.directive('audioPlay', function() { return { restrict: 'E',

Custom html5 audio tag, how to add volume buttons?

No I'm just creating a directive to set up live streaming based on HTML5 tags, but I need to add a volume button, how to achieve it? see instructions var app = angular.module('app', []); app.directive('audioPlay', function() { return { restrict: 'E',

Separate taskbar buttons for dialogs

vitality I am supporting a WinAPI/ATL based application with many dialog windows created based on user actions. Most dialogs are unowned windows. If multiple dialogs are created at the same time, their taskbar buttons will be grouped together on the taskbar (d

How to add custom block in tinyMce

Tariq Hussein I want to add a custom format block for TinyMCE, I was able to do it using the following code. style_formats: [ {title : 'Code', block : 'pre', classes : 'pre-code', exact: true},] https://codepen.io/anon/pen/vWRGEg However, by adding this code,