From 1cf528b13f5d2bb02aa4a00925ee264b310618c1 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Tue, 13 May 2014 00:36:03 +0200 Subject: Update hammer, make usable on desktop --- js/hammer.js | 586 ------------------------------------------------------ js/hammer.min.js | 9 + js/hammer.min.map | 1 + js/slide-deck.js | 15 +- js/slides.js | 2 +- 5 files changed, 19 insertions(+), 594 deletions(-) delete mode 100755 js/hammer.js create mode 100755 js/hammer.min.js create mode 100644 js/hammer.min.map (limited to 'js') diff --git a/js/hammer.js b/js/hammer.js deleted file mode 100755 index 44a5802..0000000 --- a/js/hammer.js +++ /dev/null @@ -1,586 +0,0 @@ -/* - * Hammer.JS - * version 0.4 - * author: Eight Media - * https://github.com/EightMedia/hammer.js - */ -function Hammer(element, options, undefined) -{ - var self = this; - - var defaults = { - // prevent the default event or not... might be buggy when false - prevent_default : false, - css_hacks : true, - - drag : true, - drag_vertical : true, - drag_horizontal : true, - // minimum distance before the drag event starts - drag_min_distance : 20, // pixels - - // pinch zoom and rotation - transform : true, - scale_treshold : 0.1, - rotation_treshold : 15, // degrees - - tap : true, - tap_double : true, - tap_max_interval : 300, - tap_double_distance: 20, - - hold : true, - hold_timeout : 500 - }; - options = mergeObject(defaults, options); - - // some css hacks - (function() { - if(!options.css_hacks) { - return false; - } - - var vendors = ['webkit','moz','ms','o','']; - var css_props = { - "userSelect": "none", - "touchCallout": "none", - "userDrag": "none", - "tapHighlightColor": "rgba(0,0,0,0)" - }; - - var prop = ''; - for(var i = 0; i < vendors.length; i++) { - for(var p in css_props) { - prop = p; - if(vendors[i]) { - prop = vendors[i] + prop.substring(0, 1).toUpperCase() + prop.substring(1); - } - element.style[ prop ] = css_props[p]; - } - } - })(); - - // holds the distance that has been moved - var _distance = 0; - - // holds the exact angle that has been moved - var _angle = 0; - - // holds the diraction that has been moved - var _direction = 0; - - // holds position movement for sliding - var _pos = { }; - - // how many fingers are on the screen - var _fingers = 0; - - var _first = false; - - var _gesture = null; - var _prev_gesture = null; - - var _touch_start_time = null; - var _prev_tap_pos = {x: 0, y: 0}; - var _prev_tap_end_time = null; - - var _hold_timer = null; - - var _offset = {}; - - // keep track of the mouse status - var _mousedown = false; - - var _event_start; - var _event_move; - var _event_end; - - - /** - * angle to direction define - * @param float angle - * @return string direction - */ - this.getDirectionFromAngle = function( angle ) - { - var directions = { - down: angle >= 45 && angle < 135, //90 - left: angle >= 135 || angle <= -135, //180 - up: angle < -45 && angle > -135, //270 - right: angle >= -45 && angle <= 45 //0 - }; - - var direction, key; - for(key in directions){ - if(directions[key]){ - direction = key; - break; - } - } - return direction; - }; - - - /** - * count the number of fingers in the event - * when no fingers are detected, one finger is returned (mouse pointer) - * @param event - * @return int fingers - */ - function countFingers( event ) - { - // there is a bug on android (until v4?) that touches is always 1, - // so no multitouch is supported, e.g. no, zoom and rotation... - return event.touches ? event.touches.length : 1; - } - - - /** - * get the x and y positions from the event object - * @param event - * @return array [{ x: int, y: int }] - */ - function getXYfromEvent( event ) - { - event = event || window.event; - - // no touches, use the event pageX and pageY - if(!event.touches) { - var doc = document, - body = doc.body; - - return [{ - x: event.pageX || event.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && doc.clientLeft || 0 ), - y: event.pageY || event.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && doc.clientTop || 0 ) - }]; - } - // multitouch, return array with positions - else { - var pos = [], src; - for(var t=0, len=event.touches.length; t options.drag_min_distance) || _gesture == 'drag') { - // calculate the angle - _angle = getAngle(_pos.start[0], _pos.move[0]); - _direction = self.getDirectionFromAngle(_angle); - - // check the movement and stop if we go in the wrong direction - var is_vertical = (_direction == 'up' || _direction == 'down'); - if(((is_vertical && !options.drag_vertical) || (!is_vertical && !options.drag_horizontal)) - && (_distance > options.drag_min_distance)) { - return; - } - - _gesture = 'drag'; - - var position = { x: _pos.move[0].x - _offset.left, - y: _pos.move[0].y - _offset.top }; - - var event_obj = { - originalEvent : event, - position : position, - direction : _direction, - distance : _distance, - distanceX : _distance_x, - distanceY : _distance_y, - angle : _angle - }; - - // on the first time trigger the start event - if(_first) { - triggerEvent("dragstart", event_obj); - - _first = false; - } - - // normal slide event - triggerEvent("drag", event_obj); - - cancelEvent(event); - } - }, - - - // transform gesture - // fired on touchmove - transform : function(event) - { - if(options.transform) { - var scale = event.scale || 1; - var rotation = event.rotation || 0; - - if(countFingers(event) != 2) { - return false; - } - - if(_gesture != 'drag' && - (_gesture == 'transform' || Math.abs(1-scale) > options.scale_treshold - || Math.abs(rotation) > options.rotation_treshold)) { - _gesture = 'transform'; - - _pos.center = { x: ((_pos.move[0].x + _pos.move[1].x) / 2) - _offset.left, - y: ((_pos.move[0].y + _pos.move[1].y) / 2) - _offset.top }; - - var event_obj = { - originalEvent : event, - position : _pos.center, - scale : scale, - rotation : rotation - }; - - // on the first time trigger the start event - if(_first) { - triggerEvent("transformstart", event_obj); - _first = false; - } - - triggerEvent("transform", event_obj); - - cancelEvent(event); - - return true; - } - } - - return false; - }, - - - // tap and double tap gesture - // fired on touchend - tap : function(event) - { - // compare the kind of gesture by time - var now = new Date().getTime(); - var touch_time = now - _touch_start_time; - - // dont fire when hold is fired - if(options.hold && !(options.hold && options.hold_timeout > touch_time)) { - return; - } - - // when previous event was tap and the tap was max_interval ms ago - var is_double_tap = (function(){ - if (_prev_tap_pos && options.tap_double && _prev_gesture == 'tap' && (_touch_start_time - _prev_tap_end_time) < options.tap_max_interval) { - var x_distance = Math.abs(_prev_tap_pos[0].x - _pos.start[0].x); - var y_distance = Math.abs(_prev_tap_pos[0].y - _pos.start[0].y); - return (_prev_tap_pos && _pos.start && Math.max(x_distance, y_distance) < options.tap_double_distance); - - } - return false; - })(); - - if(is_double_tap) { - _gesture = 'double_tap'; - _prev_tap_end_time = null; - - triggerEvent("doubletap", { - originalEvent : event, - position : _pos.start - }); - cancelEvent(event); - } - - // single tap is single touch - else { - _gesture = 'tap'; - _prev_tap_end_time = now; - _prev_tap_pos = _pos.start; - - if(options.tap) { - triggerEvent("tap", { - originalEvent : event, - position : _pos.start - }); - cancelEvent(event); - } - } - - } - - }; - - - function handleEvents(event) - { - switch(event.type) - { - case 'mousedown': - case 'touchstart': - _pos.start = getXYfromEvent(event); - _touch_start_time = new Date().getTime(); - _fingers = countFingers(event); - _first = true; - _event_start = event; - - // borrowed from jquery offset https://github.com/jquery/jquery/blob/master/src/offset.js - var box = element.getBoundingClientRect(); - var clientTop = element.clientTop || document.body.clientTop || 0; - var clientLeft = element.clientLeft || document.body.clientLeft || 0; - var scrollTop = window.pageYOffset || element.scrollTop || document.body.scrollTop; - var scrollLeft = window.pageXOffset || element.scrollLeft || document.body.scrollLeft; - - _offset = { - top: box.top + scrollTop - clientTop, - left: box.left + scrollLeft - clientLeft - }; - - _mousedown = true; - - // hold gesture - gestures.hold(event); - - if(options.prevent_default) { - cancelEvent(event); - } - break; - - case 'mousemove': - case 'touchmove': - if(!_mousedown) { - return false; - } - _event_move = event; - _pos.move = getXYfromEvent(event); - - if(!gestures.transform(event)) { - gestures.drag(event); - } - break; - - case 'mouseup': - case 'mouseout': - case 'touchcancel': - case 'touchend': - if(!_mousedown || (_gesture != 'transform' && event.touches && event.touches.length > 0)) { - return false; - } - - _mousedown = false; - _event_end = event; - - // drag gesture - // dragstart is triggered, so dragend is possible - if(_gesture == 'drag') { - triggerEvent("dragend", { - originalEvent : event, - direction : _direction, - distance : _distance, - angle : _angle - }); - } - - // transform - // transformstart is triggered, so transformed is possible - else if(_gesture == 'transform') { - triggerEvent("transformend", { - originalEvent : event, - position : _pos.center, - scale : event.scale, - rotation : event.rotation - }); - } - else { - gestures.tap(_event_start); - } - - _prev_gesture = _gesture; - - // reset vars - reset(); - break; - } - } - - - // bind events for touch devices - // except for windows phone 7.5, it doesnt support touch events..! - if('ontouchstart' in window) { - element.addEventListener("touchstart", handleEvents, false); - element.addEventListener("touchmove", handleEvents, false); - element.addEventListener("touchend", handleEvents, false); - element.addEventListener("touchcancel", handleEvents, false); - } - // for non-touch - else { - - if(element.addEventListener){ // prevent old IE errors - element.addEventListener("mouseout", function(event) { - if(!isInsideHammer(element, event.relatedTarget)) { - handleEvents(event); - } - }, false); - element.addEventListener("mouseup", handleEvents, false); - element.addEventListener("mousedown", handleEvents, false); - element.addEventListener("mousemove", handleEvents, false); - - // events for older IE - }else if(document.attachEvent){ - element.attachEvent("onmouseout", function(event) { - if(!isInsideHammer(element, event.relatedTarget)) { - handleEvents(event); - } - }, false); - element.attachEvent("onmouseup", handleEvents); - element.attachEvent("onmousedown", handleEvents); - element.attachEvent("onmousemove", handleEvents); - } - } - - - /** - * find if element is (inside) given parent element - * @param object element - * @param object parent - * @return bool inside - */ - function isInsideHammer(parent, child) { - // get related target for IE - if(!child && window.event && window.event.toElement){ - child = window.event.toElement; - } - - if(parent === child){ - return true; - } - - // loop over parentNodes of child until we find hammer element - if(child){ - var node = child.parentNode; - while(node !== null){ - if(node === parent){ - return true; - }; - node = node.parentNode; - } - } - return false; - } - - - /** - * merge 2 objects into a new object - * @param object obj1 - * @param object obj2 - * @return object merged object - */ - function mergeObject(obj1, obj2) { - var output = {}; - - if(!obj2) { - return obj1; - } - - for (var prop in obj1) { - if (prop in obj2) { - output[prop] = obj2[prop]; - } else { - output[prop] = obj1[prop]; - } - } - return output; - } - - function isFunction( obj ){ - return Object.prototype.toString.call( obj ) == "[object Function]"; - } -} \ No newline at end of file diff --git a/js/hammer.min.js b/js/hammer.min.js new file mode 100755 index 0000000..32a076f --- /dev/null +++ b/js/hammer.min.js @@ -0,0 +1,9 @@ +/*! Hammer.JS - v1.1.2 - 2014-04-25 + * http://eightmedia.github.io/hammer.js + * + * Copyright (c) 2014 Jorik Tangelder ; + * Licensed under the MIT license */ + + +!function(a,b){"use strict";function c(){d.READY||(s.determineEventTypes(),r.each(d.gestures,function(a){u.register(a)}),s.onTouch(d.DOCUMENT,n,u.detect),s.onTouch(d.DOCUMENT,o,u.detect),d.READY=!0)}var d=function v(a,b){return new v.Instance(a,b||{})};d.VERSION="1.1.2",d.defaults={behavior:{userSelect:"none",touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},d.DOCUMENT=document,d.HAS_POINTEREVENTS=navigator.pointerEnabled||navigator.msPointerEnabled,d.HAS_TOUCHEVENTS="ontouchstart"in a,d.IS_MOBILE=/mobile|tablet|ip(ad|hone|od)|android|silk/i.test(navigator.userAgent),d.NO_MOUSEEVENTS=d.HAS_TOUCHEVENTS&&d.IS_MOBILE||d.HAS_POINTEREVENTS,d.CALCULATE_INTERVAL=25;var e={},f=d.DIRECTION_DOWN="down",g=d.DIRECTION_LEFT="left",h=d.DIRECTION_UP="up",i=d.DIRECTION_RIGHT="right",j=d.POINTER_MOUSE="mouse",k=d.POINTER_TOUCH="touch",l=d.POINTER_PEN="pen",m=d.EVENT_START="start",n=d.EVENT_MOVE="move",o=d.EVENT_END="end",p=d.EVENT_RELEASE="release",q=d.EVENT_TOUCH="touch";d.READY=!1,d.plugins=d.plugins||{},d.gestures=d.gestures||{};var r=d.utils={extend:function(a,c,d){for(var e in c)!c.hasOwnProperty(e)||a[e]!==b&&d||(a[e]=c[e]);return a},on:function(a,b,c){a.addEventListener(b,c,!1)},off:function(a,b,c){a.removeEventListener(b,c,!1)},each:function(a,c,d){var e,f;if("forEach"in a)a.forEach(c,d);else if(a.length!==b){for(e=0,f=a.length;f>e;e++)if(c.call(d,a[e],e,a)===!1)return}else for(e in a)if(a.hasOwnProperty(e)&&c.call(d,a[e],e,a)===!1)return},inStr:function(a,b){return a.indexOf(b)>-1},inArray:function(a,b){if(a.indexOf){var c=a.indexOf(b);return-1===c?!1:c}for(var d=0,e=a.length;e>d;d++)if(a[d]===b)return d;return!1},toArray:function(a){return Array.prototype.slice.call(a,0)},hasParent:function(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1},getCenter:function(a){var b=[],c=[],d=[],e=[],f=Math.min,g=Math.max;return 1===a.length?{pageX:a[0].pageX,pageY:a[0].pageY,clientX:a[0].clientX,clientY:a[0].clientY}:(r.each(a,function(a){b.push(a.pageX),c.push(a.pageY),d.push(a.clientX),e.push(a.clientY)}),{pageX:(f.apply(Math,b)+g.apply(Math,b))/2,pageY:(f.apply(Math,c)+g.apply(Math,c))/2,clientX:(f.apply(Math,d)+g.apply(Math,d))/2,clientY:(f.apply(Math,e)+g.apply(Math,e))/2})},getVelocity:function(a,b,c){return{x:Math.abs(b/a)||0,y:Math.abs(c/a)||0}},getAngle:function(a,b){var c=b.clientX-a.clientX,d=b.clientY-a.clientY;return 180*Math.atan2(d,c)/Math.PI},getDirection:function(a,b){var c=Math.abs(a.clientX-b.clientX),d=Math.abs(a.clientY-b.clientY);return c>=d?a.clientX-b.clientX>0?g:i:a.clientY-b.clientY>0?h:f},getDistance:function(a,b){var c=b.clientX-a.clientX,d=b.clientY-a.clientY;return Math.sqrt(c*c+d*d)},getScale:function(a,b){return a.length>=2&&b.length>=2?this.getDistance(b[0],b[1])/this.getDistance(a[0],a[1]):1},getRotation:function(a,b){return a.length>=2&&b.length>=2?this.getAngle(b[1],b[0])-this.getAngle(a[1],a[0]):0},isVertical:function(a){return a==h||a==f},setPrefixedCss:function(a,b,c,d){var e=["","Webkit","Moz","O","ms"];b=r.toCamelCase(b);for(var f=0;f0&&this.started&&(g=n),this.started=!0;var j=this.collectEventData(c,g,e,a);return b!=o&&d.call(u,j),h&&(j.changedLength=i,j.eventType=h,d.call(u,j),j.eventType=g,delete j.changedLength),g==o&&(d.call(u,j),this.started=!1),g},determineEventTypes:function(){var b;return b=d.HAS_POINTEREVENTS?a.PointerEvent?["pointerdown","pointermove","pointerup pointercancel lostpointercapture"]:["MSPointerDown","MSPointerMove","MSPointerUp MSPointerCancel MSLostPointerCapture"]:d.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],e[m]=b[0],e[n]=b[1],e[o]=b[2],e},getTouchList:function(a,b){if(d.HAS_POINTEREVENTS)return t.getTouchList();if(a.touches){if(b==n)return a.touches;var c=[],e=[].concat(r.toArray(a.touches),r.toArray(a.changedTouches)),f=[];return r.each(e,function(a){r.inArray(c,a.identifier)===!1&&f.push(a),c.push(a.identifier)}),f}return a.identifier=1,[a]},collectEventData:function(a,b,c,d){var e=k;return r.inStr(d.type,"mouse")||t.matchType(j,d)?e=j:t.matchType(l,d)&&(e=l),{center:r.getCenter(c),timeStamp:Date.now(),target:d.target,touches:c,eventType:b,pointerType:e,srcEvent:d,preventDefault:function(){var a=this.srcEvent;a.preventManipulation&&a.preventManipulation(),a.preventDefault&&a.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return u.stopDetect()}}}},t=d.PointerEvent={pointers:{},getTouchList:function(){var a=[];return r.each(this.pointers,function(b){a.push(b)}),a},updatePointer:function(a,b){a==o||a!=o&&1!==b.buttons?delete this.pointers[b.pointerId]:(b.identifier=b.pointerId,this.pointers[b.pointerId]=b)},matchType:function(a,b){if(!b.pointerType)return!1;var c=b.pointerType,d={};return d[j]=c===(b.MSPOINTER_TYPE_MOUSE||j),d[k]=c===(b.MSPOINTER_TYPE_TOUCH||k),d[l]=c===(b.MSPOINTER_TYPE_PEN||l),d[a]},reset:function(){this.pointers={}}},u=d.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(a,b){this.current||(this.stopped=!1,this.current={inst:a,startEvent:r.extend({},b),lastEvent:!1,lastCalcEvent:!1,futureCalcEvent:!1,lastCalcData:{},name:""},this.detect(b))},detect:function(a){if(this.current&&!this.stopped){a=this.extendEventData(a);var b=this.current.inst,c=b.options;return r.each(this.gestures,function(d){return!this.stopped&&b.enabled&&c[d.name]&&d.handler.call(d,a,b)===!1?(this.stopDetect(),!1):void 0},this),this.current&&(this.current.lastEvent=a),a.eventType==o&&this.stopDetect(),a}},stopDetect:function(){this.previous=r.extend({},this.current),this.current=null,this.stopped=!0},getCalculatedData:function(a,b,c,e,f){var g=this.current,h=!1,i=g.lastCalcEvent,j=g.lastCalcData;i&&a.timeStamp-i.timeStamp>d.CALCULATE_INTERVAL&&(b=i.center,c=a.timeStamp-i.timeStamp,e=a.center.clientX-i.center.clientX,f=a.center.clientY-i.center.clientY,h=!0),(a.eventType==q||a.eventType==p)&&(g.futureCalcEvent=a),(!g.lastCalcEvent||h)&&(j.velocity=r.getVelocity(c,e,f),j.angle=r.getAngle(b,a.center),j.direction=r.getDirection(b,a.center),g.lastCalcEvent=g.futureCalcEvent||a,g.futureCalcEvent=a),a.velocityX=j.velocity.x,a.velocityY=j.velocity.y,a.interimAngle=j.angle,a.interimDirection=j.direction},extendEventData:function(a){var b=this.current,c=b.startEvent,d=b.lastEvent||c;(a.eventType==q||a.eventType==p)&&(c.touches=[],r.each(a.touches,function(a){c.touches.push({clientX:a.clientX,clientY:a.clientY})}));var e=a.timeStamp-c.timeStamp,f=a.center.clientX-c.center.clientX,g=a.center.clientY-c.center.clientY;return this.getCalculatedData(a,d.center,e,f,g),r.extend(a,{startEvent:c,deltaTime:e,deltaX:f,deltaY:g,distance:r.getDistance(c.center,a.center),angle:r.getAngle(c.center,a.center),direction:r.getDirection(c.center,a.center),scale:r.getScale(c.touches,a.touches),rotation:r.getRotation(c.touches,a.touches)}),a},register:function(a){var c=a.defaults||{};return c[a.name]===b&&(c[a.name]=!0),r.extend(d.defaults,c,!0),a.index=a.index||1e3,this.gestures.push(a),this.gestures.sort(function(a,b){return a.indexb.index?1:0}),this.gestures}};d.Instance=function(a,b){var e=this;c(),this.element=a,this.enabled=!0,r.each(b,function(a,c){delete b[c],b[r.toCamelCase(c)]=a}),this.options=r.extend(r.extend({},d.defaults),b||{}),this.options.behavior&&r.toggleBehavior(this.element,this.options.behavior,!0),this.eventStartHandler=s.onTouch(a,m,function(a){e.enabled&&a.eventType==m?u.startDetect(e,a):a.eventType==q&&u.detect(a)}),this.eventHandlers=[]},d.Instance.prototype={on:function(a,b){var c=this;return s.on(c.element,a,b,function(a){c.eventHandlers.push({gesture:a,handler:b})}),c},off:function(a,b){var c=this;return s.off(c.element,a,b,function(a){var d=r.inArray({gesture:a,handler:b});d!==!1&&c.eventHandlers.splice(d,1)}),c},trigger:function(a,b){b||(b={});var c=d.DOCUMENT.createEvent("Event");c.initEvent(a,!0,!0),c.gesture=b;var e=this.element;return r.hasParent(b.target,e)&&(e=b.target),e.dispatchEvent(c),this},enable:function(a){return this.enabled=a,this},dispose:function(){var a,b;for(r.toggleBehavior(this.element,this.options.behavior,!1),a=-1;b=this.eventHandlers[++a];)r.off(this.element,b.gesture,b.handler);return this.eventHandlers=[],s.off(this.element,e[m],this.eventStartHandler),null}},function(a){function b(b,d){var e=u.current;if(!(d.options.dragMaxTouches>0&&b.touches.length>d.options.dragMaxTouches))switch(b.eventType){case m:c=!1;break;case n:if(b.distance0)){var k=Math.abs(d.options.dragMinDistance/b.distance);j.pageX+=b.deltaX*k,j.pageY+=b.deltaY*k,j.clientX+=b.deltaX*k,j.clientY+=b.deltaY*k,b=u.extendEventData(b)}(e.lastEvent.dragLockToAxis||d.options.dragLockToAxis&&d.options.dragLockMinDistance<=b.distance)&&(b.dragLockToAxis=!0);var l=e.lastEvent.direction;b.dragLockToAxis&&l!==b.direction&&(b.direction=r.isVertical(l)?b.deltaY<0?h:f:b.deltaX<0?g:i),c||(d.trigger(a+"start",b),c=!0),d.trigger(a,b),d.trigger(a+b.direction,b);var q=r.isVertical(b.direction);(d.options.dragBlockVertical&&q||d.options.dragBlockHorizontal&&!q)&&b.preventDefault();break;case p:c&&b.changedLength<=d.options.dragMaxTouches&&(d.trigger(a+"end",b),c=!1);break;case o:c=!1}}var c=!1;d.gestures.Drag={name:a,index:50,handler:b,defaults:{dragMinDistance:10,dragDistanceCorrection:!0,dragMaxTouches:1,dragBlockHorizontal:!1,dragBlockVertical:!1,dragLockToAxis:!1,dragLockMinDistance:25}}}("drag"),d.gestures.Gesture={name:"gesture",index:1337,handler:function(a,b){b.trigger(this.name,a)}},function(a){function b(b,d){var e=d.options,f=u.current;switch(b.eventType){case m:clearTimeout(c),f.name=a,c=setTimeout(function(){f&&f.name==a&&d.trigger(a,b)},e.holdTimeout);break;case n:b.distance>e.holdThreshold&&clearTimeout(c);break;case p:clearTimeout(c)}}var c;d.gestures.Hold={name:a,index:10,defaults:{holdTimeout:500,holdThreshold:2},handler:b}}("hold"),d.gestures.Release={name:"release",index:1/0,handler:function(a,b){a.eventType==p&&b.trigger(this.name,a)}},d.gestures.Swipe={name:"swipe",index:40,defaults:{swipeMinTouches:1,swipeMaxTouches:1,swipeVelocityX:.6,swipeVelocityY:.6},handler:function(a,b){if(a.eventType==p){var c=a.touches.length,d=b.options;if(cd.swipeMaxTouches)return;(a.velocityX>d.swipeVelocityX||a.velocityY>d.swipeVelocityY)&&(b.trigger(this.name,a),b.trigger(this.name+a.direction,a))}}},function(a){function b(b,d){var e,f,g=d.options,h=u.current,i=u.previous;switch(b.eventType){case m:c=!1;break;case n:c=c||b.distance>g.tapMaxDistance;break;case o:"touchcancel"!=b.srcEvent.type&&b.deltaTimed.options.transformMinRotation&&d.trigger("rotate",b),e>d.options.transformMinScale&&(d.trigger("pinch",b),d.trigger("pinch"+(b.scale<1?"in":"out"),b));break;case p:c&&b.changedLength<2&&(d.trigger(a+"end",b),c=!1)}}var c=!1;d.gestures.Transform={name:a,index:45,defaults:{transformMinScale:.01,transformMinRotation:1},handler:b}}("transform"),"function"==typeof define&&define.amd?define(function(){return d}):"undefined"!=typeof module&&module.exports?module.exports=d:a.Hammer=d}(window); +//# sourceMappingURL=hammer.min.map \ No newline at end of file diff --git a/js/hammer.min.map b/js/hammer.min.map new file mode 100644 index 0000000..51d4f11 --- /dev/null +++ b/js/hammer.min.map @@ -0,0 +1 @@ +{"version":3,"file":"hammer.min.js","sources":["hammer.js"],"names":["window","undefined","setup","Hammer","READY","Event","determineEventTypes","Utils","each","gestures","gesture","Detection","register","onTouch","DOCUMENT","EVENT_MOVE","detect","EVENT_END","element","options","Instance","VERSION","defaults","behavior","userSelect","touchAction","touchCallout","contentZooming","userDrag","tapHighlightColor","document","HAS_POINTEREVENTS","navigator","pointerEnabled","msPointerEnabled","HAS_TOUCHEVENTS","IS_MOBILE","test","userAgent","NO_MOUSEEVENTS","CALCULATE_INTERVAL","EVENT_TYPES","DIRECTION_DOWN","DIRECTION_LEFT","DIRECTION_UP","DIRECTION_RIGHT","POINTER_MOUSE","POINTER_TOUCH","POINTER_PEN","EVENT_START","EVENT_RELEASE","EVENT_TOUCH","plugins","utils","extend","dest","src","merge","key","hasOwnProperty","on","type","handler","addEventListener","off","removeEventListener","obj","iterator","context","i","len","forEach","length","call","inStr","find","indexOf","inArray","index","toArray","Array","prototype","slice","hasParent","node","parent","parentNode","getCenter","touches","pageX","pageY","clientX","clientY","min","Math","max","touch","push","apply","getVelocity","deltaTime","deltaX","deltaY","x","abs","y","getAngle","touch1","touch2","atan2","PI","getDirection","getDistance","sqrt","getScale","start","end","this","getRotation","isVertical","direction","setPrefixedCss","prop","value","toggle","prefixes","toCamelCase","p","toUpperCase","style","toggleBehavior","props","falseFn","onselectstart","ondragstart","str","replace","s","event","preventMouseEvents","started","shouldDetect","hook","types","split","eventType","self","onTouchHandler","ev","triggerType","srcType","toLowerCase","isPointer","isMouse","button","buttons","PointerEvent","matchType","updatePointer","doDetect","reset","touchList","getTouchList","touchListLength","triggerChange","trigger","changedLength","changedTouches","evData","collectEventData","identifiers","concat","identifier","pointerType","center","timeStamp","Date","now","target","srcEvent","preventDefault","preventManipulation","stopPropagation","stopDetect","pointers","touchlist","pointer","pointerEvent","pointerId","pt","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_TOUCH","MSPOINTER_TYPE_PEN","detection","current","previous","stopped","startDetect","inst","eventData","startEvent","lastEvent","lastCalcEvent","futureCalcEvent","lastCalcData","name","extendEventData","instOptions","enabled","getCalculatedData","cur","recalc","calcEv","calcData","velocity","angle","velocityX","velocityY","interimAngle","interimDirection","startEv","lastEv","distance","scale","rotation","sort","a","b","eventStartHandler","eventHandlers","splice","createEvent","initEvent","dispatchEvent","enable","state","dispose","eh","dragGesture","dragMaxTouches","triggered","dragMinDistance","startCenter","dragDistanceCorrection","factor","dragLockToAxis","dragLockMinDistance","lastDirection","dragBlockVertical","dragBlockHorizontal","Drag","Gesture","holdGesture","clearTimeout","timer","setTimeout","holdTimeout","holdThreshold","Hold","Release","Infinity","Swipe","swipeMinTouches","swipeMaxTouches","swipeVelocityX","swipeVelocityY","tapGesture","sincePrev","didDoubleTap","prev","hasMoved","tapMaxDistance","tapMaxTime","doubleTapInterval","doubleTapDistance","tapAlways","Tap","Touch","preventMouse","transformGesture","scaleThreshold","rotationThreshold","transformMinScale","transformMinRotation","Transform","define","amd","module","exports"],"mappings":";;;;;;;CAMA,SAAUA,EAAQC,GAChB,YA2OF,SAASC,KACFC,EAAOC,QAKVC,EAAMC,sBAGNC,EAAMC,KAAKL,EAAOM,SAAU,SAASC,GACjCC,EAAUC,SAASF,KAIvBL,EAAMQ,QAAQV,EAAOW,SAAUC,EAAYJ,EAAUK,QACrDX,EAAMQ,QAAQV,EAAOW,SAAUG,EAAWN,EAAUK,QAGpDb,EAAOC,OAAQ,GAxOnB,GAAID,GAAS,QAASA,GAAOe,EAASC,GAClC,MAAO,IAAIhB,GAAOiB,SAASF,EAASC,OAUxChB,GAAOkB,QAAU,WAgBjBlB,EAAOmB,UAOHC,UAQIC,WAAY,OASZC,YAAa,OAUbC,aAAc,OAQdC,eAAgB,OAShBC,SAAU,OAaVC,kBAAmB,kBAU3B1B,EAAOW,SAAWgB,SAOlB3B,EAAO4B,kBAAoBC,UAAUC,gBAAkBD,UAAUE,iBAOjE/B,EAAOgC,gBAAmB,gBAAkBnC,GAO5CG,EAAOiC,UAAY,6CAA6CC,KAAKL,UAAUM,WAO/EnC,EAAOoC,eAAkBpC,EAAOgC,iBAAmBhC,EAAOiC,WAAcjC,EAAO4B,kBAQ/E5B,EAAOqC,mBAAqB,EAU5B,IAAIC,MASAC,EAAiBvC,EAAOuC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AY,CACZ,MAEJ,KAAKjO,GAED,GAAGqI,EAAG5D,QAAQhB,OAAS,EACnB,MAGJ,IAAIgN,GAAiB1L,KAAKU,IAAI,EAAI4C,EAAG2E,OACjC0D,EAAoB3L,KAAKU,IAAI4C,EAAG4E,SAIpC,IAAGwD,EAAiBlF,EAAKnL,QAAQuQ,mBAC7BD,EAAoBnF,EAAKnL,QAAQwQ,qBACjC,MAIJhR,GAAUuL,QAAQW,KAAOA,EAGrBmC,IACA1C,EAAKjC,QAAQwC,EAAO,QAASzD,GAC7B4F,GAAY,GAGhB1C,EAAKjC,QAAQwC,EAAMzD,GAGhBqI,EAAoBnF,EAAKnL,QAAQwQ,sBAChCrF,EAAKjC,QAAQ,SAAUjB,GAIxBoI,EAAiBlF,EAAKnL,QAAQuQ,oBAC7BpF,EAAKjC,QAAQ,QAASjB,GACtBkD,EAAKjC,QAAQ,SAAWjB,EAAG2E,MAAQ,EAAI,KAAO,OAAQ3E,GAE1D,MAEJ,KAAKlG,GACE8L,GAAa5F,EAAGkB,cAAgB,IAC/BgC,EAAKjC,QAAQwC,EAAO,MAAOzD,GAC3B4F,GAAY,IAlD5B,GAAIA,IAAY,CAwDhB7O,GAAOM,SAASmR,WACZ/E,KAAMA,EACN/H,MAAO,GACPxD,UAOIoQ,kBAAmB,IAQnBC,qBAAsB,GAG1B7N,QAASyN,IAEd,aAOiB,kBAAVM,SAAwBA,OAAOC,IACrCD,OAAO,WACH,MAAO1R,KAGa,mBAAX4R,SAA0BA,OAAOC,QAC9CD,OAAOC,QAAU7R,EAGjBH,EAAOG,OAASA,GAGjBH"} \ No newline at end of file diff --git a/js/slide-deck.js b/js/slide-deck.js index 559b761..266de5c 100644 --- a/js/slide-deck.js +++ b/js/slide-deck.js @@ -415,8 +415,9 @@ SlideDeck.prototype.loadConfig_ = function(config) { this.container.appendChild(el); } - if (Modernizr.touch - && (!!!('enableTouch' in settings) || settings.enableTouch)) { + if (/* + * Modernizr.touch && + */(!!!('enableTouch' in settings) || settings.enableTouch)) { var self = this; // Note: this prevents mobile zoom in/out but prevents iOS from doing @@ -425,13 +426,13 @@ SlideDeck.prototype.loadConfig_ = function(config) { e.preventDefault(); }, false); - require([ 'hammer' ], function() { - var hammer = new Hammer(this.container); - hammer.ondragend = function(e) { + require([ 'hammer' ], function(Hammer) { + var hammer = new Hammer(self.container); + hammer.on('swipe', function(e) { var evt = document.createEvent('Event'); evt.initEvent('keydown', true, true); - switch (e.direction) { + switch (e.gesture.direction) { case 'right': // previous slide evt.keyCode = 37; @@ -443,7 +444,7 @@ SlideDeck.prototype.loadConfig_ = function(config) { } document.dispatchEvent(evt); - }; + }); }); } diff --git a/js/slides.js b/js/slides.js index c2d0b5c..bfef324 100644 --- a/js/slides.js +++ b/js/slides.js @@ -6,7 +6,7 @@ require.config({ 'modernizr' : 'modernizr.custom.56571', 'prettify' : 'prettify/prettify', - 'hammer' : 'hammer', + 'hammer' : 'hammer.min', }, shim : { -- cgit v1.2.3