Author: A.Skokov
Date: 2007-05-29 09:41:21 -0400 (Tue, 29 May 2007)
New Revision: 932
Modified:
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
Exadel replaced with RichFaces
Modified:
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
---
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-05-29
12:46:15 UTC (rev 931)
+++
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-05-29
13:41:21 UTC (rev 932)
@@ -45,8 +45,8 @@
import org.richfaces.renderkit.ScriptOptions;
-public class DropDownMenuRendererBase extends HeaderResourcesRendererBase {
-
+public class DropDownMenuRendererBase extends HeaderResourcesRendererBase {
+
protected Class getComponentClass() {
return UIDropDownMenu.class;
}
@@ -58,10 +58,10 @@
public void encodeChildren(FacesContext context, UIComponent component) throws
IOException {
List flatListOfNodes = new LinkedList();
String width = (String)component.getAttributes().get("popupWidth");
-
+
flatten(component.getChildren(), flatListOfNodes);
processLayer(context, component, width);
-
+
for (Iterator iter = flatListOfNodes.iterator(); iter.hasNext();) {
UIMenuGroup node = (UIMenuGroup) iter.next();
if (node.isRendered() && !node.isDisabled()) processLayer(context, node,
width);
@@ -82,19 +82,19 @@
writer.startElement("div", layer);
writer.writeAttribute("class", "dr-menu-list-strut
rich-menu-list-strut", null);
-
+
writer.startElement("img", layer);
writer.writeAttribute("width", "1", null);
writer.writeAttribute("height", "1", null);
writer.writeAttribute("alt", "", null);
writer.writeAttribute("border", "0", null);
writer.writeAttribute("style", width!=null && width.length() > 0 ?
"width: " + HtmlUtil.qualifySize(width) : "", null);
- writer.writeAttribute("src",
- getResource("/org/richfaces/renderkit/html/images/spacer.gif").getUri(context,
null),
+ writer.writeAttribute("src",
+ getResource("/org/richfaces/renderkit/html/images/spacer.gif").getUri(context,
null),
null);
writer.endElement("img");
writer.endElement("div");
-
+
writer.endElement("div");
writer.endElement("div");
@@ -103,19 +103,19 @@
writer.writeAttribute("class", "underneath_iframe", null);
writer.writeAttribute("style", "position:absolute", null);
writer.endElement("iframe");
-
+
writer.startElement("script", layer);
writer.writeAttribute("id", clientId+"_menu_script", null);
writer.writeAttribute("type", "text/javascript", null);
encodeScript(context, layer);
writer.endElement("script");
-
+
AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
Set renderedAreas = ajaxContext.getAjaxRenderedAreas();
renderedAreas.add(clientId + "_menu_iframe");
renderedAreas.add(clientId + "_menu_script");
}
-
+
public void encodeItems(FacesContext context, UIComponent component) throws IOException
{
List kids = component.getChildren();
Iterator it = kids.iterator();
@@ -142,7 +142,7 @@
public void encodeScript(FacesContext context, UIComponent component) throws IOException
{
StringBuffer buffer = new StringBuffer();
- JSFunction function = new JSFunction("new Exadel.Menu.Layer");
+ JSFunction function = new JSFunction("new RichFaces.Menu.Layer");
function.addParameter(component.getClientId(context)+"_menu");
function.addParameter(component.getAttributes().get("showDelay"));
if (component instanceof UIDropDownMenu) {
@@ -151,8 +151,8 @@
else{
function.addParameter(""+300);
}
- function.appendScript(buffer);
- if (component instanceof UIMenuGroup) {
+ function.appendScript(buffer);
+ if (component instanceof UIMenuGroup) {
buffer.append(".");
function = new JSFunction("asSubMenu");
function.addParameter(component.getParent().getClientId(context)+"_menu");
@@ -168,7 +168,7 @@
Optionssub.addOption("direction",
component.getAttributes().get("direction"));
function.addParameter(Optionssub);
function.appendScript(buffer);
-
+
} else {
buffer.append(".");
function = new JSFunction("asDropDown");
@@ -180,12 +180,12 @@
function.addParameter(evt);
function.addParameter("onmouseout");
ScriptOptions Options = new ScriptOptions(component);
-
+
Options.addOption("direction",
component.getAttributes().get("direction"));
Options.addOption("jointPoint",
component.getAttributes().get("jointPoint"));
- Options.addOption("verticalOffset",
component.getAttributes().get("verticalOffset"));
-
-
+ Options.addOption("verticalOffset",
component.getAttributes().get("verticalOffset"));
+
+
Options.addOption("horizontalOffset",
component.getAttributes().get("horizontalOffset"));
Options.addOption("oncollapse",
component.getAttributes().get("oncollapse"));
Options.addOption("onexpand",
component.getAttributes().get("onexpand"));
@@ -193,9 +193,9 @@
Options.addOption("ongroupactivate",
component.getAttributes().get("ongroupactivate"));
function.addParameter(Options);
function.appendScript(buffer);
-
+
}
-
+
List children = component.getChildren();
for(Iterator it = children.iterator();it.hasNext();) {
UIComponent kid = (UIComponent)it.next();
@@ -206,13 +206,13 @@
UIMenuItem MenuItem=(UIMenuItem)kid;
itemId = kid.getClientId(context);
if (MenuItem.isDisabled()){
- flcloseonclick=0;
+ flcloseonclick=0;
}
} else if (kid instanceof UIMenuGroup) {
UIMenuGroup menuGroup=(UIMenuGroup)kid;
itemId = "ref" + kid.getClientId(context);
flcloseonclick=0;
- if (menuGroup.isDisabled()) flagGroup = 2; else flagGroup = 1;
+ if (menuGroup.isDisabled()) flagGroup = 2; else flagGroup = 1;
}
if(itemId != null){
function = new JSFunction("addItem");
@@ -230,14 +230,14 @@
function.appendScript(buffer);
}
}
-
+
ResponseWriter out = context.getResponseWriter();
String script =buffer.append(";").toString();
- out.write(script);
-
-
-
+ out.write(script);
+
+
+
}
-
-
+
+
}
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
---
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-05-29
12:46:15 UTC (rev 931)
+++
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-05-29
13:41:21 UTC (rev 932)
@@ -5,15 +5,15 @@
var LOG = {a4j_debug:function(){}};
}
-if(!Exadel) var Exadel = {};
-if(!Exadel.Menu) Exadel.Menu = {};
+if(!RichFaces) var RichFaces = {};
+if(!RichFaces.Menu) RichFaces.Menu = {};
/**
* Fixes IE bug with incorrect layer width when set to auto
- * @param layer
+ * @param layer
*/
-Exadel.Menu.fitLayerToContent = function(layer) {
- if (!Exadel.Menu.Layers.IE)
+RichFaces.Menu.fitLayerToContent = function(layer) {
+ if (!RichFaces.Menu.Layers.IE)
return;
var table = layer.childNodes[0];
@@ -27,7 +27,7 @@
} // if
}
-Exadel.Menu.removePx = function(e) {
+RichFaces.Menu.removePx = function(e) {
if ((e+"").indexOf("px")!=-1)
return (e+"").substring(0,e.length-2);
else
@@ -35,7 +35,7 @@
}
-Exadel.Menu.Layers = {
+RichFaces.Menu.Layers = {
listl: new Array(),
father: {},
lwidthDetected:false,
@@ -107,7 +107,7 @@
}
this.detectWidth();
var menu = $(menuName);
- Exadel.Menu.fitLayerToContent(menu);
+ RichFaces.Menu.fitLayerToContent(menu);
var visible = this.isVisible(menuName);
this.setVisibility(menuName, visibleFlag);
this.ieSelectWorkAround(menuName, visibleFlag);
@@ -120,7 +120,7 @@
var menuLayer = this.layers[menu.id];
if (menuLayer && menuLayer.eventOnOpen) menuLayer.eventOnOpen();
if (menuLayer && menuLayer.eventOnExpand) menuLayer.eventOnExpand();
-
+
if (menuLayer.level>0) {
do {
menuLayer = this.layers[(this.father[menuLayer.id])];
@@ -160,11 +160,11 @@
needToResetLayers = true;
}
}
-
+
if (needToResetLayers) {
this.resetLayers();
}
-
+
this.layerPoppedUp = '';
if (this.Konqueror || this.IE5) {
this.seeThroughElements(true);
@@ -178,12 +178,12 @@
newList.push(layer);
}
}
-
+
this.listl = newList;
}
,
- /**
+ /**
* Set visibility
* @param layer the layer to visibility
* @param visible the boolean flag, if true to set visible layer from variable,
otherwise - hide this layer
@@ -220,7 +220,7 @@
}
if (this.useTimeouts) {
clearTimeout(this.timeoutFlag);
- this.timeoutFlag = setTimeout('Exadel.Menu.Layers.shutdown()', ratio);
+ this.timeoutFlag = setTimeout('RichFaces.Menu.Layers.shutdown()', ratio);
}
},
@@ -231,12 +231,12 @@
},
showMenuLayer: function (layerId, e, delay){
this.clearPopUpTO();
- this.showTimeOutFlag = setTimeout(new Exadel.Menu.DelayedPopUp(layerId, e,
function(){this.layerId = null;}.bind(this)).show, delay);
+ this.showTimeOutFlag = setTimeout(new RichFaces.Menu.DelayedPopUp(layerId, e,
function(){this.layerId = null;}.bind(this)).show, delay);
this.layerId = layerId;
},
showDropDownLayer: function (layerId, parentId, e, delay){
this.clearPopUpTO();
- this.showTimeOutFlag = setTimeout(new Exadel.Menu.DelayedDropDown(layerId, parentId,
e).show, delay);
+ this.showTimeOutFlag = setTimeout(new RichFaces.Menu.DelayedDropDown(layerId, parentId,
e).show, delay);
},
showPopUpLayer: function (layer, e){
this.shutdown();
@@ -249,11 +249,11 @@
/**
* return true if defined document element or document body, otherwise return false
*/
-Exadel.Menu.getWindowElement = function() {
+RichFaces.Menu.getWindowElement = function() {
return (document.documentElement || document.body);
}
-Exadel.Menu.getWindowDimensions = function() {
+RichFaces.Menu.getWindowDimensions = function() {
var x,y;
if (self.innerHeight) // all except Explorer
{
@@ -274,7 +274,7 @@
return {width:x, height:y};
}
-Exadel.Menu.getWindowScrollOffset = function() {
+RichFaces.Menu.getWindowScrollOffset = function() {
var x,y;
if (typeof pageYOffset != "undefined") // all except Explorer
{
@@ -296,11 +296,11 @@
return {top:y, left: x};
}
-Exadel.Menu.getPageDimensions = function() {
+RichFaces.Menu.getPageDimensions = function() {
var x,y;
var test1 = document.body.scrollHeight;
var test2 = document.body.offsetHeight;
- if (test1 > test2) {
+ if (test1 > test2) {
// all but Explorer Mac
x = document.body.scrollWidth;
y = document.body.scrollHeight;
@@ -317,7 +317,7 @@
}
-Exadel.Menu.DelayedContextMenu = function(layer, e) {
+RichFaces.Menu.DelayedContextMenu = function(layer, e) {
if (!e) {
e = window.event;
}
@@ -325,9 +325,9 @@
this.element = Event.element(e);
this.layer = $(layer);
this.show = function() {
- Exadel.Menu.Layers.shutdown();
- var body = Exadel.Menu.getPageDimensions();
- var win = Exadel.Menu.getWindowDimensions();
+ RichFaces.Menu.Layers.shutdown();
+ var body = RichFaces.Menu.getPageDimensions();
+ var win = RichFaces.Menu.getWindowDimensions();
var bodyHeight = body.height;
var bodyWidth = body.width;
var clientX = this.event.clientX;
@@ -339,7 +339,7 @@
var layerLeft = left;
if (clientX + layerdim.width > win.width) {
- layerLeft -= (layerdim.width - Exadel.Menu.Layers.shadowWidth -
Exadel.Menu.Layers.CornerRadius);
+ layerLeft -= (layerdim.width - RichFaces.Menu.Layers.shadowWidth -
RichFaces.Menu.Layers.CornerRadius);
}
if (layerLeft < 0) {
@@ -365,7 +365,7 @@
}
*/
if (clientY + layerdim.height > win.height) {
- layerTop -= (layerdim.height - Exadel.Menu.Layers.shadowWidth -
Exadel.Menu.Layers.CornerRadius);
+ layerTop -= (layerdim.height - RichFaces.Menu.Layers.shadowWidth -
RichFaces.Menu.Layers.CornerRadius);
}
if (layerTop < 0) {
@@ -375,8 +375,8 @@
this.layer.style.left = layerLeft + "px";
this.layer.style.top = layerTop + "px";
- Exadel.Menu.Layers.LMPopUp(this.layer.id, false);
- Exadel.Menu.Layers.clearLMTO();
+ RichFaces.Menu.Layers.LMPopUp(this.layer.id, false);
+ RichFaces.Menu.Layers.clearLMTO();
}.bind(this);
}
@@ -384,7 +384,7 @@
/**
* Calculates for DROPDOWN
*/
-Exadel.Menu.DelayedDropDown = function(layer, elementId, e) {
+RichFaces.Menu.DelayedDropDown = function(layer, elementId, e) {
if (!e) {
e = window.event;
}
@@ -415,7 +415,7 @@
}
return list;
}.bind(this);
-
+
this.calcPosition = function(jp, dir) {
var layerLeft;
var layerTop;
@@ -452,16 +452,16 @@
}.bind(this);
this.show = function() {
- Exadel.Menu.Layers.shutdown();
-
- var winOffset = Exadel.Menu.getWindowScrollOffset();
- var win = Exadel.Menu.getWindowDimensions();
- var pageDims = Exadel.Menu.getPageDimensions();
+ RichFaces.Menu.Layers.shutdown();
+ var winOffset = RichFaces.Menu.getWindowScrollOffset();
+ var win = RichFaces.Menu.getWindowDimensions();
+ var pageDims = RichFaces.Menu.getPageDimensions();
+
var windowHeight = win.height;
var windowWidth = win.width;
-
+
// var screenOffset = Position.cumulativeOffset(this.element);
// if (Element.getStyle(this.element, 'position') == 'absolute') {
// screenOffset[0] = 0;
@@ -470,23 +470,23 @@
var screenOffset = Position.positionedOffset(this.element);
var innerDiv = this.element.lastChild;
var dim = Element.getDimensions(this.element);
-
+
var parOffset = Position.cumulativeOffset(this.element);
var divOffset = Position.cumulativeOffset(innerDiv);
var deltaX = divOffset[0] - parOffset[0];
var deltaY = divOffset[1] - parOffset[1];
-
+
// parent element
this.top = screenOffset[1];
this.left = screenOffset[0];
this.bottom = this.top + dim.height;
this.right = this.left + dim.width;
-
+
this.layerdim = Element.getDimensions(this.layer);
- var options = Exadel.Menu.Layers.layers[this.layer.id].options;
-
+ var options = RichFaces.Menu.Layers.layers[this.layer.id].options;
+
var jointPoint = 0;
if (options.jointPoint) {
var sJp = options.jointPoint.toUpperCase();
@@ -495,7 +495,7 @@
jointPoint = sJp.indexOf('BR') != -1?3:jointPoint;
jointPoint = sJp.indexOf('BL') != -1?4:jointPoint;
}
-
+
var direction = 0;
if (options.direction) {
var sDir = options.direction.toUpperCase();
@@ -506,15 +506,15 @@
}
var hOffset = options.horizontalOffset;
var vOffset = options.verticalOffset;
-
+
var listPos = this.listPositions(jointPoint, direction);
var layerPos;
var foundPos = false;
for (var i=0;i<listPos.length;i++) {
layerPos = this.calcPosition(listPos[i].jointPoint, listPos[i].direction)
- if ((layerPos.left + hOffset >= winOffset.left) &&
+ if ((layerPos.left + hOffset >= winOffset.left) &&
(layerPos.left + hOffset + this.layerdim.width - winOffset.left <= windowWidth)
&&
- (layerPos.top + vOffset >= winOffset.top) &&
+ (layerPos.top + vOffset >= winOffset.top) &&
(layerPos.top + vOffset + this.layerdim.height - winOffset.top <= windowHeight))
{
foundPos = true;
break;
@@ -527,17 +527,17 @@
this.layer.style.top = layerPos.top + vOffset - deltaY - this.top + "px";
this.layer.style.width = this.layer.clientWidth + "px";
-
- Exadel.Menu.Layers.LMPopUp(this.layer.id, false);
- Exadel.Menu.Layers.clearLMTO();
+
+ RichFaces.Menu.Layers.LMPopUp(this.layer.id, false);
+ RichFaces.Menu.Layers.clearLMTO();
}.bind(this);
}
-Exadel.Menu.DelayedPopUp = function(layer, e) {
+RichFaces.Menu.DelayedPopUp = function(layer, e) {
if (!e) {
e = window.event;
}
-
+
this.event = e;
this.element = Event.findElement(e, 'div');
if (this.element.id.indexOf(":folder") == (this.element.id.length -7) ) {
@@ -546,23 +546,23 @@
this.layer = $(layer);
this.show = function() {
- if (!Exadel.Menu.Layers.isVisible(this.layer) &&
- Exadel.Menu.Layers.isVisible(Exadel.Menu.Layers.father[this.layer.id])) {
+ if (!RichFaces.Menu.Layers.isVisible(this.layer) &&
+ RichFaces.Menu.Layers.isVisible(RichFaces.Menu.Layers.father[this.layer.id])) {
this.reposition();
- Exadel.Menu.Layers.LMPopUp(this.layer, false);
+ RichFaces.Menu.Layers.LMPopUp(this.layer, false);
}
}.bind(this);
}
-Exadel.Menu.DelayedPopUp.prototype.reposition = function() {
- var windowShift = Exadel.Menu.getWindowScrollOffset();
- var body = Exadel.Menu.getWindowDimensions();
+RichFaces.Menu.DelayedPopUp.prototype.reposition = function() {
+ var windowShift = RichFaces.Menu.getWindowScrollOffset();
+ var body = RichFaces.Menu.getWindowDimensions();
var windowHeight = body.height;
var windowWidth = body.width;
var scrolls = {top:0, left:0};
var screenOffset = Position.positionedOffset(this.element);
- var leftPx = Exadel.Menu.removePx(this.element.parentNode.parentNode.style.left);
- var topPx = Exadel.Menu.removePx(this.element.parentNode.parentNode.style.top);
+ var leftPx = RichFaces.Menu.removePx(this.element.parentNode.parentNode.style.left);
+ var topPx = RichFaces.Menu.removePx(this.element.parentNode.parentNode.style.top);
screenOffset[0]+=Number(leftPx);
screenOffset[1]+=Number(topPx);
var cumulativeOffset = Position.cumulativeOffset(this.element);
@@ -574,7 +574,7 @@
var right = left + dim.width;
var layerdim = Element.getDimensions(this.layer);
- var options = Exadel.Menu.Layers.layers[this.layer.id].options;
+ var options = RichFaces.Menu.Layers.layers[this.layer.id].options;
var dir = 0;
if (options.direction) {
dir = options.direction.toUpperCase().indexOf('LEFT')!=-1?1:dir;
@@ -583,19 +583,19 @@
var layerLeft = right;
var layerTop = top;
-
+
if (dir == 0) {
if (layerLeft + layerdim.width + labelOffset[0] - windowShift.left >=
windowWidth) {
var invisibleRight = layerLeft + layerdim.width + labelOffset[0] -
windowShift.left - windowWidth;
layerLeft = left - layerdim.width;
}
-
+
if (layerLeft + labelOffset[0] < 0) {
if (Math.abs(layerLeft + labelOffset[0]) > invisibleRight) {
layerLeft = right;
}
}
-
+
} else if (dir == 1) {
layerLeft = left - layerdim.width;
}
@@ -613,11 +613,11 @@
if (Math.abs(layerTop) > invisibleBottom) layerTop = top;
}
}
-
+
}
/* if (layerLeft + layerdim.width >= windowWidth) {
- layerLeft = left - layerdim.width + Exadel.Menu.Layers.shadowWidth;
+ layerLeft = left - layerdim.width + RichFaces.Menu.Layers.shadowWidth;
}
if (layerLeft < 0) {
@@ -639,29 +639,29 @@
itemOffset = Position.cumulativeOffset(lastItem);
layertop = top -(itemOffset[1]-layerOffset[1]);
}
- } else layertop = top - Exadel.Menu.Layers.CornerRadius;
-
+ } else layertop = top - RichFaces.Menu.Layers.CornerRadius;
+
if (layertop < 0) {
layertop = 0;
} */
this.layer.style.left = layerLeft + "px";
this.layer.style.top = layerTop + "px";
-
+
this.layer.style.width = this.layer.clientWidth + "px";
-
+
}
/**
- * set to true when a dropdown box inside menu receives focus
+ * set to true when a dropdown box inside menu receives focus
*/
-Exadel.Menu.selectOpen = false;
-Exadel.Menu.MouseIn = false;
+RichFaces.Menu.selectOpen = false;
+RichFaces.Menu.MouseIn = false;
-Exadel.Menu.Layer = Class.create();
-Exadel.Menu.Layer.prototype = {
+RichFaces.Menu.Layer = Class.create();
+RichFaces.Menu.Layer.prototype = {
initialize: function(id,delay, hideDelay){
- Exadel.Menu.Layers.listl.push(id);
+ RichFaces.Menu.Layers.listl.push(id);
this.id = id;
this.layer = $(id);
this.level = 0;
@@ -670,48 +670,48 @@
this.hideDelay=hideDelay;
}
else{
- this.hideDelay=hideDelay;
+ this.hideDelay=hideDelay;
}
- Exadel.Menu.fitLayerToContent(this.layer);
+ RichFaces.Menu.fitLayerToContent(this.layer);
this.items = new Array();
- Exadel.Menu.Layers.layers[id] = this;
+ RichFaces.Menu.Layers.layers[id] = this;
this.bindings = new Array();
- this.mouseover =
+ this.mouseover =
function(e){
- Exadel.Menu.MouseIn=true;
- Exadel.Menu.Layers.clearLMTO();
-
- var menuNode =
Exadel.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
+ RichFaces.Menu.MouseIn=true;
+ RichFaces.Menu.Layers.clearLMTO();
+
+ var menuNode =
RichFaces.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
menuNode.className='dr-menu-label dr-menu-label-select rich-ddmenu-label
rich-ddmenu-label-select';
-
+
Event.stop(e);
}.bindAsEventListener(this);
-
- this.mouseout =
+
+ this.mouseout =
function(e){
- Exadel.Menu.MouseIn = false;
- if (!Exadel.Menu.selectOpen) {
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
+ RichFaces.Menu.MouseIn = false;
+ if (!RichFaces.Menu.selectOpen) {
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
}
- var menuNode =
Exadel.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
+ var menuNode =
RichFaces.Menu.Layers.layers[this.layer.id].layer.parentNode.parentNode;
menuNode.className='dr-menu-label dr-menu-label-unselect rich-ddmenu-label
rich-ddmenu-label-unselect';
-
+
Event.stop(e);
}.bindAsEventListener(this);
- var binding = new Exadel.Menu.Layer.Binding (
+ var binding = new RichFaces.Menu.Layer.Binding (
this.id,
"mouseover",
this.mouseover);
this.bindings.push(binding);
binding.refresh();
- binding = new Exadel.Menu.Layer.Binding (
+ binding = new RichFaces.Menu.Layer.Binding (
this.id,
"mouseout",
this.mouseout);
@@ -724,16 +724,16 @@
var closeSelectb = this.closeSelect.bindAsEventListener(this);
Event.observe(arrayinp[i], "focus", openSelectb);
Event.observe(arrayinp[i], "blur", closeSelectb);
- //var MouseoverInInputb =
Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ //var MouseoverInInputb =
RichFaces.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
- //var MouseoutInInputb =
Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- var MouseoutInInputb =
this.MouseoutInInput.bindAsEventListener(this);
+ //var MouseoutInInputb =
RichFaces.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb =
this.MouseoutInInput.bindAsEventListener(this);
Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
-
- //var OnKeyPressb = Exadel.Menu.Layer.OnKeyPress.bindAsEventListener(this);
+
+ //var OnKeyPressb = RichFaces.Menu.Layer.OnKeyPress.bindAsEventListener(this);
var OnKeyPressb = this.OnKeyPress.bindAsEventListener(this);
- Event.observe(arrayinp[i], "keypress", OnKeyPressb);
+ Event.observe(arrayinp[i], "keypress", OnKeyPressb);
}
arrayinp=$A(this.layer.getElementsByTagName("input"));
@@ -742,12 +742,12 @@
var closeSelectb = this.closeSelect.bindAsEventListener(this);
Event.observe(arrayinp[i], "focus", openSelectb);
Event.observe(arrayinp[i], "blur", closeSelectb);
- //var MouseoverInInputb =
Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ //var MouseoverInInputb =
RichFaces.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
- //var MouseoutInInputb =
Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- var MouseoutInInputb =
this.MouseoutInInput.bindAsEventListener(this);
+ //var MouseoutInInputb =
RichFaces.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb =
this.MouseoutInInput.bindAsEventListener(this);
Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
- Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
+ Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
var OnKeyPressb = this.OnKeyPress.bindAsEventListener(this);
Event.observe(arrayinp[i], "keypress", OnKeyPressb);
}
@@ -757,13 +757,13 @@
var openSelectb = this.openSelect.bindAsEventListener(this);
var closeSelectb = this.closeSelect.bindAsEventListener(this);
Event.observe(arrayinp[i], "focus", openSelectb);
- Event.observe(arrayinp[i], "blur", closeSelectb);
- //var MouseoverInInputb =
Exadel.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
+ Event.observe(arrayinp[i], "blur", closeSelectb);
+ //var MouseoverInInputb =
RichFaces.Menu.Layer.MouseoverInInput.bindAsEventListener(this);
var MouseoverInInputb = this.MouseoverInInput.bindAsEventListener(this);
- //var MouseoutInInputb =
Exadel.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
- var MouseoutInInputb =
this.MouseoutInInput.bindAsEventListener(this);
+ //var MouseoutInInputb =
RichFaces.Menu.Layer.MouseoutInInput.bindAsEventListener(this);
+ var MouseoutInInputb =
this.MouseoutInInput.bindAsEventListener(this);
Event.observe(arrayinp[i], "mouseover", MouseoverInInputb);
- Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
+ Event.observe(arrayinp[i], "mouseout", MouseoutInInputb);
}
/* if(window.A4J && A4J.AJAX ){
@@ -774,30 +774,30 @@
- openSelect: function(event){
- Exadel.Menu.selectOpen = true;
+ openSelect: function(event){
+ RichFaces.Menu.selectOpen = true;
var ClickInputb = this.ClickInput.bindAsEventListener(this);
Event.observe(Event.element(event), "click", this.ClickInput);
-
+
},
closeSelect: function(event){
- Exadel.Menu.selectOpen = false;
+ RichFaces.Menu.selectOpen = false;
var ClickInputb = this.ClickInput.bindAsEventListener(this);
Event.stopObserving(Event.element(event), "click", this.ClickInput);
- if (Exadel.Menu.MouseIn == false){
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
+ if (RichFaces.Menu.MouseIn == false){
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
}
},
OnKeyPress: function(event){
-
+
if(event.keyCode==13){
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
- }
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
+ }
},
@@ -814,13 +814,13 @@
return false;
},
-
+
MouseoutInInput: function(event){
var ClickInputb = this.ClickInput.bindAsEventListener(this);
Event.stopObserving(Event.element(event), "click", this.ClickInput);
},
-
+
rebind:function(){
$A(this.bindings)
.each(
@@ -832,17 +832,17 @@
showMe: function(e){
this.closeSiblings(e);
//LOG.a4j_debug('show me ' + this.id +' ' +this.level);
- Exadel.Menu.Layers.showMenuLayer(this.id, e, this.delay);
- Exadel.Menu.Layers.levels[this.level] = this;
+ RichFaces.Menu.Layers.showMenuLayer(this.id, e, this.delay);
+ RichFaces.Menu.Layers.levels[this.level] = this;
// if (this.eventOnOpen) this.eventOnOpen();
},
closeSiblings: function(e){
//LOG.a4j_debug('closeASiblins ' + this.id +' ' +this.level);
- if(Exadel.Menu.Layers.levels[this.level] &&
Exadel.Menu.Layers.levels[this.level].id != this.id){
- for(var i = this.level; i < Exadel.Menu.Layers.levels.length; i++){
- if(Exadel.Menu.Layers.levels[i]) {
- Exadel.Menu.Layers.levels[i].hideMe();
- //Exadel.Menu.Layers.levels[i] = '';
+ if(RichFaces.Menu.Layers.levels[this.level] &&
RichFaces.Menu.Layers.levels[this.level].id != this.id){
+ for(var i = this.level; i < RichFaces.Menu.Layers.levels.length; i++){
+ if(RichFaces.Menu.Layers.levels[i]) {
+ RichFaces.Menu.Layers.levels[i].hideMe();
+ //RichFaces.Menu.Layers.levels[i] = '';
}
}
}
@@ -852,10 +852,10 @@
var item = this.items[id];
// if(!item.childMenu){
//LOG.a4j_debug('hiding menus ' + this.id +' ' +this.level);
- for(var i = this.level + (!item.childMenu?1:2); i <
Exadel.Menu.Layers.levels.length; i++){
- if(Exadel.Menu.Layers.levels[i]) {
- //LOG.a4j_debug('hide ' +Exadel.Menu.Layers.levels[i]);
- Exadel.Menu.Layers.levels[i].hideMe();
+ for(var i = this.level + (!item.childMenu?1:2); i <
RichFaces.Menu.Layers.levels.length; i++){
+ if(RichFaces.Menu.Layers.levels[i]) {
+ //LOG.a4j_debug('hide ' +RichFaces.Menu.Layers.levels[i]);
+ RichFaces.Menu.Layers.levels[i].hideMe();
}
}
// }
@@ -874,7 +874,7 @@
Element.addClassName(this.id,"dr-menu-item-hover");
Element.addClassName(this.id,"rich-menu-group-hover");
if (this.options.selectClass) Element.addClassName(this.id,
this.options.selectClass);
-
+
Element.addClassName(this.id+":icon","rich-menu-item-icon-selected");
Element.addClassName(this.id+":anchor","rich-menu-item-label");
} else if (!this.mouseOver) {
@@ -900,7 +900,7 @@
item.eventOnMouseOut = new
Function("event",item.options.onmouseout).bindAsEventListener(item);
}
this.items[itemId] = item;
-
+
var onmouseover =
function(e){
this.menu.closeMinors(this.id);
@@ -916,7 +916,7 @@
this.eventOnMouseOver();
}
}.bindAsEventListener(item);
-
+
var onmouseout =
function(e){
if (this.options.flagGroup == 1) {
@@ -934,28 +934,28 @@
var onmouseclick =
function(e){
- var menuLayer = item.menu;
+ var menuLayer = item.menu;
while (menuLayer.level > 0) {
- menuLayer = Exadel.Menu.Layers.layers[(Exadel.Menu.Layers.father[menuLayer.id])];
- }
+ menuLayer =
RichFaces.Menu.Layers.layers[(RichFaces.Menu.Layers.father[menuLayer.id])];
+ }
if (menuLayer && menuLayer.eventOnItemSelect) menuLayer.eventOnItemSelect();
- Exadel.Menu.Layers.shutdown();
+ RichFaces.Menu.Layers.shutdown();
}.bindAsEventListener(item);
- var binding = new Exadel.Menu.Layer.Binding (
+ var binding = new RichFaces.Menu.Layer.Binding (
item.id,
"mouseover",
onmouseover);
this.bindings.push(binding);
binding.refresh();
- binding = new Exadel.Menu.Layer.Binding (
+ binding = new RichFaces.Menu.Layer.Binding (
item.id,
"mouseout",
onmouseout);
this.bindings.push(binding);
binding.refresh();
if (flag_close_onclick==1){
- binding = new Exadel.Menu.Layer.Binding (
+ binding = new RichFaces.Menu.Layer.Binding (
item.id,
"click",
onmouseclick);
@@ -966,9 +966,9 @@
return this;
},
hideMe: function(e){
- Exadel.Menu.Layers.clearPopUpTO();
- Exadel.Menu.Layers.levels[this.level] = null;
- Exadel.Menu.Layers.LMPopUpL(this.id, false);
+ RichFaces.Menu.Layers.clearPopUpTO();
+ RichFaces.Menu.Layers.levels[this.level] = null;
+ RichFaces.Menu.Layers.LMPopUpL(this.id, false);
// if (this.eventOnClose) this.eventOnClose();
},
asDropDown: function(topLevel, onEvt, offEvt, options){
@@ -991,7 +991,7 @@
if (!e) {
e = window.event;
}
- Exadel.Menu.Layers.showDropDownLayer(this.id, topLevel, e,this.delay);
+ RichFaces.Menu.Layers.showDropDownLayer(this.id, topLevel,
e,this.delay);
}.bindAsEventListener(this);
if(!onEvt){
@@ -1006,23 +1006,23 @@
var dis = this;
var onmouseout =
function(e){
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
- Exadel.Menu.Layers.clearPopUpTO();
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
+ RichFaces.Menu.Layers.clearPopUpTO();
}.bindAsEventListener(this);
// var item = $(topLevel);
- var binding = new Exadel.Menu.Layer.Binding(topLevel,onEvt, onmouseover);
+ var binding = new RichFaces.Menu.Layer.Binding(topLevel,onEvt, onmouseover);
this.bindings.push(binding);
binding.refresh();
- binding = new Exadel.Menu.Layer.Binding (topLevel, offEvt, onmouseout);
+ binding = new RichFaces.Menu.Layer.Binding (topLevel, offEvt, onmouseout);
this.bindings.push(binding);
binding.refresh();
- Exadel.Menu.Layers.horizontals[this.id] = topLevel;
+ RichFaces.Menu.Layers.horizontals[this.id] = topLevel;
// }
return this;
},
-
+
asSubMenu: function(parentv, refLayerName, evtName, options){
this.options = options || {};
if (this.options.onclose != ""){
@@ -1031,34 +1031,34 @@
if (this.options.onopen != ""){
this.eventOnOpen = new
Function("event",this.options.onopen).bindAsEventListener(this);
}
-
+
if(!evtName){
evtName = 'onmouseover';
}
evtName = this.eventJsToPrototype(evtName);
- this.level = Exadel.Menu.Layers.layers[parentv].level + 1;
- Exadel.Menu.Layers.father[this.id] = parentv;
+ this.level = RichFaces.Menu.Layers.layers[parentv].level + 1;
+ RichFaces.Menu.Layers.father[this.id] = parentv;
if(!refLayerName){
refLayerName = 'ref' + parentv;
}
var refLayer = $(refLayerName);
- this.refItem = Exadel.Menu.Layers.layers[parentv].items[refLayerName];
+ this.refItem = RichFaces.Menu.Layers.layers[parentv].items[refLayerName];
this.refItem.childMenu = this;
- var binding = new Exadel.Menu.Layer.Binding(refLayerName,
evtName, this.showMe.bindAsEventListener(this));
+ var binding = new RichFaces.Menu.Layer.Binding(refLayerName,
evtName, this.showMe.bindAsEventListener(this));
this.bindings.push(binding);
binding.refresh();
-
+
// set parents hideDelay
- var menuLayer=this;
+ var menuLayer=this;
while (menuLayer.level > 0) {
- menuLayer = Exadel.Menu.Layers.layers[(Exadel.Menu.Layers.father[menuLayer.id])];
- }
+ menuLayer =
RichFaces.Menu.Layers.layers[(RichFaces.Menu.Layers.father[menuLayer.id])];
+ }
if (menuLayer && menuLayer.hideDelay){
this.hideDelay=menuLayer.hideDelay;
- }
+ }
-
+
return this;
},
asContextMenu: function(parent, evt){
@@ -1074,15 +1074,15 @@
var dis = this;
var onmouseout =
function(e){
- Exadel.Menu.Layers.setLMTO(this.hideDelay);
- Exadel.Menu.Layers.clearPopUpTO();
+ RichFaces.Menu.Layers.setLMTO(this.hideDelay);
+ RichFaces.Menu.Layers.clearPopUpTO();
}.bindAsEventListener(this);
evt = this.eventJsToPrototype(evt);
- var handler = function(e){new Exadel.Menu.DelayedContextMenu(this.id,
e).show();}.bindAsEventListener(this);
- var binding = new Exadel.Menu.Layer.Binding (parent, evt, handler);
+ var handler = function(e){new RichFaces.Menu.DelayedContextMenu(this.id,
e).show();}.bindAsEventListener(this);
+ var binding = new RichFaces.Menu.Layer.Binding (parent, evt, handler);
this.bindings.push(binding);
binding.refresh();
- binding = new Exadel.Menu.Layer.Binding (parent, offEvt, onmouseout);
+ binding = new RichFaces.Menu.Layer.Binding (parent, offEvt, onmouseout);
this.bindings.push(binding);
binding.refresh();
return this;
@@ -1097,8 +1097,8 @@
};
-Exadel.Menu.Layer.Binding = Class.create();
-Exadel.Menu.Layer.Binding.prototype = {
+RichFaces.Menu.Layer.Binding = Class.create();
+RichFaces.Menu.Layer.Binding.prototype = {
initialize:function(objectId, eventname, handler){
this.objectId = objectId;
this.eventname = eventname;
@@ -1115,14 +1115,14 @@
return false;
}
};
-if(!Exadel.Menu.Item) Exadel.Menu.Item = {};
+if(!RichFaces.Menu.Item) RichFaces.Menu.Item = {};
/**
*
*/
-Exadel.Menu.Item.Onclick = function(evt, item, action, params, target) {
+RichFaces.Menu.Item.Onclick = function(evt, item, action, params, target) {
var form = Event.findElement(evt, 'form');
-
+
/*if(!form || typeof(form) == 'undefined' || !form.nodeName ||
form.nodeName.toLowerCase() != 'form'){
form = document.createElement('form');
form.setAttribute('method', 'post');
@@ -1132,10 +1132,10 @@
}*/
var objectsCreated = new Array();
var oldValues = new Object();
- Exadel.Menu.Item._createOrInitHiddenInput(item + ":submit", item +
":submit", objectsCreated, oldValues, form);
-
+ RichFaces.Menu.Item._createOrInitHiddenInput(item + ":submit", item +
":submit", objectsCreated, oldValues, form);
+
if (params) {
-
+
for (var param in params) {
var paramName = param;
var paramValue = params[paramName];
@@ -1143,36 +1143,36 @@
if (paramValue) {
paramValue = String(paramValue);
}
- Exadel.Menu.Item._createOrInitHiddenInput(paramName, paramValue, objectsCreated,
oldValues, form);
-
+ RichFaces.Menu.Item._createOrInitHiddenInput(paramName, paramValue, objectsCreated,
oldValues, form);
+
}
}
}
-
+
var l = objectsCreated.length;
-
+
for (var i = 0; i < l; i++) {
var kid = objectsCreated[i];
form.appendChild(kid);
}
-
+
var targ = form.target;
-
+
if (target) {
form.target = target;
}
-
+
form.submit();
-
+
form.target = targ;
-
+
for (var j = 0; j < l; j++) {
var kid = objectsCreated[j];
if (form && kid) {
form.removeChild(kid);
}
}
-
+
for (var key in oldValues) {
var value = oldValues[key];
if (typeof(value) != 'function') {
@@ -1180,10 +1180,10 @@
}
}
}
-
-Exadel.Menu.Item._createOrInitHiddenInput = function(name, value, list, oldValues, form)
{
+
+RichFaces.Menu.Item._createOrInitHiddenInput = function(name, value, list, oldValues,
form) {
var hiddenObj = $(name) || form[name];
-
+
if (!hiddenObj) {
hiddenObj = document.createElement('input');
hiddenObj.setAttribute('type', 'hidden');