From 4aeeef6b7a1961920da27e74336ffa7a7310806c Mon Sep 17 00:00:00 2001 From: Carlos Lawton Date: Thu, 16 Jul 2015 12:11:50 -0400 Subject: [PATCH 1/5] Added support for requireFailure when multiple gestured are attached --- .editorconfig | 0 angular.hammer.js | 389 +++++++++++++++++++++++++--------------------- 2 files changed, 214 insertions(+), 175 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e69de29 diff --git a/angular.hammer.js b/angular.hammer.js index 0f2aaad..203ac0b 100644 --- a/angular.hammer.js +++ b/angular.hammer.js @@ -3,33 +3,33 @@ // Copyright (c) 2014 Ryan S Mullins // Licensed under the MIT Software License -(function (window, angular, Hammer) { +(function(window, angular, Hammer) { 'use strict'; // Checking to make sure Hammer and Angular are defined - if (typeof angular === 'undefined') { - if (typeof require !== 'undefined' && require) { + if(typeof angular === 'undefined') { + if(typeof require !== 'undefined' && require) { try { angular = require('angular'); - } catch (e) { + } catch(e) { return console.log('ERROR: Angular Hammer could not require() a reference to angular'); } - } else if (typeof window.angular !== 'undefined') { + } else if(typeof window.angular !== 'undefined') { angular = window.angular; } else { return console.log('ERROR: Angular Hammer could not find or require() a reference to angular'); } } - if (typeof Hammer === 'undefined') { - if (typeof require !== 'undefined' && require) { + if(typeof Hammer === 'undefined') { + if(typeof require !== 'undefined' && require) { try { Hammer = require('hammerjs'); - } catch (e) { + } catch(e) { return console.log('ERROR: Angular Hammer could not require() a reference to Hammer'); } - } else if (typeof window.Hammer !== 'undefined') { + } else if(typeof window.Hammer !== 'undefined') { Hammer = window.Hammer; } else { return console.log('ERROR: Angular Hammer could not find or require() a reference to Hammer'); @@ -94,186 +94,225 @@ * @param {String} type Mapping in the form of : * @return None */ - angular.forEach(gestureTypes, function (type) { + angular.forEach(gestureTypes, function(type) { var directive = type.split(':'), - directiveName = directive[0], - eventName = directive[1]; + directiveName = directive[0], + eventName = directive[1]; angular.module('hmTouchEvents') - .directive(directiveName, ['$parse', '$window', function ($parse, $window) { - return { - 'restrict' : 'A', - 'link' : function (scope, element, attrs) { - - // Check for Hammer and required functionality - // If no Hammer, maybe bind tap and doubletap to click and dblclick + .directive(directiveName, [ + '$parse', '$window', function($parse, $window) { + return { + 'restrict': 'A', + 'link': function(scope, element, attrs) { + + // Check for Hammer and required functionality + // If no Hammer, maybe bind tap and doubletap to click and dblclick + + if(!Hammer || !$window.addEventListener) { + if(directiveName === 'hmTap') { + element.bind('click', handler); + } - if (!Hammer || !$window.addEventListener) { - if (directiveName === 'hmTap') { - element.bind('click', handler); - } + if(directiveName === 'hmDoubletap') { + element.bind('dblclick', handler); + } - if (directiveName === 'hmDoubletap') { - element.bind('dblclick', handler); + return; } - return; - } - - var hammer = element.data('hammer'), + var hammer = element.data('hammer'), managerOpts = angular.fromJson(attrs.hmManagerOptions), recognizerOpts = angular.fromJson(attrs.hmRecognizerOptions); + // Check for a manager, make one if needed and destroy it when + // the scope is destroyed - // Check for a manager, make one if needed and destroy it when - // the scope is destroyed - - if (!hammer) { - hammer = new Hammer.Manager(element[0], managerOpts); - element.data('hammer', hammer); - scope.$on('$destroy', function () { - hammer.destroy(); - }); - } + if(!hammer) { + hammer = new Hammer.Manager(element[0], managerOpts); + element.data('hammer', hammer); + scope.$on('$destroy', function() { + hammer.destroy(); + }); + } - // Instantiate the handler + // Instantiate the handler - var handlerName = attrs[directiveName], + var handlerName = attrs[directiveName], handlerExpr = $parse(handlerName), - handler = function (event) { + handler = function(event) { var phase = scope.$root.$$phase, - recognizer = hammer.get(event.type); + recognizer = hammer.get(event.type); event.element = element; - if (recognizer) { - if (recognizer.options.preventDefault) { + if(recognizer) { + if(recognizer.options.preventDefault) { event.preventDefault(); } - if (recognizer.options.stopPropagation) { + if(recognizer.options.stopPropagation) { event.srcEvent.stopPropagation(); } } - if (phase === '$apply' || phase === '$digest') { + if(phase === '$apply' || phase === '$digest') { callHandler(); } else { scope.$apply(callHandler); } - function callHandler () { - var fn = handlerExpr(scope, {'$event':event}); + function callHandler() { + var fn = handlerExpr(scope, {'$event': event}); - if (fn) { + if(fn) { fn.call(scope, event); } } }; - // Setting up the recognizers based on the supplied options + // Setting up the recognizers based on the supplied options + + if(angular.isArray(recognizerOpts)) { + // The recognizer options may be stored in an array. In this + // case, Angular Hammer iterates through the array of options + // trying to find an occurrence of the options.type in the event + // name. If it find the type in the event name, it applies those + // options to the recognizer for events with that name. If it + // does not find the type in the event name it moves on. - if (angular.isArray(recognizerOpts)) { - // The recognizer options may be stored in an array. In this - // case, Angular Hammer iterates through the array of options - // trying to find an occurrence of the options.type in the event - // name. If it find the type in the event name, it applies those - // options to the recognizer for events with that name. If it - // does not find the type in the event name it moves on. + angular.forEach(recognizerOpts, function(options) { + if(directiveName === 'hmCustom') { + eventName = options.event; + } else { + if(!options.type) { + options.type = getRecognizerTypeFromeventName(eventName); + } + + if(options.event) { + delete options.event; + } + } - angular.forEach(recognizerOpts, function (options) { - if (directiveName === 'hmCustom') { - eventName = options.event; + if(directiveName === 'hmCustom' || + eventName.indexOf(options.type) > -1) { + setupRecognizerWithOptions( + hammer, + applyManagerOptions(managerOpts, options), + element); + } + }); + } else if(angular.isObject(recognizerOpts)) { + // Recognizer options may be stored as an object. In this case, + // Angular Hammer checks to make sure that the options type + // property is found in the event name. If the options are + // designated for this general type of event, Angular Hammer + // applies the options directly to the manager instance for + // this element. + + if(directiveName === 'hmCustom') { + eventName = recognizerOpts.event; } else { - if (!options.type) { - options.type = getRecognizerTypeFromeventName(eventName); + if(!recognizerOpts.type) { + recognizerOpts.type = getRecognizerTypeFromeventName(eventName); } - if (options.event) { - delete options.event; + if(recognizerOpts.event) { + delete recognizerOpts.event; } } - if (directiveName === 'hmCustom' || - eventName.indexOf(options.type) > -1) { + if(directiveName === 'hmCustom' || + eventName.indexOf(recognizerOpts.type) > -1) { setupRecognizerWithOptions( hammer, - applyManagerOptions(managerOpts, options), + applyManagerOptions(managerOpts, recognizerOpts), element); } - }); - } else if (angular.isObject(recognizerOpts)) { - // Recognizer options may be stored as an object. In this case, - // Angular Hammer checks to make sure that the options type - // property is found in the event name. If the options are - // designated for this general type of event, Angular Hammer - // applies the options directly to the manager instance for - // this element. - - if (directiveName === 'hmCustom') { - eventName = recognizerOpts.event; - } else { - if (!recognizerOpts.type) { - recognizerOpts.type = getRecognizerTypeFromeventName(eventName); - } + } else if(directiveName !== 'hmCustom') { + // If no options are supplied, or the supplied options do not + // match any of the above conditions, Angular Hammer sets up + // the default options that a manager instantiated using + // Hammer() would have. + + recognizerOpts = { + 'type': getRecognizerTypeFromeventName(eventName) + }; - if (recognizerOpts.event) { - delete recognizerOpts.event; + if(directiveName === 'hmDoubletap') { + recognizerOpts.event = eventName; + recognizerOpts.taps = 2; + + if(hammer.get('tap')) { + recognizerOpts.recognizeWith = 'tap'; } - } + } + + if(recognizerOpts.type.indexOf('pan') > -1 && + hammer.get('swipe')) { + recognizerOpts.recognizeWith = 'swipe'; + } + + if(recognizerOpts.type.indexOf('pinch') > -1 && + hammer.get('rotate')) { + recognizerOpts.recognizeWith = 'rotate'; + } - if (directiveName === 'hmCustom' || - eventName.indexOf(recognizerOpts.type) > -1) { setupRecognizerWithOptions( hammer, applyManagerOptions(managerOpts, recognizerOpts), element); - } - } else if (directiveName !== 'hmCustom') { - // If no options are supplied, or the supplied options do not - // match any of the above conditions, Angular Hammer sets up - // the default options that a manager instantiated using - // Hammer() would have. - - recognizerOpts = { - 'type': getRecognizerTypeFromeventName(eventName) - }; - - if (directiveName === 'hmDoubletap') { - recognizerOpts.event = eventName; - recognizerOpts.taps = 2; - - if (hammer.get('tap')) { - recognizerOpts.recognizeWith = 'tap'; - } + } else { + eventName = null; } - if (recognizerOpts.type.indexOf('pan') > -1 && - hammer.get('swipe')) { - recognizerOpts.recognizeWith = 'swipe'; + if(eventName) { + hammer.on(eventName, handler); } + } + }; + } + ]); + }); - if (recognizerOpts.type.indexOf('pinch') > -1 && - hammer.get('rotate')) { - recognizerOpts.recognizeWith = 'rotate'; - } + hmTouchEvents.directive('hmRequireFailure', [ + '$log', function($log) { - setupRecognizerWithOptions( - hammer, - applyManagerOptions(managerOpts, recognizerOpts), - element); - } else { - eventName = null; - } + return { + priority: 1000, + restrict: 'A', + scope: {}, + link: function(scope, element, attrs) { - if (eventName) { - hammer.on(eventName, handler); - } - } - }; - }]); - }); + var manager = element.data('hammer'), + mapping = angular.fromJson(attrs.hmRequireFailure); + + if(manager) { + angular.forEach(mapping, function(requiredEventNames, eventName) { + + // find actual events and filter any that the manager doesn't know about + var event = manager.get(eventName), + requiredEvents = [].concat(requiredEventNames).map(function(name) { + var event = manager.get(name); + if(!event) { + $log.warn('Event [' + name + '] was not be added to requireFailure for event [' + eventName + ']'); + } + return event; + }).filter(function(event) { + return event; + }); + if(event && requiredEvents.length > 0) { + event.requireFailure(requiredEvents); + } else { + $log.warn('No events where added to requireFailure for event [' + eventName + ']'); + } + }); + } + } + } + } + ]); // ---- Private Functions ----- /** @@ -285,20 +324,20 @@ * @return {Object} Reference to the new gesture recognizer, if successful, * null otherwise. */ - function addRecognizer (manager, options) { - if (!manager || !options || !options.type) { return null; } + function addRecognizer(manager, options) { + if(!manager || !options || !options.type) { return null; } var recognizer; - if (options.type.indexOf('pan') > -1) { + if(options.type.indexOf('pan') > -1) { recognizer = new Hammer.Pan(options); - } else if (options.type.indexOf('pinch') > -1) { + } else if(options.type.indexOf('pinch') > -1) { recognizer = new Hammer.Pinch(options); - } else if (options.type.indexOf('press') > -1) { + } else if(options.type.indexOf('press') > -1) { recognizer = new Hammer.Press(options); - } else if (options.type.indexOf('rotate') > -1) { + } else if(options.type.indexOf('rotate') > -1) { recognizer = new Hammer.Rotate(options); - } else if (options.type.indexOf('swipe') > -1) { + } else if(options.type.indexOf('swipe') > -1) { recognizer = new Hammer.Swipe(options); } else { recognizer = new Hammer.Tap(options); @@ -315,8 +354,8 @@ * @param {Object} recognizerOpts Recognizer options * @return None */ - function applyManagerOptions (managerOpts, recognizerOpts) { - if (managerOpts) { + function applyManagerOptions(managerOpts, recognizerOpts) { + if(managerOpts) { recognizerOpts.preventGhosts = managerOpts.preventGhosts; } @@ -330,16 +369,16 @@ * @param {String} eventName Name to derive the recognizer type from * @return {string} Type of recognizer that fires events with that name */ - function getRecognizerTypeFromeventName (eventName) { - if (eventName.indexOf('pan') > -1) { + function getRecognizerTypeFromeventName(eventName) { + if(eventName.indexOf('pan') > -1) { return 'pan'; - } else if (eventName.indexOf('pinch') > -1) { + } else if(eventName.indexOf('pinch') > -1) { return 'pinch'; - } else if (eventName.indexOf('press') > -1) { + } else if(eventName.indexOf('press') > -1) { return 'press'; - } else if (eventName.indexOf('rotate') > -1) { + } else if(eventName.indexOf('rotate') > -1) { return 'rotate'; - } else if (eventName.indexOf('swipe') > -1) { + } else if(eventName.indexOf('swipe') > -1) { return 'swipe'; } else { return 'tap'; @@ -355,25 +394,25 @@ * @param {Object} options Options applied to a recognizer managed by manager * @return None */ - function setupRecognizerWithOptions (manager, options, element) { - if (!manager || !options) { return; } + function setupRecognizerWithOptions(manager, options, element) { + if(!manager || !options) { return; } var recognizer = manager.get(options.type); - if (!recognizer) { + if(!recognizer) { recognizer = addRecognizer(manager, options); } - if (!options.directions) { - if (options.type === 'pan' || options.type === 'swipe') { + if(!options.directions) { + if(options.type === 'pan' || options.type === 'swipe') { options.directions = 'DIRECTION_ALL'; - } else if (options.type.indexOf('left') > -1) { + } else if(options.type.indexOf('left') > -1) { options.directions = 'DIRECTION_LEFT'; - } else if (options.type.indexOf('right') > -1) { + } else if(options.type.indexOf('right') > -1) { options.directions = 'DIRECTION_RIGHT'; - } else if (options.type.indexOf('up') > -1) { + } else if(options.type.indexOf('up') > -1) { options.directions = 'DIRECTION_UP'; - } else if (options.type.indexOf('down') > -1) { + } else if(options.type.indexOf('down') > -1) { options.directions = 'DIRECTION_DOWN'; } else { options.directions = ''; @@ -383,31 +422,31 @@ options.direction = parseDirections(options.directions); recognizer.set(options); - if (options.recognizeWith) { - if (!manager.get(options.recognizeWith)){ - addRecognizer(manager, {type:options.recognizeWith}); + if(options.recognizeWith) { + if(!manager.get(options.recognizeWith)) { + addRecognizer(manager, {type: options.recognizeWith}); } recognizer.recognizeWith(manager.get(options.recognizeWith)); } - if (options.dropRecognizeWith && manager.get(options.dropRecognizeWith)) { + if(options.dropRecognizeWith && manager.get(options.dropRecognizeWith)) { recognizer.dropRecognizeWith(manager.get(options.dropRecognizeWith)); } - if (options.requireFailure) { - if (!manager.get(options.requireFailure)){ - addRecognizer(manager, {type:options.requireFailure}); + if(options.requireFailure) { + if(!manager.get(options.requireFailure)) { + addRecognizer(manager, {type: options.requireFailure}); } recognizer.requireFailure(manager.get(options.requireFailure)); } - if (options.dropRequireFailure && manager.get(options.dropRequireFailure)) { + if(options.dropRequireFailure && manager.get(options.dropRequireFailure)) { recognizer.dropRequireFailure(manager.get(options.dropRequireFailure)); } - if (options.preventGhosts && element) { + if(options.preventGhosts && element) { preventGhosts(element); } } @@ -419,11 +458,11 @@ * @param {String} dirs Direction names separated by '|' characters * @return {Number} Hammer.js direction value */ - function parseDirections (dirs) { + function parseDirections(dirs) { var directions = 0; - angular.forEach(dirs.split('|'), function (direction) { - if (Hammer.hasOwnProperty(direction)) { + angular.forEach(dirs.split('|'), function(direction) { + if(Hammer.hasOwnProperty(direction)) { directions = directions | Hammer[direction]; } }); @@ -442,14 +481,14 @@ * https://developers.google.com/mobile/articles/fast_buttons#ghost */ - function preventGhosts (element) { - if (!element) { return; } + function preventGhosts(element) { + if(!element) { return; } var coordinates = [], - threshold = 25, - timeout = 2500; + threshold = 25, + timeout = 2500; - if ('ontouchstart' in window) { + if('ontouchstart' in window) { element[0].addEventListener('touchstart', resetCoordinates, true); element[0].addEventListener('touchend', registerCoordinates, true); element[0].addEventListener('click', preventGhostClick, true); @@ -460,14 +499,14 @@ * prevent clicks if they're in a registered XY region * @param {MouseEvent} ev */ - function preventGhostClick (ev) { - for (var i = 0; i < coordinates.length; i++) { + function preventGhostClick(ev) { + for(var i = 0; i < coordinates.length; i++) { var x = coordinates[i][0]; var y = coordinates[i][1]; // within the range, so prevent the click - if (Math.abs(ev.clientX - x) < threshold && - Math.abs(ev.clientY - y) < threshold) { + if(Math.abs(ev.clientX - x) < threshold && + Math.abs(ev.clientY - y) < threshold) { ev.stopPropagation(); ev.preventDefault(); break; @@ -478,14 +517,14 @@ /** * reset the coordinates array */ - function resetCoordinates () { + function resetCoordinates() { coordinates = []; } /** * remove the first coordinates set from the array */ - function popCoordinates () { + function popCoordinates() { coordinates.splice(0, 1); } @@ -493,7 +532,7 @@ * if it is an final touchend, we want to register it's place * @param {TouchEvent} ev */ - function registerCoordinates (ev) { + function registerCoordinates(ev) { // touchend is triggered on every releasing finger // changed touches always contain the removed touches on a touchend // the touches object might contain these also at some browsers (firefox os) From 4ddea1bb167609723fd67e1ccdfbbba4354be3a9 Mon Sep 17 00:00:00 2001 From: Carlos Lawton Date: Thu, 16 Jul 2015 13:16:12 -0400 Subject: [PATCH 2/5] - Added support for inline definition mapping. - Fixed space reformatting --- angular.hammer.js | 1082 ++++++++++++++++++++++----------------------- 1 file changed, 541 insertions(+), 541 deletions(-) diff --git a/angular.hammer.js b/angular.hammer.js index 203ac0b..6cd9f93 100644 --- a/angular.hammer.js +++ b/angular.hammer.js @@ -4,545 +4,545 @@ // Licensed under the MIT Software License (function(window, angular, Hammer) { - 'use strict'; - - // Checking to make sure Hammer and Angular are defined - - if(typeof angular === 'undefined') { - if(typeof require !== 'undefined' && require) { - try { - angular = require('angular'); - } catch(e) { - return console.log('ERROR: Angular Hammer could not require() a reference to angular'); - } - } else if(typeof window.angular !== 'undefined') { - angular = window.angular; - } else { - return console.log('ERROR: Angular Hammer could not find or require() a reference to angular'); - } - } - - if(typeof Hammer === 'undefined') { - if(typeof require !== 'undefined' && require) { - try { - Hammer = require('hammerjs'); - } catch(e) { - return console.log('ERROR: Angular Hammer could not require() a reference to Hammer'); - } - } else if(typeof window.Hammer !== 'undefined') { - Hammer = window.Hammer; - } else { - return console.log('ERROR: Angular Hammer could not find or require() a reference to Hammer'); - } - } - - /** - * Mapping of the gesture event names with the Angular attribute directive - * names. Follows the form: :. - * - * @type {Array} - */ - var gestureTypes = [ - 'hmCustom:custom', - 'hmSwipe:swipe', - 'hmSwipeleft:swipeleft', - 'hmSwiperight:swiperight', - 'hmSwipeup:swipeup', - 'hmSwipedown:swipedown', - 'hmPan:pan', - 'hmPanstart:panstart', - 'hmPanmove:panmove', - 'hmPanend:panend', - 'hmPancancel:pancancel', - 'hmPanleft:panleft', - 'hmPanright:panright', - 'hmPanup:panup', - 'hmPandown:pandown', - 'hmPress:press', - 'hmPressup:pressup', - 'hmRotate:rotate', - 'hmRotatestart:rotatestart', - 'hmRotatemove:rotatemove', - 'hmRotateend:rotateend', - 'hmRotatecancel:rotatecancel', - 'hmPinch:pinch', - 'hmPinchstart:pinchstart', - 'hmPinchmove:pinchmove', - 'hmPinchend:pinchend', - 'hmPinchcancel:pinchcancel', - 'hmPinchin:pinchin', - 'hmPinchout:pinchout', - 'hmTap:tap', - 'hmDoubletap:doubletap' - ]; - - // ---- Module Definition ---- - - /** - * @module hmTouchEvents - * @description Angular.js module for adding Hammer.js event listeners to HTML - * elements using attribute directives - * @requires angular - * @requires hammer - */ - angular.module('hmTouchEvents', []); - - /** - * Iterates through each gesture type mapping and creates a directive for - * each of the - * - * @param {String} type Mapping in the form of : - * @return None - */ - angular.forEach(gestureTypes, function(type) { - var directive = type.split(':'), - directiveName = directive[0], - eventName = directive[1]; - - angular.module('hmTouchEvents') - .directive(directiveName, [ - '$parse', '$window', function($parse, $window) { - return { - 'restrict': 'A', - 'link': function(scope, element, attrs) { - - // Check for Hammer and required functionality - // If no Hammer, maybe bind tap and doubletap to click and dblclick - - if(!Hammer || !$window.addEventListener) { - if(directiveName === 'hmTap') { - element.bind('click', handler); - } - - if(directiveName === 'hmDoubletap') { - element.bind('dblclick', handler); - } - - return; - } - - var hammer = element.data('hammer'), - managerOpts = angular.fromJson(attrs.hmManagerOptions), - recognizerOpts = angular.fromJson(attrs.hmRecognizerOptions); - - // Check for a manager, make one if needed and destroy it when - // the scope is destroyed - - if(!hammer) { - hammer = new Hammer.Manager(element[0], managerOpts); - element.data('hammer', hammer); - scope.$on('$destroy', function() { - hammer.destroy(); - }); - } - - // Instantiate the handler - - var handlerName = attrs[directiveName], - handlerExpr = $parse(handlerName), - handler = function(event) { - var phase = scope.$root.$$phase, - recognizer = hammer.get(event.type); - - event.element = element; - - if(recognizer) { - if(recognizer.options.preventDefault) { - event.preventDefault(); - } - - if(recognizer.options.stopPropagation) { - event.srcEvent.stopPropagation(); - } - } - - if(phase === '$apply' || phase === '$digest') { - callHandler(); - } else { - scope.$apply(callHandler); - } - - function callHandler() { - var fn = handlerExpr(scope, {'$event': event}); - - if(fn) { - fn.call(scope, event); - } - } - }; - - // Setting up the recognizers based on the supplied options - - if(angular.isArray(recognizerOpts)) { - // The recognizer options may be stored in an array. In this - // case, Angular Hammer iterates through the array of options - // trying to find an occurrence of the options.type in the event - // name. If it find the type in the event name, it applies those - // options to the recognizer for events with that name. If it - // does not find the type in the event name it moves on. - - angular.forEach(recognizerOpts, function(options) { - if(directiveName === 'hmCustom') { - eventName = options.event; - } else { - if(!options.type) { - options.type = getRecognizerTypeFromeventName(eventName); - } - - if(options.event) { - delete options.event; - } - } - - if(directiveName === 'hmCustom' || - eventName.indexOf(options.type) > -1) { - setupRecognizerWithOptions( - hammer, - applyManagerOptions(managerOpts, options), - element); - } - }); - } else if(angular.isObject(recognizerOpts)) { - // Recognizer options may be stored as an object. In this case, - // Angular Hammer checks to make sure that the options type - // property is found in the event name. If the options are - // designated for this general type of event, Angular Hammer - // applies the options directly to the manager instance for - // this element. - - if(directiveName === 'hmCustom') { - eventName = recognizerOpts.event; - } else { - if(!recognizerOpts.type) { - recognizerOpts.type = getRecognizerTypeFromeventName(eventName); - } - - if(recognizerOpts.event) { - delete recognizerOpts.event; - } - } - - if(directiveName === 'hmCustom' || - eventName.indexOf(recognizerOpts.type) > -1) { - setupRecognizerWithOptions( - hammer, - applyManagerOptions(managerOpts, recognizerOpts), - element); - } - } else if(directiveName !== 'hmCustom') { - // If no options are supplied, or the supplied options do not - // match any of the above conditions, Angular Hammer sets up - // the default options that a manager instantiated using - // Hammer() would have. - - recognizerOpts = { - 'type': getRecognizerTypeFromeventName(eventName) - }; - - if(directiveName === 'hmDoubletap') { - recognizerOpts.event = eventName; - recognizerOpts.taps = 2; - - if(hammer.get('tap')) { - recognizerOpts.recognizeWith = 'tap'; - } - } - - if(recognizerOpts.type.indexOf('pan') > -1 && - hammer.get('swipe')) { - recognizerOpts.recognizeWith = 'swipe'; - } - - if(recognizerOpts.type.indexOf('pinch') > -1 && - hammer.get('rotate')) { - recognizerOpts.recognizeWith = 'rotate'; - } - - setupRecognizerWithOptions( - hammer, - applyManagerOptions(managerOpts, recognizerOpts), - element); - } else { - eventName = null; - } - - if(eventName) { - hammer.on(eventName, handler); - } - } - }; - } - ]); - }); - - hmTouchEvents.directive('hmRequireFailure', [ - '$log', function($log) { - - return { - priority: 1000, - restrict: 'A', - scope: {}, - link: function(scope, element, attrs) { - - var manager = element.data('hammer'), - mapping = angular.fromJson(attrs.hmRequireFailure); - - if(manager) { - angular.forEach(mapping, function(requiredEventNames, eventName) { - - // find actual events and filter any that the manager doesn't know about - var event = manager.get(eventName), - requiredEvents = [].concat(requiredEventNames).map(function(name) { - var event = manager.get(name); - if(!event) { - $log.warn('Event [' + name + '] was not be added to requireFailure for event [' + eventName + ']'); - } - return event; - }).filter(function(event) { - return event; - }); - - if(event && requiredEvents.length > 0) { - event.requireFailure(requiredEvents); - } else { - $log.warn('No events where added to requireFailure for event [' + eventName + ']'); - } - }); - } - } - } - } - ]); - // ---- Private Functions ----- - - /** - * Adds a gesture recognizer to a given manager. The type of recognizer to - * add is determined by the value of the options.type property. - * - * @param {Object} manager Hammer.js manager object assigned to an element - * @param {Object} options Options that define the recognizer to add - * @return {Object} Reference to the new gesture recognizer, if successful, - * null otherwise. - */ - function addRecognizer(manager, options) { - if(!manager || !options || !options.type) { return null; } - - var recognizer; - - if(options.type.indexOf('pan') > -1) { - recognizer = new Hammer.Pan(options); - } else if(options.type.indexOf('pinch') > -1) { - recognizer = new Hammer.Pinch(options); - } else if(options.type.indexOf('press') > -1) { - recognizer = new Hammer.Press(options); - } else if(options.type.indexOf('rotate') > -1) { - recognizer = new Hammer.Rotate(options); - } else if(options.type.indexOf('swipe') > -1) { - recognizer = new Hammer.Swipe(options); - } else { - recognizer = new Hammer.Tap(options); - } - - manager.add(recognizer); - return recognizer; - } - - /** - * Applies certain manager options to individual recognizer options. - * - * @param {Object} managerOpts Manager options - * @param {Object} recognizerOpts Recognizer options - * @return None - */ - function applyManagerOptions(managerOpts, recognizerOpts) { - if(managerOpts) { - recognizerOpts.preventGhosts = managerOpts.preventGhosts; - } - - return recognizerOpts; - } - - /** - * Extracts the type of recognizer that should be instantiated from a given - * event name. Used only when no recognizer options are provided. - * - * @param {String} eventName Name to derive the recognizer type from - * @return {string} Type of recognizer that fires events with that name - */ - function getRecognizerTypeFromeventName(eventName) { - if(eventName.indexOf('pan') > -1) { - return 'pan'; - } else if(eventName.indexOf('pinch') > -1) { - return 'pinch'; - } else if(eventName.indexOf('press') > -1) { - return 'press'; - } else if(eventName.indexOf('rotate') > -1) { - return 'rotate'; - } else if(eventName.indexOf('swipe') > -1) { - return 'swipe'; - } else { - return 'tap'; - } - } - - /** - * Applies the passed options object to the appropriate gesture recognizer. - * Recognizers are created if they do not already exist. See the README for a - * description of the options object that can be passed to this function. - * - * @param {Object} manager Hammer.js manager object assigned to an element - * @param {Object} options Options applied to a recognizer managed by manager - * @return None - */ - function setupRecognizerWithOptions(manager, options, element) { - if(!manager || !options) { return; } - - var recognizer = manager.get(options.type); - - if(!recognizer) { - recognizer = addRecognizer(manager, options); - } - - if(!options.directions) { - if(options.type === 'pan' || options.type === 'swipe') { - options.directions = 'DIRECTION_ALL'; - } else if(options.type.indexOf('left') > -1) { - options.directions = 'DIRECTION_LEFT'; - } else if(options.type.indexOf('right') > -1) { - options.directions = 'DIRECTION_RIGHT'; - } else if(options.type.indexOf('up') > -1) { - options.directions = 'DIRECTION_UP'; - } else if(options.type.indexOf('down') > -1) { - options.directions = 'DIRECTION_DOWN'; - } else { - options.directions = ''; - } - } - - options.direction = parseDirections(options.directions); - recognizer.set(options); - - if(options.recognizeWith) { - if(!manager.get(options.recognizeWith)) { - addRecognizer(manager, {type: options.recognizeWith}); - } - - recognizer.recognizeWith(manager.get(options.recognizeWith)); - } - - if(options.dropRecognizeWith && manager.get(options.dropRecognizeWith)) { - recognizer.dropRecognizeWith(manager.get(options.dropRecognizeWith)); - } - - if(options.requireFailure) { - if(!manager.get(options.requireFailure)) { - addRecognizer(manager, {type: options.requireFailure}); - } - - recognizer.requireFailure(manager.get(options.requireFailure)); - } - - if(options.dropRequireFailure && manager.get(options.dropRequireFailure)) { - recognizer.dropRequireFailure(manager.get(options.dropRequireFailure)); - } - - if(options.preventGhosts && element) { - preventGhosts(element); - } - } - - /** - * Parses the value of the directions property of any Angular Hammer options - * object and converts them into the standard Hammer.js directions values. - * - * @param {String} dirs Direction names separated by '|' characters - * @return {Number} Hammer.js direction value - */ - function parseDirections(dirs) { - var directions = 0; - - angular.forEach(dirs.split('|'), function(direction) { - if(Hammer.hasOwnProperty(direction)) { - directions = directions | Hammer[direction]; - } - }); - - return directions; - } - - // ---- Preventing Ghost Clicks ---- - - /** - * Modified from: https://gist.github.com/jtangelder/361052976f044200ea17 - * - * Prevent click events after a touchend. - * - * Inspired/copy-paste from this article of Google by Ryan Fioravanti - * https://developers.google.com/mobile/articles/fast_buttons#ghost - */ - - function preventGhosts(element) { - if(!element) { return; } - - var coordinates = [], - threshold = 25, - timeout = 2500; - - if('ontouchstart' in window) { - element[0].addEventListener('touchstart', resetCoordinates, true); - element[0].addEventListener('touchend', registerCoordinates, true); - element[0].addEventListener('click', preventGhostClick, true); - element[0].addEventListener('mouseup', preventGhostClick, true); - } - - /** - * prevent clicks if they're in a registered XY region - * @param {MouseEvent} ev - */ - function preventGhostClick(ev) { - for(var i = 0; i < coordinates.length; i++) { - var x = coordinates[i][0]; - var y = coordinates[i][1]; - - // within the range, so prevent the click - if(Math.abs(ev.clientX - x) < threshold && - Math.abs(ev.clientY - y) < threshold) { - ev.stopPropagation(); - ev.preventDefault(); - break; - } - } - } - - /** - * reset the coordinates array - */ - function resetCoordinates() { - coordinates = []; - } - - /** - * remove the first coordinates set from the array - */ - function popCoordinates() { - coordinates.splice(0, 1); - } - - /** - * if it is an final touchend, we want to register it's place - * @param {TouchEvent} ev - */ - function registerCoordinates(ev) { - // touchend is triggered on every releasing finger - // changed touches always contain the removed touches on a touchend - // the touches object might contain these also at some browsers (firefox os) - // so touches - changedTouches will be 0 or lower, like -1, on the final touchend - if(ev.touches.length - ev.changedTouches.length <= 0) { - var touch = ev.changedTouches[0]; - coordinates.push([touch.clientX, touch.clientY]); - - setTimeout(popCoordinates, timeout); - } - } - } + 'use strict'; + + // Checking to make sure Hammer and Angular are defined + + if(typeof angular === 'undefined') { + if(typeof require !== 'undefined' && require) { + try { + angular = require('angular'); + } catch(e) { + return console.log('ERROR: Angular Hammer could not require() a reference to angular'); + } + } else if(typeof window.angular !== 'undefined') { + angular = window.angular; + } else { + return console.log('ERROR: Angular Hammer could not find or require() a reference to angular'); + } + } + + if(typeof Hammer === 'undefined') { + if(typeof require !== 'undefined' && require) { + try { + Hammer = require('hammerjs'); + } catch(e) { + return console.log('ERROR: Angular Hammer could not require() a reference to Hammer'); + } + } else if(typeof window.Hammer !== 'undefined') { + Hammer = window.Hammer; + } else { + return console.log('ERROR: Angular Hammer could not find or require() a reference to Hammer'); + } + } + + /** + * Mapping of the gesture event names with the Angular attribute directive + * names. Follows the form: :. + * + * @type {Array} + */ + var gestureTypes = [ + 'hmCustom:custom', + 'hmSwipe:swipe', + 'hmSwipeleft:swipeleft', + 'hmSwiperight:swiperight', + 'hmSwipeup:swipeup', + 'hmSwipedown:swipedown', + 'hmPan:pan', + 'hmPanstart:panstart', + 'hmPanmove:panmove', + 'hmPanend:panend', + 'hmPancancel:pancancel', + 'hmPanleft:panleft', + 'hmPanright:panright', + 'hmPanup:panup', + 'hmPandown:pandown', + 'hmPress:press', + 'hmPressup:pressup', + 'hmRotate:rotate', + 'hmRotatestart:rotatestart', + 'hmRotatemove:rotatemove', + 'hmRotateend:rotateend', + 'hmRotatecancel:rotatecancel', + 'hmPinch:pinch', + 'hmPinchstart:pinchstart', + 'hmPinchmove:pinchmove', + 'hmPinchend:pinchend', + 'hmPinchcancel:pinchcancel', + 'hmPinchin:pinchin', + 'hmPinchout:pinchout', + 'hmTap:tap', + 'hmDoubletap:doubletap' + ]; + + // ---- Module Definition ---- + + /** + * @module hmTouchEvents + * @description Angular.js module for adding Hammer.js event listeners to HTML + * elements using attribute directives + * @requires angular + * @requires hammer + */ + angular.module('hmTouchEvents', []); + + /** + * Iterates through each gesture type mapping and creates a directive for + * each of the + * + * @param {String} type Mapping in the form of : + * @return None + */ + angular.forEach(gestureTypes, function(type) { + var directive = type.split(':'), + directiveName = directive[0], + eventName = directive[1]; + + angular.module('hmTouchEvents') + .directive(directiveName, [ + '$parse', '$window', function($parse, $window) { + return { + 'restrict': 'A', + 'link': function(scope, element, attrs) { + + // Check for Hammer and required functionality + // If no Hammer, maybe bind tap and doubletap to click and dblclick + + if(!Hammer || !$window.addEventListener) { + if(directiveName === 'hmTap') { + element.bind('click', handler); + } + + if(directiveName === 'hmDoubletap') { + element.bind('dblclick', handler); + } + + return; + } + + var hammer = element.data('hammer'), + managerOpts = angular.fromJson(attrs.hmManagerOptions), + recognizerOpts = angular.fromJson(attrs.hmRecognizerOptions); + + // Check for a manager, make one if needed and destroy it when + // the scope is destroyed + + if(!hammer) { + hammer = new Hammer.Manager(element[0], managerOpts); + element.data('hammer', hammer); + scope.$on('$destroy', function() { + hammer.destroy(); + }); + } + + // Instantiate the handler + + var handlerName = attrs[directiveName], + handlerExpr = $parse(handlerName), + handler = function(event) { + var phase = scope.$root.$$phase, + recognizer = hammer.get(event.type); + + event.element = element; + + if(recognizer) { + if(recognizer.options.preventDefault) { + event.preventDefault(); + } + + if(recognizer.options.stopPropagation) { + event.srcEvent.stopPropagation(); + } + } + + if(phase === '$apply' || phase === '$digest') { + callHandler(); + } else { + scope.$apply(callHandler); + } + + function callHandler() { + var fn = handlerExpr(scope, {'$event': event}); + + if(fn) { + fn.call(scope, event); + } + } + }; + + // Setting up the recognizers based on the supplied options + + if(angular.isArray(recognizerOpts)) { + // The recognizer options may be stored in an array. In this + // case, Angular Hammer iterates through the array of options + // trying to find an occurrence of the options.type in the event + // name. If it find the type in the event name, it applies those + // options to the recognizer for events with that name. If it + // does not find the type in the event name it moves on. + + angular.forEach(recognizerOpts, function(options) { + if(directiveName === 'hmCustom') { + eventName = options.event; + } else { + if(!options.type) { + options.type = getRecognizerTypeFromeventName(eventName); + } + + if(options.event) { + delete options.event; + } + } + + if(directiveName === 'hmCustom' || + eventName.indexOf(options.type) > -1) { + setupRecognizerWithOptions( + hammer, + applyManagerOptions(managerOpts, options), + element); + } + }); + } else if(angular.isObject(recognizerOpts)) { + // Recognizer options may be stored as an object. In this case, + // Angular Hammer checks to make sure that the options type + // property is found in the event name. If the options are + // designated for this general type of event, Angular Hammer + // applies the options directly to the manager instance for + // this element. + + if(directiveName === 'hmCustom') { + eventName = recognizerOpts.event; + } else { + if(!recognizerOpts.type) { + recognizerOpts.type = getRecognizerTypeFromeventName(eventName); + } + + if(recognizerOpts.event) { + delete recognizerOpts.event; + } + } + + if(directiveName === 'hmCustom' || + eventName.indexOf(recognizerOpts.type) > -1) { + setupRecognizerWithOptions( + hammer, + applyManagerOptions(managerOpts, recognizerOpts), + element); + } + } else if(directiveName !== 'hmCustom') { + // If no options are supplied, or the supplied options do not + // match any of the above conditions, Angular Hammer sets up + // the default options that a manager instantiated using + // Hammer() would have. + + recognizerOpts = { + 'type': getRecognizerTypeFromeventName(eventName) + }; + + if(directiveName === 'hmDoubletap') { + recognizerOpts.event = eventName; + recognizerOpts.taps = 2; + + if(hammer.get('tap')) { + recognizerOpts.recognizeWith = 'tap'; + } + } + + if(recognizerOpts.type.indexOf('pan') > -1 && + hammer.get('swipe')) { + recognizerOpts.recognizeWith = 'swipe'; + } + + if(recognizerOpts.type.indexOf('pinch') > -1 && + hammer.get('rotate')) { + recognizerOpts.recognizeWith = 'rotate'; + } + + setupRecognizerWithOptions( + hammer, + applyManagerOptions(managerOpts, recognizerOpts), + element); + } else { + eventName = null; + } + + if(eventName) { + hammer.on(eventName, handler); + } + } + }; + } + ]); + }); + + hmTouchEvents.directive('hmRequireFailure', [ + '$log', function($log) { + + return { + priority: 1000, + restrict: 'A', + scope: {}, + link: function(scope, element, attrs) { + + var manager = element.data('hammer'), + mapping = scope.$eval(attrs.hmRequireFailure); + + if(manager) { + angular.forEach(mapping, function(requiredEventNames, eventName) { + + // find actual events and filter any that the manager doesn't know about + var event = manager.get(eventName), + requiredEvents = [].concat(requiredEventNames).map(function(name) { + var event = manager.get(name); + if(!event) { + $log.warn('Event [' + name + '] was not be added to requireFailure for event [' + eventName + ']'); + } + return event; + }).filter(function(event) { + return event; + }); + + if(event && requiredEvents.length > 0) { + event.requireFailure(requiredEvents); + } else { + $log.warn('No events where added to requireFailure for event [' + eventName + ']'); + } + }); + } + } + } + } + ]); + // ---- Private Functions ----- + + /** + * Adds a gesture recognizer to a given manager. The type of recognizer to + * add is determined by the value of the options.type property. + * + * @param {Object} manager Hammer.js manager object assigned to an element + * @param {Object} options Options that define the recognizer to add + * @return {Object} Reference to the new gesture recognizer, if successful, + * null otherwise. + */ + function addRecognizer(manager, options) { + if(!manager || !options || !options.type) { return null; } + + var recognizer; + + if(options.type.indexOf('pan') > -1) { + recognizer = new Hammer.Pan(options); + } else if(options.type.indexOf('pinch') > -1) { + recognizer = new Hammer.Pinch(options); + } else if(options.type.indexOf('press') > -1) { + recognizer = new Hammer.Press(options); + } else if(options.type.indexOf('rotate') > -1) { + recognizer = new Hammer.Rotate(options); + } else if(options.type.indexOf('swipe') > -1) { + recognizer = new Hammer.Swipe(options); + } else { + recognizer = new Hammer.Tap(options); + } + + manager.add(recognizer); + return recognizer; + } + + /** + * Applies certain manager options to individual recognizer options. + * + * @param {Object} managerOpts Manager options + * @param {Object} recognizerOpts Recognizer options + * @return None + */ + function applyManagerOptions(managerOpts, recognizerOpts) { + if(managerOpts) { + recognizerOpts.preventGhosts = managerOpts.preventGhosts; + } + + return recognizerOpts; + } + + /** + * Extracts the type of recognizer that should be instantiated from a given + * event name. Used only when no recognizer options are provided. + * + * @param {String} eventName Name to derive the recognizer type from + * @return {string} Type of recognizer that fires events with that name + */ + function getRecognizerTypeFromeventName(eventName) { + if(eventName.indexOf('pan') > -1) { + return 'pan'; + } else if(eventName.indexOf('pinch') > -1) { + return 'pinch'; + } else if(eventName.indexOf('press') > -1) { + return 'press'; + } else if(eventName.indexOf('rotate') > -1) { + return 'rotate'; + } else if(eventName.indexOf('swipe') > -1) { + return 'swipe'; + } else { + return 'tap'; + } + } + + /** + * Applies the passed options object to the appropriate gesture recognizer. + * Recognizers are created if they do not already exist. See the README for a + * description of the options object that can be passed to this function. + * + * @param {Object} manager Hammer.js manager object assigned to an element + * @param {Object} options Options applied to a recognizer managed by manager + * @return None + */ + function setupRecognizerWithOptions(manager, options, element) { + if(!manager || !options) { return; } + + var recognizer = manager.get(options.type); + + if(!recognizer) { + recognizer = addRecognizer(manager, options); + } + + if(!options.directions) { + if(options.type === 'pan' || options.type === 'swipe') { + options.directions = 'DIRECTION_ALL'; + } else if(options.type.indexOf('left') > -1) { + options.directions = 'DIRECTION_LEFT'; + } else if(options.type.indexOf('right') > -1) { + options.directions = 'DIRECTION_RIGHT'; + } else if(options.type.indexOf('up') > -1) { + options.directions = 'DIRECTION_UP'; + } else if(options.type.indexOf('down') > -1) { + options.directions = 'DIRECTION_DOWN'; + } else { + options.directions = ''; + } + } + + options.direction = parseDirections(options.directions); + recognizer.set(options); + + if(options.recognizeWith) { + if(!manager.get(options.recognizeWith)) { + addRecognizer(manager, {type: options.recognizeWith}); + } + + recognizer.recognizeWith(manager.get(options.recognizeWith)); + } + + if(options.dropRecognizeWith && manager.get(options.dropRecognizeWith)) { + recognizer.dropRecognizeWith(manager.get(options.dropRecognizeWith)); + } + + if(options.requireFailure) { + if(!manager.get(options.requireFailure)) { + addRecognizer(manager, {type: options.requireFailure}); + } + + recognizer.requireFailure(manager.get(options.requireFailure)); + } + + if(options.dropRequireFailure && manager.get(options.dropRequireFailure)) { + recognizer.dropRequireFailure(manager.get(options.dropRequireFailure)); + } + + if(options.preventGhosts && element) { + preventGhosts(element); + } + } + + /** + * Parses the value of the directions property of any Angular Hammer options + * object and converts them into the standard Hammer.js directions values. + * + * @param {String} dirs Direction names separated by '|' characters + * @return {Number} Hammer.js direction value + */ + function parseDirections(dirs) { + var directions = 0; + + angular.forEach(dirs.split('|'), function(direction) { + if(Hammer.hasOwnProperty(direction)) { + directions = directions | Hammer[direction]; + } + }); + + return directions; + } + + // ---- Preventing Ghost Clicks ---- + + /** + * Modified from: https://gist.github.com/jtangelder/361052976f044200ea17 + * + * Prevent click events after a touchend. + * + * Inspired/copy-paste from this article of Google by Ryan Fioravanti + * https://developers.google.com/mobile/articles/fast_buttons#ghost + */ + + function preventGhosts(element) { + if(!element) { return; } + + var coordinates = [], + threshold = 25, + timeout = 2500; + + if('ontouchstart' in window) { + element[0].addEventListener('touchstart', resetCoordinates, true); + element[0].addEventListener('touchend', registerCoordinates, true); + element[0].addEventListener('click', preventGhostClick, true); + element[0].addEventListener('mouseup', preventGhostClick, true); + } + + /** + * prevent clicks if they're in a registered XY region + * @param {MouseEvent} ev + */ + function preventGhostClick(ev) { + for(var i = 0; i < coordinates.length; i++) { + var x = coordinates[i][0]; + var y = coordinates[i][1]; + + // within the range, so prevent the click + if(Math.abs(ev.clientX - x) < threshold && + Math.abs(ev.clientY - y) < threshold) { + ev.stopPropagation(); + ev.preventDefault(); + break; + } + } + } + + /** + * reset the coordinates array + */ + function resetCoordinates() { + coordinates = []; + } + + /** + * remove the first coordinates set from the array + */ + function popCoordinates() { + coordinates.splice(0, 1); + } + + /** + * if it is an final touchend, we want to register it's place + * @param {TouchEvent} ev + */ + function registerCoordinates(ev) { + // touchend is triggered on every releasing finger + // changed touches always contain the removed touches on a touchend + // the touches object might contain these also at some browsers (firefox os) + // so touches - changedTouches will be 0 or lower, like -1, on the final touchend + if(ev.touches.length - ev.changedTouches.length <= 0) { + var touch = ev.changedTouches[0]; + coordinates.push([touch.clientX, touch.clientY]); + + setTimeout(popCoordinates, timeout); + } + } + } })(window, window.angular, window.Hammer); From b2dcf2c3f1a68d35de33f5bd4aceda9b8470b4a1 Mon Sep 17 00:00:00 2001 From: Carlos Lawton Date: Thu, 16 Jul 2015 13:19:40 -0400 Subject: [PATCH 3/5] - Really fixed space reformatting --- angular.hammer.js | 1083 ++++++++++++++++++++++----------------------- 1 file changed, 541 insertions(+), 542 deletions(-) diff --git a/angular.hammer.js b/angular.hammer.js index 6cd9f93..cdb8974 100644 --- a/angular.hammer.js +++ b/angular.hammer.js @@ -3,546 +3,545 @@ // Copyright (c) 2014 Ryan S Mullins // Licensed under the MIT Software License -(function(window, angular, Hammer) { - 'use strict'; - - // Checking to make sure Hammer and Angular are defined - - if(typeof angular === 'undefined') { - if(typeof require !== 'undefined' && require) { - try { - angular = require('angular'); - } catch(e) { - return console.log('ERROR: Angular Hammer could not require() a reference to angular'); - } - } else if(typeof window.angular !== 'undefined') { - angular = window.angular; - } else { - return console.log('ERROR: Angular Hammer could not find or require() a reference to angular'); - } - } - - if(typeof Hammer === 'undefined') { - if(typeof require !== 'undefined' && require) { - try { - Hammer = require('hammerjs'); - } catch(e) { - return console.log('ERROR: Angular Hammer could not require() a reference to Hammer'); - } - } else if(typeof window.Hammer !== 'undefined') { - Hammer = window.Hammer; - } else { - return console.log('ERROR: Angular Hammer could not find or require() a reference to Hammer'); - } - } - - /** - * Mapping of the gesture event names with the Angular attribute directive - * names. Follows the form: :. - * - * @type {Array} - */ - var gestureTypes = [ - 'hmCustom:custom', - 'hmSwipe:swipe', - 'hmSwipeleft:swipeleft', - 'hmSwiperight:swiperight', - 'hmSwipeup:swipeup', - 'hmSwipedown:swipedown', - 'hmPan:pan', - 'hmPanstart:panstart', - 'hmPanmove:panmove', - 'hmPanend:panend', - 'hmPancancel:pancancel', - 'hmPanleft:panleft', - 'hmPanright:panright', - 'hmPanup:panup', - 'hmPandown:pandown', - 'hmPress:press', - 'hmPressup:pressup', - 'hmRotate:rotate', - 'hmRotatestart:rotatestart', - 'hmRotatemove:rotatemove', - 'hmRotateend:rotateend', - 'hmRotatecancel:rotatecancel', - 'hmPinch:pinch', - 'hmPinchstart:pinchstart', - 'hmPinchmove:pinchmove', - 'hmPinchend:pinchend', - 'hmPinchcancel:pinchcancel', - 'hmPinchin:pinchin', - 'hmPinchout:pinchout', - 'hmTap:tap', - 'hmDoubletap:doubletap' - ]; - - // ---- Module Definition ---- - - /** - * @module hmTouchEvents - * @description Angular.js module for adding Hammer.js event listeners to HTML - * elements using attribute directives - * @requires angular - * @requires hammer - */ - angular.module('hmTouchEvents', []); - - /** - * Iterates through each gesture type mapping and creates a directive for - * each of the - * - * @param {String} type Mapping in the form of : - * @return None - */ - angular.forEach(gestureTypes, function(type) { - var directive = type.split(':'), - directiveName = directive[0], - eventName = directive[1]; - - angular.module('hmTouchEvents') - .directive(directiveName, [ - '$parse', '$window', function($parse, $window) { - return { - 'restrict': 'A', - 'link': function(scope, element, attrs) { - - // Check for Hammer and required functionality - // If no Hammer, maybe bind tap and doubletap to click and dblclick - - if(!Hammer || !$window.addEventListener) { - if(directiveName === 'hmTap') { - element.bind('click', handler); - } - - if(directiveName === 'hmDoubletap') { - element.bind('dblclick', handler); - } - - return; - } - - var hammer = element.data('hammer'), - managerOpts = angular.fromJson(attrs.hmManagerOptions), - recognizerOpts = angular.fromJson(attrs.hmRecognizerOptions); - - // Check for a manager, make one if needed and destroy it when - // the scope is destroyed - - if(!hammer) { - hammer = new Hammer.Manager(element[0], managerOpts); - element.data('hammer', hammer); - scope.$on('$destroy', function() { - hammer.destroy(); - }); - } - - // Instantiate the handler - - var handlerName = attrs[directiveName], - handlerExpr = $parse(handlerName), - handler = function(event) { - var phase = scope.$root.$$phase, - recognizer = hammer.get(event.type); - - event.element = element; - - if(recognizer) { - if(recognizer.options.preventDefault) { - event.preventDefault(); - } - - if(recognizer.options.stopPropagation) { - event.srcEvent.stopPropagation(); - } - } - - if(phase === '$apply' || phase === '$digest') { - callHandler(); - } else { - scope.$apply(callHandler); - } - - function callHandler() { - var fn = handlerExpr(scope, {'$event': event}); - - if(fn) { - fn.call(scope, event); - } - } - }; - - // Setting up the recognizers based on the supplied options - - if(angular.isArray(recognizerOpts)) { - // The recognizer options may be stored in an array. In this - // case, Angular Hammer iterates through the array of options - // trying to find an occurrence of the options.type in the event - // name. If it find the type in the event name, it applies those - // options to the recognizer for events with that name. If it - // does not find the type in the event name it moves on. - - angular.forEach(recognizerOpts, function(options) { - if(directiveName === 'hmCustom') { - eventName = options.event; - } else { - if(!options.type) { - options.type = getRecognizerTypeFromeventName(eventName); - } - - if(options.event) { - delete options.event; - } - } - - if(directiveName === 'hmCustom' || - eventName.indexOf(options.type) > -1) { - setupRecognizerWithOptions( - hammer, - applyManagerOptions(managerOpts, options), - element); - } - }); - } else if(angular.isObject(recognizerOpts)) { - // Recognizer options may be stored as an object. In this case, - // Angular Hammer checks to make sure that the options type - // property is found in the event name. If the options are - // designated for this general type of event, Angular Hammer - // applies the options directly to the manager instance for - // this element. - - if(directiveName === 'hmCustom') { - eventName = recognizerOpts.event; - } else { - if(!recognizerOpts.type) { - recognizerOpts.type = getRecognizerTypeFromeventName(eventName); - } - - if(recognizerOpts.event) { - delete recognizerOpts.event; - } - } - - if(directiveName === 'hmCustom' || - eventName.indexOf(recognizerOpts.type) > -1) { - setupRecognizerWithOptions( - hammer, - applyManagerOptions(managerOpts, recognizerOpts), - element); - } - } else if(directiveName !== 'hmCustom') { - // If no options are supplied, or the supplied options do not - // match any of the above conditions, Angular Hammer sets up - // the default options that a manager instantiated using - // Hammer() would have. - - recognizerOpts = { - 'type': getRecognizerTypeFromeventName(eventName) - }; - - if(directiveName === 'hmDoubletap') { - recognizerOpts.event = eventName; - recognizerOpts.taps = 2; - - if(hammer.get('tap')) { - recognizerOpts.recognizeWith = 'tap'; - } - } - - if(recognizerOpts.type.indexOf('pan') > -1 && - hammer.get('swipe')) { - recognizerOpts.recognizeWith = 'swipe'; - } - - if(recognizerOpts.type.indexOf('pinch') > -1 && - hammer.get('rotate')) { - recognizerOpts.recognizeWith = 'rotate'; - } - - setupRecognizerWithOptions( - hammer, - applyManagerOptions(managerOpts, recognizerOpts), - element); - } else { - eventName = null; - } - - if(eventName) { - hammer.on(eventName, handler); - } - } - }; - } - ]); - }); - - hmTouchEvents.directive('hmRequireFailure', [ - '$log', function($log) { - - return { - priority: 1000, - restrict: 'A', - scope: {}, - link: function(scope, element, attrs) { - - var manager = element.data('hammer'), - mapping = scope.$eval(attrs.hmRequireFailure); - - if(manager) { - angular.forEach(mapping, function(requiredEventNames, eventName) { - - // find actual events and filter any that the manager doesn't know about - var event = manager.get(eventName), - requiredEvents = [].concat(requiredEventNames).map(function(name) { - var event = manager.get(name); - if(!event) { - $log.warn('Event [' + name + '] was not be added to requireFailure for event [' + eventName + ']'); - } - return event; - }).filter(function(event) { - return event; - }); - - if(event && requiredEvents.length > 0) { - event.requireFailure(requiredEvents); - } else { - $log.warn('No events where added to requireFailure for event [' + eventName + ']'); - } - }); - } - } - } - } - ]); - // ---- Private Functions ----- - - /** - * Adds a gesture recognizer to a given manager. The type of recognizer to - * add is determined by the value of the options.type property. - * - * @param {Object} manager Hammer.js manager object assigned to an element - * @param {Object} options Options that define the recognizer to add - * @return {Object} Reference to the new gesture recognizer, if successful, - * null otherwise. - */ - function addRecognizer(manager, options) { - if(!manager || !options || !options.type) { return null; } - - var recognizer; - - if(options.type.indexOf('pan') > -1) { - recognizer = new Hammer.Pan(options); - } else if(options.type.indexOf('pinch') > -1) { - recognizer = new Hammer.Pinch(options); - } else if(options.type.indexOf('press') > -1) { - recognizer = new Hammer.Press(options); - } else if(options.type.indexOf('rotate') > -1) { - recognizer = new Hammer.Rotate(options); - } else if(options.type.indexOf('swipe') > -1) { - recognizer = new Hammer.Swipe(options); - } else { - recognizer = new Hammer.Tap(options); - } - - manager.add(recognizer); - return recognizer; - } - - /** - * Applies certain manager options to individual recognizer options. - * - * @param {Object} managerOpts Manager options - * @param {Object} recognizerOpts Recognizer options - * @return None - */ - function applyManagerOptions(managerOpts, recognizerOpts) { - if(managerOpts) { - recognizerOpts.preventGhosts = managerOpts.preventGhosts; - } - - return recognizerOpts; - } - - /** - * Extracts the type of recognizer that should be instantiated from a given - * event name. Used only when no recognizer options are provided. - * - * @param {String} eventName Name to derive the recognizer type from - * @return {string} Type of recognizer that fires events with that name - */ - function getRecognizerTypeFromeventName(eventName) { - if(eventName.indexOf('pan') > -1) { - return 'pan'; - } else if(eventName.indexOf('pinch') > -1) { - return 'pinch'; - } else if(eventName.indexOf('press') > -1) { - return 'press'; - } else if(eventName.indexOf('rotate') > -1) { - return 'rotate'; - } else if(eventName.indexOf('swipe') > -1) { - return 'swipe'; - } else { - return 'tap'; - } - } - - /** - * Applies the passed options object to the appropriate gesture recognizer. - * Recognizers are created if they do not already exist. See the README for a - * description of the options object that can be passed to this function. - * - * @param {Object} manager Hammer.js manager object assigned to an element - * @param {Object} options Options applied to a recognizer managed by manager - * @return None - */ - function setupRecognizerWithOptions(manager, options, element) { - if(!manager || !options) { return; } - - var recognizer = manager.get(options.type); - - if(!recognizer) { - recognizer = addRecognizer(manager, options); - } - - if(!options.directions) { - if(options.type === 'pan' || options.type === 'swipe') { - options.directions = 'DIRECTION_ALL'; - } else if(options.type.indexOf('left') > -1) { - options.directions = 'DIRECTION_LEFT'; - } else if(options.type.indexOf('right') > -1) { - options.directions = 'DIRECTION_RIGHT'; - } else if(options.type.indexOf('up') > -1) { - options.directions = 'DIRECTION_UP'; - } else if(options.type.indexOf('down') > -1) { - options.directions = 'DIRECTION_DOWN'; - } else { - options.directions = ''; - } - } - - options.direction = parseDirections(options.directions); - recognizer.set(options); - - if(options.recognizeWith) { - if(!manager.get(options.recognizeWith)) { - addRecognizer(manager, {type: options.recognizeWith}); - } - - recognizer.recognizeWith(manager.get(options.recognizeWith)); - } - - if(options.dropRecognizeWith && manager.get(options.dropRecognizeWith)) { - recognizer.dropRecognizeWith(manager.get(options.dropRecognizeWith)); - } - - if(options.requireFailure) { - if(!manager.get(options.requireFailure)) { - addRecognizer(manager, {type: options.requireFailure}); - } - - recognizer.requireFailure(manager.get(options.requireFailure)); - } - - if(options.dropRequireFailure && manager.get(options.dropRequireFailure)) { - recognizer.dropRequireFailure(manager.get(options.dropRequireFailure)); - } - - if(options.preventGhosts && element) { - preventGhosts(element); - } - } - - /** - * Parses the value of the directions property of any Angular Hammer options - * object and converts them into the standard Hammer.js directions values. - * - * @param {String} dirs Direction names separated by '|' characters - * @return {Number} Hammer.js direction value - */ - function parseDirections(dirs) { - var directions = 0; - - angular.forEach(dirs.split('|'), function(direction) { - if(Hammer.hasOwnProperty(direction)) { - directions = directions | Hammer[direction]; - } - }); - - return directions; - } - - // ---- Preventing Ghost Clicks ---- - - /** - * Modified from: https://gist.github.com/jtangelder/361052976f044200ea17 - * - * Prevent click events after a touchend. - * - * Inspired/copy-paste from this article of Google by Ryan Fioravanti - * https://developers.google.com/mobile/articles/fast_buttons#ghost - */ - - function preventGhosts(element) { - if(!element) { return; } - - var coordinates = [], - threshold = 25, - timeout = 2500; - - if('ontouchstart' in window) { - element[0].addEventListener('touchstart', resetCoordinates, true); - element[0].addEventListener('touchend', registerCoordinates, true); - element[0].addEventListener('click', preventGhostClick, true); - element[0].addEventListener('mouseup', preventGhostClick, true); - } - - /** - * prevent clicks if they're in a registered XY region - * @param {MouseEvent} ev - */ - function preventGhostClick(ev) { - for(var i = 0; i < coordinates.length; i++) { - var x = coordinates[i][0]; - var y = coordinates[i][1]; - - // within the range, so prevent the click - if(Math.abs(ev.clientX - x) < threshold && - Math.abs(ev.clientY - y) < threshold) { - ev.stopPropagation(); - ev.preventDefault(); - break; - } - } - } - - /** - * reset the coordinates array - */ - function resetCoordinates() { - coordinates = []; - } - - /** - * remove the first coordinates set from the array - */ - function popCoordinates() { - coordinates.splice(0, 1); - } - - /** - * if it is an final touchend, we want to register it's place - * @param {TouchEvent} ev - */ - function registerCoordinates(ev) { - // touchend is triggered on every releasing finger - // changed touches always contain the removed touches on a touchend - // the touches object might contain these also at some browsers (firefox os) - // so touches - changedTouches will be 0 or lower, like -1, on the final touchend - if(ev.touches.length - ev.changedTouches.length <= 0) { - var touch = ev.changedTouches[0]; - coordinates.push([touch.clientX, touch.clientY]); - - setTimeout(popCoordinates, timeout); - } - } - } +(function (window, angular, Hammer) { + 'use strict'; + + // Checking to make sure Hammer and Angular are defined + + if (typeof angular === 'undefined') { + if (typeof require !== 'undefined' && require) { + try { + angular = require('angular'); + } catch (e) { + return console.log('ERROR: Angular Hammer could not require() a reference to angular'); + } + } else if (typeof window.angular !== 'undefined') { + angular = window.angular; + } else { + return console.log('ERROR: Angular Hammer could not find or require() a reference to angular'); + } + } + + if (typeof Hammer === 'undefined') { + if (typeof require !== 'undefined' && require) { + try { + Hammer = require('hammerjs'); + } catch (e) { + return console.log('ERROR: Angular Hammer could not require() a reference to Hammer'); + } + } else if (typeof window.Hammer !== 'undefined') { + Hammer = window.Hammer; + } else { + return console.log('ERROR: Angular Hammer could not find or require() a reference to Hammer'); + } + } + + /** + * Mapping of the gesture event names with the Angular attribute directive + * names. Follows the form: :. + * + * @type {Array} + */ + var gestureTypes = [ + 'hmCustom:custom', + 'hmSwipe:swipe', + 'hmSwipeleft:swipeleft', + 'hmSwiperight:swiperight', + 'hmSwipeup:swipeup', + 'hmSwipedown:swipedown', + 'hmPan:pan', + 'hmPanstart:panstart', + 'hmPanmove:panmove', + 'hmPanend:panend', + 'hmPancancel:pancancel', + 'hmPanleft:panleft', + 'hmPanright:panright', + 'hmPanup:panup', + 'hmPandown:pandown', + 'hmPress:press', + 'hmPressup:pressup', + 'hmRotate:rotate', + 'hmRotatestart:rotatestart', + 'hmRotatemove:rotatemove', + 'hmRotateend:rotateend', + 'hmRotatecancel:rotatecancel', + 'hmPinch:pinch', + 'hmPinchstart:pinchstart', + 'hmPinchmove:pinchmove', + 'hmPinchend:pinchend', + 'hmPinchcancel:pinchcancel', + 'hmPinchin:pinchin', + 'hmPinchout:pinchout', + 'hmTap:tap', + 'hmDoubletap:doubletap' + ]; + + // ---- Module Definition ---- + + /** + * @module hmTouchEvents + * @description Angular.js module for adding Hammer.js event listeners to HTML + * elements using attribute directives + * @requires angular + * @requires hammer + */ + angular.module('hmTouchEvents', []); + + /** + * Iterates through each gesture type mapping and creates a directive for + * each of the + * + * @param {String} type Mapping in the form of : + * @return None + */ + angular.forEach(gestureTypes, function (type) { + var directive = type.split(':'), + directiveName = directive[0], + eventName = directive[1]; + + angular.module('hmTouchEvents') + .directive(directiveName, ['$parse', '$window', function ($parse, $window) { + return { + 'restrict' : 'A', + 'link' : function (scope, element, attrs) { + + // Check for Hammer and required functionality + // If no Hammer, maybe bind tap and doubletap to click and dblclick + + if (!Hammer || !$window.addEventListener) { + if (directiveName === 'hmTap') { + element.bind('click', handler); + } + + if (directiveName === 'hmDoubletap') { + element.bind('dblclick', handler); + } + + return; + } + + var hammer = element.data('hammer'), + managerOpts = angular.fromJson(attrs.hmManagerOptions), + recognizerOpts = angular.fromJson(attrs.hmRecognizerOptions); + + + // Check for a manager, make one if needed and destroy it when + // the scope is destroyed + + if (!hammer) { + hammer = new Hammer.Manager(element[0], managerOpts); + element.data('hammer', hammer); + scope.$on('$destroy', function () { + hammer.destroy(); + }); + } + + // Instantiate the handler + + var handlerName = attrs[directiveName], + handlerExpr = $parse(handlerName), + handler = function (event) { + var phase = scope.$root.$$phase, + recognizer = hammer.get(event.type); + + event.element = element; + + if (recognizer) { + if (recognizer.options.preventDefault) { + event.preventDefault(); + } + + if (recognizer.options.stopPropagation) { + event.srcEvent.stopPropagation(); + } + } + + if (phase === '$apply' || phase === '$digest') { + callHandler(); + } else { + scope.$apply(callHandler); + } + + function callHandler () { + var fn = handlerExpr(scope, {'$event':event}); + + if (fn) { + fn.call(scope, event); + } + } + }; + + // Setting up the recognizers based on the supplied options + + if (angular.isArray(recognizerOpts)) { + // The recognizer options may be stored in an array. In this + // case, Angular Hammer iterates through the array of options + // trying to find an occurrence of the options.type in the event + // name. If it find the type in the event name, it applies those + // options to the recognizer for events with that name. If it + // does not find the type in the event name it moves on. + + angular.forEach(recognizerOpts, function (options) { + if (directiveName === 'hmCustom') { + eventName = options.event; + } else { + if (!options.type) { + options.type = getRecognizerTypeFromeventName(eventName); + } + + if (options.event) { + delete options.event; + } + } + + if (directiveName === 'hmCustom' || + eventName.indexOf(options.type) > -1) { + setupRecognizerWithOptions( + hammer, + applyManagerOptions(managerOpts, options), + element); + } + }); + } else if (angular.isObject(recognizerOpts)) { + // Recognizer options may be stored as an object. In this case, + // Angular Hammer checks to make sure that the options type + // property is found in the event name. If the options are + // designated for this general type of event, Angular Hammer + // applies the options directly to the manager instance for + // this element. + + if (directiveName === 'hmCustom') { + eventName = recognizerOpts.event; + } else { + if (!recognizerOpts.type) { + recognizerOpts.type = getRecognizerTypeFromeventName(eventName); + } + + if (recognizerOpts.event) { + delete recognizerOpts.event; + } + } + + if (directiveName === 'hmCustom' || + eventName.indexOf(recognizerOpts.type) > -1) { + setupRecognizerWithOptions( + hammer, + applyManagerOptions(managerOpts, recognizerOpts), + element); + } + } else if (directiveName !== 'hmCustom') { + // If no options are supplied, or the supplied options do not + // match any of the above conditions, Angular Hammer sets up + // the default options that a manager instantiated using + // Hammer() would have. + + recognizerOpts = { + 'type': getRecognizerTypeFromeventName(eventName) + }; + + if (directiveName === 'hmDoubletap') { + recognizerOpts.event = eventName; + recognizerOpts.taps = 2; + + if (hammer.get('tap')) { + recognizerOpts.recognizeWith = 'tap'; + } + } + + if (recognizerOpts.type.indexOf('pan') > -1 && + hammer.get('swipe')) { + recognizerOpts.recognizeWith = 'swipe'; + } + + if (recognizerOpts.type.indexOf('pinch') > -1 && + hammer.get('rotate')) { + recognizerOpts.recognizeWith = 'rotate'; + } + + setupRecognizerWithOptions( + hammer, + applyManagerOptions(managerOpts, recognizerOpts), + element); + } else { + eventName = null; + } + + if (eventName) { + hammer.on(eventName, handler); + } + } + }; + }]); + }); + + hmTouchEvents.directive('hmRequireFailure', [ + '$log', function($log) { + + return { + priority: 1000, + restrict: 'A', + scope: {}, + link: function(scope, element, attrs) { + + var manager = element.data('hammer'), + mapping = scope.$eval(attrs.hmRequireFailure); + + if(manager) { + angular.forEach(mapping, function(requiredEventNames, eventName) { + + // find actual events and filter any that the manager doesn't know about + var event = manager.get(eventName), + requiredEvents = [].concat(requiredEventNames).map(function(name) { + var event = manager.get(name); + if(!event) { + $log.warn('Event [' + name + '] was not be added to requireFailure for event [' + eventName + ']'); + } + return event; + }).filter(function(event) { + return event; + }); + + if(event && requiredEvents.length > 0) { + event.requireFailure(requiredEvents); + } else { + $log.warn('No events where added to requireFailure for event [' + eventName + ']'); + } + }); + } + } + } + } + ]); + // ---- Private Functions ----- + + /** + * Adds a gesture recognizer to a given manager. The type of recognizer to + * add is determined by the value of the options.type property. + * + * @param {Object} manager Hammer.js manager object assigned to an element + * @param {Object} options Options that define the recognizer to add + * @return {Object} Reference to the new gesture recognizer, if successful, + * null otherwise. + */ + function addRecognizer (manager, options) { + if (!manager || !options || !options.type) { return null; } + + var recognizer; + + if (options.type.indexOf('pan') > -1) { + recognizer = new Hammer.Pan(options); + } else if (options.type.indexOf('pinch') > -1) { + recognizer = new Hammer.Pinch(options); + } else if (options.type.indexOf('press') > -1) { + recognizer = new Hammer.Press(options); + } else if (options.type.indexOf('rotate') > -1) { + recognizer = new Hammer.Rotate(options); + } else if (options.type.indexOf('swipe') > -1) { + recognizer = new Hammer.Swipe(options); + } else { + recognizer = new Hammer.Tap(options); + } + + manager.add(recognizer); + return recognizer; + } + + /** + * Applies certain manager options to individual recognizer options. + * + * @param {Object} managerOpts Manager options + * @param {Object} recognizerOpts Recognizer options + * @return None + */ + function applyManagerOptions (managerOpts, recognizerOpts) { + if (managerOpts) { + recognizerOpts.preventGhosts = managerOpts.preventGhosts; + } + + return recognizerOpts; + } + + /** + * Extracts the type of recognizer that should be instantiated from a given + * event name. Used only when no recognizer options are provided. + * + * @param {String} eventName Name to derive the recognizer type from + * @return {string} Type of recognizer that fires events with that name + */ + function getRecognizerTypeFromeventName (eventName) { + if (eventName.indexOf('pan') > -1) { + return 'pan'; + } else if (eventName.indexOf('pinch') > -1) { + return 'pinch'; + } else if (eventName.indexOf('press') > -1) { + return 'press'; + } else if (eventName.indexOf('rotate') > -1) { + return 'rotate'; + } else if (eventName.indexOf('swipe') > -1) { + return 'swipe'; + } else { + return 'tap'; + } + } + + /** + * Applies the passed options object to the appropriate gesture recognizer. + * Recognizers are created if they do not already exist. See the README for a + * description of the options object that can be passed to this function. + * + * @param {Object} manager Hammer.js manager object assigned to an element + * @param {Object} options Options applied to a recognizer managed by manager + * @return None + */ + function setupRecognizerWithOptions (manager, options, element) { + if (!manager || !options) { return; } + + var recognizer = manager.get(options.type); + + if (!recognizer) { + recognizer = addRecognizer(manager, options); + } + + if (!options.directions) { + if (options.type === 'pan' || options.type === 'swipe') { + options.directions = 'DIRECTION_ALL'; + } else if (options.type.indexOf('left') > -1) { + options.directions = 'DIRECTION_LEFT'; + } else if (options.type.indexOf('right') > -1) { + options.directions = 'DIRECTION_RIGHT'; + } else if (options.type.indexOf('up') > -1) { + options.directions = 'DIRECTION_UP'; + } else if (options.type.indexOf('down') > -1) { + options.directions = 'DIRECTION_DOWN'; + } else { + options.directions = ''; + } + } + + options.direction = parseDirections(options.directions); + recognizer.set(options); + + if (options.recognizeWith) { + if (!manager.get(options.recognizeWith)){ + addRecognizer(manager, {type:options.recognizeWith}); + } + + recognizer.recognizeWith(manager.get(options.recognizeWith)); + } + + if (options.dropRecognizeWith && manager.get(options.dropRecognizeWith)) { + recognizer.dropRecognizeWith(manager.get(options.dropRecognizeWith)); + } + + if (options.requireFailure) { + if (!manager.get(options.requireFailure)){ + addRecognizer(manager, {type:options.requireFailure}); + } + + recognizer.requireFailure(manager.get(options.requireFailure)); + } + + if (options.dropRequireFailure && manager.get(options.dropRequireFailure)) { + recognizer.dropRequireFailure(manager.get(options.dropRequireFailure)); + } + + if (options.preventGhosts && element) { + preventGhosts(element); + } + } + + /** + * Parses the value of the directions property of any Angular Hammer options + * object and converts them into the standard Hammer.js directions values. + * + * @param {String} dirs Direction names separated by '|' characters + * @return {Number} Hammer.js direction value + */ + function parseDirections (dirs) { + var directions = 0; + + angular.forEach(dirs.split('|'), function (direction) { + if (Hammer.hasOwnProperty(direction)) { + directions = directions | Hammer[direction]; + } + }); + + return directions; + } + + // ---- Preventing Ghost Clicks ---- + + /** + * Modified from: https://gist.github.com/jtangelder/361052976f044200ea17 + * + * Prevent click events after a touchend. + * + * Inspired/copy-paste from this article of Google by Ryan Fioravanti + * https://developers.google.com/mobile/articles/fast_buttons#ghost + */ + + function preventGhosts (element) { + if (!element) { return; } + + var coordinates = [], + threshold = 25, + timeout = 2500; + + if ('ontouchstart' in window) { + element[0].addEventListener('touchstart', resetCoordinates, true); + element[0].addEventListener('touchend', registerCoordinates, true); + element[0].addEventListener('click', preventGhostClick, true); + element[0].addEventListener('mouseup', preventGhostClick, true); + } + + /** + * prevent clicks if they're in a registered XY region + * @param {MouseEvent} ev + */ + function preventGhostClick (ev) { + for (var i = 0; i < coordinates.length; i++) { + var x = coordinates[i][0]; + var y = coordinates[i][1]; + + // within the range, so prevent the click + if (Math.abs(ev.clientX - x) < threshold && + Math.abs(ev.clientY - y) < threshold) { + ev.stopPropagation(); + ev.preventDefault(); + break; + } + } + } + + /** + * reset the coordinates array + */ + function resetCoordinates () { + coordinates = []; + } + + /** + * remove the first coordinates set from the array + */ + function popCoordinates () { + coordinates.splice(0, 1); + } + + /** + * if it is an final touchend, we want to register it's place + * @param {TouchEvent} ev + */ + function registerCoordinates (ev) { + // touchend is triggered on every releasing finger + // changed touches always contain the removed touches on a touchend + // the touches object might contain these also at some browsers (firefox os) + // so touches - changedTouches will be 0 or lower, like -1, on the final touchend + if(ev.touches.length - ev.changedTouches.length <= 0) { + var touch = ev.changedTouches[0]; + coordinates.push([touch.clientX, touch.clientY]); + + setTimeout(popCoordinates, timeout); + } + } + } })(window, window.angular, window.Hammer); From f9b94d27197c4b31c1b879daadef8c55abab6601 Mon Sep 17 00:00:00 2001 From: Carlos Lawton Date: Thu, 16 Jul 2015 18:02:49 -0400 Subject: [PATCH 4/5] fixed issue with reference to hmTouchEvents module. --- .editorconfig | 0 angular.hammer.js | 3 +-- angular.hammer.min.js | 2 +- angular.hammer.min.js.map | 2 +- doc/angular.hammer.js.html | 40 ++++++++++++++++++++++++++++++++++- doc/index.html | 2 +- doc/module-hmTouchEvents.html | 2 +- 7 files changed, 44 insertions(+), 7 deletions(-) delete mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index e69de29..0000000 diff --git a/angular.hammer.js b/angular.hammer.js index cdb8974..60b8303 100644 --- a/angular.hammer.js +++ b/angular.hammer.js @@ -273,8 +273,7 @@ }; }]); }); - - hmTouchEvents.directive('hmRequireFailure', [ + angular.module('hmTouchEvents').directive('hmRequireFailure', [ '$log', function($log) { return { diff --git a/angular.hammer.min.js b/angular.hammer.min.js index 5552b6c..f71b813 100644 --- a/angular.hammer.min.js +++ b/angular.hammer.min.js @@ -1,5 +1,5 @@ // ---- Angular Hammer ---- // Copyright (c) 2014 Ryan S Mullins // Licensed under the MIT Software License -!function(a,b,c){"use strict";function d(a,b){if(!a||!b||!b.type)return null;var d;return d=b.type.indexOf("pan")>-1?new c.Pan(b):b.type.indexOf("pinch")>-1?new c.Pinch(b):b.type.indexOf("press")>-1?new c.Press(b):b.type.indexOf("rotate")>-1?new c.Rotate(b):b.type.indexOf("swipe")>-1?new c.Swipe(b):new c.Tap(b),a.add(d),d}function e(a,b){return a&&(b.preventGhosts=a.preventGhosts),b}function f(a){return a.indexOf("pan")>-1?"pan":a.indexOf("pinch")>-1?"pinch":a.indexOf("press")>-1?"press":a.indexOf("rotate")>-1?"rotate":a.indexOf("swipe")>-1?"swipe":"tap"}function g(a,b,c){if(a&&b){var e=a.get(b.type);e||(e=d(a,b)),b.directions||(b.directions="pan"===b.type||"swipe"===b.type?"DIRECTION_ALL":b.type.indexOf("left")>-1?"DIRECTION_LEFT":b.type.indexOf("right")>-1?"DIRECTION_RIGHT":b.type.indexOf("up")>-1?"DIRECTION_UP":b.type.indexOf("down")>-1?"DIRECTION_DOWN":""),b.direction=h(b.directions),e.set(b),b.recognizeWith&&(a.get(b.recognizeWith)||d(a,{type:b.recognizeWith}),e.recognizeWith(a.get(b.recognizeWith))),b.dropRecognizeWith&&a.get(b.dropRecognizeWith)&&e.dropRecognizeWith(a.get(b.dropRecognizeWith)),b.requireFailure&&(a.get(b.requireFailure)||d(a,{type:b.requireFailure}),e.requireFailure(a.get(b.requireFailure))),b.dropRequireFailure&&a.get(b.dropRequireFailure)&&e.dropRequireFailure(a.get(b.dropRequireFailure)),b.preventGhosts&&c&&i(c)}}function h(a){var d=0;return b.forEach(a.split("|"),function(a){c.hasOwnProperty(a)&&(d|=c[a])}),d}function i(b){function c(a){for(var b=0;b-1)&&g(m,e(n,a),k)}):b.isObject(o)?("hmCustom"===h?i=o.event:(o.type||(o.type=f(i)),o.event&&delete o.event),("hmCustom"===h||i.indexOf(o.type)>-1)&&g(m,e(n,o),k)):"hmCustom"!==h?(o={type:f(i)},"hmDoubletap"===h&&(o.event=i,o.taps=2,m.get("tap")&&(o.recognizeWith="tap")),o.type.indexOf("pan")>-1&&m.get("swipe")&&(o.recognizeWith="swipe"),o.type.indexOf("pinch")>-1&&m.get("rotate")&&(o.recognizeWith="rotate"),g(m,e(n,o),k)):i=null,i&&m.on(i,r)}}}])})}(window,window.angular,window.Hammer); +!function(a,b,c){"use strict";function d(a,b){if(!a||!b||!b.type)return null;var d;return d=b.type.indexOf("pan")>-1?new c.Pan(b):b.type.indexOf("pinch")>-1?new c.Pinch(b):b.type.indexOf("press")>-1?new c.Press(b):b.type.indexOf("rotate")>-1?new c.Rotate(b):b.type.indexOf("swipe")>-1?new c.Swipe(b):new c.Tap(b),a.add(d),d}function e(a,b){return a&&(b.preventGhosts=a.preventGhosts),b}function f(a){return a.indexOf("pan")>-1?"pan":a.indexOf("pinch")>-1?"pinch":a.indexOf("press")>-1?"press":a.indexOf("rotate")>-1?"rotate":a.indexOf("swipe")>-1?"swipe":"tap"}function g(a,b,c){if(a&&b){var e=a.get(b.type);e||(e=d(a,b)),b.directions||("pan"===b.type||"swipe"===b.type?b.directions="DIRECTION_ALL":b.type.indexOf("left")>-1?b.directions="DIRECTION_LEFT":b.type.indexOf("right")>-1?b.directions="DIRECTION_RIGHT":b.type.indexOf("up")>-1?b.directions="DIRECTION_UP":b.type.indexOf("down")>-1?b.directions="DIRECTION_DOWN":b.directions=""),b.direction=h(b.directions),e.set(b),b.recognizeWith&&(a.get(b.recognizeWith)||d(a,{type:b.recognizeWith}),e.recognizeWith(a.get(b.recognizeWith))),b.dropRecognizeWith&&a.get(b.dropRecognizeWith)&&e.dropRecognizeWith(a.get(b.dropRecognizeWith)),b.requireFailure&&(a.get(b.requireFailure)||d(a,{type:b.requireFailure}),e.requireFailure(a.get(b.requireFailure))),b.dropRequireFailure&&a.get(b.dropRequireFailure)&&e.dropRequireFailure(a.get(b.dropRequireFailure)),b.preventGhosts&&c&&i(c)}}function h(a){var d=0;return b.forEach(a.split("|"),function(a){c.hasOwnProperty(a)&&(d|=c[a])}),d}function i(b){function c(a){for(var b=0;b-1)&&g(m,e(n,a),k)}):b.isObject(o)?("hmCustom"===h?i=o.event:(o.type||(o.type=f(i)),o.event&&delete o.event),("hmCustom"===h||i.indexOf(o.type)>-1)&&g(m,e(n,o),k)):"hmCustom"!==h?(o={type:f(i)},"hmDoubletap"===h&&(o.event=i,o.taps=2,m.get("tap")&&(o.recognizeWith="tap")),o.type.indexOf("pan")>-1&&m.get("swipe")&&(o.recognizeWith="swipe"),o.type.indexOf("pinch")>-1&&m.get("rotate")&&(o.recognizeWith="rotate"),g(m,e(n,o),k)):i=null,i&&m.on(i,r)}}}])}),hmTouchEvents.directive("hmRequireFailure",["$log",function(a){return{priority:1e3,restrict:"A",scope:{},link:function(c,d,e){var f=d.data("hammer"),g=c.$eval(e.hmRequireFailure);f&&b.forEach(g,function(b,c){var d=f.get(c),e=[].concat(b).map(function(b){var d=f.get(b);return d||a.warn("Event ["+b+"] was not be added to requireFailure for event ["+c+"]"),d}).filter(function(a){return a});d&&e.length>0?d.requireFailure(e):a.warn("No events where added to requireFailure for event ["+c+"]")})}}}])}(window,window.angular,window.Hammer); //# sourceMappingURL=angular.hammer.min.js.map \ No newline at end of file diff --git a/angular.hammer.min.js.map b/angular.hammer.min.js.map index 341d4dc..59d4e1b 100644 --- a/angular.hammer.min.js.map +++ b/angular.hammer.min.js.map @@ -1 +1 @@ -{"version":3,"file":"angular.hammer.min.js","sources":["angular.hammer.js"],"names":["window","angular","Hammer","addRecognizer","manager","options","type","recognizer","indexOf","Pan","Pinch","Press","Rotate","Swipe","Tap","add","applyManagerOptions","managerOpts","recognizerOpts","preventGhosts","getRecognizerTypeFromeventName","eventName","setupRecognizerWithOptions","element","get","directions","direction","parseDirections","set","recognizeWith","dropRecognizeWith","requireFailure","dropRequireFailure","dirs","forEach","split","hasOwnProperty","preventGhostClick","ev","i","coordinates","length","x","y","Math","abs","clientX","threshold","clientY","stopPropagation","preventDefault","resetCoordinates","popCoordinates","splice","registerCoordinates","touches","changedTouches","touch","push","setTimeout","timeout","addEventListener","require","e","console","log","gestureTypes","module","directive","directiveName","$parse","$window","restrict","link","scope","attrs","bind","handler","hammer","data","fromJson","hmManagerOptions","hmRecognizerOptions","Manager","$on","destroy","handlerName","handlerExpr","event","callHandler","fn","$event","call","phase","$root","$$phase","srcEvent","$apply","isArray","isObject","taps","on"],"mappings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,QAIN,aAAlBnB,GACAhD,EAAUb,QAAQU,EAAeZ,MAAQ,KAC3CgB,EACEwD,EACA9D,EAAoBC,EAAaC,GACjCK,IAEuB,aAAlB8C,GAMTnD,GACEZ,KAAQc,EAA+BC,IAGnB,gBAAlBgD,IACFnD,EAAesE,MAAQnE,EACvBH,EAAekF,KAAO,EAElBtB,EAAOtD,IAAI,SACbN,EAAeW,cAAgB,QAI/BX,EAAeZ,KAAKE,QAAQ,OAAS,IACrCsE,EAAOtD,IAAI,WACbN,EAAeW,cAAgB,SAG7BX,EAAeZ,KAAKE,QAAQ,SAAW,IACvCsE,EAAOtD,IAAI,YACbN,EAAeW,cAAgB,UAGjCP,EACEwD,EACA9D,EAAoBC,EAAaC,GACjCK,IAEFF,EAAY,KAGVA,GACFyD,EAAOuB,GAAGhF,EAAWwD,WA+OhC7E,OAAQA,OAAOC,QAASD,OAAOE"} \ No newline at end of file +{"version":3,"file":"angular.hammer.min.js","sources":["angular.hammer.js"],"names":["window","angular","Hammer","addRecognizer","manager","options","type","recognizer","indexOf","Pan","Pinch","Press","Rotate","Swipe","Tap","add","applyManagerOptions","managerOpts","recognizerOpts","preventGhosts","getRecognizerTypeFromeventName","eventName","setupRecognizerWithOptions","element","get","directions","direction","parseDirections","set","recognizeWith","dropRecognizeWith","requireFailure","dropRequireFailure","dirs","forEach","split","hasOwnProperty","preventGhostClick","ev","i","coordinates","length","x","y","Math","abs","clientX","threshold","clientY","stopPropagation","preventDefault","resetCoordinates","popCoordinates","splice","registerCoordinates","touches","changedTouches","touch","push","setTimeout","timeout","addEventListener","require","e","console","log","gestureTypes","module","directive","directiveName","$parse","$window","restrict","link","scope","attrs","bind","handler","hammer","data","fromJson","hmManagerOptions","hmRecognizerOptions","Manager","$on","destroy","handlerName","handlerExpr","event","callHandler","fn","$event","call","phase","$root","$$phase","srcEvent","$apply","isArray","isObject","taps","on","hmTouchEvents","$log","priority","mapping","$eval","hmRequireFailure","requiredEventNames","requiredEvents","concat","map","name","warn","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of file diff --git a/doc/angular.hammer.js.html b/doc/angular.hammer.js.html index 2bccc1b..bd7a3b2 100644 --- a/doc/angular.hammer.js.html +++ b/doc/angular.hammer.js.html @@ -301,6 +301,44 @@

