1 line
21 KiB
Plaintext
1 line
21 KiB
Plaintext
{"version":3,"sources":["foundation.util.touch.min.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__foundation_core__","__WEBPACK_EXTERNAL_MODULE_jquery__","modules","installedModules","__webpack_require__","moduleId","i","l","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","./foundation.core","./js/entries/plugins/foundation.util.touch.js","__webpack_exports__","jquery__WEBPACK_IMPORTED_MODULE_0__","jquery__WEBPACK_IMPORTED_MODULE_0___default","_foundation_util_touch__WEBPACK_IMPORTED_MODULE_1__","_foundation_core__WEBPACK_IMPORTED_MODULE_2__","init","a","Foundation","Touch","./js/foundation.util.touch.js","_defineProperties","target","props","length","descriptor","configurable","writable","startPosX","startTime","elapsedTime","startEvent","isMoving","didMoved","onTouchEnd","e","this","removeEventListener","onTouchMove","tapEvent","Event","trigger","spotSwipe","preventDefault","dir","x","touches","pageX","dx","pageY","Date","getTime","Math","abs","moveThreshold","timeThreshold","apply","arguments","concat","onTouchStart","addEventListener","SpotSwipe","$","instance","Constructor","TypeError","_classCallCheck","version","enabled","document","documentElement","_init","protoProps","staticProps","event","special","swipe","setup","tap","each","on","noop","setupSpotSwipe","setupTouchHandler","fn","addTouch","el","handleTouch","simulatedEvent","first","changedTouches","type","touchstart","touchmove","touchend","MouseEvent","bubbles","cancelable","screenX","screenY","clientX","clientY","createEvent","initMouseEvent","dispatchEvent","28","jquery"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,qBAAsBA,QAAQ,WACtC,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,oBAAqB,UAAWJ,GACd,iBAAZC,QACdA,QAAQ,yBAA2BD,EAAQG,QAAQ,qBAAsBA,QAAQ,YAEjFJ,E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,WAAWJ,EAAM,CAC3CK,SAAW,EACXC,YAAc,EACdC,QAAWT,EAAMS,QACjBC,QAAWV,EAAMU,QACjBC,QAAWX,EAAMW,QACjBC,QAAWZ,EAAMY,WAGnBb,EAAiBnB,SAASiC,YAAY,eACvBC,eAAeZ,GAAM,GAAM,EAAMxH,OAAQ,EAAGsH,EAAMS,QAAST,EAAMU,QAASV,EAAMW,QAASX,EAAMY,SAAS,GAAO,GAAO,GAAO,EAAO,EAEjJ,MAGJZ,EAAMnE,OAAOkF,cAAchB,MAKjCrE,EAAMH,KAAO,SAAU8C,QACM,IAAhBA,EAAEpB,YACXvB,EAAM+D,eAAepB,GACrB3C,EAAMgE,kBAAkBrB,MAQtB2C,GAKA,SAAU1I,EAAQD,EAASU,GAEjCT,EAAOD,QAAUU,EAAoK,kDAK/KkI,OAKA,SAAU3I,EAAQD,GAExBC,EAAOD,QAAUO","file":"foundation.util.touch.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.core\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.util.touch\"] = factory(require(\"./foundation.core\"), require(\"jquery\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.touch\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 28);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./foundation.core\":\n/*!****************************************************************************************************************************************************************!*\\\n !*** external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"} ***!\n \\****************************************************************************************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;\n\n/***/ }),\n\n/***/ \"./js/entries/plugins/foundation.util.touch.js\":\n/*!*****************************************************!*\\\n !*** ./js/entries/plugins/foundation.util.touch.js ***!\n \\*****************************************************/\n/*! exports provided: Foundation, Touch */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.util.touch */ \"./js/foundation.util.touch.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Touch\", function() { return _foundation_util_touch__WEBPACK_IMPORTED_MODULE_1__[\"Touch\"]; });\n\n/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core */ \"./foundation.core\");\n/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Foundation\", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_2__[\"Foundation\"]; });\n\n\n\n_foundation_util_touch__WEBPACK_IMPORTED_MODULE_1__[\"Touch\"].init(jquery__WEBPACK_IMPORTED_MODULE_0___default.a);\nwindow.Foundation.Touch = _foundation_util_touch__WEBPACK_IMPORTED_MODULE_1__[\"Touch\"];\n\n\n\n/***/ }),\n\n/***/ \"./js/foundation.util.touch.js\":\n/*!*************************************!*\\\n !*** ./js/foundation.util.touch.js ***!\n \\*************************************/\n/*! exports provided: Touch */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Touch\", function() { return Touch; });\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n//**************************************************\n//**Work inspired by multiple jquery swipe plugins**\n//**Done by Yohai Ararat ***************************\n//**************************************************\n\nvar Touch = {};\nvar startPosX,\n startPosY,\n startTime,\n elapsedTime,\n startEvent,\n isMoving = false,\n didMoved = false;\n\nfunction onTouchEnd(e) {\n this.removeEventListener('touchmove', onTouchMove);\n this.removeEventListener('touchend', onTouchEnd); // If the touch did not move, consider it as a \"tap\"\n\n if (!didMoved) {\n var tapEvent = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('tap', startEvent || e);\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(tapEvent);\n }\n\n startEvent = null;\n isMoving = false;\n didMoved = false;\n}\n\nfunction onTouchMove(e) {\n if (jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.preventDefault) {\n e.preventDefault();\n }\n\n if (isMoving) {\n var x = e.touches[0].pageX;\n var y = e.touches[0].pageY;\n var dx = startPosX - x;\n var dy = startPosY - y;\n var dir;\n didMoved = true;\n elapsedTime = new Date().getTime() - startTime;\n\n if (Math.abs(dx) >= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.moveThreshold && elapsedTime <= jquery__WEBPACK_IMPORTED_MODULE_0___default.a.spotSwipe.timeThreshold) {\n dir = dx > 0 ? 'left' : 'right';\n } // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n // dir = dy > 0 ? 'down' : 'up';\n // }\n\n\n if (dir) {\n e.preventDefault();\n onTouchEnd.apply(this, arguments);\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event('swipe', e), dir).trigger(jquery__WEBPACK_IMPORTED_MODULE_0___default.a.Event(\"swipe\".concat(dir), e));\n }\n }\n}\n\nfunction onTouchStart(e) {\n if (e.touches.length == 1) {\n startPosX = e.touches[0].pageX;\n startPosY = e.touches[0].pageY;\n startEvent = e;\n isMoving = true;\n didMoved = false;\n startTime = new Date().getTime();\n this.addEventListener('touchmove', onTouchMove, false);\n this.addEventListener('touchend', onTouchEnd, false);\n }\n}\n\nfunction init() {\n this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);\n}\n\nfunction teardown() {\n this.removeEventListener('touchstart', onTouchStart);\n}\n\nvar SpotSwipe =\n/*#__PURE__*/\nfunction () {\n function SpotSwipe($) {\n _classCallCheck(this, SpotSwipe);\n\n this.version = '1.0.0';\n this.enabled = 'ontouchstart' in document.documentElement;\n this.preventDefault = false;\n this.moveThreshold = 75;\n this.timeThreshold = 200;\n this.$ = $;\n\n this._init();\n }\n\n _createClass(SpotSwipe, [{\n key: \"_init\",\n value: function _init() {\n var $ = this.$;\n $.event.special.swipe = {\n setup: init\n };\n $.event.special.tap = {\n setup: init\n };\n $.each(['left', 'up', 'down', 'right'], function () {\n $.event.special[\"swipe\".concat(this)] = {\n setup: function setup() {\n $(this).on('swipe', $.noop);\n }\n };\n });\n }\n }]);\n\n return SpotSwipe;\n}();\n/****************************************************\n * As far as I can tell, both setupSpotSwipe and *\n * setupTouchHandler should be idempotent, *\n * because they directly replace functions & *\n * values, and do not add event handlers directly. *\n ****************************************************/\n\n\nTouch.setupSpotSwipe = function ($) {\n $.spotSwipe = new SpotSwipe($);\n};\n/****************************************************\n * Method for adding pseudo drag events to elements *\n ***************************************************/\n\n\nTouch.setupTouchHandler = function ($) {\n $.fn.addTouch = function () {\n this.each(function (i, el) {\n $(el).bind('touchstart touchmove touchend touchcancel', function (event) {\n //we pass the original event object because the jQuery event\n //object is normalized to w3c specs and does not provide the TouchList\n handleTouch(event);\n });\n });\n\n var handleTouch = function handleTouch(event) {\n var touches = event.changedTouches,\n first = touches[0],\n eventTypes = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup'\n },\n type = eventTypes[event.type],\n simulatedEvent;\n\n if ('MouseEvent' in window && typeof window.MouseEvent === 'function') {\n simulatedEvent = new window.MouseEvent(type, {\n 'bubbles': true,\n 'cancelable': true,\n 'screenX': first.screenX,\n 'screenY': first.screenY,\n 'clientX': first.clientX,\n 'clientY': first.clientY\n });\n } else {\n simulatedEvent = document.createEvent('MouseEvent');\n simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0\n /*left*/\n , null);\n }\n\n first.target.dispatchEvent(simulatedEvent);\n };\n };\n};\n\nTouch.init = function ($) {\n if (typeof $.spotSwipe === 'undefined') {\n Touch.setupSpotSwipe($);\n Touch.setupTouchHandler($);\n }\n};\n\n\n\n/***/ }),\n\n/***/ 28:\n/*!***********************************************************!*\\\n !*** multi ./js/entries/plugins/foundation.util.touch.js ***!\n \\***********************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(/*! /Users/ncoden/Documents/Documents/Projects/Programmation/Web/2016/Foundation/foundation-sites/js/entries/plugins/foundation.util.touch.js */\"./js/entries/plugins/foundation.util.touch.js\");\n\n\n/***/ }),\n\n/***/ \"jquery\":\n/*!********************************************************************************************!*\\\n !*** external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"} ***!\n \\********************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;\n\n/***/ })\n\n/******/ });\n});\n//# sourceMappingURL=foundation.util.touch.js.map"]} |