

Intro to Google's open source JavaScript rich text / HTML editor - rwalker
http://closuretools.blogspot.com/2010/07/introducing-closure-library-editor.html

======
swilliams
It requires literally dozens of .js files to get it working... Is there a
bundled and minified version of this in a single file?

I'm very much interested in a basic rich-text editor that is either uses
jQuery or is just framework independent. I've liked 37signals's wysihat, but
it uses Prototype. I'm sort of working on porting it to jQuery, but that takes
time.

~~~
rwalker
It (like the rest of the Closure Library) is designed to be used with the
Closure Compiler:

<http://code.google.com/closure/compiler/>

The general philosophy is: for development, loading lots of files is ok and in
some cases easier to debug. For production, the compiler will often strip out
much more code than just minification would.

~~~
swilliams
I saw that, and agree with that philosophy, but does the compiler also pull in
all the extra files too? I didn't see it spelled out... I'm guessing yes, so
I'll play around with it later tonight.

~~~
rwalker
I'm not sure exactly what files get pulled in by the compiler, but it will
remove any dead code (meaning 100% of any extra files) and output a single
minimized file.

------
jmcnevin
How does this differ significantly from something like TinyMCE? From what I
can tell, it's still using contenteditable.

I'd be interested in seeing an open implementation of the editor Google is now
using with Google Docs, where they completely avoid using contenteditable.

------
kamme
It's unbelievable how broken online RTE's are. I'm building websites for quite
some time now and I never figured out why browser makers are neglecting such a
basic feature, it should not be that hard to implement a basic RTE.

It's nice to see Google is trying to do something about it and making it
easier to implement an RTE with projects like this, but it would be nicer if
they would push other browser builders to standardise.

~~~
fretlessjazz
A big problem is that contentEditable has never been part of an official spec
until now (HTML5). My fingers are crossed that we'll see some improvements
over the next few years.

------
urza
Hello, I have a question.

Does anybody know about javascript rich text / HTML editor, that could easily
show small popup under carret (or certain word) while the user is typing? I
mean something like the spell-checker in this google wave demonstration - see
at 0:44:40 <http://www.youtube.com/watch?v=v_UyVmITiYQ> Or lets say, you want
to implement something like this <http://doc.trolltech.com/4.6/tools-
customcompleter.html> but in web browser. How would you go about it?

------
maqr
This is the first time I've heard about the "Closure Library".

Do you think this is what the new m.youtube.com HTML5 site is built in? Is
Closure a replacement for GWT?

~~~
enomar
It is not a replacement for GWT. Closure is for people that want to write
Javascript. GWT is for people that want to write Java.

~~~
maqr
It looks like there's a "Library", "Compiler", and "Templates". The Library
looks like a Javascript library, the Compiler looks like a Javascript
optimizer, and the Templates look like the GWT-ish thing that builds HTML from
Java (or Javascript?).

source: <http://code.google.com/closure/>

~~~
pjscott
Closure Library: a JS library containing a bunch of useful stuff.

Closure Compiler: A compiler that takes Javascript as input and produces
Javascript as output. Removes dead code, does various optimizations, and
usually beats other minifiers by a small but significant margin.

Closure Templates: a templating system that generates Java or Javascript code.
Handy if you want to generate a bunch of HTML from templates in Javascript,
and you don't want to write all that by hand.

------
flog
Double BR's, DIVs used as containing elements... ugh. I was expecting better
from Google. The problem of all RTE remains: their HTML is fucking ugly.

~~~
arethuza
The Google one is pretty poor - enter some text and then indent it. The
resulting HTML is browser-specific, Firefox produces:

<div style="margin-left: 40px;">one</div>

While IE produces:

<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr> one</BLOCKQUOTE>

Having written code to normalize the junk produced by a simple contentEditable
editor I hate this kind of thing - there are editors out there that produce
relatively nice well-formed XHTML.

------
ashu
The GMail editor feels a LOT faster than the demo provided. Any specific
reason?

