{"version":3,"file":"/pc/all/libs/lightbox/touch.js.map","sources":["/pc/all/libs/lightbox/touch.js"],"sourcesContent":["/* global define */\r\n\r\n(function(factory) {\r\n if (typeof define === \"function\" && define.amd) {\r\n define([\r\n \"jquery\",\r\n \"./core\"\r\n ], factory);\r\n } else {\r\n factory(jQuery, Formstone);\r\n }\r\n }(function($, Formstone) {\r\n\r\n \"use strict\";\r\n\r\n /**\r\n * @method private\r\n * @name construct\r\n * @description Builds instance.\r\n * @param data [object] \"Instance data\"\r\n */\r\n\r\n function construct(data) {\r\n data.touches = [];\r\n data.touching = false;\r\n\r\n this.on(Events.dragStart, Functions.killEvent);\r\n\r\n if (data.swipe) {\r\n data.pan = true;\r\n }\r\n\r\n if (data.scale) {\r\n data.axis = false;\r\n }\r\n\r\n data.axisX = data.axis === \"x\";\r\n data.axisY = data.axis === \"y\";\r\n\r\n if (Formstone.support.pointer) {\r\n var action = \"\";\r\n\r\n if (!data.axis || (data.axisX && data.axisY)) {\r\n action = \"none\";\r\n } else {\r\n if (data.axisX) {\r\n action += \" pan-y\";\r\n }\r\n if (data.axisY) {\r\n action += \" pan-x\";\r\n }\r\n }\r\n\r\n touchAction(this, action);\r\n\r\n this.on(Events.pointerDown, data, onTouch);\r\n } else {\r\n this.on(Events.touchStart, data, onTouch)\r\n .on(Events.mouseDown, data, onPointerStart);\r\n }\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name destruct\r\n * @description Tears down instance.\r\n * @param data [object] \"Instance data\"\r\n */\r\n\r\n function destruct(data) {\r\n this.off(Events.namespace);\r\n\r\n touchAction(this, \"\");\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name onTouch\r\n * @description Delegates touch events.\r\n * @param e [object] \"Event data\"\r\n */\r\n\r\n function onTouch(e) {\r\n // Stop panning and zooming\r\n if (e.preventManipulation) {\r\n e.preventManipulation();\r\n }\r\n\r\n var data = e.data,\r\n oe = e.originalEvent;\r\n\r\n if (oe.type.match(/(up|end|cancel)$/i)) {\r\n onPointerEnd(e);\r\n return;\r\n }\r\n\r\n if (oe.pointerId) {\r\n // Normalize MS pointer events back to standard touches\r\n var activeTouch = false;\r\n for (var i in data.touches) {\r\n if (data.touches[i].id === oe.pointerId) {\r\n activeTouch = true;\r\n data.touches[i].pageX = oe.pageX;\r\n data.touches[i].pageY = oe.pageY;\r\n }\r\n }\r\n if (!activeTouch) {\r\n data.touches.push({\r\n id: oe.pointerId,\r\n pageX: oe.pageX,\r\n pageY: oe.pageY\r\n });\r\n }\r\n } else {\r\n // Alias normal touches\r\n data.touches = oe.touches;\r\n }\r\n\r\n // Delegate touch actions\r\n if (oe.type.match(/(down|start)$/i)) {\r\n onPointerStart(e);\r\n } else if (oe.type.match(/move$/i)) {\r\n onPointerMove(e);\r\n }\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name onPointerStart\r\n * @description Handles pointer start.\r\n * @param e [object] \"Event data\"\r\n */\r\n\r\n function onPointerStart(e) {\r\n var data = e.data,\r\n touch = ($.type(data.touches) !== \"undefined\" && data.touches.length) ? data.touches[0] : null;\r\n\r\n if (touch) {\r\n data.$el.off(Events.mouseDown);\r\n }\r\n\r\n if (!data.touching) {\r\n data.startE = e.originalEvent;\r\n data.startX = (touch) ? touch.pageX : e.pageX;\r\n data.startY = (touch) ? touch.pageY : e.pageY;\r\n data.startT = new Date().getTime();\r\n data.scaleD = 1;\r\n data.passedAxis = false;\r\n }\r\n\r\n // Clear old click events\r\n\r\n if (data.$links) {\r\n data.$links.off(Events.click);\r\n }\r\n\r\n // Pan / Scale\r\n\r\n var newE = buildEvent(data.scale ? Events.scaleStart : Events.panStart, e, data.startX, data.startY, data.scaleD, 0, 0, \"\", \"\");\r\n\r\n if (data.scale && data.touches && data.touches.length >= 2) {\r\n var t = data.touches;\r\n\r\n data.pinch = {\r\n startX: midpoint(t[0].pageX, t[1].pageX),\r\n startY: midpoint(t[0].pageY, t[1].pageY),\r\n startD: pythagorus((t[1].pageX - t[0].pageX), (t[1].pageY - t[0].pageY))\r\n };\r\n\r\n newE.pageX = data.startX = data.pinch.startX;\r\n newE.pageY = data.startY = data.pinch.startY;\r\n }\r\n\r\n // Only bind at first touch\r\n if (!data.touching) {\r\n data.touching = true;\r\n\r\n if (data.pan && !touch) {\r\n $Window.on(Events.mouseMove, data, onPointerMove)\r\n .on(Events.mouseUp, data, onPointerEnd);\r\n }\r\n\r\n if (Formstone.support.pointer) {\r\n $Window.on([\r\n Events.pointerMove,\r\n Events.pointerUp,\r\n Events.pointerCancel\r\n ].join(\" \"), data, onTouch);\r\n } else {\r\n $Window.on([\r\n Events.touchMove,\r\n Events.touchEnd,\r\n Events.touchCancel\r\n ].join(\" \"), data, onTouch);\r\n }\r\n\r\n data.$el.trigger(newE);\r\n }\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name onPointerMove\r\n * @description Handles pointer move.\r\n * @param e [object] \"Event data\"\r\n */\r\n\r\n function onPointerMove(e) {\r\n var data = e.data,\r\n touch = ($.type(data.touches) !== \"undefined\" && data.touches.length) ? data.touches[0] : null,\r\n newX = (touch) ? touch.pageX : e.pageX,\r\n newY = (touch) ? touch.pageY : e.pageY,\r\n deltaX = newX - data.startX,\r\n deltaY = newY - data.startY,\r\n dirX = (deltaX > 0) ? \"right\" : \"left\",\r\n dirY = (deltaY > 0) ? \"down\" : \"up\",\r\n movedX = Math.abs(deltaX) > data.threshold,\r\n movedY = Math.abs(deltaY) > data.threshold;\n\r\n if (!data.passedAxis && data.axis && ((data.axisX && movedY) || (data.axisY && movedX))) {\r\n // if axis and moved in opposite direction\r\n onPointerEnd(e);\r\n } else {\r\n if (!data.passedAxis && (!data.axis || (data.axis && (data.axisX && movedX) || (data.axisY && movedY)))) {\r\n // if has axis and moved in same direction\r\n data.passedAxis = true;\r\n }\r\n\r\n if (data.passedAxis) {\r\n Functions.killEvent(e);\r\n Functions.killEvent(data.startE);\r\n }\r\n\r\n // Pan / Scale\r\n\r\n var fire = true,\r\n newE = buildEvent(data.scale ? Events.scale : Events.pan, e, newX, newY, data.scaleD, deltaX, deltaY, dirX, dirY);\r\n\r\n if (data.scale) {\r\n if (data.touches && data.touches.length >= 2) {\r\n var t = data.touches;\r\n\r\n data.pinch.endX = midpoint(t[0].pageX, t[1].pageX);\r\n data.pinch.endY = midpoint(t[0].pageY, t[1].pageY);\r\n data.pinch.endD = pythagorus((t[1].pageX - t[0].pageX), (t[1].pageY - t[0].pageY));\r\n data.scaleD = (data.pinch.endD / data.pinch.startD);\r\n newE.pageX = data.pinch.endX;\r\n newE.pageY = data.pinch.endY;\r\n newE.scale = data.scaleD;\r\n newE.deltaX = data.pinch.endX - data.pinch.startX;\r\n newE.deltaY = data.pinch.endY - data.pinch.startY;\r\n } else if (!data.pan) {\r\n fire = false;\r\n }\r\n }\r\n\r\n if (fire) {\r\n data.$el.trigger(newE);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name onPointerEnd\r\n * @description Handles pointer end / cancel.\r\n * @param e [object] \"Event data\"\r\n */\r\n\r\n function onPointerEnd(e) {\r\n var data = e.data;\r\n\r\n // Pan / Swipe / Scale\r\n\r\n var touch = ($.type(data.touches) !== \"undefined\" && data.touches.length) ? data.touches[0] : null,\r\n newX = (touch) ? touch.pageX : e.pageX,\r\n newY = (touch) ? touch.pageY : e.pageY,\r\n deltaX = newX - data.startX,\r\n deltaY = newY - data.startY,\r\n endT = new Date().getTime(),\r\n eType = data.scale ? Events.scaleEnd : Events.panEnd,\r\n dirX = (deltaX > 0) ? \"right\" : \"left\",\r\n dirY = (deltaY > 0) ? \"down\" : \"up\",\r\n movedX = Math.abs(deltaX) > 1,\r\n movedY = Math.abs(deltaY) > 1;\r\n\r\n // Swipe\r\n if ( data.swipe && (endT - data.startT) < data.time && Math.abs(deltaX) > data.threshold) {\r\n eType = Events.swipe;\r\n }\r\n\r\n // Kill clicks to internal links\r\n\r\n if ((data.axis && ((data.axisX && movedY) || (data.axisY && movedX))) || (movedX || movedY)) {\r\n data.$links = data.$el.find(\"a\");\r\n\r\n for (var i = 0, count = data.$links.length; i < count; i++) {\r\n bindLink(data.$links.eq(i), data);\r\n }\r\n }\r\n\r\n var newE = buildEvent(eType, e, newX, newY, data.scaleD, deltaX, deltaY, dirX, dirY);\r\n\r\n $Window.off([\r\n Events.touchMove,\r\n Events.touchEnd,\r\n Events.touchCancel,\r\n Events.mouseMove,\r\n Events.mouseUp,\r\n Events.pointerMove,\r\n Events.pointerUp,\r\n Events.pointerCancel\r\n ].join(\" \"));\r\n\r\n data.$el.trigger(newE);\r\n\r\n data.touches = [];\r\n\r\n if (data.scale) {\r\n /*\r\n if (e.originalEvent.pointerId) {\r\n for (var i in data.touches) {\r\n if (data.touches[i].id === e.originalEvent.pointerId) {\r\n data.touches.splice(i, 1);\r\n }\r\n }\r\n } else {\r\n data.touches = e.originalEvent.touches;\r\n }\r\n */\r\n\r\n /*\r\n if (data.touches.length) {\r\n onPointerStart($.extend(e, {\r\n data: data,\r\n originalEvent: {\r\n touches: data.touches\r\n }\r\n }));\r\n }\r\n */\r\n }\r\n\r\n if (touch) {\r\n data.touchTimer = Functions.startTimer(data.touchTimer, 5, function() {\r\n data.$el.on(Events.mouseDown, data, onPointerStart);\r\n });\r\n }\r\n\r\n data.touching = false;\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name bindLink\r\n * @description Bind events to internal links\r\n * @param $link [object] \"Object to bind\"\r\n * @param data [object] \"Instance data\"\r\n */\r\n\r\n function bindLink($link, data) {\r\n $link.on(Events.click, data, onLinkClick);\r\n\r\n // http://www.elijahmanor.com/how-to-access-jquerys-internal-data/\r\n var events = $._data($link[0], \"events\")[\"click\"];\r\n events.unshift(events.pop());\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name onLinkClick\r\n * @description Handles clicks to internal links\r\n * @param e [object] \"Event data\"\r\n */\r\n\r\n function onLinkClick(e) {\r\n Functions.killEvent(e, true);\r\n e.data.$links.off(Events.click);\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name buildEvents\r\n * @description Builds new event.\r\n * @param type [type] \"Event type\"\r\n * @param oe [object] \"Original event\"\r\n * @param x [int] \"X value\"\r\n * @param y [int] \"Y value\"\r\n * @param scale [float] \"Scale value\"\r\n * @param dx [float] \"Delta X value\"\r\n * @param dy [float] \"Delta Y value\"\r\n */\r\n\r\n function buildEvent(type, oe, px, py, s, dx, dy, dirx, diry) {\r\n return $.Event(type, {\r\n originalEvent: oe,\r\n bubbles: true,\r\n pageX: px,\r\n pageY: py,\r\n scale: s,\r\n deltaX: dx,\r\n deltaY: dy,\r\n directionX: dirx,\r\n directionY: diry\r\n });\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name midpoint\r\n * @description Calculates midpoint.\r\n * @param a [float] \"Value 1\"\r\n * @param b [float] \"Value 2\"\r\n */\r\n\r\n function midpoint(a, b) {\r\n return (a + b) / 2.0;\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name pythagorus\r\n * @description Pythagorean theorem.\r\n * @param a [float] \"Value 1\"\r\n * @param b [float] \"Value 2\"\r\n */\r\n\r\n function pythagorus(a, b) {\r\n return Math.sqrt((a * a) + (b * b));\r\n }\r\n\r\n /**\r\n * @method private\r\n * @name touchAction\r\n * @description Set ms touch action on target.\r\n * @param action [string] \"Touch action value\"\r\n */\r\n\r\n function touchAction($target, action) {\r\n $target.css({\r\n \"-ms-touch-action\": action,\r\n \"touch-action\": action\r\n });\r\n }\r\n\r\n /**\r\n * @plugin\r\n * @name Touch\r\n * @description A jQuery plugin for multi-touch events.\r\n * @type widget\r\n * @main touch.js\r\n * @dependency jQuery\r\n * @dependency core.js\r\n */\r\n\r\n var legacyPointer = !(Formstone.window.PointerEvent),\r\n Plugin = Formstone.Plugin(\"touch\", {\r\n widget: true,\r\n\r\n /**\r\n * @options\r\n * @param axis [string] \"Limit axis for pan and swipe; 'x' or 'y'\"\r\n * @param pan [boolean] \"Pan events\"\r\n * @param scale [boolean] \"Scale events\"\r\n * @param swipe [boolean] \"Swipe events\"\n * @param threshold [int] <10> \"Touch threshold for single axis\"\n * @param time [int] <50> \"Touch time limit for single axis\"\r\n */\r\n\r\n defaults: {\r\n axis: false,\r\n pan: false,\r\n scale: false,\r\n swipe: false,\n threshold: 10,\n time: 50\r\n },\r\n\r\n methods: {\r\n _construct: construct,\r\n _destruct: destruct\r\n },\r\n\r\n events: {\r\n pointerDown: legacyPointer ? \"MSPointerDown\" : \"pointerdown\",\r\n pointerUp: legacyPointer ? \"MSPointerUp\" : \"pointerup\",\r\n pointerMove: legacyPointer ? \"MSPointerMove\" : \"pointermove\",\r\n pointerCancel: legacyPointer ? \"MSPointerCancel\" : \"pointercancel\"\r\n }\r\n }),\r\n\r\n // Localize References\r\n\r\n Events = Plugin.events,\r\n Functions = Plugin.functions,\r\n\r\n // Local\r\n\r\n $Window = Formstone.$window;\r\n\r\n /**\r\n * @events\r\n * @event panstart \"Panning started\"\r\n * @event pan \"Panning\"\r\n * @event panend \"Panning ended\"\r\n * @event scalestart \"Scaling started\"\r\n * @event scale \"Scaling\"\r\n * @event scaleend \"Scaling ended\"\r\n * @event swipe \"Swipe\"\r\n */\r\n\r\n Events.pan = \"pan\";\r\n Events.panStart = \"panstart\";\r\n Events.panEnd = \"panend\";\r\n Events.scale = \"scale\";\r\n Events.scaleStart = \"scalestart\";\r\n Events.scaleEnd = \"scaleend\";\r\n Events.swipe = \"swipe\";\r\n\r\n })\r\n\r\n);\r\n"],"names":["factory","define","amd","jQuery","Formstone","$","construct","data","touches","touching","this","on","Events","dragStart","Functions","killEvent","swipe","pan","scale","axis","axisX","axisY","support","pointer","action","touchAction","pointerDown","onTouch","touchStart","mouseDown","onPointerStart","destruct","off","namespace","e","preventManipulation","oe","originalEvent","type","match","onPointerEnd","pointerId","activeTouch","i","id","pageX","pageY","push","onPointerMove","touch","length","$el","startE","startX","startY","startT","Date","getTime","scaleD","passedAxis","$links","click","newE","buildEvent","scaleStart","panStart","t","pinch","midpoint","startD","pythagorus","$Window","mouseMove","mouseUp","pointerMove","pointerUp","pointerCancel","join","touchMove","touchEnd","touchCancel","trigger","newX","newY","deltaX","deltaY","dirX","dirY","movedX","Math","abs","threshold","movedY","fire","endX","endY","endD","endT","eType","scaleEnd","panEnd","time","find","count","bindLink","eq","touchTimer","startTimer","$link","onLinkClick","events","_data","unshift","pop","px","py","s","dx","dy","dirx","diry","Event","bubbles","directionX","directionY","a","b","sqrt","$target","css","-ms-touch-action","touch-action","legacyPointer","window","Plugin","widget","defaults","methods","_construct","_destruct","functions","$window"],"mappings":"CAEC,SAASA,GACgB,kBAAXC,SAAyBA,OAAOC,IACzCD,QACE,SACA,UACCD,GAEHA,EAAQG,OAAQC,YAElB,SAASC,EAAGD,GAEZ,YASA,SAASE,GAAUC,GAiBjB,GAhBAA,EAAKC,WACLD,EAAKE,UAAW,EAEhBC,KAAKC,GAAGC,EAAOC,UAAWC,EAAUC,WAEhCR,EAAKS,QACPT,EAAKU,KAAM,GAGTV,EAAKW,QACPX,EAAKY,MAAO,GAGdZ,EAAKa,MAAsB,MAAdb,EAAKY,KAClBZ,EAAKc,MAAsB,MAAdd,EAAKY,KAEdf,EAAUkB,QAAQC,QAAS,CAC7B,GAAIC,GAAS,IAERjB,EAAKY,MAASZ,EAAKa,OAASb,EAAKc,MACpCG,EAAS,QAELjB,EAAKa,QACPI,GAAU,UAERjB,EAAKc,QACPG,GAAU,WAIdC,EAAYf,KAAMc,GAElBd,KAAKC,GAAGC,EAAOc,YAAanB,EAAMoB,OAElCjB,MAAKC,GAAGC,EAAOgB,WAAYrB,EAAMoB,GAC9BhB,GAAGC,EAAOiB,UAAWtB,EAAMuB,GAWlC,QAASC,KACPrB,KAAKsB,IAAIpB,EAAOqB,WAEhBR,EAAYf,KAAM,IAUpB,QAASiB,GAAQO,GAEXA,EAAEC,qBACJD,EAAEC,qBAGJ,IAAI5B,GAAO2B,EAAE3B,KACX6B,EAAKF,EAAEG,aAET,IAAID,EAAGE,KAAKC,MAAM,qBAEhB,WADAC,GAAaN,EAIf,IAAIE,EAAGK,UAAW,CAEhB,GAAIC,IAA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