X-editable: In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
vitalets.github.com
vitalets.github.com
The web is in dire need of a library correctly reimplementing "form behaviors" (events, mostly) on top of contenteditable, and allowing those behaviors to be applied to arbitrary (to the extent that browser implementations allow) elements on the fly.
edit: just in case, don't take me wrong, HTML forms should stay and I'm an advocate of less javascript everywhere as it tends to be mandated in places where it has no reason to be (and to ultimately decrease usability rather than enhance it), but if you're going to do "edit in place" and rich web applications which require javascript to run — and using the library linked above would probably qualify as you can't do anything without JS enabled and a fairly recent browser running it. And in those cases, HTML form elements tend to be a hindrance more than a help.
OT: Am I the only one annoyed by this "viewed best in Chrome" trend? Reminds me of those old "Best in IE" badges.
There was a jquery fundamentals website that had the same problem. To compound matters, Chrome font rendering is godawfully bad on my machine.
Did you miss the part where I said I wasn't talking about RTE?
I don't care that it's implemented using something which was introduced to build RTEs in the first place and has been used for exactly that for the past 12 years or so (which does happen to make contenteditable-based RTEs traditional, as are designMode-based ones, despite your apparent assertion to the contrary), my original comment is not about rich text edition.
For example, if you cut&paste formatted text into a contenteditable, it will keep the formatting [1]. Then you have to intercept the paste event and sanitize the text. Also, the selection model is a mess and slightly incompatible among browsers (although this might be fixed in modern browsers, I haven't looked into it for a while).
What are the benefits of contenteditable that justify to go into all this trouble?
[1] http://stackoverflow.com/questions/3306205/how-to-avoid-webk...
contenteditable is meant for editing content, what kind of content you edit with it is up to you.
> What are the benefits of contenteditable that justify to go into all this trouble?
Coherent and simple styling and integration, avoidance of reflow (especially when toggling between editable and non-editable)
Also, forms go far beyond text input. Are you seriously suggesting that dropdown menus, multi-select boxes, sliders, radio buttons, datepickers, etc. should all be reimplemented on top of a rich text element?
I think this is because of performance. form elements are rendered differently and actions mostly result in a limited repaint and a couple events fired. contenteditable DOM elements are a lot more work to update.
Android Gingerbread devices do not support it, and they are still the largest percentage of Android devices accessing Google Play: http://developer.android.com/about/dashboards/index.html
So it seems that a user agent detection and fallback for Android < 3.0 devices is still a great necessity, and it is difficult to say just how many other devices fall into this category.
This next link is the most comprehensive list of support I could find, and although the support does seem widespread at this point, there are probably still too many user agent unknowns for someone wanting to make a mobile friendly library around the feature: http://caniuse.com/#feat=contenteditable
You're creating new behavior which is counter to how we all understand links. Underlined words take us to other places. And dashed words unfortunately have the stigma of opening up some crappy add referencing the word.
Consider instead a little edit carrot next to the word and clicking anywhere in the cell makes it editable.
If a site uses solid underlines for its links, that frees it up to use dashed for these inlines IMO.
But not for doing editing where you need to change many or most of the fields.
Take the example of a table of employee information where you have the standard edit/delete/view buttons on each row and you notice a typo in one row. To me it's a better user flow to just edit that one field inline than have to pull up the whole form through a modal or page load. Both for speed (in the case of the page load) and forcing the user to re-locate the field they wanted to change.
For one thing, I can see where having this in the toolbox might enable one to bang out a fast admin-type view quickly--and sometimes being able to implement some relatively "utilitarian" view quickly is what lets you spend the proper amount of time on views that you want to implement more traditionally/fancily.
The use of "links" to launch the little dialogs doesn't personally bother me for whatever reason. (Though I get that sometimes it's just preference--for instance I have always disliked the use of drop-downs as navigation controls, but re-purposing the link element as shown in these x-editable demos doesn't--not sure I can defend why).
It happens on my school's network, jquery.com is painfully slow...