I’m following the documentation from froala to integrate a custom popup in the Kentico (latest hotfix) Froala editor. In order to do it the kentico way, I’m doing it like this but I don’t know how to get the editor param as per the Froala example:
I’ve removed most of the code for brevity. It’s not the FroalaEditor
param or the richTextEditor
object
(function (pageBuilder) {
var richTextEditor = pageBuilder.richTextEditor = pageBuilder.richTextEditor || {};
// Retrieves the collection of plugins
var plugins = richTextEditor.plugins = richTextEditor.plugins || [];
// Creates a new Sample Button
var myButtonPlugin = function (FroalaEditor) {
// Create custom popup.
function initPopup() {
// Load popup template.
var template = FroalaEditor.POPUP_TEMPLATES.customPopup;
if (typeof template == 'function') template = template.apply(editor);
// Popup buttons.
var popup_buttons = '';
//this is the first instance of where I need the editor object
if (editor.opts.popupButtons.length > 1) {
popup_buttons += '<div class="fr-buttons">';
popup_buttons += editor.button.buildList(editor.opts.popupButtons);
popup_buttons += '</div>';
}
});
};
// Adds the plugin to the collection
plugins.push(myButtonPlugin);
})(window.kentico.pageBuilder);
Am I calling it wrong?