diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 000000000..2c395eef1 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Angular + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 966617b8d..79c2b1cf2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # packaged angular-touch -This repo is for distribution on `npm` and `bower`. The source for this module is in the -[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngTouch). -Please file issues and pull requests against that repo. +**This package contains the legacy AngularJS (version 1.x). AngularJS support has officially ended +as of January 2022. +[See what ending support means](https://docs.angularjs.org/misc/version-support-status) and +[read the end of life announcement](https://goo.gle/angularjs-end-of-life).** + +**[See `@angular/core` for the actively supported Angular](https://npmjs.com/@angular/core).** ## Install @@ -14,21 +17,12 @@ You can install this package either with `npm` or with `bower`. npm install angular-touch ``` -Add a ` -``` - Then add `ngTouch` as a dependency for your app: ```javascript -angular.module('myApp', ['ngTouch']); +angular.module('myApp', [require('angular-touch')]); ``` -Note that this package is not in CommonJS format, so doing `require('angular-touch')` will -return `undefined`. - ### bower ```shell @@ -56,7 +50,7 @@ Documentation is available on the The MIT License -Copyright (c) 2010-2012 Google, Inc. http://angularjs.org +Copyright (c) 2022 Google LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/angular-touch.js b/angular-touch.js index 9acb48ce7..44e5cd9ea 100644 --- a/angular-touch.js +++ b/angular-touch.js @@ -1,46 +1,58 @@ /** - * @license AngularJS v1.3.9-build.3770+sha.034fade - * (c) 2010-2015 Google, Inc. http://angularjs.org + * @license AngularJS v1.8.3 + * (c) 2010-2020 Google LLC. http://angularjs.org * License: MIT */ -(function(window, angular, undefined) {'use strict'; +(function(window, angular) {'use strict'; /** * @ngdoc module * @name ngTouch * @description * - * # ngTouch - * - * The `ngTouch` module provides touch events and other helpers for touch-enabled devices. + * The `ngTouch` module provides helpers for touch-enabled devices. * The implementation is based on jQuery Mobile touch event handling - * ([jquerymobile.com](http://jquerymobile.com/)). - * + * ([jquerymobile.com](http://jquerymobile.com/)). * * * See {@link ngTouch.$swipe `$swipe`} for usage. * - *
- * + * @deprecated + * sinceVersion="1.7.0" + * The ngTouch module with the {@link ngTouch.$swipe `$swipe`} service and + * the {@link ngTouch.ngSwipeLeft} and {@link ngTouch.ngSwipeRight} directives are + * deprecated. Instead, stand-alone libraries for touch handling and gesture interaction + * should be used, for example [HammerJS](https://hammerjs.github.io/) (which is also used by + * Angular). */ // define ngTouch module -/* global -ngTouch */ +/* global ngTouch */ var ngTouch = angular.module('ngTouch', []); +ngTouch.info({ angularVersion: '1.8.3' }); + +function nodeName_(element) { + return angular.$$lowercase(element.nodeName || (element[0] && element[0].nodeName)); +} + /* global ngTouch: false */ /** * @ngdoc service * @name $swipe * + * @deprecated + * sinceVersion="1.7.0" + * + * See the {@link ngTouch module} documentation for more information. + * * @description * The `$swipe` service is a service that abstracts the messier details of hold-and-drag swipe * behavior, to make implementing swipe-related directives more convenient. * * Requires the {@link ngTouch `ngTouch`} module to be installed. * - * `$swipe` is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngTouch`, and by - * `ngCarousel` in a separate component. + * `$swipe` is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngTouch`. * * # Usage * The `$swipe` service is an object with a single method: `bind`. `bind` takes an element @@ -63,15 +75,19 @@ ngTouch.factory('$swipe', [function() { move: 'touchmove', end: 'touchend', cancel: 'touchcancel' + }, + 'pointer': { + start: 'pointerdown', + move: 'pointermove', + end: 'pointerup', + cancel: 'pointercancel' } }; function getCoordinates(event) { - var touches = event.touches && event.touches.length ? event.touches : [event]; - var e = (event.changedTouches && event.changedTouches[0]) || - (event.originalEvent && event.originalEvent.changedTouches && - event.originalEvent.changedTouches[0]) || - touches[0].originalEvent || touches[0]; + var originalEvent = event.originalEvent || event; + var touches = originalEvent.touches && originalEvent.touches.length ? originalEvent.touches : [originalEvent]; + var e = (originalEvent.changedTouches && originalEvent.changedTouches[0]) || touches[0]; return { x: e.clientX, @@ -99,14 +115,15 @@ ngTouch.factory('$swipe', [function() { * The main method of `$swipe`. It takes an element to be watched for swipe motions, and an * object containing event handlers. * The pointer types that should be used can be specified via the optional - * third argument, which is an array of strings `'mouse'` and `'touch'`. By default, - * `$swipe` will listen for `mouse` and `touch` events. + * third argument, which is an array of strings `'mouse'`, `'touch'` and `'pointer'`. By default, + * `$swipe` will listen for `mouse`, `touch` and `pointer` events. * * The four events are `start`, `move`, `end`, and `cancel`. `start`, `move`, and `end` - * receive as a parameter a coordinates object of the form `{ x: 150, y: 310 }`. + * receive as a parameter a coordinates object of the form `{ x: 150, y: 310 }` and the raw + * `event`. `cancel` receives the raw `event` as its single parameter. * - * `start` is called on either `mousedown` or `touchstart`. After this event, `$swipe` is - * watching for `touchmove` or `mousemove` events. These events are ignored until the total + * `start` is called on either `mousedown`, `touchstart` or `pointerdown`. After this event, `$swipe` is + * watching for `touchmove`, `mousemove` or `pointermove` events. These events are ignored until the total * distance moved in either dimension exceeds a small threshold. * * Once this threshold is exceeded, either the horizontal or vertical delta is greater. @@ -114,12 +131,12 @@ ngTouch.factory('$swipe', [function() { * - If the vertical distance is greater, this is a scroll, and we let the browser take over. * A `cancel` event is sent. * - * `move` is called on `mousemove` and `touchmove` after the above logic has determined that + * `move` is called on `mousemove`, `touchmove` and `pointermove` after the above logic has determined that * a swipe is in progress. * - * `end` is called when a swipe is successfully completed with a `touchend` or `mouseup`. + * `end` is called when a swipe is successfully completed with a `touchend`, `mouseup` or `pointerup`. * - * `cancel` is called either on a `touchcancel` from the browser, or when we begin scrolling + * `cancel` is called either on a `touchcancel` or `pointercancel` from the browser, or when we begin scrolling * as described above. * */ @@ -133,20 +150,24 @@ ngTouch.factory('$swipe', [function() { // Whether a swipe is active. var active = false; - pointerTypes = pointerTypes || ['mouse', 'touch']; + pointerTypes = pointerTypes || ['mouse', 'touch', 'pointer']; element.on(getEvents(pointerTypes, 'start'), function(event) { startCoords = getCoordinates(event); active = true; totalX = 0; totalY = 0; lastPos = startCoords; - eventHandlers['start'] && eventHandlers['start'](startCoords, event); + if (eventHandlers['start']) { + eventHandlers['start'](startCoords, event); + } }); var events = getEvents(pointerTypes, 'cancel'); if (events) { element.on(events, function(event) { active = false; - eventHandlers['cancel'] && eventHandlers['cancel'](event); + if (eventHandlers['cancel']) { + eventHandlers['cancel'](event); + } }); } @@ -175,19 +196,25 @@ ngTouch.factory('$swipe', [function() { if (totalY > totalX) { // Allow native scrolling to take over. active = false; - eventHandlers['cancel'] && eventHandlers['cancel'](event); + if (eventHandlers['cancel']) { + eventHandlers['cancel'](event); + } return; } else { // Prevent the browser from scrolling. event.preventDefault(); - eventHandlers['move'] && eventHandlers['move'](coords, event); + if (eventHandlers['move']) { + eventHandlers['move'](coords, event); + } } }); element.on(getEvents(pointerTypes, 'end'), function(event) { if (!active) return; active = false; - eventHandlers['end'] && eventHandlers['end'](getCoordinates(event), event); + if (eventHandlers['end']) { + eventHandlers['end'](getCoordinates(event), event); + } }); } }; @@ -197,298 +224,12 @@ ngTouch.factory('$swipe', [function() { /** * @ngdoc directive - * @name ngClick - * - * @description - * A more powerful replacement for the default ngClick designed to be used on touchscreen - * devices. Most mobile browsers wait about 300ms after a tap-and-release before sending - * the click event. This version handles them immediately, and then prevents the - * following click event from propagating. - * - * Requires the {@link ngTouch `ngTouch`} module to be installed. - * - * This directive can fall back to using an ordinary click event, and so works on desktop - * browsers as well as mobile. + * @name ngSwipeLeft * - * This directive also sets the CSS class `ng-click-active` while the element is being held - * down (by a mouse click or touch) so you can restyle the depressed element if you wish. + * @deprecated + * sinceVersion="1.7.0" * - * @element ANY - * @param {expression} ngClick {@link guide/expression Expression} to evaluate - * upon tap. (Event object is available as `$event`) - * - * @example - - - - count: {{ count }} - - - angular.module('ngClickExample', ['ngTouch']); - - - */ - -ngTouch.config(['$provide', function($provide) { - $provide.decorator('ngClickDirective', ['$delegate', function($delegate) { - // drop the default ngClick directive - $delegate.shift(); - return $delegate; - }]); -}]); - -ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', - function($parse, $timeout, $rootElement) { - var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag. - var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers. - var PREVENT_DURATION = 2500; // 2.5 seconds maximum from preventGhostClick call to click - var CLICKBUSTER_THRESHOLD = 25; // 25 pixels in any dimension is the limit for busting clicks. - - var ACTIVE_CLASS_NAME = 'ng-click-active'; - var lastPreventedTime; - var touchCoordinates; - var lastLabelClickCoordinates; - - - // TAP EVENTS AND GHOST CLICKS - // - // Why tap events? - // Mobile browsers detect a tap, then wait a moment (usually ~300ms) to see if you're - // double-tapping, and then fire a click event. - // - // This delay sucks and makes mobile apps feel unresponsive. - // So we detect touchstart, touchmove, touchcancel and touchend ourselves and determine when - // the user has tapped on something. - // - // What happens when the browser then generates a click event? - // The browser, of course, also detects the tap and fires a click after a delay. This results in - // tapping/clicking twice. We do "clickbusting" to prevent it. - // - // How does it work? - // We attach global touchstart and click handlers, that run during the capture (early) phase. - // So the sequence for a tap is: - // - global touchstart: Sets an "allowable region" at the point touched. - // - element's touchstart: Starts a touch - // (- touchmove or touchcancel ends the touch, no click follows) - // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold - // too long) and fires the user's tap handler. The touchend also calls preventGhostClick(). - // - preventGhostClick() removes the allowable region the global touchstart created. - // - The browser generates a click event. - // - The global click handler catches the click, and checks whether it was in an allowable region. - // - If preventGhostClick was called, the region will have been removed, the click is busted. - // - If the region is still there, the click proceeds normally. Therefore clicks on links and - // other elements without ngTap on them work normally. - // - // This is an ugly, terrible hack! - // Yeah, tell me about it. The alternatives are using the slow click events, or making our users - // deal with the ghost clicks, so I consider this the least of evils. Fortunately Angular - // encapsulates this ugly logic away from the user. - // - // Why not just put click handlers on the element? - // We do that too, just to be sure. If the tap event caused the DOM to change, - // it is possible another element is now in that position. To take account for these possibly - // distinct elements, the handlers are global and care only about coordinates. - - // Checks if the coordinates are close enough to be within the region. - function hit(x1, y1, x2, y2) { - return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD; - } - - // Checks a list of allowable regions against a click location. - // Returns true if the click should be allowed. - // Splices out the allowable region from the list after it has been used. - function checkAllowableRegions(touchCoordinates, x, y) { - for (var i = 0; i < touchCoordinates.length; i += 2) { - if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) { - touchCoordinates.splice(i, i + 2); - return true; // allowable region - } - } - return false; // No allowable region; bust it. - } - - // Global click handler that prevents the click if it's in a bustable zone and preventGhostClick - // was called recently. - function onClick(event) { - if (Date.now() - lastPreventedTime > PREVENT_DURATION) { - return; // Too old. - } - - var touches = event.touches && event.touches.length ? event.touches : [event]; - var x = touches[0].clientX; - var y = touches[0].clientY; - // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label - // and on the input element). Depending on the exact browser, this second click we don't want - // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label - // click event - if (x < 1 && y < 1) { - return; // offscreen - } - if (lastLabelClickCoordinates && - lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) { - return; // input click triggered by label click - } - // reset label click coordinates on first subsequent click - if (lastLabelClickCoordinates) { - lastLabelClickCoordinates = null; - } - // remember label click coordinates to prevent click busting of trigger click event on input - if (event.target.tagName.toLowerCase() === 'label') { - lastLabelClickCoordinates = [x, y]; - } - - // Look for an allowable region containing this click. - // If we find one, that means it was created by touchstart and not removed by - // preventGhostClick, so we don't bust it. - if (checkAllowableRegions(touchCoordinates, x, y)) { - return; - } - - // If we didn't find an allowable region, bust the click. - event.stopPropagation(); - event.preventDefault(); - - // Blur focused form elements - event.target && event.target.blur(); - } - - - // Global touchstart handler that creates an allowable region for a click event. - // This allowable region can be removed by preventGhostClick if we want to bust it. - function onTouchStart(event) { - var touches = event.touches && event.touches.length ? event.touches : [event]; - var x = touches[0].clientX; - var y = touches[0].clientY; - touchCoordinates.push(x, y); - - $timeout(function() { - // Remove the allowable region. - for (var i = 0; i < touchCoordinates.length; i += 2) { - if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) { - touchCoordinates.splice(i, i + 2); - return; - } - } - }, PREVENT_DURATION, false); - } - - // On the first call, attaches some event handlers. Then whenever it gets called, it creates a - // zone around the touchstart where clicks will get busted. - function preventGhostClick(x, y) { - if (!touchCoordinates) { - $rootElement[0].addEventListener('click', onClick, true); - $rootElement[0].addEventListener('touchstart', onTouchStart, true); - touchCoordinates = []; - } - - lastPreventedTime = Date.now(); - - checkAllowableRegions(touchCoordinates, x, y); - } - - // Actual linking function. - return function(scope, element, attr) { - var clickHandler = $parse(attr.ngClick), - tapping = false, - tapElement, // Used to blur the element after a tap. - startTime, // Used to check if the tap was held too long. - touchStartX, - touchStartY; - - function resetState() { - tapping = false; - element.removeClass(ACTIVE_CLASS_NAME); - } - - element.on('touchstart', function(event) { - tapping = true; - tapElement = event.target ? event.target : event.srcElement; // IE uses srcElement. - // Hack for Safari, which can target text nodes instead of containers. - if (tapElement.nodeType == 3) { - tapElement = tapElement.parentNode; - } - - element.addClass(ACTIVE_CLASS_NAME); - - startTime = Date.now(); - - var touches = event.touches && event.touches.length ? event.touches : [event]; - var e = touches[0].originalEvent || touches[0]; - touchStartX = e.clientX; - touchStartY = e.clientY; - }); - - element.on('touchmove', function(event) { - resetState(); - }); - - element.on('touchcancel', function(event) { - resetState(); - }); - - element.on('touchend', function(event) { - var diff = Date.now() - startTime; - - var touches = (event.changedTouches && event.changedTouches.length) ? event.changedTouches : - ((event.touches && event.touches.length) ? event.touches : [event]); - var e = touches[0].originalEvent || touches[0]; - var x = e.clientX; - var y = e.clientY; - var dist = Math.sqrt(Math.pow(x - touchStartX, 2) + Math.pow(y - touchStartY, 2)); - - if (tapping && diff < TAP_DURATION && dist < MOVE_TOLERANCE) { - // Call preventGhostClick so the clickbuster will catch the corresponding click. - preventGhostClick(x, y); - - // Blur the focused element (the button, probably) before firing the callback. - // This doesn't work perfectly on Android Chrome, but seems to work elsewhere. - // I couldn't get anything to work reliably on Android Chrome. - if (tapElement) { - tapElement.blur(); - } - - if (!angular.isDefined(attr.disabled) || attr.disabled === false) { - element.triggerHandler('click', [event]); - } - } - - resetState(); - }); - - // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click - // something else nearby. - element.onclick = function(event) { }; - - // Actual click handler. - // There are three different kinds of clicks, only two of which reach this point. - // - On desktop browsers without touch events, their clicks will always come here. - // - On mobile browsers, the simulated "fast" click will call this. - // - But the browser's follow-up slow click will be "busted" before it reaches this handler. - // Therefore it's safe to use this directive on both mobile and desktop. - element.on('click', function(event, touchend) { - scope.$apply(function() { - clickHandler(scope, {$event: (touchend || event)}); - }); - }); - - element.on('mousedown', function(event) { - element.addClass(ACTIVE_CLASS_NAME); - }); - - element.on('mousemove mouseup', function(event) { - element.removeClass(ACTIVE_CLASS_NAME); - }); - - }; -}]); - -/* global ngTouch: false */ - -/** - * @ngdoc directive - * @name ngSwipeLeft + * See the {@link ngTouch module} documentation for more information. * * @description * Specify custom behavior when an element is swiped to the left on a touchscreen device. @@ -506,7 +247,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', * upon left swipe. (Event object is available as `$event`) * * @example - +
Some list content, like an email in the inbox @@ -526,6 +267,11 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', * @ngdoc directive * @name ngSwipeRight * + * @deprecated + * sinceVersion="1.7.0" + * + * See the {@link ngTouch module} documentation for more information. + * * @description * Specify custom behavior when an element is swiped to the right on a touchscreen device. * A rightward swipe is a quick, left-to-right slide of the finger. @@ -539,7 +285,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', * upon right swipe. (Event object is available as `$event`) * * @example - +
Some list content, like an email in the inbox diff --git a/angular-touch.min.js b/angular-touch.min.js index 21af6cf21..2ad43bf21 100644 --- a/angular-touch.min.js +++ b/angular-touch.min.js @@ -1,13 +1,10 @@ /* - AngularJS v1.3.9-build.3770+sha.034fade - (c) 2010-2015 Google, Inc. http://angularjs.org + AngularJS v1.8.3 + (c) 2010-2020 Google LLC. http://angularjs.org License: MIT */ -(function(y,u,z){'use strict';function s(h,k,p){n.directive(h,["$parse","$swipe",function(d,e){return function(l,m,f){function g(a){if(!c)return!1;var b=Math.abs(a.y-c.y);a=(a.x-c.x)*k;return q&&75>b&&0b/a}var b=d(f[h]),c,q,a=["touch"];u.isDefined(f.ngSwipeDisableMouse)||a.push("mouse");e.bind(m,{start:function(a,b){c=a;q=!0},cancel:function(a){q=!1},end:function(a,c){g(a)&&l.$apply(function(){m.triggerHandler(p);b(l,{$event:c})})}},a)}}])}var n=u.module("ngTouch",[]);n.factory("$swipe", -[function(){function h(d){var e=d.touches&&d.touches.length?d.touches:[d];d=d.changedTouches&&d.changedTouches[0]||d.originalEvent&&d.originalEvent.changedTouches&&d.originalEvent.changedTouches[0]||e[0].originalEvent||e[0];return{x:d.clientX,y:d.clientY}}function k(d,e){var l=[];u.forEach(d,function(d){(d=p[d][e])&&l.push(d)});return l.join(" ")}var p={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend",cancel:"touchcancel"}};return{bind:function(d, -e,l){var m,f,g,b,c=!1;l=l||["mouse","touch"];d.on(k(l,"start"),function(a){g=h(a);c=!0;f=m=0;b=g;e.start&&e.start(g,a)});var q=k(l,"cancel");if(q)d.on(q,function(a){c=!1;e.cancel&&e.cancel(a)});d.on(k(l,"move"),function(a){if(c&&g){var d=h(a);m+=Math.abs(d.x-b.x);f+=Math.abs(d.y-b.y);b=d;10>m&&10>f||(f>m?(c=!1,e.cancel&&e.cancel(a)):(a.preventDefault(),e.move&&e.move(d,a)))}});d.on(k(l,"end"),function(a){c&&(c=!1,e.end&&e.end(h(a),a))})}}}]);n.config(["$provide",function(h){h.decorator("ngClickDirective", -["$delegate",function(k){k.shift();return k}])}]);n.directive("ngClick",["$parse","$timeout","$rootElement",function(h,k,p){function d(b,c,d){for(var a=0;aMath.abs(b[a]-c)&&25>Math.abs(e-f))return b.splice(a,a+2),!0}return!1}function e(b){if(!(2500e&&1>c||g&&g[0]===e&&g[1]===c||(g&&(g=null),"label"===b.target.tagName.toLowerCase()&&(g=[e,c]),d(f,e,c)||(b.stopPropagation(), -b.preventDefault(),b.target&&b.target.blur()))}}function l(b){b=b.touches&&b.touches.length?b.touches:[b];var c=b[0].clientX,d=b[0].clientY;f.push(c,d);k(function(){for(var a=0;ak&&12>x&&(f||(p[0].addEventListener("click",e,!0),p[0].addEventListener("touchstart", -l,!0),f=[]),m=Date.now(),d(f,h,t),r&&r.blur(),u.isDefined(g.disabled)&&!1!==g.disabled||c.triggerHandler("click",[b]));a()});c.onclick=function(a){};c.on("click",function(a,c){b.$apply(function(){k(b,{$event:c||a})})});c.on("mousedown",function(a){c.addClass("ng-click-active")});c.on("mousemove mouseup",function(a){c.removeClass("ng-click-active")})}}]);s("ngSwipeLeft",-1,"swipeleft");s("ngSwipeRight",1,"swiperight")})(window,window.angular); +(function(t,p){'use strict';function q(g,h,s){n.directive(g,["$parse","$swipe",function(a,b){return function(c,e,f){function k(a){if(!d)return!1;var b=Math.abs(a.y-d.y);a=(a.x-d.x)*h;return l&&75>b&&0b/a}var m=a(f[g]),d,l,r=["touch"];p.isDefined(f.ngSwipeDisableMouse)||r.push("mouse");b.bind(e,{start:function(a,b){d=a;l=!0},cancel:function(a){l=!1},end:function(a,b){k(a)&&c.$apply(function(){e.triggerHandler(s);m(c,{$event:b})})}},r)}}])}var n=p.module("ngTouch",[]);n.info({angularVersion:"1.8.3"}); +n.factory("$swipe",[function(){function g(a){a=a.originalEvent||a;var b=a.touches&&a.touches.length?a.touches:[a];a=a.changedTouches&&a.changedTouches[0]||b[0];return{x:a.clientX,y:a.clientY}}function h(a,b){var c=[];p.forEach(a,function(a){(a=n[a][b])&&c.push(a)});return c.join(" ")}var n={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend",cancel:"touchcancel"},pointer:{start:"pointerdown",move:"pointermove",end:"pointerup",cancel:"pointercancel"}}; +return{bind:function(a,b,c){var e,f,k,m,d=!1;c=c||["mouse","touch","pointer"];a.on(h(c,"start"),function(a){k=g(a);d=!0;f=e=0;m=k;b.start&&b.start(k,a)});var l=h(c,"cancel");if(l)a.on(l,function(a){d=!1;b.cancel&&b.cancel(a)});a.on(h(c,"move"),function(a){if(d&&k){var c=g(a);e+=Math.abs(c.x-m.x);f+=Math.abs(c.y-m.y);m=c;10>e&&10>f||(f>e?(d=!1,b.cancel&&b.cancel(a)):(a.preventDefault(),b.move&&b.move(c,a)))}});a.on(h(c,"end"),function(a){d&&(d=!1,b.end&&b.end(g(a),a))})}}}]);q("ngSwipeLeft",-1,"swipeleft"); +q("ngSwipeRight",1,"swiperight")})(window,window.angular); //# sourceMappingURL=angular-touch.min.js.map diff --git a/angular-touch.min.js.map b/angular-touch.min.js.map index a00b14c21..1c0b5e946 100644 --- a/angular-touch.min.js.map +++ b/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","angular","undefined","makeSwipeDirective","directiveName","direction","eventName","ngTouch","directive","$parse","$swipe","scope","element","attr","validSwipe","coords","startCoords","deltaY","Math","abs","y","deltaX","x","valid","MAX_VERTICAL_DISTANCE","MIN_HORIZONTAL_DISTANCE","MAX_VERTICAL_RATIO","swipeHandler","pointerTypes","isDefined","push","bind","start","event","cancel","end","$apply","triggerHandler","$event","module","factory","getCoordinates","touches","length","e","changedTouches","originalEvent","clientX","clientY","getEvents","eventType","res","forEach","pointerType","POINTER_EVENTS","join","move","eventHandlers","totalX","totalY","lastPos","active","on","events","MOVE_BUFFER_RADIUS","preventDefault","config","$provide","decorator","$delegate","shift","$timeout","$rootElement","checkAllowableRegions","touchCoordinates","i","CLICKBUSTER_THRESHOLD","x1","y1","y2","splice","onClick","PREVENT_DURATION","Date","now","lastPreventedTime","lastLabelClickCoordinates","target","tagName","toLowerCase","stopPropagation","blur","onTouchStart","resetState","tapping","removeClass","ACTIVE_CLASS_NAME","clickHandler","ngClick","tapElement","startTime","touchStartX","touchStartY","srcElement","nodeType","parentNode","addClass","diff","dist","sqrt","pow","TAP_DURATION","MOVE_TOLERANCE","addEventListener","disabled","onclick","element.onclick","touchend"] +"names":["window","angular","makeSwipeDirective","directiveName","direction","eventName","ngTouch","directive","$parse","$swipe","scope","element","attr","validSwipe","coords","startCoords","deltaY","Math","abs","y","deltaX","x","valid","MAX_VERTICAL_DISTANCE","MIN_HORIZONTAL_DISTANCE","MAX_VERTICAL_RATIO","swipeHandler","pointerTypes","isDefined","push","bind","start","event","cancel","end","$apply","triggerHandler","$event","module","info","angularVersion","factory","getCoordinates","originalEvent","touches","length","e","changedTouches","clientX","clientY","getEvents","eventType","res","forEach","pointerType","POINTER_EVENTS","join","move","eventHandlers","totalX","totalY","lastPos","active","on","events","MOVE_BUFFER_RADIUS","preventDefault"] } diff --git a/bower.json b/bower.json index e8550dac5..408286aa3 100644 --- a/bower.json +++ b/bower.json @@ -1,9 +1,10 @@ { "name": "angular-touch", - "version": "1.3.9-build.3770+sha.034fade", + "version": "1.8.3", + "license": "MIT", "main": "./angular-touch.js", "ignore": [], "dependencies": { - "angular": "1.3.9-build.3770+sha.034fade" + "angular": "1.8.3" } } diff --git a/index.js b/index.js new file mode 100644 index 000000000..0478a404b --- /dev/null +++ b/index.js @@ -0,0 +1,2 @@ +require('./angular-touch'); +module.exports = 'ngTouch'; diff --git a/package.json b/package.json index 4a4812aba..6ba170837 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "angular-touch", - "version": "1.3.9-build.3770+sha.034fade", + "version": "1.8.3", "description": "AngularJS module for touch events and helpers for touch-enabled devices", - "main": "angular-touch.js", + "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -22,5 +22,12 @@ "bugs": { "url": "https://github.com/angular/angular.js/issues" }, - "homepage": "http://angularjs.org" + "homepage": "http://angularjs.org", + "jspm": { + "shim": { + "angular-touch": { + "deps": ["angular"] + } + } + } }