diff --git a/web-fixtures/js_test.html b/web-fixtures/js_test.html
index 35db3d0..35339a5 100644
--- a/web-fixtures/js_test.html
+++ b/web-fixtures/js_test.html
@@ -91,6 +91,27 @@
$('.text-event').text('key upped: ' + (ev.keyCode || ev.charCode) + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1);
});
+ // https://stackoverflow.com/a/22306212/5153116
+ var eventsList = ["mousedown", "mouseup", "click", "dblclick", "mousemove",
+ "mouseover", "mouseout", "mousewheel", "keydown", "keyup", "keypress",
+ "textInput", "touchstart", "touchmove", "touchend", "touchcancel", "resize",
+ "scroll", "zoom", "focus", "blur", "select", "change", "submit", "reset"];
+
+ var callbackFunction = function(element, eventName) {
+ $( this ).find( "p" ).html( $( this ).find( "p" ).html() + ", " + eventName );
+ };
+
+ var elements = document.querySelectorAll('*');
+ for (var i = 0; i < elements.length; i++) {
+ for (var j = 0; j < eventsList.length; j++) {
+ var element = elements[i];
+ var event = eventsList[j];
+
+ element.addEventListener(event,
+ callbackFunction.bind(this, element, event), true);
+ }
+ }
+
$( "#draggable" ).draggable();
$( "#draggable2" ).draggable({
distance: 0,
@@ -103,7 +124,7 @@
});
$( "#droppable" ).droppable({
drop: function( event, ui ) {
- $( this ).find( "p" ).html( 'Dropped ' + ui.draggable.data('name') + '!' );
+ $( this ).find( "p" ).html( $( this ).find( "p" ).html() + ", " + 'Dropped ' + ui.draggable.data('name') + '!' );
}
});