From bc5f82f624fed139bd757298996189eca19ed1b7 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 22 Feb 2016 11:19:02 -0500 Subject: Updated perfect-scrollbar to 0.6.10 --- web/static/js/perfect-scrollbar-0.6.10.jquery.js | 1572 +++++++++++++++++++ .../js/perfect-scrollbar-0.6.10.jquery.min.js | 2 + web/static/js/perfect-scrollbar-0.6.7.jquery.js | 1613 -------------------- .../js/perfect-scrollbar-0.6.7.jquery.min.js | 2 - 4 files changed, 1574 insertions(+), 1615 deletions(-) create mode 100644 web/static/js/perfect-scrollbar-0.6.10.jquery.js create mode 100644 web/static/js/perfect-scrollbar-0.6.10.jquery.min.js delete mode 100644 web/static/js/perfect-scrollbar-0.6.7.jquery.js delete mode 100644 web/static/js/perfect-scrollbar-0.6.7.jquery.min.js (limited to 'web/static/js') diff --git a/web/static/js/perfect-scrollbar-0.6.10.jquery.js b/web/static/js/perfect-scrollbar-0.6.10.jquery.js new file mode 100644 index 000000000..fbfd4796e --- /dev/null +++ b/web/static/js/perfect-scrollbar-0.6.10.jquery.js @@ -0,0 +1,1572 @@ +/* perfect-scrollbar v0.6.10 */ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0) { + classes.splice(idx, 1); + } + element.className = classes.join(' '); +} + +exports.add = function (element, className) { + if (element.classList) { + element.classList.add(className); + } else { + oldAdd(element, className); + } +}; + +exports.remove = function (element, className) { + if (element.classList) { + element.classList.remove(className); + } else { + oldRemove(element, className); + } +}; + +exports.list = function (element) { + if (element.classList) { + return Array.prototype.slice.apply(element.classList); + } else { + return element.className.split(' '); + } +}; + +},{}],3:[function(require,module,exports){ +'use strict'; + +var DOM = {}; + +DOM.e = function (tagName, className) { + var element = document.createElement(tagName); + element.className = className; + return element; +}; + +DOM.appendTo = function (child, parent) { + parent.appendChild(child); + return child; +}; + +function cssGet(element, styleName) { + return window.getComputedStyle(element)[styleName]; +} + +function cssSet(element, styleName, styleValue) { + if (typeof styleValue === 'number') { + styleValue = styleValue.toString() + 'px'; + } + element.style[styleName] = styleValue; + return element; +} + +function cssMultiSet(element, obj) { + for (var key in obj) { + var val = obj[key]; + if (typeof val === 'number') { + val = val.toString() + 'px'; + } + element.style[key] = val; + } + return element; +} + +DOM.css = function (element, styleNameOrObject, styleValue) { + if (typeof styleNameOrObject === 'object') { + // multiple set with object + return cssMultiSet(element, styleNameOrObject); + } else { + if (typeof styleValue === 'undefined') { + return cssGet(element, styleNameOrObject); + } else { + return cssSet(element, styleNameOrObject, styleValue); + } + } +}; + +DOM.matches = function (element, query) { + if (typeof element.matches !== 'undefined') { + return element.matches(query); + } else { + if (typeof element.matchesSelector !== 'undefined') { + return element.matchesSelector(query); + } else if (typeof element.webkitMatchesSelector !== 'undefined') { + return element.webkitMatchesSelector(query); + } else if (typeof element.mozMatchesSelector !== 'undefined') { + return element.mozMatchesSelector(query); + } else if (typeof element.msMatchesSelector !== 'undefined') { + return element.msMatchesSelector(query); + } + } +}; + +DOM.remove = function (element) { + if (typeof element.remove !== 'undefined') { + element.remove(); + } else { + if (element.parentNode) { + element.parentNode.removeChild(element); + } + } +}; + +DOM.queryChildren = function (element, selector) { + return Array.prototype.filter.call(element.childNodes, function (child) { + return DOM.matches(child, selector); + }); +}; + +module.exports = DOM; + +},{}],4:[function(require,module,exports){ +'use strict'; + +var EventElement = function (element) { + this.element = element; + this.events = {}; +}; + +EventElement.prototype.bind = function (eventName, handler) { + if (typeof this.events[eventName] === 'undefined') { + this.events[eventName] = []; + } + this.events[eventName].push(handler); + this.element.addEventListener(eventName, handler, false); +}; + +EventElement.prototype.unbind = function (eventName, handler) { + var isHandlerProvided = (typeof handler !== 'undefined'); + this.events[eventName] = this.events[eventName].filter(function (hdlr) { + if (isHandlerProvided && hdlr !== handler) { + return true; + } + this.element.removeEventListener(eventName, hdlr, false); + return false; + }, this); +}; + +EventElement.prototype.unbindAll = function () { + for (var name in this.events) { + this.unbind(name); + } +}; + +var EventManager = function () { + this.eventElements = []; +}; + +EventManager.prototype.eventElement = function (element) { + var ee = this.eventElements.filter(function (eventElement) { + return eventElement.element === element; + })[0]; + if (typeof ee === 'undefined') { + ee = new EventElement(element); + this.eventElements.push(ee); + } + return ee; +}; + +EventManager.prototype.bind = function (element, eventName, handler) { + this.eventElement(element).bind(eventName, handler); +}; + +EventManager.prototype.unbind = function (element, eventName, handler) { + this.eventElement(element).unbind(eventName, handler); +}; + +EventManager.prototype.unbindAll = function () { + for (var i = 0; i < this.eventElements.length; i++) { + this.eventElements[i].unbindAll(); + } +}; + +EventManager.prototype.once = function (element, eventName, handler) { + var ee = this.eventElement(element); + var onceHandler = function (e) { + ee.unbind(eventName, onceHandler); + handler(e); + }; + ee.bind(eventName, onceHandler); +}; + +module.exports = EventManager; + +},{}],5:[function(require,module,exports){ +'use strict'; + +module.exports = (function () { + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + return function () { + return s4() + s4() + '-' + s4() + '-' + s4() + '-' + + s4() + '-' + s4() + s4() + s4(); + }; +})(); + +},{}],6:[function(require,module,exports){ +'use strict'; + +var cls = require('./class') + , d = require('./dom'); + +exports.toInt = function (x) { + return parseInt(x, 10) || 0; +}; + +exports.clone = function (obj) { + if (obj === null) { + return null; + } else if (typeof obj === 'object') { + var result = {}; + for (var key in obj) { + result[key] = this.clone(obj[key]); + } + return result; + } else { + return obj; + } +}; + +exports.extend = function (original, source) { + var result = this.clone(original); + for (var key in source) { + result[key] = this.clone(source[key]); + } + return result; +}; + +exports.isEditable = function (el) { + return d.matches(el, "input,[contenteditable]") || + d.matches(el, "select,[contenteditable]") || + d.matches(el, "textarea,[contenteditable]") || + d.matches(el, "button,[contenteditable]"); +}; + +exports.removePsClasses = function (element) { + var clsList = cls.list(element); + for (var i = 0; i < clsList.length; i++) { + var className = clsList[i]; + if (className.indexOf('ps-') === 0) { + cls.remove(element, className); + } + } +}; + +exports.outerWidth = function (element) { + return this.toInt(d.css(element, 'width')) + + this.toInt(d.css(element, 'paddingLeft')) + + this.toInt(d.css(element, 'paddingRight')) + + this.toInt(d.css(element, 'borderLeftWidth')) + + this.toInt(d.css(element, 'borderRightWidth')); +}; + +exports.startScrolling = function (element, axis) { + cls.add(element, 'ps-in-scrolling'); + if (typeof axis !== 'undefined') { + cls.add(element, 'ps-' + axis); + } else { + cls.add(element, 'ps-x'); + cls.add(element, 'ps-y'); + } +}; + +exports.stopScrolling = function (element, axis) { + cls.remove(element, 'ps-in-scrolling'); + if (typeof axis !== 'undefined') { + cls.remove(element, 'ps-' + axis); + } else { + cls.remove(element, 'ps-x'); + cls.remove(element, 'ps-y'); + } +}; + +exports.env = { + isWebKit: 'WebkitAppearance' in document.documentElement.style, + supportsTouch: (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch), + supportsIePointer: window.navigator.msMaxTouchPoints !== null +}; + +},{"./class":2,"./dom":3}],7:[function(require,module,exports){ +'use strict'; + +var destroy = require('./plugin/destroy') + , initialize = require('./plugin/initialize') + , update = require('./plugin/update'); + +module.exports = { + initialize: initialize, + update: update, + destroy: destroy +}; + +},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(require,module,exports){ +'use strict'; + +module.exports = { + maxScrollbarLength: null, + minScrollbarLength: null, + scrollXMarginOffset: 0, + scrollYMarginOffset: 0, + stopPropagationOnClick: true, + suppressScrollX: false, + suppressScrollY: false, + swipePropagation: true, + useBothWheelAxes: false, + useKeyboard: true, + useSelectionScroll: false, + wheelPropagation: false, + wheelSpeed: 1, + theme: 'default' +}; + +},{}],9:[function(require,module,exports){ +'use strict'; + +var d = require('../lib/dom') + , h = require('../lib/helper') + , instances = require('./instances'); + +module.exports = function (element) { + var i = instances.get(element); + + if (!i) { + return; + } + + i.event.unbindAll(); + d.remove(i.scrollbarX); + d.remove(i.scrollbarY); + d.remove(i.scrollbarXRail); + d.remove(i.scrollbarYRail); + h.removePsClasses(element); + + instances.remove(element); +}; + +},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){ +'use strict'; + +var h = require('../../lib/helper') + , instances = require('../instances') + , updateGeometry = require('../update-geometry') + , updateScroll = require('../update-scroll'); + +function bindClickRailHandler(element, i) { + function pageOffset(el) { + return el.getBoundingClientRect(); + } + + if (i.settings.stopPropagationOnClick) { + i.event.bind(i.scrollbarY, 'click', function (e) { + e.stopPropagation(); + }); + } + i.event.bind(i.scrollbarYRail, 'click', function (e) { + var halfOfScrollbarLength = h.toInt(i.scrollbarYHeight / 2); + var positionTop = i.railYRatio * (e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top - halfOfScrollbarLength); + var maxPositionTop = i.railYRatio * (i.railYHeight - i.scrollbarYHeight); + var positionRatio = positionTop / maxPositionTop; + + if (positionRatio < 0) { + positionRatio = 0; + } else if (positionRatio > 1) { + positionRatio = 1; + } + + updateScroll(element, 'top', (i.contentHeight - i.containerHeight) * positionRatio); + updateGeometry(element); + + e.stopPropagation(); + }); + + if (i.settings.stopPropagationOnClick) { + i.event.bind(i.scrollbarY, 'click', function (e) { + e.stopPropagation(); + }); + } + i.event.bind(i.scrollbarXRail, 'click', function (e) { + var halfOfScrollbarLength = h.toInt(i.scrollbarXWidth / 2); + var positionLeft = i.railXRatio * (e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left - halfOfScrollbarLength); + var maxPositionLeft = i.railXRatio * (i.railXWidth - i.scrollbarXWidth); + var positionRatio = positionLeft / maxPositionLeft; + + if (positionRatio < 0) { + positionRatio = 0; + } else if (positionRatio > 1) { + positionRatio = 1; + } + + updateScroll(element, 'left', ((i.contentWidth - i.containerWidth) * positionRatio) - i.negativeScrollAdjustment); + updateGeometry(element); + + e.stopPropagation(); + }); +} + +module.exports = function (element) { + var i = instances.get(element); + bindClickRailHandler(element, i); +}; + +},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){ +'use strict'; + +var d = require('../../lib/dom') + , h = require('../../lib/helper') + , instances = require('../instances') + , updateGeometry = require('../update-geometry') + , updateScroll = require('../update-scroll'); + +function bindMouseScrollXHandler(element, i) { + var currentLeft = null; + var currentPageX = null; + + function updateScrollLeft(deltaX) { + var newLeft = currentLeft + (deltaX * i.railXRatio); + var maxLeft = Math.max(0, i.scrollbarXRail.getBoundingClientRect().left) + (i.railXRatio * (i.railXWidth - i.scrollbarXWidth)); + + if (newLeft < 0) { + i.scrollbarXLeft = 0; + } else if (newLeft > maxLeft) { + i.scrollbarXLeft = maxLeft; + } else { + i.scrollbarXLeft = newLeft; + } + + var scrollLeft = h.toInt(i.scrollbarXLeft * (i.contentWidth - i.containerWidth) / (i.containerWidth - (i.railXRatio * i.scrollbarXWidth))) - i.negativeScrollAdjustment; + updateScroll(element, 'left', scrollLeft); + } + + var mouseMoveHandler = function (e) { + updateScrollLeft(e.pageX - currentPageX); + updateGeometry(element); + e.stopPropagation(); + e.preventDefault(); + }; + + var mouseUpHandler = function () { + h.stopScrolling(element, 'x'); + i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); + }; + + i.event.bind(i.scrollbarX, 'mousedown', function (e) { + currentPageX = e.pageX; + currentLeft = h.toInt(d.css(i.scrollbarX, 'left')) * i.railXRatio; + h.startScrolling(element, 'x'); + + i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); + i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); + + e.stopPropagation(); + e.preventDefault(); + }); +} + +function bindMouseScrollYHandler(element, i) { + var currentTop = null; + var currentPageY = null; + + function updateScrollTop(deltaY) { + var newTop = currentTop + (deltaY * i.railYRatio); + var maxTop = Math.max(0, i.scrollbarYRail.getBoundingClientRect().top) + (i.railYRatio * (i.railYHeight - i.scrollbarYHeight)); + + if (newTop < 0) { + i.scrollbarYTop = 0; + } else if (newTop > maxTop) { + i.scrollbarYTop = maxTop; + } else { + i.scrollbarYTop = newTop; + } + + var scrollTop = h.toInt(i.scrollbarYTop * (i.contentHeight - i.containerHeight) / (i.containerHeight - (i.railYRatio * i.scrollbarYHeight))); + updateScroll(element, 'top', scrollTop); + } + + var mouseMoveHandler = function (e) { + updateScrollTop(e.pageY - currentPageY); + updateGeometry(element); + e.stopPropagation(); + e.preventDefault(); + }; + + var mouseUpHandler = function () { + h.stopScrolling(element, 'y'); + i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); + }; + + i.event.bind(i.scrollbarY, 'mousedown', function (e) { + currentPageY = e.pageY; + currentTop = h.toInt(d.css(i.scrollbarY, 'top')) * i.railYRatio; + h.startScrolling(element, 'y'); + + i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); + i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); + + e.stopPropagation(); + e.preventDefault(); + }); +} + +module.exports = function (element) { + var i = instances.get(element); + bindMouseScrollXHandler(element, i); + bindMouseScrollYHandler(element, i); +}; + +},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){ +'use strict'; + +var h = require('../../lib/helper') + , d = require('../../lib/dom') + , instances = require('../instances') + , updateGeometry = require('../update-geometry') + , updateScroll = require('../update-scroll'); + +function bindKeyboardHandler(element, i) { + var hovered = false; + i.event.bind(element, 'mouseenter', function () { + hovered = true; + }); + i.event.bind(element, 'mouseleave', function () { + hovered = false; + }); + + var shouldPrevent = false; + function shouldPreventDefault(deltaX, deltaY) { + var scrollTop = element.scrollTop; + if (deltaX === 0) { + if (!i.scrollbarYActive) { + return false; + } + if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) { + return !i.settings.wheelPropagation; + } + } + + var scrollLeft = element.scrollLeft; + if (deltaY === 0) { + if (!i.scrollbarXActive) { + return false; + } + if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) { + return !i.settings.wheelPropagation; + } + } + return true; + } + + i.event.bind(i.ownerDocument, 'keydown', function (e) { + if (e.isDefaultPrevented && e.isDefaultPrevented()) { + return; + } + + var focused = d.matches(i.scrollbarX, ':focus') || + d.matches(i.scrollbarY, ':focus'); + + if (!hovered && !focused) { + return; + } + + var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement; + if (activeElement) { + // go deeper if element is a webcomponent + while (activeElement.shadowRoot) { + activeElement = activeElement.shadowRoot.activeElement; + } + if (h.isEditable(activeElement)) { + return; + } + } + + var deltaX = 0; + var deltaY = 0; + + switch (e.which) { + case 37: // left + deltaX = -30; + break; + case 38: // up + deltaY = 30; + break; + case 39: // right + deltaX = 30; + break; + case 40: // down + deltaY = -30; + break; + case 33: // page up + deltaY = 90; + break; + case 32: // space bar + if (e.shiftKey) { + deltaY = 90; + } else { + deltaY = -90; + } + break; + case 34: // page down + deltaY = -90; + break; + case 35: // end + if (e.ctrlKey) { + deltaY = -i.contentHeight; + } else { + deltaY = -i.containerHeight; + } + break; + case 36: // home + if (e.ctrlKey) { + deltaY = element.scrollTop; + } else { + deltaY = i.containerHeight; + } + break; + default: + return; + } + + updateScroll(element, 'top', element.scrollTop - deltaY); + updateScroll(element, 'left', element.scrollLeft + deltaX); + updateGeometry(element); + + shouldPrevent = shouldPreventDefault(deltaX, deltaY); + if (shouldPrevent) { + e.preventDefault(); + } + }); +} + +module.exports = function (element) { + var i = instances.get(element); + bindKeyboardHandler(element, i); +}; + +},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){ +'use strict'; + +var instances = require('../instances') + , updateGeometry = require('../update-geometry') + , updateScroll = require('../update-scroll'); + +function bindMouseWheelHandler(element, i) { + var shouldPrevent = false; + + function shouldPreventDefault(deltaX, deltaY) { + var scrollTop = element.scrollTop; + if (deltaX === 0) { + if (!i.scrollbarYActive) { + return false; + } + if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) { + return !i.settings.wheelPropagation; + } + } + + var scrollLeft = element.scrollLeft; + if (deltaY === 0) { + if (!i.scrollbarXActive) { + return false; + } + if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) { + return !i.settings.wheelPropagation; + } + } + return true; + } + + function getDeltaFromEvent(e) { + var deltaX = e.deltaX; + var deltaY = -1 * e.deltaY; + + if (typeof deltaX === "undefined" || typeof deltaY === "undefined") { + // OS X Safari + deltaX = -1 * e.wheelDeltaX / 6; + deltaY = e.wheelDeltaY / 6; + } + + if (e.deltaMode && e.deltaMode === 1) { + // Firefox in deltaMode 1: Line scrolling + deltaX *= 10; + deltaY *= 10; + } + + if (deltaX !== deltaX && deltaY !== deltaY/* NaN checks */) { + // IE in some mouse drivers + deltaX = 0; + deltaY = e.wheelDelta; + } + + return [deltaX, deltaY]; + } + + function shouldBeConsumedByTextarea(deltaX, deltaY) { + var hoveredTextarea = element.querySelector('textarea:hover'); + if (hoveredTextarea) { + var maxScrollTop = hoveredTextarea.scrollHeight - hoveredTextarea.clientHeight; + if (maxScrollTop > 0) { + if (!(hoveredTextarea.scrollTop === 0 && deltaY > 0) && + !(hoveredTextarea.scrollTop === maxScrollTop && deltaY < 0)) { + return true; + } + } + var maxScrollLeft = hoveredTextarea.scrollLeft - hoveredTextarea.clientWidth; + if (maxScrollLeft > 0) { + if (!(hoveredTextarea.scrollLeft === 0 && deltaX < 0) && + !(hoveredTextarea.scrollLeft === maxScrollLeft && deltaX > 0)) { + return true; + } + } + } + return false; + } + + function mousewheelHandler(e) { + var delta = getDeltaFromEvent(e); + + var deltaX = delta[0]; + var deltaY = delta[1]; + + if (shouldBeConsumedByTextarea(deltaX, deltaY)) { + return; + } + + shouldPrevent = false; + if (!i.settings.useBothWheelAxes) { + // deltaX will only be used for horizontal scrolling and deltaY will + // only be used for vertical scrolling - this is the default + updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed)); + updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed)); + } else if (i.scrollbarYActive && !i.scrollbarXActive) { + // only vertical scrollbar is active and useBothWheelAxes option is + // active, so let's scroll vertical bar using both mouse wheel axes + if (deltaY) { + updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed)); + } else { + updateScroll(element, 'top', element.scrollTop + (deltaX * i.settings.wheelSpeed)); + } + shouldPrevent = true; + } else if (i.scrollbarXActive && !i.scrollbarYActive) { + // useBothWheelAxes and only horizontal bar is active, so use both + // wheel axes for horizontal bar + if (deltaX) { + updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed)); + } else { + updateScroll(element, 'left', element.scrollLeft - (deltaY * i.settings.wheelSpeed)); + } + shouldPrevent = true; + } + + updateGeometry(element); + + shouldPrevent = (shouldPrevent || shouldPreventDefault(deltaX, deltaY)); + if (shouldPrevent) { + e.stopPropagation(); + e.preventDefault(); + } + } + + if (typeof window.onwheel !== "undefined") { + i.event.bind(element, 'wheel', mousewheelHandler); + } else if (typeof window.onmousewheel !== "undefined") { + i.event.bind(element, 'mousewheel', mousewheelHandler); + } +} + +module.exports = function (element) { + var i = instances.get(element); + bindMouseWheelHandler(element, i); +}; + +},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(require,module,exports){ +'use strict'; + +var instances = require('../instances') + , updateGeometry = require('../update-geometry'); + +function bindNativeScrollHandler(element, i) { + i.event.bind(element, 'scroll', function () { + updateGeometry(element); + }); +} + +module.exports = function (element) { + var i = instances.get(element); + bindNativeScrollHandler(element, i); +}; + +},{"../instances":18,"../update-geometry":19}],15:[function(require,module,exports){ +'use strict'; + +var h = require('../../lib/helper') + , instances = require('../instances') + , updateGeometry = require('../update-geometry') + , updateScroll = require('../update-scroll'); + +function bindSelectionHandler(element, i) { + function getRangeNode() { + var selection = window.getSelection ? window.getSelection() : + document.getSelection ? document.getSelection() : ''; + if (selection.toString().length === 0) { + return null; + } else { + return selection.getRangeAt(0).commonAncestorContainer; + } + } + + var scrollingLoop = null; + var scrollDiff = {top: 0, left: 0}; + function startScrolling() { + if (!scrollingLoop) { + scrollingLoop = setInterval(function () { + if (!instances.get(element)) { + clearInterval(scrollingLoop); + return; + } + + updateScroll(element, 'top', element.scrollTop + scrollDiff.top); + updateScroll(element, 'left', element.scrollLeft + scrollDiff.left); + updateGeometry(element); + }, 50); // every .1 sec + } + } + function stopScrolling() { + if (scrollingLoop) { + clearInterval(scrollingLoop); + scrollingLoop = null; + } + h.stopScrolling(element); + } + + var isSelected = false; + i.event.bind(i.ownerDocument, 'selectionchange', function () { + if (element.contains(getRangeNode())) { + isSelected = true; + } else { + isSelected = false; + stopScrolling(); + } + }); + i.event.bind(window, 'mouseup', function () { + if (isSelected) { + isSelected = false; + stopScrolling(); + } + }); + + i.event.bind(window, 'mousemove', function (e) { + if (isSelected) { + var mousePosition = {x: e.pageX, y: e.pageY}; + var containerGeometry = { + left: element.offsetLeft, + right: element.offsetLeft + element.offsetWidth, + top: element.offsetTop, + bottom: element.offsetTop + element.offsetHeight + }; + + if (mousePosition.x < containerGeometry.left + 3) { + scrollDiff.left = -5; + h.startScrolling(element, 'x'); + } else if (mousePosition.x > containerGeometry.right - 3) { + scrollDiff.left = 5; + h.startScrolling(element, 'x'); + } else { + scrollDiff.left = 0; + } + + if (mousePosition.y < containerGeometry.top + 3) { + if (containerGeometry.top + 3 - mousePosition.y < 5) { + scrollDiff.top = -5; + } else { + scrollDiff.top = -20; + } + h.startScrolling(element, 'y'); + } else if (mousePosition.y > containerGeometry.bottom - 3) { + if (mousePosition.y - containerGeometry.bottom + 3 < 5) { + scrollDiff.top = 5; + } else { + scrollDiff.top = 20; + } + h.startScrolling(element, 'y'); + } else { + scrollDiff.top = 0; + } + + if (scrollDiff.top === 0 && scrollDiff.left === 0) { + stopScrolling(); + } else { + startScrolling(); + } + } + }); +} + +module.exports = function (element) { + var i = instances.get(element); + bindSelectionHandler(element, i); +}; + +},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){ +'use strict'; + +var instances = require('../instances') + , updateGeometry = require('../update-geometry') + , updateScroll = require('../update-scroll'); + +function bindTouchHandler(element, i, supportsTouch, supportsIePointer) { + function shouldPreventDefault(deltaX, deltaY) { + var scrollTop = element.scrollTop; + var scrollLeft = element.scrollLeft; + var magnitudeX = Math.abs(deltaX); + var magnitudeY = Math.abs(deltaY); + + if (magnitudeY > magnitudeX) { + // user is perhaps trying to swipe up/down the page + + if (((deltaY < 0) && (scrollTop === i.contentHeight - i.containerHeight)) || + ((deltaY > 0) && (scrollTop === 0))) { + return !i.settings.swipePropagation; + } + } else if (magnitudeX > magnitudeY) { + // user is perhaps trying to swipe left/right across the page + + if (((deltaX < 0) && (scrollLeft === i.contentWidth - i.containerWidth)) || + ((deltaX > 0) && (scrollLeft === 0))) { + return !i.settings.swipePropagation; + } + } + + return true; + } + + function applyTouchMove(differenceX, differenceY) { + updateScroll(element, 'top', element.scrollTop - differenceY); + updateScroll(element, 'left', element.scrollLeft - differenceX); + + updateGeometry(element); + } + + var startOffset = {}; + var startTime = 0; + var speed = {}; + var easingLoop = null; + var inGlobalTouch = false; + var inLocalTouch = false; + + function globalTouchStart() { + inGlobalTouch = true; + } + function globalTouchEnd() { + inGlobalTouch = false; + } + + function getTouch(e) { + if (e.targetTouches) { + return e.targetTouches[0]; + } else { + // Maybe IE pointer + return e; + } + } + function shouldHandle(e) { + if (e.targetTouches && e.targetTouches.length === 1) { + return true; + } + if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) { + return true; + } + return false; + } + function touchStart(e) { + if (shouldHandle(e)) { + inLocalTouch = true; + + var touch = getTouch(e); + + startOffset.pageX = touch.pageX; + startOffset.pageY = touch.pageY; + + startTime = (new Date()).getTime(); + + if (easingLoop !== null) { + clearInterval(easingLoop); + } + + e.stopPropagation(); + } + } + function touchMove(e) { + if (!inGlobalTouch && inLocalTouch && shouldHandle(e)) { + var touch = getTouch(e); + + var currentOffset = {pageX: touch.pageX, pageY: touch.pageY}; + + var differenceX = currentOffset.pageX - startOffset.pageX; + var differenceY = currentOffset.pageY - startOffset.pageY; + + applyTouchMove(differenceX, differenceY); + startOffset = currentOffset; + + var currentTime = (new Date()).getTime(); + + var timeGap = currentTime - startTime; + if (timeGap > 0) { + speed.x = differenceX / timeGap; + speed.y = differenceY / timeGap; + startTime = currentTime; + } + + if (shouldPreventDefault(differenceX, differenceY)) { + e.stopPropagation(); + e.preventDefault(); + } + } + } + function touchEnd() { + if (!inGlobalTouch && inLocalTouch) { + inLocalTouch = false; + + clearInterval(easingLoop); + easingLoop = setInterval(function () { + if (!instances.get(element)) { + clearInterval(easingLoop); + return; + } + + if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { + clearInterval(easingLoop); + return; + } + + applyTouchMove(speed.x * 30, speed.y * 30); + + speed.x *= 0.8; + speed.y *= 0.8; + }, 10); + } + } + + if (supportsTouch) { + i.event.bind(window, 'touchstart', globalTouchStart); + i.event.bind(window, 'touchend', globalTouchEnd); + i.event.bind(element, 'touchstart', touchStart); + i.event.bind(element, 'touchmove', touchMove); + i.event.bind(element, 'touchend', touchEnd); + } + + if (supportsIePointer) { + if (window.PointerEvent) { + i.event.bind(window, 'pointerdown', globalTouchStart); + i.event.bind(window, 'pointerup', globalTouchEnd); + i.event.bind(element, 'pointerdown', touchStart); + i.event.bind(element, 'pointermove', touchMove); + i.event.bind(element, 'pointerup', touchEnd); + } else if (window.MSPointerEvent) { + i.event.bind(window, 'MSPointerDown', globalTouchStart); + i.event.bind(window, 'MSPointerUp', globalTouchEnd); + i.event.bind(element, 'MSPointerDown', touchStart); + i.event.bind(element, 'MSPointerMove', touchMove); + i.event.bind(element, 'MSPointerUp', touchEnd); + } + } +} + +module.exports = function (element, supportsTouch, supportsIePointer) { + var i = instances.get(element); + bindTouchHandler(element, i, supportsTouch, supportsIePointer); +}; + +},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(require,module,exports){ +'use strict'; + +var cls = require('../lib/class') + , h = require('../lib/helper') + , instances = require('./instances') + , updateGeometry = require('./update-geometry'); + +// Handlers +var clickRailHandler = require('./handler/click-rail') + , dragScrollbarHandler = require('./handler/drag-scrollbar') + , keyboardHandler = require('./handler/keyboard') + , mouseWheelHandler = require('./handler/mouse-wheel') + , nativeScrollHandler = require('./handler/native-scroll') + , selectionHandler = require('./handler/selection') + , touchHandler = require('./handler/touch'); + +module.exports = function (element, userSettings) { + userSettings = typeof userSettings === 'object' ? userSettings : {}; + + cls.add(element, 'ps-container'); + + // Create a plugin instance. + var i = instances.add(element); + + i.settings = h.extend(i.settings, userSettings); + cls.add(element, 'ps-theme-' + i.settings.theme); + + clickRailHandler(element); + dragScrollbarHandler(element); + mouseWheelHandler(element); + nativeScrollHandler(element); + + if (i.settings.useSelectionScroll) { + selectionHandler(element); + } + + if (h.env.supportsTouch || h.env.supportsIePointer) { + touchHandler(element, h.env.supportsTouch, h.env.supportsIePointer); + } + if (i.settings.useKeyboard) { + keyboardHandler(element); + } + + updateGeometry(element); +}; + +},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(require,module,exports){ +'use strict'; + +var cls = require('../lib/class') + , d = require('../lib/dom') + , defaultSettings = require('./default-setting') + , EventManager = require('../lib/event-manager') + , guid = require('../lib/guid') + , h = require('../lib/helper'); + +var instances = {}; + +function Instance(element) { + var i = this; + + i.settings = h.clone(defaultSettings); + i.containerWidth = null; + i.containerHeight = null; + i.contentWidth = null; + i.contentHeight = null; + + i.isRtl = d.css(element, 'direction') === "rtl"; + i.isNegativeScroll = (function () { + var originalScrollLeft = element.scrollLeft; + var result = null; + element.scrollLeft = -1; + result = element.scrollLeft < 0; + element.scrollLeft = originalScrollLeft; + return result; + })(); + i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0; + i.event = new EventManager(); + i.ownerDocument = element.ownerDocument || document; + + function focus() { + cls.add(element, 'ps-focus'); + } + + function blur() { + cls.remove(element, 'ps-focus'); + } + + i.scrollbarXRail = d.appendTo(d.e('div', 'ps-scrollbar-x-rail'), element); + i.scrollbarX = d.appendTo(d.e('div', 'ps-scrollbar-x'), i.scrollbarXRail); + i.scrollbarX.setAttribute('tabindex', 0); + i.event.bind(i.scrollbarX, 'focus', focus); + i.event.bind(i.scrollbarX, 'blur', blur); + i.scrollbarXActive = null; + i.scrollbarXWidth = null; + i.scrollbarXLeft = null; + i.scrollbarXBottom = h.toInt(d.css(i.scrollbarXRail, 'bottom')); + i.isScrollbarXUsingBottom = i.scrollbarXBottom === i.scrollbarXBottom; // !isNaN + i.scrollbarXTop = i.isScrollbarXUsingBottom ? null : h.toInt(d.css(i.scrollbarXRail, 'top')); + i.railBorderXWidth = h.toInt(d.css(i.scrollbarXRail, 'borderLeftWidth')) + h.toInt(d.css(i.scrollbarXRail, 'borderRightWidth')); + // Set rail to display:block to calculate margins + d.css(i.scrollbarXRail, 'display', 'block'); + i.railXMarginWidth = h.toInt(d.css(i.scrollbarXRail, 'marginLeft')) + h.toInt(d.css(i.scrollbarXRail, 'marginRight')); + d.css(i.scrollbarXRail, 'display', ''); + i.railXWidth = null; + i.railXRatio = null; + + i.scrollbarYRail = d.appendTo(d.e('div', 'ps-scrollbar-y-rail'), element); + i.scrollbarY = d.appendTo(d.e('div', 'ps-scrollbar-y'), i.scrollbarYRail); + i.scrollbarY.setAttribute('tabindex', 0); + i.event.bind(i.scrollbarY, 'focus', focus); + i.event.bind(i.scrollbarY, 'blur', blur); + i.scrollbarYActive = null; + i.scrollbarYHeight = null; + i.scrollbarYTop = null; + i.scrollbarYRight = h.toInt(d.css(i.scrollbarYRail, 'right')); + i.isScrollbarYUsingRight = i.scrollbarYRight === i.scrollbarYRight; // !isNaN + i.scrollbarYLeft = i.isScrollbarYUsingRight ? null : h.toInt(d.css(i.scrollbarYRail, 'left')); + i.scrollbarYOuterWidth = i.isRtl ? h.outerWidth(i.scrollbarY) : null; + i.railBorderYWidth = h.toInt(d.css(i.scrollbarYRail, 'borderTopWidth')) + h.toInt(d.css(i.scrollbarYRail, 'borderBottomWidth')); + d.css(i.scrollbarYRail, 'display', 'block'); + i.railYMarginHeight = h.toInt(d.css(i.scrollbarYRail, 'marginTop')) + h.toInt(d.css(i.scrollbarYRail, 'marginBottom')); + d.css(i.scrollbarYRail, 'display', ''); + i.railYHeight = null; + i.railYRatio = null; +} + +function getId(element) { + if (typeof element.dataset === 'undefined') { + return element.getAttribute('data-ps-id'); + } else { + return element.dataset.psId; + } +} + +function setId(element, id) { + if (typeof element.dataset === 'undefined') { + element.setAttribute('data-ps-id', id); + } else { + element.dataset.psId = id; + } +} + +function removeId(element) { + if (typeof element.dataset === 'undefined') { + element.removeAttribute('data-ps-id'); + } else { + delete element.dataset.psId; + } +} + +exports.add = function (element) { + var newId = guid(); + setId(element, newId); + instances[newId] = new Instance(element); + return instances[newId]; +}; + +exports.remove = function (element) { + delete instances[getId(element)]; + removeId(element); +}; + +exports.get = function (element) { + return instances[getId(element)]; +}; + +},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){ +'use strict'; + +var cls = require('../lib/class') + , d = require('../lib/dom') + , h = require('../lib/helper') + , instances = require('./instances') + , updateScroll = require('./update-scroll'); + +function getThumbSize(i, thumbSize) { + if (i.settings.minScrollbarLength) { + thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength); + } + if (i.settings.maxScrollbarLength) { + thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength); + } + return thumbSize; +} + +function updateCss(element, i) { + var xRailOffset = {width: i.railXWidth}; + if (i.isRtl) { + xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth; + } else { + xRailOffset.left = element.scrollLeft; + } + if (i.isScrollbarXUsingBottom) { + xRailOffset.bottom = i.scrollbarXBottom - element.scrollTop; + } else { + xRailOffset.top = i.scrollbarXTop + element.scrollTop; + } + d.css(i.scrollbarXRail, xRailOffset); + + var yRailOffset = {top: element.scrollTop, height: i.railYHeight}; + if (i.isScrollbarYUsingRight) { + if (i.isRtl) { + yRailOffset.right = i.contentWidth - (i.negativeScrollAdjustment + element.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth; + } else { + yRailOffset.right = i.scrollbarYRight - element.scrollLeft; + } + } else { + if (i.isRtl) { + yRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth * 2 - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth; + } else { + yRailOffset.left = i.scrollbarYLeft + element.scrollLeft; + } + } + d.css(i.scrollbarYRail, yRailOffset); + + d.css(i.scrollbarX, {left: i.scrollbarXLeft, width: i.scrollbarXWidth - i.railBorderXWidth}); + d.css(i.scrollbarY, {top: i.scrollbarYTop, height: i.scrollbarYHeight - i.railBorderYWidth}); +} + +module.exports = function (element) { + var i = instances.get(element); + + i.containerWidth = element.clientWidth; + i.containerHeight = element.clientHeight; + i.contentWidth = element.scrollWidth; + i.contentHeight = element.scrollHeight; + + var existingRails; + if (!element.contains(i.scrollbarXRail)) { + existingRails = d.queryChildren(element, '.ps-scrollbar-x-rail'); + if (existingRails.length > 0) { + existingRails.forEach(function (rail) { + d.remove(rail); + }); + } + d.appendTo(i.scrollbarXRail, element); + } + if (!element.contains(i.scrollbarYRail)) { + existingRails = d.queryChildren(element, '.ps-scrollbar-y-rail'); + if (existingRails.length > 0) { + existingRails.forEach(function (rail) { + d.remove(rail); + }); + } + d.appendTo(i.scrollbarYRail, element); + } + + if (!i.settings.suppressScrollX && i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth) { + i.scrollbarXActive = true; + i.railXWidth = i.containerWidth - i.railXMarginWidth; + i.railXRatio = i.containerWidth / i.railXWidth; + i.scrollbarXWidth = getThumbSize(i, h.toInt(i.railXWidth * i.containerWidth / i.contentWidth)); + i.scrollbarXLeft = h.toInt((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth) / (i.contentWidth - i.containerWidth)); + } else { + i.scrollbarXActive = false; + } + + if (!i.settings.suppressScrollY && i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight) { + i.scrollbarYActive = true; + i.railYHeight = i.containerHeight - i.railYMarginHeight; + i.railYRatio = i.containerHeight / i.railYHeight; + i.scrollbarYHeight = getThumbSize(i, h.toInt(i.railYHeight * i.containerHeight / i.contentHeight)); + i.scrollbarYTop = h.toInt(element.scrollTop * (i.railYHeight - i.scrollbarYHeight) / (i.contentHeight - i.containerHeight)); + } else { + i.scrollbarYActive = false; + } + + if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) { + i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth; + } + if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) { + i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight; + } + + updateCss(element, i); + + if (i.scrollbarXActive) { + cls.add(element, 'ps-active-x'); + } else { + cls.remove(element, 'ps-active-x'); + i.scrollbarXWidth = 0; + i.scrollbarXLeft = 0; + updateScroll(element, 'left', 0); + } + if (i.scrollbarYActive) { + cls.add(element, 'ps-active-y'); + } else { + cls.remove(element, 'ps-active-y'); + i.scrollbarYHeight = 0; + i.scrollbarYTop = 0; + updateScroll(element, 'top', 0); + } +}; + +},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){ +'use strict'; + +var instances = require('./instances'); + +var upEvent = document.createEvent('Event') + , downEvent = document.createEvent('Event') + , leftEvent = document.createEvent('Event') + , rightEvent = document.createEvent('Event') + , yEvent = document.createEvent('Event') + , xEvent = document.createEvent('Event') + , xStartEvent = document.createEvent('Event') + , xEndEvent = document.createEvent('Event') + , yStartEvent = document.createEvent('Event') + , yEndEvent = document.createEvent('Event') + , lastTop + , lastLeft; + +upEvent.initEvent('ps-scroll-up', true, true); +downEvent.initEvent('ps-scroll-down', true, true); +leftEvent.initEvent('ps-scroll-left', true, true); +rightEvent.initEvent('ps-scroll-right', true, true); +yEvent.initEvent('ps-scroll-y', true, true); +xEvent.initEvent('ps-scroll-x', true, true); +xStartEvent.initEvent('ps-x-reach-start', true, true); +xEndEvent.initEvent('ps-x-reach-end', true, true); +yStartEvent.initEvent('ps-y-reach-start', true, true); +yEndEvent.initEvent('ps-y-reach-end', true, true); + +module.exports = function (element, axis, value) { + if (typeof element === 'undefined') { + throw 'You must provide an element to the update-scroll function'; + } + + if (typeof axis === 'undefined') { + throw 'You must provide an axis to the update-scroll function'; + } + + if (typeof value === 'undefined') { + throw 'You must provide a value to the update-scroll function'; + } + + if (axis === 'top' && value <= 0) { + element.scrollTop = value = 0; // don't allow negative scroll + element.dispatchEvent(yStartEvent); + } + + if (axis === 'left' && value <= 0) { + element.scrollLeft = value = 0; // don't allow negative scroll + element.dispatchEvent(xStartEvent); + } + + var i = instances.get(element); + + if (axis === 'top' && value >= i.contentHeight - i.containerHeight) { + element.scrollTop = value = i.contentHeight - i.containerHeight; // don't allow scroll past container + element.dispatchEvent(yEndEvent); + } + + if (axis === 'left' && value >= i.contentWidth - i.containerWidth) { + element.scrollLeft = value = i.contentWidth - i.containerWidth; // don't allow scroll past container + element.dispatchEvent(xEndEvent); + } + + if (!lastTop) { + lastTop = element.scrollTop; + } + + if (!lastLeft) { + lastLeft = element.scrollLeft; + } + + if (axis === 'top' && value < lastTop) { + element.dispatchEvent(upEvent); + } + + if (axis === 'top' && value > lastTop) { + element.dispatchEvent(downEvent); + } + + if (axis === 'left' && value < lastLeft) { + element.dispatchEvent(leftEvent); + } + + if (axis === 'left' && value > lastLeft) { + element.dispatchEvent(rightEvent); + } + + if (axis === 'top') { + element.scrollTop = lastTop = value; + element.dispatchEvent(yEvent); + } + + if (axis === 'left') { + element.scrollLeft = lastLeft = value; + element.dispatchEvent(xEvent); + } + +}; + +},{"./instances":18}],21:[function(require,module,exports){ +'use strict'; + +var d = require('../lib/dom') + , h = require('../lib/helper') + , instances = require('./instances') + , updateGeometry = require('./update-geometry') + , updateScroll = require('./update-scroll'); + +module.exports = function (element) { + var i = instances.get(element); + + if (!i) { + return; + } + + // Recalcuate negative scrollLeft adjustment + i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0; + + // Recalculate rail margins + d.css(i.scrollbarXRail, 'display', 'block'); + d.css(i.scrollbarYRail, 'display', 'block'); + i.railXMarginWidth = h.toInt(d.css(i.scrollbarXRail, 'marginLeft')) + h.toInt(d.css(i.scrollbarXRail, 'marginRight')); + i.railYMarginHeight = h.toInt(d.css(i.scrollbarYRail, 'marginTop')) + h.toInt(d.css(i.scrollbarYRail, 'marginBottom')); + + // Hide scrollbars not to affect scrollWidth and scrollHeight + d.css(i.scrollbarXRail, 'display', 'none'); + d.css(i.scrollbarYRail, 'display', 'none'); + + updateGeometry(element); + + // Update top/left scroll to trigger events + updateScroll(element, 'top', element.scrollTop); + updateScroll(element, 'left', element.scrollLeft); + + d.css(i.scrollbarXRail, 'display', ''); + d.css(i.scrollbarYRail, 'display', ''); +}; + +},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]); diff --git a/web/static/js/perfect-scrollbar-0.6.10.jquery.min.js b/web/static/js/perfect-scrollbar-0.6.10.jquery.min.js new file mode 100644 index 000000000..af39018e1 --- /dev/null +++ b/web/static/js/perfect-scrollbar-0.6.10.jquery.min.js @@ -0,0 +1,2 @@ +/* perfect-scrollbar v0.6.10 */ +!function t(e,n,r){function o(l,s){if(!n[l]){if(!e[l]){var a="function"==typeof require&&require;if(!s&&a)return a(l,!0);if(i)return i(l,!0);var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[l]={exports:{}};e[l][0].call(u.exports,function(t){var n=e[l][1][t];return o(n?n:t)},u,u.exports,t,e,n,r)}return n[l].exports}for(var i="function"==typeof require&&require,l=0;l=0&&n.splice(r,1),t.className=n.join(" ")}n.add=function(t,e){t.classList?t.classList.add(e):r(t,e)},n.remove=function(t,e){t.classList?t.classList.remove(e):o(t,e)},n.list=function(t){return t.classList?Array.prototype.slice.apply(t.classList):t.className.split(" ")}},{}],3:[function(t,e,n){"use strict";function r(t,e){return window.getComputedStyle(t)[e]}function o(t,e,n){return"number"==typeof n&&(n=n.toString()+"px"),t.style[e]=n,t}function i(t,e){for(var n in e){var r=e[n];"number"==typeof r&&(r=r.toString()+"px"),t.style[n]=r}return t}var l={};l.e=function(t,e){var n=document.createElement(t);return n.className=e,n},l.appendTo=function(t,e){return e.appendChild(t),t},l.css=function(t,e,n){return"object"==typeof e?i(t,e):"undefined"==typeof n?r(t,e):o(t,e,n)},l.matches=function(t,e){return"undefined"!=typeof t.matches?t.matches(e):"undefined"!=typeof t.matchesSelector?t.matchesSelector(e):"undefined"!=typeof t.webkitMatchesSelector?t.webkitMatchesSelector(e):"undefined"!=typeof t.mozMatchesSelector?t.mozMatchesSelector(e):"undefined"!=typeof t.msMatchesSelector?t.msMatchesSelector(e):void 0},l.remove=function(t){"undefined"!=typeof t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)},l.queryChildren=function(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return l.matches(t,e)})},e.exports=l},{}],4:[function(t,e,n){"use strict";var r=function(t){this.element=t,this.events={}};r.prototype.bind=function(t,e){"undefined"==typeof this.events[t]&&(this.events[t]=[]),this.events[t].push(e),this.element.addEventListener(t,e,!1)},r.prototype.unbind=function(t,e){var n="undefined"!=typeof e;this.events[t]=this.events[t].filter(function(r){return n&&r!==e?!0:(this.element.removeEventListener(t,r,!1),!1)},this)},r.prototype.unbindAll=function(){for(var t in this.events)this.unbind(t)};var o=function(){this.eventElements=[]};o.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return"undefined"==typeof e&&(e=new r(t),this.eventElements.push(e)),e},o.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},o.prototype.unbind=function(t,e,n){this.eventElement(t).unbind(e,n)},o.prototype.unbindAll=function(){for(var t=0;tu?u=0:u>1&&(u=1),s(t,"top",(e.contentHeight-e.containerHeight)*u),l(t),r.stopPropagation()}),e.settings.stopPropagationOnClick&&e.event.bind(e.scrollbarY,"click",function(t){t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"click",function(r){var i=o.toInt(e.scrollbarXWidth/2),a=e.railXRatio*(r.pageX-window.pageXOffset-n(e.scrollbarXRail).left-i),c=e.railXRatio*(e.railXWidth-e.scrollbarXWidth),u=a/c;0>u?u=0:u>1&&(u=1),s(t,"left",(e.contentWidth-e.containerWidth)*u-e.negativeScrollAdjustment),l(t),r.stopPropagation()})}var o=t("../../lib/helper"),i=t("../instances"),l=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=i.get(t);r(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(t,e,n){"use strict";function r(t,e){function n(n){var o=r+n*e.railXRatio,i=Math.max(0,e.scrollbarXRail.getBoundingClientRect().left)+e.railXRatio*(e.railXWidth-e.scrollbarXWidth);0>o?e.scrollbarXLeft=0:o>i?e.scrollbarXLeft=i:e.scrollbarXLeft=o;var s=l.toInt(e.scrollbarXLeft*(e.contentWidth-e.containerWidth)/(e.containerWidth-e.railXRatio*e.scrollbarXWidth))-e.negativeScrollAdjustment;c(t,"left",s)}var r=null,o=null,s=function(e){n(e.pageX-o),a(t),e.stopPropagation(),e.preventDefault()},u=function(){l.stopScrolling(t,"x"),e.event.unbind(e.ownerDocument,"mousemove",s)};e.event.bind(e.scrollbarX,"mousedown",function(n){o=n.pageX,r=l.toInt(i.css(e.scrollbarX,"left"))*e.railXRatio,l.startScrolling(t,"x"),e.event.bind(e.ownerDocument,"mousemove",s),e.event.once(e.ownerDocument,"mouseup",u),n.stopPropagation(),n.preventDefault()})}function o(t,e){function n(n){var o=r+n*e.railYRatio,i=Math.max(0,e.scrollbarYRail.getBoundingClientRect().top)+e.railYRatio*(e.railYHeight-e.scrollbarYHeight);0>o?e.scrollbarYTop=0:o>i?e.scrollbarYTop=i:e.scrollbarYTop=o;var s=l.toInt(e.scrollbarYTop*(e.contentHeight-e.containerHeight)/(e.containerHeight-e.railYRatio*e.scrollbarYHeight));c(t,"top",s)}var r=null,o=null,s=function(e){n(e.pageY-o),a(t),e.stopPropagation(),e.preventDefault()},u=function(){l.stopScrolling(t,"y"),e.event.unbind(e.ownerDocument,"mousemove",s)};e.event.bind(e.scrollbarY,"mousedown",function(n){o=n.pageY,r=l.toInt(i.css(e.scrollbarY,"top"))*e.railYRatio,l.startScrolling(t,"y"),e.event.bind(e.ownerDocument,"mousemove",s),e.event.once(e.ownerDocument,"mouseup",u),n.stopPropagation(),n.preventDefault()})}var i=t("../../lib/dom"),l=t("../../lib/helper"),s=t("../instances"),a=t("../update-geometry"),c=t("../update-scroll");e.exports=function(t){var e=s.get(t);r(t,e),o(t,e)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(t,e,n){"use strict";function r(t,e){function n(n,r){var o=t.scrollTop;if(0===n){if(!e.scrollbarYActive)return!1;if(0===o&&r>0||o>=e.contentHeight-e.containerHeight&&0>r)return!e.settings.wheelPropagation}var i=t.scrollLeft;if(0===r){if(!e.scrollbarXActive)return!1;if(0===i&&0>n||i>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}var r=!1;e.event.bind(t,"mouseenter",function(){r=!0}),e.event.bind(t,"mouseleave",function(){r=!1});var l=!1;e.event.bind(e.ownerDocument,"keydown",function(c){if(!c.isDefaultPrevented||!c.isDefaultPrevented()){var u=i.matches(e.scrollbarX,":focus")||i.matches(e.scrollbarY,":focus");if(r||u){var d=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(d){for(;d.shadowRoot;)d=d.shadowRoot.activeElement;if(o.isEditable(d))return}var p=0,f=0;switch(c.which){case 37:p=-30;break;case 38:f=30;break;case 39:p=30;break;case 40:f=-30;break;case 33:f=90;break;case 32:f=c.shiftKey?90:-90;break;case 34:f=-90;break;case 35:f=c.ctrlKey?-e.contentHeight:-e.containerHeight;break;case 36:f=c.ctrlKey?t.scrollTop:e.containerHeight;break;default:return}a(t,"top",t.scrollTop-f),a(t,"left",t.scrollLeft+p),s(t),l=n(p,f),l&&c.preventDefault()}}})}var o=t("../../lib/helper"),i=t("../../lib/dom"),l=t("../instances"),s=t("../update-geometry"),a=t("../update-scroll");e.exports=function(t){var e=l.get(t);r(t,e)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(t,e,n){"use strict";function r(t,e){function n(n,r){var o=t.scrollTop;if(0===n){if(!e.scrollbarYActive)return!1;if(0===o&&r>0||o>=e.contentHeight-e.containerHeight&&0>r)return!e.settings.wheelPropagation}var i=t.scrollLeft;if(0===r){if(!e.scrollbarXActive)return!1;if(0===i&&0>n||i>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}function r(t){var e=t.deltaX,n=-1*t.deltaY;return("undefined"==typeof e||"undefined"==typeof n)&&(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!==e&&n!==n&&(e=0,n=t.wheelDelta),[e,n]}function o(e,n){var r=t.querySelector("textarea:hover");if(r){var o=r.scrollHeight-r.clientHeight;if(o>0&&!(0===r.scrollTop&&n>0||r.scrollTop===o&&0>n))return!0;var i=r.scrollLeft-r.clientWidth;if(i>0&&!(0===r.scrollLeft&&0>e||r.scrollLeft===i&&e>0))return!0}return!1}function s(s){var c=r(s),u=c[0],d=c[1];o(u,d)||(a=!1,e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(d?l(t,"top",t.scrollTop-d*e.settings.wheelSpeed):l(t,"top",t.scrollTop+u*e.settings.wheelSpeed),a=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(u?l(t,"left",t.scrollLeft+u*e.settings.wheelSpeed):l(t,"left",t.scrollLeft-d*e.settings.wheelSpeed),a=!0):(l(t,"top",t.scrollTop-d*e.settings.wheelSpeed),l(t,"left",t.scrollLeft+u*e.settings.wheelSpeed)),i(t),a=a||n(u,d),a&&(s.stopPropagation(),s.preventDefault()))}var a=!1;"undefined"!=typeof window.onwheel?e.event.bind(t,"wheel",s):"undefined"!=typeof window.onmousewheel&&e.event.bind(t,"mousewheel",s)}var o=t("../instances"),i=t("../update-geometry"),l=t("../update-scroll");e.exports=function(t){var e=o.get(t);r(t,e)}},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(t,e,n){"use strict";function r(t,e){e.event.bind(t,"scroll",function(){i(t)})}var o=t("../instances"),i=t("../update-geometry");e.exports=function(t){var e=o.get(t);r(t,e)}},{"../instances":18,"../update-geometry":19}],15:[function(t,e,n){"use strict";function r(t,e){function n(){var t=window.getSelection?window.getSelection():document.getSelection?document.getSelection():"";return 0===t.toString().length?null:t.getRangeAt(0).commonAncestorContainer}function r(){c||(c=setInterval(function(){return i.get(t)?(s(t,"top",t.scrollTop+u.top),s(t,"left",t.scrollLeft+u.left),void l(t)):void clearInterval(c)},50))}function a(){c&&(clearInterval(c),c=null),o.stopScrolling(t)}var c=null,u={top:0,left:0},d=!1;e.event.bind(e.ownerDocument,"selectionchange",function(){t.contains(n())?d=!0:(d=!1,a())}),e.event.bind(window,"mouseup",function(){d&&(d=!1,a())}),e.event.bind(window,"mousemove",function(e){if(d){var n={x:e.pageX,y:e.pageY},i={left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight};n.xi.right-3?(u.left=5,o.startScrolling(t,"x")):u.left=0,n.yi.bottom-3?(n.y-i.bottom+3<5?u.top=5:u.top=20,o.startScrolling(t,"y")):u.top=0,0===u.top&&0===u.left?a():r()}})}var o=t("../../lib/helper"),i=t("../instances"),l=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=i.get(t);r(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(t,e,n){"use strict";function r(t,e,n,r){function s(n,r){var o=t.scrollTop,i=t.scrollLeft,l=Math.abs(n),s=Math.abs(r);if(s>l){if(0>r&&o===e.contentHeight-e.containerHeight||r>0&&0===o)return!e.settings.swipePropagation}else if(l>s&&(0>n&&i===e.contentWidth-e.containerWidth||n>0&&0===i))return!e.settings.swipePropagation;return!0}function a(e,n){l(t,"top",t.scrollTop-n),l(t,"left",t.scrollLeft-e),i(t)}function c(){Y=!0}function u(){Y=!1}function d(t){return t.targetTouches?t.targetTouches[0]:t}function p(t){return t.targetTouches&&1===t.targetTouches.length?!0:t.pointerType&&"mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE?!0:!1}function f(t){if(p(t)){w=!0;var e=d(t);v.pageX=e.pageX,v.pageY=e.pageY,g=(new Date).getTime(),null!==y&&clearInterval(y),t.stopPropagation()}}function h(t){if(!Y&&w&&p(t)){var e=d(t),n={pageX:e.pageX,pageY:e.pageY},r=n.pageX-v.pageX,o=n.pageY-v.pageY;a(r,o),v=n;var i=(new Date).getTime(),l=i-g;l>0&&(m.x=r/l,m.y=o/l,g=i),s(r,o)&&(t.stopPropagation(),t.preventDefault())}}function b(){!Y&&w&&(w=!1,clearInterval(y),y=setInterval(function(){return o.get(t)?Math.abs(m.x)<.01&&Math.abs(m.y)<.01?void clearInterval(y):(a(30*m.x,30*m.y),m.x*=.8,void(m.y*=.8)):void clearInterval(y)},10))}var v={},g=0,m={},y=null,Y=!1,w=!1;n&&(e.event.bind(window,"touchstart",c),e.event.bind(window,"touchend",u),e.event.bind(t,"touchstart",f),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",b)),r&&(window.PointerEvent?(e.event.bind(window,"pointerdown",c),e.event.bind(window,"pointerup",u),e.event.bind(t,"pointerdown",f),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",b)):window.MSPointerEvent&&(e.event.bind(window,"MSPointerDown",c),e.event.bind(window,"MSPointerUp",u),e.event.bind(t,"MSPointerDown",f),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",b)))}var o=t("../instances"),i=t("../update-geometry"),l=t("../update-scroll");e.exports=function(t,e,n){var i=o.get(t);r(t,i,e,n)}},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(t,e,n){"use strict";var r=t("../lib/class"),o=t("../lib/helper"),i=t("./instances"),l=t("./update-geometry"),s=t("./handler/click-rail"),a=t("./handler/drag-scrollbar"),c=t("./handler/keyboard"),u=t("./handler/mouse-wheel"),d=t("./handler/native-scroll"),p=t("./handler/selection"),f=t("./handler/touch");e.exports=function(t,e){e="object"==typeof e?e:{},r.add(t,"ps-container");var n=i.add(t);n.settings=o.extend(n.settings,e),r.add(t,"ps-theme-"+n.settings.theme),s(t),a(t),u(t),d(t),n.settings.useSelectionScroll&&p(t),(o.env.supportsTouch||o.env.supportsIePointer)&&f(t,o.env.supportsTouch,o.env.supportsIePointer),n.settings.useKeyboard&&c(t),l(t)}},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(t,e,n){"use strict";function r(t){function e(){s.add(t,"ps-focus")}function n(){s.remove(t,"ps-focus")}var r=this;r.settings=p.clone(c),r.containerWidth=null,r.containerHeight=null,r.contentWidth=null,r.contentHeight=null,r.isRtl="rtl"===a.css(t,"direction"),r.isNegativeScroll=function(){var e=t.scrollLeft,n=null;return t.scrollLeft=-1,n=t.scrollLeft<0,t.scrollLeft=e,n}(),r.negativeScrollAdjustment=r.isNegativeScroll?t.scrollWidth-t.clientWidth:0,r.event=new u,r.ownerDocument=t.ownerDocument||document,r.scrollbarXRail=a.appendTo(a.e("div","ps-scrollbar-x-rail"),t),r.scrollbarX=a.appendTo(a.e("div","ps-scrollbar-x"),r.scrollbarXRail),r.scrollbarX.setAttribute("tabindex",0),r.event.bind(r.scrollbarX,"focus",e),r.event.bind(r.scrollbarX,"blur",n),r.scrollbarXActive=null,r.scrollbarXWidth=null,r.scrollbarXLeft=null,r.scrollbarXBottom=p.toInt(a.css(r.scrollbarXRail,"bottom")),r.isScrollbarXUsingBottom=r.scrollbarXBottom===r.scrollbarXBottom,r.scrollbarXTop=r.isScrollbarXUsingBottom?null:p.toInt(a.css(r.scrollbarXRail,"top")),r.railBorderXWidth=p.toInt(a.css(r.scrollbarXRail,"borderLeftWidth"))+p.toInt(a.css(r.scrollbarXRail,"borderRightWidth")),a.css(r.scrollbarXRail,"display","block"),r.railXMarginWidth=p.toInt(a.css(r.scrollbarXRail,"marginLeft"))+p.toInt(a.css(r.scrollbarXRail,"marginRight")),a.css(r.scrollbarXRail,"display",""),r.railXWidth=null,r.railXRatio=null,r.scrollbarYRail=a.appendTo(a.e("div","ps-scrollbar-y-rail"),t),r.scrollbarY=a.appendTo(a.e("div","ps-scrollbar-y"),r.scrollbarYRail),r.scrollbarY.setAttribute("tabindex",0),r.event.bind(r.scrollbarY,"focus",e),r.event.bind(r.scrollbarY,"blur",n),r.scrollbarYActive=null,r.scrollbarYHeight=null,r.scrollbarYTop=null,r.scrollbarYRight=p.toInt(a.css(r.scrollbarYRail,"right")),r.isScrollbarYUsingRight=r.scrollbarYRight===r.scrollbarYRight,r.scrollbarYLeft=r.isScrollbarYUsingRight?null:p.toInt(a.css(r.scrollbarYRail,"left")),r.scrollbarYOuterWidth=r.isRtl?p.outerWidth(r.scrollbarY):null,r.railBorderYWidth=p.toInt(a.css(r.scrollbarYRail,"borderTopWidth"))+p.toInt(a.css(r.scrollbarYRail,"borderBottomWidth")),a.css(r.scrollbarYRail,"display","block"),r.railYMarginHeight=p.toInt(a.css(r.scrollbarYRail,"marginTop"))+p.toInt(a.css(r.scrollbarYRail,"marginBottom")),a.css(r.scrollbarYRail,"display",""),r.railYHeight=null,r.railYRatio=null}function o(t){return"undefined"==typeof t.dataset?t.getAttribute("data-ps-id"):t.dataset.psId}function i(t,e){"undefined"==typeof t.dataset?t.setAttribute("data-ps-id",e):t.dataset.psId=e}function l(t){"undefined"==typeof t.dataset?t.removeAttribute("data-ps-id"):delete t.dataset.psId}var s=t("../lib/class"),a=t("../lib/dom"),c=t("./default-setting"),u=t("../lib/event-manager"),d=t("../lib/guid"),p=t("../lib/helper"),f={};n.add=function(t){var e=d();return i(t,e),f[e]=new r(t),f[e]},n.remove=function(t){delete f[o(t)],l(t)},n.get=function(t){return f[o(t)]}},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(t,e,n){"use strict";function r(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function o(t,e){var n={width:e.railXWidth};e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft,e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-t.scrollTop:n.top=e.scrollbarXTop+t.scrollTop,l.css(e.scrollbarXRail,n);var r={top:t.scrollTop,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?r.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth:r.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?r.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:r.left=e.scrollbarYLeft+t.scrollLeft,l.css(e.scrollbarYRail,r),l.css(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),l.css(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}var i=t("../lib/class"),l=t("../lib/dom"),s=t("../lib/helper"),a=t("./instances"),c=t("./update-scroll");e.exports=function(t){var e=a.get(t);e.containerWidth=t.clientWidth,e.containerHeight=t.clientHeight,e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight;var n;t.contains(e.scrollbarXRail)||(n=l.queryChildren(t,".ps-scrollbar-x-rail"),n.length>0&&n.forEach(function(t){l.remove(t)}),l.appendTo(e.scrollbarXRail,t)),t.contains(e.scrollbarYRail)||(n=l.queryChildren(t,".ps-scrollbar-y-rail"),n.length>0&&n.forEach(function(t){l.remove(t)}),l.appendTo(e.scrollbarYRail,t)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),o(t,e),e.scrollbarXActive?i.add(t,"ps-active-x"):(i.remove(t,"ps-active-x"),e.scrollbarXWidth=0,e.scrollbarXLeft=0,c(t,"left",0)),e.scrollbarYActive?i.add(t,"ps-active-y"):(i.remove(t,"ps-active-y"),e.scrollbarYHeight=0,e.scrollbarYTop=0,c(t,"top",0))}},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(t,e,n){"use strict";var r,o,i=t("./instances"),l=document.createEvent("Event"),s=document.createEvent("Event"),a=document.createEvent("Event"),c=document.createEvent("Event"),u=document.createEvent("Event"),d=document.createEvent("Event"),p=document.createEvent("Event"),f=document.createEvent("Event"),h=document.createEvent("Event"),b=document.createEvent("Event");l.initEvent("ps-scroll-up",!0,!0),s.initEvent("ps-scroll-down",!0,!0),a.initEvent("ps-scroll-left",!0,!0),c.initEvent("ps-scroll-right",!0,!0),u.initEvent("ps-scroll-y",!0,!0),d.initEvent("ps-scroll-x",!0,!0),p.initEvent("ps-x-reach-start",!0,!0),f.initEvent("ps-x-reach-end",!0,!0),h.initEvent("ps-y-reach-start",!0,!0),b.initEvent("ps-y-reach-end",!0,!0),e.exports=function(t,e,n){if("undefined"==typeof t)throw"You must provide an element to the update-scroll function";if("undefined"==typeof e)throw"You must provide an axis to the update-scroll function";if("undefined"==typeof n)throw"You must provide a value to the update-scroll function";"top"===e&&0>=n&&(t.scrollTop=n=0,t.dispatchEvent(h)),"left"===e&&0>=n&&(t.scrollLeft=n=0,t.dispatchEvent(p));var v=i.get(t);"top"===e&&n>=v.contentHeight-v.containerHeight&&(t.scrollTop=n=v.contentHeight-v.containerHeight,t.dispatchEvent(b)),"left"===e&&n>=v.contentWidth-v.containerWidth&&(t.scrollLeft=n=v.contentWidth-v.containerWidth,t.dispatchEvent(f)),r||(r=t.scrollTop),o||(o=t.scrollLeft),"top"===e&&r>n&&t.dispatchEvent(l),"top"===e&&n>r&&t.dispatchEvent(s),"left"===e&&o>n&&t.dispatchEvent(a),"left"===e&&n>o&&t.dispatchEvent(c),"top"===e&&(t.scrollTop=r=n,t.dispatchEvent(u)),"left"===e&&(t.scrollLeft=o=n,t.dispatchEvent(d))}},{"./instances":18}],21:[function(t,e,n){"use strict";var r=t("../lib/dom"),o=t("../lib/helper"),i=t("./instances"),l=t("./update-geometry"),s=t("./update-scroll");e.exports=function(t){var e=i.get(t);e&&(e.negativeScrollAdjustment=e.isNegativeScroll?t.scrollWidth-t.clientWidth:0,r.css(e.scrollbarXRail,"display","block"),r.css(e.scrollbarYRail,"display","block"),e.railXMarginWidth=o.toInt(r.css(e.scrollbarXRail,"marginLeft"))+o.toInt(r.css(e.scrollbarXRail,"marginRight")),e.railYMarginHeight=o.toInt(r.css(e.scrollbarYRail,"marginTop"))+o.toInt(r.css(e.scrollbarYRail,"marginBottom")),r.css(e.scrollbarXRail,"display","none"),r.css(e.scrollbarYRail,"display","none"),l(t),s(t,"top",t.scrollTop),s(t,"left",t.scrollLeft),r.css(e.scrollbarXRail,"display",""),r.css(e.scrollbarYRail,"display",""))}},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]); \ No newline at end of file diff --git a/web/static/js/perfect-scrollbar-0.6.7.jquery.js b/web/static/js/perfect-scrollbar-0.6.7.jquery.js deleted file mode 100644 index 6c25fa91f..000000000 --- a/web/static/js/perfect-scrollbar-0.6.7.jquery.js +++ /dev/null @@ -1,1613 +0,0 @@ -/* perfect-scrollbar v0.6.7 */ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0) { - classes.splice(idx, 1); - } - element.className = classes.join(' '); -} - -exports.add = function (element, className) { - if (element.classList) { - element.classList.add(className); - } else { - oldAdd(element, className); - } -}; - -exports.remove = function (element, className) { - if (element.classList) { - element.classList.remove(className); - } else { - oldRemove(element, className); - } -}; - -exports.list = function (element) { - if (element.classList) { - return Array.prototype.slice.apply(element.classList); - } else { - return element.className.split(' '); - } -}; - -},{}],3:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var DOM = {}; - -DOM.e = function (tagName, className) { - var element = document.createElement(tagName); - element.className = className; - return element; -}; - -DOM.appendTo = function (child, parent) { - parent.appendChild(child); - return child; -}; - -function cssGet(element, styleName) { - return window.getComputedStyle(element)[styleName]; -} - -function cssSet(element, styleName, styleValue) { - if (typeof styleValue === 'number') { - styleValue = styleValue.toString() + 'px'; - } - element.style[styleName] = styleValue; - return element; -} - -function cssMultiSet(element, obj) { - for (var key in obj) { - var val = obj[key]; - if (typeof val === 'number') { - val = val.toString() + 'px'; - } - element.style[key] = val; - } - return element; -} - -DOM.css = function (element, styleNameOrObject, styleValue) { - if (typeof styleNameOrObject === 'object') { - // multiple set with object - return cssMultiSet(element, styleNameOrObject); - } else { - if (typeof styleValue === 'undefined') { - return cssGet(element, styleNameOrObject); - } else { - return cssSet(element, styleNameOrObject, styleValue); - } - } -}; - -DOM.matches = function (element, query) { - if (typeof element.matches !== 'undefined') { - return element.matches(query); - } else { - if (typeof element.matchesSelector !== 'undefined') { - return element.matchesSelector(query); - } else if (typeof element.webkitMatchesSelector !== 'undefined') { - return element.webkitMatchesSelector(query); - } else if (typeof element.mozMatchesSelector !== 'undefined') { - return element.mozMatchesSelector(query); - } else if (typeof element.msMatchesSelector !== 'undefined') { - return element.msMatchesSelector(query); - } - } -}; - -DOM.remove = function (element) { - if (typeof element.remove !== 'undefined') { - element.remove(); - } else { - if (element.parentNode) { - element.parentNode.removeChild(element); - } - } -}; - -DOM.queryChildren = function (element, selector) { - return Array.prototype.filter.call(element.childNodes, function (child) { - return DOM.matches(child, selector); - }); -}; - -module.exports = DOM; - -},{}],4:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var EventElement = function (element) { - this.element = element; - this.events = {}; -}; - -EventElement.prototype.bind = function (eventName, handler) { - if (typeof this.events[eventName] === 'undefined') { - this.events[eventName] = []; - } - this.events[eventName].push(handler); - this.element.addEventListener(eventName, handler, false); -}; - -EventElement.prototype.unbind = function (eventName, handler) { - var isHandlerProvided = (typeof handler !== 'undefined'); - this.events[eventName] = this.events[eventName].filter(function (hdlr) { - if (isHandlerProvided && hdlr !== handler) { - return true; - } - this.element.removeEventListener(eventName, hdlr, false); - return false; - }, this); -}; - -EventElement.prototype.unbindAll = function () { - for (var name in this.events) { - this.unbind(name); - } -}; - -var EventManager = function () { - this.eventElements = []; -}; - -EventManager.prototype.eventElement = function (element) { - var ee = this.eventElements.filter(function (eventElement) { - return eventElement.element === element; - })[0]; - if (typeof ee === 'undefined') { - ee = new EventElement(element); - this.eventElements.push(ee); - } - return ee; -}; - -EventManager.prototype.bind = function (element, eventName, handler) { - this.eventElement(element).bind(eventName, handler); -}; - -EventManager.prototype.unbind = function (element, eventName, handler) { - this.eventElement(element).unbind(eventName, handler); -}; - -EventManager.prototype.unbindAll = function () { - for (var i = 0; i < this.eventElements.length; i++) { - this.eventElements[i].unbindAll(); - } -}; - -EventManager.prototype.once = function (element, eventName, handler) { - var ee = this.eventElement(element); - var onceHandler = function (e) { - ee.unbind(eventName, onceHandler); - handler(e); - }; - ee.bind(eventName, onceHandler); -}; - -module.exports = EventManager; - -},{}],5:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -module.exports = (function () { - function s4() { - return Math.floor((1 + Math.random()) * 0x10000) - .toString(16) - .substring(1); - } - return function () { - return s4() + s4() + '-' + s4() + '-' + s4() + '-' + - s4() + '-' + s4() + s4() + s4(); - }; -})(); - -},{}],6:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var cls = require('./class') - , d = require('./dom'); - -exports.toInt = function (x) { - return parseInt(x, 10) || 0; -}; - -exports.clone = function (obj) { - if (obj === null) { - return null; - } else if (typeof obj === 'object') { - var result = {}; - for (var key in obj) { - result[key] = this.clone(obj[key]); - } - return result; - } else { - return obj; - } -}; - -exports.extend = function (original, source) { - var result = this.clone(original); - for (var key in source) { - result[key] = this.clone(source[key]); - } - return result; -}; - -exports.isEditable = function (el) { - return d.matches(el, "input,[contenteditable]") || - d.matches(el, "select,[contenteditable]") || - d.matches(el, "textarea,[contenteditable]") || - d.matches(el, "button,[contenteditable]"); -}; - -exports.removePsClasses = function (element) { - var clsList = cls.list(element); - for (var i = 0; i < clsList.length; i++) { - var className = clsList[i]; - if (className.indexOf('ps-') === 0) { - cls.remove(element, className); - } - } -}; - -exports.outerWidth = function (element) { - return this.toInt(d.css(element, 'width')) + - this.toInt(d.css(element, 'paddingLeft')) + - this.toInt(d.css(element, 'paddingRight')) + - this.toInt(d.css(element, 'borderLeftWidth')) + - this.toInt(d.css(element, 'borderRightWidth')); -}; - -exports.startScrolling = function (element, axis) { - cls.add(element, 'ps-in-scrolling'); - if (typeof axis !== 'undefined') { - cls.add(element, 'ps-' + axis); - } else { - cls.add(element, 'ps-x'); - cls.add(element, 'ps-y'); - } -}; - -exports.stopScrolling = function (element, axis) { - cls.remove(element, 'ps-in-scrolling'); - if (typeof axis !== 'undefined') { - cls.remove(element, 'ps-' + axis); - } else { - cls.remove(element, 'ps-x'); - cls.remove(element, 'ps-y'); - } -}; - -exports.env = { - isWebKit: 'WebkitAppearance' in document.documentElement.style, - supportsTouch: (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch), - supportsIePointer: window.navigator.msMaxTouchPoints !== null -}; - -},{"./class":2,"./dom":3}],7:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var destroy = require('./plugin/destroy') - , initialize = require('./plugin/initialize') - , update = require('./plugin/update'); - -module.exports = { - initialize: initialize, - update: update, - destroy: destroy -}; - -},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -module.exports = { - maxScrollbarLength: null, - minScrollbarLength: null, - scrollXMarginOffset: 0, - scrollYMarginOffset: 0, - stopPropagationOnClick: true, - suppressScrollX: false, - suppressScrollY: false, - swipePropagation: true, - useBothWheelAxes: false, - useKeyboard: true, - useSelectionScroll: false, - wheelPropagation: false, - wheelSpeed: 1 -}; - -},{}],9:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var d = require('../lib/dom') - , h = require('../lib/helper') - , instances = require('./instances'); - -module.exports = function (element) { - var i = instances.get(element); - - if (!i) { - return; - } - - i.event.unbindAll(); - d.remove(i.scrollbarX); - d.remove(i.scrollbarY); - d.remove(i.scrollbarXRail); - d.remove(i.scrollbarYRail); - h.removePsClasses(element); - - instances.remove(element); -}; - -},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var h = require('../../lib/helper') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); - -function bindClickRailHandler(element, i) { - function pageOffset(el) { - return el.getBoundingClientRect(); - } - - if (i.settings.stopPropagationOnClick) { - i.event.bind(i.scrollbarY, 'click', function (e) { - e.stopPropagation(); - }); - } - i.event.bind(i.scrollbarYRail, 'click', function (e) { - var halfOfScrollbarLength = h.toInt(i.scrollbarYHeight / 2); - var positionTop = i.railYRatio * (e.pageY - window.scrollY - pageOffset(i.scrollbarYRail).top - halfOfScrollbarLength); - var maxPositionTop = i.railYRatio * (i.railYHeight - i.scrollbarYHeight); - var positionRatio = positionTop / maxPositionTop; - - if (positionRatio < 0) { - positionRatio = 0; - } else if (positionRatio > 1) { - positionRatio = 1; - } - - updateScroll(element, 'top', (i.contentHeight - i.containerHeight) * positionRatio); - updateGeometry(element); - - e.stopPropagation(); - }); - - if (i.settings.stopPropagationOnClick) { - i.event.bind(i.scrollbarY, 'click', function (e) { - e.stopPropagation(); - }); - } - i.event.bind(i.scrollbarXRail, 'click', function (e) { - var halfOfScrollbarLength = h.toInt(i.scrollbarXWidth / 2); - var positionLeft = i.railXRatio * (e.pageX - window.scrollX - pageOffset(i.scrollbarXRail).left - halfOfScrollbarLength); - var maxPositionLeft = i.railXRatio * (i.railXWidth - i.scrollbarXWidth); - var positionRatio = positionLeft / maxPositionLeft; - - if (positionRatio < 0) { - positionRatio = 0; - } else if (positionRatio > 1) { - positionRatio = 1; - } - - updateScroll(element, 'left', ((i.contentWidth - i.containerWidth) * positionRatio) - i.negativeScrollAdjustment); - updateGeometry(element); - - e.stopPropagation(); - }); -} - -module.exports = function (element) { - var i = instances.get(element); - bindClickRailHandler(element, i); -}; - -},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var d = require('../../lib/dom') - , h = require('../../lib/helper') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); - -function bindMouseScrollXHandler(element, i) { - var currentLeft = null; - var currentPageX = null; - - function updateScrollLeft(deltaX) { - var newLeft = currentLeft + (deltaX * i.railXRatio); - var maxLeft = i.scrollbarXRail.getBoundingClientRect().left + (i.railXRatio * (i.railXWidth - i.scrollbarXWidth)); - - if (newLeft < 0) { - i.scrollbarXLeft = 0; - } else if (newLeft > maxLeft) { - i.scrollbarXLeft = maxLeft; - } else { - i.scrollbarXLeft = newLeft; - } - - var scrollLeft = h.toInt(i.scrollbarXLeft * (i.contentWidth - i.containerWidth) / (i.containerWidth - (i.railXRatio * i.scrollbarXWidth))) - i.negativeScrollAdjustment; - updateScroll(element, 'left', scrollLeft); - } - - var mouseMoveHandler = function (e) { - updateScrollLeft(e.pageX - currentPageX); - updateGeometry(element); - e.stopPropagation(); - e.preventDefault(); - }; - - var mouseUpHandler = function () { - h.stopScrolling(element, 'x'); - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); - }; - - i.event.bind(i.scrollbarX, 'mousedown', function (e) { - currentPageX = e.pageX; - currentLeft = h.toInt(d.css(i.scrollbarX, 'left')) * i.railXRatio; - h.startScrolling(element, 'x'); - - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); - - e.stopPropagation(); - e.preventDefault(); - }); -} - -function bindMouseScrollYHandler(element, i) { - var currentTop = null; - var currentPageY = null; - - function updateScrollTop(deltaY) { - var newTop = currentTop + (deltaY * i.railYRatio); - var maxTop = i.scrollbarYRail.getBoundingClientRect().top + (i.railYRatio * (i.railYHeight - i.scrollbarYHeight)); - - if (newTop < 0) { - i.scrollbarYTop = 0; - } else if (newTop > maxTop) { - i.scrollbarYTop = maxTop; - } else { - i.scrollbarYTop = newTop; - } - - var scrollTop = h.toInt(i.scrollbarYTop * (i.contentHeight - i.containerHeight) / (i.containerHeight - (i.railYRatio * i.scrollbarYHeight))); - updateScroll(element, 'top', scrollTop); - } - - var mouseMoveHandler = function (e) { - updateScrollTop(e.pageY - currentPageY); - updateGeometry(element); - e.stopPropagation(); - e.preventDefault(); - }; - - var mouseUpHandler = function () { - h.stopScrolling(element, 'y'); - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); - }; - - i.event.bind(i.scrollbarY, 'mousedown', function (e) { - currentPageY = e.pageY; - currentTop = h.toInt(d.css(i.scrollbarY, 'top')) * i.railYRatio; - h.startScrolling(element, 'y'); - - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); - - e.stopPropagation(); - e.preventDefault(); - }); -} - -module.exports = function (element) { - var i = instances.get(element); - bindMouseScrollXHandler(element, i); - bindMouseScrollYHandler(element, i); -}; - -},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var h = require('../../lib/helper') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); - -function bindKeyboardHandler(element, i) { - var hovered = false; - i.event.bind(element, 'mouseenter', function () { - hovered = true; - }); - i.event.bind(element, 'mouseleave', function () { - hovered = false; - }); - - var shouldPrevent = false; - function shouldPreventDefault(deltaX, deltaY) { - var scrollTop = element.scrollTop; - if (deltaX === 0) { - if (!i.scrollbarYActive) { - return false; - } - if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) { - return !i.settings.wheelPropagation; - } - } - - var scrollLeft = element.scrollLeft; - if (deltaY === 0) { - if (!i.scrollbarXActive) { - return false; - } - if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) { - return !i.settings.wheelPropagation; - } - } - return true; - } - - i.event.bind(i.ownerDocument, 'keydown', function (e) { - if (e.isDefaultPrevented && e.isDefaultPrevented()) { - return; - } - - if (!hovered) { - return; - } - - var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement; - if (activeElement) { - // go deeper if element is a webcomponent - while (activeElement.shadowRoot) { - activeElement = activeElement.shadowRoot.activeElement; - } - if (h.isEditable(activeElement)) { - return; - } - } - - var deltaX = 0; - var deltaY = 0; - - switch (e.which) { - case 37: // left - deltaX = -30; - break; - case 38: // up - deltaY = 30; - break; - case 39: // right - deltaX = 30; - break; - case 40: // down - deltaY = -30; - break; - case 33: // page up - deltaY = 90; - break; - case 32: // space bar - if (e.shiftKey) { - deltaY = 90; - } else { - deltaY = -90; - } - break; - case 34: // page down - deltaY = -90; - break; - case 35: // end - if (e.ctrlKey) { - deltaY = -i.contentHeight; - } else { - deltaY = -i.containerHeight; - } - break; - case 36: // home - if (e.ctrlKey) { - deltaY = element.scrollTop; - } else { - deltaY = i.containerHeight; - } - break; - default: - return; - } - - updateScroll(element, 'top', element.scrollTop - deltaY); - updateScroll(element, 'left', element.scrollLeft + deltaX); - updateGeometry(element); - - shouldPrevent = shouldPreventDefault(deltaX, deltaY); - if (shouldPrevent) { - e.preventDefault(); - } - }); -} - -module.exports = function (element) { - var i = instances.get(element); - bindKeyboardHandler(element, i); -}; - -},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var h = require('../../lib/helper') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); - -function bindMouseWheelHandler(element, i) { - var shouldPrevent = false; - - function shouldPreventDefault(deltaX, deltaY) { - var scrollTop = element.scrollTop; - if (deltaX === 0) { - if (!i.scrollbarYActive) { - return false; - } - if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) { - return !i.settings.wheelPropagation; - } - } - - var scrollLeft = element.scrollLeft; - if (deltaY === 0) { - if (!i.scrollbarXActive) { - return false; - } - if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) { - return !i.settings.wheelPropagation; - } - } - return true; - } - - function getDeltaFromEvent(e) { - var deltaX = e.deltaX; - var deltaY = -1 * e.deltaY; - - if (typeof deltaX === "undefined" || typeof deltaY === "undefined") { - // OS X Safari - deltaX = -1 * e.wheelDeltaX / 6; - deltaY = e.wheelDeltaY / 6; - } - - if (e.deltaMode && e.deltaMode === 1) { - // Firefox in deltaMode 1: Line scrolling - deltaX *= 10; - deltaY *= 10; - } - - if (deltaX !== deltaX && deltaY !== deltaY/* NaN checks */) { - // IE in some mouse drivers - deltaX = 0; - deltaY = e.wheelDelta; - } - - return [deltaX, deltaY]; - } - - function shouldBeConsumedByTextarea(deltaX, deltaY) { - var hoveredTextarea = element.querySelector('textarea:hover'); - if (hoveredTextarea) { - var maxScrollTop = hoveredTextarea.scrollHeight - hoveredTextarea.clientHeight; - if (maxScrollTop > 0) { - if (!(hoveredTextarea.scrollTop === 0 && deltaY > 0) && - !(hoveredTextarea.scrollTop === maxScrollTop && deltaY < 0)) { - return true; - } - } - var maxScrollLeft = hoveredTextarea.scrollLeft - hoveredTextarea.clientWidth; - if (maxScrollLeft > 0) { - if (!(hoveredTextarea.scrollLeft === 0 && deltaX < 0) && - !(hoveredTextarea.scrollLeft === maxScrollLeft && deltaX > 0)) { - return true; - } - } - } - return false; - } - - function mousewheelHandler(e) { - // FIXME: this is a quick fix for the select problem in FF and IE. - // If there comes an effective way to deal with the problem, - // this lines should be removed. - if (!h.env.isWebKit && element.querySelector('select:focus')) { - return; - } - - var delta = getDeltaFromEvent(e); - - var deltaX = delta[0]; - var deltaY = delta[1]; - - if (shouldBeConsumedByTextarea(deltaX, deltaY)) { - return; - } - - shouldPrevent = false; - if (!i.settings.useBothWheelAxes) { - // deltaX will only be used for horizontal scrolling and deltaY will - // only be used for vertical scrolling - this is the default - updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed)); - updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed)); - } else if (i.scrollbarYActive && !i.scrollbarXActive) { - // only vertical scrollbar is active and useBothWheelAxes option is - // active, so let's scroll vertical bar using both mouse wheel axes - if (deltaY) { - updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed)); - } else { - updateScroll(element, 'top', element.scrollTop + (deltaX * i.settings.wheelSpeed)); - } - shouldPrevent = true; - } else if (i.scrollbarXActive && !i.scrollbarYActive) { - // useBothWheelAxes and only horizontal bar is active, so use both - // wheel axes for horizontal bar - if (deltaX) { - updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed)); - } else { - updateScroll(element, 'left', element.scrollLeft - (deltaY * i.settings.wheelSpeed)); - } - shouldPrevent = true; - } - - updateGeometry(element); - - shouldPrevent = (shouldPrevent || shouldPreventDefault(deltaX, deltaY)); - if (shouldPrevent) { - e.stopPropagation(); - e.preventDefault(); - } - } - - if (typeof window.onwheel !== "undefined") { - i.event.bind(element, 'wheel', mousewheelHandler); - } else if (typeof window.onmousewheel !== "undefined") { - i.event.bind(element, 'mousewheel', mousewheelHandler); - } -} - -module.exports = function (element) { - var i = instances.get(element); - bindMouseWheelHandler(element, i); -}; - -},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var instances = require('../instances') - , updateGeometry = require('../update-geometry'); - -function bindNativeScrollHandler(element, i) { - i.event.bind(element, 'scroll', function () { - updateGeometry(element); - }); -} - -module.exports = function (element) { - var i = instances.get(element); - bindNativeScrollHandler(element, i); -}; - -},{"../instances":18,"../update-geometry":19}],15:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var h = require('../../lib/helper') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); - -function bindSelectionHandler(element, i) { - function getRangeNode() { - var selection = window.getSelection ? window.getSelection() : - document.getSelection ? document.getSelection() : ''; - if (selection.toString().length === 0) { - return null; - } else { - return selection.getRangeAt(0).commonAncestorContainer; - } - } - - var scrollingLoop = null; - var scrollDiff = {top: 0, left: 0}; - function startScrolling() { - if (!scrollingLoop) { - scrollingLoop = setInterval(function () { - if (!instances.get(element)) { - clearInterval(scrollingLoop); - return; - } - - updateScroll(element, 'top', element.scrollTop + scrollDiff.top); - updateScroll(element, 'left', element.scrollLeft + scrollDiff.left); - updateGeometry(element); - }, 50); // every .1 sec - } - } - function stopScrolling() { - if (scrollingLoop) { - clearInterval(scrollingLoop); - scrollingLoop = null; - } - h.stopScrolling(element); - } - - var isSelected = false; - i.event.bind(i.ownerDocument, 'selectionchange', function () { - if (element.contains(getRangeNode())) { - isSelected = true; - } else { - isSelected = false; - stopScrolling(); - } - }); - i.event.bind(window, 'mouseup', function () { - if (isSelected) { - isSelected = false; - stopScrolling(); - } - }); - - i.event.bind(window, 'mousemove', function (e) { - if (isSelected) { - var mousePosition = {x: e.pageX, y: e.pageY}; - var containerGeometry = { - left: element.offsetLeft, - right: element.offsetLeft + element.offsetWidth, - top: element.offsetTop, - bottom: element.offsetTop + element.offsetHeight - }; - - if (mousePosition.x < containerGeometry.left + 3) { - scrollDiff.left = -5; - h.startScrolling(element, 'x'); - } else if (mousePosition.x > containerGeometry.right - 3) { - scrollDiff.left = 5; - h.startScrolling(element, 'x'); - } else { - scrollDiff.left = 0; - } - - if (mousePosition.y < containerGeometry.top + 3) { - if (containerGeometry.top + 3 - mousePosition.y < 5) { - scrollDiff.top = -5; - } else { - scrollDiff.top = -20; - } - h.startScrolling(element, 'y'); - } else if (mousePosition.y > containerGeometry.bottom - 3) { - if (mousePosition.y - containerGeometry.bottom + 3 < 5) { - scrollDiff.top = 5; - } else { - scrollDiff.top = 20; - } - h.startScrolling(element, 'y'); - } else { - scrollDiff.top = 0; - } - - if (scrollDiff.top === 0 && scrollDiff.left === 0) { - stopScrolling(); - } else { - startScrolling(); - } - } - }); -} - -module.exports = function (element) { - var i = instances.get(element); - bindSelectionHandler(element, i); -}; - -},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); - -function bindTouchHandler(element, i, supportsTouch, supportsIePointer) { - function shouldPreventDefault(deltaX, deltaY) { - var scrollTop = element.scrollTop; - var scrollLeft = element.scrollLeft; - var magnitudeX = Math.abs(deltaX); - var magnitudeY = Math.abs(deltaY); - - if (magnitudeY > magnitudeX) { - // user is perhaps trying to swipe up/down the page - - if (((deltaY < 0) && (scrollTop === i.contentHeight - i.containerHeight)) || - ((deltaY > 0) && (scrollTop === 0))) { - return !i.settings.swipePropagation; - } - } else if (magnitudeX > magnitudeY) { - // user is perhaps trying to swipe left/right across the page - - if (((deltaX < 0) && (scrollLeft === i.contentWidth - i.containerWidth)) || - ((deltaX > 0) && (scrollLeft === 0))) { - return !i.settings.swipePropagation; - } - } - - return true; - } - - function applyTouchMove(differenceX, differenceY) { - updateScroll(element, 'top', element.scrollTop - differenceY); - updateScroll(element, 'left', element.scrollLeft - differenceX); - - updateGeometry(element); - } - - var startOffset = {}; - var startTime = 0; - var speed = {}; - var easingLoop = null; - var inGlobalTouch = false; - var inLocalTouch = false; - - function globalTouchStart() { - inGlobalTouch = true; - } - function globalTouchEnd() { - inGlobalTouch = false; - } - - function getTouch(e) { - if (e.targetTouches) { - return e.targetTouches[0]; - } else { - // Maybe IE pointer - return e; - } - } - function shouldHandle(e) { - if (e.targetTouches && e.targetTouches.length === 1) { - return true; - } - if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) { - return true; - } - return false; - } - function touchStart(e) { - if (shouldHandle(e)) { - inLocalTouch = true; - - var touch = getTouch(e); - - startOffset.pageX = touch.pageX; - startOffset.pageY = touch.pageY; - - startTime = (new Date()).getTime(); - - if (easingLoop !== null) { - clearInterval(easingLoop); - } - - e.stopPropagation(); - } - } - function touchMove(e) { - if (!inGlobalTouch && inLocalTouch && shouldHandle(e)) { - var touch = getTouch(e); - - var currentOffset = {pageX: touch.pageX, pageY: touch.pageY}; - - var differenceX = currentOffset.pageX - startOffset.pageX; - var differenceY = currentOffset.pageY - startOffset.pageY; - - applyTouchMove(differenceX, differenceY); - startOffset = currentOffset; - - var currentTime = (new Date()).getTime(); - - var timeGap = currentTime - startTime; - if (timeGap > 0) { - speed.x = differenceX / timeGap; - speed.y = differenceY / timeGap; - startTime = currentTime; - } - - if (shouldPreventDefault(differenceX, differenceY)) { - e.stopPropagation(); - e.preventDefault(); - } - } - } - function touchEnd() { - if (!inGlobalTouch && inLocalTouch) { - inLocalTouch = false; - - clearInterval(easingLoop); - easingLoop = setInterval(function () { - if (!instances.get(element)) { - clearInterval(easingLoop); - return; - } - - if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { - clearInterval(easingLoop); - return; - } - - applyTouchMove(speed.x * 30, speed.y * 30); - - speed.x *= 0.8; - speed.y *= 0.8; - }, 10); - } - } - - if (supportsTouch) { - i.event.bind(window, 'touchstart', globalTouchStart); - i.event.bind(window, 'touchend', globalTouchEnd); - i.event.bind(element, 'touchstart', touchStart); - i.event.bind(element, 'touchmove', touchMove); - i.event.bind(element, 'touchend', touchEnd); - } - - if (supportsIePointer) { - if (window.PointerEvent) { - i.event.bind(window, 'pointerdown', globalTouchStart); - i.event.bind(window, 'pointerup', globalTouchEnd); - i.event.bind(element, 'pointerdown', touchStart); - i.event.bind(element, 'pointermove', touchMove); - i.event.bind(element, 'pointerup', touchEnd); - } else if (window.MSPointerEvent) { - i.event.bind(window, 'MSPointerDown', globalTouchStart); - i.event.bind(window, 'MSPointerUp', globalTouchEnd); - i.event.bind(element, 'MSPointerDown', touchStart); - i.event.bind(element, 'MSPointerMove', touchMove); - i.event.bind(element, 'MSPointerUp', touchEnd); - } - } -} - -module.exports = function (element, supportsTouch, supportsIePointer) { - var i = instances.get(element); - bindTouchHandler(element, i, supportsTouch, supportsIePointer); -}; - -},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var cls = require('../lib/class') - , h = require('../lib/helper') - , instances = require('./instances') - , updateGeometry = require('./update-geometry'); - -// Handlers -var clickRailHandler = require('./handler/click-rail') - , dragScrollbarHandler = require('./handler/drag-scrollbar') - , keyboardHandler = require('./handler/keyboard') - , mouseWheelHandler = require('./handler/mouse-wheel') - , nativeScrollHandler = require('./handler/native-scroll') - , selectionHandler = require('./handler/selection') - , touchHandler = require('./handler/touch'); - -module.exports = function (element, userSettings) { - userSettings = typeof userSettings === 'object' ? userSettings : {}; - - cls.add(element, 'ps-container'); - - // Create a plugin instance. - var i = instances.add(element); - - i.settings = h.extend(i.settings, userSettings); - - clickRailHandler(element); - dragScrollbarHandler(element); - mouseWheelHandler(element); - nativeScrollHandler(element); - - if (i.settings.useSelectionScroll) { - selectionHandler(element); - } - - if (h.env.supportsTouch || h.env.supportsIePointer) { - touchHandler(element, h.env.supportsTouch, h.env.supportsIePointer); - } - if (i.settings.useKeyboard) { - keyboardHandler(element); - } - - updateGeometry(element); -}; - -},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var d = require('../lib/dom') - , defaultSettings = require('./default-setting') - , EventManager = require('../lib/event-manager') - , guid = require('../lib/guid') - , h = require('../lib/helper'); - -var instances = {}; - -function Instance(element) { - var i = this; - - i.settings = h.clone(defaultSettings); - i.containerWidth = null; - i.containerHeight = null; - i.contentWidth = null; - i.contentHeight = null; - - i.isRtl = d.css(element, 'direction') === "rtl"; - i.isNegativeScroll = (function () { - var originalScrollLeft = element.scrollLeft; - var result = null; - element.scrollLeft = -1; - result = element.scrollLeft < 0; - element.scrollLeft = originalScrollLeft; - return result; - })(); - i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0; - i.event = new EventManager(); - i.ownerDocument = element.ownerDocument || document; - - i.scrollbarXRail = d.appendTo(d.e('div', 'ps-scrollbar-x-rail'), element); - i.scrollbarX = d.appendTo(d.e('div', 'ps-scrollbar-x'), i.scrollbarXRail); - i.scrollbarXActive = null; - i.scrollbarXWidth = null; - i.scrollbarXLeft = null; - i.scrollbarXBottom = h.toInt(d.css(i.scrollbarXRail, 'bottom')); - i.isScrollbarXUsingBottom = i.scrollbarXBottom === i.scrollbarXBottom; // !isNaN - i.scrollbarXTop = i.isScrollbarXUsingBottom ? null : h.toInt(d.css(i.scrollbarXRail, 'top')); - i.railBorderXWidth = h.toInt(d.css(i.scrollbarXRail, 'borderLeftWidth')) + h.toInt(d.css(i.scrollbarXRail, 'borderRightWidth')); - // Set rail to display:block to calculate margins - d.css(i.scrollbarXRail, 'display', 'block'); - i.railXMarginWidth = h.toInt(d.css(i.scrollbarXRail, 'marginLeft')) + h.toInt(d.css(i.scrollbarXRail, 'marginRight')); - d.css(i.scrollbarXRail, 'display', ''); - i.railXWidth = null; - i.railXRatio = null; - - i.scrollbarYRail = d.appendTo(d.e('div', 'ps-scrollbar-y-rail'), element); - i.scrollbarY = d.appendTo(d.e('div', 'ps-scrollbar-y'), i.scrollbarYRail); - i.scrollbarYActive = null; - i.scrollbarYHeight = null; - i.scrollbarYTop = null; - i.scrollbarYRight = h.toInt(d.css(i.scrollbarYRail, 'right')); - i.isScrollbarYUsingRight = i.scrollbarYRight === i.scrollbarYRight; // !isNaN - i.scrollbarYLeft = i.isScrollbarYUsingRight ? null : h.toInt(d.css(i.scrollbarYRail, 'left')); - i.scrollbarYOuterWidth = i.isRtl ? h.outerWidth(i.scrollbarY) : null; - i.railBorderYWidth = h.toInt(d.css(i.scrollbarYRail, 'borderTopWidth')) + h.toInt(d.css(i.scrollbarYRail, 'borderBottomWidth')); - d.css(i.scrollbarYRail, 'display', 'block'); - i.railYMarginHeight = h.toInt(d.css(i.scrollbarYRail, 'marginTop')) + h.toInt(d.css(i.scrollbarYRail, 'marginBottom')); - d.css(i.scrollbarYRail, 'display', ''); - i.railYHeight = null; - i.railYRatio = null; -} - -function getId(element) { - if (typeof element.dataset === 'undefined') { - return element.getAttribute('data-ps-id'); - } else { - return element.dataset.psId; - } -} - -function setId(element, id) { - if (typeof element.dataset === 'undefined') { - element.setAttribute('data-ps-id', id); - } else { - element.dataset.psId = id; - } -} - -function removeId(element) { - if (typeof element.dataset === 'undefined') { - element.removeAttribute('data-ps-id'); - } else { - delete element.dataset.psId; - } -} - -exports.add = function (element) { - var newId = guid(); - setId(element, newId); - instances[newId] = new Instance(element); - return instances[newId]; -}; - -exports.remove = function (element) { - delete instances[getId(element)]; - removeId(element); -}; - -exports.get = function (element) { - return instances[getId(element)]; -}; - -},{"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var cls = require('../lib/class') - , d = require('../lib/dom') - , h = require('../lib/helper') - , instances = require('./instances') - , updateScroll = require('./update-scroll'); - -function getThumbSize(i, thumbSize) { - if (i.settings.minScrollbarLength) { - thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength); - } - if (i.settings.maxScrollbarLength) { - thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength); - } - return thumbSize; -} - -function updateCss(element, i) { - var xRailOffset = {width: i.railXWidth}; - if (i.isRtl) { - xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth; - } else { - xRailOffset.left = element.scrollLeft; - } - if (i.isScrollbarXUsingBottom) { - xRailOffset.bottom = i.scrollbarXBottom - element.scrollTop; - } else { - xRailOffset.top = i.scrollbarXTop + element.scrollTop; - } - d.css(i.scrollbarXRail, xRailOffset); - - var yRailOffset = {top: element.scrollTop, height: i.railYHeight}; - if (i.isScrollbarYUsingRight) { - if (i.isRtl) { - yRailOffset.right = i.contentWidth - (i.negativeScrollAdjustment + element.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth; - } else { - yRailOffset.right = i.scrollbarYRight - element.scrollLeft; - } - } else { - if (i.isRtl) { - yRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth * 2 - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth; - } else { - yRailOffset.left = i.scrollbarYLeft + element.scrollLeft; - } - } - d.css(i.scrollbarYRail, yRailOffset); - - d.css(i.scrollbarX, {left: i.scrollbarXLeft, width: i.scrollbarXWidth - i.railBorderXWidth}); - d.css(i.scrollbarY, {top: i.scrollbarYTop, height: i.scrollbarYHeight - i.railBorderYWidth}); -} - -module.exports = function (element) { - var i = instances.get(element); - - i.containerWidth = element.clientWidth; - i.containerHeight = element.clientHeight; - i.contentWidth = element.scrollWidth; - i.contentHeight = element.scrollHeight; - - var existingRails; - if (!element.contains(i.scrollbarXRail)) { - existingRails = d.queryChildren(element, '.ps-scrollbar-x-rail'); - if (existingRails.length > 0) { - existingRails.forEach(function (rail) { - d.remove(rail); - }); - } - d.appendTo(i.scrollbarXRail, element); - } - if (!element.contains(i.scrollbarYRail)) { - existingRails = d.queryChildren(element, '.ps-scrollbar-y-rail'); - if (existingRails.length > 0) { - existingRails.forEach(function (rail) { - d.remove(rail); - }); - } - d.appendTo(i.scrollbarYRail, element); - } - - if (!i.settings.suppressScrollX && i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth) { - i.scrollbarXActive = true; - i.railXWidth = i.containerWidth - i.railXMarginWidth; - i.railXRatio = i.containerWidth / i.railXWidth; - i.scrollbarXWidth = getThumbSize(i, h.toInt(i.railXWidth * i.containerWidth / i.contentWidth)); - i.scrollbarXLeft = h.toInt((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth) / (i.contentWidth - i.containerWidth)); - } else { - i.scrollbarXActive = false; - i.scrollbarXWidth = 0; - i.scrollbarXLeft = 0; - element.scrollLeft = 0; - } - - if (!i.settings.suppressScrollY && i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight) { - i.scrollbarYActive = true; - i.railYHeight = i.containerHeight - i.railYMarginHeight; - i.railYRatio = i.containerHeight / i.railYHeight; - i.scrollbarYHeight = getThumbSize(i, h.toInt(i.railYHeight * i.containerHeight / i.contentHeight)); - i.scrollbarYTop = h.toInt(element.scrollTop * (i.railYHeight - i.scrollbarYHeight) / (i.contentHeight - i.containerHeight)); - } else { - i.scrollbarYActive = false; - i.scrollbarYHeight = 0; - i.scrollbarYTop = 0; - updateScroll(element, 'top', 0); - } - - if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) { - i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth; - } - if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) { - i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight; - } - - updateCss(element, i); - - cls[i.scrollbarXActive ? 'add' : 'remove'](element, 'ps-active-x'); - cls[i.scrollbarYActive ? 'add' : 'remove'](element, 'ps-active-y'); -}; - -},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var instances = require('./instances'); - -var upEvent = document.createEvent('Event') - , downEvent = document.createEvent('Event') - , leftEvent = document.createEvent('Event') - , rightEvent = document.createEvent('Event') - , yEvent = document.createEvent('Event') - , xEvent = document.createEvent('Event') - , xStartEvent = document.createEvent('Event') - , xEndEvent = document.createEvent('Event') - , yStartEvent = document.createEvent('Event') - , yEndEvent = document.createEvent('Event') - , lastTop - , lastLeft; - -upEvent.initEvent('ps-scroll-up', true, true); -downEvent.initEvent('ps-scroll-down', true, true); -leftEvent.initEvent('ps-scroll-left', true, true); -rightEvent.initEvent('ps-scroll-right', true, true); -yEvent.initEvent('ps-scroll-y', true, true); -xEvent.initEvent('ps-scroll-x', true, true); -xStartEvent.initEvent('ps-x-reach-start', true, true); -xEndEvent.initEvent('ps-x-reach-end', true, true); -yStartEvent.initEvent('ps-y-reach-start', true, true); -yEndEvent.initEvent('ps-y-reach-end', true, true); - -module.exports = function (element, axis, value) { - if (typeof element === 'undefined') { - throw 'You must provide an element to the update-scroll function'; - } - - if (typeof axis === 'undefined') { - throw 'You must provide an axis to the update-scroll function'; - } - - if (typeof value === 'undefined') { - throw 'You must provide a value to the update-scroll function'; - } - - if (axis === 'top' && value <= 0) { - element.scrollTop = 0; - element.dispatchEvent(yStartEvent); - return; // don't allow negative scroll - } - - if (axis === 'left' && value <= 0) { - element.scrollLeft = 0; - element.dispatchEvent(xStartEvent); - return; // don't allow negative scroll - } - - var i = instances.get(element); - - if (axis === 'top' && value > i.contentHeight - i.containerHeight) { - element.scrollTop = i.contentHeight - i.containerHeight; - element.dispatchEvent(yEndEvent); - return; // don't allow scroll past container - } - - if (axis === 'left' && value > i.contentWidth - i.containerWidth) { - element.scrollLeft = i.contentWidth - i.containerWidth; - element.dispatchEvent(xEndEvent); - return; // don't allow scroll past container - } - - if (!lastTop) { - lastTop = element.scrollTop; - } - - if (!lastLeft) { - lastLeft = element.scrollLeft; - } - - if (axis === 'top' && value < lastTop) { - element.dispatchEvent(upEvent); - } - - if (axis === 'top' && value > lastTop) { - element.dispatchEvent(downEvent); - } - - if (axis === 'left' && value < lastLeft) { - element.dispatchEvent(leftEvent); - } - - if (axis === 'left' && value > lastLeft) { - element.dispatchEvent(rightEvent); - } - - if (axis === 'top') { - element.scrollTop = lastTop = value; - element.dispatchEvent(yEvent); - } - - if (axis === 'left') { - element.scrollLeft = lastLeft = value; - element.dispatchEvent(xEvent); - } - -}; - -},{"./instances":18}],21:[function(require,module,exports){ -/* Copyright (c) 2015 Hyunje Alex Jun and other contributors - * Licensed under the MIT License - */ -'use strict'; - -var d = require('../lib/dom') - , h = require('../lib/helper') - , instances = require('./instances') - , updateGeometry = require('./update-geometry'); - -module.exports = function (element) { - var i = instances.get(element); - - if (!i) { - return; - } - - // Recalcuate negative scrollLeft adjustment - i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0; - - // Recalculate rail margins - d.css(i.scrollbarXRail, 'display', 'block'); - d.css(i.scrollbarYRail, 'display', 'block'); - i.railXMarginWidth = h.toInt(d.css(i.scrollbarXRail, 'marginLeft')) + h.toInt(d.css(i.scrollbarXRail, 'marginRight')); - i.railYMarginHeight = h.toInt(d.css(i.scrollbarYRail, 'marginTop')) + h.toInt(d.css(i.scrollbarYRail, 'marginBottom')); - - // Hide scrollbars not to affect scrollWidth and scrollHeight - d.css(i.scrollbarXRail, 'display', 'none'); - d.css(i.scrollbarYRail, 'display', 'none'); - - updateGeometry(element); - - d.css(i.scrollbarXRail, 'display', ''); - d.css(i.scrollbarYRail, 'display', ''); -}; - -},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19}]},{},[1]); diff --git a/web/static/js/perfect-scrollbar-0.6.7.jquery.min.js b/web/static/js/perfect-scrollbar-0.6.7.jquery.min.js deleted file mode 100644 index 8b0f0056c..000000000 --- a/web/static/js/perfect-scrollbar-0.6.7.jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* perfect-scrollbar v0.6.7 */ -!function t(e,n,r){function o(l,s){if(!n[l]){if(!e[l]){var a="function"==typeof require&&require;if(!s&&a)return a(l,!0);if(i)return i(l,!0);var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[l]={exports:{}};e[l][0].call(u.exports,function(t){var n=e[l][1][t];return o(n?n:t)},u,u.exports,t,e,n,r)}return n[l].exports}for(var i="function"==typeof require&&require,l=0;l=0&&n.splice(r,1),t.className=n.join(" ")}n.add=function(t,e){t.classList?t.classList.add(e):r(t,e)},n.remove=function(t,e){t.classList?t.classList.remove(e):o(t,e)},n.list=function(t){return t.classList?Array.prototype.slice.apply(t.classList):t.className.split(" ")}},{}],3:[function(t,e,n){"use strict";function r(t,e){return window.getComputedStyle(t)[e]}function o(t,e,n){return"number"==typeof n&&(n=n.toString()+"px"),t.style[e]=n,t}function i(t,e){for(var n in e){var r=e[n];"number"==typeof r&&(r=r.toString()+"px"),t.style[n]=r}return t}var l={};l.e=function(t,e){var n=document.createElement(t);return n.className=e,n},l.appendTo=function(t,e){return e.appendChild(t),t},l.css=function(t,e,n){return"object"==typeof e?i(t,e):"undefined"==typeof n?r(t,e):o(t,e,n)},l.matches=function(t,e){return"undefined"!=typeof t.matches?t.matches(e):"undefined"!=typeof t.matchesSelector?t.matchesSelector(e):"undefined"!=typeof t.webkitMatchesSelector?t.webkitMatchesSelector(e):"undefined"!=typeof t.mozMatchesSelector?t.mozMatchesSelector(e):"undefined"!=typeof t.msMatchesSelector?t.msMatchesSelector(e):void 0},l.remove=function(t){"undefined"!=typeof t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)},l.queryChildren=function(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return l.matches(t,e)})},e.exports=l},{}],4:[function(t,e,n){"use strict";var r=function(t){this.element=t,this.events={}};r.prototype.bind=function(t,e){"undefined"==typeof this.events[t]&&(this.events[t]=[]),this.events[t].push(e),this.element.addEventListener(t,e,!1)},r.prototype.unbind=function(t,e){var n="undefined"!=typeof e;this.events[t]=this.events[t].filter(function(r){return n&&r!==e?!0:(this.element.removeEventListener(t,r,!1),!1)},this)},r.prototype.unbindAll=function(){for(var t in this.events)this.unbind(t)};var o=function(){this.eventElements=[]};o.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return"undefined"==typeof e&&(e=new r(t),this.eventElements.push(e)),e},o.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},o.prototype.unbind=function(t,e,n){this.eventElement(t).unbind(e,n)},o.prototype.unbindAll=function(){for(var t=0;tu?u=0:u>1&&(u=1),s(t,"top",(e.contentHeight-e.containerHeight)*u),l(t),r.stopPropagation()}),e.settings.stopPropagationOnClick&&e.event.bind(e.scrollbarY,"click",function(t){t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"click",function(r){var i=o.toInt(e.scrollbarXWidth/2),a=e.railXRatio*(r.pageX-window.scrollX-n(e.scrollbarXRail).left-i),c=e.railXRatio*(e.railXWidth-e.scrollbarXWidth),u=a/c;0>u?u=0:u>1&&(u=1),s(t,"left",(e.contentWidth-e.containerWidth)*u-e.negativeScrollAdjustment),l(t),r.stopPropagation()})}var o=t("../../lib/helper"),i=t("../instances"),l=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=i.get(t);r(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(t,e,n){"use strict";function r(t,e){function n(n){var o=r+n*e.railXRatio,i=e.scrollbarXRail.getBoundingClientRect().left+e.railXRatio*(e.railXWidth-e.scrollbarXWidth);0>o?e.scrollbarXLeft=0:o>i?e.scrollbarXLeft=i:e.scrollbarXLeft=o;var s=l.toInt(e.scrollbarXLeft*(e.contentWidth-e.containerWidth)/(e.containerWidth-e.railXRatio*e.scrollbarXWidth))-e.negativeScrollAdjustment;c(t,"left",s)}var r=null,o=null,s=function(e){n(e.pageX-o),a(t),e.stopPropagation(),e.preventDefault()},u=function(){l.stopScrolling(t,"x"),e.event.unbind(e.ownerDocument,"mousemove",s)};e.event.bind(e.scrollbarX,"mousedown",function(n){o=n.pageX,r=l.toInt(i.css(e.scrollbarX,"left"))*e.railXRatio,l.startScrolling(t,"x"),e.event.bind(e.ownerDocument,"mousemove",s),e.event.once(e.ownerDocument,"mouseup",u),n.stopPropagation(),n.preventDefault()})}function o(t,e){function n(n){var o=r+n*e.railYRatio,i=e.scrollbarYRail.getBoundingClientRect().top+e.railYRatio*(e.railYHeight-e.scrollbarYHeight);0>o?e.scrollbarYTop=0:o>i?e.scrollbarYTop=i:e.scrollbarYTop=o;var s=l.toInt(e.scrollbarYTop*(e.contentHeight-e.containerHeight)/(e.containerHeight-e.railYRatio*e.scrollbarYHeight));c(t,"top",s)}var r=null,o=null,s=function(e){n(e.pageY-o),a(t),e.stopPropagation(),e.preventDefault()},u=function(){l.stopScrolling(t,"y"),e.event.unbind(e.ownerDocument,"mousemove",s)};e.event.bind(e.scrollbarY,"mousedown",function(n){o=n.pageY,r=l.toInt(i.css(e.scrollbarY,"top"))*e.railYRatio,l.startScrolling(t,"y"),e.event.bind(e.ownerDocument,"mousemove",s),e.event.once(e.ownerDocument,"mouseup",u),n.stopPropagation(),n.preventDefault()})}var i=t("../../lib/dom"),l=t("../../lib/helper"),s=t("../instances"),a=t("../update-geometry"),c=t("../update-scroll");e.exports=function(t){var e=s.get(t);r(t,e),o(t,e)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(t,e,n){"use strict";function r(t,e){function n(n,r){var o=t.scrollTop;if(0===n){if(!e.scrollbarYActive)return!1;if(0===o&&r>0||o>=e.contentHeight-e.containerHeight&&0>r)return!e.settings.wheelPropagation}var i=t.scrollLeft;if(0===r){if(!e.scrollbarXActive)return!1;if(0===i&&0>n||i>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}var r=!1;e.event.bind(t,"mouseenter",function(){r=!0}),e.event.bind(t,"mouseleave",function(){r=!1});var i=!1;e.event.bind(e.ownerDocument,"keydown",function(a){if((!a.isDefaultPrevented||!a.isDefaultPrevented())&&r){var c=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(c){for(;c.shadowRoot;)c=c.shadowRoot.activeElement;if(o.isEditable(c))return}var u=0,d=0;switch(a.which){case 37:u=-30;break;case 38:d=30;break;case 39:u=30;break;case 40:d=-30;break;case 33:d=90;break;case 32:d=a.shiftKey?90:-90;break;case 34:d=-90;break;case 35:d=a.ctrlKey?-e.contentHeight:-e.containerHeight;break;case 36:d=a.ctrlKey?t.scrollTop:e.containerHeight;break;default:return}s(t,"top",t.scrollTop-d),s(t,"left",t.scrollLeft+u),l(t),i=n(u,d),i&&a.preventDefault()}})}var o=t("../../lib/helper"),i=t("../instances"),l=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=i.get(t);r(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(t,e,n){"use strict";function r(t,e){function n(n,r){var o=t.scrollTop;if(0===n){if(!e.scrollbarYActive)return!1;if(0===o&&r>0||o>=e.contentHeight-e.containerHeight&&0>r)return!e.settings.wheelPropagation}var i=t.scrollLeft;if(0===r){if(!e.scrollbarXActive)return!1;if(0===i&&0>n||i>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}function r(t){var e=t.deltaX,n=-1*t.deltaY;return("undefined"==typeof e||"undefined"==typeof n)&&(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!==e&&n!==n&&(e=0,n=t.wheelDelta),[e,n]}function i(e,n){var r=t.querySelector("textarea:hover");if(r){var o=r.scrollHeight-r.clientHeight;if(o>0&&!(0===r.scrollTop&&n>0||r.scrollTop===o&&0>n))return!0;var i=r.scrollLeft-r.clientWidth;if(i>0&&!(0===r.scrollLeft&&0>e||r.scrollLeft===i&&e>0))return!0}return!1}function a(a){if(o.env.isWebKit||!t.querySelector("select:focus")){var u=r(a),d=u[0],p=u[1];i(d,p)||(c=!1,e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(p?s(t,"top",t.scrollTop-p*e.settings.wheelSpeed):s(t,"top",t.scrollTop+d*e.settings.wheelSpeed),c=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(d?s(t,"left",t.scrollLeft+d*e.settings.wheelSpeed):s(t,"left",t.scrollLeft-p*e.settings.wheelSpeed),c=!0):(s(t,"top",t.scrollTop-p*e.settings.wheelSpeed),s(t,"left",t.scrollLeft+d*e.settings.wheelSpeed)),l(t),c=c||n(d,p),c&&(a.stopPropagation(),a.preventDefault()))}}var c=!1;"undefined"!=typeof window.onwheel?e.event.bind(t,"wheel",a):"undefined"!=typeof window.onmousewheel&&e.event.bind(t,"mousewheel",a)}var o=t("../../lib/helper"),i=t("../instances"),l=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=i.get(t);r(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(t,e,n){"use strict";function r(t,e){e.event.bind(t,"scroll",function(){i(t)})}var o=t("../instances"),i=t("../update-geometry");e.exports=function(t){var e=o.get(t);r(t,e)}},{"../instances":18,"../update-geometry":19}],15:[function(t,e,n){"use strict";function r(t,e){function n(){var t=window.getSelection?window.getSelection():document.getSelection?document.getSelection():"";return 0===t.toString().length?null:t.getRangeAt(0).commonAncestorContainer}function r(){c||(c=setInterval(function(){return i.get(t)?(s(t,"top",t.scrollTop+u.top),s(t,"left",t.scrollLeft+u.left),void l(t)):void clearInterval(c)},50))}function a(){c&&(clearInterval(c),c=null),o.stopScrolling(t)}var c=null,u={top:0,left:0},d=!1;e.event.bind(e.ownerDocument,"selectionchange",function(){t.contains(n())?d=!0:(d=!1,a())}),e.event.bind(window,"mouseup",function(){d&&(d=!1,a())}),e.event.bind(window,"mousemove",function(e){if(d){var n={x:e.pageX,y:e.pageY},i={left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight};n.xi.right-3?(u.left=5,o.startScrolling(t,"x")):u.left=0,n.yi.bottom-3?(n.y-i.bottom+3<5?u.top=5:u.top=20,o.startScrolling(t,"y")):u.top=0,0===u.top&&0===u.left?a():r()}})}var o=t("../../lib/helper"),i=t("../instances"),l=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=i.get(t);r(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(t,e,n){"use strict";function r(t,e,n,r){function s(n,r){var o=t.scrollTop,i=t.scrollLeft,l=Math.abs(n),s=Math.abs(r);if(s>l){if(0>r&&o===e.contentHeight-e.containerHeight||r>0&&0===o)return!e.settings.swipePropagation}else if(l>s&&(0>n&&i===e.contentWidth-e.containerWidth||n>0&&0===i))return!e.settings.swipePropagation;return!0}function a(e,n){l(t,"top",t.scrollTop-n),l(t,"left",t.scrollLeft-e),i(t)}function c(){Y=!0}function u(){Y=!1}function d(t){return t.targetTouches?t.targetTouches[0]:t}function p(t){return t.targetTouches&&1===t.targetTouches.length?!0:t.pointerType&&"mouse"!==t.pointerType&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE?!0:!1}function f(t){if(p(t)){w=!0;var e=d(t);b.pageX=e.pageX,b.pageY=e.pageY,g=(new Date).getTime(),null!==y&&clearInterval(y),t.stopPropagation()}}function h(t){if(!Y&&w&&p(t)){var e=d(t),n={pageX:e.pageX,pageY:e.pageY},r=n.pageX-b.pageX,o=n.pageY-b.pageY;a(r,o),b=n;var i=(new Date).getTime(),l=i-g;l>0&&(m.x=r/l,m.y=o/l,g=i),s(r,o)&&(t.stopPropagation(),t.preventDefault())}}function v(){!Y&&w&&(w=!1,clearInterval(y),y=setInterval(function(){return o.get(t)?Math.abs(m.x)<.01&&Math.abs(m.y)<.01?void clearInterval(y):(a(30*m.x,30*m.y),m.x*=.8,void(m.y*=.8)):void clearInterval(y)},10))}var b={},g=0,m={},y=null,Y=!1,w=!1;n&&(e.event.bind(window,"touchstart",c),e.event.bind(window,"touchend",u),e.event.bind(t,"touchstart",f),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",v)),r&&(window.PointerEvent?(e.event.bind(window,"pointerdown",c),e.event.bind(window,"pointerup",u),e.event.bind(t,"pointerdown",f),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",v)):window.MSPointerEvent&&(e.event.bind(window,"MSPointerDown",c),e.event.bind(window,"MSPointerUp",u),e.event.bind(t,"MSPointerDown",f),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",v)))}var o=t("../instances"),i=t("../update-geometry"),l=t("../update-scroll");e.exports=function(t,e,n){var i=o.get(t);r(t,i,e,n)}},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(t,e,n){"use strict";var r=t("../lib/class"),o=t("../lib/helper"),i=t("./instances"),l=t("./update-geometry"),s=t("./handler/click-rail"),a=t("./handler/drag-scrollbar"),c=t("./handler/keyboard"),u=t("./handler/mouse-wheel"),d=t("./handler/native-scroll"),p=t("./handler/selection"),f=t("./handler/touch");e.exports=function(t,e){e="object"==typeof e?e:{},r.add(t,"ps-container");var n=i.add(t);n.settings=o.extend(n.settings,e),s(t),a(t),u(t),d(t),n.settings.useSelectionScroll&&p(t),(o.env.supportsTouch||o.env.supportsIePointer)&&f(t,o.env.supportsTouch,o.env.supportsIePointer),n.settings.useKeyboard&&c(t),l(t)}},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(t,e,n){"use strict";function r(t){var e=this;e.settings=d.clone(a),e.containerWidth=null,e.containerHeight=null,e.contentWidth=null,e.contentHeight=null,e.isRtl="rtl"===s.css(t,"direction"),e.isNegativeScroll=function(){var e=t.scrollLeft,n=null;return t.scrollLeft=-1,n=t.scrollLeft<0,t.scrollLeft=e,n}(),e.negativeScrollAdjustment=e.isNegativeScroll?t.scrollWidth-t.clientWidth:0,e.event=new c,e.ownerDocument=t.ownerDocument||document,e.scrollbarXRail=s.appendTo(s.e("div","ps-scrollbar-x-rail"),t),e.scrollbarX=s.appendTo(s.e("div","ps-scrollbar-x"),e.scrollbarXRail),e.scrollbarXActive=null,e.scrollbarXWidth=null,e.scrollbarXLeft=null,e.scrollbarXBottom=d.toInt(s.css(e.scrollbarXRail,"bottom")),e.isScrollbarXUsingBottom=e.scrollbarXBottom===e.scrollbarXBottom,e.scrollbarXTop=e.isScrollbarXUsingBottom?null:d.toInt(s.css(e.scrollbarXRail,"top")),e.railBorderXWidth=d.toInt(s.css(e.scrollbarXRail,"borderLeftWidth"))+d.toInt(s.css(e.scrollbarXRail,"borderRightWidth")),s.css(e.scrollbarXRail,"display","block"),e.railXMarginWidth=d.toInt(s.css(e.scrollbarXRail,"marginLeft"))+d.toInt(s.css(e.scrollbarXRail,"marginRight")),s.css(e.scrollbarXRail,"display",""),e.railXWidth=null,e.railXRatio=null,e.scrollbarYRail=s.appendTo(s.e("div","ps-scrollbar-y-rail"),t),e.scrollbarY=s.appendTo(s.e("div","ps-scrollbar-y"),e.scrollbarYRail),e.scrollbarYActive=null,e.scrollbarYHeight=null,e.scrollbarYTop=null,e.scrollbarYRight=d.toInt(s.css(e.scrollbarYRail,"right")),e.isScrollbarYUsingRight=e.scrollbarYRight===e.scrollbarYRight,e.scrollbarYLeft=e.isScrollbarYUsingRight?null:d.toInt(s.css(e.scrollbarYRail,"left")),e.scrollbarYOuterWidth=e.isRtl?d.outerWidth(e.scrollbarY):null,e.railBorderYWidth=d.toInt(s.css(e.scrollbarYRail,"borderTopWidth"))+d.toInt(s.css(e.scrollbarYRail,"borderBottomWidth")),s.css(e.scrollbarYRail,"display","block"),e.railYMarginHeight=d.toInt(s.css(e.scrollbarYRail,"marginTop"))+d.toInt(s.css(e.scrollbarYRail,"marginBottom")),s.css(e.scrollbarYRail,"display",""),e.railYHeight=null,e.railYRatio=null}function o(t){return"undefined"==typeof t.dataset?t.getAttribute("data-ps-id"):t.dataset.psId}function i(t,e){"undefined"==typeof t.dataset?t.setAttribute("data-ps-id",e):t.dataset.psId=e}function l(t){"undefined"==typeof t.dataset?t.removeAttribute("data-ps-id"):delete t.dataset.psId}var s=t("../lib/dom"),a=t("./default-setting"),c=t("../lib/event-manager"),u=t("../lib/guid"),d=t("../lib/helper"),p={};n.add=function(t){var e=u();return i(t,e),p[e]=new r(t),p[e]},n.remove=function(t){delete p[o(t)],l(t)},n.get=function(t){return p[o(t)]}},{"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(t,e,n){"use strict";function r(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function o(t,e){var n={width:e.railXWidth};e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft,e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-t.scrollTop:n.top=e.scrollbarXTop+t.scrollTop,l.css(e.scrollbarXRail,n);var r={top:t.scrollTop,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?r.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth:r.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?r.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:r.left=e.scrollbarYLeft+t.scrollLeft,l.css(e.scrollbarYRail,r),l.css(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),l.css(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}var i=t("../lib/class"),l=t("../lib/dom"),s=t("../lib/helper"),a=t("./instances"),c=t("./update-scroll");e.exports=function(t){var e=a.get(t);e.containerWidth=t.clientWidth,e.containerHeight=t.clientHeight,e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight;var n;t.contains(e.scrollbarXRail)||(n=l.queryChildren(t,".ps-scrollbar-x-rail"),n.length>0&&n.forEach(function(t){l.remove(t)}),l.appendTo(e.scrollbarXRail,t)),t.contains(e.scrollbarYRail)||(n=l.queryChildren(t,".ps-scrollbar-y-rail"),n.length>0&&n.forEach(function(t){l.remove(t)}),l.appendTo(e.scrollbarYRail,t)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),o(t,e),i[e.scrollbarXActive?"add":"remove"](t,"ps-active-x"),i[e.scrollbarYActive?"add":"remove"](t,"ps-active-y")}},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(t,e,n){"use strict";var r,o,i=t("./instances"),l=document.createEvent("Event"),s=document.createEvent("Event"),a=document.createEvent("Event"),c=document.createEvent("Event"),u=document.createEvent("Event"),d=document.createEvent("Event"),p=document.createEvent("Event"),f=document.createEvent("Event"),h=document.createEvent("Event"),v=document.createEvent("Event");l.initEvent("ps-scroll-up",!0,!0),s.initEvent("ps-scroll-down",!0,!0),a.initEvent("ps-scroll-left",!0,!0),c.initEvent("ps-scroll-right",!0,!0),u.initEvent("ps-scroll-y",!0,!0),d.initEvent("ps-scroll-x",!0,!0),p.initEvent("ps-x-reach-start",!0,!0),f.initEvent("ps-x-reach-end",!0,!0),h.initEvent("ps-y-reach-start",!0,!0),v.initEvent("ps-y-reach-end",!0,!0),e.exports=function(t,e,n){if("undefined"==typeof t)throw"You must provide an element to the update-scroll function";if("undefined"==typeof e)throw"You must provide an axis to the update-scroll function";if("undefined"==typeof n)throw"You must provide a value to the update-scroll function";if("top"===e&&0>=n)return t.scrollTop=0,void t.dispatchEvent(h);if("left"===e&&0>=n)return t.scrollLeft=0,void t.dispatchEvent(p);var b=i.get(t);return"top"===e&&n>b.contentHeight-b.containerHeight?(t.scrollTop=b.contentHeight-b.containerHeight,void t.dispatchEvent(v)):"left"===e&&n>b.contentWidth-b.containerWidth?(t.scrollLeft=b.contentWidth-b.containerWidth,void t.dispatchEvent(f)):(r||(r=t.scrollTop),o||(o=t.scrollLeft),"top"===e&&r>n&&t.dispatchEvent(l),"top"===e&&n>r&&t.dispatchEvent(s),"left"===e&&o>n&&t.dispatchEvent(a),"left"===e&&n>o&&t.dispatchEvent(c),"top"===e&&(t.scrollTop=r=n,t.dispatchEvent(u)),void("left"===e&&(t.scrollLeft=o=n,t.dispatchEvent(d))))}},{"./instances":18}],21:[function(t,e,n){"use strict";var r=t("../lib/dom"),o=t("../lib/helper"),i=t("./instances"),l=t("./update-geometry");e.exports=function(t){var e=i.get(t);e&&(e.negativeScrollAdjustment=e.isNegativeScroll?t.scrollWidth-t.clientWidth:0,r.css(e.scrollbarXRail,"display","block"),r.css(e.scrollbarYRail,"display","block"),e.railXMarginWidth=o.toInt(r.css(e.scrollbarXRail,"marginLeft"))+o.toInt(r.css(e.scrollbarXRail,"marginRight")),e.railYMarginHeight=o.toInt(r.css(e.scrollbarYRail,"marginTop"))+o.toInt(r.css(e.scrollbarYRail,"marginBottom")),r.css(e.scrollbarXRail,"display","none"),r.css(e.scrollbarYRail,"display","none"),l(t),r.css(e.scrollbarXRail,"display",""),r.css(e.scrollbarYRail,"display",""))}},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19}]},{},[1]); \ No newline at end of file -- cgit v1.2.3-1-g7c22