diff --git b/pom.xml a/pom.xml new file mode 100644 index 0000000..2e96703 --- /dev/null +++ a/pom.xml @@ -0,0 +1,73 @@ + + + + org.richfaces.sandbox + ui + 3.3.3.Final + + 4.0.0 + org.richfaces.sandbox.ui + dock + dock + + + + org.richfaces.cdk + maven-cdk-plugin + ${project.version} + + + generate-sources + + generate + + + + + + org.richfaces.sandbox.ui + + dock + http://richfaces.org/sandbox/dock + + + + + + maven-compiler-plugin + true + + 1.5 + 1.5 + ${project.build.sourceEncoding} + + + + org.apache.maven.plugins + maven-resources-plugin + 2.2 + + ${project.build.sourceEncoding} + + + + + + + org.richfaces.framework + richfaces-impl + ${project.version} + + + + UTF-8 + + + + bernard.labno.pl + MyCo Internal Repository + http://bernard.labno.pl/artifactory/libs-release-local + + + + diff --git b/src/main/config/component/dock.xml a/src/main/config/component/dock.xml new file mode 100644 index 0000000..e3271c1 --- /dev/null +++ a/src/main/config/component/dock.xml @@ -0,0 +1,238 @@ + + + + org.richfaces.Dock + org.richfaces.Dock + org.richfaces.component.html.HtmlDock + org.richfaces.component.UIDock + + The Dock - as anyone familiar with a Mac will know - is a set of iconic images that expand when rolled over + with the cursor, and usually perform some action when clicked. This plugin mimics that behaviour by + transforming a contiguous set of HTML images into an expanding Dock, vertical or horizontal, with or without + labels. + + + org.richfaces.DockRenderer + org.richfaces.renderkit.html.DockRenderer + + + dock + org.richfaces.taglib.DockTag + + org.ajax4jsf.webapp.taglib.HtmlComponentTagBase + + + + + + &ui_component_attributes; + &html_style_attributes; + + + active + int + + This designates one of the menu's elements to be fully expanded when the dock is initialised. The option + takes a zero-based index of the position of the desired menu element (image) within the dock - so if you + want the 4th of 6 images to be expanded, set active : 3. + + Warning : There are consequences to using this option, which might possibly only become apparent when + you try it. I have provided it because it has specifically been requested, but ... if you set a mid-menu + image initially active, and the user then enters the dock at either end, it is quite likely that the + dock will simply collapse to its 'at rest' state because the resultant animation takes the mouse off the + dock! + + -1 + + + + align + java.lang.String + + values = 'top', 'middle', 'bottom', left', center', 'right' + + Fixes the horizontal/vertical main axis, and direction of expansion. + + For a horizontal menu: + * 'top' : fixes the top edge of the dock, so that images expand down + * 'middle' : fixes the middle of the images, so that images expand up and down equally + * 'bottom' : fixes the bottom edge of the dock, so that images expand up + + For a vertical menu: + * 'left' : fixes the left edge of the dock, so that images expand right + * 'center' : fixes the center of the images, so that images expand left and right equally + * 'right' : fixes the right edge of the dock, so that images expand left + + "bottom" + + + + coefficient + double + + Attenuation coefficient. This controls the relationship between the distance from the cursor and the + amount of expansion of any affected image within that distance. A coefficient of 1 makes the expansion + linear with respect to distance from cursor; a larger coefficient gives a greater degree of expansion + the closer to the cursor the affected image is (within distance). # distance : integer, default = 72 + Attenuation distance from cursor, ie the distance (in pixels) from the cursor that an image has to be + within in order to have any expansion applied. + + Note that attenuation is always calculated as if the Dock was 'at rest' (no images expanded), even + though there may be expanded images at the time. + + 1.5 + + + + duration + int + + The duration (in milliseconds) of the initial 'on-Dock' expansion, and the 'off-Dock' shrinkage. + + 300 + + + + fadeIn + int + + The amount of time (in milliseconds) for the initial fade-in of the Dock after initialisation. By + default this is set to 0 (zero), which means that the Dock is displayed in full as soon as it can be ( = + show() ). There may be occasions when a 'softer' presentation of the Dock is desirable, and setting + fadeIn to, for example, 400 would fade the Dock in over that period. + + 0 + + + + fadeLayer + java.lang.String + + By default the fade-in effect (see fadeIn above) is applied to the original target menu element. By + specifying either 'wrap' or 'dock' here, the fade-in element can be switched to the child or grand-child + (ie. div.jqDockWrap or div.jqDock, respectively) of the original target menu element. This option only + has any effect if fadeIn is set, and is really only useful for cases where, for example, background + colours have been styled on the original menu element or div.jqDock, and you don't want them to be faded + in. + + null + + + + flow + boolean + + If set, this alters the default dock behaviour such that the Dock is not auto-centered and the wrap + element (.jqDockWrap, which is relatively positioned) expands and collapses to precisely contain the + Dock (.jqDock); this allows elements positioned around the docked menu to adjust their own relative + position according to the current state of the docked menu. + + Warning : There are consequences to using this option, which might possibly only become apparent when + you try it. I have provided it because it has specifically been requested, but with flow enabled, if you + aim your mouse at a specific menu option you will probably find that quite often you don't stay on that + option without having to move the mouse again! + + false + + + + idle + int + + The period of time (in milliseconds) after the mouse has left the menu (without re-entering, obviously!) + before the Dock attempts to go to sleep. + + 0 + + + + inactivity + int + + The period of time (in milliseconds) after which the Dock will shrink if there has been no movement of + the mouse while it is over an expanded Dock. + + 0 + + + + labels + java.lang.String + + values = 'true', 'false', 'tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br' + + This enables/disables display of a label on the current image. Allowed string values are 2 characters in + length: the first character indicates horizontal position (t=top, m=middle, b=bottom) and the second + indicates vertical position (l=left, c=center, r=right). So 'br' means bottom-right! If simply set to + true, jqDock will use its default positioning for the label, which is 'tl' (top-left) for any align + setting other than 'top' or 'left'. The defaults for 'top' and 'left' alignment are 'br' (bottom-right) + and 'tr' (top-right) respectively. To determine the text for the label, jqDock looks firstly for text in + the image's 'title' attribute; if not found, it will then look for text in the 'title' attribute of the + parent link - if there is one - and use that if found. + + Please be aware that enabling this option with one of the middle/center label positions (eg. 'ml', 'bc', + etc) may have a slight effect on the performance of the Dock, simply due to the additional processing + required to position the label correctly. + + "false" + + + + loader + java.lang.String + + values = 'image', 'jquery' + + This overrides the default image loader used by jqDock. Depending on the browser, jqDock uses an image + loader based on either "new Image()", or the jQuery HTML constructor "jQuery('<img/>')...". If your + Dock is not being displayed, and you have triple checked all your image paths, try setting this option + to 'image' or 'jquery' to override the default loader. + + null + + + + noBuffer + boolean + + By default, while the dock is asleep the most recent mouse event is buffered, and when the dock is + nudged awake that buffered event is used and acted upon - before any other mouse event that might occur + subsequent to the 'nudge'. Setting the noBuffer option to true will prevent buffering of the mouse + events. + + false + + + + size + int + + This is the maximum value (in pixels) of the minor axis dimension for the 'at rest' images. For example, + an image of natural dimensions 90x120 (width x height), placed in a horizontal Dock (say, 'align' = + 'bottom') would, by default, be sized down to 36x48. This is because height is the minor axis in a + horizontal Dock, and to keep the presentation of the 'at rest' images neat and tidy it is the height + that is governed by the size option. Conversely, in a vertical Dock it would be the width that was + capped at the size value, with height being set proportionately. + + 48 + + + + step + int + + The timer interval (in milliseconds) between each animation step of the 'on-Dock' expansion, and the + 'off-Dock' shrinkage. + + 50 + + + + diff --git b/src/main/java/org/richfaces/component/UIDock.java a/src/main/java/org/richfaces/component/UIDock.java new file mode 100644 index 0000000..393fbac --- /dev/null +++ a/src/main/java/org/richfaces/component/UIDock.java @@ -0,0 +1,83 @@ +package org.richfaces.component; + +import javax.faces.component.UIComponentBase; + +public abstract class UIDock extends UIComponentBase { +// ------------------------------ FIELDS ------------------------------ + + public static final String COMPONENT_FAMILY = "org.richfaces.Dock"; + + public static final String COMPONENT_TYPE = "org.richfaces.Dock"; + + public static final boolean DEFAULT_ACTIVE = false; + +// -------------------------- OTHER METHODS -------------------------- + + public abstract int getActive(); + + public abstract String getAlign(); + + public abstract double getCoefficient(); + + public abstract int getDistance(); + + public abstract int getDuration(); + + public abstract int getFadeIn(); + + public abstract String getFadeLayer(); + + public abstract int getIdle(); + + public abstract int getInactivity(); + + public abstract String getLabels(); + + public abstract String getLoader(); + + public abstract int getSize(); + + public abstract int getStep(); + + public abstract String getStyle(); + + public abstract String getStyleClass(); + + public abstract boolean isFlow(); + + public abstract boolean isNoBuffer(); + + public abstract void setActive(int active); + + public abstract void setAlign(String align); + + public abstract void setCoefficient(double coefficient); + + public abstract void setDistance(int distance); + + public abstract void setDuration(int duration); + + public abstract void setFadeIn(int fadeIn); + + public abstract void setFadeLayer(String fadeLayer); + + public abstract void setFlow(boolean flow); + + public abstract void setIdle(int idle); + + public abstract void setInactivity(int inactivity); + + public abstract void setLabels(String labels); + + public abstract void setLoader(String loader); + + public abstract void setNoBuffer(boolean noBuffer); + + public abstract void setSize(int size); + + public abstract void setStep(int step); + + public abstract void setStyle(String style); + + public abstract void setStyleClass(String styleClass); +} diff --git b/src/main/java/org/richfaces/renderkit/html/DockRenderer.java a/src/main/java/org/richfaces/renderkit/html/DockRenderer.java new file mode 100644 index 0000000..755d20d --- /dev/null +++ a/src/main/java/org/richfaces/renderkit/html/DockRenderer.java @@ -0,0 +1,152 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright , 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. + */ + +package org.richfaces.renderkit.html; + +import org.ajax4jsf.javascript.JSFunction; +import org.ajax4jsf.renderkit.HeaderResourcesRendererBase; +import org.ajax4jsf.renderkit.RendererUtils.HTML; +import org.ajax4jsf.resource.InternetResource; +import org.richfaces.component.UIDock; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +public class DockRenderer extends HeaderResourcesRendererBase { +// ------------------------------ FIELDS ------------------------------ + + private static final Map DEFAULTS; + + private final InternetResource[] scripts = { + getResource("/org/richfaces/renderkit/html/scripts/jquery/jquery.js"), + getResource("/org/richfaces/renderkit/html/scripts/jquery.jdock.js"), + getResource("/org/richfaces/renderkit/html/scripts/richfaces.dock.js") + }; + private final InternetResource[] styles = { + getResource("/org/richfaces/renderkit/html/css/dock.xcss") + }; + +// -------------------------- STATIC METHODS -------------------------- + + static { + Map defaults = new HashMap(); + defaults.put("active", -1); + defaults.put("align", "bottom"); + defaults.put("coefficient", 1.5); + defaults.put("duration", 300); + defaults.put("fadeIn", 0); + defaults.put("fadeLayer", ""); + defaults.put("flow", false); + defaults.put("idle", 0); + defaults.put("inactivity", 0); + defaults.put("labels", "false"); + defaults.put("loader", ""); + defaults.put("noBuffer", false); + defaults.put("size", 48); + defaults.put("step", 50); + DEFAULTS = Collections.unmodifiableMap(defaults); + } + +// --------------------- GETTER / SETTER METHODS --------------------- + + protected Class getComponentClass() { + return UIDock.class; + } + + @Override + protected InternetResource[] getScripts() { + return scripts; + } + + @Override + protected InternetResource[] getStyles() { + return styles; + } + +// -------------------------- OTHER METHODS -------------------------- + + @Override + protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { + writer.startElement(HTML.DIV_ELEM, component); + final String clientId = getUtils().clientId(context, component); + writer.writeAttribute(HTML.id_ATTRIBUTE, clientId, HTML.id_ATTRIBUTE); + writer.startElement(HTML.DIV_ELEM, component); + writer.writeAttribute(HTML.id_ATTRIBUTE, getContainerClientId(context, component), HTML.id_ATTRIBUTE); + Object styleClass = component.getAttributes().get("styleClass"); + styleClass = styleClass == null ? "" : " " + styleClass.toString(); + writer.writeAttribute(HTML.class_ATTRIBUTE, "rf-dk" + styleClass, HTML.class_ATTRIBUTE); + writer.writeAttribute(HTML.style_ATTRIBUTE, component.getAttributes().get("style"), HTML.style_ATTRIBUTE); + } + + @Override + protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { + writer.endElement(HTML.DIV_ELEM); + writer.startElement(HTML.SCRIPT_ELEM, null); + writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", "type"); + writer.writeText(new JSFunction("RichFaces.Dock", getContainerClientId(context, component), + getOptions((UIDock) component)), null); + writer.writeText(";", null); + writer.endElement(HTML.SCRIPT_ELEM); + writer.endElement(HTML.DIV_ELEM); + } + + private String getContainerClientId(FacesContext context, UIComponent component) { + return getUtils().clientId(context, component) + "Container"; + } + + protected Map getOptions(UIDock dock) throws IOException { + /** + * Include only attributes that are actually set. + */ + Map options = new HashMap(); + addOptionIfSetAndNotDefault("active", dock.getActive(), options); + addOptionIfSetAndNotDefault("align", dock.getAlign(), options); + addOptionIfSetAndNotDefault("coefficient", dock.getCoefficient(), options); + addOptionIfSetAndNotDefault("duration", dock.getDuration(), options); + addOptionIfSetAndNotDefault("fadeIn", dock.getFadeIn(), options); + addOptionIfSetAndNotDefault("fadeLayer", dock.getFadeLayer(), options); + addOptionIfSetAndNotDefault("flow", dock.isFlow(), options); + addOptionIfSetAndNotDefault("idle", dock.getIdle(), options); + addOptionIfSetAndNotDefault("inactivity", dock.getInactivity(), options); + addOptionIfSetAndNotDefault("labels", dock.getLabels(), options); + addOptionIfSetAndNotDefault("loader", dock.getLoader(), options); + addOptionIfSetAndNotDefault("noBuffer", dock.isNoBuffer(), options); + addOptionIfSetAndNotDefault("size", dock.getSize(), options); + addOptionIfSetAndNotDefault("step", dock.getStep(), options); + return options; + } + + protected void addOptionIfSetAndNotDefault(String optionName, Object value, Map options) { + if (value != null && !"".equals(value) + && !value.equals(DEFAULTS.get(optionName)) + && !(value instanceof Collection && ((Collection) value).size() == 0) + && !(value instanceof Map && ((Map) value).size() == 0)) { + options.put(optionName, value); + } + } +} diff --git b/src/main/resources/org/richfaces/renderkit/html/css/dock.xcss a/src/main/resources/org/richfaces/renderkit/html/css/dock.xcss new file mode 100644 index 0000000..cc18769 --- /dev/null +++ a/src/main/resources/org/richfaces/renderkit/html/css/dock.xcss @@ -0,0 +1,19 @@ + + + + +.rf-dk a { + text-decoration:none; +} + + + + + + + + + + \ No newline at end of file diff --git b/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.jdock.js a/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.jdock.js new file mode 100644 index 0000000..c280f6b --- /dev/null +++ a/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.jdock.js @@ -0,0 +1,27 @@ +/* + jquery.jqDock.js v1.6 +*/ +(function(k,w){if(!k.jqDock){var v=["Top","Right","Bottom","Left"],N=["Major","Minor"],z=["mouseenter","mousemove","mouseleave"],x=["docknudge","dockidle","dockfreeze"],s=["Idler","Inactive","Indock","Overdock","Offdock"],E=['
'],p={v:{wh:"height",xy:1,tl:"top",lead:0,trail:2,inv:"h"},h:{wh:"width",xy:0,tl:"left",lead:3,trail:1,inv:"v"}},m=[],F=[0,0],X=function(){},C=function(a){a=parseInt(a,10);return isNaN(a)? +0:a},t=function(a,d){for(var c=s[d]?d+1:s.length;dd)d-=a-d;return d},O=function(a){var d=m[a.data.id],c=d.Elem[a.data.idx];c.height=this.height;c.width=this.width;--d.Load<=0&&w.setTimeout(function(){k.jqDock.initDock(a.data.id)},0)},Z=function(a,d){for(var c;a&&a.ownerDocument&&a!==d;){if(c=a.className.toString().match(/jqDockMouse(\d+)/))return 1*c[1];a=a.parentNode}return-1},P=function(a,d,c){var e={},b=p[c].wh;c=p[p[c].inv].wh;e[b]= +d;e[c]=Math.round(d*a[c]/a[b]);return e},Q=function(){k(this).prev("img").trigger("click");return false},y=function(a,d){var c=a.Elem[a.Current];if(c&&a.Opts.labels)c.Label.el[d?"show":"hide"]()},R=function(a){var d=p[a.Opts.vh],c=a.Elem.length,e=-1,b=0,f,h,j,i=F[d.xy]-a.Elem[0].Wrap.parent().offset()[d.tl];if(i>=0)for(;e<0&&b
').hide().insertAfter(d.Img);if(b){h=b.charAt(0)=="b";b= +b.charAt(1)=="r";f.el.css({top:h?"auto":0,left:b?"auto":0,bottom:h?0:"auto",right:b?0:"auto"}).click(Q)}a=e.setLabel.call(a.Menu[0],d.Title,c,f.el[0]);a!==false&&k('
'+a.toString()+"
").appendTo(f.el)},I=function(a,d){var c=m[a],e=c.Opts,b=p[e.vh].wh,f=c.Elem.length,h,j,i;for(d=d||d===0?d:R(c);f--;){h=c.Elem[f];i=h.Initial;if(d>=0){j=Math.abs(d-h.Centre);if(j=c.duration)d.Stamp=0}if(b>=c.step){for(h=(c.duration-b)/c.step;f1?c.Major+Math[b<0?"floor":"ceil"](b/h):c.Final;U(a, +f,b)}if(d.Spread>d[e.wh]){d.Yard.parent()[e.wh](d.Spread+d.Border[e.lead]+d.Border[e.trail]);d[e.wh]=d.Spread}}},K=function(a,d){var c=m[a],e=c.Elem,b=e.length;t(c,2);if(c.OnDock&&!c.Stamp){for(I(a,d);b--&&e[b].Major==e[b].Final;);if(b<0)y(c,1);else{J(a);c[s[2]]=w.setTimeout(function(){K(a,d)},c.Opts.step)}}},V=function(a,d){var c=m[a],e=c.Elem,b=e.length;if(!c.OnDock){for(;b--&&e[b].Major<=e[b].Initial;);R(c);if(b<0){c.Stamp=0;for(b=e.length;b--;)e[b].Major=e[b].Final=e[b].Initial;c.Current=-1;d|| +D(c)}else{J(a);c[s[4]]=w.setTimeout(function(){V(a,d)},c.Opts.step)}}},W=function(a,d){var c=m[a],e=c.Elem,b=e.length;if(c.OnDock){for(I(a,d);b--&&e[b].Major==e[b].Final;);if(b<0||!c.Stamp){c.Stamp=0;K(a,d)}else{J(a);c[s[3]]=w.setTimeout(function(){W(a,d)},c.Opts.step)}}},B=function(a,d,c,e){var b=m[d],f=b.Elem,h=f.length;if(a===0){b.OnDock=1;b.Current>=0&&b.Current!==c&&y(b);b.Current=c;b.Stamp=e&&e>1?0:H(b);W(d,e?f[c].Centre:null)}if(a===1){if(c!==b.Current){y(b);b.Current=c}K(d)}if(a===2){t(b, +1);b.OnDock=0;y(b);for(b.Stamp=H(b);h--;)f[h].Final=f[h].Initial;V(d,!!e)}},L=function(a){var d=A(this),c=m[d],e=c?Z(a.target,this):-1,b=-1,f;if(c)if(c.Asleep){if(!c.Opts.noBuffer)c.Sleeper={target:a.target,type:a.type,pageX:a.pageX,pageY:a.pageY}}else{f=c.OnDock;t(c,0);F=[a.pageX,a.pageY];if(a.type==z[2])if(f)b=2;else D(c);else{if(c.Opts.inactivity){t(c,1);c[s[1]]=w.setTimeout(function(){B(2,d,e,1)},c.Opts.inactivity)}if(a.type==z[1])if(e<0){if(f&&c.Current>=0)b=2}else b=!f||c.Current<0?0:1;else if(e>= +0&&!f)b=0}c.Sleeper=null;b>=0&&B(b,d,e)}},M=function(a){var d=k(".jqDock",this).get(0),c=A(d),e=m[c],b=a.type==x[2],f=b?"freeze":"sleep";if(e)if(a.type==x[0]){f=e.Frozen?"thaw":"wake";if(e.Asleep&&!(e.Asleep=e.Opts.onWake.call(this,f)===false))e.Frozen=!k(this).trigger("dockwake",[f]);if(!e.Asleep){D(e);e.Sleeper&&L.call(d,e.Sleeper)}}else{t(e,0);a=!e.Asleep||b&&!e.Frozen;if(!a||e.Opts.onSleep.call(e.Menu[0],f)!==false){e.Asleep=!t(e,b?-1:1);e.Frozen=e.Frozen||b;a&&e.Menu.trigger("docksleep",[f]); +if(b)e.Stamp=e.OnDock=0;else B(2,c,0,1)}}};k.jqDock=function(){return{version:1.6,defaults:{size:48,distance:72,coefficient:1.5,duration:300,align:"bottom",labels:0,source:0,loader:0,inactivity:0,fadeIn:0,fadeLayer:"",step:50,setLabel:0,flow:0,idle:0,onReady:0,onSleep:0,onWake:0,noBuffer:0,active:-1},useJqLoader:k.browser.opera||k.browser.safari,initDock:function(a){var d=m[a],c=d.Opts,e=p[c.vh],b=p[e.inv],f=d.Border,h=d.Elem.length,j=E.join(""),i=0,n=0,o,g,l,q=c.fadeLayer;S(d.Menu[0]);for(d.Menu.children().each(function(r, +u){var ba=d.Elem[r].Wrap=k(u).wrap(j+j+"").parent();c.vh=="h"&&ba.parent().css("float","left")}).find("img").andSelf().css({position:"relative",padding:0,margin:0,borderWidth:0,borderStyle:"none",verticalAlign:"top",display:"block",width:"100%",height:"100%"});nd[e.wh])d[e.wh]=i}}for(;n;){g=d.Elem[--n];g.Final=g.Initial}e=[E[0],E[2],'
'].join("");d.Yard=k("div.jqDock", +d.Menu.wrapInner(e));for(b=4;b--;)f[b]=C(d.Yard.css("border"+v[b]+"Width"));for(d.Yard.parent().addClass("jqDockWrap").width(d.width+f[1]+f[3]).height(d.height+f[0]+f[2]);n").bind("load",{id:e,idx:n},O).attr({src:l});else{g=new Image;g.onload=function(){O.call(this,{data:{id:e,idx:n}});g.onload="";g=null};g.src=l}})});return this}}})(jQuery,window); diff --git b/src/main/resources/org/richfaces/renderkit/html/scripts/richfaces.dock.js a/src/main/resources/org/richfaces/renderkit/html/scripts/richfaces.dock.js new file mode 100644 index 0000000..68a6e3b --- /dev/null +++ a/src/main/resources/org/richfaces/renderkit/html/scripts/richfaces.dock.js @@ -0,0 +1,31 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright , 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. + */ + +window.RichFaces = window.RichFaces || {}; +RichFaces.Dock = function(clientId, options) { + var container = jQuery(document.getElementById(clientId)); + /** + * Move all scripts generated by children out of container (jDock requirement). + */ + container.children().filter("script").appendTo(container.parent()); + return container.jqDock(options); +}; \ No newline at end of file