I am using an inline editor and most everything works as it should. When I click into some code where a script tag has been placed the editor adds the cke_protected code. When I want to save I need it to not save with the cke_protected, but I want to save the same way it looks in source view. Right before save, I destroy the inline editors and then grab the content using something like $("#mycontent").html(). Is there a way to have ckeditor remove the protected jargon before I try to save. I have been spending hours on this trying to manually remove everything using the DOM and regex, but I am just making a mess. I know there must be some way to get the source without that stuff or the source view would be showing it as well.
Thanks in advance!
additional information
I guess what I am looking for is instead of grabbing the content from the inline div, is there a way I can call the same thing that gets called when you click to view source, because that does not display any of the cke_protected code in it.
I need to know how to do it by blurring out of the wysiwyg or right before I do a destroy on the element...
To get content of editor you
To get content of editor you need to use editor.getData() method. The editor instance is returned by CKEDITOR.replace/inline methods or you can find it in the CKEDITOR.instances object.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
That was it!
I have a content area which is drag and drop as well as a button to turn the wysiwyg on/off at any time. The solution was right before grabbing the HTML content from the content area, I checked if the editor was enabled, if not, create the instance, then do getData and save to a variable, destroy the instance and replace the content area with the data stored in the variable, then grab it out with $("#mycontent").html() as the data to save to the database. May seem like a crazy work around but it was only a few lines of JS to make it happen. Thanks for your direction!
Probably do not need to loop over instances, but at one point I had multiple inline instances and may go back to that.
That's indeed a very crazy
That's indeed a very crazy code ;). I don't understand why you need it, but I'm glad that you solved the problem :).
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+