krysalis-menu/component/src/java/org/krysalis/menu/component Menu.library,NONE,1.1 MenuBar.html,NONE,1.1 MenuBar.jwc,NONE,1.1 MenuDropDown.html,NONE,1.1 MenuDropDown.jwc,NONE,1.1 MenuDropDown.script,NONE,1.1 MenuItem.html,NONE,1.1 MenuItem.java,NONE,1.1 MenuItem.jwc,NONE,1.1 MenuItem.script,NONE,1.1 MenuSep.html,NONE,1.1 MenuSep.jwc,NONE,1.1 SubMenu.html,NONE,1.1 SubMenu.jwc,NONE,1.1
Glen Stampoultzis <[email protected]> Wed, 24 Nov 2004 23:08:42 +0000
| Newsgroups | gmane.comp.krysalis.metamorphosis.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/metamorphosis/krysalis-menu/component/src/java/org/krysalis/menu/component
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16326/component/src/java/org/krysalis/menu/component
Added Files:
Menu.library MenuBar.html MenuBar.jwc MenuDropDown.html
MenuDropDown.jwc MenuDropDown.script MenuItem.html
MenuItem.java MenuItem.jwc MenuItem.script MenuSep.html
MenuSep.jwc SubMenu.html SubMenu.jwc
Log Message:
Initial commit
--- NEW FILE: MenuItem.html ---
<span jwcid="@Script" script="/org/krysalis/menu/component/MenuItem.script" id="ognl:id" submenuid="ognl:submenuId"/>
<tr class="menuItem" id="ognl:'menu' + id" jwcid="@Any"><td>
<span jwcid="@Conditional" condition="ognl:getBinding('disabled') != null && getBinding('disabled').object">
<span class="menuDisabled">
<span jwcid="@RenderBody"/>
</span>
</span>
<span jwcid="@Conditional" condition="ognl:!(getBinding('disabled') != null && getBinding('disabled').object)">
<span jwcid="@Conditional" condition="ognl:getBinding('directLink') != null && getBinding('directLink').object">
<span jwcid="@DirectLink" listener="ognl:getBinding('directLink').object"><span jwcid="@RenderBody"/></span>
</span>
<span jwcid="@Conditional" condition="ognl:!(getBinding('directLink') != null && getBinding('directLink').object)">
<span jwcid="@RenderBody"/>
</span>
</span>
</td>
<td>
<span jwcid="@Conditional" condition="ognl:submenuProvided">
>
</span>
</td>
</tr>
--- NEW FILE: MenuDropDown.jwc ---
<?xml version="1.0" encoding="UTF-8"?>
<!--
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
-->
<!DOCTYPE component-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<component-specification>
<description>
Defines a drop down
</description>
<parameter name="title" type="java.lang.String" direction="in" default-value="Menu">
<description>
The name of this menu
</description>
</parameter>
<!-- <parameter name="param2" type="java.lang.String" direction="in">-->
<!-- <description>-->
<!-- The element to emulate.-->
<!-- </description>-->
<!-- </parameter>-->
<!---->
<!-- <reserved-parameter name="XXX"/>-->
<!-- -->
<!-- <property-specification name="prop1" type="boolean" initial-value="false"/>-->
</component-specification>
--- NEW FILE: MenuItem.java ---
/*
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
*/
package org.krysalis.menu.component;
import org.apache.tapestry.BaseComponent;
import org.apache.tapestry.IComponent;
/**
* @author Glen Stampoultzis
* @version $Id: MenuItem.java,v 1.1 2004/11/24 23:08:39 gstamp Exp $
*/
public class MenuItem
extends BaseComponent
{
public boolean isSubmenuProvided()
{
return getBinding("submenu") != null && getBinding("submenu").getObject() != null;
}
public String getSubmenuId()
{
if (getBinding("submenu") != null)
return ((IComponent)getBinding("submenu").getObject()).getId();
else
return "";
}
}
--- NEW FILE: MenuSep.html ---
<tr><td colspan="2"><span class="menuItemSep"></span></td></tr>
--- NEW FILE: Menu.library ---
<?xml version="1.0" encoding="UTF-8"?>
<!--
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
-->
<!DOCTYPE library-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<library-specification>
<component-type type="MenuBar" specification-path="/org/krysalis/menu/component/MenuBar.jwc"/>
<component-type type="MenuDropDown" specification-path="/org/krysalis/menu/component/MenuDropDown.jwc"/>
<component-type type="MenuItem" specification-path="/org/krysalis/menu/component/MenuItem.jwc"/>
<component-type type="MenuSep" specification-path="/org/krysalis/menu/component/MenuSep.jwc"/>
</library-specification>
--- NEW FILE: MenuBar.html ---
<div class="menuBar">
<div jwcid="@RenderBody"/>
</div>
--- NEW FILE: MenuDropDown.html ---
<span jwcid="@Script" script="/org/krysalis/menu/component/MenuDropDown.script" id="ognl:id"/>
<div class="menuDropDown" id="ognl:'menu' + id" jwcid="@Any">
<div jwcid="@Insert" value="ognl:bindings.title.string"/>
</div>
<div jwcid="@Any" class="menuDropDiv" id="ognl:'menuDD' + id">
<table border="0" cellspacing="0">
<div jwcid="@RenderBody"/>
</table>
</div>
--- NEW FILE: SubMenu.html ---
<div jwcid="@Any" class="menuDropDiv" id="ognl:'menuDD' + id">
<table border="0" cellspacing="0">
<span jwcid="@RenderBody"/>
</table>
</div>
--- NEW FILE: MenuItem.script ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script PUBLIC
"-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
<!--
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
-->
<script>
<input-symbol key="id" class="java.lang.String"/>
<input-symbol key="submenuid" class="java.lang.String"/>
<let key="menuId">menu${id}</let>
<let key="subId">menuDD${submenuid}</let>
<body>
<unique>
<![CDATA[
var currentSubmenu;
function addMenuHighlight(node)
{
addClass( node, "menuItemHighlight" );
var children = node.childNodes;
for (var i = 0; i < children.length; i++)
addMenuHighlight(children[i]);
}
function removeMenuHighlight(node)
{
removeClass( node, "menuItemHighlight" );
var children = node.childNodes;
for (var i = 0; i < children.length; i++)
removeMenuHighlight(children[i]);
}
function initItem( buttonElement, submenuElement )
{
buttonElement.onmouseover = function() {
addMenuHighlight(this);
if (currentSubmenu)
{
var node = this;
var inSubmenu = false;
while (node)
{
if (node == currentSubmenu)
inSubmenu = true;
node = node.parentNode;
}
if (!inSubmenu)
{
removeClass( currentSubmenu, "menuDropDivVisible" );
currentSubmenu = null;
}
}
if (submenuElement)
{
submenuElement.style.top = (topMargin(buttonElement) ) + "px";
submenuElement.style.left = (leftMargin(buttonElement) + buttonElement.offsetWidth - 9) + "px";
addClass( submenuElement, "menuDropDivVisible" );
currentSubmenu = submenuElement;
}
};
if (submenuElement)
{
submenuElement.onmouseout = function(e) {
if (currentSubmenu)
{
if (!e) var e = window.event;
var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
if (reltg)
{
if (!containsClass(reltg, 'menuDropDiv', true) && !containsClass(reltg, 'menuItem', true))
{
removeClass( currentSubmenu, "menuDropDivVisible" );
currentSubmenu = null;
}
}
}
}
}
buttonElement.onmouseout = function(e) {
if (currentSubmenu)
{
if (!e) var e = window.event;
/*
var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
if (reltg)
{
if (!containsClass(reltg, 'menuDropDiv', true) && !containsClass(reltg, 'menuItem', true))
{
removeClass( currentSubmenu, "menuDropDivVisible" );
currentSubmenu = null;
}
}
*/
}
removeMenuHighlight(this);
};
}
]]>
</unique>
</body>
<initialization><![CDATA[
initItem( document.getElementById('${menuId}'), document.getElementById('${subId}') );]]></initialization>
</script>
--- NEW FILE: MenuItem.jwc ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE component-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<!--
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
-->
<component-specification class="org.krysalis.menu.component.MenuItem">
<description>
Represents a component menu item
</description>
<parameter name="submenu" type="org.apache.tapestry.IComponent" direction="in">
<description>
The submenu of this component
</description>
</parameter>
<parameter name="directLink" type="org.apache.tapestry.IActionListener" direction="in">
<description>
Listener called when component is clicked
</description>
</parameter>
<parameter name="disabled" type="boolean" direction="in">
<description>
Whether direct link is disabled
</description>
</parameter>
</component-specification>
--- NEW FILE: SubMenu.jwc ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE component-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<!--
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
-->
<component-specification>
<description>
Defines a submenu
</description>
</component-specification>
--- NEW FILE: MenuDropDown.script ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script PUBLIC
"-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
<!--
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
-->
<script>
<input-symbol key="id" class="java.lang.String"/>
<let key="menuId">menu${id}</let>
<let key="menuDDId">menuDD${id}</let>
<body>
<unique>
<![CDATA[
var activeMenuButton;
var activeMenuDiv;
// Eg: var helloElms = getElementsByCondition(function(el){return el.className.indexOf('hello')>-1})
function getElementsByCondition(condition,container)
{
container = container||document;
var all = container.all||container.getElementsByTagName('*');
var arr = [];
for(var k=0;k<all.length;k++)
{
var elm = all[k];
if(condition(elm,k))
arr[arr.length] = elm;
}
return arr;
}
function addClass(el, name)
{
if (!containsClass(el, name))
if (el.className)
el.className += " " + name;
}
function containsClass(el, name, recurseParents)
{
if (!el) // not sure why we're getting an empty element.
return false;
if (el.className)
{
var list = el.className.split(" ");
for (var i = 0; i < list.length; i++)
if (list[i] == name)
{
return true;
}
}
if (recurseParents && el.parentNode)
{
return containsClass(el.parentNode, name, recurseParents);
}
return false;
}
function debug(msg)
{
if (document.getElementById('debug'))
document.getElementById('debug').innerHTML = msg + "<br>" + document.getElementById('debug').innerHTML;
}
function removeClass(el, name)
{
if (!el.className)
return;
var newList = new Array();
var curList = el.className.split(" ");
for (var i = 0; i < curList.length; i++)
if (curList[i] != name)
newList.push(curList[i]);
el.className = newList.join(" ");
}
function leftMargin(el)
{
var x = el.offsetLeft;
if (el.offsetParent != null) x += leftMargin(el.offsetParent);
return x;
}
function topMargin(el)
{
var y = el.offsetTop;
if (el.offsetParent != null) y += topMargin(el.offsetParent);
return y;
}
function deactivateCurrentMenu()
{
if (activeMenuDiv)
removeClass( activeMenuDiv, "menuDropDivVisible" );
if (currentSubmenu)
removeClass( currentSubmenu, "menuDropDivVisible" );
if (activeMenuButton)
removeClass( activeMenuButton, "menuDropDownSelected" );
}
function init( buttonElement, ddElement )
{
buttonElement.onmouseover = function() { addClass( buttonElement, "menuDropDownHighlight" ); };
buttonElement.onmouseout = function() { removeClass( buttonElement, "menuDropDownHighlight" ); };
buttonElement.onclick = function() {
deactivateCurrentMenu();
activeMenuButton = buttonElement;
activeMenuDiv = ddElement;
addClass( buttonElement, "menuDropDownSelected" );
addClass( ddElement, "menuDropDivVisible" );
ddElement.style.left = leftMargin(buttonElement) + "px";
ddElement.style.top = (topMargin(buttonElement) + buttonElement.offsetHeight) + "px";
ddElement.onmouseover = function() {
ddElement.onmouseout = function(e) {
if (!e) var e = window.event;
// bypass bogus mouseout events
var tg = ddElement;
if (tg.nodeName != 'DIV') { return; }
var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
if (reltg)
{
if (!containsClass(reltg, 'menuDropDiv', true) && !containsClass(reltg, 'menuItem', true))
{
deactivateCurrentMenu();
}
}
};
}
}
}
]]>
</unique>
</body>
<initialization>
<![CDATA[
var buttonElement = document.getElementById('${menuId}');
var ddElement = document.getElementById('${menuDDId}');
init(buttonElement, ddElement);
]]>
</initialization>
</script>
--- NEW FILE: MenuSep.jwc ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE component-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<!--
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
-->
<component-specification allow-body="no" allow-informal-parameters="no" >
<description>
Represents a menu separator
</description>
<!-- <parameter name="param1" type="boolean" direction="in" default-value="true">-->
<!-- <description>-->
<!-- The condition to evaluate.-->
<!-- </description>-->
<!-- </parameter>-->
<!---->
<!-- <parameter name="param2" type="java.lang.String" direction="in">-->
<!-- <description>-->
<!-- The element to emulate.-->
<!-- </description>-->
<!-- </parameter>-->
<!-- <reserved-parameter name="XXX"/>-->
<!-- <property-specification name="prop1" type="boolean" initial-value="false"/>-->
</component-specification>
--- NEW FILE: MenuBar.jwc ---
<?xml version="1.0" encoding="UTF-8"?>
<!--
The Krysalis Patchy Software License, Version 1.1_01
Copyright (c) 2004 Nicola Ken Barozzi. All rights reserved.
This Licence is compatible with the BSD licence as described and
approved by http://www.opensource.org/, and is based on the
Apache Software Licence Version 1.1.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The end-user documentation included with the redistribution,
if any, must include the following acknowledgment:
"This product includes software developed for project
Krysalis (http://www.krysalis.org/)."
Alternately, this acknowledgment may appear in the software itself,
if and wherever such third-party acknowledgments normally appear.
4. The names "Krysalis" and "Nicola Ken Barozzi" and
"Krysalis Centipede" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact [email protected].
5. Products derived from this software may not be called "Krysalis",
"Krysalis Centipede", nor may "Krysalis" appear in their name, without
prior written permission of Nicola Ken Barozzi.
6. This software may contain voluntary contributions made by many
individuals, who decided to donate the code to this project in respect
of this licence.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
====================================================================
-->
<!DOCTYPE component-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<component-specification>
<description>
Defines a menu bar
</description>
</component-specification>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/