Come on people. What the hell? Why can't you create a good editor at once. So much functionality and yet the most critical part of the editor is NOT working!
It's really stupid.
For example. Why i have to do these manipulations to make it working?
Issue 1:
if(editor) { editor.on('instanceReady',function(){ form.submit(submit); }); } else { form.submit(submit); }
Why do i have to wait for instanceReady event and then apply my ajax submit handler? Why can't you apply submit event right away, put there some listener, then when instance is ready, just apply handler to that listener and trigger the listener on submit event?
This way your submit event handler will be the first in the submit handlers stack and will be called first of all. By doing that, MY submit handler will serialize data updated by ckeditor textarea, instead of picking old, unapdated data...
Issue2:
Why on earth sometimes it's not updating hidden textarea? I have to update it manually by doing this:
// Fill textarea with the data, before sending j('.ckeditor').val(editor.getData());
I have checked, your submit handler on the parent form is attached as first handler. Then why on earth it's not filling textarea with new data? I have even inserted ajax call inside 1second timeout and still there wasn't new data in textarea...
Issue3:
WHERE ON EARTH DO I GET UNCOMPRESSED, BUILT(not sliced sources...) ckeditor.js?!
Bah. Come on people. Why can't you just do as intended, test your product and so on. And you call this version 4.0? It's not even 1.0 with such critical bugs. I'm a bit experienced developer and imagine what newbies will do, to make it working...
Bear sercive. Would be better if you created paid editor and without such bugs, instead of free and with them...
Shame on you. Wasted time because of you.
Hi,
Hi,
First of all it would be nice if you could describe your problems more clearly.
Second, are you sure you haven't got to quick with criticism?
Editor enables all commands (command handlers) when it is created. Standard save command is one of them. As for user custom commands you have to do it yourself. There are two events you could use to attach your submit - instanceReady or pluginsLoaded.
The problem I see with your code is that you don't attach any listener but simply add method that is executed when editor is ready.
You should rather use this http://docs.ckeditor.com/#!/api/CKEDITOR.event-method-on.
Your code should probably look something like: If this isn't what you meant please describe exactly what the problem is.
Could you please tell us how were you updating textarea?
Am I correct? Could you please explain how have you downloaded this uncompressed version?
Please also note that compressed doesn’t mean one file. Dialogs code is kept in separate files. This is because we don’t load it at the start but only when user asks for dialog the first time. This lazy load for dialogs helps to save time when editor loads with page for the first time.
Regards,
Jakub Świderski
The problem is in the way you
The problem is in the way you are applying submit handler on the form.
As i understand, the problem is in iframe contents loading. You are waiting for it to finish loading all the content and then applying submit event to the parent form of initial textarea.
This is wrong! Because while you waiting for onload of iframe i'm applying my own submit handler on the form and when the time comes, your submit handler will be second after mine.
That means:
-> submit tirggered -> mySubmitHandler -> serialize_form(form) here is yet, not updated texarea -> ajax -> yourSubmitHandler -> etc.
Easy fix would be if you apply submit event before creating iframe.
For example like this:
This way your submit handler will be first and textarea contents will be updated before my form serialization and ajax call. This fixed both 1 and 2 questions.
I have downloaded compressed editor.js with usual bundle, i wan't using any constructors. I just wanted to fix your code on my own, but could not find uncompressed editor.js. Ofc i could use some kind of js beautifiers, to make it readable, but that's another story...
Btw why i can't open any
Btw why i can't open any issue on your github page? Have you disabled that option there? https://github.com/ckeditor/ckeditor-dev
Could you add what i have suggested into the next version?
Pull requests aren't disabled
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
I didn't like user first post
I didn't like user first post but I'm writing this so that others could know if they get similar problem.
This should be done after editor is created (on instanceReady event). Some might say this is to late because use user might press enter or click submit till that time. Currently editor doesn't provide any hooks to attach custom submits as early as possible or to override editor classic submit. Simple workaround might be blocking Enter key and hiding submit button until custom submit isn't attached.
If anyone sees any other workaround for issue one please write.