Forum closed. New forum available at http://community.wymeditor.org/

Iframes and not contentEditable - why?

Discuss features, code, contributions, ideas, suggestions, ...
For bugs, patches and feature requests, please post on the Trac:
http://trac.wymeditor.org/

Iframes and not contentEditable - why?

Postby alias-knagg on Thu Dec 18, 2008 10:17 am

Hi
I have been looking into wysiwyg editors lately, to replace the ageing IE-only editor in our CMS system.

But, what puzzles me is why everybody are still using iframes when contenteditable is supposed to work cross-browser now?
I guess we might have slightly different requirements that most, in that we have relatively few users so we can require them to use an up to date browser, and that we want to edit multiple fields from one toolbar on top of the page, but still..

Our old editor uses contenteditable on divs and spans, and as far as I can understand, that makes working with existing page styles, and reflowing of text so much easier. We have tweaked the old editor to work with FF for now, but the codebase is just a horror, so we would really like to start afresh from some editor with a bit of momentum and community behind it, and preferably one built on a well known library such as jquery.

The strange thing is that it seems that every editor I have looked at just assumes that textareas and iframes are the only way to go, but I have not been able to find out why...
alias-knagg
 
Posts: 3
Joined: Tue Dec 16, 2008 1:25 pm

Re: Iframes and not contentEditable - why?

Postby jfh on Tue Jan 06, 2009 8:29 pm

FYI, I've made some tests last month with contentEditable in the 4 major browsers, and the results were pretty good, so I'm planning a more thorough testing while starting 0.6 development. Hopefully it'll help to sanitize the code and will provide more WYSIWYM capabilities.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Re: Iframes and not contentEditable - why?

Postby alias-knagg on Wed Jan 07, 2009 7:52 am

That sounds good :)
If you haven't already, may I suggest you take a look at the source of wysihat:
http://www.37signals.com/svn/posts/1330 ... wyg-editor
Source: http://github.com/37signals/wysihat/tree/master
Example: http://qhoxie.com/wysihat/
Not that I have anything like a complete understanding of that code, or all the problems involved, but it looks to me like he has built a quite nice abstraction around the Iframe/ contentEditable choice. Major problem: _no_ momentum.

Personally I would be extra happy if the editable element where loosely enough coupled to the toolbar, not to hinder the scenario with several editable fields, but one toolbar. But I already said that :)
alias-knagg
 
Posts: 3
Joined: Tue Dec 16, 2008 1:25 pm

Re: Iframes and not contentEditable - why?

Postby Cattus on Mon Mar 23, 2009 6:50 pm

Without iframes wouldn't it be very hard (if not impossible) to use another Doctype than the one of the document the editor resides in? Another problem would be using custom style sheets for the editable content, not impossible though, just kind of tedious. I guess those two are among the reasons for not switching.
Cattus
 
Posts: 3
Joined: Mon Mar 16, 2009 7:11 pm

Re: Iframes and not contentEditable - why?

Postby alias-knagg on Mon Jun 29, 2009 4:28 pm

I think you misunderstand our usage.
The editor lives in it's own page with while the page to be edited in a large iframe underneath.

The edited page can have whatever content type and css it wants without affecting the editor.

Then you understand why we would rather not have all the editable fields be iframes as well.
alias-knagg
 
Posts: 3
Joined: Tue Dec 16, 2008 1:25 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest