I'm currently using TinyMCE and would like to add a custom button that works as follows:
Any ideas on if this can be done? I've figured out how to make a custom button inject text, but not wrap text... Here is the current code:
// Add a custom button
ed.addButton('mybutton', {
title : 'My button',
'class' : 'MyCoolBtn',
image : 'MyCoolBtn.png',
onclick : function() {
// Add you own code to execute something on click
ed.focus();
ed.selection.setContent('<strong>Hello world!</strong>');
}
});
thanks!
ed.addButton('mybutton', {
title: 'My button',
class: 'MyCoolBtn',
image: 'MyCoolBtn.png',
onclick: function() {
// Add your own code to execute something on click
ed.focus();
ed.selection.setContent('<tag>' + ed.selection.getContent() + '</tag>');
}
});