{"version":3,"file":"dragdroptouch.min.js","sources":["https:\/\/moodle.sonsbeekmedia.nl\/caie_39\/mod\/teachingtools\/amd\/src\/dragdroptouch.js"],"sourcesContent":["var DragDropTouch;\n(function (DragDropTouch_1) {\n 'use strict';\n \/**\n * Object used to hold the data that is being dragged during drag and drop operations.\n *\n * It may hold one or more data items of different types. For more information about\n * drag and drop operations and data transfer objects, see\n * HTML Drag and Drop API<\/a>.\n *\n * This object is created automatically by the @see:DragDropTouch singleton and is\n * accessible through the @see:dataTransfer property of all drag events.\n *\/\n var DataTransfer = (function () {\n function DataTransfer() {\n this._dropEffect = 'move';\n this._effectAllowed = 'all';\n this._data = {};\n }\n Object.defineProperty(DataTransfer.prototype, \"dropEffect\", {\n \/**\n * Gets or sets the type of drag-and-drop operation currently selected.\n * The value must be 'none', 'copy', 'link', or 'move'.\n *\/\n get: function () {\n return this._dropEffect;\n },\n set: function (value) {\n this._dropEffect = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataTransfer.prototype, \"effectAllowed\", {\n \/**\n * Gets or sets the types of operations that are possible.\n * Must be one of 'none', 'copy', 'copyLink', 'copyMove', 'link',\n * 'linkMove', 'move', 'all' or 'uninitialized'.\n *\/\n get: function () {\n return this._effectAllowed;\n },\n set: function (value) {\n this._effectAllowed = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataTransfer.prototype, \"types\", {\n \/**\n * Gets an array of strings giving the formats that were set in the @see:dragstart event.\n *\/\n get: function () {\n return Object.keys(this._data);\n },\n enumerable: true,\n configurable: true\n });\n \/**\n * Removes the data associated with a given type.\n *\n * The type argument is optional. If the type is empty or not specified, the data\n * associated with all types is removed. If data for the specified type does not exist,\n * or the data transfer contains no data, this method will have no effect.\n *\n * @param type Type of data to remove.\n *\/\n DataTransfer.prototype.clearData = function (type) {\n if (type !== null) {\n delete this._data[type.toLowerCase()];\n }\n else {\n this._data = {};\n }\n };\n \/**\n * Retrieves the data for a given type, or an empty string if data for that type does\n * not exist or the data transfer contains no data.\n *\n * @param type Type of data to retrieve.\n *\/\n DataTransfer.prototype.getData = function (type) {\n return this._data[type.toLowerCase()] || '';\n };\n \/**\n * Set the data for a given type.\n *\n * For a list of recommended drag types, please see\n * https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Guide\/HTML\/Recommended_Drag_Types.\n *\n * @param type Type of data to add.\n * @param value Data to add.\n *\/\n DataTransfer.prototype.setData = function (type, value) {\n this._data[type.toLowerCase()] = value;\n };\n \/**\n * Set the image to be used for dragging if a custom one is desired.\n *\n * @param img An image element to use as the drag feedback image.\n * @param offsetX The horizontal offset within the image.\n * @param offsetY The vertical offset within the image.\n *\/\n DataTransfer.prototype.setDragImage = function (img, offsetX, offsetY) {\n var ddt = DragDropTouch._instance;\n ddt._imgCustom = img;\n ddt._imgOffset = { x: offsetX, y: offsetY };\n };\n return DataTransfer;\n }());\n DragDropTouch_1.DataTransfer = DataTransfer;\n \/**\n * Defines a class that adds support for touch-based HTML5 drag\/drop operations.\n *\n * The @see:DragDropTouch class listens to touch events and raises the\n * appropriate HTML5 drag\/drop events as if the events had been caused\n * by mouse actions.\n *\n * The purpose of this class is to enable using existing, standard HTML5\n * drag\/drop code on mobile devices running IOS or Android.\n *\n * To use, include the DragDropTouch.js file on the page. The class will\n * automatically start monitoring touch events and will raise the HTML5\n * drag drop events (dragstart, dragenter, dragleave, drop, dragend) which\n * should be handled by the application.\n *\n * For details and examples on HTML drag and drop, see\n * https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Guide\/HTML\/Drag_operations.\n *\/\n var DragDropTouch = (function () {\n \/**\n * Initializes the single instance of the @see:DragDropTouch class.\n *\/\n function DragDropTouch() {\n this._lastClick = 0;\n \/\/ enforce singleton pattern\n if (DragDropTouch._instance) {\n throw 'DragDropTouch instance already created.';\n }\n \/\/ detect passive event support\n \/\/ https:\/\/github.com\/Modernizr\/Modernizr\/issues\/1894\n var supportsPassive = false;\n document.addEventListener('test', function () { }, {\n get passive() {\n supportsPassive = true;\n return true;\n }\n });\n \/\/ listen to touch events\n if (navigator.maxTouchPoints) {\n var d = document, \n ts = this._touchstart.bind(this), \n tm = this._touchmove.bind(this), \n te = this._touchend.bind(this), \n opt = supportsPassive ? { passive: false, capture: false } : false;\n d.addEventListener('touchstart', ts, opt);\n d.addEventListener('touchmove', tm, opt);\n d.addEventListener('touchend', te);\n d.addEventListener('touchcancel', te);\n }\n }\n \/**\n * Gets a reference to the @see:DragDropTouch singleton.\n *\/\n DragDropTouch.getInstance = function () {\n return DragDropTouch._instance;\n };\n \/\/ ** event handlers\n DragDropTouch.prototype._touchstart = function (e) {\n var _this = this;\n if (this._shouldHandle(e)) {\n \/\/ raise double-click and prevent zooming\n if (Date.now() - this._lastClick < DragDropTouch._DBLCLICK) {\n if (this._dispatchEvent(e, 'dblclick', e.target)) {\n e.preventDefault();\n this._reset();\n return;\n }\n }\n \/\/ clear all variables\n this._reset();\n \/\/ get nearest draggable element\n var src = this._closestDraggable(e.target);\n if (src) {\n \/\/ give caller a chance to handle the hover\/move events\n if (!this._dispatchEvent(e, 'mousemove', e.target) &&\n !this._dispatchEvent(e, 'mousedown', e.target)) {\n \/\/ get ready to start dragging\n this._dragSource = src;\n this._ptDown = this._getPoint(e);\n this._lastTouch = e;\n e.preventDefault();\n \/\/ show context menu if the user hasn't started dragging after a while\n setTimeout(function () {\n if (_this._dragSource === src && _this._img === null) {\n if (_this._dispatchEvent(e, 'contextmenu', src)) {\n _this._reset();\n }\n }\n }, DragDropTouch._CTXMENU);\n if (DragDropTouch._ISPRESSHOLDMODE) {\n this._pressHoldInterval = setTimeout(function () {\n _this._isDragEnabled = true;\n _this._touchmove(e);\n }, DragDropTouch._PRESSHOLDAWAIT);\n }\n }\n }\n }\n };\n DragDropTouch.prototype._touchmove = function (e) {\n if (this._shouldCancelPressHoldMove(e)) {\n this._reset();\n return;\n }\n if (this._shouldHandleMove(e) || this._shouldHandlePressHoldMove(e)) {\n \/\/ see if target wants to handle move\n var target = this._getTarget(e);\n if (this._dispatchEvent(e, 'mousemove', target)) {\n this._lastTouch = e;\n e.preventDefault();\n return;\n }\n \/\/ start dragging\n if (this._dragSource && !this._img && this._shouldStartDragging(e)) {\n if (this._dispatchEvent(this._lastTouch, 'dragstart', this._dragSource)) {\n \/\/ target canceled the drag event\n this._dragSource = null;\n return;\n }\n this._createImage(e);\n this._dispatchEvent(e, 'dragenter', target);\n }\n \/\/ continue dragging\n if (this._img) {\n this._lastTouch = e;\n e.preventDefault(); \/\/ prevent scrolling\n this._dispatchEvent(e, 'drag', this._dragSource);\n if (target !== this._lastTarget) {\n this._dispatchEvent(this._lastTouch, 'dragleave', this._lastTarget);\n this._dispatchEvent(e, 'dragenter', target);\n this._lastTarget = target;\n }\n this._moveImage(e);\n this._isDropZone = this._dispatchEvent(e, 'dragover', target);\n }\n }\n };\n DragDropTouch.prototype._touchend = function (e) {\n if (this._shouldHandle(e)) {\n \/\/ see if target wants to handle up\n if (this._dispatchEvent(this._lastTouch, 'mouseup', e.target)) {\n e.preventDefault();\n return;\n }\n \/\/ user clicked the element but didn't drag, so clear the source and simulate a click\n if (!this._img) {\n this._dragSource = null;\n this._dispatchEvent(this._lastTouch, 'click', e.target);\n this._lastClick = Date.now();\n }\n \/\/ finish dragging\n this._destroyImage();\n if (this._dragSource) {\n if (e.type.indexOf('cancel') < 0 && this._isDropZone) {\n this._dispatchEvent(this._lastTouch, 'drop', this._lastTarget);\n }\n this._dispatchEvent(this._lastTouch, 'dragend', this._dragSource);\n this._reset();\n }\n }\n };\n \/\/ ** utilities\n \/\/ ignore events that have been handled or that involve more than one touch\n DragDropTouch.prototype._shouldHandle = function (e) {\n return e &&\n !e.defaultPrevented &&\n e.touches && e.touches.length < 2;\n };\n\n \/\/ use regular condition outside of press & hold mode\n DragDropTouch.prototype._shouldHandleMove = function (e) {\n return !DragDropTouch._ISPRESSHOLDMODE && this._shouldHandle(e);\n };\n\n \/\/ allow to handle moves that involve many touches for press & hold\n DragDropTouch.prototype._shouldHandlePressHoldMove = function (e) {\n return DragDropTouch._ISPRESSHOLDMODE &&\n this._isDragEnabled && e && e.touches && e.touches.length;\n };\n\n \/\/ reset data if user drags without pressing & holding\n DragDropTouch.prototype._shouldCancelPressHoldMove = function (e) {\n return DragDropTouch._ISPRESSHOLDMODE && !this._isDragEnabled &&\n this._getDelta(e) > DragDropTouch._PRESSHOLDMARGIN;\n };\n\n \/\/ start dragging when specified delta is detected\n DragDropTouch.prototype._shouldStartDragging = function (e) {\n var delta = this._getDelta(e);\n return delta > DragDropTouch._THRESHOLD ||\n (DragDropTouch._ISPRESSHOLDMODE && delta >= DragDropTouch._PRESSHOLDTHRESHOLD);\n }\n\n \/\/ clear all members\n DragDropTouch.prototype._reset = function () {\n this._destroyImage();\n this._dragSource = null;\n this._lastTouch = null;\n this._lastTarget = null;\n this._ptDown = null;\n this._isDragEnabled = false;\n this._isDropZone = false;\n this._dataTransfer = new DataTransfer();\n clearInterval(this._pressHoldInterval);\n };\n \/\/ get point for a touch event\n DragDropTouch.prototype._getPoint = function (e, page) {\n if (e && e.touches) {\n e = e.touches[0];\n }\n return { x: page ? e.pageX : e.clientX, y: page ? e.pageY : e.clientY };\n };\n \/\/ get distance between the current touch event and the first one\n DragDropTouch.prototype._getDelta = function (e) {\n if (DragDropTouch._ISPRESSHOLDMODE && !this._ptDown) { return 0; }\n var p = this._getPoint(e);\n return Math.abs(p.x - this._ptDown.x) + Math.abs(p.y - this._ptDown.y);\n };\n \/\/ get the element at a given touch event\n DragDropTouch.prototype._getTarget = function (e) {\n var pt = this._getPoint(e), el = document.elementFromPoint(pt.x, pt.y);\n while (el && getComputedStyle(el).pointerEvents == 'none') {\n el = el.parentElement;\n }\n return el;\n };\n \/\/ create drag image from source element\n DragDropTouch.prototype._createImage = function (e) {\n \/\/ just in case...\n if (this._img) {\n this._destroyImage();\n }\n \/\/ create drag image from custom element or drag source\n var src = this._imgCustom || this._dragSource;\n this._img = src.cloneNode(true);\n this._copyStyle(src, this._img);\n this._img.style.top = this._img.style.left = '-9999px';\n \/\/ if creating from drag source, apply offset and opacity\n if (!this._imgCustom) {\n var rc = src.getBoundingClientRect(), pt = this._getPoint(e);\n this._imgOffset = { x: pt.x - rc.left, y: pt.y - rc.top };\n this._img.style.opacity = DragDropTouch._OPACITY.toString();\n }\n \/\/ add image to document\n this._moveImage(e);\n document.body.appendChild(this._img);\n };\n \/\/ dispose of drag image element\n DragDropTouch.prototype._destroyImage = function () {\n if (this._img && this._img.parentElement) {\n this._img.parentElement.removeChild(this._img);\n }\n this._img = null;\n this._imgCustom = null;\n };\n \/\/ move the drag image element\n DragDropTouch.prototype._moveImage = function (e) {\n var _this = this;\n requestAnimationFrame(function () {\n if (_this._img) {\n var pt = _this._getPoint(e, true), s = _this._img.style;\n s.position = 'absolute';\n s.pointerEvents = 'none';\n s.zIndex = '999999';\n s.left = Math.round(pt.x - _this._imgOffset.x) + 'px';\n s.top = Math.round(pt.y - _this._imgOffset.y) + 'px';\n }\n });\n };\n \/\/ copy properties from an object to another\n DragDropTouch.prototype._copyProps = function (dst, src, props) {\n for (var i = 0; i < props.length; i++) {\n var p = props[i];\n dst[p] = src[p];\n }\n };\n DragDropTouch.prototype._copyStyle = function (src, dst) {\n \/\/ remove potentially troublesome attributes\n DragDropTouch._rmvAtts.forEach(function (att) {\n dst.removeAttribute(att);\n });\n \/\/ copy canvas content\n if (src instanceof HTMLCanvasElement) {\n var cSrc = src, cDst = dst;\n cDst.width = cSrc.width;\n cDst.height = cSrc.height;\n cDst.getContext('2d').drawImage(cSrc, 0, 0);\n }\n \/\/ copy style (without transitions)\n var cs = getComputedStyle(src);\n for (var i = 0; i < cs.length; i++) {\n var key = cs[i];\n if (key.indexOf('transition') < 0) {\n dst.style[key] = cs[key];\n }\n }\n dst.style.pointerEvents = 'none';\n \/\/ and repeat for all children\n for (var i = 0; i < src.children.length; i++) {\n this._copyStyle(src.children[i], dst.children[i]);\n }\n };\n \/\/ compute missing offset or layer property for an event\n DragDropTouch.prototype._setOffsetAndLayerProps = function (e, target) {\n var rect = undefined;\n if (e.offsetX === undefined) {\n rect = target.getBoundingClientRect();\n e.offsetX = e.clientX - rect.x;\n e.offsetY = e.clientY - rect.y;\n }\n if (e.layerX === undefined) {\n rect = rect || target.getBoundingClientRect();\n e.layerX = e.pageX - rect.left;\n e.layerY = e.pageY - rect.top;\n }\n }\n DragDropTouch.prototype._dispatchEvent = function (e, type, target) {\n if (e && target) {\n var evt = document.createEvent('Event'), t = e.touches ? e.touches[0] : e;\n evt.initEvent(type, true, true);\n evt.button = 0;\n evt.which = evt.buttons = 1;\n this._copyProps(evt, e, DragDropTouch._kbdProps);\n this._copyProps(evt, t, DragDropTouch._ptProps);\n this._setOffsetAndLayerProps(evt, target);\n evt.dataTransfer = this._dataTransfer;\n target.dispatchEvent(evt);\n return evt.defaultPrevented;\n }\n return false;\n };\n \/\/ gets an element's closest draggable ancestor\n DragDropTouch.prototype._closestDraggable = function (e) {\n for (; e; e = e.parentElement) {\n if (e.hasAttribute('draggable') && e.draggable) {\n return e;\n }\n }\n return null;\n };\n return DragDropTouch;\n }());\n \/*private*\/ DragDropTouch._instance = new DragDropTouch(); \/\/ singleton\n \/\/ constants\n DragDropTouch._THRESHOLD = 5; \/\/ pixels to move before drag starts\n DragDropTouch._OPACITY = 0.5; \/\/ drag image opacity\n DragDropTouch._DBLCLICK = 500; \/\/ max ms between clicks in a double click\n DragDropTouch._CTXMENU = 900; \/\/ ms to hold before raising 'contextmenu' event\n DragDropTouch._ISPRESSHOLDMODE = false; \/\/ decides of press & hold mode presence\n DragDropTouch._PRESSHOLDAWAIT = 400; \/\/ ms to wait before press & hold is detected\n DragDropTouch._PRESSHOLDMARGIN = 25; \/\/ pixels that finger might shiver while pressing\n DragDropTouch._PRESSHOLDTHRESHOLD = 0; \/\/ pixels to move before drag starts\n \/\/ copy styles\/attributes from drag source to drag image element\n DragDropTouch._rmvAtts = 'id,class,style,draggable'.split(',');\n \/\/ synthesize and dispatch an event\n \/\/ returns true if the event has been handled (e.preventDefault == true)\n DragDropTouch._kbdProps = 'altKey,ctrlKey,metaKey,shiftKey'.split(',');\n DragDropTouch._ptProps = 'pageX,pageY,clientX,clientY,screenX,screenY,offsetX,offsetY'.split(',');\n DragDropTouch_1.DragDropTouch = DragDropTouch;\n})(DragDropTouch || (DragDropTouch = {}));\n\nexport default {\n DragDropTouch: DragDropTouch,\n};"],"names":["DragDropTouch","DragDropTouch_1","DataTransfer","_dropEffect","_effectAllowed","_data","Object","defineProperty","prototype","get","this","set","value","enumerable","configurable","keys","clearData","type","toLowerCase","getData","setData","setDragImage","img","offsetX","offsetY","ddt","_instance","_imgCustom","_imgOffset","x","y","_lastClick","supportsPassive","document","addEventListener","passive","navigator","maxTouchPoints","d","ts","_touchstart","bind","tm","_touchmove","te","_touchend","opt","capture","getInstance","e","_this","_shouldHandle","Date","now","_DBLCLICK","_dispatchEvent","target","preventDefault","_reset","src","_closestDraggable","_dragSource","_ptDown","_getPoint","_lastTouch","setTimeout","_img","_CTXMENU","_ISPRESSHOLDMODE","_pressHoldInterval","_isDragEnabled","_PRESSHOLDAWAIT","_shouldCancelPressHoldMove","_shouldHandleMove","_shouldHandlePressHoldMove","_getTarget","_shouldStartDragging","_createImage","_lastTarget","_moveImage","_isDropZone","_destroyImage","indexOf","defaultPrevented","touches","length","_getDelta","_PRESSHOLDMARGIN","delta","_THRESHOLD","_PRESSHOLDTHRESHOLD","_dataTransfer","clearInterval","page","pageX","clientX","pageY","clientY","p","Math","abs","pt","el","elementFromPoint","getComputedStyle","pointerEvents","parentElement","cloneNode","_copyStyle","style","top","left","rc","getBoundingClientRect","opacity","_OPACITY","toString","body","appendChild","removeChild","requestAnimationFrame","s","position","zIndex","round","_copyProps","dst","props","i","_rmvAtts","forEach","att","removeAttribute","HTMLCanvasElement","cSrc","cDst","width","height","getContext","drawImage","cs","key","children","_setOffsetAndLayerProps","rect","undefined","layerX","layerY","evt","createEvent","t","initEvent","button","which","buttons","_kbdProps","_ptProps","dataTransfer","d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