Disclaimer: This in a quite ugly hack ... but its working ...

It is actually quite easy to enable inline editing in Hobo using 
Clickeditor, which is awesome. 
It is also possible to use Ckeditor in Hobo, which is awesome as well.

There is even some integration between the two, so clicking on a 
cktext-attribute unhides the already embedded CkEditor. But unfortunately, 
you can't save, there isn't even a save button.

I first thought config.extraPlugins = 'save'; in the CkEditor fixes this. 
Background info: The save plugin is disabled in current CkEditor gem for 
Rails, and this enables it. But this only helps on the edit view, where the 
save icon is displayed and active. It doesn't work in the show view. The 
reason is, that the plugin searches for an surrounding form which isn't 
available from Clickeditor, so it disables itself and it's grayed out.

So I use some JQuery magic to wait for focus loss on CkEditor and trigger 
the submission then. As the user can switch between editing and displaying 
several times, the registering of the event handler has to be done 
repeatedly. I have chosen to do this on any click (counting the ckeditor 
instances didn't work for me somehow...) which is way too much, but it does 
not cause much performance loss. 

Code example how I use this is in the 
Gist<https://gist.github.com/haslinger/7838039>
. Pull requsts (on the Gist) improving that part are highly appreciated. 
Meanwhile have fun using "Live-Ck-Click-Editor" in Hobo.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to