Todd O'Bryan wrote:

I'm trying to convert HtmlArea so that it works with 3.0.3.

For those who don't know, HtmlArea is a great big collection of JavaScripts and other crapola that changes a TextArea into a WYSIWYG editor. Problem is, there's a main script which tries to load the other scripts, images, etc., and has trouble now because it tries to create its own URLs on the fly, and these no longer match what Tapestry wants.

I'm more than willing to code assets for all the images, other scripts, etc., but how do I reference those assets from inside the JavaScript components?

Thanks,
Todd

Hi Todd,
yesterday I spent a few minutes on HtmlArea component.
I suppose that one possible solution is:

* define every asset in HtmlArea.jwc file (for example:

[...]
<component id="definitions" type="Script">
<static-binding name="script">HtmlAreaDefinitions.script</static-binding>
<binding name="url" expression="generatePath(assets.htmlareajs, 'htmlarea.js')"/>
<binding name="htmlareajs" expression="assets.htmlareajs.buildURL(page.requestCycle)"/>
<binding name="dialogjs" expression="assets.dialogjs.buildURL(page.requestCycle)"/>
<binding name="popupwinjs" expression="assets.popupwinjs.buildURL(page.requestCycle)"/>
<binding name="langjs" expression="assets.langjs.buildURL(page.requestCycle)"/>
</component>


<private-asset name="htmlareajs" resource-path="/org/rz/htmlarea/htmlarea.js"/>
<private-asset name="dialogjs" resource-path="/org/rz/htmlarea/dialog.js"/>
<private-asset name="popupwinjs" resource-path="/org/rz/htmlarea/popupwin.js"/>
<private-asset name="langjs" resource-path="/org/rz/htmlarea/lang/en.js"/>


[...]

* define a variable in HtmlAreaDefinitions.script for each asset,

<![CDATA[
_editor_url="${url}";//how are we gonna work this??? ;)
_editor_lang="en";//note, need fix this later for i18n before uploading component to Tassel...


_htmlareajs= "${htmlareajs}";
_dialogjs= "${dialogjs}";
_popupwinjs = ${popupwinjs};
_langjs = ${langjs};

]]>

* modify htmlarea.js so that it uses the variables defined in HtmlAreaDefinitions

The problem is that I think that the assets are really a lot!
I still looking for an easier solution ... any idea?

Thanks
Enrico


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to