You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/11/11 16:49:44 UTC
svn commit: r1769312 - in
/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main:
java/org/apache/myfaces/tobago/example/demo/
webapp/content/40-test/6000-event/ webapp/script/ webapp/style/
Author: lofwyr
Date: Fri Nov 11 16:49:44 2016
New Revision: 1769312
URL: http://svn.apache.org/viewvc?rev=1769312&view=rev
Log:
TOBAGO-1617 New tag <tc:event> to be similar to <f:ajax> and to replace <tc:command> in facets
* small amount of tests added to <tc:event> and <f:ajax> on components
[developed by hnoeth]
Added:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-bar.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-button.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-component-content.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-in.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-row.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-textarea.xhtml
Removed:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event-input.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/progress.xhtml
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.xhtml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/tobago.css
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java?rev=1769312&r1=1769311&r2=1769312&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java Fri Nov 11 16:49:44 2016
@@ -19,6 +19,11 @@
package org.apache.myfaces.tobago.example.demo;
+import org.apache.myfaces.tobago.component.UIBar;
+import org.apache.myfaces.tobago.component.UIButton;
+import org.apache.myfaces.tobago.component.UIIn;
+import org.apache.myfaces.tobago.component.UIRow;
+import org.apache.myfaces.tobago.component.UITextarea;
import org.apache.myfaces.tobago.example.data.SolarObject;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -26,17 +31,23 @@ import javax.enterprise.context.SessionS
import javax.faces.component.UIData;
import javax.faces.event.ActionEvent;
import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.event.FacesEvent;
import javax.faces.event.ValueChangeEvent;
import javax.inject.Named;
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Date;
import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
@SessionScoped
@Named
public class EventController implements Serializable {
+ private List<EventsOnComponent> eventsOnComponents = new ArrayList<EventsOnComponent>();
+ private EventsOnComponent selectedComponent;
private int action = 0;
private int actionListener = 0;
private int ajaxListener = 0;
@@ -45,6 +56,12 @@ public class EventController implements
private String selectedPlanet;
public EventController() {
+ eventsOnComponents.add(new EventsOnComponent("bar", new UIBar().getEventNames()));
+ eventsOnComponents.add(new EventsOnComponent("button", new UIButton().getEventNames()));
+ eventsOnComponents.add(new EventsOnComponent("in", new UIIn().getEventNames()));
+ eventsOnComponents.add(new EventsOnComponent("row", new UIRow().getEventNames()));
+ eventsOnComponents.add(new EventsOnComponent("textarea", new UITextarea().getEventNames()));
+
planets.add(new SolarObject("Mercury", "I", "Sun", 57910, 87.97, 7.00, 0.21, "-", null));
planets.add(new SolarObject("Venus", "II", "Sun", 108200, 224.70, 3.39, 0.01, "-", null));
planets.add(new SolarObject("Earth", "III", "Sun", 149600, 365.26, 0.00, 0.02, "-", null));
@@ -63,6 +80,23 @@ public class EventController implements
selectedPlanet = null;
}
+ public List<EventsOnComponent> getEventsOnComponents() {
+ return eventsOnComponents;
+ }
+
+ public EventsOnComponent getSelectedComponent() {
+ return selectedComponent;
+ }
+
+ public void setSelectedComponent(EventsOnComponent selectedComponent) {
+ this.selectedComponent = selectedComponent;
+ }
+
+ public void selectComponent(final ActionEvent actionEvent) {
+ final UIData data = ComponentUtils.findAncestor(actionEvent.getComponent(), UIData.class);
+ selectedComponent = data != null ? ((EventsOnComponent) data.getRowData()) : null;
+ }
+
public void action() {
action++;
}
@@ -111,8 +145,116 @@ public class EventController implements
this.selectedPlanet = selectedPlanet;
}
- public void selectPlanet(final ActionEvent actionEvent) {
+ public void selectPlanet(final FacesEvent actionEvent) {
final UIData data = ComponentUtils.findAncestor(actionEvent.getComponent(), UIData.class);
selectedPlanet = data != null ? ((SolarObject) data.getRowData()).getName() : null;
}
+
+ public class EventsOnComponent {
+ private String tagName;
+ private Set<String> eventNames = new TreeSet<String>();
+
+ public EventsOnComponent(String tagName, Collection<String> eventNames) {
+ this.tagName = tagName;
+ if (eventNames != null) {
+ this.eventNames.addAll(eventNames);
+ }
+ }
+
+ public String getTagName() {
+ return tagName;
+ }
+
+ public Set<String> getEventNames() {
+ return eventNames;
+ }
+
+ public String getChangeEvent() {
+ return getCommonEventString(CommonEvent.change);
+ }
+
+ public String getClickEvents() {
+ return getCommonEventString(CommonEvent.click, CommonEvent.dblclick);
+ }
+
+ public String getFocusEvents() {
+ return getCommonEventString(CommonEvent.focus, CommonEvent.blur);
+ }
+
+ public String getKeyEvents() {
+ return getCommonEventString(CommonEvent.keydown, CommonEvent.keypress, CommonEvent.keyup);
+ }
+
+ public String getMouseEvents() {
+ return getCommonEventString(CommonEvent.mousedown, CommonEvent.mousemove, CommonEvent.mouseout,
+ CommonEvent.mouseover, CommonEvent.mouseup);
+ }
+
+ public String getSelectEvent() {
+ return getCommonEventString(CommonEvent.select);
+ }
+
+ private String getCommonEventString(CommonEvent... commonEvents) {
+ boolean allTrue = true;
+ boolean allFalse = true;
+
+ for (CommonEvent commonEvent : commonEvents) {
+ if (eventNames.contains(commonEvent.name())) {
+ allFalse = false;
+ } else {
+ allTrue = false;
+ }
+ }
+
+ if (allTrue) {
+ return "x";
+ } else if (allFalse) {
+ return "-";
+ } else {
+ return concatStrings(eventNames);
+ }
+ }
+
+ public String getSpecialEvents() {
+ Set<String> specialEventNames = new TreeSet<String>();
+
+ for (String eventName : eventNames) {
+ boolean isSpecialEvent = true;
+ for (CommonEvent commonEvent : CommonEvent.values()) {
+ if (eventName.equals(commonEvent.name())) {
+ isSpecialEvent = false;
+ }
+ }
+
+ if (isSpecialEvent) {
+ specialEventNames.add(eventName);
+ }
+ }
+
+ return specialEventNames.size() > 0 ? concatStrings(specialEventNames) : "";
+ }
+
+ private String concatStrings(Set<String> strings) {
+ StringBuilder stringBuilder = new StringBuilder();
+
+ int i = 0;
+ for (String string : strings) {
+ i++;
+ stringBuilder.append(string);
+ if (i < strings.size()) {
+ stringBuilder.append(", ");
+ }
+ }
+ return stringBuilder.toString();
+ }
+ }
+
+ private enum CommonEvent {
+ change,
+ click, dblclick,
+ focus, blur,
+ keydown, keypress, keyup,
+ mousedown, mousemove, mouseout, mouseover, mouseup,
+ select
+ }
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.test.js?rev=1769312&r1=1769311&r2=1769312&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.test.js Fri Nov 11 16:49:44 2016
@@ -15,330 +15,321 @@
* limitations under the License.
*/
-QUnit.test("tc:in tc:event - change", function(assert) {
- assert.expect(4);
- var done = assert.async();
-
- var oldActionCount = getActionCount();
- var oldActionListenerCount = getActionListenerCount();
- var oldAjaxListenerCount = getAjaxListenerCount();
- var oldValueChangeListenerCount = getValueChangeListenerCount();
-
- var $inputField = jQueryFrame("#page\\:mainForm\\:inEventChange\\:\\:field");
- var newValue = "hello";
- if (newValue == $inputField.val()) {
- newValue = "hi there";
- }
- $inputField.val(newValue).trigger("change");
+QUnit.test("tc:button tc:event - blur", function(assert) {
+ testButtonEvent(assert, "blur");
+});
- jQuery("#page\\:testframe").load(function() {
- var newActionCount = getActionCount();
- var newActionListenerCount = getActionListenerCount();
- var newAjaxListenerCount = getAjaxListenerCount();
- var newValueChangeListenerCount = getValueChangeListenerCount();
+QUnit.test("tc:button tc:event - click", function(assert) {
+ testButtonEvent(assert, "click");
+});
- assert.ok(newActionCount > oldActionCount);
- assert.ok(newActionListenerCount > oldActionListenerCount);
- assert.ok(newAjaxListenerCount == oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount > oldValueChangeListenerCount);
+QUnit.test("tc:button tc:event - dblclick", function(assert) {
+ testButtonEvent(assert, "dblclick");
+});
- done();
- });
+QUnit.test("tc:button tc:event - focus", function(assert) {
+ testButtonEvent(assert, "focus");
});
-QUnit.test("tc:in tc:event - click", function(assert) {
- assert.expect(4);
- var done = assert.async();
+QUnit.test("tc:button f:ajax - blur", function(assert) {
+ testButtonAjax(assert, "blur");
+});
- var oldActionCount = getActionCount();
- var oldActionListenerCount = getActionListenerCount();
- var oldAjaxListenerCount = getAjaxListenerCount();
- var oldValueChangeListenerCount = getValueChangeListenerCount();
+QUnit.test("tc:button f:ajax - click", function(assert) {
+ testButtonAjax(assert, "click");
+});
- var $inputField = jQueryFrame("#page\\:mainForm\\:inEventClick\\:\\:field");
- $inputField.trigger("click");
+QUnit.test("tc:button f:ajax - dblclick", function(assert) {
+ testButtonAjax(assert, "dblclick");
+});
- jQuery("#page\\:testframe").load(function() {
- var newActionCount = getActionCount();
- var newActionListenerCount = getActionListenerCount();
- var newAjaxListenerCount = getAjaxListenerCount();
- var newValueChangeListenerCount = getValueChangeListenerCount();
+QUnit.test("tc:button f:ajax - focus", function(assert) {
+ testButtonAjax(assert, "focus");
+});
- assert.ok(newActionCount > oldActionCount);
- assert.ok(newActionListenerCount > oldActionListenerCount);
- assert.ok(newAjaxListenerCount == oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount == oldValueChangeListenerCount);
+QUnit.test("tc:in tc:event - blur", function(assert) {
+ testInEvent(assert, "blur");
+});
- done();
- });
+QUnit.test("tc:in tc:event - change", function(assert) {
+ testInEvent(assert, "change");
});
-QUnit.test("tc:in tc:event - change + click", function(assert) {
- assert.expect(8);
- var done = assert.async(2);
- var step = 1;
-
- var oldActionCount = getActionCount();
- var oldActionListenerCount = getActionListenerCount();
- var oldAjaxListenerCount = getAjaxListenerCount();
- var oldValueChangeListenerCount = getValueChangeListenerCount();
- var newActionCount;
- var newActionListenerCount;
- var newAjaxListenerCount;
- var newValueChangeListenerCount;
-
- var $inputField = jQueryFrame("#page\\:mainForm\\:inEventChangeClick\\:\\:field");
- $inputField.trigger("click");
-
- jQuery("#page\\:testframe").load(function() {
- if (step == 1) {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
-
- assert.ok(newActionCount > oldActionCount);
- assert.ok(newActionListenerCount > oldActionListenerCount);
- assert.ok(newAjaxListenerCount == oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount == oldValueChangeListenerCount);
-
- $inputField = jQueryFrame($inputField.selector);
- var newValue = "hello";
- if (newValue == $inputField.val()) {
- newValue = "hi there";
- }
- $inputField.val(newValue).trigger("change");
- } else if (step == 2) {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
-
- assert.ok(newActionCount > oldActionCount);
- assert.ok(newActionListenerCount > oldActionListenerCount);
- assert.ok(newAjaxListenerCount == oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount > oldValueChangeListenerCount);
-
- oldActionCount = getActionCount();
- oldActionListenerCount = getActionListenerCount();
- oldAjaxListenerCount = getAjaxListenerCount();
- oldValueChangeListenerCount = getValueChangeListenerCount();
- }
+QUnit.test("tc:in tc:event - click", function(assert) {
+ testInEvent(assert, "click");
+});
- step++;
- done();
- });
+QUnit.test("tc:in tc:event - dblclick", function(assert) {
+ testInEvent(assert, "dblclick");
});
-QUnit.test("tc:in tc:ajax - change", function(assert) {
- assert.expect(4);
- var done = assert.async();
-
- var oldActionCount = getActionCount();
- var oldActionListenerCount = getActionListenerCount();
- var oldAjaxListenerCount = getAjaxListenerCount();
- var oldValueChangeListenerCount = getValueChangeListenerCount();
- var newActionCount;
- var newActionListenerCount;
- var newAjaxListenerCount;
- var newValueChangeListenerCount;
-
- var $inputField = jQueryFrame("#page\\:mainForm\\:inAjaxChange\\:\\:field");
- var newValue = "hello";
- if (newValue == $inputField.val()) {
- newValue = "hi there";
- }
- $inputField.val(newValue).trigger("change");
+QUnit.test("tc:in tc:event - focus", function(assert) {
+ testInEvent(assert, "focus");
+});
- waitForAjax(function() {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
- return (newActionCount == oldActionCount)
- && (newActionListenerCount == oldActionListenerCount)
- && (newAjaxListenerCount > oldAjaxListenerCount)
- && (newValueChangeListenerCount > oldValueChangeListenerCount);
- }, function() {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
-
- assert.ok(newActionCount == oldActionCount);
- assert.ok(newActionListenerCount == oldActionListenerCount);
- assert.ok(newAjaxListenerCount > oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount > oldValueChangeListenerCount);
+QUnit.test("tc:in f:ajax - blur", function(assert) {
+ testInAjax(assert, "blur");
+});
- done();
- });
+QUnit.test("tc:in f:ajax - change", function(assert) {
+ testInAjax(assert, "change");
+});
+QUnit.test("tc:in f:ajax - click", function(assert) {
+ testInAjax(assert, "click");
+});
+QUnit.test("tc:in f:ajax - dblclick", function(assert) {
+ testInAjax(assert, "dblclick");
+});
+QUnit.test("tc:in f:ajax - focus", function(assert) {
+ testInAjax(assert, "focus");
});
-/*QUnit.test("tc:in tc:ajax - click", function(assert) {
- assert.expect(4);
- var done = assert.async();
-
- var oldActionCount = getActionCount();
- var oldActionListenerCount = getActionListenerCount();
- var oldAjaxListenerCount = getAjaxListenerCount();
- var oldValueChangeListenerCount = getValueChangeListenerCount();
- var newActionCount;
- var newActionListenerCount;
- var newAjaxListenerCount;
- var newValueChangeListenerCount;
+QUnit.test("tc:row tc:event - click", function(assert) {
+ testRowEvent(assert, "click");
+});
- var $inputField = jQueryFrame("#page\\:mainForm\\:inAjaxClick\\:\\:field");
- $inputField.trigger("click");
+QUnit.test("tc:row tc:event - dblclick", function(assert) {
+ testRowEvent(assert, "dblclick");
+});
- waitForAjax(function() {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
- return (newActionCount == oldActionCount)
- && (newActionListenerCount == oldActionListenerCount)
- && (newAjaxListenerCount > oldAjaxListenerCount)
- && (newValueChangeListenerCount == oldValueChangeListenerCount);
- }, function() {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
-
- assert.ok(newActionCount == oldActionCount);
- assert.ok(newActionListenerCount == oldActionListenerCount);
- assert.ok(newAjaxListenerCount > oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount == oldValueChangeListenerCount);
+QUnit.test("tc:row f:ajax - click", function(assert) {
+ testRowAjax(assert, "click");
+});
- done();
- });
-});*/
+QUnit.test("tc:row f:ajax - dblclick", function(assert) {
+ testRowAjax(assert, "dblclick");
+});
-/*QUnit.test("tc:in tc:ajax - change + click", function(assert) {
- assert.expect(8);
- var done = assert.async();
- var step = 1;
-
- var oldActionCount = getActionCount();
- var oldActionListenerCount = getActionListenerCount();
- var oldAjaxListenerCount = getAjaxListenerCount();
- var oldValueChangeListenerCount = getValueChangeListenerCount();
- var newActionCount;
- var newActionListenerCount;
- var newAjaxListenerCount;
- var newValueChangeListenerCount;
+function testButtonEvent(assert, eventName) {
+ testEvent(assert, "button", function() {
+ return jQueryFrame("#page\\:mainForm\\:buttonevent" + eventName + "\\:\\:command");
+ }, eventName, true, true, false, false, false);
+}
- var $inputField = jQueryFrame("#page\\:mainForm\\:inAjaxChangeClick\\:\\:field");
- $inputField.trigger("click");
+function testButtonAjax(assert, eventName) {
+ testAjax(assert, "button", function() {
+ return jQueryFrame("#page\\:mainForm\\:buttonajax" + eventName);
+ }, eventName, false, false, true, false, false);
+}
- waitForAjax(function() {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
- return step == 1
- && (newActionCount == oldActionCount)
- && (newActionListenerCount == oldActionListenerCount)
- && (newAjaxListenerCount > oldAjaxListenerCount)
- && (newValueChangeListenerCount == oldValueChangeListenerCount);
- }, function() {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
-
- assert.ok(newActionCount > oldActionCount);
- assert.ok(newActionListenerCount > oldActionListenerCount);
- assert.ok(newAjaxListenerCount == oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount > oldValueChangeListenerCount);
+function testInEvent(assert, eventName) {
+ testEvent(assert, "in", function() {
+ var $inputField = jQueryFrame("#page\\:mainForm\\:inevent" + eventName + "\\:\\:field");
+ var newValue = "hello";
+ if (newValue == $inputField.val()) {
+ newValue = "hi there";
+ }
+ $inputField.val(newValue);
+ return $inputField;
+ }, eventName, true, true, false, true, false);
+}
- $inputField = jQueryFrame($inputField.selector);
+function testInAjax(assert, eventName) {
+ testAjax(assert, "in", function() {
+ var $inputField = jQueryFrame("#page\\:mainForm\\:inajax" + eventName + "\\:\\:field");
var newValue = "hello";
if (newValue == $inputField.val()) {
newValue = "hi there";
}
- $inputField.val(newValue).trigger("change");
+ $inputField.val(newValue);
+ return $inputField;
+ }, eventName, false, false, true, true, false);
+}
- waitForAjax(function() {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
- return step == 2
- && (newActionCount == oldActionCount)
- && (newActionListenerCount == oldActionListenerCount)
- && (newAjaxListenerCount > oldAjaxListenerCount)
- && (newValueChangeListenerCount > oldValueChangeListenerCount);
- }, function() {
- newActionCount = getActionCount();
- newActionListenerCount = getActionListenerCount();
- newAjaxListenerCount = getAjaxListenerCount();
- newValueChangeListenerCount = getValueChangeListenerCount();
-
- assert.ok(newActionCount == oldActionCount);
- assert.ok(newActionListenerCount == oldActionListenerCount);
- assert.ok(newAjaxListenerCount > oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount > oldValueChangeListenerCount);
- });
+function testRowEvent(assert, eventName) {
+ var newSelectedPlanet = "Venus";
+ testEvent(assert, "row", function() {
+ var $row = jQueryFrame("#page\\:mainForm\\:sheetevent" + eventName + "\\:1\\:selectPlanet");
+ if (getSelectedPlanet() == newSelectedPlanet) {
+ $row = jQueryFrame("#page\\:mainForm\\:sheetevent" + eventName + "\\:4\\:selectPlanet");
+ newSelectedPlanet = "Jupiter";
+ }
+ return $row;
+ }, eventName, true, false, false, false, true);
+}
- step++;
- done();
- });
-});*/
+function testRowAjax(assert, eventName) {
+ var newSelectedPlanet = "Venus";
+ testAjax(assert, "row", function() {
+ var $row = jQueryFrame("#page\\:mainForm\\:sheetajax" + eventName + "\\:1\\:selectPlanet");
+ if (getSelectedPlanet() == newSelectedPlanet) {
+ $row = jQueryFrame("#page\\:mainForm\\:sheetajax" + eventName + "\\:4\\:selectPlanet");
+ newSelectedPlanet = "Jupiter";
+ }
+ return $row;
+ }, eventName, false, false, false, false, true);
+}
-QUnit.test("tc:button tc:event - click", function(assert) {
- assert.expect(4);
- var done = assert.async();
+function testEvent(assert, componentName, componentFunc, event,
+ incAction, incActionListener, incAjaxListener, incValueChangeListener, changePlanet) {
+ assert.expect(6);
+ var changeActiveComponent = jQueryFrame("#page\\:mainForm\\:compTestSection > div > h1 > span").text()
+ != "<tc:" + componentName + ">";
+ var done = assert.async(1 + changeActiveComponent);
+
+ var oldActionCount;
+ var oldActionListenerCount;
+ var oldAjaxListenerCount;
+ var oldValueChangeListenerCount;
+ var oldTimestamp;
+ var oldPlanet;
+
+ if (changeActiveComponent) {
+ activateComponent(componentName);
+ var step = 1;
+
+ jQuery("#page\\:testframe").load(function() {
+ if (step == 1) {
+ oldActionCount = getActionCount();
+ oldActionListenerCount = getActionListenerCount();
+ oldAjaxListenerCount = getAjaxListenerCount();
+ oldValueChangeListenerCount = getValueChangeListenerCount();
+ oldTimestamp = getTimestamp();
+ oldPlanet = getSelectedPlanet();
+
+ componentFunc().trigger(event);
+ } else if (step == 2) {
+ validateEvent(assert, oldActionCount, oldActionListenerCount, oldAjaxListenerCount,
+ oldValueChangeListenerCount, oldTimestamp, oldPlanet, incAction, incActionListener, incAjaxListener,
+ incValueChangeListener, changePlanet);
+ }
+ step++;
+ done();
+ });
+ } else {
+ oldActionCount = getActionCount();
+ oldActionListenerCount = getActionListenerCount();
+ oldAjaxListenerCount = getAjaxListenerCount();
+ oldValueChangeListenerCount = getValueChangeListenerCount();
+ oldTimestamp = getTimestamp();
+ oldPlanet = getSelectedPlanet();
+
+ componentFunc().trigger(event);
+
+ jQuery("#page\\:testframe").load(function() {
+ validateEvent(assert, oldActionCount, oldActionListenerCount, oldAjaxListenerCount, oldValueChangeListenerCount,
+ oldTimestamp, oldPlanet, incAction, incActionListener, incAjaxListener, incValueChangeListener, changePlanet);
+
+ done();
+ });
+ }
+}
- var oldActionCount = getActionCount();
- var oldActionListenerCount = getActionListenerCount();
- var oldAjaxListenerCount = getAjaxListenerCount();
- var oldValueChangeListenerCount = getValueChangeListenerCount();
+function validateEvent(assert, oldActionCount, oldActionListenerCount, oldAjaxListenerCount,
+ oldValueChangeListenerCount, oldTimestamp, oldPlanet, incAction, incActionListener,
+ incAjaxListener, incValueChangeListener, changePlanet) {
+ var newActionCount = getActionCount();
+ var newActionListenerCount = getActionListenerCount();
+ var newAjaxListenerCount = getAjaxListenerCount();
+ var newValueChangeListenerCount = getValueChangeListenerCount();
+ var newTimestamp = getTimestamp();
+ var newPlanet = getSelectedPlanet();
+
+ assert.equal(newActionCount, oldActionCount + incAction, "action");
+ assert.equal(newActionListenerCount, oldActionListenerCount + incActionListener, "actionListener");
+ assert.equal(newAjaxListenerCount, oldAjaxListenerCount + incAjaxListener, "ajaxListener");
+ assert.equal(newValueChangeListenerCount, oldValueChangeListenerCount + incValueChangeListener,
+ "valueChangeListener");
+ assert.ok(newTimestamp > oldTimestamp, "timestamp");
+ if (changePlanet) {
+ assert.notEqual(newPlanet, oldPlanet, "selectedPlanet");
+ } else {
+ assert.equal(newPlanet, oldPlanet, "selectedPlanet");
+ }
+}
- var button = jQueryFrame("#page\\:mainForm\\:buttonEventClick");
- button.click();
+function testAjax(assert, componentName, componentFunc, event,
+ incAction, incActionListener, incAjaxListener, incValueChangeListener, changePlanet) {
+ assert.expect(6);
+ var changeActiveComponent = jQueryFrame("#page\\:mainForm\\:compTestSection > div > h1 > span").text()
+ != "<tc:" + componentName + ">";
+ var done = assert.async(1 + changeActiveComponent);
+
+ var oldActionCount;
+ var oldActionListenerCount;
+ var oldAjaxListenerCount;
+ var oldValueChangeListenerCount;
+ var oldTimestamp;
+ var oldPlanet;
+
+ if (changeActiveComponent) {
+ activateComponent(componentName);
+ var step = 1;
+
+ jQuery("#page\\:testframe").load(function() {
+ if (step == 1) {
+ oldActionCount = getActionCount();
+ oldActionListenerCount = getActionListenerCount();
+ oldAjaxListenerCount = getAjaxListenerCount();
+ oldValueChangeListenerCount = getValueChangeListenerCount();
+ oldTimestamp = getTimestamp();
+ oldPlanet = getSelectedPlanet();
+
+ componentFunc().trigger(event);
+
+ validateAjax(assert, done, oldActionCount, oldActionListenerCount, oldAjaxListenerCount,
+ oldValueChangeListenerCount, oldTimestamp, oldPlanet, incAction, incActionListener, incAjaxListener,
+ incValueChangeListener, changePlanet);
+ }
+ step++;
+ done();
+ });
+ } else {
+ oldActionCount = getActionCount();
+ oldActionListenerCount = getActionListenerCount();
+ oldAjaxListenerCount = getAjaxListenerCount();
+ oldValueChangeListenerCount = getValueChangeListenerCount();
+ oldTimestamp = getTimestamp();
+ oldPlanet = getSelectedPlanet();
+
+ componentFunc().trigger(event);
+
+ validateAjax(assert, done, oldActionCount, oldActionListenerCount, oldAjaxListenerCount,
+ oldValueChangeListenerCount, oldTimestamp, oldPlanet, incAction, incActionListener, incAjaxListener,
+ incValueChangeListener, changePlanet);
+ }
+}
- jQuery("#page\\:testframe").load(function() {
+function validateAjax(assert, done, oldActionCount, oldActionListenerCount, oldAjaxListenerCount,
+ oldValueChangeListenerCount, oldTimestamp, oldPlanet, incAction, incActionListener,
+ incAjaxListener, incValueChangeListener, changePlanet) {
+ waitForAjax(function() {
var newActionCount = getActionCount();
var newActionListenerCount = getActionListenerCount();
var newAjaxListenerCount = getAjaxListenerCount();
var newValueChangeListenerCount = getValueChangeListenerCount();
+ var newTimestamp = getTimestamp();
+ var newPlanet = getSelectedPlanet();
- assert.ok(newActionCount > oldActionCount);
- assert.ok(newActionListenerCount > oldActionListenerCount);
- assert.ok(newAjaxListenerCount == oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount == oldValueChangeListenerCount);
-
- done();
- });
-});
-
-QUnit.test("tc:sheet tc:event - click", function(assert) {
- assert.expect(4);
- var done = assert.async();
-
- var oldActionCount = getActionCount();
- var oldActionListenerCount = getActionListenerCount();
- var oldAjaxListenerCount = getAjaxListenerCount();
- var oldValueChangeListenerCount = getValueChangeListenerCount();
-
- var button = jQueryFrame("#page\\:mainForm\\:buttonEventClick");
- button.click();
-
- jQuery("#page\\:testframe").load(function() {
+ return newActionCount == (oldActionCount + incAction)
+ && newActionListenerCount == (oldActionListenerCount + incActionListener)
+ && newAjaxListenerCount == (oldAjaxListenerCount + incAjaxListener)
+ && newValueChangeListenerCount == (oldValueChangeListenerCount + incValueChangeListener)
+ && newTimestamp > oldTimestamp
+ && changePlanet ? newPlanet != oldPlanet : newPlanet == oldPlanet;
+ }, function() {
var newActionCount = getActionCount();
var newActionListenerCount = getActionListenerCount();
var newAjaxListenerCount = getAjaxListenerCount();
var newValueChangeListenerCount = getValueChangeListenerCount();
+ var newTimestamp = getTimestamp();
+ var newPlanet = getSelectedPlanet();
- assert.ok(newActionCount > oldActionCount);
- assert.ok(newActionListenerCount > oldActionListenerCount);
- assert.ok(newAjaxListenerCount == oldAjaxListenerCount);
- assert.ok(newValueChangeListenerCount == oldValueChangeListenerCount);
+ assert.equal(newActionCount, oldActionCount + incAction, "action");
+ assert.equal(newActionListenerCount, oldActionListenerCount + incActionListener, "actionListener");
+ assert.equal(newAjaxListenerCount, oldAjaxListenerCount + incAjaxListener, "ajaxListener");
+ assert.equal(newValueChangeListenerCount, oldValueChangeListenerCount + incValueChangeListener,
+ "valueChangeListener");
+ assert.ok(newTimestamp > oldTimestamp, "timestamp");
+ if (changePlanet) {
+ assert.notEqual(newPlanet, oldPlanet, "selectedPlanet");
+ } else {
+ assert.equal(newPlanet, oldPlanet, "selectedPlanet");
+ }
done();
- });
-});
+ }, 3000);
+}
function getActionCount() {
return parseInt(jQueryFrame("#page\\:mainForm\\:outAction span").text());
@@ -361,5 +352,13 @@ function getTimestamp() {
}
function getSelectedPlanet() {
- return jQueryFrame("#page\\:mainForm\\:outPlanet span").text();
+ return jQueryFrame("#page\\:mainForm\\:inPlanet\\:\\:field").val()
+}
+
+function activateComponent(componentName) {
+ jQueryFrame("#page\\:mainForm\\:componentTable .tobago-sheet-row").each(function() {
+ if (jQuery(this).find("td").eq(0).find("span").text() == componentName) {
+ this.click();
+ }
+ });
}
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.xhtml?rev=1769312&r1=1769311&r2=1769312&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/event.xhtml Fri Nov 11 16:49:44 2016
@@ -21,9 +21,10 @@
xmlns="http://www.w3.org/1999/xhtml"
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jsp/jstl/core">
<ui:param name="title" value="<tc:event>"/>
- <tc:box id="metrics" label="Metrics">
+ <tc:box id="metrics" label="Metrics" rendered="#{eventController.selectedComponent != null}">
<f:facet name="bar">
<tc:button label="Reset" action="#{eventController.reset}"/>
</f:facet>
@@ -36,155 +37,67 @@
<tc:out id="outTimestamp" label="Timestamp" value="#{eventController.currentTimestamp}"/>
<tc:in id="inPlanet" label="Selected planet" value="#{eventController.selectedPlanet}"/>
</tc:box>
- <tc:section label="<tc:in>">
+
+ <tc:section id="compTestSection" label="<tc:#{eventController.selectedComponent.tagName}>"
+ rendered="#{eventController.selectedComponent != null}">
<tc:segmentLayout medium="6;6">
<tc:box label="<tc:event>">
- <tc:section label="change">
- <tc:in id="inEventChange" valueChangeListener="#{eventController.valueChangeListener}">
- <tc:event event="change" action="#{eventController.action}"
- actionListener="#{eventController.actionListener}"/>
- </tc:in>
- </tc:section>
- <tc:section label="click">
- <tc:in id="inEventClick" valueChangeListener="#{eventController.valueChangeListener}">
- <tc:event event="click" action="#{eventController.action}"
- actionListener="#{eventController.actionListener}"/>
- </tc:in>
- </tc:section>
- <tc:section label="change + click">
- <tc:in id="inEventChangeClick" valueChangeListener="#{eventController.valueChangeListener}">
- <tc:event event="change" action="#{eventController.action}"
- actionListener="#{eventController.actionListener}"/>
- <tc:event event="click" action="#{eventController.action}"
- actionListener="#{eventController.actionListener}"/>
- </tc:in>
- </tc:section>
+ <c:forEach items="#{eventController.selectedComponent.eventNames}" var="event">
+ <ui:include src="#{'x-event-'.concat(eventController.selectedComponent.tagName).concat('.xhtml')}">
+ <ui:param name="type" value="event"/>
+ <ui:param name="event" value="#{event}"/>
+ </ui:include>
+ </c:forEach>
</tc:box>
<tc:box label="<f:ajax>">
- <tc:section label="change">
- <tc:in id="inAjaxChange" valueChangeListener="#{eventController.valueChangeListener}">
- <f:ajax render="metrics" listener="#{eventController.ajaxListener}"/>
- </tc:in>
- </tc:section>
- <tc:section label="click">
- <tc:in id="inAjaxClick" valueChangeListener="#{eventController.valueChangeListener}">
- <f:ajax event="click" render="metrics" listener="#{eventController.ajaxListener}"/>
- </tc:in>
- <p>AjaxListener doesn't work for click!</p>
- </tc:section>
- <tc:section label="change + click">
- <tc:in id="inAjaxChangeClick" valueChangeListener="#{eventController.valueChangeListener}">
- <f:ajax event="change" render="metrics" listener="#{eventController.ajaxListener}"/>
- <f:ajax event="click" render="metrics" listener="#{eventController.ajaxListener}"/>
- </tc:in>
- <p>AjaxListener doesn't work for click!</p>
- </tc:section>
- </tc:box>
- </tc:segmentLayout>
- </tc:section>
- <tc:section label="<tc:button>">
- <tc:segmentLayout medium="6;6">
- <tc:box label="<tc:event>">
- <tc:section label="click">
- <tc:button id="buttonEventClick" label="Button" action="#{eventController.action}"
- actionListener="#{eventController.actionListener}"/>
- </tc:section>
- <tc:section label="dblclick">
- <p>Not implemented yet!</p>
- </tc:section>
- <tc:section label="mousedown">
- <p>Not implemented yet!</p>
- </tc:section>
- </tc:box>
- <tc:box label="<f:ajax>">
- <tc:section label="click">
- <tc:button id="buttonAjaxClick" label="Button" action="#{eventController.action}"
- actionListener="#{eventController.actionListener}">
- <f:ajax render="metrics" listener="#{eventController.ajaxListener}"/>
- </tc:button>
- <p>AjaxListener doesn't work for click!</p>
- </tc:section>
- <tc:section label="dblclick">
- <!--<tc:button id="buttonAjaxDblclick" label="Button" action="#{eventController.action}" actionListener="#{eventController.actionListener}">
- <f:ajax event="dblclick" render="metrics" listener="#{eventController.ajaxListener}"/>
- </tc:button>-->
- <p>Not implemented yet!</p>
- </tc:section>
- <tc:section label="mousedown">
- <!--<tc:button id="buttonAjaxMousedown" label="Button" action="#{eventController.action}" actionListener="#{eventController.actionListener}">
- <f:ajax event="mousedown" render="metrics" listener="#{eventController.ajaxListener}"/>
- </tc:button>-->
- <p>Not implemented yet!</p>
- </tc:section>
- </tc:box>
- </tc:segmentLayout>
- </tc:section>
- <!--<tc:section label="<tc:panel>">
- <tc:box label="Reload">
- <tc:panel>
- <f:facet name="reload">
- <tc:reload frequency="1000"/>
- </f:facet>
- <p>Still old implementation!</p>
- <tc:progress id="progessReload" value="#{progressController.currentSeconds}" max="59"/>
- </tc:panel>
- </tc:box>
- </tc:section>-->
- <tc:section label="<tc:sheet>">
- <tc:segmentLayout medium="6;6">
- <tc:box label="<tc:event>">
- <tc:section label="click">
- <tc:sheet id="sheetEventClick" value="#{eventController.planets}" var="planet" markup="small">
- <tc:style maxHeight="200px"/>
- <tc:column label="Planet">
- <tc:out value="#{planet.name}" labelLayout="skip"/>
- </tc:column>
- <tc:row>
- <tc:event event="click" action="#{eventController.action}"
- actionListener="#{eventController.selectPlanet}"/>
- </tc:row>
- </tc:sheet>
- <p>ActionListener doesn't work!</p>
- </tc:section>
- <tc:section label="dblclick">
- <!--<tc:sheet id="sheetEventDblclick" value="#{eventController.planets}" var="planet" markup="small">
- <tc:style maxHeight="200px"/>
- <tc:column label="Planet">
- <tc:out value="#{planet.name}" labelLayout="skip"/>
- </tc:column>
- <tc:row>
- <tc:event event="dblclick" action="#{eventController.action}" actionListener="#{eventController.selectPlanet}"/>
- </tc:row>
- </tc:sheet>-->
- <p>Not implemented yet!</p>
- </tc:section>
- </tc:box>
- <tc:box label="<f:ajax>">
- <tc:section label="click">
- <tc:sheet id="sheetAjaxClick" value="#{eventController.planets}" var="planet" markup="small">
- <tc:style maxHeight="200px"/>
- <tc:column label="Planet">
- <tc:out value="#{planet.name}" labelLayout="skip"/>
- </tc:column>
- <tc:row>
- <f:ajax render="::metrics" listener="#{eventController.ajaxListener}"/>
- </tc:row>
- </tc:sheet>
- <p>Not implemented yet</p>
- </tc:section>
- <tc:section label="dblclick">
- <!--<tc:sheet id="sheetAjaxClick" value="#{eventController.planets}" var="planet" markup="small">
- <tc:style maxHeight="200px"/>
- <tc:column label="Planet">
- <tc:out value="#{planet.name}" labelLayout="skip"/>
- </tc:column>
- <tc:row>
- <f:ajax event="dblclick" render="::metrics" listener="#{eventController.ajaxListener}"/>
- </tc:row>
- </tc:sheet>-->
- <p>Not implemented yet!</p>
- </tc:section>
+ <c:forEach items="#{eventController.selectedComponent.eventNames}" var="event">
+ <ui:include src="#{'x-event-'.concat(eventController.selectedComponent.tagName).concat('.xhtml')}">
+ <ui:param name="type" value="ajax"/>
+ <ui:param name="event" value="#{event}"/>
+ </ui:include>
+ </c:forEach>
</tc:box>
</tc:segmentLayout>
</tc:section>
+
+ <tc:separator/>
+ <p>click events = click, dblclick<br/>
+ focus events = focus, blur<br/>
+ mouse events = mousedown, mousemove, mouseout, mouseover, mouseup<br/>
+ key events = keydown, keypress, keyup</p>
+ <tc:sheet id="componentTable" value="#{eventController.eventsOnComponents}" var="comp" markup="small">
+ <tc:column label="Tag Name">
+ <tc:out value="#{comp.tagName}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="change" align="center"
+ markup="#{comp.changeEvent == 'x' ? 'lightgreen' : comp.changeEvent == '-' ? 'lightred' : ''}">
+ <tc:out value="#{comp.changeEvent}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="click events" align="center"
+ markup="#{comp.clickEvents == 'x' ? 'lightgreen' : comp.clickEvents == '-' ? 'lightred' : ''}">
+ <tc:out value="#{comp.clickEvents}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="focus events" align="center"
+ markup="#{comp.focusEvents == 'x' ? 'lightgreen' : comp.focusEvents == '-' ? 'lightred' : ''}">
+ <tc:out value="#{comp.focusEvents}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="mouse events" align="center"
+ markup="#{comp.mouseEvents == 'x' ? 'lightgreen' : comp.mouseEvents == '-' ? 'lightred' : ''}">
+ <tc:out value="#{comp.mouseEvents}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="key events" align="center"
+ markup="#{comp.keyEvents == 'x' ? 'lightgreen' : comp.keyEvents == '-' ? 'lightred' : ''}">
+ <tc:out value="#{comp.keyEvents}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="select" align="center"
+ markup="#{comp.selectEvent == 'x' ? 'lightgreen' : comp.selectEvent == '-' ? 'lightred' : ''}">
+ <tc:out value="#{comp.selectEvent}" labelLayout="skip"/>
+ </tc:column>
+ <tc:column label="special events">
+ <tc:out value="#{comp.specialEvents}" labelLayout="skip"/>
+ </tc:column>
+ <tc:row id="selectComponent">
+ <tc:event event="click" actionListener="#{eventController.selectComponent}"/>
+ </tc:row>
+ </tc:sheet>
</ui:composition>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-bar.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-bar.xhtml?rev=1769312&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-bar.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-bar.xhtml Fri Nov 11 16:49:44 2016
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <tc:section label="#{event}">
+ <tc:bar id="bar#{type}#{event}"></tc:bar>
+ <p>Not implemented yet!</p>
+ </tc:section>
+</ui:composition>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-button.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-button.xhtml?rev=1769312&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-button.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-button.xhtml Fri Nov 11 16:49:44 2016
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <tc:section label="#{event}">
+ <tc:button id="button#{type}#{event}" label="Button">
+ <ui:include src="x-event-component-content.xhtml">
+ <ui:param name="type" value="#{type}"/>
+ <ui:param name="event" value="#{event}"/>
+ </ui:include>
+ </tc:button>
+ </tc:section>
+</ui:composition>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-component-content.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-component-content.xhtml?rev=1769312&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-component-content.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-component-content.xhtml Fri Nov 11 16:49:44 2016
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jsp/jstl/core">
+ <c:if test="#{type=='event'}">
+ <c:if test="#{event=='blur'}">
+ <tc:event event="blur" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='change'}">
+ <tc:event event="change" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='click'}">
+ <tc:event event="click" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='complete'}">
+ <tc:event event="complete" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='dblclick'}">
+ <tc:event event="dblclick" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='focus'}">
+ <tc:event event="focus" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='keydown'}">
+ <tc:event event="keydown" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='keypress'}">
+ <tc:event event="keypress" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='keyup'}">
+ <tc:event event="keyup" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='load'}">
+ <tc:event event="load" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='mousedown'}">
+ <tc:event event="mousedown" action="#{eventController.action}"
+ actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='mousemove'}">
+ <tc:event event="mousemove" action="#{eventController.action}"
+ actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='mouseout'}">
+ <tc:event event="mouseout" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='mouseover'}">
+ <tc:event event="mouseover" action="#{eventController.action}"
+ actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='mouseup'}">
+ <tc:event event="mouseup" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='resize'}">
+ <tc:event event="resize" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ <c:if test="#{event=='select'}">
+ <tc:event event="select" action="#{eventController.action}" actionListener="#{eventController.actionListener}"/>
+ </c:if>
+ </c:if>
+ <c:if test="#{type=='ajax'}">
+ <c:if test="#{event=='blur'}">
+ <f:ajax event="blur" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='change'}">
+ <f:ajax event="change" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='click'}">
+ <f:ajax event="click" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='complete'}">
+ <f:ajax event="complete" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='dblclick'}">
+ <f:ajax event="dblclick" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='focus'}">
+ <f:ajax event="focus" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='keydown'}">
+ <f:ajax event="keydown" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='keypress'}">
+ <f:ajax event="keypress" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='keyup'}">
+ <f:ajax event="keyup" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='load'}">
+ <f:ajax event="load" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='mousedown'}">
+ <f:ajax event="mousedown" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='mousemove'}">
+ <f:ajax event="mousemove" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='mouseout'}">
+ <f:ajax event="mouseout" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='mouseover'}">
+ <f:ajax event="mouseover" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='mouseup'}">
+ <f:ajax event="mouseup" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='resize'}">
+ <f:ajax event="resize" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ <c:if test="#{event=='select'}">
+ <f:ajax event="select" render="metrics" listener="#{eventController.ajaxListener}"/>
+ </c:if>
+ </c:if>
+</ui:composition>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-in.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-in.xhtml?rev=1769312&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-in.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-in.xhtml Fri Nov 11 16:49:44 2016
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <tc:section label="#{event}">
+ <tc:in id="in#{type}#{event}" valueChangeListener="#{eventController.valueChangeListener}">
+ <ui:include src="x-event-component-content.xhtml">
+ <ui:param name="type" value="#{type}"/>
+ <ui:param name="event" value="#{event}"/>
+ </ui:include>
+ </tc:in>
+ </tc:section>
+</ui:composition>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-row.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-row.xhtml?rev=1769312&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-row.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-row.xhtml Fri Nov 11 16:49:44 2016
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <tc:section label="#{event}">
+ <tc:sheet id="sheet#{type}#{event}" value="#{eventController.planets}" var="planet" markup="small">
+ <tc:style maxHeight="200px"/>
+ <tc:column label="Planet">
+ <tc:out value="#{planet.name}" labelLayout="skip"/>
+ </tc:column>
+ <tc:row id="selectPlanet">
+ <c:if test="#{type=='event'}">
+ <c:if test="#{event=='blur'}">
+ <tc:event event="blur" action="#{eventController.action}" actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='change'}">
+ <tc:event event="change" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='click'}">
+ <tc:event event="click" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='complete'}">
+ <tc:event event="complete" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='dblclick'}">
+ <tc:event event="dblclick" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='focus'}">
+ <tc:event event="focus" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='keydown'}">
+ <tc:event event="keydown" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='keypress'}">
+ <tc:event event="keypress" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='keyup'}">
+ <tc:event event="keyup" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='load'}">
+ <tc:event event="load" action="#{eventController.action}" actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mousedown'}">
+ <tc:event event="mousedown" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mousemove'}">
+ <tc:event event="mousemove" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mouseout'}">
+ <tc:event event="mouseout" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mouseover'}">
+ <tc:event event="mouseover" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mouseup'}">
+ <tc:event event="mouseup" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='resize'}">
+ <tc:event event="resize" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='select'}">
+ <tc:event event="select" action="#{eventController.action}"
+ actionListener="#{eventController.selectPlanet}"/>
+ </c:if>
+ </c:if>
+ <c:if test="#{type=='ajax'}">
+ <c:if test="#{event=='blur'}">
+ <f:ajax event="blur" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='change'}">
+ <f:ajax event="change" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='click'}">
+ <f:ajax event="click" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='complete'}">
+ <f:ajax event="complete" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='dblclick'}">
+ <f:ajax event="dblclick" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='focus'}">
+ <f:ajax event="focus" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='keydown'}">
+ <f:ajax event="keydown" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='keypress'}">
+ <f:ajax event="keypress" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='keyup'}">
+ <f:ajax event="keyup" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='load'}">
+ <f:ajax event="load" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mousedown'}">
+ <f:ajax event="mousedown" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mousemove'}">
+ <f:ajax event="mousemove" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mouseout'}">
+ <f:ajax event="mouseout" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mouseover'}">
+ <f:ajax event="mouseover" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='mouseup'}">
+ <f:ajax event="mouseup" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='resize'}">
+ <f:ajax event="resize" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ <c:if test="#{event=='select'}">
+ <f:ajax event="select" render=":page:mainForm:metrics" listener="#{eventController.selectPlanet}"/>
+ </c:if>
+ </c:if>
+ </tc:row>
+ </tc:sheet>
+ </tc:section>
+</ui:composition>
Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-textarea.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-textarea.xhtml?rev=1769312&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-textarea.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/6000-event/x-event-textarea.xhtml Fri Nov 11 16:49:44 2016
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <tc:section label="#{event}">
+ <tc:textarea id="textarea#{type}#{event}" valueChangeListener="#{eventController.valueChangeListener}">
+ <ui:include src="x-event-component-content.xhtml">
+ <ui:param name="type" value="#{type}"/>
+ <ui:param name="event" value="#{event}"/>
+ </ui:include>
+ </tc:textarea>
+ </tc:section>
+</ui:composition>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js?rev=1769312&r1=1769311&r2=1769312&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/script/tobago-test.js Fri Nov 11 16:49:44 2016
@@ -23,12 +23,13 @@ function jQueryFrame(expression) {
* Wait for ajax requests. Can be used with PhantomJs.
* @param waitingDone return false if still waiting, true if waiting done
* @param executeWhenDone is executed after waiting
+ * @param maxWait set the maximal waiting time in ms; default is 20000
*/
-function waitForAjax(waitingDone, executeWhenDone) {
+function waitForAjax(waitingDone, executeWhenDone, maxWait) {
var startTime = new Date().getTime();
- var maxWait = 20000;
+ maxWait = maxWait != null ? maxWait : 20000;
var stillWaiting = true;
- var interval = setInterval(function () {
+ var interval = setInterval(function() {
if (new Date().getTime() - startTime < maxWait && stillWaiting) {
stillWaiting = !waitingDone();
} else {
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/tobago.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/tobago.css?rev=1769312&r1=1769311&r2=1769312&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/tobago.css (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/tobago.css Fri Nov 11 16:49:44 2016
@@ -26,3 +26,11 @@
.tobago-sheet-cell-markup-moon {
background-color: #6495ed;
}
+
+.tobago-sheet-cell-markup-lightgreen {
+ background-color: #ddffdd;
+}
+
+.tobago-sheet-cell-markup-lightred {
+ background-color: #ffdddd;
+}