I'm having difficulty disabling certain CKEditor buttons. Basically, I'd like to loop through all of the loaded commands and disable them at runtime so that they are represented as greyed out buttons. Here is my code for doing this:
for (var key in CKEDITOR.instances.editor1.commands) {
if (CKEDITOR.instances.editor1.commands.hasOwnProperty(key)) {
console.log("disabling command " + key);
CKEDITOR.instances.editor1.commands[key].disable();
}
}
My CKEditor setup uses the Image, Background Colour, Bold, Italic, Underline, Insert/Remove Bulleted List, Copy and Paste plugins. However, the only button that is actually disabled via this method is the Image button; the others remain enabled, even though I see no errors and my console.log is firing for each of them.
Any advice would be greatly appreciated.