Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/custom_interaction_events.min.js.map |
{"version":3,"sources":["../src/custom_interaction_events.js"],"names":["define","$","keyCodes","events","activate","keyboardActivate","escape","down","up","home","end","next","previous","asterix","scrollLock","scrollTop","scrollBottom","ctrlPageUp","ctrlPageDown","enter","accessibleChange","triggeredEvents","shouldAddEvent","eventType","include","length","indexOf","isModifierPressed","e","shiftKey","metaKey","altKey","ctrlKey","triggerEvent","eventName","eventTypeKey","hasOwnProperty","type","timeStamp","target","trigger","originalEvent","addKeyboardEvent","element","event","keyCode","off","on","addActivateListener","space","addKeyboardActivateListener","addEscapeListener","addDownListener","arrowDown","addUpListener","arrowUp","addHomeListener","addEndListener","addNextListener","attr","arrowLeft","arrowRight","addPreviousListener","addAsterixListener","addScrollTopListener","addScrollBottomListener","innerHeight","scrollHeight","addScrollLockListener","height","delta","detail","wheelDelta","stopPropagation","preventDefault","returnValue","addCtrlPageUpListener","pageUp","addCtrlPageDownListener","pageDown","addEnterListener","addAccessibleChangeListener","onMac","navigator","userAgent","touchEnabled","window","msMaxTouchPoints","data","value","initValue","removeData","which","getHandlers","handlers","each","handler"],"mappings":"AA0BAA,OAAM,kCAAC,CAAC,QAAD,CAAW,gBAAX,CAAD,CAA+B,SAASC,CAAT,CAAYC,CAAZ,CAAsB,IAEnDC,CAAAA,CAAM,CAAG,CACTC,QAAQ,CAAE,cADD,CAETC,gBAAgB,CAAE,sBAFT,CAGTC,MAAM,CAAE,YAHC,CAITC,IAAI,CAAE,UAJG,CAKTC,EAAE,CAAE,QALK,CAMTC,IAAI,CAAE,UANG,CAOTC,GAAG,CAAE,SAPI,CAQTC,IAAI,CAAE,UARG,CASTC,QAAQ,CAAE,cATD,CAUTC,OAAO,CAAE,aAVA,CAWTC,UAAU,CAAE,gBAXH,CAYTC,SAAS,CAAE,eAZF,CAaTC,YAAY,CAAE,kBAbL,CAcTC,UAAU,CA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BnB,CAAlB,CAA2B,CACpCmB,CAAO,CAAG1C,CAAC,CAAC0C,CAAD,CAAX,CACAnB,CAAO,CAAGA,CAAO,EAAI,EAArB,CAEA,GAAI,CAACmB,CAAO,CAAClB,MAAT,EAAmB,CAACD,CAAO,CAACC,MAAhC,CAAwC,CACpC,MACH,CAEDxB,CAAC,CAAC8F,IAAF,CAAOF,CAAW,EAAlB,CAAsB,SAAStE,CAAT,CAAoByE,CAApB,CAA6B,CAC/C,GAAI1E,CAAc,CAACC,CAAD,CAAYC,CAAZ,CAAlB,CAAwC,CACpCwE,CAAO,CAACrD,CAAD,CACV,CACJ,CAJD,CAKH,CAEoD,CAEjDxC,MAAM,CAAEA,CAFyC,CAIxD,CA5eK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * This module provides a wrapper to encapsulate a lot of the common combinations of\n * user interaction we use in Moodle.\n *\n * @module core/custom_interaction_events\n * @class custom_interaction_events\n * @package core\n * @copyright 2016 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery', 'core/key_codes'], function($, keyCodes) {\n // The list of events provided by this module. Namespaced to avoid clashes.\n var events = {\n activate: 'cie:activate',\n keyboardActivate: 'cie:keyboardactivate',\n escape: 'cie:escape',\n down: 'cie:down',\n up: 'cie:up',\n home: 'cie:home',\n end: 'cie:end',\n next: 'cie:next',\n previous: 'cie:previous',\n asterix: 'cie:asterix',\n scrollLock: 'cie:scrollLock',\n scrollTop: 'cie:scrollTop',\n scrollBottom: 'cie:scrollBottom',\n ctrlPageUp: 'cie:ctrlPageUp',\n ctrlPageDown: 'cie:ctrlPageDown',\n enter: 'cie:enter',\n accessibleChange: 'cie:accessibleChange',\n };\n // Static cache of jQuery events that have been handled. This should\n // only be populated by JavaScript generated events (which will keep it\n // fairly small).\n var triggeredEvents = {};\n\n /**\n * Check if the caller has asked for the given event type to be\n * registered.\n *\n * @method shouldAddEvent\n * @private\n * @param {string} eventType name of the event (see events above)\n * @param {array} include the list of events to be added\n * @return {bool} true if the event should be added, false otherwise.\n */\n var shouldAddEvent = function(eventType, include) {\n include = include || [];\n\n if (include.length && include.indexOf(eventType) !== -1) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Check if any of the modifier keys have been pressed on the event.\n *\n * @method isModifierPressed\n * @private\n * @param {event} e jQuery event\n * @return {bool} true if shift, meta (command on Mac), alt or ctrl are pressed\n */\n var isModifierPressed = function(e) {\n return (e.shiftKey || e.metaKey || e.altKey || e.ctrlKey);\n };\n\n /**\n * Trigger the custom event for the given jQuery event.\n *\n * This function will only fire the custom event if one hasn't already been\n * fired for the jQuery event.\n *\n * This is to prevent multiple custom event handlers triggering multiple\n * custom events for a single jQuery event as it bubbles up the stack.\n *\n * @param {string} eventName The name of the custom event\n * @param {event} e The jQuery event\n * @return {void}\n */\n var triggerEvent = function(eventName, e) {\n var eventTypeKey = \"\";\n\n if (!e.hasOwnProperty('originalEvent')) {\n // This is a jQuery event generated from JavaScript not a browser event so\n // we need to build the cache key for the event.\n eventTypeKey = \"\" + eventName + e.type + e.timeStamp;\n\n if (!triggeredEvents.hasOwnProperty(eventTypeKey)) {\n // If we haven't seen this jQuery event before then fire a custom\n // event for it and remember the event for later.\n triggeredEvents[eventTypeKey] = true;\n $(e.target).trigger(eventName, [{originalEvent: e}]);\n }\n return;\n }\n\n eventTypeKey = \"triggeredCustom_\" + eventName;\n if (!e.originalEvent.hasOwnProperty(eventTypeKey)) {\n // If this is a jQuery event generated by the browser then set a\n // property on the original event to track that we've seen it before.\n // The property is set on the original event because it's the only part\n // of the jQuery event that is maintained through multiple event handlers.\n e.originalEvent[eventTypeKey] = true;\n $(e.target).trigger(eventName, [{originalEvent: e}]);\n return;\n }\n };\n\n /**\n * Register a keyboard event that ignores modifier keys.\n *\n * @method addKeyboardEvent\n * @private\n * @param {object} element A jQuery object of the element to bind events to\n * @param {string} event The custom interaction event name\n * @param {int} keyCode The key code.\n */\n var addKeyboardEvent = function(element, event, keyCode) {\n element.off('keydown.' + event).on('keydown.' + event, function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCode) {\n triggerEvent(event, e);\n }\n }\n });\n };\n\n /**\n * Trigger the activate event on the given element if it is clicked or the enter\n * or space key are pressed without a modifier key.\n *\n * @method addActivateListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addActivateListener = function(element) {\n element.off('click.cie.activate').on('click.cie.activate', function(e) {\n triggerEvent(events.activate, e);\n });\n element.off('keydown.cie.activate').on('keydown.cie.activate', function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCodes.enter || e.keyCode == keyCodes.space) {\n triggerEvent(events.activate, e);\n }\n }\n });\n };\n\n /**\n * Trigger the keyboard activate event on the given element if the enter\n * or space key are pressed without a modifier key.\n *\n * @method addKeyboardActivateListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addKeyboardActivateListener = function(element) {\n element.off('keydown.cie.keyboardactivate').on('keydown.cie.keyboardactivate', function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCodes.enter || e.keyCode == keyCodes.space) {\n triggerEvent(events.keyboardActivate, e);\n }\n }\n });\n };\n\n /**\n * Trigger the escape event on the given element if the escape key is pressed\n * without a modifier key.\n *\n * @method addEscapeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEscapeListener = function(element) {\n addKeyboardEvent(element, events.escape, keyCodes.escape);\n };\n\n /**\n * Trigger the down event on the given element if the down arrow key is pressed\n * without a modifier key.\n *\n * @method addDownListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addDownListener = function(element) {\n addKeyboardEvent(element, events.down, keyCodes.arrowDown);\n };\n\n /**\n * Trigger the up event on the given element if the up arrow key is pressed\n * without a modifier key.\n *\n * @method addUpListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addUpListener = function(element) {\n addKeyboardEvent(element, events.up, keyCodes.arrowUp);\n };\n\n /**\n * Trigger the home event on the given element if the home key is pressed\n * without a modifier key.\n *\n * @method addHomeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addHomeListener = function(element) {\n addKeyboardEvent(element, events.home, keyCodes.home);\n };\n\n /**\n * Trigger the end event on the given element if the end key is pressed\n * without a modifier key.\n *\n * @method addEndListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEndListener = function(element) {\n addKeyboardEvent(element, events.end, keyCodes.end);\n };\n\n /**\n * Trigger the next event on the given element if the right arrow key is pressed\n * without a modifier key in LTR mode or left arrow key in RTL mode.\n *\n * @method addNextListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addNextListener = function(element) {\n // Left and right are flipped in RTL mode.\n var keyCode = $('html').attr('dir') == \"rtl\" ? keyCodes.arrowLeft : keyCodes.arrowRight;\n\n addKeyboardEvent(element, events.next, keyCode);\n };\n\n /**\n * Trigger the previous event on the given element if the left arrow key is pressed\n * without a modifier key in LTR mode or right arrow key in RTL mode.\n *\n * @method addPreviousListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addPreviousListener = function(element) {\n // Left and right are flipped in RTL mode.\n var keyCode = $('html').attr('dir') == \"rtl\" ? keyCodes.arrowRight : keyCodes.arrowLeft;\n\n addKeyboardEvent(element, events.previous, keyCode);\n };\n\n /**\n * Trigger the asterix event on the given element if the asterix key is pressed\n * without a modifier key.\n *\n * @method addAsterixListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addAsterixListener = function(element) {\n addKeyboardEvent(element, events.asterix, keyCodes.asterix);\n };\n\n\n /**\n * Trigger the scrollTop event on the given element if the user scrolls to\n * the top of the given element.\n *\n * @method addScrollTopListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addScrollTopListener = function(element) {\n element.off('scroll.cie.scrollTop').on('scroll.cie.scrollTop', function(e) {\n var scrollTop = element.scrollTop();\n if (scrollTop === 0) {\n triggerEvent(events.scrollTop, e);\n }\n });\n };\n\n /**\n * Trigger the scrollBottom event on the given element if the user scrolls to\n * the bottom of the given element.\n *\n * @method addScrollBottomListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addScrollBottomListener = function(element) {\n element.off('scroll.cie.scrollBottom').on('scroll.cie.scrollBottom', function(e) {\n var scrollTop = element.scrollTop();\n var innerHeight = element.innerHeight();\n var scrollHeight = element[0].scrollHeight;\n\n if (scrollTop + innerHeight >= scrollHeight) {\n triggerEvent(events.scrollBottom, e);\n }\n });\n };\n\n /**\n * Trigger the scrollLock event on the given element if the user scrolls to\n * the bottom or top of the given element.\n *\n * @method addScrollLockListener\n * @private\n * @param {jQuery} element jQuery object to add event listeners to\n */\n var addScrollLockListener = function(element) {\n // Lock mousewheel scrolling within the element to stop the annoying window scroll.\n element.off('DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock')\n .on('DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock', function(e) {\n var scrollTop = element.scrollTop();\n var scrollHeight = element[0].scrollHeight;\n var height = element.height();\n var delta = (e.type == 'DOMMouseScroll' ?\n e.originalEvent.detail * -40 :\n e.originalEvent.wheelDelta);\n var up = delta > 0;\n\n if (!up && -delta > scrollHeight - height - scrollTop) {\n // Scrolling down past the bottom.\n element.scrollTop(scrollHeight);\n e.stopPropagation();\n e.preventDefault();\n e.returnValue = false;\n // Fire the scroll lock event.\n triggerEvent(events.scrollLock, e);\n\n return false;\n } else if (up && delta > scrollTop) {\n // Scrolling up past the top.\n element.scrollTop(0);\n e.stopPropagation();\n e.preventDefault();\n e.returnValue = false;\n // Fire the scroll lock event.\n triggerEvent(events.scrollLock, e);\n\n return false;\n }\n\n return true;\n });\n };\n\n /**\n * Trigger the ctrlPageUp event on the given element if the user presses the\n * control and page up key.\n *\n * @method addCtrlPageUpListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addCtrlPageUpListener = function(element) {\n element.off('keydown.cie.ctrlpageup').on('keydown.cie.ctrlpageup', function(e) {\n if (e.ctrlKey) {\n if (e.keyCode == keyCodes.pageUp) {\n triggerEvent(events.ctrlPageUp, e);\n }\n }\n });\n };\n\n /**\n * Trigger the ctrlPageDown event on the given element if the user presses the\n * control and page down key.\n *\n * @method addCtrlPageDownListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addCtrlPageDownListener = function(element) {\n element.off('keydown.cie.ctrlpagedown').on('keydown.cie.ctrlpagedown', function(e) {\n if (e.ctrlKey) {\n if (e.keyCode == keyCodes.pageDown) {\n triggerEvent(events.ctrlPageDown, e);\n }\n }\n });\n };\n\n /**\n * Trigger the enter event on the given element if the enter key is pressed\n * without a modifier key.\n *\n * @method addEnterListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEnterListener = function(element) {\n addKeyboardEvent(element, events.enter, keyCodes.enter);\n };\n\n /**\n * Trigger the AccessibleChange event on the given element if the value of the element is changed.\n *\n * @method addAccessibleChangeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addAccessibleChangeListener = function(element) {\n var onMac = navigator.userAgent.indexOf('Macintosh') !== -1;\n var touchEnabled = ('ontouchstart' in window) || (('msMaxTouchPoints' in navigator) && (navigator.msMaxTouchPoints > 0));\n if (onMac || touchEnabled) {\n element.on('change', function(e) {\n triggerEvent(events.accessibleChange, e);\n });\n } else {\n element.on('focus', function() {\n $(this).data('initValue', this.value);\n });\n element.on('blur', function(e) {\n var initValue = $(this).data('initValue');\n $(this).removeData('initValue');\n if (this.value !== initValue) {\n triggerEvent(events.accessibleChange, e);\n }\n });\n element.on('keydown', function(e) {\n if ((e.which === keyCodes.enter) && this.value !== $(this).data('initValue')) {\n triggerEvent(events.accessibleChange, e);\n } else if (e.which === keyCodes.escape) {\n this.value = $(this).data('initValue');\n }\n });\n element.on('click', function(e) {\n var initValue = $(this).data('initValue');\n // Some browsers trigger onclick before onblur, therefore it is possible that initValue is undefined.\n if (typeof initValue !== 'undefined' && initValue != this.value) {\n triggerEvent(events.accessibleChange, e);\n }\n });\n }\n };\n\n /**\n * Get the list of events and their handlers.\n *\n * @method getHandlers\n * @private\n * @return {object} object key of event names and value of handler functions\n */\n var getHandlers = function() {\n var handlers = {};\n\n handlers[events.activate] = addActivateListener;\n handlers[events.keyboardActivate] = addKeyboardActivateListener;\n handlers[events.escape] = addEscapeListener;\n handlers[events.down] = addDownListener;\n handlers[events.up] = addUpListener;\n handlers[events.home] = addHomeListener;\n handlers[events.end] = addEndListener;\n handlers[events.next] = addNextListener;\n handlers[events.previous] = addPreviousListener;\n handlers[events.asterix] = addAsterixListener;\n handlers[events.scrollLock] = addScrollLockListener;\n handlers[events.scrollTop] = addScrollTopListener;\n handlers[events.scrollBottom] = addScrollBottomListener;\n handlers[events.ctrlPageUp] = addCtrlPageUpListener;\n handlers[events.ctrlPageDown] = addCtrlPageDownListener;\n handlers[events.enter] = addEnterListener;\n handlers[events.accessibleChange] = addAccessibleChangeListener;\n\n return handlers;\n };\n\n /**\n * Add all of the listeners on the given element for the requested events.\n *\n * @method define\n * @public\n * @param {object} element the DOM element to register event listeners on\n * @param {array} include the array of events to be triggered\n */\n var define = function(element, include) {\n element = $(element);\n include = include || [];\n\n if (!element.length || !include.length) {\n return;\n }\n\n $.each(getHandlers(), function(eventType, handler) {\n if (shouldAddEvent(eventType, include)) {\n handler(element);\n }\n });\n };\n\n return /** @module core/custom_interaction_events */ {\n define: define,\n events: events,\n };\n});\n"],"file":"custom_interaction_events.min.js"}