From 73382867b947659c94bb71d838c8681c1553e62b Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Thu, 6 Jun 2013 16:30:53 -0700 Subject: [PATCH 1/7] flatten PointerGestures, remove direct link to PointerEvents --- .gitmodules | 3 --- Gruntfile.js | 11 ----------- karma.conf.js | 16 ++++++++-------- src/pointergestures.js => pointergestures.js | 19 +++++++++---------- src/PointerEvents | 1 - tests/index.html | 3 ++- 6 files changed, 19 insertions(+), 34 deletions(-) rename src/pointergestures.js => pointergestures.js (72%) delete mode 160000 src/PointerEvents diff --git a/.gitmodules b/.gitmodules index 0791747..061786b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "src/PointerEvents"] - path = src/PointerEvents - url = https://github.com/Polymer/PointerEvents.git [submodule "buildbot"] path = buildbot url = git://github.com/Polymer/buildbot.git diff --git a/Gruntfile.js b/Gruntfile.js index 391f273..0791812 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -22,17 +22,6 @@ module.exports = function(grunt) { }, dest: 'build/pointergestures.js', src: [ - // PointerEvents - 'src/PointerEvents/src/boot.js', - 'src/PointerEvents/src/touch-action.js', - 'src/PointerEvents/src/PointerEvent.js', - 'src/PointerEvents/src/pointermap.js', - 'src/PointerEvents/src/sidetable.js', - 'src/PointerEvents/src/dispatcher.js', - 'src/PointerEvents/src/installer.js', - 'src/PointerEvents/src/platform-events.js', - 'src/PointerEvents/src/capture.js', - // PointerGestures 'src/PointerGestureEvent.js', 'src/initialize.js', 'src/sidetable.js', diff --git a/karma.conf.js b/karma.conf.js index 3bf814e..4d30497 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -14,14 +14,14 @@ frameworks = ['mocha']; files = [ 'node_modules/chai/chai.js', 'node_modules/chai-spies/chai-spies.js', - 'src/PointerEvents/src/boot.js', - 'src/PointerEvents/src/PointerEvent.js', - 'src/PointerEvents/src/pointermap.js', - 'src/PointerEvents/src/sidetable.js', - 'src/PointerEvents/src/dispatcher.js', - 'src/PointerEvents/src/installer.js', - 'src/PointerEvents/src/platform-events.js', - 'src/PointerEvents/src/capture.js', + '../PointerEvents/src/boot.js', + '../PointerEvents/src/PointerEvent.js', + '../PointerEvents/src/pointermap.js', + '../PointerEvents/src/sidetable.js', + '../PointerEvents/src/dispatcher.js', + '../PointerEvents/src/installer.js', + '../PointerEvents/src/platform-events.js', + '../PointerEvents/src/capture.js', 'src/PointerGestureEvent.js', 'src/initialize.js', 'src/sidetable.js', diff --git a/src/pointergestures.js b/pointergestures.js similarity index 72% rename from src/pointergestures.js rename to pointergestures.js index 98e93a5..31ed71c 100644 --- a/src/pointergestures.js +++ b/pointergestures.js @@ -19,15 +19,14 @@ } [ - 'PointerEvents/src/pointerevents.js', - 'PointerGestureEvent.js', - 'initialize.js', - 'sidetable.js', - 'pointermap.js', - 'dispatcher.js', - 'hold.js', - 'track.js', - 'flick.js', - 'tap.js' + 'src/PointerGestureEvent.js', + 'src/initialize.js', + 'src/sidetable.js', + 'src/pointermap.js', + 'src/dispatcher.js', + 'src/hold.js', + 'src/track.js', + 'src/flick.js', + 'src/tap.js' ].forEach(require); })(); diff --git a/src/PointerEvents b/src/PointerEvents deleted file mode 160000 index 35423ee..0000000 --- a/src/PointerEvents +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 35423eedda4dc3c96ba726757322ab9c9cd753d8 diff --git a/tests/index.html b/tests/index.html index 8f3244a..48554d2 100644 --- a/tests/index.html +++ b/tests/index.html @@ -7,7 +7,8 @@ - + +
From 6d5c8c73bfa8f801e88023b10c1b25700a2747df Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Thu, 6 Jun 2013 17:06:32 -0700 Subject: [PATCH 2/7] boot pointerevents polyfill if necessary --- README.md | 9 +++------ pointergestures.js | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 651bd96..e11ef09 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,8 @@ Included events are: ## Installation -1. Check out the submodule for PointerEvents, and PointerEvents' necessary -submodules. (`git submodule update --init --recursive`). +1. Install the [PointerEvents polyfill](http://github.com/Polymer/PointerEvents) as a sibling to PointerGestures -2. Include PointerGestures/src/pointergestures in your page. +2. Include `PointerGestures/pointergestures.js` in your page. -3. PointerGestures will automatically include PointerEvents. - -4. Set the `touch-action` of a few elements and see the events fire! +3. Set the `touch-action` of a few elements and see the events fire! diff --git a/pointergestures.js b/pointergestures.js index 31ed71c..655b8ef 100644 --- a/pointergestures.js +++ b/pointergestures.js @@ -18,6 +18,10 @@ libLocation = s.src.slice(0, -thisFile.length); } + if (!window.PointerEvent) { + require('../PointerEvents/pointerevents.js'); + } + [ 'src/PointerGestureEvent.js', 'src/initialize.js', From 2669b16eee2a47f461727fa1076184323ed2ea40 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Thu, 6 Jun 2013 17:34:52 -0700 Subject: [PATCH 3/7] update samples --- samples/simple/index.html | 2 +- samples/track/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/simple/index.html b/samples/simple/index.html index 29bb6a9..03763f3 100644 --- a/samples/simple/index.html +++ b/samples/simple/index.html @@ -37,7 +37,7 @@ white-space: pre; } - +
diff --git a/samples/track/index.html b/samples/track/index.html index 7015d38..1d5de69 100644 --- a/samples/track/index.html +++ b/samples/track/index.html @@ -3,7 +3,7 @@ Track sample - +