Forum OpenACS Q&A: Re: Status of the "Nice Text Entry Widget"

Posted by Lars Pind on
HTMLArea, a WYSIWYG editor is integrated into the form builder's 'richtext' widget in stock OpenACS 5.1.

At this point, however, it requires that you edit a parameter on acs-templating to make it use that widget by default.

The reason is that it only works with IE and Mozilla.

I wanted to look at the User-Agent header and be smart about it. When you try using Safari, it'll show an annoying alert box, for example.

Really, to make it useful, we do need to check the user agent.

Hm. Will look into that.

Posted by Steve Manning on

Is this an improved version of the one that was working in IE in earlier versions of OACS? A quick glance at my 5.0.4 code shows that the javascript is still present in richtext-procs.tcl but I don't think it shows up in forms on IE.

The problem with checking user-agent is that they are spoofed to bypass problems with sites that check user-agents :o). For instance I believe Opera defaults to giving an IE user agent by default - or atleast its trivial to change. And indeed I have changed the user-agent in Galeon to spoof IE to allow me access to a site that throws up a stupid objection to accessing it in an non-M$ browser (even though it works without problems). A more reliable method is to use feature testing to determine if code should be executed e.g

if (document.getElementById) {
} else if (document.all) {
    IE 4 API
} else if (document.layers) {
    NETSCAPE 4 API (god help us)
} else {