{"version":3,"sources":["visibility.js"],"names":["$","window","document","undefined","Math","self","Function","fn","visibility","parameters","returnedValue","$allModules","this","moduleSelector","selector","time","Date","getTime","performance","query","arguments","methodInvoked","queryArguments","slice","call","moduleCount","length","loadedCount","each","$placeholder","contextObserver","observer","module","settings","isPlainObject","extend","className","namespace","error","metadata","eventNamespace","moduleNamespace","$window","$module","$context","context","instance","data","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","callback","setTimeout","element","disabled","initialize","debug","setup","cache","should","trackChanges","type","image","fixed","observeChanges","bind","events","save","position","is","visible","initialCheck","checkVisibility","instantiate","destroy","verbose","disconnect","off","event","load","resize","scroll","scrollchange","resetFixed","remove","placeholder","removeData","MutationObserver","contextChanged","changed","observe","childList","subtree","refreshOnLoad","on","mutations","timer","refresh","forEach","mutation","removedNodes","node","find","refreshOnResize","throttle","clearTimeout","triggerHandler","scrollTop","scrollPosition","precache","images","Array","imagesLength","loadedCounter","cacheImage","createElement","handleLoad","isFunction","onload","onerror","src","push","enableCallbacks","disableCallbacks","occurred","screen","once","onOnScreen","set","onAllLoaded","onLoad","transition","create","onTopPassed","show","duration","onTopPassedReverse","hide","clone","css","addClass","insertAfter","top","offset","left","zIndex","onFixed","attr","fadeIn","onScreen","calculations","get","elementCalculations","offScreen","width","reset","checkOnRefresh","onRefresh","passed","passingReverse","topVisibleReverse","bottomVisibleReverse","topPassedReverse","bottomPassedReverse","passing","topVisible","bottomVisible","topPassed","bottomPassed","onUpdate","amount","newCallback","onPassed","pixelsPassed","execute","callbackName","onOffScreen","onPassing","onTopVisible","onBottomVisible","onBottomPassed","onPassingReverse","onTopVisibleReverse","onBottomVisibleReverse","onBottomPassedReverse","screenCalculations","continuous","removeClass","onUnfixed","direction","lastScroll","elementPosition","screenSize","fits","height","outerWidth","outerHeight","includeMargin","margin","parseInt","bottom","percentagePassed","search","setting","name","value","internal","silent","log","prototype","console","info","apply","message","currentTime","executionTime","previousTime","Name","Arguments","Element","Execution Time","display","title","totalTime","index","group","table","groupCollapsed","groupEnd","invoke","passedArguments","maxDepth","found","response","object","split","depth","camelCaseValue","charAt","toUpperCase","method","isArray","jQuery"],"mappings":";;;;;;;;;CAUC,SAAWA,EAAGC,EAAQC,EAAUC,GAEjC,YAEAF,GAA2B,mBAAVA,IAAyBA,EAAOG,MAAQA,KACrDH,EACgB,mBAARI,OAAuBA,KAAKD,MAAQA,KAC1CC,KACAC,SAAS,iBAGfN,EAAEO,GAAGC,WAAa,SAASC,GACzB,GAUEC,GATAC,EAAiBX,EAAEY,MACnBC,EAAiBF,EAAYG,UAAY,GAEzCC,GAAiB,GAAIC,OAAOC,UAC5BC,KAEAC,EAAiBC,UAAU,GAC3BC,EAAkC,gBAATF,GACzBG,KAAoBC,MAAMC,KAAKJ,UAAW,GAG1CK,EAAiBd,EAAYe,OAC7BC,EAAiB,CAsnCnB,OAnnCAhB,GACGiB,KAAK,WACJ,GAkBEC,GAcAC,EACAC,EACAC,EAjCAC,EAAoBjC,EAAEkC,cAAczB,GAChCT,EAAEmC,QAAO,KAAUnC,EAAEO,GAAGC,WAAWyB,SAAUxB,GAC7CT,EAAEmC,UAAWnC,EAAEO,GAAGC,WAAWyB,UAEjCG,EAAkBH,EAASG,UAC3BC,EAAkBJ,EAASI,UAC3BC,EAAkBL,EAASK,MAC3BC,EAAkBN,EAASM,SAE3BC,EAAkB,IAAMH,EACxBI,EAAkB,UAAYJ,EAE9BK,EAAkB1C,EAAEC,GAEpB0C,EAAkB3C,EAAEY,MACpBgC,EAAkB5C,EAAEiC,EAASY,SAK7BC,GADkBH,EAAQ7B,UAAY,GACpB6B,EAAQI,KAAKN,IAE/BO,EAAwB/C,EAAO+C,uBAC1B/C,EAAOgD,0BACPhD,EAAOiD,6BACPjD,EAAOkD,yBACP,SAASC,GAAYC,WAAWD,EAAU,IAE/CE,EAAkB1C,KAClB2C,GAAkB,CAOpBvB,IAEEwB,WAAY,WACVxB,EAAOyB,MAAM,eAAgBxB,GA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AASsB,KAAKmF,eACdvH,EAAOsM,OAAOnN,KAGX2B,IAAa3C,GACd2C,EAASwL,OAAO,WAElBtM,EAAOwB,gBAKL9C,IAAkBP,EACtBO,EACAE,MAINZ,EAAEO,GAAGC,WAAWyB,UAEd4K,KAAyB,aACzBxK,UAAyB,aAEzBoB,OAAyB,EACzBmB,SAAyB,EACzB1D,aAAyB,EAGzB+C,gBAAyB,EAGzBO,cAAyB,EAGzBsB,eAAyB,EAGzBU,iBAAyB,EAGzBqD,gBAAyB,EAGzB9B,MAAyB,EAGzB4D,YAAyB,EAGzB3C,OAAyB,EAGzBsD,eAAyB,EAGzBzJ,QAAyB5C,EAGzBwG,UAAyB,EAGzB3C,MAAyB,EAGzBoF,OAAyB,KAGzBd,WAAyB,UACzBI,SAAyB,IAGzBqC,YAGA7C,YAAyB,EACzBiD,aAAyB,EACzBC,WAAyB,EACzBC,cAAyB,EACzBC,iBAAyB,EACzB9C,aAAyB,EACzB+C,gBAAyB,EAGzBC,kBAAyB,EACzBC,qBAAyB,EACzBC,wBAAyB,EACzB/C,oBAAyB,EACzBgD,uBAAyB,EAGzBtD,OAAyB,aACzBD,YAAyB,aAGzBiB,QAAyB,aACzB0C,UAAyB,aAGzBnB,UAAyB,EACzBZ,UAAyB,aAEzBvH,UACEkF,IAAK,OAGPrF,WACE4B,MAAc,QACdsB,YAAc,eAGhBhD,OACE2M,OAAU,wCACV1K,QAAU,4EAKV4K,OAAQlP,OAAQC","file":"visibility.min.js","sourcesContent":["/*!\n * # Semantic UI 2.2.6 - Visibility\n * http://github.com/semantic-org/semantic-ui/\n *\n *\n * Released under the MIT license\n * http://opensource.org/licenses/MIT\n *\n */\n\n;(function ($, window, document, undefined) {\n\n\"use strict\";\n\nwindow = (typeof window != 'undefined' && window.Math == Math)\n ? window\n : (typeof self != 'undefined' && self.Math == Math)\n ? self\n : Function('return this')()\n;\n\n$.fn.visibility = function(parameters) {\n var\n $allModules = $(this),\n moduleSelector = $allModules.selector || '',\n\n time = new Date().getTime(),\n performance = [],\n\n query = arguments[0],\n methodInvoked = (typeof query == 'string'),\n queryArguments = [].slice.call(arguments, 1),\n returnedValue,\n\n moduleCount = $allModules.length,\n loadedCount = 0\n ;\n\n $allModules\n .each(function() {\n var\n settings = ( $.isPlainObject(parameters) )\n ? $.extend(true, {}, $.fn.visibility.settings, parameters)\n : $.extend({}, $.fn.visibility.settings),\n\n className = settings.className,\n namespace = settings.namespace,\n error = settings.error,\n metadata = settings.metadata,\n\n eventNamespace = '.' + namespace,\n moduleNamespace = 'module-' + namespace,\n\n $window = $(window),\n\n $module = $(this),\n $context = $(settings.context),\n\n $placeholder,\n\n selector = $module.selector || '',\n instance = $module.data(moduleNamespace),\n\n requestAnimationFrame = window.requestAnimationFrame\n || window.mozRequestAnimationFrame\n || window.webkitRequestAnimationFrame\n || window.msRequestAnimationFrame\n || function(callback) { setTimeout(callback, 0); },\n\n element = this,\n disabled = false,\n\n contextObserver,\n observer,\n module\n ;\n\n module = {\n\n initialize: function() {\n module.debug('Initializing', settings);\n\n module.setup.cache();\n\n if( module.should.trackChanges() ) {\n\n if(settings.type == 'image') {\n module.setup.image();\n }\n if(settings.type == 'fixed') {\n module.setup.fixed();\n }\n\n if(settings.observeChanges) {\n module.observeChanges();\n }\n module.bind.events();\n }\n\n module.save.position();\n if( !module.is.visible() ) {\n module.error(error.visible, $module);\n }\n\n if(settings.initialCheck) {\n module.checkVisibility();\n }\n module.instantiate();\n },\n\n instantiate: function() {\n module.debug('Storing instance', module);\n $module\n .data(moduleNamespace, module)\n ;\n instance = module;\n },\n\n destroy: function() {\n module.verbose('Destroying previous module');\n if(observer) {\n observer.disconnect();\n }\n if(contextObserver) {\n contextObserver.disconnect();\n }\n $window\n .off('load' + eventNamespace, module.event.load)\n .off('resize' + eventNamespace, module.event.resize)\n ;\n $context\n .off('scroll' + eventNamespace, module.event.scroll)\n .off('scrollchange' + eventNamespace, module.event.scrollchange)\n ;\n if(settings.type == 'fixed') {\n module.resetFixed();\n module.remove.placeholder();\n }\n $module\n .off(eventNamespace)\n .removeData(moduleNamespace)\n ;\n },\n\n observeChanges: function() {\n if('MutationObserver' in window) {\n contextObserver = new MutationObserver(module.event.contextChanged);\n observer = new MutationObserver(module.event.changed);\n contextObserver.observe(document, {\n childList : true,\n subtree : true\n });\n observer.observe(element, {\n childList : true,\n subtree : true\n });\n module.debug('Setting up mutation observer', observer);\n }\n },\n\n bind: {\n events: function() {\n module.verbose('Binding visibility events to scroll and resize');\n if(settings.refreshOnLoad) {\n $window\n .on('load' + eventNamespace, module.event.load)\n ;\n }\n $window\n .on('resize' + eventNamespace, module.event.resize)\n ;\n // pub/sub pattern\n $context\n .off('scroll' + eventNamespace)\n .on('scroll' + eventNamespace, module.event.scroll)\n .on('scrollchange' + eventNamespace, module.event.scrollchange)\n ;\n }\n },\n\n event: {\n changed: function(mutations) {\n module.verbose('DOM tree modified, updating visibility calculations');\n module.timer = setTimeout(function() {\n module.verbose('DOM tree modified, updating sticky menu');\n module.refresh();\n }, 100);\n },\n contextChanged: function(mutations) {\n [].forEach.call(mutations, function(mutation) {\n if(mutation.removedNodes) {\n [].forEach.call(mutation.removedNodes, function(node) {\n if(node == element || $(node).find(element).length > 0) {\n module.debug('Element removed from DOM, tearing down events');\n module.destroy();\n }\n });\n }\n });\n },\n resize: function() {\n module.debug('Window resized');\n if(settings.refreshOnResize) {\n requestAnimationFrame(module.refresh);\n }\n },\n load: function() {\n module.debug('Page finished loading');\n requestAnimationFrame(module.refresh);\n },\n // publishes scrollchange event on one scroll\n scroll: function() {\n if(settings.throttle) {\n clearTimeout(module.timer);\n module.timer = setTimeout(function() {\n $context.triggerHandler('scrollchange' + eventNamespace, [ $context.scrollTop() ]);\n }, settings.throttle);\n }\n else {\n requestAnimationFrame(function() {\n $context.triggerHandler('scrollchange' + eventNamespace, [ $context.scrollTop() ]);\n });\n }\n },\n // subscribes to scrollchange\n scrollchange: function(event, scrollPosition) {\n module.checkVisibility(scrollPosition);\n },\n },\n\n precache: function(images, callback) {\n if (!(images instanceof Array)) {\n images = [images];\n }\n var\n imagesLength = images.length,\n loadedCounter = 0,\n cache = [],\n cacheImage = document.createElement('img'),\n handleLoad = function() {\n loadedCounter++;\n if (loadedCounter >= images.length) {\n if ($.isFunction(callback)) {\n callback();\n }\n }\n }\n ;\n while (imagesLength--) {\n cacheImage = document.createElement('img');\n cacheImage.onload = handleLoad;\n cacheImage.onerror = handleLoad;\n cacheImage.src = images[imagesLength];\n cache.push(cacheImage);\n }\n },\n\n enableCallbacks: function() {\n module.debug('Allowing callbacks to occur');\n disabled = false;\n },\n\n disableCallbacks: function() {\n module.debug('Disabling all callbacks temporarily');\n disabled = true;\n },\n\n should: {\n trackChanges: function() {\n if(methodInvoked) {\n module.debug('One time query, no need to bind events');\n return false;\n }\n module.debug('Callbacks being attached');\n return true;\n }\n },\n\n setup: {\n cache: function() {\n module.cache = {\n occurred : {},\n screen : {},\n element : {},\n };\n },\n image: function() {\n var\n src = $module.data(metadata.src)\n ;\n if(src) {\n module.verbose('Lazy loading image', src);\n settings.once = true;\n settings.observeChanges = false;\n\n // show when top visible\n settings.onOnScreen = function() {\n module.debug('Image on screen', element);\n module.precache(src, function() {\n module.set.image(src, function() {\n loadedCount++;\n if(loadedCount == moduleCount) {\n settings.onAllLoaded.call(this);\n }\n settings.onLoad.call(this);\n });\n });\n };\n }\n },\n fixed: function() {\n module.debug('Setting up fixed');\n settings.once = false;\n settings.observeChanges = false;\n settings.initialCheck = true;\n settings.refreshOnLoad = true;\n if(!parameters.transition) {\n settings.transition = false;\n }\n module.create.placeholder();\n module.debug('Added placeholder', $placeholder);\n settings.onTopPassed = function() {\n module.debug('Element passed, adding fixed position', $module);\n module.show.placeholder();\n module.set.fixed();\n if(settings.transition) {\n if($.fn.transition !== undefined) {\n $module.transition(settings.transition, settings.duration);\n }\n }\n };\n settings.onTopPassedReverse = function() {\n module.debug('Element returned to position, removing fixed', $module);\n module.hide.placeholder();\n module.remove.fixed();\n };\n }\n },\n\n create: {\n placeholder: function() {\n module.verbose('Creating fixed position placeholder');\n $placeholder = $module\n .clone(false)\n .css('display', 'none')\n .addClass(className.placeholder)\n .insertAfter($module)\n ;\n }\n },\n\n show: {\n placeholder: function() {\n module.verbose('Showing placeholder');\n $placeholder\n .css('display', 'block')\n .css('visibility', 'hidden')\n ;\n }\n },\n hide: {\n placeholder: function() {\n module.verbose('Hiding placeholder');\n $placeholder\n .css('display', 'none')\n .css('visibility', '')\n ;\n }\n },\n\n set: {\n fixed: function() {\n module.verbose('Setting element to fixed position');\n $module\n .addClass(className.fixed)\n .css({\n position : 'fixed',\n top : settings.offset + 'px',\n left : 'auto',\n zIndex : settings.zIndex\n })\n ;\n settings.onFixed.call(element);\n },\n image: function(src, callback) {\n $module\n .attr('src', src)\n ;\n if(settings.transition) {\n if( $.fn.transition !== undefined ) {\n $module.transition(settings.transition, settings.duration, callback);\n }\n else {\n $module.fadeIn(settings.duration, callback);\n }\n }\n else {\n $module.show();\n }\n }\n },\n\n is: {\n onScreen: function() {\n var\n calculations = module.get.elementCalculations()\n ;\n return calculations.onScreen;\n },\n offScreen: function() {\n var\n calculations = module.get.elementCalculations()\n ;\n return calculations.offScreen;\n },\n visible: function() {\n if(module.cache && module.cache.element) {\n return !(module.cache.element.width === 0 && module.cache.element.offset.top === 0);\n }\n return false;\n }\n },\n\n refresh: function() {\n module.debug('Refreshing constants (width/height)');\n if(settings.type == 'fixed') {\n module.resetFixed();\n }\n module.reset();\n module.save.position();\n if(settings.checkOnRefresh) {\n module.checkVisibility();\n }\n settings.onRefresh.call(element);\n },\n\n resetFixed: function () {\n module.remove.fixed();\n module.remove.occurred();\n },\n\n reset: function() {\n module.verbose('Resetting all cached values');\n if( $.isPlainObject(module.cache) ) {\n module.cache.screen = {};\n module.cache.element = {};\n }\n },\n\n checkVisibility: function(scroll) {\n module.verbose('Checking visibility of element', module.cache.element);\n\n if( !disabled && module.is.visible() ) {\n\n // save scroll position\n module.save.scroll(scroll);\n\n // update calculations derived from scroll\n module.save.calculations();\n\n // percentage\n module.passed();\n\n // reverse (must be first)\n module.passingReverse();\n module.topVisibleReverse();\n module.bottomVisibleReverse();\n module.topPassedReverse();\n module.bottomPassedReverse();\n\n // one time\n module.onScreen();\n module.offScreen();\n module.passing();\n module.topVisible();\n module.bottomVisible();\n module.topPassed();\n module.bottomPassed();\n\n // on update callback\n if(settings.onUpdate) {\n settings.onUpdate.call(element, module.get.elementCalculations());\n }\n }\n },\n\n passed: function(amount, newCallback) {\n var\n calculations = module.get.elementCalculations(),\n amountInPixels\n ;\n // assign callback\n if(amount && newCallback) {\n settings.onPassed[amount] = newCallback;\n }\n else if(amount !== undefined) {\n return (module.get.pixelsPassed(amount) > calculations.pixelsPassed);\n }\n else if(calculations.passing) {\n $.each(settings.onPassed, function(amount, callback) {\n if(calculations.bottomVisible || calculations.pixelsPassed > module.get.pixelsPassed(amount)) {\n module.execute(callback, amount);\n }\n else if(!settings.once) {\n module.remove.occurred(callback);\n }\n });\n }\n },\n\n onScreen: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onOnScreen,\n callbackName = 'onScreen'\n ;\n if(newCallback) {\n module.debug('Adding callback for onScreen', newCallback);\n settings.onOnScreen = newCallback;\n }\n if(calculations.onScreen) {\n module.execute(callback, callbackName);\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback !== undefined) {\n return calculations.onOnScreen;\n }\n },\n\n offScreen: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onOffScreen,\n callbackName = 'offScreen'\n ;\n if(newCallback) {\n module.debug('Adding callback for offScreen', newCallback);\n settings.onOffScreen = newCallback;\n }\n if(calculations.offScreen) {\n module.execute(callback, callbackName);\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback !== undefined) {\n return calculations.onOffScreen;\n }\n },\n\n passing: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onPassing,\n callbackName = 'passing'\n ;\n if(newCallback) {\n module.debug('Adding callback for passing', newCallback);\n settings.onPassing = newCallback;\n }\n if(calculations.passing) {\n module.execute(callback, callbackName);\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback !== undefined) {\n return calculations.passing;\n }\n },\n\n\n topVisible: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onTopVisible,\n callbackName = 'topVisible'\n ;\n if(newCallback) {\n module.debug('Adding callback for top visible', newCallback);\n settings.onTopVisible = newCallback;\n }\n if(calculations.topVisible) {\n module.execute(callback, callbackName);\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback === undefined) {\n return calculations.topVisible;\n }\n },\n\n bottomVisible: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onBottomVisible,\n callbackName = 'bottomVisible'\n ;\n if(newCallback) {\n module.debug('Adding callback for bottom visible', newCallback);\n settings.onBottomVisible = newCallback;\n }\n if(calculations.bottomVisible) {\n module.execute(callback, callbackName);\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback === undefined) {\n return calculations.bottomVisible;\n }\n },\n\n topPassed: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onTopPassed,\n callbackName = 'topPassed'\n ;\n if(newCallback) {\n module.debug('Adding callback for top passed', newCallback);\n settings.onTopPassed = newCallback;\n }\n if(calculations.topPassed) {\n module.execute(callback, callbackName);\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback === undefined) {\n return calculations.topPassed;\n }\n },\n\n bottomPassed: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onBottomPassed,\n callbackName = 'bottomPassed'\n ;\n if(newCallback) {\n module.debug('Adding callback for bottom passed', newCallback);\n settings.onBottomPassed = newCallback;\n }\n if(calculations.bottomPassed) {\n module.execute(callback, callbackName);\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback === undefined) {\n return calculations.bottomPassed;\n }\n },\n\n passingReverse: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onPassingReverse,\n callbackName = 'passingReverse'\n ;\n if(newCallback) {\n module.debug('Adding callback for passing reverse', newCallback);\n settings.onPassingReverse = newCallback;\n }\n if(!calculations.passing) {\n if(module.get.occurred('passing')) {\n module.execute(callback, callbackName);\n }\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback !== undefined) {\n return !calculations.passing;\n }\n },\n\n\n topVisibleReverse: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onTopVisibleReverse,\n callbackName = 'topVisibleReverse'\n ;\n if(newCallback) {\n module.debug('Adding callback for top visible reverse', newCallback);\n settings.onTopVisibleReverse = newCallback;\n }\n if(!calculations.topVisible) {\n if(module.get.occurred('topVisible')) {\n module.execute(callback, callbackName);\n }\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback === undefined) {\n return !calculations.topVisible;\n }\n },\n\n bottomVisibleReverse: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onBottomVisibleReverse,\n callbackName = 'bottomVisibleReverse'\n ;\n if(newCallback) {\n module.debug('Adding callback for bottom visible reverse', newCallback);\n settings.onBottomVisibleReverse = newCallback;\n }\n if(!calculations.bottomVisible) {\n if(module.get.occurred('bottomVisible')) {\n module.execute(callback, callbackName);\n }\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback === undefined) {\n return !calculations.bottomVisible;\n }\n },\n\n topPassedReverse: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onTopPassedReverse,\n callbackName = 'topPassedReverse'\n ;\n if(newCallback) {\n module.debug('Adding callback for top passed reverse', newCallback);\n settings.onTopPassedReverse = newCallback;\n }\n if(!calculations.topPassed) {\n if(module.get.occurred('topPassed')) {\n module.execute(callback, callbackName);\n }\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback === undefined) {\n return !calculations.onTopPassed;\n }\n },\n\n bottomPassedReverse: function(newCallback) {\n var\n calculations = module.get.elementCalculations(),\n callback = newCallback || settings.onBottomPassedReverse,\n callbackName = 'bottomPassedReverse'\n ;\n if(newCallback) {\n module.debug('Adding callback for bottom passed reverse', newCallback);\n settings.onBottomPassedReverse = newCallback;\n }\n if(!calculations.bottomPassed) {\n if(module.get.occurred('bottomPassed')) {\n module.execute(callback, callbackName);\n }\n }\n else if(!settings.once) {\n module.remove.occurred(callbackName);\n }\n if(newCallback === undefined) {\n return !calculations.bottomPassed;\n }\n },\n\n execute: function(callback, callbackName) {\n var\n calculations = module.get.elementCalculations(),\n screen = module.get.screenCalculations()\n ;\n callback = callback || false;\n if(callback) {\n if(settings.continuous) {\n module.debug('Callback being called continuously', callbackName, calculations);\n callback.call(element, calculations, screen);\n }\n else if(!module.get.occurred(callbackName)) {\n module.debug('Conditions met', callbackName, calculations);\n callback.call(element, calculations, screen);\n }\n }\n module.save.occurred(callbackName);\n },\n\n remove: {\n fixed: function() {\n module.debug('Removing fixed position');\n $module\n .removeClass(className.fixed)\n .css({\n position : '',\n top : '',\n left : '',\n zIndex : ''\n })\n ;\n settings.onUnfixed.call(element);\n },\n placeholder: function() {\n module.debug('Removing placeholder content');\n if($placeholder) {\n $placeholder.remove();\n }\n },\n occurred: function(callback) {\n if(callback) {\n var\n occurred = module.cache.occurred\n ;\n if(occurred[callback] !== undefined && occurred[callback] === true) {\n module.debug('Callback can now be called again', callback);\n module.cache.occurred[callback] = false;\n }\n }\n else {\n module.cache.occurred = {};\n }\n }\n },\n\n save: {\n calculations: function() {\n module.verbose('Saving all calculations necessary to determine positioning');\n module.save.direction();\n module.save.screenCalculations();\n module.save.elementCalculations();\n },\n occurred: function(callback) {\n if(callback) {\n if(module.cache.occurred[callback] === undefined || (module.cache.occurred[callback] !== true)) {\n module.verbose('Saving callback occurred', callback);\n module.cache.occurred[callback] = true;\n }\n }\n },\n scroll: function(scrollPosition) {\n scrollPosition = scrollPosition + settings.offset || $context.scrollTop() + settings.offset;\n module.cache.scroll = scrollPosition;\n },\n direction: function() {\n var\n scroll = module.get.scroll(),\n lastScroll = module.get.lastScroll(),\n direction\n ;\n if(scroll > lastScroll && lastScroll) {\n direction = 'down';\n }\n else if(scroll < lastScroll && lastScroll) {\n direction = 'up';\n }\n else {\n direction = 'static';\n }\n module.cache.direction = direction;\n return module.cache.direction;\n },\n elementPosition: function() {\n var\n element = module.cache.element,\n screen = module.get.screenSize()\n ;\n module.verbose('Saving element position');\n // (quicker than $.extend)\n element.fits = (element.height < screen.height);\n element.offset = $module.offset();\n element.width = $module.outerWidth();\n element.height = $module.outerHeight();\n // store\n module.cache.element = element;\n return element;\n },\n elementCalculations: function() {\n var\n screen = module.get.screenCalculations(),\n element = module.get.elementPosition()\n ;\n // offset\n if(settings.includeMargin) {\n element.margin = {};\n element.margin.top = parseInt($module.css('margin-top'), 10);\n element.margin.bottom = parseInt($module.css('margin-bottom'), 10);\n element.top = element.offset.top - element.margin.top;\n element.bottom = element.offset.top + element.height + element.margin.bottom;\n }\n else {\n element.top = element.offset.top;\n element.bottom = element.offset.top + element.height;\n }\n\n // visibility\n element.topVisible = (screen.bottom >= element.top);\n element.topPassed = (screen.top >= element.top);\n element.bottomVisible = (screen.bottom >= element.bottom);\n element.bottomPassed = (screen.top >= element.bottom);\n element.pixelsPassed = 0;\n element.percentagePassed = 0;\n\n // meta calculations\n element.onScreen = (element.topVisible && !element.bottomPassed);\n element.passing = (element.topPassed && !element.bottomPassed);\n element.offScreen = (!element.onScreen);\n\n // passing calculations\n if(element.passing) {\n element.pixelsPassed = (screen.top - element.top);\n element.percentagePassed = (screen.top - element.top) / element.height;\n }\n module.cache.element = element;\n module.verbose('Updated element calculations', element);\n return element;\n },\n screenCalculations: function() {\n var\n scroll = module.get.scroll()\n ;\n module.save.direction();\n module.cache.screen.top = scroll;\n module.cache.screen.bottom = scroll + module.cache.screen.height;\n return module.cache.screen;\n },\n screenSize: function() {\n module.verbose('Saving window position');\n module.cache.screen = {\n height: $context.height()\n };\n },\n position: function() {\n module.save.screenSize();\n module.save.elementPosition();\n }\n },\n\n get: {\n pixelsPassed: function(amount) {\n var\n element = module.get.elementCalculations()\n ;\n if(amount.search('%') > -1) {\n return ( element.height * (parseInt(amount, 10) / 100) );\n }\n return parseInt(amount, 10);\n },\n occurred: function(callback) {\n return (module.cache.occurred !== undefined)\n ? module.cache.occurred[callback] || false\n : false\n ;\n },\n direction: function() {\n if(module.cache.direction === undefined) {\n module.save.direction();\n }\n return module.cache.direction;\n },\n elementPosition: function() {\n if(module.cache.element === undefined) {\n module.save.elementPosition();\n }\n return module.cache.element;\n },\n elementCalculations: function() {\n if(module.cache.element === undefined) {\n module.save.elementCalculations();\n }\n return module.cache.element;\n },\n screenCalculations: function() {\n if(module.cache.screen === undefined) {\n module.save.screenCalculations();\n }\n return module.cache.screen;\n },\n screenSize: function() {\n if(module.cache.screen === undefined) {\n module.save.screenSize();\n }\n return module.cache.screen;\n },\n scroll: function() {\n if(module.cache.scroll === undefined) {\n module.save.scroll();\n }\n return module.cache.scroll;\n },\n lastScroll: function() {\n if(module.cache.screen === undefined) {\n module.debug('First scroll event, no last scroll could be found');\n return false;\n }\n return module.cache.screen.top;\n }\n },\n\n setting: function(name, value) {\n if( $.isPlainObject(name) ) {\n $.extend(true, settings, name);\n }\n else if(value !== undefined) {\n settings[name] = value;\n }\n else {\n return settings[name];\n }\n },\n internal: function(name, value) {\n if( $.isPlainObject(name) ) {\n $.extend(true, module, name);\n }\n else if(value !== undefined) {\n module[name] = value;\n }\n else {\n return module[name];\n }\n },\n debug: function() {\n if(!settings.silent && settings.debug) {\n if(settings.performance) {\n module.performance.log(arguments);\n }\n else {\n module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');\n module.debug.apply(console, arguments);\n }\n }\n },\n verbose: function() {\n if(!settings.silent && settings.verbose && settings.debug) {\n if(settings.performance) {\n module.performance.log(arguments);\n }\n else {\n module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');\n module.verbose.apply(console, arguments);\n }\n }\n },\n error: function() {\n if(!settings.silent) {\n module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');\n module.error.apply(console, arguments);\n }\n },\n performance: {\n log: function(message) {\n var\n currentTime,\n executionTime,\n previousTime\n ;\n if(settings.performance) {\n currentTime = new Date().getTime();\n previousTime = time || currentTime;\n executionTime = currentTime - previousTime;\n time = currentTime;\n performance.push({\n 'Name' : message[0],\n 'Arguments' : [].slice.call(message, 1) || '',\n 'Element' : element,\n 'Execution Time' : executionTime\n });\n }\n clearTimeout(module.performance.timer);\n module.performance.timer = setTimeout(module.performance.display, 500);\n },\n display: function() {\n var\n title = settings.name + ':',\n totalTime = 0\n ;\n time = false;\n clearTimeout(module.performance.timer);\n $.each(performance, function(index, data) {\n totalTime += data['Execution Time'];\n });\n title += ' ' + totalTime + 'ms';\n if(moduleSelector) {\n title += ' \\'' + moduleSelector + '\\'';\n }\n if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {\n console.groupCollapsed(title);\n if(console.table) {\n console.table(performance);\n }\n else {\n $.each(performance, function(index, data) {\n console.log(data['Name'] + ': ' + data['Execution Time']+'ms');\n });\n }\n console.groupEnd();\n }\n performance = [];\n }\n },\n invoke: function(query, passedArguments, context) {\n var\n object = instance,\n maxDepth,\n found,\n response\n ;\n passedArguments = passedArguments || queryArguments;\n context = element || context;\n if(typeof query == 'string' && object !== undefined) {\n query = query.split(/[\\. ]/);\n maxDepth = query.length - 1;\n $.each(query, function(depth, value) {\n var camelCaseValue = (depth != maxDepth)\n ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)\n : query\n ;\n if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {\n object = object[camelCaseValue];\n }\n else if( object[camelCaseValue] !== undefined ) {\n found = object[camelCaseValue];\n return false;\n }\n else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {\n object = object[value];\n }\n else if( object[value] !== undefined ) {\n found = object[value];\n return false;\n }\n else {\n module.error(error.method, query);\n return false;\n }\n });\n }\n if ( $.isFunction( found ) ) {\n response = found.apply(context, passedArguments);\n }\n else if(found !== undefined) {\n response = found;\n }\n if($.isArray(returnedValue)) {\n returnedValue.push(response);\n }\n else if(returnedValue !== undefined) {\n returnedValue = [returnedValue, response];\n }\n else if(response !== undefined) {\n returnedValue = response;\n }\n return found;\n }\n };\n\n if(methodInvoked) {\n if(instance === undefined) {\n module.initialize();\n }\n instance.save.scroll();\n instance.save.calculations();\n module.invoke(query);\n }\n else {\n if(instance !== undefined) {\n instance.invoke('destroy');\n }\n module.initialize();\n }\n })\n ;\n\n return (returnedValue !== undefined)\n ? returnedValue\n : this\n ;\n};\n\n$.fn.visibility.settings = {\n\n name : 'Visibility',\n namespace : 'visibility',\n\n debug : false,\n verbose : false,\n performance : true,\n\n // whether to use mutation observers to follow changes\n observeChanges : true,\n\n // check position immediately on init\n initialCheck : true,\n\n // whether to refresh calculations after all page images load\n refreshOnLoad : true,\n\n // whether to refresh calculations after page resize event\n refreshOnResize : true,\n\n // should call callbacks on refresh event (resize, etc)\n checkOnRefresh : true,\n\n // callback should only occur one time\n once : true,\n\n // callback should fire continuously whe evaluates to true\n continuous : false,\n\n // offset to use with scroll top\n offset : 0,\n\n // whether to include margin in elements position\n includeMargin : false,\n\n // scroll context for visibility checks\n context : window,\n\n // visibility check delay in ms (defaults to animationFrame)\n throttle : false,\n\n // special visibility type (image, fixed)\n type : false,\n\n // z-index to use with visibility 'fixed'\n zIndex : '10',\n\n // image only animation settings\n transition : 'fade in',\n duration : 1000,\n\n // array of callbacks for percentage\n onPassed : {},\n\n // standard callbacks\n onOnScreen : false,\n onOffScreen : false,\n onPassing : false,\n onTopVisible : false,\n onBottomVisible : false,\n onTopPassed : false,\n onBottomPassed : false,\n\n // reverse callbacks\n onPassingReverse : false,\n onTopVisibleReverse : false,\n onBottomVisibleReverse : false,\n onTopPassedReverse : false,\n onBottomPassedReverse : false,\n\n // special callbacks for image\n onLoad : function() {},\n onAllLoaded : function() {},\n\n // special callbacks for fixed position\n onFixed : function() {},\n onUnfixed : function() {},\n\n // utility callbacks\n onUpdate : false, // disabled by default for performance\n onRefresh : function(){},\n\n metadata : {\n src: 'src'\n },\n\n className: {\n fixed : 'fixed',\n placeholder : 'placeholder'\n },\n\n error : {\n method : 'The method you called is not defined.',\n visible : 'Element is hidden, you must call refresh after element becomes visible'\n }\n\n};\n\n})( jQuery, window, document );\n"]}