Forum OpenACS Development: Re: Pasting HTML into Xinha

Collapse
Posted by Hamilton Chua on
I looked deeper into the htmlarea.js file from xinha and I noticed that it supports cleaning word html.

In fact, there is a button with the icon of a word document with a red circle/slash that users can press to clean up the content in the textarea of any word cruft.

The javascript function (HTMLArea.prototype._wordClean ) that does this can be found in htmlarea.js and is called whenever that button with the word icon is clicked.

Also, I've found that you can automatically execute this function as soon as content is pasted by setting this.htmlareaPaste and this.killWordOnPaste to true in the htmlarea.js file.

However, htmlareaPaste works only in IE so for users that use mozilla based browsers, they will still need to click the clean word icon after pasting.

Collapse
Posted by Malte Sussdorff on
I think we should make the patch Hamilton proposes to be the default one in OpenACS. Or are we really concerned about pasted Word HTML "crap" ?

I assume from the way you have been describing it that you cannot make this a acs-parameter, can you?