I actually went with defining the plugin & using the callback to call it; this allows for multiple functions/plugins to be called from the callback and also feels like the intended approach.
Plugin:
RedactorPlugins.advanced = {
your_method: function() {
// Add code here…
}
}
your_method()
is now available on the redactor object & simply callable through the below:
Redactor call:
$('#redactor').redactor({
keydownCallback: function() {
this.your_method();
// Additional keyDownCallbacks:
this.another_method();
this.yet_another_method();
}
});
Original answer:
I know it’s late but came across this my self this evening.
This worked for me:
RedactorPlugins.advanced = {
init: function() {
this.opts.keydownCallback = function(e) {
// Add code here…
}
}
}
It simply calls the options and adds the keyDownCallback
. The only trouble is it can only be added by one plugin (as the last on called always overwrites the previous).