Author: Alex.Kolonitsky
Date: 2010-12-08 07:31:27 -0500 (Wed, 08 Dec 2010)
New Revision: 20457
Added:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordionItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanelItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js
Removed:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanel_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel_.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip_.js
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
Log:
RF-9608 - Rename JavaScript resources to lower case
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -62,8 +62,8 @@
@ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(library = "org.richfaces", name =
"TogglePanelItem_.js"),
- @ResourceDependency(library = "org.richfaces", name =
"AccordionItem_.js")
+ @ResourceDependency(library = "org.richfaces", name =
"togglePanelItem.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"accordionItem.js")
})
public class AccordionItemRenderer extends TogglePanelItemRenderer {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -46,8 +46,8 @@
@ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
@ResourceDependency(library = "org.richfaces", name =
"accordion.ecss"),
- @ResourceDependency(library = "org.richfaces", name =
"TogglePanel_.js"),
- @ResourceDependency(library = "org.richfaces", name =
"Accordion_.js") })
+ @ResourceDependency(library = "org.richfaces", name =
"togglePanel.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"accordion.js") })
public class AccordionRenderer extends TogglePanelRenderer {
@Override
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -49,10 +49,10 @@
@ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(library = "org.richfaces", name =
"TogglePanel_.js"),
- @ResourceDependency(library = "org.richfaces", name =
"TogglePanelItem_.js"),
- @ResourceDependency(library = "org.richfaces", name =
"CollapsiblePanel_.js"),
- @ResourceDependency(library = "org.richfaces", name =
"CollapsiblePanelItem_.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"togglePanel.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"togglePanelItem.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"collapsiblePanel.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"collapsiblePanelItem.js"),
@ResourceDependency(library = "org.richfaces", name =
"collapsiblePanel.ecss") })
public class CollapsiblePanelRenderer extends TogglePanelRenderer {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -53,9 +53,9 @@
@ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(library = "org.richfaces", name =
"PanelMenu_.js"),
- @ResourceDependency(library = "org.richfaces", name =
"PanelMenuItem_.js"),
- @ResourceDependency(library = "org.richfaces", name =
"PanelMenuGroup_.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"panelMenu.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"panelMenuItem.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"panelMenuGroup.js"),
@ResourceDependency(library = "org.richfaces", name =
"panelMenu.ecss") })
public class PanelMenuRenderer extends DivPanelRenderer {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -58,8 +58,8 @@
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
@ResourceDependency(library = "org.richfaces", name =
"tabPanel.ecss"),
- @ResourceDependency(library = "org.richfaces", name =
"TogglePanel_.js"),
- @ResourceDependency(library = "org.richfaces", name =
"TabPanel_.js")
+ @ResourceDependency(library = "org.richfaces", name =
"togglePanel.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"tabPanel.js")
})
public class TabPanelRenderer extends TogglePanelRenderer {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -45,8 +45,8 @@
@ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(library = "org.richfaces", name =
"TogglePanelItem_.js"),
- @ResourceDependency(library = "org.richfaces", name = "Tab_.js")
+ @ResourceDependency(library = "org.richfaces", name =
"togglePanelItem.js"),
+ @ResourceDependency(library = "org.richfaces", name = "tab.js")
})
public class TabRenderer extends TogglePanelItemRenderer {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelItemRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -46,7 +46,7 @@
@ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(library = "org.richfaces", name =
"TogglePanelItem_.js") })
+ @ResourceDependency(library = "org.richfaces", name =
"togglePanelItem.js") })
public class TogglePanelItemRenderer extends DivPanelRenderer {
private static final String LEAVE = "leave";
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -57,7 +57,7 @@
@ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(library = "org.richfaces", name =
"TogglePanel_.js") })
+ @ResourceDependency(library = "org.richfaces", name =
"togglePanel.js") })
public class TogglePanelRenderer extends DivPanelRenderer {
public static final String VALUE_POSTFIX = "-value";
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2010-12-08
12:31:27 UTC (rev 20457)
@@ -58,7 +58,7 @@
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
@ResourceDependency(library = "org.richfaces", name =
"popup.js"),
- @ResourceDependency(library = "org.richfaces", name =
"Tooltip_.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"tooltip.js"),
@ResourceDependency(library = "org.richfaces", name =
"tooltip.ecss") })
public class TooltipRenderer extends DivPanelRenderer implements MetaComponentRenderer {
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,158 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.AccordionItem = rf.ui.TogglePanelItem.extendClass({
- // class name
- name:"AccordionItem",
-
- /**
- * @class AccordionItem
- * @name AccordionItem
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- $super.constructor.call(this, componentId, options);
- this.index = options["index"];
- this.getTogglePanel().getItems()[this.index] = this;
-
- if (!this.disabled) {
- rf.Event.bindById(this.id + ":header", "click",
this.__onHeaderClick, this);
- }
-
- if (this.isSelected()) {
- var item = this;
- $(document).ready(function () {
- item.__fitToHeight(item.getTogglePanel());
- });
- }
- },
-
- /***************************** Public Methods
****************************************************************/
-
- __onHeaderClick : function (comp) {
- this.getTogglePanel().switchToItem(this.getName());
- },
-
- /**
- * @param state {string} = inactive | active | disabled
- * in that case looking header by css class appropriate to this state
- *
- * @return {jQuery Object}
- * */
- __header : function (state) {
- var res = $(rf.getDomElement(this.id + ":header"));
- if (state) {
- return res.find(".rf-ac-itm-hdr-" + state);
- }
-
- return res;
- },
-
- /**
- * @return {jQuery Object}
- * */
- __content : function () {
- if (!this.__content_) {
- this.__content_ = $(rf.getDomElement(this.id + ":content"));
- }
- return this.__content_;
- },
-
- /**
- * @private
- *
- * used in TogglePanel
- * */
- __enter : function () {
- var parentPanel = this.getTogglePanel();
- if (parentPanel.isKeepHeight) {
- this.__content().hide(); // TODO ?
- this.__fitToHeight(parentPanel);
- }
-
- this.__content().show();
- this.__header("inact").hide();
- this.__header("act").show();
-
- return this.__fireEnter();
- },
-
- __fitToHeight : function (parentPanel) {
- var h = parentPanel.getInnerHeight();
-
- var items = parentPanel.getItems();
- for (var i in items) {
- h -= items[i].__header().outerHeight();
- }
-
- this.__content().height(h - 20); // 20 it is padding top and bottom
- },
-
- getHeight : function (recalculate) {
- if (recalculate || !this.__height) {
- this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
- }
-
- return this.__height;
- },
-
- /**
- * @private
- *
- * used in TogglePanel
- * */
- __leave : function () {
- var continueProcess = this.__fireLeave();
- if (!continueProcess) {
- return false;
- }
-
- this.__content().hide();
- this.__header("act").hide();
- this.__header("inact").show();
-
- return true;
- },
-
- /***************************** Private Methods
********************************************************/
-
-
- destroy: function () {
- var parent = this.getTogglePanel();
- delete parent.getItems()[this.index];
-
- rf.Event.unbindById(this.id, "."+this.namespace);
-
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.AccordionItem.$super;
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.Accordion = rf.ui.TogglePanel.extendClass({
- // class name
- name:"Accordion",
-
- /**
- * @class Accordion
- * @name Accordion
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- $super.constructor.call(this, componentId, options);
- this.items = [];
-
- this.isKeepHeight = options["isKeepHeight"] || false
- },
-
- /***************************** Public Methods
****************************************************************/
-
- getHeight : function (recalculate) {
- if (recalculate || !this.__height) {
- this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
- }
-
- return this.__height;
- },
-
- getInnerHeight : function (recalculate) {
- if (recalculate || !this.__innerHeight) {
- this.__innerHeight = $(rf.getDomElement(this.id)).innerHeight(true)
- }
-
- return this.__innerHeight;
- },
-
- /***************************** Private Methods
********************************************************/
-
-
- destroy: function () {
- rf.Event.unbindById(this.id, "." + this.namespace);
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.Accordion.$super;
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.CollapsiblePanelItem = rf.ui.TogglePanelItem.extendClass({
-
- init : function (componentId, options) {
- rf.ui.TogglePanelItem.call(this, componentId, options);
- },
-
- __enter : function () {
- rf.getDomElement(this.id).style.display = "block";
- this.__header(this.__state()).show();
-
- return true;
- },
-
- __leave : function () {
- rf.getDomElement(this.id).style.display = "none";
- this.__header(this.__state()).hide();
-
- return true;
- },
-
- __state : function () {
- return this.getName() === "true" ? "exp" :
"colps";
- },
-
- __header : function (state) {
- var res = $(rf.getDomElement(this.togglePanelId + ":header"));
- if (state) {
- return res.find(".rf-cp-hdr-" + state);
- }
-
- return res;
- }
- });
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanel_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanel_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanel_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.CollapsiblePanel = rf.ui.TogglePanel.extendClass({
-
- name:"CollapsiblePanel",
-
- /**
- * @class CollapsiblePanel
- * @name CollapsiblePanel
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- rf.ui.TogglePanel.call(this, componentId, options);
- this.switchMode = options.switchMode;
-
- this.__addUserEventHandler("beforeswitch");
- this.__addUserEventHandler("switch");
-
- this.items = [
- new RichFaces.ui.CollapsiblePanelItem(
- this.id + ":content", {"index":0,
"togglePanelId":this.id, "switchMode":this.switchMode,
"name":"true"}),
-
- new RichFaces.ui.CollapsiblePanelItem(
- this.id + ":empty", {"index":1,
"togglePanelId":this.id, "switchMode":this.switchMode,
"name":"false"})
- ];
- this.options.cycledSwitching = true;
-
- rf.Event.bindById(this.id + ":header", "click",
this.__onHeaderClick, this)
- },
-
- switchPanel : function (to) {
- this.switchToItem(to || "@next");
- },
-
- /***************************** Private Methods
********************************************************/
-
- __onHeaderClick : function () {
- this.switchToItem("@next");
- },
-
- __fireItemChange : function (oldItem, newItem) {
- return new rf.Event.fireById(this.id, "switch", {
- id: this.id,
- isExpanded : newItem.getName()
- });
- },
-
- __fireBeforeItemChange : function (oldItem, newItem) {
- return rf.Event.fireById(this.id, "beforeswitch", {
- id: this.id,
- isExpanded : newItem.getName()
- });
- }
- });
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,365 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- var __DEFAULT_OPTIONS = {
- expanded : false,
- expandSingle : true,
- bubbleSelection : true,
- stylePrefix : "rf-pm-gr",
-
- // TODO we should use selectionType = {none, selectable, unselectable}
- selectable : false,
- unselectable : false // unselectable can be only selectable item => if
selectable == false than unselectable = false
- };
-
- var EXPAND_ITEM = {
-
- /**
- *
- * @return {void}
- * */
- exec : function (group, expand) {
- var mode = group.mode;
- if (mode == "server") {
- return this.execServer(group);
- } else if (mode == "ajax") {
- return this.execAjax(group);
- } else if (mode == "client" || mode == "none") {
- return this.execClient(group, expand);
- } else {
- rf.log.error("EXPAND_ITEM.exec : unknown mode (" + mode +
")");
- }
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execServer : function (group) {
- group.__changeState();
- rf.submitForm(this.__getParentForm(group));
-
- return false;
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execAjax : function (group) {
- var oldState = group.__changeState();
- rf.ajax(group.id, null, $.extend({}, group.options["ajax"], {}));
- group.__restoreState(oldState);
-
- return true;
- },
-
- /**
- * @protected
- *
- * @param {PanelMenuGroup} group
- * @param {Boolean} expand
- * @return {undefined}
- * - false - if process has been terminated
- * - true - in other cases
- * */
- execClient : function (group, expand) {
- if (expand) {
- group.expand();
- } else {
- group.collapse();
- }
-
- return group.__fireSwitch();
- },
-
- /**
- * @private
- * */
- __getParentForm : function (item) {
- return $($(rf.getDomElement(item.id)).parents("form")[0]);
- }
- };
-
- rf.ui.PanelMenuGroup = rf.ui.PanelMenuItem.extendClass({
- // class name
- name:"PanelMenuGroup",
-
- /**
- * @class PanelMenuGroup
- * @name PanelMenuGroup
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- $super.constructor.call(this, componentId);
- this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
-
- if (!this.options.disabled) {
- var menuGroup = this;
-
- if (!this.options.selectable) {
- this.__header().bind("click", function () {
- return menuGroup.switchExpantion();
- });
- }
-
- if (this.options.selectable || this.options.bubbleSelection) {
- this.__content().bind("select", function (event) {
- if (menuGroup.options.selectable &&
menuGroup.__isMyEvent(event)) {
- menuGroup.expand();
- }
-
- if (menuGroup.options.bubbleSelection &&
!menuGroup.__isMyEvent(event)) {
- menuGroup.__select();
- if (!menuGroup.expanded()) {
- menuGroup.expand();
- }
- }
- });
-
- this.__content().bind("unselect", function (event) {
- if (menuGroup.options.selectable &&
menuGroup.__isMyEvent(event)) {
- menuGroup.collapse();
- }
-
- if (menuGroup.options.bubbleSelection &&
!menuGroup.__isMyEvent(event)) {
- menuGroup.__unselect();
- }
- });
- }
-
- if (menuGroup.options.expandSingle) {
- menuGroup.__group().bind("expand", function (event) {
- if (menuGroup.__isMyEvent(event)) {
- return;
- }
-
- menuGroup.__childGroups().each (function (index, group) {
- var rfGroup = rf.$(group);
- if (!rfGroup.__isMyEvent(event)) {
- rfGroup.collapse();
- }
- });
-
- event.stopPropagation();
- });
- }
-
- this.__addUserEventHandler("collapse");
- this.__addUserEventHandler("expand");
- }
- },
-
- /***************************** Public Methods
****************************************************************/
- expanded : function () {
- // TODO check invariant in dev mode
- // return this.__content().hasClass("rf-pm-exp")
- return this.__getExpandValue();
- },
-
- expand : function () {
- this.__expand();
-
- return this.__fireExpand();
- },
-
- __expand : function () {
-
this.__content().removeClass("rf-pm-colps").addClass("rf-pm-exp");
- var header = this.__header();
- header.find(".rf-pm-ico-colps").hide();
- header.find(".rf-pm-ico-exp").show();
-
- this.__setExpandValue(true);
- },
-
- collapsed : function () {
- // TODO check invariant in dev mode
- // return this.__content().hasClass("rf-pm-colps")
- return !this.__getExpandValue();
- },
-
- collapse : function () {
- this.__collapse();
-
- this.__childGroups().each (function(index, group) {
- rf.$(group.id).__collapse();
- });
-
- this.__fireCollapse();
- },
-
- __collapse : function () {
-
this.__content().addClass("rf-pm-colps").removeClass("rf-pm-exp");
- var header = this.__header();
- header.find(".rf-pm-ico-exp").hide();
- header.find(".rf-pm-ico-colps").show();
-
- this.__setExpandValue(false);
- },
-
- /**
- * @methodOf
- * @name PanelMenuGroup#switch
- *
- * TODO ...
- *
- * @param {boolean} expand
- * @return {void} TODO ...
- */
- switchExpantion : function () { // TODO rename
- var continueProcess = this.__fireBeforeSwitch();
- if (!continueProcess) {
- return false;
- }
-
- EXPAND_ITEM.exec(this, !this.expanded());
- },
-
- /**
- * please, remove this method when client side ajax events will be added
- *
- * */
- onCompleteHandler : function () {
- EXPAND_ITEM.execClient(this, this.expanded());
- },
-
- __switch : function (expand) {
- if (expand) {
- this.expand();
- } else {
- this.collapse();
- }
- },
-
- /***************************** Private Methods
****************************************************************/
- __childGroups : function () {
- return this.__content().children(".rf-pm-gr")
- },
-
- __group : function () {
- return $(rf.getDomElement(this.id))
- },
-
- __header : function () {
- return $(rf.getDomElement(this.id + ":hdr"))
- },
-
- __content : function () {
- return $(rf.getDomElement(this.id + ":cnt"))
- },
-
- __expandValueInput : function () {
- return document.getElementById(this.id + ":expanded");
- },
-
- __getExpandValue : function () {
- return this.__expandValueInput().value == "true";
- },
-
- /**
- * @methodOf
- * @name PanelMenuGroup#__setExpandValue
- *
- * @param {boolean} value - is group expanded?
- * @return {boolean} preview value
- */
- __setExpandValue : function (value) {
- var input = this.__expandValueInput();
- var oldValue = input.value;
-
- input.value = value;
-
- return oldValue;
- },
-
- __changeState : function () {
- var state = {};
- state["expanded"] =
this.__setExpandValue(!this.__getExpandValue());
- if (this.options.selectable) {
- state["itemName"] =
this.__rfPanelMenu().selectedItem(this.itemName); // TODO bad function name for function
which change component state
- }
-
- return state;
- },
-
- __restoreState : function (state) {
- if (!state) {
- return;
- }
-
- if (state["expanded"]) {
- this.__setExpandValue(state["expanded"]);
- }
-
- if (state["itemName"]) {
- this.__rfPanelMenu().selectedItem(state["itemName"]);
- }
- },
-
- __fireSwitch : function () {
- return new rf.Event.fireById(this.id, "switch", {
- id: this.id
- });
- },
-
- __isMyEvent: function (event) {
- return this.id == event.target.id;
- },
-
- __fireBeforeSwitch : function () {
- return rf.Event.fireById(this.id, "beforeswitch", {
- id: this.id
- });
- },
-
- __fireCollapse : function () {
- return new rf.Event.fireById(this.id, "collapse", {
- id: this.id
- });
- },
-
- __fireExpand : function () {
- return new rf.Event.fireById(this.id, "expand", {
- id: this.id
- });
- },
-
- destroy: function () {
- rf.Event.unbindById(this.id, "."+this.namespace);
-
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.PanelMenuGroup.$super;
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,321 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- var __DEFAULT_OPTIONS = {
- disabled : false,
- selectable: true,
- mode: "client",
- unselectable: false,
- highlight: true,
- stylePrefix: "rf-pm-itm",
- itemStep: 20
- };
-
- var SELECT_ITEM = {
-
- /**
- *
- * @return {void}
- * */
- exec : function (item) {
- var mode = item.mode;
- if (mode == "server") {
- return this.execServer(item);
- } else if (mode == "ajax") {
- return this.execAjax(item);
- } else if (mode == "client" || mode == "none") {
- return this.execClient(item);
- } else {
- rf.log.error("SELECT_ITEM.exec : unknown mode (" + mode +
")");
- }
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execServer : function (item) {
- item.__changeState();
- rf.submitForm(this.__getParentForm(item));
-
- return false;
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execAjax : function (item) {
- var oldItem = item.__changeState();
- rf.ajax(item.__panelMenu().id, null, $.extend({},
item.options["ajax"], {}));
- item.__restoreState(oldItem);
-
- return true;
- },
-
- /**
- * @protected
- *
- * @return {undefined}
- * - false - if process has been terminated
- * - true - in other cases
- * */
- execClient : function (item) {
- var panelMenu = item.__rfPanelMenu();
- if (panelMenu.selectedItem()) {
- panelMenu.getItems()[panelMenu.selectedItem()].unselect();
- }
- panelMenu.selectedItem(item.itemName);
-
- item.__select();
-
- return item.__fireSelect();
- },
-
- /**
- * @private
- * */
- __getParentForm : function (item) {
- return $($(rf.getDomElement(item.id)).parents("form")[0]);
- }
- };
-
- rf.ui.PanelMenuItem = rf.BaseComponent.extendClass({
- // class name
- name:"PanelMenuItem",
-
- /**
- * @class PanelMenuItem
- * @name PanelMenuItem
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- $super.constructor.call(this, componentId);
- this.attachToDom();
-
- this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
-
- this.mode = this.options.mode
- this.itemName = this.options.name
- this.__rfPanelMenu().getItems()[this.itemName] = this;
-
- // todo move it
- this.selectionClass = this.options.stylePrefix + "-sel";
- this.hoverClass = this.options.stylePrefix + "-hov";
-
- if (!this.options.disabled) {
- var item = this;
- if (this.options.highlight) {
- this.__item().bind("mouseenter", function() {
- item.highlight(true);
- });
- this.__item().bind("mouseleave", function() {
- item.highlight(false);
- });
- }
-
- if (this.options.selectable) {
- this.__header().bind("click", function() {
- if (item.__rfPanelMenu().selectedItem() == item.id) {
- if (item.options.unselectable) {
- return item.unselect();
- }
-
- // we shouldn't select one item several times
- } else {
- return item.select();
- }
- });
- }
- }
-
- item = this;
- $(this.__panelMenu()).ready(function () {
- item.__renderNestingLevel();
- });
-
- this.__addUserEventHandler("select");
- },
-
- /***************************** Public Methods
****************************************************************/
- highlight : function (highlight) {
- if (highlight && !this.selected()) {
- this.__header().addClass(this.hoverClass);
- } else {
- this.__header().removeClass(this.hoverClass);
- }
- },
-
- selected : function () {
- return this.__header().hasClass(this.selectionClass);
- },
-
- /**
- * @methodOf
- * @name PanelMenuItem#select
- *
- * TODO ...
- *
- * @return {void} TODO ...
- */
- select: function () {
- var continueProcess = this.__fireBeforeSelect();
- if (!continueProcess) {
- return false;
- }
-
- return SELECT_ITEM.exec(this)
- },
-
- /**
- * please, remove this method when client side ajax events will be added
- *
- * */
- onCompleteHandler : function () {
- SELECT_ITEM.execClient(this);
- },
-
- unselect: function () {
- var panelMenu = this.__rfPanelMenu();
- if (panelMenu.selectedItem() == this.itemName) {
- panelMenu.selectedItem(null);
- } else {
- rf.warn("You try unselect item (name=" + this.itemName +
") that isn't seleted")
- }
-
- this.__unselect();
-
- return this.__fireUnselect();
- },
-
- /***************************** Private Methods
****************************************************************/
- __rfParentItem : function () {
- var res = this.__item().parents(".rf-pm-gr")[0];
- if (!res) {
- res = this.__item().parents(".rf-pm-top-gr")[0];
- }
-
- if (!res) {
- res = this.__panelMenu();
- }
-
- return res ? rf.$(res) : null;
- },
-
- __getNestingLevel : function () {
- if (!this.nestingLevel) {
- var parentItem = this.__rfParentItem();
- if (parentItem && parentItem.__getNestingLevel) {
- this.nestingLevel = parentItem.__getNestingLevel() + 1;
- } else {
- this.nestingLevel = 0;
- }
- }
-
- return this.nestingLevel;
- },
-
- __renderNestingLevel : function () {
- this.__item().find("td").first().css("padding-left",
this.options.itemStep * this.__getNestingLevel());
- },
-
- __panelMenu : function () {
- return this.__item().parents(".rf-pm")[0];
- },
-
- __rfPanelMenu : function () {
- return rf.$(this.__item().parents(".rf-pm")[0]);
- },
-
- __changeState : function () {
- return this.__rfPanelMenu().selectedItem(this.itemName);
- },
-
- __restoreState : function (state) {
- if (state) {
- this.__rfPanelMenu().selectedItem(state);
- }
- },
-
- __item : function () {
- return $(rf.getDomElement(this.id));
- },
-
- __header : function () {
- return this.__item();
- },
-
- __select: function () {
- this.__header().addClass(this.selectionClass);
- },
-
- __unselect: function () {
- this.__header().removeClass(this.selectionClass);
- },
-
- __fireBeforeSelect : function () {
- return new rf.Event.fireById(this.id, "beforeselect", {
- id: this.id
- });
- },
-
- __fireSelect : function () {
- return new rf.Event.fireById(this.id, "select", {
- id: this.id
- });
- },
-
- __fireUnselect : function () {
- return new rf.Event.fireById(this.id, "unselect", {
- id: this.id
- });
- },
-
- /**
- * @private
- * */
- __addUserEventHandler : function (name) {
- var handler = this.options["on" + name];
- if (handler) {
- rf.Event.bindById(this.id, name, handler);
- }
- },
-
- destroy: function () {
- delete this.__rfPanelMenu().getItems()[this.itemName];
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.PanelMenuItem.$super;
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,211 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- var __DEFAULT_OPTIONS = {
- expandSingle : true
- };
-
- rf.ui.PanelMenu = rf.BaseComponent.extendClass({
- // class name
- name:"PanelMenu",
-
- /**
- * @class PanelMenu
- * @name PanelMenu
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- $super.constructor.call(this, componentId);
- this.items = [];
- this.attachToDom();
-
- this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
- this.activeItem = this.__getValueInput().value;
- this.nestingLevel = 0;
-
- var menuGroup = this;
- if (menuGroup.options.expandSingle) {
- menuGroup.__panelMenu().bind("expand", function (event) {
- menuGroup.__childGroups().each (function (index, group) {
- if (event.target.id != group.id) {
- rf.$(group.id).collapse();
- }
- });
-
- event.stopPropagation();
- });
- }
-
- if (menuGroup.activeItem) {
- this.__panelMenu().ready(function () {
- var item = menuGroup.items[menuGroup.activeItem];
- item.__select();
- item.__fireSelect();
- })
- }
-
- this.__addUserEventHandler("collapse");
- this.__addUserEventHandler("expand");
- },
-
- getItems: function () {
- return this.items;
- },
-
- getItem: function (name) {
- return this.items[name];
- },
-
- /***************************** Public Methods
****************************************************************/
- /**
- * @methodOf
- * @name PanelMenu#selectItem
- *
- * TODO ...
- *
- * @param {String} name
- * @return {void} TODO ...
- */
- selectItem: function (name) {
- // TODO implement
- },
-
- /**
- * @methodOf
- * @name PanelMenu#selectedItem
- *
- * TODO ...
- *
- * @return {String} TODO ...
- */
- selectedItem: function (id) {
- if (id != undefined) {
- var valueInput = this.__getValueInput();
- var prevActiveItem = valueInput.value;
-
- this.activeItem = id;
- valueInput.value = id;
-
- return prevActiveItem;
- } else {
- return this.activeItem;
- }
- },
-
- __getValueInput : function() {
- return document.getElementById(this.id + "-value");
- },
-
- selectItem: function (itemName) {
- // TODO
- },
-
- /**
- * @methodOf
- * @name PanelMenu#expandAll
- *
- * TODO ...
- *
- * @return {void} TODO ...
- */
- expandAll: function () {
- // TODO implement
- },
-
- /**
- * @methodOf
- * @name PanelMenu#collapseAll
- *
- * TODO ...
- *
- * @return {void} TODO ...
- */
- collapseAll: function () {
- // TODO implement
- },
-
- /**
- * @methodOf
- * @name PanelMenu#expandGroup
- *
- * TODO ...
- *
- * @param {String} groupName
- * @return {void} TODO ...
- */
- expandGroup: function (groupName) {
- // TODO implement
- },
-
- /**
- * @methodOf
- * @name PanelMenu#collapseGroup
- *
- * TODO ...
- *
- * @param {String} groupName
- * @return {void} TODO ...
- */
- collapseGroup: function (groupName) {
- // TODO implement
- },
-
-
- /***************************** Private Methods
****************************************************************/
-
-
- __panelMenu : function () {
- return $(rf.getDomElement(this.id));
- },
-
- __childGroups : function () {
- return this.__panelMenu().children(".rf-pm-top-gr")
- },
-
- /**
- * @private
- * */
- __addUserEventHandler : function (name) {
- var handler = this.options["on" + name];
- if (handler) {
- rf.Event.bindById(this.id, name, handler);
- }
- },
-
- destroy: function () {
- rf.Event.unbindById(this.id, "."+this.namespace);
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.PanelMenu.$super;
-
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.TabPanel = rf.ui.TogglePanel.extendClass({
- // class name
- name:"TabPanel",
-
- /**
- * @class TabPanel
- * @name TabPanel
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- rf.ui.TogglePanel.call(this, componentId, options);
- this.items = [];
-
- this.isKeepHeight = options["isKeepHeight"] || false
- }
- });
-})(jQuery, RichFaces);
Deleted: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.Tab = rf.ui.TogglePanelItem.extendClass({
- // class name
- name:"Tab",
-
- /**
- * @class AccordionItem
- * @name AccordionItem
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- $super.constructor.call(this, componentId, options);
- this.index = options["index"];
- this.getTogglePanel().getItems()[this.index] = this;
-
- //TODO - optimize this
- rf.Event.bindById(this.id + ":header:active", "click",
this.__onHeaderClick, this);
- rf.Event.bindById(this.id + ":header:inactive", "click",
this.__onHeaderClick, this)
- },
-
- /***************************** Public Methods
****************************************************************/
-
- __onHeaderClick : function (comp) {
- this.getTogglePanel().switchToItem(this.getName());
- },
-
- /**
- * @param state {string} = inactive | active | disabled
- * in that case looking header by css class appropriate to this state
- *
- * @return {jQuery Object}
- * */
- __header : function (state) {
- var res = $(rf.getDomElement(this.id + ":header"));
- if (state) {
- return $(rf.getDomElement(this.id + ":header:" + state));
- }
-
- return res;
- },
-
- /**
- * @return {jQuery Object}
- * */
- __content : function () {
- if (!this.__content_) {
- this.__content_ = $(rf.getDomElement(this.id + ":content"));
- }
- return this.__content_;
- },
-
- /**
- * @private
- *
- * used in TogglePanel
- * */
- __enter : function () {
-
- this.__content().show();
- this.__header("inactive").hide();
- this.__header("active").show();
-
- return this.__fireEnter();
- },
-
- getHeight : function (recalculate) {
- if (recalculate || !this.__height) {
- this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
- }
-
- return this.__height;
- },
-
- /**
- * @private
- *
- * used in TogglePanel
- * */
- __leave : function () {
- var continueProcess = this.__fireLeave();
- if (!continueProcess) {
- return false;
- }
-
- this.__content().hide();
- this.__header("active").hide();
- this.__header("inactive").show();
-
- return true;
- },
-
- /***************************** Private Methods
********************************************************/
-
-
- destroy: function () {
- var parent = this.getTogglePanel();
- delete parent.getItems()[this.index];
-
- rf.Event.unbindById(this.id);
-
- //TODO - optimize
- rf.Event.unbindById(this.id + ":header:active");
- rf.Event.unbindById(this.id + ":header:inactive");
-
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.Tab.$super;
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.TogglePanelItem = rf.BaseComponent.extendClass({
-
- // class name
- name:"TogglePanelItem",
-
- init : function (componentId, options) {
- // call constructor of parent class
- $super.constructor.call(this, componentId);
- this.attachToDom();
-
- this.options = $.extend(this.options, options || {});
- this.name = this.options.name;
- this.togglePanelId = this.options.togglePanelId;
- this.switchMode = this.options.switchMode;
- this.disabled = this.options.disabled || false;
- },
-
- /***************************** Public Methods
*****************************************************************/
- /**
- * @methodOf TogglePanelItem
- * @name TogglePanelItem#getName
- *
- * @return {String} panel item name
- */
- getName: function () {
- return this.options.name;
- },
-
- /**
- * @methodOf
- * @name TogglePanelItem#getTogglePanel
- *
- * @return {TogglePanel} parent TogglePanel
- * */
- getTogglePanel : function () {
- return rf.$(this.togglePanelId);
- },
-
- /**
- * @methodOf
- * @name TogglePanelItem#isSelected
- *
- * @return {Boolean} true if this panel item is selected in the parent toggle
panel
- * */
- isSelected : function () {
- return this.getName() == this.getTogglePanel().getSelectItem();
- },
-
-
- /***************************** Private Methods
****************************************************************/
-
- /**
- * @private
- *
- * used in TogglePanel
- * */
- __enter : function () {
- rf.getDomElement(this.id).style.display = "block";
-
- return this.__fireEnter();
- },
-
- /**
- * @private
- *
- * used in TogglePanel
- * */
- __leave : function () {
- var continueProcess = this.__fireLeave();
- if (!continueProcess) {
- return false;
- }
-
- rf.getDomElement(this.id).style.display = "none";
- return true;
- },
-
- __fireLeave : function () {
- return rf.Event.fireById(this.id, "__leave");
- },
-
- __fireEnter : function () {
- return rf.Event.fireById(this.id, "__enter");
- },
-
- // class stuff
- destroy: function () {
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.TogglePanelItem.$super;
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,433 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- /* SIMPLE INNER CLASS for handle switch operation*/
- function SwitchItems(comp) {
- this.comp = comp;
- }
-
- SwitchItems.prototype = {
-
- /**
- * @param {TogglePanelItem} oldPanel
- * @param {TogglePanelItem} newPanel
- *
- * @return {void}
- * */
- exec : function (oldPanel, newPanel) {
- if (newPanel.switchMode == "server") {
- return this.execServer(oldPanel, newPanel);
- } else if (newPanel.switchMode == "ajax") {
- return this.execAjax(oldPanel, newPanel);
- } else if (newPanel.switchMode == "client") {
- return this.execClient(oldPanel, newPanel);
- } else {
- rf.log.error("SwitchItems.exec : unknown switchMode (" +
this.comp.switchMode + ")");
- }
- },
-
- /**
- * @protected
- * @param {TogglePanelItem} oldPanel
- * @param {TogglePanelItem} newPanel
- *
- * @return {Boolean} false
- * */
- execServer : function (oldPanel, newPanel) {
- if (oldPanel) {
- var continueProcess = oldPanel.__leave();
- if (!continueProcess) {
- return false;
- }
- }
-
- this.__setActiveItem(newPanel.getName());
-
- rf.submitForm(this.__getParentForm());
-
- return false;
- },
-
- /**
- * @protected
- * @param {TogglePanelItem} oldPanel
- * @param {TogglePanelItem} newPanel
- *
- * @return {Boolean} false
- * */
- execAjax : function (oldPanel, newPanel) {
- var options = $.extend({}, this.comp.options["ajax"],
{}/*this.getParameters(newPanel)*/);
-
- this.__setActiveItem(newPanel.getName());
- rf.ajax(this.comp.id, null, options);
-
- if (oldPanel) {
- this.__setActiveItem(oldPanel.getName());
- }
-
- return false;
- },
-
- /**
- * @protected
- * @param {TogglePanelItem} oldPanel
- * @param {TogglePanelItem} newPanel
- *
- * @return {undefined}
- * - false - if process has been terminated
- * - true - in other cases
- * */
- execClient : function (oldPanel, newPanel) {
- if (oldPanel) {
- var continueProcess = oldPanel.__leave();
- if (!continueProcess) {
- return false;
- }
- }
-
- this.__setActiveItem(newPanel.getName());
-
- newPanel.__enter();
- this.comp.__fireItemChange(oldPanel, newPanel);
-
- return true;
- },
-
- /**
- * @private
- * */
- __getParentForm : function () {
- return $(rf.getDomElement(this.comp.id)).parents('form:first');
- },
-
- /**
- * @private
- * */
- __setActiveItem : function (name) {
- rf.getDomElement(this.__getValueInputId()).value = name;
- this.comp.activeItem = name;
- },
-
- /**
- * @private
- * */
- __getValueInputId: function () {
- return this.comp.id + "-value"
- }
- };
-
- /**
- * @class TogglePanel
- * @name TogglePanel
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- rf.ui.TogglePanel = rf.BaseComponent.extendClass({
-
- // class name
- name:"TogglePanel",
-
- init : function (componentId, options) {
- $super.constructor.call(this, componentId);
- this.attachToDom();
-
- this.options = $.extend(this.options, options || {});
- this.activeItem = this.options.activeItem;
- this.items = this.options.items;
-
- this.__addUserEventHandler("itemchange");
- this.__addUserEventHandler("beforeitemchange");
- },
-
- /***************************** Public Methods
****************************************************************/
-
- /**
- * @methodOf
- *
- * @name TogglePanel#getSelectItem
- *
- * @return {String} name of current selected panel item
- */
- getSelectItem: function () {
- return this.activeItem;
- },
-
- /**
- * @methodOf
- * @name TogglePanel#switchToItem
- *
- * @param {String} name - panel item name to switch
- * we can use meta names @first, @prev, @next and @last
- * @return {Boolean} - false if something wrong and true if all is ok
- */
- switchToItem: function (name) {
- var newPanel = this.getNextItem(name);
- if (newPanel == null) {
- rf.log.warn("TogglePanel.switchToItems(" + name + "): item
with name '" + name + "' not found");
- return false;
- }
-
- var oldPanel = this.__getItemByName(this.getSelectItem());
-
- var continueProcess = this.__fireBeforeItemChange(oldPanel, newPanel);
- if (!continueProcess) {
- rf.log.warn("TogglePanel.switchToItems(" + name + "):
switch has been canceled by beforeItemChange event");
- return false
- }
-
- return new SwitchItems(this).exec(oldPanel, newPanel);
- },
-
- /**
- * @methodOf
- * @name TogglePanel#getNextItem
- *
- * @param {String} name of TogglePanelItem or meta name (@first | @prev | @next |
@last)
- * @return {TogglePanelItem} null if item not found
- */
- getNextItem : function (name) {
- if (name) {
- var newItemIndex = this.__ITEMS_META_NAMES[name];
- if (newItemIndex) {
- return this.__getItem(newItemIndex(this));
- } else {
- return this.__getItemByName(name);
- }
- } else {
- return this.__getItemByName(this.nextItem());
- }
- },
-
- /**
- * please, remove this method when client side ajax events will be added
- *
- * */
- onCompleteHandler : function (newItemName) {
- var oldItem = this.__getItemByName(this.activeItem);
- var newItem = this.__getItemByName(newItemName);
-
- // Don't do like this and remove it ASAP
- new SwitchItems(this).execClient(oldItem, newItem);
- },
-
- /**
- * @methodOf
- * @name TogglePanel#getItems
- *
- * @return {TogglePanelItem[]} all defined panel items
- */
- getItems : function () {
- return this.items;
- },
-
- /**
- * @methodOf
- * @name TogglePanel#getItemsNames
- *
- * @return {String[]} names of all defined items
- */
- getItemsNames: function () {
- var res = [];
- for (var item in this.items) {
- res.push(this.items[item].getName());
- }
-
- return res;
- },
-
- /**
- * @methodOf
- * @name TogglePanel#nextItem
- *
- * @param {String} [itemName = activeItem]
- * @return {String} name of next panel item
- */
- nextItem: function (itemName) {
- var itemIndex = this.__getItemIndex(itemName || this.activeItem);
- if (itemIndex == -1) {
- return null;
- }
-
- return this.__getItemName(itemIndex + 1);
- },
-
- /**
- * @methodOf
- * @name TogglePanel#firstItem
- *
- * @return {String} name of first panel item
- */
- firstItem: function () {
- return this.__getItemName(0);
- },
-
- /**
- * @methodOf
- * @name TogglePanel#lastItem
- *
- * @return {String} name of last panel item
- */
- lastItem: function () {
- return this.__getItemName(this.items.length - 1);
- },
-
- /**
- * @methodOf
- * @name TogglePanel#prevItem
- *
- * @param {String} itemName
- * @return {String} name of prev panel item
- * null if it is first item
- */
- prevItem: function (itemName) {
- var itemIndex = this.__getItemIndex(itemName || this.activeItem);
- if (!this.options.cycledSwitching && itemIndex < 1) {
- return null;
- }
-
- return this.__getItemName(itemIndex - 1);
- },
-
-
/////////////////////////////////////////////////////////////////////////////////
- //// Private
-
/////////////////////////////////////////////////////////////////////////////////
-
- /********************* Methods *************************/
-
- __ITEMS_META_NAMES : (function () {
- function goFrom (comp, ind, step) {
- var res = ind;
- while ((!comp.items[res] || comp.items[res].disabled) && res <
comp.items.length && res > 0) {
- res += step;
- }
- return res;
- }
-
-
- return {
- "@first" : function (comp) {
- return goFrom(comp, 0, 1);
- },
-
- "@prev" : function (comp) {
- return goFrom(comp, parseInt(comp.__getItemIndex(comp.activeItem)) -
1 , -1);
- },
-
- "@next" : function (comp) {
- return goFrom(comp, parseInt(comp.__getItemIndex(comp.activeItem)) +
1 , 1);
- },
-
- "@last" : function (comp) {
- return goFrom(comp, comp.items.length - 1, -1);
- }
- }
- })(),
-
- /**
- * @private
- * */
- __getItemIndex : function (itemName) {
- for (var i in this.items) {
- if (!this.items[i].disabled && this.items[i].getName() ===
itemName) {
- return parseInt(i);
- }
- }
-
- rf.log.info("TogglePanel.getItemIndex: item with name '" +
itemName + "' not found");
- return -1;
- },
-
- /**
- * @private
- * */
- __addUserEventHandler : function (name) {
- var handler = this.options["on" + name];
- if (handler) {
- rf.Event.bindById(this.id, name, handler);
- }
- },
-
- /**
- * @private
- * @param {Number} index - array index
- *
- * @return {TogglePanelItem}
- * null - if item not found
- * */
- __getItem : function (index) {
- if (this.options.cycledSwitching) {
- var size = this.items.length;
- return this.items[(size + index) % size]
- } else if (index >= 0 && index < this.items.length) {
- return this.items[index]
- } else {
- return null;
- }
- },
-
- __getItemByName : function (name) {
- return this.__getItem(this.__getItemIndex(name));
- },
-
- __getItemName : function (index) {
- var item = this.__getItem(index);
- if (item == null) {
- return null;
- }
-
- return item.getName();
- },
-
- /**
- * Fire Concealable Event
- * */
-
- __fireItemChange : function (oldItem, newItem) {
- return new rf.Event.fireById(this.id, "itemchange", {
- id: this.id,
- oldItem : oldItem,
- newItem : newItem
- });
- },
-
- __fireBeforeItemChange : function (oldItem, newItem) {
- return rf.Event.fireById(this.id, "beforeitemchange", {
- id: this.id,
- oldItem : oldItem,
- newItem : newItem
- });
- },
-
- destroy: function () {
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.TogglePanel.$super;
-})(jQuery, RichFaces);
Deleted:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip_.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip_.js 2010-12-08
12:27:08 UTC (rev 20456)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip_.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -1,295 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.TooltipDirection = {
- topRight : "topRight",
- topLeft : "topLeft",
- bottomRight : "bottomRight",
- bottomLeft : "bottomLeft",
- auto : "auto",
-
- DEFAULT: "bottomRight"
- };
- var TooltipDirection = rf.ui.TooltipDirection;
-
- rf.ui.TooltipMode = {
- client : "client",
- ajax : "ajax",
-
- DEFAULT: "client"
- };
- var TooltipMode = rf.ui.TooltipMode;
-
- var DEFAULT_OPTIONS = {
- direction : TooltipDirection.DEFAULT,
- attached : true,
- offset : [],
- mode : TooltipMode.DEFAULT,
- disabled : false,
- hideDelay : 0,
- hideEvent : "mouseleave",
- showDelay : 0,
- showEvent : "mouseenter",
- followMouse : true
- };
-
- var SHOW_ACTION = {
-
- /**
- *
- * @return {void}
- * */
- exec : function (tooltip, event) {
- var mode = tooltip.mode;
- if (mode == TooltipMode.ajax) {
- return this.execAjax(tooltip, event);
- } else if (mode == TooltipMode.client) {
- return this.execClient(tooltip, event);
- } else {
- rf.log.error("SHOW_ACTION.exec : unknown mode (" + mode +
")");
- }
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execAjax : function (tooltip, event) {
- tooltip.__loading().show();
- tooltip.__content().hide();
- tooltip.__show(event);
-
- rf.ajax(tooltip.id, null, $.extend({}, tooltip.options["ajax"],
{}));
-
- return true;
- },
-
- /**
- * @protected
- *
- * @return {undefined}
- * - false - if process has been terminated
- * - true - in other cases
- * */
- execClient : function (tooltip, event) {
- tooltip.__show(event);
-
- return tooltip.__fireShow();
- }
- };
-
- rf.ui.Tooltip = rf.BaseComponent.extendClass({
- // class name
- name:"Tooltip",
-
- /**
- * @class Tooltip
- * @name Tooltip
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- $super.constructor.call(this, componentId);
- this.options = $.extend(this.options, DEFAULT_OPTIONS, options || {});
- this.attachToDom();
-
- this.mode = this.options.mode;
- this.target = this.options.target;
-
- this.__addUserEventHandler("hide");
- this.__addUserEventHandler("show");
- this.__addUserEventHandler("beforehide");
- this.__addUserEventHandler("beforeshow");
-
- this.popup = new RichFaces.ui.Popup(this.id, {
- attachTo: this.target,
- attachToBody: false,
- positionType: "TOOLTIP",
- positionOffset: [200,200]
- });
-
- var tooltip = this;
- function mouseMoveHandler(event) {
- tooltip.popup.show(event);
- }
-
- $(document.getElementById(this.target)).bind(this.options.showEvent, function
(event) {
- tooltip.show(event);
-
- if (tooltip.options.followMouse) {
-
$(document.getElementById(tooltip.target)).bind("mousemove", mouseMoveHandler);
- }
- });
-
- $(document.getElementById(tooltip.target)).bind(this.options.hideEvent,
function (event) {
- tooltip.hide();
-
- if (tooltip.options.followMouse) {
-
$(document.getElementById(tooltip.target)).unbind("mousemove",
mouseMoveHandler);
- }
- });
-
- },
-
- /***************************** Public Methods
****************************************************************/
- /**
- * @methodOf
- * @name PanelMenuItem#hide
- *
- * TODO ...
- *
- * @return {void} TODO ...
- */
- hide: function () {
- var continueProcess = this.__fireBeforeHide();
- if (!continueProcess) {
- return false;
- }
-
- this.__hide();
-
- return this.__fireHide()
- },
-
- /**
- * @private
- * @return {void} TODO ...
- */
- __hide: function () {
- var tooltip = this;
- this.__delay(this.options.hideDelay, function () {
- tooltip.popup.hide();
- });
- },
-
- /**
- * @methodOf
- * @name PanelMenuItem#show
- *
- * TODO ...
- *
- * @return {void} TODO ...
- */
- show: function (event) {
- var continueProcess = this.__fireBeforeShow();
- if (!continueProcess) {
- return false;
- }
-
- SHOW_ACTION.exec(this, event);
- },
-
- onCompleteHandler : function () {
- this.__content().show();
- this.__loading().hide();
-
- return this.__fireShow();
- },
-
- /**
- * @private
- * @return {void} TODO ...
- */
- __show: function (event) {
- var tooltip = this;
- this.__delay(this.options.showDelay, function () {
- tooltip.popup.show(event);
- });
- },
-
- /***************************** Private Methods
****************************************************************/
- __delay : function (delay, action) {
- if (delay > 0) {
- var hidingTimerHandle = window.setTimeout(function() {
- action();
-
- if (hidingTimerHandle) {
- window.clearTimeout(hidingTimerHandle);
- hidingTimerHandle = undefined;
- }
- }, delay);
- } else {
- action();
- }
- },
-
- __detectAncestorNode: function(leaf, element) {
- // Return true if "element" is "leaf" or one of its
parents
- var node = leaf;
- while (node != null && node != element) {
- node = node.parentNode;
- }
- return (node != null);
- },
-
- __loading : function () {
- return $(document.getElementById(this.id + ":loading"));
- },
-
- __content : function () {
- return $(document.getElementById(this.id + "@content"));
- },
-
- __fireHide : function () {
- return rf.Event.fireById(this.id, "hide", { id: this.id });
- },
-
- __fireShow : function () {
- return rf.Event.fireById(this.id, "show", { id: this.id });
- },
-
- __fireBeforeHide : function () {
- return rf.Event.fireById(this.id, "beforehide", { id: this.id });
- },
-
- __fireBeforeShow : function () {
- return rf.Event.fireById(this.id, "beforeshow", { id: this.id });
- },
-
-
-
- /**
- * @private
- * */
- __addUserEventHandler : function (name) {
- var handler = this.options["on" + name];
- if (handler) {
- rf.Event.bindById(this.id, name, handler);
- }
- },
-
- destroy: function () {
- $super.destroy.call(this);
- }
- });
-
- // define super class link
- var $super = rf.ui.Tooltip.$super;
-})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.js (from
rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion_.js)
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Accordion = rf.ui.TogglePanel.extendClass({
+ // class name
+ name:"Accordion",
+
+ /**
+ * @class Accordion
+ * @name Accordion
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ $super.constructor.call(this, componentId, options);
+ this.items = [];
+
+ this.isKeepHeight = options["isKeepHeight"] || false
+ },
+
+ /***************************** Public Methods
****************************************************************/
+
+ getHeight : function (recalculate) {
+ if (recalculate || !this.__height) {
+ this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
+ }
+
+ return this.__height;
+ },
+
+ getInnerHeight : function (recalculate) {
+ if (recalculate || !this.__innerHeight) {
+ this.__innerHeight = $(rf.getDomElement(this.id)).innerHeight(true)
+ }
+
+ return this.__innerHeight;
+ },
+
+ /***************************** Private Methods
********************************************************/
+
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "." + this.namespace);
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.Accordion.$super;
+})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordionItem.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem_.js)
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordionItem.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordionItem.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.AccordionItem = rf.ui.TogglePanelItem.extendClass({
+ // class name
+ name:"AccordionItem",
+
+ /**
+ * @class AccordionItem
+ * @name AccordionItem
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ $super.constructor.call(this, componentId, options);
+ this.index = options["index"];
+ this.getTogglePanel().getItems()[this.index] = this;
+
+ if (!this.disabled) {
+ rf.Event.bindById(this.id + ":header", "click",
this.__onHeaderClick, this);
+ }
+
+ if (this.isSelected()) {
+ var item = this;
+ $(document).ready(function () {
+ item.__fitToHeight(item.getTogglePanel());
+ });
+ }
+ },
+
+ /***************************** Public Methods
****************************************************************/
+
+ __onHeaderClick : function (comp) {
+ this.getTogglePanel().switchToItem(this.getName());
+ },
+
+ /**
+ * @param state {string} = inactive | active | disabled
+ * in that case looking header by css class appropriate to this state
+ *
+ * @return {jQuery Object}
+ * */
+ __header : function (state) {
+ var res = $(rf.getDomElement(this.id + ":header"));
+ if (state) {
+ return res.find(".rf-ac-itm-hdr-" + state);
+ }
+
+ return res;
+ },
+
+ /**
+ * @return {jQuery Object}
+ * */
+ __content : function () {
+ if (!this.__content_) {
+ this.__content_ = $(rf.getDomElement(this.id + ":content"));
+ }
+ return this.__content_;
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __enter : function () {
+ var parentPanel = this.getTogglePanel();
+ if (parentPanel.isKeepHeight) {
+ this.__content().hide(); // TODO ?
+ this.__fitToHeight(parentPanel);
+ }
+
+ this.__content().show();
+ this.__header("inact").hide();
+ this.__header("act").show();
+
+ return this.__fireEnter();
+ },
+
+ __fitToHeight : function (parentPanel) {
+ var h = parentPanel.getInnerHeight();
+
+ var items = parentPanel.getItems();
+ for (var i in items) {
+ h -= items[i].__header().outerHeight();
+ }
+
+ this.__content().height(h - 20); // 20 it is padding top and bottom
+ },
+
+ getHeight : function (recalculate) {
+ if (recalculate || !this.__height) {
+ this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
+ }
+
+ return this.__height;
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __leave : function () {
+ var continueProcess = this.__fireLeave();
+ if (!continueProcess) {
+ return false;
+ }
+
+ this.__content().hide();
+ this.__header("act").hide();
+ this.__header("inact").show();
+
+ return true;
+ },
+
+ /***************************** Private Methods
********************************************************/
+
+
+ destroy: function () {
+ var parent = this.getTogglePanel();
+ delete parent.getItems()[this.index];
+
+ rf.Event.unbindById(this.id, "."+this.namespace);
+
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.AccordionItem.$super;
+})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanel.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanel_.js)
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanel.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanel.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.CollapsiblePanel = rf.ui.TogglePanel.extendClass({
+
+ name:"CollapsiblePanel",
+
+ /**
+ * @class CollapsiblePanel
+ * @name CollapsiblePanel
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ rf.ui.TogglePanel.call(this, componentId, options);
+ this.switchMode = options.switchMode;
+
+ this.__addUserEventHandler("beforeswitch");
+ this.__addUserEventHandler("switch");
+
+ this.items = [
+ new RichFaces.ui.CollapsiblePanelItem(
+ this.id + ":content", {"index":0,
"togglePanelId":this.id, "switchMode":this.switchMode,
"name":"true"}),
+
+ new RichFaces.ui.CollapsiblePanelItem(
+ this.id + ":empty", {"index":1,
"togglePanelId":this.id, "switchMode":this.switchMode,
"name":"false"})
+ ];
+ this.options.cycledSwitching = true;
+
+ rf.Event.bindById(this.id + ":header", "click",
this.__onHeaderClick, this)
+ },
+
+ switchPanel : function (to) {
+ this.switchToItem(to || "@next");
+ },
+
+ /***************************** Private Methods
********************************************************/
+
+ __onHeaderClick : function () {
+ this.switchToItem("@next");
+ },
+
+ __fireItemChange : function (oldItem, newItem) {
+ return new rf.Event.fireById(this.id, "switch", {
+ id: this.id,
+ isExpanded : newItem.getName()
+ });
+ },
+
+ __fireBeforeItemChange : function (oldItem, newItem) {
+ return rf.Event.fireById(this.id, "beforeswitch", {
+ id: this.id,
+ isExpanded : newItem.getName()
+ });
+ }
+ });
+})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanelItem.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem_.js)
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanelItem.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/collapsiblePanelItem.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.CollapsiblePanelItem = rf.ui.TogglePanelItem.extendClass({
+
+ init : function (componentId, options) {
+ rf.ui.TogglePanelItem.call(this, componentId, options);
+ },
+
+ __enter : function () {
+ rf.getDomElement(this.id).style.display = "block";
+ this.__header(this.__state()).show();
+
+ return true;
+ },
+
+ __leave : function () {
+ rf.getDomElement(this.id).style.display = "none";
+ this.__header(this.__state()).hide();
+
+ return true;
+ },
+
+ __state : function () {
+ return this.getName() === "true" ? "exp" :
"colps";
+ },
+
+ __header : function (state) {
+ var res = $(rf.getDomElement(this.togglePanelId + ":header"));
+ if (state) {
+ return res.find(".rf-cp-hdr-" + state);
+ }
+
+ return res;
+ }
+ });
+})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js (from
rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu_.js)
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,211 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ expandSingle : true
+ };
+
+ rf.ui.PanelMenu = rf.BaseComponent.extendClass({
+ // class name
+ name:"PanelMenu",
+
+ /**
+ * @class PanelMenu
+ * @name PanelMenu
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ $super.constructor.call(this, componentId);
+ this.items = [];
+ this.attachToDom();
+
+ this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
+ this.activeItem = this.__getValueInput().value;
+ this.nestingLevel = 0;
+
+ var menuGroup = this;
+ if (menuGroup.options.expandSingle) {
+ menuGroup.__panelMenu().bind("expand", function (event) {
+ menuGroup.__childGroups().each (function (index, group) {
+ if (event.target.id != group.id) {
+ rf.$(group.id).collapse();
+ }
+ });
+
+ event.stopPropagation();
+ });
+ }
+
+ if (menuGroup.activeItem) {
+ this.__panelMenu().ready(function () {
+ var item = menuGroup.items[menuGroup.activeItem];
+ item.__select();
+ item.__fireSelect();
+ })
+ }
+
+ this.__addUserEventHandler("collapse");
+ this.__addUserEventHandler("expand");
+ },
+
+ getItems: function () {
+ return this.items;
+ },
+
+ getItem: function (name) {
+ return this.items[name];
+ },
+
+ /***************************** Public Methods
****************************************************************/
+ /**
+ * @methodOf
+ * @name PanelMenu#selectItem
+ *
+ * TODO ...
+ *
+ * @param {String} name
+ * @return {void} TODO ...
+ */
+ selectItem: function (name) {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#selectedItem
+ *
+ * TODO ...
+ *
+ * @return {String} TODO ...
+ */
+ selectedItem: function (id) {
+ if (id != undefined) {
+ var valueInput = this.__getValueInput();
+ var prevActiveItem = valueInput.value;
+
+ this.activeItem = id;
+ valueInput.value = id;
+
+ return prevActiveItem;
+ } else {
+ return this.activeItem;
+ }
+ },
+
+ __getValueInput : function() {
+ return document.getElementById(this.id + "-value");
+ },
+
+ selectItem: function (itemName) {
+ // TODO
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#expandAll
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ expandAll: function () {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#collapseAll
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ collapseAll: function () {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#expandGroup
+ *
+ * TODO ...
+ *
+ * @param {String} groupName
+ * @return {void} TODO ...
+ */
+ expandGroup: function (groupName) {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#collapseGroup
+ *
+ * TODO ...
+ *
+ * @param {String} groupName
+ * @return {void} TODO ...
+ */
+ collapseGroup: function (groupName) {
+ // TODO implement
+ },
+
+
+ /***************************** Private Methods
****************************************************************/
+
+
+ __panelMenu : function () {
+ return $(rf.getDomElement(this.id));
+ },
+
+ __childGroups : function () {
+ return this.__panelMenu().children(".rf-pm-top-gr")
+ },
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "."+this.namespace);
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.PanelMenu.$super;
+
+})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup_.js)
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,365 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ expanded : false,
+ expandSingle : true,
+ bubbleSelection : true,
+ stylePrefix : "rf-pm-gr",
+
+ // TODO we should use selectionType = {none, selectable, unselectable}
+ selectable : false,
+ unselectable : false // unselectable can be only selectable item => if
selectable == false than unselectable = false
+ };
+
+ var EXPAND_ITEM = {
+
+ /**
+ *
+ * @return {void}
+ * */
+ exec : function (group, expand) {
+ var mode = group.mode;
+ if (mode == "server") {
+ return this.execServer(group);
+ } else if (mode == "ajax") {
+ return this.execAjax(group);
+ } else if (mode == "client" || mode == "none") {
+ return this.execClient(group, expand);
+ } else {
+ rf.log.error("EXPAND_ITEM.exec : unknown mode (" + mode +
")");
+ }
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execServer : function (group) {
+ group.__changeState();
+ rf.submitForm(this.__getParentForm(group));
+
+ return false;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (group) {
+ var oldState = group.__changeState();
+ rf.ajax(group.id, null, $.extend({}, group.options["ajax"], {}));
+ group.__restoreState(oldState);
+
+ return true;
+ },
+
+ /**
+ * @protected
+ *
+ * @param {PanelMenuGroup} group
+ * @param {Boolean} expand
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (group, expand) {
+ if (expand) {
+ group.expand();
+ } else {
+ group.collapse();
+ }
+
+ return group.__fireSwitch();
+ },
+
+ /**
+ * @private
+ * */
+ __getParentForm : function (item) {
+ return $($(rf.getDomElement(item.id)).parents("form")[0]);
+ }
+ };
+
+ rf.ui.PanelMenuGroup = rf.ui.PanelMenuItem.extendClass({
+ // class name
+ name:"PanelMenuGroup",
+
+ /**
+ * @class PanelMenuGroup
+ * @name PanelMenuGroup
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ $super.constructor.call(this, componentId);
+ this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
+
+ if (!this.options.disabled) {
+ var menuGroup = this;
+
+ if (!this.options.selectable) {
+ this.__header().bind("click", function () {
+ return menuGroup.switchExpantion();
+ });
+ }
+
+ if (this.options.selectable || this.options.bubbleSelection) {
+ this.__content().bind("select", function (event) {
+ if (menuGroup.options.selectable &&
menuGroup.__isMyEvent(event)) {
+ menuGroup.expand();
+ }
+
+ if (menuGroup.options.bubbleSelection &&
!menuGroup.__isMyEvent(event)) {
+ menuGroup.__select();
+ if (!menuGroup.expanded()) {
+ menuGroup.expand();
+ }
+ }
+ });
+
+ this.__content().bind("unselect", function (event) {
+ if (menuGroup.options.selectable &&
menuGroup.__isMyEvent(event)) {
+ menuGroup.collapse();
+ }
+
+ if (menuGroup.options.bubbleSelection &&
!menuGroup.__isMyEvent(event)) {
+ menuGroup.__unselect();
+ }
+ });
+ }
+
+ if (menuGroup.options.expandSingle) {
+ menuGroup.__group().bind("expand", function (event) {
+ if (menuGroup.__isMyEvent(event)) {
+ return;
+ }
+
+ menuGroup.__childGroups().each (function (index, group) {
+ var rfGroup = rf.$(group);
+ if (!rfGroup.__isMyEvent(event)) {
+ rfGroup.collapse();
+ }
+ });
+
+ event.stopPropagation();
+ });
+ }
+
+ this.__addUserEventHandler("collapse");
+ this.__addUserEventHandler("expand");
+ }
+ },
+
+ /***************************** Public Methods
****************************************************************/
+ expanded : function () {
+ // TODO check invariant in dev mode
+ // return this.__content().hasClass("rf-pm-exp")
+ return this.__getExpandValue();
+ },
+
+ expand : function () {
+ this.__expand();
+
+ return this.__fireExpand();
+ },
+
+ __expand : function () {
+
this.__content().removeClass("rf-pm-colps").addClass("rf-pm-exp");
+ var header = this.__header();
+ header.find(".rf-pm-ico-colps").hide();
+ header.find(".rf-pm-ico-exp").show();
+
+ this.__setExpandValue(true);
+ },
+
+ collapsed : function () {
+ // TODO check invariant in dev mode
+ // return this.__content().hasClass("rf-pm-colps")
+ return !this.__getExpandValue();
+ },
+
+ collapse : function () {
+ this.__collapse();
+
+ this.__childGroups().each (function(index, group) {
+ rf.$(group.id).__collapse();
+ });
+
+ this.__fireCollapse();
+ },
+
+ __collapse : function () {
+
this.__content().addClass("rf-pm-colps").removeClass("rf-pm-exp");
+ var header = this.__header();
+ header.find(".rf-pm-ico-exp").hide();
+ header.find(".rf-pm-ico-colps").show();
+
+ this.__setExpandValue(false);
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuGroup#switch
+ *
+ * TODO ...
+ *
+ * @param {boolean} expand
+ * @return {void} TODO ...
+ */
+ switchExpantion : function () { // TODO rename
+ var continueProcess = this.__fireBeforeSwitch();
+ if (!continueProcess) {
+ return false;
+ }
+
+ EXPAND_ITEM.exec(this, !this.expanded());
+ },
+
+ /**
+ * please, remove this method when client side ajax events will be added
+ *
+ * */
+ onCompleteHandler : function () {
+ EXPAND_ITEM.execClient(this, this.expanded());
+ },
+
+ __switch : function (expand) {
+ if (expand) {
+ this.expand();
+ } else {
+ this.collapse();
+ }
+ },
+
+ /***************************** Private Methods
****************************************************************/
+ __childGroups : function () {
+ return this.__content().children(".rf-pm-gr")
+ },
+
+ __group : function () {
+ return $(rf.getDomElement(this.id))
+ },
+
+ __header : function () {
+ return $(rf.getDomElement(this.id + ":hdr"))
+ },
+
+ __content : function () {
+ return $(rf.getDomElement(this.id + ":cnt"))
+ },
+
+ __expandValueInput : function () {
+ return document.getElementById(this.id + ":expanded");
+ },
+
+ __getExpandValue : function () {
+ return this.__expandValueInput().value == "true";
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuGroup#__setExpandValue
+ *
+ * @param {boolean} value - is group expanded?
+ * @return {boolean} preview value
+ */
+ __setExpandValue : function (value) {
+ var input = this.__expandValueInput();
+ var oldValue = input.value;
+
+ input.value = value;
+
+ return oldValue;
+ },
+
+ __changeState : function () {
+ var state = {};
+ state["expanded"] =
this.__setExpandValue(!this.__getExpandValue());
+ if (this.options.selectable) {
+ state["itemName"] =
this.__rfPanelMenu().selectedItem(this.itemName); // TODO bad function name for function
which change component state
+ }
+
+ return state;
+ },
+
+ __restoreState : function (state) {
+ if (!state) {
+ return;
+ }
+
+ if (state["expanded"]) {
+ this.__setExpandValue(state["expanded"]);
+ }
+
+ if (state["itemName"]) {
+ this.__rfPanelMenu().selectedItem(state["itemName"]);
+ }
+ },
+
+ __fireSwitch : function () {
+ return new rf.Event.fireById(this.id, "switch", {
+ id: this.id
+ });
+ },
+
+ __isMyEvent: function (event) {
+ return this.id == event.target.id;
+ },
+
+ __fireBeforeSwitch : function () {
+ return rf.Event.fireById(this.id, "beforeswitch", {
+ id: this.id
+ });
+ },
+
+ __fireCollapse : function () {
+ return new rf.Event.fireById(this.id, "collapse", {
+ id: this.id
+ });
+ },
+
+ __fireExpand : function () {
+ return new rf.Event.fireById(this.id, "expand", {
+ id: this.id
+ });
+ },
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "."+this.namespace);
+
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.PanelMenuGroup.$super;
+})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem_.js)
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,321 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ disabled : false,
+ selectable: true,
+ mode: "client",
+ unselectable: false,
+ highlight: true,
+ stylePrefix: "rf-pm-itm",
+ itemStep: 20
+ };
+
+ var SELECT_ITEM = {
+
+ /**
+ *
+ * @return {void}
+ * */
+ exec : function (item) {
+ var mode = item.mode;
+ if (mode == "server") {
+ return this.execServer(item);
+ } else if (mode == "ajax") {
+ return this.execAjax(item);
+ } else if (mode == "client" || mode == "none") {
+ return this.execClient(item);
+ } else {
+ rf.log.error("SELECT_ITEM.exec : unknown mode (" + mode +
")");
+ }
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execServer : function (item) {
+ item.__changeState();
+ rf.submitForm(this.__getParentForm(item));
+
+ return false;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (item) {
+ var oldItem = item.__changeState();
+ rf.ajax(item.__panelMenu().id, null, $.extend({},
item.options["ajax"], {}));
+ item.__restoreState(oldItem);
+
+ return true;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (item) {
+ var panelMenu = item.__rfPanelMenu();
+ if (panelMenu.selectedItem()) {
+ panelMenu.getItems()[panelMenu.selectedItem()].unselect();
+ }
+ panelMenu.selectedItem(item.itemName);
+
+ item.__select();
+
+ return item.__fireSelect();
+ },
+
+ /**
+ * @private
+ * */
+ __getParentForm : function (item) {
+ return $($(rf.getDomElement(item.id)).parents("form")[0]);
+ }
+ };
+
+ rf.ui.PanelMenuItem = rf.BaseComponent.extendClass({
+ // class name
+ name:"PanelMenuItem",
+
+ /**
+ * @class PanelMenuItem
+ * @name PanelMenuItem
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ $super.constructor.call(this, componentId);
+ this.attachToDom();
+
+ this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
+
+ this.mode = this.options.mode
+ this.itemName = this.options.name
+ this.__rfPanelMenu().getItems()[this.itemName] = this;
+
+ // todo move it
+ this.selectionClass = this.options.stylePrefix + "-sel";
+ this.hoverClass = this.options.stylePrefix + "-hov";
+
+ if (!this.options.disabled) {
+ var item = this;
+ if (this.options.highlight) {
+ this.__item().bind("mouseenter", function() {
+ item.highlight(true);
+ });
+ this.__item().bind("mouseleave", function() {
+ item.highlight(false);
+ });
+ }
+
+ if (this.options.selectable) {
+ this.__header().bind("click", function() {
+ if (item.__rfPanelMenu().selectedItem() == item.id) {
+ if (item.options.unselectable) {
+ return item.unselect();
+ }
+
+ // we shouldn't select one item several times
+ } else {
+ return item.select();
+ }
+ });
+ }
+ }
+
+ item = this;
+ $(this.__panelMenu()).ready(function () {
+ item.__renderNestingLevel();
+ });
+
+ this.__addUserEventHandler("select");
+ },
+
+ /***************************** Public Methods
****************************************************************/
+ highlight : function (highlight) {
+ if (highlight && !this.selected()) {
+ this.__header().addClass(this.hoverClass);
+ } else {
+ this.__header().removeClass(this.hoverClass);
+ }
+ },
+
+ selected : function () {
+ return this.__header().hasClass(this.selectionClass);
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuItem#select
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ select: function () {
+ var continueProcess = this.__fireBeforeSelect();
+ if (!continueProcess) {
+ return false;
+ }
+
+ return SELECT_ITEM.exec(this)
+ },
+
+ /**
+ * please, remove this method when client side ajax events will be added
+ *
+ * */
+ onCompleteHandler : function () {
+ SELECT_ITEM.execClient(this);
+ },
+
+ unselect: function () {
+ var panelMenu = this.__rfPanelMenu();
+ if (panelMenu.selectedItem() == this.itemName) {
+ panelMenu.selectedItem(null);
+ } else {
+ rf.warn("You try unselect item (name=" + this.itemName +
") that isn't seleted")
+ }
+
+ this.__unselect();
+
+ return this.__fireUnselect();
+ },
+
+ /***************************** Private Methods
****************************************************************/
+ __rfParentItem : function () {
+ var res = this.__item().parents(".rf-pm-gr")[0];
+ if (!res) {
+ res = this.__item().parents(".rf-pm-top-gr")[0];
+ }
+
+ if (!res) {
+ res = this.__panelMenu();
+ }
+
+ return res ? rf.$(res) : null;
+ },
+
+ __getNestingLevel : function () {
+ if (!this.nestingLevel) {
+ var parentItem = this.__rfParentItem();
+ if (parentItem && parentItem.__getNestingLevel) {
+ this.nestingLevel = parentItem.__getNestingLevel() + 1;
+ } else {
+ this.nestingLevel = 0;
+ }
+ }
+
+ return this.nestingLevel;
+ },
+
+ __renderNestingLevel : function () {
+ this.__item().find("td").first().css("padding-left",
this.options.itemStep * this.__getNestingLevel());
+ },
+
+ __panelMenu : function () {
+ return this.__item().parents(".rf-pm")[0];
+ },
+
+ __rfPanelMenu : function () {
+ return rf.$(this.__item().parents(".rf-pm")[0]);
+ },
+
+ __changeState : function () {
+ return this.__rfPanelMenu().selectedItem(this.itemName);
+ },
+
+ __restoreState : function (state) {
+ if (state) {
+ this.__rfPanelMenu().selectedItem(state);
+ }
+ },
+
+ __item : function () {
+ return $(rf.getDomElement(this.id));
+ },
+
+ __header : function () {
+ return this.__item();
+ },
+
+ __select: function () {
+ this.__header().addClass(this.selectionClass);
+ },
+
+ __unselect: function () {
+ this.__header().removeClass(this.selectionClass);
+ },
+
+ __fireBeforeSelect : function () {
+ return new rf.Event.fireById(this.id, "beforeselect", {
+ id: this.id
+ });
+ },
+
+ __fireSelect : function () {
+ return new rf.Event.fireById(this.id, "select", {
+ id: this.id
+ });
+ },
+
+ __fireUnselect : function () {
+ return new rf.Event.fireById(this.id, "unselect", {
+ id: this.id
+ });
+ },
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ destroy: function () {
+ delete this.__rfPanelMenu().getItems()[this.itemName];
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.PanelMenuItem.$super;
+})(jQuery, RichFaces);
Copied: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab_.js)
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tab.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,139 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Tab = rf.ui.TogglePanelItem.extendClass({
+ // class name
+ name:"Tab",
+
+ /**
+ * @class AccordionItem
+ * @name AccordionItem
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ $super.constructor.call(this, componentId, options);
+ this.index = options["index"];
+ this.getTogglePanel().getItems()[this.index] = this;
+
+ //TODO - optimize this
+ rf.Event.bindById(this.id + ":header:active", "click",
this.__onHeaderClick, this);
+ rf.Event.bindById(this.id + ":header:inactive", "click",
this.__onHeaderClick, this)
+ },
+
+ /***************************** Public Methods
****************************************************************/
+
+ __onHeaderClick : function (comp) {
+ this.getTogglePanel().switchToItem(this.getName());
+ },
+
+ /**
+ * @param state {string} = inactive | active | disabled
+ * in that case looking header by css class appropriate to this state
+ *
+ * @return {jQuery Object}
+ * */
+ __header : function (state) {
+ var res = $(rf.getDomElement(this.id + ":header"));
+ if (state) {
+ return $(rf.getDomElement(this.id + ":header:" + state));
+ }
+
+ return res;
+ },
+
+ /**
+ * @return {jQuery Object}
+ * */
+ __content : function () {
+ if (!this.__content_) {
+ this.__content_ = $(rf.getDomElement(this.id + ":content"));
+ }
+ return this.__content_;
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __enter : function () {
+
+ this.__content().show();
+ this.__header("inactive").hide();
+ this.__header("active").show();
+
+ return this.__fireEnter();
+ },
+
+ getHeight : function (recalculate) {
+ if (recalculate || !this.__height) {
+ this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
+ }
+
+ return this.__height;
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __leave : function () {
+ var continueProcess = this.__fireLeave();
+ if (!continueProcess) {
+ return false;
+ }
+
+ this.__content().hide();
+ this.__header("active").hide();
+ this.__header("inactive").show();
+
+ return true;
+ },
+
+ /***************************** Private Methods
********************************************************/
+
+
+ destroy: function () {
+ var parent = this.getTogglePanel();
+ delete parent.getItems()[this.index];
+
+ rf.Event.unbindById(this.id);
+
+ //TODO - optimize
+ rf.Event.unbindById(this.id + ":header:active");
+ rf.Event.unbindById(this.id + ":header:inactive");
+
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.Tab.$super;
+})(jQuery, RichFaces);
Copied: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel_.js)
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.TabPanel = rf.ui.TogglePanel.extendClass({
+ // class name
+ name:"TabPanel",
+
+ /**
+ * @class TabPanel
+ * @name TabPanel
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ rf.ui.TogglePanel.call(this, componentId, options);
+ this.items = [];
+
+ this.isKeepHeight = options["isKeepHeight"] || false
+ }
+ });
+})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanel.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel_.js)
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanel.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanel.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,433 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ /* SIMPLE INNER CLASS for handle switch operation*/
+ function SwitchItems(comp) {
+ this.comp = comp;
+ }
+
+ SwitchItems.prototype = {
+
+ /**
+ * @param {TogglePanelItem} oldPanel
+ * @param {TogglePanelItem} newPanel
+ *
+ * @return {void}
+ * */
+ exec : function (oldPanel, newPanel) {
+ if (newPanel.switchMode == "server") {
+ return this.execServer(oldPanel, newPanel);
+ } else if (newPanel.switchMode == "ajax") {
+ return this.execAjax(oldPanel, newPanel);
+ } else if (newPanel.switchMode == "client") {
+ return this.execClient(oldPanel, newPanel);
+ } else {
+ rf.log.error("SwitchItems.exec : unknown switchMode (" +
this.comp.switchMode + ")");
+ }
+ },
+
+ /**
+ * @protected
+ * @param {TogglePanelItem} oldPanel
+ * @param {TogglePanelItem} newPanel
+ *
+ * @return {Boolean} false
+ * */
+ execServer : function (oldPanel, newPanel) {
+ if (oldPanel) {
+ var continueProcess = oldPanel.__leave();
+ if (!continueProcess) {
+ return false;
+ }
+ }
+
+ this.__setActiveItem(newPanel.getName());
+
+ rf.submitForm(this.__getParentForm());
+
+ return false;
+ },
+
+ /**
+ * @protected
+ * @param {TogglePanelItem} oldPanel
+ * @param {TogglePanelItem} newPanel
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (oldPanel, newPanel) {
+ var options = $.extend({}, this.comp.options["ajax"],
{}/*this.getParameters(newPanel)*/);
+
+ this.__setActiveItem(newPanel.getName());
+ rf.ajax(this.comp.id, null, options);
+
+ if (oldPanel) {
+ this.__setActiveItem(oldPanel.getName());
+ }
+
+ return false;
+ },
+
+ /**
+ * @protected
+ * @param {TogglePanelItem} oldPanel
+ * @param {TogglePanelItem} newPanel
+ *
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (oldPanel, newPanel) {
+ if (oldPanel) {
+ var continueProcess = oldPanel.__leave();
+ if (!continueProcess) {
+ return false;
+ }
+ }
+
+ this.__setActiveItem(newPanel.getName());
+
+ newPanel.__enter();
+ this.comp.__fireItemChange(oldPanel, newPanel);
+
+ return true;
+ },
+
+ /**
+ * @private
+ * */
+ __getParentForm : function () {
+ return $(rf.getDomElement(this.comp.id)).parents('form:first');
+ },
+
+ /**
+ * @private
+ * */
+ __setActiveItem : function (name) {
+ rf.getDomElement(this.__getValueInputId()).value = name;
+ this.comp.activeItem = name;
+ },
+
+ /**
+ * @private
+ * */
+ __getValueInputId: function () {
+ return this.comp.id + "-value"
+ }
+ };
+
+ /**
+ * @class TogglePanel
+ * @name TogglePanel
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ rf.ui.TogglePanel = rf.BaseComponent.extendClass({
+
+ // class name
+ name:"TogglePanel",
+
+ init : function (componentId, options) {
+ $super.constructor.call(this, componentId);
+ this.attachToDom();
+
+ this.options = $.extend(this.options, options || {});
+ this.activeItem = this.options.activeItem;
+ this.items = this.options.items;
+
+ this.__addUserEventHandler("itemchange");
+ this.__addUserEventHandler("beforeitemchange");
+ },
+
+ /***************************** Public Methods
****************************************************************/
+
+ /**
+ * @methodOf
+ *
+ * @name TogglePanel#getSelectItem
+ *
+ * @return {String} name of current selected panel item
+ */
+ getSelectItem: function () {
+ return this.activeItem;
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#switchToItem
+ *
+ * @param {String} name - panel item name to switch
+ * we can use meta names @first, @prev, @next and @last
+ * @return {Boolean} - false if something wrong and true if all is ok
+ */
+ switchToItem: function (name) {
+ var newPanel = this.getNextItem(name);
+ if (newPanel == null) {
+ rf.log.warn("TogglePanel.switchToItems(" + name + "): item
with name '" + name + "' not found");
+ return false;
+ }
+
+ var oldPanel = this.__getItemByName(this.getSelectItem());
+
+ var continueProcess = this.__fireBeforeItemChange(oldPanel, newPanel);
+ if (!continueProcess) {
+ rf.log.warn("TogglePanel.switchToItems(" + name + "):
switch has been canceled by beforeItemChange event");
+ return false
+ }
+
+ return new SwitchItems(this).exec(oldPanel, newPanel);
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#getNextItem
+ *
+ * @param {String} name of TogglePanelItem or meta name (@first | @prev | @next |
@last)
+ * @return {TogglePanelItem} null if item not found
+ */
+ getNextItem : function (name) {
+ if (name) {
+ var newItemIndex = this.__ITEMS_META_NAMES[name];
+ if (newItemIndex) {
+ return this.__getItem(newItemIndex(this));
+ } else {
+ return this.__getItemByName(name);
+ }
+ } else {
+ return this.__getItemByName(this.nextItem());
+ }
+ },
+
+ /**
+ * please, remove this method when client side ajax events will be added
+ *
+ * */
+ onCompleteHandler : function (newItemName) {
+ var oldItem = this.__getItemByName(this.activeItem);
+ var newItem = this.__getItemByName(newItemName);
+
+ // Don't do like this and remove it ASAP
+ new SwitchItems(this).execClient(oldItem, newItem);
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#getItems
+ *
+ * @return {TogglePanelItem[]} all defined panel items
+ */
+ getItems : function () {
+ return this.items;
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#getItemsNames
+ *
+ * @return {String[]} names of all defined items
+ */
+ getItemsNames: function () {
+ var res = [];
+ for (var item in this.items) {
+ res.push(this.items[item].getName());
+ }
+
+ return res;
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#nextItem
+ *
+ * @param {String} [itemName = activeItem]
+ * @return {String} name of next panel item
+ */
+ nextItem: function (itemName) {
+ var itemIndex = this.__getItemIndex(itemName || this.activeItem);
+ if (itemIndex == -1) {
+ return null;
+ }
+
+ return this.__getItemName(itemIndex + 1);
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#firstItem
+ *
+ * @return {String} name of first panel item
+ */
+ firstItem: function () {
+ return this.__getItemName(0);
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#lastItem
+ *
+ * @return {String} name of last panel item
+ */
+ lastItem: function () {
+ return this.__getItemName(this.items.length - 1);
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanel#prevItem
+ *
+ * @param {String} itemName
+ * @return {String} name of prev panel item
+ * null if it is first item
+ */
+ prevItem: function (itemName) {
+ var itemIndex = this.__getItemIndex(itemName || this.activeItem);
+ if (!this.options.cycledSwitching && itemIndex < 1) {
+ return null;
+ }
+
+ return this.__getItemName(itemIndex - 1);
+ },
+
+
/////////////////////////////////////////////////////////////////////////////////
+ //// Private
+
/////////////////////////////////////////////////////////////////////////////////
+
+ /********************* Methods *************************/
+
+ __ITEMS_META_NAMES : (function () {
+ function goFrom (comp, ind, step) {
+ var res = ind;
+ while ((!comp.items[res] || comp.items[res].disabled) && res <
comp.items.length && res > 0) {
+ res += step;
+ }
+ return res;
+ }
+
+
+ return {
+ "@first" : function (comp) {
+ return goFrom(comp, 0, 1);
+ },
+
+ "@prev" : function (comp) {
+ return goFrom(comp, parseInt(comp.__getItemIndex(comp.activeItem)) -
1 , -1);
+ },
+
+ "@next" : function (comp) {
+ return goFrom(comp, parseInt(comp.__getItemIndex(comp.activeItem)) +
1 , 1);
+ },
+
+ "@last" : function (comp) {
+ return goFrom(comp, comp.items.length - 1, -1);
+ }
+ }
+ })(),
+
+ /**
+ * @private
+ * */
+ __getItemIndex : function (itemName) {
+ for (var i in this.items) {
+ if (!this.items[i].disabled && this.items[i].getName() ===
itemName) {
+ return parseInt(i);
+ }
+ }
+
+ rf.log.info("TogglePanel.getItemIndex: item with name '" +
itemName + "' not found");
+ return -1;
+ },
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ /**
+ * @private
+ * @param {Number} index - array index
+ *
+ * @return {TogglePanelItem}
+ * null - if item not found
+ * */
+ __getItem : function (index) {
+ if (this.options.cycledSwitching) {
+ var size = this.items.length;
+ return this.items[(size + index) % size]
+ } else if (index >= 0 && index < this.items.length) {
+ return this.items[index]
+ } else {
+ return null;
+ }
+ },
+
+ __getItemByName : function (name) {
+ return this.__getItem(this.__getItemIndex(name));
+ },
+
+ __getItemName : function (index) {
+ var item = this.__getItem(index);
+ if (item == null) {
+ return null;
+ }
+
+ return item.getName();
+ },
+
+ /**
+ * Fire Concealable Event
+ * */
+
+ __fireItemChange : function (oldItem, newItem) {
+ return new rf.Event.fireById(this.id, "itemchange", {
+ id: this.id,
+ oldItem : oldItem,
+ newItem : newItem
+ });
+ },
+
+ __fireBeforeItemChange : function (oldItem, newItem) {
+ return rf.Event.fireById(this.id, "beforeitemchange", {
+ id: this.id,
+ oldItem : oldItem,
+ newItem : newItem
+ });
+ },
+
+ destroy: function () {
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.TogglePanel.$super;
+})(jQuery, RichFaces);
Copied:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem_.js)
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.TogglePanelItem = rf.BaseComponent.extendClass({
+
+ // class name
+ name:"TogglePanelItem",
+
+ init : function (componentId, options) {
+ // call constructor of parent class
+ $super.constructor.call(this, componentId);
+ this.attachToDom();
+
+ this.options = $.extend(this.options, options || {});
+ this.name = this.options.name;
+ this.togglePanelId = this.options.togglePanelId;
+ this.switchMode = this.options.switchMode;
+ this.disabled = this.options.disabled || false;
+ },
+
+ /***************************** Public Methods
*****************************************************************/
+ /**
+ * @methodOf TogglePanelItem
+ * @name TogglePanelItem#getName
+ *
+ * @return {String} panel item name
+ */
+ getName: function () {
+ return this.options.name;
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanelItem#getTogglePanel
+ *
+ * @return {TogglePanel} parent TogglePanel
+ * */
+ getTogglePanel : function () {
+ return rf.$(this.togglePanelId);
+ },
+
+ /**
+ * @methodOf
+ * @name TogglePanelItem#isSelected
+ *
+ * @return {Boolean} true if this panel item is selected in the parent toggle
panel
+ * */
+ isSelected : function () {
+ return this.getName() == this.getTogglePanel().getSelectItem();
+ },
+
+
+ /***************************** Private Methods
****************************************************************/
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __enter : function () {
+ rf.getDomElement(this.id).style.display = "block";
+
+ return this.__fireEnter();
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __leave : function () {
+ var continueProcess = this.__fireLeave();
+ if (!continueProcess) {
+ return false;
+ }
+
+ rf.getDomElement(this.id).style.display = "none";
+ return true;
+ },
+
+ __fireLeave : function () {
+ return rf.Event.fireById(this.id, "__leave");
+ },
+
+ __fireEnter : function () {
+ return rf.Event.fireById(this.id, "__enter");
+ },
+
+ // class stuff
+ destroy: function () {
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.TogglePanelItem.$super;
+})(jQuery, RichFaces);
Copied: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js
(from rev 20456,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip_.js)
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js
(rev 0)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js 2010-12-08
12:31:27 UTC (rev 20457)
@@ -0,0 +1,295 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.TooltipDirection = {
+ topRight : "topRight",
+ topLeft : "topLeft",
+ bottomRight : "bottomRight",
+ bottomLeft : "bottomLeft",
+ auto : "auto",
+
+ DEFAULT: "bottomRight"
+ };
+ var TooltipDirection = rf.ui.TooltipDirection;
+
+ rf.ui.TooltipMode = {
+ client : "client",
+ ajax : "ajax",
+
+ DEFAULT: "client"
+ };
+ var TooltipMode = rf.ui.TooltipMode;
+
+ var DEFAULT_OPTIONS = {
+ direction : TooltipDirection.DEFAULT,
+ attached : true,
+ offset : [],
+ mode : TooltipMode.DEFAULT,
+ disabled : false,
+ hideDelay : 0,
+ hideEvent : "mouseleave",
+ showDelay : 0,
+ showEvent : "mouseenter",
+ followMouse : true
+ };
+
+ var SHOW_ACTION = {
+
+ /**
+ *
+ * @return {void}
+ * */
+ exec : function (tooltip, event) {
+ var mode = tooltip.mode;
+ if (mode == TooltipMode.ajax) {
+ return this.execAjax(tooltip, event);
+ } else if (mode == TooltipMode.client) {
+ return this.execClient(tooltip, event);
+ } else {
+ rf.log.error("SHOW_ACTION.exec : unknown mode (" + mode +
")");
+ }
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (tooltip, event) {
+ tooltip.__loading().show();
+ tooltip.__content().hide();
+ tooltip.__show(event);
+
+ rf.ajax(tooltip.id, null, $.extend({}, tooltip.options["ajax"],
{}));
+
+ return true;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (tooltip, event) {
+ tooltip.__show(event);
+
+ return tooltip.__fireShow();
+ }
+ };
+
+ rf.ui.Tooltip = rf.BaseComponent.extendClass({
+ // class name
+ name:"Tooltip",
+
+ /**
+ * @class Tooltip
+ * @name Tooltip
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ $super.constructor.call(this, componentId);
+ this.options = $.extend(this.options, DEFAULT_OPTIONS, options || {});
+ this.attachToDom();
+
+ this.mode = this.options.mode;
+ this.target = this.options.target;
+
+ this.__addUserEventHandler("hide");
+ this.__addUserEventHandler("show");
+ this.__addUserEventHandler("beforehide");
+ this.__addUserEventHandler("beforeshow");
+
+ this.popup = new RichFaces.ui.Popup(this.id, {
+ attachTo: this.target,
+ attachToBody: false,
+ positionType: "TOOLTIP",
+ positionOffset: [200,200]
+ });
+
+ var tooltip = this;
+ function mouseMoveHandler(event) {
+ tooltip.popup.show(event);
+ }
+
+ $(document.getElementById(this.target)).bind(this.options.showEvent, function
(event) {
+ tooltip.show(event);
+
+ if (tooltip.options.followMouse) {
+
$(document.getElementById(tooltip.target)).bind("mousemove", mouseMoveHandler);
+ }
+ });
+
+ $(document.getElementById(tooltip.target)).bind(this.options.hideEvent,
function (event) {
+ tooltip.hide();
+
+ if (tooltip.options.followMouse) {
+
$(document.getElementById(tooltip.target)).unbind("mousemove",
mouseMoveHandler);
+ }
+ });
+
+ },
+
+ /***************************** Public Methods
****************************************************************/
+ /**
+ * @methodOf
+ * @name PanelMenuItem#hide
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ hide: function () {
+ var continueProcess = this.__fireBeforeHide();
+ if (!continueProcess) {
+ return false;
+ }
+
+ this.__hide();
+
+ return this.__fireHide()
+ },
+
+ /**
+ * @private
+ * @return {void} TODO ...
+ */
+ __hide: function () {
+ var tooltip = this;
+ this.__delay(this.options.hideDelay, function () {
+ tooltip.popup.hide();
+ });
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuItem#show
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ show: function (event) {
+ var continueProcess = this.__fireBeforeShow();
+ if (!continueProcess) {
+ return false;
+ }
+
+ SHOW_ACTION.exec(this, event);
+ },
+
+ onCompleteHandler : function () {
+ this.__content().show();
+ this.__loading().hide();
+
+ return this.__fireShow();
+ },
+
+ /**
+ * @private
+ * @return {void} TODO ...
+ */
+ __show: function (event) {
+ var tooltip = this;
+ this.__delay(this.options.showDelay, function () {
+ tooltip.popup.show(event);
+ });
+ },
+
+ /***************************** Private Methods
****************************************************************/
+ __delay : function (delay, action) {
+ if (delay > 0) {
+ var hidingTimerHandle = window.setTimeout(function() {
+ action();
+
+ if (hidingTimerHandle) {
+ window.clearTimeout(hidingTimerHandle);
+ hidingTimerHandle = undefined;
+ }
+ }, delay);
+ } else {
+ action();
+ }
+ },
+
+ __detectAncestorNode: function(leaf, element) {
+ // Return true if "element" is "leaf" or one of its
parents
+ var node = leaf;
+ while (node != null && node != element) {
+ node = node.parentNode;
+ }
+ return (node != null);
+ },
+
+ __loading : function () {
+ return $(document.getElementById(this.id + ":loading"));
+ },
+
+ __content : function () {
+ return $(document.getElementById(this.id + "@content"));
+ },
+
+ __fireHide : function () {
+ return rf.Event.fireById(this.id, "hide", { id: this.id });
+ },
+
+ __fireShow : function () {
+ return rf.Event.fireById(this.id, "show", { id: this.id });
+ },
+
+ __fireBeforeHide : function () {
+ return rf.Event.fireById(this.id, "beforehide", { id: this.id });
+ },
+
+ __fireBeforeShow : function () {
+ return rf.Event.fireById(this.id, "beforeshow", { id: this.id });
+ },
+
+
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ destroy: function () {
+ $super.destroy.call(this);
+ }
+ });
+
+ // define super class link
+ var $super = rf.ui.Tooltip.$super;
+})(jQuery, RichFaces);