admin-notifications.js
1 month ago
sbr-blocks.js
1 month ago
sbr-feed.js
1 month ago
sbr-feed.min.js
1 month ago
sbr-review-alerts.js
1 month ago
sbr-feed.js
4153 lines
| 1 | var sbr_js_exists = (typeof sbr_js_exists !== 'undefined') ? true : false; |
| 2 | if(!sbr_js_exists) { |
| 3 | /*! |
| 4 | * Isotope PACKAGED v3.0.6 |
| 5 | * |
| 6 | * Licensed GPLv3 for open source use |
| 7 | * or Isotope Commercial License for commercial use |
| 8 | * |
| 9 | * https://isotope.metafizzy.co |
| 10 | * Copyright 2010-2018 Metafizzy |
| 11 | */ |
| 12 | |
| 13 | !function (t, e) { |
| 14 | "function" == typeof define && define.amd ? define("jquery-bridget/jquery-bridget", ["jquery"], function (i) { |
| 15 | return e(t, i) |
| 16 | }) : "object" == typeof module && module.exports ? module.exports = e(t, require("jquery")) : t.jQueryBridget = e(t, t.jQuery) |
| 17 | }(window, function (t, e) { |
| 18 | "use strict"; |
| 19 | |
| 20 | function i(i, s, a) { |
| 21 | function u(t, e, o) { |
| 22 | var n, s = "$()." + i + '("' + e + '")'; |
| 23 | return t.each(function (t, u) { |
| 24 | var h = a.data(u, i); |
| 25 | if (!h) return void r(i + " not initialized. Cannot call methods, i.e. " + s); |
| 26 | var d = h[e]; |
| 27 | if (!d || "_" == e.charAt(0)) return void r(s + " is not a valid method"); |
| 28 | var l = d.apply(h, o); |
| 29 | n = void 0 === n ? l : n |
| 30 | }), void 0 !== n ? n : t |
| 31 | } |
| 32 | |
| 33 | function h(t, e) { |
| 34 | t.each(function (t, o) { |
| 35 | var n = a.data(o, i); |
| 36 | n ? (n.option(e), n._init()) : (n = new s(o, e), a.data(o, i, n)) |
| 37 | }) |
| 38 | } |
| 39 | |
| 40 | a = a || e || t.jQuery, a && (s.prototype.option || (s.prototype.option = function (t) { |
| 41 | a.isPlainObject(t) && (this.options = a.extend(!0, this.options, t)) |
| 42 | }), a.fn[i] = function (t) { |
| 43 | if ("string" == typeof t) { |
| 44 | var e = n.call(arguments, 1); |
| 45 | return u(this, t, e) |
| 46 | } |
| 47 | return h(this, t), this |
| 48 | }, o(a)) |
| 49 | } |
| 50 | |
| 51 | function o(t) { |
| 52 | !t || t && t.bridget || (t.bridget = i) |
| 53 | } |
| 54 | |
| 55 | var n = Array.prototype.slice, s = t.console, r = "undefined" == typeof s ? function () { |
| 56 | } : function (t) { |
| 57 | s.error(t) |
| 58 | }; |
| 59 | return o(e || t.jQuery), i |
| 60 | }), function (t, e) { |
| 61 | "function" == typeof define && define.amd ? define("ev-emitter/ev-emitter", e) : "object" == typeof module && module.exports ? module.exports = e() : t.EvEmitter = e() |
| 62 | }("undefined" != typeof window ? window : this, function () { |
| 63 | function t() { |
| 64 | } |
| 65 | |
| 66 | var e = t.prototype; |
| 67 | return e.on = function (t, e) { |
| 68 | if (t && e) { |
| 69 | var i = this._events = this._events || {}, o = i[t] = i[t] || []; |
| 70 | return o.indexOf(e) == -1 && o.push(e), this |
| 71 | } |
| 72 | }, e.once = function (t, e) { |
| 73 | if (t && e) { |
| 74 | this.on(t, e); |
| 75 | var i = this._onceEvents = this._onceEvents || {}, o = i[t] = i[t] || {}; |
| 76 | return o[e] = !0, this |
| 77 | } |
| 78 | }, e.off = function (t, e) { |
| 79 | var i = this._events && this._events[t]; |
| 80 | if (i && i.length) { |
| 81 | var o = i.indexOf(e); |
| 82 | return o != -1 && i.splice(o, 1), this |
| 83 | } |
| 84 | }, e.emitEvent = function (t, e) { |
| 85 | var i = this._events && this._events[t]; |
| 86 | if (i && i.length) { |
| 87 | i = i.slice(0), e = e || []; |
| 88 | for (var o = this._onceEvents && this._onceEvents[t], n = 0; n < i.length; n++) { |
| 89 | var s = i[n], r = o && o[s]; |
| 90 | r && (this.off(t, s), delete o[s]), s.apply(this, e) |
| 91 | } |
| 92 | return this |
| 93 | } |
| 94 | }, e.allOff = function () { |
| 95 | delete this._events, delete this._onceEvents |
| 96 | }, t |
| 97 | }), function (t, e) { |
| 98 | "function" == typeof define && define.amd ? define("get-size/get-size", e) : "object" == typeof module && module.exports ? module.exports = e() : t.getSize = e() |
| 99 | }(window, function () { |
| 100 | "use strict"; |
| 101 | |
| 102 | function t(t) { |
| 103 | var e = parseFloat(t), i = t.indexOf("%") == -1 && !isNaN(e); |
| 104 | return i && e |
| 105 | } |
| 106 | |
| 107 | function e() { |
| 108 | } |
| 109 | |
| 110 | function i() { |
| 111 | for (var t = { |
| 112 | width: 0, |
| 113 | height: 0, |
| 114 | innerWidth: 0, |
| 115 | innerHeight: 0, |
| 116 | outerWidth: 0, |
| 117 | outerHeight: 0 |
| 118 | }, e = 0; e < h; e++) { |
| 119 | var i = u[e]; |
| 120 | t[i] = 0 |
| 121 | } |
| 122 | return t |
| 123 | } |
| 124 | |
| 125 | function o(t) { |
| 126 | var e = getComputedStyle(t); |
| 127 | return e || a("Style returned " + e + ". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"), e |
| 128 | } |
| 129 | |
| 130 | function n() { |
| 131 | if (!d) { |
| 132 | d = !0; |
| 133 | var e = document.createElement("div"); |
| 134 | e.style.width = "200px", e.style.padding = "1px 2px 3px 4px", e.style.borderStyle = "solid", e.style.borderWidth = "1px 2px 3px 4px", e.style.boxSizing = "border-box"; |
| 135 | var i = document.body || document.documentElement; |
| 136 | i.appendChild(e); |
| 137 | var n = o(e); |
| 138 | r = 200 == Math.round(t(n.width)), s.isBoxSizeOuter = r, i.removeChild(e) |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | function s(e) { |
| 143 | if (n(), "string" == typeof e && (e = document.querySelector(e)), e && "object" == typeof e && e.nodeType) { |
| 144 | var s = o(e); |
| 145 | if ("none" == s.display) return i(); |
| 146 | var a = {}; |
| 147 | a.width = e.offsetWidth, a.height = e.offsetHeight; |
| 148 | for (var d = a.isBorderBox = "border-box" == s.boxSizing, l = 0; l < h; l++) { |
| 149 | var f = u[l], c = s[f], m = parseFloat(c); |
| 150 | a[f] = isNaN(m) ? 0 : m |
| 151 | } |
| 152 | var p = a.paddingLeft + a.paddingRight, y = a.paddingTop + a.paddingBottom, |
| 153 | g = a.marginLeft + a.marginRight, v = a.marginTop + a.marginBottom, |
| 154 | _ = a.borderLeftWidth + a.borderRightWidth, z = a.borderTopWidth + a.borderBottomWidth, I = d && r, |
| 155 | x = t(s.width); |
| 156 | x !== !1 && (a.width = x + (I ? 0 : p + _)); |
| 157 | var S = t(s.height); |
| 158 | return S !== !1 && (a.height = S + (I ? 0 : y + z)), a.innerWidth = a.width - (p + _), a.innerHeight = a.height - (y + z), a.outerWidth = a.width + g, a.outerHeight = a.height + v, a |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | var r, a = "undefined" == typeof console ? e : function (t) { |
| 163 | console.error(t) |
| 164 | }, |
| 165 | u = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"], |
| 166 | h = u.length, d = !1; |
| 167 | return s |
| 168 | }), function (t, e) { |
| 169 | "use strict"; |
| 170 | "function" == typeof define && define.amd ? define("desandro-matches-selector/matches-selector", e) : "object" == typeof module && module.exports ? module.exports = e() : t.matchesSelector = e() |
| 171 | }(window, function () { |
| 172 | "use strict"; |
| 173 | var t = function () { |
| 174 | var t = window.Element.prototype; |
| 175 | if (t.matches) return "matches"; |
| 176 | if (t.matchesSelector) return "matchesSelector"; |
| 177 | for (var e = ["webkit", "moz", "ms", "o"], i = 0; i < e.length; i++) { |
| 178 | var o = e[i], n = o + "MatchesSelector"; |
| 179 | if (t[n]) return n |
| 180 | } |
| 181 | }(); |
| 182 | return function (e, i) { |
| 183 | return e[t](i) |
| 184 | } |
| 185 | }), function (t, e) { |
| 186 | "function" == typeof define && define.amd ? define("fizzy-ui-utils/utils", ["desandro-matches-selector/matches-selector"], function (i) { |
| 187 | return e(t, i) |
| 188 | }) : "object" == typeof module && module.exports ? module.exports = e(t, require("desandro-matches-selector")) : t.fizzyUIUtils = e(t, t.matchesSelector) |
| 189 | }(window, function (t, e) { |
| 190 | var i = {}; |
| 191 | i.extend = function (t, e) { |
| 192 | for (var i in e) t[i] = e[i]; |
| 193 | return t |
| 194 | }, i.modulo = function (t, e) { |
| 195 | return (t % e + e) % e |
| 196 | }; |
| 197 | var o = Array.prototype.slice; |
| 198 | i.makeArray = function (t) { |
| 199 | if (Array.isArray(t)) return t; |
| 200 | if (null === t || void 0 === t) return []; |
| 201 | var e = "object" == typeof t && "number" == typeof t.length; |
| 202 | return e ? o.call(t) : [t] |
| 203 | }, i.removeFrom = function (t, e) { |
| 204 | var i = t.indexOf(e); |
| 205 | i != -1 && t.splice(i, 1) |
| 206 | }, i.getParent = function (t, i) { |
| 207 | for (; t.parentNode && t != document.body;) if (t = t.parentNode, e(t, i)) return t |
| 208 | }, i.getQueryElement = function (t) { |
| 209 | return "string" == typeof t ? document.querySelector(t) : t |
| 210 | }, i.handleEvent = function (t) { |
| 211 | var e = "on" + t.type; |
| 212 | this[e] && this[e](t) |
| 213 | }, i.filterFindElements = function (t, o) { |
| 214 | t = i.makeArray(t); |
| 215 | var n = []; |
| 216 | return t.forEach(function (t) { |
| 217 | if (t instanceof HTMLElement) { |
| 218 | if (!o) return void n.push(t); |
| 219 | e(t, o) && n.push(t); |
| 220 | for (var i = t.querySelectorAll(o), s = 0; s < i.length; s++) n.push(i[s]) |
| 221 | } |
| 222 | }), n |
| 223 | }, i.debounceMethod = function (t, e, i) { |
| 224 | i = i || 100; |
| 225 | var o = t.prototype[e], n = e + "Timeout"; |
| 226 | t.prototype[e] = function () { |
| 227 | var t = this[n]; |
| 228 | clearTimeout(t); |
| 229 | var e = arguments, s = this; |
| 230 | this[n] = setTimeout(function () { |
| 231 | o.apply(s, e), delete s[n] |
| 232 | }, i) |
| 233 | } |
| 234 | }, i.docReady = function (t) { |
| 235 | var e = document.readyState; |
| 236 | "complete" == e || "interactive" == e ? setTimeout(t) : document.addEventListener("DOMContentLoaded", t) |
| 237 | }, i.toDashed = function (t) { |
| 238 | return t.replace(/(.)([A-Z])/g, function (t, e, i) { |
| 239 | return e + "-" + i |
| 240 | }).toLowerCase() |
| 241 | }; |
| 242 | var n = t.console; |
| 243 | return i.htmlInit = function (e, o) { |
| 244 | i.docReady(function () { |
| 245 | var s = i.toDashed(o), r = "data-" + s, a = document.querySelectorAll("[" + r + "]"), |
| 246 | u = document.querySelectorAll(".js-" + s), h = i.makeArray(a).concat(i.makeArray(u)), |
| 247 | d = r + "-options", l = t.jQuery; |
| 248 | h.forEach(function (t) { |
| 249 | var i, s = t.getAttribute(r) || t.getAttribute(d); |
| 250 | try { |
| 251 | i = s && JSON.parse(s) |
| 252 | } catch (a) { |
| 253 | return void (n && n.error("Error parsing " + r + " on " + t.className + ": " + a)) |
| 254 | } |
| 255 | var u = new e(t, i); |
| 256 | l && l.data(t, o, u) |
| 257 | }) |
| 258 | }) |
| 259 | }, i |
| 260 | }), function (t, e) { |
| 261 | "function" == typeof define && define.amd ? define("outlayer/item", ["ev-emitter/ev-emitter", "get-size/get-size"], e) : "object" == typeof module && module.exports ? module.exports = e(require("ev-emitter"), require("get-size")) : (t.Outlayer = {}, t.Outlayer.Item = e(t.EvEmitter, t.getSize)) |
| 262 | }(window, function (t, e) { |
| 263 | "use strict"; |
| 264 | |
| 265 | function i(t) { |
| 266 | for (var e in t) return !1; |
| 267 | return e = null, !0 |
| 268 | } |
| 269 | |
| 270 | function o(t, e) { |
| 271 | t && (this.element = t, this.layout = e, this.position = {x: 0, y: 0}, this._create()) |
| 272 | } |
| 273 | |
| 274 | function n(t) { |
| 275 | return t.replace(/([A-Z])/g, function (t) { |
| 276 | return "-" + t.toLowerCase() |
| 277 | }) |
| 278 | } |
| 279 | |
| 280 | var s = document.documentElement.style, r = "string" == typeof s.transition ? "transition" : "WebkitTransition", |
| 281 | a = "string" == typeof s.transform ? "transform" : "WebkitTransform", |
| 282 | u = {WebkitTransition: "webkitTransitionEnd", transition: "transitionend"}[r], h = { |
| 283 | transform: a, |
| 284 | transition: r, |
| 285 | transitionDuration: r + "Duration", |
| 286 | transitionProperty: r + "Property", |
| 287 | transitionDelay: r + "Delay" |
| 288 | }, d = o.prototype = Object.create(t.prototype); |
| 289 | d.constructor = o, d._create = function () { |
| 290 | this._transn = {ingProperties: {}, clean: {}, onEnd: {}}, this.css({position: "absolute"}) |
| 291 | }, d.handleEvent = function (t) { |
| 292 | var e = "on" + t.type; |
| 293 | this[e] && this[e](t) |
| 294 | }, d.getSize = function () { |
| 295 | this.size = e(this.element) |
| 296 | }, d.css = function (t) { |
| 297 | var e = this.element.style; |
| 298 | for (var i in t) { |
| 299 | var o = h[i] || i; |
| 300 | e[o] = t[i] |
| 301 | } |
| 302 | }, d.getPosition = function () { |
| 303 | var t = getComputedStyle(this.element), e = this.layout._getOption("originLeft"), |
| 304 | i = this.layout._getOption("originTop"), o = t[e ? "left" : "right"], n = t[i ? "top" : "bottom"], |
| 305 | s = parseFloat(o), r = parseFloat(n), a = this.layout.size; |
| 306 | o.indexOf("%") != -1 && (s = s / 100 * a.width), n.indexOf("%") != -1 && (r = r / 100 * a.height), s = isNaN(s) ? 0 : s, r = isNaN(r) ? 0 : r, s -= e ? a.paddingLeft : a.paddingRight, r -= i ? a.paddingTop : a.paddingBottom, this.position.x = s, this.position.y = r |
| 307 | }, d.layoutPosition = function () { |
| 308 | var t = this.layout.size, e = {}, i = this.layout._getOption("originLeft"), |
| 309 | o = this.layout._getOption("originTop"), n = i ? "paddingLeft" : "paddingRight", |
| 310 | s = i ? "left" : "right", r = i ? "right" : "left", a = this.position.x + t[n]; |
| 311 | e[s] = this.getXValue(a), e[r] = ""; |
| 312 | var u = o ? "paddingTop" : "paddingBottom", h = o ? "top" : "bottom", d = o ? "bottom" : "top", |
| 313 | l = this.position.y + t[u]; |
| 314 | e[h] = this.getYValue(l), e[d] = "", this.css(e), this.emitEvent("layout", [this]) |
| 315 | }, d.getXValue = function (t) { |
| 316 | var e = this.layout._getOption("horizontal"); |
| 317 | return this.layout.options.percentPosition && !e ? t / this.layout.size.width * 100 + "%" : t + "px" |
| 318 | }, d.getYValue = function (t) { |
| 319 | var e = this.layout._getOption("horizontal"); |
| 320 | return this.layout.options.percentPosition && e ? t / this.layout.size.height * 100 + "%" : t + "px" |
| 321 | }, d._transitionTo = function (t, e) { |
| 322 | this.getPosition(); |
| 323 | var i = this.position.x, o = this.position.y, n = t == this.position.x && e == this.position.y; |
| 324 | if (this.setPosition(t, e), n && !this.isTransitioning) return void this.layoutPosition(); |
| 325 | var s = t - i, r = e - o, a = {}; |
| 326 | a.transform = this.getTranslate(s, r), this.transition({ |
| 327 | to: a, |
| 328 | onTransitionEnd: {transform: this.layoutPosition}, |
| 329 | isCleaning: !0 |
| 330 | }) |
| 331 | }, d.getTranslate = function (t, e) { |
| 332 | var i = this.layout._getOption("originLeft"), o = this.layout._getOption("originTop"); |
| 333 | return t = i ? t : -t, e = o ? e : -e, "translate3d(" + t + "px, " + e + "px, 0)" |
| 334 | }, d.goTo = function (t, e) { |
| 335 | this.setPosition(t, e), this.layoutPosition() |
| 336 | }, d.moveTo = d._transitionTo, d.setPosition = function (t, e) { |
| 337 | this.position.x = parseFloat(t), this.position.y = parseFloat(e) |
| 338 | }, d._nonTransition = function (t) { |
| 339 | this.css(t.to), t.isCleaning && this._removeStyles(t.to); |
| 340 | for (var e in t.onTransitionEnd) t.onTransitionEnd[e].call(this) |
| 341 | }, d.transition = function (t) { |
| 342 | if (!parseFloat(this.layout.options.transitionDuration)) return void this._nonTransition(t); |
| 343 | var e = this._transn; |
| 344 | for (var i in t.onTransitionEnd) e.onEnd[i] = t.onTransitionEnd[i]; |
| 345 | for (i in t.to) e.ingProperties[i] = !0, t.isCleaning && (e.clean[i] = !0); |
| 346 | if (t.from) { |
| 347 | this.css(t.from); |
| 348 | var o = this.element.offsetHeight; |
| 349 | o = null |
| 350 | } |
| 351 | this.enableTransition(t.to), this.css(t.to), this.isTransitioning = !0 |
| 352 | }; |
| 353 | var l = "opacity," + n(a); |
| 354 | d.enableTransition = function () { |
| 355 | if (!this.isTransitioning) { |
| 356 | var t = this.layout.options.transitionDuration; |
| 357 | t = "number" == typeof t ? t + "ms" : t, this.css({ |
| 358 | transitionProperty: l, |
| 359 | transitionDuration: t, |
| 360 | transitionDelay: this.staggerDelay || 0 |
| 361 | }), this.element.addEventListener(u, this, !1) |
| 362 | } |
| 363 | }, d.onwebkitTransitionEnd = function (t) { |
| 364 | this.ontransitionend(t) |
| 365 | }, d.onotransitionend = function (t) { |
| 366 | this.ontransitionend(t) |
| 367 | }; |
| 368 | var f = {"-webkit-transform": "transform"}; |
| 369 | d.ontransitionend = function (t) { |
| 370 | if (t.target === this.element) { |
| 371 | var e = this._transn, o = f[t.propertyName] || t.propertyName; |
| 372 | if (delete e.ingProperties[o], i(e.ingProperties) && this.disableTransition(), o in e.clean && (this.element.style[t.propertyName] = "", delete e.clean[o]), o in e.onEnd) { |
| 373 | var n = e.onEnd[o]; |
| 374 | n.call(this), delete e.onEnd[o] |
| 375 | } |
| 376 | this.emitEvent("transitionEnd", [this]) |
| 377 | } |
| 378 | }, d.disableTransition = function () { |
| 379 | this.removeTransitionStyles(), this.element.removeEventListener(u, this, !1), this.isTransitioning = !1 |
| 380 | }, d._removeStyles = function (t) { |
| 381 | var e = {}; |
| 382 | for (var i in t) e[i] = ""; |
| 383 | this.css(e) |
| 384 | }; |
| 385 | var c = {transitionProperty: "", transitionDuration: "", transitionDelay: ""}; |
| 386 | return d.removeTransitionStyles = function () { |
| 387 | this.css(c) |
| 388 | }, d.stagger = function (t) { |
| 389 | t = isNaN(t) ? 0 : t, this.staggerDelay = t + "ms" |
| 390 | }, d.removeElem = function () { |
| 391 | this.element.parentNode.removeChild(this.element), this.css({display: ""}), this.emitEvent("remove", [this]) |
| 392 | }, d.remove = function () { |
| 393 | return r && parseFloat(this.layout.options.transitionDuration) ? (this.once("transitionEnd", function () { |
| 394 | this.removeElem() |
| 395 | }), void this.hide()) : void this.removeElem() |
| 396 | }, d.reveal = function () { |
| 397 | delete this.isHidden, this.css({display: ""}); |
| 398 | var t = this.layout.options, e = {}, i = this.getHideRevealTransitionEndProperty("visibleStyle"); |
| 399 | e[i] = this.onRevealTransitionEnd, this.transition({ |
| 400 | from: t.hiddenStyle, |
| 401 | to: t.visibleStyle, |
| 402 | isCleaning: !0, |
| 403 | onTransitionEnd: e |
| 404 | }) |
| 405 | }, d.onRevealTransitionEnd = function () { |
| 406 | this.isHidden || this.emitEvent("reveal") |
| 407 | }, d.getHideRevealTransitionEndProperty = function (t) { |
| 408 | var e = this.layout.options[t]; |
| 409 | if (e.opacity) return "opacity"; |
| 410 | for (var i in e) return i |
| 411 | }, d.hide = function () { |
| 412 | this.isHidden = !0, this.css({display: ""}); |
| 413 | var t = this.layout.options, e = {}, i = this.getHideRevealTransitionEndProperty("hiddenStyle"); |
| 414 | e[i] = this.onHideTransitionEnd, this.transition({ |
| 415 | from: t.visibleStyle, |
| 416 | to: t.hiddenStyle, |
| 417 | isCleaning: !0, |
| 418 | onTransitionEnd: e |
| 419 | }) |
| 420 | }, d.onHideTransitionEnd = function () { |
| 421 | this.isHidden && (this.css({display: "none"}), this.emitEvent("hide")) |
| 422 | }, d.destroy = function () { |
| 423 | this.css({position: "", left: "", right: "", top: "", bottom: "", transition: "", transform: ""}) |
| 424 | }, o |
| 425 | }), function (t, e) { |
| 426 | "use strict"; |
| 427 | "function" == typeof define && define.amd ? define("outlayer/outlayer", ["ev-emitter/ev-emitter", "get-size/get-size", "fizzy-ui-utils/utils", "./item"], function (i, o, n, s) { |
| 428 | return e(t, i, o, n, s) |
| 429 | }) : "object" == typeof module && module.exports ? module.exports = e(t, require("ev-emitter"), require("get-size"), require("fizzy-ui-utils"), require("./item")) : t.Outlayer = e(t, t.EvEmitter, t.getSize, t.fizzyUIUtils, t.Outlayer.Item) |
| 430 | }(window, function (t, e, i, o, n) { |
| 431 | "use strict"; |
| 432 | |
| 433 | function s(t, e) { |
| 434 | var i = o.getQueryElement(t); |
| 435 | if (!i) return void (u && u.error("Bad element for " + this.constructor.namespace + ": " + (i || t))); |
| 436 | this.element = i, h && (this.$element = h(this.element)), this.options = o.extend({}, this.constructor.defaults), this.option(e); |
| 437 | var n = ++l; |
| 438 | this.element.outlayerGUID = n, f[n] = this, this._create(); |
| 439 | var s = this._getOption("initLayout"); |
| 440 | s && this.layout() |
| 441 | } |
| 442 | |
| 443 | function r(t) { |
| 444 | function e() { |
| 445 | t.apply(this, arguments) |
| 446 | } |
| 447 | |
| 448 | return e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e |
| 449 | } |
| 450 | |
| 451 | function a(t) { |
| 452 | if ("number" == typeof t) return t; |
| 453 | var e = t.match(/(^\d*\.?\d*)(\w*)/), i = e && e[1], o = e && e[2]; |
| 454 | if (!i.length) return 0; |
| 455 | i = parseFloat(i); |
| 456 | var n = m[o] || 1; |
| 457 | return i * n |
| 458 | } |
| 459 | |
| 460 | var u = t.console, h = t.jQuery, d = function () { |
| 461 | }, l = 0, f = {}; |
| 462 | s.namespace = "outlayer", s.Item = n, s.defaults = { |
| 463 | containerStyle: {position: "relative"}, |
| 464 | initLayout: !0, |
| 465 | originLeft: !0, |
| 466 | originTop: !0, |
| 467 | resize: !0, |
| 468 | resizeContainer: !0, |
| 469 | transitionDuration: "0.4s", |
| 470 | hiddenStyle: {opacity: 0, transform: "scale(0.001)"}, |
| 471 | visibleStyle: {opacity: 1, transform: "scale(1)"} |
| 472 | }; |
| 473 | var c = s.prototype; |
| 474 | o.extend(c, e.prototype), c.option = function (t) { |
| 475 | o.extend(this.options, t) |
| 476 | }, c._getOption = function (t) { |
| 477 | var e = this.constructor.compatOptions[t]; |
| 478 | return e && void 0 !== this.options[e] ? this.options[e] : this.options[t] |
| 479 | }, s.compatOptions = { |
| 480 | initLayout: "isInitLayout", |
| 481 | horizontal: "isHorizontal", |
| 482 | layoutInstant: "isLayoutInstant", |
| 483 | originLeft: "isOriginLeft", |
| 484 | originTop: "isOriginTop", |
| 485 | resize: "isResizeBound", |
| 486 | resizeContainer: "isResizingContainer" |
| 487 | }, c._create = function () { |
| 488 | this.reloadItems(), this.stamps = [], this.stamp(this.options.stamp), o.extend(this.element.style, this.options.containerStyle); |
| 489 | var t = this._getOption("resize"); |
| 490 | t && this.bindResize() |
| 491 | }, c.reloadItems = function () { |
| 492 | this.items = this._itemize(this.element.children) |
| 493 | }, c._itemize = function (t) { |
| 494 | for (var e = this._filterFindItemElements(t), i = this.constructor.Item, o = [], n = 0; n < e.length; n++) { |
| 495 | var s = e[n], r = new i(s, this); |
| 496 | o.push(r) |
| 497 | } |
| 498 | return o |
| 499 | }, c._filterFindItemElements = function (t) { |
| 500 | return o.filterFindElements(t, this.options.itemSelector) |
| 501 | }, c.getItemElements = function () { |
| 502 | return this.items.map(function (t) { |
| 503 | return t.element |
| 504 | }) |
| 505 | }, c.layout = function () { |
| 506 | this._resetLayout(), this._manageStamps(); |
| 507 | var t = this._getOption("layoutInstant"), e = void 0 !== t ? t : !this._isLayoutInited; |
| 508 | this.layoutItems(this.items, e), this._isLayoutInited = !0 |
| 509 | }, c._init = c.layout, c._resetLayout = function () { |
| 510 | this.getSize() |
| 511 | }, c.getSize = function () { |
| 512 | this.size = i(this.element) |
| 513 | }, c._getMeasurement = function (t, e) { |
| 514 | var o, n = this.options[t]; |
| 515 | n ? ("string" == typeof n ? o = this.element.querySelector(n) : n instanceof HTMLElement && (o = n), this[t] = o ? i(o)[e] : n) : this[t] = 0 |
| 516 | }, c.layoutItems = function (t, e) { |
| 517 | t = this._getItemsForLayout(t), this._layoutItems(t, e), this._postLayout() |
| 518 | }, c._getItemsForLayout = function (t) { |
| 519 | return t.filter(function (t) { |
| 520 | return !t.isIgnored |
| 521 | }) |
| 522 | }, c._layoutItems = function (t, e) { |
| 523 | if (this._emitCompleteOnItems("layout", t), t && t.length) { |
| 524 | var i = []; |
| 525 | t.forEach(function (t) { |
| 526 | var o = this._getItemLayoutPosition(t); |
| 527 | o.item = t, o.isInstant = e || t.isLayoutInstant, i.push(o) |
| 528 | }, this), this._processLayoutQueue(i) |
| 529 | } |
| 530 | }, c._getItemLayoutPosition = function () { |
| 531 | return {x: 0, y: 0} |
| 532 | }, c._processLayoutQueue = function (t) { |
| 533 | this.updateStagger(), t.forEach(function (t, e) { |
| 534 | this._positionItem(t.item, t.x, t.y, t.isInstant, e) |
| 535 | }, this) |
| 536 | }, c.updateStagger = function () { |
| 537 | var t = this.options.stagger; |
| 538 | return null === t || void 0 === t ? void (this.stagger = 0) : (this.stagger = a(t), this.stagger) |
| 539 | }, c._positionItem = function (t, e, i, o, n) { |
| 540 | o ? t.goTo(e, i) : (t.stagger(n * this.stagger), t.moveTo(e, i)) |
| 541 | }, c._postLayout = function () { |
| 542 | this.resizeContainer() |
| 543 | }, c.resizeContainer = function () { |
| 544 | var t = this._getOption("resizeContainer"); |
| 545 | if (t) { |
| 546 | var e = this._getContainerSize(); |
| 547 | e && (this._setContainerMeasure(e.width, !0), this._setContainerMeasure(e.height, !1)) |
| 548 | } |
| 549 | }, c._getContainerSize = d, c._setContainerMeasure = function (t, e) { |
| 550 | if (void 0 !== t) { |
| 551 | var i = this.size; |
| 552 | i.isBorderBox && (t += e ? i.paddingLeft + i.paddingRight + i.borderLeftWidth + i.borderRightWidth : i.paddingBottom + i.paddingTop + i.borderTopWidth + i.borderBottomWidth), t = Math.max(t, 0), this.element.style[e ? "width" : "height"] = t + "px" |
| 553 | } |
| 554 | }, c._emitCompleteOnItems = function (t, e) { |
| 555 | function i() { |
| 556 | n.dispatchEvent(t + "Complete", null, [e]) |
| 557 | } |
| 558 | |
| 559 | function o() { |
| 560 | r++, r == s && i() |
| 561 | } |
| 562 | |
| 563 | var n = this, s = e.length; |
| 564 | if (!e || !s) return void i(); |
| 565 | var r = 0; |
| 566 | e.forEach(function (e) { |
| 567 | e.once(t, o) |
| 568 | }) |
| 569 | }, c.dispatchEvent = function (t, e, i) { |
| 570 | var o = e ? [e].concat(i) : i; |
| 571 | if (this.emitEvent(t, o), h) if (this.$element = this.$element || h(this.element), e) { |
| 572 | var n = h.Event(e); |
| 573 | n.type = t, this.$element.trigger(n, i) |
| 574 | } else this.$element.trigger(t, i) |
| 575 | }, c.ignore = function (t) { |
| 576 | var e = this.getItem(t); |
| 577 | e && (e.isIgnored = !0) |
| 578 | }, c.unignore = function (t) { |
| 579 | var e = this.getItem(t); |
| 580 | e && delete e.isIgnored |
| 581 | }, c.stamp = function (t) { |
| 582 | t = this._find(t), t && (this.stamps = this.stamps.concat(t), t.forEach(this.ignore, this)) |
| 583 | }, c.unstamp = function (t) { |
| 584 | t = this._find(t), t && t.forEach(function (t) { |
| 585 | o.removeFrom(this.stamps, t), this.unignore(t) |
| 586 | }, this) |
| 587 | }, c._find = function (t) { |
| 588 | if (t) return "string" == typeof t && (t = this.element.querySelectorAll(t)), t = o.makeArray(t) |
| 589 | }, c._manageStamps = function () { |
| 590 | this.stamps && this.stamps.length && (this._getBoundingRect(), this.stamps.forEach(this._manageStamp, this)) |
| 591 | }, c._getBoundingRect = function () { |
| 592 | var t = this.element.getBoundingClientRect(), e = this.size; |
| 593 | this._boundingRect = { |
| 594 | left: t.left + e.paddingLeft + e.borderLeftWidth, |
| 595 | top: t.top + e.paddingTop + e.borderTopWidth, |
| 596 | right: t.right - (e.paddingRight + e.borderRightWidth), |
| 597 | bottom: t.bottom - (e.paddingBottom + e.borderBottomWidth) |
| 598 | } |
| 599 | }, c._manageStamp = d, c._getElementOffset = function (t) { |
| 600 | var e = t.getBoundingClientRect(), o = this._boundingRect, n = i(t), s = { |
| 601 | left: e.left - o.left - n.marginLeft, |
| 602 | top: e.top - o.top - n.marginTop, |
| 603 | right: o.right - e.right - n.marginRight, |
| 604 | bottom: o.bottom - e.bottom - n.marginBottom |
| 605 | }; |
| 606 | return s |
| 607 | }, c.handleEvent = o.handleEvent, c.bindResize = function () { |
| 608 | t.addEventListener("resize", this), this.isResizeBound = !0 |
| 609 | }, c.unbindResize = function () { |
| 610 | t.removeEventListener("resize", this), this.isResizeBound = !1 |
| 611 | }, c.onresize = function () { |
| 612 | this.resize() |
| 613 | }, o.debounceMethod(s, "onresize", 100), c.resize = function () { |
| 614 | this.isResizeBound && this.needsResizeLayout() && this.layout() |
| 615 | }, c.needsResizeLayout = function () { |
| 616 | var t = i(this.element), e = this.size && t; |
| 617 | return e && t.innerWidth !== this.size.innerWidth |
| 618 | }, c.addItems = function (t) { |
| 619 | var e = this._itemize(t); |
| 620 | return e.length && (this.items = this.items.concat(e)), e |
| 621 | }, c.appended = function (t) { |
| 622 | var e = this.addItems(t); |
| 623 | e.length && (this.layoutItems(e, !0), this.reveal(e)) |
| 624 | }, c.prepended = function (t) { |
| 625 | var e = this._itemize(t); |
| 626 | if (e.length) { |
| 627 | var i = this.items.slice(0); |
| 628 | this.items = e.concat(i), this._resetLayout(), this._manageStamps(), this.layoutItems(e, !0), this.reveal(e), this.layoutItems(i) |
| 629 | } |
| 630 | }, c.reveal = function (t) { |
| 631 | if (this._emitCompleteOnItems("reveal", t), t && t.length) { |
| 632 | var e = this.updateStagger(); |
| 633 | t.forEach(function (t, i) { |
| 634 | t.stagger(i * e), t.reveal() |
| 635 | }) |
| 636 | } |
| 637 | }, c.hide = function (t) { |
| 638 | if (this._emitCompleteOnItems("hide", t), t && t.length) { |
| 639 | var e = this.updateStagger(); |
| 640 | t.forEach(function (t, i) { |
| 641 | t.stagger(i * e), t.hide() |
| 642 | }) |
| 643 | } |
| 644 | }, c.revealItemElements = function (t) { |
| 645 | var e = this.getItems(t); |
| 646 | this.reveal(e) |
| 647 | }, c.hideItemElements = function (t) { |
| 648 | var e = this.getItems(t); |
| 649 | this.hide(e) |
| 650 | }, c.getItem = function (t) { |
| 651 | for (var e = 0; e < this.items.length; e++) { |
| 652 | var i = this.items[e]; |
| 653 | if (i.element == t) return i |
| 654 | } |
| 655 | }, c.getItems = function (t) { |
| 656 | t = o.makeArray(t); |
| 657 | var e = []; |
| 658 | return t.forEach(function (t) { |
| 659 | var i = this.getItem(t); |
| 660 | i && e.push(i) |
| 661 | }, this), e |
| 662 | }, c.remove = function (t) { |
| 663 | var e = this.getItems(t); |
| 664 | this._emitCompleteOnItems("remove", e), e && e.length && e.forEach(function (t) { |
| 665 | t.remove(), o.removeFrom(this.items, t) |
| 666 | }, this) |
| 667 | }, c.destroy = function () { |
| 668 | var t = this.element.style; |
| 669 | t.height = "", t.position = "", t.width = "", this.items.forEach(function (t) { |
| 670 | t.destroy() |
| 671 | }), this.unbindResize(); |
| 672 | var e = this.element.outlayerGUID; |
| 673 | delete f[e], delete this.element.outlayerGUID, h && h.removeData(this.element, this.constructor.namespace) |
| 674 | }, s.data = function (t) { |
| 675 | t = o.getQueryElement(t); |
| 676 | var e = t && t.outlayerGUID; |
| 677 | return e && f[e] |
| 678 | }, s.create = function (t, e) { |
| 679 | var i = r(s); |
| 680 | return i.defaults = o.extend({}, s.defaults), o.extend(i.defaults, e), i.compatOptions = o.extend({}, s.compatOptions), i.namespace = t, i.data = s.data, i.Item = r(n), o.htmlInit(i, t), h && h.bridget && h.bridget(t, i), i |
| 681 | }; |
| 682 | var m = {ms: 1, s: 1e3}; |
| 683 | return s.Item = n, s |
| 684 | }), function (t, e) { |
| 685 | "function" == typeof define && define.amd ? define("isotope-layout/js/item", ["outlayer/outlayer"], e) : "object" == typeof module && module.exports ? module.exports = e(require("outlayer")) : (t.Smashotope = t.Smashotope || {}, t.Smashotope.Item = e(t.Outlayer)) |
| 686 | }(window, function (t) { |
| 687 | "use strict"; |
| 688 | |
| 689 | function e() { |
| 690 | t.Item.apply(this, arguments) |
| 691 | } |
| 692 | |
| 693 | var i = e.prototype = Object.create(t.Item.prototype), o = i._create; |
| 694 | i._create = function () { |
| 695 | this.id = this.layout.itemGUID++, o.call(this), this.sortData = {} |
| 696 | }, i.updateSortData = function () { |
| 697 | if (!this.isIgnored) { |
| 698 | this.sortData.id = this.id, this.sortData["original-order"] = this.id, this.sortData.random = Math.random(); |
| 699 | var t = this.layout.options.getSortData, e = this.layout._sorters; |
| 700 | for (var i in t) { |
| 701 | var o = e[i]; |
| 702 | this.sortData[i] = o(this.element, this) |
| 703 | } |
| 704 | } |
| 705 | }; |
| 706 | var n = i.destroy; |
| 707 | return i.destroy = function () { |
| 708 | n.apply(this, arguments), this.css({display: ""}) |
| 709 | }, e |
| 710 | }), function (t, e) { |
| 711 | "function" == typeof define && define.amd ? define("isotope-layout/js/layout-mode", ["get-size/get-size", "outlayer/outlayer"], e) : "object" == typeof module && module.exports ? module.exports = e(require("get-size"), require("outlayer")) : (t.Smashotope = t.Smashotope || {}, t.Smashotope.LayoutMode = e(t.getSize, t.Outlayer)) |
| 712 | }(window, function (t, e) { |
| 713 | "use strict"; |
| 714 | |
| 715 | function i(t) { |
| 716 | this.smashotope = t, t && (this.options = t.options[this.namespace], this.element = t.element, this.items = t.filteredItems, this.size = t.size) |
| 717 | } |
| 718 | |
| 719 | var o = i.prototype, |
| 720 | n = ["_resetLayout", "_getItemLayoutPosition", "_manageStamp", "_getContainerSize", "_getElementOffset", "needsResizeLayout", "_getOption"]; |
| 721 | return n.forEach(function (t) { |
| 722 | o[t] = function () { |
| 723 | return e.prototype[t].apply(this.smashotope, arguments) |
| 724 | } |
| 725 | }), o.needsVerticalResizeLayout = function () { |
| 726 | var e = t(this.smashotope.element), i = this.smashotope.size && e; |
| 727 | return i && e.innerHeight != this.smashotope.size.innerHeight |
| 728 | }, o._getMeasurement = function () { |
| 729 | this.smashotope._getMeasurement.apply(this, arguments) |
| 730 | }, o.getColumnWidth = function () { |
| 731 | this.getSegmentSize("column", "Width") |
| 732 | }, o.getRowHeight = function () { |
| 733 | this.getSegmentSize("row", "Height") |
| 734 | }, o.getSegmentSize = function (t, e) { |
| 735 | var i = t + e, o = "outer" + e; |
| 736 | if (this._getMeasurement(i, o), !this[i]) { |
| 737 | var n = this.getFirstItemSize(); |
| 738 | this[i] = n && n[o] || this.smashotope.size["inner" + e] |
| 739 | } |
| 740 | }, o.getFirstItemSize = function () { |
| 741 | var e = this.smashotope.filteredItems[0]; |
| 742 | return e && e.element && t(e.element) |
| 743 | }, o.layout = function () { |
| 744 | this.smashotope.layout.apply(this.smashotope, arguments) |
| 745 | }, o.getSize = function () { |
| 746 | this.smashotope.getSize(), this.size = this.smashotope.size |
| 747 | }, i.modes = {}, i.create = function (t, e) { |
| 748 | function n() { |
| 749 | i.apply(this, arguments) |
| 750 | } |
| 751 | |
| 752 | return n.prototype = Object.create(o), n.prototype.constructor = n, e && (n.options = e), n.prototype.namespace = t, i.modes[t] = n, n |
| 753 | }, i |
| 754 | }), function (t, e) { |
| 755 | "function" == typeof define && define.amd ? define("masonry-layout/masonry", ["outlayer/outlayer", "get-size/get-size"], e) : "object" == typeof module && module.exports ? module.exports = e(require("outlayer"), require("get-size")) : t.Masonry = e(t.Outlayer, t.getSize) |
| 756 | }(window, function (t, e) { |
| 757 | var i = t.create("masonry"); |
| 758 | i.compatOptions.fitWidth = "isFitWidth"; |
| 759 | var o = i.prototype; |
| 760 | return o._resetLayout = function () { |
| 761 | this.getSize(), this._getMeasurement("columnWidth", "outerWidth"), this._getMeasurement("gutter", "outerWidth"), this.measureColumns(), this.colYs = []; |
| 762 | for (var t = 0; t < this.cols; t++) this.colYs.push(0); |
| 763 | this.maxY = 0, this.horizontalColIndex = 0 |
| 764 | }, o.measureColumns = function () { |
| 765 | if (this.getContainerWidth(), !this.columnWidth) { |
| 766 | var t = this.items[0], i = t && t.element; |
| 767 | this.columnWidth = i && e(i).outerWidth || this.containerWidth |
| 768 | } |
| 769 | var o = this.columnWidth += this.gutter, n = this.containerWidth + this.gutter, s = n / o, r = o - n % o, |
| 770 | a = r && r < 1 ? "round" : "floor"; |
| 771 | s = Math[a](s), this.cols = Math.max(s, 1) |
| 772 | }, o.getContainerWidth = function () { |
| 773 | var t = this._getOption("fitWidth"), i = t ? this.element.parentNode : this.element, o = e(i); |
| 774 | this.containerWidth = o && o.innerWidth |
| 775 | }, o._getItemLayoutPosition = function (t) { |
| 776 | t.getSize(); |
| 777 | var e = t.size.outerWidth % this.columnWidth, i = e && e < 1 ? "round" : "ceil", |
| 778 | o = Math[i](t.size.outerWidth / this.columnWidth); |
| 779 | o = Math.min(o, this.cols); |
| 780 | for (var n = this.options.horizontalOrder ? "_getHorizontalColPosition" : "_getTopColPosition", s = this[n](o, t), r = { |
| 781 | x: this.columnWidth * s.col, |
| 782 | y: s.y |
| 783 | }, a = s.y + t.size.outerHeight, u = o + s.col, h = s.col; h < u; h++) this.colYs[h] = a; |
| 784 | return r |
| 785 | }, o._getTopColPosition = function (t) { |
| 786 | var e = this._getTopColGroup(t), i = Math.min.apply(Math, e); |
| 787 | return {col: e.indexOf(i), y: i} |
| 788 | }, o._getTopColGroup = function (t) { |
| 789 | if (t < 2) return this.colYs; |
| 790 | for (var e = [], i = this.cols + 1 - t, o = 0; o < i; o++) e[o] = this._getColGroupY(o, t); |
| 791 | return e |
| 792 | }, o._getColGroupY = function (t, e) { |
| 793 | if (e < 2) return this.colYs[t]; |
| 794 | var i = this.colYs.slice(t, t + e); |
| 795 | return Math.max.apply(Math, i) |
| 796 | }, o._getHorizontalColPosition = function (t, e) { |
| 797 | var i = this.horizontalColIndex % this.cols, o = t > 1 && i + t > this.cols; |
| 798 | i = o ? 0 : i; |
| 799 | var n = e.size.outerWidth && e.size.outerHeight; |
| 800 | return this.horizontalColIndex = n ? i + t : this.horizontalColIndex, {col: i, y: this._getColGroupY(i, t)} |
| 801 | }, o._manageStamp = function (t) { |
| 802 | var i = e(t), o = this._getElementOffset(t), n = this._getOption("originLeft"), s = n ? o.left : o.right, |
| 803 | r = s + i.outerWidth, a = Math.floor(s / this.columnWidth); |
| 804 | a = Math.max(0, a); |
| 805 | var u = Math.floor(r / this.columnWidth); |
| 806 | u -= r % this.columnWidth ? 0 : 1, u = Math.min(this.cols - 1, u); |
| 807 | for (var h = this._getOption("originTop"), d = (h ? o.top : o.bottom) + i.outerHeight, l = a; l <= u; l++) this.colYs[l] = Math.max(d, this.colYs[l]) |
| 808 | }, o._getContainerSize = function () { |
| 809 | this.maxY = Math.max.apply(Math, this.colYs); |
| 810 | var t = {height: this.maxY}; |
| 811 | return this._getOption("fitWidth") && (t.width = this._getContainerFitWidth()), t |
| 812 | }, o._getContainerFitWidth = function () { |
| 813 | for (var t = 0, e = this.cols; --e && 0 === this.colYs[e];) t++; |
| 814 | return (this.cols - t) * this.columnWidth - this.gutter |
| 815 | }, o.needsResizeLayout = function () { |
| 816 | var t = this.containerWidth; |
| 817 | return this.getContainerWidth(), t != this.containerWidth |
| 818 | }, i |
| 819 | }), function (t, e) { |
| 820 | "function" == typeof define && define.amd ? define("isotope-layout/js/layout-modes/masonry", ["../layout-mode", "masonry-layout/masonry"], e) : "object" == typeof module && module.exports ? module.exports = e(require("../layout-mode"), require("masonry-layout")) : e(t.Smashotope.LayoutMode, t.Masonry) |
| 821 | }(window, function (t, e) { |
| 822 | "use strict"; |
| 823 | var i = t.create("masonry"), o = i.prototype, n = {_getElementOffset: !0, layout: !0, _getMeasurement: !0}; |
| 824 | for (var s in e.prototype) n[s] || (o[s] = e.prototype[s]); |
| 825 | var r = o.measureColumns; |
| 826 | o.measureColumns = function () { |
| 827 | this.items = this.smashotope.filteredItems, r.call(this) |
| 828 | }; |
| 829 | var a = o._getOption; |
| 830 | return o._getOption = function (t) { |
| 831 | return "fitWidth" == t ? void 0 !== this.options.isFitWidth ? this.options.isFitWidth : this.options.fitWidth : a.apply(this.smashotope, arguments) |
| 832 | }, i |
| 833 | }), function (t, e) { |
| 834 | "function" == typeof define && define.amd ? define("isotope-layout/js/layout-modes/fit-rows", ["../layout-mode"], e) : "object" == typeof exports ? module.exports = e(require("../layout-mode")) : e(t.Smashotope.LayoutMode) |
| 835 | }(window, function (t) { |
| 836 | "use strict"; |
| 837 | var e = t.create("fitRows"), i = e.prototype; |
| 838 | return i._resetLayout = function () { |
| 839 | this.x = 0, this.y = 0, this.maxY = 0, this._getMeasurement("gutter", "outerWidth") |
| 840 | }, i._getItemLayoutPosition = function (t) { |
| 841 | t.getSize(); |
| 842 | var e = t.size.outerWidth + this.gutter, i = this.smashotope.size.innerWidth + this.gutter; |
| 843 | 0 !== this.x && e + this.x > i && (this.x = 0, this.y = this.maxY); |
| 844 | var o = {x: this.x, y: this.y}; |
| 845 | return this.maxY = Math.max(this.maxY, this.y + t.size.outerHeight), this.x += e, o |
| 846 | }, i._getContainerSize = function () { |
| 847 | return {height: this.maxY} |
| 848 | }, e |
| 849 | }), function (t, e) { |
| 850 | "function" == typeof define && define.amd ? define("isotope-layout/js/layout-modes/vertical", ["../layout-mode"], e) : "object" == typeof module && module.exports ? module.exports = e(require("../layout-mode")) : e(t.Smashotope.LayoutMode) |
| 851 | }(window, function (t) { |
| 852 | "use strict"; |
| 853 | var e = t.create("vertical", {horizontalAlignment: 0}), i = e.prototype; |
| 854 | return i._resetLayout = function () { |
| 855 | this.y = 0 |
| 856 | }, i._getItemLayoutPosition = function (t) { |
| 857 | t.getSize(); |
| 858 | var e = (this.smashotope.size.innerWidth - t.size.outerWidth) * this.options.horizontalAlignment, |
| 859 | i = this.y; |
| 860 | return this.y += t.size.outerHeight, {x: e, y: i} |
| 861 | }, i._getContainerSize = function () { |
| 862 | return {height: this.y} |
| 863 | }, e |
| 864 | }), function (t, e) { |
| 865 | "function" == typeof define && define.amd ? define(["outlayer/outlayer", "get-size/get-size", "desandro-matches-selector/matches-selector", "fizzy-ui-utils/utils", "isotope-layout/js/item", "isotope-layout/js/layout-mode", "isotope-layout/js/layout-modes/masonry", "isotope-layout/js/layout-modes/fit-rows", "isotope-layout/js/layout-modes/vertical"], function (i, o, n, s, r, a) { |
| 866 | return e(t, i, o, n, s, r, a) |
| 867 | }) : "object" == typeof module && module.exports ? module.exports = e(t, require("outlayer"), require("get-size"), require("desandro-matches-selector"), require("fizzy-ui-utils"), require("isotope-layout/js/item"), require("isotope-layout/js/layout-mode"), require("isotope-layout/js/layout-modes/masonry"), require("isotope-layout/js/layout-modes/fit-rows"), require("isotope-layout/js/layout-modes/vertical")) : t.Smashotope = e(t, t.Outlayer, t.getSize, t.matchesSelector, t.fizzyUIUtils, t.Smashotope.Item, t.Smashotope.LayoutMode) |
| 868 | }(window, function (t, e, i, o, n, s, r) { |
| 869 | function a(t, e) { |
| 870 | return function (i, o) { |
| 871 | for (var n = 0; n < t.length; n++) { |
| 872 | var s = t[n], r = i.sortData[s], a = o.sortData[s]; |
| 873 | if (r > a || r < a) { |
| 874 | var u = void 0 !== e[s] ? e[s] : e, h = u ? 1 : -1; |
| 875 | return (r > a ? 1 : -1) * h |
| 876 | } |
| 877 | } |
| 878 | return 0 |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | var u = t.jQuery, h = String.prototype.trim ? function (t) { |
| 883 | return t.trim() |
| 884 | } : function (t) { |
| 885 | return t.replace(/^\s+|\s+$/g, "") |
| 886 | }, d = e.create("smashotope", {layoutMode: "masonry", isJQueryFiltering: !0, sortAscending: !0}); |
| 887 | d.Item = s, d.LayoutMode = r; |
| 888 | var l = d.prototype; |
| 889 | l._create = function () { |
| 890 | this.itemGUID = 0, this._sorters = {}, this._getSorters(), e.prototype._create.call(this), this.modes = {}, this.filteredItems = this.items, this.sortHistory = ["original-order"]; |
| 891 | for (var t in r.modes) this._initLayoutMode(t) |
| 892 | }, l.reloadItems = function () { |
| 893 | this.itemGUID = 0, e.prototype.reloadItems.call(this) |
| 894 | }, l._itemize = function () { |
| 895 | for (var t = e.prototype._itemize.apply(this, arguments), i = 0; i < t.length; i++) { |
| 896 | var o = t[i]; |
| 897 | o.id = this.itemGUID++ |
| 898 | } |
| 899 | return this._updateItemsSortData(t), t |
| 900 | }, l._initLayoutMode = function (t) { |
| 901 | var e = r.modes[t], i = this.options[t] || {}; |
| 902 | this.options[t] = e.options ? n.extend(e.options, i) : i, this.modes[t] = new e(this) |
| 903 | }, l.layout = function () { |
| 904 | return !this._isLayoutInited && this._getOption("initLayout") ? void this.arrange() : void this._layout() |
| 905 | }, l._layout = function () { |
| 906 | var t = this._getIsInstant(); |
| 907 | this._resetLayout(), this._manageStamps(), this.layoutItems(this.filteredItems, t), this._isLayoutInited = !0 |
| 908 | }, l.arrange = function (t) { |
| 909 | this.option(t), this._getIsInstant(); |
| 910 | var e = this._filter(this.items); |
| 911 | this.filteredItems = e.matches, this._bindArrangeComplete(), this._isInstant ? this._noTransition(this._hideReveal, [e]) : this._hideReveal(e), this._sort(), this._layout() |
| 912 | }, l._init = l.arrange, l._hideReveal = function (t) { |
| 913 | this.reveal(t.needReveal), this.hide(t.needHide) |
| 914 | }, l._getIsInstant = function () { |
| 915 | var t = this._getOption("layoutInstant"), e = void 0 !== t ? t : !this._isLayoutInited; |
| 916 | return this._isInstant = e, e |
| 917 | }, l._bindArrangeComplete = function () { |
| 918 | function t() { |
| 919 | e && i && o && n.dispatchEvent("arrangeComplete", null, [n.filteredItems]) |
| 920 | } |
| 921 | |
| 922 | var e, i, o, n = this; |
| 923 | this.once("layoutComplete", function () { |
| 924 | e = !0, t() |
| 925 | }), this.once("hideComplete", function () { |
| 926 | i = !0, t() |
| 927 | }), this.once("revealComplete", function () { |
| 928 | o = !0, t() |
| 929 | }) |
| 930 | }, l._filter = function (t) { |
| 931 | var e = this.options.filter; |
| 932 | e = e || "*"; |
| 933 | for (var i = [], o = [], n = [], s = this._getFilterTest(e), r = 0; r < t.length; r++) { |
| 934 | var a = t[r]; |
| 935 | if (!a.isIgnored) { |
| 936 | var u = s(a); |
| 937 | u && i.push(a), u && a.isHidden ? o.push(a) : u || a.isHidden || n.push(a) |
| 938 | } |
| 939 | } |
| 940 | return {matches: i, needReveal: o, needHide: n} |
| 941 | }, l._getFilterTest = function (t) { |
| 942 | return u && this.options.isJQueryFiltering ? function (e) { |
| 943 | return u(e.element).is(t); |
| 944 | } : "function" == typeof t ? function (e) { |
| 945 | return t(e.element) |
| 946 | } : function (e) { |
| 947 | return o(e.element, t) |
| 948 | } |
| 949 | }, l.updateSortData = function (t) { |
| 950 | var e; |
| 951 | t ? (t = n.makeArray(t), e = this.getItems(t)) : e = this.items, this._getSorters(), this._updateItemsSortData(e) |
| 952 | }, l._getSorters = function () { |
| 953 | var t = this.options.getSortData; |
| 954 | for (var e in t) { |
| 955 | var i = t[e]; |
| 956 | this._sorters[e] = f(i) |
| 957 | } |
| 958 | }, l._updateItemsSortData = function (t) { |
| 959 | for (var e = t && t.length, i = 0; e && i < e; i++) { |
| 960 | var o = t[i]; |
| 961 | o.updateSortData() |
| 962 | } |
| 963 | }; |
| 964 | var f = function () { |
| 965 | function t(t) { |
| 966 | if ("string" != typeof t) return t; |
| 967 | var i = h(t).split(" "), o = i[0], n = o.match(/^\[(.+)\]$/), s = n && n[1], r = e(s, o), |
| 968 | a = d.sortDataParsers[i[1]]; |
| 969 | return t = a ? function (t) { |
| 970 | return t && a(r(t)) |
| 971 | } : function (t) { |
| 972 | return t && r(t) |
| 973 | } |
| 974 | } |
| 975 | |
| 976 | function e(t, e) { |
| 977 | return t ? function (e) { |
| 978 | return e.getAttribute(t) |
| 979 | } : function (t) { |
| 980 | var i = t.querySelector(e); |
| 981 | return i && i.textContent |
| 982 | } |
| 983 | } |
| 984 | |
| 985 | return t |
| 986 | }(); |
| 987 | d.sortDataParsers = { |
| 988 | parseInt: function (t) { |
| 989 | return parseInt(t, 10) |
| 990 | }, parseFloat: function (t) { |
| 991 | return parseFloat(t) |
| 992 | } |
| 993 | }, l._sort = function () { |
| 994 | if (this.options.sortBy) { |
| 995 | var t = n.makeArray(this.options.sortBy); |
| 996 | this._getIsSameSortBy(t) || (this.sortHistory = t.concat(this.sortHistory)); |
| 997 | var e = a(this.sortHistory, this.options.sortAscending); |
| 998 | this.filteredItems.sort(e) |
| 999 | } |
| 1000 | }, l._getIsSameSortBy = function (t) { |
| 1001 | for (var e = 0; e < t.length; e++) if (t[e] != this.sortHistory[e]) return !1; |
| 1002 | return !0 |
| 1003 | }, l._mode = function () { |
| 1004 | var t = this.options.layoutMode, e = this.modes[t]; |
| 1005 | if (!e) throw new Error("No layout mode: " + t); |
| 1006 | return e.options = this.options[t], e |
| 1007 | }, l._resetLayout = function () { |
| 1008 | e.prototype._resetLayout.call(this), this._mode()._resetLayout() |
| 1009 | }, l._getItemLayoutPosition = function (t) { |
| 1010 | return this._mode()._getItemLayoutPosition(t) |
| 1011 | }, l._manageStamp = function (t) { |
| 1012 | this._mode()._manageStamp(t) |
| 1013 | }, l._getContainerSize = function () { |
| 1014 | return this._mode()._getContainerSize() |
| 1015 | }, l.needsResizeLayout = function () { |
| 1016 | return this._mode().needsResizeLayout() |
| 1017 | }, l.appended = function (t) { |
| 1018 | var e = this.addItems(t); |
| 1019 | if (e.length) { |
| 1020 | var i = this._filterRevealAdded(e); |
| 1021 | this.filteredItems = this.filteredItems.concat(i) |
| 1022 | } |
| 1023 | }, l.prepended = function (t) { |
| 1024 | var e = this._itemize(t); |
| 1025 | if (e.length) { |
| 1026 | this._resetLayout(), this._manageStamps(); |
| 1027 | var i = this._filterRevealAdded(e); |
| 1028 | this.layoutItems(this.filteredItems), this.filteredItems = i.concat(this.filteredItems), this.items = e.concat(this.items) |
| 1029 | } |
| 1030 | }, l._filterRevealAdded = function (t) { |
| 1031 | var e = this._filter(t); |
| 1032 | return this.hide(e.needHide), this.reveal(e.matches), this.layoutItems(e.matches, !0), e.matches |
| 1033 | }, l.insert = function (t) { |
| 1034 | var e = this.addItems(t); |
| 1035 | if (e.length) { |
| 1036 | var i, o, n = e.length; |
| 1037 | for (i = 0; i < n; i++) o = e[i], this.element.appendChild(o.element); |
| 1038 | var s = this._filter(e).matches; |
| 1039 | for (i = 0; i < n; i++) e[i].isLayoutInstant = !0; |
| 1040 | for (this.arrange(), i = 0; i < n; i++) delete e[i].isLayoutInstant; |
| 1041 | this.reveal(s) |
| 1042 | } |
| 1043 | }; |
| 1044 | var c = l.remove; |
| 1045 | return l.remove = function (t) { |
| 1046 | t = n.makeArray(t); |
| 1047 | var e = this.getItems(t); |
| 1048 | c.call(this, t); |
| 1049 | for (var i = e && e.length, o = 0; i && o < i; o++) { |
| 1050 | var s = e[o]; |
| 1051 | n.removeFrom(this.filteredItems, s) |
| 1052 | } |
| 1053 | }, l.shuffle = function () { |
| 1054 | for (var t = 0; t < this.items.length; t++) { |
| 1055 | var e = this.items[t]; |
| 1056 | e.sortData.random = Math.random() |
| 1057 | } |
| 1058 | this.options.sortBy = "random", this._sort(), this._layout() |
| 1059 | }, l._noTransition = function (t, e) { |
| 1060 | var i = this.options.transitionDuration; |
| 1061 | this.options.transitionDuration = 0; |
| 1062 | var o = t.apply(this, e); |
| 1063 | return this.options.transitionDuration = i, o |
| 1064 | }, l.getFilteredItemElements = function () { |
| 1065 | return this.filteredItems.map(function (t) { |
| 1066 | return t.element |
| 1067 | }) |
| 1068 | }, d |
| 1069 | }); |
| 1070 | |
| 1071 | |
| 1072 | // Carousel |
| 1073 | !function (a, b, c, d) { |
| 1074 | function e(b, c) { |
| 1075 | this.settings = null, this.options = a.extend({}, e.Defaults, c), this.$element = a(b), this._handlers = {}, this._plugins = {}, this._supress = {}, this._current = null, this._speed = null, this._coordinates = [], this._breakpoint = null, this._width = null, this._items = [], this._clones = [], this._mergers = [], this._widths = [], this._invalidated = {}, this._pipe = [], this._drag = { |
| 1076 | time: null, |
| 1077 | target: null, |
| 1078 | pointer: null, |
| 1079 | stage: {start: null, current: null}, |
| 1080 | direction: null |
| 1081 | }, this._states = { |
| 1082 | current: {}, |
| 1083 | tags: {initializing: ["busy"], animating: ["busy"], dragging: ["interacting"]} |
| 1084 | }, a.each(["onResize", "onThrottledResize"], a.proxy(function (b, c) { |
| 1085 | this._handlers[c] = a.proxy(this[c], this) |
| 1086 | }, this)), a.each(e.Plugins, a.proxy(function (a, b) { |
| 1087 | this._plugins[a.charAt(0).toLowerCase() + a.slice(1)] = new b(this) |
| 1088 | }, this)), a.each(e.Workers, a.proxy(function (b, c) { |
| 1089 | this._pipe.push({filter: c.filter, run: a.proxy(c.run, this)}) |
| 1090 | }, this)), this.setup(), this.initialize() |
| 1091 | } |
| 1092 | |
| 1093 | e.Defaults = { |
| 1094 | items: 3, |
| 1095 | loop: !1, |
| 1096 | center: !1, |
| 1097 | rewind: !1, |
| 1098 | mouseDrag: !0, |
| 1099 | touchDrag: !0, |
| 1100 | pullDrag: !0, |
| 1101 | freeDrag: !1, |
| 1102 | margin: 0, |
| 1103 | stagePadding: 0, |
| 1104 | merge: !1, |
| 1105 | mergeFit: !0, |
| 1106 | autoWidth: !1, |
| 1107 | startPosition: 0, |
| 1108 | rtl: !1, |
| 1109 | smartSpeed: 250, |
| 1110 | fluidSpeed: !1, |
| 1111 | dragEndSpeed: !1, |
| 1112 | responsive: {}, |
| 1113 | responsiveRefreshRate: 200, |
| 1114 | responsiveBaseElement: b, |
| 1115 | fallbackEasing: "swing", |
| 1116 | info: !1, |
| 1117 | nestedItemSelector: !1, |
| 1118 | itemElement: "div", |
| 1119 | stageElement: "div", |
| 1120 | refreshClass: "sbr-owl-refresh", |
| 1121 | loadedClass: "sbr-owl-loaded", |
| 1122 | loadingClass: "sbr-owl-loading", |
| 1123 | rtlClass: "sbr-owl-rtl", |
| 1124 | responsiveClass: "sbr-owl-responsive", |
| 1125 | dragClass: "sbr-owl-drag", |
| 1126 | itemClass: "sbr-owl-item", |
| 1127 | stageClass: "sbr-owl-stage", |
| 1128 | stageOuterClass: "sbr-owl-stage-outer", |
| 1129 | grabClass: "sbr-owl-grab" |
| 1130 | }, e.Width = {Default: "default", Inner: "inner", Outer: "outer"}, e.Type = { |
| 1131 | Event: "event", |
| 1132 | State: "state" |
| 1133 | }, e.Plugins = {}, e.Workers = [{ |
| 1134 | filter: ["width", "settings"], run: function () { |
| 1135 | this._width = this.$element.width() |
| 1136 | } |
| 1137 | }, { |
| 1138 | filter: ["width", "items", "settings"], run: function (a) { |
| 1139 | a.current = this._items && this._items[this.relative(this._current)] |
| 1140 | } |
| 1141 | }, { |
| 1142 | filter: ["items", "settings"], run: function () { |
| 1143 | this.$stage.children(".cloned").remove() |
| 1144 | } |
| 1145 | }, { |
| 1146 | filter: ["width", "items", "settings"], run: function (a) { |
| 1147 | var b = this.settings.margin || "", c = !this.settings.autoWidth, d = this.settings.rtl, |
| 1148 | e = {width: "auto", "margin-left": d ? b : "", "margin-right": d ? "" : b}; |
| 1149 | !c && this.$stage.children().css(e), a.css = e |
| 1150 | } |
| 1151 | }, { |
| 1152 | filter: ["width", "items", "settings"], run: function (a) { |
| 1153 | var b = (this.width() / this.settings.items).toFixed(3) - this.settings.margin, c = null, |
| 1154 | d = this._items.length, e = !this.settings.autoWidth, f = []; |
| 1155 | for (a.items = { |
| 1156 | merge: !1, |
| 1157 | width: b |
| 1158 | }; d--;) c = this._mergers[d], c = this.settings.mergeFit && Math.min(c, this.settings.items) || c, a.items.merge = c > 1 || a.items.merge, f[d] = e ? b * c : this._items[d].width(); |
| 1159 | this._widths = f |
| 1160 | } |
| 1161 | }, { |
| 1162 | filter: ["items", "settings"], run: function () { |
| 1163 | var b = [], c = this._items, d = this.settings, e = Math.max(2 * d.items, 4), |
| 1164 | f = 2 * Math.ceil(c.length / 2), g = d.loop && c.length ? d.rewind ? e : Math.max(e, f) : 0, h = "", |
| 1165 | i = ""; |
| 1166 | for (g /= 2; g--;) b.push(this.normalize(b.length / 2, !0)), h += c[b[b.length - 1]][0].outerHTML, b.push(this.normalize(c.length - 1 - (b.length - 1) / 2, !0)), i = c[b[b.length - 1]][0].outerHTML + i; |
| 1167 | this._clones = b, a(h).addClass("cloned").appendTo(this.$stage), a(i).addClass("cloned").prependTo(this.$stage) |
| 1168 | } |
| 1169 | }, { |
| 1170 | filter: ["width", "items", "settings"], run: function () { |
| 1171 | for (var a = this.settings.rtl ? 1 : -1, b = this._clones.length + this._items.length, c = -1, d = 0, e = 0, f = []; ++c < b;) d = f[c - 1] || 0, e = this._widths[this.relative(c)] + this.settings.margin, f.push(d + e * a); |
| 1172 | this._coordinates = f |
| 1173 | } |
| 1174 | }, { |
| 1175 | filter: ["width", "items", "settings"], run: function () { |
| 1176 | var a = this.settings.stagePadding, b = this._coordinates, c = { |
| 1177 | width: Math.ceil(Math.abs(b[b.length - 1])) + 2 * a, |
| 1178 | "padding-left": a || "", |
| 1179 | "padding-right": a || "" |
| 1180 | }; |
| 1181 | this.$stage.css(c) |
| 1182 | } |
| 1183 | }, { |
| 1184 | filter: ["width", "items", "settings"], run: function (a) { |
| 1185 | var b = this._coordinates.length, c = !this.settings.autoWidth, d = this.$stage.children(); |
| 1186 | if (c && a.items.merge) for (; b--;) a.css.width = this._widths[this.relative(b)], d.eq(b).css(a.css); else c && (a.css.width = a.items.width, d.css(a.css)) |
| 1187 | } |
| 1188 | }, { |
| 1189 | filter: ["items"], run: function () { |
| 1190 | this._coordinates.length < 1 && this.$stage.removeAttr("style") |
| 1191 | } |
| 1192 | }, { |
| 1193 | filter: ["width", "items", "settings"], run: function (a) { |
| 1194 | a.current = a.current ? this.$stage.children().index(a.current) : 0, a.current = Math.max(this.minimum(), Math.min(this.maximum(), a.current)), this.reset(a.current) |
| 1195 | } |
| 1196 | }, { |
| 1197 | filter: ["position"], run: function () { |
| 1198 | this.animate(this.coordinates(this._current)) |
| 1199 | } |
| 1200 | }, { |
| 1201 | filter: ["width", "position", "items", "settings"], run: function () { |
| 1202 | var a, b, c, d, e = this.settings.rtl ? 1 : -1, f = 2 * this.settings.stagePadding, |
| 1203 | g = this.coordinates(this.current()) + f, h = g + this.width() * e, i = []; |
| 1204 | for (c = 0, d = this._coordinates.length; c < d; c++) a = this._coordinates[c - 1] || 0, b = Math.abs(this._coordinates[c]) + f * e, (this.op(a, "<=", g) && this.op(a, ">", h) || this.op(b, "<", g) && this.op(b, ">", h)) && i.push(c); |
| 1205 | this.$stage.children(".active").removeClass("active"), this.$stage.children(":eq(" + i.join("), :eq(") + ")").addClass("active"), this.settings.center && (this.$stage.children(".center").removeClass("center"), this.$stage.children().eq(this.current()).addClass("center")) |
| 1206 | } |
| 1207 | }], e.prototype.initialize = function () { |
| 1208 | if (this.enter("initializing"), this.trigger("initialize"), this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl), this.settings.autoWidth && !this.is("pre-loading")) { |
| 1209 | var b, c, e; |
| 1210 | b = this.$element.find("img"), c = this.settings.nestedItemSelector ? "." + this.settings.nestedItemSelector : d, e = this.$element.children(c).width(), b.length && e <= 0 && this.preloadAutoWidthImages(b) |
| 1211 | } |
| 1212 | this.$element.addClass(this.options.loadingClass), this.$stage = a("<" + this.settings.stageElement + ' class="' + this.settings.stageClass + '"/>').wrap('<div class="' + this.settings.stageOuterClass + '"/>'), this.$element.append(this.$stage.parent()), this.replace(this.$element.children().not(this.$stage.parent())), this.$element.is(":visible") ? this.refresh() : this.invalidate("width"), this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass), this.registerEventHandlers(), this.leave("initializing"), this.trigger("initialized") |
| 1213 | }, e.prototype.setup = function () { |
| 1214 | var b = this.viewport(), c = this.options.responsive, d = -1, e = null; |
| 1215 | c ? (a.each(c, function (a) { |
| 1216 | a <= b && a > d && (d = Number(a)) |
| 1217 | }), e = a.extend({}, this.options, c[d]), "function" == typeof e.stagePadding && (e.stagePadding = e.stagePadding()), delete e.responsive, e.responsiveClass && this.$element.attr("class", this.$element.attr("class").replace(new RegExp("(" + this.options.responsiveClass + "-)\\S+\\s", "g"), "$1" + d))) : e = a.extend({}, this.options), this.trigger("change", { |
| 1218 | property: { |
| 1219 | name: "settings", |
| 1220 | value: e |
| 1221 | } |
| 1222 | }), this._breakpoint = d, this.settings = e, this.invalidate("settings"), this.trigger("changed", { |
| 1223 | property: { |
| 1224 | name: "settings", |
| 1225 | value: this.settings |
| 1226 | } |
| 1227 | }) |
| 1228 | }, e.prototype.optionsLogic = function () { |
| 1229 | this.settings.autoWidth && (this.settings.stagePadding = !1, this.settings.merge = !1) |
| 1230 | }, e.prototype.prepare = function (b) { |
| 1231 | var c = this.trigger("prepare", {content: b}); |
| 1232 | return c.data || (c.data = a("<" + this.settings.itemElement + "/>").addClass(this.options.itemClass).append(b)), this.trigger("prepared", {content: c.data}), c.data |
| 1233 | }, e.prototype.update = function () { |
| 1234 | for (var b = 0, c = this._pipe.length, d = a.proxy(function (a) { |
| 1235 | return this[a] |
| 1236 | }, this._invalidated), e = {}; b < c;) (this._invalidated.all || a.grep(this._pipe[b].filter, d).length > 0) && this._pipe[b].run(e), b++; |
| 1237 | this._invalidated = {}, !this.is("valid") && this.enter("valid") |
| 1238 | }, e.prototype.width = function (a) { |
| 1239 | switch (a = a || e.Width.Default) { |
| 1240 | case e.Width.Inner: |
| 1241 | case e.Width.Outer: |
| 1242 | return this._width; |
| 1243 | default: |
| 1244 | return this._width - 2 * this.settings.stagePadding + this.settings.margin |
| 1245 | } |
| 1246 | }, e.prototype.refresh = function () { |
| 1247 | this.enter("refreshing"), this.trigger("refresh"), this.setup(), this.optionsLogic(), this.$element.addClass(this.options.refreshClass), this.update(), this.$element.removeClass(this.options.refreshClass), this.leave("refreshing"), this.trigger("refreshed") |
| 1248 | }, e.prototype.onThrottledResize = function () { |
| 1249 | b.clearTimeout(this.resizeTimer), this.resizeTimer = b.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate) |
| 1250 | }, e.prototype.onResize = function () { |
| 1251 | return !!this._items.length && (this._width !== this.$element.width() && (!!this.$element.is(":visible") && (this.enter("resizing"), this.trigger("resize").isDefaultPrevented() ? (this.leave("resizing"), !1) : (this.invalidate("width"), this.refresh(), this.leave("resizing"), void this.trigger("resized"))))) |
| 1252 | }, e.prototype.registerEventHandlers = function () { |
| 1253 | a.support.transition && this.$stage.on(a.support.transition.end + ".owl.core", a.proxy(this.onTransitionEnd, this)), this.settings.responsive !== !1 && this.on(b, "resize", this._handlers.onThrottledResize), this.settings.mouseDrag && (this.$element.addClass(this.options.dragClass), this.$stage.on("mousedown.owl.core", a.proxy(this.onDragStart, this)), this.$stage.on("dragstart.owl.core selectstart.owl.core", function () { |
| 1254 | return !1 |
| 1255 | })), this.settings.touchDrag && (this.$stage.on("touchstart.owl.core", a.proxy(this.onDragStart, this)), this.$stage.on("touchcancel.owl.core", a.proxy(this.onDragEnd, this))) |
| 1256 | }, e.prototype.onDragStart = function (b) { |
| 1257 | var d = null; |
| 1258 | 3 !== b.which && (a.support.transform ? (d = this.$stage.css("transform").replace(/.*\(|\)| /g, "").split(","), d = { |
| 1259 | x: d[16 === d.length ? 12 : 4], |
| 1260 | y: d[16 === d.length ? 13 : 5] |
| 1261 | }) : (d = this.$stage.position(), d = { |
| 1262 | x: this.settings.rtl ? d.left + this.$stage.width() - this.width() + this.settings.margin : d.left, |
| 1263 | y: d.top |
| 1264 | }), this.is("animating") && (a.support.transform ? this.animate(d.x) : this.$stage.stop(), this.invalidate("position")), this.$element.toggleClass(this.options.grabClass, "mousedown" === b.type), this.speed(0), this._drag.time = (new Date).getTime(), this._drag.target = a(b.target), this._drag.stage.start = d, this._drag.stage.current = d, this._drag.pointer = this.pointer(b), a(c).on("mouseup.owl.core touchend.owl.core", a.proxy(this.onDragEnd, this)), a(c).one("mousemove.owl.core touchmove.owl.core", a.proxy(function (b) { |
| 1265 | var d = this.difference(this._drag.pointer, this.pointer(b)); |
| 1266 | a(c).on("mousemove.owl.core touchmove.owl.core", a.proxy(this.onDragMove, this)), Math.abs(d.x) < Math.abs(d.y) && this.is("valid") || (b.preventDefault(), this.enter("dragging"), this.trigger("drag")) |
| 1267 | }, this))) |
| 1268 | }, e.prototype.onDragMove = function (a) { |
| 1269 | var b = null, c = null, d = null, e = this.difference(this._drag.pointer, this.pointer(a)), |
| 1270 | f = this.difference(this._drag.stage.start, e); |
| 1271 | this.is("dragging") && (a.preventDefault(), this.settings.loop ? (b = this.coordinates(this.minimum()), c = this.coordinates(this.maximum() + 1) - b, f.x = ((f.x - b) % c + c) % c + b) : (b = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()), c = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()), d = this.settings.pullDrag ? -1 * e.x / 5 : 0, f.x = Math.max(Math.min(f.x, b + d), c + d)), this._drag.stage.current = f, this.animate(f.x)) |
| 1272 | }, e.prototype.onDragEnd = function (b) { |
| 1273 | var d = this.difference(this._drag.pointer, this.pointer(b)), e = this._drag.stage.current, |
| 1274 | f = d.x > 0 ^ this.settings.rtl ? "left" : "right"; |
| 1275 | a(c).off(".owl.core"), this.$element.removeClass(this.options.grabClass), (0 !== d.x && this.is("dragging") || !this.is("valid")) && (this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed), this.current(this.closest(e.x, 0 !== d.x ? f : this._drag.direction)), this.invalidate("position"), this.update(), this._drag.direction = f, (Math.abs(d.x) > 3 || (new Date).getTime() - this._drag.time > 300) && this._drag.target.one("click.owl.core", function () { |
| 1276 | return !1 |
| 1277 | })), this.is("dragging") && (this.leave("dragging"), this.trigger("dragged")) |
| 1278 | }, e.prototype.closest = function (b, c) { |
| 1279 | var d = -1, e = 30, f = this.width(), g = this.coordinates(); |
| 1280 | return this.settings.freeDrag || a.each(g, a.proxy(function (a, h) { |
| 1281 | return "left" === c && b > h - e && b < h + e ? d = a : "right" === c && b > h - f - e && b < h - f + e ? d = a + 1 : this.op(b, "<", h) && this.op(b, ">", g[a + 1] || h - f) && (d = "left" === c ? a + 1 : a), d === -1 |
| 1282 | }, this)), this.settings.loop || (this.op(b, ">", g[this.minimum()]) ? d = b = this.minimum() : this.op(b, "<", g[this.maximum()]) && (d = b = this.maximum())), d |
| 1283 | }, e.prototype.animate = function (b) { |
| 1284 | var c = this.speed() > 0; |
| 1285 | this.is("animating") && this.onTransitionEnd(), c && (this.enter("animating"), this.trigger("translate")), a.support.transform3d && a.support.transition ? this.$stage.css({ |
| 1286 | transform: "translate3d(" + b + "px,0px,0px)", |
| 1287 | transition: this.speed() / 1e3 + "s" |
| 1288 | }) : c ? this.$stage.animate({left: b + "px"}, this.speed(), this.settings.fallbackEasing, a.proxy(this.onTransitionEnd, this)) : this.$stage.css({left: b + "px"}) |
| 1289 | }, e.prototype.is = function (a) { |
| 1290 | return this._states.current[a] && this._states.current[a] > 0 |
| 1291 | }, e.prototype.current = function (a) { |
| 1292 | if (a === d) return this._current; |
| 1293 | if (0 === this._items.length) return d; |
| 1294 | if (a = this.normalize(a), this._current !== a) { |
| 1295 | var b = this.trigger("change", {property: {name: "position", value: a}}); |
| 1296 | b.data !== d && (a = this.normalize(b.data)), this._current = a, this.invalidate("position"), this.trigger("changed", { |
| 1297 | property: { |
| 1298 | name: "position", |
| 1299 | value: this._current |
| 1300 | } |
| 1301 | }) |
| 1302 | } |
| 1303 | return this._current |
| 1304 | }, e.prototype.invalidate = function (b) { |
| 1305 | return "string" === typeof b && (this._invalidated[b] = !0, this.is("valid") && this.leave("valid")), a.map(this._invalidated, function (a, b) { |
| 1306 | return b |
| 1307 | }) |
| 1308 | }, e.prototype.reset = function (a) { |
| 1309 | a = this.normalize(a), a !== d && (this._speed = 0, this._current = a, this.suppress(["translate", "translated"]), this.animate(this.coordinates(a)), this.release(["translate", "translated"])) |
| 1310 | }, e.prototype.normalize = function (a, b) { |
| 1311 | var c = this._items.length, e = b ? 0 : this._clones.length; |
| 1312 | return !this.isNumeric(a) || c < 1 ? a = d : (a < 0 || a >= c + e) && (a = ((a - e / 2) % c + c) % c + e / 2), a |
| 1313 | }, e.prototype.relative = function (a) { |
| 1314 | return a -= this._clones.length / 2, this.normalize(a, !0) |
| 1315 | }, e.prototype.maximum = function (a) { |
| 1316 | var b, c, d, e = this.settings, f = this._coordinates.length; |
| 1317 | if (e.loop) f = this._clones.length / 2 + this._items.length - 1; else if (e.autoWidth || e.merge) { |
| 1318 | for (b = this._items.length, c = this._items[--b].width(), d = this.$element.width(); b-- && (c += this._items[b].width() + this.settings.margin, !(c > d));) ; |
| 1319 | f = b + 1 |
| 1320 | } else f = e.center ? this._items.length - 1 : this._items.length - e.items; |
| 1321 | return a && (f -= this._clones.length / 2), Math.max(f, 0) |
| 1322 | }, e.prototype.minimum = function (a) { |
| 1323 | return a ? 0 : this._clones.length / 2 |
| 1324 | }, e.prototype.items = function (a) { |
| 1325 | return a === d ? this._items.slice() : (a = this.normalize(a, !0), this._items[a]) |
| 1326 | }, e.prototype.mergers = function (a) { |
| 1327 | return a === d ? this._mergers.slice() : (a = this.normalize(a, !0), this._mergers[a]) |
| 1328 | }, e.prototype.clones = function (b) { |
| 1329 | var c = this._clones.length / 2, e = c + this._items.length, f = function (a) { |
| 1330 | return a % 2 === 0 ? e + a / 2 : c - (a + 1) / 2 |
| 1331 | }; |
| 1332 | return b === d ? a.map(this._clones, function (a, b) { |
| 1333 | return f(b) |
| 1334 | }) : a.map(this._clones, function (a, c) { |
| 1335 | return a === b ? f(c) : null |
| 1336 | }) |
| 1337 | }, e.prototype.speed = function (a) { |
| 1338 | return a !== d && (this._speed = a), this._speed |
| 1339 | }, e.prototype.coordinates = function (b) { |
| 1340 | var c, e = 1, f = b - 1; |
| 1341 | return b === d ? a.map(this._coordinates, a.proxy(function (a, b) { |
| 1342 | return this.coordinates(b) |
| 1343 | }, this)) : (this.settings.center ? (this.settings.rtl && (e = -1, f = b + 1), c = this._coordinates[b], c += (this.width() - c + (this._coordinates[f] || 0)) / 2 * e) : c = this._coordinates[f] || 0, c = Math.ceil(c)) |
| 1344 | }, e.prototype.duration = function (a, b, c) { |
| 1345 | return 0 === c ? 0 : Math.min(Math.max(Math.abs(b - a), 1), 6) * Math.abs(c || this.settings.smartSpeed) |
| 1346 | }, e.prototype.to = function (a, b) { |
| 1347 | var c = this.current(), d = null, e = a - this.relative(c), f = (e > 0) - (e < 0), g = this._items.length, |
| 1348 | h = this.minimum(), i = this.maximum(); |
| 1349 | this.settings.loop ? (!this.settings.rewind && Math.abs(e) > g / 2 && (e += f * -1 * g), a = c + e, d = ((a - h) % g + g) % g + h, d !== a && d - e <= i && d - e > 0 && (c = d - e, a = d, this.reset(c))) : this.settings.rewind ? (i += 1, a = (a % i + i) % i) : a = Math.max(h, Math.min(i, a)), this.speed(this.duration(c, a, b)), this.current(a), this.$element.is(":visible") && this.update() |
| 1350 | }, e.prototype.next = function (a) { |
| 1351 | a = a || !1, this.to(this.relative(this.current()) + 1, a) |
| 1352 | }, e.prototype.prev = function (a) { |
| 1353 | a = a || !1, this.to(this.relative(this.current()) - 1, a) |
| 1354 | }, e.prototype.onTransitionEnd = function (a) { |
| 1355 | if (a !== d && (a.stopPropagation(), (a.target || a.srcElement || a.originalTarget) !== this.$stage.get(0))) return !1; |
| 1356 | this.leave("animating"), this.trigger("translated") |
| 1357 | }, e.prototype.viewport = function () { |
| 1358 | var d; |
| 1359 | return this.options.responsiveBaseElement !== b ? d = a(this.options.responsiveBaseElement).width() : b.innerWidth ? d = b.innerWidth : c.documentElement && c.documentElement.clientWidth ? d = c.documentElement.clientWidth : console.warn("Can not detect viewport width."), d |
| 1360 | }, e.prototype.replace = function (b) { |
| 1361 | this.$stage.empty(), this._items = [], b && (b = b instanceof jQuery ? b : a(b)), this.settings.nestedItemSelector && (b = b.find("." + this.settings.nestedItemSelector)), b.filter(function () { |
| 1362 | return 1 === this.nodeType |
| 1363 | }).each(a.proxy(function (a, b) { |
| 1364 | b = this.prepare(b), this.$stage.append(b), this._items.push(b), this._mergers.push(1 * b.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1) |
| 1365 | }, this)), this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0), this.invalidate("items") |
| 1366 | }, e.prototype.add = function (b, c) { |
| 1367 | var e = this.relative(this._current); |
| 1368 | c = c === d ? this._items.length : this.normalize(c, !0), b = b instanceof jQuery ? b : a(b), this.trigger("add", { |
| 1369 | content: b, |
| 1370 | position: c |
| 1371 | }), b = this.prepare(b), 0 === this._items.length || c === this._items.length ? (0 === this._items.length && this.$stage.append(b), 0 !== this._items.length && this._items[c - 1].after(b), this._items.push(b), this._mergers.push(1 * b.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1)) : (this._items[c].before(b), this._items.splice(c, 0, b), this._mergers.splice(c, 0, 1 * b.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1)), this._items[e] && this.reset(this._items[e].index()), this.invalidate("items"), this.trigger("added", { |
| 1372 | content: b, |
| 1373 | position: c |
| 1374 | }) |
| 1375 | }, e.prototype.remove = function (a) { |
| 1376 | a = this.normalize(a, !0), a !== d && (this.trigger("remove", { |
| 1377 | content: this._items[a], |
| 1378 | position: a |
| 1379 | }), this._items[a].remove(), this._items.splice(a, 1), this._mergers.splice(a, 1), this.invalidate("items"), this.trigger("removed", { |
| 1380 | content: null, |
| 1381 | position: a |
| 1382 | })) |
| 1383 | }, e.prototype.preloadAutoWidthImages = function (b) { |
| 1384 | b.each(a.proxy(function (b, c) { |
| 1385 | this.enter("pre-loading"), c = a(c), a(new Image).one("load", a.proxy(function (a) { |
| 1386 | c.attr("src", a.target.src), c.css("opacity", 1), this.leave("pre-loading"), !this.is("pre-loading") && !this.is("initializing") && this.refresh() |
| 1387 | }, this)).attr("src", c.attr("src") || c.attr("data-src") || c.attr("data-src-retina")) |
| 1388 | }, this)) |
| 1389 | }, e.prototype.destroy = function () { |
| 1390 | this.$element.off(".owl.core"), this.$stage.off(".owl.core"), a(c).off(".owl.core"), this.settings.responsive !== !1 && (b.clearTimeout(this.resizeTimer), this.off(b, "resize", this._handlers.onThrottledResize)); |
| 1391 | for (var d in this._plugins) this._plugins[d].destroy(); |
| 1392 | this.$stage.children(".cloned").remove(), this.$stage.unwrap(), this.$stage.children().contents().unwrap(), this.$stage.children().unwrap(), this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class", this.$element.attr("class").replace(new RegExp(this.options.responsiveClass + "-\\S+\\s", "g"), "")).removeData("owl.carousel") |
| 1393 | }, e.prototype.op = function (a, b, c) { |
| 1394 | var d = this.settings.rtl; |
| 1395 | switch (b) { |
| 1396 | case"<": |
| 1397 | return d ? a > c : a < c; |
| 1398 | case">": |
| 1399 | return d ? a < c : a > c; |
| 1400 | case">=": |
| 1401 | return d ? a <= c : a >= c; |
| 1402 | case"<=": |
| 1403 | return d ? a >= c : a <= c |
| 1404 | } |
| 1405 | }, e.prototype.on = function (a, b, c, d) { |
| 1406 | a.addEventListener ? a.addEventListener(b, c, d) : a.attachEvent && a.attachEvent("on" + b, c) |
| 1407 | }, e.prototype.off = function (a, b, c, d) { |
| 1408 | a.removeEventListener ? a.removeEventListener(b, c, d) : a.detachEvent && a.detachEvent("on" + b, c) |
| 1409 | }, e.prototype.trigger = function (b, c, d, f, g) { |
| 1410 | var h = {item: {count: this._items.length, index: this.current()}}, |
| 1411 | i = a.camelCase(a.grep(["on", b, d], function (a) { |
| 1412 | return a |
| 1413 | }).join("-").toLowerCase()), |
| 1414 | j = a.Event([b, "owl", d || "carousel"].join(".").toLowerCase(), a.extend({relatedTarget: this}, h, c)); |
| 1415 | return this._supress[b] || (a.each(this._plugins, function (a, b) { |
| 1416 | b.onTrigger && b.onTrigger(j) |
| 1417 | }), this.register({ |
| 1418 | type: e.Type.Event, |
| 1419 | name: b |
| 1420 | }), this.$element.trigger(j), this.settings && "function" == typeof this.settings[i] && this.settings[i].call(this, j)), j |
| 1421 | }, e.prototype.enter = function (b) { |
| 1422 | a.each([b].concat(this._states.tags[b] || []), a.proxy(function (a, b) { |
| 1423 | this._states.current[b] === d && (this._states.current[b] = 0), this._states.current[b]++ |
| 1424 | }, this)) |
| 1425 | }, e.prototype.leave = function (b) { |
| 1426 | a.each([b].concat(this._states.tags[b] || []), a.proxy(function (a, b) { |
| 1427 | this._states.current[b]-- |
| 1428 | }, this)) |
| 1429 | }, e.prototype.register = function (b) { |
| 1430 | if (b.type === e.Type.Event) { |
| 1431 | if (a.event.special[b.name] || (a.event.special[b.name] = {}), !a.event.special[b.name].owl) { |
| 1432 | var c = a.event.special[b.name]._default; |
| 1433 | a.event.special[b.name]._default = function (a) { |
| 1434 | return !c || !c.apply || a.namespace && a.namespace.indexOf("owl") !== -1 ? a.namespace && a.namespace.indexOf("owl") > -1 : c.apply(this, arguments) |
| 1435 | }, a.event.special[b.name].owl = !0 |
| 1436 | } |
| 1437 | } else b.type === e.Type.State && (this._states.tags[b.name] ? this._states.tags[b.name] = this._states.tags[b.name].concat(b.tags) : this._states.tags[b.name] = b.tags, this._states.tags[b.name] = a.grep(this._states.tags[b.name], a.proxy(function (c, d) { |
| 1438 | return a.inArray(c, this._states.tags[b.name]) === d |
| 1439 | }, this))) |
| 1440 | }, e.prototype.suppress = function (b) { |
| 1441 | a.each(b, a.proxy(function (a, b) { |
| 1442 | this._supress[b] = !0 |
| 1443 | }, this)) |
| 1444 | }, e.prototype.release = function (b) { |
| 1445 | a.each(b, a.proxy(function (a, b) { |
| 1446 | delete this._supress[b] |
| 1447 | }, this)) |
| 1448 | }, e.prototype.pointer = function (a) { |
| 1449 | var c = {x: null, y: null}; |
| 1450 | return a = a.originalEvent || a || b.event, a = a.touches && a.touches.length ? a.touches[0] : a.changedTouches && a.changedTouches.length ? a.changedTouches[0] : a, a.pageX ? (c.x = a.pageX, c.y = a.pageY) : (c.x = a.clientX, c.y = a.clientY), c |
| 1451 | }, e.prototype.isNumeric = function (a) { |
| 1452 | return !isNaN(parseFloat(a)) |
| 1453 | }, e.prototype.difference = function (a, b) { |
| 1454 | return {x: a.x - b.x, y: a.y - b.y} |
| 1455 | }, a.fn.sbrOwlCarousel = function (b) { |
| 1456 | var c = Array.prototype.slice.call(arguments, 1); |
| 1457 | return this.each(function () { |
| 1458 | var d = a(this), f = d.data("owl.carousel"); |
| 1459 | f || (f = new e(this, "object" == typeof b && b), d.data("owl.carousel", f), a.each(["next", "prev", "to", "destroy", "refresh", "replace", "add", "remove"], function (b, c) { |
| 1460 | f.register({ |
| 1461 | type: e.Type.Event, |
| 1462 | name: c |
| 1463 | }), f.$element.on(c + ".owl.carousel.core", a.proxy(function (a) { |
| 1464 | a.namespace && a.relatedTarget !== this && (this.suppress([c]), f[c].apply(this, [].slice.call(arguments, 1)), this.release([c])) |
| 1465 | }, f)) |
| 1466 | })), "string" == typeof b && "_" !== b.charAt(0) && f[b].apply(f, c) |
| 1467 | }) |
| 1468 | }, a.fn.sbrOwlCarousel.Constructor = e |
| 1469 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1470 | var e = function (b) { |
| 1471 | this._core = b, this._interval = null, this._visible = null, this._handlers = { |
| 1472 | "initialized.owl.carousel": a.proxy(function (a) { |
| 1473 | a.namespace && this._core.settings.autoRefresh && this.watch() |
| 1474 | }, this) |
| 1475 | }, this._core.options = a.extend({}, e.Defaults, this._core.options), this._core.$element.on(this._handlers) |
| 1476 | }; |
| 1477 | e.Defaults = {autoRefresh: !0, autoRefreshInterval: 500}, e.prototype.watch = function () { |
| 1478 | this._interval || (this._visible = this._core.$element.is(":visible"), this._interval = b.setInterval(a.proxy(this.refresh, this), this._core.settings.autoRefreshInterval)) |
| 1479 | }, e.prototype.refresh = function () { |
| 1480 | this._core.$element.is(":visible") !== this._visible && (this._visible = !this._visible, this._core.$element.toggleClass("sbr-owl-hidden", !this._visible), this._visible && this._core.invalidate("width") && this._core.refresh()) |
| 1481 | }, e.prototype.destroy = function () { |
| 1482 | var a, c; |
| 1483 | b.clearInterval(this._interval); |
| 1484 | for (a in this._handlers) this._core.$element.off(a, this._handlers[a]); |
| 1485 | for (c in Object.getOwnPropertyNames(this)) "function" != typeof this[c] && (this[c] = null) |
| 1486 | }, a.fn.sbrOwlCarousel.Constructor.Plugins.AutoRefresh = e |
| 1487 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1488 | var e = function (b) { |
| 1489 | this._core = b, this._loaded = [], this._handlers = { |
| 1490 | "initialized.owl.carousel change.owl.carousel resized.owl.carousel": a.proxy(function (b) { |
| 1491 | if (b.namespace && this._core.settings && this._core.settings.lazyLoad && (b.property && "position" == b.property.name || "initialized" == b.type)) for (var c = this._core.settings, e = c.center && Math.ceil(c.items / 2) || c.items, f = c.center && e * -1 || 0, g = (b.property && b.property.value !== d ? b.property.value : this._core.current()) + f, h = this._core.clones().length, i = a.proxy(function (a, b) { |
| 1492 | this.load(b) |
| 1493 | }, this); f++ < e;) this.load(h / 2 + this._core.relative(g)), h && a.each(this._core.clones(this._core.relative(g)), i), g++ |
| 1494 | }, this) |
| 1495 | }, this._core.options = a.extend({}, e.Defaults, this._core.options), this._core.$element.on(this._handlers) |
| 1496 | }; |
| 1497 | e.Defaults = {lazyLoad: !1}, e.prototype.load = function (c) { |
| 1498 | var d = this._core.$stage.children().eq(c), e = d && d.find(".sbr-owl-lazy"); |
| 1499 | !e || a.inArray(d.get(0), this._loaded) > -1 || (e.each(a.proxy(function (c, d) { |
| 1500 | var e, f = a(d), g = b.devicePixelRatio > 1 && f.attr("data-src-retina") || f.attr("data-src"); |
| 1501 | this._core.trigger("load", { |
| 1502 | element: f, |
| 1503 | url: g |
| 1504 | }, "lazy"), f.is("img") ? f.one("load.owl.lazy", a.proxy(function () { |
| 1505 | f.css("opacity", 1), this._core.trigger("loaded", {element: f, url: g}, "lazy") |
| 1506 | }, this)).attr("src", g) : (e = new Image, e.onload = a.proxy(function () { |
| 1507 | f.css({ |
| 1508 | "background-image": 'url("' + g + '")', |
| 1509 | opacity: "1" |
| 1510 | }), this._core.trigger("loaded", {element: f, url: g}, "lazy") |
| 1511 | }, this), e.src = g) |
| 1512 | }, this)), this._loaded.push(d.get(0))) |
| 1513 | }, e.prototype.destroy = function () { |
| 1514 | var a, b; |
| 1515 | for (a in this.handlers) this._core.$element.off(a, this.handlers[a]); |
| 1516 | for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) |
| 1517 | }, a.fn.sbrOwlCarousel.Constructor.Plugins.Lazy = e |
| 1518 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1519 | var e = function (b) { |
| 1520 | this._core = b, this._handlers = { |
| 1521 | "initialized.owl.carousel refreshed.owl.carousel": a.proxy(function (a) { |
| 1522 | a.namespace && this._core.settings.autoHeight && this.update() |
| 1523 | }, this), "changed.owl.carousel": a.proxy(function (a) { |
| 1524 | a.namespace && this._core.settings.autoHeight && "position" == a.property.name && this.update() |
| 1525 | }, this), "loaded.owl.lazy": a.proxy(function (a) { |
| 1526 | a.namespace && this._core.settings.autoHeight && a.element.closest("." + this._core.settings.itemClass).index() === this._core.current() && this.update() |
| 1527 | }, this) |
| 1528 | }, this._core.options = a.extend({}, e.Defaults, this._core.options), this._core.$element.on(this._handlers) |
| 1529 | }; |
| 1530 | e.Defaults = {autoHeight: !1, autoHeightClass: "sbr-owl-height"}, e.prototype.update = function () { |
| 1531 | var b = this._core._current, c = b + this._core.settings.items, |
| 1532 | d = this._core.$stage.children().toArray().slice(b, c), e = [], f = 0; |
| 1533 | a.each(d, function (b, c) { |
| 1534 | e.push(a(c).height()) |
| 1535 | }), f = Math.max.apply(null, e), this._core.$stage.parent().height(f).addClass(this._core.settings.autoHeightClass) |
| 1536 | }, e.prototype.destroy = function () { |
| 1537 | var a, b; |
| 1538 | for (a in this._handlers) this._core.$element.off(a, this._handlers[a]); |
| 1539 | for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) |
| 1540 | }, a.fn.sbrOwlCarousel.Constructor.Plugins.AutoHeight = e |
| 1541 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1542 | var e = function (b) { |
| 1543 | this._core = b, this._videos = {}, this._playing = null, this._handlers = { |
| 1544 | "initialized.owl.carousel": a.proxy(function (a) { |
| 1545 | a.namespace && this._core.register({type: "state", name: "playing", tags: ["interacting"]}) |
| 1546 | }, this), "resize.owl.carousel": a.proxy(function (a) { |
| 1547 | a.namespace && this._core.settings.video && this.isInFullScreen() && a.preventDefault() |
| 1548 | }, this), "refreshed.owl.carousel": a.proxy(function (a) { |
| 1549 | a.namespace && this._core.is("resizing") && this._core.$stage.find(".cloned .sbr-owl-video-frame").remove() |
| 1550 | }, this), "changed.owl.carousel": a.proxy(function (a) { |
| 1551 | a.namespace && "position" === a.property.name && this._playing && this.stop() |
| 1552 | }, this), "prepared.owl.carousel": a.proxy(function (b) { |
| 1553 | if (b.namespace) { |
| 1554 | var c = a(b.content).find(".sbr-owl-video"); |
| 1555 | c.length && (c.css("display", "none"), this.fetch(c, a(b.content))) |
| 1556 | } |
| 1557 | }, this) |
| 1558 | }, this._core.options = a.extend({}, e.Defaults, this._core.options), this._core.$element.on(this._handlers), this._core.$element.on("click.owl.video", ".sbr-owl-video-play-icon", a.proxy(function (a) { |
| 1559 | this.play(a) |
| 1560 | }, this)) |
| 1561 | }; |
| 1562 | e.Defaults = {video: !1, videoHeight: !1, videoWidth: !1}, e.prototype.fetch = function (a, b) { |
| 1563 | var c = function () { |
| 1564 | return a.attr("data-vimeo-id") ? "vimeo" : a.attr("data-vzaar-id") ? "vzaar" : "youtube" |
| 1565 | }(), d = a.attr("data-vimeo-id") || a.attr("data-youtube-id") || a.attr("data-vzaar-id"), |
| 1566 | e = a.attr("data-width") || this._core.settings.videoWidth, |
| 1567 | f = a.attr("data-height") || this._core.settings.videoHeight, g = a.attr("href"); |
| 1568 | if (!g) throw new Error("Missing video URL."); |
| 1569 | if (d = g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/), d[3].indexOf("youtu") > -1) c = "youtube"; else if (d[3].indexOf("vimeo") > -1) c = "vimeo"; else { |
| 1570 | if (!(d[3].indexOf("vzaar") > -1)) throw new Error("Video URL not supported."); |
| 1571 | c = "vzaar" |
| 1572 | } |
| 1573 | d = d[6], this._videos[g] = { |
| 1574 | type: c, |
| 1575 | id: d, |
| 1576 | width: e, |
| 1577 | height: f |
| 1578 | }, b.attr("data-video", g), this.thumbnail(a, this._videos[g]) |
| 1579 | }, e.prototype.thumbnail = function (b, c) { |
| 1580 | var d, e, f, g = c.width && c.height ? 'style="width:' + c.width + "px;height:" + c.height + 'px;"' : "", |
| 1581 | h = b.find("img"), i = "src", j = "", k = this._core.settings, l = function (a) { |
| 1582 | e = '<div class="sbr-owl-video-play-icon"></div>', d = k.lazyLoad ? '<div class="sbr-owl-video-tn ' + j + '" ' + i + '="' + a + '"></div>' : '<div class="sbr-owl-video-tn" style="opacity:1;background-image:url(' + a + ')"></div>', b.after(d), b.after(e) |
| 1583 | }; |
| 1584 | if (b.wrap('<div class="sbr-owl-video-wrapper"' + g + "></div>"), this._core.settings.lazyLoad && (i = "data-src", j = "sbr-owl-lazy"), h.length) return l(h.attr(i)), h.remove(), !1; |
| 1585 | "youtube" === c.type ? (f = "//img.youtube.com/vi/" + c.id + "/hqdefault.jpg", l(f)) : "vimeo" === c.type ? a.ajax({ |
| 1586 | type: "GET", |
| 1587 | url: "//vimeo.com/api/v2/video/" + c.id + ".json", |
| 1588 | jsonp: "callback", |
| 1589 | dataType: "jsonp", |
| 1590 | success: function (a) { |
| 1591 | f = a[0].thumbnail_large, l(f) |
| 1592 | } |
| 1593 | }) : "vzaar" === c.type && a.ajax({ |
| 1594 | type: "GET", |
| 1595 | url: "//vzaar.com/api/videos/" + c.id + ".json", |
| 1596 | jsonp: "callback", |
| 1597 | dataType: "jsonp", |
| 1598 | success: function (a) { |
| 1599 | f = a.framegrab_url, l(f) |
| 1600 | } |
| 1601 | }) |
| 1602 | }, e.prototype.stop = function () { |
| 1603 | this._core.trigger("stop", null, "video"), this._playing.find(".sbr-owl-video-frame").remove(), this._playing.removeClass("sbr-owl-video-playing"), this._playing = null, this._core.leave("playing"), this._core.trigger("stopped", null, "video") |
| 1604 | }, e.prototype.play = function (b) { |
| 1605 | var c, d = a(b.target), e = d.closest("." + this._core.settings.itemClass), |
| 1606 | f = this._videos[e.attr("data-video")], g = f.width || "100%", |
| 1607 | h = f.height || this._core.$stage.height(); |
| 1608 | this._playing || (this._core.enter("playing"), this._core.trigger("play", null, "video"), e = this._core.items(this._core.relative(e.index())), this._core.reset(e.index()), "youtube" === f.type ? c = '<iframe width="' + g + '" height="' + h + '" src="//www.youtube.com/embed/' + f.id + "?autoplay=1&rel=0&v=" + f.id + '" frameborder="0" allowfullscreen></iframe>' : "vimeo" === f.type ? c = '<iframe src="//player.vimeo.com/video/' + f.id + '?autoplay=1" width="' + g + '" height="' + h + '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>' : "vzaar" === f.type && (c = '<iframe frameborder="0"height="' + h + '"width="' + g + '" allowfullscreen mozallowfullscreen webkitAllowFullScreen src="//view.vzaar.com/' + f.id + '/player?autoplay=true"></iframe>'), a('<div class="sbr-owl-video-frame">' + c + "</div>").insertAfter(e.find(".sbr-owl-video")), this._playing = e.addClass("sbr-owl-video-playing")) |
| 1609 | }, e.prototype.isInFullScreen = function () { |
| 1610 | var b = c.fullscreenElement || c.mozFullScreenElement || c.webkitFullscreenElement; |
| 1611 | return b && a(b).parent().hasClass("sbr-owl-video-frame") |
| 1612 | }, e.prototype.destroy = function () { |
| 1613 | var a, b; |
| 1614 | this._core.$element.off("click.owl.video"); |
| 1615 | for (a in this._handlers) this._core.$element.off(a, this._handlers[a]); |
| 1616 | for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) |
| 1617 | }, a.fn.sbrOwlCarousel.Constructor.Plugins.Video = e |
| 1618 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1619 | var e = function (b) { |
| 1620 | this.core = b, this.core.options = a.extend({}, e.Defaults, this.core.options), this.swapping = !0, this.previous = d, this.next = d, this.handlers = { |
| 1621 | "change.owl.carousel": a.proxy(function (a) { |
| 1622 | a.namespace && "position" == a.property.name && (this.previous = this.core.current(), this.next = a.property.value) |
| 1623 | }, this), "drag.owl.carousel dragged.owl.carousel translated.owl.carousel": a.proxy(function (a) { |
| 1624 | a.namespace && (this.swapping = "translated" == a.type) |
| 1625 | }, this), "translate.owl.carousel": a.proxy(function (a) { |
| 1626 | a.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn) && this.swap() |
| 1627 | }, this) |
| 1628 | }, this.core.$element.on(this.handlers) |
| 1629 | }; |
| 1630 | e.Defaults = {animateOut: !1, animateIn: !1}, e.prototype.swap = function () { |
| 1631 | if (1 === this.core.settings.items && a.support.animation && a.support.transition) { |
| 1632 | this.core.speed(0); |
| 1633 | var b, c = a.proxy(this.clear, this), d = this.core.$stage.children().eq(this.previous), |
| 1634 | e = this.core.$stage.children().eq(this.next), f = this.core.settings.animateIn, |
| 1635 | g = this.core.settings.animateOut; |
| 1636 | this.core.current() !== this.previous && (g && (b = this.core.coordinates(this.previous) - this.core.coordinates(this.next), d.one(a.support.animation.end, c).css({left: b + "px"}).addClass("animated sbr-owl-animated-out").addClass(g)), f && e.one(a.support.animation.end, c).addClass("animated sbr-owl-animated-in").addClass(f)) |
| 1637 | } |
| 1638 | }, e.prototype.clear = function (b) { |
| 1639 | a(b.target).css({left: ""}).removeClass("animated sbr-owl-animated-out sbr-owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut), this.core.onTransitionEnd() |
| 1640 | }, e.prototype.destroy = function () { |
| 1641 | var a, b; |
| 1642 | for (a in this.handlers) this.core.$element.off(a, this.handlers[a]); |
| 1643 | for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) |
| 1644 | }, |
| 1645 | a.fn.sbrOwlCarousel.Constructor.Plugins.Animate = e |
| 1646 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1647 | var e = function (b) { |
| 1648 | this._core = b, this._timeout = null, this._paused = !1, this._handlers = { |
| 1649 | "changed.owl.carousel": a.proxy(function (a) { |
| 1650 | a.namespace && "settings" === a.property.name ? this._core.settings.autoplay ? this.play() : this.stop() : a.namespace && "position" === a.property.name && this._core.settings.autoplay && this._setAutoPlayInterval() |
| 1651 | }, this), "initialized.owl.carousel": a.proxy(function (a) { |
| 1652 | a.namespace && this._core.settings.autoplay && this.play() |
| 1653 | }, this), "play.owl.autoplay": a.proxy(function (a, b, c) { |
| 1654 | a.namespace && this.play(b, c) |
| 1655 | }, this), "stop.owl.autoplay": a.proxy(function (a) { |
| 1656 | a.namespace && this.stop() |
| 1657 | }, this), "mouseover.owl.autoplay": a.proxy(function () { |
| 1658 | this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.pause() |
| 1659 | }, this), "mouseleave.owl.autoplay": a.proxy(function () { |
| 1660 | this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.play() |
| 1661 | }, this), "touchstart.owl.core": a.proxy(function () { |
| 1662 | this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.pause() |
| 1663 | }, this), "touchend.owl.core": a.proxy(function () { |
| 1664 | this._core.settings.autoplayHoverPause && this.play() |
| 1665 | }, this) |
| 1666 | }, this._core.$element.on(this._handlers), this._core.options = a.extend({}, e.Defaults, this._core.options) |
| 1667 | }; |
| 1668 | e.Defaults = { |
| 1669 | autoplay: !1, |
| 1670 | autoplayTimeout: 5e3, |
| 1671 | autoplayHoverPause: !1, |
| 1672 | autoplaySpeed: !1 |
| 1673 | }, e.prototype.play = function (a, b) { |
| 1674 | this._paused = !1, this._core.is("rotating") || (this._core.enter("rotating"), this._setAutoPlayInterval()) |
| 1675 | }, e.prototype._getNextTimeout = function (d, e) { |
| 1676 | return this._timeout && b.clearTimeout(this._timeout), b.setTimeout(a.proxy(function () { |
| 1677 | this._paused || this._core.is("busy") || this._core.is("interacting") || c.hidden || this._core.next(e || this._core.settings.autoplaySpeed) |
| 1678 | }, this), d || this._core.settings.autoplayTimeout) |
| 1679 | }, e.prototype._setAutoPlayInterval = function () { |
| 1680 | this._timeout = this._getNextTimeout() |
| 1681 | }, e.prototype.stop = function () { |
| 1682 | this._core.is("rotating") && (b.clearTimeout(this._timeout), this._core.leave("rotating")) |
| 1683 | }, e.prototype.pause = function () { |
| 1684 | this._core.is("rotating") && (this._paused = !0) |
| 1685 | }, e.prototype.destroy = function () { |
| 1686 | var a, b; |
| 1687 | this.stop(); |
| 1688 | for (a in this._handlers) this._core.$element.off(a, this._handlers[a]); |
| 1689 | for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) |
| 1690 | }, a.fn.sbrOwlCarousel.Constructor.Plugins.autoplay = e |
| 1691 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1692 | "use strict"; |
| 1693 | var e = function (b) { |
| 1694 | this._core = b, this._initialized = !1, this._pages = [], this._controls = {}, this._templates = [], this.$element = this._core.$element, this._overrides = { |
| 1695 | next: this._core.next, |
| 1696 | prev: this._core.prev, |
| 1697 | to: this._core.to |
| 1698 | }, this._handlers = { |
| 1699 | "prepared.owl.carousel": a.proxy(function (b) { |
| 1700 | b.namespace && this._core.settings.dotsData && this._templates.push('<div class="' + this._core.settings.dotClass + '">' + a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot") + "</div>") |
| 1701 | }, this), "added.owl.carousel": a.proxy(function (a) { |
| 1702 | a.namespace && this._core.settings.dotsData && this._templates.splice(a.position, 0, this._templates.pop()) |
| 1703 | }, this), "remove.owl.carousel": a.proxy(function (a) { |
| 1704 | a.namespace && this._core.settings.dotsData && this._templates.splice(a.position, 1) |
| 1705 | }, this), "changed.owl.carousel": a.proxy(function (a) { |
| 1706 | a.namespace && "position" == a.property.name && this.draw() |
| 1707 | }, this), "initialized.owl.carousel": a.proxy(function (a) { |
| 1708 | a.namespace && !this._initialized && (this._core.trigger("initialize", null, "navigation"), this.initialize(), this.update(), this.draw(), this._initialized = !0, this._core.trigger("initialized", null, "navigation")) |
| 1709 | }, this), "refreshed.owl.carousel": a.proxy(function (a) { |
| 1710 | a.namespace && this._initialized && (this._core.trigger("refresh", null, "navigation"), this.update(), this.draw(), this._core.trigger("refreshed", null, "navigation")) |
| 1711 | }, this) |
| 1712 | }, this._core.options = a.extend({}, e.Defaults, this._core.options), this.$element.on(this._handlers) |
| 1713 | }; |
| 1714 | e.Defaults = { |
| 1715 | nav: !1, |
| 1716 | navText: ["prev", "next"], |
| 1717 | navSpeed: !1, |
| 1718 | navElement: "div", |
| 1719 | navContainer: !1, |
| 1720 | navContainerClass: "sbr-owl-nav", |
| 1721 | navClass: ["sbr-owl-prev", "sbr-owl-next"], |
| 1722 | slideBy: 1, |
| 1723 | dotClass: "sbr-owl-dot", |
| 1724 | dotsClass: "sbr-owl-dots", |
| 1725 | dots: !0, |
| 1726 | dotsEach: !1, |
| 1727 | dotsData: !1, |
| 1728 | dotsSpeed: !1, |
| 1729 | dotsContainer: !1 |
| 1730 | }, e.prototype.initialize = function () { |
| 1731 | var b, c = this._core.settings; |
| 1732 | this._controls.$relative = (c.navContainer ? a(c.navContainer) : a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"), this._controls.$previous = a("<" + c.navElement + ">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click", a.proxy(function (a) { |
| 1733 | this.prev(c.navSpeed) |
| 1734 | }, this)), this._controls.$next = a("<" + c.navElement + ">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click", a.proxy(function (a) { |
| 1735 | this.next(c.navSpeed) |
| 1736 | }, this)), c.dotsData || (this._templates = [a("<div>").addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]), this._controls.$absolute = (c.dotsContainer ? a(c.dotsContainer) : a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"), this._controls.$absolute.on("click", "div", a.proxy(function (b) { |
| 1737 | var d = a(b.target).parent().is(this._controls.$absolute) ? a(b.target).index() : a(b.target).parent().index(); |
| 1738 | b.preventDefault(), this.to(d, c.dotsSpeed) |
| 1739 | }, this)); |
| 1740 | for (b in this._overrides) this._core[b] = a.proxy(this[b], this) |
| 1741 | }, e.prototype.destroy = function () { |
| 1742 | var a, b, c, d; |
| 1743 | for (a in this._handlers) this.$element.off(a, this._handlers[a]); |
| 1744 | for (b in this._controls) this._controls[b].remove(); |
| 1745 | for (d in this.overides) this._core[d] = this._overrides[d]; |
| 1746 | for (c in Object.getOwnPropertyNames(this)) "function" != typeof this[c] && (this[c] = null) |
| 1747 | }, e.prototype.update = function () { |
| 1748 | var a, b, c, d = this._core.clones().length / 2, e = d + this._core.items().length, |
| 1749 | f = this._core.maximum(!0), g = this._core.settings, |
| 1750 | h = g.center || g.autoWidth || g.dotsData ? 1 : g.dotsEach || g.items; |
| 1751 | if ("page" !== g.slideBy && (g.slideBy = Math.min(g.slideBy, g.items)), g.dots || "page" == g.slideBy) for (this._pages = [], a = d, b = 0, c = 0; a < e; a++) { |
| 1752 | if (b >= h || 0 === b) { |
| 1753 | if (this._pages.push({ |
| 1754 | start: Math.min(f, a - d), |
| 1755 | end: a - d + h - 1 |
| 1756 | }), Math.min(f, a - d) === f) break; |
| 1757 | b = 0, ++c |
| 1758 | } |
| 1759 | b += this._core.mergers(this._core.relative(a)) |
| 1760 | } |
| 1761 | }, e.prototype.draw = function () { |
| 1762 | var b, c = this._core.settings, d = this._core.items().length <= c.items, |
| 1763 | e = this._core.relative(this._core.current()), f = c.loop || c.rewind; |
| 1764 | this._controls.$relative.toggleClass("disabled", !c.nav || d), c.nav && (this._controls.$previous.toggleClass("disabled", !f && e <= this._core.minimum(!0)), this._controls.$next.toggleClass("disabled", !f && e >= this._core.maximum(!0))), this._controls.$absolute.toggleClass("disabled", !c.dots || d), c.dots && (b = this._pages.length - this._controls.$absolute.children().length, c.dotsData && 0 !== b ? this._controls.$absolute.html(this._templates.join("")) : b > 0 ? this._controls.$absolute.append(new Array(b + 1).join(this._templates[0])) : b < 0 && this._controls.$absolute.children().slice(b).remove(), this._controls.$absolute.find(".active").removeClass("active"), this._controls.$absolute.children().eq(a.inArray(this.current(), this._pages)).addClass("active")) |
| 1765 | }, e.prototype.onTrigger = function (b) { |
| 1766 | var c = this._core.settings; |
| 1767 | b.page = { |
| 1768 | index: a.inArray(this.current(), this._pages), |
| 1769 | count: this._pages.length, |
| 1770 | size: c && (c.center || c.autoWidth || c.dotsData ? 1 : c.dotsEach || c.items) |
| 1771 | } |
| 1772 | }, e.prototype.current = function () { |
| 1773 | var b = this._core.relative(this._core.current()); |
| 1774 | return a.grep(this._pages, a.proxy(function (a, c) { |
| 1775 | return a.start <= b && a.end >= b |
| 1776 | }, this)).pop() |
| 1777 | }, e.prototype.getPosition = function (b) { |
| 1778 | var c, d, e = this._core.settings; |
| 1779 | return "page" == e.slideBy ? (c = a.inArray(this.current(), this._pages), d = this._pages.length, b ? ++c : --c, c = this._pages[(c % d + d) % d].start) : (c = this._core.relative(this._core.current()), d = this._core.items().length, b ? c += e.slideBy : c -= e.slideBy), c |
| 1780 | }, e.prototype.next = function (b) { |
| 1781 | a.proxy(this._overrides.to, this._core)(this.getPosition(!0), b) |
| 1782 | }, e.prototype.prev = function (b) { |
| 1783 | a.proxy(this._overrides.to, this._core)(this.getPosition(!1), b) |
| 1784 | }, e.prototype.to = function (b, c, d) { |
| 1785 | var e; |
| 1786 | !d && this._pages.length ? (e = this._pages.length, a.proxy(this._overrides.to, this._core)(this._pages[(b % e + e) % e].start, c)) : a.proxy(this._overrides.to, this._core)(b, c) |
| 1787 | }, a.fn.sbrOwlCarousel.Constructor.Plugins.Navigation = e |
| 1788 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1789 | "use strict"; |
| 1790 | var e = function (c) { |
| 1791 | this._core = c, this._hashes = {}, this.$element = this._core.$element, this._handlers = { |
| 1792 | "initialized.owl.carousel": a.proxy(function (c) { |
| 1793 | c.namespace && "URLHash" === this._core.settings.startPosition && a(b).trigger("hashchange.owl.navigation") |
| 1794 | }, this), "prepared.owl.carousel": a.proxy(function (b) { |
| 1795 | if (b.namespace) { |
| 1796 | var c = a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash"); |
| 1797 | if (!c) return; |
| 1798 | this._hashes[c] = b.content |
| 1799 | } |
| 1800 | }, this), "changed.owl.carousel": a.proxy(function (c) { |
| 1801 | if (c.namespace && "position" === c.property.name) { |
| 1802 | var d = this._core.items(this._core.relative(this._core.current())), |
| 1803 | e = a.map(this._hashes, function (a, b) { |
| 1804 | return a === d ? b : null |
| 1805 | }).join(); |
| 1806 | if (!e || b.location.hash.slice(1) === e) return; |
| 1807 | b.location.hash = e |
| 1808 | } |
| 1809 | }, this) |
| 1810 | }, this._core.options = a.extend({}, e.Defaults, this._core.options), this.$element.on(this._handlers), a(b).on("hashchange.owl.navigation", a.proxy(function (a) { |
| 1811 | var c = b.location.hash.substring(1), e = this._core.$stage.children(), |
| 1812 | f = this._hashes[c] && e.index(this._hashes[c]); |
| 1813 | f !== d && f !== this._core.current() && this._core.to(this._core.relative(f), !1, !0) |
| 1814 | }, this)) |
| 1815 | }; |
| 1816 | e.Defaults = {URLhashListener: !1}, e.prototype.destroy = function () { |
| 1817 | var c, d; |
| 1818 | a(b).off("hashchange.owl.navigation"); |
| 1819 | for (c in this._handlers) this._core.$element.off(c, this._handlers[c]); |
| 1820 | for (d in Object.getOwnPropertyNames(this)) "function" != typeof this[d] && (this[d] = null) |
| 1821 | }, a.fn.sbrOwlCarousel.Constructor.Plugins.Hash = e |
| 1822 | }(window.Zepto || window.jQuery, window, document), function (a, b, c, d) { |
| 1823 | function e(b, c) { |
| 1824 | var e = !1, f = b.charAt(0).toUpperCase() + b.slice(1); |
| 1825 | return a.each((b + " " + h.join(f + " ") + f).split(" "), function (a, b) { |
| 1826 | if (g[b] !== d) return e = !c || b, !1 |
| 1827 | }), e |
| 1828 | } |
| 1829 | |
| 1830 | function f(a) { |
| 1831 | return e(a, !0) |
| 1832 | } |
| 1833 | |
| 1834 | var g = a("<support>").get(0).style, h = "Webkit Moz O ms".split(" "), i = { |
| 1835 | transition: { |
| 1836 | end: { |
| 1837 | WebkitTransition: "webkitTransitionEnd", |
| 1838 | MozTransition: "transitionend", |
| 1839 | OTransition: "oTransitionEnd", |
| 1840 | transition: "transitionend" |
| 1841 | } |
| 1842 | }, |
| 1843 | animation: { |
| 1844 | end: { |
| 1845 | WebkitAnimation: "webkitAnimationEnd", |
| 1846 | MozAnimation: "animationend", |
| 1847 | OAnimation: "oAnimationEnd", |
| 1848 | animation: "animationend" |
| 1849 | } |
| 1850 | } |
| 1851 | }, j = { |
| 1852 | csstransforms: function () { |
| 1853 | return !!e("transform") |
| 1854 | }, csstransforms3d: function () { |
| 1855 | return !!e("perspective") |
| 1856 | }, csstransitions: function () { |
| 1857 | return !!e("transition") |
| 1858 | }, cssanimations: function () { |
| 1859 | return !!e("animation") |
| 1860 | } |
| 1861 | }; |
| 1862 | j.csstransitions() && (a.support.transition = new String(f("transition")), a.support.transition.end = i.transition.end[a.support.transition]), j.cssanimations() && (a.support.animation = new String(f("animation")), a.support.animation.end = i.animation.end[a.support.animation]), j.csstransforms() && (a.support.transform = new String(f("transform")), a.support.transform3d = j.csstransforms3d()) |
| 1863 | }(window.Zepto || window.jQuery, window, document); |
| 1864 | |
| 1865 | !function (a, b) { |
| 1866 | "function" == typeof define && define.amd ? define("packery/js/rect", b) : "object" == typeof module && module.exports ? module.exports = b() : (a.Packery = a.Packery || {}, a.Packery.Rect = b()) |
| 1867 | }(window, function () { |
| 1868 | function a(b) { |
| 1869 | for (var c in a.defaults) this[c] = a.defaults[c]; |
| 1870 | for (c in b) this[c] = b[c] |
| 1871 | } |
| 1872 | |
| 1873 | a.defaults = {x: 0, y: 0, width: 0, height: 0}; |
| 1874 | var b = a.prototype; |
| 1875 | return b.contains = function (a) { |
| 1876 | var b = a.width || 0, c = a.height || 0; |
| 1877 | return this.x <= a.x && this.y <= a.y && this.x + this.width >= a.x + b && this.y + this.height >= a.y + c |
| 1878 | }, b.overlaps = function (a) { |
| 1879 | var b = this.x + this.width, c = this.y + this.height, d = a.x + a.width, e = a.y + a.height; |
| 1880 | return this.x < d && b > a.x && this.y < e && c > a.y |
| 1881 | }, b.getMaximalFreeRects = function (b) { |
| 1882 | if (!this.overlaps(b)) return !1; |
| 1883 | var c, d = [], e = this.x + this.width, f = this.y + this.height, g = b.x + b.width, h = b.y + b.height; |
| 1884 | return this.y < b.y && (c = new a({ |
| 1885 | x: this.x, |
| 1886 | y: this.y, |
| 1887 | width: this.width, |
| 1888 | height: b.y - this.y |
| 1889 | }), d.push(c)), e > g && (c = new a({ |
| 1890 | x: g, |
| 1891 | y: this.y, |
| 1892 | width: e - g, |
| 1893 | height: this.height |
| 1894 | }), d.push(c)), f > h && (c = new a({ |
| 1895 | x: this.x, |
| 1896 | y: h, |
| 1897 | width: this.width, |
| 1898 | height: f - h |
| 1899 | }), d.push(c)), this.x < b.x && (c = new a({ |
| 1900 | x: this.x, |
| 1901 | y: this.y, |
| 1902 | width: b.x - this.x, |
| 1903 | height: this.height |
| 1904 | }), d.push(c)), d |
| 1905 | }, b.canFit = function (a) { |
| 1906 | return this.width >= a.width && this.height >= a.height |
| 1907 | }, a |
| 1908 | }), function (a, b) { |
| 1909 | if ("function" == typeof define && define.amd) define("packery/js/packer", ["./rect"], b); else if ("object" == typeof module && module.exports) module.exports = b(require("./rect")); else { |
| 1910 | var c = a.Packery = a.Packery || {}; |
| 1911 | c.Packer = b(c.Rect) |
| 1912 | } |
| 1913 | }(window, function (a) { |
| 1914 | function b(a, b, c) { |
| 1915 | this.width = a || 0, this.height = b || 0, this.sortDirection = c || "downwardLeftToRight", this.reset() |
| 1916 | } |
| 1917 | |
| 1918 | var c = b.prototype; |
| 1919 | c.reset = function () { |
| 1920 | this.spaces = []; |
| 1921 | var b = new a({x: 0, y: 0, width: this.width, height: this.height}); |
| 1922 | this.spaces.push(b), this.sorter = d[this.sortDirection] || d.downwardLeftToRight |
| 1923 | }, c.pack = function (a) { |
| 1924 | for (var b = 0; b < this.spaces.length; b++) { |
| 1925 | var c = this.spaces[b]; |
| 1926 | if (c.canFit(a)) { |
| 1927 | this.placeInSpace(a, c); |
| 1928 | break |
| 1929 | } |
| 1930 | } |
| 1931 | }, c.columnPack = function (a) { |
| 1932 | for (var b = 0; b < this.spaces.length; b++) { |
| 1933 | var c = this.spaces[b], d = c.x <= a.x && c.x + c.width >= a.x + a.width && c.height >= a.height - .01; |
| 1934 | if (d) { |
| 1935 | a.y = c.y, this.placed(a); |
| 1936 | break |
| 1937 | } |
| 1938 | } |
| 1939 | }, c.rowPack = function (a) { |
| 1940 | for (var b = 0; b < this.spaces.length; b++) { |
| 1941 | var c = this.spaces[b], d = c.y <= a.y && c.y + c.height >= a.y + a.height && c.width >= a.width - .01; |
| 1942 | if (d) { |
| 1943 | a.x = c.x, this.placed(a); |
| 1944 | break |
| 1945 | } |
| 1946 | } |
| 1947 | }, c.placeInSpace = function (a, b) { |
| 1948 | a.x = b.x, a.y = b.y, this.placed(a) |
| 1949 | }, c.placed = function (a) { |
| 1950 | for (var b = [], c = 0; c < this.spaces.length; c++) { |
| 1951 | var d = this.spaces[c], e = d.getMaximalFreeRects(a); |
| 1952 | e ? b.push.apply(b, e) : b.push(d) |
| 1953 | } |
| 1954 | this.spaces = b, this.mergeSortSpaces() |
| 1955 | }, c.mergeSortSpaces = function () { |
| 1956 | b.mergeRects(this.spaces), this.spaces.sort(this.sorter) |
| 1957 | }, c.addSpace = function (a) { |
| 1958 | this.spaces.push(a), this.mergeSortSpaces() |
| 1959 | }, b.mergeRects = function (a) { |
| 1960 | var b = 0, c = a[b]; |
| 1961 | a:for (; c;) { |
| 1962 | for (var d = 0, e = a[b + d]; e;) { |
| 1963 | if (e == c) d++; else { |
| 1964 | if (e.contains(c)) { |
| 1965 | a.splice(b, 1), c = a[b]; |
| 1966 | continue a |
| 1967 | } |
| 1968 | c.contains(e) ? a.splice(b + d, 1) : d++ |
| 1969 | } |
| 1970 | e = a[b + d] |
| 1971 | } |
| 1972 | b++, c = a[b] |
| 1973 | } |
| 1974 | return a |
| 1975 | }; |
| 1976 | var d = { |
| 1977 | downwardLeftToRight: function (a, b) { |
| 1978 | return a.y - b.y || a.x - b.x |
| 1979 | }, rightwardTopToBottom: function (a, b) { |
| 1980 | return a.x - b.x || a.y - b.y |
| 1981 | } |
| 1982 | }; |
| 1983 | return b |
| 1984 | }), function (a, b) { |
| 1985 | "function" == typeof define && define.amd ? define("packery/js/item", ["outlayer/outlayer", "./rect"], b) : "object" == typeof module && module.exports ? module.exports = b(require("outlayer"), require("./rect")) : a.Packery.Item = b(a.Outlayer, a.Packery.Rect) |
| 1986 | }(window, function (a, b) { |
| 1987 | var c = document.documentElement.style, d = "string" == typeof c.transform ? "transform" : "WebkitTransform", |
| 1988 | e = function () { |
| 1989 | a.Item.apply(this, arguments) |
| 1990 | }, f = e.prototype = Object.create(a.Item.prototype), g = f._create; |
| 1991 | f._create = function () { |
| 1992 | g.call(this), this.rect = new b |
| 1993 | }; |
| 1994 | var h = f.moveTo; |
| 1995 | return f.moveTo = function (a, b) { |
| 1996 | var c = Math.abs(this.position.x - a), d = Math.abs(this.position.y - b), |
| 1997 | e = this.layout.dragItemCount && !this.isPlacing && !this.isTransitioning && 1 > c && 1 > d; |
| 1998 | return e ? void this.goTo(a, b) : void h.apply(this, arguments) |
| 1999 | }, f.enablePlacing = function () { |
| 2000 | this.removeTransitionStyles(), this.isTransitioning && d && (this.element.style[d] = "none"), this.isTransitioning = !1, this.getSize(), this.layout._setRectSize(this.element, this.rect), this.isPlacing = !0 |
| 2001 | }, f.disablePlacing = function () { |
| 2002 | this.isPlacing = !1 |
| 2003 | }, f.removeElem = function () { |
| 2004 | this.element.parentNode.removeChild(this.element), this.layout.packer.addSpace(this.rect), this.emitEvent("remove", [this]) |
| 2005 | }, f.showDropPlaceholder = function () { |
| 2006 | var a = this.dropPlaceholder; |
| 2007 | a || (a = this.dropPlaceholder = document.createElement("div"), a.className = "packery-drop-placeholder", a.style.position = "absolute"), a.style.width = this.size.width + "px", a.style.height = this.size.height + "px", this.positionDropPlaceholder(), this.layout.element.appendChild(a) |
| 2008 | }, f.positionDropPlaceholder = function () { |
| 2009 | this.dropPlaceholder.style[d] = "translate(" + this.rect.x + "px, " + this.rect.y + "px)" |
| 2010 | }, f.hideDropPlaceholder = function () { |
| 2011 | this.layout.element.removeChild(this.dropPlaceholder) |
| 2012 | }, e |
| 2013 | }), function (a, b) { |
| 2014 | "function" == typeof define && define.amd ? define("packery/js/packery", ["get-size/get-size", "outlayer/outlayer", "./rect", "./packer", "./item"], b) : "object" == typeof module && module.exports ? module.exports = b(require("get-size"), require("outlayer"), require("./rect"), require("./packer"), require("./item")) : a.Packery = b(a.getSize, a.Outlayer, a.Packery.Rect, a.Packery.Packer, a.Packery.Item) |
| 2015 | }(window, function (a, b, c, d, e) { |
| 2016 | function f(a, b) { |
| 2017 | return a.position.y - b.position.y || a.position.x - b.position.x |
| 2018 | } |
| 2019 | |
| 2020 | function g(a, b) { |
| 2021 | return a.position.x - b.position.x || a.position.y - b.position.y |
| 2022 | } |
| 2023 | |
| 2024 | function h(a, b) { |
| 2025 | var c = b.x - a.x, d = b.y - a.y; |
| 2026 | return Math.sqrt(c * c + d * d) |
| 2027 | } |
| 2028 | |
| 2029 | c.prototype.canFit = function (a) { |
| 2030 | return this.width >= a.width - 1 && this.height >= a.height - 1 |
| 2031 | }; |
| 2032 | var i = b.create("packery"); |
| 2033 | i.Item = e; |
| 2034 | var j = i.prototype; |
| 2035 | j._create = function () { |
| 2036 | b.prototype._create.call(this), this.packer = new d, this.shiftPacker = new d, this.isEnabled = !0, this.dragItemCount = 0; |
| 2037 | var a = this; |
| 2038 | this.handleDraggabilly = { |
| 2039 | dragStart: function () { |
| 2040 | a.itemDragStart(this.element) |
| 2041 | }, dragMove: function () { |
| 2042 | a.itemDragMove(this.element, this.position.x, this.position.y) |
| 2043 | }, dragEnd: function () { |
| 2044 | a.itemDragEnd(this.element) |
| 2045 | } |
| 2046 | }, this.handleUIDraggable = { |
| 2047 | start: function (b, c) { |
| 2048 | c && a.itemDragStart(b.currentTarget) |
| 2049 | }, drag: function (b, c) { |
| 2050 | c && a.itemDragMove(b.currentTarget, c.position.left, c.position.top) |
| 2051 | }, stop: function (b, c) { |
| 2052 | c && a.itemDragEnd(b.currentTarget) |
| 2053 | } |
| 2054 | } |
| 2055 | }, j._resetLayout = function () { |
| 2056 | this.getSize(), this._getMeasurements(); |
| 2057 | var a, b, c; |
| 2058 | this._getOption("horizontal") ? (a = 1 / 0, b = this.size.innerHeight + this.gutter, c = "rightwardTopToBottom") : (a = this.size.innerWidth + this.gutter, b = 1 / 0, c = "downwardLeftToRight"), this.packer.width = this.shiftPacker.width = a, this.packer.height = this.shiftPacker.height = b, this.packer.sortDirection = this.shiftPacker.sortDirection = c, this.packer.reset(), this.maxY = 0, this.maxX = 0 |
| 2059 | }, j._getMeasurements = function () { |
| 2060 | this._getMeasurement("columnWidth", "width"), this._getMeasurement("rowHeight", "height"), this._getMeasurement("gutter", "width") |
| 2061 | }, j._getItemLayoutPosition = function (a) { |
| 2062 | if (this._setRectSize(a.element, a.rect), this.isShifting || this.dragItemCount > 0) { |
| 2063 | var b = this._getPackMethod(); |
| 2064 | this.packer[b](a.rect) |
| 2065 | } else this.packer.pack(a.rect); |
| 2066 | return this._setMaxXY(a.rect), a.rect |
| 2067 | }, j.shiftLayout = function () { |
| 2068 | this.isShifting = !0, this.layout(), delete this.isShifting |
| 2069 | }, j._getPackMethod = function () { |
| 2070 | return this._getOption("horizontal") ? "rowPack" : "columnPack" |
| 2071 | }, j._setMaxXY = function (a) { |
| 2072 | this.maxX = Math.max(a.x + a.width, this.maxX), this.maxY = Math.max(a.y + a.height, this.maxY) |
| 2073 | }, j._setRectSize = function (b, c) { |
| 2074 | var d = a(b), e = d.outerWidth, f = d.outerHeight; |
| 2075 | (e || f) && (e = this._applyGridGutter(e, this.columnWidth), f = this._applyGridGutter(f, this.rowHeight)), c.width = Math.min(e, this.packer.width), c.height = Math.min(f, this.packer.height) |
| 2076 | }, j._applyGridGutter = function (a, b) { |
| 2077 | if (!b) return a + this.gutter; |
| 2078 | b += this.gutter; |
| 2079 | var c = a % b, d = c && 1 > c ? "round" : "ceil"; |
| 2080 | return a = Math[d](a / b) * b |
| 2081 | }, j._getContainerSize = function () { |
| 2082 | return this._getOption("horizontal") ? {width: this.maxX - this.gutter} : {height: this.maxY - this.gutter} |
| 2083 | }, j._manageStamp = function (a) { |
| 2084 | var b, d = this.getItem(a); |
| 2085 | if (d && d.isPlacing) b = d.rect; else { |
| 2086 | var e = this._getElementOffset(a); |
| 2087 | b = new c({ |
| 2088 | x: this._getOption("originLeft") ? e.left : e.right, |
| 2089 | y: this._getOption("originTop") ? e.top : e.bottom |
| 2090 | }) |
| 2091 | } |
| 2092 | this._setRectSize(a, b), this.packer.placed(b), this._setMaxXY(b) |
| 2093 | }, j.sortItemsByPosition = function () { |
| 2094 | var a = this._getOption("horizontal") ? g : f; |
| 2095 | this.items.sort(a) |
| 2096 | }, j.fit = function (a, b, c) { |
| 2097 | var d = this.getItem(a); |
| 2098 | d && (this.stamp(d.element), d.enablePlacing(), this.updateShiftTargets(d), b = void 0 === b ? d.rect.x : b, c = void 0 === c ? d.rect.y : c, this.shift(d, b, c), this._bindFitEvents(d), d.moveTo(d.rect.x, d.rect.y), this.shiftLayout(), this.unstamp(d.element), this.sortItemsByPosition(), d.disablePlacing()) |
| 2099 | }, j._bindFitEvents = function (a) { |
| 2100 | function b() { |
| 2101 | d++, 2 == d && c.dispatchEvent("fitComplete", null, [a]) |
| 2102 | } |
| 2103 | |
| 2104 | var c = this, d = 0; |
| 2105 | a.once("layout", b), this.once("layoutComplete", b) |
| 2106 | }, j.resize = function () { |
| 2107 | this.isResizeBound && this.needsResizeLayout() && (this.options.shiftPercentResize ? this.resizeShiftPercentLayout() : this.layout()) |
| 2108 | }, j.needsResizeLayout = function () { |
| 2109 | var b = a(this.element), c = this._getOption("horizontal") ? "innerHeight" : "innerWidth"; |
| 2110 | return b[c] != this.size[c] |
| 2111 | }, j.resizeShiftPercentLayout = function () { |
| 2112 | var b = this._getItemsForLayout(this.items), c = this._getOption("horizontal"), d = c ? "y" : "x", |
| 2113 | e = c ? "height" : "width", f = c ? "rowHeight" : "columnWidth", g = c ? "innerHeight" : "innerWidth", |
| 2114 | h = this[f]; |
| 2115 | if (h = h && h + this.gutter) { |
| 2116 | this._getMeasurements(); |
| 2117 | var i = this[f] + this.gutter; |
| 2118 | b.forEach(function (a) { |
| 2119 | var b = Math.round(a.rect[d] / h); |
| 2120 | a.rect[d] = b * i |
| 2121 | }) |
| 2122 | } else { |
| 2123 | var j = a(this.element)[g] + this.gutter, k = this.packer[e]; |
| 2124 | b.forEach(function (a) { |
| 2125 | a.rect[d] = a.rect[d] / k * j |
| 2126 | }) |
| 2127 | } |
| 2128 | this.shiftLayout() |
| 2129 | }, j.itemDragStart = function (a) { |
| 2130 | if (this.isEnabled) { |
| 2131 | this.stamp(a); |
| 2132 | var b = this.getItem(a); |
| 2133 | b && (b.enablePlacing(), b.showDropPlaceholder(), this.dragItemCount++, this.updateShiftTargets(b)) |
| 2134 | } |
| 2135 | }, j.updateShiftTargets = function (a) { |
| 2136 | this.shiftPacker.reset(), this._getBoundingRect(); |
| 2137 | var b = this._getOption("originLeft"), d = this._getOption("originTop"); |
| 2138 | this.stamps.forEach(function (a) { |
| 2139 | var e = this.getItem(a); |
| 2140 | if (!e || !e.isPlacing) { |
| 2141 | var f = this._getElementOffset(a), g = new c({x: b ? f.left : f.right, y: d ? f.top : f.bottom}); |
| 2142 | this._setRectSize(a, g), this.shiftPacker.placed(g) |
| 2143 | } |
| 2144 | }, this); |
| 2145 | var e = this._getOption("horizontal"), f = e ? "rowHeight" : "columnWidth", g = e ? "height" : "width"; |
| 2146 | this.shiftTargetKeys = [], this.shiftTargets = []; |
| 2147 | var h, i = this[f]; |
| 2148 | if (i = i && i + this.gutter) { |
| 2149 | var j = Math.ceil(a.rect[g] / i), k = Math.floor((this.shiftPacker[g] + this.gutter) / i); |
| 2150 | h = (k - j) * i; |
| 2151 | for (var l = 0; k > l; l++) this._addShiftTarget(l * i, 0, h) |
| 2152 | } else h = this.shiftPacker[g] + this.gutter - a.rect[g], this._addShiftTarget(0, 0, h); |
| 2153 | var m = this._getItemsForLayout(this.items), n = this._getPackMethod(); |
| 2154 | m.forEach(function (a) { |
| 2155 | var b = a.rect; |
| 2156 | this._setRectSize(a.element, b), this.shiftPacker[n](b), this._addShiftTarget(b.x, b.y, h); |
| 2157 | var c = e ? b.x + b.width : b.x, d = e ? b.y : b.y + b.height; |
| 2158 | if (this._addShiftTarget(c, d, h), i) for (var f = Math.round(b[g] / i), j = 1; f > j; j++) { |
| 2159 | var k = e ? c : b.x + i * j, l = e ? b.y + i * j : d; |
| 2160 | this._addShiftTarget(k, l, h) |
| 2161 | } |
| 2162 | }, this) |
| 2163 | }, j._addShiftTarget = function (a, b, c) { |
| 2164 | var d = this._getOption("horizontal") ? b : a; |
| 2165 | if (!(0 !== d && d > c)) { |
| 2166 | var e = a + "," + b, f = -1 != this.shiftTargetKeys.indexOf(e); |
| 2167 | f || (this.shiftTargetKeys.push(e), this.shiftTargets.push({x: a, y: b})) |
| 2168 | } |
| 2169 | }, j.shift = function (a, b, c) { |
| 2170 | var d, e = 1 / 0, f = {x: b, y: c}; |
| 2171 | this.shiftTargets.forEach(function (a) { |
| 2172 | var b = h(a, f); |
| 2173 | e > b && (d = a, e = b) |
| 2174 | }), a.rect.x = d.x, a.rect.y = d.y |
| 2175 | }; |
| 2176 | var k = 120; |
| 2177 | j.itemDragMove = function (a, b, c) { |
| 2178 | function d() { |
| 2179 | f.shift(e, b, c), e.positionDropPlaceholder(), f.layout() |
| 2180 | } |
| 2181 | |
| 2182 | var e = this.isEnabled && this.getItem(a); |
| 2183 | if (e) { |
| 2184 | b -= this.size.paddingLeft, c -= this.size.paddingTop; |
| 2185 | var f = this, g = new Date; |
| 2186 | this._itemDragTime && g - this._itemDragTime < k ? (clearTimeout(this.dragTimeout), this.dragTimeout = setTimeout(d, k)) : (d(), this._itemDragTime = g) |
| 2187 | } |
| 2188 | }, j.itemDragEnd = function (a) { |
| 2189 | function b() { |
| 2190 | d++, 2 == d && (c.element.classList.remove("is-positioning-post-drag"), c.hideDropPlaceholder(), e.dispatchEvent("dragItemPositioned", null, [c])) |
| 2191 | } |
| 2192 | |
| 2193 | var c = this.isEnabled && this.getItem(a); |
| 2194 | if (c) { |
| 2195 | clearTimeout(this.dragTimeout), c.element.classList.add("is-positioning-post-drag"); |
| 2196 | var d = 0, e = this; |
| 2197 | c.once("layout", b), this.once("layoutComplete", b), c.moveTo(c.rect.x, c.rect.y), this.layout(), this.dragItemCount = Math.max(0, this.dragItemCount - 1), this.sortItemsByPosition(), c.disablePlacing(), this.unstamp(c.element) |
| 2198 | } |
| 2199 | }, j.bindDraggabillyEvents = function (a) { |
| 2200 | this._bindDraggabillyEvents(a, "on") |
| 2201 | }, j.unbindDraggabillyEvents = function (a) { |
| 2202 | this._bindDraggabillyEvents(a, "off") |
| 2203 | }, j._bindDraggabillyEvents = function (a, b) { |
| 2204 | var c = this.handleDraggabilly; |
| 2205 | a[b]("dragStart", c.dragStart), a[b]("dragMove", c.dragMove), a[b]("dragEnd", c.dragEnd) |
| 2206 | }, j.bindUIDraggableEvents = function (a) { |
| 2207 | this._bindUIDraggableEvents(a, "on") |
| 2208 | }, j.unbindUIDraggableEvents = function (a) { |
| 2209 | this._bindUIDraggableEvents(a, "off") |
| 2210 | }, j._bindUIDraggableEvents = function (a, b) { |
| 2211 | var c = this.handleUIDraggable; |
| 2212 | a[b]("dragstart", c.start)[b]("drag", c.drag)[b]("dragstop", c.stop) |
| 2213 | }; |
| 2214 | var l = j.destroy; |
| 2215 | return j.destroy = function () { |
| 2216 | l.apply(this, arguments), this.isEnabled = !1 |
| 2217 | }, i.Rect = c, i.Packer = d, i |
| 2218 | }), function (a, b) { |
| 2219 | "function" == typeof define && define.amd ? define(["isotope-layout/js/layout-mode", "packery/js/packery"], b) : "object" == typeof module && module.exports ? module.exports = b(require("isotope-layout/js/layout-mode"), require("packery")) : b(a.Smashotope.LayoutMode, a.Packery) |
| 2220 | }(window, function (a, b) { |
| 2221 | var c = a.create("packery"), d = c.prototype, e = {_getElementOffset: !0, _getMeasurement: !0}; |
| 2222 | for (var f in b.prototype) e[f] || (d[f] = b.prototype[f]); |
| 2223 | var g = d._resetLayout; |
| 2224 | d._resetLayout = function () { |
| 2225 | this.packer = this.packer || new b.Packer, this.shiftPacker = this.shiftPacker || new b.Packer, g.apply(this, arguments) |
| 2226 | }; |
| 2227 | var h = d._getItemLayoutPosition; |
| 2228 | d._getItemLayoutPosition = function (a) { |
| 2229 | return a.rect = a.rect || new b.Rect, h.call(this, a) |
| 2230 | }; |
| 2231 | var i = d.needsResizeLayout; |
| 2232 | d.needsResizeLayout = function () { |
| 2233 | return this._getOption("horizontal") ? this.needsVerticalResizeLayout() : i.call(this) |
| 2234 | }; |
| 2235 | var j = d._getOption; |
| 2236 | return d._getOption = function (a) { |
| 2237 | return "horizontal" == a ? void 0 !== this.options.isHorizontal ? this.options.isHorizontal : this.options.horizontal : j.apply(this.smashotope, arguments) |
| 2238 | }, c |
| 2239 | }); |
| 2240 | |
| 2241 | // Two Row Carousel |
| 2242 | ;(function ($, window, document, undefined) { |
| 2243 | Owl2row = function (scope) { |
| 2244 | this.owl = scope; |
| 2245 | this.owl.options = $.extend({}, Owl2row.Defaults, this.owl.options); |
| 2246 | var self = this; |
| 2247 | //link callback events with owl carousel here |
| 2248 | this.handlers = { |
| 2249 | 'initialize.owl.carousel': $.proxy(function (e) { |
| 2250 | if (this.owl.settings.owl2row === true && !$("#sb_instagram").hasClass("2rows")) { |
| 2251 | this.build2row(this); |
| 2252 | $("#sb_instagram").addClass("2rows"); |
| 2253 | }else{ |
| 2254 | $("#sb_instagram").removeClass("2rows"); |
| 2255 | } |
| 2256 | }, this) |
| 2257 | }; |
| 2258 | |
| 2259 | this.owl.$element.on(this.handlers); |
| 2260 | |
| 2261 | }; |
| 2262 | |
| 2263 | Owl2row.Defaults = { |
| 2264 | owl2row: false, |
| 2265 | owl2rowTarget: 'sb-post-item-wrap', |
| 2266 | owl2rowContainer: 'sbr_owl2row-item', |
| 2267 | owl2rowDirection: 'utd' // ltr |
| 2268 | }; |
| 2269 | |
| 2270 | //mehtods: |
| 2271 | Owl2row.prototype.build2row = function (thisScope) { |
| 2272 | |
| 2273 | var carousel = $(thisScope.owl.$element); |
| 2274 | var carouselItems = carousel.find('.' + thisScope.owl.options.owl2rowTarget); |
| 2275 | |
| 2276 | var aEvenElements = []; |
| 2277 | var aOddElements = []; |
| 2278 | |
| 2279 | $.each(carouselItems, function (index, item) { |
| 2280 | |
| 2281 | if (index % 2 === 0) { |
| 2282 | aEvenElements.push(item); |
| 2283 | } else { |
| 2284 | aOddElements.push(item); |
| 2285 | } |
| 2286 | }); |
| 2287 | |
| 2288 | //carousel.empty(); |
| 2289 | |
| 2290 | switch (thisScope.owl.options.owl2rowDirection) { |
| 2291 | case 'ltr': |
| 2292 | thisScope.leftToright(thisScope, carousel, carouselItems); |
| 2293 | break; |
| 2294 | |
| 2295 | default : |
| 2296 | thisScope.upTodown(thisScope, aEvenElements, aOddElements, carousel); |
| 2297 | } |
| 2298 | |
| 2299 | |
| 2300 | }; |
| 2301 | |
| 2302 | Owl2row.prototype.leftToright = function (thisScope, carousel, carouselItems) { |
| 2303 | |
| 2304 | var o2wContainerClass = thisScope.owl.options.owl2rowContainer; |
| 2305 | var owlMargin = thisScope.owl.options.margin; |
| 2306 | var carouselItemsLength = carouselItems.length; |
| 2307 | var firsArr = []; |
| 2308 | var secondArr = []; |
| 2309 | |
| 2310 | if (carouselItemsLength % 2 === 1) { |
| 2311 | carouselItemsLength = ((carouselItemsLength - 1) / 2) + 1; |
| 2312 | } else { |
| 2313 | carouselItemsLength = carouselItemsLength / 2; |
| 2314 | } |
| 2315 | |
| 2316 | $.each(carouselItems, function (index, item) { |
| 2317 | |
| 2318 | |
| 2319 | if (index < carouselItemsLength) { |
| 2320 | firsArr.push(item); |
| 2321 | } else { |
| 2322 | secondArr.push(item); |
| 2323 | } |
| 2324 | }); |
| 2325 | |
| 2326 | $.each(firsArr, function (index, item) { |
| 2327 | var rowContainer = $('<div class="' + o2wContainerClass + '"/>'); |
| 2328 | |
| 2329 | var firstRowElement = firsArr[index]; |
| 2330 | firstRowElement.style.marginBottom = owlMargin + 'px'; |
| 2331 | |
| 2332 | rowContainer |
| 2333 | .append(firstRowElement) |
| 2334 | .append(secondArr[index]); |
| 2335 | |
| 2336 | carousel.append(rowContainer); |
| 2337 | }); |
| 2338 | |
| 2339 | }; |
| 2340 | |
| 2341 | Owl2row.prototype.upTodown = function (thisScope, aEvenElements, aOddElements, carousel) { |
| 2342 | |
| 2343 | var o2wContainerClass = thisScope.owl.options.owl2rowContainer; |
| 2344 | var owlMargin = thisScope.owl.options.margin; |
| 2345 | |
| 2346 | $.each(aEvenElements, function (index, item) { |
| 2347 | |
| 2348 | var rowContainer = $('<div class="' + o2wContainerClass + '"/>'); |
| 2349 | var evenElement = aEvenElements[index]; |
| 2350 | |
| 2351 | evenElement.style.marginBottom = owlMargin + 'px'; |
| 2352 | |
| 2353 | rowContainer |
| 2354 | .append(evenElement) |
| 2355 | .append(aOddElements[index]); |
| 2356 | |
| 2357 | carousel.append(rowContainer); |
| 2358 | }); |
| 2359 | }; |
| 2360 | |
| 2361 | /** |
| 2362 | * Destroys the plugin. |
| 2363 | */ |
| 2364 | Owl2row.prototype.destroy = function () { |
| 2365 | var handler, property; |
| 2366 | }; |
| 2367 | |
| 2368 | $.fn.sbrOwlCarousel.Constructor.Plugins['owl2row'] = Owl2row; |
| 2369 | })(window.Zepto || window.jQuery, window, document); |
| 2370 | |
| 2371 | |
| 2372 | (function($){ |
| 2373 | |
| 2374 | function sbrAddImgLiquid() { |
| 2375 | /*! imgLiquid v0.9.944 / 03-05-2013 https://github.com/karacas/imgLiquid */ |
| 2376 | var sbr_imgLiquid = sbr_imgLiquid || {VER: "0.9.944"}; |
| 2377 | sbr_imgLiquid.bgs_Available = !1, sbr_imgLiquid.bgs_CheckRunned = !1, function (i) { |
| 2378 | function t() { |
| 2379 | if (!sbr_imgLiquid.bgs_CheckRunned) { |
| 2380 | sbr_imgLiquid.bgs_CheckRunned = !0; |
| 2381 | var t = i('<span style="background-size:cover" />'); |
| 2382 | i("body").append(t), !function () { |
| 2383 | var i = t[0]; |
| 2384 | if (i && window.getComputedStyle) { |
| 2385 | var e = window.getComputedStyle(i, null); |
| 2386 | e && e.backgroundSize && (sbr_imgLiquid.bgs_Available = "cover" === e.backgroundSize) |
| 2387 | } |
| 2388 | }(), t.remove() |
| 2389 | } |
| 2390 | } |
| 2391 | |
| 2392 | i.fn.extend({ |
| 2393 | sbr_imgLiquid: function (e) { |
| 2394 | this.defaults = { |
| 2395 | fill: !0, |
| 2396 | verticalAlign: "center", |
| 2397 | horizontalAlign: "center", |
| 2398 | useBackgroundSize: !0, |
| 2399 | useDataHtmlAttr: !0, |
| 2400 | responsive: !0, |
| 2401 | delay: 0, |
| 2402 | fadeInTime: 0, |
| 2403 | removeBoxBackground: !0, |
| 2404 | hardPixels: !0, |
| 2405 | responsiveCheckTime: 500, |
| 2406 | timecheckvisibility: 500, |
| 2407 | onStart: null, |
| 2408 | onFinish: null, |
| 2409 | onItemStart: null, |
| 2410 | onItemFinish: null, |
| 2411 | onItemError: null |
| 2412 | }, t(); |
| 2413 | var a = this; |
| 2414 | return this.options = e, this.settings = i.extend({}, this.defaults, this.options), this.settings.onStart && this.settings.onStart(), this.each(function (t) { |
| 2415 | function e() { |
| 2416 | -1 === u.css("background-image").indexOf(encodeURI(c.attr("src"))) && u.css({"background-image": 'url("' + encodeURI(c.attr("src")) + '")'}), u.css({ |
| 2417 | "background-size": g.fill ? "cover" : "contain", |
| 2418 | "background-position": (g.horizontalAlign + " " + g.verticalAlign).toLowerCase(), |
| 2419 | "background-repeat": "no-repeat" |
| 2420 | }), i("a:first", u).css({ |
| 2421 | display: "block", |
| 2422 | width: "100%", |
| 2423 | height: "100%" |
| 2424 | }), i("img", u).css({display: "none"}), g.onItemFinish && g.onItemFinish(t, u, c), u.addClass("sbr_imgLiquid_bgSize"), u.addClass("sbr_imgLiquid_ready"), l() |
| 2425 | } |
| 2426 | |
| 2427 | function o() { |
| 2428 | function e() { |
| 2429 | c.data("sbr_imgLiquid_error") || c.data("sbr_imgLiquid_loaded") || c.data("sbr_imgLiquid_oldProcessed") || (u.is(":visible") && c[0].complete && c[0].width > 0 && c[0].height > 0 ? (c.data("sbr_imgLiquid_loaded", !0), setTimeout(r, t * g.delay)) : setTimeout(e, g.timecheckvisibility)) |
| 2430 | } |
| 2431 | |
| 2432 | if (c.data("oldSrc") && c.data("oldSrc") !== c.attr("src")) { |
| 2433 | var a = c.clone().removeAttr("style"); |
| 2434 | return a.data("sbr_imgLiquid_settings", c.data("sbr_imgLiquid_settings")), c.parent().prepend(a), c.remove(), c = a, c[0].width = 0, void setTimeout(o, 10) |
| 2435 | } |
| 2436 | return c.data("sbr_imgLiquid_oldProcessed") ? void r() : (c.data("sbr_imgLiquid_oldProcessed", !1), c.data("oldSrc", c.attr("src")), i("img:not(:first)", u).css("display", "none"), u.css({overflow: "hidden"}), c.fadeTo(0, 0).removeAttr("width").removeAttr("height").css({ |
| 2437 | visibility: "visible", |
| 2438 | "max-width": "none", |
| 2439 | "max-height": "none", |
| 2440 | width: "auto", |
| 2441 | height: "auto", |
| 2442 | display: "block" |
| 2443 | }), c.on("error", n), c[0].onerror = n, e(), void d()) |
| 2444 | } |
| 2445 | |
| 2446 | function d() { |
| 2447 | (g.responsive || c.data("sbr_imgLiquid_oldProcessed")) && c.data("sbr_imgLiquid_settings") && (g = c.data("sbr_imgLiquid_settings"), u.actualSize = u.get(0).offsetWidth + u.get(0).offsetHeight / 1e4, u.sizeOld && u.actualSize !== u.sizeOld && r(), u.sizeOld = u.actualSize, setTimeout(d, g.responsiveCheckTime)) |
| 2448 | } |
| 2449 | |
| 2450 | function n() { |
| 2451 | c.data("sbr_imgLiquid_error", !0), u.addClass("sbr_imgLiquid_error"), g.onItemError && g.onItemError(t, u, c), l() |
| 2452 | } |
| 2453 | |
| 2454 | function s() { |
| 2455 | var i = {}; |
| 2456 | if (a.settings.useDataHtmlAttr) { |
| 2457 | var t = u.attr("data-sbr_imgLiquid-fill"), |
| 2458 | e = u.attr("data-sbr_imgLiquid-horizontalAlign"), |
| 2459 | o = u.attr("data-sbr_imgLiquid-verticalAlign"); |
| 2460 | ("true" === t || "false" === t) && (i.fill = Boolean("true" === t)), void 0 === e || "left" !== e && "center" !== e && "right" !== e && -1 === e.indexOf("%") || (i.horizontalAlign = e), void 0 === o || "top" !== o && "bottom" !== o && "center" !== o && -1 === o.indexOf("%") || (i.verticalAlign = o) |
| 2461 | } |
| 2462 | return sbr_imgLiquid.isIE && a.settings.ieFadeInDisabled && (i.fadeInTime = 0), i |
| 2463 | } |
| 2464 | |
| 2465 | function r() { |
| 2466 | var i, e, a, o, d, n, s, r, m = 0, h = 0, f = u.width(), v = u.height(); |
| 2467 | void 0 === c.data("owidth") && c.data("owidth", c[0].width), void 0 === c.data("oheight") && c.data("oheight", c[0].height), g.fill === f / v >= c.data("owidth") / c.data("oheight") ? (i = "100%", e = "auto", a = Math.floor(f), o = Math.floor(f * (c.data("oheight") / c.data("owidth")))) : (i = "auto", e = "100%", a = Math.floor(v * (c.data("owidth") / c.data("oheight"))), o = Math.floor(v)), d = g.horizontalAlign.toLowerCase(), s = f - a, "left" === d && (h = 0), "center" === d && (h = .5 * s), "right" === d && (h = s), -1 !== d.indexOf("%") && (d = parseInt(d.replace("%", ""), 10), d > 0 && (h = s * d * .01)), n = g.verticalAlign.toLowerCase(), r = v - o, "left" === n && (m = 0), "center" === n && (m = .5 * r), "bottom" === n && (m = r), -1 !== n.indexOf("%") && (n = parseInt(n.replace("%", ""), 10), n > 0 && (m = r * n * .01)), g.hardPixels && (i = a, e = o), c.css({ |
| 2468 | width: i, |
| 2469 | height: e, |
| 2470 | "margin-left": Math.floor(h), |
| 2471 | "margin-top": Math.floor(m) |
| 2472 | }), c.data("sbr_imgLiquid_oldProcessed") || (c.fadeTo(g.fadeInTime, 1), c.data("sbr_imgLiquid_oldProcessed", !0), g.removeBoxBackground && u.css("background-image", "none"), u.addClass("sbr_imgLiquid_nobgSize"), u.addClass("sbr_imgLiquid_ready")), g.onItemFinish && g.onItemFinish(t, u, c), l() |
| 2473 | } |
| 2474 | |
| 2475 | function l() { |
| 2476 | t === a.length - 1 && a.settings.onFinish && a.settings.onFinish() |
| 2477 | } |
| 2478 | |
| 2479 | var g = a.settings, u = i(this), c = i("img:first", u); |
| 2480 | return c.length ? (c.data("sbr_imgLiquid_settings") ? (u.removeClass("sbr_imgLiquid_error").removeClass("sbr_imgLiquid_ready"), g = i.extend({}, c.data("sbr_imgLiquid_settings"), a.options)) : g = i.extend({}, a.settings, s()), c.data("sbr_imgLiquid_settings", g), g.onItemStart && g.onItemStart(t, u, c), void (sbr_imgLiquid.bgs_Available && g.useBackgroundSize ? e() : o())) : void n() |
| 2481 | }) |
| 2482 | } |
| 2483 | }) |
| 2484 | }(jQuery); |
| 2485 | |
| 2486 | // Use imagefill to set the images as backgrounds so they can be square |
| 2487 | !function () { |
| 2488 | var css = sbr_imgLiquid.injectCss, |
| 2489 | head = document.getElementsByTagName('head')[0], |
| 2490 | style = document.createElement('style'); |
| 2491 | style.type = 'text/css'; |
| 2492 | if (style.styleSheet) { |
| 2493 | style.styleSheet.cssText = css; |
| 2494 | } else { |
| 2495 | style.appendChild(document.createTextNode(css)); |
| 2496 | } |
| 2497 | head.appendChild(style); |
| 2498 | }(); |
| 2499 | } |
| 2500 | |
| 2501 | function sbrAddVisibilityListener() { |
| 2502 | /* Detect when element becomes visible. Used for when the feed is initially hidden, in a tab for example. https://github.com/shaunbowe/jquery.visibilityChanged */ |
| 2503 | !function (i) { |
| 2504 | var n = { |
| 2505 | callback: function () { |
| 2506 | }, runOnLoad: !0, frequency: 100, sbrPreviousVisibility: null |
| 2507 | }, c = {}; |
| 2508 | c.sbrCheckVisibility = function (i, n) { |
| 2509 | if (jQuery.contains(document, i[0])) { |
| 2510 | var e = n.sbrPreviousVisibility, t = i.is(":visible"); |
| 2511 | n.sbrPreviousVisibility = t, null == e ? n.runOnLoad && n.callback(i, t) : e !== t && n.callback(i, t), setTimeout(function () { |
| 2512 | c.sbrCheckVisibility(i, n) |
| 2513 | }, n.frequency) |
| 2514 | } |
| 2515 | }, i.fn.sbrVisibilityChanged = function (e) { |
| 2516 | var t = i.extend({}, n, e); |
| 2517 | return this.each(function () { |
| 2518 | c.sbrCheckVisibility(i(this), t) |
| 2519 | }) |
| 2520 | } |
| 2521 | }(jQuery); |
| 2522 | } |
| 2523 | |
| 2524 | function Sbr() { |
| 2525 | this.feeds = {}; |
| 2526 | this.options = sbrOptions; |
| 2527 | this.isTouch = sbrIsTouch(); |
| 2528 | } |
| 2529 | |
| 2530 | Sbr.prototype = { |
| 2531 | createPage: function (createFeeds, createFeedsArgs) { |
| 2532 | if (typeof window.sbrOptions.adminAjaxUrl === 'undefined' || window.sbrOptions.adminAjaxUrl.indexOf(window.location.hostname) === -1) { |
| 2533 | // Use location.origin (scheme + host [+ port]) so the rewritten URL |
| 2534 | // is absolute. location.hostname alone drops the scheme AND the |
| 2535 | // leading slash, so $.ajax treats it as a RELATIVE path and resolves |
| 2536 | // it against the current page — e.g. on a cloned/staging domain the |
| 2537 | // Load More POST hit /sample-page/host/wp-admin/admin-ajax.php → 404. |
| 2538 | window.sbrOptions.adminAjaxUrl = window.location.origin + '/wp-admin/admin-ajax.php'; |
| 2539 | } |
| 2540 | this.createFeeds(createFeedsArgs); |
| 2541 | }, |
| 2542 | createLightbox: function() { |
| 2543 | var lbBuilder = sbrGetlightboxBuilder(); |
| 2544 | var sbr_lb_delay = (function () { |
| 2545 | var sbr_timer = 0; |
| 2546 | return function (sbr_callback, sbr_ms) { |
| 2547 | clearTimeout(sbr_timer); |
| 2548 | sbr_timer = setTimeout(sbr_callback, sbr_ms); |
| 2549 | }; |
| 2550 | })(); |
| 2551 | jQuery(window).on('resize',function () { |
| 2552 | sbr_lb_delay(function () { |
| 2553 | lbBuilder.afterResize(); |
| 2554 | }, 200); |
| 2555 | }); |
| 2556 | /* Lightbox v2.7.1 by Lokesh Dhakar - http://lokeshdhakar.com/projects/lightbox2/ - Heavily modified specifically for this plugin */ |
| 2557 | (function() { |
| 2558 | var a = jQuery, |
| 2559 | b = function() { |
| 2560 | function a() { |
| 2561 | this.fadeDuration = 500, this.fitImagesInViewport = !0, this.resizeDuration = 700, this.positionFromTop = 50, this.showImageNumberLabel = !0, this.alwaysShowNavOnTouchDevices = !1, this.wrapAround = !1 |
| 2562 | } |
| 2563 | return a.prototype.albumLabel = function(a, b) { |
| 2564 | return a + " / " + b |
| 2565 | }, a |
| 2566 | }(), |
| 2567 | c = function() { |
| 2568 | function b(a) { |
| 2569 | this.options = a, this.album = [], this.currentImageIndex = void 0, this.init() |
| 2570 | } |
| 2571 | return b.prototype.init = function() { |
| 2572 | this.enable(), this.build() |
| 2573 | }, b.prototype.enable = function() { |
| 2574 | var b = this; |
| 2575 | a("body").on("click", "a[data-sbr-lightbox]", function(c) { |
| 2576 | return b.start(a(c.currentTarget)), !1 |
| 2577 | }) |
| 2578 | }, b.prototype.build = function() { |
| 2579 | var b = this; |
| 2580 | a(""+ |
| 2581 | lbBuilder.template()).appendTo(a("body")), this.$lightbox = a("#sbr_lightbox"), this.$overlay = a("#sbr_lightboxOverlay"), this.$outerContainer = this.$lightbox.find(".sbr_lb-outerContainer"), this.$container = this.$lightbox.find(".sbr_lb-container"), this.containerTopPadding = parseInt(this.$container.css("padding-top"), 10), this.containerRightPadding = parseInt(this.$container.css("padding-right"), 10), this.containerBottomPadding = parseInt(this.$container.css("padding-bottom"), 10), this.containerLeftPadding = parseInt(this.$container.css("padding-left"), 10), this.$overlay.hide().on("click", function() { |
| 2582 | return b.end(), !1 |
| 2583 | }), jQuery(document).on('click', function(event, b, c) { |
| 2584 | //Fade out the lightbox if click anywhere outside of the two elements defined below |
| 2585 | if (!jQuery(event.target).closest('.sbr_lb-outerContainer').length) { |
| 2586 | if (!jQuery(event.target).closest('.sbr_lb-dataContainer').length) { |
| 2587 | //Fade out lightbox |
| 2588 | if (typeof window.sbrLightboxPlayer !== 'undefined') { YT.get('sbr_lb-player').pauseVideo(); } |
| 2589 | |
| 2590 | jQuery('#sbr_lightboxOverlay, #sbr_lightbox').fadeOut(); |
| 2591 | } |
| 2592 | } |
| 2593 | }), this.$lightbox.hide(), |
| 2594 | jQuery('#sbr_lightboxOverlay').on("click", function(c) { |
| 2595 | if (typeof window.sbrLightboxPlayer !== 'undefined') { YT.get('sbr_lb-player').pauseVideo(); } |
| 2596 | |
| 2597 | return "sbr_lightbox" === a(c.target).attr("id") && b.end(), !1 |
| 2598 | }), this.$lightbox.find(".sbr_lb-prev").on("click", function() { |
| 2599 | |
| 2600 | if (typeof window.sbrLightboxPlayer !== 'undefined') { YT.get('sbr_lb-player').pauseVideo(); } |
| 2601 | |
| 2602 | return b.changeImage(0 === b.currentImageIndex ? b.album.length - 1 : b.currentImageIndex - 1), !1 |
| 2603 | }), this.$lightbox.find(".sbr_lb-container").on("swiperight", function() { |
| 2604 | |
| 2605 | if (typeof window.sbrLightboxPlayer !== 'undefined') { YT.get('sbr_lb-player').pauseVideo(); } |
| 2606 | |
| 2607 | return b.changeImage(0 === b.currentImageIndex ? b.album.length - 1 : b.currentImageIndex - 1), !1 |
| 2608 | }), this.$lightbox.find(".sbr_lb-next").on("click", function() { |
| 2609 | |
| 2610 | if (typeof window.sbrLightboxPlayer !== 'undefined') { YT.get('sbr_lb-player').pauseVideo(); } |
| 2611 | |
| 2612 | return b.changeImage(b.currentImageIndex === b.album.length - 1 ? 0 : b.currentImageIndex + 1), !1 |
| 2613 | }), this.$lightbox.find(".sbr_lb-container").on("swipeleft", function() { |
| 2614 | |
| 2615 | if (typeof window.sbrLightboxPlayer !== 'undefined') { YT.get('sbr_lb-player').pauseVideo(); } |
| 2616 | |
| 2617 | return b.changeImage(b.currentImageIndex === b.album.length - 1 ? 0 : b.currentImageIndex + 1), !1 |
| 2618 | }), this.$lightbox.find(".sbr_lb-loader, .sbr_lb-close").on("click", function() { |
| 2619 | |
| 2620 | if (typeof window.sbrLightboxPlayer !== 'undefined') { YT.get('sbr_lb-player').pauseVideo(); } |
| 2621 | |
| 2622 | return b.end(), !1 |
| 2623 | }) |
| 2624 | }, b.prototype.start = function(b) { |
| 2625 | function c(a) { |
| 2626 | d.album.push(lbBuilder.getData(a)) |
| 2627 | } |
| 2628 | var d = this, |
| 2629 | e = a(window); |
| 2630 | e.on("resize", a.proxy(this.sizeOverlay, this)), a("select, object, embed").css({ |
| 2631 | visibility: "hidden" |
| 2632 | }), this.sizeOverlay(), this.album = []; |
| 2633 | var f, g = 0, |
| 2634 | h = b.attr("data-sbr-lightbox"); |
| 2635 | if (h) { |
| 2636 | f = a(b.prop("tagName") + '[data-sbr-lightbox="' + h + '"]'); |
| 2637 | for (var i = 0; i < f.length; i = ++i) c(a(f[i])), f[i] === b[0] && (g = i) |
| 2638 | } else if ("lightbox" === b.attr("rel")) c(b); |
| 2639 | else { |
| 2640 | f = a(b.prop("tagName") + '[rel="' + b.attr("rel") + '"]'); |
| 2641 | for (var j = 0; j < f.length; j = ++j) c(a(f[j])), f[j] === b[0] && (g = j) |
| 2642 | } |
| 2643 | var k = e.scrollTop() + this.options.positionFromTop, |
| 2644 | l = e.scrollLeft(); |
| 2645 | this.$lightbox.css({ |
| 2646 | top: k + "px", |
| 2647 | left: l + "px" |
| 2648 | }).fadeIn(this.options.fadeDuration), this.changeImage(g) |
| 2649 | }, b.prototype.changeImage = function(b) { |
| 2650 | var c = this; |
| 2651 | this.disableKeyboardNav(); |
| 2652 | var d = this.$lightbox.find(".sbr_lb-image"); |
| 2653 | this.$overlay.fadeIn(this.options.fadeDuration), a(".sbr_lb-loader").fadeIn("slow"), this.$lightbox.find(".sbr_lb-image, .sbr_lb-nav, .sbr_lb-prev, .sbr_lb-next, .sbr_lb-dataContainer, .sbr_lb-numbers, .sbr_lb-caption").hide(), this.$outerContainer.addClass("animating"); |
| 2654 | var e = new Image; |
| 2655 | e.onload = function() { |
| 2656 | var f, g, h, i, j, k, l; |
| 2657 | var sbrArrowWidth = 100; |
| 2658 | d.attr("src", c.album[b].link), f = a(e), d.width(e.width), d.height(e.height), c.options.fitImagesInViewport && (l = a(window).width(), k = a(window).height(), j = l - c.containerLeftPadding - c.containerRightPadding - 20 - sbrArrowWidth, i = k - c.containerTopPadding - c.containerBottomPadding - 150, (e.width > j || e.height > i) && (e.width / j > e.height / i ? (h = j, g = parseInt(e.height / (e.width / h), 10), d.width(h), d.height(g)) : (g = i, h = parseInt(e.width / (e.height / g), 10), d.width(h), d.height(g)))), c.sizeContainer(d.width(), d.height()) |
| 2659 | }, e.src = this.album[b].link, this.currentImageIndex = b |
| 2660 | }, b.prototype.sizeOverlay = function() { |
| 2661 | this.$overlay.width(a(window).width()).height(a(document).height()) |
| 2662 | }, b.prototype.sizeContainer = function(a, b) { |
| 2663 | function c() { |
| 2664 | d.$lightbox.find(".sbr_lb-dataContainer").width(g), d.$lightbox.find(".sbr_lb-prevLink").height(h), d.$lightbox.find(".sbr_lb-nextLink").height(h), d.showImage() |
| 2665 | } |
| 2666 | var d = this, |
| 2667 | e = this.$outerContainer.outerWidth(), |
| 2668 | f = this.$outerContainer.outerHeight(), |
| 2669 | g = a + this.containerLeftPadding + this.containerRightPadding, |
| 2670 | h = b + this.containerTopPadding + this.containerBottomPadding; |
| 2671 | e !== g || f !== h ? this.$outerContainer.animate({ |
| 2672 | width: g, |
| 2673 | height: h |
| 2674 | }, this.options.resizeDuration, "swing", function() { |
| 2675 | c() |
| 2676 | }) : c() |
| 2677 | }, b.prototype.showImage = function() { |
| 2678 | this.$lightbox.find(".sbr_lb-loader").hide(), this.$lightbox.find(".sbr_lb-image").fadeIn("slow"), this.updateNav(), this.updateDetails(), this.preloadNeighboringImages(), this.enableKeyboardNav() |
| 2679 | }, b.prototype.updateNav = function() { |
| 2680 | var a = !1; |
| 2681 | try { |
| 2682 | document.createEvent("TouchEvent"), a = this.options.alwaysShowNavOnTouchDevices ? !0 : !1 |
| 2683 | } catch (b) {} |
| 2684 | this.$lightbox.find(".sbr_lb-nav").show(), this.album.length > 1 && (this.options.wrapAround ? (a && this.$lightbox.find(".sbr_lb-prev, .sbr_lb-next").css("opacity", "1"), this.$lightbox.find(".sbr_lb-prev, .sbr_lb-next").show()) : (this.currentImageIndex > 0 && (this.$lightbox.find(".sbr_lb-prev").show(), a && this.$lightbox.find(".sbr_lb-prev").css("opacity", "1")), this.currentImageIndex < this.album.length - 1 && (this.$lightbox.find(".sbr_lb-next").show(), a && this.$lightbox.find(".sbr_lb-next").css("opacity", "1")))) |
| 2685 | }, b.prototype.updateDetails = function() { |
| 2686 | var b = this; |
| 2687 | |
| 2688 | /** NEW PHOTO ACTION **/ |
| 2689 | if(jQuery('iframe.sbr_lb-player-loaded').length) { |
| 2690 | jQuery('.sbr_lb-player-placeholder').replaceWith(jQuery('iframe.sbr_lb-player-loaded')); |
| 2691 | jQuery('iframe.sbr_lb-player-loaded').removeClass('sbr_lb-player-loaded').show(); |
| 2692 | } |
| 2693 | //Switch video when either a new popup or navigating to new one |
| 2694 | var feed = window.sbr.feeds[this.album[this.currentImageIndex].feedIndex]; |
| 2695 | lbBuilder.beforePlayerSetup(this.$lightbox,this.album[this.currentImageIndex],this.currentImageIndex,this.album,feed); |
| 2696 | var preconditions = true; |
| 2697 | |
| 2698 | if( preconditions ){ |
| 2699 | jQuery('#sbr_lightbox').removeClass('sbr-image-lightbox'); |
| 2700 | |
| 2701 | var fullImage = this.album[this.currentImageIndex].link; |
| 2702 | $('.sbr_lb-image').attr('src',fullImage); |
| 2703 | this.$outerContainer.removeClass("animating"); |
| 2704 | this.$lightbox.find(".sbr_lb-dataContainer").fadeIn(this.options.resizeDuration, function() { |
| 2705 | return b.sizeOverlay() |
| 2706 | }); |
| 2707 | |
| 2708 | if (this.album.length > 1 && this.options.showImageNumberLabel) { |
| 2709 | this.$lightbox.find(".sbr_lb-number").text(this.options.albumLabel(this.currentImageIndex + 1, this.album.length)).fadeIn("fast"); |
| 2710 | } else { |
| 2711 | this.$lightbox.find(".sbr_lb-number").hide(); |
| 2712 | } |
| 2713 | } |
| 2714 | }, b.prototype.preloadNeighboringImages = function() { |
| 2715 | if (this.album.length > this.currentImageIndex + 1) { |
| 2716 | var a = new Image; |
| 2717 | a.src = this.album[this.currentImageIndex + 1].link |
| 2718 | } |
| 2719 | if (this.currentImageIndex > 0) { |
| 2720 | var b = new Image; |
| 2721 | b.src = this.album[this.currentImageIndex - 1].link |
| 2722 | } |
| 2723 | }, b.prototype.enableKeyboardNav = function() { |
| 2724 | a(document).on("keyup.keyboard", a.proxy(this.keyboardAction, this)) |
| 2725 | }, b.prototype.disableKeyboardNav = function() { |
| 2726 | a(document).off(".keyboard") |
| 2727 | }, b.prototype.keyboardAction = function(a) { |
| 2728 | |
| 2729 | var KEYCODE_ESC = 27; |
| 2730 | var KEYCODE_LEFTARROW = 37; |
| 2731 | var KEYCODE_RIGHTARROW = 39; |
| 2732 | |
| 2733 | var keycode = event.keyCode; |
| 2734 | var key = String.fromCharCode(keycode).toLowerCase(); |
| 2735 | if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) { |
| 2736 | if( sbr_supports_video() ) $('#sbr_lightbox video.sbr_video')[0].pause(); |
| 2737 | $('#sbr_lightbox iframe').attr('src', ''); |
| 2738 | this.end(); |
| 2739 | } else if (key === 'p' || keycode === KEYCODE_LEFTARROW) { |
| 2740 | if (this.currentImageIndex !== 0) { |
| 2741 | this.changeImage(this.currentImageIndex - 1); |
| 2742 | } else if (this.options.wrapAround && this.album.length > 1) { |
| 2743 | this.changeImage(this.album.length - 1); |
| 2744 | } |
| 2745 | } else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) { |
| 2746 | if (this.currentImageIndex !== this.album.length - 1) { |
| 2747 | this.changeImage(this.currentImageIndex + 1); |
| 2748 | } else if (this.options.wrapAround && this.album.length > 1) { |
| 2749 | this.changeImage(0); |
| 2750 | } |
| 2751 | } |
| 2752 | |
| 2753 | }, b.prototype.end = function() { |
| 2754 | this.disableKeyboardNav(), a(window).off("resize", this.sizeOverlay), this.$lightbox.fadeOut(this.options.fadeDuration), this.$overlay.fadeOut(this.options.fadeDuration), a("select, object, embed").css({ |
| 2755 | visibility: "visible" |
| 2756 | }) |
| 2757 | }, b |
| 2758 | }(); |
| 2759 | a(function() { |
| 2760 | { |
| 2761 | var a = new b; |
| 2762 | new c(a) |
| 2763 | |
| 2764 | //Lightbox hide photo function |
| 2765 | $('.sbr_lightbox_action a').off().on('click', function(){ |
| 2766 | $(this).parent().find('.sbr_lightbox_tooltip').toggle(); |
| 2767 | }); |
| 2768 | } |
| 2769 | }) |
| 2770 | }).call(this); |
| 2771 | }, |
| 2772 | createFeeds: function (args) { |
| 2773 | window.sbr.createLightbox(); |
| 2774 | args.whenFeedsCreated( |
| 2775 | $('.sb-feed-container').each(function (index) { |
| 2776 | $(this).attr('data-sbr-index', index + 1); |
| 2777 | var $self = $(this), |
| 2778 | flags = typeof $self.attr('data-sbr-flags') !== 'undefined' ? $self.attr('data-sbr-flags').split(',') : [], |
| 2779 | general = typeof $self.attr('data-options') !== 'undefined' ? JSON.parse($self.attr('data-options')) : {}; |
| 2780 | var feedOptions = { |
| 2781 | postID : typeof $self.attr( 'data-postid' ) !== 'undefined' ? $self.attr( 'data-postid' ) : 'unknown', |
| 2782 | feedID : typeof $self.attr( 'data-feed-id' ) !== 'undefined' ? $self.attr( 'data-feed-id' ) : 'unknown', |
| 2783 | nextPage : 2, |
| 2784 | layout : typeof $self.attr( 'data-layout' ) !== 'undefined' ? $self.attr( 'data-layout' ) : 'list', |
| 2785 | cols : typeof $self.attr( 'data-cols' ) !== 'undefined' ? $self.attr( 'data-cols' ) : 3, |
| 2786 | colstablet : typeof $self.attr( 'data-colstablet' ) !== 'undefined' ? $self.attr( 'data-colstablet' ) : 2, |
| 2787 | colsmobile : typeof $self.attr( 'data-colsmobile' ) !== 'undefined' ? $self.attr( 'data-colsmobile' ) : 1, |
| 2788 | shortCodeAtts : typeof $self.attr('data-shortcode-atts') !== 'undefined' ? $self.attr('data-shortcode-atts') : '', |
| 2789 | misc : typeof $self.attr('data-misc') !== 'undefined' ? JSON.parse($self.attr('data-misc')) : {}, |
| 2790 | debugEnabled : (flags.indexOf('debug') > -1), |
| 2791 | gdpr : (flags.indexOf('gdpr') > -1), |
| 2792 | consentGiven : (flags.indexOf('gdpr') === -1), |
| 2793 | noCDN : (flags.indexOf('disablecdn') > -1), |
| 2794 | lightboxEnabled : true, |
| 2795 | locator : (flags.indexOf('locator') > -1), |
| 2796 | checkMediaNonce : typeof $self.attr( 'data-check-media' ) !== 'undefined' ? $self.attr( 'data-check-media' ) : false, |
| 2797 | autoMinRes : 1, |
| 2798 | general : general, |
| 2799 | carouselBreakpointDesktop : typeof $self.attr( 'data-carousel-breakpoint-desktop' ) !== 'undefined' ? parseInt($self.attr( 'data-carousel-breakpoint-desktop' )) : 850, |
| 2800 | carouselBreakpointTablet : typeof $self.attr( 'data-carousel-breakpoint-tablet' ) !== 'undefined' ? parseInt($self.attr( 'data-carousel-breakpoint-tablet' )) : 520 |
| 2801 | }; |
| 2802 | if ( typeof feedOptions.misc.carousel !== 'undefined' ) { |
| 2803 | feedOptions.carousel = feedOptions.misc.carousel; |
| 2804 | } |
| 2805 | window.sbr.feeds[index] = sbrGetNewFeed(this, index, feedOptions); |
| 2806 | window.sbr.feeds[index].init(); |
| 2807 | |
| 2808 | var evt = jQuery.Event('sbrafterfeedcreate'); |
| 2809 | evt.feed = window.sbr.feeds[index]; |
| 2810 | jQuery(window).trigger(evt); |
| 2811 | }) |
| 2812 | ); |
| 2813 | }, |
| 2814 | afterFeedsCreated: function () { |
| 2815 | // enable header hover action |
| 2816 | $('.sb_instagram_header').each(function () { |
| 2817 | var $thisHeader = $(this); |
| 2818 | $thisHeader.find('.sbr_header_link').on('mouseenter mouseleave', function(e) { |
| 2819 | switch(e.type) { |
| 2820 | case 'mouseenter': |
| 2821 | $thisHeader.find('.sbr_header_img_hover').addClass('sbr_fade_in'); |
| 2822 | break; |
| 2823 | case 'mouseleave': |
| 2824 | $thisHeader.find('.sbr_header_img_hover').removeClass('sbr_fade_in'); |
| 2825 | break; |
| 2826 | } |
| 2827 | }); |
| 2828 | }); |
| 2829 | |
| 2830 | }, |
| 2831 | encodeHTML: function(raw) { |
| 2832 | // make sure passed variable is defined |
| 2833 | if (typeof raw === 'undefined') { |
| 2834 | return ''; |
| 2835 | } |
| 2836 | // replace greater than and less than symbols with html entity to disallow html in comments |
| 2837 | var encoded = raw.replace(/(>)/g,'>'), |
| 2838 | encoded = encoded.replace(/(<)/g,'<'); |
| 2839 | encoded = encoded.replace(/(<br\/>)/g,'<br>'); |
| 2840 | encoded = encoded.replace(/(<br>)/g,'<br>'); |
| 2841 | |
| 2842 | return encoded; |
| 2843 | }, |
| 2844 | urlDetect: function(text) { |
| 2845 | var urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g; |
| 2846 | return text.match(urlRegex); |
| 2847 | } |
| 2848 | }; |
| 2849 | |
| 2850 | function SbrFeed(el, index, settings) { |
| 2851 | this.el = el; |
| 2852 | this.index = index; |
| 2853 | this.settings = settings; |
| 2854 | this.placeholderURL = window.sbr.options.placeholder; |
| 2855 | this.consentGiven = settings.consentGiven; |
| 2856 | this.minImageWidth = 0; |
| 2857 | this.imageResolution = 150; |
| 2858 | this.outOfPages = false; |
| 2859 | } |
| 2860 | |
| 2861 | SbrFeed.prototype = { |
| 2862 | init: function() { |
| 2863 | var feed = this; |
| 2864 | feed.settings.consentGiven = feed.checkConsent(); |
| 2865 | |
| 2866 | if ($(this.el).find('#sbr_mod_error').length) { |
| 2867 | $(this.el).prepend($(this.el).find('#sbr_mod_error')); |
| 2868 | } |
| 2869 | feed.afterInitialImagesLoaded(); |
| 2870 | var sbr_delay = (function () { |
| 2871 | var sbr_timer = 0; |
| 2872 | return function (sbr_callback, sbr_ms) { |
| 2873 | clearTimeout(sbr_timer); |
| 2874 | sbr_timer = setTimeout(sbr_callback, sbr_ms); |
| 2875 | }; |
| 2876 | })(); |
| 2877 | jQuery(window).on('resize',function () { |
| 2878 | sbr_delay(function () { |
| 2879 | feed.afterResize(); |
| 2880 | }, 500); |
| 2881 | }); |
| 2882 | |
| 2883 | if ( feed.settings.checkMediaNonce ) { |
| 2884 | var submitData = { |
| 2885 | action: 'sbr_check_media', |
| 2886 | nonce: feed.settings.checkMediaNonce, |
| 2887 | feed_id: feed.settings.feedID |
| 2888 | }; |
| 2889 | var onSuccess = function (data) { |
| 2890 | if ( typeof data === 'object' ) { |
| 2891 | $.each(data.data,function(index){ |
| 2892 | if ($('.sbr-item-' + index ).length) { |
| 2893 | $('.sbr-item-' + index ).find('.sb-media-placeholder').replaceWith(this); |
| 2894 | feed.applyLightbox($('.sbr-item-' + index )); |
| 2895 | } |
| 2896 | }); |
| 2897 | } |
| 2898 | }; |
| 2899 | sbrAjax(submitData, onSuccess); |
| 2900 | } |
| 2901 | }, |
| 2902 | initLayout: function() { |
| 2903 | var self = this; |
| 2904 | $(this.el).find('.sb-new').removeClass('sb-new'); |
| 2905 | if ( this.settings.layout === 'masonry' ) { |
| 2906 | $(this.el).addClass('sbr-masonry'); |
| 2907 | |
| 2908 | if ($(this.el).find('.sb-feed-posts').data('smashotope')) { |
| 2909 | $(this.el).find('.sb-feed-posts').smashotope('layout'); |
| 2910 | } |
| 2911 | |
| 2912 | this.isotopeArgs = { |
| 2913 | itemSelector: '.sb-post-item-wrap', |
| 2914 | layoutMode: 'packery', |
| 2915 | transitionDuration: 0, |
| 2916 | percentPosition: true, |
| 2917 | // options... |
| 2918 | resizable: false // disable normal resizing |
| 2919 | } |
| 2920 | |
| 2921 | this.smashotopeInit(); |
| 2922 | } else if ( this.settings.layout === 'carousel' ) { |
| 2923 | this.initCarousel(); |
| 2924 | } |
| 2925 | setTimeout(function() { |
| 2926 | self.setItemSizeClass(); |
| 2927 | },100) |
| 2928 | |
| 2929 | }, |
| 2930 | initCarousel: function() { |
| 2931 | var $self = $(this.el), |
| 2932 | feed = this; |
| 2933 | //$self.find('.sb-feed-posts').addClass('sbr_carousel').attr('role','carousel'); |
| 2934 | $self.find('.sb-feed-posts').addClass('sbr_carousel'); |
| 2935 | $self.find('.sb-load-button-ctn').remove(); |
| 2936 | var arrows = this.settings.carousel[0], |
| 2937 | pagination = this.settings.carousel[1], |
| 2938 | autoplay = this.settings.carousel[2], |
| 2939 | time = this.settings.carousel[3], |
| 2940 | loop = this.settings.carousel[4] === 'infinity', |
| 2941 | rows = this.settings.carousel[5]; |
| 2942 | //Initiate carousel |
| 2943 | if( !autoplay ) time = false; |
| 2944 | |
| 2945 | //Set defaults for responsive breakpoints |
| 2946 | var itemsTabletSmall = this.settings.colstablet, |
| 2947 | itemsMobile = this.settings.colsmobile, |
| 2948 | autoplay = time !== false, |
| 2949 | has2rows = (rows == 2), |
| 2950 | loop = loop, |
| 2951 | onChange = function() { |
| 2952 | setTimeout(function(){ |
| 2953 | feed.afterResize(); |
| 2954 | }, 250); |
| 2955 | }, |
| 2956 | afterInit = function() { |
| 2957 | var $self = jQuery(feed.el); |
| 2958 | $self.find('.sb-feed-posts.sbr_carousel').fadeIn(); |
| 2959 | setTimeout(function(){ |
| 2960 | $self.find('.sbr_owl2row-item, .sbr_carousel').fadeIn(); |
| 2961 | }, 50); |
| 2962 | |
| 2963 | setTimeout(function(){ |
| 2964 | |
| 2965 | var $navElementsWrapper = $self.find('.sbr-owl-nav'); |
| 2966 | if (arrows === 'onhover') { |
| 2967 | |
| 2968 | } else if (arrows === 'below') { |
| 2969 | var $dots = $self.find('.sbr-owl-dots'), |
| 2970 | $prev = $self.find('.sbr-owl-prev'), |
| 2971 | $next = $self.find('.sbr-owl-next'), |
| 2972 | $nav = $self.find('.sbr-owl-nav'), |
| 2973 | $dot = $self.find('.sbr-owl-dot'), |
| 2974 | widthDots = $dot.length * $dot.innerWidth(), |
| 2975 | maxWidth = $self.innerWidth(); |
| 2976 | |
| 2977 | $prev.after($dots); |
| 2978 | |
| 2979 | $nav.css('position', 'relative'); |
| 2980 | $next.css('position', 'absolute').css('top', '-6px').css('right', Math.max((.5 * $nav.innerWidth() - .5 * (widthDots) - $next.innerWidth() - 6), 0)); |
| 2981 | $prev.css('position', 'absolute').css('top', '-6px').css('left', Math.max((.5 * $nav.innerWidth() - .5 * (widthDots) - $prev.innerWidth() - 6), 0)); |
| 2982 | } else if (arrows === 'hide') { |
| 2983 | $navElementsWrapper.addClass('hide').hide(); |
| 2984 | } |
| 2985 | |
| 2986 | }, 100); |
| 2987 | }; |
| 2988 | this.carouselArgs = { |
| 2989 | items: this.settings.cols, |
| 2990 | loop: loop, |
| 2991 | rewind: !loop, |
| 2992 | autoplay: autoplay, |
| 2993 | autoplayTimeout: Math.max(time,2000), |
| 2994 | autoplayHoverPause: true, |
| 2995 | nav: arrows, |
| 2996 | navText: ['<svg class="svg-inline--fa fa-chevron-left fa-w-10" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="chevron-left" role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"></path></svg>', '<svg class="svg-inline--fa fa-chevron-right fa-w-10" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="chevron-right" role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg>'], |
| 2997 | dots: pagination, |
| 2998 | owl2row: has2rows, |
| 2999 | responsiveClass: true, |
| 3000 | responsiveRefreshRate: 50, |
| 3001 | responsive: { |
| 3002 | 0: { |
| 3003 | items: this.settings.colsmobile |
| 3004 | }, |
| 3005 | [this.settings.carouselBreakpointTablet]: { |
| 3006 | items: this.settings.colstablet |
| 3007 | }, |
| 3008 | [this.settings.carouselBreakpointDesktop]: { |
| 3009 | items: this.settings.cols |
| 3010 | } |
| 3011 | }, |
| 3012 | onChange: onChange, |
| 3013 | onInitialize: afterInit |
| 3014 | }; |
| 3015 | $self.find('.sbr_carousel').sbrOwlCarousel(this.carouselArgs); |
| 3016 | //if (parseInt(settings.general.carousel[5]) === 2) { |
| 3017 | // $sbi.addClass('sbi_carousel_2_row'); |
| 3018 | //} |
| 3019 | }, |
| 3020 | smashotopeInit: function() { |
| 3021 | var gutter = parseInt( $(this.el).attr( 'data-gutter' ) ); |
| 3022 | this.isotopeArgs.packery = { |
| 3023 | columnWidth: this.isotopeArgs.itemSelector, |
| 3024 | gutter : Number.isInteger( gutter ) ? gutter : 0 |
| 3025 | }; |
| 3026 | $(this.el).find('.sb-feed-posts').smashotope(this.isotopeArgs); |
| 3027 | }, |
| 3028 | appendSmashotope: function() { |
| 3029 | $self = $(this.el); |
| 3030 | if ($self.find('.sb-feed-posts').data('smashotope')) { |
| 3031 | $self.find('.sb-feed-posts').smashotope('appended', jQuery('.sb-new')); |
| 3032 | setTimeout(() => { |
| 3033 | $self.find('.sb-feed-posts').smashotope('layout'); |
| 3034 | }, 10); |
| 3035 | } |
| 3036 | }, |
| 3037 | afterInitialImagesLoaded: function() { |
| 3038 | this.initNewItems(); |
| 3039 | this.initLayout(); |
| 3040 | this.hideExtraImagesForWidth(); |
| 3041 | this.loadMoreButtonInit(); |
| 3042 | this.hideExtraItemsForWidth(); |
| 3043 | if (this.settings.consentGiven) { |
| 3044 | this.applyFullFeatures(); |
| 3045 | } else { |
| 3046 | this.removeFeatures(); |
| 3047 | } |
| 3048 | }, |
| 3049 | initNewItems: function() { |
| 3050 | var feed = this, |
| 3051 | $self = $(this.el); |
| 3052 | |
| 3053 | $self.find('.sb-new').each(function (index) { |
| 3054 | var $item = jQuery(this); |
| 3055 | |
| 3056 | if ($item.find('.sb-item-text').length && ! $item.find('.sb-item-text').hasClass('sb-item-full-text')) { |
| 3057 | //Expand post |
| 3058 | var $caption = $item.find('.sb-item-text'), |
| 3059 | text_limit = typeof feed.settings.misc.contentLength !== 'undefined' ? parseInt(feed.settings.misc.contentLength) : 280; |
| 3060 | if (text_limit < 1) text_limit = 99999; |
| 3061 | //Set the full text to be the caption (used in the image alt) |
| 3062 | var captionText = feed.stripEmojihtml($item.find('.sb-item-text').first()); |
| 3063 | /* |
| 3064 | var captionText = feed.stripEmojihtml($item.find('.sb-item-text').first()), |
| 3065 | brCount = (captionText.match(/<br>/g) || []).length, |
| 3066 | brAdjust = true; |
| 3067 | // replace emoji with alt for more accurate shortening |
| 3068 | if (brAdjust && brCount > 0 && captionText.indexOf('<br>') < text_limit) { |
| 3069 | var $sizingCaption = $item.find('.sb-item-text').first(), |
| 3070 | captionWidth = $sizingCaption.width() > 20 ? $sizingCaption.width() : $item.width(), |
| 3071 | fontSize = $sizingCaption.css('font-size'), |
| 3072 | charactersPerLine = captionWidth / parseInt(fontSize) * 1.85, |
| 3073 | maxCharsPerLine = Math.floor(charactersPerLine), |
| 3074 | projectedMaxLines = Math.ceil(text_limit / charactersPerLine); |
| 3075 | |
| 3076 | var splitCaption = captionText.split('<br>'), |
| 3077 | linesConsumed = 0, |
| 3078 | adjustedTextLimit = 0; |
| 3079 | jQuery.each(splitCaption, function () { |
| 3080 | |
| 3081 | var linesLeft = projectedMaxLines - linesConsumed; |
| 3082 | if (linesLeft > 0) { |
| 3083 | var thisLinesConsumed = Math.max(1, Math.ceil(this.length / charactersPerLine)); |
| 3084 | |
| 3085 | adjustedTextLimit += Math.min(this.length + 4, linesLeft * maxCharsPerLine); |
| 3086 | linesConsumed += thisLinesConsumed; |
| 3087 | } |
| 3088 | }); |
| 3089 | |
| 3090 | text_limit = adjustedTextLimit; |
| 3091 | } |
| 3092 | */ |
| 3093 | var short_text = captionText.substring(0, text_limit); |
| 3094 | short_text = captionText.length > text_limit ? short_text.substr(0, Math.min(short_text.length, short_text.lastIndexOf(" "))) : short_text; |
| 3095 | |
| 3096 | //Cut the text based on limits set |
| 3097 | if ($caption.length) { |
| 3098 | //if (short_text === captionText && $item.find('.sb-expand a').attr('data-link') === '') { |
| 3099 | if (short_text === captionText) { |
| 3100 | $caption.next('.sb-expand').remove(); |
| 3101 | } else { |
| 3102 | |
| 3103 | $item.attr('data-text',$item.find('.sb-item-text').html()); |
| 3104 | if (short_text.length > 1) { |
| 3105 | $item.find('.sb-item-text').html(short_text); |
| 3106 | } |
| 3107 | $item.find('.sb-item-text').append($item.find('.sb-expand')); |
| 3108 | /* |
| 3109 | if ( $item.find('.sb-expand a').attr('data-link') !== '' ) { |
| 3110 | $item.find('.sb-expand a').attr('href',$item.find('.sb-expand a').attr('data-link')) |
| 3111 | $item.find('.sb-expand a').attr('target','blank').attr('rel','noopener noreferrer'); |
| 3112 | } else { |
| 3113 | $item.find('.sb-expand a').addClass('sb-expand-on-click'); |
| 3114 | } |
| 3115 | */ |
| 3116 | $item.find('.sb-expand a').addClass('sb-expand-on-click'); |
| 3117 | |
| 3118 | } |
| 3119 | |
| 3120 | |
| 3121 | } |
| 3122 | |
| 3123 | //Show the 'See More' link if needed |
| 3124 | if (captionText.length > text_limit) { |
| 3125 | $item.find('.sb-expand').show(); |
| 3126 | } |
| 3127 | //Click function |
| 3128 | $item.find('.sb-expand a.sb-expand-on-click').off('click').on('click', function (e) { |
| 3129 | e.preventDefault(); |
| 3130 | var $expand = jQuery(this); |
| 3131 | $expand.closest('.sbr-expand').remove(); |
| 3132 | $caption.html($item.attr('data-text')); |
| 3133 | $item.addClass('sb-item-full-text'); |
| 3134 | feed.afterResize(); |
| 3135 | }); |
| 3136 | } |
| 3137 | }); //End .sby_item each |
| 3138 | }, |
| 3139 | stripEmojihtml: function ($el) { |
| 3140 | $el.find('.emoji').each(function() { |
| 3141 | $(this).replaceWith($(this).attr('alt')); |
| 3142 | }); |
| 3143 | |
| 3144 | return $el.html(); |
| 3145 | }, |
| 3146 | hideExtraImagesForWidth: function() { |
| 3147 | if (this.settings.layout === 'carousel') { |
| 3148 | return; |
| 3149 | } |
| 3150 | var $self = $(this.el), |
| 3151 | diff = 0; |
| 3152 | if ($(window).width() < 480 || window.sb_preview_device === 'mobile') { |
| 3153 | if (this.settings.misc.num.mobile < $self.find('.sb-post-item-wrap').length) { |
| 3154 | $self.find('.sb-post-item-wrap').slice(this.settings.misc.num.mobile - $self.find('.sb-post-item-wrap').length).addClass('sb-num-diff-hide'); |
| 3155 | } |
| 3156 | } else if ($(window).width() < 640 || window.sb_preview_device === 'tablet') { |
| 3157 | if (this.settings.misc.num.tablet < $self.find('.sb-post-item-wrap').length) { |
| 3158 | $self.find('.sb-post-item-wrap').slice(this.settings.misc.num.tablet - $self.find('.sb-post-item-wrap').length).addClass('sb-num-diff-hide'); |
| 3159 | } |
| 3160 | } else { |
| 3161 | if (this.settings.misc.num.desktop < $self.find('.sb-post-item-wrap').length) { |
| 3162 | $self.find('.sb-post-item-wrap').slice(this.settings.misc.num.desktop - $self.find('.sb-post-item-wrap').length).addClass('sb-num-diff-hide'); |
| 3163 | } |
| 3164 | } |
| 3165 | |
| 3166 | if ($self.find('.sb-feed-posts').data('smashotope')) { |
| 3167 | $self.find('.sb-feed-posts').smashotope('layout'); |
| 3168 | } |
| 3169 | |
| 3170 | }, |
| 3171 | afterResize: function() { |
| 3172 | var $self = $(this.el); |
| 3173 | this.setImageHeight(); |
| 3174 | this.setImageResolution(); |
| 3175 | this.maybeRaiseImageResolution(); |
| 3176 | if ($self.find('.sb-feed-posts').data('smashotope')) { |
| 3177 | $self.find('.sb-feed-posts').smashotope('layout'); |
| 3178 | } |
| 3179 | this.setItemSizeClass(); |
| 3180 | }, |
| 3181 | setItemSizeClass: function () { |
| 3182 | var $self = $(this.el); |
| 3183 | |
| 3184 | var itemWidth = $self.find('.sb-post-item').first().width(); |
| 3185 | if (itemWidth <= 320) $self.addClass('sbr-narrow'); |
| 3186 | if (itemWidth <= 250) $self.addClass('sbr-super-narrow'); |
| 3187 | if (itemWidth > 320) $self.removeClass('sbr-super-narrow sbr-narrow'); |
| 3188 | }, |
| 3189 | afterLoadMoreClicked: function($button) { |
| 3190 | var $wrap = $button.closest('.sb-load-button-ctn'), |
| 3191 | areDiffHiding = $wrap.closest('.sb-feed-container').find('.sb-num-diff-hide').length; |
| 3192 | $wrap.find('.sbr-loader').removeClass('sbr-hidden'); |
| 3193 | $wrap.find('.sb-load-button span').addClass('sbr-hidden'); |
| 3194 | $wrap.closest('.sb-feed-container').find('.sb-num-diff-hide').addClass('sbr_transition').removeClass('sb-num-diff-hide'); |
| 3195 | if (areDiffHiding && $(this.el).find('.sb-feed-posts').data('smashotope')) { |
| 3196 | $(this.el).find('.sb-feed-posts').smashotope('layout'); |
| 3197 | } |
| 3198 | }, |
| 3199 | loadMoreButtonInit: function () { |
| 3200 | var $self = $(this.el), |
| 3201 | feed = this; |
| 3202 | if (this.settings.misc.flagLastPage && ! $self.find( '.sb-num-diff-hide').length ) { |
| 3203 | $self.find('.sb-load-button-ctn .sb-load-button').remove(); |
| 3204 | } |
| 3205 | $self.find('.sb-load-button-ctn .sb-load-button').off().on('click', function () { |
| 3206 | var $button = jQuery(this); |
| 3207 | // Overflow items are pre-rendered but hidden for the current |
| 3208 | // breakpoint. The first click reveals them instead of also |
| 3209 | // fetching a page, so reveal + fetch never stack (over-load bug). |
| 3210 | if ($button.closest('.sb-feed-container').find('.sb-num-diff-hide').length) { |
| 3211 | feed.revealHiddenPosts($button); |
| 3212 | } else { |
| 3213 | feed.afterLoadMoreClicked($button); |
| 3214 | feed.getNewPostSet(); |
| 3215 | } |
| 3216 | }); //End click event |
| 3217 | }, |
| 3218 | revealHiddenPosts: function ($button) { |
| 3219 | var $self = $(this.el), |
| 3220 | $container = $button.closest('.sb-feed-container'); |
| 3221 | $container.find('.sb-num-diff-hide').addClass('sbr_transition').removeClass('sb-num-diff-hide'); |
| 3222 | if ($self.find('.sb-feed-posts').data('smashotope')) { |
| 3223 | $self.find('.sb-feed-posts').smashotope('layout'); |
| 3224 | } |
| 3225 | // Page 1 was already the last page: revealing is the final action. |
| 3226 | if (this.settings.misc.flagLastPage) { |
| 3227 | $container.find('.sb-load-button-ctn').remove(); |
| 3228 | } |
| 3229 | }, |
| 3230 | getNewPostSet: function () { |
| 3231 | var $self = $(this.el), |
| 3232 | feed = this; |
| 3233 | var submitData = { |
| 3234 | action: 'sbr_load_more_clicked', |
| 3235 | next_page: feed.settings.nextPage, |
| 3236 | feed_id: feed.settings.feedID, |
| 3237 | location: feed.locationGuess(), |
| 3238 | post_id: feed.settings.postID, |
| 3239 | atts: feed.settings.shortCodeAtts, |
| 3240 | current_resolution: feed.imageResolution |
| 3241 | }; |
| 3242 | var onSuccess = function (data) { |
| 3243 | feed.appendNewPosts(data.data.html); |
| 3244 | feed.settings.nextPage++; |
| 3245 | feed.afterNewImagesLoaded(); |
| 3246 | if (data.data.is_last_page) { |
| 3247 | feed.outOfPages = true; |
| 3248 | $self.find('.sb-load-button-ctn').remove(); |
| 3249 | } |
| 3250 | |
| 3251 | }; |
| 3252 | sbrAjax(submitData, onSuccess); |
| 3253 | }, |
| 3254 | afterNewImagesLoaded: function() { |
| 3255 | var $self = $(this.el), |
| 3256 | feed = this; |
| 3257 | this.initNewItems(); |
| 3258 | setTimeout(function () { |
| 3259 | //Hide the loader in the load more button |
| 3260 | $self.find('.sbr-loader').addClass('sbr-hidden'); |
| 3261 | $self.find('.sb-load-button span').removeClass('sbr-hidden'); |
| 3262 | |
| 3263 | feed.maybeRaiseImageResolution(); |
| 3264 | }, 500); |
| 3265 | if (this.settings.consentGiven) { |
| 3266 | this.applyFullFeatures(); |
| 3267 | } else { |
| 3268 | this.removeFeatures(); |
| 3269 | } |
| 3270 | |
| 3271 | $self.find('.sb-new').removeClass('sb-new'); |
| 3272 | }, |
| 3273 | appendNewPosts: function (newPostsHtml) { |
| 3274 | var $self = $(this.el); |
| 3275 | if ($self.find('.sb-feed-posts .sb-post-item-wrap').length) { |
| 3276 | $self.find('.sb-feed-posts .sb-post-item-wrap').last().after(newPostsHtml); |
| 3277 | } else { |
| 3278 | $self.find('.sb-feed-posts').append(newPostsHtml); |
| 3279 | } |
| 3280 | if (this.settings.layout === 'masonry') { |
| 3281 | this.appendSmashotope(); |
| 3282 | } |
| 3283 | }, |
| 3284 | addResizedImages: function (resizedImagesToAdd) { |
| 3285 | for (var imageID in resizedImagesToAdd) { |
| 3286 | this.resizedImages[imageID] = resizedImagesToAdd[imageID]; |
| 3287 | } |
| 3288 | }, |
| 3289 | setImageHeight: function() { |
| 3290 | }, |
| 3291 | maybeRaiseSingleImageResolution: function ($item, forceChange) { |
| 3292 | var feed = this, |
| 3293 | imgSrcSet = feed.getImageUrls($item), |
| 3294 | currentUrl = $item.find('.sbr_video_thumbnail > img').attr('src'), |
| 3295 | currentRes = 150, |
| 3296 | aspectRatio = 1, // all thumbnails are oriented the same so the best calculation uses 1 |
| 3297 | forceChange = typeof forceChange !== 'undefined' ? forceChange : false; |
| 3298 | |
| 3299 | if ($item.hasClass('sbr_no_resraise') || |
| 3300 | (!feed.settings.consentGiven && feed.settings.noCDN) ) { |
| 3301 | return; |
| 3302 | } |
| 3303 | |
| 3304 | $.each(imgSrcSet, function (index, value) { |
| 3305 | if (value === currentUrl) { |
| 3306 | currentRes = parseInt(index); |
| 3307 | // If the image has already been changed to an existing real source, don't force the change |
| 3308 | forceChange = false; |
| 3309 | } |
| 3310 | }); |
| 3311 | //Image res |
| 3312 | var newRes = 640; |
| 3313 | switch (feed.settings.imgRes) { |
| 3314 | case 'thumb': |
| 3315 | newRes = 120; |
| 3316 | break; |
| 3317 | case 'medium': |
| 3318 | newRes = 320; |
| 3319 | break; |
| 3320 | case 'large': |
| 3321 | newRes = 480; |
| 3322 | break; |
| 3323 | case 'full': |
| 3324 | newRes = 640; |
| 3325 | break; |
| 3326 | default: |
| 3327 | var minImageWidth = Math.max(feed.settings.autoMinRes,$item.find('.sbr_video_thumbnail').innerWidth()), |
| 3328 | thisImageReplace = feed.getBestResolutionForAuto(minImageWidth, aspectRatio, $(this.el).find('sbr_item').first()); |
| 3329 | switch (thisImageReplace) { |
| 3330 | case 480: |
| 3331 | newRes = 480; |
| 3332 | break; |
| 3333 | case 320: |
| 3334 | newRes = 320; |
| 3335 | break; |
| 3336 | case 120: |
| 3337 | newRes = 120; |
| 3338 | break; |
| 3339 | } |
| 3340 | break; |
| 3341 | } |
| 3342 | |
| 3343 | if (newRes > currentRes || currentUrl === feed.placeholderURL || forceChange) { |
| 3344 | if (feed.settings.debugEnabled) { |
| 3345 | var reason = currentUrl === feed.placeholderURL ? 'was placeholder' : 'too small'; |
| 3346 | // nosemgrep: js-console-log -- Intentional debug logging when debugEnabled is true |
| 3347 | console.log('rais res for ' + currentUrl, reason); |
| 3348 | } |
| 3349 | var newUrl = imgSrcSet[newRes]; |
| 3350 | $item.find('.sbr_video_thumbnail > img').attr('src', newUrl); |
| 3351 | if ($item.find('.sbr_video_thumbnail').hasClass('sbr_imgLiquid_ready')) { |
| 3352 | $item.find('.sbr_video_thumbnail').css('background-image', 'url("' + newUrl + '")'); |
| 3353 | } |
| 3354 | } |
| 3355 | |
| 3356 | $item.find('img').on('error', function () { |
| 3357 | if (!$(this).hasClass('sbr_img_error')) { |
| 3358 | $(this).addClass('sbr_img_error'); |
| 3359 | var sourceFromAPI = ($(this).attr('src').indexOf('i.ytimg.com') > -1); |
| 3360 | |
| 3361 | if (!sourceFromAPI) { |
| 3362 | if (typeof $(this).closest('.sbr_video_thumbnail').attr('data-full-res') !== 'undefined') { |
| 3363 | //$(this).attr('src', $(this).closest('.sbr_video_thumbnail').attr('data-full-res')); |
| 3364 | //$(this).closest('.sbr_video_thumbnail').css('background-image', 'url(' + $(this).closest('.sbr_video_thumbnail').attr('data-full-res') + ')'); |
| 3365 | } else if ($(this).closest('.sbr_video_thumbnail').attr('href') !== 'undefined') { |
| 3366 | //$(this).attr('src', $(this).closest('.sbr_video_thumbnail').attr('href') + 'media?size=l'); |
| 3367 | //$(this).closest('.sbr_video_thumbnail').css('background-image', 'url(' + $(this).closest('.sbr_video_thumbnail').attr('href') + 'media?size=l)'); |
| 3368 | } |
| 3369 | } else { |
| 3370 | feed.settings.favorLocal = true; |
| 3371 | var srcSet = feed.getImageUrls($(this).closest('.sbr_item')); |
| 3372 | if (typeof srcSet[640] !== 'undefined') { |
| 3373 | //$(this).attr('src', srcSet[640]); |
| 3374 | //$(this).closest('.sbr_video_thumbnail').css('background-image', 'url(' + srcSet[640] + ')'); |
| 3375 | } |
| 3376 | } |
| 3377 | setTimeout(function() { |
| 3378 | feed.afterResize(); |
| 3379 | }, 1500) |
| 3380 | } else { |
| 3381 | // nosemgrep: js-console-log -- Intentional error logging for debugging image load failures |
| 3382 | console.log('unfixed error ' + $(this).attr('src')); |
| 3383 | } |
| 3384 | }); |
| 3385 | }, |
| 3386 | maybeRaiseImageResolution: function (justNew) { |
| 3387 | var feed = this, |
| 3388 | itemsSelector = typeof justNew !== 'undefined' && justNew === true ? '.sbr_item.sbr_new' : '.sbr_item', |
| 3389 | forceChange = !feed.isInitialized ? true : false; |
| 3390 | $(feed.el).find(itemsSelector).each(function () { |
| 3391 | if (!$(this).hasClass(' sb-num-diff-hide') |
| 3392 | && $(this).find('.sbr_video_thumbnail').length |
| 3393 | && typeof $(this).find('.sbr_video_thumbnail').attr('data-img-src-set') !== 'undefined') { |
| 3394 | feed.maybeRaiseSingleImageResolution($(this),forceChange); |
| 3395 | } |
| 3396 | }); //End .sbr_item each |
| 3397 | feed.isInitialized = true; |
| 3398 | }, |
| 3399 | getBestResolutionForAuto: function(colWidth, aspectRatio, $item) { |
| 3400 | if (isNaN(aspectRatio) || aspectRatio < 1) { |
| 3401 | aspectRatio = 1; |
| 3402 | } |
| 3403 | var bestWidth = colWidth * aspectRatio, |
| 3404 | bestWidthRounded = Math.ceil(bestWidth / 10) * 10, |
| 3405 | customSizes = [120, 320, 480, 640]; |
| 3406 | |
| 3407 | if ($item.hasClass('sbr_highlighted')) { |
| 3408 | bestWidthRounded = bestWidthRounded *2; |
| 3409 | } |
| 3410 | |
| 3411 | if (customSizes.indexOf(parseInt(bestWidthRounded)) === -1) { |
| 3412 | var done = false; |
| 3413 | $.each(customSizes, function (_index, item) { |
| 3414 | if (item > parseInt(bestWidthRounded) && !done) { |
| 3415 | bestWidthRounded = item; |
| 3416 | done = true; |
| 3417 | } |
| 3418 | }); |
| 3419 | } |
| 3420 | |
| 3421 | return bestWidthRounded; |
| 3422 | }, |
| 3423 | hideExtraItemsForWidth: function() { |
| 3424 | if (this.layout === 'carousel') { |
| 3425 | return; |
| 3426 | } |
| 3427 | var $self = $(this.el), |
| 3428 | num = typeof $self.attr('data-num') !== 'undefined' && $self.attr('data-num') !== '' ? parseInt($self.attr('data-num')) : 1, |
| 3429 | nummobile = typeof $self.attr('data-nummobile') !== 'undefined' && $self.attr('data-nummobile') !== '' ? parseInt($self.attr('data-nummobile')) : num; |
| 3430 | |
| 3431 | if (!$self.hasClass('.sbr_layout_carousel')) { |
| 3432 | if ($(window).width() < 480) { |
| 3433 | if (nummobile < $self.find('.sbr_item').length) { |
| 3434 | $self.find('.sbr_item').slice(nummobile - $self.find('.sbr_item').length).addClass(' sb-num-diff-hide'); |
| 3435 | } |
| 3436 | } else { |
| 3437 | if (num < $self.find('.sbr_item').length) { |
| 3438 | $self.find('.sbr_item').slice(num - $self.find('.sbr_item').length).addClass(' sb-num-diff-hide'); |
| 3439 | } |
| 3440 | } |
| 3441 | } |
| 3442 | |
| 3443 | }, |
| 3444 | setImageSizeClass: function () { |
| 3445 | var $self = $(this.el); |
| 3446 | $self.removeClass('sbr_small sbr_medium'); |
| 3447 | var feedWidth = $self.innerWidth(), |
| 3448 | photoPadding = parseInt(($self.find('.sbr_items_wrap').outerWidth() - $self.find('.sbr_items_wrap').width())) / 2, |
| 3449 | cols = this.getColumnCount(), |
| 3450 | feedWidthSansPadding = feedWidth - (photoPadding * (cols+2)), |
| 3451 | colWidth = (feedWidthSansPadding / cols); |
| 3452 | |
| 3453 | if (colWidth > 140 && colWidth < 240) { |
| 3454 | $self.addClass('sbr_medium'); |
| 3455 | } else if (colWidth <= 140) { |
| 3456 | $self.addClass('sbr_small'); |
| 3457 | } |
| 3458 | }, |
| 3459 | setMinImageWidth: function () { |
| 3460 | if ($(this.el).find('.sbr_item .sbr_video_thumbnail').first().length) { |
| 3461 | this.minImageWidth = $(this.el).find('.sbr_item .sbr_video_thumbnail').first().innerWidth(); |
| 3462 | } else { |
| 3463 | this.minImageWidth = 150; |
| 3464 | } |
| 3465 | }, |
| 3466 | setImageResolution: function () { |
| 3467 | if (this.settings.imgRes === 'auto') { |
| 3468 | this.imageResolution = 'auto'; |
| 3469 | } else { |
| 3470 | switch (this.settings.imgRes) { |
| 3471 | case 'thumb': |
| 3472 | this.imageResolution = 150; |
| 3473 | break; |
| 3474 | case 'medium': |
| 3475 | this.imageResolution = 320; |
| 3476 | break; |
| 3477 | default: |
| 3478 | this.imageResolution = 640; |
| 3479 | } |
| 3480 | } |
| 3481 | }, |
| 3482 | getImageUrls: function ($item) { |
| 3483 | var srcSet = JSON.parse($item.find('.sbr_video_thumbnail').attr('data-img-src-set').replace(/\\\//g, '/')), |
| 3484 | id = $item.attr('id').replace('sbr_', '').replace('player_',''); |
| 3485 | if (typeof this.resizedImages[id] !== 'undefined' |
| 3486 | && this.resizedImages[id] !== 'video' |
| 3487 | && this.resizedImages[id] !== 'pending' |
| 3488 | && this.resizedImages[id].id !== 'error' |
| 3489 | && this.resizedImages[id].id !== 'video' |
| 3490 | && this.resizedImages[id].id !== 'pending') { |
| 3491 | |
| 3492 | if (typeof this.resizedImages[id]['sizes'] !== 'undefined') { |
| 3493 | var foundSizes = []; |
| 3494 | if (typeof this.resizedImages[id]['sizes']['full'] !== 'undefined') { |
| 3495 | foundSizes.push(640); |
| 3496 | srcSet[640] = sbrOptions.resized_url + this.resizedImages[id].id + 'full.jpg'; |
| 3497 | $item.find('.sbr_link_area').attr( 'href', sbrOptions.resized_url + this.resizedImages[id].id + 'full.jpg' ); |
| 3498 | $item.find('.sbr_video_thumbnail').attr( 'data-full-res', sbrOptions.resized_url + this.resizedImages[id].id + 'full.jpg' ); |
| 3499 | } |
| 3500 | if (typeof this.resizedImages[id]['sizes']['low'] !== 'undefined') { |
| 3501 | foundSizes.push(320); |
| 3502 | srcSet[320] = sbrOptions.resized_url + this.resizedImages[id].id + 'low.jpg'; |
| 3503 | if (this.settings.favorLocal && typeof this.resizedImages[id]['sizes']['full'] === 'undefined') { |
| 3504 | $item.find('.sbr_link_area').attr( 'href', sbrOptions.resized_url + this.resizedImages[id].id + 'low.jpg' ); |
| 3505 | $item.find('.sbr_video_thumbnail').attr( 'data-full-res', sbrOptions.resized_url + this.resizedImages[id].id + 'low.jpg' ); |
| 3506 | } |
| 3507 | } |
| 3508 | if (typeof this.resizedImages[id]['sizes']['thumb'] !== 'undefined') { |
| 3509 | foundSizes.push(150); |
| 3510 | srcSet[150] = sbrOptions.resized_url + this.resizedImages[id].id + 'thumb.jpg'; |
| 3511 | } |
| 3512 | if (this.settings.favorLocal) { |
| 3513 | if (foundSizes.indexOf(640) === -1) { |
| 3514 | if (foundSizes.indexOf(320) > -1) { |
| 3515 | srcSet[640] = sbrOptions.resized_url + this.resizedImages[id].id + 'low.jpg'; |
| 3516 | } |
| 3517 | } |
| 3518 | if (foundSizes.indexOf(320) === -1) { |
| 3519 | if (foundSizes.indexOf(640) > -1) { |
| 3520 | srcSet[320] = sbrOptions.resized_url + this.resizedImages[id].id + 'full.jpg'; |
| 3521 | } else if (foundSizes.indexOf(150) > -1) { |
| 3522 | srcSet[320] = sbrOptions.resized_url + this.resizedImages[id].id + 'thumb.jpg'; |
| 3523 | } |
| 3524 | } |
| 3525 | if (foundSizes.indexOf(150) === -1) { |
| 3526 | if (foundSizes.indexOf(320) > -1) { |
| 3527 | srcSet[150] = sbrOptions.resized_url + this.resizedImages[id].id + 'low.jpg'; |
| 3528 | } else if (foundSizes.indexOf(640) > -1) { |
| 3529 | srcSet[150] = sbrOptions.resized_url + this.resizedImages[id].id + 'full.jpg'; |
| 3530 | } |
| 3531 | } |
| 3532 | } |
| 3533 | } |
| 3534 | } else if (typeof this.resizedImages[id] === 'undefined' |
| 3535 | || (typeof this.resizedImages[id]['id'] !== 'undefined' && this.resizedImages[id]['id'] !== 'pending' && this.resizedImages[id]['id'] !== 'error')) { |
| 3536 | this.addToNeedsResizing(id); |
| 3537 | } |
| 3538 | |
| 3539 | return srcSet; |
| 3540 | }, |
| 3541 | getVideoID: function ($el) { |
| 3542 | if ($el.hasClass('sbr_item') || $el.hasClass('sbr_player_item')) { |
| 3543 | if (typeof $el.find('.sbr_video_thumbnail').attr('data-video-id') !== 'undefined') { |
| 3544 | return $el.find('.sbr_video_thumbnail').attr('data-video-id'); |
| 3545 | } |
| 3546 | } else if ($el.closest('sbr_item').length || $el.closest('sbr_player_item').length) { |
| 3547 | var $targeEl = $el.closest('sbr_item').length ? $el.closest('sbr_item') : $el.closest('sbr_player_item'); |
| 3548 | if (typeof $targeEl.find('.sbr_video_thumbnail').attr('data-video-id') !== 'undefined') { |
| 3549 | return $targeEl.find('.sbr_video_thumbnail').attr('data-video-id'); |
| 3550 | } |
| 3551 | } else if ($el.hasClass('sb-feed-container')) { |
| 3552 | return $el.find('.sbr_item').first().find('.sbr_video_thumbnail').attr('data-video-id'); |
| 3553 | } else if ($(this.el).find('.sbr_video_thumbnail').first().length && typeof $(this.el).find('.sbr_video_thumbnail').first().attr('data-video-id') !== 'undefined'){ |
| 3554 | return $(this.el).find('.sbr_video_thumbnail').first().attr('data-video-id'); |
| 3555 | } |
| 3556 | return ''; |
| 3557 | }, |
| 3558 | getAvatarUrl: function (username,favorType) { |
| 3559 | if (username === '') { |
| 3560 | return ''; |
| 3561 | } |
| 3562 | |
| 3563 | var availableAvatars = this.settings.general.avatars, |
| 3564 | favorType = typeof favorType !== 'undefined' ? favorType : 'local'; |
| 3565 | |
| 3566 | if (favorType === 'local') { |
| 3567 | if (typeof availableAvatars['LCL'+username] !== 'undefined' && parseInt(availableAvatars['LCL'+username]) === 1) { |
| 3568 | return sbrOptions.resized_url + username + '.jpg'; |
| 3569 | } else if (typeof availableAvatars[username] !== 'undefined') { |
| 3570 | return availableAvatars[username]; |
| 3571 | } else { |
| 3572 | return ''; |
| 3573 | } |
| 3574 | } else { |
| 3575 | if (typeof availableAvatars[username] !== 'undefined') { |
| 3576 | return availableAvatars[username]; |
| 3577 | } else if (typeof availableAvatars['LCL'+username] !== 'undefined' && parseInt(availableAvatars['LCL'+username]) === 1) { |
| 3578 | return sbrOptions.resized_url + username + '.jpg'; |
| 3579 | } else { |
| 3580 | return ''; |
| 3581 | } |
| 3582 | } |
| 3583 | }, |
| 3584 | addToNeedsResizing: function (id) { |
| 3585 | if (this.needsResizing.indexOf(id) === -1) { |
| 3586 | this.needsResizing.push(id); |
| 3587 | } |
| 3588 | }, |
| 3589 | applyImageLiquid: function () { |
| 3590 | var $self = $(this.el), |
| 3591 | feed = this; |
| 3592 | sbrAddImgLiquid(); |
| 3593 | if (typeof $self.find(".sbr_player_item").sbr_imgLiquid == 'function') { |
| 3594 | if ($self.find('.sbr_player_item').length) { |
| 3595 | $self.find(".sbr_player_item .sbr_player_video_thumbnail").sbr_imgLiquid({fill: true}); |
| 3596 | } |
| 3597 | $self.find(".sbr_item .sbr_item_video_thumbnail").sbr_imgLiquid({fill: true}); |
| 3598 | } |
| 3599 | }, |
| 3600 | listenForVisibilityChange: function() { |
| 3601 | var feed = this; |
| 3602 | sbrAddVisibilityListener(); |
| 3603 | if (typeof $(this.el).filter(':hidden').sbrVisibilityChanged == 'function') { |
| 3604 | //If the feed is initially hidden (in a tab for example) then check for when it becomes visible and set then set the height |
| 3605 | $(this.el).filter(':hidden').sbrVisibilityChanged({ |
| 3606 | callback: function () { |
| 3607 | feed.afterResize(); |
| 3608 | }, |
| 3609 | runOnLoad: false |
| 3610 | }); |
| 3611 | } |
| 3612 | }, |
| 3613 | getColumnCount: function() { |
| 3614 | var cols = this.settings.cols, |
| 3615 | colstablet = this.settings.colstablet, |
| 3616 | colsmobile = this.settings.colsmobile; |
| 3617 | |
| 3618 | sbrWindowWidth = window.innerWidth; |
| 3619 | if (sbrWindowWidth <= 480) { |
| 3620 | parseInt(colsmobile); |
| 3621 | } else if (sbrWindowWidth <= 640) { |
| 3622 | parseInt(colstablet); |
| 3623 | } |
| 3624 | |
| 3625 | return parseInt(cols); |
| 3626 | }, |
| 3627 | onThumbnailClick: function($clicked,isPlayer,videoID) { |
| 3628 | if (!this.canCreatePlayer()) { |
| 3629 | return; |
| 3630 | } |
| 3631 | var $self = $(this.el); |
| 3632 | if ($self.hasClass('sbr_layout_gallery')) { |
| 3633 | $self.find('.sbr_current').removeClass('sbr_current'); |
| 3634 | $clicked.closest('.sbr_item').addClass('sbr_current'); |
| 3635 | |
| 3636 | $clicked.closest('.sbr_item').addClass('sbr_current'); |
| 3637 | $self.addClass('sbr_player_added').find('.sbr_player_outer_wrap').addClass('sbr_player_loading'); |
| 3638 | $self.find('.sbr_player_outer_wrap .sbr_video_thumbnail').find('.sbr_loader').show().removeClass('sbr_hidden'); |
| 3639 | if (!$self.find('.sbr_player_outer_wrap iframe').length) { |
| 3640 | if (isPlayer) { |
| 3641 | this.createPlayer('sbr_player'+this.index); |
| 3642 | } else { |
| 3643 | var videoID = typeof videoID === 'undefined' ? this.getVideoID($clicked.closest('.sbr_item')) : videoID; |
| 3644 | this.createPlayer('sbr_player'+this.index,videoID); |
| 3645 | } |
| 3646 | } else { |
| 3647 | if (isPlayer) { |
| 3648 | var videoID = typeof videoID === 'undefined' ? this.getVideoID($self.find('.sbr_item').first()) : videoID; |
| 3649 | |
| 3650 | this.playVideoInPlayer(videoID); |
| 3651 | } else { |
| 3652 | var videoID = typeof videoID === 'undefined' ? this.getVideoID($clicked.closest('.sbr_item')) : videoID; |
| 3653 | |
| 3654 | this.changePlayerInfo($clicked.closest('.sbr_item')); |
| 3655 | this.playVideoInPlayer(videoID); |
| 3656 | this.afterVideoChanged(); |
| 3657 | } |
| 3658 | } |
| 3659 | |
| 3660 | } else if ($(this.el).hasClass('sbr_layout_grid') || $(this.el).hasClass('sbr_layout_carousel')) { |
| 3661 | var $sbrItem = $clicked.closest('.sbr_item'), |
| 3662 | videoID = typeof videoID === 'undefined' ? this.getVideoID($sbrItem) : videoID; |
| 3663 | this.playVideoInPlayer(videoID); |
| 3664 | this.afterVideoChanged(); |
| 3665 | } else if ($(this.el).hasClass('sbr_layout_list')) { |
| 3666 | var $sbrItem = $clicked.closest('.sbr_item'), |
| 3667 | videoID = typeof videoID === 'undefined' ? this.getVideoID($sbrItem) : videoID; |
| 3668 | if ($sbrItem.length && !$sbrItem.find('iframe').length) { |
| 3669 | $sbrItem.find('.sbr_loader').show().removeClass('sbr_hidden'); |
| 3670 | $sbrItem.addClass('sbr_player_loading sbr_player_loaded'); |
| 3671 | this.createPlayer('sbr_player_'+videoID,videoID); |
| 3672 | } else { |
| 3673 | this.playVideoInPlayer(videoID,$sbrItem.attr('data-video-id')); |
| 3674 | this.afterVideoChanged(); |
| 3675 | } |
| 3676 | } |
| 3677 | }, |
| 3678 | onThumbnailEnter: function($hovered) { |
| 3679 | if (!this.canCreatePlayer()) { |
| 3680 | return; |
| 3681 | } |
| 3682 | var $self = $(this.el); |
| 3683 | if ($self.hasClass('sbr_layout_list')) { |
| 3684 | var $sbrItem = $hovered.closest('.sbr_item'), |
| 3685 | videoID = this.getVideoID($sbrItem); |
| 3686 | if (!$sbrItem.find('iframe').length) { |
| 3687 | $sbrItem.find('.sbr_loader').show().removeClass('sbr_hidden'); |
| 3688 | $sbrItem.addClass('sbr_player_loading sbr_player_loaded'); |
| 3689 | this.createPlayer('sbr_player_'+videoID,videoID,0); |
| 3690 | } |
| 3691 | } |
| 3692 | }, |
| 3693 | onThumbnailLeave: function() { |
| 3694 | }, |
| 3695 | changePlayerInfo: function() { |
| 3696 | |
| 3697 | }, |
| 3698 | playerEagerLoaded: function() { |
| 3699 | if (typeof this.player !== 'undefined' || $(this.el).hasClass('sbr_player_loaded')) { |
| 3700 | return true; |
| 3701 | } |
| 3702 | }, |
| 3703 | initGrid: function() { |
| 3704 | if (window.sbrSemiEagerLoading && jQuery('#sbr_lightbox').length) { |
| 3705 | var feed = this; |
| 3706 | playerID = 'sbr_lb-player'; |
| 3707 | jQuery('#sbr_lightbox').addClass('sbr_video_lightbox'); |
| 3708 | |
| 3709 | var videoID = $(this.el).find('sbr_item').first().attr('data-video-id'), |
| 3710 | autoplay = sbrOptions.autoplay; |
| 3711 | if (typeof window.sbrLightboxPlayer === 'undefined') { |
| 3712 | var args = { |
| 3713 | host: window.location.protocol + feed.embedURL, |
| 3714 | videoId: videoID, |
| 3715 | playerVars: { |
| 3716 | modestbranding: 1, |
| 3717 | rel: 0, |
| 3718 | autoplay: autoplay |
| 3719 | }, |
| 3720 | events: { |
| 3721 | 'onStateChange': function (data) { |
| 3722 | var videoID = data.target.getVideoData()['video_id']; |
| 3723 | feed.afterStateChange(playerID, videoID, data, $('#' + playerID).closest('.sbr_video_thumbnail_wrap')); |
| 3724 | } |
| 3725 | } |
| 3726 | }; |
| 3727 | feed.maybeAddCTA(playerID); |
| 3728 | |
| 3729 | window.sbrLightboxPlayer = new window.YT.Player(playerID, args); |
| 3730 | } |
| 3731 | } |
| 3732 | }, |
| 3733 | maybeAddCTA: function() {}, |
| 3734 | canCreatePlayer: function() { |
| 3735 | if ($(this.el).find('#sbr_blank').length) { |
| 3736 | return false; |
| 3737 | } |
| 3738 | return this.playerEagerLoaded() || (this.playerAPIReady && this.settings.consentGiven) || (window.sbrAPIReady && this.settings.consentGiven); |
| 3739 | }, |
| 3740 | playVideoInPlayer: function(videoID,playerID) { |
| 3741 | if (typeof this.player !== 'undefined' && typeof this.player.loadVideoById !== 'undefined') { |
| 3742 | this.player.loadVideoById(videoID); |
| 3743 | } else if (typeof window.sbrLightboxPlayer !== 'undefined' |
| 3744 | && typeof window.sbrLightboxPlayer.loadVideoById !== 'undefined') { |
| 3745 | window.sbrLightboxPlayer.loadVideoById(videoID); |
| 3746 | } else if (typeof playerID !== 'undefined' |
| 3747 | && typeof this.players !== 'undefined' |
| 3748 | && typeof this.players[playerID] !== 'undefined' |
| 3749 | && typeof this.players[playerID].loadVideoById !== 'undefined') { |
| 3750 | this.players[playerID].loadVideoById(videoID); |
| 3751 | } |
| 3752 | }, |
| 3753 | afterVideoChanged: function() { |
| 3754 | if ($(this.el).hasClass('sbr_layout_gallery')) { |
| 3755 | $(this.el).find('.sbr_player_outer_wrap').removeClass('sbr_player_loading'); |
| 3756 | $(this.el).find('.sbr_player_outer_wrap .sbr_video_thumbnail').find('.sbr_loader').hide().addClass('sbr_hidden'); |
| 3757 | |
| 3758 | if ($(window).width() < 480) { |
| 3759 | $('html, body').animate({ |
| 3760 | scrollTop: $(this.el).find('.sbr_player_outer_wrap').offset().top |
| 3761 | }, 300); |
| 3762 | } |
| 3763 | |
| 3764 | } |
| 3765 | }, |
| 3766 | checkConsent: function() { |
| 3767 | if (this.settings.consentGiven || !this.settings.gdpr) { |
| 3768 | this.settings.noCDN = false; |
| 3769 | return true; |
| 3770 | } |
| 3771 | if (typeof CLI_Cookie !== "undefined") { // GDPR Cookie Consent by WebToffee |
| 3772 | if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null) { |
| 3773 | |
| 3774 | // WebToffee no longer uses this cookie but being left here to maintain backwards compatibility |
| 3775 | if (CLI_Cookie.read('cookielawinfo-checkbox-non-necessary') !== null) { |
| 3776 | this.settings.consentGiven = CLI_Cookie.read('cookielawinfo-checkbox-non-necessary') === 'yes'; |
| 3777 | } |
| 3778 | |
| 3779 | if (CLI_Cookie.read('cookielawinfo-checkbox-necessary') !== null) { |
| 3780 | this.settings.consentGiven = CLI_Cookie.read('cookielawinfo-checkbox-necessary') === 'yes'; |
| 3781 | } |
| 3782 | } |
| 3783 | |
| 3784 | } else if (typeof window.cnArgs !== "undefined") { // Cookie Notice by dFactory |
| 3785 | var value = "; " + document.cookie, |
| 3786 | parts = value.split( '; cookie_notice_accepted=' ); |
| 3787 | |
| 3788 | if ( parts.length === 2 ) { |
| 3789 | var val = parts.pop().split( ';' ).shift(); |
| 3790 | |
| 3791 | this.settings.consentGiven = (val === 'true'); |
| 3792 | } |
| 3793 | } else if (typeof window.cookieconsent !== 'undefined') { // Complianz by Really Simple Plugins |
| 3794 | this.settings.consentGiven = ( sbrCmplzGetCookie('cmplz_consent_status') === 'allow' || jQuery('body').hasClass('cmplz-status-marketing') ); |
| 3795 | } else if (typeof window.Cookiebot !== "undefined") { // Cookiebot by Cybot A/S |
| 3796 | this.settings.consentGiven = Cookiebot.consented; |
| 3797 | } else if (typeof window.BorlabsCookie !== 'undefined') { // Borlabs Cookie by Borlabs |
| 3798 | if (typeof window.BorlabsCookie.checkCookieConsent === 'function') { |
| 3799 | // Borlabs Cookie 2.x API |
| 3800 | this.settings.consentGiven = window.BorlabsCookie.checkCookieConsent('reviews'); |
| 3801 | } else if (typeof window.BorlabsCookie.Consents !== 'undefined' && |
| 3802 | typeof window.BorlabsCookie.Consents.hasConsent === 'function') { |
| 3803 | // Borlabs Cookie 3.x API |
| 3804 | this.settings.consentGiven = window.BorlabsCookie.Consents.hasConsent('reviews'); |
| 3805 | } else { |
| 3806 | // Fallback: check if consent was given via event listener |
| 3807 | this.settings.consentGiven = false; |
| 3808 | } |
| 3809 | } |
| 3810 | |
| 3811 | var evt = jQuery.Event('sbrcheckconsent'); |
| 3812 | evt.feed = this; |
| 3813 | jQuery(window).trigger(evt); |
| 3814 | |
| 3815 | if (this.settings.consentGiven) { |
| 3816 | this.settings.noCDN = false; |
| 3817 | } |
| 3818 | |
| 3819 | return this.settings.consentGiven; // GDPR not enabled |
| 3820 | }, |
| 3821 | afterConsentToggled: function() { |
| 3822 | if (this.checkConsent()) { |
| 3823 | var feed = this; |
| 3824 | feed.maybeRaiseImageResolution(); |
| 3825 | feed.applyFullFeatures(); |
| 3826 | setTimeout(function() { |
| 3827 | feed.afterResize(); |
| 3828 | },500); |
| 3829 | } |
| 3830 | }, |
| 3831 | removeFeatures: function() { |
| 3832 | var feed = this; |
| 3833 | if (feed.settings.noCDN) { |
| 3834 | $(feed.el).find('.sbr_video_thumbnail').each(function() { |
| 3835 | $(this).removeAttr('data-sbr-lightbox'); |
| 3836 | }); |
| 3837 | } |
| 3838 | }, |
| 3839 | addLightboxAtt: function() { |
| 3840 | var feed = this; |
| 3841 | |
| 3842 | if (typeof $(feed.el).find('.sb-single-image').last().attr('data-sbr-lightbox') === 'undefined' |
| 3843 | && feed.settings.lightboxEnabled) { |
| 3844 | $(feed.el).find('.sb-single-image').each(function() { |
| 3845 | $(this).attr('data-sbr-lightbox',feed.index); |
| 3846 | }); |
| 3847 | } |
| 3848 | }, |
| 3849 | applyLightbox: function($item) { |
| 3850 | var feed = this; |
| 3851 | |
| 3852 | $item.find('.sb-single-image').each(function() { |
| 3853 | $(this).attr('data-sbr-lightbox',feed.index); |
| 3854 | }); |
| 3855 | }, |
| 3856 | applyFullFeatures: function() { |
| 3857 | var feed = this; |
| 3858 | if (feed.settings.lightboxEnabled) { |
| 3859 | feed.addLightboxAtt(); |
| 3860 | } |
| 3861 | var $self = $(feed.el); |
| 3862 | $self.find('.sbr_no_consent').removeClass('sbr_no_consent'); |
| 3863 | }, |
| 3864 | locationGuess: function() { |
| 3865 | var $feed = $(this.el), |
| 3866 | location = 'content'; |
| 3867 | |
| 3868 | if ($feed.closest('footer').length) { |
| 3869 | location = 'footer'; |
| 3870 | } else if ($feed.closest('.header').length |
| 3871 | || $feed.closest('header').length) { |
| 3872 | location = 'header'; |
| 3873 | } else if ($feed.closest('.sidebar').length |
| 3874 | || $feed.closest('aside').length) { |
| 3875 | location = 'sidebar'; |
| 3876 | } |
| 3877 | |
| 3878 | return location; |
| 3879 | } |
| 3880 | }; |
| 3881 | |
| 3882 | function SbrLightboxBuilder() {} |
| 3883 | |
| 3884 | SbrLightboxBuilder.prototype = { |
| 3885 | getData: function(a){ |
| 3886 | var closestFeedIndex = parseInt(a.closest('.sb-feed-container').attr('data-sbr-index')-1); |
| 3887 | return { |
| 3888 | feedIndex : closestFeedIndex, |
| 3889 | link: a.attr("href") |
| 3890 | //videoTitle: typeof a.attr("data-video-title") !== 'undefined' ? a.attr("data-video-title") : 'YouTube Video', |
| 3891 | //video: a.attr("data-video-id") |
| 3892 | } |
| 3893 | }, |
| 3894 | template: function () { |
| 3895 | return "<div id='sbr_lightboxOverlay' class='sbr_lightboxOverlay'></div>"+ |
| 3896 | "<div id='sbr_lightbox' class='sbr_lightbox'>"+ |
| 3897 | "<div class='sbr_lb-outerContainer'>"+ |
| 3898 | "<div class='sbr_lb-container'>"+ |
| 3899 | "<img class='sbr_lb-image' alt='Lightbox image placeholder' src='' />"+ |
| 3900 | "<div class='sbr_lb-player sbr_lb-player-placeholder' id='sbr_lb-player'></div>" + |
| 3901 | "<div class='sbr_lb-nav'><a class='sbr_lb-prev' href='#' ><p class='sbr-screenreader'>Previous Slide</p><span></span></a><a class='sbr_lb-next' href='#' ><p class='sbr-screenreader'>Next Slide</p><span></span></a></div>"+ |
| 3902 | "<div class='sbr_lb-loader'><a class='sbr_lb-cancel'></a></div>"+ |
| 3903 | "</div>"+ |
| 3904 | "</div>"+ |
| 3905 | "<div class='sbr_lb-dataContainer'>"+ |
| 3906 | "<div class='sbr_lb-data'>"+ |
| 3907 | "<div class='sbr_lb-details'>"+ |
| 3908 | "<div class='sbr_lb-caption'></div>"+ |
| 3909 | "<div class='sbr_lb-info'>"+ |
| 3910 | "<div class='sbr_lb-number'></div>"+ |
| 3911 | "</div>"+ |
| 3912 | "</div>"+ |
| 3913 | "<div class='sbr_lb-closeContainer'><a class='sbr_lb-close'></a></div>"+ |
| 3914 | "</div>"+ |
| 3915 | "</div>"+ |
| 3916 | "</div>"; |
| 3917 | }, |
| 3918 | beforePlayerSetup: function(){ |
| 3919 | |
| 3920 | }, |
| 3921 | afterPlayerSetup: function () { |
| 3922 | }, |
| 3923 | afterResize: function(){ |
| 3924 | var playerHeight = $('#sbr_lightbox .sbr_lb-player').height(); |
| 3925 | |
| 3926 | if (playerHeight > 100) { |
| 3927 | var heightDif = $('#sbr_lightbox .sbr_lb-outerContainer').height() - playerHeight; |
| 3928 | if (heightDif > 10) { |
| 3929 | $('#sbr_lightbox .sbr_lb-player').css('top',heightDif/2); |
| 3930 | } |
| 3931 | } |
| 3932 | }, |
| 3933 | pausePlayer: function () { |
| 3934 | if (typeof YT.get('sbr_lb-player') !== 'undefined' && typeof YT.get('sbr_lb-player').pauseVideo === 'function') { |
| 3935 | YT.get('sbr_lb-player').pauseVideo() |
| 3936 | } else if (typeof window.sbrLightboxPlayer !== 'undefined' && typeof window.sbrLightboxPlayer.pauseVideo === 'function') { |
| 3937 | window.sbrLightboxPlayer.pauseVideo(); |
| 3938 | } |
| 3939 | |
| 3940 | } |
| 3941 | }; |
| 3942 | |
| 3943 | window.sbr_init = function() { |
| 3944 | window.sbr = new Sbr(); |
| 3945 | window.sbr.createPage( window.sbr.createFeeds, {whenFeedsCreated: window.sbr.afterFeedsCreated}); |
| 3946 | }; |
| 3947 | |
| 3948 | function sbrGetNewFeed(feed,index,feedOptions) { |
| 3949 | return new SbrFeed(feed,index,feedOptions); |
| 3950 | } |
| 3951 | |
| 3952 | function sbrGetlightboxBuilder() { |
| 3953 | return new SbrLightboxBuilder(); |
| 3954 | } |
| 3955 | |
| 3956 | function sbrAjax(submitData,onSuccess) { |
| 3957 | $.ajax({ |
| 3958 | url: sbrOptions.adminAjaxUrl, |
| 3959 | type: 'post', |
| 3960 | data: submitData, |
| 3961 | success: onSuccess |
| 3962 | }); |
| 3963 | } |
| 3964 | |
| 3965 | function sbrIsTouch() { |
| 3966 | return "ontouchstart" in document.documentElement; |
| 3967 | } |
| 3968 | |
| 3969 | function sbrCmplzGetCookie(cname) { |
| 3970 | var name = cname + "="; //Create the cookie name variable with cookie name concatenate with = sign |
| 3971 | var cArr = window.document.cookie.split(';'); //Create cookie array by split the cookie by ';' |
| 3972 | |
| 3973 | //Loop through the cookies and return the cookie value if it find the cookie name |
| 3974 | for (var i = 0; i < cArr.length; i++) { |
| 3975 | var c = cArr[i].trim(); |
| 3976 | //If the name is the cookie string at position 0, we found the cookie and return the cookie value |
| 3977 | if (c.indexOf(name) == 0) |
| 3978 | return c.substring(name.length, c.length); |
| 3979 | } |
| 3980 | |
| 3981 | return ""; |
| 3982 | } |
| 3983 | |
| 3984 | })(jQuery); |
| 3985 | |
| 3986 | jQuery(document).ready(function($) { |
| 3987 | sbr_init(); |
| 3988 | |
| 3989 | // Cookie Notice by dFactory |
| 3990 | $('#cookie-notice a').on('click',function() { |
| 3991 | setTimeout(function() { |
| 3992 | $.each(window.sbr.feeds,function(index){ |
| 3993 | window.sbr.feeds[ index ].afterConsentToggled(); |
| 3994 | }); |
| 3995 | },1000); |
| 3996 | }); |
| 3997 | |
| 3998 | // Cookie Notice by dFactory |
| 3999 | $('#cookie-law-info-bar a').on('click',function() { |
| 4000 | setTimeout(function() { |
| 4001 | $.each(window.sbr.feeds,function(index){ |
| 4002 | window.sbr.feeds[ index ].afterConsentToggled(); |
| 4003 | }); |
| 4004 | },1000); |
| 4005 | }); |
| 4006 | |
| 4007 | // GDPR Cookie Consent by WebToffee |
| 4008 | $('.cli-user-preference-checkbox').on('click',function(){ |
| 4009 | setTimeout(function() { |
| 4010 | $.each(window.sbr.feeds,function(index){ |
| 4011 | window.sbr.feeds[ index ].settings.consentGiven = false; |
| 4012 | window.sbr.feeds[ index ].afterConsentToggled(); |
| 4013 | }); |
| 4014 | },1000); |
| 4015 | }); |
| 4016 | |
| 4017 | // Cookiebot, Complianz by Really Simple Plugins, Complianz by Really Simple Plugins Borlabs Cookie by Borlabs |
| 4018 | $(window).on('CookiebotOnAccept cmplzAcceptAll cmplzRevoke borlabs-cookie-consent-saved', function () { |
| 4019 | $.each(window.sbr.feeds,function(index){ |
| 4020 | window.sbr.feeds[ index ].settings.consentGiven = true; |
| 4021 | window.sbr.feeds[ index ].afterConsentToggled(); |
| 4022 | }); |
| 4023 | }); |
| 4024 | |
| 4025 | // Initialize reviewer photos lightbox (used by providers with photo support) |
| 4026 | if (typeof window.SBRLightbox === 'undefined') { |
| 4027 | window.SBRLightbox = { |
| 4028 | overlay: null, |
| 4029 | currentImages: [], |
| 4030 | currentIndex: 0, |
| 4031 | |
| 4032 | init: function() { |
| 4033 | var self = this; |
| 4034 | |
| 4035 | // Create lightbox overlay on first use |
| 4036 | if (!this.overlay) { |
| 4037 | var overlayHtml = '<div class="sbr-lightbox-overlay">' + |
| 4038 | '<button class="sbr-lightbox-close" aria-label="Close">×</button>' + |
| 4039 | '<button class="sbr-lightbox-nav sbr-prev" aria-label="Previous">‹</button>' + |
| 4040 | '<div class="sbr-lightbox-content">' + |
| 4041 | '<img class="sbr-lightbox-image" src="" alt="Reviewer photo" />' + |
| 4042 | '</div>' + |
| 4043 | '<button class="sbr-lightbox-nav sbr-next" aria-label="Next">›</button>' + |
| 4044 | '</div>'; |
| 4045 | |
| 4046 | $('body').append(overlayHtml); |
| 4047 | this.overlay = $('.sbr-lightbox-overlay'); |
| 4048 | |
| 4049 | // Bind close events |
| 4050 | this.overlay.find('.sbr-lightbox-close').on('click', function() { |
| 4051 | self.close(); |
| 4052 | }); |
| 4053 | |
| 4054 | this.overlay.on('click', function(e) { |
| 4055 | if (e.target === this) { |
| 4056 | self.close(); |
| 4057 | } |
| 4058 | }); |
| 4059 | |
| 4060 | // Bind navigation events |
| 4061 | this.overlay.find('.sbr-prev').on('click', function() { |
| 4062 | self.prev(); |
| 4063 | }); |
| 4064 | |
| 4065 | this.overlay.find('.sbr-next').on('click', function() { |
| 4066 | self.next(); |
| 4067 | }); |
| 4068 | |
| 4069 | // Keyboard navigation |
| 4070 | $(document).on('keydown', function(e) { |
| 4071 | if (!self.overlay.hasClass('sbr-active')) return; |
| 4072 | |
| 4073 | if (e.key === 'Escape' || e.keyCode === 27) { |
| 4074 | self.close(); |
| 4075 | } else if (e.key === 'ArrowLeft' || e.keyCode === 37) { |
| 4076 | self.prev(); |
| 4077 | } else if (e.key === 'ArrowRight' || e.keyCode === 39) { |
| 4078 | self.next(); |
| 4079 | } |
| 4080 | }); |
| 4081 | } |
| 4082 | |
| 4083 | // Bind click events to reviewer photo links |
| 4084 | $(document).on('click', '.sb-reviewer-photo-link', function(e) { |
| 4085 | e.preventDefault(); |
| 4086 | |
| 4087 | var $link = $(this); |
| 4088 | var reviewId = $link.attr('data-sbr-lightbox'); |
| 4089 | |
| 4090 | // Collect all images for this review |
| 4091 | self.currentImages = []; |
| 4092 | $('.sb-reviewer-photo-link[data-sbr-lightbox="' + reviewId + '"]').each(function() { |
| 4093 | self.currentImages.push($(this).attr('href')); |
| 4094 | }); |
| 4095 | |
| 4096 | // Find the clicked image index |
| 4097 | self.currentIndex = $('.sb-reviewer-photo-link[data-sbr-lightbox="' + reviewId + '"]').index($link); |
| 4098 | |
| 4099 | self.open(); |
| 4100 | }); |
| 4101 | }, |
| 4102 | |
| 4103 | open: function() { |
| 4104 | if (this.currentImages.length === 0) return; |
| 4105 | |
| 4106 | this.showImage(); |
| 4107 | this.overlay.addClass('sbr-active'); |
| 4108 | |
| 4109 | // Show navigation if multiple images |
| 4110 | if (this.currentImages.length > 1) { |
| 4111 | this.overlay.addClass('sbr-has-multiple'); |
| 4112 | } else { |
| 4113 | this.overlay.removeClass('sbr-has-multiple'); |
| 4114 | } |
| 4115 | |
| 4116 | // Prevent body scroll |
| 4117 | $('body').css('overflow', 'hidden'); |
| 4118 | }, |
| 4119 | |
| 4120 | close: function() { |
| 4121 | this.overlay.removeClass('sbr-active'); |
| 4122 | this.currentImages = []; |
| 4123 | this.currentIndex = 0; |
| 4124 | |
| 4125 | // Restore body scroll |
| 4126 | $('body').css('overflow', ''); |
| 4127 | }, |
| 4128 | |
| 4129 | showImage: function() { |
| 4130 | if (this.currentIndex < 0) this.currentIndex = this.currentImages.length - 1; |
| 4131 | if (this.currentIndex >= this.currentImages.length) this.currentIndex = 0; |
| 4132 | |
| 4133 | var $img = this.overlay.find('.sbr-lightbox-image'); |
| 4134 | $img.attr('src', this.currentImages[this.currentIndex]); |
| 4135 | }, |
| 4136 | |
| 4137 | prev: function() { |
| 4138 | this.currentIndex--; |
| 4139 | this.showImage(); |
| 4140 | }, |
| 4141 | |
| 4142 | next: function() { |
| 4143 | this.currentIndex++; |
| 4144 | this.showImage(); |
| 4145 | } |
| 4146 | }; |
| 4147 | |
| 4148 | window.SBRLightbox.init(); |
| 4149 | } |
| 4150 | }); |
| 4151 | |
| 4152 | } // if sbr_js_exists |
| 4153 |