I have a third party Bootstrap plugin (probably EOL), which added buttons to the toolbar, which in turn opened a dialog from where I could select Bootstrap elements to add to the content.
It used 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 that Factory is undefined or that create is a non-existing function. What can I use to make this work, to show the buttons as well as showing the dialog on click? I already updated the following code to view bsItems:
editor.ui.registry.addButton('bootstrap', {
type: 'buttongroup',
classes: 'bs-btn',
items: bsItems
});
And 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()
All to no avail