Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#12176 closed enhancement (fixed)

[patch] [ccla] Dojo touch event layer for both mobile and PC

Reported by: evan Owned by: Evan
Priority: high Milestone: 1.7
Component: DojoX Mobile Version: 1.6.0
Keywords: 1.7-mobile, touch Cc: ccmitchellusa@…, drschwar@…, deanw@…, evanhuangwei@…, heguyi@…, rqruanqi@…, zhongsq@…, Kris Zyp, eabe@…, etissandier@…, Evan
Blocked By: Blocking:

Description (last modified by evan)

We'll use this ticket to track touch event layer which is designed to recognize various user gestures with appropriate events published.

It also offers unified event APIs for developers to catch and respond to the raised events across browsers not only on PC but also on mobile devices such as iPhone, iPad and Andriod etc.

Please refer to the following materials:

1. Implementation proposal

2. Live demo(only tested on iPhone v.3GS+)

3. Demo video(demo.wmv)

Attachments (8)

touch-dijit.patch (1.4 KB) - added by evan 8 years ago.
touch-dojo.patch (595 bytes) - added by evan 8 years ago.
touch-dojox.patch (23.1 KB) - added by evan 8 years ago.
touch0.1.patch (19.3 KB) - added by evan 8 years ago.
touch0.1-demo.zip (36.6 KB) - added by evan 8 years ago.
Demo for touch0.1.patch, experimenting basic touches & gestures(tap, rotation) with dijit Slider and Charting, from Si Qi Zhong(IBM, CCLA), Ruan Qi (IBM, CCLA)
touch0.2.patch (15.4 KB) - added by evan 8 years ago.
Refactored based on new event framework, also added support for isolating mouse/touch handlers
touch0.3-all-in-one.patch (74.8 KB) - added by evan 8 years ago.
touch0.4.patch (17.7 KB) - added by evan 8 years ago.
AMD issue fixed working well with trunk, gesture event bubbling issue still exists

Download all attachments as: .zip

Change History (33)

Changed 8 years ago by evan

Attachment: touch-dijit.patch added

Changed 8 years ago by evan

Attachment: touch-dojo.patch added

Changed 8 years ago by evan

Attachment: touch-dojox.patch added

comment:1 Changed 8 years ago by evan

Breakdown the original patch(from Siqi Zhong, IBM CCLA) into three - please apply to dijit, dojo and dojox separately.

comment:2 Changed 8 years ago by evan

Keywords: 1.7-mobile added
Milestone: tbd1.7
Owner: changed from Shane O'Sullivan to evan
Priority: normalhigh
Version: 1.6.0b11.6.0

comment:3 Changed 8 years ago by Chris Mitchell

Summary: Dojo touch event layer for both mobile and PC[patch] [ccla] Dojo touch event layer for both mobile and PC

comment:4 Changed 8 years ago by Chris Mitchell

Type: taskenhancement

Changed 8 years ago by evan

Attachment: touch0.1.patch added

Changed 8 years ago by evan

Attachment: touch0.1-demo.zip added

Demo for touch0.1.patch, experimenting basic touches & gestures(tap, rotation) with dijit Slider and Charting, from Si Qi Zhong(IBM, CCLA), Ruan Qi (IBM, CCLA)

comment:5 Changed 8 years ago by Chris Mitchell

Cc: ccmitchellusa@… added; chrism1@… removed

comment:6 Changed 8 years ago by Chris Mitchell

Has there been any further feedback on this ticket?

I've reviewed this latest patch, and it looks very clean with the new event module refractor from kris, but looks like the events patch is out of date with trunk. -Chris

comment:7 in reply to:  6 Changed 8 years ago by evan

Replying to chrism:

Has there been any further feedback on this ticket?

I've reviewed this latest patch, and it looks very clean with the new event module refractor from kris, but looks like the events patch is out of date with trunk. -Chris

Yep, the discussion is currently going on in mailing list. Kris has already fixed it in git, just uploaded a latest path version there

Changed 8 years ago by evan

Attachment: touch0.2.patch added

Refactored based on new event framework, also added support for isolating mouse/touch handlers

Changed 8 years ago by evan

Attachment: touch0.3-all-in-one.patch added

comment:8 Changed 8 years ago by evan

Cc: Kris Zyp eabe@… etissandier@… added

