1/* hover box */ 2 3var offsetx = 20; 4var offsety = 0; 5 6function hideAtkpBox(e, Inhalte) { 7 document.getElementById('atkp-infobox').style.visibility = "hidden"; 8} 9 10function isAtkpMobile() { 11 var isMobile = false; //initiate as false 12 // device detection 13 if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 14 || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
14substr(0,4))) { 15 isMobile = true; 16 } 17 18 return isMobile; 19} 20 21function showAtkpBox(e, Inhalte, offsetX, offsetY) { 22 23 if(isAtkpMobile()) { 24 hideAtkpBox(e, Inhalte); 25 return; 26 } 27 28 if (offsetX) { 29 offsetx = offsetX; 30 } else { 31 offsetx = 20; 32 } 33 if (offsetY) { 34 offsety = offsetY; 35 } else { 36 offsety = 0; 37 } 38 var PositionX = 0; 39 var PositionY = 0; 40 if (!e) var e = window.event; 41 if (e.pageX || e.pageY) { 42 PositionX = e.pageX; 43 PositionY = e.pageY; 44 } 45 else if (e.clientX || e.clientY) { 46 PositionX = e.clientX + document.body.scrollLeft; 47 PositionY = e.clientY + document.body.scrollTop; 48 } 49 document.getElementById("BoxInhalte").innerHTML = document.getElementById(Inhalte).innerHTML; 50 document.getElementById('atkp-infobox').style.left = (PositionX + offsetx) + "px"; 51 document.getElementById('atkp-infobox').style.top = (PositionY + offsety) + "px"; 52 document.getElementById('atkp-infobox').style.visibility = "visible"; 53 54} 55 56 57 58/*slider*/ 59 60/*! nouislider - 9.0.0 - 2016-09-29 21:44:02 */ 61 62!function (a) { 63 "function" == typeof define && define.amd ? define([], a) : "object" == typeof exports ? module.exports = a() : window.atkpnoUiSlider = a() 64}(function () { 65 "use strict"; 66 67 function a(a, b) { 68 var c = document.createElement("div"); 69 return j(c, b), a.appendChild(c), c 70 } 71 72 function b(a) { 73 return a.filter(function (a) { 74 return !this[a] && (this[a] = !0) 75 }, {}) 76 } 77 78 function c(a, b) { 79 return Math.round(a / b) * b 80 } 81 82 function d(a, b) { 83 var c = a.getBoundingClientRect(), d = a.ownerDocument, e = d.documentElement, f = m(); 84 return /webkit.*Chrome.*Mobile/i.test(navigator.userAgent) && (f.x = 0), b ? c.top + f.y - e.clientTop : c.left + f.x - e.clientLeft 85 } 86 87 function e(a) { 88 return "number" == typeof a && !isNaN(a) && isFinite(a) 89 } 90 91 function f(a, b, c) { 92 c > 0 && (j(a, b), setTimeout(function () { 93 k(a, b) 94 }, c)) 95 } 96 97 function g(a) { 98 return Math.max(Math.min(a, 100), 0) 99 } 100 101 function h(a) { 102 return Array.isArray(a) ? a : [a] 103 } 104 105 function i(a) { 106 a = String(a); 107 var b = a.split("."); 108 return b.length > 1 ? b[1].length : 0 109 } 110 111 function j(a, b) { 112 a.classList ? a.classList.add(b) : a.className += " " + b 113 } 114 115 function k(a, b) { 116 a.classList ? a.classList.remove(b) : a.className = a.className.replace(new RegExp("(^|\\b)" + b.split(" ").join("|") + "(\\b|$)", "gi"), " ") 117 } 118 119 function l(a, b) { 120 return a.classList ? a.classList.contains(b) : new RegExp("\\b" + b + "\\b").test(a.className) 121 } 122 123 function m() { 124 var a = void 0 !== window.pageXOffset, b = "CSS1Compat" === (document.compatMode || ""), 125 c = a ? window.pageXOffset : b ? document.documentElement.scrollLeft : document.body.scrollLeft, 126 d = a ? window.pageYOffset : b ? document.documentElement.scrollTop : document.body.scrollTop; 127 return {x: c, y: d} 128 } 129 130 function n() { 131 return window.navigator.pointerEnabled ? { 132 start: "pointerdown", 133 move: "pointermove", 134 end: "pointerup" 135 } : window.navigator.msPointerEnabled ? { 136 start: "MSPointerDown", 137 move: "MSPointerMove", 138 end: "MSPointerUp" 139 } : {start: "mousedown touchstart", move: "mousemove touchmove", end: "mouseup touchend"} 140 } 141 142 function o(a, b) { 143 return 100 / (b - a) 144 } 145 146 function p(a, b) { 147 return 100 * b / (a[1] - a[0]) 148 } 149 150 function q(a, b) { 151 return p(a, a[0] < 0 ? b + Math.abs(a[0]) : b - a[0]) 152 } 153 154 function r(a, b) { 155 return b * (a[1] - a[0]) / 100 + a[0] 156 } 157 158 function s(a, b) { 159 for (var c = 1; a >= b[c];) c += 1; 160 return c 161 } 162 163 function t(a, b, c) { 164 if (c >= a.slice(-1)[0]) return 100; 165 var d, e, f, g, h = s(c, a); 166 return d = a[h - 1], e = a[h], f = b[h - 1], g = b[h], f + q([d, e], c) / o(f, g) 167 } 168 169 function u(a, b, c) { 170 if (c >= 100) return a.slice(-1)[0]; 171 var d, e, f, g, h = s(c, b); 172 return d = a[h - 1], e = a[h], f = b[h - 1], g = b[h], r([d, e], (c - f) * o(f, g)) 173 } 174 175 function v(a, b, d, e) { 176 if (100 === e) return e; 177 var f, g, h = s(e, a); 178 return d ? (f = a[h - 1], g = a[h], e - f > (g - f) / 2 ? g : f) : b[h - 1] ? a[h - 1] + c(e - a[h - 1], b[h - 1]) : e 179 } 180 181 function w(a, b, c) { 182 var d; 183 if ("number" == typeof b && (b = [b]), "[object Array]" !== Object.prototype.toString.call(b)) throw new Error("atkpnoUiSlider: 'range' contains invali
vendor: 5,949 bytes, lines 183-319
183d value."); 184 if (d = "min" === a ? 0 : "max" === a ? 100 : parseFloat(a), !e(d) || !e(b[0])) throw new Error("atkpnoUiSlider: 'range' value isn't numeric."); 185 c.xPct.push(d), c.xVal.push(b[0]), d ? c.xSteps.push(!isNaN(b[1]) && b[1]) : isNaN(b[1]) || (c.xSteps[0] = b[1]), c.xHighestCompleteStep.push(0) 186 } 187 188 function x(a, b, c) { 189 if (!b) return !0; 190 c.xSteps[a] = p([c.xVal[a], c.xVal[a + 1]], b) / o(c.xPct[a], c.xPct[a + 1]); 191 var d = (c.xVal[a + 1] - c.xVal[a]) / c.xNumSteps[a], e = Math.ceil(Number(d.toFixed(3)) - 1), 192 f = c.xVal[a] + c.xNumSteps[a] * e; 193 c.xHighestCompleteStep[a] = f 194 } 195 196 function y(a, b, c, d) { 197 this.xPct = [], this.xVal = [], this.xSteps = [d || !1], this.xNumSteps = [!1], this.xHighestCompleteStep = [], this.snap = b, this.direction = c; 198 var e, f = []; 199 for (e in a) a.hasOwnProperty(e) && f.push([a[e], e]); 200 for (f.length && "object" == typeof f[0][0] ? f.sort(function (a, b) { 201 return a[0][0] - b[0][0] 202 }) : f.sort(function (a, b) { 203 return a[0] - b[0] 204 }), e = 0; e < f.length; e++) w(f[e][1], f[e][0], this); 205 for (this.xNumSteps = this.xSteps.slice(0), e = 0; e < this.xNumSteps.length; e++) x(e, this.xNumSteps[e], this) 206 } 207 208 function z(a, b) { 209 if (!e(b)) throw new Error("atkpnoUiSlider: 'step' is not numeric."); 210 a.singleStep = b 211 } 212 213 function A(a, b) { 214 if ("object" != typeof b || Array.isArray(b)) throw new Error("atkpnoUiSlider: 'range' is not an object."); 215 if (void 0 === b.min || void 0 === b.max) throw new Error("atkpnoUiSlider: Missing 'min' or 'max' in 'range'."); 216 if (b.min === b.max) throw new Error("atkpnoUiSlider: 'range' 'min' and 'max' cannot be equal."); 217 a.spectrum = new y(b, a.snap, a.dir, a.singleStep) 218 } 219 220 function B(a, b) { 221 if (b = h(b), !Array.isArray(b) || !b.length) throw new Error("atkpnoUiSlider: 'start' option is incorrect."); 222 a.handles = b.length, a.start = b 223 } 224 225 function C(a, b) { 226 if (a.snap = b, "boolean" != typeof b) throw new Error("atkpnoUiSlider: 'snap' option must be a boolean.") 227 } 228 229 function D(a, b) { 230 if (a.animate = b, "boolean" != typeof b) throw new Error("atkpnoUiSlider: 'animate' option must be a boolean.") 231 } 232 233 function E(a, b) { 234 if (a.animationDuration = b, "number" != typeof b) throw new Error("atkpnoUiSlider: 'animationDuration' option must be a number.") 235 } 236 237 function F(a, b) { 238 var c, d = [!1]; 239 if (b === !0 || b === !1) { 240 for (c = 1; c < a.handles; c++) d.push(b); 241 d.push(!1) 242 } else { 243 if (!Array.isArray(b) || !b.length || b.length !== a.handles + 1) throw new Error("atkpnoUiSlider: 'connect' option doesn't match handle count."); 244 d = b 245 } 246 a.connect = d 247 } 248 249 function G(a, b) { 250 switch (b) { 251 case"horizontal": 252 a.ort = 0; 253 break; 254 case"vertical": 255 a.ort = 1; 256 break; 257 default: 258 throw new Error("atkpnoUiSlider: 'orientation' option is invalid.") 259 } 260 } 261 262 function H(a, b) { 263 if (!e(b)) throw new Error("atkpnoUiSlider: 'margin' option must be numeric."); 264 if (0 !== b && (a.margin = a.spectrum.getMargin(b), !a.margin)) throw new Error("atkpnoUiSlider: 'margin' option is only supported on linear sliders.") 265 } 266 267 function I(a, b) { 268 if (!e(b)) throw new Error("atkpnoUiSlider: 'limit' option must be numeric."); 269 if (a.limit = a.spectrum.getMargin(b), !a.limit || a.handles < 2) throw new Error("atkpnoUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.") 270 } 271 272 function J(a, b) { 273 switch (b) { 274 case"ltr": 275 a.dir = 0; 276 break; 277 case"rtl": 278 a.dir = 1; 279 break; 280 default: 281 throw new Error("atkpnoUiSlider: 'direction' option was not recognized.") 282 } 283 } 284 285 function K(a, b) { 286 if ("string" != typeof b) throw new Error("atkpnoUiSlider: 'behaviour' must be a string containing options."); 287 var c = b.indexOf("tap") >= 0, d = b.indexOf("drag") >= 0, e = b.indexOf("fixed") >= 0, 288 f = b.indexOf("snap") >= 0, g = b.indexOf("hover") >= 0; 289 if (e) { 290 if (2 !== a.handles) throw new Error("atkpnoUiSlider: 'fixed' behaviour must be used with 2 handles"); 291 H(a, a.start[1] - a.start[0]) 292 } 293 a.events = {tap: c || f, drag: d, fixed: e, snap: f, hover: g} 294 } 295 296 function L(a, b) { 297 if (b !== !1) if (b === !0) { 298 a.tooltips = []; 299 for (var c = 0; c < a.handles; c++) a.tooltips.push(!0) 300 } else { 301 if (a.tooltips = h(b), a.tooltips.length !== a.handles) throw new Error("atkpnoUiSlider: must pass a formatter for all handles."); 302 a.tooltips.forEach(function (a) { 303 if ("boolean" != typeof a && ("object" != typeof a || "function" != typeof a.to)) throw new Error("atkpnoUiSlider: 'tooltips' must be passed a formatter or 'false'.") 304 }) 305 } 306 } 307 308 function M(a, b) { 309 if (a.format = b, "function" == typeof b.to && "function" == typeof b.from) return !0; 310 throw new Error("atkpnoUiSlider: 'format' requires 'to' and 'from' methods.") 311 } 312 313 function N(a, b) { 314 if (void 0 !== b && "string" != typeof b && b !== !1) throw new Error("atkpnoUiSlider: 'cssPrefix' must be a string or `false`."); 315 a.cssPrefix = b 316 } 317 318 function O(a, b) { 319 if (void 0 !== b && "object" != typeof b) throw new Error("atkpnoUiSlider: 'cssClasse
319s' must be an object."); 320 if ("string" == typeof a.cssPrefix) { 321 a.cssClasses = {}; 322 for (var c in b) b.hasOwnProperty(c) && (a.cssClasses[c] = a.cssPrefix + b[c]) 323 } else a.cssClasses = b 324 } 325 326 function P(a, b) { 327 if (b !== !0 && b !== !1) throw new Error("atkpnoUiSlider: 'useRequestAnimationFrame' option should be true (default) or false."); 328 a.useRequestAnimationFrame = b 329 } 330 331 function Q(a) { 332 var b, c = {margin: 0, limit: 0, animate: !0, animationDuration: 300, format: T}; 333 b = { 334 step: {r: !1, t: z}, 335 start: {r: !0, t: B}, 336 connect: {r: !0, t: F}, 337 direction: {r: !0, t: J}, 338 snap: {r: !1, t: C}, 339 animate: {r: !1, t: D}, 340 animationDuration: {r: !1, t: E}, 341 range: {r: !0, t: A}, 342 orientation: {r: !1, t: G}, 343 margin: {r: !1, t: H}, 344 limit: {r: !1, t: I}, 345 behaviour: {r: !0, t: K}, 346 format: {r: !1, t: M}, 347 tooltips: {r: !1, t: L}, 348 cssPrefix: {r: !1, t: N}, 349 cssClasses: {r: !1, t: O}, 350 useRequestAnimationFrame: {r: !1, t: P} 351 }; 352 var d = { 353 connect: !1, 354 direction: "ltr", 355 behaviour: "tap", 356 orientation: "horizontal", 357 cssPrefix: "atkpnoUi-", 358 cssClasses: { 359 target: "target", 360 base: "base", 361 origin: "origin", 362 handle: "handle", 363 horizontal: "horizontal", 364 vertical: "vertical", 365 background: "background", 366 connect: "connect", 367 ltr: "ltr", 368 rtl: "rtl", 369 draggable: "draggable", 370 drag: "state-drag", 371 tap: "state-tap", 372 active: "active", 373 tooltip: "tooltip", 374 pips: "pips", 375 pipsHorizontal: "pips-horizontal", 376 pipsVertical: "pips-vertical", 377 marker: "marker", 378 markerHorizontal: "marker-horizontal", 379 markerVertical: "marker-vertical", 380 markerNormal: "marker-normal", 381 markerLarge: "marker-large", 382 markerSub: "marker-sub", 383 value: "value", 384 valueHorizontal: "value-horizontal", 385 valueVertical: "value-vertical", 386 valueNormal: "value-normal", 387 valueLarge: "value-large", 388 valueSub: "value-sub" 389 }, 390 useRequestAnimationFrame: !0 391 }; 392 Object.keys(b).forEach(function (e) { 393 if (void 0 === a[e] && void 0 === d[e]) { 394 if (b[e].r) throw new Error("atkpnoUiSlider: '" + e + "' is required."); 395 return !0 396 } 397 b[e].t(c, void 0 === a[e] ? d[e] : a[e]) 398 }), c.pips = a.pips; 399 var e = [["left", "top"], ["right", "bottom"]]; 400 return c.style = e[c.dir][c.ort], c.styleOposite = e[c.dir ? 0 : 1][c.ort], c 401 } 402 403 function R(c, e, i) { 404 function o(b, c) { 405 var d = a(b, e.cssClasses.origin), f = a(d, e.cssClasses.handle); 406 return f.setAttribute("data-handle", c), d 407 } 408 409 function p(b, c) { 410 return !!c && a(b, e.cssClasses.connect) 411 } 412 413 function q(a, b) { 414 ba = [], ca = [], ca.push(p(b, a[0])); 415 for (var c = 0; c < e.handles; c++) ba.push(o(b, c)), ha[c] = c, ca.push(p(b, a[c + 1])) 416 } 417 418 function r(b) { 419 j(b, e.cssClasses.target), 0 === e.dir ? j(b, e.cssClasses.ltr) : j(b, e.cssClasses.rtl), 0 === e.ort ? j(b, e.cssClasses.horizontal) : j(b, e.cssClasses.vertical), aa = a(b, e.cssClasses.base) 420 } 421 422 function s(b, c) { 423 return !!e.tooltips[c] && a(b.firstChild, e.cssClasses.tooltip) 424 } 425 426 function t() { 427 var a = ba.map(s); 428 Z("update", function (b, c, d) { 429 if (a[c]) { 430 var f = b[c]; 431 e.tooltips[c] !== !0 && (f = e.tooltips[c].to(d[c])), a[c].innerHTML = f 432 } 433 }) 434 } 435 436 function u(a, b, c) { 437 if ("range" === a || "steps" === a) return ia.xVal; 438 if ("count" === a) { 439 var d, e = 100 / (b - 1), f = 0; 440 for (b = []; (d = f++ * e) <= 100;) b.push(d); 441 a = "positions" 442 } 443 return "positions" === a ? b.map(function (a) { 444 return ia.fromStepping(c ? ia.getStep(a) : a) 445 }) : "values" === a ? c ? b.map(function (a) { 446 return ia.fromStepping(ia.getStep(ia.toStepping(a))) 447 }) : b : void 0 448 } 449 450 function v(a, c, d) { 451 function e(a, b) { 452 return (a + b).toFixed(7) / 1 453 } 454 455 var f = {}, g = ia.xVal[0], h = ia.xVal[ia.xVal.length - 1], i = !1, j = !1, k = 0; 456 return d = b(d.slice().sort(function (a, b) { 457 return a - b 458 })), d[0] !== g && (d.unshift(g), i = !0), d[d.length - 1] !== h && (d.push(h), j = !0), d.forEach(function (b, g) { 459 var h, l, m, n, o, p, q, r, s, t, u = b, v = d[g + 1]; 460 if ("steps" === c && (h = ia.xNumSteps[g]), h || (h = v - u), u !== !1 && void 0 !== v) for (h = Math.max(h, 1e-7), l = u; l <= v; l = e(l, h)) { 461 for (n = ia.toStepping(l), o = n - k, r = o / a, s = Math.round(r), t = o / s, m = 1; m <= s; m += 1) p = k + m * t, f[p.toFixed(5)] = ["x", 0]; 462 q = d.indexOf(l) > -1 ? 1 : "steps" === c ? 2 : 0, !g && i && (q = 0), l === v && j || (f[n.toFixed(5)] = [l, q]), k = n 463 } 464 }), f
465 } 466 467 function w(a, b, c) { 468 function d(a, b) { 469 var c = b === e.cssClasses.value, d = c ? m : n, f = c ? k : l; 470 return b + " " + d[e.ort] + " " + f[a] 471 } 472 473 function f(a, b, c) { 474 return 'class="' + d(c[1], b) + '" style="' + e.style + ": " + a + '%"' 475 } 476 477 function g(a, d) { 478 d[1] = d[1] && b ? b(d[0], d[1]) : d[1], i += "<div " + f(a, e.cssClasses.marker, d) + "></div>", d[1] && (i += "<div " + f(a, e.cssClasses.value, d) + ">" + c.to(d[0]) + "</div>") 479 } 480 481 var h = document.createElement("div"), i = "", 482 k = [e.cssClasses.valueNormal, e.cssClasses.valueLarge, e.cssClasses.valueSub], 483 l = [e.cssClasses.markerNormal, e.cssClasses.markerLarge, e.cssClasses.markerSub], 484 m = [e.cssClasses.valueHorizontal, e.cssClasses.valueVertical], 485 n = [e.cssClasses.markerHorizontal, e.cssClasses.markerVertical]; 486 return j(h, e.cssClasses.pips), j(h, 0 === e.ort ? e.cssClasses.pipsHorizontal : e.cssClasses.pipsVertical), Object.keys(a).forEach(function (b) { 487 g(b, a[b]) 488 }), h.innerHTML = i, h 489 } 490 491 function x(a) { 492 var b = a.mode, c = a.density || 1, d = a.filter || !1, e = a.values || !1, f = a.stepped || !1, 493 g = u(b, e, f), h = v(c, b, g), i = a.format || {to: Math.round}; 494 return fa.appendChild(w(h, d, i)) 495 } 496 497 function y() { 498 var a = aa.getBoundingClientRect(), b = "offset" + ["Width", "Height"][e.ort]; 499 return 0 === e.ort ? a.width || aa[b] : a.height || aa[b] 500 } 501 502 function z(a, b, c, d) { 503 var f = function (b) { 504 return !fa.hasAttribute("disabled") && (!l(fa, e.cssClasses.tap) && (b = A(b, d.pageOffset), !(a === ea.start && void 0 !== b.buttons && b.buttons > 1) && ((!d.hover || !b.buttons) && (b.calcPoint = b.points[e.ort], void c(b, d))))) 505 }, g = []; 506 return a.split(" ").forEach(function (a) { 507 b.addEventListener(a, f, !1), g.push([a, f]) 508 }), g 509 } 510 511 function A(a, b) { 512 a.preventDefault(); 513 var c, d, e = 0 === a.type.indexOf("touch"), f = 0 === a.type.indexOf("mouse"), 514 g = 0 === a.type.indexOf("pointer"), h = a; 515 if (0 === a.type.indexOf("MSPointer") && (g = !0), e) { 516 if (h.touches.length > 1) return !1; 517 c = a.changedTouches[0].pageX, d = a.changedTouches[0].pageY 518 } 519 return b = b || m(), (f || g) && (c = a.clientX + b.x, d = a.clientY + b.y), h.pageOffset = b, h.points = [c, d], h.cursor = f || g, h 520 } 521 522 function B(a) { 523 var b = a - d(aa, e.ort), c = 100 * b / y(); 524 return e.dir ? 100 - c : c 525 } 526 527 function C(a) { 528 var b = 100, c = !1; 529 return ba.forEach(function (d, e) { 530 if (!d.hasAttribute("disabled")) { 531 var f = Math.abs(ga[e] - a); 532 f < b && (c = e, b = f) 533 } 534 }), c 535 } 536 537 function D(a, b, c, d) { 538 var e = c.slice(), f = [!a, a], g = [a, !a]; 539 d = d.slice(), a && d.reverse(), d.length > 1 ? d.forEach(function (a, c) { 540 var d = M(e, a, e[a] + b, f[c], g[c]); 541 d === !1 ? b = 0 : (b = d - e[a], e[a] = d) 542 }) : f = g = [!0]; 543 var h = !1; 544 d.forEach(function (a, d) { 545 h = R(a, c[a] + b, f[d], g[d]) || h 546 }), h && d.forEach(function (a) { 547 E("update", a), E("slide", a) 548 }) 549 } 550 551 function E(a, b, c) { 552 Object.keys(ka).forEach(function (d) { 553 var f = d.split(".")[0]; 554 a === f && ka[d].forEach(function (a) { 555 a.call(da, ja.map(e.format.to), b, ja.slice(), c || !1, ga.slice()) 556 }) 557 }) 558 } 559 560 function F(a, b) { 561 "mouseout" === a.type && "HTML" === a.target.nodeName && null === a.relatedTarget && H(a, b) 562 } 563 564 function G(a, b) { 565 if (navigator.appVersion.indexOf("MSIE 9") === -1 && 0 === a.buttons && 0 !== b.buttonsProperty) return H(a, b); 566 var c = (e.dir ? -1 : 1) * (a.calcPoint - b.startCalcPoint), d = 100 * c / b.baseSize; 567 D(c > 0, d, b.locations, b.handleNumbers) 568 } 569 570 function H(a, b) {
vendor: 4,142 bytes, lines 571-651
571 var c = aa.querySelector("." + e.cssClasses.active); 572 null !== c && k(c, e.cssClasses.active), a.cursor && (document.body.style.cursor = "", document.body.removeEventListener("selectstart", document.body.atkpnoUiListener)), document.documentElement.atkpnoUiListeners.forEach(function (a) { 573 document.documentElement.removeEventListener(a[0], a[1]) 574 }), k(fa, e.cssClasses.drag), P(), b.handleNumbers.forEach(function (a) { 575 E("set", a), E("change", a), E("end", a) 576 }) 577 } 578 579 function I(a, b) { 580 if (1 === b.handleNumbers.length) { 581 var c = ba[b.handleNumbers[0]]; 582 if (c.hasAttribute("disabled")) return !1; 583 j(c.children[0], e.cssClasses.active) 584 } 585 a.preventDefault(), a.stopPropagation(); 586 var d = z(ea.move, document.documentElement, G, { 587 startCalcPoint: a.calcPoint, 588 baseSize: y(), 589 pageOffset: a.pageOffset, 590 handleNumbers: b.handleNumbers, 591 buttonsProperty: a.buttons, 592 locations: ga.slice() 593 }), f = z(ea.end, document.documentElement, H, {handleNumbers: b.handleNumbers}), 594 g = z("mouseout", document.documentElement, F, {handleNumbers: b.handleNumbers}); 595 if (document.documentElement.atkpnoUiListeners = d.concat(f, g), a.cursor) { 596 document.body.style.cursor = getComputedStyle(a.target).cursor, ba.length > 1 && j(fa, e.cssClasses.drag); 597 var h = function () { 598 return !1 599 }; 600 document.body.atkpnoUiListener = h, document.body.addEventListener("selectstart", h, !1) 601 } 602 b.handleNumbers.forEach(function (a) { 603 E("start", a) 604 }) 605 } 606 607 function J(a) { 608 a.stopPropagation(); 609 var b = B(a.calcPoint), c = C(b); 610 return c !== !1 && (e.events.snap || f(fa, e.cssClasses.tap, e.animationDuration), R(c, b, !0, !0), P(), E("slide", c, !0), E("set", c, !0), E("change", c, !0), E("update", c, !0), void(e.events.snap && I(a, {handleNumbers: [c]}))) 611 } 612 613 function K(a) { 614 var b = B(a.calcPoint), c = ia.getStep(b), d = ia.fromStepping(c); 615 Object.keys(ka).forEach(function (a) { 616 "hover" === a.split(".")[0] && ka[a].forEach(function (a) { 617 a.call(da, d) 618 }) 619 }) 620 } 621 622 function L(a) { 623 a.fixed || ba.forEach(function (a, b) { 624 z(ea.start, a.children[0], I, {handleNumbers: [b]}) 625 }), a.tap && z(ea.start, aa, J, {}), a.hover && z(ea.move, aa, K, {hover: !0}), a.drag && ca.forEach(function (b, c) { 626 if (b !== !1 && 0 !== c && c !== ca.length - 1) { 627 var d = ba[c - 1], f = ba[c], g = [b]; 628 j(b, e.cssClasses.draggable), a.fixed && (g.push(d.children[0]), g.push(f.children[0])), g.forEach(function (a) { 629 z(ea.start, a, I, {handles: [d, f], handleNumbers: [c - 1, c]}) 630 }) 631 } 632 }) 633 } 634 635 function M(a, b, c, d, f) { 636 return ba.length > 1 && (d && b > 0 && (c = Math.max(c, a[b - 1] + e.margin)), f && b < ba.length - 1 && (c = Math.min(c, a[b + 1] - e.margin))), ba.length > 1 && e.limit && (d && b > 0 && (c = Math.min(c, a[b - 1] + e.limit)), f && b < ba.length - 1 && (c = Math.max(c, a[b + 1] - e.limit))), c = ia.getStep(c), c = g(c), c !== a[b] && c 637 } 638 639 function N(a) { 640 return a + "%" 641 } 642 643 function O(a, b) { 644 ga[a] = b, ja[a] = ia.fromStepping(b); 645 var c = function () { 646 ba[a].style[e.style] = N(b), S(a), S(a + 1) 647 }; 648 window.requestAnimationFrame && e.useRequestAnimationFrame ? window.requestAnimationFrame(c) : c() 649 } 650 651 function P() {
652 ha.forEach(function (a) { 653 var b = ga[a] > 50 ? -1 : 1, c = 3 + (ba.length + b * a); 654 ba[a].childNodes[0].style.zIndex = c 655 }) 656 } 657 658 function R(a, b, c, d) { 659 return b = M(ga, a, b, c, d), b !== !1 && (O(a, b), !0) 660 } 661 662 function S(a) { 663 if (ca[a]) { 664 var b = 0, c = 100; 665 0 !== a && (b = ga[a - 1]), a !== ca.length - 1 && (c = ga[a]), ca[a].style[e.style] = N(b), ca[a].style[e.styleOposite] = N(100 - c) 666 } 667 } 668 669 function T(a, b) { 670 null !== a && a !== !1 && ("number" == typeof a && (a = String(a)), a = e.format.from(a), a === !1 || isNaN(a) || R(b, ia.toStepping(a), !1, !1)) 671 } 672 673 function U(a, b) { 674 var c = h(a), d = void 0 === ga[0]; 675 b = void 0 === b || !!b, c.forEach(T), e.animate && !d && f(fa, e.cssClasses.tap, e.animationDuration), ha.forEach(function (a) { 676 R(a, ga[a], !0, !1) 677 }), P(), ha.forEach(function (a) { 678 E("update", a), null !== c[a] && b && E("set", a) 679 }) 680 } 681 682 function V(a) { 683 U(e.start, a) 684 } 685 686 function W() { 687 var a = ja.map(e.format.to); 688 return 1 === a.length ? a[0] : a 689 } 690 691 function X() { 692 for (var a in e.cssClasses) e.cssClasses.hasOwnProperty(a) && k(fa, e.cssClasses[a]); 693 for (; fa.firstChild;) fa.removeChild(fa.firstChild); 694 delete fa.atkpnoUiSlider 695 } 696 697 function Y() { 698 return ga.map(function (a, b) { 699 var c = ia.getNearbySteps(a), d = ja[b], e = c.thisStep.step, f = null; 700 e !== !1 && d + e > c.stepAfter.startValue && (e = c.stepAfter.startValue - d), f = d > c.thisStep.startValue ? c.thisStep.step : c.stepBefore.step !== !1 && d - c.stepBefore.highestStep, 100 === a ? e = null : 0 === a && (f = null); 701 var g = ia.countStepDecimals(); 702 return null !== e && e !== !1 && (e = Number(e.toFixed(g))), null !== f && f !== !1 && (f = Number(f.toFixed(g))), [f, e] 703 }) 704 } 705 706 function Z(a, b) { 707 ka[a] = ka[a] || [], ka[a].push(b), "update" === a.split(".")[0] && ba.forEach(function (a, b) { 708 E("update", b) 709 }) 710 } 711 712 function $(a) { 713 var b = a && a.split(".")[0], c = b && a.substring(b.length); 714 Object.keys(ka).forEach(function (a) { 715 var d = a.split(".")[0], e = a.substring(d.length); 716 b && b !== d || c && c !== e || delete ka[a] 717 }) 718 } 719 720 function _(a, b) { 721 var c = W(), d = ["margin", "limit", "range", "animate", "snap", "step", "format"]; 722 d.forEach(function (b) { 723 void 0 !== a[b] && (i[b] = a[b]) 724 }); 725 var f = Q(i); 726 d.forEach(function (b) { 727 void 0 !== a[b] && (e[b] = f[b]) 728 }), f.spectrum.direction = ia.direction, ia = f.spectrum, e.margin = f.margin, e.limit = f.limit, ga = [], U(a.start || c, b) 729 } 730 731 var aa, ba, ca, da, ea = n(), fa = c, ga = [], ha = [], ia = e.spectrum, ja = [], ka = {}; 732 if (fa.atkpnoUiSlider) throw new Error("Slider was already initialized."); 733 return r(fa), q(e.connect, aa), da = { 734 destroy: X, 735 steps: Y, 736 on: Z, 737 off: $, 738 get: W, 739 set: U, 740 reset: V, 741 __moveHandles: function (a, b, c) { 742 D(a, b, ga, c) 743 }, 744 options: i, 745 updateOptions: _, 746 target: fa, 747 pips: x 748 }, L(e.events), U(e.start), e.pips && x(e.pips), e.tooltips && t(), da 749 } 750 751 function S(a, b) { 752 if (!a.nodeName) throw new Error("atkpnoUiSlider.create requires a single element."); 753 var c = Q(b, a), d = R(a, c, b); 754 return a.atkpnoUiSlider = d, d 755 } 756 757 y.prototype.getMargin = function (a) { 758 var b = this.xNumSteps[0]; 759 if (b && a % b) throw new Error("atkpnoUiSlider: 'limit' and 'margin' must be divisible by step."); 760 return 2 === this.xPct.length && p(this.xVal, a) 761 }, y.prototype.toStepping = function (a) { 762 return a = t(this.xVal, this.xPct, a) 763 }, y.prototype.fromStepping = function (a) { 764 return u(this.xVal, this.xPct, a) 765 }, y.prototype.getStep = function (a) { 766 return a = v(this.xPct, this.xSteps, this.snap, a) 767 }, y.prototype.getNearbySteps = function (a) { 768 var b = s(a, this.xPct); 769 return { 770 stepBefore: { 771 startValue: this.xVal[b - 2], 772 step: this.xNumSteps[b - 2],
773 highestStep: this.xHighestCompleteStep[b - 2] 774 }, 775 thisStep: { 776 startValue: this.xVal[b - 1], 777 step: this.xNumSteps[b - 1], 778 highestStep: this.xHighestCompleteStep[b - 1] 779 }, 780 stepAfter: { 781 startValue: this.xVal[b - 0], 782 step: this.xNumSteps[b - 0], 783 highestStep: this.xHighestCompleteStep[b - 0] 784 } 785 } 786 }, y.prototype.countStepDecimals = function () { 787 var a = this.xNumSteps.map(i); 788 return Math.max.apply(null, a) 789 }, y.prototype.convert = function (a) { 790 return this.getStep(this.toStepping(a)) 791 }; 792 var T = { 793 to: function (a) { 794 return void 0 !== a && a.toFixed(2) 795 }, from: Number 796 }; 797 return {create: S} 798}); 799 800 801 802 803 804/* atkp carousel */ 805 806 807jQuery(document).ready(function () { 808 809 var CONSTANTS = { 810 productMinWidth: 185, 811 productMargin: 20 812 }; 813 814 var $adUnits = jQuery('.atkp-product-carousel-unit'); 815 $adUnits.each(function () { 816 817 var $adUnit = jQuery(this), 818 dataid = $adUnit.data('uid'), 819 $wrapper = $adUnit.find('.atkp-pc-wrapper-'+dataid), 820 $productContainer = $adUnit.find('.atkp-pc-product-container-'+dataid), 821 $btnNext = $adUnit.find('.atkp-pc-btn-next-'+dataid), 822 $btnPrev = $adUnit.find('.atkp-pc-btn-prev-'+dataid), 823 824 $productList = $productContainer.find('.atkp-pc-product-list-'+dataid), 825 $products = $productList.find('.atkp-pc-product-'+dataid), 826 productCount = $products.length; 827 828 if (!productCount) { 829 return true; 830 } 831 if ($adUnit.data('productminwidth') != null) 832 CONSTANTS.productMinWidth = $adUnit.data('productminwidth'); 833 if ($adUnit.data('productmargin') != null) 834 CONSTANTS.productMargin = $adUnit.data('productmargin'); 835 836 var rows = $adUnit.find('input[name=rows]').length && parseInt($adUnit.find('input[name=rows]').val(), 10); 837 var columns = $adUnit.find('input[name=columns]').length && parseInt($adUnit.find('input[name=columns]').val(), 10); 838 839 if (columns) { 840 var productContainerMinWidth = columns * (CONSTANTS.productMinWidth + CONSTANTS.productMargin) + 'px'; 841 $adUnit.css('min-width', productContainerMinWidth); 842 $productContainer.css('min-width', productContainerMinWidth); 843 $products.filter(':nth-child(' + columns + 'n + 1)').css('clear', 'both'); 844 } 845 846 if (rows && columns) { 847 var cutOffIndex = (rows * columns) - 1; 848 $products.filter(':gt(' + cutOffIndex + ')').remove(); 849 } 850 851 function updateLayout() { 852 var wrapperWidth = $wrapper.width(); 853 var possibleColumns = columns || parseInt(wrapperWidth / (CONSTANTS.productMinWidth + CONSTANTS.productMargin), 10); 854 var actualColumns = columns || possibleColumns < productCount ? possibleColumns : productCount; 855 856 /** 857 * The actual columns can be zero when the wraperwidth is less than sum of CONSTANTS.productMinWidth and 858 * CONSTANTS.productMargin.The parseInt will use floor function and converts any value less than 1 to 859 * zero.Therefore making actual columns 1 . 860 **/ 861 if (actualColumns == 0) { 862 actualColumns = 1; 863 } 864 865 var productWidth = parseInt(wrapperWidth / actualColumns, 10) - CONSTANTS.productMargin; 866 867 $products.css('width', productWidth + 'px'); 868 869 /** 870 * Removing the Carousel navigation button when the number of products selected by admin is less 871 * than the actual columns (the number of products) can be shown on screen 872 **/ 873 if (productCount > actualColumns) { 874 $btnNext.css('visibility', 'visible').removeClass('disabled').unbind('click'); 875 $btnPrev.css('visibility', 'visible').removeClass('disabled').unbind('click'); 876 }
877 $productContainer.jCarouselLite({ 878 containerSelector: '.atkp-pc-product-list', 879 itemSelector: '.atkp-pc-product', 880 btnNext: '#' + $adUnit.attr('id') + ' .atkp-pc-btn-next-'+dataid, 881 btnPrev: '#' + $adUnit.attr('id') + ' .atkp-pc-btn-prev-'+dataid, 882 visible: actualColumns, 883 circular: true, 884 responsive: true 885 }); 886 887 888 } 889 890 updateLayout(); 891 jQuery(window).resize(updateLayout); 892 }); 893}); 894 895/*! 896 * jCarousel Lite - v1.9.3 - 2015-02-16 897 * http://kswedberg.github.com/jquery-carousel-lite/ 898 * Copyright (c) 2015 Karl Swedberg 899 * based on the original by Ganeshji Marwaha (gmarwaha.com) 900 * Licensed MIT (http://kswedberg.github.com/jquery-carousel-lite/blob/master/LICENSE-MIT) 901 */ 902 903 904(function ($) { 905 $.jCarouselLite = { 906 version: '1.9.3', 907 curr: 0 908 }; 909 910 $.fn.anim = typeof $.fn.velocity !== 'undefined' ? $.fn.velocity : $.fn.animate; 911 912 $.fn.jCarouselLite = function (options) { 913 var o = $.extend(true, {}, $.fn.jCarouselLite.defaults, options), 914 ceil = Math.ceil, 915 mabs = Math.abs; 916 917 this.each(function () { 918 919 var beforeCirc, afterCirc, pageNav, pageNavCount, resize, 920 li, itemLength, curr, 921 prepResize, touchEvents, $btnsGo, 922 isTouch = 'ontouchend' in document, 923 styles = {div: {}, ul: {}, li: {}}, 924 // firstCss = true, 925 running = false, 926 animCss = o.vertical ? 'top' : 'left', 927 aniProps = {}, 928 sizeProp = o.vertical ? 'height' : 'width', 929 outerMethod = o.vertical ? 'outerHeight' : 'outerWidth', 930 self = this, 931 div = $(this), 932 ul = div.find(o.containerSelector).eq(0), 933 tLi = ul.children(o.itemSelector), 934 tl = tLi.length, 935 visibleNum = o.visible, 936 // need visibleCeil and visibleFloor in case we want a fractional number of visible items at a time 937 visibleCeil = ceil(visibleNum), 938 visibleFloor = Math.floor(visibleNum), 939 start = Math.min(o.start, tl - 1), 940 direction = 1, 941 activeBtnOffset = 0, 942 activeBtnTypes = {}, 943 startTouch = {}, 944 endTouch = {}, 945 axisPrimary = o.vertical ? 'y' : 'x', 946 axisSecondary = o.vertical ? 'x' : 'y'; 947 948 949 var init = o.init.call(this, o, tLi); 950 // bail out for this carousel if the o.init() callback returns `false` 951 if (init === false) { 952 return; 953 } 954 955 var makeCircular = function () { 956 if (beforeCirc && beforeCirc.length) { 957 beforeCirc.remove(); 958 afterCirc.remove(); 959 } 960 tLi = ul.children(o.liSelector); 961 tl = tLi.length; 962 beforeCirc = tLi.slice(tl - visibleCeil).clone(true).each(fixIds); 963 afterCirc = tLi.slice(0, visibleCeil).clone(true).each(fixIds); 964 ul.prepend(beforeCirc) 965 .append(afterCirc); 966 li = ul.children(o.liSelector); 967 itemLength = li.length; 968 }; 969 970 div.data('dirjc', direction); 971 div.data(animCss + 'jc', div.css(animCss)); 972 973 if (o.circular) { 974 975 makeCircular(); 976 start += visibleCeil; 977 activeBtnOffset = visibleCeil; 978 979 } else { 980 li = ul.children(o.liSelector); 981 itemLength = li.length; 982 } 983 984 if (o.btnGo && o.btnGo.length) { 985 986 if ($.isArray(o.btnGo) && typeof o.btnGo[0] === 'string') { 987 $btnsGo = $(o.btnGo.join()); 988 } else { 989 $btnsGo = $(o.btnGo); 990 } 991 992 $btnsGo.each(function (i) { 993 $(this).bind('click.jc', function (event) { 994 event.preventDefault(); 995 var btnInfo = { 996 btnGo: this, 997 btnGoIndex: i 998 }; 999 return go(o.circular ? visibleNum + i : i, btnInfo); 1000 }); 1001 }); 1002 activeBtnTypes.go = 1; 1003 } 1004 1005 var setActive = function (i, types) { 1006 i = ceil(i); 1007 1008 // Set active class on the appropriate carousel item 1009 li.filter('.' + o.activeClass).removeClass(o.activeClass); 1010 li.eq(i).addClass(o.activeClass); 1011 1012 var activeBtnIndex = (i - activeBtnOffset) % tl, 1013 visEnd = activeBtnIndex + visibleFloor; 1014 1015 if (types.go) { 1016 // remove active and visible classes from all the go buttons 1017 $btnsGo.removeClass(o.activeClass).removeClass(o.visibleClass); 1018 // add active class to the go button corresponding to the first visible slide 1019 $btnsGo.eq(activeBtnIndex).addClass(o.activeClass); 1020 // add visible class to go buttons corresponding to all visible slides 1021 $btnsGo.slice(activeBtnIndex, activeBtnIndex + visibleFloor).addClass(o.visibleClass); 1022 1023 if (visEnd > $btnsGo.length) { 1024 $btnsGo.slice(0, visEnd - $btnsGo.length).addClass(o.visibleClass); 1025 } 1026 } 1027 1028 if (types.pager) { 1029 pageNav.removeClass(o.activeClass); 1030 pageNav.eq(ceil(activeBtnIndex / visibleNum)).addClass(o.activeClass); 1031 } 1032 return activeBtnIndex; 1033 }; 1034 1035 curr = start; 1036
1037 $.jCarouselLite.curr = curr; 1038 1039 var getDimensions = function (reset) { 1040 var liSize, ulSize, divSize; 1041 1042 if (reset) { 1043 1044 styles.div[sizeProp] = ''; 1045 styles.li = { 1046 width: '', 1047 height: '' 1048 }; 1049 // bail out with the reset styles 1050 return styles; 1051 } 1052 1053 // Full li size(incl margin)-Used for animation 1054 liSize = li[outerMethod](true); 1055 1056 // size of full ul(total length, not just for the visible items) 1057 ulSize = liSize * itemLength; 1058 1059 // size of entire div(total length for just the visible items) 1060 divSize = liSize * visibleNum; 1061 1062 styles.div[sizeProp] = divSize + 'px'; 1063 styles.ul[sizeProp] = ulSize + 'px'; 1064 styles.ul[animCss] = -(curr * liSize) + 'px'; 1065 styles.li = { 1066 width: li.width(), 1067 height: li.height() 1068 }; 1069 styles.liSize = liSize; 1070 return styles; 1071 }; 1072 1073 1074 var setDimensions = function (reset) { 1075 var css, tmpDivSize; 1076 var prelimCss = { 1077 div: {visibility: 'visible', position: 'relative', zIndex: 2, left: '0'}, 1078 ul: {margin: '0', padding: '0', position: 'relative', listStyleType: 'none', zIndex: 1}, 1079 li: {overflow: o.vertical ? 'hidden' : 'visible', 'float': o.vertical ? 'none' : 'left'} 1080 }; 1081 1082 if (reset) { 1083 css = getDimensions(true); 1084 div.css(css.div); 1085 ul.css(css.ul); 1086 li.css(css.li); 1087 } 1088 1089 css = getDimensions(); 1090 1091 if (o.autoCSS) { 1092 $.extend(true, css, prelimCss); 1093 // firstCss = false; 1094 } 1095 1096 if (o.autoWidth) { 1097 tmpDivSize = parseInt(div.css(sizeProp), 10); 1098 styles.liSize = tmpDivSize / o.visible; 1099 css.li[sizeProp] = styles.liSize - (li[outerMethod](true) - parseInt(li.css(sizeProp), 10)); 1100 1101 // Need to adjust other settings to fit with li width 1102 css.ul[sizeProp] = (styles.liSize * itemLength) + 'px'; 1103 css.ul[animCss] = -(curr * styles.liSize) + 'px'; 1104 css.div[sizeProp] = tmpDivSize; 1105 } 1106 1107 if (o.autoCSS) { 1108 li.css(css.li); 1109 ul.css(css.ul); 1110 div.css(css.div); 1111 } 1112 }; 1113 1114 setDimensions(); 1115 1116 // set up timed advancer 1117 var advanceCounter = 0, 1118 autoStop = iterations(tl, o), 1119 autoScrollBy = typeof o.auto === 'number' ? o.auto : o.scroll; 1120 1121 var advancer = function () { 1122 self.setAutoAdvance = setTimeout(function () { 1123 1124 if (!autoStop || autoStop > advanceCounter) { 1125 direction = div.data('dirjc'); 1126 go(curr + (direction * autoScrollBy), {auto: true}); 1127 advanceCounter++; 1128 advancer(); 1129 } 1130 }, o.timeout); 1131 }; 1132 1133 // bind click handlers to prev and next buttons, if set 1134 $.each(['btnPrev', 'btnNext'], function (index, btn) { 1135 if (o[btn]) { 1136 o['$' + btn] = $.isFunction(o[btn]) ? o[btn].call(div[0]) : $(o[btn]); 1137 o['$' + btn].bind('click.jc', function (event) { 1138 event.preventDefault(); 1139 var step = index === 0 ? curr - o.scroll : curr + o.scroll; 1140 if (o.directional) { 1141 // set direction of subsequent scrolls to: 1142 // 1 if "btnNext" clicked 1143 // -1 if "btnPrev" clicked 1144 div.data('dirjc', (index ? 1 : -1)); 1145 } 1146 return go(step); 1147 }); 1148 } 1149 }); 1150 1151 if (!o.circular) { 1152 if (o.btnPrev && start === 0) {
1153 o.$btnPrev.addClass(o.btnDisabledClass); 1154 } 1155 1156 if (o.btnNext && start + visibleFloor >= itemLength) { 1157 o.$btnNext.addClass(o.btnDisabledClass); 1158 } 1159 } 1160 1161 if (o.autoPager) { 1162 pageNavCount = ceil(tl / visibleNum); 1163 pageNav = []; 1164 for (var i = 0; i < pageNavCount; i++) { 1165 pageNav.push('<li><a href="#">' + (i + 1) + '</a></li>'); 1166 } 1167 if (pageNav.length > 1) { 1168 pageNav = $('<ul>' + pageNav.join('') + '</ul>').appendTo(o.autoPager).find('li'); 1169 pageNav.find('a').each(function (i) { 1170 $(this).bind('click.jc', function (event) { 1171 event.preventDefault(); 1172 var slide = i * visibleNum; 1173 if (o.circular) { 1174 slide += visibleNum; 1175 } 1176 return go(slide); 1177 }); 1178 }); 1179 activeBtnTypes.pager = 1; 1180 } 1181 } 1182 1183 // set the active class on the btn corresponding to the "start" li
1184 setActive(start, activeBtnTypes); 1185 1186 if (o.mouseWheel && div.mousewheel) { 1187 div.bind('mousewheel.jc', function (e, d) { 1188 return d > 0 ? go(curr - o.scroll) : go(curr + o.scroll); 1189 }); 1190 } 1191 1192 if (o.pause && o.auto && !isTouch) { 1193 div.bind('mouseenter.jc', function () { 1194 div.trigger('pauseCarousel.jc'); 1195 }).bind('mouseleave.jc', function () { 1196 div.trigger('resumeCarousel.jc'); 1197 }); 1198 } 1199 1200 if (o.auto) { 1201 advancer(); 1202 } 1203 1204 function vis() { 1205 return li.slice(curr).slice(0, visibleCeil); 1206 } 1207 1208 $.jCarouselLite.vis = vis; 1209 1210 function go(to, settings) { 1211 if (running) { 1212 return false; 1213 } 1214 settings = settings || {}; 1215 var prev = curr, 1216 direction = to > curr, 1217 speed = typeof settings.speed !== 'undefined' ? settings.speed : o.speed, 1218 // offset appears if touch moves slides 1219 offset = settings.offset || 0; 1220 1221 if (o.beforeStart) { 1222 o.beforeStart.call(div, vis(), direction, settings); 1223 } 1224 1225 // If circular and we are in first or last, then go to the other end 1226 if (o.circular) { 1227 if (to > curr && to > itemLength - visibleCeil) { 1228 1229 // temporarily set "to" as the difference 1230 to = to - curr; 1231 curr = curr % tl; 1232 1233 // use the difference to make "to" correct relative to curr 1234 to = curr + to; 1235 ul.css(animCss, (-curr * styles.liSize) - offset); 1236 } else if (to < curr && to < 0) { 1237 curr += tl; 1238 to += tl; 1239 ul.css(animCss, (-curr * styles.liSize) - offset); 1240 } 1241 1242 curr = to + (to % 1); 1243 1244 // If non-circular and "to" points beyond first or last, we change to first or last. 1245 } else { 1246 if (to < 0) { 1247 to = 0; 1248 } else if (to > itemLength - visibleFloor) { 1249 to = itemLength - visibleFloor; 1250 } 1251 1252 curr = to; 1253 1254 if (curr === 0 && o.first) { 1255 o.first.call(this, vis(), direction); 1256 } 1257 1258 if (curr === itemLength - visibleFloor && o.last) { 1259 o.last.call(this, vis(), direction); 1260 } 1261 1262 // Disable buttons when the carousel reaches the last/first, and enable when not 1263 if (o.btnPrev) { 1264 o.$btnPrev.toggleClass(o.btnDisabledClass, curr === 0); 1265 } 1266 if (o.btnNext) { 1267 o.$btnNext.toggleClass(o.btnDisabledClass, curr === itemLength - visibleFloor); 1268 } 1269 } 1270 1271 // if btnGo, set the active class on the btnGo element corresponding to the first visible carousel li 1272 // if autoPager, set active class on the appropriate autopager element
1273 setActive(curr, activeBtnTypes); 1274 1275 $.jCarouselLite.curr = curr; 1276 1277 if (prev === curr && !settings.force) { 1278 if (o.afterEnd) { 1279 o.afterEnd.call(div, vis(), direction, settings); 1280 } 1281 return curr; 1282 } 1283 1284 running = true; 1285 1286 aniProps[animCss] = -(curr * styles.liSize); 1287 ul.anim(aniProps, speed, o.easing, function () { 1288 if (o.afterEnd) { 1289 o.afterEnd.call(div, vis(), direction, settings); 1290 } 1291 running = false; 1292 }); 1293 1294 return curr; 1295 } // end go function 1296 1297 // bind custom events so they can be triggered by user 1298 div 1299 .bind('go.jc', function (e, to, settings) { 1300 1301 if (typeof to === 'undefined') { 1302 to = '+=1'; 1303 } 1304 1305 var todir = typeof to === 'string' && /(\+=|-=)(\d+)/.exec(to); 1306 1307 if (todir) { 1308 to = todir[1] === '-=' ? curr - todir[2] * 1 : curr + todir[2] * 1; 1309 } else { 1310 to += start; 1311 } 1312 go(to, settings); 1313 }) 1314 .bind('startCarousel.jc', function () { 1315 clearTimeout(self.setAutoAdvance); 1316 self.setAutoAdvance = undefined; 1317 div.trigger('go', '+=' + o.scroll); 1318 advancer(); 1319 div.removeData('pausedjc').removeData('stoppedjc'); 1320 }) 1321 .bind('resumeCarousel.jc', function (event, forceRun) { 1322 if (self.setAutoAdvance) { 1323 return; 1324 } 1325 clearTimeout(self.setAutoAdvance); 1326 self.setAutoAdvance = undefined; 1327 1328 var stopped = div.data('stoppedjc'); 1329 if (forceRun || !stopped) { 1330 advancer(); 1331 div.removeData('pausedjc'); 1332 if (stopped) { 1333 div.removeData('stoppedjc'); 1334 } 1335 } 1336 }) 1337 1338 .bind('pauseCarousel.jc', function () { 1339 clearTimeout(self.setAutoAdvance); 1340 self.setAutoAdvance = undefined; 1341 div.data('pausedjc', true); 1342 }) 1343 .bind('stopCarousel.jc', function () { 1344 clearTimeout(self.setAutoAdvance); 1345 self.setAutoAdvance = undefined; 1346 1347 div.data('stoppedjc', true); 1348 }) 1349 1350 .bind('refreshCarousel.jc', function (event, all) { 1351 if (all && o.circular) { 1352 makeCircular(); 1353 } 1354 setDimensions(o.autoCSS); 1355 }) 1356 1357 .bind('endCarousel.jc', function () { 1358 if (self.setAutoAdvance) { 1359 clearTimeout(self.setAutoAdvance); 1360 self.setAutoAdvance = undefined; 1361 } 1362 if (o.btnPrev) { 1363 o.$btnPrev.addClass(o.btnDisabledClass).unbind('.jc'); 1364 } 1365 if (o.btnNext) { 1366 o.$btnNext.addClass(o.btnDisabledClass).unbind('.jc'); 1367 } 1368 if (o.btnGo) { 1369 $.each(o.btnGo, function (i, val) { 1370 $(val).unbind('.jc'); 1371 }); 1372 } 1373 1374 if (o.circular) { 1375 li.slice(0, visibleCeil).remove(); 1376 li.slice(-visibleCeil).remove(); 1377 } 1378 $.each([animCss + 'jc', 'pausedjc', 'stoppedjc', 'dirjc'], function (i, d) { 1379 div.removeData(d); 1380 }); 1381 div.unbind('.jc'); 1382 }); 1383 1384 // touch gesture support 1385 1386 touchEvents = { 1387 touchstart: function (event) { 1388 endTouch.x = 0; 1389 endTouch.y = 0; 1390 startTouch.x = event.targetTouches[0].pageX; 1391 startTouch.y = event.targetTouches[0].pageY; 1392 startTouch[animCss] = parseFloat(ul.css(animCss)); 1393 startTouch.time = +new Date(); 1394 }, 1395 1396 touchmove: function (event) { 1397 var tlength = event.targetTouches.length; 1398 1399 if (tlength === 1) { 1400 endTouch.x = event.targetTouches[0].pageX; 1401 endTouch.y = event.targetTouches[0].pageY; 1402 aniProps[animCss] = startTouch[animCss] + (endTouch[axisPrimary] - startTouch[axisPrimary]); 1403 ul.css(aniProps); 1404 if (o.preventTouchWindowScroll) { 1405 event.preventDefault(); 1406 } 1407 } else { 1408 endTouch.x = startTouch.x; 1409 endTouch.y = startTouch.y; 1410 } 1411 }, 1412 1413 touchend: function () { 1414 // bail out early if there is no touch movement 1415 if (!endTouch.x) { 1416 return; 1417 } 1418 1419 var pxDelta = startTouch[axisPrimary] - endTouch[axisPrimary], 1420 pxAbsDelta = mabs(pxDelta), 1421 primaryAxisGood = pxAbsDelta > o.swipeThresholds[axisPrimary], 1422 secondaryAxisGood = mabs(startTouch[axisSecondary] - endTouch[axisSecondary]) < o.swipeThresholds[axisSecondary], 1423 timeDelta = +new Date() - startTouch.time, 1424 quickSwipe = timeDelta < o.swipeThresholds.time, 1425 operator = pxDelta > 0 ? '+=' : '-=', 1426 to = operator + o.scroll, 1427 swipeInfo = {force: true}; 1428 1429 // quick, clean swipe 1430 if (quickSwipe && primaryAxisGood && secondaryAxisGood
1430) { 1431 // set animation speed to twice as fast as that set in speed option 1432 swipeInfo.speed = o.speed / 2; 1433 } else 1434 // slow swipe < 1/2 slide width, OR 1435 // not enough movement for swipe, OR 1436 // too much movement on secondary axis when quick swipe 1437 if ((!quickSwipe && pxAbsDelta < styles.liSize / 2) || 1438 !primaryAxisGood || 1439 (quickSwipe && !secondaryAxisGood) 1440 ) { 1441 // revert to same slide 1442 to = '+=0'; 1443 } else 1444 // slow swipe > 1/2 slide width 1445 if (!quickSwipe && pxAbsDelta > styles.liSize / 2) { 1446 to = Math.round(pxAbsDelta / styles.liSize); 1447 to = operator + (to > o.visible ? o.visible : to); 1448 1449 // send pxDelta along as offset in case carousel is circular and needs to reset 1450 swipeInfo.offset = pxDelta; 1451 } 1452 1453 div.trigger('go.jc', [to, swipeInfo]); 1454 endTouch = {}; 1455 }, 1456 1457 handle: function (event) { 1458 event = event.originalEvent; 1459 touchEvents[event.type](event); 1460 } 1461 }; 1462 1463 if (isTouch && o.swipe) { 1464 div.bind('touchstart.jc touchmove.jc touchend.jc', touchEvents.handle); 1465 } // end swipe events 1466 1467 // Responsive design handling: 1468 // Reset dimensions on window.resize 1469 if (o.responsive) { 1470 prepResize = o.autoCSS; 1471 $(window).bind('resize', function () { 1472 if (prepResize) { 1473 ul.width(ul.width() * 2); 1474 prepResize = false; 1475 } 1476 1477 clearTimeout(resize); 1478 resize = setTimeout(function () { 1479 div.trigger('refreshCarousel.jc', [true]); 1480 prepResize = o.autoCSS; 1481 }, 100); 1482 }); 1483 } 1484 1485 }); // end each 1486 1487 return this; 1488 }; 1489 1490 $.fn.jCarouselLite.defaults = { 1491 1492 // valid selector for the "ul" container containing the slides 1493 containerSelector: 'ul', 1494 1495 // valid selector for the slide "li" items 1496 itemSelector: 'li', 1497 1498 btnPrev: null, 1499 btnNext: null, 1500 1501 // array (or jQuery object) of elements. When clicked, makes the corresponding carousel LI the first visible one 1502 btnGo: null, 1503 1504 // selector (or jQuery object) indicating the containing element for pagination navigation. 1505 autoPager: null, 1506 btnDisabledClass: 'disabled', 1507 1508 // class applied to the active slide and btnGo element 1509 activeClass: 'active', 1510 1511 // class applied to the btnGo elements corresponding to the visible slides 1512 visibleClass: 'vis', 1513 mouseWheel: false, 1514 speed: 200, 1515 easing: null, 1516 1517 // milliseconds between scrolls 1518 timeout: 4000, 1519 1520 // true to enable auto scrolling; number to auto-scroll by different number at a time than that of scroll option 1521 auto: false, 1522 1523 1524 // true to enable changing direction of auto scrolling when user clicks prev or next button 1525 directional: false, 1526 1527 // number of times before autoscrolling will stop. (if circular is false, won't iterate more than number of items) 1528 autoStop: false, 1529 1530 // pause scrolling on hover 1531 pause: true, 1532 vertical: false, 1533 1534 // continue scrolling when reach the last item 1535 circular: true, 1536 1537 // the number to be visible at a given time. 1538 visible: 3, 1539 1540 // index of item to show initially in the first posiition 1541 start: 0, 1542 1543 // number of items to scroll at a time 1544 scroll: 1, 1545 1546 // whether to set initial styles on the carousel elements. See readme for info 1547 autoCSS: true, 1548 1549 // whether the dimensions should change on resize 1550 responsive: false, 1551 1552 // whether to set width of <li>s (and left/top of <ul>) based on width of <div> 1553 autoWidth: false, 1554 1555 // touch options 1556 swipe: true, 1557 swipeThresholds: { 1558 x: 80, 1559 y: 40, 1560 time: 150 1561 }, 1562 1563 // whether to prevent vertical scrolling of the document window when swiping 1564 preventTouchWindowScroll: true, 1565 1566 // Function to be called for each matched carousel when .jCaourselLite() is called. 1567 // Inside the function, `this` is the carousel div. 1568 // The function can take 2 arguments: 1569 // 1. The merged options object
1570 // 2. A jQuery object containing the <li> items in the carousel 1571 // If the function returns `false`, the plugin will skip all the carousel magic for that carousel div 1572 init: function () { 1573 }, 1574 1575 // function to be called once the first slide is hit 1576 first: null, 1577 1578 // function to be called once the last slide is hit 1579 last: null, 1580 1581 // function to be called before each transition starts 1582 beforeStart: null, 1583 1584 // function to be called after each transition ends 1585 afterEnd: null 1586 }; 1587 1588 function iterations(itemLength, options) { 1589 return options.autoStop && (options.circular ? options.autoStop : Math.min(itemLength, options.autoStop)); 1590 } 1591 1592 function fixIds(i) { 1593 if (this.id) { 1594 this.id += i; 1595 } 1596 } 1597})(jQuery); 1598
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.