JBoss Rich Faces SVN: r21225 - trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-25 14:14:02 -0500 (Tue, 25 Jan 2011)
New Revision: 21225
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
Log:
RF-10284
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 2011-01-25 19:12:58 UTC (rev 21224)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2011-01-25 19:14:02 UTC (rev 21225)
@@ -131,7 +131,12 @@
writer.startElement(getMarkupElement(tooltip), tooltip);
writer.writeAttribute(ID_ATTRIBUTE, tooltip.getClientId(context) + ":loading", null);
writer.writeAttribute(CLASS_ATTRIBUTE, "rf-tt-loading", null);
- writer.writeText("Loading...", null);
+ UIComponent loading = tooltip.getFacet("loading");
+ if (loading != null && loading.isRendered()) {
+ loading.encodeAll(context);
+ } else {
+ writer.writeText("Loading...", null);
+ }
writer.endElement(getMarkupElement(tooltip));
}
13 years, 11 months
JBoss Rich Faces SVN: r21224 - trunk/ui/common/ui/src/main/java/org/richfaces/component/util.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-25 14:12:58 -0500 (Tue, 25 Jan 2011)
New Revision: 21224
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/component/util/InputUtils.java
trunk/ui/common/ui/src/main/java/org/richfaces/component/util/SelectUtils.java
Log:
RF-10171
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/component/util/InputUtils.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/util/InputUtils.java 2011-01-25 18:11:23 UTC (rev 21223)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/util/InputUtils.java 2011-01-25 19:12:58 UTC (rev 21224)
@@ -72,12 +72,15 @@
if ((converter == null) && (valueExpression != null)) {
Class converterType = valueExpression.getType(context.getELContext());
- if ((converterType == null) || (converterType == Object.class) || (converterType == String.class)) {
+ if ((converterType == null) || (converterType == Object.class)) {
return newValue;
} else {
converter = context.getApplication().createConverter(converterType);
if (converter == null) {
+ if (String.class.equals(converterType)) {
+ return newValue;
+ }
throw new ConverterException(Messages.getMessage(Messages.NO_CONVERTER_FOUND_ERROR,
converterType.getName()));
}
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/component/util/SelectUtils.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/util/SelectUtils.java 2011-01-25 18:11:23 UTC (rev 21223)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/util/SelectUtils.java 2011-01-25 19:12:58 UTC (rev 21224)
@@ -293,13 +293,13 @@
if (ve != null) {
Class<?> valueType = ve.getType(facesContext.getELContext());
- if ((valueType == null) || String.class.equals(valueType) || Object.class.equals(valueType)) {
+ if ((valueType == null) || Object.class.equals(valueType)) {
// No converter needed
} else {
converter = facesContext.getApplication().createConverter(valueType);
- if (converter == null) {
+ if (converter == null && !String.class.equals(valueType)) {
throw new ConverterException(Messages.getMessage(Messages.NO_CONVERTER_FOUND_ERROR,
valueType.getName()));
}
@@ -320,7 +320,7 @@
if (ve != null) {
Class<?> valueType = ve.getType(facesContext.getELContext());
- if ((valueType == null) || String.class.equals(valueType) || Object.class.equals(valueType)) {
+ if ((valueType == null) || Object.class.equals(valueType)) {
// No converter needed
} else {
converter = facesContext.getApplication().createConverter(valueType);
13 years, 11 months
JBoss Rich Faces SVN: r21223 - sandbox/trunk/examples/irc-client/src/main/java/org/ircclient/controller.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-25 13:11:23 -0500 (Tue, 25 Jan 2011)
New Revision: 21223
Modified:
sandbox/trunk/examples/irc-client/src/main/java/org/ircclient/controller/ChatBean.java
Log:
Modified: sandbox/trunk/examples/irc-client/src/main/java/org/ircclient/controller/ChatBean.java
===================================================================
--- sandbox/trunk/examples/irc-client/src/main/java/org/ircclient/controller/ChatBean.java 2011-01-25 17:12:42 UTC (rev 21222)
+++ sandbox/trunk/examples/irc-client/src/main/java/org/ircclient/controller/ChatBean.java 2011-01-25 18:11:23 UTC (rev 21223)
@@ -29,18 +29,13 @@
private static final String SERVER_URL = "irc.freenode.org";
private static final int SERVER_PORT = 6667;
private static final String CHANNEL_PREFIX = "#";
- private static final String DEFAULT_CHANNEL = "richfaces";
+ private static final String DEFAULT_CHANNEL = "richfaces_push";
private static final Logger LOGGER = LogFactory.getLogger(ChatBean.class);
private String channelName;
private String message;
private transient TopicsContext topicsContext;
- public ChatBean() {
- LOGGER.info("TOPICS CONTEXT INITIALIZED");
- topicsContext = TopicsContext.lookup();
- }
-
public void connect() {
try {
this.connect(SERVER_URL, SERVER_PORT);
@@ -69,11 +64,18 @@
this.disconnect();
}
+ private TopicsContext getTopicsContext() {
+ if (topicsContext == null){
+ topicsContext = TopicsContext.lookup();
+ }
+ return topicsContext;
+ }
+
@Override
protected void onMessage(String channel, String sender, String login, String hostname, String message) {
String channelName = channel.replace(CHANNEL_PREFIX, "");
try {
- topicsContext.publish(new TopicKey("chat", channelName),
+ getTopicsContext().publish(new TopicKey("chat", channelName),
MessageFormat.format("{0,time,medium} {1}: {2}", new Date(), sender, message));
} catch (MessageException e) {
LOGGER.error(e.getMessage(), e);
@@ -83,7 +85,7 @@
@Override
protected void onUserList(String channel, User[] users) {
try {
- topicsContext.publish(new TopicKey("chat", channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", channelName + "List"), null);
} catch (MessageException e) {
LOGGER.error(e.getMessage(), e);
}
@@ -92,8 +94,8 @@
@Override
protected void onJoin(String channel, String sender, String login, String hostname) {
try {
- topicsContext.publish(new TopicKey("chat", channelName + "List"), null);
- topicsContext.publish(new TopicKey("chat", channelName),
+ getTopicsContext().publish(new TopicKey("chat", channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", channelName),
MessageFormat.format("{0,time,medium} {1}: {2}", new Date(), sender, "joined channel"));
} catch (MessageException e) {
LOGGER.error(e.getMessage(), e);
@@ -103,8 +105,8 @@
@Override
protected void onPart(String channel, String sender, String login, String hostname) {
try {
- topicsContext.publish(new TopicKey("chat", channelName + "List"), null);
- topicsContext.publish(new TopicKey("chat", channelName),
+ getTopicsContext().publish(new TopicKey("chat", channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", channelName),
MessageFormat.format("{0,time,medium} {1}: {2}", new Date(), sender, "left channel"));
} catch (MessageException e) {
LOGGER.error(e.getMessage(), e);
@@ -114,8 +116,8 @@
@Override
protected void onNickChange(String oldNick, String login, String hostname, String newNick) {
try {
- topicsContext.publish(new TopicKey("chat", channelName + "List"), null);
- topicsContext.publish(new TopicKey("chat", channelName),
+ getTopicsContext().publish(new TopicKey("chat", channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", channelName),
MessageFormat.format("{0,time,medium} {1}", new Date(), oldNick + " changed nick to " + newNick));
} catch (MessageException e) {
LOGGER.error(e.getMessage(), e);
@@ -125,8 +127,8 @@
@Override
protected void onQuit(String sourceNick, String sourceLogin, String sourceHostname, String reason) {
try {
- topicsContext.publish(new TopicKey("chat", channelName + "List"), null);
- topicsContext.publish(new TopicKey("chat", channelName),
+ getTopicsContext().publish(new TopicKey("chat", channelName + "List"), null);
+ getTopicsContext().publish(new TopicKey("chat", channelName),
MessageFormat.format("{0,time,medium} {1}: {2} {3}", new Date(), sourceNick, "joined channel", reason));
} catch (MessageException e) {
LOGGER.error(e.getMessage(), e);
@@ -140,7 +142,7 @@
public void send() {
this.sendMessage(CHANNEL_PREFIX + channelName, message);
try {
- topicsContext.publish(new TopicKey("chat", channelName),
+ getTopicsContext().publish(new TopicKey("chat", channelName),
MessageFormat.format("{0,time,medium} {1}: {2}", new Date(), this.getName(), message));
} catch (MessageException e) {
LOGGER.error(e.getMessage(), e);
13 years, 11 months
JBoss Rich Faces SVN: r21222 - in trunk/ui/input/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-01-25 12:12:42 -0500 (Tue, 25 Jan 2011)
New Revision: 21222
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss
trunk/ui/input/ui/src/main/templates/autocomplete.template.xml
Log:
http://jira.jboss.com/jira/browse/RF-9559
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss 2011-01-25 16:49:29 UTC (rev 21221)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.ecss 2011-01-25 17:12:42 UTC (rev 21222)
@@ -7,6 +7,8 @@
input.rf-au-inp {
border-width: 0px;
width: 100%;
+ padding-left: 0px;
+ padding-right: 0px;
}
.rf-au-fld{
@@ -22,6 +24,10 @@
background-color: '#{richSkin.controlBackgroundColor}';
}
+.rf-au-fld-btn{
+ position : relative; overflow : hidden; text-align : left; padding-right : 21px;
+}
+
.rf-au-btn{
background-image: "url(#{resource['org.richfaces.renderkit.html.images.AutocompleteButtonGradient']})";
background-repeat: repeat-x;
Modified: trunk/ui/input/ui/src/main/templates/autocomplete.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/autocomplete.template.xml 2011-01-25 16:49:29 UTC (rev 21221)
+++ trunk/ui/input/ui/src/main/templates/autocomplete.template.xml 2011-01-25 17:12:42 UTC (rev 21222)
@@ -16,8 +16,8 @@
<cc:implementation>
<cdk:object type="java.lang.Object" name="disabled" value="#{component.attributes['disabled']}" />
<div id="#{clientId}" class="rf-au-fld">
- <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="rf-au-fnt rf-au-inp" />
- <div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
+ <input id="#{clientId}Value" name="#{clientId}Value" type="hidden"/>
+ <div class="#{component.attributes['showButton'] ? 'rf-au-fld-btn' : ''}">
<input onclick="#{component.attributes['onclick']}"
ondblclick="#{component.attributes['ondblclick']}"
onmouseup="#{component.attributes['onmouseup']}"
13 years, 11 months
JBoss Rich Faces SVN: r21221 - management/design-4x/message.
by richfaces-svn-commits@lists.jboss.org
Author: Ochikvina
Date: 2011-01-25 11:49:29 -0500 (Tue, 25 Jan 2011)
New Revision: 21221
Modified:
management/design-4x/message/message.html
management/design-4x/message/messages.html
Log:
Updated markups.
Modified: management/design-4x/message/message.html
===================================================================
--- management/design-4x/message/message.html 2011-01-25 16:47:41 UTC (rev 21220)
+++ management/design-4x/message/message.html 2011-01-25 16:49:29 UTC (rev 21221)
@@ -14,11 +14,12 @@
font-size:11px;/*generalSizeFont*/
}
.rf-msg-mkr {
+ display:inline-block;
+ height:16px;
padding-right:2px;
- }
- .rf-msg-mkr img{
vertical-align:middle;
- }
+ width:16px;
+ }
.rf-msg-lbl {
vertical-align:middle;
}
@@ -27,6 +28,7 @@
.rf-msg-err{
}
.rf-msg-err-mkr {
+ background:url(images/error.png) left center no-repeat;
}
.rf-msg-err-lbl {
color:#ff0000;
@@ -39,6 +41,7 @@
.rf-msg-ftl{
}
.rf-msg-ftl-mkr {
+ background:url(images/fatal.png) left center no-repeat;
}
.rf-msg-ftl-lbl {
color:#ff0000;
@@ -47,6 +50,7 @@
.rf-msg-inf{
}
.rf-msg-inf-mkr {
+ background:url(images/info.png) left center no-repeat;
}
.rf-msg-inf-lbl {
color:#000000;
@@ -55,6 +59,7 @@
.rf-msg-wrn{
}
.rf-msg-wrn-mkr {
+ background:url(images/warning.png) left center no-repeat;
}
.rf-msg-wrn-lbl {
color:#000000;
@@ -65,9 +70,7 @@
<h1>ERROR Message</h1>
<span class="rf-msg rf-msg-err">
- <span class="rf-msg-mkr rf-msg-err-mkr">
- <img src="images/error.png" alt="Message marker"/>
- </span>
+ <span class="rf-msg-mkr rf-msg-err-mkr"></span>
<span class="rf-msg-lbl rf-msg-err-lbl">
<span class="rf-msg-sum">Name: Validation Error: Value is less than allowable minimum of '3'.</span>
<span class="rf-msg-des">Description</span>
@@ -77,9 +80,7 @@
<h1>FATAL Message</h1>
<span class="rf-msg rf-msg-ftl">
- <span class="rf-msg-mkr rf-msg-ftl-mkr">
- <img src="images/fatal.png" alt="Message marker"/>
- </span>
+ <span class="rf-msg-mkr rf-msg-ftl-mkr"></span>
<span class="rf-msg-lbl rf-msg-ftl-lbl">
<span class="rf-msg-sum">Fatal error!</span>
<span class="rf-msg-des">Description</span>
@@ -89,9 +90,7 @@
<h1>INFO Message</h1>
<span class="rf-msg rf-msg-inf">
- <span class="rf-msg-mkr rf-msg-inf-mkr">
- <img src="images/info.png" alt="Message marker"/>
- </span>
+ <span class="rf-msg-mkr rf-msg-inf-mkr"></span>
<span class="rf-msg-lbl rf-msg-inf-lbl">
<span class="rf-msg-sum">Information!</span>
<span class="rf-msg-des">Description</span>
@@ -101,9 +100,7 @@
<h1>WARNING Message</h1>
<span class="rf-msg rf-msg-wrn">
- <span class="rf-msg-mkr rf-msg-wrn-mkr">
- <img src="images/warning.png" alt="Message marker"/>
- </span>
+ <span class="rf-msg-mkr rf-msg-wrn-mkr"></span>
<span class="rf-msg-lbl rf-msg-wrn-lbl">
<span class="rf-msg-sum">Warning!</span>
<span class="rf-msg-des">Description</span>
Modified: management/design-4x/message/messages.html
===================================================================
--- management/design-4x/message/messages.html 2011-01-25 16:47:41 UTC (rev 21220)
+++ management/design-4x/message/messages.html 2011-01-25 16:49:29 UTC (rev 21221)
@@ -19,8 +19,11 @@
padding:0;
}
.rf-msgs li{
- margin:5px 0;
+ margin:6px 0;
}
+ .rf-msgs-lbl {
+ vertical-align:middle;
+ }
.rf-msgs table{
padding:0 0 8px;
}
@@ -29,24 +32,26 @@
text-align:left;
}
.rf-msgs td{
- padding:2px 0;
- vertical-align:middle;
+ padding:3px 0;
}
.rf-msgs-hdr{
font-weight:bold;
}
.rf-msgs-mkr{
+ display:inline-block;
+ height:16px;
+ vertical-align:middle;
+ padding-right:2px;
+ width:16px;
}
td.rf-msgs-mkr{
padding-right:5px;
}
- .rf-msgs-mkr img {
- vertical-align:middle;
- }
/* ERROR specific */
.rf-msgs-err{
}
.rf-msgs-err-mkr {
+ background:url(images/error.png) left center no-repeat;
}
.rf-msgs-err-lbl {
color:#ff0000;
@@ -55,6 +60,7 @@
.rf-msgs-ftl{
}
.rf-msgs-ftl-mkr {
+ background:url(images/fatal.png) left center no-repeat;
}
.rf-msgs-ftl-lbl {
color:#ff0000;
@@ -63,6 +69,7 @@
.rf-msgs-inf{
}
.rf-msgs-inf-mkr {
+ background:url(images/info.png) left center no-repeat;
}
.rf-msgs-inf-lbl {
color:#000000;
@@ -71,6 +78,7 @@
.rf-msgs-wrn{
}
.rf-msgs-wrn-mkr {
+ background:url(images/warning.png) left center no-repeat;
}
.rf-msgs-wrn-lbl {
color:#000000;
@@ -84,28 +92,28 @@
<div class="rf-msgs-hdr">Entered Data Status:</div>
<ul>
<li class="rf-msgs-err">
- <span class="rf-msgs-mkr rf-msgs-err-mkr"><img src="images/error.png" alt="Messages Marker"/></span>
+ <span class="rf-msgs-mkr rf-msgs-err-mkr"></span>
<span class="rf-msgs-lbl rf-msgs-err-lbl">
<span class="rf-msgs-sum">Name: Validation Error: Value is required.</span>
<span class="rf-msgs-des">Description.</span>
</span>
</li>
<li class="rf-msgs-ftl">
- <span class="rf-msgs-mkr rf-msgs-ftl-mkr"><img src="images/fatal.png" alt="Messages Marker"/></span>
+ <span class="rf-msgs-mkr rf-msgs-ftl-mkr"></span>
<span class="rf-msgs-lbl rf-msgs-ftl-lbl">
<span class="rf-msgs-sum">Fatal Error!</span>
<span class="rf-msgs-des">Description.</span>
</span>
</li>
<li class="rf-msgs-inf">
- <span class="rf-msgs-mkr rf-msgs-inf-mkr"><img src="images/info.png" alt="Messages Marker"/></span>
+ <span class="rf-msgs-mkr rf-msgs-inf-mkr"></span>
<span class="rf-msgs-lbl rf-msgs-inf-lbl">
<span class="rf-msgs-sum">Information!</span>
<span class="rf-msgs-des">Description.</span>
</span>
</li>
<li class="rf-msgs-wrn">
- <span class="rf-msgs-mkr rf-msgs-wrn-mkr"><img src="images/warning.png" alt="Messages Marker"/></span>
+ <span class="rf-msgs-mkr rf-msgs-wrn-mkr"></span>
<span class="rf-msgs-lbl rf-msgs-wrn-lbl">
<span class="rf-msgs-sum">Warning!</span>
<span class="rf-msgs-des">Description.</span>
@@ -125,28 +133,28 @@
</thead>
<tbody>
<tr class="rf-msgs-err">
- <td class="rf-msgs-mkr rf-msgs-err-mkr"><img src="images/error.png" alt="Messages Marker"/></td>
+ <td class="rf-msgs-mkr rf-msgs-err-mkr"></td>
<td class="rf-msgs-lbl rf-msgs-err-lbl">
<span class="rf-msgs-sum">Name: Validation Error: Value is required.</span>
<span class="rf-msgs-des">Description.</span>
</td>
</tr>
<tr class="rf-msgs-ftl">
- <td class="rf-msgs-mkr rf-msgs-ftl-mkr"><img src="images/fatal.png" alt="Messages Marker"/></td>
+ <td class="rf-msgs-mkr rf-msgs-ftl-mkr"></td>
<td class="rf-msgs-lbl rf-msgs-ftl-lbl">
<span class="rf-msgs-sum">Fatal Error!</span>
<span class="rf-msgs-des">Description.</span>
</td>
</tr>
<tr class="rf-msgs-inf">
- <td class="rf-msgs-mkr rf-msgs-inf-mkr"><img src="images/info.png" alt="Messages Marker"/></td>
+ <td class="rf-msgs-mkr rf-msgs-inf-mkr"></td>
<td class="rf-msgs-lbl rf-msgs-inf-lbl">
<span class="rf-msgs-sum">Information!</span>
<span class="rf-msgs-des">Description.</span>
</td>
</tr>
<tr class="rf-msgs-wrn">
- <td class="rf-msgs-mkr rf-msgs-wrn-mkr"><img src="images/warning.png" alt="Messages Marker"/></td>
+ <td class="rf-msgs-mkr rf-msgs-wrn-mkr"></td>
<td class="rf-msgs-lbl rf-msgs-wrn-lbl">
<span class="rf-msgs-sum">Warning!</span>
<span class="rf-msgs-des">Description.</span>
13 years, 11 months
JBoss Rich Faces SVN: r21220 - trunk/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-25 11:47:41 -0500 (Tue, 25 Jan 2011)
New Revision: 21220
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
Log:
RF-10283
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2011-01-25 16:46:38 UTC (rev 21219)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2011-01-25 16:47:41 UTC (rev 21220)
@@ -47,7 +47,7 @@
* @since 2010-10-24
*/
@JsfComponent(tag = @Tag(type = TagType.Facelets),
- renderer = @JsfRenderer(type = "org.richfaces.TooltipRenderer"))
+ renderer = @JsfRenderer(type = "org.richfaces.TooltipRenderer"), attributes = {"ajax-props.xml"})
public abstract class AbstractTooltip extends AbstractDivPanel implements MetaComponentResolver, MetaComponentEncoder {
public static final String COMPONENT_TYPE = "org.richfaces.Tooltip";
@@ -119,21 +119,6 @@
@Attribute(defaultValue = "10")
public abstract int getVerticalOffset();
- @Attribute
- public abstract boolean isLimitRender();
-
- @Attribute
- public abstract Object getData();
-
- @Attribute
- public abstract String getStatus();
-
- @Attribute
- public abstract Object getExecute();
-
- @Attribute
- public abstract Object getRender();
-
// ------------------------------------------------ Html Attributes
@Attribute
13 years, 11 months
JBoss Rich Faces SVN: r21219 - trunk/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-25 11:46:38 -0500 (Tue, 25 Jan 2011)
New Revision: 21219
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolbarGroup.java
Log:
RF-10278
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolbarGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolbarGroup.java 2011-01-25 16:35:55 UTC (rev 21218)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolbarGroup.java 2011-01-25 16:46:38 UTC (rev 21219)
@@ -43,6 +43,12 @@
public static final String COMPONENT_TYPE = "org.richfaces.ToolbarGroup";
@Attribute
+ public abstract String getItemClass();
+
+ @Attribute
+ public abstract String getItemStyle();
+
+ @Attribute
public abstract String getItemSeparator();
@Attribute
13 years, 11 months
JBoss Rich Faces SVN: r21218 - in trunk/ui/output/ui/src/main/java/org/richfaces: renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-25 11:35:55 -0500 (Tue, 25 Jan 2011)
New Revision: 21218
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
Log:
RF-10282
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2011-01-25 16:07:15 UTC (rev 21217)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2011-01-25 16:35:55 UTC (rev 21218)
@@ -120,9 +120,6 @@
public abstract int getVerticalOffset();
@Attribute
- public abstract boolean isBypassUpdates();
-
- @Attribute
public abstract boolean isLimitRender();
@Attribute
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 2011-01-25 16:07:15 UTC (rev 21217)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2011-01-25 16:35:55 UTC (rev 21218)
@@ -87,6 +87,7 @@
//TODO nick - this should be done on encode, not on decode
addOnCompleteParam(context, tooltip.getClientId(context));
+ context.renderResponse();
}
}
13 years, 11 months
JBoss Rich Faces SVN: r21217 - trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-25 11:07:15 -0500 (Tue, 25 Jan 2011)
New Revision: 21217
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.ecss
Log:
RF-10246 accordion: inconsistent styling comparing to other panels
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.ecss
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.ecss 2011-01-25 16:00:49 UTC (rev 21216)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.ecss 2011-01-25 16:07:15 UTC (rev 21217)
@@ -34,6 +34,9 @@
overflow: auto;
overflow-x: hidden;
padding: 10px;
+ font-size:'#{richSkin.generalSizeFont}';
+ color:'#{richSkin.generalTextColor}';
+ font-family:'#{richSkin.generalFamilyFont}';
}
.rf-ac-itm-hdr-act {}
13 years, 11 months
JBoss Rich Faces SVN: r21216 - trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2011-01-25 11:00:49 -0500 (Tue, 25 Jan 2011)
New Revision: 21216
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
Log:
RF-10288: incorrect positioning of popupPanel is fixed. Also code formatting, JS warnings are fixed.
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2011-01-25 15:30:23 UTC (rev 21215)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2011-01-25 16:00:49 UTC (rev 21216)
@@ -1,765 +1,755 @@
(function ($, richfaces) {
-
+
richfaces.ui = richfaces.ui || {};
- var selectionEventHandler = function(event){
- event.stopPropagation();
- event.preventDefault();
+ var selectionEventHandler = function(event) {
+ event.stopPropagation();
+ event.preventDefault();
};
- var disableSelection = function (element)
- {
- if (typeof element.onselectstart!="undefined") //IE
- {
- $(richfaces.getDomElement(element)).bind( 'selectstart', selectionEventHandler);
- }
- else //All other (ie: Opera)
- {
- $(richfaces.getDomElement(element)).bind( 'mousedown', selectionEventHandler);
- }
- }
+ var disableSelection = function (element) {
+ if (typeof element.onselectstart != "undefined") //IE
+ {
+ $(richfaces.getDomElement(element)).bind('selectstart', selectionEventHandler);
+ }
+ else //All other (ie: Opera)
+ {
+ $(richfaces.getDomElement(element)).bind('mousedown', selectionEventHandler);
+ }
+ };
- var enableSelection = function (element)
- {
- if (typeof element.onselectstart!="undefined") //IE
- {
- $(richfaces.getDomElement(element)).unbind( 'selectstart', selectionEventHandler);
- }
- else //All other (ie: Opera)
- {
- $(richfaces.getDomElement(element)).unbind( 'mousedown', selectionEventHandler);
- }
- }
-
- var defaultOptions = {
- width:-1,
- height:-1,
- minWidth:-1,
- minHeight:-1,
- modal:true,
- moveable:true,
- resizeable: false,
- autosized: false,
- modal:true,
- left: "auto",
- top : "auto",
- zindex:100,
- shadowDepth : 5,
- shadowOpacity: 0.1,
- attachToBody:true
- };
-
-
- richfaces.ui.PopupPanel = function(id, options) {
-
- $super.constructor.call(this,id);
- this.markerId = id;
- this.attachToDom(this.markerId);
- this.options = $.extend(this.options, defaultOptions, options || {});
+ var enableSelection = function (element) {
+ if (typeof element.onselectstart != "undefined") //IE
+ {
+ $(richfaces.getDomElement(element)).unbind('selectstart', selectionEventHandler);
+ }
+ else //All other (ie: Opera)
+ {
+ $(richfaces.getDomElement(element)).unbind('mousedown', selectionEventHandler);
+ }
+ };
- this.minWidth = this.getMinimumSize(this.options.minWidth);
- this.minHeight = this.getMinimumSize(this.options.minHeight);
- this.maxWidth = this.options.maxWidth;
- this.maxHeight = this.options.maxHeight;
+ var defaultOptions = {
+ width:-1,
+ height:-1,
+ minWidth:-1,
+ minHeight:-1,
+ modal:true,
+ moveable:true,
+ resizeable: false,
+ autosized: false,
+ left: "auto",
+ top : "auto",
+ zindex:100,
+ shadowDepth : 5,
+ shadowOpacity: 0.1,
+ attachToBody:true
+ };
- this.baseZIndex = this.options.zindex;
-
- this.div = $(richfaces.getDomElement(id));
- this.cdiv = $(richfaces.getDomElement(id + "_container"));
- this.contentDiv = $(richfaces.getDomElement(id + "_content"));
- this.shadowDiv = $(richfaces.getDomElement(id + "_shadow"));
- this.shadeDiv = $(richfaces.getDomElement(id + "_shade"));
- this.scrollerDiv = $(richfaces.getDomElement(id + "_content_scroller"));
- this.borders = new Array();
- this.firstHref = $(richfaces.getDomElement(id + "FirstHref"));
- if (this.options.resizeable) {
- this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerN", this, "N-resize", richfaces.ui.PopupPanel.Sizer.N));
- this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerE", this, "E-resize", richfaces.ui.PopupPanel.Sizer.E));
- this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerS", this, "S-resize", richfaces.ui.PopupPanel.Sizer.S));
- this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerW", this, "W-resize", richfaces.ui.PopupPanel.Sizer.W));
+ richfaces.ui.PopupPanel = function(id, options) {
- this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerNW", this, "NW-resize", richfaces.ui.PopupPanel.Sizer.NW));
- this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerNE", this, "NE-resize", richfaces.ui.PopupPanel.Sizer.NE));
- this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSE", this, "SE-resize", richfaces.ui.PopupPanel.Sizer.SE));
- this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSW", this, "SW-resize", richfaces.ui.PopupPanel.Sizer.SW));
- }
+ $super.constructor.call(this, id);
+ this.markerId = id;
+ this.attachToDom(this.markerId);
+ this.options = $.extend(this.options, defaultOptions, options || {});
- if (this.options.moveable && richfaces.getDomElement(id + "_header")) {
- this.header = new richfaces.ui.PopupPanel.Border(id + "_header", this, "move", richfaces.ui.PopupPanel.Sizer.Header);
- } else{
- $(richfaces.getDomElement(id + "_header")).css('cursor', 'default');
- }
+ this.minWidth = this.getMinimumSize(this.options.minWidth);
+ this.minHeight = this.getMinimumSize(this.options.minHeight);
+ this.maxWidth = this.options.maxWidth;
+ this.maxHeight = this.options.maxHeight;
+ this.baseZIndex = this.options.zindex;
+
+ this.div = $(richfaces.getDomElement(id));
+ this.cdiv = $(richfaces.getDomElement(id + "_container"));
+ this.contentDiv = $(richfaces.getDomElement(id + "_content"));
+ this.shadowDiv = $(richfaces.getDomElement(id + "_shadow"));
+ this.shadeDiv = $(richfaces.getDomElement(id + "_shade"));
+ this.scrollerDiv = $(richfaces.getDomElement(id + "_content_scroller"));
+
+ this.borders = new Array();
+ this.firstHref = $(richfaces.getDomElement(id + "FirstHref"));
+ if (this.options.resizeable) {
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerN", this, "N-resize", richfaces.ui.PopupPanel.Sizer.N));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerE", this, "E-resize", richfaces.ui.PopupPanel.Sizer.E));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerS", this, "S-resize", richfaces.ui.PopupPanel.Sizer.S));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerW", this, "W-resize", richfaces.ui.PopupPanel.Sizer.W));
+
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerNW", this, "NW-resize", richfaces.ui.PopupPanel.Sizer.NW));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerNE", this, "NE-resize", richfaces.ui.PopupPanel.Sizer.NE));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSE", this, "SE-resize", richfaces.ui.PopupPanel.Sizer.SE));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSW", this, "SW-resize", richfaces.ui.PopupPanel.Sizer.SW));
+ }
+
+ if (this.options.moveable && richfaces.getDomElement(id + "_header")) {
+ this.header = new richfaces.ui.PopupPanel.Border(id + "_header", this, "move", richfaces.ui.PopupPanel.Sizer.Header);
+ } else {
+ $(richfaces.getDomElement(id + "_header")).css('cursor', 'default');
+ }
+
};
-
- richfaces.BaseComponent.extend(richfaces.ui.PopupPanel);
- var $super = richfaces.ui.PopupPanel.$super;
- $.extend(richfaces.ui.PopupPanel.prototype, (function (options) {
-
+
+ richfaces.BaseComponent.extend(richfaces.ui.PopupPanel);
+ var $super = richfaces.ui.PopupPanel.$super;
+ $.extend(richfaces.ui.PopupPanel.prototype, (function (options) {
+
return {
-
- name: "PopupPanel",
- saveInputValues: function(element) {
- /* Fix for RF-3856 - Checkboxes in modal panel does not hold their states after modal was closed and opened again */
- if ($.browser.msie /* reproducible for checkbox/radio in IE6, radio in IE 7/8 beta 2 */) {
- $('input[type=checkbox], input[type=radio]', element).each(function(index) {
- $(this).defaultChecked = $(this).checked;
- });
- }
- },
-
- width: function() {
- return this.getContentElement()[0].clientWidth;//TODO
- },
- height: function() {
- return this.getContentElement()[0].clientHeight;//TODO
- },
-
- getLeft : function (){
- return this.cdiv.css('left');
- },
-
- getTop : function (){
- return this.cdiv.css('top');
- },
-
- getInitialSize : function(){
- if(this.options.autosized){
- return 15;
- } else{
- return $(richfaces.getDomElement(this.markerId + "_header_content")).height();
- }
- },
-
- getContentElement: function() {
- if (!this._contentElement) {
- this._contentElement = this.cdiv;
- }
+ name: "PopupPanel",
+ saveInputValues: function(element) {
+ /* Fix for RF-3856 - Checkboxes in modal panel does not hold their states after modal was closed and opened again */
+ if ($.browser.msie /* reproducible for checkbox/radio in IE6, radio in IE 7/8 beta 2 */) {
+ $('input[type=checkbox], input[type=radio]', element).each(function(index) {
+ $(this).defaultChecked = $(this).checked;
+ });
+ }
+ },
- return this._contentElement;
- },
- getSizeElement : function() {
- return document.body;
- },
+ width: function() {
+ return this.getContentElement()[0].clientWidth;//TODO
+ },
- getMinimumSize : function(size) {
- return Math.max(size, 2*this.getInitialSize() + 2);
- },
- destroy: function() {
-
- this._contentElement = null;
- this.firstOutside = null;
- this.lastOutside = null;
- this.firstHref = null;
- this.parent = null;
- if (this.header) {
- this.header.destroy();
- this.header=null;
- }
+ height: function() {
+ return this.getContentElement()[0].clientHeight;//TODO
+ },
- for (var k = 0; k < this.borders.length; k++ ) {
- this.borders[k].destroy();
- }
- this.borders = null;
+ getLeft : function () {
+ return this.cdiv.css('left');
+ },
- if (this.domReattached) {
- var element = this.div;
- var parent = element.parent();
- if (parent) {
- parent.remove(element);
- }
- }
- this.markerId = null;
- this.options = null;
-
- this.div = null;
- this.cdiv = null;
- this.contentDiv = null;
- this.shadowDiv = null;
- this.scrollerDiv = null;
- this.userOptions = null;
- this.eIframe= null;
-
- $super.destroy.call(this);
-
- },
+ getTop : function () {
+ return this.cdiv.css('top');
+ },
- initIframe : function() {
- if (this.contentWindow) {
- $(this.contentWindow.document.body).css("margin", "0px 0px 0px 0px");
- } else {
- //TODO opera etc.
+ getInitialSize : function() {
+ if (this.options.autosized) {
+ return 15;
+ } else {
+ return $(richfaces.getDomElement(this.markerId + "_header_content")).height();
+ }
+ },
- }
+ getContentElement: function() {
+ if (!this._contentElement) {
+ this._contentElement = this.cdiv;
+ }
- if("transparent" == $(document.body).css("background-color")) {
- $(this).css('filter', "alpha(opacity=0)");
- $(this).css('opacity', "0");
- }
- },
-
- setLeft: function(pos) {
- if(!isNaN(pos)){
- this.cdiv.css('left', pos + "px");
- this.shadowDiv.css('left', pos + parseInt(this.options.shadowDepth) + "px");
- }
- },
+ return this._contentElement;
+ },
+ getSizeElement : function() {
+ return document.body;
+ },
- setTop: function(pos) {
- if(!isNaN(pos)){
- this.cdiv.css('top', pos + "px");
- this.shadowDiv.css('top', pos + parseInt(this.options.shadowDepth) +"px");
- }
- },
+ getMinimumSize : function(size) {
+ return Math.max(size, 2 * this.getInitialSize() + 2);
+ },
+ destroy: function() {
- show: function(event, opts) {
- var element = this.cdiv;
- if(!this.shown && this.invokeEvent("beforeshow",event,null,element)) {
- this.preventFocus();
-
-
- if (!this.domReattached) {
- this.parent = this.div.parent();
-
- var domElementAttachment;
- if (opts) {
- domElementAttachment = opts.domElementAttachment;
- }
-
- if (!domElementAttachment) {
- domElementAttachment = this.options.domElementAttachment;
- }
-
- var newParent;
- if ('parent' == domElementAttachment) {
- newParent = this.parent;
- } else if ('form' == domElementAttachment) {
- newParent = this.findForm(element) || document.body;
- } else {
- //default - body
- newParent = document.body;
- }
-
- if (newParent != this.parent) {
- this.saveInputValues(element);
+ this._contentElement = null;
+ this.firstOutside = null;
+ this.lastOutside = null;
+ this.firstHref = null;
+ this.parent = null;
+ if (this.header) {
+ this.header.destroy();
+ this.header = null;
+ }
+
+ for (var k = 0; k < this.borders.length; k++) {
+ this.borders[k].destroy();
+ }
+ this.borders = null;
+
+ if (this.domReattached) {
+ var element = this.div;
+ var parent = element.parent();
+ if (parent) {
+ parent.remove(element);
+ }
+ }
+ this.markerId = null;
+ this.options = null;
+
+ this.div = null;
+ this.cdiv = null;
+ this.contentDiv = null;
+ this.shadowDiv = null;
+ this.scrollerDiv = null;
+ this.userOptions = null;
+ this.eIframe = null;
+
+ $super.destroy.call(this);
+
+ },
+
+ initIframe : function() {
+ if (this.contentWindow) {
+ $(this.contentWindow.document.body).css("margin", "0px 0px 0px 0px");
+ } else {
+ //TODO opera etc.
+
+ }
+
+ if ("transparent" == $(document.body).css("background-color")) {
+ $(this).css('filter', "alpha(opacity=0)");
+ $(this).css('opacity', "0");
+ }
+ },
+
+ setLeft: function(pos) {
+ if (!isNaN(pos)) {
+ this.cdiv.css('left', pos + "px");
+ this.shadowDiv.css('left', pos + parseInt(this.options.shadowDepth) + "px");
+ }
+ },
+
+ setTop: function(pos) {
+ if (!isNaN(pos)) {
+ this.cdiv.css('top', pos + "px");
+ this.shadowDiv.css('top', pos + parseInt(this.options.shadowDepth) + "px");
+ }
+ },
+
+ show: function(event, opts) {
+ var element = this.cdiv;
+ if (!this.shown && this.invokeEvent("beforeshow", event, null, element)) {
+ this.preventFocus();
+
+
+ if (!this.domReattached) {
+ this.parent = this.div.parent();
+
+ var domElementAttachment;
+ if (opts) {
+ domElementAttachment = opts.domElementAttachment;
+ }
+
+ if (!domElementAttachment) {
+ domElementAttachment = this.options.domElementAttachment;
+ }
+
+ var newParent;
+ if ('parent' == domElementAttachment) {
+ newParent = this.parent;
+ } else if ('form' == domElementAttachment) {
+ newParent = this.findForm(element) || document.body;
+ } else {
+ //default - body
+ newParent = document.body;
+ }
+
+ if (newParent != this.parent) {
+ this.saveInputValues(element);
this.shadeDiv.insertAfter($(newParent).children().last());
this.shadowDiv.insertAfter($(newParent).children().last());
- this.cdiv.insertAfter($(newParent).children().last());
- this.domReattached = true;
- } else {
- this.parent.show();
- }
- }
-
- var forms = $("form", element);
-
- if (this.options.keepVisualState && forms) {
- for (var i = 0; i < forms.length; i++) {
- var popup = this;
- $(forms[i]).bind( "submit", {popup:popup}, this.setStateInput);
- }
- }
-
-
-
- var options = {};
- this.userOptions = {};
- if (!element.mpSet) {
- $.extend(options, this.options);
- }
-
- if (opts) {
- $.extend(options, opts);
- $.extend(this.userOptions, opts);
- }
-
- this.currentMinHeight = this.getMinimumSize((options.minHeight || options.minHeight == 0) ? options.minHeight : this.minHeight);
- this.currentMinWidth = this.getMinimumSize((options.minWidth || options.minWidth == 0) ? options.minWidth : this.minWidth);
-
- var eContentElt = this.getContentElement();
-
- if (!this.options.autosized) {
- if (options.width && options.width == -1)
- options.width = 300;
- if (options.height && options.height == -1)
- options.height = 200;
- }
-
- if (options.width && options.width != -1) {
- if (this.currentMinWidth > options.width) {
- options.width = this.currentMinWidth;
- }
- if (options.width > this.maxWidth) {
- options.width = this.maxWidth;
- }
- $(richfaces.getDomElement(eContentElt)).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
- this.shadowDiv.css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
- this.scrollerDiv.css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
-
-
- }
-
- if (options.height && options.height != -1) {
- if (this.currentMinHeight > options.height) {
- options.height = this.currentMinHeight;
- }
- if (options.height > this.maxHeight) {
- options.height = this.maxHeight;
- }
- $(richfaces.getDomElement(eContentElt)).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
- this.shadowDiv.css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
- var headerHeight = $(richfaces.getDomElement(this.markerId +"_header"))[0] ? $(richfaces.getDomElement(this.markerId +"_header"))[0].clientHeight : 0;
- this.scrollerDiv.css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
-
-
- }
- var eIframe;
- if (this.options.overlapEmbedObjects && !this.iframe) {
- this.iframe = this.markerId + "IFrame";
- $("<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +
- "class=\"rf-pp-ifr\" style=\"width:" +this.options.width + "px; height:" + this.options.height + "px;\">" +
- "</iframe>").insertBefore($(':first-child', this.cdiv)[0]);
-
- eIframe = $(richfaces.getDomElement(this.iframe));
-
- eIframe.bind('load', this.initIframe);
- this.eIframe = eIframe;
- }
- element.mpSet = true;
-
- var eDiv = this.div;
-
- if (options.left) {
- var _left;
- if (options.left != "auto") {
- _left = parseInt(options.left, 10);
- } else {
- var cw = this.getSizeElement().clientWidth;
- var _width = this.width();
- if (cw >= _width) {
- _left = (cw - _width) / 2;
- } else {
- _left = 0;
- }
- }
-
- this.setLeft(Math.round(_left));
- }
-
- if (options.top) {
- var _top;
- if (options.top != "auto") {
- _top = parseInt(options.top, 10);
- } else {
- var ch = this.getSizeElement().clientHeight;
- var _height = this.height();
- if (ch >= _height) {
- _top = (ch - _height) / 2;
- } else {
- _top = 0;
- }
- }
-
- this.setTop(Math.round(_top));
- }
-
- this.shadowDiv.css('opacity', this.options.shadowOpacity);
- this.shadowDiv.css('filter ', 'alpha(opacity='+this.options.shadowOpacity*100 +');');
-
- this.div.css('visibility', '');
- this.div.css('display', 'block');
- if (this.options.autosized) {
- this.shadowDiv.css('height', this.cdiv[0].clientHeight);
- this.shadowDiv.css('width', this.cdiv[0].clientWidth);
-
- }
- var event = {};
- event.parameters = opts || {};
- this.shown = true;
- this.invokeEvent("show",event,null,element);
- }
- },
-
- startDrag: function(border) {
- //for (var k = 0; k < this.borders.length; k++ ) {
- //this.borders[k].hide();
- //}
- disableSelection(document.body);
- },
- firstOnfocus: function(event) {
- var e = $(event.data.popup.firstHref)
- if (e) {
- e.focus();
- }
- },
+ this.cdiv.insertAfter($(newParent).children().last());
+ this.domReattached = true;
+ } else {
+ this.parent.show();
+ }
+ }
-
- formElements: "|a|input|select|button|textarea|",
-
- processAllFocusElements: function(root, callback) {
- var idx = -1;
- var tagName;
-
- if (root.focus && root.nodeType == 1 && (tagName = root.tagName) &&
- // Many not visible elements have focus method, we is had to avoid processing them.
- (idx = this.formElements.indexOf(tagName.toLowerCase())) != -1 &&
- this.formElements.charAt(idx - 1) === '|' &&
- this.formElements.charAt(idx + tagName.length) === '|' &&
- !root.disabled && root.type!="hidden") {
- callback.call(this, root);
- } else {
- if (root != this.div) {
- var child = root.firstChild;
- while (child) {
- if (!child.style || child.style.display != 'none') {
- this.processAllFocusElements(child, callback);
- }
- child = child.nextSibling;
- }
- }
- }
- },
+ var forms = $("form", element);
- processTabindexes: function(input) {
- if (!this.firstOutside) {
- this.firstOutside = input;
- }
- if (input.tabIndex && !input.prevTabIndex) {
- input.prevTabIndex = input.tabIndex;
- }
- input.tabIndex = undefined;
- if (input.accesskey && !input.prevAccesskey) {
- input.prevAccesskey = input.accesskey;
- }
- input.accesskey = undefined;
- },
+ if (this.options.keepVisualState && forms) {
+ for (var i = 0; i < forms.length; i++) {
+ var popup = this;
+ $(forms[i]).bind("submit", {popup:popup}, this.setStateInput);
+ }
+ }
- restoreTabindexes: function(input) {
- if (input.prevTabIndex) {
- input.tabIndex = input.prevTabIndex;
- input.prevTabIndex = undefined;
- }
- if (input.prevAccesskey) {
- input.accesskey = input.prevAccesskey;
- input.prevAccesskey = undefined;
- }
- },
- preventFocus: function() {
- if(this.options.modal){
- this.processAllFocusElements(document, this.processTabindexes);
- var popup = this;
- if (this.firstOutside) {
-
- $(richfaces.getDomElement(this.firstOutside)).bind("focus", {popup: popup}, this.firstOnfocus);
- }
- }
- },
+ var options = {};
+ this.userOptions = {};
+ $.extend(options, this.options);
- restoreFocus: function() {
- if(this.options.modal){
- this.processAllFocusElements(document, this.restoreTabindexes);
-
- if (this.firstOutside) {
- $(richfaces.getDomElement(this.firstOutside)).unbind("focus", this.firstOnfocus);
- this.firstOutside = null;
- }
- }
- },
-
- endDrag: function(border) {
- for (var k = 0; k < this.borders.length; k++ ) {
- this.borders[k].show();
- this.borders[k].doPosition();
- }
- enableSelection(document.body);
- },
+ if (opts) {
+ $.extend(options, opts);
+ $.extend(this.userOptions, opts);
+ }
- hide: function(event, opts) {
- var element = this.cdiv;
- this.restoreFocus();
- if (this.shown && this.invokeEvent("beforehide",event,null,element)) {
+ this.currentMinHeight = this.getMinimumSize((options.minHeight || options.minHeight == 0) ? options.minHeight : this.minHeight);
+ this.currentMinWidth = this.getMinimumSize((options.minWidth || options.minWidth == 0) ? options.minWidth : this.minWidth);
- this.currentMinHeight = undefined;
- this.currentMinWidth = undefined;
-
- this.div.hide();
-
- if (this.parent) {
- if (this.domReattached) {
- this.saveInputValues(element);
- this.div.append(this.shadeDiv);
- this.div.append(this.shadowDiv);
- this.div.append(element);
+ var eContentElt = this.getContentElement();
- this.domReattached = false;
- }
- }
-
- var event = {};
- event.parameters = opts || {};
-// if (this.options && this.options.onhide) {
-// this.options.onhide(event);
-// }
-
- var forms = $("form", element);
- if (this.options.keepVisualState && forms) {
- for (var i = 0; i < forms.length; i++) {
- $(forms[i]).unbind( "submit", this.setStateInput);
- }
- }
-
- this.shown = false;
- this.invokeEvent("hide",event,null,element)
- }
- },
+ if (!this.options.autosized) {
+ if (options.width && options.width == -1)
+ options.width = 300;
+ if (options.height && options.height == -1)
+ options.height = 200;
+ }
- getStyle: function(elt, name) {
- return parseInt($(richfaces.getDomElement(elt)).css(name).replace("px", ""), 10);
- },
-
- doResizeOrMove: function(diff) {
- var vetoes = {};
- var shadowHash = {};
- var cssHash = {};
- var cssHashWH = {};
- var shadowHashWH = {};
- var contentHashWH = {};
- var scrollerHashWH = {};
+ if (options.width && options.width != -1) {
+ if (this.currentMinWidth > options.width) {
+ options.width = this.currentMinWidth;
+ }
+ if (options.width > this.maxWidth) {
+ options.width = this.maxWidth;
+ }
+ $(richfaces.getDomElement(eContentElt)).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+ this.shadowDiv.css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+ this.scrollerDiv.css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
- var vetoeChange = false;
- var newSize;
- var shadowDepth = parseInt(this.options.shadowDepth);
- var scrollerHeight = 22;
- var scrollerWidth = 0;
- var eContentElt = this.getContentElement();
-
- newSize = this.getStyle(eContentElt, "width");
- var oldSize = newSize;
- newSize += diff.deltaWidth || 0;
+ }
-
-
- if (newSize >= this.currentMinWidth || this.options.autosized) {
- if (diff.deltaWidth) {
- cssHashWH.width = newSize + 'px';
- shadowHashWH.width = newSize + 'px';
- contentHashWH.width = newSize - scrollerWidth + 'px';
- scrollerHashWH.width = newSize - scrollerWidth + 'px';
- }
- } else {
- if (diff.deltaWidth) {
- cssHashWH.width = this.currentMinWidth + 'px';
- shadowHashWH.width = this.currentMinWidth + 'px';
- contentHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
- scrollerHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
- vetoes.vx = oldSize - this.currentMinWidth;
- }
+ if (options.height && options.height != -1) {
+ if (this.currentMinHeight > options.height) {
+ options.height = this.currentMinHeight;
+ }
+ if (options.height > this.maxHeight) {
+ options.height = this.maxHeight;
+ }
+ $(richfaces.getDomElement(eContentElt)).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
+ this.shadowDiv.css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
+ var headerHeight = $(richfaces.getDomElement(this.markerId + "_header"))[0] ? $(richfaces.getDomElement(this.markerId + "_header"))[0].clientHeight : 0;
+ this.scrollerDiv.css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
- vetoes.x = true;
- }
-
- if (newSize > this.options.maxWidth) {
- if (diff.deltaWidth) {
- cssHashWH.width = this.currentMaxWidth + 'px';
- shadowHashWH.width = this.currentMaxWidth + 'px';
- contentHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
- scrollerHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
- vetoes.vx = oldSize - this.currentMaxWidth;
- }
- vetoes.x = true;
- }
+ }
+ var eIframe;
+ if (this.options.overlapEmbedObjects && !this.iframe) {
+ this.iframe = this.markerId + "IFrame";
+ $("<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +
+ "class=\"rf-pp-ifr\" style=\"width:" + this.options.width + "px; height:" + this.options.height + "px;\">" +
+ "</iframe>").insertBefore($(':first-child', this.cdiv)[0]);
- if (vetoes.vx && diff.deltaX) {
- diff.deltaX = -vetoes.vx;
- }
-
- var eCdiv = $(this.cdiv);
+ eIframe = $(richfaces.getDomElement(this.iframe));
- if (diff.deltaX && (vetoes.vx || !vetoes.x)) {
- if (vetoes.vx) {
- diff.deltaX = vetoes.vx;
- }
- var newPos;
-
- newPos = this.getStyle(eCdiv, "left");
- newPos += diff.deltaX;
- cssHash.left = newPos + 'px';
-
- shadowHash.left = newPos + shadowDepth + "px";
- }
+ eIframe.bind('load', this.initIframe);
+ this.eIframe = eIframe;
+ }
- newSize = this.getStyle(eContentElt, "height")
+ if (options.left) {
+ var _left;
+ if (options.left != "auto") {
+ _left = parseInt(options.left, 10);
+ } else {
+ var cw = this.__calculateWindowWidth();
+ var _width = this.width();
+ if (cw >= _width) {
+ _left = (cw - _width) / 2;
+ } else {
+ _left = 0;
+ }
+ }
- var oldSize = newSize;
- newSize += diff.deltaHeight || 0;
+ this.setLeft(Math.round(_left));
+ }
- if (newSize >= this.currentMinHeight || this.options.autosized) {
- if (diff.deltaHeight) {
- cssHashWH.height = newSize + 'px';
- shadowHashWH.height = newSize + 'px';
- scrollerHashWH.height = newSize - scrollerHeight + 'px';
- }
- } else {
- if (diff.deltaHeight) {
- cssHashWH.height = this.currentMinHeight + 'px';
- shadowHashWH.height = this.currentMinHeight + 'px';
- scrollerHashWH.height = this.currentMinHeight - scrollerHeight + 'px';
- vetoes.vy = oldSize - this.currentMinHeight;
- }
+ if (options.top) {
+ var _top;
+ if (options.top != "auto") {
+ _top = parseInt(options.top, 10);
+ } else {
+ var ch = this.__calculateWindowHeight();
+ var _height = this.height();
+ if (ch >= _height) {
+ _top = (ch - _height) / 2;
+ } else {
+ _top = 0;
+ }
+ }
- vetoes.y = true;
- }
-
- if (newSize > this.options.maxHeight) {
- if (diff.deltaHeight) {
- cssHashWH.height = this.currentMaxHeight + 'px';
- shadowHashWH.height = this.currentMaxHeight + 'px';
- scrollerHashWH.height = this.currentMaxHeight - scrollerHeight + 'px';
- vetoes.vy = oldSize - this.currentMaxHeight;
- }
+ this.setTop(Math.round(_top));
+ }
- vetoes.y = true;
- }
+ this.shadowDiv.css('opacity', this.options.shadowOpacity);
+ this.shadowDiv.css('filter ', 'alpha(opacity=' + this.options.shadowOpacity * 100 + ');');
- if (vetoes.vy && diff.deltaY) {
- diff.deltaY = -vetoes.vy;
- }
+ this.div.css('visibility', '');
+ this.div.css('display', 'block');
+ if (this.options.autosized) {
+ this.shadowDiv.css('height', this.cdiv[0].clientHeight);
+ this.shadowDiv.css('width', this.cdiv[0].clientWidth);
- if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
- if (vetoes.vy) {
- diff.deltaY = vetoes.vy;
- }
+ }
+ var showEvent = {};
+ showEvent.parameters = opts || {};
+ this.shown = true;
+ this.invokeEvent("show", showEvent, null, element);
+ }
+ },
- }
- if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
- if (vetoes.vy) {
- diff.deltaY = vetoes.vy;
- }
- var newPos;
-
- newPos = this.getStyle(eCdiv, "top");
- newPos += diff.deltaY;
- cssHash.top = newPos + 'px';
- shadowHash.top = newPos + shadowDepth + "px";
- }
- eContentElt.css(cssHashWH);
- this.scrollerDiv.css(scrollerHashWH);
- if(this.eIframe){
- this.eIframe.css(scrollerHashWH);
- }
- this.shadowDiv.css(shadowHashWH);
+ __calculateWindowHeight: function() {
+ var documentElement = document.documentElement;
+ return self.innerHeight || (documentElement && documentElement.clientHeight) || document.body.clientHeight;
+ },
- eCdiv.css(cssHash);
- this.shadowDiv.css(shadowHash);
+ __calculateWindowWidth: function() {
+ var documentElement = document.documentElement;
+ return self.innerWidth || (documentElement && documentElement.clientWidth) || document.body.clientWidth;
+ },
- $.extend(this.userOptions, cssHash);
- $.extend(this.userOptions, cssHashWH);
- var w = this.width();
- var h = this.height();
+ startDrag: function(border) {
+ disableSelection(document.body);
+ },
+ firstOnfocus: function(event) {
+ var e = $(event.data.popup.firstHref);
+ if (e) {
+ e.focus();
+ }
+ },
- this.reductionData = null;
- if (w <= 2*this.getInitialSize()) {
- this.reductionData = {};
- this.reductionData.w = w;
- }
+ formElements: "|a|input|select|button|textarea|",
- if (h <= 2*this.getInitialSize()) {
- if (!this.reductionData) {
- this.reductionData = {};
- }
+ processAllFocusElements: function(root, callback) {
+ var idx = -1;
+ var tagName;
- this.reductionData.h = h;
- }
+ if (root.focus && root.nodeType == 1 && (tagName = root.tagName) &&
+ // Many not visible elements have focus method, we is had to avoid processing them.
+ (idx = this.formElements.indexOf(tagName.toLowerCase())) != -1 &&
+ this.formElements.charAt(idx - 1) === '|' &&
+ this.formElements.charAt(idx + tagName.length) === '|' &&
+ !root.disabled && root.type != "hidden") {
+ callback.call(this, root);
+ } else {
+ if (root != this.div) {
+ var child = root.firstChild;
+ while (child) {
+ if (!child.style || child.style.display != 'none') {
+ this.processAllFocusElements(child, callback);
+ }
+ child = child.nextSibling;
+ }
+ }
+ }
+ },
- if (this.header) {
- this.header.doPosition();
- }
-
- return vetoes;
- },
-
- setSize : function (width, height){
- var w = width - this.width() ;
- var h = height -this.height();
- var diff = new richfaces.ui.PopupPanel.Sizer.Diff(0,0, w, h);
- this.doResizeOrMove(diff);
- },
-
- moveTo : function (top, left){
- var shadowDepth = parseInt(this.options.shadowDepth);
- this.cdiv.css('top', top);
- this.cdiv.css('left', left);
- this.shadowDiv.css('top', top + shadowDepth);
- this.shadowDiv.css('left', left + shadowDepth);
- },
-
- move : function (dx, dy){
- var diff = new richfaces.ui.PopupPanel.Sizer.Diff(dx,dy, 0, 0);
- this.doResizeOrMove(diff);
- },
-
- resize : function (dx, dy){
- var diff = new richfaces.ui.PopupPanel.Sizer.Diff(0,0, dx, dy);
- this.doResizeOrMove(diff);
- },
+ processTabindexes: function(input) {
+ if (!this.firstOutside) {
+ this.firstOutside = input;
+ }
+ if (input.tabIndex && !input.prevTabIndex) {
+ input.prevTabIndex = input.tabIndex;
+ }
+ input.tabIndex = undefined;
+ if (input.accesskey && !input.prevAccesskey) {
+ input.prevAccesskey = input.accesskey;
+ }
+ input.accesskey = undefined;
+ },
- findForm: function(elt) {
- var target = elt;
- while (target) {
- if (target[0] && (!target[0].tagName /* document node doesn't have tagName */
- || target[0].tagName.toLowerCase() != "form")) {
-
- target = $(target).parent();
- } else {
- break;
- }
- }
-
- return target;
- },
-
- setStateInput: function(event) {
- // Concret input but not entire form is a target element for onsubmit in FF
- var popup = event.data.popup;
- target = $(popup.findForm(event.currentTarget));
-
- var input = document.createElement("input");
- input.type = "hidden";
- input.id = popup.markerId + "OpenedState";
- input.name = popup.markerId + "OpenedState";
- input.value = popup.shown ? "true" : "false";
- target.append(input);
+ restoreTabindexes: function(input) {
+ if (input.prevTabIndex) {
+ input.tabIndex = input.prevTabIndex;
+ input.prevTabIndex = undefined;
+ }
+ if (input.prevAccesskey) {
+ input.accesskey = input.prevAccesskey;
+ input.prevAccesskey = undefined;
+ }
+ },
- $.each(popup.userOptions, function(key, value) {
- input = document.createElement("input");
- input.type = "hidden";
- input.id = popup.markerId + "StateOption_" + key;
- input.name = popup.markerId + "StateOption_" + key;
- input.value = value;
- target.append(input);
- });
-
- return true;
- }
-
-
- }
-
+ preventFocus: function() {
+ if (this.options.modal) {
+ this.processAllFocusElements(document, this.processTabindexes);
+ var popup = this;
+ if (this.firstOutside) {
+
+ $(richfaces.getDomElement(this.firstOutside)).bind("focus", {popup: popup}, this.firstOnfocus);
+ }
+ }
+ },
+
+ restoreFocus: function() {
+ if (this.options.modal) {
+ this.processAllFocusElements(document, this.restoreTabindexes);
+
+ if (this.firstOutside) {
+ $(richfaces.getDomElement(this.firstOutside)).unbind("focus", this.firstOnfocus);
+ this.firstOutside = null;
+ }
+ }
+ },
+
+ endDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++) {
+ this.borders[k].show();
+ this.borders[k].doPosition();
+ }
+ enableSelection(document.body);
+ },
+
+ hide: function(event, opts) {
+ var element = this.cdiv;
+ this.restoreFocus();
+ if (this.shown && this.invokeEvent("beforehide", event, null, element)) {
+
+ this.currentMinHeight = undefined;
+ this.currentMinWidth = undefined;
+
+ this.div.hide();
+
+ if (this.parent) {
+ if (this.domReattached) {
+ this.saveInputValues(element);
+ this.div.append(this.shadeDiv);
+ this.div.append(this.shadowDiv);
+ this.div.append(element);
+
+ this.domReattached = false;
+ }
+ }
+
+ var hideEvent = {};
+ hideEvent.parameters = opts || {};
+
+ var forms = $("form", element);
+ if (this.options.keepVisualState && forms) {
+ for (var i = 0; i < forms.length; i++) {
+ $(forms[i]).unbind("submit", this.setStateInput);
+ }
+ }
+
+ this.shown = false;
+ this.invokeEvent("hide", hideEvent, null, element)
+ }
+ },
+
+ getStyle: function(elt, name) {
+ return parseInt($(richfaces.getDomElement(elt)).css(name).replace("px", ""), 10);
+ },
+
+ doResizeOrMove: function(diff) {
+ var vetoes = {};
+ var shadowHash = {};
+ var cssHash = {};
+ var cssHashWH = {};
+ var shadowHashWH = {};
+ var contentHashWH = {};
+ var scrollerHashWH = {};
+ var newSize;
+ var shadowDepth = parseInt(this.options.shadowDepth);
+ var scrollerHeight = 22;
+ var scrollerWidth = 0;
+ var eContentElt = this.getContentElement();
+
+ newSize = this.getStyle(eContentElt, "width");
+
+ var oldWidthSize = newSize;
+ newSize += diff.deltaWidth || 0;
+
+
+ if (newSize >= this.currentMinWidth || this.options.autosized) {
+ if (diff.deltaWidth) {
+ cssHashWH.width = newSize + 'px';
+ shadowHashWH.width = newSize + 'px';
+ contentHashWH.width = newSize - scrollerWidth + 'px';
+ scrollerHashWH.width = newSize - scrollerWidth + 'px';
+ }
+ } else {
+ if (diff.deltaWidth) {
+ cssHashWH.width = this.currentMinWidth + 'px';
+ shadowHashWH.width = this.currentMinWidth + 'px';
+ contentHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
+ scrollerHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
+ vetoes.vx = oldWidthSize - this.currentMinWidth;
+ }
+
+ vetoes.x = true;
+ }
+
+ if (newSize > this.options.maxWidth) {
+ if (diff.deltaWidth) {
+ cssHashWH.width = this.currentMaxWidth + 'px';
+ shadowHashWH.width = this.currentMaxWidth + 'px';
+ contentHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
+ scrollerHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
+ vetoes.vx = oldWidthSize - this.currentMaxWidth;
+ }
+
+ vetoes.x = true;
+ }
+
+ if (vetoes.vx && diff.deltaX) {
+ diff.deltaX = -vetoes.vx;
+ }
+
+ var eCdiv = $(this.cdiv);
+
+ if (diff.deltaX && (vetoes.vx || !vetoes.x)) {
+ if (vetoes.vx) {
+ diff.deltaX = vetoes.vx;
+ }
+
+ var newLeftPos = this.getStyle(eCdiv, "left");
+ newLeftPos += diff.deltaX;
+ cssHash.left = newLeftPos + 'px';
+
+ shadowHash.left = newLeftPos + shadowDepth + "px";
+ }
+
+ newSize = this.getStyle(eContentElt, "height");
+
+ var oldHeightSize = newSize;
+ newSize += diff.deltaHeight || 0;
+
+ if (newSize >= this.currentMinHeight || this.options.autosized) {
+ if (diff.deltaHeight) {
+ cssHashWH.height = newSize + 'px';
+ shadowHashWH.height = newSize + 'px';
+ scrollerHashWH.height = newSize - scrollerHeight + 'px';
+ }
+ } else {
+ if (diff.deltaHeight) {
+ cssHashWH.height = this.currentMinHeight + 'px';
+ shadowHashWH.height = this.currentMinHeight + 'px';
+ scrollerHashWH.height = this.currentMinHeight - scrollerHeight + 'px';
+ vetoes.vy = oldHeightSize - this.currentMinHeight;
+ }
+
+ vetoes.y = true;
+ }
+
+ if (newSize > this.options.maxHeight) {
+ if (diff.deltaHeight) {
+ cssHashWH.height = this.currentMaxHeight + 'px';
+ shadowHashWH.height = this.currentMaxHeight + 'px';
+ scrollerHashWH.height = this.currentMaxHeight - scrollerHeight + 'px';
+ vetoes.vy = oldHeightSize - this.currentMaxHeight;
+ }
+
+ vetoes.y = true;
+ }
+
+ if (vetoes.vy && diff.deltaY) {
+ diff.deltaY = -vetoes.vy;
+ }
+
+ if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
+ if (vetoes.vy) {
+ diff.deltaY = vetoes.vy;
+ }
+
+ }
+ if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
+ if (vetoes.vy) {
+ diff.deltaY = vetoes.vy;
+ }
+
+ var newTopPos = this.getStyle(eCdiv, "top");
+ newTopPos += diff.deltaY;
+ cssHash.top = newTopPos + 'px';
+ shadowHash.top = newTopPos + shadowDepth + "px";
+ }
+ eContentElt.css(cssHashWH);
+ this.scrollerDiv.css(scrollerHashWH);
+ if (this.eIframe) {
+ this.eIframe.css(scrollerHashWH);
+ }
+ this.shadowDiv.css(shadowHashWH);
+
+ eCdiv.css(cssHash);
+ this.shadowDiv.css(shadowHash);
+
+ $.extend(this.userOptions, cssHash);
+ $.extend(this.userOptions, cssHashWH);
+ var w = this.width();
+ var h = this.height();
+
+ this.reductionData = null;
+
+ if (w <= 2 * this.getInitialSize()) {
+ this.reductionData = {};
+ this.reductionData.w = w;
+ }
+
+ if (h <= 2 * this.getInitialSize()) {
+ if (!this.reductionData) {
+ this.reductionData = {};
+ }
+
+ this.reductionData.h = h;
+ }
+
+ if (this.header) {
+ this.header.doPosition();
+ }
+
+ return vetoes;
+ },
+
+ setSize : function (width, height) {
+ var w = width - this.width();
+ var h = height - this.height();
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, w, h);
+ this.doResizeOrMove(diff);
+ },
+
+ moveTo : function (top, left) {
+ var shadowDepth = parseInt(this.options.shadowDepth);
+ this.cdiv.css('top', top);
+ this.cdiv.css('left', left);
+ this.shadowDiv.css('top', top + shadowDepth);
+ this.shadowDiv.css('left', left + shadowDepth);
+ },
+
+ move : function (dx, dy) {
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(dx, dy, 0, 0);
+ this.doResizeOrMove(diff);
+ },
+
+ resize : function (dx, dy) {
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, dx, dy);
+ this.doResizeOrMove(diff);
+ },
+
+ findForm: function(elt) {
+ var target = elt;
+ while (target) {
+ if (target[0] && (!target[0].tagName /* document node doesn't have tagName */
+ || target[0].tagName.toLowerCase() != "form")) {
+
+ target = $(target).parent();
+ } else {
+ break;
+ }
+ }
+
+ return target;
+ },
+
+ setStateInput: function(event) {
+ // Concret input but not entire form is a target element for onsubmit in FF
+ var popup = event.data.popup;
+ target = $(popup.findForm(event.currentTarget));
+
+ var input = document.createElement("input");
+ input.type = "hidden";
+ input.id = popup.markerId + "OpenedState";
+ input.name = popup.markerId + "OpenedState";
+ input.value = popup.shown ? "true" : "false";
+ target.append(input);
+
+ $.each(popup.userOptions, function(key, value) {
+ input = document.createElement("input");
+ input.type = "hidden";
+ input.id = popup.markerId + "StateOption_" + key;
+ input.name = popup.markerId + "StateOption_" + key;
+ input.value = value;
+ target.append(input);
+ });
+
+ return true;
+ }
+
+
+ }
+
})());
$.extend(richfaces.ui.PopupPanel, {
-
- showPopupPanel : function (id, opts, event) {
- richface.Event.ready(richfaces.$(id).show());
- },
- hidePopupPanel : function (id, opts, event) {
- richface.Event.ready(richfaces.$(id).hide());
- }
+ showPopupPanel : function (id, opts, event) {
+ richface.Event.ready(richfaces.$(id).show());
+ },
+
+ hidePopupPanel : function (id, opts, event) {
+ richface.Event.ready(richfaces.$(id).hide());
+ }
});
})(jQuery, window.RichFaces);
13 years, 11 months