JBoss Rich Faces SVN: r22833 - modules/tests/metamer/trunk/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-10-20 06:03:58 -0400 (Thu, 20 Oct 2011)
New Revision: 22833
Modified:
modules/tests/metamer/trunk/ftest/pom.xml
Log:
RFPL-1682: add param values into maven profile to manage resource mapping option
Because of matric job configuration on Jenkins require param value, changing maven profiles to use param value not just param presence.
Modified: modules/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/pom.xml 2011-10-20 10:03:38 UTC (rev 22832)
+++ modules/tests/metamer/trunk/ftest/pom.xml 2011-10-20 10:03:58 UTC (rev 22833)
@@ -447,6 +447,7 @@
<activation>
<property>
<name>org.richfaces.resourceMapping.enabled</name>
+ <value>true</value>
</property>
</activation>
<build>
@@ -465,7 +466,7 @@
<artifactItem>
<groupId>org.richfaces.tests</groupId>
<artifactId>metamer</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>${deployable.version}</version>
<type>war</type>
<classifier>${deployable.classifier}</classifier>
<overWrite>true</overWrite>
@@ -488,6 +489,7 @@
<activation>
<property>
<name>org.richfaces.resourceMapping.enabled</name>
+ <value>true</value>
</property>
</activation>
<build>
@@ -526,6 +528,7 @@
<activation>
<property>
<name>org.richfaces.resourceMapping.compressedStages</name>
+ <value>true</value>
</property>
</activation>
<build>
@@ -563,6 +566,7 @@
<activation>
<property>
<name>org.richfaces.resourceMapping.packedStages</name>
+ <value>true</value>
</property>
</activation>
<build>
@@ -600,6 +604,7 @@
<activation>
<property>
<name>org.richfaces.resourceMapping.enabled</name>
+ <value>true</value>
</property>
</activation>
<build>
13 years, 2 months
JBoss Rich Faces SVN: r22832 - modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-10-20 06:03:38 -0400 (Thu, 20 Oct 2011)
New Revision: 22832
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/eventHandlers.xhtml
Log:
RFPL-1736: Fix rendering output bug in eventHandlers example
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/eventHandlers.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/eventHandlers.xhtml 2011-10-20 09:35:37 UTC (rev 22831)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/eventHandlers.xhtml 2011-10-20 10:03:38 UTC (rev 22832)
@@ -45,12 +45,12 @@
<h:column>
<h:inputText id="simpleText1" value="#{a4jAjaxBean.input}"
valueChangeListener="#{richBean.valueChangeListener}" >
- <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
</h:inputText>
</h:column>
<h:column>
<h:inputText id="simpleText2" value="#{a4jAjaxBean.input}" >
- <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
</h:inputText>
</h:column>
@@ -60,12 +60,12 @@
<h:column>
<rich:autocomplete id="autocomplete1" value="#{a4jAjaxBean.input}"
valueChangeListener="#{richBean.valueChangeListener}" >
- <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
</rich:autocomplete>
</h:column>
<h:column>
<rich:autocomplete id="autocomplete2" value="#{a4jAjaxBean.input}">
- <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
</rich:autocomplete>
</h:column>
@@ -90,12 +90,12 @@
<h:column>
<rich:editor id="editor1" value="#{a4jAjaxBean.input}" width="310px" height="40px"
valueChangeListener="#{richBean.valueChangeListener}" >
- <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
</rich:editor>
</h:column>
<h:column>
<rich:editor id="editor2" value="#{a4jAjaxBean.input}" width="310px" height="40px" >
- <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
</rich:editor>
</h:column>
@@ -169,7 +169,7 @@
</h:panelGrid>
<br/>
- <a4j:outputPanel id="output1" layout="block">
+ <a4j:outputPanel id="output" layout="block">
Output: <h:outputText value="#{a4jAjaxBean.input}"/>
</a4j:outputPanel>
13 years, 2 months
JBoss Rich Faces SVN: r22831 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-10-20 05:35:37 -0400 (Thu, 20 Oct 2011)
New Revision: 22831
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/NotifyTestAttributes.java
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/AbstractRichNotifyTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java
Log:
fixing tests for notify component
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/AbstractRichNotifyTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/AbstractRichNotifyTest.java 2011-10-20 09:00:54 UTC (rev 22830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/AbstractRichNotifyTest.java 2011-10-20 09:35:37 UTC (rev 22831)
@@ -53,6 +53,11 @@
protected final Attributes<NotifyStackAttributes> attributesStack = new Attributes<NotifyStackAttributes>(pjq("table.attributes[id$=attributesNotifyStack]"));
/**
+ * attributes for test
+ */
+ protected final Attributes<NotifyTestAttributes> attributesTest = new Attributes<NotifyTestAttributes>(pjq("table.attributes[id$=attributesBean]"));
+
+ /**
* notify locator which matches on all notifies and messages
*/
protected final JQueryLocator notify = jq("div.rf-ntf");
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/NotifyTestAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/NotifyTestAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/NotifyTestAttributes.java 2011-10-20 09:35:37 UTC (rev 22831)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.ftest.richNotify;
+
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public enum NotifyTestAttributes implements AttributeEnum {
+
+ messageCount,
+ messageDetail,
+ messageText
+
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java 2011-10-20 09:00:54 UTC (rev 22830)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java 2011-10-20 09:35:37 UTC (rev 22831)
@@ -32,12 +32,11 @@
import java.util.Map;
import org.jboss.test.selenium.css.CssProperty;
-import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.NegationCondition;
import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
import org.richfaces.tests.metamer.bean.rich.RichNotifyBean;
-import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -105,52 +104,33 @@
attributesNotify.set(NotifyAttributes.showHistory, true);
assertTrue(selenium.isElementPresent(notifyHistory), "The showHistory is set to <true> and one notify is present, but there is no history menu.");
close(notify);
- produceMessage(notifyError, "Error", 1);
- close(notify);
- close(notify);
// click on the All button in history menu
selenium.click(notifyHistoryAll);
- waitModel
- .failWith("After clicking on <All> in history menu there should be all notifies. Expected <2>, found <" + getNumberOfNotifies() + ">")
- .until(new SeleniumCondition() {
- @Override
- public boolean isTrue() {
- return getNumberOfNotifies() == 2;
- }
- });
+ waitGui
+ .failWith("After clicking on <All> in history menu there should be all notifies.")
+ .until(elementPresent.locator(notify));
close(notify);
- close(notify);
// click on the Last button in the history menu
selenium.click(notifyHistoryLast);
waitModel
- .failWith("After clicking on <Last> in history menu there should be last notify. Expected <1>, found <" + getNumberOfNotifies() + ">")
- .until(new SeleniumCondition() {
- @Override
- public boolean isTrue() {
- return getNumberOfNotifies() == 1;
- }
- });
+ .failWith("After clicking on <Last> in history menu there should be last notify.")
+ .until(elementPresent.locator(notify));
}
@Test
public void testAttributesStayTime() {
// stayTime is set to a very high number
- close(notify);
- produceMessage(notifyError, "Error", 1);
- close(notifyError);
delay(1000);
assertTrue(selenium.isElementPresent(notify), "The stayTime is set to very high number and after some little delay the notify is not present.");
// set the stayTime to <500>
attributesNotify.set(NotifyAttributes.stayTime, 500);
- produceMessage(notifyError, "Error", 1);
- close(notifyError);
// wait for <1000>
delay(1000);
assertFalse(selenium.isElementPresent(notify), "The stayTime is set to 500 but after some delay the notify is still present.");
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11433")
+ @RegressionTest("https://issues.jboss.org/browse/RF-11433")
public void testAttributeSticky() {
// set the stayTime to <0>
attributesNotify.set(NotifyAttributes.stayTime, 0);
@@ -159,7 +139,7 @@
waitGui
.failWith("The stayTime is set to <0> and sticky to <false>, so the notify shouldn't be present.")
.until(NegationCondition.getInstance().condition(elementPresent.locator(notify)));
- // produce messages and notifies and close messages
+ // produce messages and close them
for(String type : messages.keySet()) {
produceMessage(messages.get(type), type, 1);
close(messages.get(type));
@@ -172,20 +152,14 @@
waitGui
.failWith("The stayTime is set to <0> and sticky to <true>, so the notify should be present.")
.until(elementPresent.locator(notify));
- closeAll(notify);
- // produce messages and notifies and close messages
+ // produce messages and close them
for(String type : messages.keySet()) {
produceMessage(messages.get(type), type, 1);
close(messages.get(type));
}
- waitModel
- .failWith("The stayTime is set to <0> and sticky to <true>, so the notifies should be present.")
- .until(new SeleniumCondition() {
- @Override
- public boolean isTrue() {
- return selenium.getCount(notify) == messages.size();
- }
- });
+ waitGui
+ .failWith("The stayTime is set to <0> and sticky to <true>, so the notify should be present.")
+ .until(elementPresent.locator(notify));
}
@Test
@@ -251,17 +225,16 @@
@Test
public void testAttributeMessagesShowHistory() {
// check whether the history isn't present (showHistory is set to <false>)
- close(notify);
assertFalse(selenium.isElementPresent(notifyHistory), "The showHistory is set to <false> and there shouldn't be any history menu.");
// set the showHistory to <true>
attributesMessages.set(NotifyMessagesAttributes.showHistory, true);
+ close(notify);
// check whether the history isn't displayed (there is no message in the history)
assertFalse(selenium.isElementPresent(notifyHistory), "The showHistory is set to <true>, but there is no message, so there shouldn't be any history menu.");
// produce messages and close them
for(String type : messages.keySet()) {
produceMessage(messages.get(type), type, 1);
- close(notify);
- close(notify);
+ close(messages.get(type));
}
// click on All button in the history menu
selenium.click(notifyHistoryAll);
@@ -361,21 +334,21 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11433")
+ @RegressionTest("https://issues.jboss.org/browse/RF-11433")
public void testCloseAndProduceNotify() {
// check closing the notify
close(notify);
waitGui
.failWith("After closing notify message the message is stil present.")
.until(NegationCondition.getInstance().condition(elementPresent.locator(notify)));
- // check producing notifies
+ // check notify is not produced
for(String type : messages.keySet()) {
produceMessage(messages.get(type), type, 1);
close(messages.get(type));
}
waitGui
- .failWith("After producing messages the correct number of notifies isn't present. Expected <" + messages.size() + ">, was <" + selenium.getCount(notify) + ">")
- .until(countEquals.locator(notify).count(messages.size()));
+ .failWith("After producing messages there should be no notify. Expected <0>, was <" + selenium.getCount(notify) + ">")
+ .until(countEquals.locator(notify).count(0));
}
@Test
@@ -387,19 +360,16 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11433")
+ @RegressionTest("https://issues.jboss.org/browse/RF-11433")
public void testProduceMoreMessages() {
// set the messageCount to <testedNumber>
int testedNumber = 3;
- selenium.type(pjq("input[name*=messageCountInput]"), testedNumber + "");
- selenium.fireEvent(pjq("input[name*=messageCountInput]"), Event.BLUR);
- selenium.waitForPageToLoad();
+ attributesTest.set(NotifyTestAttributes.messageCount, testedNumber);
close(notify);
for(String type : messages.keySet()) {
produceMessage(messages.get(type), type, testedNumber);
- assertEquals(getNumberOfNotifies(), 1, "Number of produced messages has been set to <" + testedNumber + "> but number of notifies should be still <1>.");
+ assertEquals(getNumberOfNotifies(), 0, "Number of produced messages has been set to <" + testedNumber + "> but number of notifies should be still <0>.");
closeAll(messages.get(type));
- close(notify);
}
}
}
13 years, 2 months
JBoss Rich Faces SVN: r22830 - modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-10-20 05:00:54 -0400 (Thu, 20 Oct 2011)
New Revision: 22830
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/moreStacks.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/validation.xhtml
Log:
fixed samples for notify component
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/moreStacks.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/moreStacks.xhtml 2011-10-19 21:20:04 UTC (rev 22829)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/moreStacks.xhtml 2011-10-20 09:00:54 UTC (rev 22830)
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">>
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
+>
- <!--
+<!--
JBoss, Home of Professional Open Source
Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
@@ -26,142 +27,122 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
- <ui:composition template="/templates/template.xhtml">
-
- <ui:define name="view">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
-
- <ui:define name="component">
- <h:form>
- <rich:notifyMessages ajaxRendered="true"
- animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
- execute="{@form}"
- for="number1"
- globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
- keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
- interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
- nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
- showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
- showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
- showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
- stack="topRightStack"
- stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
- sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
- styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
- />
- <rich:notifyMessages ajaxRendered="true"
- animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
- execute="{@form}"
- for="number2"
- globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
- keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
- interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
- nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
- showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
- showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
- showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
- stack="bottomRightStack"
- stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
- sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
- styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
- />
-
- <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
- detail="Stack 2 - #{notifyBean.attributesNotify['detail'].value}"
- delay="#{notifyBean.attributesNotify['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
- nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotify['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
- showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
- stack="topRightStack"
- stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
- sticky="#{notifyBean.attributesNotify['sticky'].value}"
- styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
- summary="Stack 2 - #{notifyBean.attributesNotify['summary'].value}"
- />
- <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotify['delay'].value}"
- detail="Stack 2 - #{notifyBean.attributesNotify['detail'].value}"
- hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
- nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotify['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
- showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
- stack="bottomRightStack"
- stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
- sticky="#{notifyBean.attributesNotify['sticky'].value}"
- styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
- summary="Stack 2 - #{notifyBean.attributesNotify['summary'].value}"
- />
-
- <rich:notifyStack id="topRightStack"
- direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
- method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
- position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
- rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
- styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}"
- />
-
- <rich:notifyStack id="bottomRightStack"
- direction="#{notifyBean.attributesNotifyStackSecond['direction'].value}"
- method="#{notifyBean.attributesNotifyStackSecond['method'].value}"
- position="#{notifyBean.attributesNotifyStackSecond['position'].value}"
- rendered="#{notifyBean.attributesNotifyStackSecond['rendered'].value}"
- styleClass="#{notifyBean.attributesNotifyStackSecond['styleClass'].value}"
- />
-
- <h:outputLabel for="number1" value="Number for Stack 1 (from 5 to 10)"/>
- <h:inputText id="number1" required="true">
- <f:validateLongRange minimum="5" maximum="10"/>
- </h:inputText>
- <br />
- <h:outputLabel for="number2" value="Number for Stack 2 (from 5 to 10)"/>
- <h:inputText id="number2" required="true">
- <f:validateLongRange minimum="5" maximum="10"/>
- </h:inputText>
- <br />
- <h:commandButton action="@form" value="h:commandButton Submit" id="hCommandButtonSubmit" />
- <a4j:commandButton action="@form" value="a4j:commandButton Submit" id="a4jCommandButtonSubmit" />
-
- </h:form>
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <h2>Attributes - Notify</h2>
- <metamer:attributes value="#{notifyBean.attributesNotify}" id="attributesNotify" render="panel"/>
- <h2>Attributes - Notify Messages</h2>
- <metamer:attributes value="#{notifyBean.attributesNotifyMessages}" id="attributesNotifyMessages" render="panel"/>
- <h2>Attributes - Notify Stack 1</h2>
- <metamer:attributes value="#{notifyBean.attributesNotifyStackFirst}" id="attributesNotifyStack1" render="panel"/>
- <h2>Attributes - Notify Stack 2</h2>
- <metamer:attributes value="#{notifyBean.attributesNotifyStackSecond}" id="attributesNotifyStack2" render="panel"/>
- </ui:define>
- </ui:composition>
-
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:notifyMessages animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotifyMessages['delay'].value}" execute="{@form}" for="number1"
+ globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
+ keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
+ interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
+ nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
+ showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
+ showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
+ showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}" stack="topRightStack"
+ stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}" />
+ <rich:notifyMessages animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotifyMessages['delay'].value}" execute="{@form}" for="number2"
+ globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
+ keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
+ interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
+ nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
+ showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
+ showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
+ showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}" stack="bottomRightStack"
+ stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}" />
+
+ <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
+ detail="Stack 2 - #{notifyBean.attributesNotify['detail'].value}"
+ delay="#{notifyBean.attributesNotify['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
+ nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotify['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
+ showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotify['showShadow'].value}" stack="topRightStack"
+ stayTime="#{notifyBean.attributesNotify['stayTime'].value}" sticky="#{notifyBean.attributesNotify['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
+ summary="Stack 2 - #{notifyBean.attributesNotify['summary'].value}" />
+ <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotify['delay'].value}"
+ detail="Stack 2 - #{notifyBean.attributesNotify['detail'].value}"
+ hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
+ nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotify['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
+ showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotify['showShadow'].value}" stack="bottomRightStack"
+ stayTime="#{notifyBean.attributesNotify['stayTime'].value}" sticky="#{notifyBean.attributesNotify['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
+ summary="Stack 2 - #{notifyBean.attributesNotify['summary'].value}" />
+
+ <rich:notifyStack id="topRightStack" direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
+ method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
+ position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
+ rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
+ styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}" />
+
+ <rich:notifyStack id="bottomRightStack" direction="#{notifyBean.attributesNotifyStackSecond['direction'].value}"
+ method="#{notifyBean.attributesNotifyStackSecond['method'].value}"
+ position="#{notifyBean.attributesNotifyStackSecond['position'].value}"
+ rendered="#{notifyBean.attributesNotifyStackSecond['rendered'].value}"
+ styleClass="#{notifyBean.attributesNotifyStackSecond['styleClass'].value}" />
+ <h:form>
+ <h:outputLabel for="number1" value="Number for Stack 1 (from 5 to 10)" />
+ <h:inputText id="number1" required="true">
+ <f:validateLongRange minimum="5" maximum="10" />
+ </h:inputText>
+ <br />
+ <h:outputLabel for="number2" value="Number for Stack 2 (from 5 to 10)" />
+ <h:inputText id="number2" required="true">
+ <f:validateLongRange minimum="5" maximum="10" />
+ </h:inputText>
+ <br />
+ <h:commandButton action="@form" value="h:commandButton Submit" id="hCommandButtonSubmit" />
+ <a4j:commandButton action="@form" value="a4j:commandButton Submit" id="a4jCommandButtonSubmit" />
+
+ </h:form>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <h2>Attributes - Notify</h2>
+ <metamer:attributes value="#{notifyBean.attributesNotify}" id="attributesNotify" render="panel" />
+ <h2>Attributes - Notify Messages</h2>
+ <metamer:attributes value="#{notifyBean.attributesNotifyMessages}" id="attributesNotifyMessages" render="panel" />
+ <h2>Attributes - Notify Stack 1</h2>
+ <metamer:attributes value="#{notifyBean.attributesNotifyStackFirst}" id="attributesNotifyStack1" render="panel" />
+ <h2>Attributes - Notify Stack 2</h2>
+ <metamer:attributes value="#{notifyBean.attributesNotifyStackSecond}" id="attributesNotifyStack2" render="panel" />
+ </ui:define>
+</ui:composition>
+
</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/simple.xhtml 2011-10-19 21:20:04 UTC (rev 22829)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/simple.xhtml 2011-10-20 09:00:54 UTC (rev 22830)
@@ -38,57 +38,50 @@
</ui:define>
<ui:define name="component">
- <h:form>
- <a4j:outputPanel ajaxRendered="true">
-
- <rich:notifyStack id="exampleNotifyStack"
- direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
- method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
- position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
- rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
- styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}"
- />
- <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotify['delay'].value}"
- detail="#{notifyBean.attributesNotify['detail'].value}"
- hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
- nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotify['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
- showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
- stack="exampleNotifyStack"
- stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
- sticky="#{notifyBean.attributesNotify['sticky'].value}"
- styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
- summary="#{notifyBean.attributesNotify['summary'].value}"
- />
- <rich:notifyMessages animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
- execute="{@form}"
- for="#{notifyBean.attributesNotifyMessages['for'].value}"
- globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
- keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
- interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
- nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
- showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
- showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
- showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
- stack="exampleNotifyStack"
- stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
- sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
- styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
- />
- </a4j:outputPanel>
- <a4j:commandButton id="produceError" value="Produce Error" action="#{notifyBean.produceError}" execute="@form"/>
+
+ <a4j:outputPanel>
+
+ <rich:notifyStack id="exampleNotifyStack" direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
+ method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
+ position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
+ rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
+ styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}" />
+ <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotify['delay'].value}" detail="#{notifyBean.attributesNotify['detail'].value}"
+ hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
+ nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotify['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
+ showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotify['showShadow'].value}" stack="exampleNotifyStack"
+ stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotify['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
+ summary="#{notifyBean.attributesNotify['summary'].value}" />
+ <rich:notifyMessages animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotifyMessages['delay'].value}" execute="{@form}"
+ for="#{notifyBean.attributesNotifyMessages['for'].value}"
+ globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
+ keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
+ interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
+ nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
+ showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
+ showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
+ showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}" stack="exampleNotifyStack"
+ stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}" />
+ </a4j:outputPanel>
+ <h:form>
+ <a4j:commandButton id="produceError" value="Produce Error" action="#{notifyBean.produceError}" execute="@form" />
<a4j:commandButton id="produceFatal" value="Produce Fatal" action="#{notifyBean.produceFatal}" execute="@form"/>
<a4j:commandButton id="produceInfo" value="Produce Info" action="#{notifyBean.produceInfo}" execute="@form"/>
<a4j:commandButton id="produceWarn" value="Produce Warn" action="#{notifyBean.produceWarn}" execute="@form"/>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/validation.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/validation.xhtml 2011-10-19 21:20:04 UTC (rev 22829)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richNotify/validation.xhtml 2011-10-20 09:00:54 UTC (rev 22830)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:a4j="http://richfaces.org/a4j">
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:a4j="http://richfaces.org/a4j">
- <!--
+<!--
JBoss, Home of Professional Open Source
Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
@@ -26,84 +26,74 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
- <ui:composition template="/templates/template.xhtml">
+<ui:composition template="/templates/template.xhtml">
- <ui:define name="view">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
- <ui:define name="component">
- <h:form>
- <rich:notifyMessages ajaxRendered="true"
- animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotifyMessages['delay'].value}"
- execute="{@form}"
- for="number"
- globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
- hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
- keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
- interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
- nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
- showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
- showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
- showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}"
- stack="exampleNotifyStack"
- stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
- sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
- styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}"
- />
-
- <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
- appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
- delay="#{notifyBean.attributesNotify['delay'].value}"
- detail="#{notifyBean.attributesNotify['detail'].value}"
- hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
- nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
- nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
- rendered="#{notifyBean.attributesNotify['rendered'].value}"
- showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
- showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
- showShadow="#{notifyBean.attributesNotify['showShadow'].value}"
- stack="exampleNotifyStack"
- stayTime="#{notifyBean.attributesNotify['stayTime'].value}"
- sticky="#{notifyBean.attributesNotify['sticky'].value}"
- styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
- summary=" #{notifyBean.attributesNotify['title'].value}"
- />
-
- <rich:notifyStack id="exampleNotifyStack"
- direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
- method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
- position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
- rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
- styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}" />
-
- <h:outputLabel for="number" value="Number (from 5 to 10)"/>
- <h:inputText id="number" required="true">
- <f:validateLongRange minimum="5" maximum="10"/>
- <a4j:ajax event="change" execute="@form"/>
- </h:inputText>
-
- </h:form>
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <h2>Attributes - Notify</h2>
- <metamer:attributes value="#{notifyBean.attributesNotify}" id="attributesNotify" render="panel"/>
- <h2>Attributes - Notify Messages</h2>
- <metamer:attributes value="#{notifyBean.attributesNotifyMessages}" id="attributesNotifyMessages" render="panel"/>
- <h2>Attributes - Notify Stack</h2>
- <metamer:attributes value="#{notifyBean.attributesNotifyStackFirst}" id="attributesNotifyStack" render="panel"/>
- </ui:define>
- </ui:composition>
-
+ <ui:define name="component">
+
+ <rich:notifyMessages animationSpeed="#{notifyBean.attributesNotifyMessages['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotifyMessages['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotifyMessages['delay'].value}" execute="{@form}" for="number"
+ globalOnly="#{notifyBean.attributesNotifyMessages['delay'].value}"
+ hideAnimation="#{notifyBean.attributesNotifyMessages['hideAnimation'].value}"
+ keepTransient="#{notifyBean.attributesNotifyMessages['keepTransient'].value}"
+ interval="#{notifyBean.attributesNotifyMessages['interval'].value}"
+ nonblocking="#{notifyBean.attributesNotifyMessages['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotifyMessages['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotifyMessages['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotifyMessages['showCloseButton'].value}"
+ showDetail="#{notifyBean.attributesNotifyMessages['showDetail'].value}"
+ showHistory="#{notifyBean.attributesNotifyMessages['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotifyMessages['showShadow'].value}"
+ showSummary="#{notifyBean.attributesNotifyMessages['showSummary'].value}" stack="exampleNotifyStack"
+ stayTime="#{notifyBean.attributesNotifyMessages['stayTime'].value}"
+ sticky="#{notifyBean.attributesNotifyMessages['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotifyMessages['styleClass'].value}" />
+
+ <rich:notify animationSpeed="#{notifyBean.attributesNotify['animationSpeed'].value}"
+ appearAnimation="#{notifyBean.attributesNotify['appearAnimation'].value}"
+ delay="#{notifyBean.attributesNotify['delay'].value}" detail="#{notifyBean.attributesNotify['detail'].value}"
+ hideAnimation="#{notifyBean.attributesNotify['hideAnimation'].value}"
+ nonblocking="#{notifyBean.attributesNotify['nonBlocking'].value}"
+ nonblockingOpacity="#{notifyBean.attributesNotify['nonBlockingOpacity'].value}"
+ rendered="#{notifyBean.attributesNotify['rendered'].value}"
+ showCloseButton="#{notifyBean.attributesNotify['showCloseButton'].value}"
+ showHistory="#{notifyBean.attributesNotify['showHistory'].value}"
+ showShadow="#{notifyBean.attributesNotify['showShadow'].value}" stack="exampleNotifyStack"
+ stayTime="#{notifyBean.attributesNotify['stayTime'].value}" sticky="#{notifyBean.attributesNotify['sticky'].value}"
+ styleClass="#{notifyBean.attributesNotify['styleClass'].value}"
+ summary=" #{notifyBean.attributesNotify['title'].value}" />
+
+ <rich:notifyStack id="exampleNotifyStack" direction="#{notifyBean.attributesNotifyStackFirst['direction'].value}"
+ method="#{notifyBean.attributesNotifyStackFirst['method'].value}"
+ position="#{notifyBean.attributesNotifyStackFirst['position'].value}"
+ rendered="#{notifyBean.attributesNotifyStackFirst['rendered'].value}"
+ styleClass="#{notifyBean.attributesNotifyStackFirst['styleClass'].value}" />
+ <h:form>
+ <h:outputLabel for="number" value="Number (from 5 to 10)" />
+ <h:inputText id="number" required="true">
+ <f:validateLongRange minimum="5" maximum="10" />
+ <a4j:ajax event="change" execute="@form" />
+ </h:inputText>
+
+ </h:form>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <h2>Attributes - Notify</h2>
+ <metamer:attributes value="#{notifyBean.attributesNotify}" id="attributesNotify" render="panel" />
+ <h2>Attributes - Notify Messages</h2>
+ <metamer:attributes value="#{notifyBean.attributesNotifyMessages}" id="attributesNotifyMessages" render="panel" />
+ <h2>Attributes - Notify Stack</h2>
+ <metamer:attributes value="#{notifyBean.attributesNotifyStackFirst}" id="attributesNotifyStack" render="panel" />
+ </ui:define>
+</ui:composition>
+
</html>
\ No newline at end of file
13 years, 2 months
JBoss Rich Faces SVN: r22829 - in branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl: src/main/javascript/prototype and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ivassile
Date: 2011-10-19 17:20:04 -0400 (Wed, 19 Oct 2011)
New Revision: 22829
Added:
branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl/src/main/javascript/prototype/prototype-1.7.js
Modified:
branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl/generatescript.xml
Log:
Fix for RFPL-1737.
Modified: branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl/generatescript.xml
===================================================================
--- branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl/generatescript.xml 2011-10-19 19:22:49 UTC (rev 22828)
+++ branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl/generatescript.xml 2011-10-19 21:20:04 UTC (rev 22829)
@@ -61,7 +61,7 @@
<filelist id="prototype"
dir="${basedir}/src/main/javascript/prototype"
- files="prototype-1.6.0.3.js,../memory.js,patches.js">
+ files="prototype-1.7.js,../memory.js,patches.js">
</filelist>
Added: branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl/src/main/javascript/prototype/prototype-1.7.js
===================================================================
--- branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl/src/main/javascript/prototype/prototype-1.7.js (rev 0)
+++ branches/enterprise/3.3.1.SP3_RFPL-1737/framework/impl/src/main/javascript/prototype/prototype-1.7.js 2011-10-19 21:20:04 UTC (rev 22829)
@@ -0,0 +1,6082 @@
+/* Prototype JavaScript framework, version 1.7
+ * (c) 2005-2010 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+ *--------------------------------------------------------------------------*/
+
+var Prototype = {
+
+ Version: '1.7',
+
+ Browser: (function(){
+ var ua = navigator.userAgent;
+ var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
+ return {
+ IE: !!window.attachEvent && !isOpera,
+ Opera: isOpera,
+ WebKit: ua.indexOf('AppleWebKit/') > -1,
+ Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
+ MobileSafari: /Apple.*Mobile/.test(ua)
+ }
+ })(),
+
+ BrowserFeatures: {
+ XPath: !!document.evaluate,
+
+ SelectorsAPI: !!document.querySelector,
+
+ ElementExtensions: (function() {
+ var constructor = window.Element || window.HTMLElement;
+ return !!(constructor && constructor.prototype);
+ })(),
+ SpecificElementExtensions: (function() {
+ if (typeof window.HTMLDivElement !== 'undefined')
+ return true;
+
+ var div = document.createElement('div'),
+ form = document.createElement('form'),
+ isSupported = false;
+
+ if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
+ isSupported = true;
+ }
+
+ div = form = null;
+
+ return isSupported;
+ })()
+ },
+
+ ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
+ JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
+
+ emptyFunction: function() { },
+
+ K: function(x) { return x }
+};
+
+if (Prototype.Browser.MobileSafari)
+ Prototype.BrowserFeatures.SpecificElementExtensions = false;
+
+
+var Abstract = { };
+
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) { }
+ }
+
+ return returnValue;
+ }
+};
+
+/* Based on Alex Arnell's inheritance implementation. */
+
+var Class = (function() {
+
+ var IS_DONTENUM_BUGGY = (function(){
+ for (var p in { toString: 1 }) {
+ if (p === 'toString') return false;
+ }
+ return true;
+ })();
+
+ function subclass() {};
+ function create() {
+ var parent = null, properties = $A(arguments);
+ if (Object.isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ Object.extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0, length = properties.length; i < length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = Prototype.emptyFunction;
+
+ klass.prototype.constructor = klass;
+ return klass;
+ }
+
+ function addMethods(source) {
+ var ancestor = this.superclass && this.superclass.prototype,
+ properties = Object.keys(source);
+
+ if (IS_DONTENUM_BUGGY) {
+ if (source.toString != Object.prototype.toString)
+ properties.push("toString");
+ if (source.valueOf != Object.prototype.valueOf)
+ properties.push("valueOf");
+ }
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && Object.isFunction(value) &&
+ value.argumentNames()[0] == "$super") {
+ var method = value;
+ value = (function(m) {
+ return function() { return ancestor[m].apply(this, arguments); };
+ })(property).wrap(method);
+
+ value.valueOf = method.valueOf.bind(method);
+ value.toString = method.toString.bind(method);
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+
+ return {
+ create: create,
+ Methods: {
+ addMethods: addMethods
+ }
+ };
+})();
+(function() {
+
+ var _toString = Object.prototype.toString,
+ NULL_TYPE = 'Null',
+ UNDEFINED_TYPE = 'Undefined',
+ BOOLEAN_TYPE = 'Boolean',
+ NUMBER_TYPE = 'Number',
+ STRING_TYPE = 'String',
+ OBJECT_TYPE = 'Object',
+ FUNCTION_CLASS = '[object Function]',
+ BOOLEAN_CLASS = '[object Boolean]',
+ NUMBER_CLASS = '[object Number]',
+ STRING_CLASS = '[object String]',
+ ARRAY_CLASS = '[object Array]',
+ DATE_CLASS = '[object Date]',
+ NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON &&
+ typeof JSON.stringify === 'function' &&
+ JSON.stringify(0) === '0' &&
+ typeof JSON.stringify(Prototype.K) === 'undefined';
+
+ function Type(o) {
+ switch(o) {
+ case null: return NULL_TYPE;
+ case (void 0): return UNDEFINED_TYPE;
+ }
+ var type = typeof o;
+ switch(type) {
+ case 'boolean': return BOOLEAN_TYPE;
+ case 'number': return NUMBER_TYPE;
+ case 'string': return STRING_TYPE;
+ }
+ return OBJECT_TYPE;
+ }
+
+ function extend(destination, source) {
+ for (var property in source)
+ destination[property] = source[property];
+ return destination;
+ }
+
+ function inspect(object) {
+ try {
+ if (isUndefined(object)) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : String(object);
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ }
+
+ function toJSON(value) {
+ return Str('', { '': value }, []);
+ }
+
+ function Str(key, holder, stack) {
+ var value = holder[key],
+ type = typeof value;
+
+ if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+ var _class = _toString.call(value);
+
+ switch (_class) {
+ case NUMBER_CLASS:
+ case BOOLEAN_CLASS:
+ case STRING_CLASS:
+ value = value.valueOf();
+ }
+
+ switch (value) {
+ case null: return 'null';
+ case true: return 'true';
+ case false: return 'false';
+ }
+
+ type = typeof value;
+ switch (type) {
+ case 'string':
+ return value.inspect(true);
+ case 'number':
+ return isFinite(value) ? String(value) : 'null';
+ case 'object':
+
+ for (var i = 0, length = stack.length; i < length; i++) {
+ if (stack[i] === value) { throw new TypeError(); }
+ }
+ stack.push(value);
+
+ var partial = [];
+ if (_class === ARRAY_CLASS) {
+ for (var i = 0, length = value.length; i < length; i++) {
+ var str = Str(i, value, stack);
+ partial.push(typeof str === 'undefined' ? 'null' : str);
+ }
+ partial = '[' + partial.join(',') + ']';
+ } else {
+ var keys = Object.keys(value);
+ for (var i = 0, length = keys.length; i < length; i++) {
+ var key = keys[i], str = Str(key, value, stack);
+ if (typeof str !== "undefined") {
+ partial.push(key.inspect(true)+ ':' + str);
+ }
+ }
+ partial = '{' + partial.join(',') + '}';
+ }
+ stack.pop();
+ return partial;
+ }
+ }
+
+ function stringify(object) {
+ return JSON.stringify(object);
+ }
+
+ function toQueryString(object) {
+ return $H(object).toQueryString();
+ }
+
+ function toHTML(object) {
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
+ }
+
+ function keys(object) {
+ if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); }
+ var results = [];
+ for (var property in object) {
+ if (object.hasOwnProperty(property)) {
+ results.push(property);
+ }
+ }
+ return results;
+ }
+
+ function values(object) {
+ var results = [];
+ for (var property in object)
+ results.push(object[property]);
+ return results;
+ }
+
+ function clone(object) {
+ return extend({ }, object);
+ }
+
+ function isElement(object) {
+ return !!(object && object.nodeType == 1);
+ }
+
+ function isArray(object) {
+ return _toString.call(object) === ARRAY_CLASS;
+ }
+
+ var hasNativeIsArray = (typeof Array.isArray == 'function')
+ && Array.isArray([]) && !Array.isArray({});
+
+ if (hasNativeIsArray) {
+ isArray = Array.isArray;
+ }
+
+ function isHash(object) {
+ return object instanceof Hash;
+ }
+
+ function isFunction(object) {
+ return _toString.call(object) === FUNCTION_CLASS;
+ }
+
+ function isString(object) {
+ return _toString.call(object) === STRING_CLASS;
+ }
+
+ function isNumber(object) {
+ return _toString.call(object) === NUMBER_CLASS;
+ }
+
+ function isDate(object) {
+ return _toString.call(object) === DATE_CLASS;
+ }
+
+ function isUndefined(object) {
+ return typeof object === "undefined";
+ }
+
+ extend(Object, {
+ extend: extend,
+ inspect: inspect,
+ toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON,
+ toQueryString: toQueryString,
+ toHTML: toHTML,
+ keys: Object.keys || keys,
+ values: values,
+ clone: clone,
+ isElement: isElement,
+ isArray: isArray,
+ isHash: isHash,
+ isFunction: isFunction,
+ isString: isString,
+ isNumber: isNumber,
+ isDate: isDate,
+ isUndefined: isUndefined
+ });
+})();
+Object.extend(Function.prototype, (function() {
+ var slice = Array.prototype.slice;
+
+ function update(array, args) {
+ var arrayLength = array.length, length = args.length;
+ while (length--) array[arrayLength + length] = args[length];
+ return array;
+ }
+
+ function merge(array, args) {
+ array = slice.call(array, 0);
+ return update(array, args);
+ }
+
+ function argumentNames() {
+ var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
+ .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
+ .replace(/\s+/g, '').split(',');
+ return names.length == 1 && !names[0] ? [] : names;
+ }
+
+ function bind(context) {
+ if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
+ var __method = this, args = slice.call(arguments, 1);
+ return function() {
+ var a = merge(args, arguments);
+ return __method.apply(context, a);
+ }
+ }
+
+ function bindAsEventListener(context) {
+ var __method = this, args = slice.call(arguments, 1);
+ return function(event) {
+ var a = update([event || window.event], args);
+ return __method.apply(context, a);
+ }
+ }
+
+ function curry() {
+ if (!arguments.length) return this;
+ var __method = this, args = slice.call(arguments, 0);
+ return function() {
+ var a = merge(args, arguments);
+ return __method.apply(this, a);
+ }
+ }
+
+ function delay(timeout) {
+ var __method = this, args = slice.call(arguments, 1);
+ timeout = timeout * 1000;
+ return window.setTimeout(function() {
+ return __method.apply(__method, args);
+ }, timeout);
+ }
+
+ function defer() {
+ var args = update([0.01], arguments);
+ return this.delay.apply(this, args);
+ }
+
+ function wrap(wrapper) {
+ var __method = this;
+ return function() {
+ var a = update([__method.bind(this)], arguments);
+ return wrapper.apply(this, a);
+ }
+ }
+
+ function methodize() {
+ if (this._methodized) return this._methodized;
+ var __method = this;
+ return this._methodized = function() {
+ var a = update([this], arguments);
+ return __method.apply(null, a);
+ };
+ }
+
+ return {
+ argumentNames: argumentNames,
+ bind: bind,
+ bindAsEventListener: bindAsEventListener,
+ curry: curry,
+ delay: delay,
+ defer: defer,
+ wrap: wrap,
+ methodize: methodize
+ }
+})());
+
+
+
+(function(proto) {
+
+
+ function toISOString() {
+ return this.getUTCFullYear() + '-' +
+ (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
+ this.getUTCDate().toPaddedString(2) + 'T' +
+ this.getUTCHours().toPaddedString(2) + ':' +
+ this.getUTCMinutes().toPaddedString(2) + ':' +
+ this.getUTCSeconds().toPaddedString(2) + 'Z';
+ }
+
+
+ function toJSON() {
+ return this.toISOString();
+ }
+
+ if (!proto.toISOString) proto.toISOString = toISOString;
+ if (!proto.toJSON) proto.toJSON = toJSON;
+
+})(Date.prototype);
+
+
+RegExp.prototype.match = RegExp.prototype.test;
+
+RegExp.escape = function(str) {
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+var PeriodicalExecuter = Class.create({
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ execute: function() {
+ this.callback(this);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.execute();
+ this.currentlyExecuting = false;
+ } catch(e) {
+ this.currentlyExecuting = false;
+ throw e;
+ }
+ }
+ }
+});
+Object.extend(String, {
+ interpret: function(value) {
+ return value == null ? '' : String(value);
+ },
+ specialChar: {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '\\': '\\\\'
+ }
+});
+
+Object.extend(String.prototype, (function() {
+ var NATIVE_JSON_PARSE_SUPPORT = window.JSON &&
+ typeof JSON.parse === 'function' &&
+ JSON.parse('{"test": true}').test;
+
+ function prepareReplacement(replacement) {
+ if (Object.isFunction(replacement)) return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+ }
+
+ function gsub(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = prepareReplacement(replacement);
+
+ if (Object.isString(pattern))
+ pattern = RegExp.escape(pattern);
+
+ if (!(pattern.length || pattern.source)) {
+ replacement = replacement('');
+ return replacement + source.split('').join(replacement) + replacement;
+ }
+
+ while (source.length > 0) {
+ if (match = source.match(pattern)) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ }
+
+ function sub(pattern, replacement, count) {
+ replacement = prepareReplacement(replacement);
+ count = Object.isUndefined(count) ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ }
+
+ function scan(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return String(this);
+ }
+
+ function truncate(length, truncation) {
+ length = length || 30;
+ truncation = Object.isUndefined(truncation) ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : String(this);
+ }
+
+ function strip() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ }
+
+ function stripTags() {
+ return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
+ }
+
+ function stripScripts() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ }
+
+ function extractScripts() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img'),
+ matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ }
+
+ function evalScripts() {
+ return this.extractScripts().map(function(script) { return eval(script) });
+ }
+
+ function escapeHTML() {
+ return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
+ }
+
+ function unescapeHTML() {
+ return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');
+ }
+
+
+ function toQueryParams(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return { };
+
+ return match[1].split(separator || '&').inject({ }, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var key = decodeURIComponent(pair.shift()),
+ value = pair.length > 1 ? pair.join('=') : pair[0];
+
+ if (value != undefined) value = decodeURIComponent(value);
+
+ if (key in hash) {
+ if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
+ hash[key].push(value);
+ }
+ else hash[key] = value;
+ }
+ return hash;
+ });
+ }
+
+ function toArray() {
+ return this.split('');
+ }
+
+ function succ() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ }
+
+ function times(count) {
+ return count < 1 ? '' : new Array(count + 1).join(this);
+ }
+
+ function camelize() {
+ return this.replace(/-+(.)?/g, function(match, chr) {
+ return chr ? chr.toUpperCase() : '';
+ });
+ }
+
+ function capitalize() {
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ }
+
+ function underscore() {
+ return this.replace(/::/g, '/')
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
+ .replace(/([a-z\d])([A-Z])/g, '$1_$2')
+ .replace(/-/g, '_')
+ .toLowerCase();
+ }
+
+ function dasherize() {
+ return this.replace(/_/g, '-');
+ }
+
+ function inspect(useDoubleQuotes) {
+ var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) {
+ if (character in String.specialChar) {
+ return String.specialChar[character];
+ }
+ return '\\u00' + character.charCodeAt().toPaddedString(2, 16);
+ });
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ }
+
+ function unfilterJSON(filter) {
+ return this.replace(filter || Prototype.JSONFilter, '$1');
+ }
+
+ function isJSON() {
+ var str = this;
+ if (str.blank()) return false;
+ str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@');
+ str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
+ str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
+ return (/^[\],:{}\s]*$/).test(str);
+ }
+
+ function evalJSON(sanitize) {
+ var json = this.unfilterJSON(),
+ cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
+ if (cx.test(json)) {
+ json = json.replace(cx, function (a) {
+ return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+ try {
+ if (!sanitize || json.isJSON()) return eval('(' + json + ')');
+ } catch (e) { }
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+ }
+
+ function parseJSON() {
+ var json = this.unfilterJSON();
+ return JSON.parse(json);
+ }
+
+ function include(pattern) {
+ return this.indexOf(pattern) > -1;
+ }
+
+ function startsWith(pattern) {
+ return this.lastIndexOf(pattern, 0) === 0;
+ }
+
+ function endsWith(pattern) {
+ var d = this.length - pattern.length;
+ return d >= 0 && this.indexOf(pattern, d) === d;
+ }
+
+ function empty() {
+ return this == '';
+ }
+
+ function blank() {
+ return /^\s*$/.test(this);
+ }
+
+ function interpolate(object, pattern) {
+ return new Template(this, pattern).evaluate(object);
+ }
+
+ return {
+ gsub: gsub,
+ sub: sub,
+ scan: scan,
+ truncate: truncate,
+ strip: String.prototype.trim || strip,
+ stripTags: stripTags,
+ stripScripts: stripScripts,
+ extractScripts: extractScripts,
+ evalScripts: evalScripts,
+ escapeHTML: escapeHTML,
+ unescapeHTML: unescapeHTML,
+ toQueryParams: toQueryParams,
+ parseQuery: toQueryParams,
+ toArray: toArray,
+ succ: succ,
+ times: times,
+ camelize: camelize,
+ capitalize: capitalize,
+ underscore: underscore,
+ dasherize: dasherize,
+ inspect: inspect,
+ unfilterJSON: unfilterJSON,
+ isJSON: isJSON,
+ evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON,
+ include: include,
+ startsWith: startsWith,
+ endsWith: endsWith,
+ empty: empty,
+ blank: blank,
+ interpolate: interpolate
+ };
+})());
+
+var Template = Class.create({
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ if (object && Object.isFunction(object.toTemplateReplacements))
+ object = object.toTemplateReplacements();
+
+ return this.template.gsub(this.pattern, function(match) {
+ if (object == null) return (match[1] + '');
+
+ var before = match[1] || '';
+ if (before == '\\') return match[2];
+
+ var ctx = object, expr = match[3],
+ pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+
+ match = pattern.exec(expr);
+ if (match == null) return before;
+
+ while (match != null) {
+ var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1];
+ ctx = ctx[comp];
+ if (null == ctx || '' == match[3]) break;
+ expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
+ match = pattern.exec(expr);
+ }
+
+ return before + String.interpret(ctx);
+ });
+ }
+});
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+
+var $break = { };
+
+var Enumerable = (function() {
+ function each(iterator, context) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ iterator.call(context, value, index++);
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ }
+
+ function eachSlice(number, iterator, context) {
+ var index = -number, slices = [], array = this.toArray();
+ if (number < 1) return array;
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.collect(iterator, context);
+ }
+
+ function all(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!iterator.call(context, value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ }
+
+ function any(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!iterator.call(context, value, index))
+ throw $break;
+ });
+ return result;
+ }
+
+ function collect(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+ this.each(function(value, index) {
+ results.push(iterator.call(context, value, index));
+ });
+ return results;
+ }
+
+ function detect(iterator, context) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ }
+
+ function findAll(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index))
+ results.push(value);
+ });
+ return results;
+ }
+
+ function grep(filter, iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+
+ if (Object.isString(filter))
+ filter = new RegExp(RegExp.escape(filter));
+
+ this.each(function(value, index) {
+ if (filter.match(value))
+ results.push(iterator.call(context, value, index));
+ });
+ return results;
+ }
+
+ function include(object) {
+ if (Object.isFunction(this.indexOf))
+ if (this.indexOf(object) != -1) return true;
+
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ }
+
+ function inGroupsOf(number, fillWith) {
+ fillWith = Object.isUndefined(fillWith) ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ }
+
+ function inject(memo, iterator, context) {
+ this.each(function(value, index) {
+ memo = iterator.call(context, memo, value, index);
+ });
+ return memo;
+ }
+
+ function invoke(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ }
+
+ function max(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index);
+ if (result == null || value >= result)
+ result = value;
+ });
+ return result;
+ }
+
+ function min(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index);
+ if (result == null || value < result)
+ result = value;
+ });
+ return result;
+ }
+
+ function partition(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ (iterator.call(context, value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ }
+
+ function pluck(property) {
+ var results = [];
+ this.each(function(value) {
+ results.push(value[property]);
+ });
+ return results;
+ }
+
+ function reject(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator.call(context, value, index))
+ results.push(value);
+ });
+ return results;
+ }
+
+ function sortBy(iterator, context) {
+ return this.map(function(value, index) {
+ return {
+ value: value,
+ criteria: iterator.call(context, value, index)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ }
+
+ function toArray() {
+ return this.map();
+ }
+
+ function zip() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (Object.isFunction(args.last()))
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ }
+
+ function size() {
+ return this.toArray().length;
+ }
+
+ function inspect() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+
+
+
+
+
+
+
+
+
+ return {
+ each: each,
+ eachSlice: eachSlice,
+ all: all,
+ every: all,
+ any: any,
+ some: any,
+ collect: collect,
+ map: collect,
+ detect: detect,
+ findAll: findAll,
+ select: findAll,
+ filter: findAll,
+ grep: grep,
+ include: include,
+ member: include,
+ inGroupsOf: inGroupsOf,
+ inject: inject,
+ invoke: invoke,
+ max: max,
+ min: min,
+ partition: partition,
+ pluck: pluck,
+ reject: reject,
+ sortBy: sortBy,
+ toArray: toArray,
+ entries: toArray,
+ zip: zip,
+ size: size,
+ inspect: inspect,
+ find: detect
+ };
+})();
+
+function $A(iterable) {
+ if (!iterable) return [];
+ if ('toArray' in Object(iterable)) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+}
+
+
+function $w(string) {
+ if (!Object.isString(string)) return [];
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+Array.from = $A;
+
+
+(function() {
+ var arrayProto = Array.prototype,
+ slice = arrayProto.slice,
+ _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available
+
+ function each(iterator, context) {
+ for (var i = 0, length = this.length >>> 0; i < length; i++) {
+ if (i in this) iterator.call(context, this[i], i, this);
+ }
+ }
+ if (!_each) _each = each;
+
+ function clear() {
+ this.length = 0;
+ return this;
+ }
+
+ function first() {
+ return this[0];
+ }
+
+ function last() {
+ return this[this.length - 1];
+ }
+
+ function compact() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ }
+
+ function flatten() {
+ return this.inject([], function(array, value) {
+ if (Object.isArray(value))
+ return array.concat(value.flatten());
+ array.push(value);
+ return array;
+ });
+ }
+
+ function without() {
+ var values = slice.call(arguments, 0);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ }
+
+ function reverse(inline) {
+ return (inline === false ? this.toArray() : this)._reverse();
+ }
+
+ function uniq(sorted) {
+ return this.inject([], function(array, value, index) {
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+ array.push(value);
+ return array;
+ });
+ }
+
+ function intersect(array) {
+ return this.uniq().findAll(function(item) {
+ return array.detect(function(value) { return item === value });
+ });
+ }
+
+
+ function clone() {
+ return slice.call(this, 0);
+ }
+
+ function size() {
+ return this.length;
+ }
+
+ function inspect() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ }
+
+ function indexOf(item, i) {
+ i || (i = 0);
+ var length = this.length;
+ if (i < 0) i = length + i;
+ for (; i < length; i++)
+ if (this[i] === item) return i;
+ return -1;
+ }
+
+ function lastIndexOf(item, i) {
+ i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
+ var n = this.slice(0, i).reverse().indexOf(item);
+ return (n < 0) ? n : i - n - 1;
+ }
+
+ function concat() {
+ var array = slice.call(this, 0), item;
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ item = arguments[i];
+ if (Object.isArray(item) && !('callee' in item)) {
+ for (var j = 0, arrayLength = item.length; j < arrayLength; j++)
+ array.push(item[j]);
+ } else {
+ array.push(item);
+ }
+ }
+ return array;
+ }
+
+ Object.extend(arrayProto, Enumerable);
+
+ if (!arrayProto._reverse)
+ arrayProto._reverse = arrayProto.reverse;
+
+ Object.extend(arrayProto, {
+ _each: _each,
+ clear: clear,
+ first: first,
+ last: last,
+ compact: compact,
+ flatten: flatten,
+ without: without,
+ reverse: reverse,
+ uniq: uniq,
+ intersect: intersect,
+ clone: clone,
+ toArray: clone,
+ size: size,
+ inspect: inspect
+ });
+
+ var CONCAT_ARGUMENTS_BUGGY = (function() {
+ return [].concat(arguments)[0][0] !== 1;
+ })(1,2)
+
+ if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
+
+ if (!arrayProto.indexOf) arrayProto.indexOf = indexOf;
+ if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf;
+})();
+function $H(object) {
+ return new Hash(object);
+};
+
+var Hash = Class.create(Enumerable, (function() {
+ function initialize(object) {
+ this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
+ }
+
+
+ function _each(iterator) {
+ for (var key in this._object) {
+ var value = this._object[key], pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ }
+
+ function set(key, value) {
+ return this._object[key] = value;
+ }
+
+ function get(key) {
+ if (this._object[key] !== Object.prototype[key])
+ return this._object[key];
+ }
+
+ function unset(key) {
+ var value = this._object[key];
+ delete this._object[key];
+ return value;
+ }
+
+ function toObject() {
+ return Object.clone(this._object);
+ }
+
+
+
+ function keys() {
+ return this.pluck('key');
+ }
+
+ function values() {
+ return this.pluck('value');
+ }
+
+ function index(value) {
+ var match = this.detect(function(pair) {
+ return pair.value === value;
+ });
+ return match && match.key;
+ }
+
+ function merge(object) {
+ return this.clone().update(object);
+ }
+
+ function update(object) {
+ return new Hash(object).inject(this, function(result, pair) {
+ result.set(pair.key, pair.value);
+ return result;
+ });
+ }
+
+ function toQueryPair(key, value) {
+ if (Object.isUndefined(value)) return key;
+ return key + '=' + encodeURIComponent(String.interpret(value));
+ }
+
+ function toQueryString() {
+ return this.inject([], function(results, pair) {
+ var key = encodeURIComponent(pair.key), values = pair.value;
+
+ if (values && typeof values == 'object') {
+ if (Object.isArray(values)) {
+ var queryValues = [];
+ for (var i = 0, len = values.length, value; i < len; i++) {
+ value = values[i];
+ queryValues.push(toQueryPair(key, value));
+ }
+ return results.concat(queryValues);
+ }
+ } else results.push(toQueryPair(key, values));
+ return results;
+ }).join('&');
+ }
+
+ function inspect() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ }
+
+ function clone() {
+ return new Hash(this);
+ }
+
+ return {
+ initialize: initialize,
+ _each: _each,
+ set: set,
+ get: get,
+ unset: unset,
+ toObject: toObject,
+ toTemplateReplacements: toObject,
+ keys: keys,
+ values: values,
+ index: index,
+ merge: merge,
+ update: update,
+ toQueryString: toQueryString,
+ inspect: inspect,
+ toJSON: toObject,
+ clone: clone
+ };
+})());
+
+Hash.from = $H;
+Object.extend(Number.prototype, (function() {
+ function toColorPart() {
+ return this.toPaddedString(2, 16);
+ }
+
+ function succ() {
+ return this + 1;
+ }
+
+ function times(iterator, context) {
+ $R(0, this, true).each(iterator, context);
+ return this;
+ }
+
+ function toPaddedString(length, radix) {
+ var string = this.toString(radix || 10);
+ return '0'.times(length - string.length) + string;
+ }
+
+ function abs() {
+ return Math.abs(this);
+ }
+
+ function round() {
+ return Math.round(this);
+ }
+
+ function ceil() {
+ return Math.ceil(this);
+ }
+
+ function floor() {
+ return Math.floor(this);
+ }
+
+ return {
+ toColorPart: toColorPart,
+ succ: succ,
+ times: times,
+ toPaddedString: toPaddedString,
+ abs: abs,
+ round: round,
+ ceil: ceil,
+ floor: floor
+ };
+})());
+
+function $R(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+}
+
+var ObjectRange = Class.create(Enumerable, (function() {
+ function initialize(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ }
+
+ function _each(iterator) {
+ var value = this.start;
+ while (this.include(value)) {
+ iterator(value);
+ value = value.succ();
+ }
+ }
+
+ function include(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+
+ return {
+ initialize: initialize,
+ _each: _each,
+ include: include
+ };
+})());
+
+
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+};
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (Object.isFunction(responder[callback])) {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) { }
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() { Ajax.activeRequestCount++ },
+ onComplete: function() { Ajax.activeRequestCount-- }
+});
+Ajax.Base = Class.create({
+ initialize: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: '',
+ evalJSON: true,
+ evalJS: true
+ };
+ Object.extend(this.options, options || { });
+
+ this.options.method = this.options.method.toLowerCase();
+
+ if (Object.isHash(this.options.parameters))
+ this.options.parameters = this.options.parameters.toObject();
+ }
+});
+Ajax.Request = Class.create(Ajax.Base, {
+ _complete: false,
+
+ initialize: function($super, url, options) {
+ $super(options);
+ this.transport = Ajax.getTransport();
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = Object.isString(this.options.parameters) ?
+ this.options.parameters :
+ Object.toQueryString(this.options.parameters);
+
+ if (!['get', 'post'].include(this.method)) {
+ params += (params ? '&' : '') + "_method=" + this.method;
+ this.method = 'post';
+ }
+
+ if (params && this.method === 'get') {
+ this.url += (this.url.include('?') ? '&' : '?') + params;
+ }
+
+ this.parameters = params.toQueryParams();
+
+ try {
+ var response = new Ajax.Response(this);
+ if (this.options.onCreate) this.options.onCreate(response);
+ Ajax.Responders.dispatch('onCreate', this, response);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+ this.transport.send(this.body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (Object.isFunction(extras.push))
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ var status = this.getStatus();
+ return !status || (status >= 200 && status < 300) || status == 304;
+ },
+
+ getStatus: function() {
+ try {
+ if (this.transport.status === 1223) return 204;
+ return this.transport.status || 0;
+ } catch (e) { return 0 }
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + response.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ var contentType = response.getHeader('Content-type');
+ if (this.options.evalJS == 'force'
+ || (this.options.evalJS && this.isSameOrigin() && contentType
+ && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
+ Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ isSameOrigin: function() {
+ var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
+ return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
+ protocol: location.protocol,
+ domain: document.domain,
+ port: location.port ? ':' + location.port : ''
+ }));
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name) || null;
+ } catch (e) { return null; }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval((this.transport.responseText || '').unfilterJSON());
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+
+
+
+
+
+
+
+Ajax.Response = Class.create({
+ initialize: function(request){
+ this.request = request;
+ var transport = this.transport = request.transport,
+ readyState = this.readyState = transport.readyState;
+
+ if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+ this.status = this.getStatus();
+ this.statusText = this.getStatusText();
+ this.responseText = String.interpret(transport.responseText);
+ this.headerJSON = this._getHeaderJSON();
+ }
+
+ if (readyState == 4) {
+ var xml = transport.responseXML;
+ this.responseXML = Object.isUndefined(xml) ? null : xml;
+ this.responseJSON = this._getResponseJSON();
+ }
+ },
+
+ status: 0,
+
+ statusText: '',
+
+ getStatus: Ajax.Request.prototype.getStatus,
+
+ getStatusText: function() {
+ try {
+ return this.transport.statusText || '';
+ } catch (e) { return '' }
+ },
+
+ getHeader: Ajax.Request.prototype.getHeader,
+
+ getAllHeaders: function() {
+ try {
+ return this.getAllResponseHeaders();
+ } catch (e) { return null }
+ },
+
+ getResponseHeader: function(name) {
+ return this.transport.getResponseHeader(name);
+ },
+
+ getAllResponseHeaders: function() {
+ return this.transport.getAllResponseHeaders();
+ },
+
+ _getHeaderJSON: function() {
+ var json = this.getHeader('X-JSON');
+ if (!json) return null;
+ json = decodeURIComponent(escape(json));
+ try {
+ return json.evalJSON(this.request.options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ },
+
+ _getResponseJSON: function() {
+ var options = this.request.options;
+ if (!options.evalJSON || (options.evalJSON != 'force' &&
+ !(this.getHeader('Content-type') || '').include('application/json')) ||
+ this.responseText.blank())
+ return null;
+ try {
+ return this.responseText.evalJSON(options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ }
+});
+
+Ajax.Updater = Class.create(Ajax.Request, {
+ initialize: function($super, container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ };
+
+ options = Object.clone(options);
+ var onComplete = options.onComplete;
+ options.onComplete = (function(response, json) {
+ this.updateContent(response.responseText);
+ if (Object.isFunction(onComplete)) onComplete(response, json);
+ }).bind(this);
+
+ $super(url, options);
+ },
+
+ updateContent: function(responseText) {
+ var receiver = this.container[this.success() ? 'success' : 'failure'],
+ options = this.options;
+
+ if (!options.evalScripts) responseText = responseText.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (options.insertion) {
+ if (Object.isString(options.insertion)) {
+ var insertion = { }; insertion[options.insertion] = responseText;
+ receiver.insert(insertion);
+ }
+ else options.insertion(receiver, responseText);
+ }
+ else receiver.update(responseText);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
+ initialize: function($super, container, url, options) {
+ $super(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = { };
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(response) {
+ if (this.options.decay) {
+ this.decay = (response.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = response.responseText;
+ }
+ this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+
+
+function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+ if (Object.isString(element))
+ element = document.getElementById(element);
+ return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+ document._getElementsByXPath = function(expression, parentElement) {
+ var results = [];
+ var query = document.evaluate(expression, $(parentElement) || document,
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
+ results.push(Element.extend(query.snapshotItem(i)));
+ return results;
+ };
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!Node) var Node = { };
+
+if (!Node.ELEMENT_NODE) {
+ Object.extend(Node, {
+ ELEMENT_NODE: 1,
+ ATTRIBUTE_NODE: 2,
+ TEXT_NODE: 3,
+ CDATA_SECTION_NODE: 4,
+ ENTITY_REFERENCE_NODE: 5,
+ ENTITY_NODE: 6,
+ PROCESSING_INSTRUCTION_NODE: 7,
+ COMMENT_NODE: 8,
+ DOCUMENT_NODE: 9,
+ DOCUMENT_TYPE_NODE: 10,
+ DOCUMENT_FRAGMENT_NODE: 11,
+ NOTATION_NODE: 12
+ });
+}
+
+
+
+(function(global) {
+ function shouldUseCache(tagName, attributes) {
+ if (tagName === 'select') return false;
+ if ('type' in attributes) return false;
+ return true;
+ }
+
+ var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){
+ try {
+ var el = document.createElement('<input name="x">');
+ return el.tagName.toLowerCase() === 'input' && el.name === 'x';
+ }
+ catch(err) {
+ return false;
+ }
+ })();
+
+ var element = global.Element;
+
+ global.Element = function(tagName, attributes) {
+ attributes = attributes || { };
+ tagName = tagName.toLowerCase();
+ var cache = Element.cache;
+
+ if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) {
+ tagName = '<' + tagName + ' name="' + attributes.name + '">';
+ delete attributes.name;
+ return Element.writeAttribute(document.createElement(tagName), attributes);
+ }
+
+ if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
+
+ var node = shouldUseCache(tagName, attributes) ?
+ cache[tagName].cloneNode(false) : document.createElement(tagName);
+
+ return Element.writeAttribute(node, attributes);
+ };
+
+ Object.extend(global.Element, element || { });
+ if (element) global.Element.prototype = element.prototype;
+
+})(this);
+
+Element.idCounter = 1;
+Element.cache = { };
+
+Element._purgeElement = function(element) {
+ var uid = element._prototypeUID;
+ if (uid) {
+ Element.stopObserving(element);
+ element._prototypeUID = void 0;
+ delete Element.Storage[uid];
+ }
+}
+
+Element.Methods = {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function(element) {
+ element = $(element);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ return element;
+ },
+
+ hide: function(element) {
+ element = $(element);
+ element.style.display = 'none';
+ return element;
+ },
+
+ show: function(element) {
+ element = $(element);
+ element.style.display = '';
+ return element;
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ },
+
+ update: (function(){
+
+ var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
+ var el = document.createElement("select"),
+ isBuggy = true;
+ el.innerHTML = "<option value=\"test\">test</option>";
+ if (el.options && el.options[0]) {
+ isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION";
+ }
+ el = null;
+ return isBuggy;
+ })();
+
+ var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){
+ try {
+ var el = document.createElement("table");
+ if (el && el.tBodies) {
+ el.innerHTML = "<tbody><tr><td>test</td></tr></tbody>";
+ var isBuggy = typeof el.tBodies[0] == "undefined";
+ el = null;
+ return isBuggy;
+ }
+ } catch (e) {
+ return true;
+ }
+ })();
+
+ var LINK_ELEMENT_INNERHTML_BUGGY = (function() {
+ try {
+ var el = document.createElement('div');
+ el.innerHTML = "<link>";
+ var isBuggy = (el.childNodes.length === 0);
+ el = null;
+ return isBuggy;
+ } catch(e) {
+ return true;
+ }
+ })();
+
+ var ANY_INNERHTML_BUGGY = SELECT_ELEMENT_INNERHTML_BUGGY ||
+ TABLE_ELEMENT_INNERHTML_BUGGY || LINK_ELEMENT_INNERHTML_BUGGY;
+
+ var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () {
+ var s = document.createElement("script"),
+ isBuggy = false;
+ try {
+ s.appendChild(document.createTextNode(""));
+ isBuggy = !s.firstChild ||
+ s.firstChild && s.firstChild.nodeType !== 3;
+ } catch (e) {
+ isBuggy = true;
+ }
+ s = null;
+ return isBuggy;
+ })();
+
+
+ function update(element, content) {
+ element = $(element);
+ var purgeElement = Element._purgeElement;
+
+ var descendants = element.getElementsByTagName('*'),
+ i = descendants.length;
+ while (i--) purgeElement(descendants[i]);
+
+ if (content && content.toElement)
+ content = content.toElement();
+
+ if (Object.isElement(content))
+ return element.update().insert(content);
+
+ content = Object.toHTML(content);
+
+ var tagName = element.tagName.toUpperCase();
+
+ if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) {
+ element.text = content;
+ return element;
+ }
+
+ if (ANY_INNERHTML_BUGGY) {
+ if (tagName in Element._insertionTranslations.tags) {
+ while (element.firstChild) {
+ element.removeChild(element.firstChild);
+ }
+ Element._getContentFromAnonymousElement(tagName, content.stripScripts())
+ .each(function(node) {
+ element.appendChild(node)
+ });
+ } else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf('<link') > -1) {
+ while (element.firstChild) {
+ element.removeChild(element.firstChild);
+ }
+ var nodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts(), true);
+ nodes.each(function(node) { element.appendChild(node) });
+ }
+ else {
+ element.innerHTML = content.stripScripts();
+ }
+ }
+ else {
+ element.innerHTML = content.stripScripts();
+ }
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ }
+
+ return update;
+ })(),
+
+ replace: function(element, content) {
+ element = $(element);
+ if (content && content.toElement) content = content.toElement();
+ else if (!Object.isElement(content)) {
+ content = Object.toHTML(content);
+ var range = element.ownerDocument.createRange();
+ range.selectNode(element);
+ content.evalScripts.bind(content).defer();
+ content = range.createContextualFragment(content.stripScripts());
+ }
+ element.parentNode.replaceChild(content, element);
+ return element;
+ },
+
+ insert: function(element, insertions) {
+ element = $(element);
+
+ if (Object.isString(insertions) || Object.isNumber(insertions) ||
+ Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
+ insertions = {bottom:insertions};
+
+ var content, insert, tagName, childNodes;
+
+ for (var position in insertions) {
+ content = insertions[position];
+ position = position.toLowerCase();
+ insert = Element._insertionTranslations[position];
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ insert(element, content);
+ continue;
+ }
+
+ content = Object.toHTML(content);
+
+ tagName = ((position == 'before' || position == 'after')
+ ? element.parentNode : element).tagName.toUpperCase();
+
+ childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+
+ if (position == 'top' || position == 'after') childNodes.reverse();
+ childNodes.each(insert.curry(element));
+
+ content.evalScripts.bind(content).defer();
+ }
+
+ return element;
+ },
+
+ wrap: function(element, wrapper, attributes) {
+ element = $(element);
+ if (Object.isElement(wrapper))
+ $(wrapper).writeAttribute(attributes || { });
+ else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
+ else wrapper = new Element('div', wrapper);
+ if (element.parentNode)
+ element.parentNode.replaceChild(wrapper, element);
+ wrapper.appendChild(element);
+ return wrapper;
+ },
+
+ inspect: function(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+ var property = pair.first(),
+ attribute = pair.last(),
+ value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ });
+ return result + '>';
+ },
+
+ recursivelyCollect: function(element, property, maximumLength) {
+ element = $(element);
+ maximumLength = maximumLength || -1;
+ var elements = [];
+
+ while (element = element[property]) {
+ if (element.nodeType == 1)
+ elements.push(Element.extend(element));
+ if (elements.length == maximumLength)
+ break;
+ }
+
+ return elements;
+ },
+
+ ancestors: function(element) {
+ return Element.recursivelyCollect(element, 'parentNode');
+ },
+
+ descendants: function(element) {
+ return Element.select(element, "*");
+ },
+
+ firstDescendant: function(element) {
+ element = $(element).firstChild;
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ return $(element);
+ },
+
+ immediateDescendants: function(element) {
+ var results = [], child = $(element).firstChild;
+ while (child) {
+ if (child.nodeType === 1) {
+ results.push(Element.extend(child));
+ }
+ child = child.nextSibling;
+ }
+ return results;
+ },
+
+ previousSiblings: function(element, maximumLength) {
+ return Element.recursivelyCollect(element, 'previousSibling');
+ },
+
+ nextSiblings: function(element) {
+ return Element.recursivelyCollect(element, 'nextSibling');
+ },
+
+ siblings: function(element) {
+ element = $(element);
+ return Element.previousSiblings(element).reverse()
+ .concat(Element.nextSiblings(element));
+ },
+
+ match: function(element, selector) {
+ element = $(element);
+ if (Object.isString(selector))
+ return Prototype.Selector.match(element, selector);
+ return selector.match(element);
+ },
+
+ up: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(element.parentNode);
+ var ancestors = Element.ancestors(element);
+ return Object.isNumber(expression) ? ancestors[expression] :
+ Prototype.Selector.find(ancestors, expression, index);
+ },
+
+ down: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return Element.firstDescendant(element);
+ return Object.isNumber(expression) ? Element.descendants(element)[expression] :
+ Element.select(element, expression)[index || 0];
+ },
+
+ previous: function(element, expression, index) {
+ element = $(element);
+ if (Object.isNumber(expression)) index = expression, expression = false;
+ if (!Object.isNumber(index)) index = 0;
+
+ if (expression) {
+ return Prototype.Selector.find(element.previousSiblings(), expression, index);
+ } else {
+ return element.recursivelyCollect("previousSibling", index + 1)[index];
+ }
+ },
+
+ next: function(element, expression, index) {
+ element = $(element);
+ if (Object.isNumber(expression)) index = expression, expression = false;
+ if (!Object.isNumber(index)) index = 0;
+
+ if (expression) {
+ return Prototype.Selector.find(element.nextSiblings(), expression, index);
+ } else {
+ var maximumLength = Object.isNumber(index) ? index + 1 : 1;
+ return element.recursivelyCollect("nextSibling", index + 1)[index];
+ }
+ },
+
+
+ select: function(element) {
+ element = $(element);
+ var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
+ return Prototype.Selector.select(expressions, element);
+ },
+
+ adjacent: function(element) {
+ element = $(element);
+ var expressions = Array.prototype.slice.call(arguments, 1).join(', ');
+ return Prototype.Selector.select(expressions, element.parentNode).without(element);
+ },
+
+ identify: function(element) {
+ element = $(element);
+ var id = Element.readAttribute(element, 'id');
+ if (id) return id;
+ do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
+ Element.writeAttribute(element, 'id', id);
+ return id;
+ },
+
+ readAttribute: function(element, name) {
+ element = $(element);
+ if (Prototype.Browser.IE) {
+ var t = Element._attributeTranslations.read;
+ if (t.values[name]) return t.values[name](element, name);
+ if (t.names[name]) name = t.names[name];
+ if (name.include(':')) {
+ return (!element.attributes || !element.attributes[name]) ? null :
+ element.attributes[name].value;
+ }
+ }
+ return element.getAttribute(name);
+ },
+
+ writeAttribute: function(element, name, value) {
+ element = $(element);
+ var attributes = { }, t = Element._attributeTranslations.write;
+
+ if (typeof name == 'object') attributes = name;
+ else attributes[name] = Object.isUndefined(value) ? true : value;
+
+ for (var attr in attributes) {
+ name = t.names[attr] || attr;
+ value = attributes[attr];
+ if (t.values[attr]) name = t.values[attr](element, value);
+ if (value === false || value === null)
+ element.removeAttribute(name);
+ else if (value === true)
+ element.setAttribute(name, name);
+ else element.setAttribute(name, value);
+ }
+ return element;
+ },
+
+ getHeight: function(element) {
+ return Element.getDimensions(element).height;
+ },
+
+ getWidth: function(element) {
+ return Element.getDimensions(element).width;
+ },
+
+ classNames: function(element) {
+ return new Element.ClassNames(element);
+ },
+
+ hasClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ var elementClassName = element.className;
+ return (elementClassName.length > 0 && (elementClassName == className ||
+ new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
+ },
+
+ addClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ if (!Element.hasClassName(element, className))
+ element.className += (element.className ? ' ' : '') + className;
+ return element;
+ },
+
+ removeClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ element.className = element.className.replace(
+ new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
+ return element;
+ },
+
+ toggleClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ return Element[Element.hasClassName(element, className) ?
+ 'removeClassName' : 'addClassName'](element, className);
+ },
+
+ cleanWhitespace: function(element) {
+ element = $(element);
+ var node = element.firstChild;
+ while (node) {
+ var nextNode = node.nextSibling;
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ element.removeChild(node);
+ node = nextNode;
+ }
+ return element;
+ },
+
+ empty: function(element) {
+ return $(element).innerHTML.blank();
+ },
+
+ descendantOf: function(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+
+ if (element.compareDocumentPosition)
+ return (element.compareDocumentPosition(ancestor) & 8) === 8;
+
+ if (ancestor.contains)
+ return ancestor.contains(element) && ancestor !== element;
+
+ while (element = element.parentNode)
+ if (element == ancestor) return true;
+
+ return false;
+ },
+
+ scrollTo: function(element) {
+ element = $(element);
+ var pos = Element.cumulativeOffset(element);
+ window.scrollTo(pos[0], pos[1]);
+ return element;
+ },
+
+ getStyle: function(element, style) {
+ element = $(element);
+ style = style == 'float' ? 'cssFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value || value == 'auto') {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ }
+ if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+ return value == 'auto' ? null : value;
+ },
+
+ getOpacity: function(element) {
+ return $(element).getStyle('opacity');
+ },
+
+ setStyle: function(element, styles) {
+ element = $(element);
+ var elementStyle = element.style, match;
+ if (Object.isString(styles)) {
+ element.style.cssText += ';' + styles;
+ return styles.include('opacity') ?
+ element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
+ }
+ for (var property in styles)
+ if (property == 'opacity') element.setOpacity(styles[property]);
+ else
+ elementStyle[(property == 'float' || property == 'cssFloat') ?
+ (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
+ property] = styles[property];
+
+ return element;
+ },
+
+ setOpacity: function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+ return element;
+ },
+
+ makePositioned: function(element) {
+ element = $(element);
+ var pos = Element.getStyle(element, 'position');
+ if (pos == 'static' || !pos) {
+ element._madePositioned = true;
+ element.style.position = 'relative';
+ if (Prototype.Browser.Opera) {
+ element.style.top = 0;
+ element.style.left = 0;
+ }
+ }
+ return element;
+ },
+
+ undoPositioned: function(element) {
+ element = $(element);
+ if (element._madePositioned) {
+ element._madePositioned = undefined;
+ element.style.position =
+ element.style.top =
+ element.style.left =
+ element.style.bottom =
+ element.style.right = '';
+ }
+ return element;
+ },
+
+ makeClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return element;
+ element._overflow = Element.getStyle(element, 'overflow') || 'auto';
+ if (element._overflow !== 'hidden')
+ element.style.overflow = 'hidden';
+ return element;
+ },
+
+ undoClipping: function(element) {
+ element = $(element);
+ if (!element._overflow) return element;
+ element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+ element._overflow = null;
+ return element;
+ },
+
+ clonePosition: function(element, source) {
+ var options = Object.extend({
+ setLeft: true,
+ setTop: true,
+ setWidth: true,
+ setHeight: true,
+ offsetTop: 0,
+ offsetLeft: 0
+ }, arguments[2] || { });
+
+ source = $(source);
+ var p = Element.viewportOffset(source), delta = [0, 0], parent = null;
+
+ element = $(element);
+
+ if (Element.getStyle(element, 'position') == 'absolute') {
+ parent = Element.getOffsetParent(element);
+ delta = Element.viewportOffset(parent);
+ }
+
+ if (parent == document.body) {
+ delta[0] -= document.body.offsetLeft;
+ delta[1] -= document.body.offsetTop;
+ }
+
+ if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
+ if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
+ if (options.setWidth) element.style.width = source.offsetWidth + 'px';
+ if (options.setHeight) element.style.height = source.offsetHeight + 'px';
+ return element;
+ }
+};
+
+Object.extend(Element.Methods, {
+ getElementsBySelector: Element.Methods.select,
+
+ childElements: Element.Methods.immediateDescendants
+});
+
+Element._attributeTranslations = {
+ write: {
+ names: {
+ className: 'class',
+ htmlFor: 'for'
+ },
+ values: { }
+ }
+};
+
+if (Prototype.Browser.Opera) {
+ Element.Methods.getStyle = Element.Methods.getStyle.wrap(
+ function(proceed, element, style) {
+ switch (style) {
+ case 'height': case 'width':
+ if (!Element.visible(element)) return null;
+
+ var dim = parseInt(proceed(element, style), 10);
+
+ if (dim !== element['offset' + style.capitalize()])
+ return dim + 'px';
+
+ var properties;
+ if (style === 'height') {
+ properties = ['border-top-width', 'padding-top',
+ 'padding-bottom', 'border-bottom-width'];
+ }
+ else {
+ properties = ['border-left-width', 'padding-left',
+ 'padding-right', 'border-right-width'];
+ }
+ return properties.inject(dim, function(memo, property) {
+ var val = proceed(element, property);
+ return val === null ? memo : memo - parseInt(val, 10);
+ }) + 'px';
+ default: return proceed(element, style);
+ }
+ }
+ );
+
+ Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
+ function(proceed, element, attribute) {
+ if (attribute === 'title') return element.title;
+ return proceed(element, attribute);
+ }
+ );
+}
+
+else if (Prototype.Browser.IE) {
+ Element.Methods.getStyle = function(element, style) {
+ element = $(element);
+ style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value && element.currentStyle) value = element.currentStyle[style];
+
+ if (style == 'opacity') {
+ if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+ if (value[1]) return parseFloat(value[1]) / 100;
+ return 1.0;
+ }
+
+ if (value == 'auto') {
+ if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
+ return element['offset' + style.capitalize()] + 'px';
+ return null;
+ }
+ return value;
+ };
+
+ Element.Methods.setOpacity = function(element, value) {
+ function stripAlpha(filter){
+ return filter.replace(/alpha\([^\)]*\)/gi,'');
+ }
+ element = $(element);
+ var currentStyle = element.currentStyle;
+ if ((currentStyle && !currentStyle.hasLayout) ||
+ (!currentStyle && element.style.zoom == 'normal'))
+ element.style.zoom = 1;
+
+ var filter = element.getStyle('filter'), style = element.style;
+ if (value == 1 || value === '') {
+ (filter = stripAlpha(filter)) ?
+ style.filter = filter : style.removeAttribute('filter');
+ return element;
+ } else if (value < 0.00001) value = 0;
+ style.filter = stripAlpha(filter) +
+ 'alpha(opacity=' + (value * 100) + ')';
+ return element;
+ };
+
+ Element._attributeTranslations = (function(){
+
+ var classProp = 'className',
+ forProp = 'for',
+ el = document.createElement('div');
+
+ el.setAttribute(classProp, 'x');
+
+ if (el.className !== 'x') {
+ el.setAttribute('class', 'x');
+ if (el.className === 'x') {
+ classProp = 'class';
+ }
+ }
+ el = null;
+
+ el = document.createElement('label');
+ el.setAttribute(forProp, 'x');
+ if (el.htmlFor !== 'x') {
+ el.setAttribute('htmlFor', 'x');
+ if (el.htmlFor === 'x') {
+ forProp = 'htmlFor';
+ }
+ }
+ el = null;
+
+ return {
+ read: {
+ names: {
+ 'class': classProp,
+ 'className': classProp,
+ 'for': forProp,
+ 'htmlFor': forProp
+ },
+ values: {
+ _getAttr: function(element, attribute) {
+ return element.getAttribute(attribute);
+ },
+ _getAttr2: function(element, attribute) {
+ return element.getAttribute(attribute, 2);
+ },
+ _getAttrNode: function(element, attribute) {
+ var node = element.getAttributeNode(attribute);
+ return node ? node.value : "";
+ },
+ _getEv: (function(){
+
+ var el = document.createElement('div'), f;
+ el.onclick = Prototype.emptyFunction;
+ var value = el.getAttribute('onclick');
+
+ if (String(value).indexOf('{') > -1) {
+ f = function(element, attribute) {
+ attribute = element.getAttribute(attribute);
+ if (!attribute) return null;
+ attribute = attribute.toString();
+ attribute = attribute.split('{')[1];
+ attribute = attribute.split('}')[0];
+ return attribute.strip();
+ };
+ }
+ else if (value === '') {
+ f = function(element, attribute) {
+ attribute = element.getAttribute(attribute);
+ if (!attribute) return null;
+ return attribute.strip();
+ };
+ }
+ el = null;
+ return f;
+ })(),
+ _flag: function(element, attribute) {
+ return $(element).hasAttribute(attribute) ? attribute : null;
+ },
+ style: function(element) {
+ return element.style.cssText.toLowerCase();
+ },
+ title: function(element) {
+ return element.title;
+ }
+ }
+ }
+ }
+ })();
+
+ Element._attributeTranslations.write = {
+ names: Object.extend({
+ cellpadding: 'cellPadding',
+ cellspacing: 'cellSpacing'
+ }, Element._attributeTranslations.read.names),
+ values: {
+ checked: function(element, value) {
+ element.checked = !!value;
+ },
+
+ style: function(element, value) {
+ element.style.cssText = value ? value : '';
+ }
+ }
+ };
+
+ Element._attributeTranslations.has = {};
+
+ $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
+ 'encType maxLength readOnly longDesc frameBorder').each(function(attr) {
+ Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
+ Element._attributeTranslations.has[attr.toLowerCase()] = attr;
+ });
+
+ (function(v) {
+ Object.extend(v, {
+ href: v._getAttr2,
+ src: v._getAttr2,
+ type: v._getAttr,
+ action: v._getAttrNode,
+ disabled: v._flag,
+ checked: v._flag,
+ readonly: v._flag,
+ multiple: v._flag,
+ onload: v._getEv,
+ onunload: v._getEv,
+ onclick: v._getEv,
+ ondblclick: v._getEv,
+ onmousedown: v._getEv,
+ onmouseup: v._getEv,
+ onmouseover: v._getEv,
+ onmousemove: v._getEv,
+ onmouseout: v._getEv,
+ onfocus: v._getEv,
+ onblur: v._getEv,
+ onkeypress: v._getEv,
+ onkeydown: v._getEv,
+ onkeyup: v._getEv,
+ onsubmit: v._getEv,
+ onreset: v._getEv,
+ onselect: v._getEv,
+ onchange: v._getEv
+ });
+ })(Element._attributeTranslations.read.values);
+
+ if (Prototype.BrowserFeatures.ElementExtensions) {
+ (function() {
+ function _descendants(element) {
+ var nodes = element.getElementsByTagName('*'), results = [];
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.tagName !== "!") // Filter out comment nodes.
+ results.push(node);
+ return results;
+ }
+
+ Element.Methods.down = function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return element.firstDescendant();
+ return Object.isNumber(expression) ? _descendants(element)[expression] :
+ Element.select(element, expression)[index || 0];
+ }
+ })();
+ }
+
+}
+
+else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1) ? 0.999999 :
+ (value === '') ? '' : (value < 0.00001) ? 0 : value;
+ return element;
+ };
+}
+
+else if (Prototype.Browser.WebKit) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+
+ if (value == 1)
+ if (element.tagName.toUpperCase() == 'IMG' && element.width) {
+ element.width++; element.width--;
+ } else try {
+ var n = document.createTextNode(' ');
+ element.appendChild(n);
+ element.removeChild(n);
+ } catch (e) { }
+
+ return element;
+ };
+}
+
+if ('outerHTML' in document.documentElement) {
+ Element.Methods.replace = function(element, content) {
+ element = $(element);
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ element.parentNode.replaceChild(content, element);
+ return element;
+ }
+
+ content = Object.toHTML(content);
+ var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
+
+ if (Element._insertionTranslations.tags[tagName]) {
+ var nextSibling = element.next(),
+ fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+ parent.removeChild(element);
+ if (nextSibling)
+ fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
+ else
+ fragments.each(function(node) { parent.appendChild(node) });
+ }
+ else element.outerHTML = content.stripScripts();
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ };
+}
+
+Element._returnOffset = function(l, t) {
+ var result = [l, t];
+ result.left = l;
+ result.top = t;
+ return result;
+};
+
+Element._getContentFromAnonymousElement = function(tagName, html, force) {
+ var div = new Element('div'),
+ t = Element._insertionTranslations.tags[tagName];
+
+ var workaround = false;
+ if (t) workaround = true;
+ else if (force) {
+ workaround = true;
+ t = ['', '', 0];
+ }
+
+ if (workaround) {
+ div.innerHTML = ' ' + t[0] + html + t[1];
+ div.removeChild(div.firstChild);
+ for (var i = t[2]; i--; ) {
+ div = div.firstChild;
+ }
+ }
+ else {
+ div.innerHTML = html;
+ }
+ return $A(div.childNodes);
+};
+
+Element._insertionTranslations = {
+ before: function(element, node) {
+ element.parentNode.insertBefore(node, element);
+ },
+ top: function(element, node) {
+ element.insertBefore(node, element.firstChild);
+ },
+ bottom: function(element, node) {
+ element.appendChild(node);
+ },
+ after: function(element, node) {
+ element.parentNode.insertBefore(node, element.nextSibling);
+ },
+ tags: {
+ TABLE: ['<table>', '</table>', 1],
+ TBODY: ['<table><tbody>', '</tbody></table>', 2],
+ TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
+ TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
+ SELECT: ['<select>', '</select>', 1]
+ }
+};
+
+(function() {
+ var tags = Element._insertionTranslations.tags;
+ Object.extend(tags, {
+ THEAD: tags.TBODY,
+ TFOOT: tags.TBODY,
+ TH: tags.TD
+ });
+})();
+
+Element.Methods.Simulated = {
+ hasAttribute: function(element, attribute) {
+ attribute = Element._attributeTranslations.has[attribute] || attribute;
+ var node = $(element).getAttributeNode(attribute);
+ return !!(node && node.specified);
+ }
+};
+
+Element.Methods.ByTag = { };
+
+Object.extend(Element, Element.Methods);
+
+(function(div) {
+
+ if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) {
+ window.HTMLElement = { };
+ window.HTMLElement.prototype = div['__proto__'];
+ Prototype.BrowserFeatures.ElementExtensions = true;
+ }
+
+ div = null;
+
+})(document.createElement('div'));
+
+Element.extend = (function() {
+
+ function checkDeficiency(tagName) {
+ if (typeof window.Element != 'undefined') {
+ var proto = window.Element.prototype;
+ if (proto) {
+ var id = '_' + (Math.random()+'').slice(2),
+ el = document.createElement(tagName);
+ proto[id] = 'x';
+ var isBuggy = (el[id] !== 'x');
+ delete proto[id];
+ el = null;
+ return isBuggy;
+ }
+ }
+ return false;
+ }
+
+ function extendElementWith(element, methods) {
+ for (var property in methods) {
+ var value = methods[property];
+ if (Object.isFunction(value) && !(property in element))
+ element[property] = value.methodize();
+ }
+ }
+
+ var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object');
+
+ if (Prototype.BrowserFeatures.SpecificElementExtensions) {
+ if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) {
+ return function(element) {
+ if (element && typeof element._extendedByPrototype == 'undefined') {
+ var t = element.tagName;
+ if (t && (/^(?:object|applet|embed)$/i.test(t))) {
+ extendElementWith(element, Element.Methods);
+ extendElementWith(element, Element.Methods.Simulated);
+ extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]);
+ }
+ }
+ return element;
+ }
+ }
+ return Prototype.K;
+ }
+
+ var Methods = { }, ByTag = Element.Methods.ByTag;
+
+ var extend = Object.extend(function(element) {
+ if (!element || typeof element._extendedByPrototype != 'undefined' ||
+ element.nodeType != 1 || element == window) return element;
+
+ var methods = Object.clone(Methods),
+ tagName = element.tagName.toUpperCase();
+
+ if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
+
+ extendElementWith(element, methods);
+
+ element._extendedByPrototype = Prototype.emptyFunction;
+ return element;
+
+ }, {
+ refresh: function() {
+ if (!Prototype.BrowserFeatures.ElementExtensions) {
+ Object.extend(Methods, Element.Methods);
+ Object.extend(Methods, Element.Methods.Simulated);
+ }
+ }
+ });
+
+ extend.refresh();
+ return extend;
+})();
+
+if (document.documentElement.hasAttribute) {
+ Element.hasAttribute = function(element, attribute) {
+ return element.hasAttribute(attribute);
+ };
+}
+else {
+ Element.hasAttribute = Element.Methods.Simulated.hasAttribute;
+}
+
+Element.addMethods = function(methods) {
+ var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
+
+ if (!methods) {
+ Object.extend(Form, Form.Methods);
+ Object.extend(Form.Element, Form.Element.Methods);
+ Object.extend(Element.Methods.ByTag, {
+ "FORM": Object.clone(Form.Methods),
+ "INPUT": Object.clone(Form.Element.Methods),
+ "SELECT": Object.clone(Form.Element.Methods),
+ "TEXTAREA": Object.clone(Form.Element.Methods),
+ "BUTTON": Object.clone(Form.Element.Methods)
+ });
+ }
+
+ if (arguments.length == 2) {
+ var tagName = methods;
+ methods = arguments[1];
+ }
+
+ if (!tagName) Object.extend(Element.Methods, methods || { });
+ else {
+ if (Object.isArray(tagName)) tagName.each(extend);
+ else extend(tagName);
+ }
+
+ function extend(tagName) {
+ tagName = tagName.toUpperCase();
+ if (!Element.Methods.ByTag[tagName])
+ Element.Methods.ByTag[tagName] = { };
+ Object.extend(Element.Methods.ByTag[tagName], methods);
+ }
+
+ function copy(methods, destination, onlyIfAbsent) {
+ onlyIfAbsent = onlyIfAbsent || false;
+ for (var property in methods) {
+ var value = methods[property];
+ if (!Object.isFunction(value)) continue;
+ if (!onlyIfAbsent || !(property in destination))
+ destination[property] = value.methodize();
+ }
+ }
+
+ function findDOMClass(tagName) {
+ var klass;
+ var trans = {
+ "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+ "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+ "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+ "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+ "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+ "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+ "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+ "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+ "FrameSet", "IFRAME": "IFrame"
+ };
+ if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName.capitalize() + 'Element';
+ if (window[klass]) return window[klass];
+
+ var element = document.createElement(tagName),
+ proto = element['__proto__'] || element.constructor.prototype;
+
+ element = null;
+ return proto;
+ }
+
+ var elementPrototype = window.HTMLElement ? HTMLElement.prototype :
+ Element.prototype;
+
+ if (F.ElementExtensions) {
+ copy(Element.Methods, elementPrototype);
+ copy(Element.Methods.Simulated, elementPrototype, true);
+ }
+
+ if (F.SpecificElementExtensions) {
+ for (var tag in Element.Methods.ByTag) {
+ var klass = findDOMClass(tag);
+ if (Object.isUndefined(klass)) continue;
+ copy(T[tag], klass.prototype);
+ }
+ }
+
+ Object.extend(Element, Element.Methods);
+ delete Element.ByTag;
+
+ if (Element.extend.refresh) Element.extend.refresh();
+ Element.cache = { };
+};
+
+
+document.viewport = {
+
+ getDimensions: function() {
+ return { width: this.getWidth(), height: this.getHeight() };
+ },
+
+ getScrollOffsets: function() {
+ return Element._returnOffset(
+ window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
+ window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
+ }
+};
+
+(function(viewport) {
+ var B = Prototype.Browser, doc = document, element, property = {};
+
+ function getRootElement() {
+ if (B.WebKit && !doc.evaluate)
+ return document;
+
+ if (B.Opera && window.parseFloat(window.opera.version()) < 9.5)
+ return document.body;
+
+ return document.documentElement;
+ }
+
+ function define(D) {
+ if (!element) element = getRootElement();
+
+ property[D] = 'client' + D;
+
+ viewport['get' + D] = function() { return element[property[D]] };
+ return viewport['get' + D]();
+ }
+
+ viewport.getWidth = define.curry('Width');
+
+ viewport.getHeight = define.curry('Height');
+})(document.viewport);
+
+
+Element.Storage = {
+ UID: 1
+};
+
+Element.addMethods({
+ getStorage: function(element) {
+ if (!(element = $(element))) return;
+
+ var uid;
+ if (element === window) {
+ uid = 0;
+ } else {
+ if (typeof element._prototypeUID === "undefined")
+ element._prototypeUID = Element.Storage.UID++;
+ uid = element._prototypeUID;
+ }
+
+ if (!Element.Storage[uid])
+ Element.Storage[uid] = $H();
+
+ return Element.Storage[uid];
+ },
+
+ store: function(element, key, value) {
+ if (!(element = $(element))) return;
+
+ if (arguments.length === 2) {
+ Element.getStorage(element).update(key);
+ } else {
+ Element.getStorage(element).set(key, value);
+ }
+
+ return element;
+ },
+
+ retrieve: function(element, key, defaultValue) {
+ if (!(element = $(element))) return;
+ var hash = Element.getStorage(element), value = hash.get(key);
+
+ if (Object.isUndefined(value)) {
+ hash.set(key, defaultValue);
+ value = defaultValue;
+ }
+
+ return value;
+ },
+
+ clone: function(element, deep) {
+ if (!(element = $(element))) return;
+ var clone = element.cloneNode(deep);
+ clone._prototypeUID = void 0;
+ if (deep) {
+ var descendants = Element.select(clone, '*'),
+ i = descendants.length;
+ while (i--) {
+ descendants[i]._prototypeUID = void 0;
+ }
+ }
+ return Element.extend(clone);
+ },
+
+ purge: function(element) {
+ if (!(element = $(element))) return;
+ var purgeElement = Element._purgeElement;
+
+ purgeElement(element);
+
+ var descendants = element.getElementsByTagName('*'),
+ i = descendants.length;
+
+ while (i--) purgeElement(descendants[i]);
+
+ return null;
+ }
+});
+
+(function() {
+
+ function toDecimal(pctString) {
+ var match = pctString.match(/^(\d+)%?$/i);
+ if (!match) return null;
+ return (Number(match[1]) / 100);
+ }
+
+ function getPixelValue(value, property, context) {
+ var element = null;
+ if (Object.isElement(value)) {
+ element = value;
+ value = element.getStyle(property);
+ }
+
+ if (value === null) {
+ return null;
+ }
+
+ if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) {
+ return window.parseFloat(value);
+ }
+
+ var isPercentage = value.include('%'), isViewport = (context === document.viewport);
+
+ if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) {
+ var style = element.style.left, rStyle = element.runtimeStyle.left;
+ element.runtimeStyle.left = element.currentStyle.left;
+ element.style.left = value || 0;
+ value = element.style.pixelLeft;
+ element.style.left = style;
+ element.runtimeStyle.left = rStyle;
+
+ return value;
+ }
+
+ if (element && isPercentage) {
+ context = context || element.parentNode;
+ var decimal = toDecimal(value);
+ var whole = null;
+ var position = element.getStyle('position');
+
+ var isHorizontal = property.include('left') || property.include('right') ||
+ property.include('width');
+
+ var isVertical = property.include('top') || property.include('bottom') ||
+ property.include('height');
+
+ if (context === document.viewport) {
+ if (isHorizontal) {
+ whole = document.viewport.getWidth();
+ } else if (isVertical) {
+ whole = document.viewport.getHeight();
+ }
+ } else {
+ if (isHorizontal) {
+ whole = $(context).measure('width');
+ } else if (isVertical) {
+ whole = $(context).measure('height');
+ }
+ }
+
+ return (whole === null) ? 0 : whole * decimal;
+ }
+
+ return 0;
+ }
+
+ function toCSSPixels(number) {
+ if (Object.isString(number) && number.endsWith('px')) {
+ return number;
+ }
+ return number + 'px';
+ }
+
+ function isDisplayed(element) {
+ var originalElement = element;
+ while (element && element.parentNode) {
+ var display = element.getStyle('display');
+ if (display === 'none') {
+ return false;
+ }
+ element = $(element.parentNode);
+ }
+ return true;
+ }
+
+ var hasLayout = Prototype.K;
+ if ('currentStyle' in document.documentElement) {
+ hasLayout = function(element) {
+ if (!element.currentStyle.hasLayout) {
+ element.style.zoom = 1;
+ }
+ return element;
+ };
+ }
+
+ function cssNameFor(key) {
+ if (key.include('border')) key = key + '-width';
+ return key.camelize();
+ }
+
+ Element.Layout = Class.create(Hash, {
+ initialize: function($super, element, preCompute) {
+ $super();
+ this.element = $(element);
+
+ Element.Layout.PROPERTIES.each( function(property) {
+ this._set(property, null);
+ }, this);
+
+ if (preCompute) {
+ this._preComputing = true;
+ this._begin();
+ Element.Layout.PROPERTIES.each( this._compute, this );
+ this._end();
+ this._preComputing = false;
+ }
+ },
+
+ _set: function(property, value) {
+ return Hash.prototype.set.call(this, property, value);
+ },
+
+ set: function(property, value) {
+ throw "Properties of Element.Layout are read-only.";
+ },
+
+ get: function($super, property) {
+ var value = $super(property);
+ return value === null ? this._compute(property) : value;
+ },
+
+ _begin: function() {
+ if (this._prepared) return;
+
+ var element = this.element;
+ if (isDisplayed(element)) {
+ this._prepared = true;
+ return;
+ }
+
+ var originalStyles = {
+ position: element.style.position || '',
+ width: element.style.width || '',
+ visibility: element.style.visibility || '',
+ display: element.style.display || ''
+ };
+
+ element.store('prototype_original_styles', originalStyles);
+
+ var position = element.getStyle('position'),
+ width = element.getStyle('width');
+
+ if (width === "0px" || width === null) {
+ element.style.display = 'block';
+ width = element.getStyle('width');
+ }
+
+ var context = (position === 'fixed') ? document.viewport :
+ element.parentNode;
+
+ element.setStyle({
+ position: 'absolute',
+ visibility: 'hidden',
+ display: 'block'
+ });
+
+ var positionedWidth = element.getStyle('width');
+
+ var newWidth;
+ if (width && (positionedWidth === width)) {
+ newWidth = getPixelValue(element, 'width', context);
+ } else if (position === 'absolute' || position === 'fixed') {
+ newWidth = getPixelValue(element, 'width', context);
+ } else {
+ var parent = element.parentNode, pLayout = $(parent).getLayout();
+
+ newWidth = pLayout.get('width') -
+ this.get('margin-left') -
+ this.get('border-left') -
+ this.get('padding-left') -
+ this.get('padding-right') -
+ this.get('border-right') -
+ this.get('margin-right');
+ }
+
+ element.setStyle({ width: newWidth + 'px' });
+
+ this._prepared = true;
+ },
+
+ _end: function() {
+ var element = this.element;
+ var originalStyles = element.retrieve('prototype_original_styles');
+ element.store('prototype_original_styles', null);
+ element.setStyle(originalStyles);
+ this._prepared = false;
+ },
+
+ _compute: function(property) {
+ var COMPUTATIONS = Element.Layout.COMPUTATIONS;
+ if (!(property in COMPUTATIONS)) {
+ throw "Property not found.";
+ }
+
+ return this._set(property, COMPUTATIONS[property].call(this, this.element));
+ },
+
+ toObject: function() {
+ var args = $A(arguments);
+ var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
+ args.join(' ').split(' ');
+ var obj = {};
+ keys.each( function(key) {
+ if (!Element.Layout.PROPERTIES.include(key)) return;
+ var value = this.get(key);
+ if (value != null) obj[key] = value;
+ }, this);
+ return obj;
+ },
+
+ toHash: function() {
+ var obj = this.toObject.apply(this, arguments);
+ return new Hash(obj);
+ },
+
+ toCSS: function() {
+ var args = $A(arguments);
+ var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
+ args.join(' ').split(' ');
+ var css = {};
+
+ keys.each( function(key) {
+ if (!Element.Layout.PROPERTIES.include(key)) return;
+ if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return;
+
+ var value = this.get(key);
+ if (value != null) css[cssNameFor(key)] = value + 'px';
+ }, this);
+ return css;
+ },
+
+ inspect: function() {
+ return "#<Element.Layout>";
+ }
+ });
+
+ Object.extend(Element.Layout, {
+ PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'),
+
+ COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'),
+
+ COMPUTATIONS: {
+ 'height': function(element) {
+ if (!this._preComputing) this._begin();
+
+ var bHeight = this.get('border-box-height');
+ if (bHeight <= 0) {
+ if (!this._preComputing) this._end();
+ return 0;
+ }
+
+ var bTop = this.get('border-top'),
+ bBottom = this.get('border-bottom');
+
+ var pTop = this.get('padding-top'),
+ pBottom = this.get('padding-bottom');
+
+ if (!this._preComputing) this._end();
+
+ return bHeight - bTop - bBottom - pTop - pBottom;
+ },
+
+ 'width': function(element) {
+ if (!this._preComputing) this._begin();
+
+ var bWidth = this.get('border-box-width');
+ if (bWidth <= 0) {
+ if (!this._preComputing) this._end();
+ return 0;
+ }
+
+ var bLeft = this.get('border-left'),
+ bRight = this.get('border-right');
+
+ var pLeft = this.get('padding-left'),
+ pRight = this.get('padding-right');
+
+ if (!this._preComputing) this._end();
+
+ return bWidth - bLeft - bRight - pLeft - pRight;
+ },
+
+ 'padding-box-height': function(element) {
+ var height = this.get('height'),
+ pTop = this.get('padding-top'),
+ pBottom = this.get('padding-bottom');
+
+ return height + pTop + pBottom;
+ },
+
+ 'padding-box-width': function(element) {
+ var width = this.get('width'),
+ pLeft = this.get('padding-left'),
+ pRight = this.get('padding-right');
+
+ return width + pLeft + pRight;
+ },
+
+ 'border-box-height': function(element) {
+ if (!this._preComputing) this._begin();
+ var height = element.offsetHeight;
+ if (!this._preComputing) this._end();
+ return height;
+ },
+
+ 'border-box-width': function(element) {
+ if (!this._preComputing) this._begin();
+ var width = element.offsetWidth;
+ if (!this._preComputing) this._end();
+ return width;
+ },
+
+ 'margin-box-height': function(element) {
+ var bHeight = this.get('border-box-height'),
+ mTop = this.get('margin-top'),
+ mBottom = this.get('margin-bottom');
+
+ if (bHeight <= 0) return 0;
+
+ return bHeight + mTop + mBottom;
+ },
+
+ 'margin-box-width': function(element) {
+ var bWidth = this.get('border-box-width'),
+ mLeft = this.get('margin-left'),
+ mRight = this.get('margin-right');
+
+ if (bWidth <= 0) return 0;
+
+ return bWidth + mLeft + mRight;
+ },
+
+ 'top': function(element) {
+ var offset = element.positionedOffset();
+ return offset.top;
+ },
+
+ 'bottom': function(element) {
+ var offset = element.positionedOffset(),
+ parent = element.getOffsetParent(),
+ pHeight = parent.measure('height');
+
+ var mHeight = this.get('border-box-height');
+
+ return pHeight - mHeight - offset.top;
+ },
+
+ 'left': function(element) {
+ var offset = element.positionedOffset();
+ return offset.left;
+ },
+
+ 'right': function(element) {
+ var offset = element.positionedOffset(),
+ parent = element.getOffsetParent(),
+ pWidth = parent.measure('width');
+
+ var mWidth = this.get('border-box-width');
+
+ return pWidth - mWidth - offset.left;
+ },
+
+ 'padding-top': function(element) {
+ return getPixelValue(element, 'paddingTop');
+ },
+
+ 'padding-bottom': function(element) {
+ return getPixelValue(element, 'paddingBottom');
+ },
+
+ 'padding-left': function(element) {
+ return getPixelValue(element, 'paddingLeft');
+ },
+
+ 'padding-right': function(element) {
+ return getPixelValue(element, 'paddingRight');
+ },
+
+ 'border-top': function(element) {
+ return getPixelValue(element, 'borderTopWidth');
+ },
+
+ 'border-bottom': function(element) {
+ return getPixelValue(element, 'borderBottomWidth');
+ },
+
+ 'border-left': function(element) {
+ return getPixelValue(element, 'borderLeftWidth');
+ },
+
+ 'border-right': function(element) {
+ return getPixelValue(element, 'borderRightWidth');
+ },
+
+ 'margin-top': function(element) {
+ return getPixelValue(element, 'marginTop');
+ },
+
+ 'margin-bottom': function(element) {
+ return getPixelValue(element, 'marginBottom');
+ },
+
+ 'margin-left': function(element) {
+ return getPixelValue(element, 'marginLeft');
+ },
+
+ 'margin-right': function(element) {
+ return getPixelValue(element, 'marginRight');
+ }
+ }
+ });
+
+ if ('getBoundingClientRect' in document.documentElement) {
+ Object.extend(Element.Layout.COMPUTATIONS, {
+ 'right': function(element) {
+ var parent = hasLayout(element.getOffsetParent());
+ var rect = element.getBoundingClientRect(),
+ pRect = parent.getBoundingClientRect();
+
+ return (pRect.right - rect.right).round();
+ },
+
+ 'bottom': function(element) {
+ var parent = hasLayout(element.getOffsetParent());
+ var rect = element.getBoundingClientRect(),
+ pRect = parent.getBoundingClientRect();
+
+ return (pRect.bottom - rect.bottom).round();
+ }
+ });
+ }
+
+ Element.Offset = Class.create({
+ initialize: function(left, top) {
+ this.left = left.round();
+ this.top = top.round();
+
+ this[0] = this.left;
+ this[1] = this.top;
+ },
+
+ relativeTo: function(offset) {
+ return new Element.Offset(
+ this.left - offset.left,
+ this.top - offset.top
+ );
+ },
+
+ inspect: function() {
+ return "#<Element.Offset left: #{left} top: #{top}>".interpolate(this);
+ },
+
+ toString: function() {
+ return "[#{left}, #{top}]".interpolate(this);
+ },
+
+ toArray: function() {
+ return [this.left, this.top];
+ }
+ });
+
+ function getLayout(element, preCompute) {
+ return new Element.Layout(element, preCompute);
+ }
+
+ function measure(element, property) {
+ return $(element).getLayout().get(property);
+ }
+
+ function getDimensions(element) {
+ element = $(element);
+ var display = Element.getStyle(element, 'display');
+
+ if (display && display !== 'none') {
+ return { width: element.offsetWidth, height: element.offsetHeight };
+ }
+
+ var style = element.style;
+ var originalStyles = {
+ visibility: style.visibility,
+ position: style.position,
+ display: style.display
+ };
+
+ var newStyles = {
+ visibility: 'hidden',
+ display: 'block'
+ };
+
+ if (originalStyles.position !== 'fixed')
+ newStyles.position = 'absolute';
+
+ Element.setStyle(element, newStyles);
+
+ var dimensions = {
+ width: element.offsetWidth,
+ height: element.offsetHeight
+ };
+
+ Element.setStyle(element, originalStyles);
+
+ return dimensions;
+ }
+
+ function getOffsetParent(element) {
+ element = $(element);
+
+ if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
+ return $(document.body);
+
+ var isInline = (Element.getStyle(element, 'display') === 'inline');
+ if (!isInline && element.offsetParent) return $(element.offsetParent);
+
+ while ((element = element.parentNode) && element !== document.body) {
+ if (Element.getStyle(element, 'position') !== 'static') {
+ return isHtml(element) ? $(document.body) : $(element);
+ }
+ }
+
+ return $(document.body);
+ }
+
+
+ function cumulativeOffset(element) {
+ element = $(element);
+ var valueT = 0, valueL = 0;
+ if (element.parentNode) {
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ }
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function positionedOffset(element) {
+ element = $(element);
+
+ var layout = element.getLayout();
+
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ if (element) {
+ if (isBody(element)) break;
+ var p = Element.getStyle(element, 'position');
+ if (p !== 'static') break;
+ }
+ } while (element);
+
+ valueL -= layout.get('margin-top');
+ valueT -= layout.get('margin-left');
+
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function cumulativeScrollOffset(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ } while (element);
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function viewportOffset(forElement) {
+ element = $(element);
+ var valueT = 0, valueL = 0, docBody = document.body;
+
+ var element = forElement;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == docBody &&
+ Element.getStyle(element, 'position') == 'absolute') break;
+ } while (element = element.offsetParent);
+
+ element = forElement;
+ do {
+ if (element != docBody) {
+ valueT -= element.scrollTop || 0;
+ valueL -= element.scrollLeft || 0;
+ }
+ } while (element = element.parentNode);
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function absolutize(element) {
+ element = $(element);
+
+ if (Element.getStyle(element, 'position') === 'absolute') {
+ return element;
+ }
+
+ var offsetParent = getOffsetParent(element);
+ var eOffset = element.viewportOffset(),
+ pOffset = offsetParent.viewportOffset();
+
+ var offset = eOffset.relativeTo(pOffset);
+ var layout = element.getLayout();
+
+ element.store('prototype_absolutize_original_styles', {
+ left: element.getStyle('left'),
+ top: element.getStyle('top'),
+ width: element.getStyle('width'),
+ height: element.getStyle('height')
+ });
+
+ element.setStyle({
+ position: 'absolute',
+ top: offset.top + 'px',
+ left: offset.left + 'px',
+ width: layout.get('width') + 'px',
+ height: layout.get('height') + 'px'
+ });
+
+ return element;
+ }
+
+ function relativize(element) {
+ element = $(element);
+ if (Element.getStyle(element, 'position') === 'relative') {
+ return element;
+ }
+
+ var originalStyles =
+ element.retrieve('prototype_absolutize_original_styles');
+
+ if (originalStyles) element.setStyle(originalStyles);
+ return element;
+ }
+
+ if (Prototype.Browser.IE) {
+ getOffsetParent = getOffsetParent.wrap(
+ function(proceed, element) {
+ element = $(element);
+
+ if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
+ return $(document.body);
+
+ var position = element.getStyle('position');
+ if (position !== 'static') return proceed(element);
+
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ }
+ );
+
+ positionedOffset = positionedOffset.wrap(function(proceed, element) {
+ element = $(element);
+ if (!element.parentNode) return new Element.Offset(0, 0);
+ var position = element.getStyle('position');
+ if (position !== 'static') return proceed(element);
+
+ var offsetParent = element.getOffsetParent();
+ if (offsetParent && offsetParent.getStyle('position') === 'fixed')
+ hasLayout(offsetParent);
+
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ });
+ } else if (Prototype.Browser.Webkit) {
+ cumulativeOffset = function(element) {
+ element = $(element);
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element, 'position') == 'absolute') break;
+
+ element = element.offsetParent;
+ } while (element);
+
+ return new Element.Offset(valueL, valueT);
+ };
+ }
+
+
+ Element.addMethods({
+ getLayout: getLayout,
+ measure: measure,
+ getDimensions: getDimensions,
+ getOffsetParent: getOffsetParent,
+ cumulativeOffset: cumulativeOffset,
+ positionedOffset: positionedOffset,
+ cumulativeScrollOffset: cumulativeScrollOffset,
+ viewportOffset: viewportOffset,
+ absolutize: absolutize,
+ relativize: relativize
+ });
+
+ function isBody(element) {
+ return element.nodeName.toUpperCase() === 'BODY';
+ }
+
+ function isHtml(element) {
+ return element.nodeName.toUpperCase() === 'HTML';
+ }
+
+ function isDocument(element) {
+ return element.nodeType === Node.DOCUMENT_NODE;
+ }
+
+ function isDetached(element) {
+ return element !== document.body &&
+ !Element.descendantOf(element, document.body);
+ }
+
+ if ('getBoundingClientRect' in document.documentElement) {
+ Element.addMethods({
+ viewportOffset: function(element) {
+ element = $(element);
+ if (isDetached(element)) return new Element.Offset(0, 0);
+
+ var rect = element.getBoundingClientRect(),
+ docEl = document.documentElement;
+ return new Element.Offset(rect.left - docEl.clientLeft,
+ rect.top - docEl.clientTop);
+ }
+ });
+ }
+})();
+window.$$ = function() {
+ var expression = $A(arguments).join(', ');
+ return Prototype.Selector.select(expression, document);
+};
+
+Prototype.Selector = (function() {
+
+ function select() {
+ throw new Error('Method "Prototype.Selector.select" must be defined.');
+ }
+
+ function match() {
+ throw new Error('Method "Prototype.Selector.match" must be defined.');
+ }
+
+ function find(elements, expression, index) {
+ index = index || 0;
+ var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i;
+
+ for (i = 0; i < length; i++) {
+ if (match(elements[i], expression) && index == matchIndex++) {
+ return Element.extend(elements[i]);
+ }
+ }
+ }
+
+ function extendElements(elements) {
+ for (var i = 0, length = elements.length; i < length; i++) {
+ Element.extend(elements[i]);
+ }
+ return elements;
+ }
+
+
+ var K = Prototype.K;
+
+ return {
+ select: select,
+ match: match,
+ find: find,
+ extendElements: (Element.extend === K) ? K : extendElements,
+ extendElement: Element.extend
+ };
+})();
+Prototype._original_property = window.Sizzle;
+/*!
+ * 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;
+
+[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, check, mode, extra, prune = true, contextXML = isXML(context),
+ soFar = selector;
+
+ 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 {
+ 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 ) {
+ throw "Syntax error, unrecognized expression: " + (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.match[ type ].exec( expr )) != null ) {
+ var filter = Expr.filter[ type ], found, item;
+ anyFound = false;
+
+ 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;
+ }
+ }
+ }
+
+ if ( expr == old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+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\(\)]*)+)\2\))?/
+ },
+ leftMatch: {},
+ attrMap: {
+ "class": "className",
+ "for": "htmlFor"
+ },
+ attrHandle: {
+ href: function(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part, isXML){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag && !isXML ) {
+ part = part.toUpperCase();
+ }
+
+ 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 === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part, isXML){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = isXML ? part : part.toUpperCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName === 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 ( !/\W/.test(part) ) {
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
+ 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 = isXML ? part : part.toUpperCase();
+ 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, isXML){
+ 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 + " ").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){
+ for ( var i = 0; curLoop[i] === false; i++ ){}
+ return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
+ },
+ CHILD: function(match){
+ if ( match[1] == "nth" ) {
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ 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 ( ( 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){
+ 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.toUpperCase() === "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 || "").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;
+ }
+ },
+ 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 === 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 );
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array, 0 );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
+
+} 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 0;
+ }
+
+ 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 0;
+ }
+
+ 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 0;
+ }
+
+ 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;
+ };
+}
+
+(function(){
+ var form = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<a name='" + id + "'/>";
+
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ 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(){
+
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ 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;
+ };
+ }
+
+ 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>";
+
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ 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
+})();
+
+if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
+ var div = document.createElement("div");
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ if ( div.getElementsByClassName("e").length === 0 )
+ return;
+
+ 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 ) {
+ var sibDir = dir == "previousSibling" && !isXML;
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ if ( sibDir && elem.nodeType === 1 ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ 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 === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ var sibDir = dir == "previousSibling" && !isXML;
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ if ( sibDir && elem.nodeType === 1 ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ 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){
+ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
+ !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ 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 );
+};
+
+
+window.Sizzle = Sizzle;
+
+})();
+
+;(function(engine) {
+ var extendElements = Prototype.Selector.extendElements;
+
+ function select(selector, scope) {
+ return extendElements(engine(selector, scope || document));
+ }
+
+ function match(element, selector) {
+ return engine.matches(selector, [element]).length == 1;
+ }
+
+ Prototype.Selector.engine = engine;
+ Prototype.Selector.select = select;
+ Prototype.Selector.match = match;
+})(Sizzle);
+
+window.Sizzle = Prototype._original_property;
+delete Prototype._original_property;
+
+var Form = {
+ reset: function(form) {
+ form = $(form);
+ form.reset();
+ return form;
+ },
+
+ serializeElements: function(elements, options) {
+ if (typeof options != 'object') options = { hash: !!options };
+ else if (Object.isUndefined(options.hash)) options.hash = true;
+ var key, value, submitted = false, submit = options.submit, accumulator, initial;
+
+ if (options.hash) {
+ initial = {};
+ accumulator = function(result, key, value) {
+ if (key in result) {
+ if (!Object.isArray(result[key])) result[key] = [result[key]];
+ result[key].push(value);
+ } else result[key] = value;
+ return result;
+ };
+ } else {
+ initial = '';
+ accumulator = function(result, key, value) {
+ return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ }
+ }
+
+ return elements.inject(initial, function(result, element) {
+ if (!element.disabled && element.name) {
+ key = element.name; value = $(element).getValue();
+ if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
+ submit !== false && (!submit || key == submit) && (submitted = true)))) {
+ result = accumulator(result, key, value);
+ }
+ }
+ return result;
+ });
+ }
+};
+
+Form.Methods = {
+ serialize: function(form, options) {
+ return Form.serializeElements(Form.getElements(form), options);
+ },
+
+ getElements: function(form) {
+ var elements = $(form).getElementsByTagName('*'),
+ element,
+ arr = [ ],
+ serializers = Form.Element.Serializers;
+ for (var i = 0; element = elements[i]; i++) {
+ arr.push(element);
+ }
+ return arr.inject([], function(elements, child) {
+ if (serializers[child.tagName.toLowerCase()])
+ elements.push(Element.extend(child));
+ return elements;
+ })
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) || (name && input.name != name))
+ continue;
+ matchingInputs.push(Element.extend(input));
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('disable');
+ return form;
+ },
+
+ enable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('enable');
+ return form;
+ },
+
+ findFirstElement: function(form) {
+ var elements = $(form).getElements().findAll(function(element) {
+ return 'hidden' != element.type && !element.disabled;
+ });
+ var firstByIndex = elements.findAll(function(element) {
+ return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
+ }).sortBy(function(element) { return element.tabIndex }).first();
+
+ return firstByIndex ? firstByIndex : elements.find(function(element) {
+ return /^(?:input|select|textarea)$/i.test(element.tagName);
+ });
+ },
+
+ focusFirstElement: function(form) {
+ form = $(form);
+ var element = form.findFirstElement();
+ if (element) element.activate();
+ return form;
+ },
+
+ request: function(form, options) {
+ form = $(form), options = Object.clone(options || { });
+
+ var params = options.parameters, action = form.readAttribute('action') || '';
+ if (action.blank()) action = window.location.href;
+ options.parameters = form.serialize(true);
+
+ if (params) {
+ if (Object.isString(params)) params = params.toQueryParams();
+ Object.extend(options.parameters, params);
+ }
+
+ if (form.hasAttribute('method') && !options.method)
+ options.method = form.method;
+
+ return new Ajax.Request(action, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+
+Form.Element = {
+ focus: function(element) {
+ $(element).focus();
+ return element;
+ },
+
+ select: function(element) {
+ $(element).select();
+ return element;
+ }
+};
+
+Form.Element.Methods = {
+
+ serialize: function(element) {
+ element = $(element);
+ if (!element.disabled && element.name) {
+ var value = element.getValue();
+ if (value != undefined) {
+ var pair = { };
+ pair[element.name] = value;
+ return Object.toQueryString(pair);
+ }
+ }
+ return '';
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ return Form.Element.Serializers[method](element);
+ },
+
+ setValue: function(element, value) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ Form.Element.Serializers[method](element, value);
+ return element;
+ },
+
+ clear: function(element) {
+ $(element).value = '';
+ return element;
+ },
+
+ present: function(element) {
+ return $(element).value != '';
+ },
+
+ activate: function(element) {
+ element = $(element);
+ try {
+ element.focus();
+ if (element.select && (element.tagName.toLowerCase() != 'input' ||
+ !(/^(?:button|reset|submit)$/i.test(element.type))))
+ element.select();
+ } catch (e) { }
+ return element;
+ },
+
+ disable: function(element) {
+ element = $(element);
+ element.disabled = true;
+ return element;
+ },
+
+ enable: function(element) {
+ element = $(element);
+ element.disabled = false;
+ return element;
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+var Field = Form.Element;
+
+var $F = Form.Element.Methods.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = (function() {
+ function input(element, value) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ return inputSelector(element, value);
+ default:
+ return valueSelector(element, value);
+ }
+ }
+
+ function inputSelector(element, value) {
+ if (Object.isUndefined(value))
+ return element.checked ? element.value : null;
+ else element.checked = !!value;
+ }
+
+ function valueSelector(element, value) {
+ if (Object.isUndefined(value)) return element.value;
+ else element.value = value;
+ }
+
+ function select(element, value) {
+ if (Object.isUndefined(value))
+ return (element.type === 'select-one' ? selectOne : selectMany)(element);
+
+ var opt, currentValue, single = !Object.isArray(value);
+ for (var i = 0, length = element.length; i < length; i++) {
+ opt = element.options[i];
+ currentValue = this.optionValue(opt);
+ if (single) {
+ if (currentValue == value) {
+ opt.selected = true;
+ return;
+ }
+ }
+ else opt.selected = value.include(currentValue);
+ }
+ }
+
+ function selectOne(element) {
+ var index = element.selectedIndex;
+ return index >= 0 ? optionValue(element.options[index]) : null;
+ }
+
+ function selectMany(element) {
+ var values, length = element.length;
+ if (!length) return null;
+
+ for (var i = 0, values = []; i < length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) values.push(optionValue(opt));
+ }
+ return values;
+ }
+
+ function optionValue(opt) {
+ return Element.hasAttribute(opt, 'value') ? opt.value : opt.text;
+ }
+
+ return {
+ input: input,
+ inputSelector: inputSelector,
+ textarea: valueSelector,
+ select: select,
+ selectOne: selectOne,
+ selectMany: selectMany,
+ optionValue: optionValue,
+ button: valueSelector
+ };
+})();
+
+/*--------------------------------------------------------------------------*/
+
+
+Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
+ initialize: function($super, element, frequency, callback) {
+ $super(callback, frequency);
+ this.element = $(element);
+ this.lastValue = this.getValue();
+ },
+
+ execute: function() {
+ var value = this.getValue();
+ if (Object.isString(this.lastValue) && Object.isString(value) ?
+ this.lastValue != value : String(this.lastValue) != String(value)) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+});
+
+Form.Element.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = Class.create({
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ Form.getElements(this.element).each(this.registerCallback, this);
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ default:
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+});
+
+Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+(function() {
+
+ var Event = {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+ KEY_HOME: 36,
+ KEY_END: 35,
+ KEY_PAGEUP: 33,
+ KEY_PAGEDOWN: 34,
+ KEY_INSERT: 45,
+
+ cache: {}
+ };
+
+ var docEl = document.documentElement;
+ var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
+ && 'onmouseleave' in docEl;
+
+
+
+ var isIELegacyEvent = function(event) { return false; };
+
+ if (window.attachEvent) {
+ if (window.addEventListener) {
+ isIELegacyEvent = function(event) {
+ return !(event instanceof window.Event);
+ };
+ } else {
+ isIELegacyEvent = function(event) { return true; };
+ }
+ }
+
+ var _isButton;
+
+ function _isButtonForDOMEvents(event, code) {
+ return event.which ? (event.which === code + 1) : (event.button === code);
+ }
+
+ var legacyButtonMap = { 0: 1, 1: 4, 2: 2 };
+ function _isButtonForLegacyEvents(event, code) {
+ return event.button === legacyButtonMap[code];
+ }
+
+ function _isButtonForWebKit(event, code) {
+ switch (code) {
+ case 0: return event.which == 1 && !event.metaKey;
+ case 1: return event.which == 2 || (event.which == 1 && event.metaKey);
+ case 2: return event.which == 3;
+ default: return false;
+ }
+ }
+
+ if (window.attachEvent) {
+ if (!window.addEventListener) {
+ _isButton = _isButtonForLegacyEvents;
+ } else {
+ _isButton = function(event, code) {
+ return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) :
+ _isButtonForDOMEvents(event, code);
+ }
+ }
+ } else if (Prototype.Browser.WebKit) {
+ _isButton = _isButtonForWebKit;
+ } else {
+ _isButton = _isButtonForDOMEvents;
+ }
+
+ function isLeftClick(event) { return _isButton(event, 0) }
+
+ function isMiddleClick(event) { return _isButton(event, 1) }
+
+ function isRightClick(event) { return _isButton(event, 2) }
+
+ function element(event) {
+ event = Event.extend(event);
+
+ var node = event.target, type = event.type,
+ currentTarget = event.currentTarget;
+
+ if (currentTarget && currentTarget.tagName) {
+ if (type === 'load' || type === 'error' ||
+ (type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
+ && currentTarget.type === 'radio'))
+ node = currentTarget;
+ }
+
+ if (node.nodeType == Node.TEXT_NODE)
+ node = node.parentNode;
+
+ return Element.extend(node);
+ }
+
+ function findElement(event, expression) {
+ var element = Event.element(event);
+
+ if (!expression) return element;
+ while (element) {
+ if (Object.isElement(element) && Prototype.Selector.match(element, expression)) {
+ return Element.extend(element);
+ }
+ element = element.parentNode;
+ }
+ }
+
+ function pointer(event) {
+ return { x: pointerX(event), y: pointerY(event) };
+ }
+
+ function pointerX(event) {
+ var docElement = document.documentElement,
+ body = document.body || { scrollLeft: 0 };
+
+ return event.pageX || (event.clientX +
+ (docElement.scrollLeft || body.scrollLeft) -
+ (docElement.clientLeft || 0));
+ }
+
+ function pointerY(event) {
+ var docElement = document.documentElement,
+ body = document.body || { scrollTop: 0 };
+
+ return event.pageY || (event.clientY +
+ (docElement.scrollTop || body.scrollTop) -
+ (docElement.clientTop || 0));
+ }
+
+
+ function stop(event) {
+ Event.extend(event);
+ event.preventDefault();
+ event.stopPropagation();
+
+ event.stopped = true;
+ }
+
+
+ Event.Methods = {
+ isLeftClick: isLeftClick,
+ isMiddleClick: isMiddleClick,
+ isRightClick: isRightClick,
+
+ element: element,
+ findElement: findElement,
+
+ pointer: pointer,
+ pointerX: pointerX,
+ pointerY: pointerY,
+
+ stop: stop
+ };
+
+ var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
+ m[name] = Event.Methods[name].methodize();
+ return m;
+ });
+
+ if (window.attachEvent) {
+ function _relatedTarget(event) {
+ var element;
+ switch (event.type) {
+ case 'mouseover':
+ case 'mouseenter':
+ element = event.fromElement;
+ break;
+ case 'mouseout':
+ case 'mouseleave':
+ element = event.toElement;
+ break;
+ default:
+ return null;
+ }
+ return Element.extend(element);
+ }
+
+ var additionalMethods = {
+ stopPropagation: function() { this.cancelBubble = true },
+ preventDefault: function() { this.returnValue = false },
+ inspect: function() { return '[object Event]' }
+ };
+
+ Event.extend = function(event, element) {
+ if (!event) return false;
+
+ if (!isIELegacyEvent(event)) return event;
+
+ if (event._extendedByPrototype) return event;
+ event._extendedByPrototype = Prototype.emptyFunction;
+
+ var pointer = Event.pointer(event);
+
+ Object.extend(event, {
+ target: event.srcElement || element,
+ relatedTarget: _relatedTarget(event),
+ pageX: pointer.x,
+ pageY: pointer.y
+ });
+
+ Object.extend(event, methods);
+ Object.extend(event, additionalMethods);
+
+ return event;
+ };
+ } else {
+ Event.extend = Prototype.K;
+ }
+
+ if (window.addEventListener) {
+ Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__;
+ Object.extend(Event.prototype, methods);
+ }
+
+ function _createResponder(element, eventName, handler) {
+ var registry = Element.retrieve(element, 'prototype_event_registry');
+
+ if (Object.isUndefined(registry)) {
+ CACHE.push(element);
+ registry = Element.retrieve(element, 'prototype_event_registry', $H());
+ }
+
+ var respondersForEvent = registry.get(eventName);
+ if (Object.isUndefined(respondersForEvent)) {
+ respondersForEvent = [];
+ registry.set(eventName, respondersForEvent);
+ }
+
+ if (respondersForEvent.pluck('handler').include(handler)) return false;
+
+ var responder;
+ if (eventName.include(":")) {
+ responder = function(event) {
+ if (Object.isUndefined(event.eventName))
+ return false;
+
+ if (event.eventName !== eventName)
+ return false;
+
+ Event.extend(event, element);
+ handler.call(element, event);
+ };
+ } else {
+ if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED &&
+ (eventName === "mouseenter" || eventName === "mouseleave")) {
+ if (eventName === "mouseenter" || eventName === "mouseleave") {
+ responder = function(event) {
+ Event.extend(event, element);
+
+ var parent = event.relatedTarget;
+ while (parent && parent !== element) {
+ try { parent = parent.parentNode; }
+ catch(e) { parent = element; }
+ }
+
+ if (parent === element) return;
+
+ handler.call(element, event);
+ };
+ }
+ } else {
+ responder = function(event) {
+ Event.extend(event, element);
+ handler.call(element, event);
+ };
+ }
+ }
+
+ responder.handler = handler;
+ respondersForEvent.push(responder);
+ return responder;
+ }
+
+ function _destroyCache() {
+ for (var i = 0, length = CACHE.length; i < length; i++) {
+ Event.stopObserving(CACHE[i]);
+ CACHE[i] = null;
+ }
+ }
+
+ var CACHE = [];
+
+ if (Prototype.Browser.IE)
+ window.attachEvent('onunload', _destroyCache);
+
+ if (Prototype.Browser.WebKit)
+ window.addEventListener('unload', Prototype.emptyFunction, false);
+
+
+ var _getDOMEventName = Prototype.K,
+ translations = { mouseenter: "mouseover", mouseleave: "mouseout" };
+
+ if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) {
+ _getDOMEventName = function(eventName) {
+ return (translations[eventName] || eventName);
+ };
+ }
+
+ function observe(element, eventName, handler) {
+ element = $(element);
+
+ var responder = _createResponder(element, eventName, handler);
+
+ if (!responder) return element;
+
+ if (eventName.include(':')) {
+ if (element.addEventListener)
+ element.addEventListener("dataavailable", responder, false);
+ else {
+ element.attachEvent("ondataavailable", responder);
+ element.attachEvent("onlosecapture", responder);
+ }
+ } else {
+ var actualEventName = _getDOMEventName(eventName);
+
+ if (element.addEventListener)
+ element.addEventListener(actualEventName, responder, false);
+ else
+ element.attachEvent("on" + actualEventName, responder);
+ }
+
+ return element;
+ }
+
+ function stopObserving(element, eventName, handler) {
+ element = $(element);
+
+ var registry = Element.retrieve(element, 'prototype_event_registry');
+ if (!registry) return element;
+
+ if (!eventName) {
+ registry.each( function(pair) {
+ var eventName = pair.key;
+ stopObserving(element, eventName);
+ });
+ return element;
+ }
+
+ var responders = registry.get(eventName);
+ if (!responders) return element;
+
+ if (!handler) {
+ responders.each(function(r) {
+ stopObserving(element, eventName, r.handler);
+ });
+ return element;
+ }
+
+ var i = responders.length, responder;
+ while (i--) {
+ if (responders[i].handler === handler) {
+ responder = responders[i];
+ break;
+ }
+ }
+ if (!responder) return element;
+
+ if (eventName.include(':')) {
+ if (element.removeEventListener)
+ element.removeEventListener("dataavailable", responder, false);
+ else {
+ element.detachEvent("ondataavailable", responder);
+ element.detachEvent("onlosecapture", responder);
+ }
+ } else {
+ var actualEventName = _getDOMEventName(eventName);
+ if (element.removeEventListener)
+ element.removeEventListener(actualEventName, responder, false);
+ else
+ element.detachEvent('on' + actualEventName, responder);
+ }
+
+ registry.set(eventName, responders.without(responder));
+
+ return element;
+ }
+
+ function fire(element, eventName, memo, bubble) {
+ element = $(element);
+
+ if (Object.isUndefined(bubble))
+ bubble = true;
+
+ if (element == document && document.createEvent && !element.dispatchEvent)
+ element = document.documentElement;
+
+ var event;
+ if (document.createEvent) {
+ event = document.createEvent('HTMLEvents');
+ event.initEvent('dataavailable', bubble, true);
+ } else {
+ event = document.createEventObject();
+ event.eventType = bubble ? 'ondataavailable' : 'onlosecapture';
+ }
+
+ event.eventName = eventName;
+ event.memo = memo || { };
+
+ if (document.createEvent)
+ element.dispatchEvent(event);
+ else
+ element.fireEvent(event.eventType, event);
+
+ return Event.extend(event);
+ }
+
+ Event.Handler = Class.create({
+ initialize: function(element, eventName, selector, callback) {
+ this.element = $(element);
+ this.eventName = eventName;
+ this.selector = selector;
+ this.callback = callback;
+ this.handler = this.handleEvent.bind(this);
+ },
+
+ start: function() {
+ Event.observe(this.element, this.eventName, this.handler);
+ return this;
+ },
+
+ stop: function() {
+ Event.stopObserving(this.element, this.eventName, this.handler);
+ return this;
+ },
+
+ handleEvent: function(event) {
+ var element = Event.findElement(event, this.selector);
+ if (element) this.callback.call(this.element, event, element);
+ }
+ });
+
+ function on(element, eventName, selector, callback) {
+ element = $(element);
+ if (Object.isFunction(selector) && Object.isUndefined(callback)) {
+ callback = selector, selector = null;
+ }
+
+ return new Event.Handler(element, eventName, selector, callback).start();
+ }
+
+ Object.extend(Event, Event.Methods);
+
+ Object.extend(Event, {
+ fire: fire,
+ observe: observe,
+ stopObserving: stopObserving,
+ on: on
+ });
+
+ Element.addMethods({
+ fire: fire,
+
+ observe: observe,
+
+ stopObserving: stopObserving,
+
+ on: on
+ });
+
+ Object.extend(document, {
+ fire: fire.methodize(),
+
+ observe: observe.methodize(),
+
+ stopObserving: stopObserving.methodize(),
+
+ on: on.methodize(),
+
+ loaded: false
+ });
+
+ if (window.Event) Object.extend(window.Event, Event);
+ else window.Event = Event;
+})();
+
+(function() {
+ /* Support for the DOMContentLoaded event is based on work by Dan Webb,
+ Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */
+
+ var timer;
+
+ function fireContentLoadedEvent() {
+ if (document.loaded) return;
+ if (timer) window.clearTimeout(timer);
+ document.loaded = true;
+ document.fire('dom:loaded');
+ }
+
+ function checkReadyState() {
+ if (document.readyState === 'complete') {
+ document.stopObserving('readystatechange', checkReadyState);
+ fireContentLoadedEvent();
+ }
+ }
+
+ function pollDoScroll() {
+ try { document.documentElement.doScroll('left'); }
+ catch(e) {
+ timer = pollDoScroll.defer();
+ return;
+ }
+ fireContentLoadedEvent();
+ }
+
+ if (document.addEventListener) {
+ document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false);
+ } else {
+ document.observe('readystatechange', checkReadyState);
+ if (window == top)
+ timer = pollDoScroll.defer();
+ }
+
+ Event.observe(window, 'load', fireContentLoadedEvent);
+})();
+
+Element.addMethods();
+
+/*------------------------------- DEPRECATED -------------------------------*/
+
+Hash.toQueryString = Object.toQueryString;
+
+var Toggle = { display: Element.toggle };
+
+Element.Methods.childOf = Element.Methods.descendantOf;
+
+var Insertion = {
+ Before: function(element, content) {
+ return Element.insert(element, {before:content});
+ },
+
+ Top: function(element, content) {
+ return Element.insert(element, {top:content});
+ },
+
+ Bottom: function(element, content) {
+ return Element.insert(element, {bottom:content});
+ },
+
+ After: function(element, content) {
+ return Element.insert(element, {after:content});
+ }
+};
+
+var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
+
+var Position = {
+ includeScrollOffsets: false,
+
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = Element.cumulativeScrollOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+
+ cumulativeOffset: Element.Methods.cumulativeOffset,
+
+ positionedOffset: Element.Methods.positionedOffset,
+
+ absolutize: function(element) {
+ Position.prepare();
+ return Element.absolutize(element);
+ },
+
+ relativize: function(element) {
+ Position.prepare();
+ return Element.relativize(element);
+ },
+
+ realOffset: Element.Methods.cumulativeScrollOffset,
+
+ offsetParent: Element.Methods.getOffsetParent,
+
+ page: Element.Methods.viewportOffset,
+
+ clone: function(source, target, options) {
+ options = options || { };
+ return Element.clonePosition(target, source, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
+ function iter(name) {
+ return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
+ }
+
+ instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
+ function(element, className) {
+ className = className.toString().strip();
+ var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
+ return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
+ } : function(element, className) {
+ className = className.toString().strip();
+ var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
+ if (!classNames && !className) return elements;
+
+ var nodes = $(element).getElementsByTagName('*');
+ className = ' ' + className + ' ';
+
+ for (var i = 0, child, cn; child = nodes[i]; i++) {
+ if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
+ (classNames && classNames.all(function(name) {
+ return !name.toString().blank() && cn.include(' ' + name + ' ');
+ }))))
+ elements.push(Element.extend(child));
+ }
+ return elements;
+ };
+
+ return function(className, parentElement) {
+ return $(parentElement || document.body).getElementsByClassName(className);
+ };
+}(Element.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set($A(this).concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set($A(this).without(classNameToRemove).join(' '));
+ },
+
+ toString: function() {
+ return $A(this).join(' ');
+ }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+
+/*--------------------------------------------------------------------------*/
+
+(function() {
+ window.Selector = Class.create({
+ initialize: function(expression) {
+ this.expression = expression.strip();
+ },
+
+ findElements: function(rootElement) {
+ return Prototype.Selector.select(this.expression, rootElement);
+ },
+
+ match: function(element) {
+ return Prototype.Selector.match(element, this.expression);
+ },
+
+ toString: function() {
+ return this.expression;
+ },
+
+ inspect: function() {
+ return "#<Selector: " + this.expression + ">";
+ }
+ });
+
+ Object.extend(Selector, {
+ matchElements: function(elements, expression) {
+ var match = Prototype.Selector.match,
+ results = [];
+
+ for (var i = 0, length = elements.length; i < length; i++) {
+ var element = elements[i];
+ if (match(element, expression)) {
+ results.push(Element.extend(element));
+ }
+ }
+ return results;
+ },
+
+ findElement: function(elements, expression, index) {
+ index = index || 0;
+ var matchIndex = 0, element;
+ for (var i = 0, length = elements.length; i < length; i++) {
+ element = elements[i];
+ if (Prototype.Selector.match(element, expression) && index === matchIndex++) {
+ return Element.extend(element);
+ }
+ }
+ },
+
+ findChildElements: function(element, expressions) {
+ var selector = expressions.toArray().join(', ');
+ return Prototype.Selector.select(selector, element || document);
+ }
+ });
+})();
13 years, 2 months
JBoss Rich Faces SVN: r22828 - branches/enterprise.
by richfaces-svn-commits@lists.jboss.org
Author: ivassile
Date: 2011-10-19 15:22:49 -0400 (Wed, 19 Oct 2011)
New Revision: 22828
Added:
branches/enterprise/3.3.1.SP3_RFPL-1737/
Log:
Created branch for the RFPL-1737 patch.
13 years, 2 months
JBoss Rich Faces SVN: r22827 - in modules/tests/metamer/branches/wfk2-product-branch: application and 43 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-10-19 09:49:01 -0400 (Wed, 19 Oct 2011)
New Revision: 22827
Added:
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/defaultEventHandlers.xhtml
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/MenuItemAttributes.java
modules/tests/metamer/branches/wfk2-product-branch/ftest/run-test-with-replace-context-params.sh
Modified:
modules/tests/metamer/branches/wfk2-product-branch/
modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/VersionBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAjaxBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCalendarBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichComponentControlBean.properties
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/eventHandlers.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/list.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richAutocomplete/csv.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richAutocomplete/jsr303.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richFileUpload/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/moreStacks.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/validation.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richPickList/simple.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/footer.xhtml
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/pom.xml
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/TestDataScroller.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingComponentControl.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richHashParam/TestRichHashParam.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/TestRichMenuItem.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesCSV.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSFValidator.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSR303.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/NotifyStackAttributes.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java
modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
modules/tests/metamer/branches/wfk2-product-branch/ftest/pom.xml
modules/tests/metamer/branches/wfk2-product-branch/ftest/src/test/resources/testng-output.xml
Log:
merged with trunk
Property changes on: modules/tests/metamer/branches/wfk2-product-branch
___________________________________________________________________
Added: svn:mergeinfo
+ /modules/tests/metamer/trunk:22762-22826
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/pom.xml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -110,13 +110,8 @@
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
</dependency>
+
<dependency>
- <groupId>org.jboss.netty</groupId>
- <artifactId>netty</artifactId>
- <version>3.2.2.Final</version>
- </dependency>
-
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
@@ -207,7 +202,7 @@
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
- <version>1.3.8</version>
+ <version>1.3.9</version>
<executions>
<execution>
<phase>package</phase>
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -430,8 +430,8 @@
* @param event
* an event representing the activation of a user interface component
*/
- public void changeEventListener(ValueChangeEvent event) {
- logToPage("*2 value changed: " + event.getOldValue() + " -> " + event.getNewValue());
+ public void changeEventListener(AjaxBehaviorEvent event) {
+ logToPage("*2 value changed ");
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/VersionBean.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/VersionBean.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/VersionBean.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -140,8 +140,6 @@
StringBuilder result = new StringBuilder();
result.append("RichFaces ");
result.append(rfVersionBean.getVersion().getImplementationVersion());
- result.append(" r.");
- result.append(rfVersionBean.getVersion().getScmRevision());
richFacesVersion = result.toString();
return richFacesVersion;
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAjaxBean.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAjaxBean.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAjaxBean.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -53,6 +53,7 @@
private static Logger logger;
private Attributes attributes;
private String input;
+ private List<?> inputs;
private List<String> cars;
private String car;
private boolean boolVal;
@@ -199,4 +200,12 @@
public void causeErrorListener(AjaxBehaviorEvent event) {
throw new FacesException("Ajax request caused an error. This is intentional behavior.");
}
+
+ public List<?> getInputs() {
+ return inputs;
+ }
+
+ public void setInputs(List<?> inputs) {
+ this.inputs = inputs;
+ }
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCalendarBean.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCalendarBean.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCalendarBean.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -47,7 +47,7 @@
/**
* Managed bean for rich:calendar.
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@@ -149,7 +149,7 @@
/**
* A value change listener that logs to the page old and new value.
- *
+ *
* @param event
* an event representing the activation of a user interface component
*/
@@ -161,10 +161,18 @@
String newDate = "null";
if (event.getOldValue() != null) {
- oldDate = sdf.format((Date) event.getOldValue());
+ if (event.getOldValue() instanceof String) {
+ oldDate = (String) event.getOldValue();
+ } else {
+ oldDate = sdf.format((Date) event.getOldValue());
+ }
}
if (event.getNewValue() != null) {
- newDate = sdf.format((Date) event.getNewValue());
+ if (event.getNewValue() instanceof String) {
+ newDate = (String) event.getNewValue();
+ } else {
+ newDate = sdf.format((Date) event.getNewValue());
+ }
}
RichBean.logToPage("* value changed: " + oldDate + " -> " + newDate);
@@ -180,7 +188,7 @@
int componentYear = cal.get(Calendar.YEAR);
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Date too far in the past.",
- "Select a date from year 1991 or newer.");
+ "Select a date from year 1991 or newer.");
if (componentYear < 1991) {
FacesContext.getCurrentInstance().addMessage("form:calendar", message);
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichNotifyBean.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -85,13 +85,11 @@
attributesNotifyStackFirst.setAttribute("method", "first");
attributesNotifyStackFirst.setAttribute("position", "topRight");
attributesNotifyStackFirst.setAttribute("rendered", true);
- attributesNotifyStackFirst.setAttribute("styleClass", "topRight");
attributesNotifyStackSecond.setAttribute("direction", "vertical");
attributesNotifyStackSecond.setAttribute("method", "first");
attributesNotifyStackSecond.setAttribute("position", "bottomRight");
attributesNotifyStackSecond.setAttribute("rendered", true);
- attributesNotifyStackSecond.setAttribute("styleClass", "bottomRight");
attributesBean.setAttribute("messageCount", "1");
attributesBean.setAttribute("messageDetail", DEFAULT_DETAIL);
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -34,7 +34,7 @@
/**
* Managed bean for rich:tab.
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@@ -61,6 +61,8 @@
attributes.setAttribute("rendered", true);
// will be tested in another way
+ attributes.remove("action");
+ attributes.remove("actionListener");
attributes.remove("converter");
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -69,7 +69,7 @@
attributes.setAttribute("mode", "client");
attributes.setAttribute("showEvent", "mouseenter");
attributes.setAttribute("hideEvent", "mouseleave");
- attributes.setAttribute("target", "form:panel");
+ attributes.setAttribute("target", "panel");
// attributes that needs to be tested in other way
attributes.remove("converter");
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichComponentControlBean.properties
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichComponentControlBean.properties 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/resources/org/richfaces/tests/metamer/bean/rich/RichComponentControlBean.properties 2011-10-19 13:49:01 UTC (rev 22827)
@@ -1,4 +1,3 @@
-attr.operation.none=
attr.operation.first=first
attr.operation.last=last
attr.operation.previous=previous
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/WEB-INF/web.xml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -1,81 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="3.0" 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_3_0.xsd">
-
- <display-name>metamer</display-name>
-
- <welcome-file-list>
- <welcome-file>faces/index.xhtml</welcome-file>
- </welcome-file-list>
-
- <!-- disabled because of a bug in Mojarra 2.1 showing an error message on every page -->
- <!-- <context-param>
+<web-app version="3.0" 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_3_0.xsd">
+ <display-name>metamer</display-name>
+ <!-- disabled because of a bug in Mojarra 2.1 showing an error message on every page
+ <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.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.skin</param-name>
- <param-value>#{richBean.skin}</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
- <param-value>2097152</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.push.jms.connectionUsername</param-name>
- <param-value>guest</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.push.jms.connectionPassword</param-name>
- <param-value>guest</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>
- <servlet-name>Resource Servlet</servlet-name>
- <servlet-class>org.richfaces.webapp.ResourceServlet</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>
- <servlet-mapping>
- <servlet-name>Resource Servlet</servlet-name>
- <url-pattern>/org.richfaces.resources/*</url-pattern>
- </servlet-mapping>
- <filter>
- <filter-name>PushFilter</filter-name>
- <filter-class>org.richfaces.webapp.PushFilter</filter-class>
- <async-supported>true</async-supported>
- </filter>
- <filter-mapping>
- <filter-name>PushFilter</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- </filter-mapping>
- <filter>
- <filter-name>Test Identity Filter</filter-name>
- <filter-class>org.richfaces.tests.metamer.TestIdentityFilter</filter-class>
- <async-supported>true</async-supported>
- </filter>
- <filter-mapping>
- <filter-name>Test Identity Filter</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- </filter-mapping>
+ <context-param>
+ <param-name>com.sun.faces.enableMissingResourceLibraryDetection</param-name>
+ <param-value>true</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.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
+ <param-value>2097152</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.push.jms.connectionPassword</param-name>
+ <param-value>guest</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.push.jms.connectionUsername</param-name>
+ <param-value>guest</param-value>
+ </context-param>
+
+ <!-- resource mapping enable/disable/configure -->
+ <context-param>
+ <param-name>org.richfaces.resourceMapping.compressedStages</param-name>
+ <param-value>None</param-value>
+ </context-param>
+ <!-- -->
+ <context-param>
+ <param-name>org.richfaces.resourceMapping.packedStages</param-name>
+ <param-value>None</param-value>
+ </context-param>
+ <!-- -->
+ <context-param>
+ <param-name>org.richfaces.resourceMapping.enabled</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{richBean.skin}</param-value>
+ </context-param>
+ <filter>
+ <filter-name>PushFilter</filter-name>
+ <filter-class>org.richfaces.webapp.PushFilter</filter-class>
+ <async-supported>true</async-supported>
+ </filter>
+ <filter>
+ <filter-name>Test Identity Filter</filter-name>
+ <filter-class>org.richfaces.tests.metamer.TestIdentityFilter</filter-class>
+ <async-supported>true</async-supported>
+ </filter>
+ <filter-mapping>
+ <filter-name>PushFilter</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>Test Identity Filter</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>Resource Servlet</servlet-name>
+ <servlet-class>org.richfaces.webapp.ResourceServlet</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>
+ <servlet-mapping>
+ <servlet-name>Resource Servlet</servlet-name>
+ <url-pattern>/org.richfaces.resources/*</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>faces/index.xhtml</welcome-file>
+ </welcome-file-list>
</web-app>
Copied: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/defaultEventHandlers.xhtml (from rev 22826, modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/defaultEventHandlers.xhtml)
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/defaultEventHandlers.xhtml (rev 0)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/defaultEventHandlers.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+ <h:panelGrid columns="2">
+ <h:column>
+ h:inputText:
+ </h:column>
+ <h:column>
+ <h:inputText id="simpleText1" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </h:inputText>
+ </h:column>
+
+ <h:column>
+ rich:accordion
+ </h:column>
+ <h:column>
+ <ui:remove>
+ <!-- rich:accordion id="accordion" itemChangeListener="#{richBean.itemChangeListener}" >
+ <rich:accordionItem id="item1" name="item1" header="Item 1">
+ content of item 1
+ </rich:accordionItem>
+ <rich:accordionItem id="item2" name="item2" header="Item 2">
+ content of item 2
+ </rich:accordionItem>
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </rich:accordion-->
+ </ui:remove>
+ </h:column>
+
+ <h:column>
+ rich:autocomplete:
+ </h:column>
+ <h:column>
+ <rich:autocomplete id="autocomplete1" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </rich:autocomplete>
+ </h:column>
+
+ <h:column>
+ rich:calendar
+ </h:column>
+ <h:column>
+ <rich:calendar id="calendar" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </rich:calendar>
+ </h:column>
+
+ <h:column>
+ rich:editor
+ </h:column>
+ <h:column>
+ <ui:remove>
+ <!-- rich:editor id="editor1" value="#{a4jAjaxBean.input}" width="310px" height="40px"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </rich:editor-->
+ </ui:remove>
+ </h:column>
+
+ <h:column>
+ rich:inplaceInput
+ </h:column>
+ <h:column>
+ <ui:remove>
+ <!--rich:inplaceInput id="inplaceInput" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </rich:inplaceInput-->
+ </ui:remove>
+ </h:column>
+
+ <h:column>
+ rich:inplaceSelect
+ </h:column>
+ <h:column>
+ <rich:inplaceSelect id="inplaceSelect" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <f:selectItem itemLabel="x" itemValue="x" />
+ <f:selectItem itemLabel="y" itemValue="y" />
+ <f:selectItem itemLabel="z" itemValue="z" />
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </rich:inplaceSelect>
+ </h:column>
+
+ <h:column>
+ rich:inputNumberSlider
+ </h:column>
+ <h:column>
+ <rich:inputNumberSlider id="inputNumberSlider" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </rich:inputNumberSlider>
+ </h:column>
+
+ <h:column>
+ rich:inputNumberSpinner
+ </h:column>
+ <h:column>
+ <rich:inputNumberSpinner id="inputNumberSpinner" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax listener="#{richBean.actionListener}" render="output" />
+ </rich:inputNumberSpinner>
+ </h:column>
+
+ </h:panelGrid>
+
+ <br/>
+ <a4j:outputPanel id="output" layout="block">
+ Output: <h:outputText value="#{a4jAjaxBean.input}"/>
+ </a4j:outputPanel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/eventHandlers.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/eventHandlers.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/eventHandlers.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -62,12 +62,110 @@
valueChangeListener="#{richBean.valueChangeListener}" >
<a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
</rich:autocomplete>
- </h:column>
+ </h:column>
+ <h:column>
<rich:autocomplete id="autocomplete2" value="#{a4jAjaxBean.input}">
<a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
</rich:autocomplete>
+ </h:column>
+
<h:column>
+ rich:calendar
</h:column>
+ <h:column>
+ <rich:calendar id="calendar1" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:calendar>
+ </h:column>
+ <h:column>
+ <rich:calendar id="calendar2" value="#{a4jAjaxBean.input}" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:calendar>
+ </h:column>
+
+ <h:column>
+ rich:editor
+ </h:column>
+ <h:column>
+ <rich:editor id="editor1" value="#{a4jAjaxBean.input}" width="310px" height="40px"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
+ </rich:editor>
+ </h:column>
+ <h:column>
+ <rich:editor id="editor2" value="#{a4jAjaxBean.input}" width="310px" height="40px" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output1" />
+ </rich:editor>
+ </h:column>
+
+ <h:column>
+ rich:inplaceInput
+ </h:column>
+ <h:column>
+ <rich:inplaceInput id="inplaceInput1" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:inplaceInput>
+ </h:column>
+ <h:column>
+ <rich:inplaceInput id="inplaceInput2" value="#{a4jAjaxBean.input}" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:inplaceInput>
+ </h:column>
+
+ <h:column>
+ rich:inplaceSelect
+ </h:column>
+ <h:column>
+ <rich:inplaceSelect id="inplaceSelect1" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <f:selectItem itemLabel="x" itemValue="x" />
+ <f:selectItem itemLabel="y" itemValue="y" />
+ <f:selectItem itemLabel="z" itemValue="z" />
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:inplaceSelect>
+ </h:column>
+ <h:column>
+ <rich:inplaceSelect id="inplaceSelect2" value="#{a4jAjaxBean.input}" >
+ <f:selectItem itemLabel="x" itemValue="x" />
+ <f:selectItem itemLabel="y" itemValue="y" />
+ <f:selectItem itemLabel="z" itemValue="z" />
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:inplaceSelect>
+ </h:column>
+
+ <h:column>
+ rich:inputNumberSlider
+ </h:column>
+ <h:column>
+ <rich:inputNumberSlider id="inputNumberSlider1" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:inputNumberSlider>
+ </h:column>
+ <h:column>
+ <rich:inputNumberSlider id="inputNumberSlider2" value="#{a4jAjaxBean.input}">
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:inputNumberSlider>
+ </h:column>
+
+ <h:column>
+ rich:inputNumberSpinner
+ </h:column>
+ <h:column>
+ <rich:inputNumberSpinner id="inputNumberSpinner1" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:inputNumberSpinner>
+ </h:column>
+ <h:column>
+ <rich:inputNumberSpinner id="inputNumberSpinner2" value="#{a4jAjaxBean.input}"
+ valueChangeListener="#{richBean.valueChangeListener}" >
+ <a4j:ajax event="change" listener="#{richBean.actionListener}" render="output" />
+ </rich:inputNumberSpinner>
+ </h:column>
+
</h:panelGrid>
<br/>
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/list.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/list.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/a4jAjax/list.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -93,6 +93,10 @@
<metamer:testPageLink id="eventHandlers" outcome="eventHandlers" value="Event handlers for various components">
Simple page that contains <b>various components</b> with <b>a4j:ajax</b> with event handler to tests collisions on this attribute
</metamer:testPageLink>
+
+ <metamer:testPageLink id="defaultEventHandlers" outcome="defaultEventHandlers" value="Default event handlers for various components">
+ Simple page that contains <b>various components</b> with <b>a4j:ajax</b> with default event handler
+ </metamer:testPageLink>
</ui:define>
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richAutocomplete/csv.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richAutocomplete/csv.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richAutocomplete/csv.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -74,6 +74,7 @@
custom (RichFaces)
<rich:autocomplete id="input4"
+ autocompleteMethod="#{richAutocompleteBean.autocomplete}"
value="#{richAutocompleteBean.value4}"
>
<f:validator validatorId="org.richfaces.StringRichFacesValidator"/>
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richAutocomplete/jsr303.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richAutocomplete/jsr303.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richAutocomplete/jsr303.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -69,7 +69,8 @@
<rich:message id="inputMsg3" for="input3"/>
custom (RichFaces)
- <rich:autocomplete id="input4"
+ <rich:autocomplete id="input4"
+ autocompleteMethod="#{richAutocompleteBean.autocomplete}"
value="#{richAutocompleteBean.value4}"
>
<f:validator validatorId="org.richfaces.StringRichFacesValidator"/>
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richFileUpload/simple.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richFileUpload/simple.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richFileUpload/simple.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -55,6 +55,7 @@
noDuplicate="#{richFileUploadBean.attributes['noDuplicate'].value}"
onbeforedomupdate="#{richFileUploadBean.attributes['onbeforedomupdate'].value}"
onbegin="#{richFileUploadBean.attributes['onbegin'].value}"
+ onclear="#{richFileUploadBean.attributes['onclear'].value}"
onclick="#{richFileUploadBean.attributes['onclick'].value}"
oncomplete="#{richFileUploadBean.attributes['oncomplete'].value}"
ondblclick="#{richFileUploadBean.attributes['ondblclick'].value}"
@@ -67,6 +68,7 @@
onmouseout="#{richFileUploadBean.attributes['onmouseout'].value}"
onmouseover="#{richFileUploadBean.attributes['onmouseover'].value}"
onmouseup="#{richFileUploadBean.attributes['onmouseup'].value}"
+ ontyperejected="#{richFileUploadBean.attributes['ontyperejected'].value}"
onuploadcomplete="#{richFileUploadBean.attributes['onuploadcomplete'].value}"
render="#{richFileUploadBean.attributes['render'].value}"
rendered="#{richFileUploadBean.attributes['rendered'].value}"
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/moreStacks.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/moreStacks.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/moreStacks.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -27,39 +27,13 @@
-->
<ui:composition template="/templates/template.xhtml">
-
- <ui:define name="head">
-<!--
- <style>
- .topLeft {
- bottom: auto;
- left: 10px;
- top: 10px;
- right: auto;
- }
-
- .topRight {
- bottom: auto;
- right: 10px;
- top: 10px;
- left: auto;
- }
-
- .bottomLeft {
- bottom: 10px;
- left: 10px;
- top: auto;
- right: auto;
- }
-
- .bottomRight {
- bottom: 10px;
- right: 10px;
- top: auto;
- left: auto;
- }
- </style>
- -->
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
</ui:define>
<ui:define name="component">
@@ -165,14 +139,15 @@
<h:outputLabel for="number1" value="Number for Stack 1 (from 5 to 10)"/>
<h:inputText id="number1" required="true">
<f:validateLongRange minimum="5" maximum="10"/>
- <a4j:ajax event="change" execute="@form"/>
</h:inputText>
<br />
<h:outputLabel for="number2" value="Number for Stack 2 (from 5 to 10)"/>
<h:inputText id="number2" required="true">
<f:validateLongRange minimum="5" maximum="10"/>
- <a4j:ajax event="change" execute="@form"/>
</h:inputText>
+ <br />
+ <h:commandButton action="@form" value="h:commandButton Submit" id="hCommandButtonSubmit" />
+ <a4j:commandButton action="@form" value="a4j:commandButton Submit" id="a4jCommandButtonSubmit" />
</h:form>
</ui:define>
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/simple.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/simple.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/simple.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -29,6 +29,14 @@
<ui:composition template="/templates/template.xhtml">
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
<ui:define name="component">
<h:form>
<a4j:outputPanel ajaxRendered="true">
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/validation.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/validation.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richNotify/validation.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -28,6 +28,14 @@
<ui:composition template="/templates/template.xhtml">
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
<ui:define name="component">
<h:form>
<rich:notifyMessages ajaxRendered="true"
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richPickList/simple.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richPickList/simple.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richPickList/simple.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -77,8 +77,10 @@
onmouseover="#{richPickListBean.attributes['onmouseover'].value}"
onmouseup="#{richPickListBean.attributes['onmouseup'].value}"
onremoveitems="#{richPickListBean.attributes['onremoveitems'].value}"
+ onsourceblur="#{richPickListBean.attributes['onsourceblur'].value}"
onsourceclick="#{richPickListBean.attributes['onsourceclick'].value}"
onsourcedblclick="#{richPickListBean.attributes['onsourcedblclick'].value}"
+ onsourcefocus="#{richPickListBean.attributes['onsourcefocus'].value}"
onsourcekeydown="#{richPickListBean.attributes['onsourcekeydown'].value}"
onsourcekeypress="#{richPickListBean.attributes['onsourcekeypress'].value}"
onsourcekeyup="#{richPickListBean.attributes['onsourcekeyup'].value}"
@@ -87,8 +89,10 @@
onsourcemouseout="#{richPickListBean.attributes['onsourcemouseout'].value}"
onsourcemouseover="#{richPickListBean.attributes['onsourcemouseover'].value}"
onsourcemouseup="#{richPickListBean.attributes['onsourcemouseup'].value}"
+ ontargetblur="#{richPickListBean.attributes['ontargetblur'].value}"
ontargetclick="#{richPickListBean.attributes['ontargetclick'].value}"
ontargetdblclick="#{richPickListBean.attributes['ontargetdblclick'].value}"
+ ontargetfocus="#{richPickListBean.attributes['ontargetfocus'].value}"
ontargetkeydown="#{richPickListBean.attributes['ontargetkeydown'].value}"
ontargetkeypress="#{richPickListBean.attributes['ontargetkeypress'].value}"
ontargetkeyup="#{richPickListBean.attributes['ontargetkeyup'].value}"
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -219,7 +219,7 @@
<fieldset>
<legend>rich:tree</legend>
- <metamer:attributes value="#{richTreeBean.attributes}" id="treeAttributes" />
+ <metamer:attributes value="#{richTreeBean.attributes}" id="attributes" />
<fieldset>
<legend>rich:treeModelRecursiveAdaptor [0]</legend>
Modified: modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/footer.xhtml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/footer.xhtml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/application/src/main/webapp/templates/footer.xhtml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!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:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jsp/jstl/core">
- <!--
+<!--
JBoss, Home of Professional Open Source
Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
@@ -25,28 +25,26 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
- <ui:composition>
- <hr style="width: 1050px; margin-left: 0px;" />
+<ui:composition>
+ <hr style="width: 1050px; margin-left: 0px;" />
- <ul>
- <li><h:outputText id="richfacesVersion" value="#{metamer.richFacesVersion}" /></li>
- <li><h:outputText id="metamerVersion" value="#{metamer.shortVersion}" /></li>
- <li><h:outputText id="jsfVersion" value="#{metamer.jsfVersion}" /></li>
- <li><h:outputText id="serverVersion" value="#{metamer.serverVersion}" /></li>
- <li><h:outputText id="javaVersion" value="#{metamer.javaVersion}" /> @ <h:outputText id="osVersion"
- value="#{metamer.osVersion}" /></li>
- <li><h:outputText id="browserVersion" value="#{metamer.browserVersion}" /></li>
- </ul>
+ <ul>
+ <li><h:outputText id="richfacesVersion" value="#{metamer.richFacesVersion}" /></li>
+ <li><h:outputText id="metamerVersion" value="#{metamer.shortVersion}" /></li>
+ <li><h:outputText id="jsfVersion" value="#{metamer.jsfVersion}" /></li>
+ <li><h:outputText id="serverVersion" value="#{metamer.serverVersion}" /></li>
+ <li><h:outputText id="javaVersion" value="#{metamer.javaVersion}" /> @ <h:outputText id="osVersion"
+ value="#{metamer.osVersion}" /></li>
+ <li><h:outputText id="browserVersion" value="#{metamer.browserVersion}" /></li>
+ </ul>
- <!-- human-readable browser detection -->
- <c:if test="#{metamer.projectStage != 'Production'}">
- <h:outputScript name="jquery.js" target="head"/>
- <h:outputScript library="script" name="detect-browser.js" target="head"/>
- <script type="text/javascript">
+ <!-- human-readable browser detection -->
+
+ <h:outputScript name="jquery.js" target="head" />
+ <h:outputScript library="script" name="detect-browser.js" target="head" />
+ <script type="text/javascript">
jQuery("span[id$=browserVersion]").text(jQuery.browser.name + ' ' + jQuery.browser.version + ' @ ' + jQuery.browser.os);
- </script>
+ </script>
- </c:if>
-
- </ui:composition>
+</ui:composition>
</html>
\ No newline at end of file
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest/pom.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest/pom.xml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest/pom.xml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -26,7 +26,7 @@
<artifactId>functional-test-jboss-ci-template</artifactId>
<groupId>org.jboss.test.richfaces-selenium</groupId>
<version>1.5.3.Final</version>
- <relativePath/>
+ <relativePath />
</parent>
<groupId>org.richfaces.tests</groupId>
@@ -411,7 +411,7 @@
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
- <version>1.3.8</version>
+ <version>1.3.9</version>
<executions>
<execution>
<phase>package</phase>
@@ -440,6 +440,192 @@
<deployable.classifier>jee6</deployable.classifier>
</properties>
</profile>
+
+ <!-- unpack metamer -->
+ <profile>
+ <id>unpack-metamer</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.enabled</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-metamer-war</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.richfaces.tests</groupId>
+ <artifactId>metamer</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <type>war</type>
+ <classifier>${deployable.classifier}</classifier>
+ <overWrite>true</overWrite>
+ <outputDirectory>target/metamer</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ <overWriteReleases>true</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- enable resource mapping by context-param in web.xml -->
+ <profile>
+ <id>org.richfaces.resourceMapping.enabled</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.enabled</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>maven-replacer-plugin</artifactId>
+ <version>1.3.9</version>
+ <executions>
+
+ <execution>
+ <id>replacer-org.richfaces.resourceMapping.enabled</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ <configuration>
+ <file>target/metamer/WEB-INF/web.xml</file>
+ <regexFlags>
+ <regexFlag>MULTILINE</regexFlag>
+ </regexFlags>
+ <token><param-name>org.richfaces.resourceMapping.enabled</param-name>\s*<param-value>false</param-value></token>
+ <value><param-name>org.richfaces.resourceMapping.enabled</param-name><param-value>true</param-value></value>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- enable resource mapping compressedStages -->
+ <profile>
+ <id>org.richfaces.resourceMapping.compressedStages</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.compressedStages</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>maven-replacer-plugin</artifactId>
+ <version>1.3.9</version>
+ <executions>
+ <execution>
+ <id>replacer-org.richfaces.resourceMapping.compressedStages</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ <configuration>
+ <file>target/metamer/WEB-INF/web.xml</file>
+ <regex>true</regex>
+ <regexFlags>
+ <regexFlag>MULTILINE</regexFlag>
+ </regexFlags>
+ <token><param-name>org.richfaces.resourceMapping.compressedStages</param-name>\s*<param-value>None</param-value></token>
+ <value><param-name>org.richfaces.resourceMapping.compressedStages</param-name><param-value>All</param-value></value>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- enable resource mapping packedStages -->
+ <profile>
+ <id>org.richfaces.resourceMapping.packedStages</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.packedStages</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>maven-replacer-plugin</artifactId>
+ <version>1.3.9</version>
+ <executions>
+ <execution>
+ <id>replacer-org.richfaces.resourceMapping.packedStages</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ <configuration>
+ <file>target/metamer/WEB-INF/web.xml</file>
+ <regex>true</regex>
+ <regexFlags>
+ <regexFlag>MULTILINE</regexFlag>
+ </regexFlags>
+ <token><param-name>org.richfaces.resourceMapping.packedStages</param-name>\s*<param-value>None</param-value></token>
+ <value><param-name>org.richfaces.resourceMapping.packedStages</param-name><param-value>All</param-value></value>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- pack metamer back to WAR -->
+ <profile>
+ <id>repack-metamer</id>
+ <activation>
+ <property>
+ <name>org.richfaces.resourceMapping.enabled</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <classifier>${deployable.classifier}</classifier>
+ <warSourceDirectory>target/metamer</warSourceDirectory>
+ <warName>metamer-updated</warName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>repack-metamer-back-to-war</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
</profiles>
<build>
Copied: modules/tests/metamer/branches/wfk2-product-branch/ftest/run-test-with-replace-context-params.sh (from rev 22826, modules/tests/metamer/trunk/ftest/run-test-with-replace-context-params.sh)
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest/run-test-with-replace-context-params.sh (rev 0)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest/run-test-with-replace-context-params.sh 2011-10-19 13:49:01 UTC (rev 22827)
@@ -0,0 +1,2 @@
+#!/bin/bash
+mvn clean package -Pjboss6x-mojarra -Dtemplates=plain -DcontainerId=jboss6x -Dcargo.jvmargs.additional=-Xmx1536m -Dcontainer.installer.url=file:///media/velkyDisk/Download/jboss-as-distribution-6.0.0.Final.zip -Dorg.richfaces.resourceMapping.enabled -Dorg.richfaces.resourceMapping.packedStages -Dorg.richfaces.resourceMapping.compressedStages -Dbrowser="*chrome /opt/firefox-3.5.5/firefox-bin" -Dtest=TestRichMenuItem -Ddeployable.location=$PWD/target/metamer-updated-jee6.war
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest/src/test/resources/testng-output.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest/src/test/resources/testng-output.xml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest/src/test/resources/testng-output.xml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -14,7 +14,6 @@
</classes>
<packages>
- <package name="org.richfaces.tests.metamer.ftest.richPanel" />
<package name="org.richfaces.tests.metamer.ftest.richPopupPanel" />
<package name="org.richfaces.tests.metamer.ftest.richProgressBar" />
<package name="org.richfaces.tests.metamer.ftest.richToolbar" />
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/pom.xml
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/pom.xml 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/pom.xml 2011-10-19 13:49:01 UTC (rev 22827)
@@ -89,7 +89,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.9</version>
+ <version>2.10</version>
<configuration>
<skip>true</skip>
</configuration>
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -78,7 +78,7 @@
}
@Test
- @IssueTracking({ "https://issues.jboss.org/browse/RF-9118", "http://java.net/jira/browse/JAVASERVERFACES-1788" })
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9118", "http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1024" })
public void testOnError() {
for (int i = 0; i < 2; i++) {
statusAttributes.set(onerror, alert.parametrize("error" + i));
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/AttributeList.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -24,6 +24,7 @@
import org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes;
import org.richfaces.tests.metamer.ftest.richJQuery.RichJQueryAttributes;
import org.richfaces.tests.metamer.ftest.richList.ListAttributes;
+import org.richfaces.tests.metamer.ftest.richMenuItem.MenuItemAttributes;
import org.richfaces.tests.metamer.ftest.richMessage.MessageAttributes;
import org.richfaces.tests.metamer.ftest.richPanelMenu.PanelMenuAttributes;
import org.richfaces.tests.metamer.ftest.richPanelMenuGroup.PanelMenuGroupAttributes;
@@ -63,5 +64,6 @@
public static Attributes<PanelMenuItemAttributes> panelMenuItemAttributes = new Attributes<PanelMenuItemAttributes>();
public static Attributes<PickListAttributes> pickListAttributes = new Attributes<PickListAttributes>();
public static Attributes<TreeAttributes> treeAttributes = new Attributes<TreeAttributes>(jq("span[id*=attributes]"));
+ public static Attributes<MenuItemAttributes> menuItemAttributes = new Attributes<MenuItemAttributes>();
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/attributes/Attributes.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -18,6 +18,8 @@
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.locator.LocatorFactory;
+import org.jboss.test.selenium.locator.option.OptionLabelLocator;
import org.jboss.test.selenium.locator.option.OptionValueLocator;
import org.jboss.test.selenium.locator.reference.LocatorReference;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
@@ -32,7 +34,7 @@
protected AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
LocatorReference<ExtendedLocator<JQueryLocator>> root =
new LocatorReference<ExtendedLocator<JQueryLocator>>(pjq(""));
- ReferencedLocator<JQueryLocator> propertyLocator = referenceInferred(root, ":input[id*=:{0}Input]{1}");
+ ReferencedLocator<JQueryLocator> propertyLocator = referenceInferred(root, ":input[id*={0}Input]{1}");
RequestType requestType = RequestType.HTTP;
@@ -127,10 +129,10 @@
if (value == null) {
value = "";
}
+
+ String valueAsString = value.toString();
+ // System.out.println("\n ###setting following value as string: '" + valueAsString + "'");
- String valueAsString = value.toString();
- System.out.println("\n ###setting following value as string: '" + valueAsString + "'");
-
if ("text".equals(inputType)) {
applyText(locator, valueAsString);
} else if ("checkbox".equals(inputType)) {
@@ -139,7 +141,7 @@
} else if ("radio".equals(inputType)) {
locator = propertyLocator.format(propertyName, "[value="
+ ("".equals(valueAsString) ? "null" : valueAsString) + "]");
-
+
if (!selenium.isChecked(locator)) {
applyRadio(locator);
}
@@ -177,7 +179,15 @@
protected void applySelect(ElementLocator<?> locator, String value) {
OptionValueLocator optionLocator = new OptionValueLocator(value);
- guard(selenium, requestType).select(locator, optionLocator);
+
+ LocatorFactory.jq(locator.getRawLocator());
+ JQueryLocator fullLocator = jq(locator.getRawLocator()).getChild(jq(optionLocator.getRawLocator()));
+ if (selenium.isElementPresent(fullLocator)) {
+ guard(selenium, requestType).select(locator, optionLocator);
+ } else {
+ OptionLabelLocator optionLabelLocator = new OptionLabelLocator(value);
+ guard(selenium, requestType).select(locator, optionLabelLocator);
+ }
}
private class RepeatForElementNotFound implements CommandInterceptor {
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -32,6 +32,7 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
/**
@@ -88,11 +89,18 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11296")
+ @Templates(exclude = { "richPopupPanel" })
public void testAccesskey() {
testHtmlAttribute(button, "accesskey", "b");
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11296")
+ public void testAccesskeyInPopupPanel() {
+ testHtmlAttribute(button, "accesskey", "b");
+ }
+
@Test
public void testAction() {
JQueryLocator doubleStringAction = pjq("input[value=doubleStringAction]");
@@ -106,7 +114,7 @@
waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
String output = selenium.getText(output2);
assertEquals(output, "RichFaces 4RichFaces 4",
- "output2 when 'RichFaces 4' in input and doubleStringAction selected");
+ "output2 when 'RichFaces 4' in input and doubleStringAction selected");
selenium.click(first6CharsAction);
selenium.waitForPageToLoad(TIMEOUT);
@@ -138,7 +146,7 @@
waitGui.until(textEquals.locator(output1).text("RichFaces 4"));
String output = selenium.getText(output3);
assertEquals(output, "RichFaces 4RichFaces 4",
- "output2 when 'RichFaces 4' in input and doubleStringActionListener selected");
+ "output2 when 'RichFaces 4' in input and doubleStringActionListener selected");
selenium.click(first6CharsActionListener);
selenium.waitForPageToLoad(TIMEOUT);
@@ -155,7 +163,7 @@
waitGui.until(textEquals.locator(output1).text("RichFaces 4ě"));
output = selenium.getText(output3);
assertEquals(output, "RICHFACES 4Ě",
- "output2 when 'RichFaces 4ě' in input and toUpperCaseActionListener selected");
+ "output2 when 'RichFaces 4ě' in input and toUpperCaseActionListener selected");
}
@Test
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/TestRichCalendarAttributes.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -48,6 +48,7 @@
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
/**
@@ -288,7 +289,7 @@
for (int i = 2; i < 42; i += 7) {
if (!selenium.belongsClass(cellDay.format(i), "rf-cal-boundary-day")) {
assertTrue(selenium.belongsClass(cellDay.format(i), "yellowDay"), "Cell nr. " + i
- + " should be yellow.");
+ + " should be yellow.");
}
}
@@ -299,12 +300,12 @@
for (int i = 0; i < 42; i++) {
assertFalse(selenium.belongsClass(cellDay.format(i), "yellowDay"), "Cell nr. " + i
- + " should not be yellow.");
+ + " should not be yellow.");
}
}
@Test
- @RegressionTest({"https://issues.jboss.org/browse/RF-9837", "https://issues.jboss.org/browse/RF-10085"})
+ @RegressionTest({ "https://issues.jboss.org/browse/RF-9837", "https://issues.jboss.org/browse/RF-10085" })
public void testDefaultTime() {
selenium.type(pjq("input[type=text][id$=defaultTimeInput]"), "21:24");
selenium.waitForPageToLoad();
@@ -354,7 +355,7 @@
selenium.click(input);
- String[] labels = {"", "Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"};
+ String[] labels = { "", "Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri" };
for (int i = 0; i < 8; i++) {
String label = selenium.getText(weekDayLabel.format(i));
@@ -375,7 +376,7 @@
// }
}
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-10821")
public void testImmediate() {
selenium.click(pjq("input[name$=immediateInput][value=true]"));
@@ -432,7 +433,7 @@
selenium.click(input);
- String[] labels = {"", "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"};
+ String[] labels = { "", "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" };
for (int i = 0; i < 8; i++) {
String label = selenium.getText(weekDayLabel.format(i));
@@ -445,7 +446,8 @@
String selectedDate = null;
try {
- Date date = new SimpleDateFormat("d MMMM, yyyy hh:mm", new Locale("ru")).parse(day + " " + month + " 12:00");
+ Date date = new SimpleDateFormat("d MMMM, yyyy hh:mm", new Locale("ru"))
+ .parse(day + " " + month + " 12:00");
selectedDate = new SimpleDateFormat("MMM d, yyyy hh:mm", new Locale("ru")).format(date);
} catch (ParseException ex) {
fail(ex.getMessage());
@@ -458,7 +460,8 @@
@Test
public void testMonthLabels() {
- String[] labels = {"január", "február", "marec", "apríl", "máj", "jún", "júl", "august", "september", "október", "november", "december"};
+ String[] labels = { "január", "február", "marec", "apríl", "máj", "jún", "júl", "august", "september",
+ "október", "november", "december" };
String labelsString = "január,február,marec,apríl,máj,jún, júl,august,september,október,november,december";
selenium.type(pjq("input[id$=monthLabelsInput]"), labelsString);
@@ -479,7 +482,7 @@
@Test
public void testMonthLabelsShort() {
- String[] labels = {"jan", "feb", "mar", "apr", "máj", "jún", "júl", "aug", "sep", "okt", "nov", "dec"};
+ String[] labels = { "jan", "feb", "mar", "apr", "máj", "jún", "júl", "aug", "sep", "okt", "nov", "dec" };
String labelsString = "jan,feb,mar,apr,máj,jún, júl,aug,sep,okt,nov,dec";
selenium.type(pjq("input[id$=monthLabelsShortInput]"), labelsString);
@@ -524,7 +527,8 @@
selenium.click(cellDay.format(18));
selenium.click(applyButton);
- waitGui.failWith("Attribute onchange does not work correctly").until(new EventFiredCondition(new Event("change")));
+ waitGui.failWith("Attribute onchange does not work correctly").until(
+ new EventFiredCondition(new Event("change")));
}
@Test
@@ -536,7 +540,8 @@
selenium.click(cellDay.format(18));
selenium.click(cleanButton);
- waitGui.failWith("Attribute onclean does not work correctly").until(new EventFiredCondition(new Event("clean")));
+ waitGui.failWith("Attribute onclean does not work correctly")
+ .until(new EventFiredCondition(new Event("clean")));
}
@Test
@@ -549,7 +554,8 @@
selenium.click(input);
guardXhr(selenium).click(nextMonthButton);
- waitGui.failWith("Attribute oncomplete does not work correctly").until(new EventFiredCondition(new Event("complete")));
+ waitGui.failWith("Attribute oncomplete does not work correctly").until(
+ new EventFiredCondition(new Event("complete")));
}
@Test
@@ -560,7 +566,8 @@
selenium.click(input);
selenium.fireEvent(cellDay.format(18), Event.MOUSEOUT);
- waitGui.failWith("Attribute ondatemouseout does not work correctly").until(new EventFiredCondition(new Event("datemouseout")));
+ waitGui.failWith("Attribute ondatemouseout does not work correctly").until(
+ new EventFiredCondition(new Event("datemouseout")));
}
@Test
@@ -571,7 +578,8 @@
selenium.click(input);
selenium.fireEvent(cellDay.format(18), Event.MOUSEOVER);
- waitGui.failWith("Attribute ondatemouseover does not work correctly").until(new EventFiredCondition(new Event("datemouseover")));
+ waitGui.failWith("Attribute ondatemouseover does not work correctly").until(
+ new EventFiredCondition(new Event("datemouseover")));
}
@Test
@@ -582,7 +590,8 @@
selenium.click(input);
selenium.click(cellDay.format(18));
- waitGui.failWith("Attribute ondateselect does not work correctly").until(new EventFiredCondition(new Event("dateselect")));
+ waitGui.failWith("Attribute ondateselect does not work correctly").until(
+ new EventFiredCondition(new Event("dateselect")));
}
@Test
@@ -613,7 +622,7 @@
selenium.type(input, "Dec 23, 2010 19:27");
waitGui.failWith("Attribute oninputchange does not work correctly").until(
- new EventFiredCondition(new Event("inputchange")));
+ new EventFiredCondition(new Event("inputchange")));
}
@Test
@@ -873,11 +882,18 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(exclude = "richPopupPanel")
public void testTabindexInput() {
testHtmlAttribute(input, "tabindex", "99");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(value = "richPopupPanel")
+ public void testTabindexInputInPopupPanel() {
+ testHtmlAttribute(input, "tabindex", "99");
+ }
+
@Test
public void testTabindexButton() {
testHtmlAttribute(image, "tabindex", "99");
@@ -912,7 +928,7 @@
private void assertNoDateSelected() {
for (int i = 0; i < 42; i++) {
assertFalse(selenium.belongsClass(cellDay.format(i), "rf-cal-sel"), "Cell nr. " + i
- + " should not be selected.");
+ + " should not be selected.");
}
}
@@ -936,10 +952,10 @@
for (int i = lowerBoundary; i < upperBoundary; i++) {
if (exceptOfDate.equals(selenium.getText(cellDay.format(i)))) {
assertTrue(selenium.belongsClass(cellDay.format(i), "rf-cal-sel"), "Cell nr. " + i
- + " should not be selected.");
+ + " should not be selected.");
} else {
assertFalse(selenium.belongsClass(cellDay.format(i), "rf-cal-sel"), "Cell nr. " + i
- + " should not be selected.");
+ + " should not be selected.");
}
}
@@ -949,7 +965,7 @@
// check other 3 lines of cells
for (int i = lowerBoundary; i < upperBoundary; i++) {
assertFalse(selenium.belongsClass(cellDay.format(i), "rf-cal-sel"), "Cell nr. " + i
- + " should not be selected.");
+ + " should not be selected.");
}
}
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -319,6 +319,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11568")
public void testToggleListener() {
String reqTime = selenium.getText(time);
guardXhr(selenium).click(header);
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -42,9 +42,9 @@
@Inject
@Use(enumeration = true)
SortOrder sortOrder;
-
+
public void testSortingWithSortOrder() {
- columnAttributes.set(ColumnAttributes.requestType, RequestType.XHR);
+ columnAttributes.setRequestType(RequestType.XHR);
columnAttributes.set(ColumnAttributes.sortOrder, sortOrder);
switch (sortOrder) {
@@ -54,7 +54,7 @@
case descending:
Collections.sort(capitals, Collections.reverseOrder(RichColumnBean.STATE_NAME_LENGTH_COMPARATOR));
break;
-
+
default:
// default case required by checkstyle
break;
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/TestDataScroller.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/TestDataScroller.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/TestDataScroller.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -27,6 +27,7 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.richDataScroller.PaginationTester;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -66,8 +67,18 @@
}
@Test
- @IssueTracking({ "https://issues.jboss.org/browse/RF-9306", "https://issues.jboss.org/browse/RFPL-1187" })
+ @IssueTracking({ "https://issues.jboss.org/browse/RFPL-1187" })
+ @Templates(exclude = { "a4jRepeat", "richCollapsibleSubTable", "richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
public void testScrollerPagination() {
paginationTester.testNumberedPages();
}
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9306" })
+ @Templates(value = { "a4jRepeat", "richCollapsibleSubTable", "richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
+ public void testScrollerPaginationInIterationComponents() {
+ paginationTester.testNumberedPages();
+ }
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingComponentControl.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingComponentControl.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingComponentControl.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -65,7 +65,7 @@
super.testSortModeSingleDoesntRememberOrder();
}
- @Test
+ @Test(groups = { "4.Future" })
@Override
@IssueTracking({ "https://issues.jboss.org/browse/RF-9932",
"http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790" })
@@ -97,7 +97,7 @@
super.testSortModeMultiReplacingOldOccurences();
}
- @Test
+ @Test(groups = { "4.Future" })
@Override
@IssueTracking({ "https://issues.jboss.org/browse/RF-9932",
"http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790" })
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richEditor/TestRichEditor.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -37,7 +37,7 @@
private JQueryLocator editorTextArea = pjq("textarea[id$=editor:inp]");
private JQueryLocator editorArea = jq("body");
private JQueryLocator phaseListenerFormat = jq("div#phasesPanel li:eq({0})");
- private FrameLocator frameLocator = new FrameLocator("jquery=iframe");
+ private FrameLocator frameLocator = new FrameLocator("jquery=iframe:eq(0)");
private JQueryLocator hSubmit = pjq("input[id$=hButton]");
private JQueryLocator a4jSubmit = pjq("input[id$=a4jButton]");
private JQueryLocator validationMsgLoc = pjq("span.rf-msgs-sum");
@@ -191,9 +191,7 @@
String langVal = "xyz";
editorAttributes.set(lang, langVal);
- // there is lang attribute present in 2 editor's elements
assertTrue(langVal.equals(selenium.getAttribute(editorTextArea.getAttribute(langAttribute))));
- assertTrue(langVal.equals(selenium.getAttribute(editor.getAttribute(langAttribute))));
}
@Test
@@ -220,29 +218,18 @@
@IssueTracking("https://issues.jboss.org/browse/RFPL-1658")
public void testReadonly() {
- typeTextToEditor(text1);
-
- String currentText = getEditorText();
- assertTrue(currentText != null && currentText.contains(text1));
-
editorAttributes.set(readonly, Boolean.TRUE);
- // waitModel.until(elementPresent.locator(editor));
- typeTextToEditor("test");
- // assert that there is no "test" present in editor text area
- currentText = getEditorText();
- assertFalse(currentText != null && currentText.contains("test"));
+ String readOnlyAttrVal = selenium.getAttribute(
+ editorTextArea.getAttribute(new Attribute("readonly")));
+ assertTrue("readonly".equals(readOnlyAttrVal));
- // now set read-only back to false
- editorAttributes.set(readonly, Boolean.FALSE);
- // waitModel.until(elementPresent.locator(editor));
+ selenium.selectFrame(frameLocator);
+ String contentEditableVal = selenium.getAttribute(
+ editorArea.getAttribute(new Attribute("contenteditable")));
+ assertTrue("false".equals(contentEditableVal));
- // and type another text
- typeTextToEditor(text2);
-
- // now we should assert that only expected text are present
- currentText = getEditorText();
- assertTrue(currentText != null && currentText.contains(text2));
+ selenium.selectFrame(new FrameLocator("relative=top"));
}
@Test
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -29,11 +29,12 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
/**
* Test case for page faces/components/richFunctions/all.xhtml.
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@@ -55,7 +56,8 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10465")
+ @Templates(exclude = { "a4jRepeat", "richCollapsibleSubTable", "richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList" })
public void testFunctions() {
String clientId = selenium.getText(clientIdOutput);
assertNotNull(clientId, "Function clientId() doesn't work.");
@@ -71,6 +73,14 @@
assertEquals(output, "abc", "Function findComponent() doesn't work.");
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "a4jRepeat", "hDataTable", "richCollapsibleSubTable", "richDataGrid", "richDataTable",
+ "richExtendedDataTable", "richList", "uiRepeat" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10465")
+ public void testFunctionsInIterationComponents() {
+ testFunctions();
+ }
+
@Test
public void testRoles() {
String outputAU = selenium.getText(userInRoleAUOutput);
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richGraphValidator/TestRichGraphValidator.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -24,12 +24,14 @@
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.graphValidatorAttributes;
-import static org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes.*;
+import static org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes.groups;
+import static org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes.rendered;
+import static org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes.summary;
+import static org.richfaces.tests.metamer.ftest.richGraphValidator.GraphValidatorAttributes.value;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
-import java.util.GregorianCalendar;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.option.OptionValueLocator;
@@ -38,22 +40,20 @@
/**
* Test for page /faces/components/richGraphValidator/all.xhtml
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision: 22622 $
*/
public class TestRichGraphValidator extends AbstractMetamerTest {
private static final String SMILE = ":-)";
-
- private static final String[] GROUPS = {"", "javax.validation.groups.Default",
- "org.richfaces.tests.metamer.validation.groups.ValidationGroupAllComponents",
- "org.richfaces.tests.metamer.validation.groups.ValidationGroupBooleanInputs",
- "org.richfaces.tests.metamer.validation.groups.ValidationGroupNumericInputs"};
-
+
+ private static final String[] GROUPS = { "Default", "null", "ValidationGroupAllComponents",
+ "ValidationGroupBooleanInputs", "ValidationGroupNumericInputs" };
+
private static final int BOOLEAN_INPUTS_GROUP = 3;
private static final int NUMERIC_INPUTS_GROUP = 4;
-
+
private JQueryLocator autocomplete = pjq("input[id$=autocompleteInput]");
private JQueryLocator inputSecret = pjq("input[id$=inputSecret]");
private JQueryLocator inputText = pjq("input[id$=inputText]");
@@ -67,27 +67,27 @@
private JQueryLocator selectBooleanCheckbox = pjq("input[id$=selectBooleanCheckbox]");
private JQueryLocator inputNumberSliderInput = pjq("span[id$=inputNumberSlider] input.rf-insl-inp");
private JQueryLocator inputNumberSpinnerInput = pjq("span[id$=inputNumberSpinner] input.rf-insp-inp");
-
+
private JQueryLocator globalMessagesContainer = pjq("span[id$=_globalMessages]");
private JQueryLocator errorMessagesContainer = pjq("span.rf-msgs");
private JQueryLocator header = pjq("div.rf-p-hdr[id$=gv1h_header]");
-
+
private OptionValueLocator optionSmile = new OptionValueLocator(SMILE);
-
+
private JQueryLocator applyChangesBtn = pjq("input[id$=applyChanges]");
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richGraphValidator/all.xhtml");
}
-
+
@Test
public void testGroups() {
- for (int i=0; i<GROUPS.length; ++i) {
+ for (int i = 0; i < GROUPS.length; ++i) {
graphValidatorAttributes.set(groups, GROUPS[i]);
-
+ waitFor(6000);
setAllValidatedFields();
-
+
if (i == BOOLEAN_INPUTS_GROUP) {
// only Boolean inputs validated
allFieldsSetToWrong();
@@ -98,83 +98,81 @@
selenium.type(inputNumberSliderInput, "10");
selenium.type(inputNumberSpinnerInput, "10");
}
-
+
// let's submit the form
selenium.click(applyChangesBtn);
-
+
// wait for success validation
- waitGui.until(textEquals
- .locator(globalMessagesContainer.getDescendant(jq("span.rf-msgs-inf span.rf-msgs-sum")))
- .text("Action sucessfully done!"));
+ waitGui.until(textEquals.locator(
+ globalMessagesContainer.getDescendant(jq("span.rf-msgs-inf span.rf-msgs-sum"))).text(
+ "Action sucessfully done!"));
}
}
-
+
@Test
public void testSummary() {
String msg = "My own validation message!";
graphValidatorAttributes.set(summary, msg);
-
+
setAllValidatedFields();
allFieldsSetToWrong();
-
+
selenium.click(applyChangesBtn);
-
- waitGui.until(textEquals
- .locator(errorMessagesContainer.getDescendant(jq("span.rf-msgs-sum")))
- .text(msg));
+
+ waitGui.until(textEquals.locator(errorMessagesContainer.getDescendant(jq("span.rf-msgs-sum"))).text(msg));
}
@Test
public void testValue() {
-
+
graphValidatorAttributes.set(value, "testValue");
-
+
setAllValidatedFields();
-
+
// let's submit the form
selenium.click(applyChangesBtn);
-
+
// wait for success validation
waitGui.until(textEquals
- .locator(globalMessagesContainer.getDescendant(jq("span.rf-msgs-inf span.rf-msgs-sum")))
- .text("Action sucessfully done!"));
+ .locator(globalMessagesContainer.getDescendant(jq("span.rf-msgs-inf span.rf-msgs-sum"))).text(
+ "Action sucessfully done!"));
}
-
+
@Test
public void testRendered() {
setAllValidatedFields();
-
+
graphValidatorAttributes.set(rendered, Boolean.FALSE);
-
+
waitGui.until(isNotDisplayed.locator(header));
}
-
+
private void setAllValidatedFields() {
// inputSecret don't keed entered value after submit
selenium.type(inputSecret, SMILE);
-
+
// input returning List/Set are by default without any element checked
selenium.check(selectManyCheckbox, true);
- selenium.select(selectManyListbox, optionSmile);
- selenium.select(selectManyMenu, optionSmile);
+ selenium.select(selectManyListbox, optionSmile);
+ selenium.select(selectManyMenu, optionSmile);
}
-
+
private void allFieldsSetToWrong() {
String wrongString = "---";
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy");
- String wrongDate = sdf.format(new Date(System.currentTimeMillis() + 24*60*60*1000));
-
+ String wrongDate = sdf.format(new Date(System.currentTimeMillis() + 24 * 60 * 60 * 1000));
+
selenium.type(inplaceSelect, wrongString);
selenium.type(inplaceInput, wrongString);
selenium.type(inputNumberSpinnerInput, "10");
selenium.check(selectBooleanCheckbox, false);
selenium.type(inputSecret, wrongString);
-
+
selenium.type(inputNumberSliderInput, "15");
selenium.type(inputNumberSpinnerInput, "15");
selenium.type(autocomplete, wrongString);
selenium.type(inputText, wrongString);
- selenium.type(calendar, wrongDate);
+ selenium.type(calendar, wrongDate);
selenium.type(inputTextArea, wrongString);
}
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richHashParam/TestRichHashParam.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richHashParam/TestRichHashParam.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richHashParam/TestRichHashParam.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -33,6 +33,7 @@
import org.jboss.test.selenium.geometry.Offset;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
/**
@@ -93,14 +94,18 @@
int panelLeft = selenium.getElementPositionLeft(panelContainer);
int shadowLeft = selenium.getElementPositionLeft(shadow);
- assertEquals(selenium.getStyle(header, new CssProperty("cursor")), "move", "Cursor used when mouse is over panel's header.");
+ assertEquals(selenium.getStyle(header, new CssProperty("cursor")), "move",
+ "Cursor used when mouse is over panel's header.");
selenium.dragAndDrop(header, new Offset(20, 0));
- assertEquals(selenium.getElementPositionLeft(panelContainer), panelLeft + 20, "Panel's position after move to the right (20px).");
- assertEquals(selenium.getElementPositionLeft(shadow), shadowLeft + 20, "Shadow's position after move to the right (20px).");
+ assertEquals(selenium.getElementPositionLeft(panelContainer), panelLeft + 20,
+ "Panel's position after move to the right (20px).");
+ assertEquals(selenium.getElementPositionLeft(shadow), shadowLeft + 20,
+ "Shadow's position after move to the right (20px).");
}
@Test
+ @Templates(exclude = { "richPopupPanel" })
public void testPanelResizeHorizontal() {
selenium.click(openButton);
int panelWidth = selenium.getElementWidth(panelContainer);
@@ -108,18 +113,24 @@
int shadowWidth = selenium.getElementWidth(shadow);
int shadowHeight = selenium.getElementHeight(shadow);
- assertEquals(selenium.getStyle(resizerW, new CssProperty("cursor")), "w-resize", "Cursor used when mouse is over panel's left resizer.");
- assertEquals(selenium.getStyle(resizerE, new CssProperty("cursor")), "e-resize", "Cursor used when mouse is over panel's right resizer.");
+ assertEquals(selenium.getStyle(resizerW, new CssProperty("cursor")), "w-resize",
+ "Cursor used when mouse is over panel's left resizer.");
+ assertEquals(selenium.getStyle(resizerE, new CssProperty("cursor")), "e-resize",
+ "Cursor used when mouse is over panel's right resizer.");
selenium.dragAndDrop(resizerW, new Offset(100, 0));
- assertEquals(selenium.getElementWidth(panelContainer), panelWidth - 100, "Panel's width after resizing horizontally (-100px).");
- assertEquals(selenium.getElementHeight(panelContainer), panelHeight, "Panel's height after resizing horizontally.");
- assertEquals(selenium.getElementWidth(shadow), shadowWidth - 100, "Shadow's width after resizing horizontally (-100px).");
+ assertEquals(selenium.getElementWidth(panelContainer), panelWidth - 100,
+ "Panel's width after resizing horizontally (-100px).");
+ assertEquals(selenium.getElementHeight(panelContainer), panelHeight,
+ "Panel's height after resizing horizontally.");
+ assertEquals(selenium.getElementWidth(shadow), shadowWidth - 100,
+ "Shadow's width after resizing horizontally (-100px).");
assertEquals(selenium.getElementHeight(shadow), shadowHeight, "Shadow's height after resizing horizontally.");
}
@Test
+ @Templates(exclude = { "richPopupPanel" })
public void testPanelHeight() {
selenium.click(openButton);
waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
@@ -127,6 +138,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel" })
public void testPanelLeft() {
selenium.click(openButton);
waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
@@ -134,6 +146,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel" })
public void testPanelTop() {
selenium.click(openButton);
waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
@@ -141,6 +154,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel" })
public void testPanelWidth() {
selenium.click(openButton);
waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -43,6 +43,7 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
/**
@@ -80,22 +81,25 @@
@Test
public void testClick() {
guardNoRequest(selenium).click(inplaceInput);
- assertFalse(selenium.belongsClass(edit, "rf-ii-none"), "Edit should not contain class rf-ii-none when popup is open.");
+ assertFalse(selenium.belongsClass(edit, "rf-ii-none"),
+ "Edit should not contain class rf-ii-none when popup is open.");
assertTrue(selenium.isDisplayed(input), "Input should be displayed.");
selenium.type(input, "new value");
selenium.fireEvent(input, Event.BLUR);
assertTrue(selenium.belongsClass(inplaceInput, "rf-ii-chng"), "New class should be added to inplace input.");
- assertTrue(selenium.belongsClass(edit, "rf-ii-none"), "Edit should contain class rf-ii-none when popup is closed.");
+ assertTrue(selenium.belongsClass(edit, "rf-ii-none"),
+ "Edit should contain class rf-ii-none when popup is closed.");
assertEquals(selenium.getText(label), "new value", "Label should contain selected value.");
assertEquals(selenium.getText(output), "new value", "Output did not change.");
String listenerText = selenium.getText(jq("div#phasesPanel li:eq(3)"));
- assertEquals(listenerText, "*1 value changed: RichFaces 4 -> new value", "Value change listener was not invoked.");
+ assertEquals(listenerText, "*1 value changed: RichFaces 4 -> new value",
+ "Value change listener was not invoked.");
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
- PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: RichFaces 4 -> new value");
}
@@ -166,13 +170,16 @@
selenium.type(pjq("input[id$=activeClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
- assertFalse(selenium.belongsClass(inplaceInput, "metamer-ftest-class"), "Inplace input should not have class metamer-ftest-class.");
+ assertFalse(selenium.belongsClass(inplaceInput, "metamer-ftest-class"),
+ "Inplace input should not have class metamer-ftest-class.");
selenium.click(inplaceInput);
- assertTrue(selenium.belongsClass(inplaceInput, "metamer-ftest-class"), "Inplace input should have class metamer-ftest-class.");
+ assertTrue(selenium.belongsClass(inplaceInput, "metamer-ftest-class"),
+ "Inplace input should have class metamer-ftest-class.");
selenium.fireEvent(input, Event.BLUR);
- assertFalse(selenium.belongsClass(inplaceInput, "metamer-ftest-class"), "Inplace input should not have class metamer-ftest-class.");
+ assertFalse(selenium.belongsClass(inplaceInput, "metamer-ftest-class"),
+ "Inplace input should not have class metamer-ftest-class.");
}
@Test
@@ -187,7 +194,7 @@
waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
- PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "value changed: RichFaces 4 -> new value");
}
@@ -205,7 +212,8 @@
// it cannot handle null because of a bug in Mojarra and Myfaces and
// generates style="width: ; " instead of default value
- assertTrue(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)), "Input doesn't have attribute style.");
+ assertTrue(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)),
+ "Input doesn't have attribute style.");
width = selenium.getAttribute(input.getAttribute(Attribute.STYLE));
assertTrue(!width.contains("width: ;"), "Default width of input was not set (was " + width + ").");
}
@@ -236,7 +244,7 @@
waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
waitGui.failWith("Attribute onchange does not work correctly").until(
- new EventFiredCondition(new Event("change")));
+ new EventFiredCondition(new Event("change")));
}
@Test
@@ -369,13 +377,16 @@
selenium.waitForPageToLoad();
selenium.click(inplaceInput);
- assertFalse(selenium.belongsClass(edit, "rf-ii-none"), "Edit should not contain class rf-is-none when popup is open.");
+ assertFalse(selenium.belongsClass(edit, "rf-ii-none"),
+ "Edit should not contain class rf-is-none when popup is open.");
assertTrue(selenium.isDisplayed(input), "Input should be displayed.");
selenium.type(input, "new value");
selenium.fireEvent(input, Event.BLUR);
- assertFalse(selenium.belongsClass(inplaceInput, "rf-ii-c-s"), "New class rf-ii-c-s should not be added to inplace input.");
- assertTrue(selenium.belongsClass(edit, "rf-ii-none"), "Edit should contain class rf-is-none when popup is closed.");
+ assertFalse(selenium.belongsClass(inplaceInput, "rf-ii-c-s"),
+ "New class rf-ii-c-s should not be added to inplace input.");
+ assertTrue(selenium.belongsClass(edit, "rf-ii-none"),
+ "Edit should contain class rf-is-none when popup is closed.");
assertEquals(selenium.getText(label), "RichFaces 4", "Label should not change.");
assertEquals(selenium.getText(output), "RichFaces 4", "Output should not change.");
@@ -428,7 +439,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(exclude = { "richPopupPanel" })
public void testTabindex() {
AttributeLocator<?> attr = input.getAttribute(new Attribute("tabindex"));
@@ -438,6 +449,18 @@
assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute tabindex should contain \"47\".");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(value = { "richPopupPanel" })
+ public void testTabindexInPopupPanel() {
+ AttributeLocator<?> attr = input.getAttribute(new Attribute("tabindex"));
+
+ selenium.type(pjq("input[id$=tabindexInput]"), "47");
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute tabindex should contain \"47\".");
+ }
+
@Test
public void testValue() {
selenium.type(pjq("input[type=text][id$=valueInput]"), "new value");
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -43,6 +43,7 @@
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.annotations.Test;
/**
@@ -81,14 +82,15 @@
@IssueTracking("https://issues.jboss.org/browse/RF-11227")
public void testClick() {
guardNoRequest(selenium).click(select);
- assertFalse(selenium.belongsClass(edit, "rf-is-none"), "Edit should not contain class rf-is-none when popup is open.");
+ assertFalse(selenium.belongsClass(edit, "rf-is-none"),
+ "Edit should not contain class rf-is-none when popup is open.");
assertTrue(selenium.isDisplayed(popup), "Popup should be displayed.");
for (int i = 0; i < 50; i++) {
assertTrue(selenium.isDisplayed(options.format(i)), "Select option " + i + " should be displayed.");
}
- String[] selectOptions = {"Alabama", "Hawaii", "Massachusetts", "New Mexico", "South Dakota"};
+ String[] selectOptions = { "Alabama", "Hawaii", "Massachusetts", "New Mexico", "South Dakota" };
for (int i = 0; i < 50; i += 10) {
assertEquals(selenium.getText(options.format(i)), selectOptions[i / 10], "Select option nr. " + i);
}
@@ -98,7 +100,8 @@
waitGui.failWith("Output did not change.").until(textEquals.locator(output).text("Hawaii"));
assertTrue(selenium.belongsClass(select, "rf-is-chng"), "New class should be added to inplace select.");
- assertTrue(selenium.belongsClass(edit, "rf-is-none"), "Edit should contain class rf-is-none when popup is closed.");
+ assertTrue(selenium.belongsClass(edit, "rf-is-none"),
+ "Edit should contain class rf-is-none when popup is closed.");
assertEquals(selenium.getText(label), "Hawaii", "Label should contain selected value.");
@@ -180,14 +183,17 @@
selenium.type(pjq("input[id$=activeClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
- assertFalse(selenium.belongsClass(select, "metamer-ftest-class"), "Inplace input should not have class metamer-ftest-class.");
+ assertFalse(selenium.belongsClass(select, "metamer-ftest-class"),
+ "Inplace input should not have class metamer-ftest-class.");
selenium.click(select);
- assertTrue(selenium.belongsClass(select, "metamer-ftest-class"), "Inplace input should have class metamer-ftest-class.");
+ assertTrue(selenium.belongsClass(select, "metamer-ftest-class"),
+ "Inplace input should have class metamer-ftest-class.");
selenium.click(options.format(10));
guardXhr(selenium).fireEvent(input, Event.BLUR);
- assertFalse(selenium.belongsClass(select, "metamer-ftest-class"), "Inplace input should not have class metamer-ftest-class.");
+ assertFalse(selenium.belongsClass(select, "metamer-ftest-class"),
+ "Inplace input should not have class metamer-ftest-class.");
}
@Test
@@ -203,7 +209,7 @@
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
- PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "value changed: -> Hawaii");
}
@@ -218,7 +224,8 @@
selenium.type(pjq("input[type=text][id$=inputWidthInput]"), "");
selenium.waitForPageToLoad();
- assertFalse(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)), "Input should not have attribute style.");
+ assertFalse(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)),
+ "Input should not have attribute style.");
}
@Test
@@ -228,8 +235,8 @@
selenium.waitForPageToLoad();
for (int i = 0; i < 50; i++) {
- assertTrue(selenium.belongsClass(options.format(i), value), "Select option "
- + selenium.getText(options.format(i)) + " does not contain class " + value);
+ assertTrue(selenium.belongsClass(options.format(i), value),
+ "Select option " + selenium.getText(options.format(i)) + " does not contain class " + value);
}
}
@@ -297,8 +304,7 @@
selenium.click(options.format(10));
guardXhr(selenium).fireEvent(input, Event.BLUR);
- waitGui.failWith("Attribute onchange does not work correctly").until(
- new EventFiredCondition(Event.CHANGE));
+ waitGui.failWith("Attribute onchange does not work correctly").until(new EventFiredCondition(Event.CHANGE));
}
@Test
@@ -319,8 +325,7 @@
selenium.click(select);
- waitGui.failWith("Attribute onfocus does not work correctly").until(
- new EventFiredCondition(Event.FOCUS));
+ waitGui.failWith("Attribute onfocus does not work correctly").until(new EventFiredCondition(Event.FOCUS));
}
@Test
@@ -478,7 +483,7 @@
selenium.click(options.format(10));
waitGui.failWith("Attribute onselectitem does not work correctly").until(
- new EventFiredCondition(new Event("selectitem")));
+ new EventFiredCondition(new Event("selectitem")));
}
@Test
@@ -487,7 +492,8 @@
selenium.waitForPageToLoad();
selenium.click(select);
- assertFalse(selenium.belongsClass(edit, "rf-is-none"), "Edit should not contain class rf-is-none when popup is open.");
+ assertFalse(selenium.belongsClass(edit, "rf-is-none"),
+ "Edit should not contain class rf-is-none when popup is open.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
selenium.click(input);
@@ -569,9 +575,11 @@
selenium.click(select);
selenium.mouseOver(options.format(0));
- assertTrue(selenium.belongsClass(options.format(0), "metamer-ftest-class"), "Selected item does not contain defined class.");
+ assertTrue(selenium.belongsClass(options.format(0), "metamer-ftest-class"),
+ "Selected item does not contain defined class.");
for (int i = 1; i < 50; i++) {
- assertFalse(selenium.belongsClass(options.format(i), "metamer-ftest-class"), "Not selected item " + i + " should not contain defined class.");
+ assertFalse(selenium.belongsClass(options.format(i), "metamer-ftest-class"), "Not selected item " + i
+ + " should not contain defined class.");
}
}
@@ -625,7 +633,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(exclude = { "richPopupPanel" })
public void testTabindex() {
AttributeLocator<?> attr = input.getAttribute(new Attribute("tabindex"));
@@ -635,12 +643,25 @@
assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute tabindex should contain \"47\".");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(value = { "richPopupPanel" })
+ public void testTabindexInPopupPanel() {
+ AttributeLocator<?> attr = input.getAttribute(new Attribute("tabindex"));
+
+ selenium.type(pjq("input[id$=tabindexInput]"), "47");
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute tabindex should contain \"47\".");
+ }
+
@Test
public void testValue() {
selenium.type(pjq("input[type=text][id$=valueInput]"), "North Carolina");
selenium.waitForPageToLoad();
- assertTrue(selenium.belongsClass(edit, "rf-is-none"), "Edit should contain class rf-is-none when popup is closed.");
+ assertTrue(selenium.belongsClass(edit, "rf-is-none"),
+ "Edit should contain class rf-is-none when popup is closed.");
assertEquals(selenium.getText(label), "North Carolina", "Label should contain selected value.");
}
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -49,6 +49,7 @@
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.Test;
@@ -112,12 +113,26 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
@Override
- @IssueTracking("https://issues.jboss.org/browse/RF-11314")
public void testClick() {
super.testClick();
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(value = { "richPopupPanel" })
+ public void testClickInPopupPanel() {
+ super.testClick();
+ }
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(value = { "richAccordion" })
+ public void testClickInAccordion() {
+ super.testClick();
+ }
+
@Test
public void testInit() {
assertTrue(selenium.isDisplayed(slider), "Slider is not present on the page.");
@@ -132,11 +147,18 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11315")
+ @Templates(exclude = { "richPopupPanel" })
public void testAccesskey() {
testHtmlAttribute(input, "accesskey", "x");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11315")
+ @Templates(value = { "richPopupPanel" })
+ public void testAccesskeyInPopupPanel() {
+ testHtmlAttribute(input, "accesskey", "x");
+ }
+
@Test
public void testDecreaseClass() {
selenium.click(pjq("input[type=radio][name$=showArrowsInput][value=true]"));
@@ -159,7 +181,7 @@
}
@Test
- @Use(field = "delay", ints = {800, 1250, 3700})
+ @Use(field = "delay", ints = { 800, 1250, 3700 })
public void testDelay() {
selenium.type(pjq("input[type=text][id$=delayInput]"), delay.toString());
selenium.waitForPageToLoad();
@@ -196,6 +218,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
public void testEnableManualInput() {
JQueryLocator selectOption = pjq("input[type=radio][name$=enableManualInputInput][value=false]");
selenium.click(selectOption);
@@ -207,6 +230,18 @@
testClick();
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testEnableManualInputInPopupPanel() {
+ testEnableManualInput();
+ }
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richAccordion" })
+ public void testEnableManualInputInAccordion() {
+ testEnableManualInput();
+ }
+
@Test
public void testHandleClass() {
testStyleClass(handle, handleClass);
@@ -228,13 +263,15 @@
selenium.waitForPageToLoad();
String reqTime = selenium.getText(time);
- guardXhr(selenium).mouseDownAt(track, new Point(0, 0));
+ guardXhr(selenium).type(input, "-10");
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
- PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
- // Remove first 2 preceding chars from correct message (used to remove usual '* ' token)
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ // Remove first 2 preceding chars from correct message (used to remove usual '* ' token)
phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "value changed: 2 -> -10");
+
+ assertEquals(selenium.getText(output), "-10", "Output was not updated.");
}
@Test
@@ -340,6 +377,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
public void testMaxValueClick() {
selenium.type(pjq("input[type=text][id$=maxValueInput]"), "20");
selenium.waitForPageToLoad();
@@ -350,16 +388,30 @@
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
assertEquals(selenium.getText(output), "17", "Output was not updated.");
int margin = selenium.getElementPositionLeft(handle) - selenium.getElementPositionLeft(track);
- assertTrue(margin >= 167 && margin <= 173, "Left margin of handle should be between 167 and 173 (was " + margin + ").");
+ assertTrue(margin >= 167 && margin <= 173, "Left margin of handle should be between 167 and 173 (was " + margin
+ + ").");
reqTime = selenium.getText(time);
guardXhr(selenium).mouseDownAt(track, new Point(195, 0));
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
assertEquals(selenium.getText(output), "20", "Output was not updated.");
margin = selenium.getElementPositionLeft(handle) - selenium.getElementPositionLeft(track);
- assertTrue(margin >= 192 && margin <= 198, "Left margin of handle should be between 192 and 198 (was " + margin + ").");
+ assertTrue(margin >= 192 && margin <= 198, "Left margin of handle should be between 192 and 198 (was " + margin
+ + ").");
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richAccordion" })
+ public void testMaxValueClickInAccordion() {
+ testMaxValueClick();
+ }
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testMaxValueClickInPopupPanel() {
+ testMaxValueClick();
+ }
+
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-9860")
public void testMaxlength() {
@@ -393,6 +445,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
public void testMinValueClick() {
selenium.type(pjq("input[type=text][id$=minValueInput]"), "-20");
selenium.waitForPageToLoad();
@@ -403,7 +456,8 @@
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
assertEquals(selenium.getText(output), "-16", "Output was not updated.");
int margin = selenium.getElementPositionLeft(handle) - selenium.getElementPositionLeft(track);
- assertTrue(margin >= 25 && margin <= 31, "Left margin of handle should be between 25 and 31 (was " + margin + ").");
+ assertTrue(margin >= 25 && margin <= 31, "Left margin of handle should be between 25 and 31 (was " + margin
+ + ").");
reqTime = selenium.getText(time);
guardXhr(selenium).mouseDownAt(track, new Point(0, 0));
@@ -413,7 +467,19 @@
assertTrue(margin <= 3, "Left margin of handle should be between 0 and 3 (was " + margin + ").");
}
- @Test
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richAccordion" })
+ public void testMinValueClickInAccordion() {
+ testMinValueClick();
+ }
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testMinValueClickInPopupPanel() {
+ testMinValueClick();
+ }
+
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnblur() {
testFireEvent(Event.BLUR, slider);
@@ -438,6 +504,7 @@
}
@Test
+ @Templates(exclude = { "richPopupPanel" })
public void testOnchangeClick() {
selenium.click(pjq("input[type=radio][name$=showArrowsInput][value=true]"));
selenium.waitForPageToLoad();
@@ -461,6 +528,12 @@
assertEquals(events.length, 3, "Three events should be fired.");
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testOnchangeClickInPopupPanel() {
+ testOnchangeClick();
+ }
+
@Test
public void testOnclick() {
testFireEvent(Event.CLICK, slider);
@@ -471,7 +544,7 @@
testFireEvent(Event.DBLCLICK, slider);
}
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnfocus() {
testFireEvent(Event.FOCUS, slider);
@@ -517,7 +590,7 @@
testFireEvent(Event.MOUSEUP, slider);
}
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-10829")
public void testOnselect() {
testFireEvent(Event.SELECT, slider);
@@ -562,7 +635,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(exclude = { "richPopupPanel", "richAccordion" })
public void testShowTooltip() {
selenium.click(pjq("input[type=radio][name$=showTooltipInput][value=true]"));
selenium.waitForPageToLoad();
@@ -578,6 +651,20 @@
assertFalse(selenium.isVisible(tooltip), "Tooltip should not be visible.");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(value = { "richAccordion" })
+ public void testShowTooltipInAccordion() {
+ testShowTooltip();
+ }
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11314")
+ @Templates(value = { "richPopupPanel" })
+ public void testShowTooltipInPopupPanel() {
+ testShowTooltip();
+ }
+
@Test
public void testStep() {
selenium.click(pjq("input[type=radio][name$=showArrowsInput][value=true]"));
@@ -617,7 +704,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(exclude = { "richPopupPanel" })
public void testTabindex() {
selenium.type(pjq("input[id$=tabindexInput]"), "55");
selenium.waitForPageToLoad(TIMEOUT);
@@ -631,6 +718,13 @@
assertEquals(selenium.getAttribute(attr), "55", "Attribute tabindex of input.");
}
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(value = { "richPopupPanel" })
+ public void testTabindexInPopupPanel() {
+ testTabindex();
+ }
+
@Test
public void testTooltipClass() {
selenium.click(pjq("input[type=radio][name$=showTooltipInput][value=true]"));
@@ -676,15 +770,19 @@
/**
* Clicks on slider's arrow.
- * @param arrow slider's left or right arrow locator
- * @param clicks how many times should it be clicked
+ *
+ * @param arrow
+ * slider's left or right arrow locator
+ * @param clicks
+ * how many times should it be clicked
*/
private void clickArrow(ElementLocator<?> arrow, int clicks) {
String reqTime = null;
for (int i = 0; i < clicks; i++) {
reqTime = selenium.getText(time);
- guardXhr(selenium).runScript(new JavaScript("jQuery(\"" + arrow.getRawLocator() + "\").mousedown().mouseup()"));
+ guardXhr(selenium).runScript(
+ new JavaScript("jQuery(\"" + arrow.getRawLocator() + "\").mousedown().mouseup()"));
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
}
@@ -692,8 +790,11 @@
/**
* Clicks on slider's arrow and verifies delay.
- * @param arrow slider's left or right arrow locator
- * @param delay awaited delay between ajax requests
+ *
+ * @param arrow
+ * slider's left or right arrow locator
+ * @param delay
+ * awaited delay between ajax requests
*/
private void verifyDelay(JQueryLocator arrow, int delay) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss.SSS");
@@ -718,7 +819,8 @@
delta = (long) (delay * 0.5);
long average = countAverage(timesArray);
- assertTrue(Math.abs(average - delay) < delta, "Average delay " + average + " is too far from set value (" + delay + ")");
+ assertTrue(Math.abs(average - delay) < delta, "Average delay " + average + " is too far from set value ("
+ + delay + ")");
}
private long countAverage(Date[] times) {
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSliderWithJSR303.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -29,47 +29,47 @@
import org.jboss.test.selenium.waiting.TextContainsCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Test for faces/components/richInputNumberSpinner/jsr303.xhtml page
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
public class TestRichSliderWithJSR303 extends AbstractMetamerTest {
-
+
/** Wrong value for input validated to min value */
public static final String WRONG_MIN_VAL = "1";
/** Wrong value for input validated to max value */
public static final String WRONG_MAX_VAL = "5";
/** Wrong value for input validated to custom value */
public static final String WRONG_CUSTOM_VAL = "-1";
-
+
/** Wrong value for input validated to min value */
public static final String CORRECT_MIN_VAL = "3";
/** Wrong value for input validated to max value */
public static final String CORRECT_MAX_VAL = "1";
/** Wrong value for input validated to custom value */
public static final String CORRECT_CUSTOM_VAL = "5";
-
-
+
/** validation message for input validated to min value */
public static final String MSG_MIN = "must be greater than or equal to 2";
/** validation message for input validated to max value */
public static final String MSG_MAX = "must be less than or equal to 2";
/** validation message for input validated to custom value */
public static final String MSG_CUSTOM = "must be a positive number";
-
+
private JQueryLocator inputFormat = pjq("span[id$=:slider{0}] span.rf-insl-inp-cntr > input");
private JQueryLocator msgFormat = pjq("span.rf-msg[id$=:inputMsg{0}] span.rf-msg-det");
private JQueryLocator outputFormat = pjq("span[id$=:output{0}]");
private JQueryLocator sliderFormat = pjq("span[id$=:slider{0}] span.rf-insl-trc");
-
+
private JQueryLocator hCommandBtn = pjq("input[id$=:hButton]");
private JQueryLocator a4jCommandBtn = pjq("input[id$=:a4jButton]");
-
+
/** Codes for inputs */
private enum ID {
/** input validated to min val */
@@ -78,33 +78,35 @@
MAX(2),
/** input validated to custom (positive) val */
CUSTOM(3);
-
+
private int id;
+
private ID(int i) {
this.id = i;
}
+
public int val() {
return id;
}
}
-
- /** Position coordinates for slider.
- * Width is 200px, positions are relative to this
+
+ /**
+ * Position coordinates for slider. Width is 200px, positions are relative to this
*/
private enum POSITION {
- LESS_THAN_ZERO(10),
- ZERO(100),
- MORE_THAN_TWO(150);
-
+ LESS_THAN_ZERO(10), ZERO(100), MORE_THAN_TWO(150);
+
private int position;
+
private POSITION(int position) {
this.position = position;
}
- public int val(){
+
+ public int val() {
return position;
}
}
-
+
private void setAllCorrect() {
selenium.type(inputFormat.format(ID.MIN.val()), CORRECT_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
@@ -113,7 +115,7 @@
selenium.type(inputFormat.format(ID.CUSTOM.val()), CORRECT_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
}
-
+
private void setAllWrong() {
selenium.type(inputFormat.format(ID.MIN.val()), WRONG_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
@@ -121,91 +123,99 @@
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
selenium.type(inputFormat.format(ID.CUSTOM.val()), WRONG_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
-
+
// wait until validation appears on last input before go ahead (e.g. submit form)
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
-
+
@Override
public URL getTestUrl() {
return URLUtils.buildUrl(contextPath, "faces/components/richInputNumberSlider/jsr303.xhtml");
}
-
+
@Test
public void testMin() {
selenium.type(inputFormat.format(ID.MIN.val()), WRONG_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
-
+
@Test
- public void testSlideToMin() {
+ @Templates(exclude = { "richPopupPanel" })
+ public void testSlideToMin() {
setAllCorrect();
-
+
selenium.mouseDownAt(sliderFormat.format(ID.MIN.val()), new Point(POSITION.ZERO.val(), 0));
- waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
+ waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
-
+
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testSlideToMinInPopupPanel() {
+ testSlideToMin();
+ }
+
@Test
public void testMax() {
selenium.type(inputFormat.format(ID.MAX.val()), WRONG_MAX_VAL);
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
-
+
@Test
- public void testSlideToMax() {
+ public void testSlideToMax() {
setAllCorrect();
-
+
selenium.mouseDownAt(sliderFormat.format(ID.MAX.val()), new Point(POSITION.MORE_THAN_TWO.val(), 0));
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
-
+
@Test
public void testCustom() {
selenium.type(inputFormat.format(ID.CUSTOM.val()), WRONG_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
-
+
@Test
public void testSlideToNegative() {
setAllCorrect();
-
+
selenium.mouseDownAt(sliderFormat.format(ID.CUSTOM.val()), new Point(POSITION.LESS_THAN_ZERO.val(), 0));
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.CUSTOM.val())).text(MSG_CUSTOM));
}
-
- @Test
+
+ @Test
+ @Templates(exclude = { "a4jRegion" })
public void testAllCorrect() {
-
+
setAllCorrect();
-
- waitGui.until(textEquals.text(CORRECT_MIN_VAL)
- .locator(outputFormat.format(ID.MIN.val())));
+
+ waitGui.until(textEquals.text(CORRECT_MIN_VAL).locator(outputFormat.format(ID.MIN.val())));
Assert.assertEquals(selenium.getText(outputFormat.format(ID.MAX.val())), CORRECT_MAX_VAL);
Assert.assertEquals(selenium.getText(outputFormat.format(ID.CUSTOM.val())), CORRECT_CUSTOM_VAL);
-
+
}
-
+
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11264")
+ @Templates(exclude = { "a4jRegion" })
public void testAllWrong() {
-
+
setAllCorrect();
setAllWrong();
-
+
selenium.click(hCommandBtn);
-
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
Assert.assertEquals(selenium.getText(msgFormat.format(ID.MAX.val())), MSG_MAX);
Assert.assertEquals(selenium.getText(msgFormat.format(ID.CUSTOM.val())), MSG_CUSTOM);
-
+
setAllCorrect();
setAllWrong();
-
+
selenium.click(a4jCommandBtn);
-
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
Assert.assertEquals(selenium.getText(msgFormat.format(ID.MAX.val())), MSG_MAX);
Assert.assertEquals(selenium.getText(msgFormat.format(ID.CUSTOM.val())), MSG_CUSTOM);
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -38,6 +38,7 @@
import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.Test;
@@ -110,11 +111,18 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-11315")
+ @Templates(exclude = { "richPopupPanel" })
public void testAccesskey() {
testHtmlAttribute(input, "accesskey", "x");
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11315")
+ public void testAccesskeyInPopupPanel() {
+ testHtmlAttribute(input, "accesskey", "x");
+ }
+
@Test
public void testCycled() {
JQueryLocator selectOption = pjq("input[type=radio][name$=cycledInput][value=true]");
@@ -183,7 +191,7 @@
assertEquals(selenium.getText(output), "4", "Output was not updated.");
phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
- PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "value changed: 2 -> 4");
}
@@ -478,11 +486,17 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10980")
+ @Templates(exclude = { "richPopupPanel" })
public void testTabindex() {
testHtmlAttribute(input, "tabindex", "57");
}
+ @Test(groups = { "4.Future" })
+ @Templates(value = { "richPopupPanel" })
+ public void testTabindexInPopupPanel() {
+ testHtmlAttribute(input, "tabindex", "57");
+ }
+
@Test
@Use(field = "number", value = "correctNumbers")
public void testValueCorrect() {
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinnerWithJSR303.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -31,49 +31,49 @@
import org.jboss.test.selenium.waiting.TextContainsCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Test for faces/components/richInputNumberSpinner/jsr303.xhtml page
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
public class TestRichSpinnerWithJSR303 extends AbstractMetamerTest {
-
+
/** Wrong value for input validated to min value */
public static final String WRONG_MIN_VAL = "1";
/** Wrong value for input validated to max value */
public static final String WRONG_MAX_VAL = "5";
/** Wrong value for input validated to custom value */
public static final String WRONG_CUSTOM_VAL = "-1";
-
+
/** Wrong value for input validated to min value */
public static final String CORRECT_MIN_VAL = "3";
/** Wrong value for input validated to max value */
public static final String CORRECT_MAX_VAL = "1";
/** Wrong value for input validated to custom value */
public static final String CORRECT_CUSTOM_VAL = "5";
-
-
+
/** validation message for input validated to min value */
public static final String MSG_MIN = "must be greater than or equal to 2";
/** validation message for input validated to max value */
public static final String MSG_MAX = "must be less than or equal to 2";
/** validation message for input validated to custom value */
public static final String MSG_CUSTOM = "must be a positive number";
-
+
private JQueryLocator inputFormat = pjq("span[id$=:input{0}] > input");
private JQueryLocator msgFormat = pjq("span.rf-msg[id$=:inputMsg{0}] span.rf-msg-det");
private JQueryLocator outputFormat = pjq("span[id$=:output{0}]");
-
+
private JQueryLocator hCommandBtn = pjq("input[id$=:hButton]");
private JQueryLocator a4jCommandBtn = pjq("input[id$=:a4jButton]");
-
+
private JQueryLocator spinnerIncFormat = jq("span[id$=:input{0}] span.rf-insp-inc");
private JQueryLocator spinnerDecFormat = jq("span[id$=:input{0}] span.rf-insp-dec");
-
+
/** Codes for inputs */
private enum ID {
/** input validated to min val */
@@ -82,16 +82,18 @@
MAX(2),
/** input validated to custom (positive) val */
CUSTOM(3);
-
+
private int id;
+
private ID(int i) {
this.id = i;
}
+
public int val() {
return id;
}
}
-
+
private void setAllCorrect() {
selenium.type(inputFormat.format(ID.MIN.val()), CORRECT_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
@@ -100,7 +102,7 @@
selenium.type(inputFormat.format(ID.CUSTOM.val()), CORRECT_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
}
-
+
private void setAllWrong() {
selenium.type(inputFormat.format(ID.MIN.val()), WRONG_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
@@ -108,32 +110,32 @@
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
selenium.type(inputFormat.format(ID.CUSTOM.val()), WRONG_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
-
+
// wait until validation appears on last input before go ahead (e.g. submit form)
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
-
+
private void spinUp(ID inputId, String toValue) {
int currentVal = Integer.parseInt(selenium.getValue(inputFormat.format(inputId.val())));
int diff = Integer.parseInt(toValue) - currentVal;
-
+
if (diff < 0) {
throw new IllegalArgumentException("Cannot spin from " + currentVal + " to " + toValue);
}
-
- for (int i = 0; i < diff; ++i) {
+
+ for (int i = 0; i < diff; ++i) {
selenium.clickAt(spinnerIncFormat.format(inputId.val()), new Point(1, 1));
- }
+ }
}
-
+
private void spinDown(ID inputId, String toValue) {
int currentVal = Integer.parseInt(selenium.getValue(inputFormat.format(inputId.val())));
int diff = currentVal - Integer.parseInt(toValue);
-
+
if (diff < 0) {
throw new IllegalArgumentException("Cannot spin from " + currentVal + " to " + toValue);
}
-
+
for (int i = 0; i < diff; ++i) {
selenium.clickAt(spinnerDecFormat.format(inputId.val()), new Point(1, 1));
}
@@ -143,83 +145,86 @@
public URL getTestUrl() {
return URLUtils.buildUrl(contextPath, "faces/components/richInputNumberSpinner/jsr303.xhtml");
}
-
+
@Test
public void testMin() {
selenium.type(inputFormat.format(ID.MIN.val()), WRONG_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
-
+
@Test
public void testSpinToMin() {
selenium.type(inputFormat.format(ID.MIN.val()), CORRECT_MIN_VAL);
selenium.fireEvent(inputFormat.format(ID.MIN.val()), Event.BLUR);
-
+
spinDown(ID.MIN, WRONG_MIN_VAL);
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
}
-
+
@Test
public void testMax() {
selenium.type(inputFormat.format(ID.MAX.val()), WRONG_MAX_VAL);
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
-
+
@Test
public void testSpinToMax() {
selenium.type(inputFormat.format(ID.MAX.val()), CORRECT_MAX_VAL);
selenium.fireEvent(inputFormat.format(ID.MAX.val()), Event.BLUR);
-
+
spinUp(ID.MAX, WRONG_MAX_VAL);
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MAX.val())).text(MSG_MAX));
}
-
+
@Test
public void testCustom() {
selenium.type(inputFormat.format(ID.CUSTOM.val()), WRONG_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
-
+
@Test
public void testSpinToNegative() {
selenium.type(inputFormat.format(ID.CUSTOM.val()), CORRECT_CUSTOM_VAL);
selenium.fireEvent(inputFormat.format(ID.CUSTOM.val()), Event.BLUR);
-
+
spinDown(ID.CUSTOM, WRONG_CUSTOM_VAL);
waitGui.until(TextContainsCondition.getInstance().text(MSG_CUSTOM).locator(msgFormat.format(ID.CUSTOM.val())));
}
-
- @Test
+
+ @Test
+ @Templates(exclude = { "a4jRegion" })
public void testAllCorrect() {
-
+
setAllCorrect();
-
- waitGui.until(TextContainsCondition.getInstance().text(CORRECT_MIN_VAL).locator(outputFormat.format(ID.MIN.val())));
+
+ waitGui.until(TextContainsCondition.getInstance().text(CORRECT_MIN_VAL)
+ .locator(outputFormat.format(ID.MIN.val())));
Assert.assertEquals(selenium.getText(outputFormat.format(ID.MAX.val())), CORRECT_MAX_VAL);
Assert.assertEquals(selenium.getText(outputFormat.format(ID.CUSTOM.val())), CORRECT_CUSTOM_VAL);
}
-
+
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11264")
+ @Templates(exclude = { "a4jRegion" })
public void testAllWrong() {
-
+
setAllCorrect();
setAllWrong();
-
+
selenium.click(hCommandBtn);
-
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
Assert.assertEquals(selenium.getText(msgFormat.format(ID.MAX.val())), MSG_MAX);
Assert.assertEquals(selenium.getText(msgFormat.format(ID.CUSTOM.val())), MSG_CUSTOM);
-
+
setAllCorrect();
setAllWrong();
-
+
selenium.click(a4jCommandBtn);
-
+
waitGui.until(TextContainsCondition.getInstance().locator(msgFormat.format(ID.MIN.val())).text(MSG_MIN));
Assert.assertEquals(selenium.getText(msgFormat.format(ID.MAX.val())), MSG_MAX);
Assert.assertEquals(selenium.getText(msgFormat.format(ID.CUSTOM.val())), MSG_CUSTOM);
Copied: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/MenuItemAttributes.java (from rev 22826, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/MenuItemAttributes.java)
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/MenuItemAttributes.java (rev 0)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/MenuItemAttributes.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.ftest.richMenuItem;
+
+import org.richfaces.tests.metamer.ftest.attributes.AttributeEnum;
+
+/**
+ * Attributes for rich:menuItem component
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ *
+ * @version $Revision$
+ */
+public enum MenuItemAttributes implements AttributeEnum {
+ bypassUpdates,
+ data,
+ dir,
+ disabled,
+ execute,
+ icon,
+ iconDisabled,
+ immediate,
+ label,
+ lang,
+ limitRender,
+ mode,
+ onbeforedomupdate,
+ onbegin,
+ onclick,
+ oncomplete,
+ ondblclick,
+ onkeydown,
+ onkeypress,
+ onkeyup,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup,
+ render,
+ rendered,
+ status,
+ style,
+ styleClass,
+ title
+}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/TestRichMenuItem.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/TestRichMenuItem.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/TestRichMenuItem.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -32,6 +32,8 @@
import static org.testng.Assert.assertNotSame;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.menuItemAttributes;
+import static org.richfaces.tests.metamer.ftest.richMenuItem.MenuItemAttributes.*;
import java.net.URL;
@@ -43,7 +45,6 @@
import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.Test;
/**
@@ -123,9 +124,8 @@
@Test
public void testBypassUpdates() {
- selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
- selenium.waitForPageToLoad();
-
+ menuItemAttributes.set(bypassUpdates, Boolean.TRUE);
+
String reqTime = selenium.getText(time);
selenium.mouseOver(fileMenuLabel);
guardXhr(selenium).click(menuItem1);
@@ -142,11 +142,9 @@
@Test
public void testData() {
- selenium.type(pjq("input[type=text][id$=dataInput]"), "RichFaces 4");
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(data, "RichFaces 4");
- selenium.type(pjq("input[type=text][id$=oncompleteInput]"), "data = event.data");
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(oncomplete, "data = event.data");
String reqTime = selenium.getText(time);
selenium.mouseOver(fileMenuLabel);
@@ -164,8 +162,7 @@
@Test
public void testDisabled() {
- selenium.click(pjq("input[type=radio][name$=disabledInput][value=true]"));
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(disabled, Boolean.TRUE);
assertTrue(selenium.belongsClass(menuItem1, "rf-ddm-itm-dis"),
"Menu item should have class \"rf-ddm-itm-dis\".");
@@ -176,8 +173,7 @@
@Test
public void testExecute() {
- selenium.type(pjq("input[type=text][id$=executeInput]"), "@this executeChecker");
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(execute, "@this executeChecker");
String reqTime = selenium.getText(time);
selenium.mouseOver(fileMenuLabel);
@@ -198,18 +194,18 @@
public void testIcon() {
AttributeLocator<?> attr = image.getAttribute(Attribute.SRC);
- selenium.select(pjq("select[id$=iconInput]"), optionLabel("star"));
- selenium.waitForPageToLoad();
+ // selenium.select(pjq("select[id$=iconInput]"), optionLabel("star"));
+ menuItemAttributes.set(icon, "star");
assertTrue(selenium.getAttribute(attr).contains("star.png"),
"Image's src attribute should contain \"star.png\".");
- selenium.select(pjq("select[id$=iconInput]"), optionLabel("nonexisting"));
- selenium.waitForPageToLoad();
+ // selenium.select(pjq("select[id$=iconInput]"), optionLabel("nonexisting"));
+ menuItemAttributes.set(icon, "nonexisting");
assertTrue(selenium.getAttribute(attr).contains("nonexisting"),
"Image's src attribute should contain \"nonexisting\".");
- selenium.select(pjq("select[id$=iconInput]"), optionLabel("null"));
- selenium.waitForPageToLoad();
+ // selenium.select(pjq("select[id$=iconInput]"), optionLabel("null"));
+ menuItemAttributes.set(icon, "null");
assertFalse(selenium.isElementPresent(image), "Icon should not be present.");
assertTrue(selenium.isElementPresent(menuItem1.getDescendant(jq("div.rf-ddm-emptyIcon"))),
"Empty icon should be present.");
@@ -217,8 +213,7 @@
@Test
public void testIconDisabled() {
- selenium.click(pjq("input[type=radio][name$=disabledInput][value=true]"));
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(disabled, Boolean.TRUE);
AttributeLocator<?> attr = image.getAttribute(Attribute.SRC);
@@ -226,21 +221,20 @@
assertTrue(selenium.isElementPresent(menuItem1.getDescendant(jq("div.rf-ddm-emptyIcon"))),
"Empty icon should be present.");
- selenium.select(pjq("select[id$=iconDisabledInput]"), optionLabel("star"));
- selenium.waitForPageToLoad();
+ // selenium.select(pjq("select[id$=iconDisabledInput]"), optionLabel("star"));
+ menuItemAttributes.set(iconDisabled, "star");
assertTrue(selenium.getAttribute(attr).contains("star.png"),
"Image's src attribute should contain \"star.png\".");
- selenium.select(pjq("select[id$=iconDisabledInput]"), optionLabel("nonexisting"));
- selenium.waitForPageToLoad();
+ // selenium.select(pjq("select[id$=iconDisabledInput]"), optionLabel("nonexisting"));
+ menuItemAttributes.set(iconDisabled, "nonexisting");
assertTrue(selenium.getAttribute(attr).contains("nonexisting"),
"Image's src attribute should contain \"nonexisting\".");
}
@Test
public void testImmediate() {
- selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(immediate, Boolean.TRUE);
String reqTime = selenium.getText(time);
selenium.mouseOver(fileMenuLabel);
@@ -257,8 +251,7 @@
@Test
public void testLabel() {
- selenium.type(pjq("input[type=text][id$=labelInput]"), "new label");
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(MenuItemAttributes.label, "new label");
assertEquals(selenium.getText(label), "new label", "New label of first menu item.");
}
@@ -270,8 +263,7 @@
@Test
public void testLimitRender() {
- selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(limitRender, Boolean.TRUE);
String reqTime = selenium.getText(time);
selenium.mouseOver(fileMenu);
@@ -281,9 +273,10 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10200")
public void testMode() {
String reqTime = selenium.getText(time);
+
+ // test for @mode=ajax
selenium.mouseOver(fileMenu);
guardXhr(selenium).click(menuItem1);
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
@@ -296,8 +289,8 @@
listenerOutput = selenium.getText(jq("div#phasesPanel li:eq(6)"));
assertEquals(listenerOutput, "* action invoked", "Action's output");
- selenium.click(pjq("input[name$=modeInput][value=server]"));
- selenium.waitForPageToLoad();
+ // test for @mode=server
+ menuItemAttributes.set(mode, "server");
selenium.mouseOver(fileMenu);
guardHttp(selenium).click(menuItem1);
@@ -309,16 +302,14 @@
assertEquals(listenerOutput, "* action listener invoked", "Action listener's output");
listenerOutput = selenium.getText(jq("div#phasesPanel li:eq(6)"));
assertEquals(listenerOutput, "* action invoked", "Action's output");
+
}
@Test
public void testEvents() {
- selenium.type(pjq("input[type=text][id$=onbeginInput]"), "metamerEvents += \"begin \"");
- selenium.waitForPageToLoad();
- selenium.type(pjq("input[type=text][id$=onbeforedomupdateInput]"), "metamerEvents += \"beforedomupdate \"");
- selenium.waitForPageToLoad();
- selenium.type(pjq("input[type=text][id$=oncompleteInput]"), "metamerEvents += \"complete \"");
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(onbegin, "metamerEvents += \"begin \"");
+ menuItemAttributes.set(onbeforedomupdate, "metamerEvents += \"beforedomupdate \"");
+ menuItemAttributes.set(oncomplete, "metamerEvents += \"complete \"");
selenium.getEval(new JavaScript("window.metamerEvents = \"\";"));
@@ -386,8 +377,7 @@
@Test
public void testRendered() {
- selenium.click(pjq("input[type=radio][name$=renderedInput][value=false]"));
- selenium.waitForPageToLoad();
+ menuItemAttributes.set(rendered, Boolean.FALSE);
assertFalse(selenium.isElementPresent(menuItem1), "Menu item should not be rendered when rendered=false.");
assertTrue(selenium.isDisplayed(menuItem1), "Menu item should be displayed when item 1 is not rendered.");
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesCSV.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesCSV.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesCSV.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -31,7 +31,7 @@
/**
* Test case for page /faces/components/richMessages/csv.xhtml
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
@@ -58,13 +58,14 @@
}
// list of called test methods
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-11298")
public void testFor() {
super.testFor();
}
- @Test
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11415")
public void testGlobalOnly() {
super.testGlobalOnly();
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSFValidator.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSFValidator.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSFValidator.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -31,7 +31,7 @@
/**
* Test case for page /faces/components/richMessages/jsfValidator.xhtml
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
@@ -58,13 +58,14 @@
}
// list of called test methods
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-11298")
public void testFor() {
super.testFor();
}
- @Test
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11415")
public void testGlobalOnly() {
super.testGlobalOnly();
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSR303.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSR303.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMessages/TestRichMessagesJSR303.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -31,7 +31,7 @@
/**
* Test case for page /faces/components/richMessages/jsr303.xhtml
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
@@ -58,13 +58,14 @@
}
// list of called test methods
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-11298")
public void testFor() {
super.testFor();
}
- @Test
+ @Test(groups = { "4.Future" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11415")
public void testGlobalOnly() {
super.testGlobalOnly();
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/NotifyStackAttributes.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/NotifyStackAttributes.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/NotifyStackAttributes.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -28,7 +28,9 @@
*/
public enum NotifyStackAttributes implements AttributeEnum {
- rendered,
- styleClass
-
+ direction,
+ method,
+ position,
+ rendered
+
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotify.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -21,21 +21,23 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richNotify;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertEquals;
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+
import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.NegationCondition;
import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
import org.richfaces.tests.metamer.bean.rich.RichNotifyBean;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -71,13 +73,13 @@
@Test
public void testAttributeDelay() {
- // set the delay to <1000>
- attributesNotify.set(NotifyAttributes.delay, 1000);
- // wait for <500>
- delay(500);
- assertFalse(selenium.isElementPresent(notify), "The delay is set to 1000 and after some little waiting the notify shouldn't be present.");
+ // set the delay to <2000>
+ attributesNotify.set(NotifyAttributes.delay, 2000);
// wait for <1000>
delay(1000);
+ assertFalse(selenium.isElementPresent(notify), "The delay is set to 1000 and after some little waiting the notify shouldn't be present.");
+ // wait for <1500>
+ delay(1500);
assertTrue(selenium.isElementPresent(notify), "The delay is set to 1000 and after some waiting the notify should be present.");
}
@@ -148,6 +150,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11433")
public void testAttributeSticky() {
// set the stayTime to <0>
attributesNotify.set(NotifyAttributes.stayTime, 0);
@@ -322,17 +325,16 @@
// set the sticky to <true>
selenium.click(pjq("input[type=radio][name*='attributesNotifyMessages:sticky'][value=true]"));
selenium.waitForPageToLoad();
- // produce messages
for(String type : messages.keySet()) {
+ // produce message
produceMessage(messages.get(type), type, 1);
- }
- // check whether the messages are still present
- delay(500);
- for(String type : messages.keySet()) {
+ delay(500);
+ // check whether the messages are still present
waitGui
.failWith("The stayTime is set to <0> and sticky to <true>, so the " + type + " message should be present.")
- .until(elementPresent.locator(messages.get(type)));
- }
+ .until(elementPresent.locator(messages.get(type)));
+ closeAll(notify);
+ }
}
@Test
@@ -352,12 +354,6 @@
}
@Test
- public void testAttributeStackStyleClass() {
- attributesStack.set(NotifyStackAttributes.styleClass, "someNiceStyleClass");
- assertTrue(selenium.belongsClass(notifyStack, "someNiceStyleClass"));
- }
-
- @Test
public void testInit() {
assertTrue(selenium.isElementPresent(notify), "There is no notify message after page is loaded.");
assertEquals(selenium.getText(getDetail(notify)), RichNotifyBean.DEFAULT_DETAIL, "The notify detail doesn't match.");
@@ -365,6 +361,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11433")
public void testCloseAndProduceNotify() {
// check closing the notify
close(notify);
@@ -390,6 +387,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11433")
public void testProduceMoreMessages() {
// set the messageCount to <testedNumber>
int testedNumber = 3;
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richNotify/TestRichNotifyMoreStacks.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -27,7 +27,6 @@
import static org.testng.Assert.assertEquals;
import java.net.URL;
-import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.testng.annotations.Test;
@@ -50,15 +49,20 @@
private final JQueryLocator stack2 = jq("div.bottomRight");
/**
- * locater of the input which is associated with messages for the first stack
+ * locator of the input which is associated with messages for the first stack
*/
private final JQueryLocator number1 = pjq("input[id$=number1]");
/**
- * locater of the input which is associated with messages for the second stack
+ * locator of the input which is associated with messages for the second stack
*/
private final JQueryLocator number2 = pjq("input[id$=number2]");
+ /**
+ * locator of the h:commnadButton submit
+ */
+ private final JQueryLocator submitHCommandButton = pjq("input[id$=hCommandButtonSubmit]");
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richNotify/moreStacks.xhtml");
@@ -66,8 +70,6 @@
@Test
public void testInit() {
- assertTrue(selenium.isElementPresent(stack1), "The first stack is not present.");
- assertTrue(selenium.isElementPresent(stack2), "The second stack is not present.");
assertTrue(selenium.isElementPresent(inStack(stack1, notify)), "The notify in the first stack is not present.");
assertTrue(selenium.isElementPresent(inStack(stack2, notify)), "The notify in the second stack is not present.");
assertEquals(1, getNumberOfNotifies(stack1), "The initial number of notifies in the first stack should be <1>, found <" + getNumberOfNotifies(stack1) + ">.");
@@ -77,32 +79,28 @@
@Test
public void testValidationErrorInTwoStacks() {
// notify in stacks
- JQueryLocator message1 = inStack(stack1, notify);
- JQueryLocator message2 = inStack(stack2, notify);
- // close notifes in both stacks
- close(message1);
- close(message2);
+ JQueryLocator message1 = inStack(stack1, notifyError);
+ JQueryLocator message2 = inStack(stack2, notifyError);
// try to fill the number 1 field (wrong)
selenium.type(number1, "1");
- selenium.fireEvent(number1, Event.BLUR);
- delay(1000);
+ selenium.type(number2, "5");
+ selenium.click(submitHCommandButton);
+ selenium.waitForPageToLoad();
waitGui
.failWith("After wrong filling the first form field the number of messages in the first stack should be <1>, found <" + selenium.getCount(message1) + ">")
.until(countEquals.locator(message1).count(1));
waitGui
.failWith("After wrong filling the first form field the number of messages in the second stack should be <0>, found <" + selenium.getCount(message2) + ">")
- .until(countEquals.locator(message1).count(0));
-
- // close produced notifies
+ .until(countEquals.locator(message2).count(0));
close(message1);
- close(message2);
// try to fill the number 2 field (wrong)
+ selenium.type(number1, "10");
selenium.type(number2, "1");
- selenium.fireEvent(number2, Event.BLUR);
- delay(1000);
+ selenium.click(submitHCommandButton);
+ selenium.waitForPageToLoad();
waitGui
.failWith("After wrong filling the second form field the number of messages in the second stack should be <1>, found <" + selenium.getCount(message2) + ">")
- .until(countEquals.locator(message1).count(1));
+ .until(countEquals.locator(message2).count(1));
waitGui
.failWith("After wrong filling the second form field the number of messages in the first stack should be <0>, found <" + selenium.getCount(message1) + ">")
.until(countEquals.locator(message1).count(0));
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -32,6 +32,7 @@
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.ftest.model.PanelMenu;
@@ -75,6 +76,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11547")
@Use(field = "event", value = "ajaxExpansionEvents")
public void testClientSideExpansionEvent() {
panelMenuGroupAttributes.set(mode, ajax);
@@ -109,6 +111,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11547")
public void testClientSideExpansionEventsOrderAjax() {
panelMenuGroupAttributes.set(mode, ajax);
menu.setGroupMode(ajax);
@@ -129,6 +132,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11547")
@Use(field = "event", value = "serverExpansionEvents")
public void testClientSideExpansionEventsServer() {
panelMenuGroupAttributes.set(mode, server);
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -88,7 +88,7 @@
super.testRequestEventsAfter(ajaxEvents);
}
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-10844")
public void testClientSideEventsOrderServer() {
panelMenuItemAttributes.set(mode, server);
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -22,6 +22,7 @@
package org.richfaces.tests.metamer.ftest.richPickList;
import static java.text.MessageFormat.format;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@@ -31,8 +32,11 @@
import java.net.URL;
+import org.atmosphere.client.JavascriptClientFilter;
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.utils.URLUtils;
import org.jboss.test.selenium.waiting.EventFiredCondition;
@@ -317,7 +321,14 @@
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659", "https://issues.jboss.org/browse/RF-11322" })
public void testOnblur() {
- testFireEvent(Event.BLUR, pickListTop);
+ ElementLocator<?> eventInput = pjq("input[id$=onblurInput]");
+ String value = "metamerEvents += \"blur \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(addAllBtn, Event.FOCUS);
+ selenium.fireEvent(addAllBtn, Event.BLUR);
+
+ waitGui.failWith("Attribute onblur does not work correctly").until(new EventFiredCondition(Event.BLUR));
}
@Test
@@ -396,7 +407,14 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11322")
public void testOnsourceblur() {
- testFireEvent(Event.BLUR, pickListSource, "sourceblur");
+ ElementLocator<?> eventInput = pjq("input[id$=onsourceblurInput]");
+ String value = "metamerEvents += \"blur \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.click(pickListSrcItems);
+ selenium.click(pickListTargetItems);
+
+ waitGui.failWith("Attribute onsourceblur does not work correctly").until(new EventFiredCondition(Event.BLUR));
}
@Test
@@ -412,25 +430,57 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11322")
public void testOnsourcefocus() {
- testFireEvent(Event.FOCUS, pickListSource, "sourcefocus");
+ ElementLocator<?> eventInput = pjq("input[id$=onsourcefocusInput]");
+ String value = "metamerEvents += \"focus \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.click(pickListSrcItems);
+
+ waitGui.failWith("Attribute onsourcefocus does not work correctly").until(new EventFiredCondition(Event.FOCUS));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659", "https://issues.jboss.org/browse/RF-11322" })
public void testOnsourcekeydown() {
- testFireEvent(Event.KEYDOWN, pickListSource, "sourcekeydown");
+ ElementLocator<?> eventInput = pjq("input[id$=onsourcekeydownInput]");
+ String value = "metamerEvents += \"keydown \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListSrcItems, Event.KEYDOWN);
+ JavaScript script = new JavaScript("window.jQuery('div[id$=pickListSourceItems]').keydown()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute onsourcekeydown does not work correctly").until(
+ new EventFiredCondition(Event.KEYDOWN));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659", "https://issues.jboss.org/browse/RF-11322" })
public void testOnsourcekeypress() {
- testFireEvent(Event.KEYPRESS, pickListSource, "sourcekeypress");
+ ElementLocator<?> eventInput = pjq("input[id$=onsourcekeypressInput]");
+ String value = "metamerEvents += \"keypress \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListSrcItems, Event.KEYPRESS);
+ JavaScript script = new JavaScript("window.jQuery('div[id$=pickListSourceItems]').keypress()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute onsourcekeypress does not work correctly").until(
+ new EventFiredCondition(Event.KEYPRESS));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659", "https://issues.jboss.org/browse/RF-11322" })
public void testOnsourcekeyup() {
- testFireEvent(Event.KEYUP, pickListSource, "sourcekeyup");
+ ElementLocator<?> eventInput = pjq("input[id$=onsourcekeyupInput]");
+ String value = "metamerEvents += \"keyup \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListSrcItems, Event.KEYUP);
+ JavaScript script = new JavaScript("window.jQuery('div[id$=pickListSourceItems]').keyup()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute onsourcekeyup does not work correctly").until(new EventFiredCondition(Event.KEYUP));
}
@Test
@@ -461,7 +511,14 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11322")
public void testOntargetblur() {
- testFireEvent(Event.BLUR, pickListTarget, "targetblur");
+ ElementLocator<?> eventInput = pjq("input[id$=ontargetblurInput]");
+ String value = "metamerEvents += \"blur \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.click(pickListTargetItems);
+ selenium.click(pickListSrcItems);
+
+ waitGui.failWith("Attribute ontargetblur does not work correctly").until(new EventFiredCondition(Event.BLUR));
}
@Test
@@ -477,25 +534,57 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11322")
public void testOntargetfocus() {
- testFireEvent(Event.FOCUS, pickListTarget, "targetfocus");
+ ElementLocator<?> eventInput = pjq("input[id$=ontargetfocusInput]");
+ String value = "metamerEvents += \"focus \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.click(pickListTargetItems);
+
+ waitGui.failWith("Attribute ontargetfocus does not work correctly").until(new EventFiredCondition(Event.FOCUS));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659", "https://issues.jboss.org/browse/RF-11322" })
public void testOntargetkeydown() {
- testFireEvent(Event.KEYDOWN, pickListTarget, "targetkeydown");
+ ElementLocator<?> eventInput = pjq("input[id$=ontargetkeydownInput]");
+ String value = "metamerEvents += \"keydown \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListTargetItems, Event.KEYDOWN);
+ JavaScript script = new JavaScript("window.jQuery('div[id$=pickListTargetItems]').keydown()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute ontargetkeydown does not work correctly").until(
+ new EventFiredCondition(Event.KEYDOWN));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659", "https://issues.jboss.org/browse/RF-11322" })
public void testOntargetkeypress() {
- testFireEvent(Event.KEYPRESS, pickListTarget, "targetkeypress");
+ ElementLocator<?> eventInput = pjq("input[id$=ontargetkeypressInput]");
+ String value = "metamerEvents += \"keypress \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListTargetItems, Event.KEYPRESS);
+ JavaScript script = new JavaScript("window.jQuery('div[id$=pickListTargetItems]').keypress()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute ontargetkeypress does not work correctly").until(
+ new EventFiredCondition(Event.KEYPRESS));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659", "https://issues.jboss.org/browse/RF-11322" })
public void testOntargetkeyup() {
- testFireEvent(Event.KEYUP, pickListTarget, "targetkeyup");
+ ElementLocator<?> eventInput = pjq("input[id$=ontargetkeyupInput]");
+ String value = "metamerEvents += \"keyup \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListTargetItems, Event.KEYUP);
+ JavaScript script = new JavaScript("window.jQuery('div[id$=pickListTargetItems]').keyup()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute ontargetkeyup does not work correctly").until(new EventFiredCondition(Event.KEYUP));
}
@Test
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -50,21 +50,24 @@
* @version $Revision$
*/
public class TestRichTab extends AbstractMetamerTest {
-
+
private static final JQueryLocator PHASE_FORMAT = jq("div#phasesPanel li:eq({0})");
- private static final String PHASE_LISTENER_LOG = "* action listener invoked";
-
+ private static final String ACTION_LOG = "* action invoked";
+ private static final String ACTION_LISTENER_LOG = "* action listener invoked";
+
private JQueryLocator panel = pjq("div[id$=tabPanel]");
- private JQueryLocator[] itemContents = {pjq("div[id$=tab1] > div.rf-tab-cnt"), pjq("div[id$=tab2] > div.rf-tab-cnt"),
- pjq("div[id$=tab3] > div.rf-tab-cnt"), pjq("div[id$=tab4] > div.rf-tab-cnt"), pjq("div[id$=tab5] > div.rf-tab-cnt")};
- private JQueryLocator[] activeHeaders = {pjq("td[id$=tab1:header:active]"), pjq("td[id$=tab2:header:active]"),
- pjq("td[id$=tab3:header:active]"), pjq("td[id$=tab4:header:active]"), pjq("td[id$=tab5:header:active]")};
- private JQueryLocator[] inactiveHeaders = {pjq("td[id$=tab1:header:inactive]"), pjq("td[id$=tab2:header:inactive]"),
- pjq("td[id$=tab3:header:inactive]"), pjq("td[id$=tab4:header:inactive]"), pjq("td[id$=tab5:header:inactive]")};
- private JQueryLocator[] disabledHeaders = {pjq("td[id$=tab1:header:disabled]"), pjq("td[id$=tab2:header:disabled]"),
- pjq("td[id$=tab3:header:disabled]"), pjq("td[id$=tab4:header:disabled]"), pjq("td[id$=tab5:header:disabled]")};
+ private JQueryLocator[] itemContents = { pjq("div[id$=tab1] > div.rf-tab-cnt"),
+ pjq("div[id$=tab2] > div.rf-tab-cnt"), pjq("div[id$=tab3] > div.rf-tab-cnt"),
+ pjq("div[id$=tab4] > div.rf-tab-cnt"), pjq("div[id$=tab5] > div.rf-tab-cnt") };
+ private JQueryLocator[] activeHeaders = { pjq("td[id$=tab1:header:active]"), pjq("td[id$=tab2:header:active]"),
+ pjq("td[id$=tab3:header:active]"), pjq("td[id$=tab4:header:active]"), pjq("td[id$=tab5:header:active]") };
+ private JQueryLocator[] inactiveHeaders = { pjq("td[id$=tab1:header:inactive]"),
+ pjq("td[id$=tab2:header:inactive]"), pjq("td[id$=tab3:header:inactive]"), pjq("td[id$=tab4:header:inactive]"),
+ pjq("td[id$=tab5:header:inactive]") };
+ private JQueryLocator[] disabledHeaders = { pjq("td[id$=tab1:header:disabled]"),
+ pjq("td[id$=tab2:header:disabled]"), pjq("td[id$=tab3:header:disabled]"), pjq("td[id$=tab4:header:disabled]"),
+ pjq("td[id$=tab5:header:disabled]") };
private JQueryLocator tab1 = pjq("div[id$=tab1]");
-
@Override
public URL getTestUrl() {
@@ -73,23 +76,37 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11427")
- public void testActionListener() {
+ public void testAction() {
retrieveRequestTime.initializeValue();
selenium.click(pjq("input[id$=nextTabButton]"));
waitAjax.waitForChange(retrieveRequestTime);
-
+
retrieveRequestTime.initializeValue();
selenium.click(pjq("input[id$=prevTabButton]"));
waitAjax.waitForChange(retrieveRequestTime);
-
- waitGui
- .failWith("Expected <" + PHASE_LISTENER_LOG + ">, found <" + selenium.getText(PHASE_FORMAT.format(5)) + ">")
- .until(textEquals.locator(PHASE_FORMAT.format(5)).text(
- PHASE_LISTENER_LOG)
- );
- }
+
+ waitGui.failWith(
+ "Expected <" + ACTION_LOG + ">, found <" + selenium.getText(PHASE_FORMAT.format(6)) + ">").until(
+ textEquals.locator(PHASE_FORMAT.format(6)).text(ACTION_LOG));
+ }
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11427")
+ public void testActionListener() {
+ retrieveRequestTime.initializeValue();
+ selenium.click(pjq("input[id$=nextTabButton]"));
+ waitAjax.waitForChange(retrieveRequestTime);
+
+ retrieveRequestTime.initializeValue();
+ selenium.click(pjq("input[id$=prevTabButton]"));
+ waitAjax.waitForChange(retrieveRequestTime);
+
+ waitGui.failWith(
+ "Expected <" + ACTION_LISTENER_LOG + ">, found <" + selenium.getText(PHASE_FORMAT.format(5)) + ">").until(
+ textEquals.locator(PHASE_FORMAT.format(5)).text(ACTION_LISTENER_LOG));
+ }
+
+ @Test
public void testInit() {
boolean displayed = selenium.isDisplayed(panel);
assertTrue(displayed, "Tab panel is not present on the page.");
@@ -166,7 +183,8 @@
selenium.type(pjq("input[type=text][id$=headerInput]"), "ľščťťžžôúňď ацущьмщфзщйцу");
selenium.waitForPageToLoad();
- assertEquals(selenium.getText(activeHeaders[0]), "ľščťťžžôúňď ацущьмщфзщйцу", "Header of the first tab did not change.");
+ assertEquals(selenium.getText(activeHeaders[0]), "ľščťťžžôúňď ацущьмщфзщйцу",
+ "Header of the first tab did not change.");
}
@Test
@@ -184,6 +202,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11549")
public void testHeaderClass() {
selenium.type(pjq("input[id$=headerClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
@@ -203,12 +222,16 @@
selenium.waitForPageToLoad();
assertFalse(selenium.belongsClass(activeHeaders[0], "metamer-ftest-class"), "headerDisabledClass does not work");
- assertFalse(selenium.belongsClass(inactiveHeaders[0], "metamer-ftest-class"), "headerDisabledClass does not work");
- assertTrue(selenium.belongsClass(disabledHeaders[0], "metamer-ftest-class"), "headerDisabledClass does not work");
+ assertFalse(selenium.belongsClass(inactiveHeaders[0], "metamer-ftest-class"),
+ "headerDisabledClass does not work");
+ assertTrue(selenium.belongsClass(disabledHeaders[0], "metamer-ftest-class"),
+ "headerDisabledClass does not work");
assertFalse(selenium.belongsClass(activeHeaders[1], "metamer-ftest-class"), "headerDisabledClass does not work");
- assertFalse(selenium.belongsClass(inactiveHeaders[1], "metamer-ftest-class"), "headerDisabledClass does not work");
- assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"), "headerDisabledClass does not work");
+ assertFalse(selenium.belongsClass(inactiveHeaders[1], "metamer-ftest-class"),
+ "headerDisabledClass does not work");
+ assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"),
+ "headerDisabledClass does not work");
}
@Test
@@ -217,12 +240,16 @@
selenium.waitForPageToLoad();
assertFalse(selenium.belongsClass(activeHeaders[0], "metamer-ftest-class"), "headerInactiveClass does not work");
- assertTrue(selenium.belongsClass(inactiveHeaders[0], "metamer-ftest-class"), "headerInactiveClass does not work");
- assertFalse(selenium.belongsClass(disabledHeaders[0], "metamer-ftest-class"), "headerInactiveClass does not work");
+ assertTrue(selenium.belongsClass(inactiveHeaders[0], "metamer-ftest-class"),
+ "headerInactiveClass does not work");
+ assertFalse(selenium.belongsClass(disabledHeaders[0], "metamer-ftest-class"),
+ "headerInactiveClass does not work");
assertFalse(selenium.belongsClass(activeHeaders[1], "metamer-ftest-class"), "headerInactiveClass does not work");
- assertFalse(selenium.belongsClass(inactiveHeaders[1], "metamer-ftest-class"), "headerInactiveClass does not work");
- assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"), "headerInactiveClass does not work");
+ assertFalse(selenium.belongsClass(inactiveHeaders[1], "metamer-ftest-class"),
+ "headerInactiveClass does not work");
+ assertFalse(selenium.belongsClass(disabledHeaders[1], "metamer-ftest-class"),
+ "headerInactiveClass does not work");
}
@Test
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -53,16 +53,19 @@
public class TestRichTabPanel extends AbstractMetamerTest {
private JQueryLocator panel = pjq("div[id$=tabPanel]");
- private JQueryLocator[] items = {pjq("div[id$=tab1]"), pjq("div[id$=tab2]"), pjq("div[id$=tab3]"), pjq("div[id$=tab4]"),
- pjq("div[id$=tab5]")};
- private JQueryLocator[] itemContents = {pjq("div[id$=tab1] > div.rf-tab-cnt"), pjq("div[id$=tab2] > div.rf-tab-cnt"),
- pjq("div[id$=tab3] > div.rf-tab-cnt"), pjq("div[id$=tab4] > div.rf-tab-cnt"), pjq("div[id$=tab5] > div.rf-tab-cnt")};
- private JQueryLocator[] activeHeaders = {pjq("td[id$=tab1:header:active]"), pjq("td[id$=tab2:header:active]"),
- pjq("td[id$=tab3:header:active]"), pjq("td[id$=tab4:header:active]"), pjq("td[id$=tab5:header:active]")};
- private JQueryLocator[] inactiveHeaders = {pjq("td[id$=tab1:header:inactive]"), pjq("td[id$=tab2:header:inactive]"),
- pjq("td[id$=tab3:header:inactive]"), pjq("td[id$=tab4:header:inactive]"), pjq("td[id$=tab5:header:inactive]")};
- private JQueryLocator[] disabledHeaders = {pjq("td[id$=tab1:header:disabled]"), pjq("td[id$=tab2:header:disabled]"),
- pjq("td[id$=tab3:header:disabled]"), pjq("td[id$=tab4:header:disabled]"), pjq("td[id$=tab5:header:disabled]")};
+ private JQueryLocator[] items = { pjq("div[id$=tab1]"), pjq("div[id$=tab2]"), pjq("div[id$=tab3]"),
+ pjq("div[id$=tab4]"), pjq("div[id$=tab5]") };
+ private JQueryLocator[] itemContents = { pjq("div[id$=tab1] > div.rf-tab-cnt"),
+ pjq("div[id$=tab2] > div.rf-tab-cnt"), pjq("div[id$=tab3] > div.rf-tab-cnt"),
+ pjq("div[id$=tab4] > div.rf-tab-cnt"), pjq("div[id$=tab5] > div.rf-tab-cnt") };
+ private JQueryLocator[] activeHeaders = { pjq("td[id$=tab1:header:active]"), pjq("td[id$=tab2:header:active]"),
+ pjq("td[id$=tab3:header:active]"), pjq("td[id$=tab4:header:active]"), pjq("td[id$=tab5:header:active]") };
+ private JQueryLocator[] inactiveHeaders = { pjq("td[id$=tab1:header:inactive]"),
+ pjq("td[id$=tab2:header:inactive]"), pjq("td[id$=tab3:header:inactive]"), pjq("td[id$=tab4:header:inactive]"),
+ pjq("td[id$=tab5:header:inactive]") };
+ private JQueryLocator[] disabledHeaders = { pjq("td[id$=tab1:header:disabled]"),
+ pjq("td[id$=tab2:header:disabled]"), pjq("td[id$=tab3:header:disabled]"), pjq("td[id$=tab4:header:disabled]"),
+ pjq("td[id$=tab5:header:disabled]") };
@Override
public URL getTestUrl() {
@@ -70,43 +73,52 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11550")
public void testHeaderAlignment() {
JQueryLocator spaceLeft = jq(panel.getRawLocator() + " *.rf-tab-hdr-spcr:eq(0)");
JQueryLocator spaceRight = jq(panel.getRawLocator() + " *.rf-tab-hdr-spcr:eq(6)");
-
- assertEquals(selenium.getStyle(spaceLeft, CssProperty.WIDTH), "0px", "The header should be aligned to the left, but it isn't.");
- assertTrue(Integer.parseInt(selenium.getStyle(spaceRight, CssProperty.WIDTH).replace("px", "")) > 100, "The header should be aligned to the left, but it isn't.");
-
+
+ assertEquals(selenium.getStyle(spaceLeft, CssProperty.WIDTH), "0px",
+ "The header should be aligned to the left, but it isn't.");
+ assertTrue(Integer.parseInt(selenium.getStyle(spaceRight, CssProperty.WIDTH).replace("px", "")) > 100,
+ "The header should be aligned to the left, but it isn't.");
+
selenium.click(pjq("input[name$=headerAlignmentInput][value=left]"));
selenium.waitForPageToLoad();
-
- assertEquals(selenium.getStyle(spaceLeft, CssProperty.WIDTH), "0px", "The header should be aligned to the left, but it isn't.");
- assertTrue(Integer.parseInt(selenium.getStyle(spaceRight, CssProperty.WIDTH).replace("px", "")) > 100, "The header should be aligned to the left, but it isn't.");
-
+
+ assertEquals(selenium.getStyle(spaceLeft, CssProperty.WIDTH), "0px",
+ "The header should be aligned to the left, but it isn't.");
+ assertTrue(Integer.parseInt(selenium.getStyle(spaceRight, CssProperty.WIDTH).replace("px", "")) > 100,
+ "The header should be aligned to the left, but it isn't.");
+
selenium.click(pjq("input[name$=headerAlignmentInput][value=right]"));
selenium.waitForPageToLoad();
-
- assertTrue(Integer.parseInt(selenium.getStyle(spaceLeft, CssProperty.WIDTH).replace("px", "")) > 100, "The header should be aligned to the right, but it isn't.");
- assertEquals(selenium.getStyle(spaceRight, CssProperty.WIDTH), "0px", "The header should be aligned to the right, but it isn't.");
+
+ assertTrue(Integer.parseInt(selenium.getStyle(spaceLeft, CssProperty.WIDTH).replace("px", "")) > 100,
+ "The header should be aligned to the right, but it isn't.");
+ assertEquals(selenium.getStyle(spaceRight, CssProperty.WIDTH), "0px",
+ "The header should be aligned to the right, but it isn't.");
}
-
+
@Test
public void testHeaderPosition() {
selenium.click(pjq("input[name$=headerPositionInput][value=bottom]"));
- selenium.waitForPageToLoad();
-
- JQueryLocator bottomVersion = jq(panel.getRawLocator() + " *.rf-tab-hdr-tabline-btm-vis");
- JQueryLocator topVersion = jq(panel.getRawLocator() + " *.rf-tab-hdr-tabline-top-vis");
+ selenium.waitForPageToLoad();
+ JQueryLocator bottomVersion = jq(panel.getRawLocator() + " .rf-tab-hdr-tabline-vis.rf-tab-hdr-tabline-btm");
+ JQueryLocator topVersion = jq(panel.getRawLocator() + " .rf-tab-hdr-tabline-vis.rf-tab-hdr-tabline-top");
+
selenium.click(pjq("input[name$=headerPositionInput][value=top]"));
- selenium.waitForPageToLoad();
- assertTrue(selenium.isElementPresent(topVersion), "The header should be placed on the top position (" + topVersion.getRawLocator() +")");
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.isElementPresent(topVersion), "The header should be placed on the top position ("
+ + topVersion.getRawLocator() + ")");
selenium.click(pjq("input[name$=headerPositionInput][value=bottom]"));
- selenium.waitForPageToLoad();
- assertTrue(selenium.isElementPresent(bottomVersion), "The header should be placed on the bottom position (" + bottomVersion.getRawLocator() +")");
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.isElementPresent(bottomVersion), "The header should be placed on the bottom position ("
+ + bottomVersion.getRawLocator() + ")");
}
-
+
@Test
public void testInit() {
boolean displayed = selenium.isDisplayed(panel);
@@ -240,7 +252,8 @@
guardXhr(selenium).click(inactiveHeaders[1]);
waitGui.failWith("Tab 2 is not displayed.").until(isDisplayed.locator(itemContents[1]));
- waitGui.failWith("onbeforeitemchange attribute does not work correctly").until(new EventFiredCondition(new Event("beforeitemchange")));
+ waitGui.failWith("onbeforeitemchange attribute does not work correctly").until(
+ new EventFiredCondition(new Event("beforeitemchange")));
}
@Test
@@ -282,7 +295,8 @@
guardXhr(selenium).click(inactiveHeaders[1]);
waitGui.failWith("Tab 2 is not displayed.").until(isDisplayed.locator(itemContents[1]));
- waitGui.failWith("onitemchange attribute does not work correctly").until(new EventFiredCondition(new Event("itemchange")));
+ waitGui.failWith("onitemchange attribute does not work correctly").until(
+ new EventFiredCondition(new Event("itemchange")));
}
@Test
@@ -333,7 +347,8 @@
for (int i = 2; i >= 0; i--) {
final int index = i;
guardXhr(selenium).click(inactiveHeaders[index]);
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(isDisplayed.locator(itemContents[index]));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContents[index]));
}
}
@@ -353,7 +368,8 @@
for (int i = 2; i >= 0; i--) {
final int index = i;
guardNoRequest(selenium).click(inactiveHeaders[index]);
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(isDisplayed.locator(itemContents[index]));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContents[index]));
}
}
@@ -366,7 +382,8 @@
for (int i = 2; i >= 0; i--) {
final int index = i;
guardHttp(selenium).click(inactiveHeaders[index]);
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(isDisplayed.locator(itemContents[index]));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContents[index]));
}
}
@@ -419,7 +436,7 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-9309")
+ @IssueTracking({ "https://issues.jboss.org/browse/RF-9309", "https://issues.jboss.org/browse/RF-11549" })
public void testTabHeaderClass() {
selenium.type(pjq("input[id$=tabHeaderClassInput]"), "metamer-ftest-class");
selenium.waitForPageToLoad();
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -41,83 +41,82 @@
* @version $Revision$
*/
public class TestRichTabPanelAddPanel1 extends AbstractMetamerTest {
-
+
private static final String SWITCH_TYPE_CLIENT = "client";
private static final String SWITCH_TYPE_SERVER = "server";
private static final String SWITCH_TYPE_AJAX = "ajax";
-
+
private static final int MAX_NEW_TAB_COUNT = 3;
private static final int STATIC_TAB_COUNT = 5;
-
+
private JQueryLocator itemContentsFormat = pjq("div[id$=tab{0}:content]");
-
+
private JQueryLocator inactiveHeadersFormat = pjq("td[id$=tab{0}:header:inactive]");
-
+
private JQueryLocator hCreateTabBtn = pjq("input[id$=hCreateTabButton]");
private JQueryLocator a4jCreateTabBtn = pjq("input[id$=a4jCreateTabButton]");
-
+
private JQueryLocator tabsCount = pjq("table.rf-tab-hdr-tabs td.rf-tab-hdr-inact");
-
+
private JQueryLocator switchTypeFormat = pjq("input[name$=switchTypeInput][value={0}]");
-
+
private JQueryLocator tabCloseFormat = pjq("td[id$=tab{0}:header:inactive] span.rf-tab-lbl > a");
-
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richTabPanel/addTab2.xhtml");
}
-
+
/**
* Simple create new tab (without tab switch)
+ *
* @param addTabBtn
*/
private void verifyCreateTab(JQueryLocator addTabBtn) {
-
+
int baseTabsCount = selenium.getCount(tabsCount);
-
+
// add 3 new tabs
for (int i = 1; i <= MAX_NEW_TAB_COUNT; ++i) {
selenium.click(addTabBtn);
waitGui.until(countEquals.count(baseTabsCount + i).locator(tabsCount));
}
}
-
+
/**
- * Simple test to tab delete. Create 3 new tabs and then delete them.
- * Without tab switch.
+ * Simple test to tab delete. Create 3 new tabs and then delete them. Without tab switch.
*/
private void verifyDeleteTab() {
verifyCreateTab(a4jCreateTabBtn);
-
+
int baseTabsCount = selenium.getCount(tabsCount);
System.out.println(baseTabsCount);
for (int i = 0; i < MAX_NEW_TAB_COUNT; ++i) {
- waitGui.until(elementPresent.locator(inactiveHeadersFormat.format(
- STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - i)));
+ waitGui
+ .until(elementPresent.locator(inactiveHeadersFormat.format(STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - i)));
selenium.fireEvent(tabCloseFormat.format(STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - i), Event.CLICK);
System.out.println(selenium.getCount(tabsCount));
waitGui.until(countEquals.count(baseTabsCount - 1 - i).locator(tabsCount));
}
}
-
+
private void verifyContentOfNewTab(JQueryLocator addTabBtn) {
-
+
verifyCreateTab(addTabBtn);
-
- // tab switch work at least with "client" option
+
+ // tab switch work at least with "client" option
selenium.click(switchTypeFormat.format(SWITCH_TYPE_CLIENT));
-
+
System.out.println("testSwitchTypeAjax: tab count: " + selenium.getCount(tabsCount));
-
+
for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT; i--) {
selenium.click(inactiveHeadersFormat.format(i + 1));
- waitGui.failWith("Tab " + (i + 1) + " doesn't display correct content.")
- .until(textEquals.text("Content of dynamicaly created tab" + (i + 1))
+ waitGui.failWith("Tab " + (i + 1) + " doesn't display correct content.").until(
+ textEquals.text("Content of dynamicaly created tab" + (i + 1))
.locator(itemContentsFormat.format(i + 1)));
}
}
-
-
+
/**
* Create new tab by clicking on h:commandButton
*/
@@ -125,7 +124,7 @@
public void testCreateTabJSF() {
verifyCreateTab(hCreateTabBtn);
}
-
+
/**
* Create new tab by clicking on a4j:commandButton
*/
@@ -133,7 +132,7 @@
public void testCreateTabAjax() {
verifyCreateTab(a4jCreateTabBtn);
}
-
+
/**
* Delete newly created tabs
*/
@@ -141,7 +140,7 @@
public void testRemoveTab() {
verifyDeleteTab();
}
-
+
/**
* Verify that all tabs displays correct content when switch tab
*/
@@ -149,34 +148,31 @@
public void testContentOfDynamicTab() {
verifyContentOfNewTab(hCreateTabBtn);
}
-
- /*
- * Test plan:
- * 1. click on 'create tab' btn 3 time and verify that new tabs appeared
- * 2. verify that switch between newly created tabs still works as in previous tabs (staticaly created)
- * 3. verify a4j ajax btn to create new tabs
+
+ /**
+ * Test plan: 1. click on 'create tab' btn 3 time and verify that new tabs appeared 2. verify that switch between
+ * newly created tabs still works as in previous tabs (staticaly created) 3. verify a4j ajax btn to create new tabs
*/
-
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-11081")
public void testSwitchTypeNull() {
-
+
verifyCreateTab(hCreateTabBtn);
-
+
for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT; i--) {
final int index = i;
guardXhr(selenium).click(inactiveHeadersFormat.format(index + 1));
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.")
- .until(isDisplayed.locator(itemContentsFormat.format(index + 1)));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContentsFormat.format(index + 1)));
}
}
- @Test
+ @Test(groups = { "4.Future" })
@IssueTracking("https://issues.jboss.org/browse/RF-11081")
public void testSwitchTypeAjax() {
-
+
verifyCreateTab(hCreateTabBtn);
-
+
selenium.click(switchTypeFormat.format(SWITCH_TYPE_AJAX));
selenium.waitForPageToLoad();
@@ -185,34 +181,34 @@
@Test
public void testSwitchTypeClient() {
-
+
verifyCreateTab(hCreateTabBtn);
-
+
selenium.click(switchTypeFormat.format(SWITCH_TYPE_CLIENT));
selenium.waitForPageToLoad();
-
+
for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT; i--) {
final int index = i;
guardNoRequest(selenium).click(inactiveHeadersFormat.format(index + 1));
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.")
- .until(isDisplayed.locator(itemContentsFormat.format(index + 1)));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContentsFormat.format(index + 1)));
}
}
-
+
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11054")
public void testSwitchTypeServer() {
-
+
verifyCreateTab(hCreateTabBtn);
-
+
selenium.click(switchTypeFormat.format(SWITCH_TYPE_SERVER));
selenium.waitForPageToLoad();
-
+
for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT; i--) {
final int index = i;
guardHttp(selenium).click(inactiveHeadersFormat.format(index + 1));
- waitGui.failWith("Tab " + (index + 1) + " is not displayed.")
- .until(isDisplayed.locator(itemContentsFormat.format(index + 1)));
+ waitGui.failWith("Tab " + (index + 1) + " is not displayed.").until(
+ isDisplayed.locator(itemContentsFormat.format(index + 1)));
}
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -36,18 +36,18 @@
/**
* Test for @target attribute on page faces/components/richTooltip/targetting.xhtml
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- *
+ *
* @version $Revision$
*/
public class TestTooltipTarget extends AbstractMetamerTest {
-
+
// private TooltipAttributes attributes = new TooltipAttributes();
private JQueryLocator panel1 = pjq("div[id$=regular-div]");
private JQueryLocator panel2 = pjq("div[id$=jsf-div]");
private JQueryLocator panel3 = pjq("div[id$=panel_body]");
-
+
TooltipModel tooltip1 = new TooltipModel(jq(".rf-tt"), panel1);
TooltipModel tooltip2 = new TooltipModel(jq(".rf-tt"), panel2);
TooltipModel tooltip3 = new TooltipModel(jq(".rf-tt"), panel3);
@@ -56,7 +56,7 @@
public URL getTestUrl() {
return URLUtils.buildUrl(contextPath, "faces/components/richTooltip/targetting.xhtml");
}
-
+
@BeforeMethod
public void setupAttributes() {
tooltipAttributes.set(showEvent, "mouseover");
@@ -66,19 +66,22 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11370")
public void testTarget() {
- // 1. first target
- tooltipAttributes.set(target, "regular-div");
- tooltip1.recall();
- waitGui.until(isDisplayed.locator(tooltip1));
-
// 2. target
- tooltipAttributes.set(target, "form:jsf-div");
+ tooltipAttributes.set(target, "jsf-div");
tooltip2.recall();
waitGui.until(isDisplayed.locator(tooltip2));
-
+
// 3. default target
- tooltipAttributes.set(target, "form:panel");
+ tooltipAttributes.set(target, "panel");
tooltip3.recall();
waitGui.until(isDisplayed.locator(tooltip3));
}
+
+ @Test(groups = { "4.2" })
+ @IssueTracking("https://issues.jboss.org/browse/RF-11370")
+ public void testTargetWithRegularDiv() {
+ tooltipAttributes.set(target, "regular-div");
+ tooltip1.recall();
+ waitGui.until(isDisplayed.locator(tooltip1));
+ }
}
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -63,6 +63,8 @@
import org.jboss.cheiron.halt.XHRHalter;
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
@@ -80,9 +82,9 @@
* @version $Revision$
*/
public class TestTreeSimple extends AbstractMetamerTest {
-
+
private static final String IMAGE_URL = "/resources/images/loading.gif";
-
+
SeleniumCondition treeNodeExpanded = new SeleniumCondition() {
@Override
@@ -94,12 +96,12 @@
@Inject
@Use(empty = true)
Event eventToFire;
- Event[] eventsToFire = new Event[] {MOUSEDOWN, MOUSEUP, MOUSEOVER, MOUSEOUT};
+ Event[] eventsToFire = new Event[] { MOUSEDOWN, MOUSEUP, MOUSEOVER, MOUSEOUT };
@Inject
@Use(empty = true)
Event domEvent;
- Event[] domEvents = {CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP};
+ Event[] domEvents = { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
TreeNodeModel treeNode;
@@ -139,19 +141,37 @@
@Test
public void testHandleClass() {
expandAll();
- super.testStyleClass(tree.getAnyNode().getHandle(), handleClass);
+
+ final String value = "metamer-ftest-class";
+ selenium.type(jq("input[id$=attributes:handleClassInput]"), value);
+ selenium.waitForPageToLoad();
+ AttributeLocator<?> styleAttr = tree.getAnyNode().getHandle().getAttribute(Attribute.CLASS);
+ assertTrue(selenium.getAttribute(styleAttr).contains(value), "Attribute handleClass should contain \"" + value
+ + "\"");
}
@Test
public void testIconClass() {
expandAll();
- super.testStyleClass(tree.getAnyNode().getIcon(), iconClass);
+
+ final String value = "metamer-ftest-class";
+ selenium.type(jq("input[id$=attributes:iconClassInput]"), value);
+ selenium.waitForPageToLoad();
+ AttributeLocator<?> styleAttr = tree.getAnyNode().getIcon().getAttribute(Attribute.CLASS);
+ assertTrue(selenium.getAttribute(styleAttr).contains(value), "Attribute iconClass should contain \"" + value
+ + "\"");
}
@Test
public void testLabelClass() {
expandAll();
- super.testStyleClass(tree.getAnyNode().getLabel(), labelClass);
+
+ final String value = "metamer-ftest-class";
+ selenium.type(jq("input[id$=attributes:labelClassInput]"), value);
+ selenium.waitForPageToLoad();
+ AttributeLocator<?> styleAttr = tree.getAnyNode().getLabel().getAttribute(Attribute.CLASS);
+ assertTrue(selenium.getAttribute(styleAttr).contains(value), "Attribute labelClass should contain \"" + value
+ + "\"");
}
@Test
@@ -287,12 +307,20 @@
@Test
public void testStyle() {
- this.testStyle(tree);
+ final String value = "background-color: yellow; font-size: 1.5em;";
+ selenium.type(jq("input[id$=attributes:styleInput]"), value);
+ selenium.waitForPageToLoad();
+ AttributeLocator<?> styleAttr = tree.getAttribute(Attribute.STYLE);
+ assertTrue(selenium.getAttribute(styleAttr).contains(value), "Attribute style should contain \"" + value + "\"");
}
@Test
public void testStyleClass() {
- this.testStyleClass(tree);
+ final String value = "metamer-ftest-class";
+ selenium.type(jq("input[id$=attributes:styleClassInput]"), value);
+ selenium.waitForPageToLoad();
+ AttributeLocator<?> styleAttr = tree.getAttribute(Attribute.CLASS);
+ assertTrue(selenium.getAttribute(styleAttr).contains(value), "Attribute class should contain \"" + value + "\"");
}
@Test
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -59,7 +59,7 @@
private boolean recursiveLeafChildrenNullable;
public URL getTestUrl() {
- return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
+ return buildUrl(contextPath, "faces/components/richTree/treeAdaptors.xhtml");
}
@BeforeMethod
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorToggling.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -63,7 +63,7 @@
}
public URL getTestUrl() {
- return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/treeAdaptors.xhtml");
+ return buildUrl(contextPath, "faces/components/richTree/treeAdaptors.xhtml");
}
@Test
Modified: modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
===================================================================
--- modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-10-19 13:04:51 UTC (rev 22826)
+++ modules/tests/metamer/branches/wfk2-product-branch/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-10-19 13:49:01 UTC (rev 22827)
@@ -36,6 +36,7 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.basicAttributes;
import static org.richfaces.tests.metamer.ftest.richTreeNode.TreeNodeAttributes.*;
import java.net.URL;
@@ -44,6 +45,7 @@
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.geometry.Point;
+import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.waiting.EventFiredCondition;
@@ -70,29 +72,29 @@
private static final String IMAGE_URL = "/resources/images/loading.gif";
Attributes<TreeAttributes> attributesTree = new Attributes<TreeAttributes>(jq("span[id$=attributes:panel]"));
- Attributes<TreeNodeAttributes> attributes = new Attributes<TreeNodeAttributes>(jq("span[id$=treeNode1Attributes:panel]"));
- Attributes<TreeNodeAttributes> attributesLeaf = new Attributes<TreeNodeAttributes>(jq("span[id$=treeNode3Attributes:panel]"));
+ Attributes<TreeNodeAttributes> attributes = new Attributes<TreeNodeAttributes>(
+ jq("span[id$=treeNode1Attributes:panel]"));
+ Attributes<TreeNodeAttributes> attributesLeaf = new Attributes<TreeNodeAttributes>(
+ jq("span[id$=treeNode3Attributes:panel]"));
TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
TreeNodeModel treeNode = tree.getNode(1);
TreeNodeModel subTreeNode = treeNode.getNode(1);
TreeNodeModel leaf = subTreeNode.getNode(1);
-
+
ElementLocator<?> iconImage = treeNode.getIcon();
AttributeLocator<?> imageSrc = iconImage.getAttribute(SRC);
AttributeRetriever retrieveImageSrc = retrieveAttribute.attributeLocator(imageSrc);
-
@Inject
@Use(empty = true)
Event event = CLICK;
- Event[] events = new Event[] {CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT,
- MOUSEOVER, MOUSEUP };
+ Event[] events = new Event[] { CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
@Inject
@Use(empty = true)
SwitchType toggleType;
- SwitchType[] toggleTypes = new SwitchType[] {SwitchType.ajax, SwitchType.server };
+ SwitchType[] toggleTypes = new SwitchType[] { SwitchType.ajax, SwitchType.server };
@BeforeMethod
public void init() {
@@ -261,12 +263,20 @@
@Test
public void testStyle() {
- super.testStyle(treeNode.getTreeNode());
+ final String value = "background-color: yellow; font-size: 1.5em;";
+ selenium.type(jq("input[id$=treeNode1Attributes:styleInput]"), value);
+ selenium.waitForPageToLoad();
+ AttributeLocator<?> styleAttr = treeNode.getTreeNode().getAttribute(Attribute.STYLE);
+ assertTrue(selenium.getAttribute(styleAttr).contains(value), "Attribute style should contain \"" + value + "\"");
}
@Test
public void testStyleClass() {
- super.testStyleClass(treeNode.getTreeNode());
+ final String value = "metamer-ftest-class";
+ selenium.type(jq("input[id$=treeNode1Attributes:styleClassInput]"), value);
+ selenium.waitForPageToLoad();
+ AttributeLocator<?> styleAttr = treeNode.getTreeNode().getAttribute(Attribute.CLASS);
+ assertTrue(selenium.getAttribute(styleAttr).contains(value), "Attribute class should contain \"" + value + "\"");
}
@Test
13 years, 2 months
JBoss Rich Faces SVN: r22826 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richDataTable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-10-19 09:04:51 -0400 (Wed, 19 Oct 2011)
New Revision: 22826
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingComponentControl.java
Log:
added issue tracking info
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-10-19 13:04:06 UTC (rev 22825)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-10-19 13:04:51 UTC (rev 22826)
@@ -319,6 +319,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11568")
public void testToggleListener() {
String reqTime = selenium.getText(time);
guardXhr(selenium).click(header);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingComponentControl.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingComponentControl.java 2011-10-19 13:04:06 UTC (rev 22825)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataTable/TestDataTableSortingUsingComponentControl.java 2011-10-19 13:04:51 UTC (rev 22826)
@@ -65,7 +65,7 @@
super.testSortModeSingleDoesntRememberOrder();
}
- @Test
+ @Test(groups = { "4.Future" })
@Override
@IssueTracking({ "https://issues.jboss.org/browse/RF-9932",
"http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790" })
@@ -97,7 +97,7 @@
super.testSortModeMultiReplacingOldOccurences();
}
- @Test
+ @Test(groups = { "4.Future" })
@Override
@IssueTracking({ "https://issues.jboss.org/browse/RF-9932",
"http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790" })
13 years, 2 months
JBoss Rich Faces SVN: r22825 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-10-19 09:04:06 -0400 (Wed, 19 Oct 2011)
New Revision: 22825
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java
Log:
sample for rich:tab fixed
added test for rich:tab's attribute action
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java 2011-10-19 11:26:07 UTC (rev 22824)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java 2011-10-19 13:04:06 UTC (rev 22825)
@@ -34,7 +34,7 @@
/**
* Managed bean for rich:tab.
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@@ -61,6 +61,8 @@
attributes.setAttribute("rendered", true);
// will be tested in another way
+ attributes.remove("action");
+ attributes.remove("actionListener");
attributes.remove("converter");
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java 2011-10-19 11:26:07 UTC (rev 22824)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTab/TestRichTab.java 2011-10-19 13:04:06 UTC (rev 22825)
@@ -52,7 +52,8 @@
public class TestRichTab extends AbstractMetamerTest {
private static final JQueryLocator PHASE_FORMAT = jq("div#phasesPanel li:eq({0})");
- private static final String PHASE_LISTENER_LOG = "* action listener invoked";
+ private static final String ACTION_LOG = "* action invoked";
+ private static final String ACTION_LISTENER_LOG = "* action listener invoked";
private JQueryLocator panel = pjq("div[id$=tabPanel]");
private JQueryLocator[] itemContents = { pjq("div[id$=tab1] > div.rf-tab-cnt"),
@@ -75,6 +76,22 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11427")
+ public void testAction() {
+ retrieveRequestTime.initializeValue();
+ selenium.click(pjq("input[id$=nextTabButton]"));
+ waitAjax.waitForChange(retrieveRequestTime);
+
+ retrieveRequestTime.initializeValue();
+ selenium.click(pjq("input[id$=prevTabButton]"));
+ waitAjax.waitForChange(retrieveRequestTime);
+
+ waitGui.failWith(
+ "Expected <" + ACTION_LOG + ">, found <" + selenium.getText(PHASE_FORMAT.format(6)) + ">").until(
+ textEquals.locator(PHASE_FORMAT.format(6)).text(ACTION_LOG));
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-11427")
public void testActionListener() {
retrieveRequestTime.initializeValue();
selenium.click(pjq("input[id$=nextTabButton]"));
@@ -85,8 +102,8 @@
waitAjax.waitForChange(retrieveRequestTime);
waitGui.failWith(
- "Expected <" + PHASE_LISTENER_LOG + ">, found <" + selenium.getText(PHASE_FORMAT.format(5)) + ">").until(
- textEquals.locator(PHASE_FORMAT.format(5)).text(PHASE_LISTENER_LOG));
+ "Expected <" + ACTION_LISTENER_LOG + ">, found <" + selenium.getText(PHASE_FORMAT.format(5)) + ">").until(
+ textEquals.locator(PHASE_FORMAT.format(5)).text(ACTION_LISTENER_LOG));
}
@Test
13 years, 2 months
JBoss Rich Faces SVN: r22824 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-10-19 07:26:07 -0400 (Wed, 19 Oct 2011)
New Revision: 22824
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
Log:
test for column sorting fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-10-19 09:56:25 UTC (rev 22823)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-10-19 11:26:07 UTC (rev 22824)
@@ -42,9 +42,9 @@
@Inject
@Use(enumeration = true)
SortOrder sortOrder;
-
+
public void testSortingWithSortOrder() {
- columnAttributes.set(ColumnAttributes.requestType, RequestType.XHR);
+ columnAttributes.setRequestType(RequestType.XHR);
columnAttributes.set(ColumnAttributes.sortOrder, sortOrder);
switch (sortOrder) {
@@ -54,7 +54,7 @@
case descending:
Collections.sort(capitals, Collections.reverseOrder(RichColumnBean.STATE_NAME_LENGTH_COMPARATOR));
break;
-
+
default:
// default case required by checkstyle
break;
13 years, 2 months