I had a question about disabling commands, and I thought this was the right place to ask it. In short, 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 the JS I'm using for 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.
I am using it in codeigniter.
I am using it in codeigniter. In the view file I am using it like this:
<script type="text/javascript">
$(document).ready(function() {
CKEDITOR.config.readOnly = true;
});
</script>