The TextColor plugin no longer fires the execCommand event, because since it is a commit , it directly uses the Formatter framework . So you cannot get your old event.
However, you can use formatChanged for formatting to provide a callback:
tinymce.activeEditor.formatter.formatChanged('forecolor', function (isNew, args) { if (isNew) console.log("new color", args.node.style.color); }, true)
JSFiddle demo.
But it also works, even if you just select text that is already colored ... so sad this is not a good alternative.
Of course, formatter.apply can be cleared by the monkey to fire the old execCommand event:
var oldApply = tinymce.activeEditor.formatter.apply; tinymce.activeEditor.formatter.apply = function apply(name, vars, node) { oldApply(name, vars, node); tinymce.activeEditor.fire('ExecCommand', {name: name, vars: vars}); }
JSFiddle demo.
But it is impossible to do this on a global scale and repeat for each instance of the tinymce editor so that it is again not the best solution ...
nemesv
source share