Source: angular.hammer.js

}]); }); + hmTouchEvents.directive('hmRequireFailure', [ + '$log', function($log) { + + return { + priority: 1000, + restrict: 'A', + scope: {}, + link: function(scope, element, attrs) { + + var manager = element.data('hammer'), + mapping = scope.$eval(attrs.hmRequireFailure); + + if(manager) { + angular.forEach(mapping, function(requiredEventNames, eventName) { + + // find actual events and filter any that the manager doesn't know about + var event = manager.get(eventName), + requiredEvents = [].concat(requiredEventNames).map(function(name) { + var event = manager.get(name); + if(!event) { + $log.warn('Event [' + name + '] was not be added to requireFailure for event [' + eventName + ']'); + } + return event; + }).filter(function(event) { + return event; + }); + + if(event && requiredEvents.length > 0) { + event.requireFailure(requiredEvents); + } else { + $log.warn('No events where added to requireFailure for event [' + eventName + ']'); + } + }); + } + } + } + } + ]); // ---- Private Functions ----- /** @@ -550,7 +588,7 @@

Index

Modules

  • diff --git a/doc/index.html b/doc/index.html index e38f450..9bb4618 100644 --- a/doc/index.html +++ b/doc/index.html @@ -54,7 +54,7 @@

    Index

    Modules

    • diff --git a/doc/module-hmTouchEvents.html b/doc/module-hmTouchEvents.html index c66fc0b..84e2e81 100644 --- a/doc/module-hmTouchEvents.html +++ b/doc/module-hmTouchEvents.html @@ -122,7 +122,7 @@

      Index

      Modules

      • From e36b09043e79849fe611d15d6dc49b0727b0e8e9 Mon Sep 17 00:00:00 2001 From: Carlos Lawton Date: Thu, 16 Jul 2015 18:04:48 -0400 Subject: [PATCH 5/5] fixed issue with reference to hmTouchEvents module. --- angular.hammer.min.js | 2 +- angular.hammer.min.js.map | 2 +- doc/angular.hammer.js.html | 5 ++--- doc/index.html | 2 +- doc/module-hmTouchEvents.html | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/angular.hammer.min.js b/angular.hammer.min.js index f71b813..766a482 100644 --- a/angular.hammer.min.js +++ b/angular.hammer.min.js @@ -1,5 +1,5 @@ // ---- Angular Hammer ---- // Copyright (c) 2014 Ryan S Mullins // Licensed under the MIT Software License -!function(a,b,c){"use strict";function d(a,b){if(!a||!b||!b.type)return null;var d;return d=b.type.indexOf("pan")>-1?new c.Pan(b):b.type.indexOf("pinch")>-1?new c.Pinch(b):b.type.indexOf("press")>-1?new c.Press(b):b.type.indexOf("rotate")>-1?new c.Rotate(b):b.type.indexOf("swipe")>-1?new c.Swipe(b):new c.Tap(b),a.add(d),d}function e(a,b){return a&&(b.preventGhosts=a.preventGhosts),b}function f(a){return a.indexOf("pan")>-1?"pan":a.indexOf("pinch")>-1?"pinch":a.indexOf("press")>-1?"press":a.indexOf("rotate")>-1?"rotate":a.indexOf("swipe")>-1?"swipe":"tap"}function g(a,b,c){if(a&&b){var e=a.get(b.type);e||(e=d(a,b)),b.directions||("pan"===b.type||"swipe"===b.type?b.directions="DIRECTION_ALL":b.type.indexOf("left")>-1?b.directions="DIRECTION_LEFT":b.type.indexOf("right")>-1?b.directions="DIRECTION_RIGHT":b.type.indexOf("up")>-1?b.directions="DIRECTION_UP":b.type.indexOf("down")>-1?b.directions="DIRECTION_DOWN":b.directions=""),b.direction=h(b.directions),e.set(b),b.recognizeWith&&(a.get(b.recognizeWith)||d(a,{type:b.recognizeWith}),e.recognizeWith(a.get(b.recognizeWith))),b.dropRecognizeWith&&a.get(b.dropRecognizeWith)&&e.dropRecognizeWith(a.get(b.dropRecognizeWith)),b.requireFailure&&(a.get(b.requireFailure)||d(a,{type:b.requireFailure}),e.requireFailure(a.get(b.requireFailure))),b.dropRequireFailure&&a.get(b.dropRequireFailure)&&e.dropRequireFailure(a.get(b.dropRequireFailure)),b.preventGhosts&&c&&i(c)}}function h(a){var d=0;return b.forEach(a.split("|"),function(a){c.hasOwnProperty(a)&&(d|=c[a])}),d}function i(b){function c(a){for(var b=0;b-1)&&g(m,e(n,a),k)}):b.isObject(o)?("hmCustom"===h?i=o.event:(o.type||(o.type=f(i)),o.event&&delete o.event),("hmCustom"===h||i.indexOf(o.type)>-1)&&g(m,e(n,o),k)):"hmCustom"!==h?(o={type:f(i)},"hmDoubletap"===h&&(o.event=i,o.taps=2,m.get("tap")&&(o.recognizeWith="tap")),o.type.indexOf("pan")>-1&&m.get("swipe")&&(o.recognizeWith="swipe"),o.type.indexOf("pinch")>-1&&m.get("rotate")&&(o.recognizeWith="rotate"),g(m,e(n,o),k)):i=null,i&&m.on(i,r)}}}])}),hmTouchEvents.directive("hmRequireFailure",["$log",function(a){return{priority:1e3,restrict:"A",scope:{},link:function(c,d,e){var f=d.data("hammer"),g=c.$eval(e.hmRequireFailure);f&&b.forEach(g,function(b,c){var d=f.get(c),e=[].concat(b).map(function(b){var d=f.get(b);return d||a.warn("Event ["+b+"] was not be added to requireFailure for event ["+c+"]"),d}).filter(function(a){return a});d&&e.length>0?d.requireFailure(e):a.warn("No events where added to requireFailure for event ["+c+"]")})}}}])}(window,window.angular,window.Hammer); +!function(a,b,c){"use strict";function d(a,b){if(!a||!b||!b.type)return null;var d;return d=b.type.indexOf("pan")>-1?new c.Pan(b):b.type.indexOf("pinch")>-1?new c.Pinch(b):b.type.indexOf("press")>-1?new c.Press(b):b.type.indexOf("rotate")>-1?new c.Rotate(b):b.type.indexOf("swipe")>-1?new c.Swipe(b):new c.Tap(b),a.add(d),d}function e(a,b){return a&&(b.preventGhosts=a.preventGhosts),b}function f(a){return a.indexOf("pan")>-1?"pan":a.indexOf("pinch")>-1?"pinch":a.indexOf("press")>-1?"press":a.indexOf("rotate")>-1?"rotate":a.indexOf("swipe")>-1?"swipe":"tap"}function g(a,b,c){if(a&&b){var e=a.get(b.type);e||(e=d(a,b)),b.directions||("pan"===b.type||"swipe"===b.type?b.directions="DIRECTION_ALL":b.type.indexOf("left")>-1?b.directions="DIRECTION_LEFT":b.type.indexOf("right")>-1?b.directions="DIRECTION_RIGHT":b.type.indexOf("up")>-1?b.directions="DIRECTION_UP":b.type.indexOf("down")>-1?b.directions="DIRECTION_DOWN":b.directions=""),b.direction=h(b.directions),e.set(b),b.recognizeWith&&(a.get(b.recognizeWith)||d(a,{type:b.recognizeWith}),e.recognizeWith(a.get(b.recognizeWith))),b.dropRecognizeWith&&a.get(b.dropRecognizeWith)&&e.dropRecognizeWith(a.get(b.dropRecognizeWith)),b.requireFailure&&(a.get(b.requireFailure)||d(a,{type:b.requireFailure}),e.requireFailure(a.get(b.requireFailure))),b.dropRequireFailure&&a.get(b.dropRequireFailure)&&e.dropRequireFailure(a.get(b.dropRequireFailure)),b.preventGhosts&&c&&i(c)}}function h(a){var d=0;return b.forEach(a.split("|"),function(a){c.hasOwnProperty(a)&&(d|=c[a])}),d}function i(b){function c(a){for(var b=0;b-1)&&g(m,e(n,a),k)}):b.isObject(o)?("hmCustom"===h?i=o.event:(o.type||(o.type=f(i)),o.event&&delete o.event),("hmCustom"===h||i.indexOf(o.type)>-1)&&g(m,e(n,o),k)):"hmCustom"!==h?(o={type:f(i)},"hmDoubletap"===h&&(o.event=i,o.taps=2,m.get("tap")&&(o.recognizeWith="tap")),o.type.indexOf("pan")>-1&&m.get("swipe")&&(o.recognizeWith="swipe"),o.type.indexOf("pinch")>-1&&m.get("rotate")&&(o.recognizeWith="rotate"),g(m,e(n,o),k)):i=null,i&&m.on(i,r)}}}])}),b.module("hmTouchEvents").directive("hmRequireFailure",["$log",function(a){return{priority:1e3,restrict:"A",scope:{},link:function(c,d,e){var f=d.data("hammer"),g=c.$eval(e.hmRequireFailure);f&&b.forEach(g,function(b,c){var d=f.get(c),e=[].concat(b).map(function(b){var d=f.get(b);return d||a.warn("Event ["+b+"] was not be added to requireFailure for event ["+c+"]"),d}).filter(function(a){return a});d&&e.length>0?d.requireFailure(e):a.warn("No events where added to requireFailure for event ["+c+"]")})}}}])}(window,window.angular,window.Hammer); //# sourceMappingURL=angular.hammer.min.js.map \ No newline at end of file diff --git a/angular.hammer.min.js.map b/angular.hammer.min.js.map index 59d4e1b..3e00c10 100644 --- a/angular.hammer.min.js.map +++ b/angular.hammer.min.js.map @@ -1 +1 @@ -{"version":3,"file":"angular.hammer.min.js","sources":["angular.hammer.js"],"names":["window","angular","Hammer","addRecognizer","manager","options","type","recognizer","indexOf","Pan","Pinch","Press","Rotate","Swipe","Tap","add","applyManagerOptions","managerOpts","recognizerOpts","preventGhosts","getRecognizerTypeFromeventName","eventName","setupRecognizerWithOptions","element","get","directions","direction","parseDirections","set","recognizeWith","dropRecognizeWith","requireFailure","dropRequireFailure","dirs","forEach","split","hasOwnProperty","preventGhostClick","ev","i","coordinates","length","x","y","Math","abs","clientX","threshold","clientY","stopPropagation","preventDefault","resetCoordinates","popCoordinates","splice","registerCoordinates","touches","changedTouches","touch","push","setTimeout","timeout","addEventListener","require","e","console","log","gestureTypes","module","directive","directiveName","$parse","$window","restrict","link","scope","attrs","bind","handler","hammer","data","fromJson","hmManagerOptions","hmRecognizerOptions","Manager","$on","destroy","handlerName","handlerExpr","event","callHandler","fn","$event","call","phase","$root","$$phase","srcEvent","$apply","isArray","isObject","taps","on","hmTouchEvents","$log","priority","mapping","$eval","hmRequireFailure","requiredEventNames","requiredEvents","concat","map","name","warn","filter"],"mappings":";;;CAKA,SAAWA,EAAQC,EAASC,GAC1B,YA+TA,SAASC,GAAeC,EAASC,GAC/B,IAAKD,IAAYC,IAAYA,EAAQC,KAAQ,MAAO,KAEpD,IAAIC,EAiBJ,OAdEA,GADEF,EAAQC,KAAKE,QAAQ,OAAS,GACnB,GAAIN,GAAOO,IAAIJ,GACnBA,EAAQC,KAAKE,QAAQ,SAAW,GAC5B,GAAIN,GAAOQ,MAAML,GACrBA,EAAQC,KAAKE,QAAQ,SAAW,GAC5B,GAAIN,GAAOS,MAAMN,GACrBA,EAAQC,KAAKE,QAAQ,UAAY,GAC7B,GAAIN,GAAOU,OAAOP,GACtBA,EAAQC,KAAKE,QAAQ,SAAW,GAC5B,GAAIN,GAAOW,MAAMR,GAEjB,GAAIH,GAAOY,IAAIT,GAG9BD,E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UAGjCP,EACEwD,EACA9D,EAAoBC,EAAaC,GACjCK,IAEFF,EAAY,KAGVA,GACFyD,EAAOuB,GAAGhF,EAAWwD,UAOjCyB,cAAclC,UAAU,oBACtB,OAAQ,SAASmC,GAEf,OACEC,SAAU,IACVhC,SAAU,IACVE,SACAD,KAAM,SAASC,EAAOnD,EAASoD,GAE7B,GAAIvE,GAAUmB,EAAQwD,KAAK,UACvB0B,EAAU/B,EAAMgC,MAAM/B,EAAMgC,iBAE7BvG,IACDH,EAAQiC,QAAQuE,EAAS,SAASG,EAAoBvF,GAGpD,GAAImE,GAAQpF,EAAQoB,IAAIH,GACpBwF,KAAoBC,OAAOF,GAAoBG,IAAI,SAASC,GAC1D,GAAIxB,GAAQpF,EAAQoB,IAAIwF,EAIxB,OAHIxB,IACFe,EAAKU,KAAK,UAAYD,EAAO,mDAAqD3F,EAAY,KAEzFmE,IACN0B,OAAO,SAAS1B,GACjB,MAAOA,IAGVA,IAASqB,EAAepE,OAAS,EAClC+C,EAAMzD,eAAe8E,GAErBN,EAAKU,KAAK,sDAAwD5F,EAAY,aAgP3FrB,OAAQA,OAAOC,QAASD,OAAOE"} \ No newline at end of file +{"version":3,"file":"angular.hammer.min.js","sources":["angular.hammer.js"],"names":["window","angular","Hammer","addRecognizer","manager","options","type","recognizer","indexOf","Pan","Pinch","Press","Rotate","Swipe","Tap","add","applyManagerOptions","managerOpts","recognizerOpts","preventGhosts","getRecognizerTypeFromeventName","eventName","setupRecognizerWithOptions","element","get","directions","direction","parseDirections","set","recognizeWith","dropRecognizeWith","requireFailure","dropRequireFailure","dirs","forEach","split","hasOwnProperty","preventGhostClick","ev","i","coordinates","length","x","y","Math","abs","clientX","threshold","clientY","stopPropagation","preventDefault","resetCoordinates","popCoordinates","splice","registerCoordinates","touches","changedTouches","touch","push","setTimeout","timeout","addEventListener","require","e","console","log","gestureTypes","module","directive","directiveName","$parse","$window","restrict","link","scope","attrs","bind","handler","hammer","data","fromJson","hmManagerOptions","hmRecognizerOptions","Manager","$on","destroy","handlerName","handlerExpr","event","callHandler","fn","$event","call","phase","$root","$$phase","srcEvent","$apply","isArray","isObject","taps","on","$log","priority","mapping","$eval","hmRequireFailure","requiredEventNames","requiredEvents","concat","map","name","warn","filter"],"mappings":";;;CAKA,SAAWA,EAAQC,EAASC,GAC1B,YA8TA,SAASC,GAAeC,EAASC,GAC/B,IAAKD,IAAYC,IAAYA,EAAQC,KAAQ,MAAO,KAEpD,IAAIC,EAiBJ,OAdEA,GADEF,EAAQC,KAAKE,QAAQ,OAAS,GACnB,GAAIN,GAAOO,IAAIJ,GACnBA,EAAQC,KAAKE,QAAQ,SAAW,GAC5B,GAAIN,GAAOQ,MAAML,GACrBA,EAAQC,KAAKE,QAAQ,SAAW,GAC5B,GAAIN,GAAOS,MAAMN,GACrBA,EAAQC,KAAKE,QAAQ,UAAY,GAC7B,GAAIN,GAAOU,OAAOP,GACtBA,EAAQC,KAAKE,QAAQ,SAAW,GAC5B,GAAIN,GAAOW,MAAMR,GAEjB,GAAIH,GAAOY,IAAIT,GAG9BD,EAAQW,IAAIR,GACLA,EAUT,QAASS,GAAqBC,EAAaC,GAKzC,MAJID,KACFC,EAAeC,cAAgBF,EAAYE,eAGtCD,EAUT,QAASE,GAAgCC,GACvC,MAAIA,GAAUb,QAAQ,OAAS,GACtB,MACEa,EAAUb,QAAQ,SAAW,GAC/B,QACEa,EAAUb,QAAQ,SAAW,GAC/B,QACEa,EAAUb,QAAQ,UAAY,GAChC,SACEa,EAAUb,QAAQ,SAAW,GAC/B,QAEA,MAaX,QAASc,GAA4BlB,EAASC,EAASkB,GACrD,GAAKnB,GAAYC,EAAjB,CAEA,GAAIE,GAAaH,EAAQoB,IAAInB,EAAQC,KAEhCC,KACHA,EAAaJ,EAAcC,EAASC,IAGjCA,EAAQoB,aACU,QAAjBpB,EAAQC,MAAmC,UAAjBD,EAAQC,KACpCD,EAAQoB,WAAa,gBACZpB,EAAQC,KAAKE,QAAQ,QAAU,GACxCH,EAAQo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AAO,SAASzB,GACjB,MAAOA,IAGVA,IAASoB,EAAenE,OAAS,EAClC+C,EAAMzD,eAAe6E,GAErBN,EAAKU,KAAK,sDAAwD3F,EAAY,aAgP3FrB,OAAQA,OAAOC,QAASD,OAAOE"} \ No newline at end of file diff --git a/doc/angular.hammer.js.html b/doc/angular.hammer.js.html index bd7a3b2..dbf1c9f 100644 --- a/doc/angular.hammer.js.html +++ b/doc/angular.hammer.js.html @@ -300,8 +300,7 @@

        Source: angular.hammer.js

        }; }]); }); - - hmTouchEvents.directive('hmRequireFailure', [ + angular.module('hmTouchEvents').directive('hmRequireFailure', [ '$log', function($log) { return { @@ -588,7 +587,7 @@

        Index

        Modules

        • diff --git a/doc/index.html b/doc/index.html index 9bb4618..c07aa94 100644 --- a/doc/index.html +++ b/doc/index.html @@ -54,7 +54,7 @@

          Index

          Modules

          • diff --git a/doc/module-hmTouchEvents.html b/doc/module-hmTouchEvents.html index 84e2e81..5e9880b 100644 --- a/doc/module-hmTouchEvents.html +++ b/doc/module-hmTouchEvents.html @@ -122,7 +122,7 @@

            Index

            Modules