I have created a module which integrates the Ekit HTML editor (see http://www.hexidec.com/ekit.php) into Drupal. Ekit itself is a Java applet which will be loaded on demand for every textarea in the Drupal administration area.

You can find the module and some comments about the installation at http://1stein.org/node.php?id=142. Keep in mind that it is not tested very much, just in my personal configuration. So I am interested in work reports and patches to make it work elsewhere.

Schimmi

Comments

sts@1stein.org’s picture

I added a demo page here:

http://1stein.org/node.php?id=143

It now even works with Mozilla and Internet Explorer on a Windows platform. You probably need a Java 1.4.1 plugin because that's what I used to compile Ekit.

Schimmi

dries’s picture

Do you plan to upload this to the contributions repository such that it becomes available for download here on drupal.org?

As for feedback, consider porting this to Drupal CVS using the newly introduced hooks (see the htmlarea module, the "textarea" hook, theme_onload_attributes() and theme_footer()). I'm curious to know whether these hooks are sufficiently generic.

sts@1stein.org’s picture

It can go to the contribution repository as soon as it matures a bit more. At least it should work with Drupal CVS in a clean way without changing core files like common.inc. I will install a Drupal CVS version in a minute to port it.

bertboerland’s picture

thanks very much. excellent addon. would love to see the module go live

once again: thanks!
--
groets

bertb

--
groets
bert boerland

sts@1stein.org’s picture

I have investigated the integration into Drupal CVS. I am not really happy with the provided hooks. The Htmlarea module for example does a lot of JavaScript magic to replace a textarea in the DOM with the Htmlarea widget. Something similar is needed for Ekit to add the "Edit" button. My code looks like a big hack here which will certainly break easily on different JavaScript implementations.

I would appreciate a more flexible hook to integrate editors. For example it should be possible to replace the whole textarea completely and replace it with my own code.

For the special "Edit" button code it would be enough the append the return value of the hook to the textarea HTML code. I manually added this in my Drupal 4 hack.

To provide a complete in place wysiwyg editor I would replace the textarea with a hidden one next to the applet. On unload I would copy the text from the editor into the hidden textarea such that the other Drupal form code would keep working.

Is there any possibility to provide hooks for the "in place" and the "new window" solution?

Schimmi

al’s picture

This is excellent. I'm about to go and test it on Drupal CVS. IMHO, this is a superior approach to the other htmlarea module, if only because it is properly cross-browser by skirting the issue entirely and using Java. Only one thing, though - please lose the copyright notice. It's not really the Drupal thing to have people's names plastered all over Drupal-powered sites. You'll notice that Drupal sites don't even have a "powered by Drupal" link for self-promotion.

sts@1stein.org’s picture

That's why I started the work in the first place although I knew about the htmlarea module. Using JavaScript for complex things like an editor easily gets you into browser dependence and browser version hell. Htmlarea never worked for me in Mozilla although the 3.0 alpha is supposed to do so. One may argue that Sun's Java needs a lot of resources, but they succeed in providing compatibility between versions.

About the licence: you're right about the copyright notice. I will change this in the future.

Please tell me how it worked out with Drupal CVS.

JoeCotellese’s picture

I'm running on a live system based on the CVS build of drupal. Things seem fine so far. I'm using the version that has the seperate edit button but would prefer a complete replacement for the text area. I understand that version exists but haven't tried it.

One suggestion would be the ability to toggle between the inline version and the standard text box as a user config option. That way older browsers or people who hate Java still can use the system.

As far as Safari goes, my initial tests didn't go so well. I'm going to play around with it some more.

joe lombardo’s picture

It seems to me that there are two big drawbacks to the Ekit solution; load time and user interface.

First, speed. I'm running a 4 CPU 2 GHZ windows 2000 box on a high-speed corporate network and it took several seconds for the applet to display. Long enough for me to think it had crashed or failed.

Regarding the user interface, it strikes me as awkward and confusing to be presented with a text field and have to click an 'edit' button to see the editor.

The goal of providing a wysiwyg editor in text entry fields is an important one, and I am glad people are trying to find solutions. I hope people continue improving the current solutions and finding new ones.

Keep up the good work.

- Joe

Joe Lombardo | joe@familytimes.com | My Blog

sts@1stein.org’s picture

Speed is only a problem the first time you load the applet. Try to close the window and open it again. On my 850 MHz notebook it needs clearly less than a second to load.

It should be possible to replace every textarea completely with an applet if drupal provides more generic hooks. I am not in the position to provide those though. Maybe anybody else?

Schimmi

dries’s picture

It should be possible to replace every textarea completely with an applet if drupal provides more generic hooks. I am not in the position to provide those though.

Quite the opposite. Being on the forefront of these textarea improvements, you are in the position to suggest alternatives and improvements, or to describe the problems you encountered. We don't mind to change existing hooks if it allows us to support a wider range of WYSIWYG editors (and friends). That is, feel free to share your thoughts and/or some (proof-of-concept) code. The mailing list would be the proper place to discuss this further.

sts@1stein.org’s picture

Now even Opera 7 works correctly. See
http://1stein.org/node.php?id=142
for the new version.

Unfortunately Konqueror does not support LiveConnect which makes Ekit to fail because the JavaScript can't access the applet. The same might be true for Safari and some other browsers.

Schimmi

sts@1stein.org’s picture

I am working on the integration into Drupal CVS. You can try the current version at

http://cvs.1stein.org/drupal/

You can create a comment or a new story to see the in place editor (no extra window anymore!)

Schimmi

hepster67-at-yahoo.com’s picture

I can't load it.