mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-10 21:24:20 +01:00
1 line
28 KiB
Plaintext
1 line
28 KiB
Plaintext
{"version":3,"sources":["module.js","helpers.js","request-animation.js","spy-api.js","scroll-container-api.js","smooth-scroll.js","spy-context.js","scroll-container.js","scrollspy.js"],"names":["duScrollDefaultEasing","x","Math","pow","angular","module","value","run","$window","$q","cancelAnimation","requestAnimation","duScrollEasing","duScrollDuration","duScrollOffset","proto","isDocument","el","HTMLDocument","nodeType","DOCUMENT_NODE","isElement","HTMLElement","ELEMENT_NODE","unwrap","duScrollTo","left","top","duration","aliasFn","this","duScrollToElement","isDefined","duScrollToAnimated","apply","arguments","scrollTo","scrollLeft","scrollTop","scrollAnimation","deferred","easing","startLeft","duScrollLeft","startTop","duScrollTop","deltaLeft","round","deltaTop","startTime","progress","cancelOnEvents","cancelScrollAnimation","$event","which","unbind","reject","defer","resolve","promise","animationStep","timestamp","percent","ceil","bind","target","offset","isNumber","isNaN","getBoundingClientRect","scrollX","document","documentElement","body","scrollY","duScrollToElementAnimated","duScrollTopAnimated","duScrollLeftAnimated","forEach","fn","key","element","prototype","unprefixed","replace","isUndefined","factory","vendors","fnName","fallback","suffix","substr","toUpperCase","i","length","polyfill","$timeout","lastTime","callback","currTime","Date","getTime","timeToCall","max","id","cancel","$rootScope","$document","scrollContainerAPI","duScrollGreedy","duScrollSpyWait","createScrollHandler","context","timer","queued","handler","bottomReached","container","containerEl","containerOffset","clientHeight","scrollHeight","pageYOffset","innerHeight","currentlyActive","toBeActive","spies","spy","pos","compareProperty","undefined","getTargetPosition","height","$element","removeClass","$broadcast","addClass","contexts","createContext","$scope","$id","$on","destroyContext","off","defaultContextId","getContextForScope","scope","$parent","getContextForSpy","contextId","indexOf","isElementInDocument","parentNode","addSpy","push","getContainer","on","triggerHandler","removeSpy","splice","containers","setContainer","getContainerId","removeContainer","directive","link","$attr","e","href","getElementById","substring","stopPropagation","preventDefault","parseInt","spyAPI","restrict","compile","pre","iElement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A+D,KACA,GAAA","file":"angular-scroll.min.js","sourcesContent":["/**\n * x is a value between 0 and 1, indicating where in the animation you are.\n */\nvar duScrollDefaultEasing = function (x) {\n 'use strict';\n\n if(x < 0.5) {\n return Math.pow(x*2, 2)/2;\n }\n return 1-Math.pow((1-x)*2, 2)/2;\n};\n\nangular.module('duScroll', [\n 'duScroll.scrollspy',\n 'duScroll.smoothScroll',\n 'duScroll.scrollContainer',\n 'duScroll.spyContext',\n 'duScroll.scrollHelpers'\n])\n //Default animation duration for smoothScroll directive\n .value('duScrollDuration', 350)\n //Scrollspy debounce interval, set to 0 to disable\n .value('duScrollSpyWait', 100)\n //Wether or not multiple scrollspies can be active at once\n .value('duScrollGreedy', false)\n //Default offset for smoothScroll directive\n .value('duScrollOffset', 0)\n //Default easing function for scroll animation\n .value('duScrollEasing', duScrollDefaultEasing);\n","angular.module('duScroll.scrollHelpers', ['duScroll.requestAnimation'])\n.run(function($window, $q, cancelAnimation, requestAnimation, duScrollEasing, duScrollDuration, duScrollOffset) {\n 'use strict';\n\n var proto = {};\n\n var isDocument = function(el) {\n return (typeof HTMLDocument !== 'undefined' && el instanceof HTMLDocument) || (el.nodeType && el.nodeType === el.DOCUMENT_NODE);\n };\n\n var isElement = function(el) {\n return (typeof HTMLElement !== 'undefined' && el instanceof HTMLElement) || (el.nodeType && el.nodeType === el.ELEMENT_NODE);\n };\n\n var unwrap = function(el) {\n return isElement(el) || isDocument(el) ? el : el[0];\n };\n\n proto.duScrollTo = function(left, top, duration, easing) {\n var aliasFn;\n if(angular.isElement(left)) {\n aliasFn = this.duScrollToElement;\n } else if(angular.isDefined(duration)) {\n aliasFn = this.duScrollToAnimated;\n }\n if(aliasFn) {\n return aliasFn.apply(this, arguments);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollTo(left, top);\n }\n el.scrollLeft = left;\n el.scrollTop = top;\n };\n\n var scrollAnimation, deferred;\n proto.duScrollToAnimated = function(left, top, duration, easing) {\n if(duration && !easing) {\n easing = duScrollEasing;\n }\n var startLeft = this.duScrollLeft(),\n startTop = this.duScrollTop(),\n deltaLeft = Math.round(left - startLeft),\n deltaTop = Math.round(top - startTop);\n\n var startTime = null, progress = 0;\n var el = this;\n\n var cancelOnEvents = 'scroll mousedown mousewheel touchmove keydown';\n var cancelScrollAnimation = function($event) {\n if (!$event || (progress && $event.which > 0)) {\n el.unbind(cancelOnEvents, cancelScrollAnimation);\n cancelAnimation(scrollAnimation);\n deferred.reject();\n scrollAnimation = null;\n }\n };\n\n if(scrollAnimation) {\n cancelScrollAnimation();\n }\n deferred = $q.defer();\n\n if(duration === 0 || (!deltaLeft && !deltaTop)) {\n if(duration === 0) {\n el.duScrollTo(left, top);\n }\n deferred.resolve();\n return deferred.promise;\n }\n\n var animationStep = function(timestamp) {\n if (startTime === null) {\n startTime = timestamp;\n }\n\n progress = timestamp - startTime;\n var percent = (progress >= duration ? 1 : easing(progress/duration));\n\n el.scrollTo(\n startLeft + Math.ceil(deltaLeft * percent),\n startTop + Math.ceil(deltaTop * percent)\n );\n if(percent < 1) {\n scrollAnimation = requestAnimation(animationStep);\n } else {\n el.unbind(cancelOnEvents, cancelScrollAnimation);\n scrollAnimation = null;\n deferred.resolve();\n }\n };\n\n //Fix random mobile safari bug when scrolling to top by hitting status bar\n el.duScrollTo(startLeft, startTop);\n\n el.bind(cancelOnEvents, cancelScrollAnimation);\n\n scrollAnimation = requestAnimation(animationStep);\n return deferred.promise;\n };\n\n proto.duScrollToElement = function(target, offset, duration, easing) {\n var el = unwrap(this);\n if(!angular.isNumber(offset) || isNaN(offset)) {\n offset = duScrollOffset;\n }\n var top = this.duScrollTop() + unwrap(target).getBoundingClientRect().top - offset;\n if(isElement(el)) {\n top -= el.getBoundingClientRect().top;\n }\n return this.duScrollTo(0, top, duration, easing);\n };\n\n proto.duScrollLeft = function(value, duration, easing) {\n if(angular.isNumber(value)) {\n return this.duScrollTo(value, this.duScrollTop(), duration, easing);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;\n }\n return el.scrollLeft;\n };\n proto.duScrollTop = function(value, duration, easing) {\n if(angular.isNumber(value)) {\n return this.duScrollTo(this.duScrollLeft(), value, duration, easing);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;\n }\n return el.scrollTop;\n };\n\n proto.duScrollToElementAnimated = function(target, offset, duration, easing) {\n return this.duScrollToElement(target, offset, duration || duScrollDuration, easing);\n };\n\n proto.duScrollTopAnimated = function(top, duration, easing) {\n return this.duScrollTop(top, duration || duScrollDuration, easing);\n };\n\n proto.duScrollLeftAnimated = function(left, duration, easing) {\n return this.duScrollLeft(left, duration || duScrollDuration, easing);\n };\n\n angular.forEach(proto, function(fn, key) {\n angular.element.prototype[key] = fn;\n\n //Remove prefix if not already claimed by jQuery / ui.utils\n var unprefixed = key.replace(/^duScroll/, 'scroll');\n if(angular.isUndefined(angular.element.prototype[unprefixed])) {\n angular.element.prototype[unprefixed] = fn;\n }\n });\n\n});\n","//Adapted from https://gist.github.com/paulirish/1579671\nangular.module('duScroll.polyfill', [])\n.factory('polyfill', function($window) {\n 'use strict';\n\n var vendors = ['webkit', 'moz', 'o', 'ms'];\n\n return function(fnName, fallback) {\n if($window[fnName]) {\n return $window[fnName];\n }\n var suffix = fnName.substr(0, 1).toUpperCase() + fnName.substr(1);\n for(var key, i = 0; i < vendors.length; i++) {\n key = vendors[i]+suffix;\n if($window[key]) {\n return $window[key];\n }\n }\n return fallback;\n };\n});\n\nangular.module('duScroll.requestAnimation', ['duScroll.polyfill'])\n.factory('requestAnimation', function(polyfill, $timeout) {\n 'use strict';\n\n var lastTime = 0;\n var fallback = function(callback, element) {\n var currTime = new Date().getTime();\n var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n var id = $timeout(function() { callback(currTime + timeToCall); },\n timeToCall);\n lastTime = currTime + timeToCall;\n return id;\n };\n\n return polyfill('requestAnimationFrame', fallback);\n})\n.factory('cancelAnimation', function(polyfill, $timeout) {\n 'use strict';\n\n var fallback = function(promise) {\n $timeout.cancel(promise);\n };\n\n return polyfill('cancelAnimationFrame', fallback);\n});\n","angular.module('duScroll.spyAPI', ['duScroll.scrollContainerAPI'])\n.factory('spyAPI', function($rootScope, $timeout, $window, $document, scrollContainerAPI, duScrollGreedy, duScrollSpyWait) {\n 'use strict';\n\n var createScrollHandler = function(context) {\n var timer = false, queued = false;\n var handler = function() {\n queued = false;\n var container = context.container,\n containerEl = container[0],\n containerOffset = 0,\n bottomReached;\n\n if (typeof HTMLElement !== 'undefined' && containerEl instanceof HTMLElement || containerEl.nodeType && containerEl.nodeType === containerEl.ELEMENT_NODE) {\n containerOffset = containerEl.getBoundingClientRect().top;\n bottomReached = Math.round(containerEl.scrollTop + containerEl.clientHeight) >= containerEl.scrollHeight;\n } else {\n bottomReached = Math.round($window.pageYOffset + $window.innerHeight) >= $document[0].body.scrollHeight;\n }\n var compareProperty = (bottomReached ? 'bottom' : 'top');\n\n var i, currentlyActive, toBeActive, spies, spy, pos;\n spies = context.spies;\n currentlyActive = context.currentlyActive;\n toBeActive = undefined;\n\n for(i = 0; i < spies.length; i++) {\n spy = spies[i];\n pos = spy.getTargetPosition();\n if (!pos) continue;\n\n if(bottomReached || (pos.top + spy.offset - containerOffset < 20 && (duScrollGreedy || pos.top*-1 + containerOffset) < pos.height)) {\n //Find the one closest the viewport top or the page bottom if it's reached\n if(!toBeActive || toBeActive[compareProperty] < pos[compareProperty]) {\n toBeActive = {\n spy: spy\n };\n toBeActive[compareProperty] = pos[compareProperty];\n }\n }\n }\n\n if(toBeActive) {\n toBeActive = toBeActive.spy;\n }\n if(currentlyActive === toBeActive || (duScrollGreedy && !toBeActive)) return;\n if(currentlyActive) {\n currentlyActive.$element.removeClass('active');\n $rootScope.$broadcast('duScrollspy:becameInactive', currentlyActive.$element);\n }\n if(toBeActive) {\n toBeActive.$element.addClass('active');\n $rootScope.$broadcast('duScrollspy:becameActive', toBeActive.$element);\n }\n context.currentlyActive = toBeActive;\n };\n\n if(!duScrollSpyWait) {\n return handler;\n }\n\n //Debounce for potential performance savings\n return function() {\n if(!timer) {\n handler();\n timer = $timeout(function() {\n timer = false;\n if(queued) {\n handler();\n }\n }, duScrollSpyWait, false);\n } else {\n queued = true;\n }\n };\n };\n\n var contexts = {};\n\n var createContext = function($scope) {\n var id = $scope.$id;\n var context = {\n spies: []\n };\n\n context.handler = createScrollHandler(context);\n contexts[id] = context;\n\n $scope.$on('$destroy', function() {\n destroyContext($scope);\n });\n\n return id;\n };\n\n var destroyContext = function($scope) {\n var id = $scope.$id;\n var context = contexts[id], container = context.container;\n if(container) {\n container.off('scroll', context.handler);\n }\n delete contexts[id];\n };\n\n var defaultContextId = createContext($rootScope);\n\n var getContextForScope = function(scope) {\n if(contexts[scope.$id]) {\n return contexts[scope.$id];\n }\n if(scope.$parent) {\n return getContextForScope(scope.$parent);\n }\n return contexts[defaultContextId];\n };\n\n var getContextForSpy = function(spy) {\n var context, contextId, scope = spy.$scope;\n if(scope) {\n return getContextForScope(scope);\n }\n //No scope, most likely destroyed\n for(contextId in contexts) {\n context = contexts[contextId];\n if(context.spies.indexOf(spy) !== -1) {\n return context;\n }\n }\n };\n\n var isElementInDocument = function(element) {\n while (element.parentNode) {\n element = element.parentNode;\n if (element === document) {\n return true;\n }\n }\n return false;\n };\n\n var addSpy = function(spy) {\n var context = getContextForSpy(spy);\n if (!context) return;\n context.spies.push(spy);\n if (!context.container || !isElementInDocument(context.container)) {\n if(context.container) {\n context.container.off('scroll', context.handler);\n }\n context.container = scrollContainerAPI.getContainer(spy.$scope);\n context.container.on('scroll', context.handler).triggerHandler('scroll');\n }\n };\n\n var removeSpy = function(spy) {\n var context = getContextForSpy(spy);\n if(spy === context.currentlyActive) {\n context.currentlyActive = null;\n }\n var i = context.spies.indexOf(spy);\n if(i !== -1) {\n context.spies.splice(i, 1);\n }\n\t\tspy.$element = null;\n };\n\n return {\n addSpy: addSpy,\n removeSpy: removeSpy,\n createContext: createContext,\n destroyContext: destroyContext,\n getContextForScope: getContextForScope\n };\n});\n","angular.module('duScroll.scrollContainerAPI', [])\n.factory('scrollContainerAPI', function($document) {\n 'use strict';\n\n var containers = {};\n\n var setContainer = function(scope, element) {\n var id = scope.$id;\n containers[id] = element;\n return id;\n };\n\n var getContainerId = function(scope) {\n if(containers[scope.$id]) {\n return scope.$id;\n }\n if(scope.$parent) {\n return getContainerId(scope.$parent);\n }\n return;\n };\n\n var getContainer = function(scope) {\n var id = getContainerId(scope);\n return id ? containers[id] : $document;\n };\n\n var removeContainer = function(scope) {\n var id = getContainerId(scope);\n if(id) {\n delete containers[id];\n }\n };\n\n return {\n getContainerId: getContainerId,\n getContainer: getContainer,\n setContainer: setContainer,\n removeContainer: removeContainer\n };\n});\n","angular.module('duScroll.smoothScroll', ['duScroll.scrollHelpers', 'duScroll.scrollContainerAPI'])\n.directive('duSmoothScroll', function(duScrollDuration, duScrollOffset, scrollContainerAPI) {\n 'use strict';\n\n return {\n link : function($scope, $element, $attr) {\n $element.on('click', function(e) {\n if(!$attr.href || $attr.href.indexOf('#') === -1) return;\n\n var target = document.getElementById($attr.href.replace(/.*(?=#[^\\s]+$)/, '').substring(1));\n if(!target || !target.getBoundingClientRect) return;\n\n if (e.stopPropagation) e.stopPropagation();\n if (e.preventDefault) e.preventDefault();\n\n var offset = $attr.offset ? parseInt($attr.offset, 10) : duScrollOffset;\n var duration = $attr.duration ? parseInt($attr.duration, 10) : duScrollDuration;\n var container = scrollContainerAPI.getContainer($scope);\n\n container.duScrollToElement(\n angular.element(target),\n isNaN(offset) ? 0 : offset,\n isNaN(duration) ? 0 : duration\n );\n });\n }\n };\n});\n","angular.module('duScroll.spyContext', ['duScroll.spyAPI'])\n.directive('duSpyContext', function(spyAPI) {\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function compile(tElement, tAttrs, transclude) {\n return {\n pre: function preLink($scope, iElement, iAttrs, controller) {\n spyAPI.createContext($scope);\n }\n };\n }\n };\n});\n","angular.module('duScroll.scrollContainer', ['duScroll.scrollContainerAPI'])\n.directive('duScrollContainer', function(scrollContainerAPI){\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function compile(tElement, tAttrs, transclude) {\n return {\n pre: function preLink($scope, iElement, iAttrs, controller) {\n iAttrs.$observe('duScrollContainer', function(element) {\n if(angular.isString(element)) {\n element = document.getElementById(element);\n }\n\n element = (angular.isElement(element) ? angular.element(element) : iElement);\n scrollContainerAPI.setContainer($scope, element);\n $scope.$on('$destroy', function() {\n scrollContainerAPI.removeContainer($scope);\n });\n });\n }\n };\n }\n };\n});\n","angular.module('duScroll.scrollspy', ['duScroll.spyAPI'])\n.directive('duScrollspy', function(spyAPI, duScrollOffset, $timeout, $rootScope) {\n 'use strict';\n\n var Spy = function(targetElementOrId, $scope, $element, offset) {\n if(angular.isElement(targetElementOrId)) {\n this.target = targetElementOrId;\n } else if(angular.isString(targetElementOrId)) {\n this.targetId = targetElementOrId;\n }\n this.$scope = $scope;\n this.$element = $element;\n this.offset = offset;\n };\n\n Spy.prototype.getTargetElement = function() {\n if (!this.target && this.targetId) {\n this.target = document.getElementById(this.targetId);\n }\n return this.target;\n };\n\n Spy.prototype.getTargetPosition = function() {\n var target = this.getTargetElement();\n if(target) {\n return target.getBoundingClientRect();\n }\n };\n\n Spy.prototype.flushTargetCache = function() {\n if(this.targetId) {\n this.target = undefined;\n }\n };\n\n return {\n link: function ($scope, $element, $attr) {\n var href = $attr.ngHref || $attr.href;\n var targetId;\n\n if (href && href.indexOf('#') !== -1) {\n targetId = href.replace(/.*(?=#[^\\s]+$)/, '').substring(1);\n } else if($attr.duScrollspy) {\n targetId = $attr.duScrollspy;\n }\n if(!targetId) return;\n\n // Run this in the next execution loop so that the scroll context has a chance\n // to initialize\n $timeout(function() {\n var spy = new Spy(targetId, $scope, $element, -($attr.offset ? parseInt($attr.offset, 10) : duScrollOffset));\n spyAPI.addSpy(spy);\n\n $scope.$on('$destroy', function() {\n spyAPI.removeSpy(spy);\n });\n $scope.$on('$locationChangeSuccess', spy.flushTargetCache.bind(spy));\n $rootScope.$on('$stateChangeSuccess', spy.flushTargetCache.bind(spy));\n }, 0, false);\n }\n };\n});\n"],"sourceRoot":"/source/"} |