I am expanding LMS with a cloud site using javascript. Thus, we can add javascript to the page, but we cannot change the javascript of the provider for different components.
LMS often uses tinyMCE. The goal is to add a new button to the toolbar of each tinyMCE editor.
The problem is that since tinyMCE modules are initialized in the vendor's untouchable code, we cannot change the init () call. Therefore, we cannot add text to the "toolbar" property of the init () object.
So, I did it in a moderately hacked way:
tinyMCE.on('AddEditor', function(e){ e.editor.on('init', function(){ tinyMCE.ui.Factory.create({ type: 'button', icon: 'icon' }).on('click', function(){
So this works, but, of course, itβs not very convenient for me to look for such a specific place in the DOM to insert this button. Although this works, I donβt think it was the creatorβs intention to use it that way.
Is there a way to add a button to the toolbar after initialization if we cannot change the initialization code?
source share