JBoss Rich Faces SVN: r19185 - sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp-gae/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-09-14 02:47:20 -0400 (Tue, 14 Sep 2010)
New Revision: 19185
Modified:
sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp-gae/WEB-INF/web.xml
Log:
https://jira.jboss.org/browse/RF-9344
Modified: sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp-gae/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp-gae/WEB-INF/web.xml 2010-09-14 06:41:29 UTC (rev 19184)
+++ sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp-gae/WEB-INF/web.xml 2010-09-14 06:47:20 UTC (rev 19185)
@@ -1,92 +1,92 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- id="richfaces-showcase" version="2.5">
- <display-name>richfaces-showcase-gae</display-name>
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
- <context-param>
- <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
- <param-value>/WEB-INF/app-tags.taglib.xml</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.enableControlSkinning</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.enableControlSkinningClasses</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.skin</param-name>
- <param-value>blueSky</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.staticResourceLocation</param-name>
- <param-value>${symbol_pound}{facesContext.externalContext.requestContextPath}/static-resources/${symbol_pound}{resourceLocation}</param-value>
- </context-param>
-
- <context-param>
- <param-name>org.ajax4jsf.cache.CACHE_MANAGER_FACTORY_CLASS</param-name>
- <param-value>org.ajax4jsf.cache.lru.LRUMapCacheFactory</param-value>
- </context-param>
-
- <context-param>
- <description>
- Set this flag to true if you want the JavaServer Faces
- Reference Implementation to validate the XML in your
- faces-config.xml resources against the DTD. Default
- value is false.
- </description>
- <param-name>com.sun.faces.validateXml</param-name>
- <param-value>true</param-value>
- </context-param>
- <!-- ***** Accommodate Single-Threaded Requirement of Google AppEngine -->
- <context-param>
- <description>
- When enabled, the runtime initialization and default ResourceHandler
- implementation will use threads to perform their functions. Set this
- value to false if threads aren't desired (as in the case of running
- within the Google Application Engine).
-
- Note that when this option is disabled, the ResourceHandler will not
- pick up new versions of resources when ProjectStage is development.
- </description>
- <param-name>com.sun.faces.enableThreading</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>com.sun.faces.expressionFactory</param-name>
- <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.executeAWTInitializer</param-name>
- <param-value>false</param-value>
- </context-param>
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- </servlet-mapping>
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="richfaces-showcase" version="2.5">
+ <display-name>RichFaces 4 GAE application</display-name>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+ <context-param>
+ <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
+ <param-value>/WEB-INF/app-tags.taglib.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinning</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinningClasses</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>blueSky</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.staticResourceLocation</param-name>
+ <param-value>${symbol_pound}{facesContext.externalContext.requestContextPath}/static-resources/${symbol_pound}{resourceLocation}</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.ajax4jsf.cache.CACHE_MANAGER_FACTORY_CLASS</param-name>
+ <param-value>org.ajax4jsf.cache.lru.LRUMapCacheFactory</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+ </description>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <!-- ***** Accommodate Single-Threaded Requirement of Google AppEngine -->
+ <context-param>
+ <description>
+ When enabled, the runtime initialization and default ResourceHandler
+ implementation will use threads to perform their functions. Set this
+ value to false if threads aren't desired (as in the case of running
+ within the Google Application Engine).
+
+ Note that when this option is disabled, the ResourceHandler will not
+ pick up new versions of resources when ProjectStage is development.
+ </description>
+ <param-name>com.sun.faces.enableThreading</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.expressionFactory</param-name>
+ <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.executeAWTInitializer</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
</web-app>
\ No newline at end of file
14 years, 3 months
JBoss Rich Faces SVN: r19184 - in sandbox/trunk/archetypes/rf-gae-sample: src/main/resources/archetype-resources and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-09-14 02:41:29 -0400 (Tue, 14 Sep 2010)
New Revision: 19184
Modified:
sandbox/trunk/archetypes/rf-gae-sample/
sandbox/trunk/archetypes/rf-gae-sample/pom.xml
sandbox/trunk/archetypes/rf-gae-sample/readme.txt
sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/pom.xml
sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/readme.txt
sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/index.xhtml
Log:
https://jira.jboss.org/browse/RF-9344
Property changes on: sandbox/trunk/archetypes/rf-gae-sample
___________________________________________________________________
Name: svn:ignore
+ target
Modified: sandbox/trunk/archetypes/rf-gae-sample/pom.xml
===================================================================
--- sandbox/trunk/archetypes/rf-gae-sample/pom.xml 2010-09-14 06:27:07 UTC (rev 19183)
+++ sandbox/trunk/archetypes/rf-gae-sample/pom.xml 2010-09-14 06:41:29 UTC (rev 19184)
@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.archetypes</groupId>
- <artifactId>richfaces-archetype-gae-sample</artifactId>
+ <artifactId>richfaces-archetype-gae</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>RichFaces Archetypes: GAE Application</name>
@@ -76,7 +76,7 @@
</build>
</profile>
</profiles>
-
+
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/archetypes/richfac...</connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/archetypes/richfaces-...</developerConnection>
Modified: sandbox/trunk/archetypes/rf-gae-sample/readme.txt
===================================================================
--- sandbox/trunk/archetypes/rf-gae-sample/readme.txt 2010-09-14 06:27:07 UTC (rev 19183)
+++ sandbox/trunk/archetypes/rf-gae-sample/readme.txt 2010-09-14 06:41:29 UTC (rev 19184)
@@ -10,8 +10,8 @@
1) To generate a project from the archetype, run
- mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes -DarchetypeArtifactId=richfaces-archetype-gae-sample
- -DarchetypeVersion=<version> -DgroupId=<yourGroupId> -DartifactId=<yourArtifactId> -Dversion=1.0-SNAPSHOT
+ mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes -DarchetypeArtifactId=richfaces-archetype-gae -DarchetypeVersion=<version>
+ -DgroupId=<yourGroupId> -DartifactId=<yourArtifactId> -Dversion=1.0-SNAPSHOT
2) To build the project for deploy to GAE cloud, run
mvn clean install -Pgae
Modified: sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/pom.xml
===================================================================
--- sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/pom.xml 2010-09-14 06:27:07 UTC (rev 19183)
+++ sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/pom.xml 2010-09-14 06:41:29 UTC (rev 19184)
@@ -5,7 +5,7 @@
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
- <name>RichFaces 4 Application</name>
+ <name>${artifactId}</name>
<version>${version}</version>
<packaging>war</packaging>
@@ -30,9 +30,28 @@
</properties>
<build>
- <finalName>rf-gae-sample</finalName>
+ <finalName>${artifactId}</finalName>
<plugins>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/main/java-gae-jsf-ri</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
@@ -44,12 +63,68 @@
<configuration>
<webResources>
<resource>
+ <directory>src/main/webapp-gae</directory>
+ </resource>
+ <resource>
+ <directory>src/main/webapp</directory>
+ </resource>
+ <resource>
+ <directory>${project.build.directory}/generated-resources</directory>
+ <targetPath>static-resources</targetPath>
+ </resource>
+ <resource>
<directory>${basedir}/src/main/java</directory>
<targetPath>/WEB-INF/src</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${org.richfaces.bom.version}</version>
+ <configuration></configuration>
+ <executions>
+ <execution>
+ <id>process</id>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ <configuration>
+ <outputDir>generated-resources</outputDir>
+ <skins>
+ <skin>blueSky</skin>
+ <skin>classic</skin>
+ <skin>deepMarine</skin>
+ <skin>emeraldTown</skin>
+ <skin>japanCherry</skin>
+ <skin>ruby</skin>
+ <skin>wine</skin>
+ </skins>
+ <includedContentTypes>
+ <include>application/javascript</include>
+ <include>text/css</include>
+ <include>image/.+</include>
+ </includedContentTypes>
+ <fileNameMappings>
+ <property>
+ <name>^\Qorg.richfaces.renderkit.html\E</name>
+ <value>org.richfaces/images</value>
+ </property>
+ <property>
+ <name>^\Qorg.richfaces.renderkit.html.images\E</name>
+ <value>org.richfaces/images</value>
+ </property>
+ <property>
+ <name>^css/</name>
+ <value>org.richfaces/css/</value>
+ </property>
+ </fileNameMappings>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
@@ -118,138 +193,6 @@
</plugin>
</plugins>
</build>
- </profile>
- <profile>
- <id>gae</id>
- <dependencies>
- <dependency>
- <groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish.web</groupId>
- <artifactId>el-impl</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jta_1.1_spec</artifactId>
- <version>1.1.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_3.0_spec</artifactId>
- <version>1.1.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.9.1</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>src/main/java-gae-jsf-ri</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <directory>src/main/webapp-gae</directory>
- </resource>
- <resource>
- <directory>src/main/webapp</directory>
- </resource>
- <resource>
- <directory>${project.build.directory}/generated-resources</directory>
- <targetPath>static-resources</targetPath>
- </resource>
- <resource>
- <directory>${basedir}/src/main/java</directory>
- <targetPath>/WEB-INF/src</targetPath>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>${org.richfaces.bom.version}</version>
- <configuration></configuration>
- <executions>
- <execution>
- <id>process</id>
- <goals>
- <goal>process</goal>
- </goals>
- <configuration>
- <outputDir>generated-resources</outputDir>
- <skins>
- <skin>blueSky</skin>
- <skin>classic</skin>
- <skin>deepMarine</skin>
- <skin>emeraldTown</skin>
- <skin>japanCherry</skin>
- <skin>ruby</skin>
- <skin>wine</skin>
- </skins>
- <includedContentTypes>
- <include>application/javascript</include>
- <include>text/css</include>
- <include>image/.+</include>
- </includedContentTypes>
- <fileNameMappings>
- <property>
- <name>^\Qorg.richfaces.renderkit.html\E</name>
- <value>org.richfaces/images</value>
- </property>
- <property>
- <name>^\Qorg.richfaces.renderkit.html.images\E</name>
- <value>org.richfaces/images</value>
- </property>
- <property>
- <name>^css/</name>
- <value>org.richfaces/css/</value>
- </property>
- </fileNameMappings>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</profile>
</profiles>
@@ -290,11 +233,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
@@ -308,9 +246,9 @@
<artifactId>ehcache</artifactId>
</dependency>
- <!--
- simple logger binding: only messages of level INFO and
- higher are printed
+ <!--
+ simple logger binding: only messages of level INFO and
+ higher are printed
-->
<dependency>
<groupId>org.slf4j</groupId>
@@ -333,5 +271,42 @@
<classifier>jdk15</classifier>
<scope>test</scope>
</dependency>
+ <!-- GAE PROFILE DEPENDENCIES -->
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1.1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_3.0_spec</artifactId>
+ <version>1.1.1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
</dependencies>
</project>
Modified: sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/readme.txt
===================================================================
--- sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/readme.txt 2010-09-14 06:27:07 UTC (rev 19183)
+++ sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/readme.txt 2010-09-14 06:41:29 UTC (rev 19184)
@@ -1,12 +1,12 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-Project generated with richfaces-archetype-simpleapp
+Project generated with richfaces-archetype-gae
-To build this project for Tomcat 6 run
+1.1) To build this project for GAE deploy
- mvn clean package
+ mvn clean install
+1.2) to deploy application to GAE use appcfg from GAE SDK. follow instructions from appspot.com
-If you wan to create a binaries for both Tomcat 6 and JBoss 6 run
- mvn clean package -P release
\ No newline at end of file
+2) If you wan to create a binaries for Tomcat 6 and JBoss 6 run
+
+ mvn clean package -P release
+
Modified: sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml 2010-09-14 06:27:07 UTC (rev 19183)
+++ sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml 2010-09-14 06:41:29 UTC (rev 19184)
@@ -4,7 +4,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
- <display-name>Sample RichFaces 4 Application</display-name>
+ <display-name>RichFaces 4 GAE Application</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
Modified: sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/index.xhtml
===================================================================
--- sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/index.xhtml 2010-09-14 06:27:07 UTC (rev 19183)
+++ sandbox/trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/index.xhtml 2010-09-14 06:41:29 UTC (rev 19184)
@@ -8,7 +8,7 @@
<body>
<ui:composition template="/templates/template.xhtml">
- <ui:define name="title">RichFaces Sample</ui:define>
+ <ui:define name="title">RichFaces GAE Sample</ui:define>
<ui:define name="body">
<h:form prependId="false">
14 years, 3 months
JBoss Rich Faces SVN: r19183 - modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-09-14 02:27:07 -0400 (Tue, 14 Sep 2010)
New Revision: 19183
Modified:
modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
Log:
Removed ajaxKeys references and updated to new approach (RF-9139)
Modified: modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-09-14 01:39:52 UTC (rev 19182)
+++ modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-09-14 06:27:07 UTC (rev 19183)
@@ -35,24 +35,95 @@
</example>
</section>
- <!-- TODO
<section id="sect-Component_Reference-a4jrepeat-Limited_views_and_partial_updates">
<title>Limited views and partial updates</title>
<para>
The <sgmltag><a4j:repeat></sgmltag> component uses other attributes common to iteration components, such as the <varname>first</varname> attribute for specifying the first item for iteration, and the <varname>rows</varname> attribute for specifying the number of rows of items to display.
</para>
<para>
- After an Ajax request, only the rows specified with the <varname>ajaxKeys</varname> attribute are updated rather than the entire collection.
+ Specific cells, rows, and columns can be updated without sending Ajax requests for the entire collection. Components that cause the change can specify which part of the table to update through the <varname>render</varname> attribute. The <varname>render</varname> attribute specifies which part of a table to update:
</para>
- <example id="exam-Component_Reference-a4jrepeat-Limited_views_and_partial_updates">
- <title>Limited views and partial updates</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-Limited_views_and_partial_updates.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
- <para>
- The table rows are limited using the <varname>first</varname> and <varname>rows</varname> attributes. Only those rows specified through the <varname>ajaxKeys</varname> are updated after an Ajax request.
- </para>
- </example>
+ <variablelist>
+ <varlistentry>
+ <term><code><varname>render</varname>=<replaceable>cellId</replaceable></code></term>
+ <listitem>
+ <para>
+ Update the cell with an identifier of <replaceable>cellId</replaceable> within the row that contains the current component.
+ </para>
+ <para>
+ Instead of a specific identifier, the <replaceable>cellId</replaceable> reference could be a variable: <code><varname>render</varname>=#{<replaceable>bean.cellToUpdate</replaceable>}</code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><code><varname>render</varname>=<replaceable>tableId</replaceable>:<replaceable>rowId</replaceable></code></term>
+ <listitem>
+ <para>
+ Update the row with an identifier of <replaceable>rowId</replaceable> within the table with an identifier of <replaceable>tableId</replaceable>. Alternatively, if the current component is contained within the table, use <code><varname>render</varname>=<replaceable>rowId</replaceable></code>.
+ </para>
+ <para>
+ Instead of a specific identifier, the <replaceable>tableId</replaceable> of <replaceable>rowId</replaceable> references could be variables: <code><varname>render</varname>=<replaceable>tableId</replaceable>:#{<replaceable>bean.rowToUpdate</replaceable>}</code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><code><varname>render</varname>=<replaceable>tableId</replaceable>:<replaceable>rowId</replaceable>:<replaceable>cellId</replaceable></code></term>
+ <listitem>
+ <para>
+ Update the cell with an identifier of <replaceable>cellId</replaceable>, within the row with and identifier of <replaceable>rowId</replaceable>, within the table with an identifier of <replaceable>tableId</replaceable>.
+ </para>
+ <para>
+ Instead of a specific identifier, any of the references could be variables: <code><varname>render</varname>=<replaceable>tableId</replaceable>:#{<replaceable>bean.rowToUpdate</replaceable>}:<replaceable>cellId</replaceable></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ Alternatively, keywords can be used with the <varname>render</varname> attribute:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><code><varname>render</varname>=@column</code></term>
+ <listitem>
+ <para>
+ Update the column that contains the current component.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><code><varname>render</varname>=@row</code></term>
+ <listitem>
+ <para>
+ Update the row that contains the current component.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><code><varname>render</varname>=<replaceable>tableId</replaceable>:@body</code></term>
+ <listitem>
+ <para>
+ Update the body of the table with the identifier of <replaceable>tableId</replaceable>. Alternatively, if the current component is contained within the table, use <code><varname>render</varname>=@body</code> instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><code><varname>render</varname>=<replaceable>tableId</replaceable>:@header</code></term>
+ <listitem>
+ <para>
+ Update the header of the table with the identifier of <replaceable>tableId</replaceable>. Alternatively, if the current component is contained within the table, use <code><varname>render</varname>=@header</code> instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><code><varname>render</varname>=<replaceable>tableId</replaceable>:@footer</code></term>
+ <listitem>
+ <para>
+ Update the footer of the table with the identifier of <replaceable>tableId</replaceable>. Alternatively, if the current component is contained within the table, use <code><varname>render</varname>=@footer</code> instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
- -->
<section id="sect-Component_Reference-a4jrepeat-Reference_data">
<title>Reference data</title>
@@ -455,12 +526,8 @@
<section id="sect-Component_Reference-richdataGrid-Patial_updates">
<title>Patial updates</title>
<para>
- As the component is based on the <sgmltag><a4j:repeat></sgmltag> component, it can be partially updated with Ajax. The <varname>ajaxKeys</varname> attribute allows row keys to be defined, which are updated after an Ajax request.
+ As <sgmltag><rich:dataGrid></sgmltag> the component is based on the <sgmltag><a4j:repeat></sgmltag> component, it can be partially updated with Ajax. Refer to <xref linkend="sect-Component_Reference-a4jrepeat-Limited_views_and_partial_updates" /> for details on partially updating the <sgmltag><rich:dataGrid></sgmltag> component.
</para>
- <example id="exam-Component_Reference-richdataGrid-ajaxKeys_example">
- <title><varname>ajaxKeys</varname> example</title>
- <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richdataGrid-ajaxKeys_example.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
- </example>
</section>
<section id="sect-Component_Reference-richdataGrid-Reference_data">
@@ -586,7 +653,7 @@
<section id="sect-Component_Reference-richdataTable-Partial_updates">
<title>Partial updates</title>
<para>
- The <sgmltag><rich:dataTable></sgmltag> component is based on the <sgmltag><a4j:repeat></sgmltag> component, and as such it can be partially updated using Ajax. The <varname>ajaxKeys</varname> attribute defines the rows to be updated during an Ajax request.
+ As <sgmltag><rich:dataTable></sgmltag> the component is based on the <sgmltag><a4j:repeat></sgmltag> component, it can be partially updated with Ajax. Refer to <xref linkend="sect-Component_Reference-a4jrepeat-Limited_views_and_partial_updates" /> for details on partially updating the <sgmltag><rich:dataTable></sgmltag> component.
</para>
</section>
14 years, 3 months
JBoss Rich Faces SVN: r19182 - in modules/docs/branches/M3_draft: Migration_Guide/src/main/docbook/en-US and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-09-13 21:39:52 -0400 (Mon, 13 Sep 2010)
New Revision: 19182
Modified:
modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
modules/docs/branches/M3_draft/Migration_Guide/src/main/docbook/en-US/Changes_and_new_features.xml
Log:
Completed rich:list style details (RF-9140)
Modified: modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-09-14 00:39:12 UTC (rev 19181)
+++ modules/docs/branches/M3_draft/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-09-14 01:39:52 UTC (rev 19182)
@@ -951,7 +951,7 @@
</variablelist>
</section>
- <!-- TODO
+ <!--
<section id="sect-Component_Reference-richlist-Bullet_point_type">
<title>Bullet point type</title>
<para>
@@ -986,153 +986,7 @@
</section>
-->
- <section id="sect-Component_Reference-richlist-Customizing_the_list">
- <title>Customizing the list</title>
- <para>
- The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richlist-richlist_example" /> shows a simple example using the <sgmltag><rich:dataList></sgmltag> component.
- </para>
- <example id="exam-Component_Reference-richlist-richlist_example">
- <title><sgmltag><rich:list></sgmltag> example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
- <blockquote>
- <figure id="figu-Component_Reference-richlist-richlist_example">
- <title><sgmltag><rich:list></sgmltag> example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-richdataList-richdataList_example.png" format="PNG" />
- </imageobject>
- <textobject>
- <para>
- A list of cars displayed in a list with bullet points.
- </para>
- </textobject>
- </mediaobject>
- </figure>
- </blockquote>
- </example>
- </section>
-
- <section id="sect-Component_Reference-richlist-Reference_data">
- <title>Reference data</title>
- <itemizedlist>
- <listitem>
- <para>
- <parameter>component-type</parameter>: <classname>org.richfaces.List</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-family</parameter>: <classname>org.richfaces.List</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>renderer-type</parameter>: <classname>org.richfaces.ListRenderer</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ListTag</classname>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
-
- <!--<rich:dataDefinitionList>-->
- <!-- TODO
- <section id="sect-Component_Reference-Tables_and_grids-richdataDefinitionList">
- <title><sgmltag><rich:dataDefinitionList></sgmltag></title>
- <para>
- The <sgmltag><rich:dataDefinitionList></sgmltag> component renders a list of items with definitions. The component uses a data model for managing the list items, which can be updated dynamically.
- </para>
-
- <section id="sect-Component_Reference-richdataDefinitionList-Basic_usage">
- <title>Basic usage</title>
- <para>
- The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage).
- </para>
- </section>
-
- <section id="sect-Component_Reference-richdataDefinitionList-Customizing_the_list">
- <title>Customizing the list</title>
- <para>
- The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example" /> shows a simple example using the <sgmltag><rich:dataDefinitionList></sgmltag> component.
- </para>
- <example id="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example">
- <title><sgmltag><rich:dataDefinitionList></sgmltag> example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-richdataDefinitionList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
- <blockquote>
- <figure id="figu-Component_Reference-richdataDefinitionList_example-richdataDefinitionList_example">
- <title><sgmltag><rich:dataDefinitionList></sgmltag> example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-Tables_and_grids-richdataDefinitionList_example.png" format="PNG" />
- </imageobject>
- <textobject>
- <para>
- A list of cars with their price and mileage displayed as a data definition.
- </para>
- </textobject>
- </mediaobject>
- </figure>
- </blockquote>
- </example>
- </section>
-
- <section id="sect-Component_Reference-richdataDefinitionList-Reference_data">
- <title>Reference data</title>
- <itemizedlist>
- <listitem>
- <para>
- <parameter>component-type</parameter>: <classname>org.richfaces.DataDefinitionList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataDefinitionList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-family</parameter>: <classname>org.richfaces.DataDefinitionList</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>renderer-type</parameter>: <classname>org.richfaces.DataDefinitionListRenderer</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataDefinitionListTag</classname>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
- -->
-
- <!--<rich:dataOrderedList>-->
- <!-- TODO
- <section id="sect-Component_Reference-Tables_and_grids-richdataOrderedList">
- <title><sgmltag><rich:dataOrderedList></sgmltag></title>
- <para>
- The <sgmltag><rich:dataOrderedList></sgmltag> component renders an ordered list of items from a data model. Specific rows can be updated dynamically without updating the entire list.
- </para>
-
- <section id="sect-Component_Reference-richdataOrderedList-Basic_usage">
- <title>Basic usage</title>
- <para>
- The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage).
- </para>
- </section>
-
+ <!--
<section id="sect-Component_Reference-richdataOrderedList-Numeration_type">
<title>Numeration type</title>
<para>
@@ -1181,25 +1035,33 @@
</varlistentry>
</variablelist>
</section>
+ -->
- <section id="sect-Component_Reference-richdataOrderedList-Customizing_the_list">
+ <section id="sect-Component_Reference-richlist-Bullet_and_numeration_appearance">
+ <title>Bullet and numeration appearance</title>
+ <para>
+ The appearance of bullet points for unordered lists or numeration for ordered lists can be customized through CSS, using the <property>list-style-type</property> property.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richlist-Customizing_the_list">
<title>Customizing the list</title>
<para>
- The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute defines a pop-up title. To only update a sub-set of the rows in the list, use the <varname>ajaxKeys</varname> attribute, which points to an object that contains the specified rows.
+ The <varname>first</varname> attribute specifies which item in the data model to start from, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richlist-richlist_example" /> shows a simple example using the <sgmltag><rich:dataList></sgmltag> component.
</para>
- <example id="exam-Component_Reference-richdataOrderedList-richdataOrderedList_example">
- <title><sgmltag><rich:dataOrderedList></sgmltag> example</title>
- <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-richdataOrderedList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <example id="exam-Component_Reference-richlist-richlist_example">
+ <title><sgmltag><rich:list></sgmltag> example</title>
+ <programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
<blockquote>
- <figure id="figu-Component_Reference-richdataOrderedList_example-richdataOrderedList_example">
- <title><sgmltag><rich:dataOrderedList></sgmltag> example</title>
+ <figure id="figu-Component_Reference-richlist-richlist_example">
+ <title><sgmltag><rich:list></sgmltag> example</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/figu-Component_Reference-Tables_and_grids-richdataOrderedList_example.png" format="PNG" />
+ <imagedata fileref="images/figu-Component_Reference-richdataList-richdataList_example.png" format="PNG" />
</imageobject>
<textobject>
<para>
- A list of cars displayed in a numbered list.
+ A list of cars displayed in a list with bullet points.
</para>
</textobject>
</mediaobject>
@@ -1208,38 +1070,37 @@
</example>
</section>
- <section id="sect-Component_Reference-richdataOrderedList-Reference_data">
+ <section id="sect-Component_Reference-richlist-Reference_data">
<title>Reference data</title>
<itemizedlist>
<listitem>
<para>
- <parameter>component-type</parameter>: <classname>org.richfaces.DataOrderedList</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.List</classname>
</para>
</listitem>
<listitem>
<para>
- <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataOrderedList</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlList</classname>
</para>
</listitem>
<listitem>
<para>
- <parameter>component-family</parameter>: <classname>org.richfaces.DataOrderedList</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.List</classname>
</para>
</listitem>
<listitem>
<para>
- <parameter>renderer-type</parameter>: <classname>org.richfaces.DataOrderedListRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.ListRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataOrderedListTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ListTag</classname>
</para>
</listitem>
</itemizedlist>
</section>
</section>
- -->
<section id="sect-Component_Reference-Tables_and_grids-Table_filtering">
<title>Table filtering</title>
Modified: modules/docs/branches/M3_draft/Migration_Guide/src/main/docbook/en-US/Changes_and_new_features.xml
===================================================================
--- modules/docs/branches/M3_draft/Migration_Guide/src/main/docbook/en-US/Changes_and_new_features.xml 2010-09-14 00:39:12 UTC (rev 19181)
+++ modules/docs/branches/M3_draft/Migration_Guide/src/main/docbook/en-US/Changes_and_new_features.xml 2010-09-14 01:39:52 UTC (rev 19182)
@@ -967,6 +967,19 @@
</para>
</section>
+ <section id="sect-Component_Reference-Consolidated_or_renamed_components-richlist">
+ <title><sgmltag><rich:list></sgmltag></title>
+ <para>
+ The <sgmltag><rich:list></sgmltag> component now combines the functionality of the old <sgmltag><rich:dataList></sgmltag>, <sgmltag><rich:dataDefinitionList></sgmltag>, and <sgmltag><rich:dataOrderedList></sgmltag> components.
+ </para>
+ <note>
+ <title>List styles</title>
+ <para>
+ Previously, the bullet styles for the <sgmltag><rich:dataList></sgmltag> component and the numeration styles for the <sgmltag><rich:dataOrderedList></sgmltag> component were specified with the <varname>type</varname> attribute. The <varname>type</varname> attribute for the <sgmltag><rich:list></sgmltag> component is now used to specify the type of list, and the bullet and numeration styles are now handled in CSS. Refer to the <sgmltag><rich:list></sgmltag> component section in the <citetitle>RichFaces Component Reference</citetitle> for details.
+ </para>
+ </note>
+ </section>
+
<section id="sect-Migration_Guide-Consolidated_or_renamed_components-richpopupPanel">
<title><sgmltag><rich:popupPanel></sgmltag></title>
<para>
14 years, 3 months
JBoss Rich Faces SVN: r19181 - in branches/RF-7817/push-redesign/src/main: java/org/richfaces/application and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-09-13 20:39:12 -0400 (Mon, 13 Sep 2010)
New Revision: 19181
Added:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/Message.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscribersActivityListener.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessagePublisher.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageSerializer.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageTransformer.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushHandler.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/AtmospherePushHandler.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/DefaultMessageSerializer.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/SubscriberActivityData.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/Subscription.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/SubscriptionImpl.java
Removed:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageAttributes.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushMessage.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushAtmosphereHandler.java
Modified:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/PushRenderer.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushServlet.java
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js
Log:
https://jira.jboss.org/browse/RF-7817
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/Message.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/Message.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/Message.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class Message {
+
+ private TopicKey topicKey;
+
+ private Map<String, Object> attributes = null;
+
+ private Object data;
+
+ public Message(TopicKey topicKey) {
+ super();
+ this.topicKey = topicKey;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ public void addAttribute(String key, Object value) {
+ if (attributes == null) {
+ attributes = new HashMap<String, Object>();
+ }
+
+ attributes.put(key, value);
+ }
+
+ public void removeAttribute(String key) {
+ if (attributes != null) {
+ attributes.remove(key);
+ }
+ }
+
+ public Map<String, Object> getAttributes() {
+ if (attributes == null) {
+ attributes = new HashMap<String, Object>();
+ }
+
+ return attributes;
+ }
+
+ public Object getAttribute(String key) {
+ if (attributes != null) {
+ return attributes.get(key);
+ }
+
+ return null;
+ }
+
+ public boolean hasAttributes() {
+ return attributes != null && !attributes.isEmpty();
+ }
+
+ public TopicKey getTopicKey() {
+ return topicKey;
+ }
+}
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageAttributes.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageAttributes.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageAttributes.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class MessageAttributes {
-
- private TopicKey topic;
-
- public TopicKey getTopic() {
- return topic;
- }
-
- public void setTopic(TopicKey topic) {
- this.topic = topic;
- }
-
-}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -27,6 +27,6 @@
*/
public interface MessageFilter {
- public boolean accept(MessageAttributes attributes, Object message);
+ public boolean accept(Message message);
}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -34,6 +34,11 @@
*/
public SubscriberKey(String uuid) {
super();
+
+ if (uuid == null) {
+ throw new NullPointerException();
+ }
+
this.uuid = uuid;
}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscribersActivityListener.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscribersActivityListener.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscribersActivityListener.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface SubscribersActivityListener {
+
+ public void onRequestStarted(SubscriberKey subscriberKey);
+
+ public void onRequestFinished(SubscriberKey subscriberKey);
+
+}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -31,6 +31,11 @@
public TopicKey(String topicName) {
super();
+
+ if (topicName == null) {
+ throw new NullPointerException();
+ }
+
this.topicName = topicName;
}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessagePublisher.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessagePublisher.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessagePublisher.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import org.richfaces.TopicKey;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface MessagePublisher {
+
+ public void publish(TopicKey topicKey, String messageData);
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageSerializer.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageSerializer.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageSerializer.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import org.richfaces.Message;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface MessageSerializer {
+
+ public String serialize(Message message);
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageTransformer.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageTransformer.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/MessageTransformer.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import org.richfaces.Message;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface MessageTransformer {
+
+ public Message transform(Message o);
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushHandler.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushHandler.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushHandler.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public abstract class PushHandler<T> {
+
+ public abstract void connect(T request);
+
+ public abstract void disconnect(T request);
+
+}
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushMessage.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushMessage.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushMessage.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.application;
-
-import org.richfaces.TopicKey;
-
-/**
- * @author Nick Belaevski
- *
- */
-public final class PushMessage {
-
- private TopicKey topicKey;
-
- private Object data;
-
- public PushMessage(TopicKey topicKey, Object data) {
- super();
- this.topicKey = topicKey;
- this.data = data;
- }
-
- public TopicKey getTopicKey() {
- return topicKey;
- }
-
- public Object getData() {
- return data;
- }
-
-}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -21,8 +21,7 @@
*/
package org.richfaces.application;
-import org.richfaces.DeliveryMode;
-import org.richfaces.MessageAttributes;
+import org.richfaces.Message;
import org.richfaces.TopicKey;
@@ -32,6 +31,10 @@
*/
public interface PushPublisherContext {
+ public static final String PUBLISHER_ATTRIBUTE_NAME = "__org_richfaces_PushPublisherContext";
+
+ public static final String PUBLISHER_EL_EXPRESSION = "#{" + PUBLISHER_ATTRIBUTE_NAME + "}";
+
//TODO - return Future?
//TODO - use topic key?
public void publish(TopicKey topic, Object message);
@@ -39,6 +42,14 @@
//TODO - return Future?
//TODO - use topic key?
//TODO - priority?
- public void publish(MessageAttributes attributes, Object message, long ttl, DeliveryMode deliveryMode);
+ public void publish(Message message);
+
+ public abstract void removeMessageTransformer(MessageTransformer transformer);
+
+ public abstract void addMessageTransformer(MessageTransformer transformer);
+
+ public abstract MessageSerializer getMessageSerializer();
+
+ public abstract void setMessageSerializer(MessageSerializer serializer);
}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/AtmospherePushHandler.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/AtmospherePushHandler.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/AtmospherePushHandler.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application.impl;
+
+import static org.richfaces.application.PushPublisherContext.PUBLISHER_ATTRIBUTE_NAME;
+import static org.richfaces.component.PushSubscriberContext.SUBSCRIBER_ATTRIBUTE_NAME;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.atmosphere.cpr.AtmosphereHandler;
+import org.atmosphere.cpr.AtmosphereResource;
+import org.atmosphere.cpr.AtmosphereResourceEvent;
+import org.atmosphere.cpr.AtmosphereServlet.AtmosphereHandlerWrapper;
+import org.atmosphere.cpr.Broadcaster;
+import org.atmosphere.cpr.DefaultBroadcaster;
+import org.richfaces.SubscriberKey;
+import org.richfaces.TopicKey;
+import org.richfaces.application.MessagePublisher;
+import org.richfaces.application.PushPublisherContext;
+import org.richfaces.component.PushSubscriberContext;
+import org.richfaces.component.Subscription;
+
+import com.google.common.base.Function;
+import com.google.common.collect.MapMaker;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class AtmospherePushHandler implements AtmosphereHandler<HttpServletRequest, HttpServletResponse>, MessagePublisher {
+
+ private PushSubscriberContext subscriberContext;
+
+ private PushPublisherContext publisherContext;
+
+ private Map<TopicKey, Broadcaster> broadcasters = new MapMaker().makeComputingMap(new Function<TopicKey, Broadcaster>() {
+ public Broadcaster apply(TopicKey from) {
+ return new DefaultBroadcaster(from.getTopicName());
+ };
+ });
+
+ public AtmospherePushHandler(ServletContext servletContext) {
+ super();
+
+ subscriberContext = new PushSubscriberContextImpl();
+ publisherContext = new PushPublisherContextImpl(this);
+
+ servletContext.setAttribute(SUBSCRIBER_ATTRIBUTE_NAME, subscriberContext);
+ servletContext.setAttribute(PUBLISHER_ATTRIBUTE_NAME, publisherContext);
+ }
+
+ protected SubscriberKey getSubscriberKey(AtmosphereResource<HttpServletRequest, HttpServletResponse> resource) {
+ return new SubscriberKey(resource.getRequest().getParameter("pid"));
+ }
+
+ public void publish(TopicKey topicKey, String message) {
+ Broadcaster broadcaster = broadcasters.get(topicKey);
+ broadcaster.broadcast(message);
+ }
+
+ public void onRequest(AtmosphereResource<HttpServletRequest, HttpServletResponse> resource) throws IOException {
+ SubscriberKey subscriberKey = getSubscriberKey(resource);
+
+ Subscription[] subscriptions = subscriberContext.getSubscriptions(subscriberKey);
+ if (subscriptions == null) {
+ //TODO - handle
+ }
+
+ subscriberContext.onRequestStarted(subscriberKey);
+
+ //TODO - ONLY FOR TESTING!!!
+ Broadcaster broadcaster = broadcasters.get(subscriptions[0].getTopicKey());
+ broadcaster.addAtmosphereResource(resource);
+
+ //TODO - review
+ resource.getAtmosphereConfig().mapBroadcasterToAtmosphereHandler(broadcaster, new AtmosphereHandlerWrapper(this, broadcaster));
+
+ resource.suspend();
+ }
+
+ public void onStateChange(AtmosphereResourceEvent<HttpServletRequest, HttpServletResponse> event)
+ throws IOException {
+
+ if (event.isCancelled()) {
+ SubscriberKey subscriberKey = getSubscriberKey(event.getResource());
+ subscriberContext.onRequestFinished(subscriberKey);
+ } else {
+ PrintWriter responseWriter = event.getResource().getResponse().getWriter();
+ responseWriter.write(event.getMessage().toString());
+ responseWriter.flush();
+ }
+ }
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/DefaultMessageSerializer.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/DefaultMessageSerializer.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/DefaultMessageSerializer.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.richfaces.Message;
+import org.richfaces.application.MessageSerializer;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class DefaultMessageSerializer implements MessageSerializer {
+
+ public static final String TOPIC_ATTRIBUTE = "topic";
+
+ public static final String ATTRIBUTES_ATTRIBUTE = "attributes";
+
+ public static final String DATA_ATTRIBUTE = "data";
+
+ public String serialize(Message message) {
+ Map<String,Object> dataMap = new HashMap<String, Object>();
+
+ dataMap.put(TOPIC_ATTRIBUTE, message.getTopicKey().getTopicName());
+
+ if (message.hasAttributes()) {
+ dataMap.put(ATTRIBUTES_ATTRIBUTE, message.getAttributes());
+ }
+
+ dataMap.put(DATA_ATTRIBUTE, message.getData());
+
+ return ScriptUtils.toScript(dataMap);
+ }
+
+}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -21,50 +21,80 @@
*/
package org.richfaces.application.impl;
-import javax.faces.bean.ApplicationScoped;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ManagedProperty;
-import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
-import org.atmosphere.cpr.AtmosphereResource;
-import org.richfaces.DeliveryMode;
-import org.richfaces.MessageAttributes;
+import org.richfaces.Message;
import org.richfaces.TopicKey;
+import org.richfaces.application.MessagePublisher;
+import org.richfaces.application.MessageSerializer;
+import org.richfaces.application.MessageTransformer;
import org.richfaces.application.PushPublisherContext;
-import org.richfaces.component.PushSubscriberContext;
/**
* @author Nick Belaevski
*
*/
-@ManagedBean(eager = true, name = "__pushPublisherContext")
-@ApplicationScoped
public class PushPublisherContextImpl implements PushPublisherContext {
- @ManagedProperty(value = "#{__pushSubscriberContext}")
- private PushSubscriberContext<AtmosphereResource<?, ?>> subscriberContext;
+ private final MessagePublisher publisher;
+
+ private volatile MessageSerializer serializer = new DefaultMessageSerializer();
- public void setSubscriberContext(PushSubscriberContext<AtmosphereResource<?, ?>> subscriberContext) {
- this.subscriberContext = subscriberContext;
+ private List<MessageTransformer> transformers = new CopyOnWriteArrayList<MessageTransformer>();
+
+ public PushPublisherContextImpl(MessagePublisher publisher) {
+ super();
+ this.publisher = publisher;
}
+
+ public void setMessageSerializer(MessageSerializer serializer) {
+ this.serializer = serializer;
+ }
+
+ public MessageSerializer getMessageSerializer() {
+ return serializer;
+ }
+
+ public void addMessageTransformer(MessageTransformer transformer) {
+ if (!transformers.contains(transformer)) {
+ transformers.add(transformer);
+ }
+ }
- /* (non-Javadoc)
- * @see org.richfaces.application.PushPublisherContext#publish(java.lang.String, java.lang.Object)
- */
+ public void removeMessageTransformer(MessageTransformer transformer) {
+ transformers.remove(transformer);
+ }
+
+ protected Message getTransformedMessage(Message message) {
+ Message result = message;
+
+ for (MessageTransformer transformer : transformers) {
+ result = transformer.transform(result);
+ if (result == null) {
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ protected void doPublish(Message message) {
+ publisher.publish(message.getTopicKey(), serializer.serialize(message));
+ }
+
public void publish(TopicKey topic, Object message) {
- // TODO Auto-generated method stub
- FacesContext context = FacesContext.getCurrentInstance();
- HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
- HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
+ Message messageObject = new Message(topic);
+ messageObject.setData(message);
+ publish(messageObject);
}
- /* (non-Javadoc)
- * @see org.richfaces.application.PushPublisherContext#publish(org.richfaces.MessageAttributes, java.lang.Object, long, org.richfaces.DeliveryMode)
- */
- public void publish(MessageAttributes attributes, Object message, long ttl, DeliveryMode deliveryMode) {
- throw new UnsupportedOperationException();
+ public void publish(Message message) {
+ Message transformedMessage = getTransformedMessage(message);
+
+ if (transformedMessage != null) {
+ doPublish(transformedMessage);
+ }
}
}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -22,75 +22,132 @@
package org.richfaces.application.impl;
import java.util.Collection;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
-import javax.faces.bean.ApplicationScoped;
-import javax.faces.bean.ManagedBean;
-
-import org.atmosphere.cpr.AtmosphereResource;
import org.richfaces.MessageFilter;
import org.richfaces.SubscriberKey;
+import org.richfaces.SubscribersActivityListener;
import org.richfaces.TopicKey;
import org.richfaces.component.PushSubscriberContext;
+import org.richfaces.component.Subscription;
+import org.richfaces.component.SubscriptionImpl;
import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.MapMaker;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
/**
* @author Nick Belaevski
*
*/
-@ApplicationScoped
-@ManagedBean(eager = true, name = "__pushSubscriberContext")
-public class PushSubscriberContextImpl implements PushSubscriberContext<AtmosphereResource<?, ?>> {
+public class PushSubscriberContextImpl implements PushSubscriberContext, SubscribersActivityListener {
- private ConcurrentMap<SubscriberKey, TopicKey> subscribers = new ConcurrentHashMap<SubscriberKey, TopicKey>();
-
- private ConcurrentMap<TopicKey, Collection<AtmosphereResource<?, ?>>> requests = new MapMaker().makeComputingMap(new Function<TopicKey, Collection<AtmosphereResource<?, ?>>>() {
- public Collection<org.atmosphere.cpr.AtmosphereResource<?,?>> apply(TopicKey from) {
- return new CopyOnWriteArrayList<AtmosphereResource<?,?>>();
- };
+ /**
+ *
+ */
+ private static final int EXPIRATION_INTERVAL = 5 * 60 * 1000;
+
+ private static final Subscription[] EMPTY_SUBSCRPTION_ARRAY = new Subscription[0];
+
+ private Multimap<SubscriberKey, Subscription> subscriptionsMap = Multimaps.synchronizedSetMultimap(
+ LinkedHashMultimap.<SubscriberKey, Subscription>create());
+
+ private Map<SubscriberKey, SubscriberActivityData> subscribersActivityMap = new MapMaker().makeComputingMap(new Function<SubscriberKey, SubscriberActivityData>() {
+
+ public SubscriberActivityData apply(SubscriberKey from) {
+ return new SubscriberActivityData();
+ }
+
});
- public void subscribe(SubscriberKey subscriberKey, TopicKey topicKey) {
- subscribers.put(subscriberKey, topicKey);
+ private ScheduledExecutorService activityExpirationService;
+
+ public PushSubscriberContextImpl() {
+ activityExpirationService = new ScheduledThreadPoolExecutor(1);
+ activityExpirationService.scheduleAtFixedRate(new Runnable() {
+
+ public void run() {
+
+ Iterator<Entry<SubscriberKey, SubscriberActivityData>> entries = subscribersActivityMap.entrySet().iterator();
+ while (entries.hasNext()) {
+ Entry<SubscriberKey, SubscriberActivityData> entry = entries.next();
+
+ long lastAccessTime = entry.getValue().getLastAccessTime();
+
+ if (lastAccessTime < 0) {
+ continue;
+ }
+
+ if (System.currentTimeMillis() - lastAccessTime > EXPIRATION_INTERVAL) {
+ unsubscribe(entry.getKey());
+ }
+ }
+ }
+ }, 0, 1, TimeUnit.SECONDS);
}
-
+
+ protected void onSubscriptionAdded(SubscriberKey subscriberKey, Subscription subscription) {
+ //force activity data creation
+ subscribersActivityMap.get(subscriberKey);
+ }
+
+ protected void onSubscriptionRemoved(SubscriberKey subscriberKey) {
+ subscribersActivityMap.remove(subscriberKey);
+ }
+
+ public void subscribe(SubscriberKey subscriberKey, TopicKey topic) {
+ Subscription subscription = new SubscriptionImpl(topic, null, false);
+ subscriptionsMap.put(subscriberKey, subscription);
+ onSubscriptionAdded(subscriberKey, subscription);
+ }
+
public void subscribe(SubscriberKey subscriberKey, TopicKey topic, MessageFilter filter) {
- throw new UnsupportedOperationException();
+ SubscriptionImpl subscription = new SubscriptionImpl(topic, filter, false);
+ subscriptionsMap.put(subscriberKey, subscription);
+ onSubscriptionAdded(subscriberKey, subscription);
}
-
+
public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic) {
- throw new UnsupportedOperationException();
+ Subscription subscription = new SubscriptionImpl(topic, null, true);
+ subscriptionsMap.put(subscriberKey, subscription);
+ onSubscriptionAdded(subscriberKey, subscription);
}
public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic, MessageFilter filter) {
- throw new UnsupportedOperationException();
+ Subscription subscription = new SubscriptionImpl(topic, filter, true);
+ subscriptionsMap.put(subscriberKey, subscription);
+ onSubscriptionAdded(subscriberKey, subscription);
}
-
- public void unsubscribe(SubscriberKey subscriberKey) {
- subscribers.remove(subscriberKey);
- }
-
- public void onConnect(SubscriberKey subscriberKey, AtmosphereResource<?, ?> resource) {
- TopicKey topicKey = subscribers.get(subscriberKey);
- if (topicKey == null) {
- //TODO - handle
+
+ public Subscription[] getSubscriptions(SubscriberKey subscriberKey) {
+ Collection<Subscription> collection = subscriptionsMap.get(subscriberKey);
+ if (collection == null) {
+ return null;
}
- requests.get(topicKey).add(resource);
+ return collection.toArray(EMPTY_SUBSCRPTION_ARRAY);
}
-
- public void onDisconnect(SubscriberKey subscriberKey, AtmosphereResource<?, ?> resource) {
- // TODO Auto-generated method stub
-
- TopicKey topicKey = subscribers.get(subscriberKey);
- if (topicKey == null) {
- //TODO - handle
+
+ public void unsubscribe(SubscriberKey subscriberKey) {
+ if (!Iterables.isEmpty(subscriptionsMap.removeAll(subscriberKey))) {
+ onSubscriptionRemoved(subscriberKey);
}
-
- requests.get(topicKey).remove(resource);
+ subscribersActivityMap.remove(subscriberKey);
}
+
+ public void onRequestStarted(SubscriberKey subscriberKey) {
+ subscribersActivityMap.get(subscriberKey).onRequestStarted();
+ }
+
+ public void onRequestFinished(SubscriberKey subscriberKey) {
+ subscribersActivityMap.get(subscriberKey).onRequestFinished();
+ }
}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/SubscriberActivityData.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/SubscriberActivityData.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/SubscriberActivityData.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application.impl;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+final class SubscriberActivityData {
+
+ private AtomicInteger requestsCount = new AtomicInteger();
+
+ private volatile long lastAccessTime = System.currentTimeMillis();
+
+ public void onRequestStarted() {
+ requestsCount.incrementAndGet();
+
+ lastAccessTime = -1;
+ }
+
+ public void onRequestFinished() {
+ if (requestsCount.decrementAndGet() == 0) {
+ lastAccessTime = System.currentTimeMillis();
+ }
+ }
+
+ public long getLastAccessTime() {
+ return lastAccessTime;
+ }
+}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -30,10 +30,10 @@
* @author Nick Belaevski
*
*/
-public interface PushSubscriberContext<T> {
+public interface PushSubscriberContext {
- public static final String PUSH_PATH = "rf-hub";
-
+ public static final String SUBSCRIBER_ATTRIBUTE_NAME = "__org_richfaces_PushSubscriberContext";
+
public void subscribe(SubscriberKey subscriberKey, TopicKey topic);
public void subscribe(SubscriberKey subscriberKey, TopicKey topic, MessageFilter filter);
@@ -44,7 +44,10 @@
public void unsubscribe(SubscriberKey subscriberKey);
- public void onConnect(SubscriberKey subscriberKey, T resource);
-
- public void onDisconnect(SubscriberKey subscriberKey, T resource);
+ public Subscription[] getSubscriptions(SubscriberKey subscriberKey);
+
+ public abstract void onRequestFinished(SubscriberKey subscriberKey);
+
+ public abstract void onRequestStarted(SubscriberKey subscriberKey);
+
}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/Subscription.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/Subscription.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/Subscription.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import org.richfaces.MessageFilter;
+import org.richfaces.TopicKey;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface Subscription {
+
+ public abstract TopicKey getTopicKey();
+
+ public abstract MessageFilter getMessageFilter();
+
+ public abstract boolean isDurable();
+
+}
\ No newline at end of file
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/SubscriptionImpl.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/SubscriptionImpl.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/SubscriptionImpl.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import org.richfaces.MessageFilter;
+import org.richfaces.TopicKey;
+
+public final class SubscriptionImpl implements Subscription {
+
+ private final TopicKey topicKey;
+
+ private final MessageFilter messageFilter;
+
+ private final boolean durability;
+
+ public SubscriptionImpl(TopicKey topicKey, MessageFilter messageFilter, boolean durability) {
+ super();
+ this.topicKey = topicKey;
+ this.messageFilter = messageFilter;
+ this.durability = durability;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((topicKey == null) ? 0 : topicKey.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ SubscriptionImpl other = (SubscriptionImpl) obj;
+ if (topicKey == null) {
+ if (other.topicKey != null) {
+ return false;
+ }
+ } else if (!topicKey.equals(other.topicKey)) {
+ return false;
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.Subscription#getTopicKey()
+ */
+ public TopicKey getTopicKey() {
+ return topicKey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.Subscription#getMessageFilter()
+ */
+ public MessageFilter getMessageFilter() {
+ return messageFilter;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.Subscription#isDurable()
+ */
+ public boolean isDurable() {
+ return durability;
+ }
+}
\ No newline at end of file
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/PushRenderer.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/PushRenderer.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/PushRenderer.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -21,6 +21,8 @@
*/
package org.richfaces.renderkit.html;
+import static org.richfaces.component.PushSubscriberContext.SUBSCRIBER_ATTRIBUTE_NAME;
+
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Map;
@@ -68,14 +70,14 @@
private String getPushUrl(FacesContext context, String pushId) {
ExternalContext ec = context.getExternalContext();
- return MessageFormat.format("{0}://{1}:{2,number,#####}{3}/atmosphere/{4}/?pid={5}",
+ return MessageFormat.format("{0}://{1}:{2,number,#####}{3}/atmosphere/?pid={4}",
ec.getRequestScheme(), ec.getRequestServerName(),
ec.getRequestServerPort(), ec.getRequestContextPath(),
- PushSubscriberContext.PUSH_PATH, pushId);
+ pushId);
}
private PushSubscriberContext getPushSubscriberContext(FacesContext context) {
- return (PushSubscriberContext) context.getExternalContext().getApplicationMap().get("__pushSubscriberContext");
+ return (PushSubscriberContext) context.getExternalContext().getApplicationMap().get(SUBSCRIBER_ATTRIBUTE_NAME);
}
@Override
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushAtmosphereHandler.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushAtmosphereHandler.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushAtmosphereHandler.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.webapp;
-
-import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.atmosphere.cpr.AtmosphereHandler;
-import org.atmosphere.cpr.AtmosphereResource;
-import org.atmosphere.cpr.AtmosphereResourceEvent;
-import org.richfaces.SubscriberKey;
-import org.richfaces.component.PushSubscriberContext;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class PushAtmosphereHandler implements AtmosphereHandler<HttpServletRequest, HttpServletResponse> {
-
- private PushSubscriberContext<AtmosphereResource<?, ?>> subscriberContext;
-
- public PushAtmosphereHandler(ServletContext servletContext) {
- super();
-
- this.subscriberContext = (PushSubscriberContext<AtmosphereResource<?, ?>>) servletContext.getAttribute("__pushSubscriberContext");
- }
-
- private SubscriberKey getSubscriberKey(HttpServletRequest request) {
- return new SubscriberKey(request.getParameter("pid"));
- }
-
- public void onRequest(AtmosphereResource<HttpServletRequest, HttpServletResponse> resource) throws IOException {
- // TODO Auto-generated method stub
- subscriberContext.onConnect(getSubscriberKey(resource.getRequest()), resource);
-
- resource.suspend();
- }
-
- public void onStateChange(AtmosphereResourceEvent<HttpServletRequest, HttpServletResponse> event)
- throws IOException {
- // TODO Auto-generated method stub
-
- if (event.isCancelled()) {
- AtmosphereResource<HttpServletRequest, HttpServletResponse> resource = event.getResource();
- subscriberContext.onDisconnect(getSubscriberKey(resource.getRequest()), resource);
- }
- }
-
-
-}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushServlet.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushServlet.java 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushServlet.java 2010-09-14 00:39:12 UTC (rev 19181)
@@ -29,7 +29,7 @@
import org.atmosphere.cpr.AtmosphereServlet;
import org.atmosphere.cpr.DefaultBroadcaster;
-import org.richfaces.component.PushSubscriberContext;
+import org.richfaces.application.impl.AtmospherePushHandler;
/**
* @author Nick Belaevski
@@ -48,6 +48,8 @@
URISyntaxException {
super.autoDetectAtmosphereHandlers(sc, c);
- addAtmosphereHandler("/atmosphere/" + PushSubscriberContext.PUSH_PATH + "/*", new PushAtmosphereHandler(sc), new DefaultBroadcaster());
+ addAtmosphereHandler("/atmosphere/*", new AtmospherePushHandler(sc), new DefaultBroadcaster());
}
+
+
}
Modified: branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js
===================================================================
--- branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-09-13 23:04:21 UTC (rev 19180)
+++ branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-09-14 00:39:12 UTC (rev 19181)
@@ -5,7 +5,8 @@
return {
__callback: function(response) {
- debugger;
+ alert(response.responseBody);
+ response.responseBody = "";
},
connect: function(url, opts) {
14 years, 3 months
JBoss Rich Faces SVN: r19180 - in branches/RF-8742: bom and 42 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-09-13 19:04:21 -0400 (Mon, 13 Sep 2010)
New Revision: 19180
Added:
branches/RF-8742/examples/template/
branches/RF-8742/examples/template/pom.xml
branches/RF-8742/examples/template/src/
branches/RF-8742/examples/template/src/main/
branches/RF-8742/examples/template/src/main/java/
branches/RF-8742/examples/template/src/main/java/org/
branches/RF-8742/examples/template/src/main/java/org/richfaces/
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ContentBean.java
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PageDescriptionBean.java
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/Pages.java
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ParsingException.java
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PhaseTracker.java
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/SkinBean.java
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/TimeBean.java
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBody.java
branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBodySerializer.java
branches/RF-8742/examples/template/src/main/resources/
branches/RF-8742/examples/template/src/main/resources/META-INF/
branches/RF-8742/examples/template/src/main/resources/META-INF/faces-config.xml
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids-min.css
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids.css
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/reset-fonts-grids.css
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.css
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.js
branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/richfaces-qunit.js
branches/RF-8742/examples/template/src/main/webapp/
branches/RF-8742/examples/template/src/main/webapp/WEB-INF/
branches/RF-8742/examples/template/src/main/webapp/WEB-INF/web.xml
branches/RF-8742/examples/template/src/main/webapp/index.jsp
branches/RF-8742/examples/template/src/main/webapp/layout/
branches/RF-8742/examples/template/src/main/webapp/layout/pagesList.xhtml
branches/RF-8742/examples/template/src/main/webapp/layout/template.xhtml
branches/RF-8742/examples/validator-demo/
branches/RF-8742/examples/validator-demo/pom.xml
branches/RF-8742/examples/validator-demo/src/
branches/RF-8742/examples/validator-demo/src/main/
branches/RF-8742/examples/validator-demo/src/main/java/
branches/RF-8742/examples/validator-demo/src/main/java/org/
branches/RF-8742/examples/validator-demo/src/main/java/org/richfaces/
branches/RF-8742/examples/validator-demo/src/main/java/org/richfaces/example/
branches/RF-8742/examples/validator-demo/src/main/webapp/
branches/RF-8742/examples/validator-demo/src/main/webapp/WEB-INF/
branches/RF-8742/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml
branches/RF-8742/examples/validator-demo/src/main/webapp/examples/
branches/RF-8742/examples/validator-demo/src/main/webapp/qunit/
branches/RF-8742/examples/validator-demo/src/main/webapp/resources/
branches/RF-8742/examples/validator-demo/src/main/webapp/resources/tests/
branches/RF-8742/svnmerge-commit-message.txt
branches/RF-8742/ui/common/api/src/main/java/META-INF/
branches/RF-8742/ui/common/api/src/main/java/META-INF/MANIFEST.MF
branches/RF-8742/ui/validator/
branches/RF-8742/ui/validator/api/
branches/RF-8742/ui/validator/api/pom.xml
branches/RF-8742/ui/validator/api/src/
branches/RF-8742/ui/validator/api/src/main/
branches/RF-8742/ui/validator/api/src/main/java/
branches/RF-8742/ui/validator/api/src/main/java/META-INF/
branches/RF-8742/ui/validator/api/src/main/java/META-INF/MANIFEST.MF
branches/RF-8742/ui/validator/impl/
branches/RF-8742/ui/validator/impl/pom.xml
branches/RF-8742/ui/validator/impl/src/
branches/RF-8742/ui/validator/impl/src/main/
branches/RF-8742/ui/validator/impl/src/main/java/
branches/RF-8742/ui/validator/impl/src/test/
branches/RF-8742/ui/validator/impl/src/test/java/
branches/RF-8742/ui/validator/impl/src/test/resources/
branches/RF-8742/ui/validator/pom.xml
branches/RF-8742/ui/validator/ui/
branches/RF-8742/ui/validator/ui/pom.xml
branches/RF-8742/ui/validator/ui/src/
branches/RF-8742/ui/validator/ui/src/main/
branches/RF-8742/ui/validator/ui/src/main/java/
branches/RF-8742/ui/validator/ui/src/test/
branches/RF-8742/ui/validator/ui/src/test/java/
Modified:
branches/RF-8742/bom/pom.xml
branches/RF-8742/examples/pom.xml
branches/RF-8742/ui/pom.xml
Log:
RESOLVED - issue RF-9214: CSV: create project in sandbox
https://jira.jboss.org/browse/RF-9214
Modified: branches/RF-8742/bom/pom.xml
===================================================================
--- branches/RF-8742/bom/pom.xml 2010-09-13 17:48:35 UTC (rev 19179)
+++ branches/RF-8742/bom/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -111,6 +111,21 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-api</artifactId>
<version>${project.version}</version>
Modified: branches/RF-8742/examples/pom.xml
===================================================================
--- branches/RF-8742/examples/pom.xml 2010-09-13 17:48:35 UTC (rev 19179)
+++ branches/RF-8742/examples/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -40,6 +40,7 @@
<modules>
<module>parent</module>
+ <module>template</module>
<module>core-demo</module>
<module>misc-demo</module>
<module>output-demo</module>
@@ -47,7 +48,7 @@
<module>repeater-demo</module>
<module>iteration-demo</module>
<module>richfaces-showcase</module>
- <!--<module>dist</module>-->
+ <module>validator-demo</module>
</modules>
<scm>
Property changes on: branches/RF-8742/examples/template
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Added: branches/RF-8742/examples/template/pom.xml
===================================================================
--- branches/RF-8742/examples/template/pom.xml (rev 0)
+++ branches/RF-8742/examples/template/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,31 @@
+<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>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>template</artifactId>
+ <packaging>war</packaging>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>examples template</name>
+ <dependencies>
+ </dependencies>
+ <build>
+ <finalName>template</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Property changes on: branches/RF-8742/examples/template/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ContentBean.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ContentBean.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ContentBean.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,53 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+
+
+/**
+ * @author leo
+ *
+ */
+public class ContentBean {
+
+ private static final String PRELUDE="<html xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
+ " xmlns:f=\"http://java.sun.com/jsf/core\"\n" +
+ " xmlns:h=\"http://java.sun.com/jsf/html\"\n" +
+ " xmlns:a4j=\"http://richfaces.org/a4j\"\n" +
+ " xmlns:rich=\"http://richfaces.org/rich\"\n" +
+ " xmlns:c=\"http://java.sun.com/jsp/jstl/core\">\n";
+
+ private static final String TAIL="\n</html>";
+
+ private String xpath="//*[local-name()='define'][@name='content']/*";
+
+ public String getContent() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ String viewId = context.getViewRoot().getViewId();
+ XMLBody xmlBody = new XMLBody();
+ try {
+ xmlBody.loadXML(context.getExternalContext().getResourceAsStream(viewId),false);
+ return PRELUDE+xmlBody.getContent(getXpath())+TAIL;
+ } catch (ParsingException e) {
+ throw new FacesException(e);
+ }
+ }
+
+ /**
+ * @param xpath the xpath to set
+ */
+ public void setXpath(String xpath) {
+ this.xpath = xpath;
+ }
+
+ /**
+ * @return the xpath
+ */
+ public String getXpath() {
+ return xpath;
+ }
+
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ContentBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PageDescriptionBean.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PageDescriptionBean.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PageDescriptionBean.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,64 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author leo
+ *
+ */
+public class PageDescriptionBean implements Comparable<PageDescriptionBean> {
+
+ private String _path;
+
+ private String _title;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return _title;
+ }
+
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ _title = title;
+ }
+
+ public String navigate() {
+ return getPath();
+ }
+
+ public String getUrl(){
+ FacesContext context = FacesContext.getCurrentInstance();
+ String actionURL = context.getApplication().getViewHandler().getActionURL(context, getPath());
+ return context.getExternalContext().encodeActionURL(actionURL);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(PageDescriptionBean o) {
+ // compare paths
+ return getPath().compareToIgnoreCase(o.getPath());
+ }
+
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PageDescriptionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/Pages.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/Pages.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/Pages.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,159 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author leo
+ *
+ */
+
+public class Pages {
+
+ public static final String DEFAULT_TITLE_PATTERN = "<h2>(.*)</h2>";
+
+ private static final Pattern JSP_PATTERN = Pattern.compile(".*\\.jspx?");
+
+ private static final Pattern XHTML_PATTERN = Pattern.compile(".*\\.xhtml");
+
+ private Pattern titlePattern = compilePattern(DEFAULT_TITLE_PATTERN);
+
+ private volatile List<PageDescriptionBean> _jspPages;
+
+ private Object jspMutex = new Object();
+
+ private String _path = "/pages";
+
+ private volatile List<PageDescriptionBean> _xhtmlPages;
+
+ private Object xhtmlMutex = new Object();
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ public Pattern compilePattern(String titlePattern) {
+ return Pattern.compile(titlePattern, Pattern.CASE_INSENSITIVE
+ | Pattern.MULTILINE);
+ }
+
+ /**
+ * @param path
+ * the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ public List<PageDescriptionBean> getJspPages() {
+ if (_jspPages == null && null != getExternalContext()) {
+ synchronized (jspMutex) {
+ if (_jspPages == null) {
+ _jspPages = getPagesByPattern(JSP_PATTERN);
+ }
+ }
+ }
+
+ return _jspPages;
+ }
+
+ private ExternalContext getExternalContext() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+
+ ExternalContext externalContext = null;
+ if (null != facesContext) {
+ externalContext = facesContext.getExternalContext();
+ }
+ return externalContext;
+ }
+
+ public List<PageDescriptionBean> getXhtmlPages() {
+ if (_xhtmlPages == null && null != getExternalContext()) {
+ synchronized (xhtmlMutex) {
+ if (_xhtmlPages == null) {
+ _xhtmlPages = getPagesByPattern(XHTML_PATTERN);
+ }
+ }
+ }
+
+ return _xhtmlPages;
+ }
+
+ /**
+ *
+ */
+ private List<PageDescriptionBean> getPagesByPattern(Pattern pattern) {
+ List<PageDescriptionBean> jspPages = new ArrayList<PageDescriptionBean>();
+ Set<String> resourcePaths = getExternalContext().getResourcePaths(
+ getPath());
+ for (Iterator<String> iterator = resourcePaths.iterator(); iterator
+ .hasNext();) {
+ String page = iterator.next();
+ if (pattern.matcher(page).matches()) {
+ PageDescriptionBean pageBean = new PageDescriptionBean();
+ pageBean.setPath(page);
+ InputStream pageInputStream = getExternalContext()
+ .getResourceAsStream(page);
+ if (null != pageInputStream) {
+ byte[] head = new byte[1024];
+ try {
+ int readed = pageInputStream.read(head);
+ String headString = new String(head, 0, readed);
+ Matcher titleMatcher = titlePattern.matcher(headString);
+ if (titleMatcher.find()
+ && titleMatcher.group(1).length() > 0) {
+ pageBean.setTitle(titleMatcher.group(1));
+ } else {
+ pageBean.setTitle(page);
+ }
+ } catch (IOException e) {
+ throw new FacesException(
+ "can't read directory content", e);
+ } finally {
+ try {
+ pageInputStream.close();
+ } catch (IOException e) {
+ // ignore it.
+ }
+ }
+ }
+ jspPages.add(pageBean);
+ }
+ }
+ Collections.sort(jspPages);
+ return jspPages;
+ }
+
+ /**
+ * @param titlePattern
+ * the titlePattern to set
+ */
+ public void setTitlePattern(String titlePattern) {
+ this.titlePattern = compilePattern(titlePattern);
+ }
+
+ /**
+ * @return the titlePattern
+ */
+ public String getTitlePattern() {
+ return titlePattern.toString();
+ }
+
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/Pages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ParsingException.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ParsingException.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ParsingException.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package org.richfaces.example;
+
+/**
+ * @author leo
+ *
+ */
+public class ParsingException extends Exception {
+
+ /**
+ *
+ */
+ public ParsingException() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param message
+ */
+ public ParsingException(String message) {
+ super(message);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param cause
+ */
+ public ParsingException(Throwable cause) {
+ super(cause);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public ParsingException(String message, Throwable cause) {
+ super(message, cause);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/ParsingException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PhaseTracker.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PhaseTracker.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PhaseTracker.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.example;
+
+import java.text.MessageFormat;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.richfaces.log.LogFactory;
+import org.richfaces.log.Logger;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PhaseTracker implements PhaseListener {
+
+ private static final long serialVersionUID = 6358081870120864332L;
+
+ private Logger logger = LogFactory.getLogger(PhaseTracker.class);
+
+ private ThreadLocal<Long> phaseTimer = new ThreadLocal<Long>();
+
+ public void afterPhase(PhaseEvent event) {
+ Long phaseStartTime = phaseTimer.get();
+
+ long measuredTime = 0;
+ if (phaseStartTime != null) {
+ measuredTime = System.currentTimeMillis() - phaseStartTime.longValue();
+ }
+
+ logger.debug(MessageFormat.format("Phase {0} completed by {1}ms", event.getPhaseId(), measuredTime));
+ phaseTimer.set(null);
+ }
+
+ public void beforePhase(PhaseEvent event) {
+ logger.debug(MessageFormat.format("Phase {0} started", event.getPhaseId()));
+ phaseTimer.set(System.currentTimeMillis());
+ }
+
+ public PhaseId getPhaseId() {
+ return PhaseId.ANY_PHASE;
+ }
+
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/PhaseTracker.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/SkinBean.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/SkinBean.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/SkinBean.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,61 @@
+package org.richfaces.example;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.model.SelectItem;
+
+@ManagedBean(name = "skinBean")
+@SessionScoped
+public class SkinBean implements Serializable {
+
+ private static final long serialVersionUID = 2744605279708632184L;
+
+ private SelectItem[] skinSetItems = {
+ new SelectItem("blueSky"),
+ new SelectItem("classic"),
+ new SelectItem("deepMarine"),
+ new SelectItem("DEFAULT"),
+ new SelectItem("emeraldTown"),
+ new SelectItem("japanCherry"),
+ new SelectItem("NULL"),
+ new SelectItem("plain"),
+ new SelectItem("ruby"),
+ new SelectItem("wine")
+ };
+
+ private String skin = "classic";
+
+ private boolean enableElementsSkinning = true;
+
+ private boolean enableClassesSkinning = false;
+
+ public String getSkin() {
+ return skin;
+ }
+
+ public void setSkin(String skin) {
+ this.skin = skin;
+ }
+
+ public boolean isEnableElementsSkinning() {
+ return enableElementsSkinning;
+ }
+
+ public void setEnableElementsSkinning(boolean enableElementsSkinning) {
+ this.enableElementsSkinning = enableElementsSkinning;
+ }
+
+ public boolean isEnableClassesSkinning() {
+ return enableClassesSkinning;
+ }
+
+ public void setEnableClassesSkinning(boolean enableClassesSkinning) {
+ this.enableClassesSkinning = enableClassesSkinning;
+ }
+
+ public SelectItem[] getSkinSetItems() {
+ return skinSetItems;
+ }
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/SkinBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/TimeBean.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/TimeBean.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/TimeBean.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,49 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - 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.example;
+
+import java.text.SimpleDateFormat;
+
+import java.util.Date;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean(name = "timeBean")
+@RequestScoped()
+public class TimeBean {
+ private String formattedDate = null;
+
+ public String getDateString() {
+ if (formattedDate == null) {
+ formattedDate = new SimpleDateFormat("HH:mm:ss SSSS").format(new Date());
+ }
+
+ return formattedDate;
+ }
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/TimeBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBody.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBody.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBody.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,219 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - 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.example;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * This class must read XML file from input stream and can extract body of root
+ * element for include into target in generation.
+ *
+ * @author shura
+ *
+ */
+public class XMLBody {
+ private Document xmlDocument;
+
+ private Element rootElement;
+
+ /**
+ * Load XML document and parse it into DOM.
+ *
+ * @param input
+ * @throws ParsingException
+ */
+ public void loadXML(InputStream input) throws ParsingException {
+ loadXML(input,false);
+ }
+
+
+ /**
+ * Load XML document and parse it into DOM.
+ *
+ * @param input
+ * @throws ParsingException
+ */
+ public void loadXML(InputStream input, boolean namespaceAware) throws ParsingException {
+ try {
+ // Create Document Builder Factory
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory
+ .newInstance();
+ docFactory.setIgnoringElementContentWhitespace(true);
+ docFactory.setValidating(false);
+ docFactory.setNamespaceAware(namespaceAware);
+ // Create Document Builder
+ DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
+ //docBuilder.
+ //docBuilder.isValidating();
+
+ // Disable loading of external Entityes
+ docBuilder.setEntityResolver(new EntityResolver() {
+ // Dummi resolver - alvays do nothing
+ public InputSource resolveEntity(String publicId, String systemId)
+ throws SAXException, IOException {
+ return new InputSource(new StringReader(""));
+ }
+
+ });
+
+ // open and parse XML-file
+ xmlDocument = docBuilder.parse(input);
+
+ // Get Root xmlElement
+ rootElement = xmlDocument.getDocumentElement();
+ } catch (Exception e) {
+ throw new ParsingException("Error load XML ", e);
+ }
+
+ }
+
+ /**
+ * Check name of root element is as expected.
+ *
+ * @param name
+ * @return
+ */
+ public boolean isRootName(String name) {
+ return rootElement.getNodeName().equals(name);
+ }
+
+ public String getDoctype() {
+ DocumentType doctype = xmlDocument.getDoctype();
+ if (null != doctype) {
+ return doctype.getName();
+ }
+ return null;
+ }
+
+ public String getPiblicId() {
+ DocumentType doctype = xmlDocument.getDoctype();
+ if (null != doctype) {
+ return doctype.getPublicId();
+ }
+ return null;
+ }
+
+ public String getRootTypeName() {
+ return rootElement.getSchemaTypeInfo().getTypeName();
+ }
+
+ public String getContent() throws ParsingException {
+ NodeList childNodes = rootElement.getChildNodes();
+ return serializeNodes(childNodes);
+ }
+
+ private String serializeNodes(NodeList childNodes) throws ParsingException {
+ try {
+ return new XMLBodySerializer().serialize(childNodes, xmlDocument);
+ } catch (Exception e) {
+ throw new ParsingException(e);
+ }
+ }
+
+ public String getContent(String xpath) throws ParsingException{
+ return serializeNodes(getByXpath(xpath));
+ }
+
+ public NodeList getByXpath(String xpath) throws ParsingException {
+ XPath path = XPathFactory.newInstance().newXPath();
+ NodeList childNodes;
+ try {
+ childNodes = (NodeList) path.evaluate(xpath, xmlDocument, XPathConstants.NODESET);
+ } catch (XPathExpressionException e) {
+ throw new ParsingException("Error evaluate xpath",e);
+ }
+ return childNodes;
+ }
+
+ public NodeList getByXpathUnique(String xpath, String keyXPath, Set<String> keySet) throws ParsingException {
+ if (keyXPath == null) {
+ return getByXpath(xpath);
+ } else {
+ XPath path = XPathFactory.newInstance().newXPath();
+ NodeList childNodes;
+ try {
+ childNodes = getByXpath(xpath);
+
+ List<Node> nodeSet = new ArrayList<Node>();
+
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ Node node = childNodes.item(i).cloneNode(true);
+
+ String key = serializeNodes((NodeList) path.evaluate(keyXPath, node, XPathConstants.NODESET));
+ if (!keySet.contains(key)) {
+ keySet.add(key);
+ nodeSet.add(node);
+ }
+ }
+ return new ArrayNodeList(nodeSet.toArray(new Node[nodeSet.size()]));
+ } catch (XPathExpressionException e) {
+ throw new ParsingException("Error evaluate xpath",e);
+ }
+
+ }
+ }
+ public String getContentUnique(String xpath, String keyXPath, Set<String> keySet) throws ParsingException{
+ return serializeNodes(getByXpathUnique(xpath, keyXPath, keySet));
+ }
+}
+
+class ArrayNodeList implements NodeList {
+ private Node[] nodes;
+
+ public ArrayNodeList(Node[] nodes) {
+ super();
+ this.nodes = nodes;
+ }
+
+ public int getLength() {
+ return nodes.length;
+ }
+
+ public Node item(int index) {
+ if (index < nodes.length) {
+ return this.nodes[index];
+ }
+
+ return null;
+ }
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBody.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBodySerializer.java
===================================================================
--- branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBodySerializer.java (rev 0)
+++ branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBodySerializer.java 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,77 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - 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.example;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.NodeList;
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class XMLBodySerializer {
+ public String serialize(NodeList childNodes, Document xmlDocument) throws ParsingException {
+ try {
+ StringWriter out;
+ DocumentFragment fragment = xmlDocument.createDocumentFragment();
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ fragment.appendChild(childNodes.item(i).cloneNode(true));
+ }
+ TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ Transformer transformer = transformerFactory.newTransformer();
+ transformer.setErrorListener(new ErrorListener(){
+
+ public void error(TransformerException exception)
+ throws TransformerException {
+ }
+
+ public void fatalError(TransformerException exception)
+ throws TransformerException {
+ }
+
+ public void warning(TransformerException exception)
+ throws TransformerException {
+ }
+
+ });
+ transformer.setOutputProperty("indent", "yes");
+ transformer.setOutputProperty("omit-xml-declaration", "yes");
+ out = new StringWriter();
+ StreamResult result = new StreamResult(out);
+ transformer.transform(new DOMSource(fragment), result);
+ return out.toString();
+ } catch (Exception e) {
+ throw new ParsingException(e);
+ }
+ }
+}
Property changes on: branches/RF-8742/examples/template/src/main/java/org/richfaces/example/XMLBodySerializer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/resources/META-INF/faces-config.xml
===================================================================
--- branches/RF-8742/examples/template/src/main/resources/META-INF/faces-config.xml (rev 0)
+++ branches/RF-8742/examples/template/src/main/resources/META-INF/faces-config.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+ <managed-bean>
+ <managed-bean-name>pages</managed-bean-name>
+ <managed-bean-class>org.richfaces.example.Pages</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>content</managed-bean-name>
+ <managed-bean-class>org.richfaces.example.ContentBean</managed-bean-class>
+ <managed-bean-scope>none</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Property changes on: branches/RF-8742/examples/template/src/main/resources/META-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids-min.css
===================================================================
--- branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids-min.css (rev 0)
+++ branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids-min.css 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.2
+*/
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right!
;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.y!
ui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.fi!
rst div.
first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin!
-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}s .yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb!
.yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20!
%;}.yui-
gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
Property changes on: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids-min.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids.css
===================================================================
--- branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids.css (rev 0)
+++ branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids.css 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,283 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.2
+*/
+/*
+ Note: Throughout this file, the *property filter is used to
+ give a value to IE that other browsers do not see.
+*/
+
+/*
+ Section: General Rules
+*/
+
+ body {
+ text-align:center;
+ }
+
+ #ft {
+ clear:both;
+ }
+
+/*
+ Section: Page Width Rules (#doc, #doc2, #doc3, #doc4)
+*/
+
+ /*
+ Subsection: General
+ */
+
+ #doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {
+ margin:auto;
+ text-align:left;
+ width:57.69em;*width:56.25em;
+ min-width:750px;
+ }
+ /*
+ Subsection: 950 Centered (doc2)
+ */
+ #doc2 {
+ width:73.076em;*width:71.25em;
+ }
+
+ /*
+ Subsection: 100% (doc3)
+ */
+ #doc3 {
+ /* Left and Right margins are not a structural part of Grids. Without them Grids
+ works fine, but content bleeds to the very edge of the document, which often
+ impairs readability and usability. They are
+ provided because they prevent the content from "bleeding" into the browser's chrome.*/
+ margin:auto 10px;
+ width:auto;
+ }
+
+ /*
+ Subsection: 974 Centered (doc4)
+ */
+ #doc4 {
+ width:74.923em;*width:73.05em;
+ }
+
+/*
+ Section: Preset Template Rules (.yui-t[1-6])
+*/
+
+ /*
+ Subsection: General
+ */
+
+ /* to preserve source-order independence for Gecko */
+ .yui-b{position:relative;}
+ .yui-b{_position:static;}
+ .yui-main .yui-b{position:static;}
+
+ .yui-main {width:100%;}
+
+ .yui-t1 .yui-main,
+ .yui-t2 .yui-main,
+ .yui-t3 .yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}
+
+ .yui-t4 .yui-main,
+ .yui-t5 .yui-main,
+ .yui-t6 .yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}
+
+ /*
+ Subsection: For Specific Template Presets
+ */
+
+ .yui-t1 .yui-b {float:left;width:12.30769em;*width:12.00em;}
+ .yui-t1 .yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}
+
+ .yui-t2 .yui-b {float:left;width:13.8461em;*width:13.50em;}
+ .yui-t2 .yui-main .yui-b {margin-left:14.8461em;*margin-left:14.55em;}
+
+ .yui-t3 .yui-b {float:left;width:23.0769em;*width:22.50em;}
+ .yui-t3 .yui-main .yui-b {margin-left:24.0769em;*margin-left:23.62em;}
+
+ .yui-t4 .yui-b {float:right;width:13.8456em;*width:13.50em;}
+ .yui-t4 .yui-main .yui-b {margin-right:14.8456em;*margin-right:14.55em;}
+
+ .yui-t5 .yui-b {float:right;width:18.4615em;*width:18.00em;}
+ .yui-t5 .yui-main .yui-b {margin-right:19.4615em;*margin-right:19.125em;}
+
+ .yui-t6 .yui-b {float:right;width:23.0769em;*width:22.50em;}
+ .yui-t6 .yui-main .yui-b {margin-right:24.0769em;*margin-right:23.62em;}
+
+ .yui-t7 .yui-main .yui-b {
+ display:block;margin:0 0 1em 0;
+ }
+ .yui-main .yui-b {float:none;width:auto;}
+
+/*
+ Section: Grids and Nesting Grids
+*/
+
+ /*
+ Subsection: Children generally take half the available space
+ */
+
+ .yui-gb .yui-u,
+ .yui-g .yui-gb .yui-u,
+ .yui-gb .yui-g,
+ .yui-gb .yui-gb,
+ .yui-gb .yui-gc,
+ .yui-gb .yui-gd,
+ .yui-gb .yui-ge,
+ .yui-gb .yui-gf,
+ .yui-gc .yui-u,
+ .yui-gc .yui-g,
+ .yui-gd .yui-u {float:left;}
+
+ /*Float units (and sub grids) to the right */
+ .yui-g .yui-u,
+ .yui-g .yui-g,
+ .yui-g .yui-gb,
+ .yui-g .yui-gc,
+ .yui-g .yui-gd,
+ .yui-g .yui-ge,
+ .yui-g .yui-gf,
+ .yui-gc .yui-u,
+ .yui-gd .yui-g,
+ .yui-g .yui-gc .yui-u,
+ .yui-ge .yui-u,
+ .yui-ge .yui-g,
+ .yui-gf .yui-g,
+ .yui-gf .yui-u{float:right;}
+
+ /*Float units (and sub grids) to the left */
+ .yui-g div.first,
+ .yui-gb div.first,
+ .yui-gc div.first,
+ .yui-gd div.first,
+ .yui-ge div.first,
+ .yui-gf div.first,
+ .yui-g .yui-gc div.first,
+ .yui-g .yui-ge div.first,
+ .yui-gc div.first div.first {float:left;}
+
+ .yui-g .yui-u,
+ .yui-g .yui-g,
+ .yui-g .yui-gb,
+ .yui-g .yui-gc,
+ .yui-g .yui-gd,
+ .yui-g .yui-ge,
+ .yui-g .yui-gf {width:49.1%;}
+
+ .yui-gb .yui-u,
+ .yui-g .yui-gb .yui-u,
+ .yui-gb .yui-g,
+ .yui-gb .yui-gb,
+ .yui-gb .yui-gc,
+ .yui-gb .yui-gd,
+ .yui-gb .yui-ge,
+ .yui-gb .yui-gf,
+ .yui-gc .yui-u,
+ .yui-gc .yui-g,
+ .yui-gd .yui-u {width:32%;margin-left:1.99%;}
+
+ /* Give IE some extra breathing room for 1/3-based rounding issues */
+ .yui-gb .yui-u {*margin-left:1.9%;*width:31.9%;}
+
+ .yui-gc div.first,
+ .yui-gd .yui-u {width:66%;}
+ .yui-gd div.first {width:32%;}
+
+ .yui-ge div.first,
+ .yui-gf .yui-u{width:74.2%;}
+
+ .yui-ge .yui-u,
+ .yui-gf div.first {width:24%;}
+
+ .yui-g .yui-gb div.first,
+ .yui-gb div.first,
+ .yui-gc div.first,
+ .yui-gd div.first {margin-left:0;}
+
+ /*
+ Section: Deep Nesting
+ */
+ .yui-g .yui-g .yui-u,
+ .yui-gb .yui-g .yui-u,
+ .yui-gc .yui-g .yui-u,
+ .yui-gd .yui-g .yui-u,
+ .yui-ge .yui-g .yui-u,
+ .yui-gf .yui-g .yui-u {width:49%;*width:48.1%;*margin-left:0;}
+
+ .yui-g .yui-gb div.first,
+ .yui-gb .yui-gb div.first {*margin-right:0;*width:32%;_width:31.7%;}
+
+ .yui-g .yui-gc div.first,
+ .yui-gd .yui-g {width:66%;}
+
+ .yui-gb .yui-g div.first {*margin-right:4%;_margin-right:1.3%;}
+
+ .yui-gb .yui-gc div.first,
+ .yui-gb .yui-gd div.first {*margin-right:0;}
+
+ .yui-gb .yui-gb .yui-u,
+ .yui-gb .yui-gc .yui-u {*margin-left:1.8%;_margin-left:4%;}
+
+ .yui-g .yui-gb .yui-u {_margin-left:1.0%;}
+
+ .yui-gb .yui-gd .yui-u {*width:66%;_width:61.2%;}
+ .yui-gb .yui-gd div.first {*width:31%;_width:29.5%;}
+
+ .yui-g .yui-gc .yui-u,
+ .yui-gb .yui-gc .yui-u {width:32%;_float:right;margin-right:0;_margin-left:0;}
+ .yui-gb .yui-gc div.first {width:66%;*float:left;*margin-left:0;}
+
+ .yui-gb .yui-ge .yui-u,
+ .yui-gb .yui-gf .yui-u {margin:0;}
+
+ .yui-gb .yui-gb .yui-u {_margin-left:.7%;}
+
+ .yui-gb .yui-g div.first,
+ .yui-gb .yui-gb div.first {*margin-left:0;}
+
+ .yui-gc .yui-g .yui-u,
+ .yui-gd .yui-g .yui-u {*width:48.1%;*margin-left:0;}s
+
+ .yui-gb .yui-gd div.first {width:32%;}
+ .yui-g .yui-gd div.first {_width:29.9%;}
+
+ .yui-ge .yui-g {width:24%;}
+ .yui-gf .yui-g {width:74.2%;}
+
+ .yui-gb .yui-ge div.yui-u,
+ .yui-gb .yui-gf div.yui-u {float:right;}
+ .yui-gb .yui-ge div.first,
+ .yui-gb .yui-gf div.first {float:left;}
+
+ /* Width Accommodation for Nested Contexts */
+ .yui-gb .yui-ge .yui-u,
+ .yui-gb .yui-gf div.first {*width:24%;_width:20%;}
+
+ /* Width Accommodation for Nested Contexts */
+ .yui-gb .yui-ge div.first,
+ .yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}
+
+ /* Patch for GD within GE */
+ .yui-ge div.first .yui-gd .yui-u {width:65%;}
+ .yui-ge div.first .yui-gd div.first {width:32%;}
+
+/*
+ Section: Clearing
+*/
+
+#bd:after,
+.yui-g:after,
+.yui-gb:after,
+.yui-gc:after,
+.yui-gd:after,
+.yui-ge:after,
+.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
+#bd,
+.yui-g,
+.yui-gb,
+.yui-gc,
+.yui-gd,
+.yui-ge,
+.yui-gf{zoom:1;}
Property changes on: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/grids.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/reset-fonts-grids.css
===================================================================
--- branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/reset-fonts-grids.css (rev 0)
+++ branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/reset-fonts-grids.css 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,8 @@
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.2
+*/
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
+body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;min-width:750px;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right!
;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.y!
ui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.fi!
rst div.
first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin!
-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}s .yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb!
.yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20!
%;}.yui-
gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
Property changes on: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/org.richfaces.template/reset-fonts-grids.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.css
===================================================================
--- branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.css (rev 0)
+++ branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.css 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,119 @@
+
+ol#qunit-tests {
+ font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
+ margin:0;
+ padding:0;
+ list-style-position:inside;
+
+ font-size: smaller;
+}
+ol#qunit-tests li{
+ padding:0.4em 0.5em 0.4em 2.5em;
+ border-bottom:1px solid #fff;
+ font-size:small;
+ list-style-position:inside;
+}
+ol#qunit-tests li ol{
+ box-shadow: inset 0px 2px 13px #999;
+ -moz-box-shadow: inset 0px 2px 13px #999;
+ -webkit-box-shadow: inset 0px 2px 13px #999;
+ margin-top:0.5em;
+ margin-left:0;
+ padding:0.5em;
+ background-color:#fff;
+ border-radius:15px;
+ -moz-border-radius: 15px;
+ -webkit-border-radius: 15px;
+}
+ol#qunit-tests li li{
+ border-bottom:none;
+ margin:0.5em;
+ background-color:#fff;
+ list-style-position: inside;
+ padding:0.4em 0.5em 0.4em 0.5em;
+}
+
+ol#qunit-tests li li.pass{
+ border-left:26px solid #C6E746;
+ background-color:#fff;
+ color:#5E740B;
+ }
+ol#qunit-tests li li.fail{
+ border-left:26px solid #EE5757;
+ background-color:#fff;
+ color:#710909;
+}
+ol#qunit-tests li.pass{
+ background-color:#D2E0E6;
+ color:#528CE0;
+}
+ol#qunit-tests li.fail{
+ background-color:#EE5757;
+ color:#000;
+}
+ol#qunit-tests li strong {
+ cursor:pointer;
+}
+h1#qunit-header{
+ background-color:#0d3349;
+ margin:0;
+ padding:0.5em 0 0.5em 1em;
+ color:#fff;
+ font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
+ border-top-right-radius:15px;
+ border-top-left-radius:15px;
+ -moz-border-radius-topright:15px;
+ -moz-border-radius-topleft:15px;
+ -webkit-border-top-right-radius:15px;
+ -webkit-border-top-left-radius:15px;
+ text-shadow: rgba(0, 0, 0, 0.5) 4px 4px 1px;
+}
+h2#qunit-banner{
+ font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
+ height:5px;
+ margin:0;
+ padding:0;
+}
+h2#qunit-banner.qunit-pass{
+ background-color:#C6E746;
+}
+h2#qunit-banner.qunit-fail, #qunit-testrunner-toolbar {
+ background-color:#EE5757;
+}
+#qunit-testrunner-toolbar {
+ font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
+ padding:0;
+ /*width:80%;*/
+ padding:0em 0 0.5em 2em;
+ font-size: small;
+}
+h2#qunit-userAgent {
+ font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
+ background-color:#2b81af;
+ margin:0;
+ padding:0;
+ color:#fff;
+ font-size: small;
+ padding:0.5em 0 0.5em 2.5em;
+ text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
+}
+p#qunit-testresult{
+ font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
+ margin:0;
+ font-size: small;
+ color:#2b81af;
+ border-bottom-right-radius:15px;
+ border-bottom-left-radius:15px;
+ -moz-border-radius-bottomright:15px;
+ -moz-border-radius-bottomleft:15px;
+ -webkit-border-bottom-right-radius:15px;
+ -webkit-border-bottom-left-radius:15px;
+ background-color:#D2E0E6;
+ padding:0.5em 0.5em 0.5em 2.5em;
+}
+strong b.fail{
+ color:#710909;
+ }
+strong b.pass{
+ color:#5E740B;
+ }
Property changes on: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.js
===================================================================
--- branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.js (rev 0)
+++ branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.js 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,1043 @@
+/*
+ * QUnit - A JavaScript Unit Testing Framework
+ *
+ * http://docs.jquery.com/QUnit
+ *
+ * Copyright (c) 2009 John Resig, Jörn Zaefferer
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ */
+
+(function(window) {
+
+var QUnit = {
+
+ // Initialize the configuration options
+ init: function() {
+ config = {
+ stats: { all: 0, bad: 0 },
+ moduleStats: { all: 0, bad: 0 },
+ started: +new Date,
+ blocking: false,
+ autorun: false,
+ assertions: [],
+ filters: [],
+ queue: []
+ };
+
+ var tests = id("qunit-tests"),
+ banner = id("qunit-banner"),
+ result = id("qunit-testresult");
+
+ if ( tests ) {
+ tests.innerHTML = "";
+ }
+
+ if ( banner ) {
+ banner.className = "";
+ }
+
+ if ( result ) {
+ result.parentNode.removeChild( result );
+ }
+ },
+
+ // call on start of module test to prepend name to all tests
+ module: function(name, testEnvironment) {
+ config.currentModule = name;
+
+ synchronize(function() {
+ if ( config.currentModule ) {
+ QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
+ }
+
+ config.currentModule = name;
+ config.moduleTestEnvironment = testEnvironment;
+ config.moduleStats = { all: 0, bad: 0 };
+
+ QUnit.moduleStart( name, testEnvironment );
+ });
+ },
+
+ asyncTest: function(testName, expected, callback) {
+ if ( arguments.length === 2 ) {
+ callback = expected;
+ expected = 0;
+ }
+
+ QUnit.test(testName, expected, callback, true);
+ },
+
+ test: function(testName, expected, callback, async) {
+ var name = testName, testEnvironment, testEnvironmentArg;
+
+ if ( arguments.length === 2 ) {
+ callback = expected;
+ expected = null;
+ }
+ // is 2nd argument a testEnvironment?
+ if ( expected && typeof expected === 'object') {
+ testEnvironmentArg = expected;
+ expected = null;
+ }
+
+ if ( config.currentModule ) {
+ name = config.currentModule + " module: " + name;
+ }
+
+ if ( !validTest(name) ) {
+ return;
+ }
+
+ synchronize(function() {
+ QUnit.testStart( testName );
+
+ testEnvironment = extend({
+ setup: function() {},
+ teardown: function() {}
+ }, config.moduleTestEnvironment);
+ if (testEnvironmentArg) {
+ extend(testEnvironment,testEnvironmentArg);
+ }
+
+ // allow utility functions to access the current test environment
+ QUnit.current_testEnvironment = testEnvironment;
+
+ config.assertions = [];
+ config.expected = expected;
+
+ try {
+ if ( !config.pollution ) {
+ saveGlobal();
+ }
+
+ testEnvironment.setup.call(testEnvironment);
+ } catch(e) {
+ QUnit.ok( false, "Setup failed on " + name + ": " + e.message );
+ }
+
+ if ( async ) {
+ QUnit.stop();
+ }
+
+ try {
+ callback.call(testEnvironment);
+ } catch(e) {
+ fail("Test " + name + " died, exception and test follows", e, callback);
+ QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message );
+ // else next test will carry the responsibility
+ saveGlobal();
+
+ // Restart the tests if they're blocking
+ if ( config.blocking ) {
+ start();
+ }
+ }
+ });
+
+ synchronize(function() {
+ try {
+ checkPollution();
+ testEnvironment.teardown.call(testEnvironment);
+ } catch(e) {
+ QUnit.ok( false, "Teardown failed on " + name + ": " + e.message );
+ }
+
+ try {
+ QUnit.reset();
+ } catch(e) {
+ fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset);
+ }
+
+ if ( config.expected && config.expected != config.assertions.length ) {
+ QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" );
+ }
+
+ var good = 0, bad = 0,
+ tests = id("qunit-tests");
+
+ config.stats.all += config.assertions.length;
+ config.moduleStats.all += config.assertions.length;
+
+ if ( tests ) {
+ var ol = document.createElement("ol");
+ ol.style.display = "none";
+
+ for ( var i = 0; i < config.assertions.length; i++ ) {
+ var assertion = config.assertions[i];
+
+ var li = document.createElement("li");
+ li.className = assertion.result ? "pass" : "fail";
+ li.appendChild(document.createTextNode(assertion.message || "(no message)"));
+ ol.appendChild( li );
+
+ if ( assertion.result ) {
+ good++;
+ } else {
+ bad++;
+ config.stats.bad++;
+ config.moduleStats.bad++;
+ }
+ }
+
+ var b = document.createElement("strong");
+ b.innerHTML = name + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + config.assertions.length + ")</b>";
+
+ addEvent(b, "click", function() {
+ var next = b.nextSibling, display = next.style.display;
+ next.style.display = display === "none" ? "block" : "none";
+ });
+
+ addEvent(b, "dblclick", function(e) {
+ var target = e && e.target ? e.target : window.event.srcElement;
+ if ( target.nodeName.toLowerCase() === "strong" ) {
+ var text = "", node = target.firstChild;
+
+ while ( node.nodeType === 3 ) {
+ text += node.nodeValue;
+ node = node.nextSibling;
+ }
+
+ text = text.replace(/(^\s*|\s*$)/g, "");
+
+ if ( window.location ) {
+ window.location.href = window.location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(text);
+ }
+ }
+ });
+
+ var li = document.createElement("li");
+ li.className = bad ? "fail" : "pass";
+ li.appendChild( b );
+ li.appendChild( ol );
+ tests.appendChild( li );
+
+ if ( bad ) {
+ var toolbar = id("qunit-testrunner-toolbar");
+ if ( toolbar ) {
+ toolbar.style.display = "block";
+ id("qunit-filter-pass").disabled = null;
+ id("qunit-filter-missing").disabled = null;
+ }
+ }
+
+ } else {
+ for ( var i = 0; i < config.assertions.length; i++ ) {
+ if ( !config.assertions[i].result ) {
+ bad++;
+ config.stats.bad++;
+ config.moduleStats.bad++;
+ }
+ }
+ }
+
+ QUnit.testDone( testName, bad, config.assertions.length );
+
+ if ( !window.setTimeout && !config.queue.length ) {
+ done();
+ }
+ });
+
+ if ( window.setTimeout && !config.doneTimer ) {
+ config.doneTimer = window.setTimeout(function(){
+ if ( !config.queue.length ) {
+ done();
+ } else {
+ synchronize( done );
+ }
+ }, 13);
+ }
+ },
+
+ /**
+ * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
+ */
+ expect: function(asserts) {
+ config.expected = asserts;
+ },
+
+ /**
+ * Asserts true.
+ * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
+ */
+ ok: function(a, msg) {
+ QUnit.log(a, msg);
+
+ config.assertions.push({
+ result: !!a,
+ message: msg
+ });
+ },
+
+ /**
+ * Checks that the first two arguments are equal, with an optional message.
+ * Prints out both actual and expected values.
+ *
+ * Prefered to ok( actual == expected, message )
+ *
+ * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
+ *
+ * @param Object actual
+ * @param Object expected
+ * @param String message (optional)
+ */
+ equal: function(actual, expected, message) {
+ push(expected == actual, actual, expected, message);
+ },
+
+ notEqual: function(actual, expected, message) {
+ push(expected != actual, actual, expected, message);
+ },
+
+ deepEqual: function(a, b, message) {
+ push(QUnit.equiv(a, b), a, b, message);
+ },
+
+ notDeepEqual: function(a, b, message) {
+ push(!QUnit.equiv(a, b), a, b, message);
+ },
+
+ strictEqual: function(actual, expected, message) {
+ push(expected === actual, actual, expected, message);
+ },
+
+ notStrictEqual: function(actual, expected, message) {
+ push(expected !== actual, actual, expected, message);
+ },
+
+ start: function() {
+ // A slight delay, to avoid any current callbacks
+ if ( window.setTimeout ) {
+ window.setTimeout(function() {
+ if ( config.timeout ) {
+ clearTimeout(config.timeout);
+ }
+
+ config.blocking = false;
+ process();
+ }, 13);
+ } else {
+ config.blocking = false;
+ process();
+ }
+ },
+
+ stop: function(timeout) {
+ config.blocking = true;
+
+ if ( timeout && window.setTimeout ) {
+ config.timeout = window.setTimeout(function() {
+ QUnit.ok( false, "Test timed out" );
+ QUnit.start();
+ }, timeout);
+ }
+ },
+
+ /**
+ * Resets the test setup. Useful for tests that modify the DOM.
+ */
+ reset: function() {
+ if ( window.jQuery ) {
+ jQuery("#main").html( config.fixture );
+ jQuery.event.global = {};
+ jQuery.ajaxSettings = extend({}, config.ajaxSettings);
+ }
+ },
+
+ /**
+ * Trigger an event on an element.
+ *
+ * @example triggerEvent( document.body, "click" );
+ *
+ * @param DOMElement elem
+ * @param String type
+ */
+ triggerEvent: function( elem, type, event ) {
+ if ( document.createEvent ) {
+ event = document.createEvent("MouseEvents");
+ event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ elem.dispatchEvent( event );
+
+ } else if ( elem.fireEvent ) {
+ elem.fireEvent("on"+type);
+ }
+ },
+
+ // Safe object type checking
+ is: function( type, obj ) {
+ return Object.prototype.toString.call( obj ) === "[object "+ type +"]";
+ },
+
+ // Logging callbacks
+ done: function(failures, total) {},
+ log: function(result, message) {},
+ testStart: function(name) {},
+ testDone: function(name, failures, total) {},
+ moduleStart: function(name, testEnvironment) {},
+ moduleDone: function(name, failures, total) {}
+};
+
+// Backwards compatibility, deprecated
+QUnit.equals = QUnit.equal;
+QUnit.same = QUnit.deepEqual;
+
+// Maintain internal state
+var config = {
+ // The queue of tests to run
+ queue: [],
+
+ // block until document ready
+ blocking: true
+};
+
+// Load paramaters
+(function() {
+ var location = window.location || { search: "", protocol: "file:" },
+ GETParams = location.search.slice(1).split('&');
+
+ for ( var i = 0; i < GETParams.length; i++ ) {
+ GETParams[i] = decodeURIComponent( GETParams[i] );
+ if ( GETParams[i] === "noglobals" ) {
+ GETParams.splice( i, 1 );
+ i--;
+ config.noglobals = true;
+ } else if ( GETParams[i].search('=') > -1 ) {
+ GETParams.splice( i, 1 );
+ i--;
+ }
+ }
+
+ // restrict modules/tests by get parameters
+ config.filters = GETParams;
+
+ // Figure out if we're running the tests from a server or not
+ QUnit.isLocal = !!(location.protocol === 'file:');
+})();
+
+// Expose the API as global variables, unless an 'exports'
+// object exists, in that case we assume we're in CommonJS
+if ( typeof exports === "undefined" || typeof require === "undefined" ) {
+ extend(window, QUnit);
+ window.QUnit = QUnit;
+} else {
+ extend(exports, QUnit);
+ exports.QUnit = QUnit;
+}
+
+if ( typeof document === "undefined" || document.readyState === "complete" ) {
+ config.autorun = true;
+}
+
+addEvent(window, "load", function() {
+ // Initialize the config, saving the execution queue
+ var oldconfig = extend({}, config);
+ QUnit.init();
+ extend(config, oldconfig);
+
+ config.blocking = false;
+
+ var userAgent = id("qunit-userAgent");
+ if ( userAgent ) {
+ userAgent.innerHTML = navigator.userAgent;
+ }
+
+ var toolbar = id("qunit-testrunner-toolbar");
+ if ( toolbar ) {
+ toolbar.style.display = "none";
+
+ var filter = document.createElement("input");
+ filter.type = "checkbox";
+ filter.id = "qunit-filter-pass";
+ filter.disabled = true;
+ addEvent( filter, "click", function() {
+ var li = document.getElementsByTagName("li");
+ for ( var i = 0; i < li.length; i++ ) {
+ if ( li[i].className.indexOf("pass") > -1 ) {
+ li[i].style.display = filter.checked ? "none" : "";
+ }
+ }
+ });
+ toolbar.appendChild( filter );
+
+ var label = document.createElement("label");
+ label.setAttribute("for", "qunit-filter-pass");
+ label.innerHTML = "Hide passed tests";
+ toolbar.appendChild( label );
+
+ var missing = document.createElement("input");
+ missing.type = "checkbox";
+ missing.id = "qunit-filter-missing";
+ missing.disabled = true;
+ addEvent( missing, "click", function() {
+ var li = document.getElementsByTagName("li");
+ for ( var i = 0; i < li.length; i++ ) {
+ if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) {
+ li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block";
+ }
+ }
+ });
+ toolbar.appendChild( missing );
+
+ label = document.createElement("label");
+ label.setAttribute("for", "qunit-filter-missing");
+ label.innerHTML = "Hide missing tests (untested code is broken code)";
+ toolbar.appendChild( label );
+ }
+
+ var main = id('main');
+ if ( main ) {
+ config.fixture = main.innerHTML;
+ }
+
+ if ( window.jQuery ) {
+ config.ajaxSettings = window.jQuery.ajaxSettings;
+ }
+
+ QUnit.start();
+});
+
+function done() {
+ if ( config.doneTimer && window.clearTimeout ) {
+ window.clearTimeout( config.doneTimer );
+ config.doneTimer = null;
+ }
+
+ if ( config.queue.length ) {
+ config.doneTimer = window.setTimeout(function(){
+ if ( !config.queue.length ) {
+ done();
+ } else {
+ synchronize( done );
+ }
+ }, 13);
+
+ return;
+ }
+
+ config.autorun = true;
+
+ // Log the last module results
+ if ( config.currentModule ) {
+ QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
+ }
+
+ var banner = id("qunit-banner"),
+ tests = id("qunit-tests"),
+ html = ['Tests completed in ',
+ +new Date - config.started, ' milliseconds.<br/>',
+ '<span class="passed">', config.stats.all - config.stats.bad, '</span> tests of <span class="total">', config.stats.all, '</span> passed, <span class="failed">', config.stats.bad,'</span> failed.'].join('');
+
+ if ( banner ) {
+ banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
+ }
+
+ if ( tests ) {
+ var result = id("qunit-testresult");
+
+ if ( !result ) {
+ result = document.createElement("p");
+ result.id = "qunit-testresult";
+ result.className = "result";
+ tests.parentNode.insertBefore( result, tests.nextSibling );
+ }
+
+ result.innerHTML = html;
+ }
+
+ QUnit.done( config.stats.bad, config.stats.all );
+}
+
+function validTest( name ) {
+ var i = config.filters.length,
+ run = false;
+
+ if ( !i ) {
+ return true;
+ }
+
+ while ( i-- ) {
+ var filter = config.filters[i],
+ not = filter.charAt(0) == '!';
+
+ if ( not ) {
+ filter = filter.slice(1);
+ }
+
+ if ( name.indexOf(filter) !== -1 ) {
+ return !not;
+ }
+
+ if ( not ) {
+ run = true;
+ }
+ }
+
+ return run;
+}
+
+function push(result, actual, expected, message) {
+ message = message || (result ? "okay" : "failed");
+ QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) );
+}
+
+function synchronize( callback ) {
+ config.queue.push( callback );
+
+ if ( config.autorun && !config.blocking ) {
+ process();
+ }
+}
+
+function process() {
+ while ( config.queue.length && !config.blocking ) {
+ config.queue.shift()();
+ }
+}
+
+function saveGlobal() {
+ config.pollution = [];
+
+ if ( config.noglobals ) {
+ for ( var key in window ) {
+ config.pollution.push( key );
+ }
+ }
+}
+
+function checkPollution( name ) {
+ var old = config.pollution;
+ saveGlobal();
+
+ var newGlobals = diff( old, config.pollution );
+ if ( newGlobals.length > 0 ) {
+ ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
+ config.expected++;
+ }
+
+ var deletedGlobals = diff( config.pollution, old );
+ if ( deletedGlobals.length > 0 ) {
+ ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
+ config.expected++;
+ }
+}
+
+// returns a new Array with the elements that are in a but not in b
+function diff( a, b ) {
+ var result = a.slice();
+ for ( var i = 0; i < result.length; i++ ) {
+ for ( var j = 0; j < b.length; j++ ) {
+ if ( result[i] === b[j] ) {
+ result.splice(i, 1);
+ i--;
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+function fail(message, exception, callback) {
+ if ( typeof console !== "undefined" && console.error && console.warn ) {
+ console.error(message);
+ console.error(exception);
+ console.warn(callback.toString());
+
+ } else if ( window.opera && opera.postError ) {
+ opera.postError(message, exception, callback.toString);
+ }
+}
+
+function extend(a, b) {
+ for ( var prop in b ) {
+ a[prop] = b[prop];
+ }
+
+ return a;
+}
+
+function addEvent(elem, type, fn) {
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, fn, false );
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, fn );
+ } else {
+ fn();
+ }
+}
+
+function id(name) {
+ return !!(typeof document !== "undefined" && document && document.getElementById) &&
+ document.getElementById( name );
+}
+
+// Test for equality any JavaScript type.
+// Discussions and reference: http://philrathe.com/articles/equiv
+// Test suites: http://philrathe.com/tests/equiv
+// Author: Philippe Rathé <prathe(a)gmail.com>
+QUnit.equiv = function () {
+
+ var innerEquiv; // the real equiv function
+ var callers = []; // stack to decide between skip/abort functions
+
+
+ // Determine what is o.
+ function hoozit(o) {
+ if (QUnit.is("String", o)) {
+ return "string";
+
+ } else if (QUnit.is("Boolean", o)) {
+ return "boolean";
+
+ } else if (QUnit.is("Number", o)) {
+
+ if (isNaN(o)) {
+ return "nan";
+ } else {
+ return "number";
+ }
+
+ } else if (typeof o === "undefined") {
+ return "undefined";
+
+ // consider: typeof null === object
+ } else if (o === null) {
+ return "null";
+
+ // consider: typeof [] === object
+ } else if (QUnit.is( "Array", o)) {
+ return "array";
+
+ // consider: typeof new Date() === object
+ } else if (QUnit.is( "Date", o)) {
+ return "date";
+
+ // consider: /./ instanceof Object;
+ // /./ instanceof RegExp;
+ // typeof /./ === "function"; // => false in IE and Opera,
+ // true in FF and Safari
+ } else if (QUnit.is( "RegExp", o)) {
+ return "regexp";
+
+ } else if (typeof o === "object") {
+ return "object";
+
+ } else if (QUnit.is( "Function", o)) {
+ return "function";
+ } else {
+ return undefined;
+ }
+ }
+
+ // Call the o related callback with the given arguments.
+ function bindCallbacks(o, callbacks, args) {
+ var prop = hoozit(o);
+ if (prop) {
+ if (hoozit(callbacks[prop]) === "function") {
+ return callbacks[prop].apply(callbacks, args);
+ } else {
+ return callbacks[prop]; // or undefined
+ }
+ }
+ }
+
+ var callbacks = function () {
+
+ // for string, boolean, number and null
+ function useStrictEquality(b, a) {
+ if (b instanceof a.constructor || a instanceof b.constructor) {
+ // to catch short annotaion VS 'new' annotation of a declaration
+ // e.g. var i = 1;
+ // var j = new Number(1);
+ return a == b;
+ } else {
+ return a === b;
+ }
+ }
+
+ return {
+ "string": useStrictEquality,
+ "boolean": useStrictEquality,
+ "number": useStrictEquality,
+ "null": useStrictEquality,
+ "undefined": useStrictEquality,
+
+ "nan": function (b) {
+ return isNaN(b);
+ },
+
+ "date": function (b, a) {
+ return hoozit(b) === "date" && a.valueOf() === b.valueOf();
+ },
+
+ "regexp": function (b, a) {
+ return hoozit(b) === "regexp" &&
+ a.source === b.source && // the regex itself
+ a.global === b.global && // and its modifers (gmi) ...
+ a.ignoreCase === b.ignoreCase &&
+ a.multiline === b.multiline;
+ },
+
+ // - skip when the property is a method of an instance (OOP)
+ // - abort otherwise,
+ // initial === would have catch identical references anyway
+ "function": function () {
+ var caller = callers[callers.length - 1];
+ return caller !== Object &&
+ typeof caller !== "undefined";
+ },
+
+ "array": function (b, a) {
+ var i;
+ var len;
+
+ // b could be an object literal here
+ if ( ! (hoozit(b) === "array")) {
+ return false;
+ }
+
+ len = a.length;
+ if (len !== b.length) { // safe and faster
+ return false;
+ }
+ for (i = 0; i < len; i++) {
+ if ( ! innerEquiv(a[i], b[i])) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "object": function (b, a) {
+ var i;
+ var eq = true; // unless we can proove it
+ var aProperties = [], bProperties = []; // collection of strings
+
+ // comparing constructors is more strict than using instanceof
+ if ( a.constructor !== b.constructor) {
+ return false;
+ }
+
+ // stack constructor before traversing properties
+ callers.push(a.constructor);
+
+ for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
+
+ aProperties.push(i); // collect a's properties
+
+ if ( ! innerEquiv(a[i], b[i])) {
+ eq = false;
+ break;
+ }
+ }
+
+ callers.pop(); // unstack, we are done
+
+ for (i in b) {
+ bProperties.push(i); // collect b's properties
+ }
+
+ // Ensures identical properties name
+ return eq && innerEquiv(aProperties.sort(), bProperties.sort());
+ }
+ };
+ }();
+
+ innerEquiv = function () { // can take multiple arguments
+ var args = Array.prototype.slice.apply(arguments);
+ if (args.length < 2) {
+ return true; // end transition
+ }
+
+ return (function (a, b) {
+ if (a === b) {
+ return true; // catch the most you can
+ } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || hoozit(a) !== hoozit(b)) {
+ return false; // don't lose time with error prone cases
+ } else {
+ return bindCallbacks(a, callbacks, [b, a]);
+ }
+
+ // apply transition with (1..n) arguments
+ })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
+ };
+
+ return innerEquiv;
+
+}();
+
+/**
+ * jsDump
+ * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
+ * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
+ * Date: 5/15/2008
+ * @projectDescription Advanced and extensible data dumping for Javascript.
+ * @version 1.0.0
+ * @author Ariel Flesler
+ * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
+ */
+QUnit.jsDump = (function() {
+ function quote( str ) {
+ return '"' + str.toString().replace(/"/g, '\\"') + '"';
+ };
+ function literal( o ) {
+ return o + '';
+ };
+ function join( pre, arr, post ) {
+ var s = jsDump.separator(),
+ base = jsDump.indent(),
+ inner = jsDump.indent(1);
+ if ( arr.join )
+ arr = arr.join( ',' + s + inner );
+ if ( !arr )
+ return pre + post;
+ return [ pre, inner + arr, base + post ].join(s);
+ };
+ function array( arr ) {
+ var i = arr.length, ret = Array(i);
+ this.up();
+ while ( i-- )
+ ret[i] = this.parse( arr[i] );
+ this.down();
+ return join( '[', ret, ']' );
+ };
+
+ var reName = /^function (\w+)/;
+
+ var jsDump = {
+ parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
+ var parser = this.parsers[ type || this.typeOf(obj) ];
+ type = typeof parser;
+
+ return type == 'function' ? parser.call( this, obj ) :
+ type == 'string' ? parser :
+ this.parsers.error;
+ },
+ typeOf:function( obj ) {
+ var type;
+ if ( obj === null ) {
+ type = "null";
+ } else if (typeof obj === "undefined") {
+ type = "undefined";
+ } else if (QUnit.is("RegExp", obj)) {
+ type = "regexp";
+ } else if (QUnit.is("Date", obj)) {
+ type = "date";
+ } else if (QUnit.is("Function", obj)) {
+ type = "function";
+ } else if (QUnit.is("Array", obj)) {
+ type = "array";
+ } else if (QUnit.is("Window", obj) || QUnit.is("global", obj)) {
+ type = "window";
+ } else if (QUnit.is("HTMLDocument", obj)) {
+ type = "document";
+ } else if (QUnit.is("HTMLCollection", obj) || QUnit.is("NodeList", obj)) {
+ type = "nodelist";
+ } else if (/^\[object HTML/.test(Object.prototype.toString.call( obj ))) {
+ type = "node";
+ } else {
+ type = typeof obj;
+ }
+ return type;
+ },
+ separator:function() {
+ return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? ' ' : ' ';
+ },
+ indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
+ if ( !this.multiline )
+ return '';
+ var chr = this.indentChar;
+ if ( this.HTML )
+ chr = chr.replace(/\t/g,' ').replace(/ /g,' ');
+ return Array( this._depth_ + (extra||0) ).join(chr);
+ },
+ up:function( a ) {
+ this._depth_ += a || 1;
+ },
+ down:function( a ) {
+ this._depth_ -= a || 1;
+ },
+ setParser:function( name, parser ) {
+ this.parsers[name] = parser;
+ },
+ // The next 3 are exposed so you can use them
+ quote:quote,
+ literal:literal,
+ join:join,
+ //
+ _depth_: 1,
+ // This is the list of parsers, to modify them, use jsDump.setParser
+ parsers:{
+ window: '[Window]',
+ document: '[Document]',
+ error:'[ERROR]', //when no parser is found, shouldn't happen
+ unknown: '[Unknown]',
+ 'null':'null',
+ undefined:'undefined',
+ 'function':function( fn ) {
+ var ret = 'function',
+ name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
+ if ( name )
+ ret += ' ' + name;
+ ret += '(';
+
+ ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join('');
+ return join( ret, this.parse(fn,'functionCode'), '}' );
+ },
+ array: array,
+ nodelist: array,
+ arguments: array,
+ object:function( map ) {
+ var ret = [ ];
+ this.up();
+ for ( var key in map )
+ ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) );
+ this.down();
+ return join( '{', ret, '}' );
+ },
+ node:function( node ) {
+ var open = this.HTML ? '<' : '<',
+ close = this.HTML ? '>' : '>';
+
+ var tag = node.nodeName.toLowerCase(),
+ ret = open + tag;
+
+ for ( var a in this.DOMAttrs ) {
+ var val = node[this.DOMAttrs[a]];
+ if ( val )
+ ret += ' ' + a + '=' + this.parse( val, 'attribute' );
+ }
+ return ret + close + open + '/' + tag + close;
+ },
+ functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
+ var l = fn.length;
+ if ( !l ) return '';
+
+ var args = Array(l);
+ while ( l-- )
+ args[l] = String.fromCharCode(97+l);//97 is 'a'
+ return ' ' + args.join(', ') + ' ';
+ },
+ key:quote, //object calls it internally, the key part of an item in a map
+ functionCode:'[code]', //function calls it internally, it's the content of the function
+ attribute:quote, //node calls it internally, it's an html attribute value
+ string:quote,
+ date:quote,
+ regexp:literal, //regex
+ number:literal,
+ 'boolean':literal
+ },
+ DOMAttrs:{//attributes to dump from nodes, name=>realName
+ id:'id',
+ name:'name',
+ 'class':'className'
+ },
+ HTML:true,//if true, entities are escaped ( <, >, \t, space and \n )
+ indentChar:' ',//indentation unit
+ multiline:true //if true, items in a collection, are separated by a \n, else just a space.
+ };
+
+ return jsDump;
+})();
+
+})(this);
Property changes on: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/qunit.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/richfaces-qunit.js
===================================================================
--- branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/richfaces-qunit.js (rev 0)
+++ branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/richfaces-qunit.js 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,30 @@
+window.RichFaces = window.RichFaces || {};
+RichFaces.QUnit = (function(){
+ var setTestHeader = function (header) {
+ var e = document.getElementById("qunit-header");
+ e.innerHTML = header;
+ };
+
+ return {
+ appendDomElements: function (parent, html) {
+ var element = document.createElement("div");
+ element.innerHTML = html;
+ var elements = [], e;
+ while (e = element.firstChild) {
+ elements.push(e);
+ parent.appendChild(e);
+ }
+ return elements;
+ },
+ removeDomElements: function (elements) {
+ var element;
+ while (elements.length>0) {
+ element = elements.pop();
+ element.parentNode.removeChild(element);
+ }
+ },
+ run: function (f) {
+ jQuery(document).ready(f);
+ }
+ };
+}());
\ No newline at end of file
Property changes on: branches/RF-8742/examples/template/src/main/resources/META-INF/resources/qunit/richfaces-qunit.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Property changes on: branches/RF-8742/examples/template/src/main/webapp
___________________________________________________________________
Name: svn:ignore
+ META-INF
Added: branches/RF-8742/examples/template/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/RF-8742/examples/template/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ branches/RF-8742/examples/template/src/main/webapp/WEB-INF/web.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
+ <display-name>validator-demo</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
\ No newline at end of file
Property changes on: branches/RF-8742/examples/template/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/webapp/index.jsp
===================================================================
--- branches/RF-8742/examples/template/src/main/webapp/index.jsp (rev 0)
+++ branches/RF-8742/examples/template/src/main/webapp/index.jsp 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Property changes on: branches/RF-8742/examples/template/src/main/webapp/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/webapp/layout/pagesList.xhtml
===================================================================
--- branches/RF-8742/examples/template/src/main/webapp/layout/pagesList.xhtml (rev 0)
+++ branches/RF-8742/examples/template/src/main/webapp/layout/pagesList.xhtml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ >
+ <ui:composition>
+ <h:form>
+ <h:dataTable value="#{pages.xhtmlPages}" var="page">
+ <h:column>
+ <h:outputLink value="#{page.url}" >#{page.title}</h:outputLink>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: branches/RF-8742/examples/template/src/main/webapp/layout/pagesList.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/examples/template/src/main/webapp/layout/template.xhtml
===================================================================
--- branches/RF-8742/examples/template/src/main/webapp/layout/template.xhtml (rev 0)
+++ branches/RF-8742/examples/template/src/main/webapp/layout/template.xhtml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ >
+<f:view contentType="text/html">
+<h:head>
+ <title>#{title}</title>
+</h:head>
+<h:body>
+ <h:outputStylesheet name="reset-fonts-grids.css" library="com.exadel.template"/>
+ <div id="doc3" class="yui-t2">
+ <div id="hd"><ui:insert name="header" /></div>
+ <div id="bd">
+ <div id="yui-main">
+ <div class="yui-b">
+ <div class="yui-g"><!-- YOUR DATA GOES HERE --> <ui:insert
+ name="content" /></div>
+ </div>
+ </div>
+ <div class="yui-b"><!-- YOUR NAVIGATION GOES HERE --></div>
+ <ui:include src="/layout/pagesList.xhtml" /></div>
+ <div id="ft">(C) Exadel Inc. 2010</div>
+ </div>
+</h:body>
+</f:view>
+</html>
\ No newline at end of file
Property changes on: branches/RF-8742/examples/template/src/main/webapp/layout/template.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Property changes on: branches/RF-8742/examples/validator-demo
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Added: branches/RF-8742/examples/validator-demo/pom.xml
===================================================================
--- branches/RF-8742/examples/validator-demo/pom.xml (rev 0)
+++ branches/RF-8742/examples/validator-demo/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,52 @@
+<?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/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>validator-demo</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces Examples: Outputs</name>
+ <packaging>war</packaging>
+
+ <properties>
+ </properties>
+
+ <build>
+ <finalName>validator-demo</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>template</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ </dependencies>
+</project>
Property changes on: branches/RF-8742/examples/validator-demo/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Property changes on: branches/RF-8742/examples/validator-demo/src/main/webapp
___________________________________________________________________
Name: svn:ignore
+ META-INF
Added: branches/RF-8742/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/RF-8742/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ branches/RF-8742/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+
+
+</faces-config>
Property changes on: branches/RF-8742/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/svnmerge-commit-message.txt
===================================================================
--- branches/RF-8742/svnmerge-commit-message.txt (rev 0)
+++ branches/RF-8742/svnmerge-commit-message.txt 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,8 @@
+Merged revisions 19176 via svnmerge from
+https://svn.jboss.org/repos/richfaces/trunk
+
+........
+ r19176 | alexsmirnov | 2010-09-13 10:42:47 -0700 (Mon, 13 Sep 2010) | 1 line
+
+ ignore working files in svn
+........
Property changes on: branches/RF-8742/svnmerge-commit-message.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/ui/common/api/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- branches/RF-8742/ui/common/api/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ branches/RF-8742/ui/common/api/src/main/java/META-INF/MANIFEST.MF 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: branches/RF-8742/ui/common/api/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/RF-8742/ui/pom.xml
===================================================================
--- branches/RF-8742/ui/pom.xml 2010-09-13 17:48:35 UTC (rev 19179)
+++ branches/RF-8742/ui/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -16,8 +16,7 @@
write to the Free Software Foundation, Inc., 51 Franklin St,
Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
--->
-<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/xsd/maven-4.0.0.xsd">
+--><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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- This aggregator pom, is not released, and is only used to make it easy to build all of the
@@ -45,6 +44,6 @@
<module>output</module>
<module>input</module>
<module>dist</module>
- </modules>
+ <module>validator</module>
+ </modules>
</project>
-
Property changes on: branches/RF-8742/ui/validator
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Property changes on: branches/RF-8742/ui/validator/api
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Added: branches/RF-8742/ui/validator/api/pom.xml
===================================================================
--- branches/RF-8742/ui/validator/api/pom.xml (rev 0)
+++ branches/RF-8742/ui/validator/api/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-api</artifactId>
+ <name>Richfaces UI Components: validator api</name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.common</groupId>
+ <artifactId>richfaces-ui-common-api</artifactId>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/validator/api</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/validator/api</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+
+</project>
Property changes on: branches/RF-8742/ui/validator/api/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/ui/validator/api/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- branches/RF-8742/ui/validator/api/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ branches/RF-8742/ui/validator/api/src/main/java/META-INF/MANIFEST.MF 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: branches/RF-8742/ui/validator/api/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Property changes on: branches/RF-8742/ui/validator/impl
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Added: branches/RF-8742/ui/validator/impl/pom.xml
===================================================================
--- branches/RF-8742/ui/validator/impl/pom.xml (rev 0)
+++ branches/RF-8742/ui/validator/impl/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-impl</artifactId>
+ <name>Richfaces UI Components: validator impl</name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <!-- todo remove this dependency or move to test scope -->
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.common</groupId>
+ <artifactId>richfaces-ui-common-ui</artifactId>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-api</artifactId>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/validator/impl</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/validator/impl</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
Property changes on: branches/RF-8742/ui/validator/impl/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/ui/validator/pom.xml
===================================================================
--- branches/RF-8742/ui/validator/pom.xml (rev 0)
+++ branches/RF-8742/ui/validator/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+ http://www.fsf.org.
+-->
+
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-aggregator</artifactId>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: validator-aggregator</name>
+
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ <module>ui</module>
+ </modules>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/validator</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/validator</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
Property changes on: branches/RF-8742/ui/validator/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Property changes on: branches/RF-8742/ui/validator/ui
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
Added: branches/RF-8742/ui/validator/ui/pom.xml
===================================================================
--- branches/RF-8742/ui/validator/ui/pom.xml (rev 0)
+++ branches/RF-8742/ui/validator/ui/pom.xml 2010-09-13 23:04:21 UTC (rev 19180)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat, Inc.
+ and individual contributors by the @authors tag. See the copyright.txt
+ in the distribution for a full listing of individual contributors.
+ This is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version. This software is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-ui</artifactId>
+ <name>Richfaces UI Components: validator ui</name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- runtime -->
+ <dependency>
+ <groupId>org.richfaces.ui.validator</groupId>
+ <artifactId>richfaces-ui-validator-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.common</groupId>
+ <artifactId>richfaces-ui-common-ui</artifactId>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/validator/ui</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/validator/ui</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
Property changes on: branches/RF-8742/ui/validator/ui/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 3 months
JBoss Rich Faces SVN: r19179 - in branches/RF-8742: ui/input and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-09-13 13:48:35 -0400 (Mon, 13 Sep 2010)
New Revision: 19179
Modified:
branches/RF-8742/
branches/RF-8742/ui/input/
Log:
Merged revisions 19176 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r19176 | alexsmirnov | 2010-09-13 10:42:47 -0700 (Mon, 13 Sep 2010) | 1 line
ignore working files in svn
.......
Property changes on: branches/RF-8742
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-19174
+ /trunk:1-19178
Property changes on: branches/RF-8742/ui/input
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
14 years, 3 months
JBoss Rich Faces SVN: r19178 - branches/RF-8742.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-09-13 13:47:19 -0400 (Mon, 13 Sep 2010)
New Revision: 19178
Modified:
branches/RF-8742/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-19174" from
https://svn.jboss.org/repos/richfaces/trunk
Property changes on: branches/RF-8742
___________________________________________________________________
Name: svnmerge-integrated
+ /trunk:1-19174
14 years, 3 months
JBoss Rich Faces SVN: r19177 - in branches/RF-7817/push-redesign: src and 18 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-09-13 13:43:54 -0400 (Mon, 13 Sep 2010)
New Revision: 19177
Added:
branches/RF-7817/push-redesign/pom.xml
branches/RF-7817/push-redesign/src/
branches/RF-7817/push-redesign/src/main/
branches/RF-7817/push-redesign/src/main/java/
branches/RF-7817/push-redesign/src/main/java/META-INF/
branches/RF-7817/push-redesign/src/main/java/META-INF/MANIFEST.MF
branches/RF-7817/push-redesign/src/main/java/org/
branches/RF-7817/push-redesign/src/main/java/org/richfaces/
branches/RF-7817/push-redesign/src/main/java/org/richfaces/DeliveryMode.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageAttributes.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushMessage.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/UIPush.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/
branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/
branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/PushRenderer.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/
branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushAtmosphereHandler.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushServlet.java
branches/RF-7817/push-redesign/src/main/resources/
branches/RF-7817/push-redesign/src/main/resources/META-INF/
branches/RF-7817/push-redesign/src/main/resources/META-INF/faces-config.xml
branches/RF-7817/push-redesign/src/main/resources/META-INF/push.taglib.xml
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/net.java.dev.atmosphere/
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/net.java.dev.atmosphere/jquery-atmosphere.js
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.jquery/
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.jquery/jquery.js
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js
branches/RF-7817/push-redesign/src/test/
branches/RF-7817/push-redesign/src/test/java/
Log:
Initial import.
Added: branches/RF-7817/push-redesign/pom.xml
===================================================================
--- branches/RF-7817/push-redesign/pom.xml (rev 0)
+++ branches/RF-7817/push-redesign/pom.xml 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,58 @@
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>push-redesign</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>push-redesign</name>
+ <url>http://maven.apache.org</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>3.0-alpha-1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.atmosphere</groupId>
+ <artifactId>atmosphere-runtime</artifactId>
+ <version>0.6.1</version>
+ </dependency>
+ </dependencies>
+</project>
Added: branches/RF-7817/push-redesign/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/META-INF/MANIFEST.MF 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/DeliveryMode.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/DeliveryMode.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/DeliveryMode.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+//TODO - do we need this?
+public enum DeliveryMode {
+
+ nonPersistent, persistent
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageAttributes.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageAttributes.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageAttributes.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class MessageAttributes {
+
+ private TopicKey topic;
+
+ public TopicKey getTopic() {
+ return topic;
+ }
+
+ public void setTopic(TopicKey topic) {
+ this.topic = topic;
+ }
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/MessageFilter.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface MessageFilter {
+
+ public boolean accept(MessageAttributes attributes, Object message);
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/SubscriberKey.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class SubscriberKey {
+
+ private String uuid;
+
+ /**
+ * @param uuid
+ */
+ public SubscriberKey(String uuid) {
+ super();
+ this.uuid = uuid;
+ }
+
+ /**
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ SubscriberKey other = (SubscriberKey) obj;
+ if (uuid == null) {
+ if (other.uuid != null) {
+ return false;
+ }
+ } else if (!uuid.equals(other.uuid)) {
+ return false;
+ }
+ return true;
+ }
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/TopicKey.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class TopicKey {
+
+ private String topicName;
+
+ public TopicKey(String topicName) {
+ super();
+ this.topicName = topicName;
+ }
+
+ /**
+ * @return the topicName
+ */
+ public String getTopicName() {
+ return topicName;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((topicName == null) ? 0 : topicName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ TopicKey other = (TopicKey) obj;
+ if (topicName == null) {
+ if (other.topicName != null) {
+ return false;
+ }
+ } else if (!topicName.equals(other.topicName)) {
+ return false;
+ }
+ return true;
+ }
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushMessage.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushMessage.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushMessage.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import org.richfaces.TopicKey;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public final class PushMessage {
+
+ private TopicKey topicKey;
+
+ private Object data;
+
+ public PushMessage(TopicKey topicKey, Object data) {
+ super();
+ this.topicKey = topicKey;
+ this.data = data;
+ }
+
+ public TopicKey getTopicKey() {
+ return topicKey;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/PushPublisherContext.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application;
+
+import org.richfaces.DeliveryMode;
+import org.richfaces.MessageAttributes;
+import org.richfaces.TopicKey;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface PushPublisherContext {
+
+ //TODO - return Future?
+ //TODO - use topic key?
+ public void publish(TopicKey topic, Object message);
+
+ //TODO - return Future?
+ //TODO - use topic key?
+ //TODO - priority?
+ public void publish(MessageAttributes attributes, Object message, long ttl, DeliveryMode deliveryMode);
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushPublisherContextImpl.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application.impl;
+
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.atmosphere.cpr.AtmosphereResource;
+import org.richfaces.DeliveryMode;
+import org.richfaces.MessageAttributes;
+import org.richfaces.TopicKey;
+import org.richfaces.application.PushPublisherContext;
+import org.richfaces.component.PushSubscriberContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean(eager = true, name = "__pushPublisherContext")
+@ApplicationScoped
+public class PushPublisherContextImpl implements PushPublisherContext {
+
+ @ManagedProperty(value = "#{__pushSubscriberContext}")
+ private PushSubscriberContext<AtmosphereResource<?, ?>> subscriberContext;
+
+ public void setSubscriberContext(PushSubscriberContext<AtmosphereResource<?, ?>> subscriberContext) {
+ this.subscriberContext = subscriberContext;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.application.PushPublisherContext#publish(java.lang.String, java.lang.Object)
+ */
+ public void publish(TopicKey topic, Object message) {
+ // TODO Auto-generated method stub
+ FacesContext context = FacesContext.getCurrentInstance();
+ HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
+ HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.application.PushPublisherContext#publish(org.richfaces.MessageAttributes, java.lang.Object, long, org.richfaces.DeliveryMode)
+ */
+ public void publish(MessageAttributes attributes, Object message, long ttl, DeliveryMode deliveryMode) {
+ throw new UnsupportedOperationException();
+ }
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/impl/PushSubscriberContextImpl.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.application.impl;
+
+import java.util.Collection;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+
+import org.atmosphere.cpr.AtmosphereResource;
+import org.richfaces.MessageFilter;
+import org.richfaces.SubscriberKey;
+import org.richfaces.TopicKey;
+import org.richfaces.component.PushSubscriberContext;
+
+import com.google.common.base.Function;
+import com.google.common.collect.MapMaker;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ApplicationScoped
+@ManagedBean(eager = true, name = "__pushSubscriberContext")
+public class PushSubscriberContextImpl implements PushSubscriberContext<AtmosphereResource<?, ?>> {
+
+ private ConcurrentMap<SubscriberKey, TopicKey> subscribers = new ConcurrentHashMap<SubscriberKey, TopicKey>();
+
+ private ConcurrentMap<TopicKey, Collection<AtmosphereResource<?, ?>>> requests = new MapMaker().makeComputingMap(new Function<TopicKey, Collection<AtmosphereResource<?, ?>>>() {
+ public Collection<org.atmosphere.cpr.AtmosphereResource<?,?>> apply(TopicKey from) {
+ return new CopyOnWriteArrayList<AtmosphereResource<?,?>>();
+ };
+ });
+
+ public void subscribe(SubscriberKey subscriberKey, TopicKey topicKey) {
+ subscribers.put(subscriberKey, topicKey);
+ }
+
+ public void subscribe(SubscriberKey subscriberKey, TopicKey topic, MessageFilter filter) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic, MessageFilter filter) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void unsubscribe(SubscriberKey subscriberKey) {
+ subscribers.remove(subscriberKey);
+ }
+
+ public void onConnect(SubscriberKey subscriberKey, AtmosphereResource<?, ?> resource) {
+ TopicKey topicKey = subscribers.get(subscriberKey);
+ if (topicKey == null) {
+ //TODO - handle
+ }
+
+ requests.get(topicKey).add(resource);
+ }
+
+ public void onDisconnect(SubscriberKey subscriberKey, AtmosphereResource<?, ?> resource) {
+ // TODO Auto-generated method stub
+
+ TopicKey topicKey = subscribers.get(subscriberKey);
+ if (topicKey == null) {
+ //TODO - handle
+ }
+
+ requests.get(topicKey).remove(resource);
+ }
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/PushSubscriberContext.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import org.richfaces.MessageFilter;
+import org.richfaces.SubscriberKey;
+import org.richfaces.TopicKey;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface PushSubscriberContext<T> {
+
+ public static final String PUSH_PATH = "rf-hub";
+
+ public void subscribe(SubscriberKey subscriberKey, TopicKey topic);
+
+ public void subscribe(SubscriberKey subscriberKey, TopicKey topic, MessageFilter filter);
+
+ public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic);
+
+ public void subscribeDurably(SubscriberKey subscriberKey, TopicKey topic, MessageFilter filter);
+
+ public void unsubscribe(SubscriberKey subscriberKey);
+
+ public void onConnect(SubscriberKey subscriberKey, T resource);
+
+ public void onDisconnect(SubscriberKey subscriberKey, T resource);
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/UIPush.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/UIPush.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/component/UIPush.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class UIPush extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Push";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Push";
+
+ private enum PropertyKeys {
+ topic
+ }
+
+ public UIPush() {
+ setRendererType("org.richfaces.Push");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public String getTopic() {
+ return (String) getStateHelper().eval(PropertyKeys.topic);
+ }
+
+ public void setTopic(String topic) {
+ getStateHelper().put(PropertyKeys.topic, topic);
+ }
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/PushRenderer.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/PushRenderer.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/renderkit/html/PushRenderer.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.Renderer;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.richfaces.SubscriberKey;
+import org.richfaces.TopicKey;
+import org.richfaces.component.PushSubscriberContext;
+import org.richfaces.component.UIPush;
+import org.richfaces.renderkit.HtmlConstants;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ResourceDependencies({
+ @ResourceDependency(library = "org.jquery", name = "jquery.js"),
+ @ResourceDependency(library = "net.java.dev.atmosphere", name = "jquery-atmosphere.js"),
+ @ResourceDependency(library = "org.richfaces", name = "push.js")
+})
+public class PushRenderer extends Renderer {
+
+ private static final String PUSH_PID_ATTRIBUTE = "org.richfaces.PushPID";
+
+ private String getPushId(FacesContext context) {
+ Map<String, Object> viewMap = context.getViewRoot().getViewMap();
+ String pid = (String) viewMap.get(PUSH_PID_ATTRIBUTE);
+ if (pid == null) {
+ pid = UUID.randomUUID().toString();
+ viewMap.put(PUSH_PID_ATTRIBUTE, pid);
+ }
+
+ return pid;
+ }
+
+ private String getPushUrl(FacesContext context, String pushId) {
+ ExternalContext ec = context.getExternalContext();
+
+ return MessageFormat.format("{0}://{1}:{2,number,#####}{3}/atmosphere/{4}/?pid={5}",
+ ec.getRequestScheme(), ec.getRequestServerName(),
+ ec.getRequestServerPort(), ec.getRequestContextPath(),
+ PushSubscriberContext.PUSH_PATH, pushId);
+ }
+
+ private PushSubscriberContext getPushSubscriberContext(FacesContext context) {
+ return (PushSubscriberContext) context.getExternalContext().getApplicationMap().get("__pushSubscriberContext");
+ }
+
+ @Override
+ public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+ super.encodeEnd(context, component);
+
+ UIPush push = (UIPush) component;
+
+ ResponseWriter writer = context.getResponseWriter();
+
+ writer.startElement(HtmlConstants.SPAN_ELEM, component);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getClientId(context), "id");
+
+ String pushId = getPushId(context);
+
+ writer.startElement(HtmlConstants.SCRIPT_ELEM, component);
+ writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.TEXT_JAVASCRIPT_TYPE, null);
+
+ writer.writeText(new JSFunction("Push.connect", getPushUrl(context, pushId)).toScript(), null);
+
+ writer.endElement(HtmlConstants.SCRIPT_ELEM);
+
+ writer.endElement(HtmlConstants.SPAN_ELEM);
+
+ getPushSubscriberContext(context).subscribe(new SubscriberKey(pushId), new TopicKey(push.getTopic()));
+ }
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushAtmosphereHandler.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushAtmosphereHandler.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushAtmosphereHandler.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.webapp;
+
+import java.io.IOException;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.atmosphere.cpr.AtmosphereHandler;
+import org.atmosphere.cpr.AtmosphereResource;
+import org.atmosphere.cpr.AtmosphereResourceEvent;
+import org.richfaces.SubscriberKey;
+import org.richfaces.component.PushSubscriberContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PushAtmosphereHandler implements AtmosphereHandler<HttpServletRequest, HttpServletResponse> {
+
+ private PushSubscriberContext<AtmosphereResource<?, ?>> subscriberContext;
+
+ public PushAtmosphereHandler(ServletContext servletContext) {
+ super();
+
+ this.subscriberContext = (PushSubscriberContext<AtmosphereResource<?, ?>>) servletContext.getAttribute("__pushSubscriberContext");
+ }
+
+ private SubscriberKey getSubscriberKey(HttpServletRequest request) {
+ return new SubscriberKey(request.getParameter("pid"));
+ }
+
+ public void onRequest(AtmosphereResource<HttpServletRequest, HttpServletResponse> resource) throws IOException {
+ // TODO Auto-generated method stub
+ subscriberContext.onConnect(getSubscriberKey(resource.getRequest()), resource);
+
+ resource.suspend();
+ }
+
+ public void onStateChange(AtmosphereResourceEvent<HttpServletRequest, HttpServletResponse> event)
+ throws IOException {
+ // TODO Auto-generated method stub
+
+ if (event.isCancelled()) {
+ AtmosphereResource<HttpServletRequest, HttpServletResponse> resource = event.getResource();
+ subscriberContext.onDisconnect(getSubscriberKey(resource.getRequest()), resource);
+ }
+ }
+
+
+}
Added: branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushServlet.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushServlet.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/webapp/PushServlet.java 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.webapp;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URLClassLoader;
+
+import javax.servlet.ServletContext;
+
+import org.atmosphere.cpr.AtmosphereServlet;
+import org.atmosphere.cpr.DefaultBroadcaster;
+import org.richfaces.component.PushSubscriberContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PushServlet extends AtmosphereServlet {
+
+ private static final long serialVersionUID = 7616370505508715222L;
+
+ public PushServlet() {
+ super();
+ }
+
+ @Override
+ protected void autoDetectAtmosphereHandlers(ServletContext sc, URLClassLoader c) throws MalformedURLException,
+ URISyntaxException {
+ super.autoDetectAtmosphereHandlers(sc, c);
+
+ addAtmosphereHandler("/atmosphere/" + PushSubscriberContext.PUSH_PATH + "/*", new PushAtmosphereHandler(sc), new DefaultBroadcaster());
+ }
+}
Added: branches/RF-7817/push-redesign/src/main/resources/META-INF/faces-config.xml
===================================================================
--- branches/RF-7817/push-redesign/src/main/resources/META-INF/faces-config.xml (rev 0)
+++ branches/RF-7817/push-redesign/src/main/resources/META-INF/faces-config.xml 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+
+ <managed-bean eager="true">
+ <managed-bean-name>__pushSubscriberContext</managed-bean-name>
+ <managed-bean-class>org.richfaces.application.impl.PushSubscriberContextImpl</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+
+ <component>
+ <component-type>org.richfaces.Push</component-type>
+ <component-class>org.richfaces.component.UIPush</component-class>
+ </component>
+
+ <render-kit>
+ <renderer>
+ <component-family>org.richfaces.Push</component-family>
+ <renderer-type>org.richfaces.PushRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.PushRenderer</renderer-class>
+ </renderer>
+ </render-kit>
+
+</faces-config>
Added: branches/RF-7817/push-redesign/src/main/resources/META-INF/push.taglib.xml
===================================================================
--- branches/RF-7817/push-redesign/src/main/resources/META-INF/push.taglib.xml (rev 0)
+++ branches/RF-7817/push-redesign/src/main/resources/META-INF/push.taglib.xml 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
+ version="2.0" id="a4j">
+ <namespace>http://richfaces.org/push</namespace>
+
+ <tag>
+ <tag-name>push</tag-name>
+ <component>
+ <component-type>org.richfaces.Push</component-type>
+ <renderer-type>org.richfaces.PushRenderer</renderer-type>
+ </component>
+ </tag>
+</facelet-taglib>
Added: branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/net.java.dev.atmosphere/jquery-atmosphere.js
===================================================================
--- branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/net.java.dev.atmosphere/jquery-atmosphere.js (rev 0)
+++ branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/net.java.dev.atmosphere/jquery-atmosphere.js 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,508 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+jQuery.atmosphere = function() {
+ var activeRequest;
+ $(window).unload(function() {
+ if (activeRequest)
+ activeRequest.abort();
+ });
+
+ return {
+ version : 0.7,
+ response : {
+ status : 200,
+ responseBody : '',
+ headers : [],
+ state : "messageReceived",
+ transport : "polling",
+ push : [],
+ error : null,
+ id : 0
+ },
+
+ request : {},
+ logLevel : 'info',
+ callbacks : [],
+ activeTransport : null,
+ websocket : null,
+ killHiddenIFrame : null,
+
+ subscribe : function(url, callback, request) {
+ jQuery.atmosphere.request = jQuery.extend({
+ timeout : 300000,
+ method : 'GET',
+ headers : {},
+ contentType : "text/html;charset=ISO-8859-1",
+ cache : true,
+ async : true,
+ ifModified : false,
+ callback : null,
+ dataType : '',
+ url : url,
+ data : '',
+ suspend : true,
+ maxRequest : 60,
+ lastIndex : 0,
+ logLevel : 'info',
+ requestCount : 0,
+ fallbackTransport : 'streaming',
+ transport : 'long-polling'
+
+ }, request);
+
+ logLevel = jQuery.atmosphere.request.logLevel || 'info';
+ if (callback != null) {
+ jQuery.atmosphere.addCallback(callback);
+ jQuery.atmosphere.request.callback = callback;
+ }
+
+ if (jQuery.atmosphere.request.transport != jQuery.atmosphere.activeTransport) {
+ jQuery.atmosphere.closeSuspendedConnection();
+ }
+ jQuery.atmosphere.activeTransport = jQuery.atmosphere.request.transport;
+
+ if (jQuery.atmosphere.request.transport != 'websocket') {
+ jQuery.atmosphere.executeRequest();
+ } else if (jQuery.atmosphere.request.transport == 'websocket') {
+ if (!window.WebSocket) {
+ jQuery.atmosphere
+ .log(
+ logLevel,
+ [ "Websocket is not supported, using request.fallbackTransport" ]);
+ jQuery.atmosphere.request.transport = jQuery.atmosphere.request.fallbackTransport;
+ jQuery.atmosphere.executeRequest();
+ } else {
+ jQuery.atmosphere.executeWebSocket();
+ }
+ }
+ },
+
+ /**
+ * Always make sure one transport is used, not two at the same time except for Websocket.
+ */
+ closeSuspendedConnection : function() {
+ if (activeRequest != null) {
+ activeRequest.abort();
+ }
+
+ if (jQuery.atmosphere.websocket != null) {
+ jQuery.atmosphere.websocket.close();
+ jQuery.atmosphere.websocket = null;
+ }
+ },
+
+ executeRequest : function() {
+
+ if (jQuery.atmosphere.request.transport == 'streaming') {
+ if ($.browser.msie) {
+ jQuery.atmosphere.ieStreaming();
+ return;
+ } else if ((typeof window.addEventStream) == 'function') {
+ jQuery.atmosphere.operaStreaming();
+ return;
+ }
+ }
+
+ if (jQuery.atmosphere.request.requestCount++ < jQuery.atmosphere.request.maxRequest) {
+ jQuery.atmosphere.response.push = function(url) {
+ jQuery.atmosphere.request.callback = null;
+ jQuery.atmosphere.publish(url, null,
+ jQuery.atmosphere.request);
+ };
+
+ var request = jQuery.atmosphere.request;
+ var response = jQuery.atmosphere.response;
+ if (request.transport != 'polling') {
+ response.transport = request.transport;
+ }
+
+ var ajaxRequest;
+ var error = false;
+ if ($.browser.msie) {
+ var activexmodes = [ "Msxml2.XMLHTTP", "Microsoft.XMLHTTP" ]
+ for ( var i = 0; i < activexmodes.length; i++) {
+ try {
+ ajaxRequest = new ActiveXObject(activexmodes[i])
+ } catch (e) {
+ }
+ }
+ } else if (window.XMLHttpRequest) {
+ ajaxRequest = new XMLHttpRequest();
+ }
+
+ if (request.suspend) {
+ activeRequest = ajaxRequest;
+ }
+
+ ajaxRequest.open(request.method, request.url, true);
+ ajaxRequest.setRequestHeader("X-Atmosphere-Framework",
+ jQuery.atmosphere.version);
+ ajaxRequest.setRequestHeader("X-Atmosphere-Transport",
+ request.transport);
+ ajaxRequest.setRequestHeader("X-Cache-Date", new Date());
+
+ if (!$.browser.msie) {
+ ajaxRequest.onerror = function() {
+ error = true;
+ try {
+ response.status = XMLHttpRequest.status;
+ } catch (e) {
+ response.status = 404;
+ }
+
+ response.state = "error";
+ jQuery.atmosphere.invokeCallback(response);
+ ajaxRequest.abort();
+ activeRequest = null;
+ }
+ }
+
+ ajaxRequest.onreadystatechange = function() {
+ var junkForWebkit = false;
+ var update = false;
+ if (ajaxRequest.readyState == 4) {
+ jQuery.atmosphere.request = request;
+ if (request.suspend && ajaxRequest.status == 200) {
+ jQuery.atmosphere.executeRequest();
+ }
+
+ if ($.browser.msie) {
+ update = true;
+ }
+ } else if (!$.browser.msie && ajaxRequest.readyState == 3
+ && ajaxRequest.status == 200) {
+ update = true;
+ } else {
+ clearTimeout(request.id);
+ }
+
+ if (update) {
+ if (request.transport == 'streaming') {
+ response.responseBody = ajaxRequest.responseText
+ .substring(request.lastIndex,
+ ajaxRequest.responseText.length);
+ request.lastIndex = ajaxRequest.responseText.length;
+
+ if (response.responseBody.indexOf("<!--") != -1) {
+ junkForWebkit = true;
+ }
+
+ } else {
+ response.responseBody = ajaxRequest.responseText;
+ }
+
+ if (response.responseBody.indexOf("parent.callback") != -1) {
+ var start = response.responseBody.indexOf("('") + 2;
+ var end = response.responseBody.indexOf("')");
+ response.responseBody = response.responseBody
+ .substring(start, end);
+ }
+
+ if (junkForWebkit)
+ return;
+
+ try {
+ response.status = ajaxRequest.status;
+ response.headers = ajaxRequest
+ .getAllResponseHeaders();
+ } catch (e) {
+ response.status = 404;
+ }
+
+ if (request.suspend) {
+ response.state = "messageReceived";
+ } else {
+ response.state = "messagePublished";
+ }
+ jQuery.atmosphere.invokeCallback(response);
+ }
+ }
+ ajaxRequest.send(request.data);
+
+ if (request.suspend) {
+ request.id = setTimeout(
+ function() {
+ ajaxRequest.abort();
+ jQuery.atmosphere.subscribe(request.url, null,
+ request);
+
+ }, request.timeout);
+ }
+ } else {
+ jQuery.atmosphere.log(logLevel,
+ [ "Max re-connection reached." ]);
+ }
+ },
+
+ operaStreaming : function() {
+
+ var url = jQuery.atmosphere.request.url;
+ var es = document.createElement('event-source');
+ var response = jQuery.atmosphere.response;
+
+ jQuery.atmosphere.response.push = function(url) {
+ jQuery.atmosphere.request.transport = 'polling';
+ jQuery.atmosphere.request.callback = null;
+ jQuery.atmosphere.publish(url, null, jQuery.atmosphere.request);
+ };
+
+ es.setAttribute('src', url);
+ // without this check opera 9.5 would make two connections.
+ if (opera.version() < 9.5) {
+ document.body.appendChild(es);
+ }
+
+ var operaCallback = function(event) {
+ if (event.data) {
+ var junkForWebkit = false;
+
+ response.responseBody = event.data;
+ if (event.data.indexOf("<!--") != -1) {
+ junkForWebkit = true;
+ }
+
+ if (response.responseBody.indexOf("parent.callback") != -1) {
+ var start = response.responseBody.indexOf("('") + 2;
+ var end = response.responseBody.indexOf("')");
+ response.responseBody = response.responseBody
+ .substring(start, end);
+ }
+
+ if (junkForWebkit)
+ return;
+
+ response.state = "messageReceived";
+ jQuery.atmosphere.invokeCallback(response);
+ }
+ };
+
+ es.addEventListener('payload', operaCallback, false);
+
+ },
+
+ ieStreaming : function() {
+ var url = jQuery.atmosphere.request.url;
+ jQuery.atmosphere.response.push = function(url) {
+ jQuery.atmosphere.request.transport = 'polling';
+ jQuery.atmosphere.request.callback = null;
+ jQuery.atmosphere.publish(url, null, jQuery.atmosphere.request);
+ };
+
+ transferDoc = new ActiveXObject("htmlfile");
+ transferDoc.open();
+ transferDoc.close();
+ var ifrDiv = transferDoc.createElement("div");
+ transferDoc.body.appendChild(ifrDiv);
+ ifrDiv.innerHTML = "<iframe src='" + url + "'></iframe>";
+ transferDoc.parentWindow.callback = jQuery.atmosphere.streamingCallback;
+ },
+
+ streamingCallback : function(args) {
+ var response = jQuery.atmosphere.response;
+ response.transport = "streaming";
+ response.status = 200;
+ response.responseBody = args;
+ response.state = "messageReceived";
+
+ jQuery.atmosphere.invokeCallback(response);
+ },
+
+ executeWebSocket : function() {
+ var request = jQuery.atmosphere.request;
+ jQuery.atmosphere.log(logLevel, [ "Invoking executeWebSocket" ]);
+ jQuery.atmosphere.response.transport = "websocket";
+ var url = jQuery.atmosphere.request.url;
+ var callback = jQuery.atmosphere.request.callback;
+ var location = url.replace('http:', 'ws:')
+ .replace('https:', 'wss:');
+
+ var websocket = new WebSocket(location);
+ jQuery.atmosphere.websocket = websocket;
+
+ jQuery.atmosphere.response.push = function(url) {
+ var data;
+ var ws = jQuery.atmosphere.websocket;
+ try {
+ data = jQuery.atmosphere.request.data;
+ ws.send(jQuery.atmosphere.request.data);
+ } catch (e) {
+ jQuery.atmosphere
+ .log(
+ logLevel,
+ [ "Websocket failed. Downgrading to Comet and resending "
+ + data ]);
+ // Websocket is not supported, reconnect using the fallback transport.
+ request.transport = request.fallbackTransport;
+ jQuery.atmosphere.request = request;
+ jQuery.atmosphere.executeRequest();
+
+ // Repost the data.
+ jQuery.atmosphere.request.suspend = false;
+ jQuery.atmosphere.request.method = 'POST';
+ jQuery.atmosphere.request.data = data;
+ jQuery.atmosphere.response.state = 'messageReceived';
+ jQuery.atmosphere.response.transport = request.fallbackTransport;
+ jQuery.atmosphere.publish(url, null,
+ jQuery.atmosphere.request);
+
+ ws.onclose = function(message) {
+ }
+ ws.close();
+ }
+ };
+
+ websocket.onopen = function(message) {
+ jQuery.atmosphere.response.state = 'openning';
+ jQuery.atmosphere.invokeCallback(jQuery.atmosphere.response);
+ };
+
+ websocket.onmessage = function(message) {
+ var data = message.data;
+ if (data.indexOf("parent.callback") != -1) {
+ var start = data.indexOf("('") + 2;
+ var end = data.indexOf("')");
+ jQuery.atmosphere.response.responseBody = data.substring(
+ start, end);
+ } else {
+ jQuery.atmosphere.response.responseBody = data;
+ }
+ jQuery.atmosphere.invokeCallback(jQuery.atmosphere.response);
+ };
+
+ websocket.onerror = function(message) {
+ jQuery.atmosphere.response.state = 'error';
+ jQuery.atmosphere.invokeCallback(jQuery.atmosphere.response);
+ };
+
+ websocket.onclose = function(message) {
+ jQuery.atmosphere.response.state = 'closed';
+ jQuery.atmosphere.invokeCallback(jQuery.atmosphere.response);
+ };
+ },
+
+ addCallback : function(func) {
+ if (jQuery.inArray(func, jQuery.atmosphere.callbacks) == -1) {
+ jQuery.atmosphere.callbacks.push(func);
+ }
+ },
+
+ removeCallback : function(func) {
+ if (jQuery.inArray(func, jQuery.atmosphere.callbacks) != -1) {
+ jQuery.atmosphere.callbacks.splice(index);
+ }
+ },
+
+ invokeCallback : function(response) {
+ var call = function(index, func) {
+ func(response);
+ };
+
+ jQuery.atmosphere.log(logLevel, [ "Invoking "
+ + jQuery.atmosphere.callbacks.length + " callbacks" ]);
+ if (jQuery.atmosphere.callbacks.length > 0) {
+ jQuery.each(jQuery.atmosphere.callbacks, call);
+ }
+ },
+
+ publish : function(url, callback, request) {
+ jQuery.atmosphere.request = jQuery.extend({
+ connected : false,
+ timeout : 60000,
+ method : 'POST',
+ headers : {},
+ cache : true,
+ async : true,
+ ifModified : false,
+ callback : null,
+ dataType : '',
+ url : url,
+ data : '',
+ suspend : false,
+ maxRequest : 60,
+ logLevel : 'info',
+ requestCount : 0,
+ transport : 'polling'
+ }, request);
+
+ if (callback != null) {
+ jQuery.atmosphere.addCallback(callback);
+ }
+ jQuery.atmosphere.request.transport = 'polling';
+ if (jQuery.atmosphere.request.transport != 'websocket') {
+ jQuery.atmosphere.executeRequest();
+ } else if (jQuery.atmosphere.request.transport == 'websocket') {
+ if (!window.WebSocket) {
+ alert("WebSocket not supported by this browser");
+ } else {
+ jQuery.atmosphere.executeWebSocket();
+ }
+ }
+ },
+
+ unload : function(arg) {
+ if (window.addEventListener) {
+ document.addEventListener('unload', arg, false);
+ window.addEventListener('unload', arg, false);
+ } else { // IE
+ document.attachEvent('onunload', arg);
+ window.attachEvent('onunload', arg);
+ }
+ },
+
+ kill_load_bar : function() {
+ if (jQuery.atmosphere.killHiddenIFrame == null) {
+ jQuery.atmosphere.killHiddenIFrame = document
+ .createElement('iframe');
+ var ifr = jQuery.atmosphere.killHiddenIFrame;
+ ifr.style.display = 'block';
+ ifr.style.width = '0';
+ ifr.style.height = '0';
+ ifr.style.border = '0';
+ ifr.style.margin = '0';
+ ifr.style.padding = '0';
+ ifr.style.overflow = 'hidden';
+ ifr.style.visibility = 'hidden';
+ }
+ document.body.appendChild(ifr);
+ ifr.src = 'about:blank';
+ document.body.removeChild(ifr);
+ },
+
+ log : function(level, args) {
+ if (window.console) {
+ var logger = window.console[level];
+ if (typeof logger == 'function') {
+ logger.apply(window.console, args);
+ }
+ }
+ },
+
+ warn : function() {
+ log('warn', arguments);
+ },
+
+ info : function() {
+ if (logLevel != 'warn') {
+ log('info', arguments);
+ }
+ },
+
+ debug : function() {
+ if (logLevel == 'debug') {
+ log('debug', arguments);
+ }
+ }
+ }
+
+}();
Added: branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.jquery/jquery.js
===================================================================
--- branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.jquery/jquery.js (rev 0)
+++ branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.jquery/jquery.js 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,6240 @@
+/*!
+ * jQuery JavaScript Library v1.4.2
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Sat Feb 13 22:33:48 2010 -0500
+ */
+(function( window, undefined ) {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
+
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/,
+
+ // Check if a string has a non-whitespace character in it
+ rnotwhite = /\S/,
+
+ // Used for trimming whitespace
+ rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+ // Keep a UserAgent string for use with jQuery.browser
+ userAgent = navigator.userAgent,
+
+ // For matching the engine and version of the browser
+ browserMatch,
+
+ // Has the ready events already been bound?
+ readyBound = false,
+
+ // The functions to execute on DOM ready
+ readyList = [],
+
+ // The ready event handler
+ DOMContentLoaded,
+
+ // Save a reference to some core methods
+ toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ push = Array.prototype.push,
+ slice = Array.prototype.slice,
+ indexOf = Array.prototype.indexOf;
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), or $(undefined)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // The body element only exists once, optimize finding it
+ if ( selector === "body" && !context ) {
+ this.context = document;
+ this[0] = document.body;
+ this.selector = "body";
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ doc = (context ? context.ownerDocument || context : document);
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ ret = rsingleTag.exec( selector );
+
+ if ( ret ) {
+ if ( jQuery.isPlainObject( context ) ) {
+ selector = [ document.createElement( ret[1] ) ];
+ jQuery.fn.attr.call( selector, context, true );
+
+ } else {
+ selector = [ doc.createElement( ret[1] ) ];
+ }
+
+ } else {
+ ret = buildFragment( [ match[1] ], [ doc ] );
+ selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $("#id")
+ } else {
+ elem = document.getElementById( match[2] );
+
+ if ( elem ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $("TAG")
+ } else if ( !context && /^\w+$/.test( selector ) ) {
+ this.selector = selector;
+ this.context = document;
+ selector = document.getElementsByTagName( selector );
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return (context || rootjQuery).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return jQuery( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if (selector.selector !== undefined) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.4.2",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return slice.call( this, 0 );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Attach the listeners
+ jQuery.bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady ) {
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ } else if ( readyList ) {
+ // Add the function to the wait list
+ readyList.push( fn );
+ }
+
+ return this;
+ },
+
+ eq: function( i ) {
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, +i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ),
+ "slice", slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || jQuery(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging object literal values or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
+ var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
+ : jQuery.isArray(copy) ? [] : {};
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // Handle when the DOM is ready
+ ready: function() {
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.isReady ) {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 13 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If there are functions bound, to execute
+ if ( readyList ) {
+ // Execute all of them
+ var fn, i = 0;
+ while ( (fn = readyList[ i++ ]) ) {
+ fn.call( document, jQuery );
+ }
+
+ // Reset the list of functions
+ readyList = null;
+ }
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ }
+ }
+ },
+
+ bindReady: function() {
+ if ( readyBound ) {
+ return;
+ }
+
+ readyBound = true;
+
+ // Catch cases where $(document).ready() is called after the
+ // browser event has already occurred.
+ if ( document.readyState === "complete" ) {
+ return jQuery.ready();
+ }
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var toplevel = false;
+
+ try {
+ toplevel = window.frameElement == null;
+ } catch(e) {}
+
+ if ( document.documentElement.doScroll && toplevel ) {
+ doScrollCheck();
+ }
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return toString.call(obj) === "[object Function]";
+ },
+
+ isArray: function( obj ) {
+ return toString.call(obj) === "[object Array]";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor
+ && !hasOwnProperty.call(obj, "constructor")
+ && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwnProperty.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw msg;
+ },
+
+ parseJSON: function( data ) {
+ if ( typeof data !== "string" || !data ) {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
+
+ // Try to use the native JSON parser first
+ return window.JSON && window.JSON.parse ?
+ window.JSON.parse( data ) :
+ (new Function("return " + data))();
+
+ } else {
+ jQuery.error( "Invalid JSON: " + data );
+ }
+ },
+
+ noop: function() {},
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && rnotwhite.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom...
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+
+ if ( jQuery.support.scriptEval ) {
+ script.appendChild( document.createTextNode( data ) );
+ } else {
+ script.text = data;
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0,
+ length = object.length,
+ isObj = length === undefined || jQuery.isFunction(object);
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.apply( object[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( object[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in object ) {
+ if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+ }
+ }
+
+ return object;
+ },
+
+ trim: function( text ) {
+ return (text || "").replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( array, results ) {
+ var ret = results || [];
+
+ if ( array != null ) {
+ // The window, strings (and functions) also have 'length'
+ // The extra typeof function check is to prevent crashes
+ // in Safari 2 (See: #3039)
+ if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
+ push.call( ret, array );
+ } else {
+ jQuery.merge( ret, array );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ if ( array.indexOf ) {
+ return array.indexOf( elem );
+ }
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[ i ] === elem ) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var i = first.length, j = 0;
+
+ if ( typeof second.length === "number" ) {
+ for ( var l = second.length; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [];
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ if ( !inv !== !callback( elems[ i ], i ) ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var ret = [], value;
+
+ // Go through the array, translating each of the items to their
+ // new value (or values).
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ proxy: function( fn, proxy, thisObject ) {
+ if ( arguments.length === 2 ) {
+ if ( typeof proxy === "string" ) {
+ thisObject = fn;
+ fn = thisObject[ proxy ];
+ proxy = undefined;
+
+ } else if ( proxy && !jQuery.isFunction( proxy ) ) {
+ thisObject = proxy;
+ proxy = undefined;
+ }
+ }
+
+ if ( !proxy && fn ) {
+ proxy = function() {
+ return fn.apply( thisObject || this, arguments );
+ };
+ }
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ if ( fn ) {
+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ }
+
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
+ // Use of jQuery.browser is frowned upon.
+ // More details: http://docs.jquery.com/Utilities/jQuery.browser
+ uaMatch: function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
+ /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
+ /(msie) ([\w.]+)/.exec( ua ) ||
+ !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
+ [];
+
+ return { browser: match[1] || "", version: match[2] || "0" };
+ },
+
+ browser: {}
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+ jQuery.browser[ browserMatch.browser ] = true;
+ jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+ jQuery.browser.safari = true;
+}
+
+if ( indexOf ) {
+ jQuery.inArray = function( elem, array ) {
+ return indexOf.call( array, elem );
+ };
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ };
+
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ };
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+ if ( jQuery.isReady ) {
+ return;
+ }
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch( error ) {
+ setTimeout( doScrollCheck, 1 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+}
+
+function evalScript( i, elem ) {
+ if ( elem.src ) {
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+ } else {
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
+
+// Mutifunctional method to get and set values to a collection
+// The value/s can be optionally by executed if its a function
+function access( elems, key, value, exec, fn, pass ) {
+ var length = elems.length;
+
+ // Setting many attributes
+ if ( typeof key === "object" ) {
+ for ( var k in key ) {
+ access( elems, k, key[k], exec, fn, value );
+ }
+ return elems;
+ }
+
+ // Setting one attribute
+ if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = !pass && exec && jQuery.isFunction(value);
+
+ for ( var i = 0; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+
+ return elems;
+ }
+
+ // Getting an attribute
+ return length ? fn( elems[0], key ) : undefined;
+}
+
+function now() {
+ return (new Date).getTime();
+}
+(function() {
+
+ jQuery.support = {};
+
+ var root = document.documentElement,
+ script = document.createElement("script"),
+ div = document.createElement("div"),
+ id = "script" + now();
+
+ div.style.display = "none";
+ div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+ var all = div.getElementsByTagName("*"),
+ a = div.getElementsByTagName("a")[0];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return;
+ }
+
+ jQuery.support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: div.firstChild.nodeType === 3,
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText insted)
+ style: /red/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: a.getAttribute("href") === "/a",
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.55$/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: div.getElementsByTagName("input")[0].value === "on",
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
+
+ parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
+
+ // Will be defined later
+ deleteExpando: true,
+ checkClone: false,
+ scriptEval: false,
+ noCloneEvent: true,
+ boxModel: null
+ };
+
+ script.type = "text/javascript";
+ try {
+ script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+ } catch(e) {}
+
+ root.insertBefore( script, root.firstChild );
+
+ // Make sure that the execution of code works by injecting a script
+ // tag with appendChild/createTextNode
+ // (IE doesn't support this, fails, and uses .text instead)
+ if ( window[ id ] ) {
+ jQuery.support.scriptEval = true;
+ delete window[ id ];
+ }
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete script.test;
+
+ } catch(e) {
+ jQuery.support.deleteExpando = false;
+ }
+
+ root.removeChild( script );
+
+ if ( div.attachEvent && div.fireEvent ) {
+ div.attachEvent("onclick", function click() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ jQuery.support.noCloneEvent = false;
+ div.detachEvent("onclick", click);
+ });
+ div.cloneNode(true).fireEvent("onclick");
+ }
+
+ div = document.createElement("div");
+ div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
+
+ var fragment = document.createDocumentFragment();
+ fragment.appendChild( div.firstChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
+
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ jQuery(function() {
+ var div = document.createElement("div");
+ div.style.width = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div ).style.display = 'none';
+
+ div = null;
+ });
+
+ // Technique from Juriy Zaytsev
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-b...
+ var eventSupported = function( eventName ) {
+ var el = document.createElement("div");
+ eventName = "on" + eventName;
+
+ var isSupported = (eventName in el);
+ if ( !isSupported ) {
+ el.setAttribute(eventName, "return;");
+ isSupported = typeof el[eventName] === "function";
+ }
+ el = null;
+
+ return isSupported;
+ };
+
+ jQuery.support.submitBubbles = eventSupported("submit");
+ jQuery.support.changeBubbles = eventSupported("change");
+
+ // release memory in IE
+ root = script = div = all = a = null;
+})();
+
+jQuery.props = {
+ "for": "htmlFor",
+ "class": "className",
+ readonly: "readOnly",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ tabindex: "tabIndex",
+ usemap: "useMap",
+ frameborder: "frameBorder"
+};
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+
+jQuery.extend({
+ cache: {},
+
+ expando:expando,
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ "object": true,
+ "applet": true
+ },
+
+ data: function( elem, name, data ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache;
+
+ if ( !id && typeof name === "string" && data === undefined ) {
+ return null;
+ }
+
+ // Compute a unique ID for the element
+ if ( !id ) {
+ id = ++uuid;
+ }
+
+ // Avoid generating a new cache unless none exists and we
+ // want to manipulate it.
+ if ( typeof name === "object" ) {
+ elem[ expando ] = id;
+ thisCache = cache[ id ] = jQuery.extend(true, {}, name);
+
+ } else if ( !cache[ id ] ) {
+ elem[ expando ] = id;
+ cache[ id ] = {};
+ }
+
+ thisCache = cache[ id ];
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined ) {
+ thisCache[ name ] = data;
+ }
+
+ return typeof name === "string" ? thisCache[ name ] : thisCache;
+ },
+
+ removeData: function( elem, name ) {
+ if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+ return;
+ }
+
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( thisCache ) {
+ // Remove the section of cache data
+ delete thisCache[ name ];
+
+ // If we've removed all the data, remove the element's cache
+ if ( jQuery.isEmptyObject(thisCache) ) {
+ jQuery.removeData( elem );
+ }
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ if ( jQuery.support.deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ // Completely remove the data cache
+ delete cache[ id ];
+ }
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ if ( typeof key === "undefined" && this.length ) {
+ return jQuery.data( this[0] );
+
+ } else if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length ) {
+ data = jQuery.data( this[0], key );
+ }
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else {
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
+ jQuery.data( this, key, value );
+ });
+ }
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ if ( !elem ) {
+ return;
+ }
+
+ type = (type || "fx") + "queue";
+ var q = jQuery.data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( !data ) {
+ return q || [];
+ }
+
+ if ( !q || jQuery.isArray(data) ) {
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+
+ } else {
+ q.push( data );
+ }
+
+ return q;
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ), fn = queue.shift();
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ }
+
+ if ( fn ) {
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift("inprogress");
+ }
+
+ fn.call(elem, function() {
+ jQuery.dequeue(elem, type);
+ });
+ }
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined ) {
+ return jQuery.queue( this[0], type );
+ }
+ return this.each(function( i, elem ) {
+ var queue = jQuery.queue( this, type, data );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function() {
+ var elem = this;
+ setTimeout(function() {
+ jQuery.dequeue( elem, type );
+ }, time );
+ });
+ },
+
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ }
+});
+var rclass = /[\n\t]/g,
+ rspace = /\s+/,
+ rreturn = /\r/g,
+ rspecialurl = /href|src|style/,
+ rtype = /(button|input)/i,
+ rfocusable = /(button|input|object|select|textarea)/i,
+ rclickable = /^(a|area)$/i,
+ rradiocheck = /radio|checkbox/;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, name, value, true, jQuery.attr );
+ },
+
+ removeAttr: function( name, fn ) {
+ return this.each(function(){
+ jQuery.attr( this, name, "" );
+ if ( this.nodeType === 1 ) {
+ this.removeAttribute( name );
+ }
+ });
+ },
+
+ addClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.addClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ var classNames = (value || "").split( rspace );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className ) {
+ elem.className = value;
+
+ } else {
+ var className = " " + elem.className + " ", setClass = elem.className;
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+ setClass += " " + classNames[c];
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.removeClass( value.call(this, i, self.attr("class")) );
+ });
+ }
+
+ if ( (value && typeof value === "string") || value === undefined ) {
+ var classNames = (value || "").split(rspace);
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var elem = this[i];
+
+ if ( elem.nodeType === 1 && elem.className ) {
+ if ( value ) {
+ var className = (" " + elem.className + " ").replace(rclass, " ");
+ for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[c] + " ", " ");
+ }
+ elem.className = jQuery.trim( className );
+
+ } else {
+ elem.className = "";
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value, isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className, i = 0, self = jQuery(this),
+ state = stateVal,
+ classNames = value.split( rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space seperated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery.data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ";
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ if ( value === undefined ) {
+ var elem = this[0];
+
+ if ( elem ) {
+ if ( jQuery.nodeName( elem, "option" ) ) {
+ return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+ }
+
+ // We need to handle select boxes special
+ if ( jQuery.nodeName( elem, "select" ) ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ if ( option.selected ) {
+ // Get the specifc value for the option
+ value = jQuery(option).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ }
+
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+
+
+ // Everything else, we just grab the value
+ return (elem.value || "").replace(rreturn, "");
+
+ }
+
+ return undefined;
+ }
+
+ var isFunction = jQuery.isFunction(value);
+
+ return this.each(function(i) {
+ var self = jQuery(this), val = value;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call(this, i, self.val());
+ }
+
+ // Typecast each time if the value is a Function and the appended
+ // value is therefore different each time.
+ if ( typeof val === "number" ) {
+ val += "";
+ }
+
+ if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
+ this.checked = jQuery.inArray( self.val(), val ) >= 0;
+
+ } else if ( jQuery.nodeName( this, "select" ) ) {
+ var values = jQuery.makeArray(val);
+
+ jQuery( "option", this ).each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ this.selectedIndex = -1;
+ }
+
+ } else {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ attrFn: {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true
+ },
+
+ attr: function( elem, name, value, pass ) {
+ // don't set attributes on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ if ( pass && name in jQuery.attrFn ) {
+ return jQuery(elem)[name](value);
+ }
+
+ var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
+ // Whether we are setting (or getting)
+ set = value !== undefined;
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.props[ name ] || name;
+
+ // Only do all the following if this is a node (faster for style)
+ if ( elem.nodeType === 1 ) {
+ // These attributes require special treatment
+ var special = rspecialurl.test( name );
+
+ // Safari mis-reports the default selected property of an option
+ // Accessing the parent's selectedIndex property fixes it
+ if ( name === "selected" && !jQuery.support.optSelected ) {
+ var parent = elem.parentNode;
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+
+ // If applicable, access the attribute via the DOM 0 way
+ if ( name in elem && notxml && !special ) {
+ if ( set ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ }
+
+ elem[ name ] = value;
+ }
+
+ // browsers index elements by id/name on forms, give priority to attributes.
+ if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
+ return elem.getAttributeNode( name ).nodeValue;
+ }
+
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabi...
+ if ( name === "tabIndex" ) {
+ var attributeNode = elem.getAttributeNode( "tabIndex" );
+
+ return attributeNode && attributeNode.specified ?
+ attributeNode.value :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+
+ return elem[ name ];
+ }
+
+ if ( !jQuery.support.style && notxml && name === "style" ) {
+ if ( set ) {
+ elem.style.cssText = "" + value;
+ }
+
+ return elem.style.cssText;
+ }
+
+ if ( set ) {
+ // convert the value to a string (all browsers do this but IE) see #1070
+ elem.setAttribute( name, "" + value );
+ }
+
+ var attr = !jQuery.support.hrefNormalized && notxml && special ?
+ // Some attributes require a special call on IE
+ elem.getAttribute( name, 2 ) :
+ elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return attr === null ? undefined : attr;
+ }
+
+ // elem is actually elem.style ... set the style
+ // Using attr for specific style information is now deprecated. Use style instead.
+ return jQuery.style( elem, name, value );
+ }
+});
+var rnamespaces = /\.(.*)$/,
+ fcleanup = function( nm ) {
+ return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
+ return "\\" + ch;
+ });
+ };
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function( elem, types, handler, data ) {
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // For whatever reason, IE has trouble passing the window object
+ // around, causing it to be cloned in the process
+ if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
+ elem = window;
+ }
+
+ var handleObjIn, handleObj;
+
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ }
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure
+ var elemData = jQuery.data( elem );
+
+ // If no elemData is found then we must be trying to bind to one of the
+ // banned noData elements
+ if ( !elemData ) {
+ return;
+ }
+
+ var events = elemData.events = elemData.events || {},
+ eventHandle = elemData.handle, eventHandle;
+
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function() {
+ // Handle the second event of a trigger and when
+ // an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+ jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ }
+
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native events in IE.
+ eventHandle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ var type, i = 0, namespaces;
+
+ while ( (type = types[ i++ ]) ) {
+ handleObj = handleObjIn ?
+ jQuery.extend({}, handleObjIn) :
+ { handler: handler, data: data };
+
+ // Namespaced event handlers
+ if ( type.indexOf(".") > -1 ) {
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+ } else {
+ namespaces = [];
+ handleObj.namespace = "";
+ }
+
+ handleObj.type = type;
+ handleObj.guid = handler.guid;
+
+ // Get the current list of functions bound to this event
+ var handlers = events[ type ],
+ special = jQuery.event.special[ type ] || {};
+
+ // Init the event handler queue
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers.push( handleObj );
+
+ // Keep track of which events have been used, for global triggering
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, pos ) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+ elemData = jQuery.data( elem ),
+ events = elemData && elemData.events;
+
+ if ( !elemData || !events ) {
+ return;
+ }
+
+ // types is actually an event object here
+ if ( types && types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Unbind all events for the element
+ if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+ types = types || "";
+
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types );
+ }
+
+ return;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ types = types.split(" ");
+
+ while ( (type = types[ i++ ]) ) {
+ origType = type;
+ handleObj = null;
+ all = type.indexOf(".") < 0;
+ namespaces = [];
+
+ if ( !all ) {
+ // Namespaced event handlers
+ namespaces = type.split(".");
+ type = namespaces.shift();
+
+ namespace = new RegExp("(^|\\.)" +
+ jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
+ }
+
+ eventType = events[ type ];
+
+ if ( !eventType ) {
+ continue;
+ }
+
+ if ( !handler ) {
+ for ( var j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ jQuery.event.remove( elem, origType, handleObj.handler, j );
+ eventType.splice( j--, 1 );
+ }
+ }
+
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+
+ for ( var j = pos || 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( handler.guid === handleObj.guid ) {
+ // remove the given handler for the given type
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ if ( pos == null ) {
+ eventType.splice( j--, 1 );
+ }
+
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+
+ if ( pos != null ) {
+ break;
+ }
+ }
+ }
+
+ // remove generic event handler if no more handlers exist
+ if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ removeEvent( elem, type, elemData.handle );
+ }
+
+ ret = null;
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ var handle = elemData.handle;
+ if ( handle ) {
+ handle.elem = null;
+ }
+
+ delete elemData.events;
+ delete elemData.handle;
+
+ if ( jQuery.isEmptyObject( elemData ) ) {
+ jQuery.removeData( elem );
+ }
+ }
+ },
+
+ // bubbling is internal
+ trigger: function( event, data, elem /*, bubbling */ ) {
+ // Event object or event type
+ var type = event.type || event,
+ bubbling = arguments[3];
+
+ if ( !bubbling ) {
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[expando] ? event :
+ // Object literal
+ jQuery.extend( jQuery.Event(type), event ) :
+ // Just the event type (string)
+ jQuery.Event(type);
+
+ if ( type.indexOf("!") >= 0 ) {
+ event.type = type = type.slice(0, -1);
+ event.exclusive = true;
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // Don't bubble custom events when global (to avoid too much overhead)
+ event.stopPropagation();
+
+ // Only trigger if we've ever bound an event for it
+ if ( jQuery.event.global[ type ] ) {
+ jQuery.each( jQuery.cache, function() {
+ if ( this.events && this.events[type] ) {
+ jQuery.event.trigger( event, data, this.handle.elem );
+ }
+ });
+ }
+ }
+
+ // Handle triggering a single element
+
+ // don't do events on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // Clean up in case it is reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone the incoming data, if any
+ data = jQuery.makeArray( data );
+ data.unshift( event );
+ }
+
+ event.currentTarget = elem;
+
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) {
+ handle.apply( elem, data );
+ }
+
+ var parent = elem.parentNode || elem.ownerDocument;
+
+ // Trigger an inline bound script
+ try {
+ if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
+ if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
+ event.result = false;
+ }
+ }
+
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (e) {}
+
+ if ( !event.isPropagationStopped() && parent ) {
+ jQuery.event.trigger( event, data, parent, true );
+
+ } else if ( !event.isDefaultPrevented() ) {
+ var target = event.target, old,
+ isClick = jQuery.nodeName(target, "a") && type === "click",
+ special = jQuery.event.special[ type ] || {};
+
+ if ( (!special._default || special._default.call( elem, event ) === false) &&
+ !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
+
+ try {
+ if ( target[ type ] ) {
+ // Make sure that we don't accidentally re-trigger the onFOO events
+ old = target[ "on" + type ];
+
+ if ( old ) {
+ target[ "on" + type ] = null;
+ }
+
+ jQuery.event.triggered = true;
+ target[ type ]();
+ }
+
+ // prevent IE from throwing an error for some elements with some event types, see #3533
+ } catch (e) {}
+
+ if ( old ) {
+ target[ "on" + type ] = old;
+ }
+
+ jQuery.event.triggered = false;
+ }
+ }
+ },
+
+ handle: function( event ) {
+ var all, handlers, namespaces, namespace, events;
+
+ event = arguments[0] = jQuery.event.fix( event || window.event );
+ event.currentTarget = this;
+
+ // Namespaced event handlers
+ all = event.type.indexOf(".") < 0 && !event.exclusive;
+
+ if ( !all ) {
+ namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+ namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
+ }
+
+ var events = jQuery.data(this, "events"), handlers = events[ event.type ];
+
+ if ( events && handlers ) {
+ // Clone the handlers to prevent manipulation
+ handlers = handlers.slice(0);
+
+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
+ var handleObj = handlers[ j ];
+
+ // Filter the functions by class
+ if ( all || namespace.test( handleObj.namespace ) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handleObj.handler;
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ var ret = handleObj.handler.apply( this, arguments );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if ( event.isImmediatePropagationStopped() ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+ fix: function( event ) {
+ if ( event[ expando ] ) {
+ return event;
+ }
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ) {
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target ) {
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+ }
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement ) {
+ event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+ }
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var doc = document.documentElement, body = document.body;
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
+ event.which = event.charCode || event.keyCode;
+ }
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey ) {
+ event.metaKey = event.ctrlKey;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button !== undefined ) {
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+ }
+
+ return event;
+ },
+
+ // Deprecated, use jQuery.guid instead
+ guid: 1E8,
+
+ // Deprecated, use jQuery.proxy instead
+ proxy: jQuery.proxy,
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: jQuery.bindReady,
+ teardown: jQuery.noop
+ },
+
+ live: {
+ add: function( handleObj ) {
+ jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) );
+ },
+
+ remove: function( handleObj ) {
+ var remove = true,
+ type = handleObj.origType.replace(rnamespaces, "");
+
+ jQuery.each( jQuery.data(this, "events").live || [], function() {
+ if ( type === this.origType.replace(rnamespaces, "") ) {
+ remove = false;
+ return false;
+ }
+ });
+
+ if ( remove ) {
+ jQuery.event.remove( this, handleObj.origType, liveHandler );
+ }
+ }
+
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( this.setInterval ) {
+ this.onbeforeunload = eventHandle;
+ }
+
+ return false;
+ },
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ }
+};
+
+var removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ elem.removeEventListener( type, handle, false );
+ } :
+ function( elem, type, handle ) {
+ elem.detachEvent( "on" + type, handle );
+ };
+
+jQuery.Event = function( src ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !this.preventDefault ) {
+ return new jQuery.Event( src );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = now();
+
+ // Mark it as fixed
+ this[ expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-bind...
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+ }
+ // otherwise set the returnValue property of the original event to false (IE)
+ e.returnValue = false;
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+
+ // Firefox sometimes assigns relatedTarget a XUL element
+ // which we cannot access the parentNode property of
+ try {
+ // Traverse up the tree
+ while ( parent && parent !== this ) {
+ parent = parent.parentNode;
+ }
+
+ if ( parent !== this ) {
+ // set the correct event type
+ event.type = event.data;
+
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+
+ // assuming we've left the element since we most likely mousedover a xul element
+ } catch(e) { }
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+ event.type = event.data;
+ jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ setup: function( data ) {
+ jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+ },
+ teardown: function( data ) {
+ jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+ }
+ };
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function( data, namespaces ) {
+ if ( this.nodeName.toLowerCase() !== "form" ) {
+ jQuery.event.add(this, "click.specialSubmit", function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+ return trigger( "submit", this, arguments );
+ }
+ });
+
+ } else {
+ return false;
+ }
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialSubmit" );
+ }
+ };
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+ var formElems = /textarea|input|select/i,
+
+ changeFilters,
+
+ getVal = function( elem ) {
+ var type = elem.type, val = elem.value;
+
+ if ( type === "radio" || type === "checkbox" ) {
+ val = elem.checked;
+
+ } else if ( type === "select-multiple" ) {
+ val = elem.selectedIndex > -1 ?
+ jQuery.map( elem.options, function( elem ) {
+ return elem.selected;
+ }).join("-") :
+ "";
+
+ } else if ( elem.nodeName.toLowerCase() === "select" ) {
+ val = elem.selectedIndex;
+ }
+
+ return val;
+ },
+
+ testChange = function testChange( e ) {
+ var elem = e.target, data, val;
+
+ if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
+ return;
+ }
+
+ data = jQuery.data( elem, "_change_data" );
+ val = getVal(elem);
+
+ // the current data will be also retrieved by beforeactivate
+ if ( e.type !== "focusout" || elem.type !== "radio" ) {
+ jQuery.data( elem, "_change_data", val );
+ }
+
+ if ( data === undefined || val === data ) {
+ return;
+ }
+
+ if ( data != null || val ) {
+ e.type = "change";
+ return jQuery.event.trigger( e, arguments[1], elem );
+ }
+ };
+
+ jQuery.event.special.change = {
+ filters: {
+ focusout: testChange,
+
+ click: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Change has to be called before submit
+ // Keydown will be called before keypress, which is used in submit-event delegation
+ keydown: function( e ) {
+ var elem = e.target, type = elem.type;
+
+ if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+ (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+ type === "select-multiple" ) {
+ return testChange.call( this, e );
+ }
+ },
+
+ // Beforeactivate happens also before the previous element is blurred
+ // with this event you can't trigger a change event, but you can store
+ // information/focus[in] is not needed anymore
+ beforeactivate: function( e ) {
+ var elem = e.target;
+ jQuery.data( elem, "_change_data", getVal(elem) );
+ }
+ },
+
+ setup: function( data, namespaces ) {
+ if ( this.type === "file" ) {
+ return false;
+ }
+
+ for ( var type in changeFilters ) {
+ jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
+ }
+
+ return formElems.test( this.nodeName );
+ },
+
+ teardown: function( namespaces ) {
+ jQuery.event.remove( this, ".specialChange" );
+
+ return formElems.test( this.nodeName );
+ }
+ };
+
+ changeFilters = jQuery.event.special.change.filters;
+}
+
+function trigger( type, elem, args ) {
+ args[0].type = type;
+ return jQuery.event.handle.apply( elem, args );
+}
+
+// Create "bubbling" focus and blur events
+if ( document.addEventListener ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ this.addEventListener( orig, handler, true );
+ },
+ teardown: function() {
+ this.removeEventListener( orig, handler, true );
+ }
+ };
+
+ function handler( e ) {
+ e = jQuery.event.fix( e );
+ e.type = fix;
+ return jQuery.event.handle.call( this, e );
+ }
+ });
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+ jQuery.fn[ name ] = function( type, data, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" ) {
+ for ( var key in type ) {
+ this[ name ](key, data, type[key], fn);
+ }
+ return this;
+ }
+
+ if ( jQuery.isFunction( data ) ) {
+ fn = data;
+ data = undefined;
+ }
+
+ var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
+ jQuery( this ).unbind( event, handler );
+ return fn.apply( this, arguments );
+ }) : fn;
+
+ if ( type === "unload" && name !== "one" ) {
+ this.one( type, data, fn );
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.add( this[i], type, handler, data );
+ }
+ }
+
+ return this;
+ };
+});
+
+jQuery.fn.extend({
+ unbind: function( type, fn ) {
+ // Handle object literals
+ if ( typeof type === "object" && !type.preventDefault ) {
+ for ( var key in type ) {
+ this.unbind(key, type[key]);
+ }
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ jQuery.event.remove( this[i], type, fn );
+ }
+ }
+
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.live( types, data, fn, selector );
+ },
+
+ undelegate: function( selector, types, fn ) {
+ if ( arguments.length === 0 ) {
+ return this.unbind( "live" );
+
+ } else {
+ return this.die( types, null, fn, selector );
+ }
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ var event = jQuery.Event( type );
+ event.preventDefault();
+ event.stopPropagation();
+ jQuery.event.trigger( event, data, this[0] );
+ return event.result;
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments, i = 1;
+
+ // link all the functions, so any of them can unbind this click handler
+ while ( i < args.length ) {
+ jQuery.proxy( fn, args[ i++ ] );
+ }
+
+ return this.click( jQuery.proxy( fn, function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ }));
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+var liveMap = {
+ focus: "focusin",
+ blur: "focusout",
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+ jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+ var type, i = 0, match, namespaces, preType,
+ selector = origSelector || this.selector,
+ context = origSelector ? this : jQuery( this.context );
+
+ if ( jQuery.isFunction( data ) ) {
+ fn = data;
+ data = undefined;
+ }
+
+ types = (types || "").split(" ");
+
+ while ( (type = types[ i++ ]) != null ) {
+ match = rnamespaces.exec( type );
+ namespaces = "";
+
+ if ( match ) {
+ namespaces = match[0];
+ type = type.replace( rnamespaces, "" );
+ }
+
+ if ( type === "hover" ) {
+ types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+ continue;
+ }
+
+ preType = type;
+
+ if ( type === "focus" || type === "blur" ) {
+ types.push( liveMap[ type ] + namespaces );
+ type = type + namespaces;
+
+ } else {
+ type = (liveMap[ type ] || type) + namespaces;
+ }
+
+ if ( name === "live" ) {
+ // bind live handler
+ context.each(function(){
+ jQuery.event.add( this, liveConvert( type, selector ),
+ { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+ });
+
+ } else {
+ // unbind live handler
+ context.unbind( liveConvert( type, selector ), fn );
+ }
+ }
+
+ return this;
+ }
+});
+
+function liveHandler( event ) {
+ var stop, elems = [], selectors = [], args = arguments,
+ related, match, handleObj, elem, j, i, l, data,
+ events = jQuery.data( this, "events" );
+
+ // Make sure we avoid non-left-click bubbling in Firefox (#3861)
+ if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
+ return;
+ }
+
+ event.liveFired = this;
+
+ var live = events.live.slice(0);
+
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+ selectors.push( handleObj.selector );
+
+ } else {
+ live.splice( j--, 1 );
+ }
+ }
+
+ match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+ for ( i = 0, l = match.length; i < l; i++ ) {
+ for ( j = 0; j < live.length; j++ ) {
+ handleObj = live[j];
+
+ if ( match[i].selector === handleObj.selector ) {
+ elem = match[i].elem;
+ related = null;
+
+ // Those two events require additional checking
+ if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+ related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+ }
+
+ if ( !related || related !== elem ) {
+ elems.push({ elem: elem, handleObj: handleObj });
+ }
+ }
+ }
+ }
+
+ for ( i = 0, l = elems.length; i < l; i++ ) {
+ match = elems[i];
+ event.currentTarget = match.elem;
+ event.data = match.handleObj.data;
+ event.handleObj = match.handleObj;
+
+ if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
+ stop = false;
+ break;
+ }
+ }
+
+ return stop;
+}
+
+function liveConvert( type, selector ) {
+ return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
+}
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( fn ) {
+ return fn ? this.bind( name, fn ) : this.trigger( name );
+ };
+
+ if ( jQuery.attrFn ) {
+ jQuery.attrFn[ name ] = true;
+ }
+});
+
+// Prevent memory leaks in IE
+// Window isn't included so as not to unbind existing unload events
+// More info:
+// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
+if ( window.attachEvent && !window.addEventListener ) {
+ window.attachEvent("onunload", function() {
+ for ( var id in jQuery.cache ) {
+ if ( jQuery.cache[ id ].handle ) {
+ // Try/Catch is to handle iframes being unloaded, see #4280
+ try {
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+ } catch(e) {}
+ }
+ }
+ });
+}
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+ done = 0,
+ toString = Object.prototype.toString,
+ hasDuplicate = false,
+ baseHasDuplicate = true;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+// Thus far that includes Google Chrome.
+[0, 0].sort(function(){
+ baseHasDuplicate = false;
+ return 0;
+});
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ var origContext = context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
+ soFar = selector;
+
+ // Reset the position of the chunker regexp (start from head)
+ while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
+ soFar = m[3];
+
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = m[3];
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] ) {
+ selector += parts.shift();
+ }
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ // Take a shortcut and set the context if the root selector is an ID
+ // (but not if it'll be faster if the inner selector is an ID)
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+ var ret = Sizzle.find( parts.shift(), context, contextXML );
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+ }
+
+ if ( context ) {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, contextXML );
+ }
+ } else {
+ checkSet = parts = [];
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ Sizzle.error( cur || selector );
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context && context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, origContext, results, seed );
+ Sizzle.uniqueSort( results );
+ }
+
+ return results;
+};
+
+Sizzle.uniqueSort = function(results){
+ if ( sortOrder ) {
+ hasDuplicate = baseHasDuplicate;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+ var left = match[1];
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+ var filter = Expr.filter[ type ], found, item, left = match[1];
+ anyFound = false;
+
+ match.splice(1,1);
+
+ if ( left.substr( left.length - 1 ) === "\\" ) {
+ continue;
+ }
+
+ if ( curLoop === result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr === old ) {
+ if ( anyFound == null ) {
+ Sizzle.error( expr );
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+ throw "Syntax error, unrecognized expression: " + msg;
+};
+
+var Expr = Sizzle.selectors = {
+ order: [ "ID", "NAME", "TAG" ],
+ match: {
+ ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+ TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+ },
+ leftMatch: {},
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag ) {
+ part = part.toLowerCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = part.toLowerCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !/\W/.test(part) ) {
+ var nodeCheck = part = part.toLowerCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
+ if ( !inplace ) {
+ result.push( elem );
+ }
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ return match[1].toLowerCase();
+ },
+ CHILD: function(match){
+ if ( match[1] === "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 === i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 === i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ Sizzle.error( "Syntax error, unrecognized expression: " + name );
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ if ( type === "first" ) {
+ return true;
+ }
+ node = elem;
+ case 'last':
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first === 0 ) {
+ return diff === 0;
+ } else {
+ return ( diff % first === 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value !== check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS;
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
+ return "\\" + (num - 0 + 1);
+ }));
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+// Also verifies that the returned array holds DOM nodes
+// (which is not the case in the Blackberry browser)
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.compareDocumentPosition ? -1 : 1;
+ }
+
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( "sourceIndex" in document.documentElement ) {
+ sortOrder = function( a, b ) {
+ if ( !a.sourceIndex || !b.sourceIndex ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.sourceIndex ? -1 : 1;
+ }
+
+ var ret = a.sourceIndex - b.sourceIndex;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( document.createRange ) {
+ sortOrder = function( a, b ) {
+ if ( !a.ownerDocument || !b.ownerDocument ) {
+ if ( a == b ) {
+ hasDuplicate = true;
+ }
+ return a.ownerDocument ? -1 : 1;
+ }
+
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+ aRange.setStart(a, 0);
+ aRange.setEnd(a, 0);
+ bRange.setStart(b, 0);
+ bRange.setEnd(b, 0);
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+}
+
+// Utility function for retreiving the text value of an array of DOM nodes
+function getText( elems ) {
+ var ret = "", elem;
+
+ for ( var i = 0; elems[i]; i++ ) {
+ elem = elems[i];
+
+ // Get the text from text nodes and CDATA nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+ ret += elem.nodeValue;
+
+ // Traverse everything else, except comment nodes
+ } else if ( elem.nodeType !== 8 ) {
+ ret += getText( elem.childNodes );
+ }
+ }
+
+ return ret;
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+ root = form = null; // release memory in IE
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+
+ div = null; // release memory in IE
+})();
+
+if ( document.querySelectorAll ) {
+ (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
+
+ div = null; // release memory in IE
+ })();
+}
+
+(function(){
+ var div = document.createElement("div");
+
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ // Also, make sure that getElementsByClassName actually exists
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
+ return;
+ }
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 ) {
+ return;
+ }
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+
+ div = null; // release memory in IE
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName.toLowerCase() === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return !!(a.compareDocumentPosition(b) & 16);
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var isXML = function(elem){
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = getText;
+jQuery.isXMLDoc = isXML;
+jQuery.contains = contains;
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+ // Note: This RegExp should be improved, or likely pulled from Sizzle
+ rmultiselector = /,/,
+ slice = Array.prototype.slice;
+
+// Implement the identical functionality for filter and not
+var winnow = function( elements, qualifier, keep ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return !!qualifier.call( elem, i, elem ) === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var ret = this.pushStack( "", "find", selector ), length = 0;
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( var n = length; n < ret.length; n++ ) {
+ for ( var r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var targets = jQuery( target );
+ return this.filter(function() {
+ for ( var i = 0, l = targets.length; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && jQuery.filter( selector, this ).length > 0;
+ },
+
+ closest: function( selectors, context ) {
+ if ( jQuery.isArray( selectors ) ) {
+ var ret = [], cur = this[0], match, matches = {}, selector;
+
+ if ( cur && selectors.length ) {
+ for ( var i = 0, l = selectors.length; i < l; i++ ) {
+ selector = selectors[i];
+
+ if ( !matches[selector] ) {
+ matches[selector] = jQuery.expr.match.POS.test( selector ) ?
+ jQuery( selector, context || this.context ) :
+ selector;
+ }
+ }
+
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ for ( selector in matches ) {
+ match = matches[selector];
+
+ if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
+ ret.push({ selector: selector, elem: cur });
+ delete matches[selector];
+ }
+ }
+ cur = cur.parentNode;
+ }
+ }
+
+ return ret;
+ }
+
+ var pos = jQuery.expr.match.POS.test( selectors ) ?
+ jQuery( selectors, context || this.context ) : null;
+
+ return this.map(function( i, cur ) {
+ while ( cur && cur.ownerDocument && cur !== context ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
+ return cur;
+ }
+ cur = cur.parentNode;
+ }
+ return null;
+ });
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ if ( !elem || typeof elem === "string" ) {
+ return jQuery.inArray( this[0],
+ // If it receives a string, the selector is used
+ // If it receives nothing, the siblings are used
+ elem ? jQuery( elem ) : this.parent().children() );
+ }
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context || this.context ) :
+ jQuery.makeArray( selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ }
+});
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return jQuery.nth( elem, 2, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return jQuery.nth( elem, 2, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( elem.parentNode.firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.makeArray( elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 ? jQuery.unique( ret ) : ret;
+
+ if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, slice.call(arguments).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [], cur = elem[dir];
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ nth: function( cur, result, dir, elem ) {
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] ) {
+ if ( cur.nodeType === 1 && ++num === result ) {
+ break;
+ }
+ }
+
+ return cur;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
+ rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnocache = /<script|<object|<embed|<option|<style/i,
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, // checked="checked" or checked (html5)
+ fcloseTag = function( all, front, tag ) {
+ return rselfClosing.test( tag ) ?
+ all :
+ front + "></" + tag + ">";
+ },
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ area: [ 1, "<map>", "</map>" ],
+ _default: [ 0, "", "" ]
+ };
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE can't serialize <link> and <script> tags normally
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "div<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( text ) {
+ if ( jQuery.isFunction(text) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ self.text( text.call(this, i, self.text()) );
+ });
+ }
+
+ if ( typeof text !== "object" && text !== undefined ) {
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+ }
+
+ return jQuery.text( this );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append(this);
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ), contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function() {
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ } else if ( arguments.length ) {
+ var set = jQuery(arguments[0]);
+ set.push.apply( set, this.toArray() );
+ return this.pushStack( set, "before", arguments );
+ }
+ },
+
+ after: function() {
+ if ( this[0] && this[0].parentNode ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ } else if ( arguments.length ) {
+ var set = this.pushStack( this, "after", arguments );
+ set.push.apply( set, jQuery(arguments[0]).toArray() );
+ return set;
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( events ) {
+ // Do the clone
+ var ret = this.map(function() {
+ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
+ // IE copies events bound via attachEvent when
+ // using cloneNode. Calling detachEvent on the
+ // clone will also remove the events from the orignal
+ // In order to get around this, we use innerHTML.
+ // Unfortunately, this means some modifications to
+ // attributes in IE that are actually only stored
+ // as properties will not be copied (such as the
+ // the name attribute on an input).
+ var html = this.outerHTML, ownerDocument = this.ownerDocument;
+ if ( !html ) {
+ var div = ownerDocument.createElement("div");
+ div.appendChild( this.cloneNode(true) );
+ html = div.innerHTML;
+ }
+
+ return jQuery.clean([html.replace(rinlinejQuery, "")
+ // Handle the case in IE 8 where action=/test/> self-closes a tag
+ .replace(/=([^="'>\s]+\/)>/g, '="$1">')
+ .replace(rleadingWhitespace, "")], ownerDocument)[0];
+ } else {
+ return this.cloneNode(true);
+ }
+ });
+
+ // Copy the events from the original to the clone
+ if ( events === true ) {
+ cloneCopyEvent( this, ret );
+ cloneCopyEvent( this.find("*"), ret.find("*") );
+ }
+
+ // Return the cloned set
+ return ret;
+ },
+
+ html: function( value ) {
+ if ( value === undefined ) {
+ return this[0] && this[0].nodeType === 1 ?
+ this[0].innerHTML.replace(rinlinejQuery, "") :
+ null;
+
+ // See if we can take a shortcut and just use innerHTML
+ } else if ( typeof value === "string" && !rnocache.test( value ) &&
+ (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
+ !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+
+ value = value.replace(rxhtmlTag, fcloseTag);
+
+ try {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( this[i].nodeType === 1 ) {
+ jQuery.cleanData( this[i].getElementsByTagName("*") );
+ this[i].innerHTML = value;
+ }
+ }
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {
+ this.empty().append( value );
+ }
+
+ } else if ( jQuery.isFunction( value ) ) {
+ this.each(function(i){
+ var self = jQuery(this), old = self.html();
+ self.empty().append(function(){
+ return value.call( this, i, old );
+ });
+ });
+
+ } else {
+ this.empty().append( value );
+ }
+
+ return this;
+ },
+
+ replaceWith: function( value ) {
+ if ( this[0] && this[0].parentNode ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery(value).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling, parent = this.parentNode;
+
+ jQuery(this).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ } else {
+ return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
+ }
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+ var results, first, value = args[0], scripts = [], fragment, parent;
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback, true );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call(this, i, table ? self.html() : undefined);
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ parent = value && value.parentNode;
+
+ // If we're in a fragment, just use that instead of building a new one
+ if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+ results = { fragment: parent };
+
+ } else {
+ results = buildFragment( args, this, scripts );
+ }
+
+ fragment = results.fragment;
+
+ if ( fragment.childNodes.length === 1 ) {
+ first = fragment = fragment.firstChild;
+ } else {
+ first = fragment.firstChild;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ callback.call(
+ table ?
+ root(this[i], first) :
+ this[i],
+ i > 0 || results.cacheable || this.length > 1 ?
+ fragment.cloneNode(true) :
+ fragment
+ );
+ }
+ }
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, evalScript );
+ }
+ }
+
+ return this;
+
+ function root( elem, cur ) {
+ return jQuery.nodeName(elem, "table") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+ }
+ }
+});
+
+function cloneCopyEvent(orig, ret) {
+ var i = 0;
+
+ ret.each(function() {
+ if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
+ return;
+ }
+
+ var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+ }
+ });
+}
+
+function buildFragment( args, nodes, scripts ) {
+ var fragment, cacheable, cacheresults,
+ doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+
+ // Only cache "small" (1/2 KB) strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
+ !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
+
+ cacheable = true;
+ cacheresults = jQuery.fragments[ args[0] ];
+ if ( cacheresults ) {
+ if ( cacheresults !== 1 ) {
+ fragment = cacheresults;
+ }
+ }
+ }
+
+ if ( !fragment ) {
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment, scripts );
+ }
+
+ if ( cacheable ) {
+ jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+}
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [], insert = jQuery( selector ),
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+
+ } else {
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+jQuery.extend({
+ clean: function( elems, context, fragment, scripts ) {
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" ) {
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ }
+
+ var ret = [];
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" && !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+
+ } else if ( typeof elem === "string" ) {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, fcloseTag);
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+ wrap = wrapMap[ tag ] || wrapMap._default,
+ depth = wrap[0],
+ div = context.createElement("div");
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = rtbody.test(elem),
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( var j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ ret = jQuery.merge( ret, elem );
+ }
+ }
+
+ if ( fragment ) {
+ for ( var i = 0; ret[i]; i++ ) {
+ if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+
+ } else {
+ if ( ret[i].nodeType === 1 ) {
+ ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+ }
+ fragment.appendChild( ret[i] );
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems ) {
+ var data, id, cache = jQuery.cache,
+ special = jQuery.event.special,
+ deleteExpando = jQuery.support.deleteExpando;
+
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ id = elem[ jQuery.expando ];
+
+ if ( id ) {
+ data = cache[ id ];
+
+ if ( data.events ) {
+ for ( var type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ } else {
+ removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ if ( deleteExpando ) {
+ delete elem[ jQuery.expando ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( jQuery.expando );
+ }
+
+ delete cache[ id ];
+ }
+ }
+ }
+});
+// exclude the following css properties to add px
+var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+ ralpha = /alpha\([^)]*\)/,
+ ropacity = /opacity=([^)]*)/,
+ rfloat = /float/i,
+ rdashAlpha = /-([a-z])/ig,
+ rupper = /([A-Z])/g,
+ rnumpx = /^-?\d+(?:px)?$/i,
+ rnum = /^-?\d/,
+
+ cssShow = { position: "absolute", visibility: "hidden", display:"block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+
+ // cache check for defaultView.getComputedStyle
+ getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
+ // normalize float css property
+ styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn.css = function( name, value ) {
+ return access( this, name, value, true, function( elem, name, value ) {
+ if ( value === undefined ) {
+ return jQuery.curCSS( elem, name );
+ }
+
+ if ( typeof value === "number" && !rexclude.test(name) ) {
+ value += "px";
+ }
+
+ jQuery.style( elem, name, value );
+ });
+};
+
+jQuery.extend({
+ style: function( elem, name, value ) {
+ // don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return undefined;
+ }
+
+ // ignore negative width and height values #1599
+ if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
+ value = undefined;
+ }
+
+ var style = elem.style || elem, set = value !== undefined;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" ) {
+ if ( set ) {
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
+ var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
+ style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
+ }
+
+ return style.filter && style.filter.indexOf("opacity=") >= 0 ?
+ (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
+ "";
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ name = name.replace(rdashAlpha, fcamelCase);
+
+ if ( set ) {
+ style[ name ] = value;
+ }
+
+ return style[ name ];
+ },
+
+ css: function( elem, name, force, extra ) {
+ if ( name === "width" || name === "height" ) {
+ var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
+
+ function getWH() {
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" ) {
+ return;
+ }
+
+ jQuery.each( which, function() {
+ if ( !extra ) {
+ val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+ }
+
+ if ( extra === "margin" ) {
+ val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
+ } else {
+ val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+ }
+ });
+ }
+
+ if ( elem.offsetWidth !== 0 ) {
+ getWH();
+ } else {
+ jQuery.swap( elem, props, getWH );
+ }
+
+ return Math.max(0, Math.round(val));
+ }
+
+ return jQuery.curCSS( elem, name, force );
+ },
+
+ curCSS: function( elem, name, force ) {
+ var ret, style = elem.style, filter;
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
+ ret = ropacity.test(elem.currentStyle.filter || "") ?
+ (parseFloat(RegExp.$1) / 100) + "" :
+ "";
+
+ return ret === "" ?
+ "1" :
+ ret;
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( rfloat.test( name ) ) {
+ name = styleFloat;
+ }
+
+ if ( !force && style && style[ name ] ) {
+ ret = style[ name ];
+
+ } else if ( getComputedStyle ) {
+
+ // Only "float" is needed here
+ if ( rfloat.test( name ) ) {
+ name = "float";
+ }
+
+ name = name.replace( rupper, "-$1" ).toLowerCase();
+
+ var defaultView = elem.ownerDocument.defaultView;
+
+ if ( !defaultView ) {
+ return null;
+ }
+
+ var computedStyle = defaultView.getComputedStyle( elem, null );
+
+ if ( computedStyle ) {
+ ret = computedStyle.getPropertyValue( name );
+ }
+
+ // We should always get a number back from opacity
+ if ( name === "opacity" && ret === "" ) {
+ ret = "1";
+ }
+
+ } else if ( elem.currentStyle ) {
+ var camelCase = name.replace(rdashAlpha, fcamelCase);
+
+ ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+ // Remember the original values
+ var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret;
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( var name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ var width = elem.offsetWidth, height = elem.offsetHeight,
+ skip = elem.nodeName.toLowerCase() === "tr";
+
+ return width === 0 && height === 0 && !skip ?
+ true :
+ width > 0 && height > 0 && !skip ?
+ false :
+ jQuery.curCSS(elem, "display") === "none";
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+var jsc = now(),
+ rscript = /<script(.|\s)*?\/script>/gi,
+ rselectTextarea = /select|textarea/i,
+ rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
+ jsre = /=\?(&|$)/,
+ rquery = /\?/,
+ rts = /(\?|&)_=.*?(&|$)/,
+ rurl = /^(\w+:)?\/\/([^\/?#]+)/,
+ r20 = /%20/g,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load;
+
+jQuery.fn.extend({
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" ) {
+ return _load.call( this, url );
+
+ // Don't do a request if no elements are being requested
+ } else if ( !this.length ) {
+ return this;
+ }
+
+ var off = url.indexOf(" ");
+ if ( off >= 0 ) {
+ var selector = url.slice(off, url.length);
+ url = url.slice(0, off);
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = null;
+
+ // Otherwise, build a param string
+ } else if ( typeof params === "object" ) {
+ params = jQuery.param( params, jQuery.ajaxSettings.traditional );
+ type = "POST";
+ }
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ complete: function( res, status ) {
+ // If successful, inject the HTML into all the matched elements
+ if ( status === "success" || status === "notmodified" ) {
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div />")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(res.responseText.replace(rscript, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ res.responseText );
+ }
+
+ if ( callback ) {
+ self.each( callback, [res.responseText, status, res] );
+ }
+ }
+ });
+
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param(this.serializeArray());
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ return this.elements ? jQuery.makeArray(this.elements) : this;
+ })
+ .filter(function() {
+ return this.name && !this.disabled &&
+ (this.checked || rselectTextarea.test(this.nodeName) ||
+ rinput.test(this.type));
+ })
+ .map(function( i, elem ) {
+ var val = jQuery(this).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray(val) ?
+ jQuery.map( val, function( val, i ) {
+ return { name: elem.name, value: val };
+ }) :
+ { name: elem.name, value: val };
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
+ jQuery.fn[o] = function( f ) {
+ return this.bind(o, f);
+ };
+});
+
+jQuery.extend({
+
+ get: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = null;
+ }
+
+ return jQuery.ajax({
+ type: "GET",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get(url, null, callback, "script");
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get(url, data, callback, "json");
+ },
+
+ post: function( url, data, callback, type ) {
+ // shift arguments if data argument was omited
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = {};
+ }
+
+ return jQuery.ajax({
+ type: "POST",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ ajaxSetup: function( settings ) {
+ jQuery.extend( jQuery.ajaxSettings, settings );
+ },
+
+ ajaxSettings: {
+ url: location.href,
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ username: null,
+ password: null,
+ traditional: false,
+ */
+ // Create the request object; Microsoft failed to properly
+ // implement the XMLHttpRequest in IE7 (can't request local files),
+ // so we use the ActiveXObject when it is available
+ // This function can be overriden by calling jQuery.ajaxSetup
+ xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
+ function() {
+ return new window.XMLHttpRequest();
+ } :
+ function() {
+ try {
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
+ } catch(e) {}
+ },
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ script: "text/javascript, application/javascript",
+ json: "application/json, text/javascript",
+ text: "text/plain",
+ _default: "*/*"
+ }
+ },
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajax: function( origSettings ) {
+ var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
+
+ var jsonp, status, data,
+ callbackContext = origSettings && origSettings.context || s,
+ type = s.type.toUpperCase();
+
+ // convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Handle JSONP Parameter Callbacks
+ if ( s.dataType === "jsonp" ) {
+ if ( type === "GET" ) {
+ if ( !jsre.test( s.url ) ) {
+ s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+ }
+ } else if ( !s.data || !jsre.test(s.data) ) {
+ s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+ }
+ s.dataType = "json";
+ }
+
+ // Build temporary JSONP function
+ if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
+ jsonp = s.jsonpCallback || ("jsonp" + jsc++);
+
+ // Replace the =? sequence both in the query string and the data
+ if ( s.data ) {
+ s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+ }
+
+ s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+ // We need to make sure
+ // that a JSONP style response is executed properly
+ s.dataType = "script";
+
+ // Handle JSONP-style loading
+ window[ jsonp ] = window[ jsonp ] || function( tmp ) {
+ data = tmp;
+ success();
+ complete();
+ // Garbage collect
+ window[ jsonp ] = undefined;
+
+ try {
+ delete window[ jsonp ];
+ } catch(e) {}
+
+ if ( head ) {
+ head.removeChild( script );
+ }
+ };
+ }
+
+ if ( s.dataType === "script" && s.cache === null ) {
+ s.cache = false;
+ }
+
+ if ( s.cache === false && type === "GET" ) {
+ var ts = now();
+
+ // try replacing _= if it is there
+ var ret = s.url.replace(rts, "$1_=" + ts + "$2");
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
+ }
+
+ // If data is available, append data to url for get requests
+ if ( s.data && type === "GET" ) {
+ s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
+ }
+
+ // Watch for a new set of requests
+ if ( s.global && ! jQuery.active++ ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // Matches an absolute URL, and saves the domain
+ var parts = rurl.exec( s.url ),
+ remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
+
+ // If we're requesting a remote document
+ // and trying to load JSON or Script with a GET
+ if ( s.dataType === "script" && type === "GET" && remote ) {
+ var head = document.getElementsByTagName("head")[0] || document.documentElement;
+ var script = document.createElement("script");
+ script.src = s.url;
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ // Handle Script loading
+ if ( !jsonp ) {
+ var done = false;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function() {
+ if ( !done && (!this.readyState ||
+ this.readyState === "loaded" || this.readyState === "complete") ) {
+ done = true;
+ success();
+ complete();
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+ }
+ };
+ }
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+
+ // We handle everything using the script element injection
+ return undefined;
+ }
+
+ var requestDone = false;
+
+ // Create the request object
+ var xhr = s.xhr();
+
+ if ( !xhr ) {
+ return;
+ }
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open(type, s.url, s.async, s.username, s.password);
+ } else {
+ xhr.open(type, s.url, s.async);
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ // Set the correct header, if data is being sent
+ if ( s.data || origSettings && origSettings.contentType ) {
+ xhr.setRequestHeader("Content-Type", s.contentType);
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[s.url] ) {
+ xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
+ }
+
+ if ( jQuery.etag[s.url] ) {
+ xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
+ }
+ }
+
+ // Set header so the called script knows that it's an XMLHttpRequest
+ // Only send the header if it's not a remote XHR
+ if ( !remote ) {
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+ s.accepts[ s.dataType ] + ", */*" :
+ s.accepts._default );
+ } catch(e) {}
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+
+ // close opended socket
+ xhr.abort();
+ return false;
+ }
+
+ if ( s.global ) {
+ trigger("ajaxSend", [xhr, s]);
+ }
+
+ // Wait for a response to come back
+ var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
+ // The request was aborted
+ if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
+ // Opera doesn't call onreadystatechange before this point
+ // so we simulate the call
+ if ( !requestDone ) {
+ complete();
+ }
+
+ requestDone = true;
+ if ( xhr ) {
+ xhr.onreadystatechange = jQuery.noop;
+ }
+
+ // The transfer is complete and the data is available, or the request timed out
+ } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
+ requestDone = true;
+ xhr.onreadystatechange = jQuery.noop;
+
+ status = isTimeout === "timeout" ?
+ "timeout" :
+ !jQuery.httpSuccess( xhr ) ?
+ "error" :
+ s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
+ "notmodified" :
+ "success";
+
+ var errMsg;
+
+ if ( status === "success" ) {
+ // Watch for, and catch, XML document parse errors
+ try {
+ // process the data (runs the xml through httpData regardless of callback)
+ data = jQuery.httpData( xhr, s.dataType, s );
+ } catch(err) {
+ status = "parsererror";
+ errMsg = err;
+ }
+ }
+
+ // Make sure that the request was successful or notmodified
+ if ( status === "success" || status === "notmodified" ) {
+ // JSONP handles its own success callback
+ if ( !jsonp ) {
+ success();
+ }
+ } else {
+ jQuery.handleError(s, xhr, status, errMsg);
+ }
+
+ // Fire the complete handlers
+ complete();
+
+ if ( isTimeout === "timeout" ) {
+ xhr.abort();
+ }
+
+ // Stop memory leaks
+ if ( s.async ) {
+ xhr = null;
+ }
+ }
+ };
+
+ // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
+ // Opera doesn't fire onreadystatechange at all on abort
+ try {
+ var oldAbort = xhr.abort;
+ xhr.abort = function() {
+ if ( xhr ) {
+ oldAbort.call( xhr );
+ }
+
+ onreadystatechange( "abort" );
+ };
+ } catch(e) { }
+
+ // Timeout checker
+ if ( s.async && s.timeout > 0 ) {
+ setTimeout(function() {
+ // Check to see if the request is still happening
+ if ( xhr && !requestDone ) {
+ onreadystatechange( "timeout" );
+ }
+ }, s.timeout);
+ }
+
+ // Send the data
+ try {
+ xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
+ } catch(e) {
+ jQuery.handleError(s, xhr, null, e);
+ // Fire the complete handlers
+ complete();
+ }
+
+ // firefox 1.5 doesn't fire statechange for sync requests
+ if ( !s.async ) {
+ onreadystatechange();
+ }
+
+ function success() {
+ // If a local callback was specified, fire it and pass it the data
+ if ( s.success ) {
+ s.success.call( callbackContext, data, status, xhr );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ trigger( "ajaxSuccess", [xhr, s] );
+ }
+ }
+
+ function complete() {
+ // Process result
+ if ( s.complete ) {
+ s.complete.call( callbackContext, xhr, status);
+ }
+
+ // The request was completed
+ if ( s.global ) {
+ trigger( "ajaxComplete", [xhr, s] );
+ }
+
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+
+ function trigger(type, args) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
+ }
+
+ // return XMLHttpRequest to allow aborting the request etc.
+ return xhr;
+ },
+
+ handleError: function( s, xhr, status, e ) {
+ // If a local callback was specified, fire it
+ if ( s.error ) {
+ s.error.call( s.context || s, xhr, status, e );
+ }
+
+ // Fire the global callback
+ if ( s.global ) {
+ (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
+ }
+ },
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Determines if an XMLHttpRequest was successful or not
+ httpSuccess: function( xhr ) {
+ try {
+ // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+ return !xhr.status && location.protocol === "file:" ||
+ // Opera returns 0 when status is 304
+ ( xhr.status >= 200 && xhr.status < 300 ) ||
+ xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
+ } catch(e) {}
+
+ return false;
+ },
+
+ // Determines if an XMLHttpRequest returns NotModified
+ httpNotModified: function( xhr, url ) {
+ var lastModified = xhr.getResponseHeader("Last-Modified"),
+ etag = xhr.getResponseHeader("Etag");
+
+ if ( lastModified ) {
+ jQuery.lastModified[url] = lastModified;
+ }
+
+ if ( etag ) {
+ jQuery.etag[url] = etag;
+ }
+
+ // Opera returns 0 when status is 304
+ return xhr.status === 304 || xhr.status === 0;
+ },
+
+ httpData: function( xhr, type, s ) {
+ var ct = xhr.getResponseHeader("content-type") || "",
+ xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if ( xml && data.documentElement.nodeName === "parsererror" ) {
+ jQuery.error( "parsererror" );
+ }
+
+ // Allow a pre-filtering function to sanitize the response
+ // s is checked to keep backwards compatibility
+ if ( s && s.dataFilter ) {
+ data = s.dataFilter( data, type );
+ }
+
+ // The filter can actually parse the response
+ if ( typeof data === "string" ) {
+ // Get the JavaScript object, if JSON is used.
+ if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
+ data = jQuery.parseJSON( data );
+
+ // If the type is "script", eval it in global context
+ } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
+ jQuery.globalEval( data );
+ }
+ }
+
+ return data;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a, traditional ) {
+ var s = [];
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray(a) || a.jquery ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( var prefix in a ) {
+ buildParams( prefix, a[prefix] );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join("&").replace(r20, "+");
+
+ function buildParams( prefix, obj ) {
+ if ( jQuery.isArray(obj) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || /\[\]$/.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
+ }
+ });
+
+ } else if ( !traditional && obj != null && typeof obj === "object" ) {
+ // Serialize object item.
+ jQuery.each( obj, function( k, v ) {
+ buildParams( prefix + "[" + k + "]", v );
+ });
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+ }
+
+ function add( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction(value) ? value() : value;
+ s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
+ }
+ }
+});
+var elemdisplay = {},
+ rfxtypes = /toggle|show|hide/,
+ rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ];
+
+jQuery.fn.extend({
+ show: function( speed, callback ) {
+ if ( speed || speed === 0) {
+ return this.animate( genFx("show", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+
+ this[i].style.display = old || "";
+
+ if ( jQuery.css(this[i], "display") === "none" ) {
+ var nodeName = this[i].nodeName, display;
+
+ if ( elemdisplay[ nodeName ] ) {
+ display = elemdisplay[ nodeName ];
+
+ } else {
+ var elem = jQuery("<" + nodeName + " />").appendTo("body");
+
+ display = elem.css("display");
+
+ if ( display === "none" ) {
+ display = "block";
+ }
+
+ elem.remove();
+
+ elemdisplay[ nodeName ] = display;
+ }
+
+ jQuery.data(this[i], "olddisplay", display);
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
+ }
+
+ return this;
+ }
+ },
+
+ hide: function( speed, callback ) {
+ if ( speed || speed === 0 ) {
+ return this.animate( genFx("hide", 3), speed, callback);
+
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ) {
+ var old = jQuery.data(this[i], "olddisplay");
+ if ( !old && old !== "none" ) {
+ jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var j = 0, k = this.length; j < k; j++ ) {
+ this[j].style.display = "none";
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2 ) {
+ var bool = typeof fn === "boolean";
+
+ if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
+ this._toggle.apply( this, arguments );
+
+ } else if ( fn == null || bool ) {
+ this.each(function() {
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ });
+
+ } else {
+ this.animate(genFx("toggle", 3), fn, fn2);
+ }
+
+ return this;
+ },
+
+ fadeTo: function( speed, to, callback ) {
+ return this.filter(":hidden").css("opacity", 0).show().end()
+ .animate({opacity: to}, speed, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ if ( jQuery.isEmptyObject( prop ) ) {
+ return this.each( optall.complete );
+ }
+
+ return this[ optall.queue === false ? "each" : "queue" ](function() {
+ var opt = jQuery.extend({}, optall), p,
+ hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
+ self = this;
+
+ for ( p in prop ) {
+ var name = p.replace(rdashAlpha, fcamelCase);
+
+ if ( p !== name ) {
+ prop[ name ] = prop[ p ];
+ delete prop[ p ];
+ p = name;
+ }
+
+ if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
+ return opt.complete.call(this);
+ }
+
+ if ( ( p === "height" || p === "width" ) && this.style ) {
+ // Store display property
+ opt.display = jQuery.css(this, "display");
+
+ // Make sure that nothing sneaks out
+ opt.overflow = this.style.overflow;
+ }
+
+ if ( jQuery.isArray( prop[p] ) ) {
+ // Create (if needed) and add to specialEasing
+ (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
+ prop[p] = prop[p][0];
+ }
+ }
+
+ if ( opt.overflow != null ) {
+ this.style.overflow = "hidden";
+ }
+
+ opt.curAnim = jQuery.extend({}, prop);
+
+ jQuery.each( prop, function( name, val ) {
+ var e = new jQuery.fx( self, opt, name );
+
+ if ( rfxtypes.test(val) ) {
+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+
+ } else {
+ var parts = rfxnum.exec(val),
+ start = e.cur(true) || 0;
+
+ if ( parts ) {
+ var end = parseFloat( parts[2] ),
+ unit = parts[3] || "px";
+
+ // We need to compute starting value
+ if ( unit !== "px" ) {
+ self.style[ name ] = (end || 1) + unit;
+ start = ((end || 1) / e.cur(true)) * start;
+ self.style[ name ] = start + unit;
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] ) {
+ end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
+ }
+
+ e.custom( start, end, unit );
+
+ } else {
+ e.custom( start, val, "" );
+ }
+ }
+ });
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function( clearQueue, gotoEnd ) {
+ var timers = jQuery.timers;
+
+ if ( clearQueue ) {
+ this.queue([]);
+ }
+
+ this.each(function() {
+ // go in reverse order so anything added to the queue during the loop is ignored
+ for ( var i = timers.length - 1; i >= 0; i-- ) {
+ if ( timers[i].elem === this ) {
+ if (gotoEnd) {
+ // force the next step to be the last
+ timers[i](true);
+ }
+
+ timers.splice(i, 1);
+ }
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if ( !gotoEnd ) {
+ this.dequeue();
+ }
+
+ return this;
+ }
+
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, callback ) {
+ return this.animate( props, speed, callback );
+ };
+});
+
+jQuery.extend({
+ speed: function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? speed : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function() {
+ if ( opt.queue !== false ) {
+ jQuery(this).dequeue();
+ }
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ) {
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ if ( !options.orig ) {
+ options.orig = {};
+ }
+ }
+
+});
+
+jQuery.fx.prototype = {
+ // Simple function for setting a style value
+ update: function() {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+ // Set display property to block for height/width animations
+ if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
+ this.elem.style.display = "block";
+ }
+ },
+
+ // Get the current size
+ cur: function( force ) {
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
+ return this.elem[ this.prop ];
+ }
+
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+ },
+
+ // Start an animation from one number to another
+ custom: function( from, to, unit ) {
+ this.startTime = now();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || "px";
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ var self = this;
+ function t( gotoEnd ) {
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval(jQuery.fx.tick, 13);
+ }
+ },
+
+ // Simple 'show' function
+ show: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery( this.elem ).show();
+ },
+
+ // Simple 'hide' function
+ hide: function() {
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function( gotoEnd ) {
+ var t = now(), done = true;
+
+ if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ this.options.curAnim[ this.prop ] = true;
+
+ for ( var i in this.options.curAnim ) {
+ if ( this.options.curAnim[i] !== true ) {
+ done = false;
+ }
+ }
+
+ if ( done ) {
+ if ( this.options.display != null ) {
+ // Reset the overflow
+ this.elem.style.overflow = this.options.overflow;
+
+ // Reset the display
+ var old = jQuery.data(this.elem, "olddisplay");
+ this.elem.style.display = old ? old : this.options.display;
+
+ if ( jQuery.css(this.elem, "display") === "none" ) {
+ this.elem.style.display = "block";
+ }
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( this.options.hide ) {
+ jQuery(this.elem).hide();
+ }
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( this.options.hide || this.options.show ) {
+ for ( var p in this.options.curAnim ) {
+ jQuery.style(this.elem, p, this.options.orig[p]);
+ }
+ }
+
+ // Execute the complete function
+ this.options.complete.call( this.elem );
+ }
+
+ return false;
+
+ } else {
+ var n = t - this.startTime;
+ this.state = n / this.options.duration;
+
+ // Perform the easing function, defaults to swing
+ var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
+ var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
+ this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+};
+
+jQuery.extend( jQuery.fx, {
+ tick: function() {
+ var timers = jQuery.timers;
+
+ for ( var i = 0; i < timers.length; i++ ) {
+ if ( !timers[i]() ) {
+ timers.splice(i--, 1);
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ },
+
+ stop: function() {
+ clearInterval( timerId );
+ timerId = null;
+ },
+
+ speeds: {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+
+ step: {
+ opacity: function( fx ) {
+ jQuery.style(fx.elem, "opacity", fx.now);
+ },
+
+ _default: function( fx ) {
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
+ } else {
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+ }
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+
+function genFx( type, num ) {
+ var obj = {};
+
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+ obj[ this ] = type;
+ });
+
+ return obj;
+}
+if ( "getBoundingClientRect" in document.documentElement ) {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+
+ return { top: top, left: left };
+ };
+
+} else {
+ jQuery.fn.offset = function( options ) {
+ var elem = this[0];
+
+ if ( options ) {
+ return this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
+ if ( elem === elem.ownerDocument.body ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ jQuery.offset.initialize();
+
+ var offsetParent = elem.offsetParent, prevOffsetParent = elem,
+ doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+ body = doc.body, defaultView = doc.defaultView,
+ prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
+ top = elem.offsetTop, left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ break;
+ }
+
+ computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
+ top -= elem.scrollTop;
+ left -= elem.scrollLeft;
+
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop;
+ left += elem.offsetLeft;
+
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+ }
+
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
+ top += parseFloat( computedStyle.borderTopWidth ) || 0;
+ left += parseFloat( computedStyle.borderLeftWidth ) || 0;
+ }
+
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
+ top += body.offsetTop;
+ left += body.offsetLeft;
+ }
+
+ if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
+ top += Math.max( docElem.scrollTop, body.scrollTop );
+ left += Math.max( docElem.scrollLeft, body.scrollLeft );
+ }
+
+ return { top: top, left: left };
+ };
+}
+
+jQuery.offset = {
+ initialize: function() {
+ var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
+ html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+
+ jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
+
+ container.innerHTML = html;
+ body.insertBefore( container, body.firstChild );
+ innerDiv = container.firstChild;
+ checkDiv = innerDiv.firstChild;
+ td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
+ // safari subtracts parent border width here which is 5px
+ this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
+ checkDiv.style.position = checkDiv.style.top = "";
+
+ innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
+
+ body.removeChild( container );
+ body = container = innerDiv = checkDiv = table = td = null;
+ jQuery.offset.initialize = jQuery.noop;
+ },
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop, left = body.offsetLeft;
+
+ jQuery.offset.initialize();
+
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
+ left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ // set position first, in-case top/left are set even on static elem
+ if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
+ elem.style.position = "relative";
+ }
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
+ curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ var props = {
+ top: (options.top - curOffset.top) + curTop,
+ left: (options.left - curOffset.left) + curLeft
+ };
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ if ( !this[0] ) {
+ return null;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
+ offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
+ parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ["Left", "Top"], function( i, name ) {
+ var method = "scroll" + name;
+
+ jQuery.fn[ method ] = function(val) {
+ var elem = this[0], win;
+
+ if ( !elem ) {
+ return null;
+ }
+
+ if ( val !== undefined ) {
+ // Set the scroll offset
+ return this.each(function() {
+ win = getWindow( this );
+
+ if ( win ) {
+ win.scrollTo(
+ !i ? val : jQuery(win).scrollLeft(),
+ i ? val : jQuery(win).scrollTop()
+ );
+
+ } else {
+ this[ method ] = val;
+ }
+ });
+ } else {
+ win = getWindow( elem );
+
+ // Return the scroll offset
+ return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
+ jQuery.support.boxModel && win.document.documentElement[ method ] ||
+ win.document.body[ method ] :
+ elem[ method ];
+ }
+ };
+});
+
+function getWindow( elem ) {
+ return ("scrollTo" in elem && elem.document) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function( i, name ) {
+
+ var type = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function() {
+ return this[0] ?
+ jQuery.css( this[0], type, false, "padding" ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function( margin ) {
+ return this[0] ?
+ jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
+ null;
+ };
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ var elem = this[0];
+ if ( !elem ) {
+ return size == null ? null : this;
+ }
+
+ if ( jQuery.isFunction( size ) ) {
+ return this.each(function( i ) {
+ var self = jQuery( this );
+ self[ type ]( size.call( this, i, self[ type ]() ) );
+ });
+ }
+
+ return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
+ elem.document.body[ "client" + name ] :
+
+ // Get document width or height
+ (elem.nodeType === 9) ? // is it a document
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ Math.max(
+ elem.documentElement["client" + name],
+ elem.body["scroll" + name], elem.documentElement["scroll" + name],
+ elem.body["offset" + name], elem.documentElement["offset" + name]
+ ) :
+
+ // Get or set width or height on the element
+ size === undefined ?
+ // Get width or height on the element
+ jQuery.css( elem, type ) :
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ this.css( type, typeof size === "string" ? size : size + "px" );
+ };
+
+});
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+})(window);
\ No newline at end of file
Added: branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js
===================================================================
--- branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js (rev 0)
+++ branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-09-13 17:43:54 UTC (rev 19177)
@@ -0,0 +1,22 @@
+Push = (function() {
+
+ var connected = false;
+
+ return {
+
+ __callback: function(response) {
+ debugger;
+ },
+
+ connect: function(url, opts) {
+ if (connected) {
+ return ;
+ }
+
+ $.atmosphere.subscribe(url, this.__callback, opts);
+
+ connected = true;
+ }
+ }
+
+}());
\ No newline at end of file
14 years, 3 months
JBoss Rich Faces SVN: r19176 - trunk/ui/input.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-09-13 13:42:47 -0400 (Mon, 13 Sep 2010)
New Revision: 19176
Modified:
trunk/ui/input/
Log:
ignore working files in svn
Property changes on: trunk/ui/input
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
.clover
.externalToolBuilders
14 years, 3 months