80beans / wysihat-engine

A Rails engine to help integrate the 37signals WysiHat rich text editor to your application.
http://www.80beans.com/2009/10/01/wysihat-engine/
MIT License
167 stars 16 forks source link

contentEditable on DIV instead of IFRAME #8

Closed brendon closed 14 years ago

brendon commented 14 years ago

Hi there, first of all, great work! It's cool to see the progress in this area. I think Wysihat is going to turn into a really solid platform for a new generation of rich text editors.

One vision I have for my customers is allowing them to edit their pages within their templates. This requires just setting the editable area (usually a DIV) to be contentEditable = true. Since Firefox 2 is old now, this shouldn't be too much of a problem as that was the only browser that didn't conform to only allowing that DIV being editable. This is far more ideal than having a detached IFRAME in an 'admin area' where the user can't see their page as it will appear in its final context.

It turns out that Wysihat was designed for this option. It's very undocumented but you can change the options to set the elements to editable rather than turn it into an IFRAME.

I was just wondering if the modifications you're making to this fork are keeping this in mind? I did a quick browse of the paste code that was recently committed and I see you're addressing the iframe there directly. Maybe you could shed some light on this.

Last time I checked, the contentEditable functionality didn't actually work, but hopefully in the future it'll be fixed up :) I've got a bit more time these days so I will delve in and see if I can't get it working at least a little bit :)

I hope I was clear enough in my explanation, but please let me know if I need to elaborate more :D

Looking forward to hearing your thoughts.

Brendon

jeffkreeftmeijer commented 14 years ago

Hi Brandon,

Thank you so much for the thorough explanation of your issue. Let me start by saying that WysiHat Engine is not a fork of WysiHat itself, it's just a quick and easy way to get WysiHat running in your rails app. This means we're not tyring to implement every feature what WysiHat can do (even if they're awesome, like your idea), we're just trying to make it easier to get started with WysiHat in Rails.

If you can find an elegant solution to fix your problem using WysiHat Engine, please commit it and send me a pull request. I'd be happy to check it out.

Otherwise, I would advice you to use WysiHat without the engine, you'll have to build some stuff yourself but at least you won't be limited by the engines capabilities. :)

Thanks again,

brendon commented 14 years ago

Thanks Jeff :) That makes a lot of sense. I'll probably go down that road and see if I can patch wysihat to make it work in that mode again. :)

Cheers,

Brendon

brendon commented 14 years ago

C