Arantor:
Well done, you repeated yourself, I already realised that after your last post.

Since there's a button for it, call the same code the button uses.

I'm sorry I bothered replying to this topic.

SoLoGHoST:
It's a prototype, so you can't access the functions directly! Anyways, here's code taken out of DreamPages.template.php for you to see how I did it. If val does not equal 2, than it disables the WYSIWYG Toggle View. You place a call to the check_bbc function on the onchange event of a Radio Button, or whatever for that matter...

And $context['page_content'] represents the $editorOptions['id'] value. For example, when you build the editor:

--- Quote ---It's a prototype, so you can't access the functions directly!--- End quote ---

Yes, I know that. But it's JS's equivalent of a class and it is instantiated into oEditorHandle_message (or whatever you've called it), whose properties and methods you CAN access because it's an object instance (hence the o prefix)

And you actually are doing that, except doing it the long way by extending the object with new methods and calling them yourself...

SoLoGHoST:
True True, if there is an easier way to do the same thing, I'm all for it. I just took a look at the prototype and came up with my own workaround for this.

Arantor:
There is, it's called calling the object's toggleView method - the same thing that the Toggle View button calls. And you can even determine its current state by examining the object instance's bRichTextEnabled properly, as I already said.

Then again, you told me on multiple occasions I don't know what I'm talking about, so I don't really know why you'd listen to me about this.