In my tinymce initialization, I use my predefined styles
style_formats : [
{title : 'Date', inline : 'span', classes : 'date'},
{title : 'Trend UP', inline : 'span', classes : 'trend_up'},
{title : 'Trend DOWN', inline : 'span', classes : 'trend_down'},
{title : 'Trend NO', inline : 'span', classes : 'trend_no'}
]
This style prefix wraps the selected content in a span tag and adds a specific class to it;
But now I need to add shortcuts (hot keys) that will provide the same functionality
for this purpose I created a plugin where my hot keys will be defined
(function(){
tinymce.create('tinymce.plugins.MyShortcuts', {
init : function(ed, url) {
ed.addShortcut('ctrl+e','Format Blockquote', ['FormatBlock', false, 'blockquote'], this);
}
});
tinymce.PluginManager.add('my_shortcuts', tinymce.plugins.MyShortcuts);
})();
And it works great for blockquote. But I did not find any useful information for me in the tinymce documentation for creating shortcuts for my custom styles .
Can someone help me in implementing this feature? I tried to do
ed.addShortcut('ctrl+e','Format Trend UP', ['FormatBlock', false, 'Trend UP'], this);
and
ed.addShortcut('ctrl+e','Format Trend UP', ['StylesBlock', false, 'Trend UP'], this);
but that will not work.