aiTree :: collapsible tree component for use with aynHTML Editor


NAME

aiTree :: collapsible tree component for use with aynHTML Editor


VERSION

Version 0.20b (beta) - 2003-05-05


SYNOPSIS

<html xmlns:AI>
	<head>
		<?import namespace="AI" implementation="aiTree.htc" />
		<script language="javascript">
			onload = function() {
				aiTree.data = '<root />';
			}
			
			aiTree.onchoose = do_something;
			
			function do_something( e ) {
				txtUrl.value = e.href;
				txtName.value = e.name;
			}
		</script>
	</head>
	<body>
		<input id="txtUrl">
		<input id="txtName">
		<AI:aiTree id="aiTree" preview="1" />
	</body>
</html>

DESCRIPTION

This is a hypertext component which can be embedded as a custom element in an HTML page. The component builds a collapsible tree from an xml string passed into it. Clicking on an item generates an event which can be captured in the containing document.

Optionally, a preview pane shows a thumbnail of the images loaded into the tree.

The component is implemented as an element behaviour, which is supported in IE 5.5 and above.


PROPERTIES

id

Id of the object, so it can be referenced in script in the containing document.

data

Well-formed xml string that contains the items to be rendered.
The tree follows the structure of the elements in the string. Element names can be freely chosen, the attributes "name" and "href" of each element are used respectively as the title and the hyperlink of each item. Elements without a non-existing or empty name attribute are shown as "no title". File urls should be absolute links to the location of the file, as relative links will be resolved relative to the location of the page containing the aiTree component. Folder names are not used to construct the url, so the tree need not correspond to a physical equivalent on the webserver.

For example, this file:

<root>
	<element name="images" ><element />
	<folder name="Documents" >
		<file name="Love Letter" href="/upload/docs/loveletter.txt" >
		<folder ></folder >
	</folder>
</root>
will look like this in fully extended view:

images
- Documents
  Love Letter
  no title

preview

Whether or not to show a preview screen next to the tree window. Useful when loading a list of images into the tree.
A thumbnail of the image will be shown in the preview pane when passing over the item with the mouse.

Values: 1 | 0 ( default ).


METHODS

no public methods defined.


EVENTS

onchoose

The onchoose event is raised when the user clicks on an item with an href attribute.

The event object raised has two custom properties:

href
The href attribute of the item clicked on.
name
The name attribute of the item clicked on.

TO DO


AUTHOR

Original developer: Denis Braet <denis.braet@aine.be>


HOMEPAGE

The aynHTML project is hosted at SourceForge.net.

Please visit http://sourceforge.net/projects/aynhtml/ for the latest release, updates and bug fixes.


COPYLEFT

aiTree :: collapsible tree component for use with aynHTML editor

Copyright © 2002-2003, Denis Braet. <denis.braet@aine.be>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, a copy can be obtained at:

http://http://www.gnu.org/licenses/gpl.html