From f583bb7406fcbd634211bbbd8dd3af0acb9464d0 Mon Sep 17 00:00:00 2001 From: Pusher Robot Date: Sat, 13 Oct 2018 16:01:49 -0700 Subject: [PATCH] Updated component to version 2.4.1 --- bower.json | 24 ++++-------------------- composer.json | 9 ++------- index.js | 2 +- package.json | 2 +- visibility.js | 2 +- visibility.min.js | 2 +- 6 files changed, 10 insertions(+), 31 deletions(-) diff --git a/bower.json b/bower.json index dc2bc03..ff9f810 100644 --- a/bower.json +++ b/bower.json @@ -6,24 +6,8 @@ "name": "Jack Lukic", "web": "http://www.jacklukic.com" }, - "ignore": [ - "docs", - "node", - "server", - "spec", - "src", - "test" - ], - "keywords": [ - "semantic", - "ui", - "css3", - "framework" - ], - "license": [ - "http://semantic-ui.mit-license.org/" - ], - "main": [ - "visibility.css" - ] + "ignore": ["docs", "node", "server", "spec", "src", "test"], + "keywords": ["semantic", "ui", "css3", "framework"], + "license": ["http://semantic-ui.mit-license.org/"], + "main": ["visibility.css"] } \ No newline at end of file diff --git a/composer.json b/composer.json index 8f3d4c2..7e4e034 100644 --- a/composer.json +++ b/composer.json @@ -8,12 +8,7 @@ "web": "http://www.jacklukic.com", "role": "Creator" }], - "keywords": [ - "semantic", - "ui", - "css", - "framework" - ], + "keywords": ["semantic", "ui", "css", "framework"], "license": "MIT", - "version": "2.4.0" + "version": "2.4.1" } \ No newline at end of file diff --git a/index.js b/index.js index 6b898be..a81763e 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 2.4.0 - Visibility + * # Semantic UI 2.4.1 - Visibility * http://github.com/semantic-org/semantic-ui/ * * diff --git a/package.json b/package.json index 407d377..a259750 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "semantic-ui-visibility", - "version": "2.4.0", + "version": "2.4.1", "title": "Semantic UI - Visibility", "description": "Single component release of visibility", "homepage": "http://www.semantic-ui.com", diff --git a/visibility.js b/visibility.js index d945b58..09a7de9 100644 --- a/visibility.js +++ b/visibility.js @@ -1,5 +1,5 @@ /*! - * # Semantic UI 2.4.0 - Visibility + * # Semantic UI 2.4.1 - Visibility * http://github.com/semantic-org/semantic-ui/ * * diff --git a/visibility.min.js b/visibility.min.js index 78dfaab..bcbfcc0 100644 --- a/visibility.min.js +++ b/visibility.min.js @@ -1 +1 @@ -!function(e,o,n,t){"use strict";o=void 0!==o&&o.Math==Math?o:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),e.fn.visibility=function(i){var s,c=e(this),r=c.selector||"",a=(new Date).getTime(),l=[],d=arguments[0],u="string"==typeof d,f=[].slice.call(arguments,1),b=c.length,g=0;return c.each(function(){var c,m,p,v,h=e.isPlainObject(i)?e.extend(!0,{},e.fn.visibility.settings,i):e.extend({},e.fn.visibility.settings),P=h.className,x=h.namespace,C=h.error,y=h.metadata,S="."+x,R="module-"+x,V=e(o),k=e(this),T=e(h.context),O=(k.selector,k.data(R)),z=o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||o.msRequestAnimationFrame||function(e){setTimeout(e,0)},A=this,w=!1;v={initialize:function(){v.debug("Initializing",h),v.setup.cache(),v.should.trackChanges()&&("image"==h.type&&v.setup.image(),"fixed"==h.type&&v.setup.fixed(),h.observeChanges&&v.observeChanges(),v.bind.events()),v.save.position(),v.is.visible()||v.error(C.visible,k),h.initialCheck&&v.checkVisibility(),v.instantiate()},instantiate:function(){v.debug("Storing instance",v),k.data(R,v),O=v},destroy:function(){v.verbose("Destroying previous module"),p&&p.disconnect(),m&&m.disconnect(),V.off("load"+S,v.event.load).off("resize"+S,v.event.resize),T.off("scroll"+S,v.event.scroll).off("scrollchange"+S,v.event.scrollchange),"fixed"==h.type&&(v.resetFixed(),v.remove.placeholder()),k.off(S).removeData(R)},observeChanges:function(){"MutationObserver"in o&&(m=new MutationObserver(v.event.contextChanged),p=new MutationObserver(v.event.changed),m.observe(n,{childList:!0,subtree:!0}),p.observe(A,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",p))},bind:{events:function(){v.verbose("Binding visibility events to scroll and resize"),h.refreshOnLoad&&V.on("load"+S,v.event.load),V.on("resize"+S,v.event.resize),T.off("scroll"+S).on("scroll"+S,v.event.scroll).on("scrollchange"+S,v.event.scrollchange)}},event:{changed:function(e){v.verbose("DOM tree modified, updating visibility calculations"),v.timer=setTimeout(function(){v.verbose("DOM tree modified, updating sticky menu"),v.refresh()},100)},contextChanged:function(o){[].forEach.call(o,function(o){o.removedNodes&&[].forEach.call(o.removedNodes,function(o){(o==A||e(o).find(A).length>0)&&(v.debug("Element removed from DOM, tearing down events"),v.destroy())})})},resize:function(){v.debug("Window resized"),h.refreshOnResize&&z(v.refresh)},load:function(){v.debug("Page finished loading"),z(v.refresh)},scroll:function(){h.throttle?(clearTimeout(v.timer),v.timer=setTimeout(function(){T.triggerHandler("scrollchange"+S,[T.scrollTop()])},h.throttle)):z(function(){T.triggerHandler("scrollchange"+S,[T.scrollTop()])})},scrollchange:function(e,o){v.checkVisibility(o)}},precache:function(o,t){o instanceof Array||(o=[o]);for(var i=o.length,s=0,c=[],r=n.createElement("img"),a=function(){++s>=o.length&&e.isFunction(t)&&t()};i--;)(r=n.createElement("img")).onload=a,r.onerror=a,r.src=o[i],c.push(r)},enableCallbacks:function(){v.debug("Allowing callbacks to occur"),w=!1},disableCallbacks:function(){v.debug("Disabling all callbacks temporarily"),w=!0},should:{trackChanges:function(){return u?(v.debug("One time query, no need to bind events"),!1):(v.debug("Callbacks being attached"),!0)}},setup:{cache:function(){v.cache={occurred:{},screen:{},element:{}}},image:function(){var e=k.data(y.src);e&&(v.verbose("Lazy loading image",e),h.once=!0,h.observeChanges=!1,h.onOnScreen=function(){v.debug("Image on screen",A),v.precache(e,function(){v.set.image(e,function(){++g==b&&h.onAllLoaded.call(this),h.onLoad.call(this)})})})},fixed:function(){v.debug("Setting up fixed"),h.once=!1,h.observeChanges=!1,h.initialCheck=!0,h.refreshOnLoad=!0,i.transition||(h.transition=!1),v.create.placeholder(),v.debug("Added placeholder",c),h.onTopPassed=function(){v.debug("Element passed, adding fixed position",k),v.show.placeholder(),v.set.fixed(),h.transition&&e.fn.transition!==t&&k.transition(h.transition,h.duration)},h.onTopPassedReverse=function(){v.debug("Element returned to position, removing fixed",k),v.hide.placeholder(),v.remove.fixed()}}},create:{placeholder:function(){v.verbose("Creating fixed position placeholder"),c=k.clone(!1).css("display","none").addClass(P.placeholder).insertAfter(k)}},show:{placeholder:function(){v.verbose("Showing placeholder"),c.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){v.verbose("Hiding placeholder"),c.css("display","none").css("visibility","")}},set:{fixed:function(){v.verbose("Setting element to fixed position"),k.addClass(P.fixed).css({position:"fixed",top:h.offset+"px",left:"auto",zIndex:h.zIndex}),h.onFixed.call(A)},image:function(o,n){if(k.attr("src",o),h.transition)if(e.fn.transition!==t){if(k.hasClass(P.visible))return void v.debug("Transition already occurred on this image, skipping animation");k.transition(h.transition,h.duration,n)}else k.fadeIn(h.duration,n);else k.show()}},is:{onScreen:function(){return v.get.elementCalculations().onScreen},offScreen:function(){return v.get.elementCalculations().offScreen},visible:function(){return!(!v.cache||!v.cache.element)&&!(0===v.cache.element.width&&0===v.cache.element.offset.top)},verticallyScrollableContext:function(){var e=T.get(0)!==o&&T.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=T.get(0)!==o&&T.css("overflow-x");return"auto"==e||"scroll"==e}},refresh:function(){v.debug("Refreshing constants (width/height)"),"fixed"==h.type&&v.resetFixed(),v.reset(),v.save.position(),h.checkOnRefresh&&v.checkVisibility(),h.onRefresh.call(A)},resetFixed:function(){v.remove.fixed(),v.remove.occurred()},reset:function(){v.verbose("Resetting all cached values"),e.isPlainObject(v.cache)&&(v.cache.screen={},v.cache.element={})},checkVisibility:function(e){v.verbose("Checking visibility of element",v.cache.element),!w&&v.is.visible()&&(v.save.scroll(e),v.save.calculations(),v.passed(),v.passingReverse(),v.topVisibleReverse(),v.bottomVisibleReverse(),v.topPassedReverse(),v.bottomPassedReverse(),v.onScreen(),v.offScreen(),v.passing(),v.topVisible(),v.bottomVisible(),v.topPassed(),v.bottomPassed(),h.onUpdate&&h.onUpdate.call(A,v.get.elementCalculations()))},passed:function(o,n){var i=v.get.elementCalculations();if(o&&n)h.onPassed[o]=n;else{if(o!==t)return v.get.pixelsPassed(o)>i.pixelsPassed;i.passing&&e.each(h.onPassed,function(e,o){i.bottomVisible||i.pixelsPassed>v.get.pixelsPassed(e)?v.execute(o,e):h.once||v.remove.occurred(o)})}},onScreen:function(e){var o=v.get.elementCalculations(),n=e||h.onOnScreen,i="onScreen";if(e&&(v.debug("Adding callback for onScreen",e),h.onOnScreen=e),o.onScreen?v.execute(n,i):h.once||v.remove.occurred(i),e!==t)return o.onOnScreen},offScreen:function(e){var o=v.get.elementCalculations(),n=e||h.onOffScreen,i="offScreen";if(e&&(v.debug("Adding callback for offScreen",e),h.onOffScreen=e),o.offScreen?v.execute(n,i):h.once||v.remove.occurred(i),e!==t)return o.onOffScreen},passing:function(e){var o=v.get.elementCalculations(),n=e||h.onPassing,i="passing";if(e&&(v.debug("Adding callback for passing",e),h.onPassing=e),o.passing?v.execute(n,i):h.once||v.remove.occurred(i),e!==t)return o.passing},topVisible:function(e){var o=v.get.elementCalculations(),n=e||h.onTopVisible,i="topVisible";if(e&&(v.debug("Adding callback for top visible",e),h.onTopVisible=e),o.topVisible?v.execute(n,i):h.once||v.remove.occurred(i),e===t)return o.topVisible},bottomVisible:function(e){var o=v.get.elementCalculations(),n=e||h.onBottomVisible,i="bottomVisible";if(e&&(v.debug("Adding callback for bottom visible",e),h.onBottomVisible=e),o.bottomVisible?v.execute(n,i):h.once||v.remove.occurred(i),e===t)return o.bottomVisible},topPassed:function(e){var o=v.get.elementCalculations(),n=e||h.onTopPassed,i="topPassed";if(e&&(v.debug("Adding callback for top passed",e),h.onTopPassed=e),o.topPassed?v.execute(n,i):h.once||v.remove.occurred(i),e===t)return o.topPassed},bottomPassed:function(e){var o=v.get.elementCalculations(),n=e||h.onBottomPassed,i="bottomPassed";if(e&&(v.debug("Adding callback for bottom passed",e),h.onBottomPassed=e),o.bottomPassed?v.execute(n,i):h.once||v.remove.occurred(i),e===t)return o.bottomPassed},passingReverse:function(e){var o=v.get.elementCalculations(),n=e||h.onPassingReverse,i="passingReverse";if(e&&(v.debug("Adding callback for passing reverse",e),h.onPassingReverse=e),o.passing?h.once||v.remove.occurred(i):v.get.occurred("passing")&&v.execute(n,i),e!==t)return!o.passing},topVisibleReverse:function(e){var o=v.get.elementCalculations(),n=e||h.onTopVisibleReverse,i="topVisibleReverse";if(e&&(v.debug("Adding callback for top visible reverse",e),h.onTopVisibleReverse=e),o.topVisible?h.once||v.remove.occurred(i):v.get.occurred("topVisible")&&v.execute(n,i),e===t)return!o.topVisible},bottomVisibleReverse:function(e){var o=v.get.elementCalculations(),n=e||h.onBottomVisibleReverse,i="bottomVisibleReverse";if(e&&(v.debug("Adding callback for bottom visible reverse",e),h.onBottomVisibleReverse=e),o.bottomVisible?h.once||v.remove.occurred(i):v.get.occurred("bottomVisible")&&v.execute(n,i),e===t)return!o.bottomVisible},topPassedReverse:function(e){var o=v.get.elementCalculations(),n=e||h.onTopPassedReverse,i="topPassedReverse";if(e&&(v.debug("Adding callback for top passed reverse",e),h.onTopPassedReverse=e),o.topPassed?h.once||v.remove.occurred(i):v.get.occurred("topPassed")&&v.execute(n,i),e===t)return!o.onTopPassed},bottomPassedReverse:function(e){var o=v.get.elementCalculations(),n=e||h.onBottomPassedReverse,i="bottomPassedReverse";if(e&&(v.debug("Adding callback for bottom passed reverse",e),h.onBottomPassedReverse=e),o.bottomPassed?h.once||v.remove.occurred(i):v.get.occurred("bottomPassed")&&v.execute(n,i),e===t)return!o.bottomPassed},execute:function(e,o){var n=v.get.elementCalculations(),t=v.get.screenCalculations();(e=e||!1)&&(h.continuous?(v.debug("Callback being called continuously",o,n),e.call(A,n,t)):v.get.occurred(o)||(v.debug("Conditions met",o,n),e.call(A,n,t))),v.save.occurred(o)},remove:{fixed:function(){v.debug("Removing fixed position"),k.removeClass(P.fixed).css({position:"",top:"",left:"",zIndex:""}),h.onUnfixed.call(A)},placeholder:function(){v.debug("Removing placeholder content"),c&&c.remove()},occurred:function(e){if(e){var o=v.cache.occurred;o[e]!==t&&!0===o[e]&&(v.debug("Callback can now be called again",e),v.cache.occurred[e]=!1)}else v.cache.occurred={}}},save:{calculations:function(){v.verbose("Saving all calculations necessary to determine positioning"),v.save.direction(),v.save.screenCalculations(),v.save.elementCalculations()},occurred:function(e){e&&(v.cache.occurred[e]!==t&&!0===v.cache.occurred[e]||(v.verbose("Saving callback occurred",e),v.cache.occurred[e]=!0))},scroll:function(e){e=e+h.offset||T.scrollTop()+h.offset,v.cache.scroll=e},direction:function(){var e,o=v.get.scroll(),n=v.get.lastScroll();return e=o>n&&n?"down":o=o.top,o.bottomPassed=e.top>=o.bottom,o.topVisible=e.bottom>=o.top&&!o.topPassed,o.bottomVisible=e.bottom>=o.bottom&&!o.bottomPassed,o.pixelsPassed=0,o.percentagePassed=0,o.onScreen=(o.topVisible||o.passing)&&!o.bottomPassed,o.passing=o.topPassed&&!o.bottomPassed,o.offScreen=!o.onScreen,o.passing&&(o.pixelsPassed=e.top-o.top,o.percentagePassed=(e.top-o.top)/o.height),v.cache.element=o,v.verbose("Updated element calculations",o),o},screenCalculations:function(){var e=v.get.scroll();return v.save.direction(),v.cache.screen.top=e,v.cache.screen.bottom=e+v.cache.screen.height,v.cache.screen},screenSize:function(){v.verbose("Saving window position"),v.cache.screen={height:T.height()}},position:function(){v.save.screenSize(),v.save.elementPosition()}},get:{pixelsPassed:function(e){var o=v.get.elementCalculations();return e.search("%")>-1?o.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return v.cache.occurred!==t&&v.cache.occurred[e]||!1},direction:function(){return v.cache.direction===t&&v.save.direction(),v.cache.direction},elementPosition:function(){return v.cache.element===t&&v.save.elementPosition(),v.cache.element},elementCalculations:function(){return v.cache.element===t&&v.save.elementCalculations(),v.cache.element},screenCalculations:function(){return v.cache.screen===t&&v.save.screenCalculations(),v.cache.screen},screenSize:function(){return v.cache.screen===t&&v.save.screenSize(),v.cache.screen},scroll:function(){return v.cache.scroll===t&&v.save.scroll(),v.cache.scroll},lastScroll:function(){return v.cache.screen===t?(v.debug("First scroll event, no last scroll could be found"),!1):v.cache.screen.top}},setting:function(o,n){if(e.isPlainObject(o))e.extend(!0,h,o);else{if(n===t)return h[o];h[o]=n}},internal:function(o,n){if(e.isPlainObject(o))e.extend(!0,v,o);else{if(n===t)return v[o];v[o]=n}},debug:function(){!h.silent&&h.debug&&(h.performance?v.performance.log(arguments):(v.debug=Function.prototype.bind.call(console.info,console,h.name+":"),v.debug.apply(console,arguments)))},verbose:function(){!h.silent&&h.verbose&&h.debug&&(h.performance?v.performance.log(arguments):(v.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),v.verbose.apply(console,arguments)))},error:function(){h.silent||(v.error=Function.prototype.bind.call(console.error,console,h.name+":"),v.error.apply(console,arguments))},performance:{log:function(e){var o,n;h.performance&&(n=(o=(new Date).getTime())-(a||o),a=o,l.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:A,"Execution Time":n})),clearTimeout(v.performance.timer),v.performance.timer=setTimeout(v.performance.display,500)},display:function(){var o=h.name+":",n=0;a=!1,clearTimeout(v.performance.timer),e.each(l,function(e,o){n+=o["Execution Time"]}),o+=" "+n+"ms",r&&(o+=" '"+r+"'"),(console.group!==t||console.table!==t)&&l.length>0&&(console.groupCollapsed(o),console.table?console.table(l):e.each(l,function(e,o){console.log(o.Name+": "+o["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(o,n,i){var c,r,a,l=O;return n=n||f,i=A||i,"string"==typeof o&&l!==t&&(o=o.split(/[\. ]/),c=o.length-1,e.each(o,function(n,i){var s=n!=c?i+o[n+1].charAt(0).toUpperCase()+o[n+1].slice(1):o;if(e.isPlainObject(l[s])&&n!=c)l=l[s];else{if(l[s]!==t)return r=l[s],!1;if(!e.isPlainObject(l[i])||n==c)return l[i]!==t?(r=l[i],!1):(v.error(C.method,o),!1);l=l[i]}})),e.isFunction(r)?a=r.apply(i,n):r!==t&&(a=r),e.isArray(s)?s.push(a):s!==t?s=[s,a]:a!==t&&(s=a),r}},u?(O===t&&v.initialize(),O.save.scroll(),O.save.calculations(),v.invoke(d)):(O!==t&&O.invoke("destroy"),v.initialize())}),s!==t?s:this},e.fn.visibility.settings={name:"Visibility",namespace:"visibility",debug:!1,verbose:!1,performance:!0,observeChanges:!0,initialCheck:!0,refreshOnLoad:!0,refreshOnResize:!0,checkOnRefresh:!0,once:!0,continuous:!1,offset:0,includeMargin:!1,context:o,throttle:!1,type:!1,zIndex:"10",transition:"fade in",duration:1e3,onPassed:{},onOnScreen:!1,onOffScreen:!1,onPassing:!1,onTopVisible:!1,onBottomVisible:!1,onTopPassed:!1,onBottomPassed:!1,onPassingReverse:!1,onTopVisibleReverse:!1,onBottomVisibleReverse:!1,onTopPassedReverse:!1,onBottomPassedReverse:!1,onLoad:function(){},onAllLoaded:function(){},onFixed:function(){},onUnfixed:function(){},onUpdate:!1,onRefresh:function(){},metadata:{src:"src"},className:{fixed:"fixed",placeholder:"placeholder",visible:"visible"},error:{method:"The method you called is not defined.",visible:"Element is hidden, you must call refresh after element becomes visible"}}}(jQuery,window,document); \ No newline at end of file +!function(O,z,A,w){"use strict";z=void 0!==z&&z.Math==Math?z:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),O.fn.visibility=function(h){var P,e=O(this),x=e.selector||"",C=(new Date).getTime(),y=[],S=h,R="string"==typeof S,V=[].slice.call(arguments,1),k=e.length,T=0;return e.each(function(){var e,o,n,r,i=O.isPlainObject(h)?O.extend(!0,{},O.fn.visibility.settings,h):O.extend({},O.fn.visibility.settings),t=i.className,s=i.namespace,a=i.error,c=i.metadata,l="."+s,d="module-"+s,u=O(z),f=O(this),b=O(i.context),g=(f.selector,f.data(d)),m=z.requestAnimationFrame||z.mozRequestAnimationFrame||z.webkitRequestAnimationFrame||z.msRequestAnimationFrame||function(e){setTimeout(e,0)},p=this,v=!1;r={initialize:function(){r.debug("Initializing",i),r.setup.cache(),r.should.trackChanges()&&("image"==i.type&&r.setup.image(),"fixed"==i.type&&r.setup.fixed(),i.observeChanges&&r.observeChanges(),r.bind.events()),r.save.position(),r.is.visible()||r.error(a.visible,f),i.initialCheck&&r.checkVisibility(),r.instantiate()},instantiate:function(){r.debug("Storing instance",r),f.data(d,r),g=r},destroy:function(){r.verbose("Destroying previous module"),n&&n.disconnect(),o&&o.disconnect(),u.off("load"+l,r.event.load).off("resize"+l,r.event.resize),b.off("scroll"+l,r.event.scroll).off("scrollchange"+l,r.event.scrollchange),"fixed"==i.type&&(r.resetFixed(),r.remove.placeholder()),f.off(l).removeData(d)},observeChanges:function(){"MutationObserver"in z&&(o=new MutationObserver(r.event.contextChanged),n=new MutationObserver(r.event.changed),o.observe(A,{childList:!0,subtree:!0}),n.observe(p,{childList:!0,subtree:!0}),r.debug("Setting up mutation observer",n))},bind:{events:function(){r.verbose("Binding visibility events to scroll and resize"),i.refreshOnLoad&&u.on("load"+l,r.event.load),u.on("resize"+l,r.event.resize),b.off("scroll"+l).on("scroll"+l,r.event.scroll).on("scrollchange"+l,r.event.scrollchange)}},event:{changed:function(e){r.verbose("DOM tree modified, updating visibility calculations"),r.timer=setTimeout(function(){r.verbose("DOM tree modified, updating sticky menu"),r.refresh()},100)},contextChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==p||0=e.length&&O.isFunction(o)&&o()};n--;)(s=A.createElement("img")).onload=c,s.onerror=c,s.src=e[n],i.push(s)},enableCallbacks:function(){r.debug("Allowing callbacks to occur"),v=!1},disableCallbacks:function(){r.debug("Disabling all callbacks temporarily"),v=!0},should:{trackChanges:function(){return R?(r.debug("One time query, no need to bind events"),!1):(r.debug("Callbacks being attached"),!0)}},setup:{cache:function(){r.cache={occurred:{},screen:{},element:{}}},image:function(){var e=f.data(c.src);e&&(r.verbose("Lazy loading image",e),i.once=!0,i.observeChanges=!1,i.onOnScreen=function(){r.debug("Image on screen",p),r.precache(e,function(){r.set.image(e,function(){++T==k&&i.onAllLoaded.call(this),i.onLoad.call(this)})})})},fixed:function(){r.debug("Setting up fixed"),i.once=!1,i.observeChanges=!1,i.initialCheck=!0,i.refreshOnLoad=!0,h.transition||(i.transition=!1),r.create.placeholder(),r.debug("Added placeholder",e),i.onTopPassed=function(){r.debug("Element passed, adding fixed position",f),r.show.placeholder(),r.set.fixed(),i.transition&&O.fn.transition!==w&&f.transition(i.transition,i.duration)},i.onTopPassedReverse=function(){r.debug("Element returned to position, removing fixed",f),r.hide.placeholder(),r.remove.fixed()}}},create:{placeholder:function(){r.verbose("Creating fixed position placeholder"),e=f.clone(!1).css("display","none").addClass(t.placeholder).insertAfter(f)}},show:{placeholder:function(){r.verbose("Showing placeholder"),e.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){r.verbose("Hiding placeholder"),e.css("display","none").css("visibility","")}},set:{fixed:function(){r.verbose("Setting element to fixed position"),f.addClass(t.fixed).css({position:"fixed",top:i.offset+"px",left:"auto",zIndex:i.zIndex}),i.onFixed.call(p)},image:function(e,o){if(f.attr("src",e),i.transition)if(O.fn.transition!==w){if(f.hasClass(t.visible))return void r.debug("Transition already occurred on this image, skipping animation");f.transition(i.transition,i.duration,o)}else f.fadeIn(i.duration,o);else f.show()}},is:{onScreen:function(){return r.get.elementCalculations().onScreen},offScreen:function(){return r.get.elementCalculations().offScreen},visible:function(){return!(!r.cache||!r.cache.element)&&!(0===r.cache.element.width&&0===r.cache.element.offset.top)},verticallyScrollableContext:function(){var e=b.get(0)!==z&&b.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=b.get(0)!==z&&b.css("overflow-x");return"auto"==e||"scroll"==e}},refresh:function(){r.debug("Refreshing constants (width/height)"),"fixed"==i.type&&r.resetFixed(),r.reset(),r.save.position(),i.checkOnRefresh&&r.checkVisibility(),i.onRefresh.call(p)},resetFixed:function(){r.remove.fixed(),r.remove.occurred()},reset:function(){r.verbose("Resetting all cached values"),O.isPlainObject(r.cache)&&(r.cache.screen={},r.cache.element={})},checkVisibility:function(e){r.verbose("Checking visibility of element",r.cache.element),!v&&r.is.visible()&&(r.save.scroll(e),r.save.calculations(),r.passed(),r.passingReverse(),r.topVisibleReverse(),r.bottomVisibleReverse(),r.topPassedReverse(),r.bottomPassedReverse(),r.onScreen(),r.offScreen(),r.passing(),r.topVisible(),r.bottomVisible(),r.topPassed(),r.bottomPassed(),i.onUpdate&&i.onUpdate.call(p,r.get.elementCalculations()))},passed:function(e,o){var n=r.get.elementCalculations();if(e&&o)i.onPassed[e]=o;else{if(e!==w)return r.get.pixelsPassed(e)>n.pixelsPassed;n.passing&&O.each(i.onPassed,function(e,o){n.bottomVisible||n.pixelsPassed>r.get.pixelsPassed(e)?r.execute(o,e):i.once||r.remove.occurred(o)})}},onScreen:function(e){var o=r.get.elementCalculations(),n=e||i.onOnScreen,t="onScreen";if(e&&(r.debug("Adding callback for onScreen",e),i.onOnScreen=e),o.onScreen?r.execute(n,t):i.once||r.remove.occurred(t),e!==w)return o.onOnScreen},offScreen:function(e){var o=r.get.elementCalculations(),n=e||i.onOffScreen,t="offScreen";if(e&&(r.debug("Adding callback for offScreen",e),i.onOffScreen=e),o.offScreen?r.execute(n,t):i.once||r.remove.occurred(t),e!==w)return o.onOffScreen},passing:function(e){var o=r.get.elementCalculations(),n=e||i.onPassing,t="passing";if(e&&(r.debug("Adding callback for passing",e),i.onPassing=e),o.passing?r.execute(n,t):i.once||r.remove.occurred(t),e!==w)return o.passing},topVisible:function(e){var o=r.get.elementCalculations(),n=e||i.onTopVisible,t="topVisible";if(e&&(r.debug("Adding callback for top visible",e),i.onTopVisible=e),o.topVisible?r.execute(n,t):i.once||r.remove.occurred(t),e===w)return o.topVisible},bottomVisible:function(e){var o=r.get.elementCalculations(),n=e||i.onBottomVisible,t="bottomVisible";if(e&&(r.debug("Adding callback for bottom visible",e),i.onBottomVisible=e),o.bottomVisible?r.execute(n,t):i.once||r.remove.occurred(t),e===w)return o.bottomVisible},topPassed:function(e){var o=r.get.elementCalculations(),n=e||i.onTopPassed,t="topPassed";if(e&&(r.debug("Adding callback for top passed",e),i.onTopPassed=e),o.topPassed?r.execute(n,t):i.once||r.remove.occurred(t),e===w)return o.topPassed},bottomPassed:function(e){var o=r.get.elementCalculations(),n=e||i.onBottomPassed,t="bottomPassed";if(e&&(r.debug("Adding callback for bottom passed",e),i.onBottomPassed=e),o.bottomPassed?r.execute(n,t):i.once||r.remove.occurred(t),e===w)return o.bottomPassed},passingReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onPassingReverse,t="passingReverse";if(e&&(r.debug("Adding callback for passing reverse",e),i.onPassingReverse=e),o.passing?i.once||r.remove.occurred(t):r.get.occurred("passing")&&r.execute(n,t),e!==w)return!o.passing},topVisibleReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onTopVisibleReverse,t="topVisibleReverse";if(e&&(r.debug("Adding callback for top visible reverse",e),i.onTopVisibleReverse=e),o.topVisible?i.once||r.remove.occurred(t):r.get.occurred("topVisible")&&r.execute(n,t),e===w)return!o.topVisible},bottomVisibleReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onBottomVisibleReverse,t="bottomVisibleReverse";if(e&&(r.debug("Adding callback for bottom visible reverse",e),i.onBottomVisibleReverse=e),o.bottomVisible?i.once||r.remove.occurred(t):r.get.occurred("bottomVisible")&&r.execute(n,t),e===w)return!o.bottomVisible},topPassedReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onTopPassedReverse,t="topPassedReverse";if(e&&(r.debug("Adding callback for top passed reverse",e),i.onTopPassedReverse=e),o.topPassed?i.once||r.remove.occurred(t):r.get.occurred("topPassed")&&r.execute(n,t),e===w)return!o.onTopPassed},bottomPassedReverse:function(e){var o=r.get.elementCalculations(),n=e||i.onBottomPassedReverse,t="bottomPassedReverse";if(e&&(r.debug("Adding callback for bottom passed reverse",e),i.onBottomPassedReverse=e),o.bottomPassed?i.once||r.remove.occurred(t):r.get.occurred("bottomPassed")&&r.execute(n,t),e===w)return!o.bottomPassed},execute:function(e,o){var n=r.get.elementCalculations(),t=r.get.screenCalculations();(e=e||!1)&&(i.continuous?(r.debug("Callback being called continuously",o,n),e.call(p,n,t)):r.get.occurred(o)||(r.debug("Conditions met",o,n),e.call(p,n,t))),r.save.occurred(o)},remove:{fixed:function(){r.debug("Removing fixed position"),f.removeClass(t.fixed).css({position:"",top:"",left:"",zIndex:""}),i.onUnfixed.call(p)},placeholder:function(){r.debug("Removing placeholder content"),e&&e.remove()},occurred:function(e){if(e){var o=r.cache.occurred;o[e]!==w&&!0===o[e]&&(r.debug("Callback can now be called again",e),r.cache.occurred[e]=!1)}else r.cache.occurred={}}},save:{calculations:function(){r.verbose("Saving all calculations necessary to determine positioning"),r.save.direction(),r.save.screenCalculations(),r.save.elementCalculations()},occurred:function(e){e&&(r.cache.occurred[e]!==w&&!0===r.cache.occurred[e]||(r.verbose("Saving callback occurred",e),r.cache.occurred[e]=!0))},scroll:function(e){e=e+i.offset||b.scrollTop()+i.offset,r.cache.scroll=e},direction:function(){var e,o=r.get.scroll(),n=r.get.lastScroll();return e=n=o.top,o.bottomPassed=e.top>=o.bottom,o.topVisible=e.bottom>=o.top&&!o.topPassed,o.bottomVisible=e.bottom>=o.bottom&&!o.bottomPassed,o.pixelsPassed=0,o.percentagePassed=0,o.onScreen=(o.topVisible||o.passing)&&!o.bottomPassed,o.passing=o.topPassed&&!o.bottomPassed,o.offScreen=!o.onScreen,o.passing&&(o.pixelsPassed=e.top-o.top,o.percentagePassed=(e.top-o.top)/o.height),r.cache.element=o,r.verbose("Updated element calculations",o),o},screenCalculations:function(){var e=r.get.scroll();return r.save.direction(),r.cache.screen.top=e,r.cache.screen.bottom=e+r.cache.screen.height,r.cache.screen},screenSize:function(){r.verbose("Saving window position"),r.cache.screen={height:b.height()}},position:function(){r.save.screenSize(),r.save.elementPosition()}},get:{pixelsPassed:function(e){var o=r.get.elementCalculations();return-1