1/* 2 * Bootstrap Slider 3 */ 4!function (t) { 5 if ("function" == typeof define && define.amd) try { 6 define(["jquery"], t) 7 } catch (i) { 8 define([], t) 9 } else if ("object" == typeof module && module.exports) { 10 var e; 11 try { 12 e = require("jquery") 13 } catch (i) { 14 e = null 15 } 16 module.exports = t(e) 17 } else window && (window.Slider = t(window.jQuery)) 18}(function (t) { 19 var i; 20 return function (t) { 21 "use strict"; 22 23 function i() { 24 } 25 26 function e(t) { 27 function e(i) { 28 i.prototype.option || (i.prototype.option = function (i) { 29 t.isPlainObject(i) && (this.options = t.extend(!0, this.options, i)) 30 }) 31 } 32 33 function o(i, e) { 34 t.fn[i] = function (o) { 35 if ("string" == typeof o) { 36 for (var a = s.call(arguments, 1), h = 0, l = this.length; l > h; h++) { 37 var r = this[h], p = t.data(r, i); 38 if (p) if (t.isFunction(p[o]) && "_" !== o.charAt(0)) { 39 var d = p[o].apply(p, a); 40 if (void 0 !== d && d !== p) return d 41 } else n("no such method '" + o + "' for " + i + " instance"); else n("cannot call methods on " + i + " prior to initialization; attempted to call '" + o + "'") 42 } 43 return this 44 } 45 var c = this.map(function () { 46 var s = t.data(this, i); 47 return s ? (s.option(o), s._init()) : (s = new e(this, o), t.data(this, i, s)), t(this) 48 }); 49 return !c || c.length > 1 ? c : c[0] 50 } 51 } 52 53 if (t) { 54 var n = "undefined" == typeof console ? i : function (t) { 55 console.error(t) 56 }; 57 return t.bridget = function (t, i) { 58 e(i), o(t, i) 59 }, t.bridget 60 } 61 } 62 63 var s = Array.prototype.slice; 64 e(t) 65 }(t), function (t) { 66 function e(i, e) { 67 function s(t, i) { 68 var e = "data-slider-" + i.replace(/_/g, "-"), s = t.getAttribute(e); 69 try { 70 return JSON.parse(s) 71 } catch (o) { 72 return s 73 } 74 } 75 76 this._state = { 77 value: null, 78 enabled: null, 79 offset: null, 80 size: null, 81 percentage: null, 82 inDrag: !1, 83 over: !1 84 }, "string" == typeof i ? this.element = document.querySelector(i) : i instanceof HTMLElement && (this.element = i), e = e ? e : {}; 85 for (var n = Object.keys(this.defaultOptions), a = 0; a < n.length; a++) { 86 var h = n[a], l = e[h]; 87 this._state.atio_element; 88 l = "undefined" != typeof l ? l : s(this.element, h), l = null !== l ? l : this.defaultOptions[h], this.options || (this.options = {}), this.options[h] = l 89 } 90 "vertical" !== this.options.orientation || "top" !== this.options.tooltip_position && "bottom" !== this.options.tooltip_position ? "horizontal" !== this.options.orientation || "left" !== this.options.tooltip_position && "right" !== this.options.tooltip_position || (this.options.tooltip_position = "top") : this.options.tooltip_position = "right"; 91 var r, p, d, c, u, m = this.element.style.width, _ = !1, v = this.element.parentNode; 92 if (this.sliderElem) _ = !0; else { 93 this.sliderElem = document.createElement("div"), this.sliderElem.className = "slider"; 94 var f = document.createElement("div"); 95 f.className = "slider-track", p = document.createElement("div"), p.className = "slider-track-low", r = document.createElement("div"), r.className = "slider-selection", d = document.createElement("div"), d.className = "slider-track-high", c = document.createElement("div"), c.className = "slider-handle min-slider-handle", c.setAttribute("role", "slider"), c.setAttribute("aria-valuemin", this.options.min), c.setAttribute("aria-valuemax", this.options.max), u = document.createElement("div"), u.className = "slider-handle max-slider-handle", u.setAttribute("role", "slider"), u.setAttribute("aria-valuemin", this.options.min), u.setAttribute("aria-valuemax", this.options.max), f.appendChild(p), f.appendChild(r), f.appendChild(d); 96 var g = Array.isArray(this.options.labelledby); 97 if (g && this.options.labelledby[0] && c.setAttribute("aria-labelledby", this.options.labelledby[0]), g && this.options.labelledby[1] && u.setAttribute("aria-labelledby", this.options.labelledby[1]), !g && this.options.labelledby && (c.setAttribute("aria-labelledby", this.options.labelledby), u.setAttribute("aria-labelledby", this.options.labelledby)), this.ticks = [], Array.isArray(this.options.ticks) && this.options.ticks.length > 0) { 98 for (a = 0; a < this.options.ticks.length; a++) { 99 var y = document.createElement("div"); 100 y.className = "slider-tick", this.ticks.push(y), f.appendChild(y) 101 } 102 r.className += " tick-slider-selection" 103 } 104 if (f.appendChild(c), f.appendChild(u), this.tickLabels = [], Array.isArray(this.options.ticks_labels) && this.options.ticks_labels.length > 0) for (this.tickLabelContainer = document.createElement("div"), this.tickLabelContainer.className = "slider-tick-label-container", a = 0; a < this.options.ticks_labels.length; a++) { 105 var b = document.createElement("div"), k = 0 === this.options.ticks_positions.length, 106 E = this.options.reversed && k ? this.options.ticks_labels.length - (a + 1) : a; 107 b.className = "slider-tick-label", b.innerHTML = this.options.ticks_labels[E], this.tickLabels.push(b), this.tickLabelContainer.appendChild(b) 108 } 109 var x = function (t) { 110 var i = document.createElement("div"); 111 i.className = "tooltip-arrow"; 112 var e = document.createElement("div"); 113 e.className = "tooltip-inner", t.appendChild(i), t.appendChild(e) 114 }, C = document.createElement("div"); 115 C.className = "tooltip tooltip-main", C.setAttribute("role", "presentation"), x(C); 116 var w = document.createElement("div"); 117 w.className = "tooltip tooltip-min", w.setAttribute("role", "presentation"), x(w);
vendor: 4,099 bytes, lines 118-130
118 var L = document.createElement("div"); 119 L.className = "tooltip tooltip-max", L.setAttribute("role", "presentation"), x(L), this.sliderElem.appendChild(f), this.sliderElem.appendChild(C), this.sliderElem.appendChild(w), this.sliderElem.appendChild(L), this.tickLabelContainer && this.sliderElem.appendChild(this.tickLabelContainer), v.insertBefore(this.sliderElem, this.element), this.element.style.display = "none" 120 } 121 if (t && (this.$element = t(this.element), this.$sliderElem = t(this.sliderElem)), this.eventToCallbackMap = {}, this.sliderElem.id = this.options.id, this.touchCapable = "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch, this.touchX = 0, this.touchY = 0, this.tooltip = this.sliderElem.querySelector(".tooltip-main"), this.tooltipInner = this.tooltip.querySelector(".tooltip-inner"), this.tooltip_min = this.sliderElem.querySelector(".tooltip-min"), this.tooltipInner_min = this.tooltip_min.querySelector(".tooltip-inner"), this.tooltip_max = this.sliderElem.querySelector(".tooltip-max"), this.tooltipInner_max = this.tooltip_max.querySelector(".tooltip-inner"), o[this.options.scale] && (this.options.scale = o[this.options.scale]), _ === !0 && (this._removeClass(this.sliderElem, "slider-horizontal"), this._removeClass(this.sliderElem, "slider-vertical"), this._removeClass(this.tooltip, "hide"), this._removeClass(this.tooltip_min, "hide"), this._removeClass(this.tooltip_max, "hide"), ["left", "top", "width", "height"].forEach(function (t) { 122 this._removeProperty(this.trackLow, t), this._removeProperty(this.trackSelection, t), this._removeProperty(this.trackHigh, t) 123 }, this), [this.handle1, this.handle2].forEach(function (t) { 124 this._removeProperty(t, "left"), this._removeProperty(t, "top") 125 }, this), [this.tooltip, this.tooltip_min, this.tooltip_max].forEach(function (t) { 126 this._removeProperty(t, "left"), this._removeProperty(t, "top"), this._removeProperty(t, "margin-left"), this._removeProperty(t, "margin-top"), this._removeClass(t, "right"), this._removeClass(t, "top") 127 }, this)), "vertical" === this.options.orientation ? (this._addClass(this.sliderElem, "slider-vertical"), this.stylePos = "top", this.mousePos = "pageY", this.sizePos = "offsetHeight") : (this._addClass(this.sliderElem, "slider-horizontal"), this.sliderElem.style.width = m, this.options.orientation = "horizontal", this.stylePos = "left", this.mousePos = "pageX", this.sizePos = "offsetWidth"), this._setTooltipPosition(), Array.isArray(this.options.ticks) && this.options.ticks.length > 0 && (this.options.max = Math.max.apply(Math, this.options.ticks), this.options.min = Math.min.apply(Math, this.options.ticks)), Array.isArray(this.options.value) ? (this.options.range = !0, this._state.value = this.options.value) : this.options.range ? this._state.value = [this.options.value, this.options.max] : this._state.value = this.options.value, this.trackLow = p || this.trackLow, this.trackSelection = r || this.trackSelection, this.trackHigh = d || this.trackHigh, "none" === this.options.selection && (this._addClass(this.trackLow, "hide"), this._addClass(this.trackSelection, "hide"), this._addClass(this.trackHigh, "hide")), this.handle1 = c || this.handle1, this.handle2 = u || this.handle2, _ === !0) for (this._removeClass(this.handle1, "round triangle"), this._removeClass(this.handle2, "round triangle hide"), a = 0; a < this.ticks.length; a++) this._removeClass(this.ticks[a], "round triangle hide"); 128 var T = ["round", "triangle", "custom"], P = -1 !== T.indexOf(this.options.handle); 129 if (P) for (this._addClass(this.handle1, this.options.handle), this._addClass(this.handle2, this.options.handle), a = 0; a < this.ticks.length; a++) this._addClass(this.ticks[a], this.options.handle); 130 this._state.offset = this._offset(this.sliderElem), this._state.size = this.sliderElem[this.sizePos], this.setValue(this._state.value), this.handle1Keydown = this._key
130down.bind(this, 0), this.handle1.addEventListener("keydown", this.handle1Keydown, !1), this.handle2Keydown = this._keydown.bind(this, 1), this.handle2.addEventListener("keydown", this.handle2Keydown, !1), this.mousedown = this._mousedown.bind(this), this.touchstart = this._touchstart.bind(this), this.touchmove = this._touchmove.bind(this), this.touchCapable && (this.sliderElem.addEventListener("touchstart", this.touchstart, !1), this.sliderElem.addEventListener("touchmove", this.touchmove, !1)), this.sliderElem.addEventListener("mousedown", this.mousedown, !1), this.resize = this._resize.bind(this), window.addEventListener("resize", this.resize, !1), "hide" === this.options.tooltip ? (this._addClass(this.tooltip, "hide"), this._addClass(this.tooltip_min, "hide"), this._addClass(this.tooltip_max, "hide")) : "always" === this.options.tooltip ? (this._showTooltip(), this._alwaysShowTooltip = !0) : (this.showTooltip = this._showTooltip.bind(this), this.hideTooltip = this._hideTooltip.bind(this), this.sliderElem.addEventListener("mouseenter", this.showTooltip, !1), this.sliderElem.addEventListener("mouseleave", this.hideTooltip, !1), this.handle1.addEventListener("focus", this.showTooltip, !1), this.handle1.addEventListener("blur", this.hideTooltip, !1), this.handle2.addEventListener("focus", this.showTooltip, !1), this.handle2.addEventListener("blur", this.hideTooltip, !1)), this.options.enabled ? this.enable() : this.disable() 131 } 132 133 var s = { 134 formatInvalidInputErrorMsg: function (t) { 135 return "Invalid input value '" + t + "' passed in" 136 }, 137 callingContextNotSliderInstance: "Calling context element does not have instance of Slider bound to it. Check your code to make sure the JQuery object returned from the call to the slider() initializer is calling the method" 138 }, o = { 139 linear: { 140 toValue: function (t) { 141 var i = t / 100 * (this.options.max - this.options.min), e = !0; 142 if (this.options.ticks_positions.length > 0) { 143 for (var s, o, n, a = 0, h = 1; h < this.options.ticks_positions.length; h++) if (t <= this.options.ticks_positions[h]) { 144 s = this.options.ticks[h - 1], n = this.options.ticks_positions[h - 1], o = this.options.ticks[h], a = this.options.ticks_positions[h]; 145 break 146 } 147 var l = (t - n) / (a - n); 148 i = s + l * (o - s), e = !1 149 } 150 var r = e ? this.options.min : 0, p = r + Math.round(i / this.options.step) * this.options.step; 151 return p < this.options.min ? this.options.min : p > this.options.max ? this.options.max : p 152 }, toPercentage: function (t) { 153 if (this.options.max === this.options.min) return 0; 154 if (this.options.ticks_positions.length > 0) { 155 for (var i, e, s, o = 0, n = 0; n < this.options.ticks.length; n++) if (t <= this.options.ticks[n]) { 156 i = n > 0 ? this.options.ticks[n - 1] : 0, s = n > 0 ? this.options.ticks_positions[n - 1] : 0, e = this.options.ticks[n], o = this.options.ticks_positions[n]; 157 break 158 } 159 if (n > 0) { 160 var a = (t - i) / (e - i); 161 return s + a * (o - s) 162 } 163 } 164 return 100 * (t - this.options.min) / (this.options.max - this.options.min) 165 } 166 }, logarithmic: { 167 toValue: function (t) { 168 var i = 0 === this.options.min ? 0 : Math.log(this.options.min), e = Math.log(this.options.max), 169 s = Math.exp(i + (e - i) * t / 100); 170 return s = this.options.min + Math.round((s - this.options.min) / this.options.step) * this.options.step, s < this.options.min ? this.options.min : s > this.options.max ? this.options.max : s 171 }, toPercentage: function (t) { 172 if (this.options.max === this.options.min) return 0; 173 var i = Math.log(this.options.max), e = 0 === this.options.min ? 0 : Math.log(this.options.min), 174 s = 0 === t ? 0 : Math.log(t); 175 return 100 * (s - e) / (i - e) 176 } 177 } 178 }; 179 if (i = function (t, i) { 180 return e.call(this, t, i), this 181 }, i.prototype = { 182 _init: function () { 183 }, 184 constructor: i, 185 defaultOptions: { 186 id: "", 187 min: 0, 188 max: 10, 189 step: 1, 190 precision: 0, 191 orientation: "horizontal", 192 value: 5, 193 range: !1, 194 selection: "before", 195 tooltip: "show", 196 tooltip_split: !1, 197 handle: "round", 198 reversed: !1, 199 enabled: !0, 200 formatter: function (t) { 201 return Array.isArray(t) ? t[0] + " : " + t[1] : t 202 }, 203 natural_arrow_keys: !1, 204 ticks: [], 205 ticks_positions: [], 206 ticks_labels: [], 207 ticks_snap_bounds: 0, 208 scale: "linear", 209 focus: !1, 210 tooltip_position: null, 211 labelledby: null, 212 atio: "" 213 }, 214 getElement: function () { 215 return this.sliderElem 216 }, 217 getValue: function () { 218 return this.options.range ? this._state.value : this._state.value[0] 219 }, 220 setValue: function (t, i, e) { 221 t || (t = 0); 222 var s = this.getValue();
vendor: 14,129 bytes, lines 223-344
223 this._state.value = this._validateInputValue(t); 224 var o = this._applyPrecision.bind(this); 225 this.options.range ? (this._state.value[0] = o(this._state.value[0]), this._state.value[1] = o(this._state.value[1]), this._state.value[0] = Math.max(this.options.min, Math.min(this.options.max, this._state.value[0])), this._state.value[1] = Math.max(this.options.min, Math.min(this.options.max, this._state.value[1]))) : (this._state.value = o(this._state.value), this._state.value = [Math.max(this.options.min, Math.min(this.options.max, this._state.value))], this._addClass(this.handle2, "hide"), "after" === this.options.selection ? this._state.value[1] = this.options.max : this._state.value[1] = this.options.min), this.options.max > this.options.min ? this._state.percentage = [this._toPercentage(this._state.value[0]), this._toPercentage(this._state.value[1]), 100 * this.options.step / (this.options.max - this.options.min)] : this._state.percentage = [0, 0, 100], this._layout(); 226 var n = this.options.range ? this._state.value : this._state.value[0]; 227 return this._setDataVal(n), i === !0 && this._trigger("slide", n), s !== n && e === !0 && this._trigger("change", { 228 oldValue: s, 229 newValue: n 230 }), this 231 }, 232 destroy: function () { 233 this._removeSliderEventHandlers(), this.sliderElem.parentNode.removeChild(this.sliderElem), this.element.style.display = "", this._cleanUpEventCallbacksMap(), this.element.removeAttribute("data"), t && (this._unbindJQueryEventHandlers(), this.$element.removeData("slider")) 234 }, 235 disable: function () { 236 return this._state.enabled = !1, this.handle1.removeAttribute("tabindex"), this.handle2.removeAttribute("tabindex"), this._addClass(this.sliderElem, "slider-disabled"), this._trigger("slideDisabled"), this 237 }, 238 enable: function () { 239 return this._state.enabled = !0, this.handle1.setAttribute("tabindex", 0), this.handle2.setAttribute("tabindex", 0), this._removeClass(this.sliderElem, "slider-disabled"), this._trigger("slideEnabled"), this 240 }, 241 toggle: function () { 242 return this._state.enabled ? this.disable() : this.enable(), this 243 }, 244 isEnabled: function () { 245 return this._state.enabled 246 }, 247 on: function (t, i) { 248 return this._bindNonQueryEventHandler(t, i), this 249 }, 250 off: function (i, e) { 251 t ? (this.$element.off(i, e), this.$sliderElem.off(i, e)) : this._unbindNonQueryEventHandler(i, e) 252 }, 253 getAttribute: function (t) { 254 return t ? this.options[t] : this.options 255 }, 256 setAttribute: function (t, i) { 257 return this.options[t] = i, this 258 }, 259 refresh: function () { 260 return this._removeSliderEventHandlers(), e.call(this, this.element, this.options), t && t.data(this.element, "slider", this), this 261 }, 262 relayout: function () { 263 return this._resize(), this._layout(), this 264 }, 265 _removeSliderEventHandlers: function () { 266 this.handle1.removeEventListener("keydown", this.handle1Keydown, !1), this.handle2.removeEventListener("keydown", this.handle2Keydown, !1), this.showTooltip && (this.handle1.removeEventListener("focus", this.showTooltip, !1), this.handle2.removeEventListener("focus", this.showTooltip, !1)), this.hideTooltip && (this.handle1.removeEventListener("blur", this.hideTooltip, !1), this.handle2.removeEventListener("blur", this.hideTooltip, !1)), this.showTooltip && this.sliderElem.removeEventListener("mouseenter", this.showTooltip, !1), this.hideTooltip && this.sliderElem.removeEventListener("mouseleave", this.hideTooltip, !1), this.sliderElem.removeEventListener("touchstart", this.touchstart, !1), this.sliderElem.removeEventListener("touchmove", this.touchmove, !1), this.sliderElem.removeEventListener("mousedown", this.mousedown, !1), window.removeEventListener("resize", this.resize, !1) 267 }, 268 _bindNonQueryEventHandler: function (t, i) { 269 void 0 === this.eventToCallbackMap[t] && (this.eventToCallbackMap[t] = []), this.eventToCallbackMap[t].push(i) 270 }, 271 _unbindNonQueryEventHandler: function (t, i) { 272 var e = this.eventToCallbackMap[t]; 273 if (void 0 !== e) for (var s = 0; s < e.length; s++) if (e[s] === i) { 274 e.splice(s, 1); 275 break 276 } 277 }, 278 _cleanUpEventCallbacksMap: function () { 279 for (var t = Object.keys(this.eventToCallbackMap), i = 0; i < t.length; i++) { 280 var e = t[i]; 281 this.eventToCallbackMap[e] = null 282 } 283 }, 284 _showTooltip: function () { 285 this.options.tooltip_split === !1 ? (this._addClass(this.tooltip, "in"), this.tooltip_min.style.display = "none", this.tooltip_max.style.display = "none") : (this._addClass(this.tooltip_min, "in"), this._addClass(this.tooltip_max, "in"), this.tooltip.style.display = "none"), this._state.over = !0 286 }, 287 _hideTooltip: function () { 288 this._state.inDrag === !1 && this.alwaysShowTooltip !== !0 && (this._removeClass(this.tooltip, "in"), this._removeClass(this.tooltip_min, "in"), this._removeClass(this.tooltip_max, "in")), this._state.over = !1 289 }, 290 _layout: function () { 291 var t; 292 if (t = this.options.reversed ? [100 - this._state.percentage[0], this.options.range ? 100 - this._state.percentage[1] : this._state.percentage[1]] : [this._state.percentage[0], this._state.percentage[1]], this.handle1.style[this.stylePos] = t[0] + "%", this.handle1.setAttribute("aria-valuenow", this._state.value[0]), this.handle2.style[this.stylePos] = t[1] + "%", this.handle2.setAttribute("aria-valuenow", this._state.value[1]), Array.isArray(this.options.ticks) && this.options.ticks.length > 0) { 293 var i = "vertical" === this.options.orientation ? "height" : "width", 294 e = "vertical" === this.options.orientation ? "marginTop" : "marginLeft", 295 s = this._state.size / (this.options.ticks.length - 1); 296 if (this.tickLabelContainer) { 297 var o = 0; 298 if (0 === this.options.ticks_positions.length) "vertical" !== this.options.orientation && (this.tickLabelContainer.style[e] = -s / 2 + "px"), o = this.tickLabelContainer.offsetHeight; else for (n = 0; n < this.tickLabelContainer.childNodes.length; n++) this.tickLabelContainer.childNodes[n].offsetHeight > o && (o = this.tickLabelContainer.childNodes[n].offsetHeight); 299 "horizontal" === this.options.orientation && (this.sliderElem.style.marginBottom = o + "px") 300 } 301 for (var n = 0; n < this.options.ticks.length; n++) { 302 var a = this.options.ticks_positions[n] || this._toPercentage(this.options.ticks[n]); 303 this.options.reversed && (a = 100 - a), this.ticks[n].style[this.stylePos] = a + "%", this._removeClass(this.ticks[n], "in-selection"), this.options.range ? a >= t[0] && a <= t[1] && this._addClass(this.ticks[n], "in-selection") : "after" === this.options.selection && a >= t[0] ? this._addClass(this.ticks[n], "in-selection") : "before" === this.options.selection && a <= t[0] && this._addClass(this.ticks[n], "in-selection"), this.tickLabels[n] && (this.tickLabels[n].style[i] = s + "px", "vertical" !== this.options.orientation && void 0 !== this.options.ticks_positions[n] ? (this.tickLabels[n].style.position = "absolute", this.tickLabels[n].style[this.stylePos] = a + "%", this.tickLabels[n].style[e] = -s / 2 + "px") : "vertical" === this.options.orientation && (this.tickLabels[n].style.marginLeft = this.sliderElem.offsetWidth + "px", this.tickLabelContainer.style.marginTop = this.sliderElem.offsetWidth / 2 * -1 + "px")) 304 } 305 } 306 var h; 307 if (this.options.range) { 308 h = this.options.formatter(this._state.value), this._setText(this.tooltipInner, h), this.tooltip.style[this.stylePos] = (t[1] + t[0]) / 2 + "%", "vertical" === this.options.orientation ? this._css(this.tooltip, "margin-top", -this.tooltip.offsetHeight / 2 + "px") : this._css(this.tooltip, "margin-left", -this.tooltip.offsetWidth / 2 + "px"), "vertical" === this.options.orientation ? this._css(this.tooltip, "margin-top", -this.tooltip.offsetHeight / 2 + "px") : this._css(this.tooltip, "margin-left", -this.tooltip.offsetWidth / 2 + "px"); 309 var l = this.options.formatter(this._state.value[0]); 310 this._setText(this.tooltipInner_min, l); 311 var r = this.options.formatter(this._state.value[1]); 312 this._setText(this.tooltipInner_max, r), this.tooltip_min.style[this.stylePos] = t[0] + "%", "vertical" === this.options.orientation ? this._css(this.tooltip_min, "margin-top", -this.tooltip_min.offsetHeight / 2 + "px") : this._css(this.tooltip_min, "margin-left", -this.tooltip_min.offsetWidth / 2 + "px"), this.tooltip_max.style[this.stylePos] = t[1] + "%", "vertical" === this.options.orientation ? this._css(this.tooltip_max, "margin-top", -this.tooltip_max.offsetHeight / 2 + "px") : this._css(this.tooltip_max, "margin-left", -this.tooltip_max.offsetWidth / 2 + "px") 313 } else h = this.options.formatter(this._state.value[0]), this._setText(this.tooltipInner, h), this.tooltip.style[this.stylePos] = t[0] + "%", "vertical" === this.options.orientation ? this._css(this.tooltip, "margin-top", -this.tooltip.offsetHeight / 2 + "px") : this._css(this.tooltip, "margin-left", -this.tooltip.offsetWidth / 2 + "px"); 314 if ("vertical" === this.options.orientation) this.trackLow.style.top = "0", this.trackLow.style.height = Math.min(t[0], t[1]) + "%", this.trackSelection.style.top = Math.min(t[0], t[1]) + "%", this.trackSelection.style.height = Math.abs(t[0] - t[1]) + "%", this.trackHigh.style.bottom = "0", this.trackHigh.style.height = 100 - Math.min(t[0], t[1]) - Math.abs(t[0] - t[1]) + "%"; else { 315 this.trackLow.style.left = "0", this.trackLow.style.width = Math.min(t[0], t[1]) + "%", this.trackSelection.style.left = Math.min(t[0], t[1]) + "%", this.trackSelection.style.width = Math.abs(t[0] - t[1]) + "%", this.trackHigh.style.right = "0", this.trackHigh.style.width = 100 - Math.min(t[0], t[1]) - Math.abs(t[0] - t[1]) + "%"; 316 var p = this.tooltip_min.getBoundingClientRect(), d = this.tooltip_max.getBoundingClientRect(); 317 "bottom" === this.options.tooltip_position ? p.right > d.left ? (this._removeClass(this.tooltip_max, "bottom"), this._addClass(this.tooltip_max, "top"), this.tooltip_max.style.top = "", this.tooltip_max.style.bottom = "22px") : (this._removeClass(this.tooltip_max, "top"), this._addClass(this.tooltip_max, "bottom"), this.tooltip_max.style.top = this.tooltip_min.style.top, this.tooltip_max.style.bottom = "") : p.right > d.left ? (this._removeClass(this.tooltip_max, "top"), this._addClass(this.tooltip_max, "bottom"), this.tooltip_max.style.top = "18px") : (this._removeClass(this.tooltip_max, "bottom"), this._addClass(this.tooltip_max, "top"), this.tooltip_max.style.top = this.tooltip_min.style.top) 318 } 319 }, 320 _resize: function (t) { 321 this._state.offset = this._offset(this.sliderElem), this._state.size = this.sliderElem[this.sizePos], this._layout() 322 }, 323 _removeProperty: function (t, i) { 324 t.style.removeProperty ? t.style.removeProperty(i) : t.style.removeAttribute(i) 325 }, 326 _mousedown: function (t) { 327 if (!this._state.enabled) return !1; 328 this._state.offset = this._offset(this.sliderElem), this._state.size = this.sliderElem[this.sizePos]; 329 var i = this._getPercentage(t); 330 if (this.options.range) { 331 var e = Math.abs(this._state.percentage[0] - i), s = Math.abs(this._state.percentage[1] - i); 332 this._state.dragged = s > e ? 0 : 1, this._adjustPercentageForRangeSliders(i) 333 } else this._state.dragged = 0; 334 this._state.percentage[this._state.dragged] = i, this._layout(), this.touchCapable && (document.removeEventListener("touchmove", this.mousemove, !1), document.removeEventListener("touchend", this.mouseup, !1)), this.mousemove && document.removeEventListener("mousemove", this.mousemove, !1), this.mouseup && document.removeEventListener("mouseup", this.mouseup, !1), this.mousemove = this._mousemove.bind(this), this.mouseup = this._mouseup.bind(this), this.touchCapable && (document.addEventListener("touchmove", this.mousemove, !1), document.addEventListener("touchend", this.mouseup, !1)), document.addEventListener("mousemove", this.mousemove, !1), document.addEventListener("mouseup", this.mouseup, !1), this._state.inDrag = !0; 335 var o = this._calculateValue(); 336 return this._trigger("slideStart", o), this._setDataVal(o), this.setValue(o, !1, !0), this._pauseEvent(t), this.options.focus && this._triggerFocusOnHandle(this._state.dragged), !0 337 }, 338 _touchstart: function (t) { 339 if (void 0 === t.changedTouches) return void this._mousedown(t); 340 var i = t.changedTouches[0]; 341 this.touchX = i.pageX, this.touchY = i.pageY 342 }, 343 _triggerFocusOnHandle: function (t) { 344 0 === t && this.handle1.focus(), 1 === t && this.handle2.focu
344s() 345 }, 346 _keydown: function (t, i) { 347 if (!this._state.enabled) return !1; 348 var e; 349 switch (i.keyCode) { 350 case 37: 351 case 40: 352 e = -1; 353 break; 354 case 39: 355 case 38: 356 e = 1 357 } 358 if (e) { 359 if (this.options.natural_arrow_keys) { 360 var s = "vertical" === this.options.orientation && !this.options.reversed, 361 o = "horizontal" === this.options.orientation && this.options.reversed; 362 (s || o) && (e = -e) 363 } 364 var n = this._state.value[t] + e * this.options.step; 365 return this.options.range && (n = [t ? this._state.value[0] : n, t ? n : this._state.value[1]]), this._trigger("slideStart", n), this._setDataVal(n), this.setValue(n, !0, !0), this._setDataVal(n), this._trigger("slideStop", n), this._layout(), this._pauseEvent(i), !1 366 } 367 }, 368 _pauseEvent: function (t) { 369 t.stopPropagation && t.stopPropagation(), t.preventDefault && t.preventDefault(), t.cancelBubble = !0, t.returnValue = !1 370 }, 371 _mousemove: function (t) { 372 if (!this._state.enabled) return !1; 373 var i = this._getPercentage(t); 374 this._adjustPercentageForRangeSliders(i), this._state.percentage[this._state.dragged] = i, this._layout(); 375 var e = this._calculateValue(!0); 376 this._state.atio_element; 377 return this.setValue(e, !0, !0), !1 378 }, 379 _touchmove: function (t) { 380 if (void 0 !== t.changedTouches) { 381 var i = t.changedTouches[0], e = i.pageX - this.touchX, s = i.pageY - this.touchY; 382 this._state.inDrag || ("vertical" === this.options.orientation && 5 >= e && e >= -5 && (s >= 15 || -15 >= s) ? this._mousedown(t) : 5 >= s && s >= -5 && (e >= 15 || -15 >= e) && this._mousedown(t)) 383 } 384 }, 385 _adjustPercentageForRangeSliders: function (t) { 386 if (this.options.range) { 387 var i = this._getNumDigitsAfterDecimalPlace(t); 388 i = i ? i - 1 : 0; 389 var e = this._applyToFixedAndParseFloat(t, i); 390 0 === this._state.dragged && this._applyToFixedAndParseFloat(this._state.percentage[1], i) < e ? (this._state.percentage[0] = this._state.percentage[1], this._state.dragged = 1) : 1 === this._state.dragged && this._applyToFixedAndParseFloat(this._state.percentage[0], i) > e && (this._state.percentage[1] = this._state.percentage[0], this._state.dragged = 0) 391 } 392 }, 393 _mouseup: function () { 394 if (!this._state.enabled) return !1; 395 this.touchCapable && (document.removeEventListener("touchmove", this.mousemove, !1), document.removeEventListener("touchend", this.mouseup, !1)), document.removeEventListener("mousemove", this.mousemove, !1), document.removeEventListener("mouseup", this.mouseup, !1), this._state.inDrag = !1, this._state.over === !1 && this._hideTooltip(); 396 var t = this._calculateValue(!0); 397 return this._layout(), this._setDataVal(t), this._trigger("slideStop", t), !1 398 }, 399 _calculateValue: function (t) { 400 var i; 401 if (this.options.range ? (i = [this.options.min, this.options.max], 0 !== this._state.percentage[0] && (i[0] = this._toValue(this._state.percentage[0]), i[0] = this._applyPrecision(i[0])), 100 !== this._state.percentage[1] && (i[1] = this._toValue(this._state.percentage[1]), i[1] = this._applyPrecision(i[1]))) : (i = this._toValue(this._state.percentage[0]), i = parseFloat(i), i = this._applyPrecision(i)), t) { 402 for (var e = [i, 1 / 0], s = 0; s < this.options.ticks.length; s++) { 403 var o = Math.abs(this.options.ticks[s] - i); 404 o <= e[1] && (e = [this.options.ticks[s], o]) 405 } 406 if (e[1] <= this.options.ticks_snap_bounds) return e[0] 407 } 408 return i 409 }, 410 _applyPrecision: function (t) { 411 var i = this.options.precision || this._getNumDigitsAfterDecimalPlace(this.options.step); 412 return this._applyToFixedAndParseFloat(t, i) 413 }, 414 _getNumDigitsAfterDecimalPlace: function (t) { 415 var i = ("" + t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); 416 return i ? Math.max(0, (i[1] ? i[1].length : 0) - (i[2] ? +i[2] : 0)) : 0 417 }, 418 _applyToFixedAndParseFloat: function (t, i) { 419 var e = t.toFixed(i); 420 return parseFloat(e) 421 }, 422 _getPercentage: function (t) { 423 !this.touchCapable || "touchstart" !== t.type && "touchmove" !== t.type || (t = t.touches[0]); 424 var i = t[this.mousePos], e = this._state.offset[this.stylePos], s = i
vendor: 2,375 bytes, lines 424-470
424- e, 425 o = s / this._state.size * 100; 426 return o = Math.round(o / this._state.percentage[2]) * this._state.percentage[2], this.options.reversed && (o = 100 - o), Math.max(0, Math.min(100, o)) 427 }, 428 _validateInputValue: function (t) { 429 if ("number" == typeof t) return t; 430 if (Array.isArray(t)) return this._validateArray(t), t; 431 throw new Error(s.formatInvalidInputErrorMsg(t)) 432 }, 433 _validateArray: function (t) { 434 for (var i = 0; i < t.length; i++) { 435 var e = t[i]; 436 if ("number" != typeof e) throw new Error(s.formatInvalidInputErrorMsg(e)) 437 } 438 }, 439 _setDataVal: function (t) { 440 this.element.setAttribute("data-value", t), this.element.setAttribute("value", t), this.element.value = t 441 }, 442 _trigger: function (i, e) { 443 e = e || 0 === e ? e : void 0; 444 var s = this.eventToCallbackMap[i]; 445 if (s && s.length) for (var o = 0; o < s.length; o++) { 446 var n = s[o]; 447 n(e) 448 } 449 t && this._triggerJQueryEvent(i, e) 450 }, 451 _triggerJQueryEvent: function (t, i) { 452 var e = {type: t, value: i}; 453 this.$element.trigger(e), this.$sliderElem.trigger(e) 454 }, 455 _unbindJQueryEventHandlers: function () { 456 this.$element.off(), this.$sliderElem.off() 457 }, 458 _setText: function (t, i) { 459 "undefined" != typeof t.textContent ? t.textContent = i : "undefined" != typeof t.innerText && (t.innerText = i) 460 }, 461 _removeClass: function (t, i) { 462 for (var e = i.split(" "), s = t.className, o = 0; o < e.length; o++) { 463 var n = e[o], a = new RegExp("(?:\\s|^)" + n + "(?:\\s|$)"); 464 s = s.replace(a, " ") 465 } 466 t.className = s.trim() 467 }, 468 _addClass: function (t, i) { 469 for (var e = i.split(" "), s = t.className, o = 0; o < e.length; o++) { 470 var n = e[o], a = new RegExp("(?:\\s|^)" + n + "(?:\\s|$)"), h = a.test(s);
471 h || (s += " " + n) 472 } 473 t.className = s.trim() 474 }, 475 _offsetLeft: function (t) { 476 return t.getBoundingClientRect().left 477 }, 478 _offsetTop: function (t) { 479 for (var i = t.offsetTop; (t = t.offsetParent) && !isNaN(t.offsetTop);) i += t.offsetTop, "BODY" !== t.tagName && (i -= t.scrollTop); 480 return i 481 }, 482 _offset: function (t) { 483 return {left: this._offsetLeft(t), top: this._offsetTop(t)} 484 }, 485 _css: function (i, e, s) { 486 if (t) t.style(i, e, s); else { 487 var o = e.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function (t, i) { 488 return i.toUpperCase() 489 }); 490 i.style[o] = s 491 } 492 }, 493 _toValue: function (t) { 494 return this.options.scale.toValue.apply(this, [t]) 495 }, 496 _toPercentage: function (t) { 497 return this.options.scale.toPercentage.apply(this, [t]) 498 }, 499 _setTooltipPosition: function () { 500 var t = [this.tooltip, this.tooltip_min, this.tooltip_max]; 501 if ("vertical" === this.options.orientation) { 502 var i = this.options.tooltip_position || "right", e = "left" === i ? "right" : "left"; 503 t.forEach(function (t) { 504 this._addClass(t, i), t.style[e] = "100%" 505 }.bind(this)) 506 } else "bottom" === this.options.tooltip_position ? t.forEach(function (t) { 507 this._addClass(t, "bottom"), t.style.top = "22px" 508 }.bind(this)) : t.forEach(function (t) { 509 this._addClass(t, "top"), t.style.top = -this.tooltip.outerHeight - 14 + "px" 510 }.bind(this)) 511 } 512 }, t) { 513 var n = t.fn.slider ? "bootstrapSlider" : "slider"; 514 t.bridget(n, i), t(function () { 515 t("input[data-provide=slider]")[n]() 516 }) 517 } 518 }(t), i 519}); 520 521/* 522 * jQuery applink 523 */ 524!function (t, e, n, o) { 525 var i = "applink", p = {popup: "auto", desktop: !1, delegate: null, timeout: 1500, data: i}, d = !1, 526 u = navigator.userAgent, a = null !== u.match(/iPad/i), 527 r = !a && (null !== u.match(/iPhone/i) || null !== u.match(/iPod/i)), s = a || r, 528 f = !s && null !== u.match(/android/i), c = s || f, l = function (t, e) { 529 return e.href = t.attr("href"), e.applink = t.data(e.data), e.popup = t.data("popup"), e.desktop = t.data("desktop"), e.desktop = "undefined" != typeof e.desktop && e.desktop ? "true" === e.desktop.toString() : p.desktop, e.enabled = c || e.desktop ? e.applink : !1, e.enabled = "undefined" != typeof e.enabled && e.enabled ? !0 : !1, e.popup = "undefined" != typeof e.popup && e.popup ? "false" === e.popup.toString() ? !1 : e.popup : p.popup, e.popup = "auto" === e.popup && /^https?:\/\/(www\.)?(facebook|twitter)\.com/i.test(e.href) ? !0 : "auto" !== e.popup && e.popup ? !0 : !1, e 530 }, h = function (t) { 531 setTimeout(function () { 532 g() ? d && d.close() : y(t) 533 }, t.timeout), e.location = t.applink 534 }, g = function () { 535 return "undefined" != typeof n.hidden ? n.hidden : "undefined" != typeof n.mozHidden ? n.mozHidden : "undefined" != typeof n.msHidden ? n.msHidden : "undefined" != typeof n.webkitHidden ? n.webkitHidden : !1 536 }, y = function (t) { 537 return t.popup ? m(t) : (d && !d.closed && d.close(), void (e.location = t.href)) 538 }, m = function (t) { 539 if (d && !d.closed) return d.location.replace(t.href), d.focus(), d; 540 var n = screen.width > 620 ? 600 : screen.width, o = screen.height > 300 ? 280 : screen.height, 541 p = screen.width / 2 - n / 2, u = screen.height / 2 - o / 2, 542 a = "location=no,menubar=no,status=no,toolbar=no,scrollbars=no,directories=no,copyhistory=no,width="
542+ n + ",height=" + o + ",top=" + u + ",left=" + p; 543 return d = e.open(t.href, i, a), d.focus(), d 544 }, k = function (e, n) { 545 this.element = e, this.settings = t.extend({}, p, n), this.init() 546 }; 547 k.prototype = { 548 init: function () { 549 var e = t(this.element), n = this; 550 e.on("click." + i, this.settings.delegate, function (e) { 551 e.preventDefault(); 552 var o = l(t(this), n.settings); 553 return o.enabled ? void h(o) : y(o) 554 }) 555 }, destroy: function () { 556 t(this.element).off("." + i) 557 } 558 }, t.fn[i] = function (e) { 559 if (e === o || "object" == typeof e) return this.each(function () { 560 t.data(this, "plugin_" + i) || t.data(this, "plugin_" + i, new k(this, e)) 561 }); 562 if ("string" != typeof e || "_" === e[0] || "init" === e) return !0; 563 var n, p = arguments; 564 return this.each(function () { 565 var o = t.data(this, "plugin_" + i); 566 o instanceof k && "function" == typeof o[e] && (n = o[e].apply(o, Array.prototype.slice.call(p, 1))), "destroy" === e && t.data(this, "plugin_" + i, null) 567 }), n !== o ? n : this 568 } 569}(jQuery, window, document); 570 571function isInt(val) { 572 var intRegex = /^-?\d+$/; 573 if (!intRegex.test(val)) 574 return false; 575 576 var intVal = parseInt(val, 10); 577 return parseFloat(val) == intVal && !isNaN(intVal); 578} 579 580jQuery.fn.eqHeights = function (options) { 581 var defaults = { 582 child: false, 583 parentSelector: null 584 }; 585 var options = jQuery.extend(defaults, options); 586 587 var grand_parent = jQuery(this).parent().parent().parent(); 588 589 if (grand_parent.hasClass('carousel-inner') || grand_parent.hasClass('tab-pane')) { 590 return; 591 } 592 593 var el = jQuery(this); 594 if (el.length > 0 && !el.data('eqHeights')) { 595 jQuery(window).bind('resize.eqHeights', function () { 596 el.eqHeights(); 597 }); 598 el.data('eqHeights', true); 599 } 600 601 if (options.child && options.child.length > 0) { 602 var elmtns = jQuery(options.child, this); 603 } else { 604 var elmtns = jQuery(this).children(); 605 } 606 607 var prevTop = 0; 608 var max_height = 0; 609 var elements = []; 610 var parentEl; 611 elmtns.height('auto').each(function () { 612 613 if (options.parentSelector && parentEl !== jQuery(this).parents(options.parentSelector).get(0)) { 614 jQuery(elements).height(max_height); 615 max_height = 0; 616 prevTop = 0; 617 elements = []; 618 parentEl = jQuery(this).parents(options.parentSelector).get(0); 619 } 620 621 var thisTop = this.offsetTop; 622 623 if (prevTop > 0 && prevTop != thisTop) { 624 jQuery(elements).height(max_height); 625 max_height = jQuery(this).height(); 626 elements = []; 627 } 628 max_height = Math.max(max_height, jQuery(this).height()); 629 630 prevTop = this.offsetTop; 631 elements.push(this); 632 }); 633 634 if (max_height > 250) { 635 jQuery(elements).height(max_height); 636 } 637}; 638 639var filter_page_reset = false; 640 641/* 642 * jQuery ready 643 */ 644jQuery(document).ready(function () { 645 jQuery('a[data-applink]').applink(); 646 jQuery('iframe[src*="youtube.com"], iframe[src*="youtube-nocookie.com"], iframe[src*="vimeo.com"], iframe[src*="google.com/maps"]').wrap('<div class="embed-responsive embed-responsive-16by9" />'); 647 jQuery('#comments_reply .form-submit input[type="submit"]').addClass('btn btn-at pull-right').after('<div class="clearfix"></div>'); 648 649 jQuery('#content p').each(function () { 650 var $this = jQuery(this); 651 if ($this.html().replace(/\s| /g, '').length == 0) $this.addClass('empty'); 652 }); 653 654 jQuery('.bt-slider').each(function (e) { 655 var curSlider = jQuery(this); 656 657 jQuery(this).slider({ 658 formatter: function (value) { 659 if (curSlider.attr('data-slider-label')) { 660 if (Array.isArray(value)) { 661 return value[0] + curSlider.attr('data-sli
661der-label') + " - " + value[1] + curSlider.attr('data-slider-label'); 662 } else { 663 return value; 664 } 665 } else { 666 return value; 667 } 668 } 669 }); 670 }); 671 672 jQuery("#navigation .dropdown").on("show.bs.dropdown", function (event) { 673 var icon = jQuery(this).find('.extra-toggle:first').find('.glyphicon'); 674 icon.removeClass('glyphicon-plus').addClass('glyphicon-minus'); 675 }); 676 677 jQuery("#navigation .dropdown").on("hidden.bs.dropdown", function (event) { 678 var icon = jQuery(this).find('.extra-toggle:first').find('.glyphicon'); 679 icon.removeClass('glyphicon-minus').addClass('glyphicon-plus'); 680 }); 681 682 jQuery("#navigation .menu-item-has-children ul .extra-toggle").on("click", function (event) { 683 var icon = jQuery(this).find('.glyphicon'); 684 console.log(icon); 685 if (icon.hasClass('glyphicon-plus')) { 686 icon.removeClass('glyphicon-plus').addClass('glyphicon-minus'); 687 } else { 688 icon.removeClass('glyphicon-minus').addClass('glyphicon-plus'); 689 } 690 }); 691 692 jQuery('.product-grid-hover .caption-hover-img a[data-big]').bind('mouseover click', function (e) { 693 var image_src = jQuery(this).attr('data-big'); 694 var image_target = jQuery(this).closest('.product-grid-hover').find('.img-grid-wrapper a img'); 695 var image_target_src = image_target.attr('src'); 696 697 jQuery(this).closest('ul').find('a').removeClass('active'); 698 jQuery(this).addClass('active'); 699 jQuery(image_target).attr('src', image_src).attr('srcset', image_src); 700 701 e.preventDefault(); 702 }); 703 704 jQuery('#productGallery ol.carousel-indicators').on("touchstart", "li", function () { 705 var slide = jQuery(this).attr('data-slide-to'); 706 707 jQuery('#productGallery ol.carousel-indicators li.active').removeClass("active"); 708 jQuery(this).addClass("active"); 709 jQuery('#productGallery').carousel(parseInt(slide)); 710 }); 711 712 jQuery('#content .eq').eqHeights({parentSelector: '.row'}); 713 714 jQuery('a[data-applink]').applink(); 715 716 // product filter 717 jQuery('form.filterform[data-ajax="true"] button[type="submit"]').on('click', function () { 718 filter_page_reset = true; 719 }); 720 721 jQuery('form.filterform[data-ajax="true"]').submit(function () { 722 if (filter_page_reset) { 723 jQuery(this).parent().find('input[name="paged"]').val('1'); 724 } 725 726 var form_data = jQuery(this).serialize(); 727 var filter_id = jQuery(this).data('id'); 728 var source_id = jQuery(this).data('source-id'); 729 var button = jQuery(this).find('button[type="submit"]'); 730 var results = jQuery('.filter-results[data-form-id="' + filter_id + '"]'); 731 732 jQuery(document).trigger('at_filter_submit', form_data); 733 734 if (results.length == 0) { 735 var target = jQuery('#main #content'); 736 737 if (jQuery('#main #content .product-listing').length) { 738 target = jQuery('#main #content .product-listing'); 739 } 740 741 target.html('<div id="filter-results-' + filter_id + '" class="filter-results filter-results-ajaxify" data-form-id="' + filter_id + '"></div>'); 742 var results = jQuery('.filter-results[data-form-id="' + filter_id + '"]'); 743 } 744 745 button.append(' <i class="fa fa-spinner fa-spin"></i>'); 746 results.addClass('filter-loading'); 747 748 jQuery.ajax({ 749 type: 'POST', 750 url: ajaxurl, 751 data: form_data + '&action=product_filter_ajax&source_id=' + source_id + '&filter_id=' + filter_id, 752 success: function (data) { 753 results.html(data); 754 button.find('i').remove(); 755 results.removeClass('filter-loading'); 756 757 jQuery(document).trigger('at_filter_submit_success', form_data); 758 759 // check user filter ordering 760 if (jQuery('.result-filter').length) { 761 var current_layout = 'grid'; 762 763 if (results.find('.product-list').length) { 764 current_layout = 'list'; 765 } 766 767 jQuery('.result-filter a[href*="layout"]').removeClass('active'); 768 jQuery('.result-filter a[data-value="' + current_layout + '"]').addClass('active'); 769 } 770 } 771 }); 772 773 return false; 774 });
775 776 // product filter pagination 777 jQuery(document.body).on('click', '.filter-results .pagination li a', function (e) { 778 var form_id = jQuery(this).closest('.filter-results').data('form-id'); 779 var form = jQuery('form.filterform[data-id="' + form_id + '"]'); 780 var page = jQuery(this).data('page'); 781 782 filter_page_reset = false; 783 form.find('input[name="paged"]').val(page); 784 form.submit(); 785 786 jQuery('html,body').animate({ 787 scrollTop: form.offset().top - 100 + 'px' 788 }, 300); 789 790 return false; 791 }); 792 793 // comment reply, privacy 794 if (jQuery('#respond.comment-respond input[name="user_check"]').length > 0) { 795 jQuery('body:not(.logged-in) #comments_reply .form-submit input[type="submit"]').attr('disabled', true); 796 jQuery('#respond.comment-respond input[name="user_check"]').on('change', function (e) { 797 if (this.checked) { 798 jQuery('#comments_reply .form-submit input[type="submit"]').attr('disabled', false); 799 } else { 800 jQuery('#comments_reply .form-submit input[type="submit"]').attr('disabled', true); 801 } 802 }); 803 } 804}); 805 806/** 807 * Cookie Bar 808 */ 809 810function getCookie(cname) { 811 var name = cname + "="; 812 var ca = document.cookie.split(';'); 813 for (var i = 0; i < ca.length; i++) { 814 var c = ca[i]; 815 while (c.charAt(0) == ' ') { 816 c = c.substring(1); 817 } 818 if (c.indexOf(name) == 0) { 819 return c.substring(name.length, c.length); 820 } 821 } 822 823 return ""; 824} 825 826function accept_cookie() { 827 var now = new Date(); 828 var time = now.getTime(); 829 time += 3122064000 * 1000; 830 now.setTime(time); 831 document.cookie = "allow_cookie=1;expires=" + now.toUTCString() + ";path=/"; 832 jQuery('.cookie-bar').slideToggle('slow'); 833} 834 835function display_cookie_info() { 836 if (getCookie('allow_cookie') != '1') { 837 jQuery('.cookie-bar').slideToggle('slow'); 838 } 839} 840 841jQuery(document).ready(function () { 842 if (jQuery('.cookie-bar').length > 0) { 843 display_cookie_info(); 844 845 jQuery('#cookie_btn').on('click', function () { 846 accept_cookie(); 847 }); 848 849 if (getCookie('allow_cookie') != '1') { 850 jQuery(window).scroll(function () { 851 var cookiebox = jQuery('.cookie-bar'); 852 var footer_top = parseFloat(jQuery('#footer').offset().top); 853 var scroll_offset_y = jQuery(window).scrollTop() + jQuery(window).height(); 854 var cookiebox_bottom = cookiebox.offset().top + cookiebox.outerHeight(true); 855 if (footer_top < scroll_offset_y) { 856 var bottom_offset = Math.floor((scroll_offset_y - footer_top)); 857 jQuery('.cookie-bar').css('bottom', bottom_offset + 'px'); 858 } else { 859 jQuery('.cookie-bar').css('bottom', '0'); 860 } 861 }); 862 } 863 } 864}); 865 866/* 867 * Social JS 868 */ 869function socialp(elem, m) { 870 if (m == 'twitter') { 871 var desc = ''; 872 var el, els = document.getElementsByTagName("meta"); 873 var i = els.length; 874 while (i--) { 875 el = els[i]; 876 if (el.getAttribute("property") == "og:title") { 877 desc = el.content; 878 break; 879 } 880 } 881 var creator = ""; 882 if (document.getElementsByName("twitter:creator").length) { 883 creator = document.getElementsByName("twitter:creator")[0].content; 884 } 885 creator = creator.replace('@', ''); 886 elem.href += "&text=" + encodeURIComponent(desc) + "&via=" + creator + "&related=" + creator; 887 } 888 889 if (m == 'pinterest') { 890 var image = ''; 891 var el, els = document.getElementsByTagName("meta"); 892 var i = els.length; 893 while (i--) { 894 el = els[i]; 895 if (el.getAttribute("property") == "og:image") { 896 image = el.content; 897 break; 898 } 899 } 900 elem.href += "&media=" + image; 901 } 902 903 elem = window.open(elem.href, "Teile diese Seite", "width=600,height=500,resizable=yes"); 904 elem.moveTo(screen.width / 2 - 300, screen.height / 2 - 450); 905 elem.focus() 906} 907 908/* 909 * TO TOP Smooth Scroll 910 */ 911jQuery(function () { 912 // ToTop Smooth Scroll 913 jQuery('a.totop').click(function () { 914 jQuery('html,body').animate({ 915 scrollTop: 0 916 }, 1000); 917 return false; 918 });
919}); 920 921/* 922 * OPEN TAB 923 */ 924jQuery(function () { 925 // ToTop Smooth Scroll 926 jQuery('a.open-tab').click(function () { 927 var target = jQuery(this).data('target'); 928 var tab = jQuery('a[aria-controls="' + target + '"]'); 929 tab.tab('show'); 930 931 jQuery('html,body').animate({ 932 scrollTop: tab.offset().top - 100 + 'px' 933 }, 1000); 934 return false; 935 }); 936}); 937 938/* 939 * Smooth Scroll 940 */ 941jQuery(function () { 942 // ToTop Smooth Scroll 943 jQuery('a.smoothscroll').click(function () { 944 var target = jQuery(this.hash); 945 var offset = jQuery(this).data('offset'); 946 target = target.length ? target : jQuery('[name=' + this.hash.slice(1) + ']'); 947 if (target.length) { 948 jQuery('html,body').animate({ 949 scrollTop: target.offset().top - offset 950 }, 1000); 951 return false; 952 } 953 }); 954}); 955 956/* 957 * Navigation Dropdown Script 958 */ 959(function ($) { 960 $(document).ready(function () { 961 $('.navbar ul.dropdown-menu [data-toggle=dropdown]').on('click', function (event) { 962 event.preventDefault(); 963 event.stopPropagation(); 964 $(this).parent().siblings().removeClass('open'); 965 $(this).parent().toggleClass('open'); 966 }); 967 }); 968})(jQuery); 969 970 971/* 972 * Carousel Swipe 973 */ 974(function (a) { 975 if (typeof define === "function" && define.amd && define.amd.jQuery) { 976 define(["jquery"], a) 977 } else { 978 a(jQuery) 979 } 980}(function (f) { 981 var p = "left", o = "right", e = "up", x = "down", c = "in", z = "out", m = "none", s = "auto", l = "swipe", 982 t = "pinch", A = "tap", j = "doubletap", b = "longtap", y = "hold", D = "horizontal", u = "vertical", i = "all", 983 r = 10, g = "start", k = "move", h = "end", q = "cancel", a = "ontouchstart" in window, 984 v = window.navigator.msPointerEnabled && !window.navigator.pointerEnabled, 985 d = window.navigator.pointerEnabled || window.navigator.msPointerEnabled, B = "TouchSwipe"; 986 var n = { 987 fingers: 1, 988 threshold: 75, 989 cancelThreshold: null, 990 pinchThreshold: 20, 991 maxTimeThreshold: null, 992 fingerReleaseThreshold: 250, 993 longTapThreshold: 500, 994 doubleTapThreshold: 200, 995 swipe: null, 996 swipeLeft: null, 997 swipeRight: null, 998 swipeUp: null, 999 swipeDown: null, 1000 swipeStatus: null, 1001 pinchIn: null, 1002 pinchOut: null, 1003 pinchStatus: null, 1004 click: null, 1005 tap: null, 1006 doubleTap: null, 1007 longTap: null, 1008 hold: null, 1009 triggerOnTouchEnd: true, 1010 triggerOnTouchLeave: false, 1011 allowPageScroll: "auto", 1012 fallbackToMouseEvents: true, 1013 excludedElements: "label, button, input, select, textarea, a, .noSwipe", 1014 preventDefaultEvents: true 1015 }; 1016 f.fn.swipe = function (G) { 1017 var F = f(this), E = F.data(B); 1018 if (E && typeof G === "string") { 1019 if (E[G]) { 1020 return E[G].apply(this, Array.prototype.slice.call(arguments, 1)) 1021 } else { 1022 f.error("Method " + G + " does not exist on jQuery.swipe") 1023 } 1024 } else { 1025 if (!E && (typeof G === "object" || !G)) { 1026 return w.apply(this, arguments) 1027 } 1028 } 1029 return F 1030 }; 1031 f.fn.swipe.defaults = n; 1032 f.fn.swipe.phases = {PHASE_START: g, PHASE_MOVE: k, PHASE_END: h, PHASE_CANCEL: q}; 1033 f.fn.swipe.directions = {LEFT: p, RIGHT: o, UP: e, DOWN: x, IN: c, OUT: z}; 1034 f.fn.swipe.pageScroll = {NONE: m, HORIZONTAL: D, VERTICAL: u, AUTO: s}; 1035 f.fn.swipe.fingers = {ONE: 1, TWO: 2, THREE: 3, ALL: i}; 1036 1037 function w(E) { 1038 if (E && (E.allowPageScroll === undefined && (E.swipe !== undefined || E.swipeStatus !== undefined))) { 1039 E.allowPageScroll = m 1040 } 1041 if (E.click !== undefined && E.tap === undefined) { 1042 E.tap = E.click 1043 } 1044 if (!E) { 1045 E = {} 1046 } 1047 E = f.extend({}, f.fn.swipe.defaults, E); 1048 return this.each(function () { 1049 var G = f(this); 1050 var F = G.data(B); 1051 if (!F) { 1052 F = new C(this, E); 1053 G.data(B, F) 1054 } 1055 }) 1056 } 1057 1058 function C(a4, av) { 1059 var az = (a || d || !av.fallbackToMouseEvents), 1060 J = az ? (d ? (v ? "MSPointerDown" : "pointerdown") : "touchstart") : "mousedown", 1061 ay = az ? (d ? (v ? "MSPointerMove" : "pointermove") : "touchmove") : "mousemove", 1062 U = az ? (d ? (v ? "MSPointerUp" : "pointerup") : "touchend") : "mouseup", S = az ? null : "mouseleave", 1063 aD = (d ? (v ? "MSPointerCancel" : "pointercancel") : "touchcancel"); 1064 var ag = 0, aP = null, ab = 0, a1 = 0, aZ = 0, G = 1, aq = 0, aJ = 0, M = null; 1065 var aR = f(a4); 1066 var Z = "start"; 1067 var W = 0; 1068 var aQ = null; 1069 var T = 0, a2 = 0, a5 = 0, ad = 0, N = 0; 1070 var aW = null, af = null; 1071 try { 1072 aR.bind(J, aN); 1073 aR.bind(aD, a9) 1074 } catch (ak) { 1075 f.error("events not supported " + J + "," + aD + " on jQuery.swipe") 1076 } 1077 this.enable = function () { 1078 aR.bind(J, aN); 1079 aR.bind(aD, a9); 1080 return aR 1081 }; 1082 this.disable = function () { 1083 aK(); 1084 return aR 1085 }; 1086 this.destroy = function () { 1087 aK(); 1088 aR.data(B, null); 1089 aR = null 1090 }; 1091 this.option = function (bc, bb) { 1092 if (av[bc] !== undefined) { 1093 if (bb === undefined) { 1094 return av[bc] 1095 } else { 1096 av[bc] = bb 1097 } 1098 } else { 1099 f.error("Option " + bc + " does not exist on jQuery.swipe.options") 1100 } 1101 return null 1102 }; 1103 1104 function aN(bd) { 1105 if (aB()) { 1106 return 1107 } 1108 if (f(bd.target).closest(av.excludedElements, aR).length > 0) { 1109 return 1110 } 1111 var be = bd.originalEvent ? bd.originalEvent : bd; 1112 var bc, bb = a ? be.touches[0] : be; 1113 Z = g; 1114 if (a) { 1115 W = be.touches.length 1116 } else { 1117 bd.preventDefault() 1118 } 1119 ag = 0; 1120 aP = null; 1121 aJ = null; 1122 ab = 0; 1123 a1 = 0; 1124 aZ = 0; 1125 G = 1; 1126 aq = 0; 1127 aQ = aj(); 1128 M = aa(); 1129 R(); 1130 if (!a || (W === av.fingers || av.fingers === i) || aX()) { 1131 ai(0, bb); 1132 T = at(); 1133 if (W == 2) { 1134 ai(1, be.touches[1]); 1135 a1 = aZ = au(aQ[0].start, aQ[1].start) 1136 } 1137 if (av.swipeStatus || av.pinchStatus) { 1138 bc = O(be, Z) 1139 } 1140 } else { 1141 bc = false 1142 } 1143 if (bc === false) { 1144 Z = q; 1145 O(be, Z); 1146 return bc 1147 } else { 1148 if (av.hold) { 1149 af = setTimeout(f.proxy(function () { 1150 aR.trigger("hold", [be.target]); 1151 if (av.hold) { 1152 bc = av.hold.call(aR, be, be.target) 1153 } 1154 }, this), av.longTapThreshold) 1155 } 1156 ao(true) 1157 } 1158 return null 1159 } 1160 1161 function a3(be) { 1162 var bh = be.originalEvent ? be.originalEvent : be;
vendor: 16,761 bytes, lines 1163-1695
1163 if (Z === h || Z === q || am()) { 1164 return 1165 } 1166 var bd, bc = a ? bh.touches[0] : bh; 1167 var bf = aH(bc); 1168 a2 = at(); 1169 if (a) { 1170 W = bh.touches.length 1171 } 1172 if (av.hold) { 1173 clearTimeout(af) 1174 } 1175 Z = k; 1176 if (W == 2) { 1177 if (a1 == 0) { 1178 ai(1, bh.touches[1]); 1179 a1 = aZ = au(aQ[0].start, aQ[1].start) 1180 } else { 1181 aH(bh.touches[1]); 1182 aZ = au(aQ[0].end, aQ[1].end); 1183 aJ = ar(aQ[0].end, aQ[1].end) 1184 } 1185 G = a7(a1, aZ); 1186 aq = Math.abs(a1 - aZ) 1187 } 1188 if ((W === av.fingers || av.fingers === i) || !a || aX()) { 1189 aP = aL(bf.start, bf.end); 1190 al(be, aP); 1191 ag = aS(bf.start, bf.end); 1192 ab = aM(); 1193 aI(aP, ag); 1194 if (av.swipeStatus || av.pinchStatus) { 1195 bd = O(bh, Z) 1196 } 1197 if (!av.triggerOnTouchEnd || av.triggerOnTouchLeave) { 1198 var bb = true; 1199 if (av.triggerOnTouchLeave) { 1200 var bg = aY(this); 1201 bb = E(bf.end, bg) 1202 } 1203 if (!av.triggerOnTouchEnd && bb) { 1204 Z = aC(k) 1205 } else { 1206 if (av.triggerOnTouchLeave && !bb) { 1207 Z = aC(h) 1208 } 1209 } 1210 if (Z == q || Z == h) { 1211 O(bh, Z) 1212 } 1213 } 1214 } else { 1215 Z = q; 1216 O(bh, Z) 1217 } 1218 if (bd === false) { 1219 Z = q; 1220 O(bh, Z) 1221 } 1222 } 1223 1224 function L(bb) { 1225 var bc = bb.originalEvent; 1226 if (a) { 1227 if (bc.touches.length > 0) { 1228 F(); 1229 return true 1230 } 1231 } 1232 if (am()) { 1233 W = ad 1234 } 1235 a2 = at(); 1236 ab = aM(); 1237 if (ba() || !an()) { 1238 Z = q; 1239 O(bc, Z) 1240 } else { 1241 if (av.triggerOnTouchEnd || (av.triggerOnTouchEnd == false && Z === k)) { 1242 bb.preventDefault(); 1243 Z = h; 1244 O(bc, Z) 1245 } else { 1246 if (!av.triggerOnTouchEnd && a6()) { 1247 Z = h; 1248 aF(bc, Z, A) 1249 } else { 1250 if (Z === k) { 1251 Z = q; 1252 O(bc, Z) 1253 } 1254 } 1255 } 1256 } 1257 ao(false); 1258 return null 1259 } 1260 1261 function a9() { 1262 W = 0; 1263 a2 = 0; 1264 T = 0; 1265 a1 = 0; 1266 aZ = 0; 1267 G = 1; 1268 R(); 1269 ao(false) 1270 } 1271 1272 function K(bb) { 1273 var bc = bb.originalEvent; 1274 if (av.triggerOnTouchLeave) { 1275 Z = aC(h); 1276 O(bc, Z) 1277 } 1278 } 1279 1280 function aK() { 1281 aR.unbind(J, aN); 1282 aR.unbind(aD, a9); 1283 aR.unbind(ay, a3); 1284 aR.unbind(U, L); 1285 if (S) { 1286 aR.unbind(S, K) 1287 } 1288 ao(false) 1289 } 1290 1291 function aC(bf) { 1292 var be = bf; 1293 var bd = aA(); 1294 var bc = an(); 1295 var bb = ba(); 1296 if (!bd || bb) { 1297 be = q 1298 } else { 1299 if (bc && bf == k && (!av.triggerOnTouchEnd || av.triggerOnTouchLeave)) { 1300 be = h 1301 } else { 1302 if (!bc && bf == h && av.triggerOnTouchLeave) { 1303 be = q 1304 } 1305 } 1306 } 1307 return be 1308 } 1309 1310 function O(bd, bb) { 1311 var bc = undefined; 1312 if ((I() || V()) || (P() || aX())) { 1313 if (I() || V()) { 1314 bc = aF(bd, bb, l) 1315 } 1316 if ((P() || aX()) && bc !== false) { 1317 bc = aF(bd, bb, t) 1318 } 1319 } else { 1320 if (aG() && bc !== false) { 1321 bc = aF(bd, bb, j) 1322 } else { 1323 if (ap() && bc !== false) { 1324 bc = aF(bd, bb, b) 1325 } else { 1326 if (ah() && bc !== false) { 1327 bc = aF(bd, bb, A) 1328 } 1329 } 1330 } 1331 } 1332 if (bb === q) { 1333 a9(bd) 1334 } 1335 if (bb === h) { 1336 if (a) { 1337 if (bd.touches.length == 0) { 1338 a9(bd) 1339 } 1340 } else { 1341 a9(bd) 1342 } 1343 } 1344 return bc 1345 } 1346 1347 function aF(be, bb, bd) { 1348 var bc = undefined; 1349 if (bd == l) { 1350 aR.trigger("swipeStatus", [bb, aP || null, ag || 0, ab || 0, W, aQ]); 1351 if (av.swipeStatus) { 1352 bc = av.swipeStatus.call(aR, be, bb, aP || null, ag || 0, ab || 0, W, aQ); 1353 if (bc === false) { 1354 return false 1355 } 1356 } 1357 if (bb == h && aV()) { 1358 aR.trigger("swipe", [aP, ag, ab, W, aQ]); 1359 if (av.swipe) { 1360 bc = av.swipe.call(aR, be, aP, ag, ab, W, aQ); 1361 if (bc === false) { 1362 return false 1363 } 1364 } 1365 switch (aP) { 1366 case p: 1367 aR.trigger("swipeLeft", [aP, ag, ab, W, aQ]); 1368 if (av.swipeLeft) { 1369 bc = av.swipeLeft.call(aR, be, aP, ag, ab, W, aQ) 1370 } 1371 break; 1372 case o: 1373 aR.trigger("swipeRight", [aP, ag, ab, W, aQ]); 1374 if (av.swipeRight) { 1375 bc = av.swipeRight.call(aR, be, aP, ag, ab, W, aQ) 1376 } 1377 break; 1378 case e: 1379 aR.trigger("swipeUp", [aP, ag, ab, W, aQ]); 1380 if (av.swipeUp) { 1381 bc = av.swipeUp.call(aR, be, aP, ag, ab, W, aQ) 1382 } 1383 break; 1384 case x: 1385 aR.trigger("swipeDown", [aP, ag, ab, W, aQ]); 1386 if (av.swipeDown) { 1387 bc = av.swipeDown.call(aR, be, aP, ag, ab, W, aQ) 1388 } 1389 break 1390 } 1391 } 1392 } 1393 if (bd == t) { 1394 aR.trigger("pinchStatus", [bb, aJ || null, aq || 0, ab || 0, W, G, aQ]); 1395 if (av.pinchStatus) { 1396 bc = av.pinchStatus.call(aR, be, bb, aJ || null, aq || 0, ab || 0, W, G, aQ); 1397 if (bc === false) { 1398 return false 1399 } 1400 } 1401 if (bb == h && a8()) { 1402 switch (aJ) { 1403 case c: 1404 aR.trigger("pinchIn", [aJ || null, aq || 0, ab || 0, W, G, aQ]); 1405 if (av.pinchIn) { 1406 bc = av.pinchIn.call(aR, be, aJ || null, aq || 0, ab || 0, W, G, aQ) 1407 } 1408 break; 1409 case z: 1410 aR.trigger("pinchOut", [aJ || null, aq || 0, ab || 0, W, G, aQ]); 1411 if (av.pinchOut) { 1412 bc = av.pinchOut.call(aR, be, aJ || null, aq || 0, ab || 0, W, G, aQ) 1413 } 1414 break 1415 } 1416 } 1417 } 1418 if (bd == A) { 1419 if (bb === q || bb === h) { 1420 clearTimeout(aW); 1421 clearTimeout(af); 1422 if (Y() && !H()) { 1423 N = at(); 1424 aW = setTimeout(f.proxy(function () { 1425 N = null; 1426 aR.trigger("tap", [be.target]); 1427 if (av.tap) { 1428 bc = av.tap.call(aR, be, be.target) 1429 } 1430 }, this), av.doubleTapThreshold) 1431 } else { 1432 N = null; 1433 aR.trigger("tap", [be.target]); 1434 if (av.tap) { 1435 bc = av.tap.call(aR, be, be.target) 1436 } 1437 } 1438 } 1439 } else { 1440 if (bd == j) { 1441 if (bb === q || bb === h) { 1442 clearTimeout(aW); 1443 N = null; 1444 aR.trigger("doubletap", [be.target]); 1445 if (av.doubleTap) { 1446 bc = av.doubleTap.call(aR, be, be.target) 1447 } 1448 } 1449 } else { 1450 if (bd == b) { 1451 if (bb === q || bb === h) { 1452 clearTimeout(aW); 1453 N = null; 1454 aR.trigger("longtap", [be.target]); 1455 if (av.longTap) { 1456 bc = av.longTap.call(aR, be, be.target) 1457 } 1458 } 1459 } 1460 } 1461 } 1462 return bc 1463 } 1464 1465 function an() { 1466 var bb = true; 1467 if (av.threshold !== null) { 1468 bb = ag >= av.threshold 1469 } 1470 return bb 1471 } 1472 1473 function ba() { 1474 var bb = false; 1475 if (av.cancelThreshold !== null && aP !== null) { 1476 bb = (aT(aP) - ag) >= av.cancelThreshold 1477 } 1478 return bb 1479 } 1480 1481 function ae() { 1482 if (av.pinchThreshold !== null) { 1483 return aq >= av.pinchThreshold 1484 } 1485 return true 1486 } 1487 1488 function aA() { 1489 var bb; 1490 if (av.maxTimeThreshold) { 1491 if (ab >= av.maxTimeThreshold) { 1492 bb = false 1493 } else { 1494 bb = true 1495 } 1496 } else { 1497 bb = true 1498 } 1499 return bb 1500 } 1501 1502 function al(bb, bc) { 1503 if (av.preventDefaultEvents === false) { 1504 return 1505 } 1506 if (av.allowPageScroll === m) { 1507 bb.preventDefault() 1508 } else { 1509 var bd = av.allowPageScroll === s; 1510 switch (bc) { 1511 case p: 1512 if ((av.swipeLeft && bd) || (!bd && av.allowPageScroll != D)) { 1513 bb.preventDefault() 1514 } 1515 break; 1516 case o: 1517 if ((av.swipeRight && bd) || (!bd && av.allowPageScroll != D)) { 1518 bb.preventDefault() 1519 } 1520 break; 1521 case e: 1522 if ((av.swipeUp && bd) || (!bd && av.allowPageScroll != u)) { 1523 bb.preventDefault() 1524 } 1525 break; 1526 case x: 1527 if ((av.swipeDown && bd) || (!bd && av.allowPageScroll != u)) { 1528 bb.preventDefault() 1529 } 1530 break 1531 } 1532 } 1533 } 1534 1535 function a8() { 1536 var bc = aO(); 1537 var bb = X(); 1538 var bd = ae(); 1539 return bc && bb && bd 1540 } 1541 1542 function aX() { 1543 return !!(av.pinchStatus || av.pinchIn || av.pinchOut) 1544 } 1545 1546 function P() { 1547 return !!(a8() && aX()) 1548 } 1549 1550 function aV() { 1551 var be = aA(); 1552 var bg = an(); 1553 var bd = aO(); 1554 var bb = X(); 1555 var bc = ba(); 1556 var bf = !bc && bb && bd && bg && be; 1557 return bf 1558 } 1559 1560 function V() { 1561 return !!(av.swipe || av.swipeStatus || av.swipeLeft || av.swipeRight || av.swipeUp || av.swipeDown) 1562 } 1563 1564 function I() { 1565 return !!(aV() && V()) 1566 } 1567 1568 function aO() { 1569 return ((W === av.fingers || av.fingers === i) || !a) 1570 } 1571 1572 function X() { 1573 return aQ[0].end.x !== 0 1574 } 1575 1576 function a6() { 1577 return !!(av.tap) 1578 } 1579 1580 function Y() { 1581 return !!(av.doubleTap) 1582 } 1583 1584 function aU() { 1585 return !!(av.longTap) 1586 } 1587 1588 function Q() { 1589 if (N == null) { 1590 return false 1591 } 1592 var bb = at(); 1593 return (Y() && ((bb - N) <= av.doubleTapThreshold)) 1594 } 1595 1596 function H() { 1597 return Q() 1598 } 1599 1600 function ax() { 1601 return ((W === 1 || !a) && (isNaN(ag) || ag < av.threshold)) 1602 } 1603 1604 function a0() { 1605 return ((ab > av.longTapThreshold) && (ag < r)) 1606 } 1607 1608 function ah() { 1609 return !!(ax() && a6()) 1610 } 1611 1612 function aG() { 1613 return !!(Q() && Y()) 1614 } 1615 1616 function ap() { 1617 return !!(a0() && aU()) 1618 } 1619 1620 function F() { 1621 a5 = at(); 1622 ad = event.touches.length + 1 1623 } 1624 1625 function R() { 1626 a5 = 0; 1627 ad = 0 1628 } 1629 1630 function am() { 1631 var bb = false; 1632 if (a5) { 1633 var bc = at() - a5; 1634 if (bc <= av.fingerReleaseThreshold) { 1635 bb = true 1636 } 1637 } 1638 return bb 1639 } 1640 1641 function aB() { 1642 return !!(aR.data(B + "_intouch") === true) 1643 } 1644 1645 function ao(bb) { 1646 if (bb === true) { 1647 aR.bind(ay, a3); 1648 aR.bind(U, L); 1649 if (S) { 1650 aR.bind(S, K) 1651 } 1652 } else { 1653 aR.unbind(ay, a3, false); 1654 aR.unbind(U, L, false); 1655 if (S) { 1656 aR.unbind(S, K, false) 1657 } 1658 } 1659 aR.data(B + "_intouch", bb === true) 1660 } 1661 1662 function ai(bc, bb) { 1663 var bd = bb.identifier !== undefined ? bb.identifier : 0; 1664 aQ[bc].identifier = bd; 1665 aQ[bc].start.x = aQ[bc].end.x = bb.pageX || bb.clientX; 1666 aQ[bc].start.y = aQ[bc].end.y = bb.pageY || bb.clientY; 1667 return aQ[bc] 1668 } 1669 1670 function aH(bb) { 1671 var bd = bb.identifier !== undefined ? bb.identifier : 0; 1672 var bc = ac(bd); 1673 bc.end.x = bb.pageX || bb.clientX; 1674 bc.end.y = bb.pageY || bb.clientY; 1675 return bc 1676 } 1677 1678 function ac(bc) { 1679 for (var bb = 0; bb < aQ.length; bb++) { 1680 if (aQ[bb].identifier == bc) { 1681 return aQ[bb] 1682 } 1683 } 1684 } 1685 1686 function aj() { 1687 var bb = []; 1688 for (var bc = 0; bc <= 5; bc++) { 1689 bb.push({start: {x: 0, y: 0}, end: {x: 0, y: 0}, identifier: 0}) 1690 } 1691 return bb 1692 } 1693 1694 function aI(bb, bc) { 1695 bc = Math.max(bc, aT(bb));
1696 M[bb].distance = bc 1697 } 1698 1699 function aT(bb) { 1700 if (M[bb]) { 1701 return M[bb].distance 1702 } 1703 return undefined 1704 } 1705 1706 function aa() { 1707 var bb = {}; 1708 bb[p] = aw(p); 1709 bb[o] = aw(o); 1710 bb[e] = aw(e); 1711 bb[x] = aw(x); 1712 return bb 1713 } 1714 1715 function aw(bb) { 1716 return {direction: bb, distance: 0} 1717 } 1718 1719 function aM() { 1720 return a2 - T 1721 } 1722 1723 function au(be, bd) { 1724 var bc = Math.abs(be.x - bd.x); 1725 var bb = Math.abs(be.y - bd.y); 1726 return Math.round(Math.sqrt(bc * bc + bb * bb)) 1727 } 1728 1729 function a7(bb, bc) { 1730 var bd = (bc / bb) * 1; 1731 return bd.toFixed(2) 1732 } 1733 1734 function ar() { 1735 if (G < 1) { 1736 return z 1737 } else { 1738 return c 1739 } 1740 } 1741 1742 function aS(bc, bb) { 1743 return Math.round(Math.sqrt(Math.pow(bb.x - bc.x, 2) + Math.pow(bb.y - bc.y, 2))) 1744 } 1745 1746 function aE(be, bc) { 1747 var bb = be.x - bc.x; 1748 var bg = bc.y - be.y; 1749 var bd = Math.atan2(bg, bb); 1750 var bf = Math.round(bd * 180 / Math.PI); 1751 if (bf < 0) { 1752 bf = 360 - Math.abs(bf) 1753 } 1754 return bf 1755 } 1756 1757 function aL(bc, bb) { 1758 var bd = aE(bc, bb); 1759 if ((bd <= 45) && (bd >= 0)) { 1760 return p 1761 } else { 1762 if ((bd <= 360) && (bd >= 315)) { 1763 return p 1764 } else { 1765 if ((bd >= 135) && (bd <= 225)) { 1766 return o 1767 } else { 1768 if ((bd > 45) && (bd < 135)) { 1769 return x 1770 } else { 1771 return e 1772 } 1773 } 1774 } 1775 } 1776 } 1777 1778 function at() { 1779 var bb = new Date(); 1780 return bb.getTime() 1781 } 1782 1783 function aY(bb) { 1784 bb = f(bb); 1785 var bd = bb.offset(); 1786 var bc = {left: bd.left, right: bd.left + bb.outerWidth(), top: bd.top, bottom: bd.top + bb.outerHeight()}; 1787 return bc 1788 } 1789 1790 function E(bb, bc) { 1791 return (bb.x > bc.left && bb.x < bc.right && bb.y > bc.top && bb.y < bc.bottom) 1792 } 1793 } 1794})); 1795jQuery('.carousel').swipe({ 1796 swipeLeft: function (event, direction, distance, duration, fingerCount) { 1797 jQuery(this).carousel('next'); 1798 }, 1799 swipeRight: function (event, direction, distance, duration, fingerCount) { 1800 jQuery(this).carousel('prev'); 1801 }, 1802 threshold: 0 1803}); 1804 1805/* 1806 * Helper 1807 */ 1808function updateURLParameter(url, param, paramVal) { 1809 var TheAnchor = null; 1810 var newAdditionalURL = ""; 1811 var tempArray = url.split("?"); 1812 var baseURL = tempArray[0]; 1813 var additionalURL = tempArray[1]; 1814 var temp = ""; 1815 1816 if (additionalURL) { 1817 var tmpAnchor = additionalURL.split("#"); 1818 var TheParams = tmpAnchor[0]; 1819 TheAnchor = tmpAnchor[1]; 1820 if (TheAnchor) 1821 additionalURL = TheParams; 1822 1823 tempArray = additionalURL.split("&"); 1824 1825 for (i = 0; i < tempArray.length; i++) { 1826 if (tempArray[i].split('=')[0] != param) { 1827 newAdditionalURL += temp + tempArray[i]; 1828 temp = "&"; 1829 } 1830 } 1831 } else { 1832 var tmpAnchor = baseURL.split("#"); 1833 var TheParams = tmpAnchor[0]; 1834 TheAnchor = tmpAnchor[1]; 1835 1836 if (TheParams) 1837 baseURL = TheParams; 1838 } 1839 1840 if (TheAnchor) 1841 paramVal += "#" + TheAnchor; 1842 1843 var rows_txt = temp + "" + param + "=" + paramVal; 1844 return baseURL + "?" + newAdditionalURL + rows_txt; 1845} 1846 1847/** 1848 * Scroll and open comments on hash 1849 */ 1850jQuery(window).ready(function () { 1851 var hash = location.hash.replace('#', ''); 1852 if (hash == 'comments' && jQuery('body').hasClass('single-product')) { 1853 var offset = 60; 1854 1855 jQuery('.nav-tabs a[href="#tab-comments"]').tab('show'); 1856 1857 jQuery('html, body').animate( 1858 { 1859 scrollTop: jQuery('#atTab').offset().top - offset 1860 }, 1861 1000 1862 ); 1863 } 1864}); 1865 1866 1867/** 1868 * User filter 1869 */ 1870jQuery(document).ready(function () { 1871 // ordering 1872 jQuery(".result-filter select#orderby").change(function () { 1873 if (jQuery('.single-filter').length && jQuery('.single-filter .filterform[data-ajax="true"]').length) {
1874 // trigger ajax 1875 var form = jQuery('.single-filter .filterform[data-ajax="true"]'); 1876 form.find('input[name="orderby"]').val(this.value); 1877 form.submit(); 1878 } else if (jQuery('.widget_filter').length && jQuery('.widget_filter .filterform[data-ajax="true"]').length) { 1879 // trigger ajax for filter in sidebar @props to manuel 1880 var form = jQuery('.widget_filter .filterform[data-ajax="true"]'); 1881 form.find('input[name="orderby"]').val(this.value); 1882 form.submit(); 1883 } else { 1884 window.location = updateURLParameter(window.location.href, 'orderby', this.value); 1885 } 1886 }); 1887 1888 // layout 1889 jQuery(".result-filter a[href*='layout']").click(function () { 1890 if (jQuery('.single-filter').length && jQuery('.single-filter .filterform[data-ajax="true"]').length) { 1891 var form = jQuery('.single-filter .filterform[data-ajax="true"]'); 1892 form.find('input[name="layout"]').val(jQuery(this).attr('data-value')); 1893 form.submit(); 1894 1895 // active class 1896 jQuery(".result-filter a[href*='layout']").removeClass('active'); 1897 jQuery(this).addClass('active'); 1898 1899 return false; 1900 } else if (jQuery('.widget_filter').length && jQuery('.widget_filter .filterform[data-ajax="true"]').length) { 1901 // trigger ajax for filter in sidebar @props to manuel 1902 var form = jQuery('.widget_filter .filterform[data-ajax="true"]'); 1903 form.find('input[name="layout"]').val(jQuery(this).attr('data-value')); 1904 form.submit(); 1905 1906 // active class 1907 jQuery(".result-filter a[href*='layout']").removeClass('active'); 1908 jQuery(this).addClass('active'); 1909 1910 return false; 1911 } 1912 }); 1913}); 1914 1915jQuery(document).ready(function () { 1916 if (jQuery('.product-select').length) { 1917 var select2 = jQuery(".product-select select").select2({ 1918 "language": { 1919 "noResults": function () { 1920 return "<?php _e('Keine Treffer', 'affiliatetheme'); ?>"; 1921 } 1922 }, 1923 matcher: at_compare_search_filter 1924 }); 1925 1926 select2.on("change", function () { 1927 select2.find("option:disabled").prop("disabled", false).removeData("data"); 1928 1929 select2.each(function () { 1930 var val = jQuery(this).val(); 1931 1932 select2.find("option:not(:selected)").filter(function () { 1933 return this.value == val; 1934 }).prop("disabled", true).removeData("data"); 1935 }); 1936 }); 1937 1938 function at_compare_search_filter(params, data) { 1939 // If there are no search terms, return all of the data 1940 if (jQuery.trim(params.term) === '') { 1941 return data; 1942 } 1943 1944 // Do not display the item if there is no 'text' property 1945 if (typeof data.text === 'undefined') { 1946 return null; 1947 } 1948 1949 if (data.text.toLowerCase().indexOf(params.term.toLowerCase()) > -1) { 1950 return data; 1951 } 1952 1953 if (data.text.indexOf(params.term) > -1 || data.element.getAttribute('data-ean').indexOf(params.term) > -1) { 1954 var matchedData = jQuery.extend({}, data, true); 1955 1956 return matchedData; 1957 } 1958 1959 return false; 1960 } 1961 } 1962}); 1963 1964jQuery(document).ready(function () { 1965 jQuery('.widget_filter .filterform select[multiple] option').mousedown(function (e) { 1966 e.preventDefault(); 1967 var originalScrollTop = jQuery(this).parent().scrollTop(); 1968 jQuery(this).prop('selected', jQuery(this).prop('selected') ? false : true); 1969 var self = this; 1970 jQuery(this).parent().focus(); 1971 setTimeout(function () { 1972 jQuery(self).parent().scrollTop(originalScrollTop); 1973 }, 0); 1974 1975 return false; 1976 }); 1977});
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.