/*! * Infinite Ajax Scroll v2.2.1 * A jQuery plugin for infinite scrolling * http://infiniteajaxscroll.com * * Commercial use requires one-time purchase of a commercial license * http://infiniteajaxscroll.com/docs/license.html * * Non-commercial use is licensed under the MIT License * * Copyright (c) 2015 Webcreate (Jeroen Fiege) */ ; var IASCallbacks = function() { return this.list = [], this.fireStack = [], this.isFiring = !1, this.isDisabled = !1, this.fire = function(h) { var g = h[0], l = h[1], k = h[2]; this.isFiring = !0; for (var j = 0, i = this.list.length; i > j; j++) { if (void 0 != this.list[j] && !1 === this.list[j].fn.apply(g, k)) { l.reject(); break } } this.isFiring = !1, l.resolve(), this.fireStack.length && this.fire(this.fireStack.shift()) }, this.inList = function(f, e) { e = e || 0; for (var h = e, g = this.list.length; g > h; h++) { if (this.list[h].fn === f || f.guid && this.list[h].fn.guid && f.guid === this.list[h].fn.guid) { return h } } return -1 }, this }; IASCallbacks.prototype = { add: function(g, f) { var j = { fn: g, priority: f }; f = f || 0; for (var i = 0, h = this.list.length; h > i; i++) { if (f > this.list[i].priority) { return this.list.splice(i, 0, j), this } } return this.list.push(j), this }, remove: function(d) { for (var c = 0; (c = this.inList(d, c)) > -1;) { this.list.splice(c, 1) } return this }, has: function(b) { return this.inList(b) > -1 }, fireWith: function(e, d) { var f = jQuery.Deferred(); return this.isDisabled ? f.reject() : (d = d || [], d = [e, f, d.slice ? d.slice() : d], this.isFiring ? this.fireStack.push(d) : this.fire(d), f) }, disable: function() { this.isDisabled = !0 }, enable: function() { this.isDisabled = !1 } }, function(e) { var d = -1, f = function(b, a) { return this.itemsContainerSelector = a.container, this.itemSelector = a.item, this.nextSelector = a.next, this.paginationSelector = a.pagination, this.$scrollContainer = b, this.$container = window === b.get(0) ? e(document) : b, this.defaultDelay = a.delay, this.negativeMargin = a.negativeMargin, this.nextUrl = null, this.isBound = !1, this.isPaused = !1, this.isInitialized = !1, this.listeners = { next: new IASCallbacks, load: new IASCallbacks, loaded: new IASCallbacks, render: new IASCallbacks, rendered: new IASCallbacks, scroll: new IASCallbacks, noneLeft: new IASCallbacks, ready: new IASCallbacks }, this.extensions = [], this.scrollHandler = function() { if (this.isBound && !this.isPaused) { var g = this.getCurrentScrollOffset(this.$scrollContainer), h = this.getScrollThreshold(); d != h && (this.fire("scroll", [g, h]), g >= h && this.next()) } }, this.getItemsContainer = function() { return e(this.itemsContainerSelector) }, this.getLastItem = function() { return e(this.itemSelector, this.getItemsContainer().get(0)).last() }, this.getFirstItem = function() { return e(this.itemSelector, this.getItemsContainer().get(0)).first() }, this.getScrollThreshold = function(g) { var h; return g = g || this.negativeMargin, g = g >= 0 ? -1 * g : g, h = this.getLastItem(), 0 === h.length ? d : h.offset().top + h.height() + g }, this.getCurrentScrollOffset = function(h) { var g = 0, i = h.height(); return g = window === h.get(0) ? h.scrollTop() : h.offset().top, (-1 != navigator.platform.indexOf("iPhone") || -1 != navigator.platform.indexOf("iPod")) && (i += 80), g + i }, this.getNextUrl = function(c) { return c = c || this.$container, e(this.nextSelector, c).last().attr("href") }, this.load = function(s, r, q) { var p, o, n = this, m = [], l = +new Date; q = q || this.defaultDelay; var k = { url: s }; return n.fire("load", [k]), e.get(k.url, null, e.proxy(function(c) { p = e(this.itemsContainerSelector, c).eq(0), 0 === p.length && (p = e(c).filter(this.itemsContainerSelector).eq(0)), p && p.find(this.itemSelector).each(function() { m.push(this) }), n.fire("loaded", [c, m]), r && (o = +new Date - l, q > o ? setTimeout(function() { r.call(n, c, m) }, q - o) : r.call(n, c, m)) }, n), "html") }, this.render = function(h, m) { var l = this, k = this.getLastItem(), j = 0, i = this.fire("render", [h]); i.done(function() { e(h).hide(), k.after(h), e(h).fadeIn(400, function() { ++j < h.length || (l.fire("rendered", [h]), m && m()) }) }) }, this.hidePagination = function() { this.paginationSelector && e(this.paginationSelector, this.$container).hide() }, this.restorePagination = function() { this.paginationSelector && e(this.paginationSelector, this.$container).show() }, this.throttle = function(g, k) { var j, i, h = 0; return j = function() { function c() { h = +new Date, g.apply(n, m) } var n = this, m = arguments, l = +new Date - h; i ? clearTimeout(i) : c(), l > k ? c() : i = setTimeout(c, k) }, e.guid && (j.guid = g.guid = g.guid || e.guid++), j }, this.fire = function(g, c) { return this.listeners[g].fireWith(this, c) }, this.pause = function() { this.isPaused = !0 }, this.resume = function() { this.isPaused = !1 }, this }; f.prototype.initialize = function() { if (this.isInitialized) { return !1 } var h = !!("onscroll" in this.$scrollContainer.get(0)), g = this.getCurrentScrollOffset(this.$scrollContainer), i = this.getScrollThreshold(); return h ? (this.hidePagination(), this.bind(), this.fire("ready"), this.nextUrl = this.getNextUrl(), g >= i ? (this.next(), this.one("rendered", function() { this.isInitialized = !0 })) : this.isInitialized = !0, this) : !1 }, f.prototype.reinitialize = function() { this.isInitialized = !1, this.unbind(), this.initialize() }, f.prototype.bind = function() { if (!this.isBound) { this.$scrollContainer.on("scroll", e.proxy(this.throttle(this.scrollHandler, 150), this)); for (var a = 0, g = this.extensions.length; g > a; a++) { this.extensions[a].bind(this) } this.isBound = !0, this.resume() } }, f.prototype.unbind = function() { if (this.isBound) { this.$scrollContainer.off("scroll", this.scrollHandler); for (var g = 0, c = this.extensions.length; c > g; g++) { "undefined" != typeof this.extensions[g].unbind && this.extensions[g].unbind(this) } this.isBound = !1 } }, f.prototype.destroy = function() { this.unbind(), this.$scrollContainer.data("ias", null) }, f.prototype.on = function(a, h, g) { if ("undefined" == typeof this.listeners[a]) { throw new Error('There is no event called "' + a + '"') } return g = g || 0, this.listeners[a].add(e.proxy(h, this), g), this }, f.prototype.one = function(h, g) { var j = this, i = function() { j.off(h, g), j.off(h, i) }; return this.on(h, g), this.on(h, i), this }, f.prototype.off = function(g, c) { if ("undefined" == typeof this.listeners[g]) { throw new Error('There is no event called "' + g + '"') } return this.listeners[g].remove(c), this }, f.prototype.next = function() { var h = this.nextUrl, g = this; if (this.pause(), !h) { return this.fire("noneLeft", [this.getLastItem()]), this.listeners.noneLeft.disable(), g.resume(), !1 } var i = this.fire("next", [h]); return i.done(function() { g.load(h, function(b, j) { g.render(j, function() { g.nextUrl = g.getNextUrl(b), g.resume() }) }) }), i.fail(function() { g.resume() }), !0 }, f.prototype.extension = function(b) { if ("undefined" == typeof b.bind) { throw new Error('Extension doesn\'t have required method "bind"') } return "undefined" != typeof b.initialize && b.initialize(this), this.extensions.push(b), this.isInitialized && this.reinitialize(), this }, e.ias = function(a) { var g = e(window); return g.ias.apply(g, arguments) }, e.fn.ias = function(a) { var g = Array.prototype.slice.call(arguments), c = this; return this.each(function() { var j = e(this), i = j.data("ias"), b = e.extend({}, e.fn.ias.defaults, j.data(), "object" == typeof a && a); if (i || (j.data("ias", i = new f(j, b)), e(document).ready(e.proxy(i.initialize, i))), "string" == typeof a) { if ("function" != typeof i[a]) { throw new Error('There is no method called "' + a + '"') } g.shift(), i[a].apply(i, g) } c = i }), c }, e.fn.ias.defaults = { item: ".item", container: ".listing", next: ".next", pagination: !1, delay: 600, negativeMargin: 10 } }(jQuery); var IASHistoryExtension = function(b) { return b = jQuery.extend({}, this.defaults, b), this.ias = null, this.prevSelector = b.prev, this.prevUrl = null, this.listeners = { prev: new IASCallbacks }, this.onPageChange = function(f, e, h) { if (window.history && window.history.replaceState) { var g = history.state; history.replaceState(g, document.title, h) } }, this.onScroll = function(e, d) { var f = this.getScrollThresholdFirstItem(); this.prevUrl && (e -= this.ias.$scrollContainer.height(), f >= e && this.prev()) }, this.onReady = function() { var d = this.ias.getCurrentScrollOffset(this.ias.$scrollContainer), c = this.getScrollThresholdFirstItem(); d -= this.ias.$scrollContainer.height(), c >= d && this.prev() }, this.getPrevUrl = function(c) { return c || (c = this.ias.$container), jQuery(this.prevSelector, c).last().attr("href") }, this.getScrollThresholdFirstItem = function() { var c; return c = this.ias.getFirstItem(), 0 === c.length ? -1 : c.offset().top }, this.renderBefore = function(g, f) { var j = this.ias, i = j.getFirstItem(), h = 0; j.fire("render", [g]), jQuery(g).hide(), i.before(g), jQuery(g).fadeIn(400, function() { ++h < g.length || (j.fire("rendered", [g]), f && f()) }) }, this }; IASHistoryExtension.prototype.initialize = function(d) { var c = this; this.ias = d, jQuery.extend(d.listeners, this.listeners), d.prev = function() { return c.prev() }, this.prevUrl = this.getPrevUrl() }, IASHistoryExtension.prototype.bind = function(b) { b.on("pageChange", jQuery.proxy(this.onPageChange, this)), b.on("scroll", jQuery.proxy(this.onScroll, this)), b.on("ready", jQuery.proxy(this.onReady, this)) }, IASHistoryExtension.prototype.unbind = function(b) { b.off("pageChange", this.onPageChange), b.off("scroll", this.onScroll), b.off("ready", this.onReady) }, IASHistoryExtension.prototype.prev = function() { var f = this.prevUrl, e = this, h = this.ias; if (!f) { return !1 } h.pause(); var g = h.fire("prev", [f]); return g.done(function() { h.load(f, function(b, c) { e.renderBefore(c, function() { e.prevUrl = e.getPrevUrl(b), h.resume(), e.prevUrl && e.prev() }) }) }), g.fail(function() { h.resume() }), !0 }, IASHistoryExtension.prototype.defaults = { prev: ".prev" }; var IASNoneLeftExtension = function(b) { return b = jQuery.extend({}, this.defaults, b), this.ias = null, this.uid = (new Date).getTime(), this.html = b.html.replace("{text}", b.text), this.showNoneLeft = function() { var d = jQuery(this.html).attr("id", "ias_noneleft_" + this.uid), c = this.ias.getLastItem(); c.after(d), d.fadeIn() }, this }; IASNoneLeftExtension.prototype.bind = function(b) { this.ias = b, b.on("noneLeft", jQuery.proxy(this.showNoneLeft, this)) }, IASNoneLeftExtension.prototype.unbind = function(b) { b.off("noneLeft", this.showNoneLeft) }, IASNoneLeftExtension.prototype.defaults = { text: "You reached the end.", html: '
{text}
' }; var IASPagingExtension = function() { return this.ias = null, this.pagebreaks = [ [0, document.location.toString()] ], this.lastPageNum = 1, this.enabled = !0, this.listeners = { pageChange: new IASCallbacks }, this.onScroll = function(h, g) { if (this.enabled) { var l, k = this.ias, j = this.getCurrentPageNum(h), i = this.getCurrentPagebreak(h); this.lastPageNum !== j && (l = i[1], k.fire("pageChange", [j, h, l])), this.lastPageNum = j } }, this.onNext = function(e) { var d = this.ias.getCurrentScrollOffset(this.ias.$scrollContainer); this.pagebreaks.push([d, e]); var f = this.getCurrentPageNum(d) + 1; this.ias.fire("pageChange", [f, d, e]), this.lastPageNum = f }, this.onPrev = function(h) { var g = this, l = g.ias, k = l.getCurrentScrollOffset(l.$scrollContainer), j = k - l.$scrollContainer.height(), i = l.getFirstItem(); this.enabled = !1, this.pagebreaks.unshift([0, h]), l.one("rendered", function() { for (var c = 1, b = g.pagebreaks.length; b > c; c++) { g.pagebreaks[c][0] = g.pagebreaks[c][0] + i.offset().top } var a = g.getCurrentPageNum(j) + 1; l.fire("pageChange", [a, j, h]), g.lastPageNum = a, g.enabled = !0 }) }, this }; IASPagingExtension.prototype.initialize = function(b) { this.ias = b, jQuery.extend(b.listeners, this.listeners) }, IASPagingExtension.prototype.bind = function(d) { try { d.on("prev", jQuery.proxy(this.onPrev, this), this.priority) } catch (c) {} d.on("next", jQuery.proxy(this.onNext, this), this.priority), d.on("scroll", jQuery.proxy(this.onScroll, this), this.priority) }, IASPagingExtension.prototype.unbind = function(d) { try { d.off("prev", this.onPrev) } catch (c) {} d.off("next", this.onNext), d.off("scroll", this.onScroll) }, IASPagingExtension.prototype.getCurrentPageNum = function(d) { for (var c = this.pagebreaks.length - 1; c > 0; c--) { if (d > this.pagebreaks[c][0]) { return c + 1 } } return 1 }, IASPagingExtension.prototype.getCurrentPagebreak = function(d) { for (var c = this.pagebreaks.length - 1; c >= 0; c--) { if (d > this.pagebreaks[c][0]) { return this.pagebreaks[c] } } return null }, IASPagingExtension.prototype.priority = 500; var IASSpinnerExtension = function(b) { return b = jQuery.extend({}, this.defaults, b), this.ias = null, this.uid = (new Date).getTime(), this.src = b.src, this.html = b.html.replace("{src}", this.src), this.showSpinner = function() { var d = this.getSpinner() || this.createSpinner(), c = this.ias.getLastItem(); c.after(d), d.fadeIn() }, this.showSpinnerBefore = function() { var d = this.getSpinner() || this.createSpinner(), c = this.ias.getFirstItem(); c.before(d), d.fadeIn() }, this.removeSpinner = function() { this.hasSpinner() && this.getSpinner().remove() }, this.getSpinner = function() { var c = jQuery("#ias_spinner_" + this.uid); return c.length > 0 ? c : !1 }, this.hasSpinner = function() { var c = jQuery("#ias_spinner_" + this.uid); return c.length > 0 }, this.createSpinner = function() { var c = jQuery(this.html).attr("id", "ias_spinner_" + this.uid); return c.hide(), c }, this }; IASSpinnerExtension.prototype.bind = function(d) { this.ias = d, d.on("next", jQuery.proxy(this.showSpinner, this)), d.on("render", jQuery.proxy(this.removeSpinner, this)); try { d.on("prev", jQuery.proxy(this.showSpinnerBefore, this)) } catch (c) {} }, IASSpinnerExtension.prototype.unbind = function(d) { d.off("next", this.showSpinner), d.off("render", this.removeSpinner); try { d.off("prev", this.showSpinnerBefore) } catch (c) {} }, IASSpinnerExtension.prototype.defaults = { src: "data:image/gif;base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAkKAAAALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQJCgAAACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg8D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Kv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAkKAAAALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQJCgAAACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQJCgAAACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==", html: '
' }; var IASTriggerExtension = function(b) { return b = jQuery.extend({}, this.defaults, b), this.ias = null, this.html = b.html.replace("{text}", b.text), this.htmlPrev = b.htmlPrev.replace("{text}", b.textPrev), this.enabled = !0, this.count = 0, this.offset = b.offset, this.$triggerNext = null, this.$triggerPrev = null, this.showTriggerNext = function() { if (!this.enabled) { return !0 } if (!1 === this.offset || ++this.count < this.offset) { return !0 } var d = this.$triggerNext || (this.$triggerNext = this.createTrigger(this.next, this.html)), c = this.ias.getLastItem(); return c.after(d), d.fadeIn(), !1 }, this.showTriggerPrev = function() { if (!this.enabled) { return !0 } var d = this.$triggerPrev || (this.$triggerPrev = this.createTrigger(this.prev, this.htmlPrev)), c = this.ias.getFirstItem(); return c.before(d), d.fadeIn(), !1 }, this.onRendered = function() { this.enabled = !0 }, this.createTrigger = function(f, e) { var h, g = (new Date).getTime(); return e = e || this.html, h = jQuery(e).attr("id", "ias_trigger_" + g), h.hide(), h.on("click", jQuery.proxy(f, this)), h }, this }; IASTriggerExtension.prototype.bind = function(d) { this.ias = d, d.on("next", jQuery.proxy(this.showTriggerNext, this), this.priority), d.on("rendered", jQuery.proxy(this.onRendered, this), this.priority); try { d.on("prev", jQuery.proxy(this.showTriggerPrev, this), this.priority) } catch (c) {} }, IASTriggerExtension.prototype.unbind = function(d) { d.off("next", this.showTriggerNext), d.off("rendered", this.onRendered); try { d.off("prev", this.showTriggerPrev) } catch (c) {} }, IASTriggerExtension.prototype.next = function() { this.enabled = !1, this.ias.pause(), this.$triggerNext && (this.$triggerNext.remove(), this.$triggerNext = null), this.ias.next() }, IASTriggerExtension.prototype.prev = function() { this.enabled = !1, this.ias.pause(), this.$triggerPrev && (this.$triggerPrev.remove(), this.$triggerPrev = null), this.ias.prev() }, IASTriggerExtension.prototype.defaults = { text: "Click to load more ", html: '
{text}
', textPrev: "Load previous items", htmlPrev: '
{text}
', offset: 0 }, IASTriggerExtension.prototype.priority = 1000;