touch0.3-all-in-one.patch includes new event/listen by adding normalization works for W3C touch events to dojo.listen, also includes a formal impl of Tap/Swipe? gestures from Eduardo(IBM, CCLA). The usages look like

  1. Unified W3C touch events working well across touch devices
dojo.connect(node, "ontouchstart"|"ontouchmove"|..., func);
dojo.connect(node, "onorientationchange", func);
  1. Abstracted touch/mouse events working well on desktop and mobiles - future dijit/dnd changes
dojo.connect(node, dojo.touch.press | move | release, func);
  1. Gestures working well on desktop and mobiles:
dojo.connect(n, dojo.gesture.tap | taphold | doubletap, func);
dojo.connect(n, dojo.gesture.swipe | swipeup | swipedown | swipeleft | swiperight, func);

comment:9 Changed 8 years ago by evan

Description: modified (diff)

Changed 8 years ago by evan

Attachment: touch0.4.patch added

AMD issue fixed working well with trunk, gesture event bubbling issue still exists

comment:10 Changed 8 years ago by evan

Description: modified (diff)

comment:11 Changed 8 years ago by evan

Resolution: fixed
Status: newclosed

Fixed with [24634] - by getting the touch & gestures code into trunk for 1.7

comment:12 Changed 8 years ago by evan

(In [25050]) Refs #12176 making gesture bubbling compatible with iOS v.3

comment:13 Changed 8 years ago by evan

(In [25701]) Refs #12176 clean up resources when a gesture event is disconnected or the global gesture instance is unRegistered.

comment:14 Changed 8 years ago by evan

(In [25706]) Refs #12176 !strict missed dojo.gesture.destroy() and related doh test cases and space fix

comment:15 Changed 8 years ago by Evan

Cc: Evan added

comment:16 Changed 8 years ago by bill

Resolution: fixed
Status: closedreopened

Can you make touch_gestures.html be run by runTests.html? Or is there a reason it isn't? (Does it work on IE?)

Actually, the automated test doesn't seem to work on FF (FF6/mac). It throws DOH assertions. The other problem with the test though is that those assertions aren't reported because you are running doh.is() tests inside of a dojo.connect() callback. (But you can see it in firebug. It's in the gestureBubbling() test on on.emit(innerDoH, 'mouseup', {}).

comment:17 Changed 8 years ago by Douglas Hays

Owner: changed from evan to Evan
Status: reopenednew

comment:18 Changed 8 years ago by Chris Mitchell

The touch demo is broken on trunk.

comment:19 Changed 8 years ago by Evan

Resolution: fixed
Status: newclosed

In [26541]:

Fixes #12176, fixes regressions due to #13828 changes

comment:20 Changed 8 years ago by Evan

In [26542]:

Refs #12176 added test_touch.html into dojo/doh harness

comment:21 in reply to:  16 Changed 8 years ago by Evan

Replying to bill:

Can you make touch_gestures.html be run by runTests.html? Or is there a reason it isn't? (Does it work on IE?)

Actually, the automated test doesn't seem to work on FF (FF6/mac). It throws DOH assertions. The other problem with the test though is that those assertions aren't reported because you are running doh.is() tests inside of a dojo.connect() callback. (But you can see it in firebug. It's in the gestureBubbling() test on on.emit(innerDoH, 'mouseup', {}).

Yep, this was fixed with [26542], [26512] and [26540]

comment:22 Changed 8 years ago by bill

I don't think it's quite fixed, as I was trying to say above you can't just put doh.is() etc. calls inside of a callback like you are doing in (for example) swipe.html:

h2 = on(inner, swipe.end, function(e){
	endExecuted = true;
	doh.assertEqual('swipe.end', e.type);
	doh.assertEqual(inner, e.target);
	doh.assertEqual(200, e.dx);
	doh.assertEqual(-120, e.dy);
});

If the assertions fail they will throw exceptions, but the execeptions will be swallowed.

Last edited 8 years ago by bill (previous) (diff)

comment:23 Changed 8 years ago by Evan

In [26549]:

Refs #12176, refined doh cases a bit so that assertions won't be swallowed.

comment:24 Changed 8 years ago by Evan

In [26550]:

Refs #12176, also refined test_touch.html doh cases a bit so that assertions won't be swallowed.

comment:25 Changed 6 years ago by Bill Keese <bill@…>

In 755fbbc3be5cb56555d1f237d3c6418569418b45/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.