JBoss Rich Faces SVN: r5294 - trunk/framework/impl/src/main/java/org/ajax4jsf/resource.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-01-11 06:33:59 -0500 (Fri, 11 Jan 2008)
New Revision: 5294
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/AnimationResource.java
Log:
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/resource/AnimationResource.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/resource/AnimationResource.java 2008-01-11 11:14:04 UTC (rev 5293)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/resource/AnimationResource.java 2008-01-11 11:33:59 UTC (rev 5294)
@@ -23,17 +23,10 @@
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
-import java.awt.image.RenderedImage;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
+import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Arrays;
-import javax.faces.FacesException;
-import javax.imageio.ImageIO;
-
-import org.ajax4jsf.Messages;
import org.ajax4jsf.resource.image.animatedgif.AnimatedGifEncoder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -68,35 +61,21 @@
private int currFrameIndex = 0;
public void send(ResourceContext context) throws IOException {
- ImageRenderer renderer = (ImageRenderer) getRenderer(null);
try {
- RenderedImage image = getImage(context);
- if (null != image) {
- renderer.sendImage(context, image);
-
- }
- } catch (Exception e) {
- throw new FacesException(Messages
- .getMessage(Messages.SEND_IMAGE_ERROR_2), e);
- }
- }
-
- protected RenderedImage getImage(ResourceContext context) {
- ImageRenderer renderer = (ImageRenderer) getRenderer(null);
- Dimension frameSize = getFrameSize(context);
- int numberOfFrames = getNumberOfFrames();
- BufferedImage frame = null;
- if (frameSize.getHeight() > 0.0 && frameSize.getWidth() > 0.0
- && numberOfFrames > 0) {
- AnimatedGifEncoder encoder = new AnimatedGifEncoder();
- FileOutputStream resultOutputStream;
- try {
- resultOutputStream = new FileOutputStream("result.gif");
- encoder.start(resultOutputStream);
+ DataOutputStream output = new DataOutputStream(context.getOutputStream());
+ Dimension frameSize = getFrameSize(context);
+ int numberOfFrames = getNumberOfFrames();
+ BufferedImage frame = null;
+ if (frameSize.getHeight() > 0.0 && frameSize.getWidth() > 0.0
+ && numberOfFrames > 0) {
+ AnimatedGifEncoder encoder = new AnimatedGifEncoder();
+ encoder.start(output);
encoder.setRepeat(getRepeat());
int[] delays = getFrameDelays();
+ ImageRenderer renderer = (ImageRenderer) getRenderer(null);
while (currFrameIndex < numberOfFrames) {
- frame = renderer.createImage(frameSize.width, frameSize.height);
+ frame = renderer.createImage(frameSize.width,
+ frameSize.height);
Graphics2D graphics = frame.createGraphics();
paint(context, graphics, currFrameIndex++);
graphics.dispose();
@@ -106,25 +85,13 @@
}
}
encoder.finish();
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
}
- }
-
- BufferedImage retVal = null;
-
- try {
- retVal = ImageIO.read(new FileInputStream("result.gif"));
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ output.flush();
+ output.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
- return retVal;
}
protected abstract void paint(ResourceContext context, Graphics2D graphics2D, int frameIndex);
17 years
JBoss Rich Faces SVN: r5293 - in trunk/sandbox/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-11 06:14:04 -0500 (Fri, 11 Jan 2008)
New Revision: 5293
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
add disabled attr, apply default css styles on startup
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11 10:34:26 UTC (rev 5292)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11 11:14:04 UTC (rev 5293)
@@ -116,6 +116,15 @@
border : 1px solid;
}
+.rich-combobox-button-disabled {
+ position : absolute;
+ top : 0px;
+ right : 0px; //left: fullWidth - 17px;
+ width : 17px;
+ margin : 0px;
+ border : 1px solid;
+}
+
.rich-combobox-button-hovered {
position : absolute;
top : 0px;
@@ -177,6 +186,12 @@
<u:style name="border-color" skin="panelBorderColor"/>
</u:selector>
+ <u:selector name=".rich-combobox-button-disabled">
+ <u:style name="border-color" skin="panelBorderColor"/>
+ </u:selector>
+
+
+
<u:selector name=".rich-combobox-button-hovered">
<u:style name="border-color" skin="selectControlColor"/>
</u:selector>
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 10:34:26 UTC (rev 5292)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 11:14:04 UTC (rev 5293)
@@ -131,11 +131,11 @@
</jsp:scriptlet>
<div id="#{clientId}" class="rich-combobox-font rich-combobox-shell #{styleClass}" style="width:#{listWidth}; #{style}">
- <input id="comboboxField#{clientId}" name="comboboxField#{clientId}" class="rich-combobox-font rich-combobox-input-default rich-combobox-input #{inputClass}" type="text" value="#{value}" size="#{inputSize}" autocomplete="off" style="width:#{listWidth}; #{inputStyle}">
+ <input id="comboboxField#{clientId}" name="comboboxField#{clientId}" disabled="#{disabled}" class="rich-combobox-font-disabled rich-combobox-input-default-disabled rich-combobox-input-disabled #{inputDisabledClass}" type="text" value="#{value}" size="#{inputSize}" autocomplete="off" style="width:#{listWidth}; #{inputStyle}">
</input>
<input id="comboBoxButtonBG#{clientId}" readonly="true" type="text" value="" class="rich-combobox-font rich-combobox-button-background rich-combobox-button">
</input>
- <input id="comboboxButton#{clientId}" readonly="true" type="text" value="" style="#{buttonStyle}" class="rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}"
+ <input id="comboboxButton#{clientId}" readonly="true" disabled="#{disabled}" type="text" value="" style="#{buttonStyle}" class="rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}"
onmousedown="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-pressed-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-button-pressed rich-combobox-font rich-combobox-button-icon';"
onmouseup="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-font rich-combobox-button-icon'"
onmouseout="this.className='rich-combobox-font rich-combobox-button-icon rich-combobox-button'"
@@ -154,9 +154,9 @@
<script type="text/javascript">
Richfaces.ComboBox.CLASSES = {
BUTTON : {CLASSES :
- {NORMAL : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}",
+ {NORMAL : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled #{buttonDisabledClass}",
ACTIVE : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}",
- DISABLED : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}"},
+ DISABLED : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button-disabled #{buttonDisabledClass}"},
STYLE :
{NORMAL: #{buttonDisabledStyle},
ACTIVE: #{buttonStyle},
17 years
JBoss Rich Faces SVN: r5292 - in trunk/sandbox/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-11 05:34:26 -0500 (Fri, 11 Jan 2008)
New Revision: 5292
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
add hovered styles
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11 10:32:14 UTC (rev 5291)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11 10:34:26 UTC (rev 5292)
@@ -34,10 +34,6 @@
}
-.rich-combobox-button-hovered {
-
-}
-
.rich-combobox-input-default-disabled {
position : absolute;
top : 0px; left : 0;
@@ -120,6 +116,15 @@
border : 1px solid;
}
+.rich-combobox-button-hovered {
+ position : absolute;
+ top : 0px;
+ right : 0px; //left: fullWidth - 17px;
+ width : 17px;
+ margin : 0px;
+ border : 1px solid;
+}
+
.rich-combobox-button-background {
background : top repeat-x;
cursor : pointer;
@@ -172,6 +177,10 @@
<u:style name="border-color" skin="panelBorderColor"/>
</u:selector>
+ <u:selector name=".rich-combobox-button-hovered">
+ <u:style name="border-color" skin="selectControlColor"/>
+ </u:selector>
+
<u:selector name=".rich-combobox-font">
<u:style name="font-size" skin="generalSizeFont"/>
<u:style name="font-family" skin="generalFamilyFont"/>
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 10:32:14 UTC (rev 5291)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 10:34:26 UTC (rev 5292)
@@ -137,7 +137,9 @@
</input>
<input id="comboboxButton#{clientId}" readonly="true" type="text" value="" style="#{buttonStyle}" class="rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}"
onmousedown="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-pressed-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-button-pressed rich-combobox-font rich-combobox-button-icon';"
- onmouseup="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-font rich-combobox-button-icon'" >
+ onmouseup="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-font rich-combobox-button-icon'"
+ onmouseout="this.className='rich-combobox-font rich-combobox-button-icon rich-combobox-button'"
+ onmouseover="this.className='rich-combobox-font rich-combobox-button-icon rich-combobox-button-hovered'">
</input>
<input type="text" class="rich-combobox-strut rich-combobox-font" style="width:#{listWidth}">
</input>
17 years
JBoss Rich Faces SVN: r5291 - trunk/ui/calendar/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-01-11 05:32:14 -0500 (Fri, 11 Jan 2008)
New Revision: 5291
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
RF-1461
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-01-11 10:29:56 UTC (rev 5290)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-01-11 10:32:14 UTC (rev 5291)
@@ -518,13 +518,13 @@
return result;
}
- public void writeStringFromBundle(ResourceBundle bundle1, ResourceBundle bundle2, String name,
+ public void writeStringsFromBundle(ResourceBundle bundle1, ResourceBundle bundle2, String name,
ResponseWriter writer) throws IOException {
String label = null;
try {
if(null != bundle1){
- label = bundle1.getString(name.toUpperCase() + "_LABEL");
+ label = bundle1.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
}
} catch (MissingResourceException e) {
@@ -532,25 +532,32 @@
try {
if(null != bundle2){
- label = bundle2.getString(name.toUpperCase() + "_LABEL");
+ label = bundle2.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
}
} catch (MissingResourceException exc) {
- // Current key wasn't found, use default
- if (!("close").equals(name.toLowerCase())) {
- writer.writeText(name.toLowerCase() + ":'" + name + "', ", null);
- } else {
- writer.writeText("close:'x' ", null);
- }
- return;
+ // Current key wasn't found, use default, ignore this exception.
}
- }
-
+ }
+ writeStringFoundInBundle(name, label, writer);
+
+ }
+
+ public void writeStringFoundInBundle(String name, String value, ResponseWriter writer) throws IOException {
+ if(null!=value){
if (!("close").equals(name.toLowerCase())) {
- writer.writeText(name.toLowerCase() + ":'" + label + "', ",null);
+ writer.writeText(name.toLowerCase() + ":'" + value + "', ",null);
} else {
- writer.writeText("close:'"+label+"'", null);
+ writer.writeText("close:'" + value + "'", null);
}
- }
+ }else{
+ if (!("close").equals(name.toLowerCase())) {
+ writer.writeText(name.toLowerCase() + ":'" + name + "', ",null);
+ } else {
+ writer.writeText("close:'x'", null);
+ }
+ }
+
+ }
public void writeLabels(FacesContext context, UICalendar calendar)
throws IOException {
@@ -573,12 +580,12 @@
ResponseWriter writer = context.getResponseWriter();
writer.writeText(",\n labels:{", null);
if (null != bundle1 || null != bundle2) {
- writeStringFromBundle(bundle1, bundle2, "Apply", writer);
- writeStringFromBundle(bundle1, bundle2, "Today", writer);
- writeStringFromBundle(bundle1, bundle2, "Clean", writer);
- writeStringFromBundle(bundle1, bundle2, "Cancel", writer);
- writeStringFromBundle(bundle1, bundle2, "OK", writer);
- writeStringFromBundle(bundle1, bundle2, "Close", writer);
+ writeStringsFromBundle(bundle1, bundle2, "Apply", writer);
+ writeStringsFromBundle(bundle1, bundle2, "Today", writer);
+ writeStringsFromBundle(bundle1, bundle2, "Clean", writer);
+ writeStringsFromBundle(bundle1, bundle2, "Cancel", writer);
+ writeStringsFromBundle(bundle1, bundle2, "OK", writer);
+ writeStringsFromBundle(bundle1, bundle2, "Close", writer);
}else{
// No bundles were found, use default labels.
writer.writeText("apply:'Apply', today:'Today', clean:'Clean', ok:'OK', cancel:'Cancel', close:'x'", null);
17 years
JBoss Rich Faces SVN: r5290 - in management/design: sortableHeader and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-01-11 05:29:56 -0500 (Fri, 11 Jan 2008)
New Revision: 5290
Added:
management/design/sortableHeader/
management/design/sortableHeader/markup/
management/design/sortableHeader/markup/images/
management/design/sortableHeader/markup/images/bg_header.png
management/design/sortableHeader/markup/images/down.gif
management/design/sortableHeader/markup/images/up.gif
management/design/sortableHeader/markup/sortableHeader.html
Log:
Added: management/design/sortableHeader/markup/images/bg_header.png
===================================================================
(Binary files differ)
Property changes on: management/design/sortableHeader/markup/images/bg_header.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/sortableHeader/markup/images/down.gif
===================================================================
(Binary files differ)
Property changes on: management/design/sortableHeader/markup/images/down.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/sortableHeader/markup/images/up.gif
===================================================================
(Binary files differ)
Property changes on: management/design/sortableHeader/markup/images/up.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/sortableHeader/markup/sortableHeader.html
===================================================================
--- management/design/sortableHeader/markup/sortableHeader.html (rev 0)
+++ management/design/sortableHeader/markup/sortableHeader.html 2008-01-11 10:29:56 UTC (rev 5290)
@@ -0,0 +1,210 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>Untitled</title>
+ <style>
+ .header_example_1{
+ background : #4A75B5;/*headerBackgroundColor*/
+ color : #FFFFFF;/*headerTextColor*/
+ font-weight: normal;
+ font-family: arial; /*generalFamilyFont*/
+ font-size: 11px; /*generalSizeFont*/
+ width : 150;
+ padding : 2 5 2 5;
+ border-bottom : 1px solid #C0C0C0; /*tableBorderColor*/
+ border-right : 1px solid #C0C0C0; /*tableBorderColor*/
+ border-left : 1px solid #C6D6EA; /*additionalBackgroundColor*/
+ border-top : 1px solid #C6D6EA;; /*tableBackgroundColor*/
+ }
+ .header_example_2{
+ background : url(images/bg_header.png) /*from additionalBackgroundColor to trimColor*/ top left repeat-x #C6D6EA; /*trimColor*/
+ color : #000000;
+ font-weight: normal;
+ font-family: arial; /*generalFamilyFont*/
+ font-size: 11px; /*generalSizeFont*/
+ width : 150;
+ padding : 2 5 2 5;
+ border-bottom : 1px solid #C0C0C0; /*tableBorderColor*/
+ border-right : 1px solid #C0C0C0; /*tableBorderColor*/
+ border-left : 1px solid #C6D6EA; /*additionalBackgroundColor*/
+ border-top : 1px solid #C6D6EA; /*tableBackgroundColor*/
+ }
+ .sh_arrow_right{
+ background-position: right; background-repeat: no-repeat; display : inline; cursor : pointer; white-space : nowrap;
+ }
+ .sh_arrow_left{
+ background-position: left; background-repeat: no-repeat; display : inline; cursor : pointer; white-space : nowrap;
+ }
+
+ .sh_sort_down{ background-image: url(images/down.gif);}
+ .sh_sort_up{ background-image: url(images/up.gif);}
+
+ .sh_arrow_right #sh_strut_p{border : 0px; height : 1px; width : 0px;}
+ .sh_arrow_right #sh_strut_n{border : 0px; height : 1px; width : 16px;}
+
+ .sh_arrow_left #sh_strut_p{border : 0px; height : 1px; width : 16px;}
+ .sh_arrow_left #sh_strut_n{border : 0px; height : 1px; width : 0px;}
+
+ </style>
+</head>
+
+<body>
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 5px">
+ <tr>
+ <td class="header_example_1">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_right sh_sort_down"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 35px">
+ <tr>
+ <td class="header_example_2">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_right sh_sort_down"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+
+
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 5px">
+ <tr>
+ <td class="header_example_1" align="right">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_right sh_sort_up"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 35px">
+ <tr>
+ <td class="header_example_2" align="right">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_right sh_sort_up"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 5px">
+ <tr>
+ <td class="header_example_1" align="center">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_right sh_sort_down"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 70px">
+ <tr>
+ <td class="header_example_2" align="center">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_right sh_sort_down"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+
+
+
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 5px">
+ <tr>
+ <td class="header_example_1">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_left sh_sort_up"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 35px">
+ <tr>
+ <td class="header_example_2">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_left sh_sort_up"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 5px">
+ <tr>
+ <td class="header_example_1" align="right">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_left sh_sort_down"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 35px">
+ <tr>
+ <td class="header_example_2" align="right">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_left sh_sort_down"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 5px">
+ <tr>
+ <td class="header_example_1" align="center">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_left sh_sort_up"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+<table border="0" cellpadding="0" cellspacing="0" style="margin-bottom : 70px">
+ <tr>
+ <td class="header_example_2" align="center">
+
+<!-- ######### Start of header content block ######### -->
+ <div class="sh_arrow_left sh_sort_up"><img src="images/spacer.gif" id="sh_strut_p">Header Name<img src="images/spacer.gif" id="sh_strut_n"></div>
+<!-- ######### End of header content block ######### -->
+
+ </td>
+ </tr>
+</table>
+
+
+</body>
+</html>
17 years
JBoss Rich Faces SVN: r5289 - in trunk/sandbox/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-11 05:23:48 -0500 (Fri, 11 Jan 2008)
New Revision: 5289
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11 10:06:18 UTC (rev 5288)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11 10:23:48 UTC (rev 5289)
@@ -34,6 +34,10 @@
}
+.rich-combobox-button-hovered {
+
+}
+
.rich-combobox-input-default-disabled {
position : absolute;
top : 0px; left : 0;
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 10:06:18 UTC (rev 5288)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 10:23:48 UTC (rev 5289)
@@ -152,18 +152,18 @@
<script type="text/javascript">
Richfaces.ComboBox.CLASSES = {
BUTTON : {CLASSES :
- {NORMAL : "rich-combobox-font rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}",
+ {NORMAL : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}",
ACTIVE : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}",
- DISABLED : "rich-combobox-font rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}"},
+ DISABLED : "rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}"},
STYLE :
{NORMAL: #{buttonDisabledStyle},
ACTIVE: #{buttonStyle},
DISABLED: #{buttonDisabledStyle}}
},
FIELD : {CLASSES:
- {NORMAL : "rich-combobox-font rich-combobox-input-default-disabled rich-combobox-input-disabled #{inputDisabledClass}",
+ {NORMAL : "rich-combobox-font-disabled rich-combobox-input-default-disabled rich-combobox-input-disabled #{inputDisabledClass}",
ACTIVE : "rich-combobox-font rich-combobox-input-default rich-combobox-input #{inputClass}",
- DISABLED : "rich-combobox-font rich-combobox-input-default-disabled rich-combobox-input-disabled #{inputDisabledClass}"},
+ DISABLED : "rich-combobox-font-disabled rich-combobox-input-default-disabled rich-combobox-input-disabled #{inputDisabledClass}"},
STYLE :
{NORMAL : #{inputDisabledStyle},
ACTIVE : #{inputStyle},
17 years
JBoss Rich Faces SVN: r5288 - in trunk/sandbox/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-11 05:06:18 -0500 (Fri, 11 Jan 2008)
New Revision: 5288
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
fox ddisabled state
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11 02:54:52 UTC (rev 5287)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-01-11 10:06:18 UTC (rev 5288)
@@ -51,7 +51,7 @@
padding-right :20px;
padding-left :3px;
margin : 0px;
- border : 1px solid #c0c0c0;
+ border : 1px solid;
background-position:left top;
background-repeat:repeat-x;
}
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 02:54:52 UTC (rev 5287)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-11 10:06:18 UTC (rev 5288)
@@ -152,18 +152,18 @@
<script type="text/javascript">
Richfaces.ComboBox.CLASSES = {
BUTTON : {CLASSES :
- {NORMAL : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonDisabledClass}",
+ {NORMAL : "rich-combobox-font rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}",
ACTIVE : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonClass}",
- DISABLED : "rich-combobox-font rich-combobox-button-icon rich-combobox-button #{buttonDisabledClass}"},
+ DISABLED : "rich-combobox-font rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}"},
STYLE :
{NORMAL: #{buttonDisabledStyle},
ACTIVE: #{buttonStyle},
DISABLED: #{buttonDisabledStyle}}
},
FIELD : {CLASSES:
- {NORMAL : "rich-combobox-font rich-combobox-button-icon-disabled rich-combobox-button #{inputDisabledClass}",
+ {NORMAL : "rich-combobox-font rich-combobox-input-default-disabled rich-combobox-input-disabled #{inputDisabledClass}",
ACTIVE : "rich-combobox-font rich-combobox-input-default rich-combobox-input #{inputClass}",
- DISABLED : "rich-combobox-font rich-combobox-button-icon-disabled rich-combobox-button #{inputDisabledClass}"},
+ DISABLED : "rich-combobox-font rich-combobox-input-default-disabled rich-combobox-input-disabled #{inputDisabledClass}"},
STYLE :
{NORMAL : #{inputDisabledStyle},
ACTIVE : #{inputStyle},
17 years
JBoss Rich Faces SVN: r5287 - in branches/3.1.x: ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-10 21:54:52 -0500 (Thu, 10 Jan 2008)
New Revision: 5287
Modified:
branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js
branches/3.1.x/framework/impl/src/main/javascript/prototype/prototype1.6.0.js
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
Log:
http://jira.jboss.com/jira/browse/RF-1841
Modified: branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -78,12 +78,13 @@
for (var eventName in cache) {
var wrappers = cache[eventName];
+ var domEventName = Event.getDOMEventName(eventName);
wrappers.each(function(wrapper) {
if (node.removeEventListener) {
- node.removeEventListener(eventName, wrapper, false);
+ node.removeEventListener(domEventName, wrapper, false);
} else {
- node.detachEvent("on" + eventName, wrapper);
+ node.detachEvent("on" + domEventName, wrapper);
}
});
@@ -92,6 +93,18 @@
delete Event.cache[eventID];
}
+
+ var component = node.component;
+ if (component) {
+ var destructorName = component["rich:destructor"];
+ //destructor name is required to be back-compatible
+ if (destructorName) {
+ var destructor = component[destructorName];
+ if (destructor) {
+ destructor.call(component);
+ }
+ }
+ }
}
Event.unloadElementsCache = function(oldNode) {
Modified: branches/3.1.x/framework/impl/src/main/javascript/prototype/prototype1.6.0.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/prototype/prototype1.6.0.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/framework/impl/src/main/javascript/prototype/prototype1.6.0.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -3805,6 +3805,12 @@
}
})();
+//added by nick
+Event.getDOMEventName = function(eventName) {
+ if (eventName && eventName.include(':')) return "dataavailable";
+ return eventName;
+};
+
Object.extend(Event, (function() {
var cache = Event.cache;
@@ -3814,10 +3820,12 @@
return element._eventID = ++arguments.callee.id;
}
- function getDOMEventName(eventName) {
- if (eventName && eventName.include(':')) return "dataavailable";
- return eventName;
- }
+// commented by nick
+//
+// function getDOMEventName(eventName) {
+// if (eventName && eventName.include(':')) return "dataavailable";
+// return eventName;
+// }
function getCacheForID(id) {
return cache[id] = cache[id] || { };
@@ -3873,7 +3881,7 @@
return {
observe: function(element, eventName, handler) {
element = $(element);
- var name = getDOMEventName(eventName);
+ var name = Event.getDOMEventName(eventName);
var wrapper = createWrapper(element, eventName, handler);
if (!wrapper) return element;
@@ -3889,7 +3897,7 @@
stopObserving: function(element, eventName, handler) {
element = $(element);
- var id = getEventID(element), name = getDOMEventName(eventName);
+ var id = getEventID(element), name = Event.getDOMEventName(eventName);
if (!handler && eventName) {
getWrappersForEventName(id, eventName).each(function(wrapper) {
Modified: branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -44,6 +44,11 @@
Richfaces.ListShuttle.prototype = {
initialize: function(targetList, sourceList, clientId, controlIds, switchByClick, sourceLayoutManager, targetLayoutManager, onlistchanged) {
this.containerId = clientId;
+ this["rich:destructor"] = "destroy";
+
+ this.container = $(this.containerId);
+ this.container.component = this;
+
this.targetList = targetList;
this.sourceList = sourceList;
@@ -75,10 +80,16 @@
if (onlistchanged) {
this.targetList.container.observe("rich:onorderchanged", onlistchanged);
- $(this.containerId).observe("rich:onlistchanged", onlistchanged);
+ this.container.observe("rich:onlistchanged", onlistchanged);
}
},
+ destroy: function() {
+ this.container.component = null;
+ this.targetList.destroy();
+ this.sourceList.destroy();
+ },
+
initControlList : function(clientId, ids) {
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
@@ -150,7 +161,7 @@
this.targetLayoutManager.widthSynchronization();
this.sourceLayoutManager.widthSynchronization();
- $(this.containerId).fire("rich:onlistchanged", {});
+ this.container.fire("rich:onlistchanged", {});
}
},
@@ -217,7 +228,7 @@
this.targetLayoutManager.widthSynchronization();
this.sourceLayoutManager.widthSynchronization();
- $(this.containerId).fire("rich:onlistchanged", {});
+ this.container.fire("rich:onlistchanged", {});
}
}
Modified: branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -48,25 +48,6 @@
ModalPanel.panels = new Array();
-A4J.AJAX.AddListener({
- onafterajax: function(req, event, data) {
- var i = 0;
- while (i < ModalPanel.panels.length) {
- var panel = ModalPanel.panels[i];
-
- if (Element.isUninitialized(panel.markerId)) {
- panel.destroy();
-
- ModalPanel.panels.splice(i, 1);
- //check all panels again. maybe we've removed parent of any panel just now
- i = 0;
- } else {
- i++;
- }
- }
- }
-});
-
ModalPanel.Context = Class.create();
ModalPanel.Context.prototype = {
initialize: function(modalPanel) {
@@ -105,7 +86,8 @@
ModalPanel.prototype = {
initialize: function(id, options) {
-
+ this["rich:destructor"] = "destroy";
+
this.markerId = $(id);
this.id = $(id + "Container");
@@ -191,7 +173,8 @@
},
destroy: function() {
-
+ ModalPanel.panels = ModalPanel.panels.without(this);
+
this.traverseSelects(true);
this.parent = null;
@@ -207,14 +190,16 @@
}
this.borders = null;
- if (this.floatedToBody) {
- var element = this.id;
- var parent = element.parentNode;
- if (parent) {
- parent.removeChild(element);
- discardElement(element);
+ setTimeout(function() {
+ if (this.floatedToBody) {
+ var element = this.id;
+ var parent = element.parentNode;
+ if (parent) {
+ parent.removeChild(element);
+ discardElement(element);
+ }
}
- }
+ }.bind(this), 0);
this.markerId.component = null;
this.markerId = null;
},
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -4,13 +4,7 @@
this.headerDiv = (this.headerTable) ? this.headerTable.parentNode : null;
this.contentDiv = this.contentTable.parentNode;
- var obj = this;
- if (window.attachEvent) {
- this.contentDiv.attachEvent("onscroll", function() {obj.scrollHandler(obj)});
- } else {
- this.contentDiv.addEventListener("scroll", function() {obj.scrollHandler(obj)}, true);
- }
-
+ Event.observe(this.contentDiv, "scroll", this.scrollHandler.bindAsEventListener(this));
}
LayoutManager.SCROLL_WIDTH = 17;
@@ -52,9 +46,9 @@
return 0;
}
-LayoutManager.prototype.scrollHandler = function(obj) {
- if (obj.headerDiv) {
- obj.headerDiv.scrollLeft = obj.contentDiv.scrollLeft;
+LayoutManager.prototype.scrollHandler = function() {
+ if (this.headerDiv) {
+ this.headerDiv.scrollLeft = this.contentDiv.scrollLeft;
}
}
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -1,19 +1,18 @@
if(!window.Richfaces) window.Richfaces = {};
-Richfaces.disableSelectionText = function(target) {
- target.onselectstart = function(e) {
- e = window.event||e;
- if (e.srcElement) {
- if (e.srcElement.tagName) {
- var tagName = e.srcElement.tagName.toUpperCase();
-
- if (tagName != "INPUT" && tagName != "TEXTAREA" /* any items more? */) {
- return false;
- }
+Richfaces.disableSelectionText = function(e) {
+ e = window.event||e;
+ if (e.srcElement) {
+ if (e.srcElement.tagName) {
+ var tagName = e.srcElement.tagName.toUpperCase();
+
+ if (tagName != "INPUT" && tagName != "TEXTAREA" /* any items more? */) {
+ return false;
}
}
}
-}
+};
+
Richfaces.ListBase = Class.create();
Richfaces.ListBase.compare = function(obj1, obj2) {
@@ -34,12 +33,13 @@
Richfaces.ListBase.prototype = {
initialize : function(containerId, contentTableId, headerTableId, focusKeeperId,
onclickControlId, controlClass) {
+ this["rich:destructor"] = "destroy";
this.selectedItems = new Array();
//this.layoutManager = layoutManager;
this.container = $(containerId);
this.shuttleTable = $(contentTableId);
- Richfaces.disableSelectionText(this.shuttleTable);
+ this.shuttleTable.onselectstart = Richfaces.disableSelectionText;
this.focusKeeper = $(focusKeeperId);
this.focusKeeper.focused = false;
//this.setFocus();
@@ -61,6 +61,14 @@
this.shuttleTable.observe("click", this.clckHandler);
},
+ destroy: function() {
+ this.shuttleTable.onselectstart = null;
+ var items = this.shuttleItems;
+ for (var i = 0; i < items.length; i++) {
+ items[i].destroy();
+ }
+ },
+
setActiveItem : function(newActiveItem) {
this.pseudoActiveItem = newActiveItem;
this.activeItem = newActiveItem;
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -23,12 +23,20 @@
initialize: function($super, containerId, contentTableId, headerTableId, focusKeeperId, ids, onclickControlId, onorderchanged, controlClass) {
$super(containerId, contentTableId, headerTableId, focusKeeperId, onclickControlId, controlClass);
+ this.container.component = this;
+
if (onorderchanged) {
this.container.observe("rich:onorderchanged", onorderchanged);
}
this.controlList = new Array();
this.initControlList(containerId, ids);
},
+
+ destroy: function($super) {
+ $super();
+
+ this.container.component = null;
+ },
initControlList : function(containerId, ids) {
for (var i = 0; i < ids.length; i++) {
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -17,6 +17,10 @@
this.active = /^s?a/.test(this.input.value);
},
+ destroy: function() {
+ this._node.item = null;
+ },
+
doActive : function() {
var classes = this.CLASSES;
var row = this._node;
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-01-11 02:19:28 UTC (rev 5286)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-01-11 02:54:52 UTC (rev 5287)
@@ -1,26 +1,48 @@
Object.extend(Event, {
- _domReady : function() {
- if (arguments.callee.done) return;
- arguments.callee.done = true;
- if (Event._timer) clearInterval(Event._timer);
- Event._readyCallbacks.each(function(f) { f() });
- Event._readyCallbacks = null;
- },
+ _domReady : function() {
+ var domReady = arguments.callee
+ if (!domReady.done) {
+ domReady.done = true;
+
+ Event._readyCallbacks.each(function(f) { f() });
+ Event._readyCallbacks = null;
+
+ if (Event._timer) {
+ clearInterval(Event._timer);
+ }
+
+ if (document.removeEventListener) {
+ document.removeEventListener("DOMContentLoaded", domReady, false);
+ }
+
+ Event.stopObserving(window, 'load', domReady);
+ }
+ },
+
onReady : function(f) {
+ var domReady = this._domReady;
+ if (domReady.done) {
+ return f();
+ }
+
if (!this._readyCallbacks) {
- var domReady = this._domReady;
- if (domReady.done) return f();
- if (document.addEventListener)
- document.addEventListener("DOMContentLoaded", domReady, false);
+
+ this._readyCallbacks = [];
+
+ if (document.addEventListener) {
+ document.addEventListener("DOMContentLoaded", domReady, false);
+ }
+
if (/WebKit/i.test(navigator.userAgent)) {
this._timer = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) domReady();
}, 10);
}
- Event.observe(window, 'load', domReady);
- Event._readyCallbacks = [];
+
+ this.observe(window, 'load', domReady);
}
- Event._readyCallbacks.push(f);
+
+ this._readyCallbacks.push(f);
}
});
17 years
JBoss Rich Faces SVN: r5286 - in branches/3.1.x: framework/impl/src/main/javascript/prototype and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-10 21:19:28 -0500 (Thu, 10 Jan 2008)
New Revision: 5286
Modified:
branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js
branches/3.1.x/framework/impl/src/main/javascript/prototype/prototype1.6.0.js
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
http://jira.jboss.com/jira/browse/RF-1567
Modified: branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-11 01:30:24 UTC (rev 5285)
+++ branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-11 02:19:28 UTC (rev 5286)
@@ -315,6 +315,12 @@
if( ! newnode ) { LOG.error("New node for ID "+id+" is not present in response");return;}
var oldnode = window.document.getElementById(id);
if ( oldnode ) {
+
+ // Remove unload prototype events for a removed elements.
+ if ((typeof Event != "undefined") && (typeof Event.unloadElementsCache == "function")) {
+ Event.unloadElementsCache(oldnode);
+ }
+
var anchor = oldnode.parentNode;
if(!window.opera && oldnode.outerHTML && !oldnode.tagName.match( /(tbody|thead|tfoot|tr|th|td)/i ) ){
LOG.debug("Replace content of node by outerHTML()");
@@ -334,11 +340,6 @@
anchor.replaceChild(importednode,oldnode);
}
- // Remove unload prototype events for a removed elements.
- if ((typeof Event != "undefined") && (typeof Event.unloadElementsCache == "function")) {
- Event.unloadElementsCache(oldnode);
- }
-
// re-execute all script fragments in imported subtree...
// TODO - opera 8 run scripts at replace content stage.
if(!A4J.AJAX._scriptEvaluated){
Modified: branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js 2008-01-11 01:30:24 UTC (rev 5285)
+++ branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js 2008-01-11 02:19:28 UTC (rev 5286)
@@ -62,32 +62,62 @@
}
};
-Event.unloadElementsCache = function(oldNode) {
- //refer to window.unload handling conditions in prototype script
- if (!window.attachEvent) return;
+//That's prototype version-dependent
- if (!oldNode) return;
-
- if (oldNode) {
- if (oldNode._eventID) {
- var cache = Event.cache[oldNode._eventID];
+if (window.attachEvent) {
+ window.attachEvent("onunload", function() {
+ Event.unloadElementsCache(document);
+ Event.unloadElementsCache(window);
+ });
+}
+
+Event.destroyEventCache = function(node) {
+ var eventID = node._eventID;
+ if (eventID) {
+ var cache = Event.cache[eventID];
+
+ for (var eventName in cache) {
+ var wrappers = cache[eventName];
- for (var eventName in cache) {
- cache[eventName] = null;
- }
+ wrappers.each(function(wrapper) {
+ if (node.removeEventListener) {
+ node.removeEventListener(eventName, wrapper, false);
+ } else {
+ node.detachEvent("on" + eventName, wrapper);
+ }
+ });
+
+ cache[eventName] = null;
+ }
- delete Event.cache[oldNode._eventID];
- }
+ delete Event.cache[eventID];
+ }
+}
- var firstNode = oldNode.firstChild;
- if (firstNode) {
- Event.unloadElementsCache(firstNode);
-
- var nextNode = firstNode.nextSibling;
- while (nextNode) {
- Event.unloadElementsCache(nextNode);
- nextNode = nextNode.nextSibling;
- }
- }
+Event.unloadElementsCache = function(oldNode) {
+ if (oldNode) {
+ Event.destroyEventCache(oldNode);
+
+ //node.all is quicker than recursive traversing
+ //window doesn't have "all" attribute
+ var all = oldNode.all;
+
+ if (all) {
+ var counter = 0;
+ var length = all.length;
+
+ for (var counter = 0; counter < length; counter++ ) {
+ Event.destroyEventCache(all[counter]);
+ }
+ } else {
+ var node = oldNode.firstChild;
+ while (node) {
+ Event.unloadElementsCache(node);
+ node = node.nextSibling;
+ }
+ }
}
-};
\ No newline at end of file
+
+};
+
+//
Modified: branches/3.1.x/framework/impl/src/main/javascript/prototype/prototype1.6.0.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/prototype/prototype1.6.0.js 2008-01-11 01:30:24 UTC (rev 5285)
+++ branches/3.1.x/framework/impl/src/main/javascript/prototype/prototype1.6.0.js 2008-01-11 02:19:28 UTC (rev 5286)
@@ -3858,16 +3858,18 @@
c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
}
- function destroyCache() {
- for (var id in cache)
- for (var eventName in cache[id])
- cache[id][eventName] = null;
- }
+// Commented by Nick
+//
+// function destroyCache() {
+// for (var id in cache)
+// for (var eventName in cache[id])
+// cache[id][eventName] = null;
+// }
+//
+// if (window.attachEvent) {
+// window.attachEvent("onunload", destroyCache);
+// }
- if (window.attachEvent) {
- window.attachEvent("onunload", destroyCache);
- }
-
return {
observe: function(element, eventName, handler) {
element = $(element);
Modified: branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-01-11 01:30:24 UTC (rev 5285)
+++ branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-01-11 02:19:28 UTC (rev 5286)
@@ -723,10 +723,13 @@
} while (obj = obj.nextSibling);
// set content
- var obj=obj.nextSibling;
+ obj=obj.nextSibling;
obj.component = this;
obj.richfacesComponent="richfaces:calendar";
+ obj = null;
+ span = null;
+
if(this.params.submitFunction) this.submitFunction = this.params.submitFunction.bind(this);
this.prepareEvents();
17 years
JBoss Rich Faces SVN: r5285 - trunk/sandbox/ui.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-10 20:30:24 -0500 (Thu, 10 Jan 2008)
New Revision: 5285
Removed:
trunk/sandbox/ui/calendar/
Log:
sandbox calendar folder removed
17 years