<!--- @copyright 2005-2008 Laszlo Systems, Inc. All Rights Reserved. Use is subject to license terms. @topic Incubator @subtopic Components --> <library> <!--- A class for URL links. This differs from the use of the XHTML <a> attribute, e.g in '<text><a href="http://openlaszlo.org">OpenLaszlo.org</a>lt;/text>', in these ways: - There is a hover effect. (This defaults to underline.) - There is a hover color. (This defaults to blue.) - The link content and target can be databound. <example executable="false"> <ulink href="http://openlaszlo.org">OpenLaszlo.org</ulink> </example> See ulink-test.lzx for additional examples. --> <class name="ulink"><!--- The color when the link is <em>not</em> being hovered. -->
<attribute name="color" type="color" value="
blue
"/><!--- The color when the link is hovered. -->
<attribute name="hoverColor" type="color" value="
blue
"/><!--- A list of tags that are applied to the link when it is hovered. This is either a list of tag names, e.g. "u" or "u b", or the HTML itself, e.g. "<u>". -->
<attribute name="hoverTags" type="string" value="
u
"/><!--- The text of the link. -->
<attribute name="text" type="html"/>
<!--- The URL target. -->
<attribute name="href" type="string"/>
<!--- Where the target opens. See lz.Browser.loadURL for a list of values. -->
<attribute name="target" type="string" value="
_new
"/> <handler name="onmouseover"> label.setAttribute('fgcolor', this.hoverColor); label.setAttribute('text', makeTags(this.hoverTags)+this.text); </handler> <handler name="onmouseout"> label.setAttribute('fgcolor', this.color); label.setAttribute('text', this.text); </handler> <handler name="onclick"> if(this.href != null){ lz.Browser.loadURL(this.href, this.target); } </handler><method name="makeTags" args="tags"> if (tags.split('<').length > 1) return tags; var s = ''; tags = tags.split(' '); for (var i = 0; i < tags.length; i++) { s += '<' + tags[i] + '>'; } return s; </method> <text name="label" resize="true" fgcolor="${parent.color}" text="${parent.text}"/> </class> </library>