JBoss Rich Faces SVN: r2187 - trunk/samples/richfaces-demo.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-08-09 21:17:16 -0400 (Thu, 09 Aug 2007)
New Revision: 2187
Modified:
trunk/samples/richfaces-demo/pom.xml
Log:
append jhighlight dependency to demo
Modified: trunk/samples/richfaces-demo/pom.xml
===================================================================
--- trunk/samples/richfaces-demo/pom.xml 2007-08-10 01:13:44 UTC (rev 2186)
+++ trunk/samples/richfaces-demo/pom.xml 2007-08-10 01:17:16 UTC (rev 2187)
@@ -17,6 +17,11 @@
<version>3.1.0-SNAPSHOT</version>
</dependency>
<dependency>
+ <groupId>com.uwyn</groupId>
+ <artifactId>jhighlight</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>core</artifactId>
<version>3.1.0-SNAPSHOT</version>
18 years, 8 months
JBoss Rich Faces SVN: r2186 - in trunk: framework/impl/src/main/javascript/ajaxjsf and 29 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-08-09 21:13:44 -0400 (Thu, 09 Aug 2007)
New Revision: 2186
Added:
trunk/ui/insert/
trunk/ui/insert/pom.xml
trunk/ui/insert/src/
trunk/ui/insert/src/main/
trunk/ui/insert/src/main/config/
trunk/ui/insert/src/main/config/component/
trunk/ui/insert/src/main/config/component/README
trunk/ui/insert/src/main/config/component/insert.xml
trunk/ui/insert/src/main/java/
trunk/ui/insert/src/main/java/META-INF/
trunk/ui/insert/src/main/java/META-INF/MANIFEST.MF
trunk/ui/insert/src/main/java/org/
trunk/ui/insert/src/main/java/org/richfaces/
trunk/ui/insert/src/main/java/org/richfaces/ui/
trunk/ui/insert/src/main/java/org/richfaces/ui/component/
trunk/ui/insert/src/main/java/org/richfaces/ui/component/README
trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
trunk/ui/insert/src/main/resources/
trunk/ui/insert/src/main/resources/org/
trunk/ui/insert/src/main/resources/org/richfaces/
trunk/ui/insert/src/main/resources/org/richfaces/ui/
trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/
trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/
trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/
trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css
trunk/ui/insert/src/main/templates/
trunk/ui/insert/src/main/templates/README
trunk/ui/insert/src/main/templates/org/
trunk/ui/insert/src/main/templates/org/richfaces/
trunk/ui/insert/src/main/templates/org/richfaces/ui/
trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx
trunk/ui/insert/src/test/
trunk/ui/insert/src/test/java/
trunk/ui/insert/src/test/java/org/
trunk/ui/insert/src/test/java/org/richfaces/
trunk/ui/insert/src/test/java/org/richfaces/ui/
trunk/ui/insert/src/test/java/org/richfaces/ui/component/
trunk/ui/insert/src/test/java/org/richfaces/ui/component/JSFComponentTest.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
trunk/ui/create.sh
trunk/ui/pom.xml
Log:
new component - rich:insert
Display standart error page in case of the AJAX requests ( http://jira.jboss.com/jira/browse/RF-548 ).
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2007-08-10 01:10:57 UTC (rev 2185)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxViewHandler.java 2007-08-10 01:13:44 UTC (rev 2186)
@@ -155,7 +155,7 @@
ExternalContext externalContext = context.getExternalContext();
Map requestParameterMap = externalContext.getRequestParameterMap();
Map requestMap = externalContext.getRequestMap();
- if (null == viewRoot) {
+/* if (null == viewRoot) {
if (requestParameterMap
.containsKey(AjaxContainerRenderer.AJAX_PARAMETER_NAME)
&& !requestMap.containsKey(REDIRECTED)) {
@@ -189,7 +189,7 @@
}
}
}
- return viewRoot;
+*/ return viewRoot;
}
/*
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2007-08-10 01:10:57 UTC (rev 2185)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2007-08-10 01:13:44 UTC (rev 2186)
@@ -783,11 +783,16 @@
window.document.close();
}
// Firefox/Mozilla in XHTML case don't support document.write()
-// window.location = "data:"+req.getContentType()+";charset=utf-8," + encodeURIComponent(req.getResponseText())
// Use dom manipulation instead.
- var oDomDoc = (new DOMParser()).parseFromString(req.getResponseText(), "application/xhtml+xml");
- var node = window.document.importNode(oDomDoc.documentElement, true);
- window.document.replaceChild(node,window.document.documentElement);
+ var oDomDoc = (new DOMParser()).parseFromString(req.getResponseText(), req.getContentType());
+ Sarissa.clearChildNodes(window.document.documentElement);
+ var docNodes = oDomDoc.documentElement.childNodes;
+ for(var i = 0;i<docNodes.length;i++){
+ if(docNodes[i].nodeType == 1){
+ var node = window.document.importNode(docNodes[i], true);
+ window.document.documentElement.appendChild(node);
+ }
+ }
// TODO - scripts reloading ?
} finally {
window.document.open = oldDocOpen;
Modified: trunk/ui/create.sh
===================================================================
--- trunk/ui/create.sh 2007-08-10 01:10:57 UTC (rev 2185)
+++ trunk/ui/create.sh 2007-08-10 01:13:44 UTC (rev 2186)
@@ -1,3 +1,3 @@
-#!/bin/sh
-mvn archetype:create -DarchetypeGroupId=org.ajax4jsf.cdk -DarchetypeArtifactId=maven-archetype-jsf-component \
- -DarchetypeVersion=1.1.1-SNAPSHOT -DgroupId=org.richfaces -DartifactId=$1
\ No newline at end of file
+#!/bin/sh
+mvn archetype:create -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-jsf-component \
+ -DarchetypeVersion=3.1.0-SNAPSHOT -DgroupId=org.richfaces.ui -DartifactId=$1
Added: trunk/ui/insert/pom.xml
===================================================================
--- trunk/ui/insert/pom.xml (rev 0)
+++ trunk/ui/insert/pom.xml 2007-08-10 01:13:44 UTC (rev 2186)
@@ -0,0 +1,44 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>insert</artifactId>
+ <name>insert</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>insert</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>com.uwyn</groupId>
+ <artifactId>jhighlight</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Property changes on: trunk/ui/insert/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/ui/insert/src/main/config/component/README
===================================================================
Added: trunk/ui/insert/src/main/config/component/insert.xml
===================================================================
--- trunk/ui/insert/src/main/config/component/insert.xml (rev 0)
+++ trunk/ui/insert/src/main/config/component/insert.xml 2007-08-10 01:13:44 UTC (rev 2186)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.ui.Insert</name>
+ <family>org.richfaces.ui.Insert</family>
+ <classname>org.richfaces.ui.component.html.HtmlInsert</classname>
+ <superclass>org.richfaces.ui.component.UIInsert</superclass>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.ui.InsertRenderer</name>
+ <template>org/richfaces/ui/htmlInsert.jspx</template>
+ </renderer>
+ <tag>
+ <name>insert</name>
+ <classname>org.richfaces.ui.taglib.InsertTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ <!--
+ <property>
+ <name>param</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"default"</defaultvalue>
+ </property>
+ -->
+ </component>
+</components>
Property changes on: trunk/ui/insert/src/main/config/component/insert.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/ui/insert/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/ui/insert/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ui/insert/src/main/java/META-INF/MANIFEST.MF 2007-08-10 01:13:44 UTC (rev 2186)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ui/insert/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/insert/src/main/java/org/richfaces/ui/component/README
===================================================================
Added: trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
===================================================================
--- trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java (rev 0)
+++ trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java 2007-08-10 01:13:44 UTC (rev 2186)
@@ -0,0 +1,84 @@
+/**
+ *
+ */
+
+package org.richfaces.ui.component;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponentBase;
+
+import com.uwyn.jhighlight.renderer.Renderer;
+import com.uwyn.jhighlight.renderer.XhtmlRendererFactory;
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIInsert extends UIComponentBase {
+
+ private static final String COMPONENT_TYPE = "org.richfaces.ui.Insert";
+
+ private static final String COMPONENT_FAMILY = "org.richfaces.ui.Insert";
+
+ public String getContent() {
+ String content = null;
+ if (null != getSrc()) {
+ InputStream inputStream = getFacesContext().getExternalContext().getResourceAsStream(getSrc());
+ if(null != inputStream){
+ if(null == getHighlight()){
+ StringBuffer buff = new StringBuffer(1024);
+ InputStreamReader in = new InputStreamReader(inputStream);
+ char[] temp = new char[1024];
+ try {
+ int bytes;
+ while((bytes = in.read(temp))>0){
+ buff.append(temp,0,bytes);
+ };
+ } catch (IOException e) {
+ throw new FacesException(e);
+ } finally {
+ try {
+ in.close();
+ } catch (IOException e) {
+ throw new FacesException(e);
+ }
+ }
+ content = buff.toString();
+ } else {
+ Renderer renderer = XhtmlRendererFactory.getRenderer(getHighlight());
+ if(null != renderer){
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ try {
+ renderer.highlight(getSrc(), inputStream, out, null, true);
+ } catch (IOException e) {
+ throw new FacesException(e);
+ } finally {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ throw new FacesException(e);
+ }
+ }
+ content = out.toString();
+ }
+ }
+ }
+ }
+
+ return content;
+ }
+
+ public abstract String getSrc();
+
+ public abstract void setSrc(String src);
+
+ public abstract String getHighlight();
+
+ public abstract void setHighlight(String highlight);
+
+}
Property changes on: trunk/ui/insert/src/main/java/org/richfaces/ui/component/UIInsert.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css
===================================================================
--- trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css (rev 0)
+++ trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css 2007-08-10 01:13:44 UTC (rev 2186)
@@ -0,0 +1,135 @@
+.java_plain {
+ color: rgb(0,0,0);
+}
+.java_keyword {
+
+ color: rgb(0,0,0);
+ font-weight: bold;
+}
+.java_type {
+
+ color: rgb(0,44,221);
+}
+.java_operator {
+
+ color: rgb(0,124,31);
+}
+.java_separator {
+
+ color: rgb(0,33,255);
+}
+.java_literal {
+
+ color: rgb(188,0,0);
+}
+.java_comment {
+
+ color: rgb(147,147,147);
+ background-color: rgb(247,247,247);
+}
+.java_javadoc_comment {
+
+ color: rgb(147,147,147);
+ background-color: rgb(247,247,247);
+ font-style: italic;
+}
+.java_javadoc_tag {
+
+ color: rgb(147,147,147);
+ background-color: rgb(247,247,247);
+ font-style: italic;
+ font-weight: bold;
+}
+.xml_plain {
+
+ color: rgb(0,0,0);
+}
+.xml_char_data {
+
+ color: rgb(0,0,0);
+}
+.xml_tag_symbols {
+
+ color: rgb(0,59,255);
+}
+.xml_comment {
+
+ color: rgb(147,147,147);
+ background-color: rgb(247,247,247);
+}
+.xml_attribute_value {
+
+ color: rgb(193,0,0);
+}
+.xml_attribute_name {
+
+ color: rgb(0,0,0);
+ font-weight: bold;
+}
+.xml_processing_instruction {
+
+ color: rgb(0,0,0);
+ font-weight: bold;
+ font-style: italic;
+}
+.xml_tag_name {
+
+ color: rgb(0,55,255);
+}
+.xml_rife_tag {
+
+ color: rgb(0,0,0);
+ background-color: rgb(228,230,160);
+}
+.xml_rife_name {
+
+ color: rgb(0,0,196);
+ background-color: rgb(228,230,160);
+}
+.cpp_plain {
+
+ color: rgb(0,0,0);
+}
+.cpp_keyword {
+
+ color: rgb(0,0,0);
+ font-weight: bold;
+}
+.cpp_type {
+
+ color: rgb(0,44,221);
+}
+.cpp_operator {
+
+ color: rgb(0,124,31);
+}
+.cpp_separator {
+
+ color: rgb(0,33,255);
+}
+.cpp_literal {
+
+ color: rgb(188,0,0);
+}
+.cpp_comment {
+
+ color: rgb(147,147,147);
+ background-color: rgb(247,247,247);
+}
+.cpp_doxygen_comment {
+
+ color: rgb(147,147,147);
+ background-color: rgb(247,247,247);
+ font-style: italic;
+}
+.cpp_doxygen_tag {
+
+ color: rgb(147,147,147);
+ background-color: rgb(247,247,247);
+ font-style: italic;
+ font-weight: bold;
+}
+.cpp_preproc {
+
+ color: purple;
+}
\ No newline at end of file
Property changes on: trunk/ui/insert/src/main/resources/org/richfaces/ui/renderkit/html/css/highlight.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/insert/src/main/templates/README
===================================================================
Added: trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx
===================================================================
--- trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx (rev 0)
+++ trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx 2007-08-10 01:13:44 UTC (rev 2186)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ class="org.richfaces.ui.renderkit.html.InsertRenderer"
+ baseclass="org.ajax4jsf.renderkit.AjaxComponentRendererBase"
+ component="org.richfaces.ui.component.UIInsert"
+ >
+ <h:styles>css/highlight.css</h:styles>
+ <f:clientid var="clientId"/>
+ <div id="#{clientId}"
+ x:passThruWithExclusions="value,name,type,id"
+ >
+ <jsp:scriptlet>
+ writer.write(component.getContent());
+ </jsp:scriptlet>
+ </div>
+</f:root>
\ No newline at end of file
Property changes on: trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/insert/src/test/java/org/richfaces/ui/component/JSFComponentTest.java
===================================================================
--- trunk/ui/insert/src/test/java/org/richfaces/ui/component/JSFComponentTest.java (rev 0)
+++ trunk/ui/insert/src/test/java/org/richfaces/ui/component/JSFComponentTest.java 2007-08-10 01:13:44 UTC (rev 2186)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.ui.component;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import javax.faces.component.UIComponent;
+
+/**
+ * Unit test for simple Component.
+ */
+public class JSFComponentTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}
Property changes on: trunk/ui/insert/src/test/java/org/richfaces/ui/component/JSFComponentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/ui/pom.xml
===================================================================
--- trunk/ui/pom.xml 2007-08-10 01:10:57 UTC (rev 2185)
+++ trunk/ui/pom.xml 2007-08-10 01:13:44 UTC (rev 2186)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>root</artifactId>
@@ -85,8 +86,9 @@
<module>calendar</module>
<module>treeModel</module>
<module>message</module>
- <module>scrollable-grid</module>
- </modules>
+ <module>scrollable-grid</module>
+ <module>insert</module>
+ </modules>
<dependencies>
<dependency>
<groupId>junit</groupId>
18 years, 8 months
JBoss Rich Faces SVN: r2185 - in trunk/ui/effect: src/main/java/org/richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-09 21:10:57 -0400 (Thu, 09 Aug 2007)
New Revision: 2185
Added:
trunk/ui/effect/src/main/java/org/richfaces/renderkit/
trunk/ui/effect/src/main/java/org/richfaces/renderkit/EffectRendererBase.java
Modified:
trunk/ui/effect/
trunk/ui/effect/src/main/resources/org/richfaces/renderkit/html/script/processEffect.js
trunk/ui/effect/src/main/templates/effect.jspx
Log:
- code slightly optimized
- escapement for parameters implemented
- id parameter is expanded to clientId if applicable
Property changes on: trunk/ui/effect
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
.classpath
.project
Added: trunk/ui/effect/src/main/java/org/richfaces/renderkit/EffectRendererBase.java
===================================================================
--- trunk/ui/effect/src/main/java/org/richfaces/renderkit/EffectRendererBase.java (rev 0)
+++ trunk/ui/effect/src/main/java/org/richfaces/renderkit/EffectRendererBase.java 2007-08-10 01:10:57 UTC (rev 2185)
@@ -0,0 +1,75 @@
+/**
+ *
+ */
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.javascript.JSEncoder;
+import org.ajax4jsf.renderkit.ComponentsVariableResolver;
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.richfaces.component.UIEffect;
+import org.richfaces.json.JSONException;
+import org.richfaces.json.JSONMap;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 09.08.2007
+ *
+ */
+public class EffectRendererBase extends HeaderResourcesRendererBase {
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ */
+ protected Class getComponentClass() {
+ return UIEffect.class;
+ }
+
+ private static final Pattern VARIABLE_PATTERN = Pattern.compile("^\\s*[_,A-Z,a-z]\\w*(?:\\.[_,A-Z,a-z]\\w*)*\\s*$");
+
+ public String convertElementParameter(Object parameter) {
+ String s = parameter.toString();
+ if (VARIABLE_PATTERN.matcher(s).matches()) {
+ return "typeof "+s+" == \"object\" ? "+s+" : $('"+s+"')";
+ } else {
+ return "'"+s+"'";
+ }
+ }
+
+ public String convertParameters(FacesContext context, UIEffect effect) throws IOException {
+ JSEncoder encoder = new JSEncoder();
+ String params = effect.getParams();
+ if (params == null) {
+ return null;
+ }
+
+ try {
+ JSONMap map = new JSONMap("{" + params + "}");
+ Object id = map.get("id");
+ if (id != null) {
+ UIComponent component = effect.findComponent(id.toString());
+ if (component != null) {
+ id = component.getClientId(context);
+ }
+
+ map.put("id", null);
+ }
+
+ ComponentsVariableResolver.getVariables(this, effect).setVariable("pmId", id);
+
+ return map.getString();
+ } catch (JSONException e) {
+ IOException exception = new IOException(e.getMessage());
+ exception.initCause(e);
+
+ throw exception;
+ }
+ }
+}
Modified: trunk/ui/effect/src/main/resources/org/richfaces/renderkit/html/script/processEffect.js
===================================================================
--- trunk/ui/effect/src/main/resources/org/richfaces/renderkit/html/script/processEffect.js 2007-08-09 21:21:51 UTC (rev 2184)
+++ trunk/ui/effect/src/main/resources/org/richfaces/renderkit/html/script/processEffect.js 2007-08-10 01:10:57 UTC (rev 2185)
@@ -1,15 +1,16 @@
if (!window.Richfaces) {
window.Richfaces = {};
}
-Richfaces.processEffect = new Function("cid","etype","aparam","param",
-"var h=Object.extend(param.evalJSON(), aparam);"+
-"new Effect[h.type||etype]($(h.id||cid),h);");
-Richfaces.effectEventOnOut = new Function("ename",
-"return ename.substr(0,2)=='on'?ename.substr(2):ename;");
+Richfaces.processEffect = function(cid, etype, aparam, param) {
+ var h=Object.extend(param, aparam);
+ new Effect[h.type||etype]($(h.id||cid),h);
+};
+Richfaces.effectEventOnOut = function(ename) {
+ return ename.substr(0,2) == 'on' ? ename.substr(2) : ename;
+};
-
/*
Richfaces.addEffectObserve= new Function("oid", "oevent","otype","oparams","useCapture",
"var funcpart='{}';"+
Modified: trunk/ui/effect/src/main/templates/effect.jspx
===================================================================
--- trunk/ui/effect/src/main/templates/effect.jspx 2007-08-09 21:21:51 UTC (rev 2184)
+++ trunk/ui/effect/src/main/templates/effect.jspx 2007-08-10 01:10:57 UTC (rev 2185)
@@ -6,7 +6,7 @@
xmlns:u=" http://ajax4jsf.org/cdk/u"
xmlns:x=" http://ajax4jsf.org/cdk/x"
class="org.richfaces.renderkit.html.EffectRenderer"
- baseclass="org.ajax4jsf.renderkit.HeaderResourcesRendererBase"
+ baseclass="org.richfaces.renderkit.EffectRendererBase"
component="org.richfaces.component.UIEffect">
<f:clientid var="clientId"/>
@@ -15,14 +15,14 @@
<c:set var="event" value="#{component.attributes['event']}"/>
<c:set var="name" value="#{component.attributes['name']}"/>
<c:set var="type" value="#{component.attributes['type']}"/>
- <c:set var="params" value="#{component.attributes['params']}"/>
+ <c:set var="params" value="#{this:convertParameters(context, component)}"/>
<h:scripts>new org.ajax4jsf.javascript.PrototypeScript(),scripts/scriptaculous/scriptaculous.js,scripts/scriptaculous/effects.js,/org/richfaces/renderkit/html/script/processEffect.js</h:scripts>
<jsp:scriptlet>
<![CDATA[
- String sid = (String)variables.getVariable("for");
- String event = (String)variables.getVariable("event");
+ String sid = (String) variables.getVariable("for");
+ String event = (String) variables.getVariable("event");
if (! "".equals(sid)) {
UIComponent forcomp = getUtils().findComponentFor(context, (UIComponent)component,sid);
@@ -45,7 +45,7 @@
<c:if test="#{needsFunction}">
<script type="text/javascript" x:passThruWithExclusions="name,type,for">
//<![CDATA[
-#{name} = new Function("Richfaces.processEffect('#{forid}','#{type}',arguments[0]||{}, '{#{params}}');");
+#{name} = function () { return Richfaces.processEffect('#{forid}','#{type}',arguments[0]||{}, #{params}); };
//]]>
</script>
</c:if>
@@ -53,11 +53,16 @@
<script type="text/javascript" x:passThruWithExclusions="name,type,for">
//<![CDATA[
{
-var pm ="{"+"#{params}"+"}";var ename = Richfaces.effectEventOnOut('#{event}');
-var obj= typeof #{forid} == "object"? #{forid}:$('#{forid}');
+var pm = #{params};
+
+/* pm.id can have a special meaning, let's check */
+pm.id = #{this:convertElementParameter(pmId)};
+
+var ename = Richfaces.effectEventOnOut('#{event}');
+var obj= #{this:convertElementParameter(forid)};
var hash = { id: obj, params: pm };
-var bindedFunction = function(event){ return Richfaces.processEffect(this.id,'#{type}',{},this.params); }.bind(hash);
-Event.observe(obj,ename, bindedFunction,{#{params}}.useCapture||false);
+var bindedFunction = function(event){ return Richfaces.processEffect(this.id,'#{type}',{},this.params); }.bindAsEventListener(hash);
+Event.observe(obj,ename, bindedFunction, pm.useCapture||false);
}
//]]>
</script>
18 years, 8 months
JBoss Rich Faces SVN: r2184 - trunk/framework/impl/src/main/java/org/richfaces/json.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-09 17:21:51 -0400 (Thu, 09 Aug 2007)
New Revision: 2184
Modified:
trunk/framework/impl/src/main/java/org/richfaces/json/JSONMap.java
Log:
JSONMap - put(key, value) method added
Modified: trunk/framework/impl/src/main/java/org/richfaces/json/JSONMap.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/json/JSONMap.java 2007-08-09 18:31:46 UTC (rev 2183)
+++ trunk/framework/impl/src/main/java/org/richfaces/json/JSONMap.java 2007-08-09 21:21:51 UTC (rev 2184)
@@ -82,10 +82,7 @@
try {
return JSONAccessor.getValue(jsonObject, this.key);
} catch (JSONException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
-
- throw new RuntimeException();
+ throw new RuntimeException(e.getMessage(), e);
}
}
@@ -114,6 +111,18 @@
};
}
+ public Object put(Object key, Object value) {
+ String keyString = key.toString();
+ try {
+ Object previousValue = JSONAccessor.getValue(jsonObject, keyString);
+ JSONAccessor.putValue(jsonObject, keyString, value);
+
+ return previousValue;
+ } catch (JSONException e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+
public String getString() throws JSONException {
return jsonObject.toString(0);
}
18 years, 8 months
JBoss Rich Faces SVN: r2183 - in trunk/framework: impl/src/main/java/org/ajax4jsf/javascript and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-08-09 14:31:46 -0400 (Thu, 09 Aug 2007)
New Revision: 2183
Added:
trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
trunk/framework/impl/src/test/java/org/ajax4jsf/javascript/
trunk/framework/impl/src/test/java/org/ajax4jsf/javascript/JSMinTest.java
Removed:
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSMin.java
Log:
Fix JSMin bur - error on compression prototype script.
Deleted: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSMin.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSMin.java 2007-08-09 17:04:22 UTC (rev 2182)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSMin.java 2007-08-09 18:31:46 UTC (rev 2183)
@@ -1,327 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * JSMin.java 2006-02-13
- *
- * Copyright (c) 2006 John Reilly (www.inconspicuous.org)
- *
- * This work is a translation from C to Java of jsmin.c published by
- * Douglas Crockford. Permission is hereby granted to use the Java
- * version under the same conditions as the jsmin.c on which it is
- * based.
- *
- *
- *
- *
- * jsmin.c 2003-04-21
- *
- * Copyright (c) 2002 Douglas Crockford (www.crockford.com)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * The Software shall be used for Good, not Evil.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-package org.ajax4jsf.javascript;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PushbackInputStream;
-
-
-
-
-public class JSMin {
- private static final int EOF = -1;
-
- private PushbackInputStream in;
- private OutputStream out;
-
- private int theA;
- private int theB;
-
- public JSMin(InputStream in, OutputStream out) {
- this.in = new PushbackInputStream(in);
- this.out = out;
- }
-
- /**
- * isAlphanum -- return true if the character is a letter, digit,
- * underscore, dollar sign, or non-ASCII character.
- */
- static boolean isAlphanum(int c) {
- return ( (c >= 'a' && c <= 'z') ||
- (c >= '0' && c <= '9') ||
- (c >= 'A' && c <= 'Z') ||
- c == '_' ||
- c == '$' ||
- c == '\\' ||
- c > 126);
- }
-
- /**
- * get -- return the next character from stdin. Watch out for lookahead. If
- * the character is a control character, translate it to a space or
- * linefeed.
- */
- int get() throws IOException {
- int c = in.read();
-
- if (c >= ' ' || c == '\n' || c == EOF) {
- return c;
- }
-
- if (c == '\r') {
- return '\n';
- }
-
- return ' ';
- }
-
-
-
- /**
- * Get the next character without getting it.
- */
- int peek() throws IOException {
- int lookaheadChar = in.read();
- in.unread(lookaheadChar);
- return lookaheadChar;
- }
-
- /**
- * next -- get the next character, excluding comments. peek() is used to see
- * if a '/' is followed by a '/' or '*'.
- */
- int next() throws IOException, UnterminatedCommentException {
- int c = get();
- if (c == '/') {
- switch (peek()) {
- case '/':
- for (;;) {
- c = get();
- if (c <= '\n') {
- return c;
- }
- }
-
- case '*':
- get();
- for (;;) {
- switch (get()) {
- case '*':
- if (peek() == '/') {
- get();
- return ' ';
- }
- break;
- case EOF:
- throw new UnterminatedCommentException();
- }
- }
-
- default:
- return c;
- }
-
- }
- return c;
- }
-
- /**
- * action -- do something! What you do is determined by the argument: 1
- * Output A. Copy B to A. Get the next B. 2 Copy B to A. Get the next B.
- * (Delete A). 3 Get the next B. (Delete B). action treats a string as a
- * single character. Wow! action recognizes a regular expression if it is
- * preceded by ( or , or =.
- */
-
- void action(int d) throws IOException, UnterminatedRegExpLiteralException,
- UnterminatedCommentException, UnterminatedStringLiteralException {
- switch (d) {
- case 1:
- out.write(theA);
- case 2:
- theA = theB;
-
- if (theA == '\'' || theA == '"') {
- for (;;) {
- out.write(theA);
- theA = get();
- if (theA == theB) {
- break;
- }
- if (theA <= '\n') {
- throw new UnterminatedStringLiteralException();
- }
- if (theA == '\\') {
- out.write(theA);
- theA = get();
- }
- }
- }
-
- case 3:
- theB = next();
- if (theB == '/' && (theA == '(' || theA == ',' || theA == '=')) {
- out.write(theA);
- out.write(theB);
- for (;;) {
- theA = get();
- if (theA == '/') {
- break;
- } else if (theA == '\\') {
- out.write(theA);
- theA = get();
- } else if (theA <= '\n') {
- throw new UnterminatedRegExpLiteralException();
- }
- out.write(theA);
- }
- theB = next();
- }
- }
- }
-
- /**
- * jsmin -- Copy the input to the output, deleting the characters which are
- * insignificant to JavaScript. Comments will be removed. Tabs will be
- * replaced with spaces. Carriage returns will be replaced with linefeeds.
- * Most spaces and linefeeds will be removed.
- */
- public void jsmin() throws IOException, UnterminatedRegExpLiteralException, UnterminatedCommentException, UnterminatedStringLiteralException{
- theA = '\n';
- action(3);
- while (theA != EOF) {
- switch (theA) {
- case ' ':
- if (isAlphanum(theB)) {
- action(1);
- } else {
- action(2);
- }
- break;
- case '\n':
- switch (theB) {
- case '{':
- case '[':
- case '(':
- case '+':
- case '-':
- action(1);
- break;
- case ' ':
- action(3);
- break;
- default:
- if (isAlphanum(theB)) {
- action(1);
- } else {
- action(2);
- }
- }
- break;
- default:
- switch (theB) {
- case ' ':
- if (isAlphanum(theA)) {
- action(1);
- break;
- }
- action(3);
- break;
- case '\n':
- switch (theA) {
- case '}':
- case ']':
- case ')':
- case '+':
- case '-':
- case '"':
- case '\'':
- action(1);
- break;
- default:
- if (isAlphanum(theA)) {
- action(1);
- } else {
- action(3);
- }
- }
- break;
- default:
- action(1);
- break;
- }
- }
- }
- out.flush();
- }
-
- class UnterminatedCommentException extends Exception {
- }
-
- class UnterminatedStringLiteralException extends Exception {
- }
-
- class UnterminatedRegExpLiteralException extends Exception {
- }
-
- public static void main(String arg[]) {
- try {
- JSMin jsmin = new JSMin(new FileInputStream(arg[0]), System.out);
- jsmin.jsmin();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (ArrayIndexOutOfBoundsException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (UnterminatedRegExpLiteralException e) {
- e.printStackTrace();
- } catch (UnterminatedCommentException e) {
- e.printStackTrace();
- } catch (UnterminatedStringLiteralException e) {
- e.printStackTrace();
- }
- }
-
-
-
-}
Copied: trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java (from rev 2182, trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSMin.java)
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2007-08-09 18:31:46 UTC (rev 2183)
@@ -0,0 +1,350 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * JSMin.java 2006-02-13
+ *
+ * Copyright (c) 2006 John Reilly (www.inconspicuous.org)
+ *
+ * This work is a translation from C to Java of jsmin.c published by
+ * Douglas Crockford. Permission is hereby granted to use the Java
+ * version under the same conditions as the jsmin.c on which it is
+ * based.
+ *
+ *
+ *
+ *
+ * jsmin.c 2003-04-21
+ *
+ * Copyright (c) 2002 Douglas Crockford (www.crockford.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * The Software shall be used for Good, not Evil.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.ajax4jsf.javascript;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PushbackInputStream;
+
+
+
+
+public class JSMin {
+ private static final int EOF = -1;
+
+ private PushbackInputStream in;
+ private OutputStream out;
+
+ private int theA;
+ private int theB;
+
+ private int line;
+
+ private int column;
+
+ public JSMin(InputStream in, OutputStream out) {
+ this.in = new PushbackInputStream(in);
+ this.out = out;
+ this.line = 0;
+ this.column = 0;
+ }
+
+ /**
+ * isAlphanum -- return true if the character is a letter, digit,
+ * underscore, dollar sign, or non-ASCII character.
+ */
+ static boolean isAlphanum(int c) {
+ return ( (c >= 'a' && c <= 'z') ||
+ (c >= '0' && c <= '9') ||
+ (c >= 'A' && c <= 'Z') ||
+ c == '_' ||
+ c == '$' ||
+ c == '\\' ||
+ c > 126);
+ }
+
+ /**
+ * get -- return the next character from stdin. Watch out for lookahead. If
+ * the character is a control character, translate it to a space or
+ * linefeed.
+ */
+ int get() throws IOException {
+ int c = in.read();
+
+ if(c == '\n'){
+ line++;
+ column = 0;
+ } else {
+ column++;
+ }
+
+ if (c >= ' ' || c == '\n' || c == EOF) {
+ return c;
+ }
+
+ if (c == '\r') {
+ column = 0;
+ return '\n';
+ }
+
+ return ' ';
+ }
+
+
+
+ /**
+ * Get the next character without getting it.
+ */
+ int peek() throws IOException {
+ int lookaheadChar = in.read();
+ in.unread(lookaheadChar);
+ return lookaheadChar;
+ }
+
+ /**
+ * next -- get the next character, excluding comments. peek() is used to see
+ * if a '/' is followed by a '/' or '*'.
+ */
+ int next() throws IOException, UnterminatedCommentException {
+ int c = get();
+ if (c == '/') {
+ switch (peek()) {
+ case '/':
+ for (;;) {
+ c = get();
+ if (c <= '\n') {
+ return c;
+ }
+ }
+
+ case '*':
+ get();
+ for (;;) {
+ switch (get()) {
+ case '*':
+ if (peek() == '/') {
+ get();
+ return ' ';
+ }
+ break;
+ case EOF:
+ throw new UnterminatedCommentException(line,column);
+ }
+ }
+
+ default:
+ return c;
+ }
+
+ }
+ return c;
+ }
+
+ /**
+ * action -- do something! What you do is determined by the argument: 1
+ * Output A. Copy B to A. Get the next B. 2 Copy B to A. Get the next B.
+ * (Delete A). 3 Get the next B. (Delete B). action treats a string as a
+ * single character. Wow! action recognizes a regular expression if it is
+ * preceded by ( or , or =.
+ */
+
+ void action(int d) throws IOException, UnterminatedRegExpLiteralException,
+ UnterminatedCommentException, UnterminatedStringLiteralException {
+ switch (d) {
+ case 1:
+ out.write(theA);
+ case 2:
+ theA = theB;
+
+ if (theA == '\'' || theA == '"') {
+ for (;;) {
+ out.write(theA);
+ theA = get();
+ if (theA == theB) {
+ break;
+ }
+ if (theA <= '\n') {
+ throw new UnterminatedStringLiteralException(line,column);
+ }
+ if (theA == '\\') {
+ out.write(theA);
+ theA = get();
+ }
+ }
+ }
+
+ case 3:
+ theB = next();
+ if (theB == '/' && (theA == '(' || theA == ',' || theA == '='|| theA == ':')) {
+ out.write(theA);
+ out.write(theB);
+ for (;;) {
+ theA = get();
+ if (theA == '/') {
+ break;
+ } else if (theA == '\\') {
+ out.write(theA);
+ theA = get();
+ } else if (theA <= '\n') {
+ throw new UnterminatedRegExpLiteralException(line,column);
+ }
+ out.write(theA);
+ }
+ theB = next();
+ }
+ }
+ }
+
+ /**
+ * jsmin -- Copy the input to the output, deleting the characters which are
+ * insignificant to JavaScript. Comments will be removed. Tabs will be
+ * replaced with spaces. Carriage returns will be replaced with linefeeds.
+ * Most spaces and linefeeds will be removed.
+ */
+ public void jsmin() throws IOException, UnterminatedRegExpLiteralException, UnterminatedCommentException, UnterminatedStringLiteralException{
+ theA = '\n';
+ action(3);
+ while (theA != EOF) {
+ switch (theA) {
+ case ' ':
+ if (isAlphanum(theB)) {
+ action(1);
+ } else {
+ action(2);
+ }
+ break;
+ case '\n':
+ switch (theB) {
+ case '{':
+ case '[':
+ case '(':
+ case '+':
+ case '-':
+ action(1);
+ break;
+ case ' ':
+ action(3);
+ break;
+ default:
+ if (isAlphanum(theB)) {
+ action(1);
+ } else {
+ action(2);
+ }
+ }
+ break;
+ default:
+ switch (theB) {
+ case ' ':
+ if (isAlphanum(theA)) {
+ action(1);
+ break;
+ }
+ action(3);
+ break;
+ case '\n':
+ switch (theA) {
+ case '}':
+ case ']':
+ case ')':
+ case '+':
+ case '-':
+ case '"':
+ case '\'':
+ action(1);
+ break;
+ default:
+ if (isAlphanum(theA)) {
+ action(1);
+ } else {
+ action(3);
+ }
+ }
+ break;
+ default:
+ action(1);
+ break;
+ }
+ }
+ }
+ out.flush();
+ }
+
+ static class UnterminatedCommentException extends Exception {
+ public UnterminatedCommentException(int line,int column) {
+ super("Unterminated comment at line "+line+" and column "+column);
+ }
+ }
+
+ static class UnterminatedStringLiteralException extends Exception {
+ public UnterminatedStringLiteralException(int line,int column) {
+ super("Unterminated string literal at line "+line+" and column "+column);
+ }
+ }
+
+ static class UnterminatedRegExpLiteralException extends Exception {
+ public UnterminatedRegExpLiteralException(int line,int column) {
+ super("Unterminated regular expression at line "+line+" and column "+column);
+ }
+ }
+
+ public static void main(String arg[]) {
+ try {
+ JSMin jsmin = new JSMin(new FileInputStream(arg[0]), System.out);
+ jsmin.jsmin();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (ArrayIndexOutOfBoundsException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (UnterminatedRegExpLiteralException e) {
+ e.printStackTrace();
+ } catch (UnterminatedCommentException e) {
+ e.printStackTrace();
+ } catch (UnterminatedStringLiteralException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+}
Added: trunk/framework/impl/src/test/java/org/ajax4jsf/javascript/JSMinTest.java
===================================================================
--- trunk/framework/impl/src/test/java/org/ajax4jsf/javascript/JSMinTest.java (rev 0)
+++ trunk/framework/impl/src/test/java/org/ajax4jsf/javascript/JSMinTest.java 2007-08-09 18:31:46 UTC (rev 2183)
@@ -0,0 +1,71 @@
+/**
+ *
+ */
+package org.ajax4jsf.javascript;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import org.ajax4jsf.javascript.JSMin.UnterminatedCommentException;
+import org.ajax4jsf.javascript.JSMin.UnterminatedRegExpLiteralException;
+import org.ajax4jsf.javascript.JSMin.UnterminatedStringLiteralException;
+
+import junit.framework.TestCase;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class JSMinTest extends TestCase {
+
+ /**
+ * @param name
+ */
+ public JSMinTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.JSMin#jsmin()}.
+ * @throws UnterminatedStringLiteralException
+ * @throws UnterminatedCommentException
+ * @throws UnterminatedRegExpLiteralException
+ * @throws IOException
+ */
+ public void testJsmin() throws IOException, UnterminatedRegExpLiteralException, UnterminatedCommentException, UnterminatedStringLiteralException {
+ String script =" patterns: {\n" +
+ " // combinators must be listed first\n" +
+ " // (and descendant needs to be last combinator)\n" +
+ " laterSibling: /^\\s*~\\s*/,\n" +
+ " child: /^\\s*>\\s*/,\n" +
+ " adjacent: /^\\s*\\+\\s*/,\n" +
+ " descendant: /^\\s/,\n" +
+ "\n" +
+ " // selectors follow\n" +
+ " tagName: /^\\s*(\\*|[\\w\\-]+)(\\b|$)?/,\n" +
+ " id: /^#([\\w\\-\\*]+)(\\b|$)/,\n" +
+ " className: /^\\.([\\w\\-\\*]+)(\\b|$)/,\n" +
+ " pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\\((.*?)\\))?(\\b|$|\\s|(?=:))/,\n" +
+ " attrPresence: /^\\[([\\w]+)\\]/,\n" +
+ " attr: /\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*(([\'\"])([^\\]]*?)\\4|([^\'\"][^\\]]*?)))?\\]/\n" +
+ " }";
+ ByteArrayInputStream in = new ByteArrayInputStream(script.getBytes());
+ JSMin jsmin = new JSMin(in,System.out);
+ jsmin.jsmin();
+ }
+
+}
Property changes on: trunk/framework/impl/src/test/java/org/ajax4jsf/javascript/JSMinTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
18 years, 8 months
JBoss Rich Faces SVN: r2182 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-08-09 13:04:22 -0400 (Thu, 09 Aug 2007)
New Revision: 2182
Added:
trunk/docs/userguide/en/src/main/resources/images/calendar.png
Log:
Added: trunk/docs/userguide/en/src/main/resources/images/calendar.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/calendar.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
18 years, 8 months
JBoss Rich Faces SVN: r2181 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-08-09 13:02:45 -0400 (Thu, 09 Aug 2007)
New Revision: 2181
Added:
trunk/docs/userguide/en/src/main/docbook/included/calendar.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
Log:
added calendar
Added: trunk/docs/userguide/en/src/main/docbook/included/calendar.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/calendar.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/calendar.desc.xml 2007-08-09 17:02:45 UTC (rev 2181)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>calendar</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <para>The <emphasis role="bold">
+ <property><rich:calendar></property>
+ </emphasis> component is used for creating monthly calendar elements on the page.</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/calendar.png"/>
+ </imageobject>
+ </mediaobject>
+ </section>
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>Highly customizable look and feel</listitem>
+ <listitem>Popup representation</listitem>
+ <listitem>Disablement support</listitem>
+ <listitem>Smart and user-defined positioning</listitem>
+ <listitem>Cells customization</listitem>
+ <listitem>Macro substitution based on tool bars customization</listitem>
+ </itemizedlist>
+ </section>
+</section>
Added: trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/calendar.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2007-08-09 17:02:45 UTC (rev 2181)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>calendar</keyword>
+ </keywordset>
+ </sectioninfo>
+
+ <table>
+ <title>Component identification parameters</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Value</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+
+ <entry>org.richfaces.Calendar</entry>
+ </row>
+
+ <row>
+ <entry>component-class</entry>
+
+ <entry>org.richfaces.component.html.HtmlCalendar</entry>
+ </row>
+
+ <row>
+ <entry>component-family</entry>
+
+ <entry>org.richfaces.Calendar</entry>
+ </row>
+
+ <row>
+ <entry>renderer-type</entry>
+
+ <entry>org.richfaces.CalendarRenderer</entry>
+ </row>
+
+ <row>
+ <entry>tag-class</entry>
+
+ <entry>org.richfaces.taglib.CalendarTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+
+ <para>To create the simplest variant on the page use the following syntax:</para>
+
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="xml">...
+ <rich:calendar popup="false"/>
+...</programlisting>
+ </section>
+
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="java">...
+ org.richfaces.component.html.HtmlCalendar myCalendar = new org.richfaces.component.html.HtmlCalendar ();
+...</programlisting>
+ </section>
+
+ <!--section>
+ <title>Details of Usage</title>
+
+ <para>All attributes are not required.</para>
+ <para>Use <emphasis>
+ <property>"event"</property>
+ </emphasis> attribute to define an event for appearance of collapsing/expanding sublevels.
+ Default value is <emphasis>
+ <property>"onclick"</property>
+ </emphasis>. An example could be seen below.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="xml">...
+ <rich:panelMenu event="onmouseover">
+ <<Nested panelMenu components>
+ </rich:panelMenu>
+...</programlisting>
+
+ <para>Switching mode could be chosen with the <emphasis>
+ <property>"mode"</property>
+ </emphasis> attribute for all panelMenu items except ones where this attribute was redefined.
+ By default all items send traditional request. </para>
+ <para>The <emphasis>
+ <property>"expandMode"</property>
+ </emphasis> attribute defines the submission modes for all collapsing/expanding panelMenu
+ groups except ones where this attribute was redefined. </para>
+ <para>The <emphasis>
+ <property>"mode"</property>
+ </emphasis> and <emphasis>
+ <property>"expandMode"</property>
+ </emphasis> attributes could be used with three possible parameters.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Server (default)</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>The common submission of the form is performed and a page is completely refreshed.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Ajax</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>An Ajax form submission is performed additionally specified elements in the <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute are reRendered.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>None</para>
+ </listitem>
+ </itemizedlist>
+
+ <para><emphasis>
+ <property>"Action"</property>
+ </emphasis> and <emphasis>
+ <property>"ActionListener"</property>
+ </emphasis> attributes are ignored. Items don't fire any submits itself. Behavior is
+ fully defined by the components nested to items. Groups expand on the client side.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="xml">...
+ <rich:panelMenu event="onclick" submitMode="none">
+ < rich:panelMenuItem label="Link to external page">
+ <h:outputLink ... >
+ <rich:panelMenuItem>
+ </rich:panelMenu>
+...</programlisting>
+
+ <note><title>Note:</title> As the <emphasis role="bold">
+ <property><rich:panelMenu></property>
+ </emphasis> component doesn't provide its own form, use it between
+ <h:form> and </h:form> tags.</note>
+
+ <para>The <emphasis>
+ <property>"expandSingle"</property>
+ </emphasis> attribute is defined for expanding more than one submenu on the same level. The
+ default value is <emphasis>
+ <property>"false"</property>
+ </emphasis>. If it's true the previously opened group on the top level closes before
+ opening another one. See the picture below.</para>
+
+ <figure>
+ <title>Using the "expandSingle" attribute</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/panelMenu1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The <emphasis>
+ <property>"selectedChild"</property>
+ </emphasis> attribute is used for defining the name of the selected group or item. An example
+ for group is placed below:</para>
+
+ <para>Here is an example:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="xml">...
+ <rich:panelMenu selectedChild="thisChild">
+ <rich:panelMenuGroup label="Group1" name="thisChild">
+ <!ested panelMenu components>
+ </rich:panelMenuGroup>
+ </rich:panelMenu>
+...</programlisting>
+ </section>
+
+ <section>
+ <title>JavaScript API</title>
+ <para>In Java Script code for expanding/collapsing group element creation it's
+ necessary to use doExpand()/doCollapse() function.</para>
+
+ <table>
+ <title>JavaScript API</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Function</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>doExpand()</entry>
+
+ <entry>Expand group element</entry>
+ </row>
+
+ <row>
+ <entry>doCollapse()</entry>
+
+ <entry>Collapse group element</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ </section>
+
+
+ <section>
+ <title>Look-and-Feel Customization</title>
+
+ <para>As this component is just a wrapper for its children its provide the only
+ "rich-panel-menu" class for wrapper div element. To redefine appearance of
+ particular panel menus, it's possible to define your own CSS class. And then just
+ define it in the components class attribute. </para>
+
+ </section-->
+
+</section>
18 years, 8 months
JBoss Rich Faces SVN: r2180 - in trunk: ui/panelbar/src/main/java/org/richfaces/component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-09 12:01:11 -0400 (Thu, 09 Aug 2007)
New Revision: 2180
Modified:
trunk/cdk/
trunk/ui/panelbar/src/main/java/org/richfaces/component/UIPanelBarItem.java
trunk/ui/panelbar/src/main/templates/panelBarItem.jspx
trunk/ui/tabPanel/src/main/java/org/richfaces/component/UITab.java
trunk/ui/toolBar/src/main/java/org/richfaces/component/UIToolBarGroup.java
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-570 fixed
Property changes on: trunk/cdk
___________________________________________________________________
Name: svn:ignore
+ target
Modified: trunk/ui/panelbar/src/main/java/org/richfaces/component/UIPanelBarItem.java
===================================================================
--- trunk/ui/panelbar/src/main/java/org/richfaces/component/UIPanelBarItem.java 2007-08-09 15:57:14 UTC (rev 2179)
+++ trunk/ui/panelbar/src/main/java/org/richfaces/component/UIPanelBarItem.java 2007-08-09 16:01:11 UTC (rev 2180)
@@ -21,6 +21,8 @@
package org.richfaces.component;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
public abstract class UIPanelBarItem
@@ -37,8 +39,16 @@
public abstract void setName(Object name);
public UIPanelBar getPanel(){
- //XXX by nick - andrew - panelBarItem is an immediate panelBar child, no need to traverse up a lot
- return (UIPanelBar) getParent();
+ UIComponent component = getParent();
+ while (component != null && !(component instanceof UIPanelBar)) {
+ component = component.getParent();
+ }
+
+ if (component == null) {
+ throw new FacesException("The component: " + this.getClientId(getFacesContext()) + " is not nested within " + UIPanelBar.class.getSimpleName());
+ } else {
+ return (UIPanelBar) component;
+ }
}
public boolean getRendersChildren() {
Modified: trunk/ui/panelbar/src/main/templates/panelBarItem.jspx
===================================================================
--- trunk/ui/panelbar/src/main/templates/panelBarItem.jspx 2007-08-09 15:57:14 UTC (rev 2179)
+++ trunk/ui/panelbar/src/main/templates/panelBarItem.jspx 2007-08-09 16:01:11 UTC (rev 2180)
@@ -10,9 +10,12 @@
component="org.richfaces.component.UIPanelBarItem">
<f:clientid var="clientId" />
- <div id="#{clientId}" class="dr-pnlbar rich-panelbar dr-pnlbar-ext #{component.panel.attributes['styleClass']}" style="#{component.panel.attributes['style']}">
- <div class="dr-pnlbar-h rich-panelbar-header #{component.panel.attributes['headerClass']} #{component.attributes['headerClass']}"
- style="#{component.panel.attributes['headerStyle']};#{component.attributes['headerStyle']}">
+
+ <c:object var="panel" value="#{component.panel}" type="javax.faces.component.UIComponent" />
+
+ <div id="#{clientId}" class="dr-pnlbar rich-panelbar dr-pnlbar-ext #{panel.attributes['styleClass']}" style="#{panel.attributes['style']}">
+ <div class="dr-pnlbar-h rich-panelbar-header #{panel.attributes['headerClass']} #{component.attributes['headerClass']}"
+ style="#{panel.attributes['headerStyle']};#{component.attributes['headerStyle']}">
<jsp:scriptlet><![CDATA[
if(component.getFacet("label")!=null && component.getFacet("label").isRendered()) {
]]></jsp:scriptlet>
@@ -25,8 +28,8 @@
}
]]></jsp:scriptlet>
</div>
- <div class="dr-pnlbar-h-act rich-panelbar-header-act #{component.panel.attributes['headerClass']} #{component.attributes['headerClass']} #{component.panel.attributes['headerClassActive']} #{component.attributes['headerClassActive']}"
- style="#{component.panel.attributes['headerStyle']};#{component.attributes['headerStyle']};#{component.panel.attributes['headerStyleActive']};#{component.attributes['headerStyleActive']};display: none;">
+ <div class="dr-pnlbar-h-act rich-panelbar-header-act #{panel.attributes['headerClass']} #{component.attributes['headerClass']} #{panel.attributes['headerClassActive']} #{component.attributes['headerClassActive']}"
+ style="#{panel.attributes['headerStyle']};#{component.attributes['headerStyle']};#{panel.attributes['headerStyleActive']};#{component.attributes['headerStyleActive']};display: none;">
<jsp:scriptlet><![CDATA[
if(component.getFacet("label")!=null && component.getFacet("label").isRendered()) {
@@ -42,8 +45,8 @@
</div>
<div style="display: none; width: 100%;">
- <table cellpadding="0" width="100%" style="height: 100%;"><tbody><tr><td class="dr-pnlbar-c rich-panelbar-content #{component.panel.attributes['contentClass']} #{component.attributes['contentClass']}"
- style="#{component.panel.attributes['contentStyle']};#{component.attributes['contentStyle']}">
+ <table cellpadding="0" width="100%" style="height: 100%;"><tbody><tr><td class="dr-pnlbar-c rich-panelbar-content #{panel.attributes['contentClass']} #{component.attributes['contentClass']}"
+ style="#{panel.attributes['contentStyle']};#{component.attributes['contentStyle']}">
<vcp:body>
<f:call name="renderChildren" />
</vcp:body>
Modified: trunk/ui/tabPanel/src/main/java/org/richfaces/component/UITab.java
===================================================================
--- trunk/ui/tabPanel/src/main/java/org/richfaces/component/UITab.java 2007-08-09 15:57:14 UTC (rev 2179)
+++ trunk/ui/tabPanel/src/main/java/org/richfaces/component/UITab.java 2007-08-09 16:01:11 UTC (rev 2180)
@@ -75,16 +75,16 @@
* @return {@link UITabPanel}
*/
public UITabPanel getPane() throws FacesException {
- UIComponent parent = this.getParent();
- if (parent instanceof UITabPanel) {
- return (UITabPanel) parent;
- }
+ UIComponent component = this.getParent();
+ while (component != null && !(component instanceof UITabPanel)) {
+ component = component.getParent();
+ }
- if (parent == null) {
- return null;
- }
-
- throw new FacesException("UITab " + this.getClientId(getFacesContext()) + "component not inside in tab panel");
+ if (component == null) {
+ throw new FacesException("The component: " + this.getClientId(getFacesContext()) + " is not nested within " + UITabPanel.class.getSimpleName());
+ } else {
+ return (UITabPanel) component;
+ }
}
/* (non-Javadoc)
Modified: trunk/ui/toolBar/src/main/java/org/richfaces/component/UIToolBarGroup.java
===================================================================
--- trunk/ui/toolBar/src/main/java/org/richfaces/component/UIToolBarGroup.java 2007-08-09 15:57:14 UTC (rev 2179)
+++ trunk/ui/toolBar/src/main/java/org/richfaces/component/UIToolBarGroup.java 2007-08-09 16:01:11 UTC (rev 2180)
@@ -21,6 +21,7 @@
package org.richfaces.component;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
@@ -38,16 +39,15 @@
public abstract void setLocation(String location);
public UIToolBar getToolBar() {
- UIComponent parent = getParent();
- if (parent == null) {
- return null;
- }
-
- if (parent instanceof UIToolBar) {
- return (UIToolBar) parent;
- }
-
- //TODO nick - nick - message text
- throw new ClassCastException("Parent should be " + UIToolBar.class.getName());
+ UIComponent component = this.getParent();
+ while (component != null && !(component instanceof UIToolBar)) {
+ component = component.getParent();
+ }
+
+ if (component == null) {
+ throw new FacesException("The component: " + this.getClientId(getFacesContext()) + " is not nested within " + UIToolBar.class.getSimpleName());
+ } else {
+ return (UIToolBar) component;
+ }
}
}
Modified: trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
===================================================================
--- trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2007-08-09 15:57:14 UTC (rev 2179)
+++ trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2007-08-09 16:01:11 UTC (rev 2180)
@@ -54,9 +54,9 @@
String style = (String) toolBarGroup.getAttributes().get("style");
String styleClass = (String) toolBarGroup.getAttributes().get("styleClass");
if (null == styleClass) styleClass = "";
- String contentClass = (String) toolBarGroup.getParent().getAttributes().get("contentClass");
+ String contentClass = (String) toolBarGroup.getToolBar().getAttributes().get("contentClass");
if (null == contentClass) contentClass = "";
- String contentStyle = (String) toolBarGroup.getParent().getAttributes().get("contentStyle");
+ String contentStyle = (String) toolBarGroup.getToolBar().getAttributes().get("contentStyle");
if (component.getChildCount() > 0) {
for (Iterator it = component.getChildren().iterator(); it.hasNext();) {
18 years, 8 months
JBoss Rich Faces SVN: r2178 - in trunk: ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-08-09 11:42:09 -0400 (Thu, 09 Aug 2007)
New Revision: 2178
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/imagecache.js
trunk/framework/impl/src/main/javascript/ajaxjsf/smartposition.js
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
trunk/ui/panelbar/src/main/templates/panelBar.jspx
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/scriptaculo.js
Log:
http://jira.jboss.com/jira/browse/RF-576
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/imagecache.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/imagecache.js 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/imagecache.js 2007-08-09 15:42:09 UTC (rev 2178)
@@ -1,6 +1,6 @@
-if (!Exadel) var Exadel = {};
+if (!Richfaces) var Richfaces = {};
-Exadel.setImages =
+Richfaces.setImages =
function (element, images) {
element = $(element);
if (!element) return;
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/smartposition.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/smartposition.js 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/smartposition.js 2007-08-09 15:42:09 UTC (rev 2178)
@@ -1,6 +1,6 @@
-if (!Exadel) {var Exadel = {};}
-if (!Exadel.SmartPosition )
-Exadel.SmartPosition = {
+if (!Richfaces) {var Richfaces = {};}
+if (!Richfaces.SmartPosition )
+Richfaces.SmartPosition = {
options: $H({"positionX": ["right","left","center"], "positionY": ["bottom","top"], positionFloat: true}),
getBase: function() {
return (document.compatMode && document.compatMode.toLowerCase() == "css1compat" &&
Modified: trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
===================================================================
--- trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-08-09 15:42:09 UTC (rev 2178)
@@ -1,6 +1,6 @@
-if(!Exadel) var Exadel = {};
-Exadel.Slider = Class.create();
-Exadel.Slider.prototype = {
+if(!Richfaces) var Richfaces = {};
+Richfaces.Slider = Class.create();
+Richfaces.Slider.prototype = {
initialize: function(handle, track, tip, table, handleSelectedClass, options) {
var slider = this;
this.handle = $( handle );
Modified: trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-08-09 15:42:09 UTC (rev 2178)
@@ -166,7 +166,7 @@
</table>
</div>
<script type="text/javascript">
- new Exadel.Slider(
+ new Richfaces.Slider(
"#{clientId}Handle",
"#{clientId}Track",
"#{clientId}Tip",
Modified: trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2007-08-09 15:42:09 UTC (rev 2178)
@@ -1,8 +1,8 @@
-if (!Exadel) var Exadel = {};
+if (!Richfaces) var Richfaces = {};
-Exadel.Spinner = Class.create();
-Exadel.Spinner.prototype = {
+Richfaces.Spinner = Class.create();
+Richfaces.Spinner.prototype = {
initialize: function( containers, options, data ,events, images) {
this.content = $ (containers.edit);
@@ -120,7 +120,7 @@
var downImg = this._getDirectChildrenByTag(buttonDown,'INPUT')[0];
}
- this.controls = new Exadel.Spinner.Controls( this, {button:buttonUp,img:upImg}, {button:buttonDown,img:downImg}, edit );
+ this.controls = new Richfaces.Spinner.Controls( this, {button:buttonUp,img:upImg}, {button:buttonDown,img:downImg}, edit );
},
_getDirectChildrenByTag: function( e, tagName ) {
@@ -141,8 +141,8 @@
}
};
-Exadel.Spinner.Controls = Class.create();
-Exadel.Spinner.Controls.prototype = {
+Richfaces.Spinner.Controls = Class.create();
+Richfaces.Spinner.Controls.prototype = {
initialize: function( spinner, up, down, edit ) {
this.spinner= spinner;
@@ -329,4 +329,4 @@
this.edit.fireEvent('on' + e);
}
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2007-08-09 15:42:09 UTC (rev 2178)
@@ -92,7 +92,7 @@
</tbody>
</table>
<script type="text/javascript">
- new Exadel.Spinner(
+ new Richfaces.Spinner(
{
edit:"#{clientId}Edit",
buttons:"#{clientId}Buttons",
Modified: trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
===================================================================
--- trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2007-08-09 15:42:09 UTC (rev 2178)
@@ -1,8 +1,8 @@
-if (!Exadel) var Exadel = {};
+if (!Richfaces) var Richfaces = {};
-Exadel.PanelBar = Class.create();
+Richfaces.PanelBar = Class.create();
-Exadel.PanelBar.prototype = {
+Richfaces.PanelBar.prototype = {
initialize: function(panelId, onclick) {
@@ -91,7 +91,7 @@
var rows=this._getDirectChildrenByTag(this.panel,'DIV');
for(var i=0; i<rows.length; i++) {
var subrows=this._getDirectChildrenByTag(rows[i],'DIV');
- this.slides.push(new Exadel.PanelBar.Slide(this,rows[i],subrows[0],subrows[1],subrows[2],i,this.onclick)); //ndex
+ this.slides.push(new Richfaces.PanelBar.Slide(this,rows[i],subrows[0],subrows[1],subrows[2],i,this.onclick)); //ndex
}
},
@@ -120,8 +120,8 @@
}
-Exadel.PanelBar.Slide = Class.create();
-Exadel.PanelBar.Slide.prototype = {
+Richfaces.PanelBar.Slide = Class.create();
+Richfaces.PanelBar.Slide.prototype = {
initialize: function(slidePanel,item,header,header_act,content,index,onclick){
Modified: trunk/ui/panelbar/src/main/templates/panelBar.jspx
===================================================================
--- trunk/ui/panelbar/src/main/templates/panelBar.jspx 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/ui/panelbar/src/main/templates/panelBar.jspx 2007-08-09 15:42:09 UTC (rev 2178)
@@ -20,7 +20,7 @@
<f:clientid var="clientId" />
<input type="hidden" name="#{clientId}" id="#{clientId}_panelBarInput"
value="#{this:expanded(context, component)}"/>
- <script type="text/javascript">new Exadel.PanelBar("#{clientId}", "#{component.attributes['onclick']}");</script>
+ <script type="text/javascript">new Richfaces.PanelBar("#{clientId}", "#{component.attributes['onclick']}");</script>
</div>
</f:root>
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/scriptaculo.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/scriptaculo.js 2007-08-09 15:02:07 UTC (rev 2177)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/scriptaculo.js 2007-08-09 15:42:09 UTC (rev 2178)
@@ -2032,11 +2032,11 @@
/*
Support for Drag and Drop in AJAX-JSF environment.
*/
-if (!Exadel) {
- var Exadel = {};
+if (!Richfaces) {
+ var Richfaces = {};
}
-if (!Exadel.AJAX) {
- Exadel.AJAX = {};
+if (!Richfaces.AJAX) {
+ Richfaces.AJAX = {};
}
/**
@@ -2055,9 +2055,9 @@
* hoverDepth
* hoverDuration
*/
-Exadel.AJAX.addDropable = function(containerId, form, element, options) {
+Richfaces.AJAX.addDropable = function(containerId, form, element, options) {
options.onDrop = function(element, dropon, dropEvent) {
- Exadel.AJAX.dropEffect(element);
+ Richfaces.AJAX.dropEffect(element);
options.element = element;
options.dropon = dropon;
options.dropEvent = dropEvent;
@@ -2071,7 +2071,7 @@
if (arguments.length < 6) {
Droppables.isInDropPhase = true;
}
- Exadel.AJAX.submitDrop(containerId, form, dropEvent, options);
+ Richfaces.AJAX.submitDrop(containerId, form, dropEvent, options);
};
if (options.oncomplete && typeof options.oncomplete == 'function') {
options.onajaxComplete = options.oncomplete;
@@ -2091,7 +2091,7 @@
var drop = Droppables.add(element, options);
}
-Exadel.AJAX.dropEffect = function(element) {
+Richfaces.AJAX.dropEffect = function(element) {
var _clone = element.cloneNode(true);
var isCursor = element.style.visibility.toLowerCase() == "hidden";
if (isCursor) _clone.style.visibility = "";
@@ -2153,7 +2153,7 @@
* effectDuration
*
*/
-Exadel.AJAX.addDragable = function(element, options) {
+Richfaces.AJAX.addDragable = function(element, options) {
// TODO - build different effects
options.reverteffect = function(element) {
element.style.top = 0;
@@ -2168,7 +2168,7 @@
}
}
-Exadel.AJAX.addClickDropable = function(element, options) {
+Richfaces.AJAX.addClickDropable = function(element, options) {
if (Droppables) {
Droppables.getForElement =
function(element) {
@@ -2198,7 +2198,7 @@
*
*
*/
-Exadel.AJAX.submitDrop = function(containerId, form, event, options) {
+Richfaces.AJAX.submitDrop = function(containerId, form, event, options) {
var parameters = options.parameters || {};
if (options.element && options.element._parameters) {
for (var k in options.element._parameters) {
18 years, 8 months
JBoss Rich Faces SVN: r2177 - in trunk/ui/tree/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-08-09 11:02:07 -0400 (Thu, 09 Aug 2007)
New Revision: 2177
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
client mode bug fixes
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-08-09 14:33:47 UTC (rev 2176)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-08-09 15:02:07 UTC (rev 2177)
@@ -211,7 +211,7 @@
renderChild(context, nodeFacet);
c = new Context();
- c.setClientId(tree.getClientId(context) + ":");
+ c.setClientId(nodeFacet.getClientId(context) + NamingContainer.SEPARATOR_CHAR);
c.setLast(this.isLastElement);
c.setExpanded(tree.isExpanded());
c.setRowKey(tree.getRowKey());
@@ -337,7 +337,7 @@
tree.setRowKey(context, key);
String id = tree.getNodeFacet().getClientId(context);
- String treeChildrenId = tree.getClientId(context) + ":childs";
+ String treeChildrenId = id + NamingContainer.SEPARATOR_CHAR + "childs";
if (ids.isEmpty() || ids.contains(id) || ids.contains(tree.getClientId(context))/* handle tree updates requests */) {
writeContent(context, tree, key);
encodeScripts = true;
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-08-09 14:33:47 UTC (rev 2176)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-08-09 15:02:07 UTC (rev 2177)
@@ -28,8 +28,8 @@
this.switchType = switchType;
this.dragIndicatorId = dragIndicatorId;
this.onselect = new Function('event', (events.onselect ? events.onselect : "") + "; return true;");
- this.onexpand = new Function('event', events.onexpand);
- this.oncollapse = new Function('event', events.oncollapse);
+ this.onexpand = new Function('event', (events.onexpand ? events.onexpand : "") + "; return true;");
+ this.oncollapse = new Function('event', (events.oncollapse ? events.oncollapse : "") + "; return true;");
this.onAjaxSelect = onAjaxSelect;
this.element = $(id);
this.inputId = input;
18 years, 8 months