Opened 8 years ago

Closed 8 years ago

#14223 closed enhancement (fixed)

Add touch & gesture plugins to Analytics

Reported by: Chris Mitchell Owned by: Ed Chatelain
Priority: high Milestone: 1.8
Component: Dojox Version: 1.6.1
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

Analytics package needs plugins to track touch events.

Attachments (1)

analytics-14223.patch (49.6 KB) - added by Ed Chatelain 8 years ago.
Added more details about the touches included in the touch events, and additional config options.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by Ed Chatelain

I will add a patch with a plugin for touchPress, touchMove, and gestureEvents along with a test for touchEvents and gestureEvents soon. touchPress will handle touch.press and touch.release. gestureEvents will handle swipe, tap, tap.doubletap, and tap.taphold.

But I have a couple of questions about the way the plugins for mouseClick and mouseOver were done, and how I should handle the touch and gesture plugins.

mouseOver has config support for targetProps like this:

this.targetProps = configtargetProps?
["id","className","localName","href", "spellcheck", "lang", "textContent", "value" ];

And when mouseOver logs an event, it only logs the targetProps for the event "target" along with the x,y values, it ignores everything else.

mouseClick uses a hardcoded list of targetProps, like this: var props=["id","className","nodeName", "localName","href", "spellcheck", "lang"]; But has code to log those targetProps for "originalTarget" and "explicitOriginalTarget" in addition to "target", along with information for clientX, clientY, pageX, pageY, screenX, screenY.

So these are my questions: 1) Should I add config support for targetProps to mouseClick? I vote yes.

2) Should mouseOver be logging clientX, clientY, pageX, pageY, screenX, screenY instead of just x,y? And should I add config support for this also? I vote to use clientX etc, and not make it configurable, because it would be a little tricky to handle the config.

3) Should the config setting for targetProps be shared by the mouse, touch and gesture plugins, or should they each have their own setting, like targetMouseProps, targetTouchProps etc? I vote a shared setting, but I am fine either way.

Thanks, Ed

comment:2 Changed 8 years ago by Ed Chatelain

Regarding the questions asked above, I got a response from Dustin via email saying he was fine with my suggestions.

comment:3 Changed 8 years ago by cjolif

Cc: cjolif added

comment:4 Changed 8 years ago by Ed Chatelain

I will be posting an updated patch today. In addition to the plugins for touchPress, touchMove, and gestureEvents, and the new tests for those, I have also added some additional config options for the mouse plugins.

mouseClick will now have config support for targetProps, and textContentMaxChars (the max number of characters to show for text or textContent, defaults to 50).

mouseOver will now have config support textContentMaxChars. See the README for details on these config options and the config options for the touch and gesture plugins. My goal for the mouse support which existed prior to the touch support being added is to be backward compatible, so these updates should not remove anything which was getting logged by default or which could have been set by config before, but it would be ok to log additional information.

So mouseClick will continue to log the same targetProps for "originalTarget" and "explicitOriginalTarget" in addition to "target", along with information for clientX, clientY, pageX, pageY, screenX, screenY by default, but there will be new config options to change the targetProps and the textContentMaxChars. And

mouseOver will continue to log the same targetProps for only for "target", along with information for "x" and "y", and I will add logging for screenX, screenY by default, but I did not add logging for clientX, clientY, pageX, pageY because those are usually the same as "x" and "y" and I did not want to flood the log with too much information.

Last edited 8 years ago by Ed Chatelain (previous) (diff)

Changed 8 years ago by Ed Chatelain

Attachment: analytics-14223.patch added

Added more details about the touches included in the touch events, and additional config options.

comment:5 Changed 8 years ago by cjolif

Resolution: fixed
Status: newclosed

In [27087]:

Add touch / gesture support to analytics. Add more config options a well. From edchat (IBM, CCLA). Fixes #14223.

Note: See TracTickets for help on using tickets.