Merged in feature/from-pantheon (pull request #16)
code from pantheon * code from pantheon
This commit is contained in:
857
wp/wp-content/themes/child-theme/js/Popper.js
Normal file
857
wp/wp-content/themes/child-theme/js/Popper.js
Normal file
@@ -0,0 +1,857 @@
|
||||
|
||||
/*
|
||||
Copyright (C) Federico Zivolo 2019
|
||||
Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
|
||||
*/
|
||||
(function(e, t) {
|
||||
'object' == typeof exports && 'undefined' != typeof module ? module.exports = t() : 'function' == typeof define && define.amd ? define(t) : e.Popper = t()
|
||||
})(this, function() {
|
||||
'use strict';
|
||||
function e(e) {
|
||||
return e && '[object Function]' === {}.toString.call(e)
|
||||
}
|
||||
function t(e, t) {
|
||||
if (1 !== e.nodeType) return [];
|
||||
var o = e.ownerDocument.defaultView,
|
||||
n = o.getComputedStyle(e, null);
|
||||
return t ? n[t] : n
|
||||
}
|
||||
function o(e) {
|
||||
return 'HTML' === e.nodeName ? e : e.parentNode || e.host
|
||||
}
|
||||
function n(e) {
|
||||
if (!e) return document.body;
|
||||
switch (e.nodeName) {
|
||||
case 'HTML':
|
||||
case 'BODY':
|
||||
return e.ownerDocument.body;
|
||||
case '#document':
|
||||
return e.body;
|
||||
}
|
||||
var i = t(e),
|
||||
r = i.overflow,
|
||||
p = i.overflowX,
|
||||
s = i.overflowY;
|
||||
return /(auto|scroll|overlay)/.test(r + s + p) ? e : n(o(e))
|
||||
}
|
||||
function i(e) {
|
||||
return e && e.referenceNode ? e.referenceNode : e
|
||||
}
|
||||
function r(e) {
|
||||
return 11 === e ? re : 10 === e ? pe : re || pe
|
||||
}
|
||||
function p(e) {
|
||||
if (!e) return document.documentElement;
|
||||
for (var o = r(10) ? document.body : null, n = e.offsetParent || null; n === o && e.nextElementSibling;) n = (e = e.nextElementSibling).offsetParent;
|
||||
var i = n && n.nodeName;
|
||||
return i && 'BODY' !== i && 'HTML' !== i ? -1 !== ['TH', 'TD', 'TABLE'].indexOf(n.nodeName) && 'static' === t(n, 'position') ? p(n) : n : e ? e.ownerDocument.documentElement : document.documentElement
|
||||
}
|
||||
function s(e) {
|
||||
var t = e.nodeName;
|
||||
return 'BODY' !== t && ('HTML' === t || p(e.firstElementChild) === e)
|
||||
}
|
||||
function d(e) {
|
||||
return null === e.parentNode ? e : d(e.parentNode)
|
||||
}
|
||||
function a(e, t) {
|
||||
if (!e || !e.nodeType || !t || !t.nodeType) return document.documentElement;
|
||||
var o = e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING,
|
||||
n = o ? e : t,
|
||||
i = o ? t : e,
|
||||
r = document.createRange();
|
||||
r.setStart(n, 0), r.setEnd(i, 0);
|
||||
var l = r.commonAncestorContainer;
|
||||
if (e !== l && t !== l || n.contains(i)) return s(l) ? l : p(l);
|
||||
var f = d(e);
|
||||
return f.host ? a(f.host, t) : a(e, d(t).host)
|
||||
}
|
||||
function l(e) {
|
||||
var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 'top',
|
||||
o = 'top' === t ? 'scrollTop' : 'scrollLeft',
|
||||
n = e.nodeName;
|
||||
if ('BODY' === n || 'HTML' === n) {
|
||||
var i = e.ownerDocument.documentElement,
|
||||
r = e.ownerDocument.scrollingElement || i;
|
||||
return r[o]
|
||||
}
|
||||
return e[o]
|
||||
}
|
||||
function f(e, t) {
|
||||
var o = 2 < arguments.length && void 0 !== arguments[2] && arguments[2],
|
||||
n = l(t, 'top'),
|
||||
i = l(t, 'left'),
|
||||
r = o ? -1 : 1;
|
||||
return e.top += n * r, e.bottom += n * r, e.left += i * r, e.right += i * r, e
|
||||
}
|
||||
function m(e, t) {
|
||||
var o = 'x' === t ? 'Left' : 'Top',
|
||||
n = 'Left' == o ? 'Right' : 'Bottom';
|
||||
return parseFloat(e['border' + o + 'Width'], 10) + parseFloat(e['border' + n + 'Width'], 10)
|
||||
}
|
||||
function h(e, t, o, n) {
|
||||
return ee(t['offset' + e], t['scroll' + e], o['client' + e], o['offset' + e], o['scroll' + e], r(10) ? parseInt(o['offset' + e]) + parseInt(n['margin' + ('Height' === e ? 'Top' : 'Left')]) + parseInt(n['margin' + ('Height' === e ? 'Bottom' : 'Right')]) : 0)
|
||||
}
|
||||
function c(e) {
|
||||
var t = e.body,
|
||||
o = e.documentElement,
|
||||
n = r(10) && getComputedStyle(o);
|
||||
return {
|
||||
height: h('Height', t, o, n),
|
||||
width: h('Width', t, o, n)
|
||||
}
|
||||
}
|
||||
function g(e) {
|
||||
return le({}, e, {
|
||||
right: e.left + e.width,
|
||||
bottom: e.top + e.height
|
||||
})
|
||||
}
|
||||
function u(e) {
|
||||
var o = {};
|
||||
try {
|
||||
if (r(10)) {
|
||||
o = e.getBoundingClientRect();
|
||||
var n = l(e, 'top'),
|
||||
i = l(e, 'left');
|
||||
o.top += n, o.left += i, o.bottom += n, o.right += i
|
||||
} else o = e.getBoundingClientRect()
|
||||
} catch (t) {}
|
||||
var p = {
|
||||
left: o.left,
|
||||
top: o.top,
|
||||
width: o.right - o.left,
|
||||
height: o.bottom - o.top
|
||||
},
|
||||
s = 'HTML' === e.nodeName ? c(e.ownerDocument) : {},
|
||||
d = s.width || e.clientWidth || p.width,
|
||||
a = s.height || e.clientHeight || p.height,
|
||||
f = e.offsetWidth - d,
|
||||
h = e.offsetHeight - a;
|
||||
if (f || h) {
|
||||
var u = t(e);
|
||||
f -= m(u, 'x'), h -= m(u, 'y'), p.width -= f, p.height -= h
|
||||
}
|
||||
return g(p)
|
||||
}
|
||||
function b(e, o) {
|
||||
var i = 2 < arguments.length && void 0 !== arguments[2] && arguments[2],
|
||||
p = r(10),
|
||||
s = 'HTML' === o.nodeName,
|
||||
d = u(e),
|
||||
a = u(o),
|
||||
l = n(e),
|
||||
m = t(o),
|
||||
h = parseFloat(m.borderTopWidth, 10),
|
||||
c = parseFloat(m.borderLeftWidth, 10);
|
||||
i && s && (a.top = ee(a.top, 0), a.left = ee(a.left, 0));
|
||||
var b = g({
|
||||
top: d.top - a.top - h,
|
||||
left: d.left - a.left - c,
|
||||
width: d.width,
|
||||
height: d.height
|
||||
});
|
||||
if (b.marginTop = 0, b.marginLeft = 0, !p && s) {
|
||||
var w = parseFloat(m.marginTop, 10),
|
||||
y = parseFloat(m.marginLeft, 10);
|
||||
b.top -= h - w, b.bottom -= h - w, b.left -= c - y, b.right -= c - y, b.marginTop = w, b.marginLeft = y
|
||||
}
|
||||
return (p && !i ? o.contains(l) : o === l && 'BODY' !== l.nodeName) && (b = f(b, o)), b
|
||||
}
|
||||
function w(e) {
|
||||
var t = 1 < arguments.length && void 0 !== arguments[1] && arguments[1],
|
||||
o = e.ownerDocument.documentElement,
|
||||
n = b(e, o),
|
||||
i = ee(o.clientWidth, window.innerWidth || 0),
|
||||
r = ee(o.clientHeight, window.innerHeight || 0),
|
||||
p = t ? 0 : l(o),
|
||||
s = t ? 0 : l(o, 'left'),
|
||||
d = {
|
||||
top: p - n.top + n.marginTop,
|
||||
left: s - n.left + n.marginLeft,
|
||||
width: i,
|
||||
height: r
|
||||
};
|
||||
return g(d)
|
||||
}
|
||||
function y(e) {
|
||||
var n = e.nodeName;
|
||||
if ('BODY' === n || 'HTML' === n) return !1;
|
||||
if ('fixed' === t(e, 'position')) return !0;
|
||||
var i = o(e);
|
||||
return !!i && y(i)
|
||||
}
|
||||
function E(e) {
|
||||
if (!e || !e.parentElement || r()) return document.documentElement;
|
||||
for (var o = e.parentElement; o && 'none' === t(o, 'transform');) o = o.parentElement;
|
||||
return o || document.documentElement
|
||||
}
|
||||
function v(e, t, r, p) {
|
||||
var s = 4 < arguments.length && void 0 !== arguments[4] && arguments[4],
|
||||
d = {
|
||||
top: 0,
|
||||
left: 0
|
||||
},
|
||||
l = s ? E(e) : a(e, i(t));
|
||||
if ('viewport' === p) d = w(l, s);
|
||||
else {
|
||||
var f;
|
||||
'scrollParent' === p ? (f = n(o(t)), 'BODY' === f.nodeName && (f = e.ownerDocument.documentElement)) : 'window' === p ? f = e.ownerDocument.documentElement : f = p;
|
||||
var m = b(f, l, s);
|
||||
if ('HTML' === f.nodeName && !y(l)) {
|
||||
var h = c(e.ownerDocument),
|
||||
g = h.height,
|
||||
u = h.width;
|
||||
d.top += m.top - m.marginTop, d.bottom = g + m.top, d.left += m.left - m.marginLeft, d.right = u + m.left
|
||||
} else d = m
|
||||
}
|
||||
r = r || 0;
|
||||
var v = 'number' == typeof r;
|
||||
return d.left += v ? r : r.left || 0, d.top += v ? r : r.top || 0, d.right -= v ? r : r.right || 0, d.bottom -= v ? r : r.bottom || 0, d
|
||||
}
|
||||
function x(e) {
|
||||
var t = e.width,
|
||||
o = e.height;
|
||||
return t * o
|
||||
}
|
||||
function O(e, t, o, n, i) {
|
||||
var r = 5 < arguments.length && void 0 !== arguments[5] ? arguments[5] : 0;
|
||||
if (-1 === e.indexOf('auto')) return e;
|
||||
var p = v(o, n, r, i),
|
||||
s = {
|
||||
top: {
|
||||
width: p.width,
|
||||
height: t.top - p.top
|
||||
},
|
||||
right: {
|
||||
width: p.right - t.right,
|
||||
height: p.height
|
||||
},
|
||||
bottom: {
|
||||
width: p.width,
|
||||
height: p.bottom - t.bottom
|
||||
},
|
||||
left: {
|
||||
width: t.left - p.left,
|
||||
height: p.height
|
||||
}
|
||||
},
|
||||
d = Object.keys(s).map(function(e) {
|
||||
return le({
|
||||
key: e
|
||||
}, s[e], {
|
||||
area: x(s[e])
|
||||
})
|
||||
}).sort(function(e, t) {
|
||||
return t.area - e.area
|
||||
}),
|
||||
a = d.filter(function(e) {
|
||||
var t = e.width,
|
||||
n = e.height;
|
||||
return t >= o.clientWidth && n >= o.clientHeight
|
||||
}),
|
||||
l = 0 < a.length ? a[0].key : d[0].key,
|
||||
f = e.split('-')[1];
|
||||
return l + (f ? '-' + f : '')
|
||||
}
|
||||
function L(e, t, o) {
|
||||
var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null,
|
||||
r = n ? E(t) : a(t, i(o));
|
||||
return b(o, r, n)
|
||||
}
|
||||
function S(e) {
|
||||
var t = e.ownerDocument.defaultView,
|
||||
o = t.getComputedStyle(e),
|
||||
n = parseFloat(o.marginTop || 0) + parseFloat(o.marginBottom || 0),
|
||||
i = parseFloat(o.marginLeft || 0) + parseFloat(o.marginRight || 0),
|
||||
r = {
|
||||
width: e.offsetWidth + i,
|
||||
height: e.offsetHeight + n
|
||||
};
|
||||
return r
|
||||
}
|
||||
function T(e) {
|
||||
var t = {
|
||||
left: 'right',
|
||||
right: 'left',
|
||||
bottom: 'top',
|
||||
top: 'bottom'
|
||||
};
|
||||
return e.replace(/left|right|bottom|top/g, function(e) {
|
||||
return t[e]
|
||||
})
|
||||
}
|
||||
function C(e, t, o) {
|
||||
o = o.split('-')[0];
|
||||
var n = S(e),
|
||||
i = {
|
||||
width: n.width,
|
||||
height: n.height
|
||||
},
|
||||
r = -1 !== ['right', 'left'].indexOf(o),
|
||||
p = r ? 'top' : 'left',
|
||||
s = r ? 'left' : 'top',
|
||||
d = r ? 'height' : 'width',
|
||||
a = r ? 'width' : 'height';
|
||||
return i[p] = t[p] + t[d] / 2 - n[d] / 2, i[s] = o === s ? t[s] - n[a] : t[T(s)], i
|
||||
}
|
||||
function D(e, t) {
|
||||
return Array.prototype.find ? e.find(t) : e.filter(t)[0]
|
||||
}
|
||||
function N(e, t, o) {
|
||||
if (Array.prototype.findIndex) return e.findIndex(function(e) {
|
||||
return e[t] === o
|
||||
});
|
||||
var n = D(e, function(e) {
|
||||
return e[t] === o
|
||||
});
|
||||
return e.indexOf(n)
|
||||
}
|
||||
function P(t, o, n) {
|
||||
var i = void 0 === n ? t : t.slice(0, N(t, 'name', n));
|
||||
return i.forEach(function(t) {
|
||||
t['function'] && console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
|
||||
var n = t['function'] || t.fn;
|
||||
t.enabled && e(n) && (o.offsets.popper = g(o.offsets.popper), o.offsets.reference = g(o.offsets.reference), o = n(o, t))
|
||||
}), o
|
||||
}
|
||||
function k() {
|
||||
if (!this.state.isDestroyed) {
|
||||
var e = {
|
||||
instance: this,
|
||||
styles: {},
|
||||
arrowStyles: {},
|
||||
attributes: {},
|
||||
flipped: !1,
|
||||
offsets: {}
|
||||
};
|
||||
e.offsets.reference = L(this.state, this.popper, this.reference, this.options.positionFixed), e.placement = O(this.options.placement, e.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding), e.originalPlacement = e.placement, e.positionFixed = this.options.positionFixed, e.offsets.popper = C(this.popper, e.offsets.reference, e.placement), e.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute', e = P(this.modifiers, e), this.state.isCreated ? this.options.onUpdate(e) : (this.state.isCreated = !0, this.options.onCreate(e))
|
||||
}
|
||||
}
|
||||
function W(e, t) {
|
||||
return e.some(function(e) {
|
||||
var o = e.name,
|
||||
n = e.enabled;
|
||||
return n && o === t
|
||||
})
|
||||
}
|
||||
function B(e) {
|
||||
for (var t = [!1, 'ms', 'Webkit', 'Moz', 'O'], o = e.charAt(0).toUpperCase() + e.slice(1), n = 0; n < t.length; n++) {
|
||||
var i = t[n],
|
||||
r = i ? '' + i + o : e;
|
||||
if ('undefined' != typeof document.body.style[r]) return r
|
||||
}
|
||||
return null
|
||||
}
|
||||
function H() {
|
||||
return this.state.isDestroyed = !0, W(this.modifiers, 'applyStyle') && (this.popper.removeAttribute('x-placement'), this.popper.style.position = '', this.popper.style.top = '', this.popper.style.left = '', this.popper.style.right = '', this.popper.style.bottom = '', this.popper.style.willChange = '', this.popper.style[B('transform')] = ''), this.disableEventListeners(), this.options.removeOnDestroy && this.popper.parentNode.removeChild(this.popper), this
|
||||
}
|
||||
function A(e) {
|
||||
var t = e.ownerDocument;
|
||||
return t ? t.defaultView : window
|
||||
}
|
||||
function M(e, t, o, i) {
|
||||
var r = 'BODY' === e.nodeName,
|
||||
p = r ? e.ownerDocument.defaultView : e;
|
||||
p.addEventListener(t, o, {
|
||||
passive: !0
|
||||
}), r || M(n(p.parentNode), t, o, i), i.push(p)
|
||||
}
|
||||
function F(e, t, o, i) {
|
||||
o.updateBound = i, A(e).addEventListener('resize', o.updateBound, {
|
||||
passive: !0
|
||||
});
|
||||
var r = n(e);
|
||||
return M(r, 'scroll', o.updateBound, o.scrollParents), o.scrollElement = r, o.eventsEnabled = !0, o
|
||||
}
|
||||
function I() {
|
||||
this.state.eventsEnabled || (this.state = F(this.reference, this.options, this.state, this.scheduleUpdate))
|
||||
}
|
||||
function R(e, t) {
|
||||
return A(e).removeEventListener('resize', t.updateBound), t.scrollParents.forEach(function(e) {
|
||||
e.removeEventListener('scroll', t.updateBound)
|
||||
}), t.updateBound = null, t.scrollParents = [], t.scrollElement = null, t.eventsEnabled = !1, t
|
||||
}
|
||||
function U() {
|
||||
this.state.eventsEnabled && (cancelAnimationFrame(this.scheduleUpdate), this.state = R(this.reference, this.state))
|
||||
}
|
||||
function Y(e) {
|
||||
return '' !== e && !isNaN(parseFloat(e)) && isFinite(e)
|
||||
}
|
||||
function V(e, t) {
|
||||
Object.keys(t).forEach(function(o) {
|
||||
var n = ''; - 1 !== ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(o) && Y(t[o]) && (n = 'px'), e.style[o] = t[o] + n
|
||||
})
|
||||
}
|
||||
function j(e, t) {
|
||||
Object.keys(t).forEach(function(o) {
|
||||
var n = t[o];
|
||||
!1 === n ? e.removeAttribute(o) : e.setAttribute(o, t[o])
|
||||
})
|
||||
}
|
||||
function q(e, t) {
|
||||
var o = e.offsets,
|
||||
n = o.popper,
|
||||
i = o.reference,
|
||||
r = $,
|
||||
p = function(e) {
|
||||
return e
|
||||
},
|
||||
s = r(i.width),
|
||||
d = r(n.width),
|
||||
a = -1 !== ['left', 'right'].indexOf(e.placement),
|
||||
l = -1 !== e.placement.indexOf('-'),
|
||||
f = t ? a || l || s % 2 == d % 2 ? r : Z : p,
|
||||
m = t ? r : p;
|
||||
return {
|
||||
left: f(1 == s % 2 && 1 == d % 2 && !l && t ? n.left - 1 : n.left),
|
||||
top: m(n.top),
|
||||
bottom: m(n.bottom),
|
||||
right: f(n.right)
|
||||
}
|
||||
}
|
||||
function K(e, t, o) {
|
||||
var n = D(e, function(e) {
|
||||
var o = e.name;
|
||||
return o === t
|
||||
}),
|
||||
i = !!n && e.some(function(e) {
|
||||
return e.name === o && e.enabled && e.order < n.order
|
||||
});
|
||||
if (!i) {
|
||||
var r = '`' + t + '`';
|
||||
console.warn('`' + o + '`' + ' modifier is required by ' + r + ' modifier in order to work, be sure to include it before ' + r + '!')
|
||||
}
|
||||
return i
|
||||
}
|
||||
function z(e) {
|
||||
return 'end' === e ? 'start' : 'start' === e ? 'end' : e
|
||||
}
|
||||
function G(e) {
|
||||
var t = 1 < arguments.length && void 0 !== arguments[1] && arguments[1],
|
||||
o = he.indexOf(e),
|
||||
n = he.slice(o + 1).concat(he.slice(0, o));
|
||||
return t ? n.reverse() : n
|
||||
}
|
||||
function _(e, t, o, n) {
|
||||
var i = e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),
|
||||
r = +i[1],
|
||||
p = i[2];
|
||||
if (!r) return e;
|
||||
if (0 === p.indexOf('%')) {
|
||||
var s;
|
||||
switch (p) {
|
||||
case '%p':
|
||||
s = o;
|
||||
break;
|
||||
case '%':
|
||||
case '%r':
|
||||
default:
|
||||
s = n;
|
||||
}
|
||||
var d = g(s);
|
||||
return d[t] / 100 * r
|
||||
}
|
||||
if ('vh' === p || 'vw' === p) {
|
||||
var a;
|
||||
return a = 'vh' === p ? ee(document.documentElement.clientHeight, window.innerHeight || 0) : ee(document.documentElement.clientWidth, window.innerWidth || 0), a / 100 * r
|
||||
}
|
||||
return r
|
||||
}
|
||||
function X(e, t, o, n) {
|
||||
var i = [0, 0],
|
||||
r = -1 !== ['right', 'left'].indexOf(n),
|
||||
p = e.split(/(\+|\-)/).map(function(e) {
|
||||
return e.trim()
|
||||
}),
|
||||
s = p.indexOf(D(p, function(e) {
|
||||
return -1 !== e.search(/,|\s/)
|
||||
}));
|
||||
p[s] && -1 === p[s].indexOf(',') && console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
|
||||
var d = /\s*,\s*|\s+/,
|
||||
a = -1 === s ? [p] : [p.slice(0, s).concat([p[s].split(d)[0]]), [p[s].split(d)[1]].concat(p.slice(s + 1))];
|
||||
return a = a.map(function(e, n) {
|
||||
var i = (1 === n ? !r : r) ? 'height' : 'width',
|
||||
p = !1;
|
||||
return e.reduce(function(e, t) {
|
||||
return '' === e[e.length - 1] && -1 !== ['+', '-'].indexOf(t) ? (e[e.length - 1] = t, p = !0, e) : p ? (e[e.length - 1] += t, p = !1, e) : e.concat(t)
|
||||
}, []).map(function(e) {
|
||||
return _(e, i, t, o)
|
||||
})
|
||||
}), a.forEach(function(e, t) {
|
||||
e.forEach(function(o, n) {
|
||||
Y(o) && (i[t] += o * ('-' === e[n - 1] ? -1 : 1))
|
||||
})
|
||||
}), i
|
||||
}
|
||||
function J(e, t) {
|
||||
var o, n = t.offset,
|
||||
i = e.placement,
|
||||
r = e.offsets,
|
||||
p = r.popper,
|
||||
s = r.reference,
|
||||
d = i.split('-')[0];
|
||||
return o = Y(+n) ? [+n, 0] : X(n, p, s, d), 'left' === d ? (p.top += o[0], p.left -= o[1]) : 'right' === d ? (p.top += o[0], p.left += o[1]) : 'top' === d ? (p.left += o[0], p.top -= o[1]) : 'bottom' === d && (p.left += o[0], p.top += o[1]), e.popper = p, e
|
||||
}
|
||||
var Q = Math.min,
|
||||
Z = Math.floor,
|
||||
$ = Math.round,
|
||||
ee = Math.max,
|
||||
te = 'undefined' != typeof window && 'undefined' != typeof document && 'undefined' != typeof navigator,
|
||||
oe = function() {
|
||||
for (var e = ['Edge', 'Trident', 'Firefox'], t = 0; t < e.length; t += 1)
|
||||
if (te && 0 <= navigator.userAgent.indexOf(e[t])) return 1;
|
||||
return 0
|
||||
}(),
|
||||
ne = te && window.Promise,
|
||||
ie = ne ? function(e) {
|
||||
var t = !1;
|
||||
return function() {
|
||||
t || (t = !0, window.Promise.resolve().then(function() {
|
||||
t = !1, e()
|
||||
}))
|
||||
}
|
||||
} : function(e) {
|
||||
var t = !1;
|
||||
return function() {
|
||||
t || (t = !0, setTimeout(function() {
|
||||
t = !1, e()
|
||||
}, oe))
|
||||
}
|
||||
},
|
||||
re = te && !!(window.MSInputMethodContext && document.documentMode),
|
||||
pe = te && /MSIE 10/.test(navigator.userAgent),
|
||||
se = function(e, t) {
|
||||
if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
|
||||
},
|
||||
de = function() {
|
||||
function e(e, t) {
|
||||
for (var o, n = 0; n < t.length; n++) o = t[n], o.enumerable = o.enumerable || !1, o.configurable = !0, 'value' in o && (o.writable = !0), Object.defineProperty(e, o.key, o)
|
||||
}
|
||||
return function(t, o, n) {
|
||||
return o && e(t.prototype, o), n && e(t, n), t
|
||||
}
|
||||
}(),
|
||||
ae = function(e, t, o) {
|
||||
return t in e ? Object.defineProperty(e, t, {
|
||||
value: o,
|
||||
enumerable: !0,
|
||||
configurable: !0,
|
||||
writable: !0
|
||||
}) : e[t] = o, e
|
||||
},
|
||||
le = Object.assign || function(e) {
|
||||
for (var t, o = 1; o < arguments.length; o++)
|
||||
for (var n in t = arguments[o], t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
||||
return e
|
||||
},
|
||||
fe = te && /Firefox/i.test(navigator.userAgent),
|
||||
me = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'],
|
||||
he = me.slice(3),
|
||||
ce = {
|
||||
FLIP: 'flip',
|
||||
CLOCKWISE: 'clockwise',
|
||||
COUNTERCLOCKWISE: 'counterclockwise'
|
||||
},
|
||||
ge = function() {
|
||||
function t(o, n) {
|
||||
var i = this,
|
||||
r = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : {};
|
||||
se(this, t), this.scheduleUpdate = function() {
|
||||
return requestAnimationFrame(i.update)
|
||||
}, this.update = ie(this.update.bind(this)), this.options = le({}, t.Defaults, r), this.state = {
|
||||
isDestroyed: !1,
|
||||
isCreated: !1,
|
||||
scrollParents: []
|
||||
}, this.reference = o && o.jquery ? o[0] : o, this.popper = n && n.jquery ? n[0] : n, this.options.modifiers = {}, Object.keys(le({}, t.Defaults.modifiers, r.modifiers)).forEach(function(e) {
|
||||
i.options.modifiers[e] = le({}, t.Defaults.modifiers[e] || {}, r.modifiers ? r.modifiers[e] : {})
|
||||
}), this.modifiers = Object.keys(this.options.modifiers).map(function(e) {
|
||||
return le({
|
||||
name: e
|
||||
}, i.options.modifiers[e])
|
||||
}).sort(function(e, t) {
|
||||
return e.order - t.order
|
||||
}), this.modifiers.forEach(function(t) {
|
||||
t.enabled && e(t.onLoad) && t.onLoad(i.reference, i.popper, i.options, t, i.state)
|
||||
}), this.update();
|
||||
var p = this.options.eventsEnabled;
|
||||
p && this.enableEventListeners(), this.state.eventsEnabled = p
|
||||
}
|
||||
return de(t, [{
|
||||
key: 'update',
|
||||
value: function() {
|
||||
return k.call(this)
|
||||
}
|
||||
}, {
|
||||
key: 'destroy',
|
||||
value: function() {
|
||||
return H.call(this)
|
||||
}
|
||||
}, {
|
||||
key: 'enableEventListeners',
|
||||
value: function() {
|
||||
return I.call(this)
|
||||
}
|
||||
}, {
|
||||
key: 'disableEventListeners',
|
||||
value: function() {
|
||||
return U.call(this)
|
||||
}
|
||||
}]), t
|
||||
}();
|
||||
return ge.Utils = ('undefined' == typeof window ? global : window).PopperUtils, ge.placements = me, ge.Defaults = {
|
||||
placement: 'bottom',
|
||||
positionFixed: !1,
|
||||
eventsEnabled: !0,
|
||||
removeOnDestroy: !1,
|
||||
onCreate: function() {},
|
||||
onUpdate: function() {},
|
||||
modifiers: {
|
||||
shift: {
|
||||
order: 100,
|
||||
enabled: !0,
|
||||
fn: function(e) {
|
||||
var t = e.placement,
|
||||
o = t.split('-')[0],
|
||||
n = t.split('-')[1];
|
||||
if (n) {
|
||||
var i = e.offsets,
|
||||
r = i.reference,
|
||||
p = i.popper,
|
||||
s = -1 !== ['bottom', 'top'].indexOf(o),
|
||||
d = s ? 'left' : 'top',
|
||||
a = s ? 'width' : 'height',
|
||||
l = {
|
||||
start: ae({}, d, r[d]),
|
||||
end: ae({}, d, r[d] + r[a] - p[a])
|
||||
};
|
||||
e.offsets.popper = le({}, p, l[n])
|
||||
}
|
||||
return e
|
||||
}
|
||||
},
|
||||
offset: {
|
||||
order: 200,
|
||||
enabled: !0,
|
||||
fn: J,
|
||||
offset: 0
|
||||
},
|
||||
preventOverflow: {
|
||||
order: 300,
|
||||
enabled: !0,
|
||||
fn: function(e, t) {
|
||||
var o = t.boundariesElement || p(e.instance.popper);
|
||||
e.instance.reference === o && (o = p(o));
|
||||
var n = B('transform'),
|
||||
i = e.instance.popper.style,
|
||||
r = i.top,
|
||||
s = i.left,
|
||||
d = i[n];
|
||||
i.top = '', i.left = '', i[n] = '';
|
||||
var a = v(e.instance.popper, e.instance.reference, t.padding, o, e.positionFixed);
|
||||
i.top = r, i.left = s, i[n] = d, t.boundaries = a;
|
||||
var l = t.priority,
|
||||
f = e.offsets.popper,
|
||||
m = {
|
||||
primary: function(e) {
|
||||
var o = f[e];
|
||||
return f[e] < a[e] && !t.escapeWithReference && (o = ee(f[e], a[e])), ae({}, e, o)
|
||||
},
|
||||
secondary: function(e) {
|
||||
var o = 'right' === e ? 'left' : 'top',
|
||||
n = f[o];
|
||||
return f[e] > a[e] && !t.escapeWithReference && (n = Q(f[o], a[e] - ('right' === e ? f.width : f.height))), ae({}, o, n)
|
||||
}
|
||||
};
|
||||
return l.forEach(function(e) {
|
||||
var t = -1 === ['left', 'top'].indexOf(e) ? 'secondary' : 'primary';
|
||||
f = le({}, f, m[t](e))
|
||||
}), e.offsets.popper = f, e
|
||||
},
|
||||
priority: ['left', 'right', 'top', 'bottom'],
|
||||
padding: 5,
|
||||
boundariesElement: 'scrollParent'
|
||||
},
|
||||
keepTogether: {
|
||||
order: 400,
|
||||
enabled: !0,
|
||||
fn: function(e) {
|
||||
var t = e.offsets,
|
||||
o = t.popper,
|
||||
n = t.reference,
|
||||
i = e.placement.split('-')[0],
|
||||
r = Z,
|
||||
p = -1 !== ['top', 'bottom'].indexOf(i),
|
||||
s = p ? 'right' : 'bottom',
|
||||
d = p ? 'left' : 'top',
|
||||
a = p ? 'width' : 'height';
|
||||
return o[s] < r(n[d]) && (e.offsets.popper[d] = r(n[d]) - o[a]), o[d] > r(n[s]) && (e.offsets.popper[d] = r(n[s])), e
|
||||
}
|
||||
},
|
||||
arrow: {
|
||||
order: 500,
|
||||
enabled: !0,
|
||||
fn: function(e, o) {
|
||||
var n;
|
||||
if (!K(e.instance.modifiers, 'arrow', 'keepTogether')) return e;
|
||||
var i = o.element;
|
||||
if ('string' == typeof i) {
|
||||
if (i = e.instance.popper.querySelector(i), !i) return e;
|
||||
} else if (!e.instance.popper.contains(i)) return console.warn('WARNING: `arrow.element` must be child of its popper element!'), e;
|
||||
var r = e.placement.split('-')[0],
|
||||
p = e.offsets,
|
||||
s = p.popper,
|
||||
d = p.reference,
|
||||
a = -1 !== ['left', 'right'].indexOf(r),
|
||||
l = a ? 'height' : 'width',
|
||||
f = a ? 'Top' : 'Left',
|
||||
m = f.toLowerCase(),
|
||||
h = a ? 'left' : 'top',
|
||||
c = a ? 'bottom' : 'right',
|
||||
u = S(i)[l];
|
||||
d[c] - u < s[m] && (e.offsets.popper[m] -= s[m] - (d[c] - u)), d[m] + u > s[c] && (e.offsets.popper[m] += d[m] + u - s[c]), e.offsets.popper = g(e.offsets.popper);
|
||||
var b = d[m] + d[l] / 2 - u / 2,
|
||||
w = t(e.instance.popper),
|
||||
y = parseFloat(w['margin' + f], 10),
|
||||
E = parseFloat(w['border' + f + 'Width'], 10),
|
||||
v = b - e.offsets.popper[m] - y - E;
|
||||
return v = ee(Q(s[l] - u, v), 0), e.arrowElement = i, e.offsets.arrow = (n = {}, ae(n, m, $(v)), ae(n, h, ''), n), e
|
||||
},
|
||||
element: '[x-arrow]'
|
||||
},
|
||||
flip: {
|
||||
order: 600,
|
||||
enabled: !0,
|
||||
fn: function(e, t) {
|
||||
if (W(e.instance.modifiers, 'inner')) return e;
|
||||
if (e.flipped && e.placement === e.originalPlacement) return e;
|
||||
var o = v(e.instance.popper, e.instance.reference, t.padding, t.boundariesElement, e.positionFixed),
|
||||
n = e.placement.split('-')[0],
|
||||
i = T(n),
|
||||
r = e.placement.split('-')[1] || '',
|
||||
p = [];
|
||||
switch (t.behavior) {
|
||||
case ce.FLIP:
|
||||
p = [n, i];
|
||||
break;
|
||||
case ce.CLOCKWISE:
|
||||
p = G(n);
|
||||
break;
|
||||
case ce.COUNTERCLOCKWISE:
|
||||
p = G(n, !0);
|
||||
break;
|
||||
default:
|
||||
p = t.behavior;
|
||||
}
|
||||
return p.forEach(function(s, d) {
|
||||
if (n !== s || p.length === d + 1) return e;
|
||||
n = e.placement.split('-')[0], i = T(n);
|
||||
var a = e.offsets.popper,
|
||||
l = e.offsets.reference,
|
||||
f = Z,
|
||||
m = 'left' === n && f(a.right) > f(l.left) || 'right' === n && f(a.left) < f(l.right) || 'top' === n && f(a.bottom) > f(l.top) || 'bottom' === n && f(a.top) < f(l.bottom),
|
||||
h = f(a.left) < f(o.left),
|
||||
c = f(a.right) > f(o.right),
|
||||
g = f(a.top) < f(o.top),
|
||||
u = f(a.bottom) > f(o.bottom),
|
||||
b = 'left' === n && h || 'right' === n && c || 'top' === n && g || 'bottom' === n && u,
|
||||
w = -1 !== ['top', 'bottom'].indexOf(n),
|
||||
y = !!t.flipVariations && (w && 'start' === r && h || w && 'end' === r && c || !w && 'start' === r && g || !w && 'end' === r && u),
|
||||
E = !!t.flipVariationsByContent && (w && 'start' === r && c || w && 'end' === r && h || !w && 'start' === r && u || !w && 'end' === r && g),
|
||||
v = y || E;
|
||||
(m || b || v) && (e.flipped = !0, (m || b) && (n = p[d + 1]), v && (r = z(r)), e.placement = n + (r ? '-' + r : ''), e.offsets.popper = le({}, e.offsets.popper, C(e.instance.popper, e.offsets.reference, e.placement)), e = P(e.instance.modifiers, e, 'flip'))
|
||||
}), e
|
||||
},
|
||||
behavior: 'flip',
|
||||
padding: 5,
|
||||
boundariesElement: 'viewport',
|
||||
flipVariations: !1,
|
||||
flipVariationsByContent: !1
|
||||
},
|
||||
inner: {
|
||||
order: 700,
|
||||
enabled: !1,
|
||||
fn: function(e) {
|
||||
var t = e.placement,
|
||||
o = t.split('-')[0],
|
||||
n = e.offsets,
|
||||
i = n.popper,
|
||||
r = n.reference,
|
||||
p = -1 !== ['left', 'right'].indexOf(o),
|
||||
s = -1 === ['top', 'left'].indexOf(o);
|
||||
return i[p ? 'left' : 'top'] = r[o] - (s ? i[p ? 'width' : 'height'] : 0), e.placement = T(t), e.offsets.popper = g(i), e
|
||||
}
|
||||
},
|
||||
hide: {
|
||||
order: 800,
|
||||
enabled: !0,
|
||||
fn: function(e) {
|
||||
if (!K(e.instance.modifiers, 'hide', 'preventOverflow')) return e;
|
||||
var t = e.offsets.reference,
|
||||
o = D(e.instance.modifiers, function(e) {
|
||||
return 'preventOverflow' === e.name
|
||||
}).boundaries;
|
||||
if (t.bottom < o.top || t.left > o.right || t.top > o.bottom || t.right < o.left) {
|
||||
if (!0 === e.hide) return e;
|
||||
e.hide = !0, e.attributes['x-out-of-boundaries'] = ''
|
||||
} else {
|
||||
if (!1 === e.hide) return e;
|
||||
e.hide = !1, e.attributes['x-out-of-boundaries'] = !1
|
||||
}
|
||||
return e
|
||||
}
|
||||
},
|
||||
computeStyle: {
|
||||
order: 850,
|
||||
enabled: !0,
|
||||
fn: function(e, t) {
|
||||
var o = t.x,
|
||||
n = t.y,
|
||||
i = e.offsets.popper,
|
||||
r = D(e.instance.modifiers, function(e) {
|
||||
return 'applyStyle' === e.name
|
||||
}).gpuAcceleration;
|
||||
void 0 !== r && console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
|
||||
var s, d, a = void 0 === r ? t.gpuAcceleration : r,
|
||||
l = p(e.instance.popper),
|
||||
f = u(l),
|
||||
m = {
|
||||
position: i.position
|
||||
},
|
||||
h = q(e, 2 > window.devicePixelRatio || !fe),
|
||||
c = 'bottom' === o ? 'top' : 'bottom',
|
||||
g = 'right' === n ? 'left' : 'right',
|
||||
b = B('transform');
|
||||
if (d = 'bottom' == c ? 'HTML' === l.nodeName ? -l.clientHeight + h.bottom : -f.height + h.bottom : h.top, s = 'right' == g ? 'HTML' === l.nodeName ? -l.clientWidth + h.right : -f.width + h.right : h.left, a && b) m[b] = 'translate3d(' + s + 'px, ' + d + 'px, 0)', m[c] = 0, m[g] = 0, m.willChange = 'transform';
|
||||
else {
|
||||
var w = 'bottom' == c ? -1 : 1,
|
||||
y = 'right' == g ? -1 : 1;
|
||||
m[c] = d * w, m[g] = s * y, m.willChange = c + ', ' + g
|
||||
}
|
||||
var E = {
|
||||
"x-placement": e.placement
|
||||
};
|
||||
return e.attributes = le({}, E, e.attributes), e.styles = le({}, m, e.styles), e.arrowStyles = le({}, e.offsets.arrow, e.arrowStyles), e
|
||||
},
|
||||
gpuAcceleration: !0,
|
||||
x: 'bottom',
|
||||
y: 'right'
|
||||
},
|
||||
applyStyle: {
|
||||
order: 900,
|
||||
enabled: !0,
|
||||
fn: function(e) {
|
||||
return V(e.instance.popper, e.styles), j(e.instance.popper, e.attributes), e.arrowElement && Object.keys(e.arrowStyles).length && V(e.arrowElement, e.arrowStyles), e
|
||||
},
|
||||
onLoad: function(e, t, o, n, i) {
|
||||
var r = L(i, t, e, o.positionFixed),
|
||||
p = O(o.placement, r, t, e, o.modifiers.flip.boundariesElement, o.modifiers.flip.padding);
|
||||
return t.setAttribute('x-placement', p), V(t, {
|
||||
position: o.positionFixed ? 'fixed' : 'absolute'
|
||||
}), o
|
||||
},
|
||||
gpuAcceleration: void 0
|
||||
}
|
||||
}
|
||||
}, ge
|
||||
});
|
||||
//# sourceMappingURL=popper.min.js.map
|
||||
4418
wp/wp-content/themes/child-theme/js/bootstrap.js
vendored
Normal file
4418
wp/wp-content/themes/child-theme/js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
wp/wp-content/themes/child-theme/js/bootstrap.min.js
vendored
Normal file
7
wp/wp-content/themes/child-theme/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
wp/wp-content/themes/child-theme/js/cleave.min.js
vendored
Normal file
8
wp/wp-content/themes/child-theme/js/cleave.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
57
wp/wp-content/themes/child-theme/js/custom-admin.js
Normal file
57
wp/wp-content/themes/child-theme/js/custom-admin.js
Normal file
@@ -0,0 +1,57 @@
|
||||
function mediaPicker(pickerid) {
|
||||
var custom_uploader;
|
||||
var row_id
|
||||
//e.preventDefault();
|
||||
row_id = jQuery('#'+pickerid).prev().attr('id');
|
||||
|
||||
//If the uploader object has already been created, reopen the dialog
|
||||
if (custom_uploader) {
|
||||
custom_uploader.open();
|
||||
return;
|
||||
}
|
||||
|
||||
//Create the media window.
|
||||
custom_uploader = wp.media.frames.file_frame = wp.media({
|
||||
title: 'Insert Images',
|
||||
button: {
|
||||
text: 'Insert Images'
|
||||
},
|
||||
type: 'image',
|
||||
multiple: false
|
||||
});
|
||||
|
||||
//Insert Media Action. Preview image and insert values to image
|
||||
custom_uploader.on('select', function(){
|
||||
var selection = custom_uploader.state().get('selection');
|
||||
selection.map( function( attachment ) {
|
||||
attachment = attachment.toJSON();
|
||||
//INSERT THE SRC IN INPUT FIELD
|
||||
jQuery('#' + row_id).val(""+attachment.url+"").trigger('change');
|
||||
//APPEND THE PREVIEW IMAGE
|
||||
jQuery('#' + row_id).parent().find('.media-picker-preview, .media-picker-remove').remove();
|
||||
if(attachment.sizes.medium){
|
||||
jQuery('#' + row_id).parent().prepend('<img class="media-picker-preview" src="'+attachment.sizes.medium.url+'" /><span class="media-picker-remove">X</span>');
|
||||
}else{
|
||||
jQuery('#' + row_id).parent().prepend('<img class="media-picker-preview" src="'+attachment.url+'" /><span class="media-picker-remove">X</span>');
|
||||
}
|
||||
|
||||
});
|
||||
jQuery(".media-picker-remove").on('click',function(e) {
|
||||
jQuery(this).parent().find('.media-picker').val('').trigger('change');
|
||||
jQuery(this).parent().find('.media-picker-preview, .media-picker-remove').remove();
|
||||
});
|
||||
});
|
||||
//OPEN THE MEDIA WINDOW
|
||||
custom_uploader.open();
|
||||
|
||||
}
|
||||
|
||||
jQuery(document).on( 'ready widget-updated widget-added', function() {
|
||||
|
||||
//jQuery(".media-picker-remove").unbind( "click" );
|
||||
jQuery(".media-picker-remove").on('click',function(e) {
|
||||
jQuery(this).parent().find('.media-picker').val('').trigger('change');
|
||||
jQuery(this).parent().find('.media-picker-preview, .media-picker-remove').remove();
|
||||
});
|
||||
|
||||
});
|
||||
36
wp/wp-content/themes/child-theme/js/customizer.js
Normal file
36
wp/wp-content/themes/child-theme/js/customizer.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Theme Customizer enhancements for a better user experience.
|
||||
*
|
||||
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
|
||||
*/
|
||||
|
||||
( function( $ ) {
|
||||
// Site title and description.
|
||||
wp.customize( 'blogname', function( value ) {
|
||||
value.bind( function( to ) {
|
||||
$( '.site-title a' ).text( to );
|
||||
} );
|
||||
} );
|
||||
wp.customize( 'blogdescription', function( value ) {
|
||||
value.bind( function( to ) {
|
||||
$( '.site-description' ).text( to );
|
||||
} );
|
||||
} );
|
||||
// Header text color.
|
||||
wp.customize( 'header_textcolor', function( value ) {
|
||||
value.bind( function( to ) {
|
||||
if ( 'blank' === to ) {
|
||||
$( '.site-branding' ).css( {
|
||||
'clip': 'rect(1px, 1px, 1px, 1px)',
|
||||
'position': 'absolute'
|
||||
} );
|
||||
} else {
|
||||
$( '.site-branding, .site-title a ,.site-description' ).css( {
|
||||
'clip': 'auto',
|
||||
'color': to,
|
||||
'position': 'relative'
|
||||
} );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
} )( jQuery );
|
||||
322
wp/wp-content/themes/child-theme/js/html5shiv.js
vendored
Normal file
322
wp/wp-content/themes/child-theme/js/html5shiv.js
vendored
Normal file
@@ -0,0 +1,322 @@
|
||||
/**
|
||||
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
;(function(window, document) {
|
||||
/*jshint evil:true */
|
||||
/** version */
|
||||
var version = '3.7.2';
|
||||
|
||||
/** Preset options */
|
||||
var options = window.html5 || {};
|
||||
|
||||
/** Used to skip problem elements */
|
||||
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
||||
|
||||
/** Not all elements can be cloned in IE **/
|
||||
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
||||
|
||||
/** Detect whether the browser supports default html5 styles */
|
||||
var supportsHtml5Styles;
|
||||
|
||||
/** Name of the expando, to work with multiple documents or to re-shiv one document */
|
||||
var expando = '_html5shiv';
|
||||
|
||||
/** The id for the the documents expando */
|
||||
var expanID = 0;
|
||||
|
||||
/** Cached data for each document */
|
||||
var expandoData = {};
|
||||
|
||||
/** Detect whether the browser supports unknown elements */
|
||||
var supportsUnknownElements;
|
||||
|
||||
(function() {
|
||||
try {
|
||||
var a = document.createElement('a');
|
||||
a.innerHTML = '<xyz></xyz>';
|
||||
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
|
||||
supportsHtml5Styles = ('hidden' in a);
|
||||
|
||||
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
||||
// assign a false positive if unable to shiv
|
||||
(document.createElement)('a');
|
||||
var frag = document.createDocumentFragment();
|
||||
return (
|
||||
typeof frag.cloneNode == 'undefined' ||
|
||||
typeof frag.createDocumentFragment == 'undefined' ||
|
||||
typeof frag.createElement == 'undefined'
|
||||
);
|
||||
}());
|
||||
} catch(e) {
|
||||
// assign a false positive if detection fails => unable to shiv
|
||||
supportsHtml5Styles = true;
|
||||
supportsUnknownElements = true;
|
||||
}
|
||||
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a style sheet with the given CSS text and adds it to the document.
|
||||
* @private
|
||||
* @param {Document} ownerDocument The document.
|
||||
* @param {String} cssText The CSS text.
|
||||
* @returns {StyleSheet} The style element.
|
||||
*/
|
||||
function addStyleSheet(ownerDocument, cssText) {
|
||||
var p = ownerDocument.createElement('p'),
|
||||
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
||||
|
||||
p.innerHTML = 'x<style>' + cssText + '</style>';
|
||||
return parent.insertBefore(p.lastChild, parent.firstChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of `html5.elements` as an array.
|
||||
* @private
|
||||
* @returns {Array} An array of shived element node names.
|
||||
*/
|
||||
function getElements() {
|
||||
var elements = html5.elements;
|
||||
return typeof elements == 'string' ? elements.split(' ') : elements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extends the built-in list of html5 elements
|
||||
* @memberOf html5
|
||||
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
|
||||
* @param {Document} ownerDocument The context document.
|
||||
*/
|
||||
function addElements(newElements, ownerDocument) {
|
||||
var elements = html5.elements;
|
||||
if(typeof elements != 'string'){
|
||||
elements = elements.join(' ');
|
||||
}
|
||||
if(typeof newElements != 'string'){
|
||||
newElements = newElements.join(' ');
|
||||
}
|
||||
html5.elements = elements +' '+ newElements;
|
||||
shivDocument(ownerDocument);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data associated to the given document
|
||||
* @private
|
||||
* @param {Document} ownerDocument The document.
|
||||
* @returns {Object} An object of data.
|
||||
*/
|
||||
function getExpandoData(ownerDocument) {
|
||||
var data = expandoData[ownerDocument[expando]];
|
||||
if (!data) {
|
||||
data = {};
|
||||
expanID++;
|
||||
ownerDocument[expando] = expanID;
|
||||
expandoData[expanID] = data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a shived element for the given nodeName and document
|
||||
* @memberOf html5
|
||||
* @param {String} nodeName name of the element
|
||||
* @param {Document} ownerDocument The context document.
|
||||
* @returns {Object} The shived element.
|
||||
*/
|
||||
function createElement(nodeName, ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createElement(nodeName);
|
||||
}
|
||||
if (!data) {
|
||||
data = getExpandoData(ownerDocument);
|
||||
}
|
||||
var node;
|
||||
|
||||
if (data.cache[nodeName]) {
|
||||
node = data.cache[nodeName].cloneNode();
|
||||
} else if (saveClones.test(nodeName)) {
|
||||
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
||||
} else {
|
||||
node = data.createElem(nodeName);
|
||||
}
|
||||
|
||||
// Avoid adding some elements to fragments in IE < 9 because
|
||||
// * Attributes like `name` or `type` cannot be set/changed once an element
|
||||
// is inserted into a document/fragment
|
||||
// * Link elements with `src` attributes that are inaccessible, as with
|
||||
// a 403 response, will cause the tab/window to crash
|
||||
// * Script elements appended to fragments will execute when their `src`
|
||||
// or `text` property is set
|
||||
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a shived DocumentFragment for the given document
|
||||
* @memberOf html5
|
||||
* @param {Document} ownerDocument The context document.
|
||||
* @returns {Object} The shived DocumentFragment.
|
||||
*/
|
||||
function createDocumentFragment(ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createDocumentFragment();
|
||||
}
|
||||
data = data || getExpandoData(ownerDocument);
|
||||
var clone = data.frag.cloneNode(),
|
||||
i = 0,
|
||||
elems = getElements(),
|
||||
l = elems.length;
|
||||
for(;i<l;i++){
|
||||
clone.createElement(elems[i]);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
|
||||
* @private
|
||||
* @param {Document|DocumentFragment} ownerDocument The document.
|
||||
* @param {Object} data of the document.
|
||||
*/
|
||||
function shivMethods(ownerDocument, data) {
|
||||
if (!data.cache) {
|
||||
data.cache = {};
|
||||
data.createElem = ownerDocument.createElement;
|
||||
data.createFrag = ownerDocument.createDocumentFragment;
|
||||
data.frag = data.createFrag();
|
||||
}
|
||||
|
||||
|
||||
ownerDocument.createElement = function(nodeName) {
|
||||
//abort shiv
|
||||
if (!html5.shivMethods) {
|
||||
return data.createElem(nodeName);
|
||||
}
|
||||
return createElement(nodeName, ownerDocument, data);
|
||||
};
|
||||
|
||||
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
||||
'var n=f.cloneNode(),c=n.createElement;' +
|
||||
'h.shivMethods&&(' +
|
||||
// unroll the `createElement` calls
|
||||
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
|
||||
data.createElem(nodeName);
|
||||
data.frag.createElement(nodeName);
|
||||
return 'c("' + nodeName + '")';
|
||||
}) +
|
||||
');return n}'
|
||||
)(html5, data.frag);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Shivs the given document.
|
||||
* @memberOf html5
|
||||
* @param {Document} ownerDocument The document to shiv.
|
||||
* @returns {Document} The shived document.
|
||||
*/
|
||||
function shivDocument(ownerDocument) {
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
var data = getExpandoData(ownerDocument);
|
||||
|
||||
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
||||
data.hasCSS = !!addStyleSheet(ownerDocument,
|
||||
// corrects block display not defined in IE6/7/8/9
|
||||
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
|
||||
// adds styling not present in IE6/7/8/9
|
||||
'mark{background:#FF0;color:#000}' +
|
||||
// hides non-rendered elements
|
||||
'template{display:none}'
|
||||
);
|
||||
}
|
||||
if (!supportsUnknownElements) {
|
||||
shivMethods(ownerDocument, data);
|
||||
}
|
||||
return ownerDocument;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The `html5` object is exposed so that more elements can be shived and
|
||||
* existing shiving can be detected on iframes.
|
||||
* @type Object
|
||||
* @example
|
||||
*
|
||||
* // options can be changed before the script is included
|
||||
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
|
||||
*/
|
||||
var html5 = {
|
||||
|
||||
/**
|
||||
* An array or space separated string of node names of the elements to shiv.
|
||||
* @memberOf html5
|
||||
* @type Array|String
|
||||
*/
|
||||
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
|
||||
|
||||
/**
|
||||
* current version of html5shiv
|
||||
*/
|
||||
'version': version,
|
||||
|
||||
/**
|
||||
* A flag to indicate that the HTML5 style sheet should be inserted.
|
||||
* @memberOf html5
|
||||
* @type Boolean
|
||||
*/
|
||||
'shivCSS': (options.shivCSS !== false),
|
||||
|
||||
/**
|
||||
* Is equal to true if a browser supports creating unknown/HTML5 elements
|
||||
* @memberOf html5
|
||||
* @type boolean
|
||||
*/
|
||||
'supportsUnknownElements': supportsUnknownElements,
|
||||
|
||||
/**
|
||||
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
|
||||
* methods should be overwritten.
|
||||
* @memberOf html5
|
||||
* @type Boolean
|
||||
*/
|
||||
'shivMethods': (options.shivMethods !== false),
|
||||
|
||||
/**
|
||||
* A string to describe the type of `html5` object ("default" or "default print").
|
||||
* @memberOf html5
|
||||
* @type String
|
||||
*/
|
||||
'type': 'default',
|
||||
|
||||
// shivs the document according to the specified `html5` object options
|
||||
'shivDocument': shivDocument,
|
||||
|
||||
//creates a shived element
|
||||
createElement: createElement,
|
||||
|
||||
//creates a shived documentFragment
|
||||
createDocumentFragment: createDocumentFragment,
|
||||
|
||||
//extends list of elements
|
||||
addElements: addElements
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose html5
|
||||
window.html5 = html5;
|
||||
|
||||
// shiv the document
|
||||
shivDocument(document);
|
||||
|
||||
}(this, document));
|
||||
10872
wp/wp-content/themes/child-theme/js/jquery-3.5.1.js
vendored
Normal file
10872
wp/wp-content/themes/child-theme/js/jquery-3.5.1.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
wp/wp-content/themes/child-theme/js/jquery-3.5.1.min.js
vendored
Normal file
2
wp/wp-content/themes/child-theme/js/jquery-3.5.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
964
wp/wp-content/themes/child-theme/js/jquery.countdown.js
Normal file
964
wp/wp-content/themes/child-theme/js/jquery.countdown.js
Normal file
@@ -0,0 +1,964 @@
|
||||
/*! http://keith-wood.name/countdown.html
|
||||
Countdown for jQuery v2.1.0.
|
||||
Written by Keith Wood (wood.keith{at}optusnet.com.au) January 2008.
|
||||
Available under the MIT (http://keith-wood.name/licence.html) license.
|
||||
Please attribute the author if you use it. */
|
||||
|
||||
(function($) { // Hide scope, no $ conflict
|
||||
'use strict';
|
||||
|
||||
var pluginName = 'countdown';
|
||||
|
||||
var Y = 0; // Years
|
||||
var O = 1; // Months
|
||||
var W = 2; // Weeks
|
||||
var D = 3; // Days
|
||||
var H = 4; // Hours
|
||||
var M = 5; // Minutes
|
||||
var S = 6; // Seconds
|
||||
|
||||
/** Create the countdown plugin.
|
||||
<p>Sets an element to show the time remaining until a given instant.</p>
|
||||
<p>Expects HTML like:</p>
|
||||
<pre><div></div></pre>
|
||||
<p>Provide inline configuration like:</p>
|
||||
<pre><div data-countdown="name: 'value', ..."></div></pre>
|
||||
@module Countdown
|
||||
@augments JQPlugin
|
||||
@example $(selector).countdown({until: +300}) */
|
||||
$.JQPlugin.createPlugin({
|
||||
|
||||
/** The name of the plugin.
|
||||
@default 'countdown' */
|
||||
name: pluginName,
|
||||
|
||||
/** Countdown expiry callback.
|
||||
Used with the {@linkcode module:Countdown~defaultOptions|onExpiry} option and
|
||||
triggered when the countdown expires.
|
||||
@global
|
||||
@callback CountdownExpiryCallback
|
||||
@this <code>Element</code>
|
||||
@example onExpiry: function() {
|
||||
alert('Done');
|
||||
} */
|
||||
|
||||
/** Countdown server synchronisation callback.
|
||||
Used with the {@linkcode module:Countdown~defaultOptions|serverSync} option and
|
||||
triggered when the countdown is initialised.
|
||||
@global
|
||||
@callback CountdownServerSyncCallback
|
||||
@return {Date} The current date/time on the server as expressed in the local timezone.
|
||||
@this <code>$.countdown</code>
|
||||
@example serverSync: function() {
|
||||
var time = null;
|
||||
$.ajax({url: 'http://myserver.com/serverTime.php',
|
||||
async: false, dataType: 'text',
|
||||
success: function(text) {
|
||||
time = new Date(text);
|
||||
}, error: function(http, message, exc) {
|
||||
time = new Date();
|
||||
});
|
||||
return time;
|
||||
} */
|
||||
|
||||
/** Countdown tick callback.
|
||||
Used with the {@linkcode module:Countdown~defaultOptions|onTick} option and
|
||||
triggered on every {@linkcode module:Countdown~defaultOptions|tickInterval} ticks of the countdown.
|
||||
@global
|
||||
@callback CountdownTickCallback
|
||||
@this <code>Element</code>
|
||||
@param {number[]} periods The breakdown by period (years, months, weeks, days,
|
||||
hours, minutes, seconds) of the time remaining/passed.
|
||||
@example onTick: function(periods) {
|
||||
$('#altTime').text(periods[4] + ':' + twoDigits(periods[5]) +
|
||||
':' + twoDigits(periods[6]));
|
||||
} */
|
||||
|
||||
/** Countdown which labels callback.
|
||||
Used with the {@linkcode module:Countdown~regionalOptions|whichLabels} option and
|
||||
triggered when the countdown is being display to determine which set of labels
|
||||
(<code>labels</code>, <code>labels1</code>, ...) are to be used for the current period value.
|
||||
@global
|
||||
@callback CountdownWhichLabelsCallback
|
||||
@param {number} num The current period value.
|
||||
@return {number} The suffix for the label set to use, or zero for the default labels.
|
||||
@example whichLabels: function(num) {
|
||||
return (num === 1 ? 1 : (num >= 2 && num <= 4 ? 2 : 0));
|
||||
} */
|
||||
|
||||
/** Default settings for the plugin.
|
||||
@property {Date|number|string} [until] The date/time to count down to, or number of seconds
|
||||
offset from now, or string of amounts and units for offset(s) from now:
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
One of <code>until</code> or <code>since</code> must be specified.
|
||||
If both are given <code>since</code> takes precedence.
|
||||
@example until: new Date(2013, 12-1, 25, 13, 30)
|
||||
until: +300
|
||||
until: '+1O -2D'
|
||||
@property {Date|number|string} [since] The date/time to count up from, or number of seconds
|
||||
offset from now, or string of amounts and units for offset(s) from now:
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
One of <code>until</code> or <code>since</code> must be specified.
|
||||
If both are given <code>since</code> takes precedence.
|
||||
@example since: new Date(2013, 1-1, 1)
|
||||
since: -300
|
||||
since: '-1O +2D'
|
||||
@property {number} [timezone=null] The timezone (hours or minutes from GMT) for the target times,
|
||||
or <code>null</code> for client local timezone.
|
||||
@example timezone: +10
|
||||
timezone: -60
|
||||
@property {CountdownServerSyncCallback} [serverSync=null] A function to retrieve the current server time
|
||||
for synchronisation.
|
||||
@property {string} [format='dHMS'] The format for display - upper case to always show,
|
||||
lower case to show only if non-zero,
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
@property {string} [layout=''] <p>Build your own layout for the countdown.</p>
|
||||
<p>Indicate substitution points with '{desc}' for the description, '{sep}' for the time separator,
|
||||
'{pv}' where p is 'y' for years, 'o' for months, 'w' for weeks, 'd' for days,
|
||||
'h' for hours, 'm' for minutes, or 's' for seconds and v is 'n' for the period value,
|
||||
'nn' for the period value with a minimum of two digits,
|
||||
'nnn' for the period value with a minimum of three digits, or
|
||||
'l' for the period label (long or short form depending on the compact setting), or
|
||||
'{pd}' where p is as above and d is '1' for the units digit, '10' for the tens digit,
|
||||
'100' for the hundreds digit, or '1000' for the thousands digit.</p>
|
||||
<p>If you need to exclude entire sections when the period value is zero and
|
||||
you have specified the period as optional, surround these sections with
|
||||
'{p<}' and '{p>}', where p is the same as above.</p>
|
||||
<p>Your layout can just be simple text, or can contain HTML markup as well.</p>
|
||||
@example layout: '{d<}{dn} {dl}{d>} {hnn}:{mnn}:{snn}'
|
||||
@property {boolean} [compact=false] <code>true</code> to display in a compact format,
|
||||
<code>false</code> for an expanded one.
|
||||
@property {boolean} [padZeroes=false] <code>true</code> to add leading zeroes.
|
||||
@property {number} [significant=0] The maximum number of periods with non-zero values to show, zero for all.
|
||||
@property {string} [description=''] The description displayed for the countdown.
|
||||
@property {string} [expiryUrl=''] A URL to load upon expiry, replacing the current page.
|
||||
@property {string} [expiryText=''] Text to display upon expiry, replacing the countdown. This may be HTML.
|
||||
@property {boolean} [alwaysExpire=false] <code>true</code> to trigger <code>onExpiry</code>
|
||||
even if the target time has passed.
|
||||
@property {CountdownExpiryCallback} [onExpiry=null] Callback when the countdown expires -
|
||||
receives no parameters and <code>this</code> is the containing element.
|
||||
@example onExpiry: function() {
|
||||
...
|
||||
}
|
||||
@property {CountdownTickCallback} [onTick=null] Callback when the countdown is updated -
|
||||
receives <code>number[7]</code> being the breakdown by period
|
||||
(years, months, weeks, days, hours, minutes, seconds - based on
|
||||
<code>format</code>) and <code>this</code> is the containing element.
|
||||
@example onTick: function(periods) {
|
||||
var secs = $.countdown.periodsToSeconds(periods);
|
||||
if (secs < 300) { // Last five minutes
|
||||
...
|
||||
}
|
||||
}
|
||||
@property {number} [tickInterval=1] The interval (seconds) between <code>onTick</code> callbacks. */
|
||||
defaultOptions: {
|
||||
until: null,
|
||||
since: null,
|
||||
timezone: null,
|
||||
serverSync: null,
|
||||
format: 'dHMS',
|
||||
layout: '',
|
||||
compact: false,
|
||||
padZeroes: true,
|
||||
significant: 4,
|
||||
description: '',
|
||||
expiryUrl: '',
|
||||
expiryText: '',
|
||||
alwaysExpire: false,
|
||||
onExpiry: null,
|
||||
onTick: null,
|
||||
tickInterval: 1
|
||||
},
|
||||
|
||||
/** Localisations for the plugin.
|
||||
Entries are objects indexed by the language code ('' being the default US/English).
|
||||
Each object has the following attributes.
|
||||
@property {string[]} [labels=['Years','Months','Weeks','Days','Hours','Minutes','Seconds']]
|
||||
The display texts for the counter periods.
|
||||
@property {string[]} [labels1=['Year','Month','Week','Day','Hour','Minute','Second']]
|
||||
The display texts for the counter periods if they have a value of 1.
|
||||
Add other <code>labels<em>n</em></code> attributes as necessary to
|
||||
cater for other numeric idiosyncrasies of the localisation.
|
||||
@property {string[]}[compactLabels=['y','m','w','d']] The compact texts for the counter periods.
|
||||
@property {CountdownWhichLabelsCallback} [whichLabels=null] A function to determine which
|
||||
<code>labels<em>n</em></code> to use.
|
||||
@example whichLabels: function(num) {
|
||||
return (num > 1 ? 0 : 1);
|
||||
}
|
||||
@property {string[]} [digits=['0','1',...,'9']] The digits to display (0-9).
|
||||
@property {string} [timeSeparator=':'] Separator for time periods in the compact layout.
|
||||
@property {boolean} [isRTL=false] <code>true</code> for right-to-left languages,
|
||||
<code>false</code> for left-to-right. */
|
||||
regionalOptions: { // Available regional settings, indexed by language/country code
|
||||
'': { // Default regional settings - English/US
|
||||
labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
|
||||
labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
|
||||
compactLabels: ['y', 'm', 'w', 'd'],
|
||||
whichLabels: null,
|
||||
digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
}
|
||||
},
|
||||
|
||||
/* Class name for the right-to-left marker. */
|
||||
_rtlClass: pluginName + '-rtl',
|
||||
/* Class name for the countdown section marker. */
|
||||
_sectionClass: pluginName + '-section',
|
||||
/* Class name for the period amount marker. */
|
||||
_amountClass: pluginName + '-amount',
|
||||
/* Class name for the period name marker. */
|
||||
_periodClass: pluginName + '-period',
|
||||
/* Class name for the countdown row marker. */
|
||||
_rowClass: pluginName + '-row',
|
||||
/* Class name for the holding countdown marker. */
|
||||
_holdingClass: pluginName + '-holding',
|
||||
/* Class name for the showing countdown marker. */
|
||||
_showClass: pluginName + '-show',
|
||||
/* Class name for the description marker. */
|
||||
_descrClass: pluginName + '-descr',
|
||||
|
||||
/* List of currently active countdown elements. */
|
||||
_timerElems: [],
|
||||
|
||||
/** Additional setup for the countdown.
|
||||
Apply default localisations.
|
||||
Create the timer.
|
||||
@private */
|
||||
_init: function() {
|
||||
var self = this;
|
||||
this._super();
|
||||
this._serverSyncs = [];
|
||||
var now = (typeof Date.now === 'function' ? Date.now : function() { return new Date().getTime(); });
|
||||
var perfAvail = (window.performance && typeof window.performance.now === 'function');
|
||||
// Shared timer for all countdowns
|
||||
function timerCallBack(timestamp) {
|
||||
var drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer
|
||||
(perfAvail ? (window.performance.now() + window.performance.timing.navigationStart) : now()) :
|
||||
// Integer milliseconds since unix epoch
|
||||
timestamp || now());
|
||||
if (drawStart - animationStartTime >= 1000) {
|
||||
self._updateElems();
|
||||
animationStartTime = drawStart;
|
||||
}
|
||||
requestAnimationFrame(timerCallBack);
|
||||
}
|
||||
var requestAnimationFrame = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame || window.msRequestAnimationFrame || null;
|
||||
// This is when we expect a fall-back to setInterval as it's much more fluid
|
||||
var animationStartTime = 0;
|
||||
if (!requestAnimationFrame || $.noRequestAnimationFrame) {
|
||||
$.noRequestAnimationFrame = null;
|
||||
// Fall back to good old setInterval
|
||||
$.countdown._timer = setInterval(function() { self._updateElems(); }, 1000);
|
||||
}
|
||||
else {
|
||||
animationStartTime = window.animationStartTime ||
|
||||
window.webkitAnimationStartTime || window.mozAnimationStartTime ||
|
||||
window.oAnimationStartTime || window.msAnimationStartTime || now();
|
||||
requestAnimationFrame(timerCallBack);
|
||||
}
|
||||
},
|
||||
|
||||
/** Convert a date/time to UTC.
|
||||
@param {number} tz The hour or minute offset from GMT, e.g. +9, -360.
|
||||
@param {Date|number} year the date/time in that timezone or the year in that timezone.
|
||||
@param {number} [month] The month (0 - 11) (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [day] The day (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [hours] The hour (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [mins] The minute (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [secs] The second (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [ms] The millisecond (omit if <code>year</code> is a <code>Date</code>).
|
||||
@return {Date} The equivalent UTC date/time.
|
||||
@example $.countdown.UTCDate(+10, 2013, 12-1, 25, 12, 0)
|
||||
$.countdown.UTCDate(-7, new Date(2013, 12-1, 25, 12, 0)) */
|
||||
UTCDate: function(tz, year, month, day, hours, mins, secs, ms) {
|
||||
if (typeof year === 'object' && year instanceof Date) {
|
||||
ms = year.getMilliseconds();
|
||||
secs = year.getSeconds();
|
||||
mins = year.getMinutes();
|
||||
hours = year.getHours();
|
||||
day = year.getDate();
|
||||
month = year.getMonth();
|
||||
year = year.getFullYear();
|
||||
}
|
||||
var d = new Date();
|
||||
d.setUTCFullYear(year);
|
||||
d.setUTCDate(1);
|
||||
d.setUTCMonth(month || 0);
|
||||
d.setUTCDate(day || 1);
|
||||
d.setUTCHours(hours || 0);
|
||||
d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz));
|
||||
d.setUTCSeconds(secs || 0);
|
||||
d.setUTCMilliseconds(ms || 0);
|
||||
return d;
|
||||
},
|
||||
|
||||
/** Convert a set of periods into seconds.
|
||||
Averaged for months and years.
|
||||
@param {number[]} periods The periods per year/month/week/day/hour/minute/second.
|
||||
@return {number} The corresponding number of seconds.
|
||||
@example var secs = $.countdown.periodsToSeconds(periods) */
|
||||
periodsToSeconds: function(periods) {
|
||||
return periods[0] * 31557600 + periods[1] * 2629800 + periods[2] * 604800 +
|
||||
periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
|
||||
},
|
||||
|
||||
/** Resynchronise the countdowns with the server.
|
||||
@example $.countdown.resync() */
|
||||
resync: function() {
|
||||
var self = this;
|
||||
$('.' + this._getMarker()).each(function() { // Each countdown
|
||||
var inst = $.data(this, self.name);
|
||||
if (inst.options.serverSync) { // If synced
|
||||
var serverSync = null;
|
||||
for (var i = 0; i < self._serverSyncs.length; i++) {
|
||||
if (self._serverSyncs[i][0] === inst.options.serverSync) { // Find sync details
|
||||
serverSync = self._serverSyncs[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (self._eqNull(serverSync[2])) { // Recalculate if missing
|
||||
var serverResult = ($.isFunction(inst.options.serverSync) ?
|
||||
inst.options.serverSync.apply(this, []) : null);
|
||||
serverSync[2] =
|
||||
(serverResult ? new Date().getTime() - serverResult.getTime() : 0) - serverSync[1];
|
||||
}
|
||||
if (inst._since) { // Apply difference
|
||||
inst._since.setMilliseconds(inst._since.getMilliseconds() + serverSync[2]);
|
||||
}
|
||||
inst._until.setMilliseconds(inst._until.getMilliseconds() + serverSync[2]);
|
||||
}
|
||||
});
|
||||
for (var i = 0; i < self._serverSyncs.length; i++) { // Update sync details
|
||||
if (!self._eqNull(self._serverSyncs[i][2])) {
|
||||
self._serverSyncs[i][1] += self._serverSyncs[i][2];
|
||||
delete self._serverSyncs[i][2];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_instSettings: function(elem, options) { // jshint unused:false
|
||||
return {_periods: [0, 0, 0, 0, 0, 0, 0]};
|
||||
},
|
||||
|
||||
/** Add an element to the list of active ones.
|
||||
@private
|
||||
@param {Element} elem The countdown element. */
|
||||
_addElem: function(elem) {
|
||||
if (!this._hasElem(elem)) {
|
||||
this._timerElems.push(elem);
|
||||
}
|
||||
},
|
||||
|
||||
/** See if an element is in the list of active ones.
|
||||
@private
|
||||
@param {Element} elem The countdown element.
|
||||
@return {boolean} <code>true</code> if present, <code>false</code> if not. */
|
||||
_hasElem: function(elem) {
|
||||
return ($.inArray(elem, this._timerElems) > -1);
|
||||
},
|
||||
|
||||
/** Remove an element from the list of active ones.
|
||||
@private
|
||||
@param {Element} elem The countdown element. */
|
||||
_removeElem: function(elem) {
|
||||
this._timerElems = $.map(this._timerElems,
|
||||
function(value) { return (value === elem ? null : value); }); // delete entry
|
||||
},
|
||||
|
||||
/** Update each active timer element.
|
||||
@private */
|
||||
_updateElems: function() {
|
||||
for (var i = this._timerElems.length - 1; i >= 0; i--) {
|
||||
this._updateCountdown(this._timerElems[i]);
|
||||
}
|
||||
},
|
||||
|
||||
_optionsChanged: function(elem, inst, options) {
|
||||
if (options.layout) {
|
||||
options.layout = options.layout.replace(/</g, '<').replace(/>/g, '>');
|
||||
}
|
||||
this._resetExtraLabels(inst.options, options);
|
||||
var timezoneChanged = (inst.options.timezone !== options.timezone);
|
||||
$.extend(inst.options, options);
|
||||
this._adjustSettings(elem, inst,
|
||||
!this._eqNull(options.until) || !this._eqNull(options.since) || timezoneChanged);
|
||||
var now = new Date();
|
||||
if ((inst._since && inst._since < now) || (inst._until && inst._until > now)) {
|
||||
this._addElem(elem[0]);
|
||||
}
|
||||
this._updateCountdown(elem, inst);
|
||||
},
|
||||
|
||||
/** Redisplay the countdown with an updated display.
|
||||
@private
|
||||
@param {Element|jQuery} elem The containing element.
|
||||
@param {object} inst The current settings for this instance. */
|
||||
_updateCountdown: function(elem, inst) {
|
||||
elem = elem.jquery ? elem : $(elem);
|
||||
inst = inst || this._getInst(elem);
|
||||
if (!inst) {
|
||||
return;
|
||||
}
|
||||
elem.html(this._generateHTML(inst)).toggleClass(this._rtlClass, inst.options.isRTL);
|
||||
if (inst._hold !== 'pause' && $.isFunction(inst.options.onTick)) {
|
||||
var periods = inst._hold !== 'lap' ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date());
|
||||
if (inst.options.tickInterval === 1 ||
|
||||
this.periodsToSeconds(periods) % inst.options.tickInterval === 0) {
|
||||
inst.options.onTick.apply(elem[0], [periods]);
|
||||
}
|
||||
}
|
||||
var expired = inst._hold !== 'pause' &&
|
||||
(inst._since ? inst._now.getTime() < inst._since.getTime() :
|
||||
inst._now.getTime() >= inst._until.getTime());
|
||||
if (expired && !inst._expiring) {
|
||||
inst._expiring = true;
|
||||
if (this._hasElem(elem[0]) || inst.options.alwaysExpire) {
|
||||
this._removeElem(elem[0]);
|
||||
if ($.isFunction(inst.options.onExpiry)) {
|
||||
inst.options.onExpiry.apply(elem[0], []);
|
||||
}
|
||||
if (inst.options.expiryText) {
|
||||
var layout = inst.options.layout;
|
||||
inst.options.layout = inst.options.expiryText;
|
||||
this._updateCountdown(elem[0], inst);
|
||||
inst.options.layout = layout;
|
||||
}
|
||||
if (inst.options.expiryUrl) {
|
||||
window.location = inst.options.expiryUrl;
|
||||
}
|
||||
}
|
||||
inst._expiring = false;
|
||||
}
|
||||
else if (inst._hold === 'pause') {
|
||||
this._removeElem(elem[0]);
|
||||
}
|
||||
},
|
||||
|
||||
/** Reset any extra labelsn and compactLabelsn entries if changing labels.
|
||||
@private
|
||||
@param {object} base The options to be updated.
|
||||
@param {object} options The new option values. */
|
||||
_resetExtraLabels: function(base, options) {
|
||||
var n = null;
|
||||
for (n in options) {
|
||||
if (n.match(/[Ll]abels[02-9]|compactLabels1/)) {
|
||||
base[n] = options[n];
|
||||
}
|
||||
}
|
||||
for (n in base) { // Remove custom numbered labels
|
||||
if (n.match(/[Ll]abels[02-9]|compactLabels1/) && typeof options[n] === 'undefined') {
|
||||
base[n] = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** Determine whether or not a value is equivalent to <code>null</code>.
|
||||
@private
|
||||
@param {object} value The value to test.
|
||||
@return {boolean} <code>true</code> if equivalent to <code>null</code>, <code>false</code> if not. */
|
||||
_eqNull: function(value) {
|
||||
return typeof value === 'undefined' || value === null;
|
||||
},
|
||||
|
||||
|
||||
/** Calculate internal settings for an instance.
|
||||
@private
|
||||
@param {jQuery} elem The containing element.
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {boolean} recalc <code>true</code> if until or since are set. */
|
||||
_adjustSettings: function(elem, inst, recalc) {
|
||||
var serverEntry = null;
|
||||
for (var i = 0; i < this._serverSyncs.length; i++) {
|
||||
if (this._serverSyncs[i][0] === inst.options.serverSync) {
|
||||
serverEntry = this._serverSyncs[i][1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
var now = null;
|
||||
var serverOffset = null;
|
||||
if (!this._eqNull(serverEntry)) {
|
||||
now = new Date();
|
||||
serverOffset = (inst.options.serverSync ? serverEntry : 0);
|
||||
}
|
||||
else {
|
||||
var serverResult = ($.isFunction(inst.options.serverSync) ?
|
||||
inst.options.serverSync.apply(elem[0], []) : null);
|
||||
now = new Date();
|
||||
serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0);
|
||||
this._serverSyncs.push([inst.options.serverSync, serverOffset]);
|
||||
}
|
||||
var timezone = inst.options.timezone;
|
||||
timezone = (this._eqNull(timezone) ? -now.getTimezoneOffset() : timezone);
|
||||
if (recalc || (!recalc && this._eqNull(inst._until) && this._eqNull(inst._since))) {
|
||||
inst._since = inst.options.since;
|
||||
if (!this._eqNull(inst._since)) {
|
||||
inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
|
||||
if (inst._since && serverOffset) {
|
||||
inst._since.setMilliseconds(inst._since.getMilliseconds() + serverOffset);
|
||||
}
|
||||
}
|
||||
inst._until = this.UTCDate(timezone, this._determineTime(inst.options.until, now));
|
||||
if (serverOffset) {
|
||||
inst._until.setMilliseconds(inst._until.getMilliseconds() + serverOffset);
|
||||
}
|
||||
}
|
||||
inst._show = this._determineShow(inst);
|
||||
},
|
||||
|
||||
/** Remove the countdown widget from an element.
|
||||
@private
|
||||
@param {jQuery} elem The containing element.
|
||||
@param {object} inst The current instance object. */
|
||||
_preDestroy: function(elem, inst) { // jshint unused:false
|
||||
this._removeElem(elem[0]);
|
||||
elem.empty();
|
||||
},
|
||||
|
||||
/** Pause a countdown widget at the current time.
|
||||
Stop it running but remember and display the current time.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('pause') */
|
||||
pause: function(elem) {
|
||||
this._hold(elem, 'pause');
|
||||
},
|
||||
|
||||
/** Pause a countdown widget at the current time.
|
||||
Stop the display but keep the countdown running.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('lap') */
|
||||
lap: function(elem) {
|
||||
this._hold(elem, 'lap');
|
||||
},
|
||||
|
||||
/** Resume a paused countdown widget.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('resume') */
|
||||
resume: function(elem) {
|
||||
this._hold(elem, null);
|
||||
},
|
||||
|
||||
/** Toggle a paused countdown widget.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('toggle') */
|
||||
toggle: function(elem) {
|
||||
var inst = $.data(elem, this.name) || {};
|
||||
this[!inst._hold ? 'pause' : 'resume'](elem);
|
||||
},
|
||||
|
||||
/** Toggle a lapped countdown widget.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('toggleLap') */
|
||||
toggleLap: function(elem) {
|
||||
var inst = $.data(elem, this.name) || {};
|
||||
this[!inst._hold ? 'lap' : 'resume'](elem);
|
||||
},
|
||||
|
||||
/** Pause or resume a countdown widget.
|
||||
@private
|
||||
@param {Element} elem The containing element.
|
||||
@param {string} hold The new hold setting. */
|
||||
_hold: function(elem, hold) {
|
||||
var inst = $.data(elem, this.name);
|
||||
if (inst) {
|
||||
if (inst._hold === 'pause' && !hold) {
|
||||
inst._periods = inst._savePeriods;
|
||||
var sign = (inst._since ? '-' : '+');
|
||||
inst[inst._since ? '_since' : '_until'] =
|
||||
this._determineTime(sign + inst._periods[0] + 'y' +
|
||||
sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' +
|
||||
sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' +
|
||||
sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's');
|
||||
this._addElem(elem);
|
||||
}
|
||||
inst._hold = hold;
|
||||
inst._savePeriods = (hold === 'pause' ? inst._periods : null);
|
||||
$.data(elem, this.name, inst);
|
||||
this._updateCountdown(elem, inst);
|
||||
}
|
||||
},
|
||||
|
||||
/** Return the current time periods, broken down by years, months, weeks, days, hours, minutes, and seconds.
|
||||
@param {Element} elem The containing element.
|
||||
@return {number[]} The current periods for the countdown.
|
||||
@example var periods = $(selector).countdown('getTimes') */
|
||||
getTimes: function(elem) {
|
||||
var inst = $.data(elem, this.name);
|
||||
return (!inst ? null : (inst._hold === 'pause' ? inst._savePeriods : (!inst._hold ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()))));
|
||||
},
|
||||
|
||||
/** A time may be specified as an exact value or a relative one.
|
||||
@private
|
||||
@param {string|number|Date} setting The date/time value as a relative or absolute value.
|
||||
@param {Date} defaultTime The date/time to use if no other is supplied.
|
||||
@return {Date} The corresponding date/time. */
|
||||
_determineTime: function(setting, defaultTime) {
|
||||
var self = this;
|
||||
var offsetNumeric = function(offset) { // e.g. +300, -2
|
||||
var time = new Date();
|
||||
time.setTime(time.getTime() + offset * 1000);
|
||||
return time;
|
||||
};
|
||||
var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m'
|
||||
offset = offset.toLowerCase();
|
||||
var time = new Date();
|
||||
var year = time.getFullYear();
|
||||
var month = time.getMonth();
|
||||
var day = time.getDate();
|
||||
var hour = time.getHours();
|
||||
var minute = time.getMinutes();
|
||||
var second = time.getSeconds();
|
||||
var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
|
||||
var matches = pattern.exec(offset);
|
||||
while (matches) {
|
||||
switch (matches[2] || 's') {
|
||||
case 's':
|
||||
second += parseInt(matches[1], 10);
|
||||
break;
|
||||
case 'm':
|
||||
minute += parseInt(matches[1], 10);
|
||||
break;
|
||||
case 'h':
|
||||
hour += parseInt(matches[1], 10);
|
||||
break;
|
||||
case 'd':
|
||||
day += parseInt(matches[1], 10);
|
||||
break;
|
||||
case 'w':
|
||||
day += parseInt(matches[1], 10) * 7;
|
||||
break;
|
||||
case 'o':
|
||||
month += parseInt(matches[1], 10);
|
||||
day = Math.min(day, self._getDaysInMonth(year, month));
|
||||
break;
|
||||
case 'y':
|
||||
year += parseInt(matches[1], 10);
|
||||
day = Math.min(day, self._getDaysInMonth(year, month));
|
||||
break;
|
||||
}
|
||||
matches = pattern.exec(offset);
|
||||
}
|
||||
return new Date(year, month, day, hour, minute, second, 0);
|
||||
};
|
||||
var time = (this._eqNull(setting) ? defaultTime :
|
||||
(typeof setting === 'string' ? offsetString(setting) :
|
||||
(typeof setting === 'number' ? offsetNumeric(setting) : setting)));
|
||||
if (time) {
|
||||
time.setMilliseconds(0);
|
||||
}
|
||||
return time;
|
||||
},
|
||||
|
||||
/** Determine the number of days in a month.
|
||||
@private
|
||||
@param {number} year The year.
|
||||
@param {number} month The month.
|
||||
@return {number} The days in that month. */
|
||||
_getDaysInMonth: function(year, month) {
|
||||
return 32 - new Date(year, month, 32).getDate();
|
||||
},
|
||||
|
||||
/** Default implementation to determine which set of labels should be used for an amount.
|
||||
Use the <code>labels</code> attribute with the same numeric suffix (if it exists).
|
||||
@private
|
||||
@param {number} num The amount to be displayed.
|
||||
@return {number} The set of labels to be used for this amount. */
|
||||
_normalLabels: function(num) {
|
||||
return num;
|
||||
},
|
||||
|
||||
/** Generate the HTML to display the countdown widget.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@return {string} The new HTML for the countdown display. */
|
||||
_generateHTML: function(inst) {
|
||||
var self = this;
|
||||
// Determine what to show
|
||||
inst._periods = (inst._hold ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()));
|
||||
// Show all 'asNeeded' after first non-zero value
|
||||
var shownNonZero = false;
|
||||
var showCount = 0;
|
||||
var sigCount = inst.options.significant;
|
||||
var show = $.extend({}, inst._show);
|
||||
var period = null;
|
||||
for (period = Y; period <= S; period++) {
|
||||
shownNonZero = shownNonZero || (inst._show[period] === '?' && inst._periods[period] > 0);
|
||||
show[period] = (inst._show[period] === '?' && !shownNonZero ? null : inst._show[period]);
|
||||
showCount += (show[period] ? 1 : 0);
|
||||
sigCount -= (inst._periods[period] > 0 ? 1 : 0);
|
||||
}
|
||||
var showSignificant = [false, false, false, false, false, false, false];
|
||||
for (period = S; period >= Y; period--) { // Determine significant periods
|
||||
if (inst._show[period]) {
|
||||
if (inst._periods[period]) {
|
||||
showSignificant[period] = true;
|
||||
}
|
||||
else {
|
||||
showSignificant[period] = sigCount > 0;
|
||||
sigCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
var labels = (inst.options.compact ? inst.options.compactLabels : inst.options.labels);
|
||||
var whichLabels = inst.options.whichLabels || this._normalLabels;
|
||||
var showCompact = function(period) {
|
||||
var labelsNum = inst.options['compactLabels' + whichLabels(inst._periods[period])];
|
||||
return (show[period] ? self._translateDigits(inst, inst._periods[period]) +
|
||||
(labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
|
||||
};
|
||||
var minDigits = (inst.options.padZeroes ? 2 : 1);
|
||||
var showFull = function(period) {
|
||||
var labelsNum = inst.options['labels' + whichLabels(inst._periods[period])];
|
||||
return ((!inst.options.significant && show[period]) ||
|
||||
(inst.options.significant && showSignificant[period]) ?
|
||||
'<span class="' + self._sectionClass + '">' +
|
||||
'<span class="' + self._amountClass + '">' +
|
||||
self._minDigits(inst, inst._periods[period], minDigits) + '</span>' +
|
||||
'<span class="' + self._periodClass + '">' +
|
||||
(labelsNum ? labelsNum[period] : labels[period]) + '</span></span>' : '');
|
||||
};
|
||||
return (inst.options.layout ? this._buildLayout(inst, show, inst.options.layout,
|
||||
inst.options.compact, inst.options.significant, showSignificant) :
|
||||
((inst.options.compact ? // Compact version
|
||||
'<span class="' + this._rowClass + ' ' + this._amountClass +
|
||||
(inst._hold ? ' ' + this._holdingClass : '') + '">' +
|
||||
showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) +
|
||||
(show[H] ? this._minDigits(inst, inst._periods[H], 2) : '') +
|
||||
(show[M] ? (show[H] ? inst.options.timeSeparator : '') +
|
||||
this._minDigits(inst, inst._periods[M], 2) : '') +
|
||||
(show[S] ? (show[H] || show[M] ? inst.options.timeSeparator : '') +
|
||||
this._minDigits(inst, inst._periods[S], 2) : '') :
|
||||
// Full version
|
||||
'<span class="' + this._rowClass + ' ' + this._showClass + (inst.options.significant || showCount) +
|
||||
(inst._hold ? ' ' + this._holdingClass : '') + '">' +
|
||||
showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
|
||||
showFull(H) + showFull(M) + showFull(S)) + '</span>' +
|
||||
(inst.options.description ? '<span class="' + this._rowClass + ' ' + this._descrClass + '">' +
|
||||
inst.options.description + '</span>' : '')));
|
||||
},
|
||||
|
||||
/** Construct a custom layout.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {boolean[]} show Flags indicating which periods are requested.
|
||||
@param {string} layout The customised layout.
|
||||
@param {boolean} compact <code>true</code> if using compact labels.
|
||||
@param {number} significant The number of periods with values to show, zero for all.
|
||||
@param {boolean[]} showSignificant Other periods to show for significance.
|
||||
@return {string} The custom HTML. */
|
||||
_buildLayout: function(inst, show, layout, compact, significant, showSignificant) {
|
||||
var labels = inst.options[compact ? 'compactLabels' : 'labels'];
|
||||
var whichLabels = inst.options.whichLabels || this._normalLabels;
|
||||
var labelFor = function(index) {
|
||||
return (inst.options[(compact ? 'compactLabels' : 'labels') +
|
||||
whichLabels(inst._periods[index])] || labels)[index];
|
||||
};
|
||||
var digit = function(value, position) {
|
||||
return inst.options.digits[Math.floor(value / position) % 10];
|
||||
};
|
||||
var subs = {desc: inst.options.description, sep: inst.options.timeSeparator,
|
||||
yl: labelFor(Y), yn: this._minDigits(inst, inst._periods[Y], 1),
|
||||
ynn: this._minDigits(inst, inst._periods[Y], 2),
|
||||
ynnn: this._minDigits(inst, inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
|
||||
y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
|
||||
y1000: digit(inst._periods[Y], 1000),
|
||||
ol: labelFor(O), on: this._minDigits(inst, inst._periods[O], 1),
|
||||
onn: this._minDigits(inst, inst._periods[O], 2),
|
||||
onnn: this._minDigits(inst, inst._periods[O], 3), o1: digit(inst._periods[O], 1),
|
||||
o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
|
||||
o1000: digit(inst._periods[O], 1000),
|
||||
wl: labelFor(W), wn: this._minDigits(inst, inst._periods[W], 1),
|
||||
wnn: this._minDigits(inst, inst._periods[W], 2),
|
||||
wnnn: this._minDigits(inst, inst._periods[W], 3), w1: digit(inst._periods[W], 1),
|
||||
w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
|
||||
w1000: digit(inst._periods[W], 1000),
|
||||
dl: labelFor(D), dn: this._minDigits(inst, inst._periods[D], 1),
|
||||
dnn: this._minDigits(inst, inst._periods[D], 2),
|
||||
dnnn: this._minDigits(inst, inst._periods[D], 3), d1: digit(inst._periods[D], 1),
|
||||
d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
|
||||
d1000: digit(inst._periods[D], 1000),
|
||||
hl: labelFor(H), hn: this._minDigits(inst, inst._periods[H], 1),
|
||||
hnn: this._minDigits(inst, inst._periods[H], 2),
|
||||
hnnn: this._minDigits(inst, inst._periods[H], 3), h1: digit(inst._periods[H], 1),
|
||||
h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
|
||||
h1000: digit(inst._periods[H], 1000),
|
||||
ml: labelFor(M), mn: this._minDigits(inst, inst._periods[M], 1),
|
||||
mnn: this._minDigits(inst, inst._periods[M], 2),
|
||||
mnnn: this._minDigits(inst, inst._periods[M], 3), m1: digit(inst._periods[M], 1),
|
||||
m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
|
||||
m1000: digit(inst._periods[M], 1000),
|
||||
sl: labelFor(S), sn: this._minDigits(inst, inst._periods[S], 1),
|
||||
snn: this._minDigits(inst, inst._periods[S], 2),
|
||||
snnn: this._minDigits(inst, inst._periods[S], 3), s1: digit(inst._periods[S], 1),
|
||||
s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100),
|
||||
s1000: digit(inst._periods[S], 1000)};
|
||||
var html = layout;
|
||||
// Replace period containers: {p<}...{p>}
|
||||
for (var i = Y; i <= S; i++) {
|
||||
var period = 'yowdhms'.charAt(i);
|
||||
var re = new RegExp('\\{' + period + '<\\}([\\s\\S]*)\\{' + period + '>\\}', 'g');
|
||||
html = html.replace(re, ((!significant && show[i]) ||
|
||||
(significant && showSignificant[i]) ? '$1' : ''));
|
||||
}
|
||||
// Replace period values: {pn}
|
||||
$.each(subs, function(n, v) {
|
||||
var re = new RegExp('\\{' + n + '\\}', 'g');
|
||||
html = html.replace(re, v);
|
||||
});
|
||||
return html;
|
||||
},
|
||||
|
||||
/** Ensure a numeric value has at least n digits for display.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {number} value The value to display.
|
||||
@param {number} len The minimum length.
|
||||
@return {string} The display text. */
|
||||
_minDigits: function(inst, value, len) {
|
||||
value = '' + value;
|
||||
if (value.length >= len) {
|
||||
return this._translateDigits(inst, value);
|
||||
}
|
||||
value = '0000000000' + value;
|
||||
return this._translateDigits(inst, value.substr(value.length - len));
|
||||
},
|
||||
|
||||
/** Translate digits into other representations.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {string} value The text to translate.
|
||||
@return {string} The translated text. */
|
||||
_translateDigits: function(inst, value) {
|
||||
return ('' + value).replace(/[0-9]/g, function(digit) {
|
||||
return inst.options.digits[digit];
|
||||
});
|
||||
},
|
||||
|
||||
/** Translate the format into flags for each period.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@return {string[]} Flags indicating which periods are requested (?) or
|
||||
required (!) by year, month, week, day, hour, minute, second. */
|
||||
_determineShow: function(inst) {
|
||||
var format = inst.options.format;
|
||||
var show = [];
|
||||
show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
|
||||
show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
|
||||
show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null));
|
||||
show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null));
|
||||
show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null));
|
||||
show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null));
|
||||
show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null));
|
||||
return show;
|
||||
},
|
||||
|
||||
/** Calculate the requested periods between now and the target time.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {string[]} show Flags indicating which periods are requested/required.
|
||||
@param {number} significant The number of periods with values to show, zero for all.
|
||||
@param {Date} now The current date and time.
|
||||
@return {number[]} The current time periods (always positive)
|
||||
by year, month, week, day, hour, minute, second. */
|
||||
_calculatePeriods: function(inst, show, significant, now) {
|
||||
// Find endpoints
|
||||
inst._now = now;
|
||||
inst._now.setMilliseconds(0);
|
||||
var until = new Date(inst._now.getTime());
|
||||
if (inst._since) {
|
||||
if (now.getTime() < inst._since.getTime()) {
|
||||
inst._now = now = until;
|
||||
}
|
||||
else {
|
||||
now = inst._since;
|
||||
}
|
||||
}
|
||||
else {
|
||||
until.setTime(inst._until.getTime());
|
||||
if (now.getTime() > inst._until.getTime()) {
|
||||
inst._now = now = until;
|
||||
}
|
||||
}
|
||||
// Calculate differences by period
|
||||
var periods = [0, 0, 0, 0, 0, 0, 0];
|
||||
if (show[Y] || show[O]) {
|
||||
// Treat end of months as the same
|
||||
var lastNow = this._getDaysInMonth(now.getFullYear(), now.getMonth());
|
||||
var lastUntil = this._getDaysInMonth(until.getFullYear(), until.getMonth());
|
||||
var sameDay = (until.getDate() === now.getDate() ||
|
||||
(until.getDate() >= Math.min(lastNow, lastUntil) &&
|
||||
now.getDate() >= Math.min(lastNow, lastUntil)));
|
||||
var getSecs = function(date) {
|
||||
return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds();
|
||||
};
|
||||
var months = Math.max(0,
|
||||
(until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() +
|
||||
((until.getDate() < now.getDate() && !sameDay) ||
|
||||
(sameDay && getSecs(until) < getSecs(now)) ? -1 : 0));
|
||||
periods[Y] = (show[Y] ? Math.floor(months / 12) : 0);
|
||||
periods[O] = (show[O] ? months - periods[Y] * 12 : 0);
|
||||
// Adjust for months difference and end of month if necessary
|
||||
now = new Date(now.getTime());
|
||||
var wasLastDay = (now.getDate() === lastNow);
|
||||
var lastDay = this._getDaysInMonth(now.getFullYear() + periods[Y],
|
||||
now.getMonth() + periods[O]);
|
||||
if (now.getDate() > lastDay) {
|
||||
now.setDate(lastDay);
|
||||
}
|
||||
now.setFullYear(now.getFullYear() + periods[Y]);
|
||||
now.setMonth(now.getMonth() + periods[O]);
|
||||
if (wasLastDay) {
|
||||
now.setDate(lastDay);
|
||||
}
|
||||
}
|
||||
var diff = Math.floor((until.getTime() - now.getTime()) / 1000);
|
||||
var period = null;
|
||||
var extractPeriod = function(period, numSecs) {
|
||||
periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0);
|
||||
diff -= periods[period] * numSecs;
|
||||
};
|
||||
extractPeriod(W, 604800);
|
||||
extractPeriod(D, 86400);
|
||||
extractPeriod(H, 3600);
|
||||
extractPeriod(M, 60);
|
||||
extractPeriod(S, 1);
|
||||
if (diff > 0 && !inst._since) { // Round up if left overs
|
||||
var multiplier = [1, 12, 4.3482, 7, 24, 60, 60];
|
||||
var lastShown = S;
|
||||
var max = 1;
|
||||
for (period = S; period >= Y; period--) {
|
||||
if (show[period]) {
|
||||
if (periods[lastShown] >= max) {
|
||||
periods[lastShown] = 0;
|
||||
diff = 1;
|
||||
}
|
||||
if (diff > 0) {
|
||||
periods[period]++;
|
||||
diff = 0;
|
||||
lastShown = period;
|
||||
max = 1;
|
||||
}
|
||||
}
|
||||
max *= multiplier[period];
|
||||
}
|
||||
}
|
||||
if (significant) { // Zero out insignificant periods
|
||||
for (period = Y; period <= S; period++) {
|
||||
if (significant && periods[period]) {
|
||||
significant--;
|
||||
}
|
||||
else if (!significant) {
|
||||
periods[period] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return periods;
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
7
wp/wp-content/themes/child-theme/js/jquery.countdown.min.js
vendored
Normal file
7
wp/wp-content/themes/child-theme/js/jquery.countdown.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
wp/wp-content/themes/child-theme/js/jquery.flexslider-min.js
vendored
Normal file
6
wp/wp-content/themes/child-theme/js/jquery.flexslider-min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1131
wp/wp-content/themes/child-theme/js/jquery.flexslider.js
Normal file
1131
wp/wp-content/themes/child-theme/js/jquery.flexslider.js
Normal file
File diff suppressed because it is too large
Load Diff
9
wp/wp-content/themes/child-theme/js/jquery.plugin.min.js
vendored
Normal file
9
wp/wp-content/themes/child-theme/js/jquery.plugin.min.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/*! Simple JavaScript Inheritance
|
||||
* By John Resig http://ejohn.org/
|
||||
* MIT Licensed.
|
||||
*/
|
||||
!function(){"use strict";var a=!1;window.JQClass=function(){},JQClass.classes={},JQClass.extend=function b(c){function d(){!a&&this._init&&this._init.apply(this,arguments)}var e=this.prototype;a=!0;var f=new this;a=!1;for(var g in c)if("function"==typeof c[g]&&"function"==typeof e[g])f[g]=function(a,b){return function(){var c=this._super;this._super=function(b){return e[a].apply(this,b||[])};var d=b.apply(this,arguments);return this._super=c,d}}(g,c[g]);else if("object"==typeof c[g]&&"object"==typeof e[g]&&"defaultOptions"===g){var h,i=e[g],j=c[g],k={};for(h in i)k[h]=i[h];for(h in j)k[h]=j[h];f[g]=k}else f[g]=c[g];return d.prototype=f,d.prototype.constructor=d,d.extend=b,d}}(),/*! Abstract base class for collection plugins v1.0.2.
|
||||
Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.
|
||||
Licensed under the MIT license (http://keith-wood.name/licence.html). */
|
||||
function($){"use strict";function camelCase(a){return a.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}JQClass.classes.JQPlugin=JQClass.extend({name:"plugin",defaultOptions:{},regionalOptions:{},deepMerge:!0,_getMarker:function(){return"is-"+this.name},_init:function(){$.extend(this.defaultOptions,this.regionalOptions&&this.regionalOptions[""]||{});var a=camelCase(this.name);$[a]=this,$.fn[a]=function(b){var c=Array.prototype.slice.call(arguments,1),d=this,e=this;return this.each(function(){if("string"==typeof b){if("_"===b[0]||!$[a][b])throw"Unknown method: "+b;var f=$[a][b].apply($[a],[this].concat(c));if(f!==d&&void 0!==f)return e=f,!1}else $[a]._attach(this,b)}),e}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_attach:function(a,b){if(a=$(a),!a.hasClass(this._getMarker())){a.addClass(this._getMarker()),b=$.extend(this.deepMerge,{},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c),this._postAttach(a,c),this.option(a,b)}},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(elem){try{var data=elem.data(this.name.toLowerCase())||"";data=data.replace(/(\\?)'/g,function(a,b){return b?"'":'"'}).replace(/([a-zA-Z0-9]+):/g,function(a,b,c){var d=data.substring(0,c).match(/"/g);return d&&d.length%2!==0?b+":":'"'+b+'":'}).replace(/\\:/g,":"),data=$.parseJSON("{"+data+"}");for(var key in data)if(data.hasOwnProperty(key)){var value=data[key];"string"==typeof value&&value.match(/^new Date\(([-0-9,\s]*)\)$/)&&(data[key]=eval(value))}return data}catch(a){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name),e=b||{};return!b||"string"==typeof b&&"undefined"==typeof c?(e=(d||{}).options,e&&b?e[b]:e):void(a.hasClass(this._getMarker())&&("string"==typeof b&&(e={},e[b]=c),this._optionsChanged(a,d,e),$.extend(d.options,e)))},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a),a.hasClass(this._getMarker())&&(this._preDestroy(a,this._getInst(a)),a.removeData(this.name).removeClass(this._getMarker()))},_preDestroy:function(a,b){}}),$.JQPlugin={createPlugin:function(a,b){"object"==typeof a&&(b=a,a="JQPlugin"),a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b),new JQClass.classes[c]}}}(jQuery);
|
||||
//# sourceMappingURL=jquery.plugin.min.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["..\\..\\src\\js\\jquery.plugin.js"],"names":["initializing","window","JQClass","classes","extend","extender","prop","this","_init","apply","arguments","base","prototype","name","fn","__super","_super","args","ret","key","obj1","obj2","obj3","constructor","$","camelCase","replace","match","group","toUpperCase","JQPlugin","defaultOptions","regionalOptions","deepMerge","_getMarker","jqName","options","otherArgs","Array","slice","call","inst","returnValue","each","methodValue","concat","undefined","_attach","setDefaults","elem","hasClass","addClass","_getMetadata","_instSettings","data","_postAttach","option","toLowerCase","e","t","i","count","substring","length","parseJSON","hasOwnProperty","value","eval","_getInst","_optionsChanged","destroy","_preDestroy","removeData","removeClass","createPlugin","superClass","overrides","className","jQuery"],"mappings":";;;;CAMA,WACC,YACA,IAAIA,IAAe,CAGnBC,QAAOC,QAAU,aAGjBA,QAAQC,WAGRD,QAAQE,OAAS,QAASC,GAASC,GA4ClC,QAASJ,MAEHF,GAAgBO,KAAKC,OACzBD,KAAKC,MAAMC,MAAMF,KAAMG,WA9CzB,GAAIC,GAAOJ,KAAKK,SAGhBZ,IAAe,CACf,IAAIY,GAAY,GAAIL,KACpBP,IAAe,CAGf,KAAK,GAAIa,KAAQP,GAEhB,GAA0B,kBAAfA,GAAKO,IAA8C,kBAAfF,GAAKE,GACnDD,EAAUC,GAAQ,SAAWA,EAAMC,GAClC,MAAO,YACN,GAAIC,GAAUR,KAAKS,MAEnBT,MAAKS,OAAS,SAAUC,GACvB,MAAON,GAAKE,GAAMJ,MAAMF,KAAMU,OAE/B,IAAIC,GAAMJ,EAAGL,MAAMF,KAAMG,UAGzB,OADAH,MAAKS,OAASD,EACPG,IAENL,EAAMP,EAAKO,QAER,IAA0B,gBAAfP,GAAKO,IAA4C,gBAAfF,GAAKE,IAA+B,mBAATA,EAA2B,CACzG,GAGIM,GAHAC,EAAOT,EAAKE,GACZQ,EAAOf,EAAKO,GACZS,IAEJ,KAAKH,IAAOC,GACXE,EAAKH,GAAOC,EAAKD,EAElB,KAAKA,IAAOE,GACXC,EAAKH,GAAOE,EAAKF,EAElBP,GAAUC,GAAQS,MAElBV,GAAUC,GAAQP,EAAKO,EAqBzB,OARAX,GAAQU,UAAYA,EAGpBV,EAAQU,UAAUW,YAAcrB,EAGhCA,EAAQE,OAASC,EAEVH;;;AAMT,SAAUsB,GACT,YA6QA,SAASC,WAAUZ,GAClB,MAAOA,GAAKa,QAAQ,YAAa,SAASC,EAAOC,GAChD,MAAOA,GAAMC,gBAzPf3B,QAAQC,QAAQ2B,SAAW5B,QAAQE,QAIlCS,KAAM,SAONkB,kBAUAC,mBAIAC,WAAW,EAMXC,WAAY,WACX,MAAO,MAAQ3B,KAAKM,MAOrBL,MAAO,WAENgB,EAAEpB,OAAOG,KAAKwB,eAAiBxB,KAAKyB,iBAAmBzB,KAAKyB,gBAAgB,QAE5E,IAAIG,GAASV,UAAUlB,KAAKM,KAE5BW,GAAEW,GAAU5B,KAEZiB,EAAEV,GAAGqB,GAAU,SAASC,GACvB,GAAIC,GAAYC,MAAM1B,UAAU2B,MAAMC,KAAK9B,UAAW,GAClD+B,EAAOlC,KACPmC,EAAcnC,IAelB,OAdAA,MAAKoC,KAAK,WACT,GAAuB,gBAAZP,GAAsB,CAChC,GAAmB,MAAfA,EAAQ,KAAeZ,EAAEW,GAAQC,GACpC,KAAM,mBAAqBA,CAE5B,IAAIQ,GAAcpB,EAAEW,GAAQC,GAAS3B,MAAMe,EAAEW,IAAU5B,MAAMsC,OAAOR,GACpE,IAAIO,IAAgBH,GAAwBK,SAAhBF,EAE3B,MADAF,GAAcE,GACP,MAGRpB,GAAEW,GAAQY,QAAQxC,KAAM6B,KAGnBM,IAOTM,YAAa,SAASZ,GACrBZ,EAAEpB,OAAOG,KAAKwB,eAAgBK,QAS/BW,QAAS,SAASE,EAAMb,GAEvB,GADAa,EAAOzB,EAAEyB,IACLA,EAAKC,SAAS3C,KAAK2B,cAAvB,CAGAe,EAAKE,SAAS5C,KAAK2B,cACnBE,EAAUZ,EAAEpB,OAAOG,KAAK0B,aAAe1B,KAAKwB,eAAgBxB,KAAK6C,aAAaH,GAAOb,MACrF,IAAIK,GAAOjB,EAAEpB,QAAQS,KAAMN,KAAKM,KAAMoC,KAAMA,EAAMb,QAASA,GAAU7B,KAAK8C,cAAcJ,EAAMb,GAC9Fa,GAAKK,KAAK/C,KAAKM,KAAM4B,GACrBlC,KAAKgD,YAAYN,EAAMR,GACvBlC,KAAKiD,OAAOP,EAAMb,KAiBnBiB,cAAe,SAASJ,EAAMb,GAC7B,UAcDmB,YAAa,SAASN,EAAMR,KAU5BW,aAAc,SAASH,MACtB,IACC,GAAIK,MAAOL,KAAKK,KAAK/C,KAAKM,KAAK4C,gBAAkB,EACjDH,MAAOA,KAAK5B,QAAQ,UAAW,SAASgC,EAAGC,GAC1C,MAAOA,GAAI,IAAO,MAChBjC,QAAQ,mBAAoB,SAASC,EAAOC,EAAOgC,GACrD,GAAIC,GAAQP,KAAKQ,UAAU,EAAGF,GAAGjC,MAAM,KACvC,OAASkC,IAASA,EAAME,OAAS,IAAM,EAAyBnC,EAAQ,IAA7B,IAAMA,EAAQ,OACvDF,QAAQ,OAAQ,KACnB4B,KAAO9B,EAAEwC,UAAU,IAAMV,KAAO,IAChC,KAAK,GAAInC,OAAOmC,MACf,GAAIA,KAAKW,eAAe9C,KAAM,CAC7B,GAAI+C,OAAQZ,KAAKnC,IACI,iBAAV+C,QAAsBA,MAAMvC,MAAM,gCAC5C2B,KAAKnC,KAAOgD,KAAKD,QAIpB,MAAOZ,MAER,MAAOI,GACN,WAQFU,SAAU,SAASnB,GAClB,MAAOzB,GAAEyB,GAAMK,KAAK/C,KAAKM,WAiB1B2C,OAAQ,SAASP,EAAMpC,EAAMqD,GAC5BjB,EAAOzB,EAAEyB,EACT,IAAIR,GAAOQ,EAAKK,KAAK/C,KAAKM,MACtBuB,EAAUvB,KACd,QAAMA,GAAyB,gBAATA,IAAsC,mBAAVqD,IACjD9B,GAAWK,OAAYL,QACfA,GAAWvB,EAAOuB,EAAQvB,GAAQuB,QAEtCa,EAAKC,SAAS3C,KAAK2B,gBAGJ,gBAATrB,KACVuB,KACAA,EAAQvB,GAAQqD,GAEjB3D,KAAK8D,gBAAgBpB,EAAMR,EAAML,GACjCZ,EAAEpB,OAAOqC,EAAKL,QAASA,MAexBiC,gBAAiB,SAASpB,EAAMR,EAAML,KAOtCkC,QAAS,SAASrB,GACjBA,EAAOzB,EAAEyB,GACJA,EAAKC,SAAS3C,KAAK2B,gBAGxB3B,KAAKgE,YAAYtB,EAAM1C,KAAK6D,SAASnB,IACrCA,EAAKuB,WAAWjE,KAAKM,MAAM4D,YAAYlE,KAAK2B,gBAc7CqC,YAAa,SAAStB,EAAMR,OAgB7BjB,EAAEM,UAcD4C,aAAc,SAASC,EAAYC,GACR,gBAAfD,KACVC,EAAYD,EACZA,EAAa,YAEdA,EAAalD,UAAUkD,EACvB,IAAIE,GAAYpD,UAAUmD,EAAU/D,KACpCX,SAAQC,QAAQ0E,GAAa3E,QAAQC,QAAQwE,GAAYvE,OAAOwE,GAChE,GAAI1E,SAAQC,QAAQ0E,MAIpBC","file":"jquery.plugin.min.js"}
|
||||
33
wp/wp-content/themes/child-theme/js/navigation.js
Normal file
33
wp/wp-content/themes/child-theme/js/navigation.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* navigation.js
|
||||
*
|
||||
* Handles toggling the navigation menu for small screens.
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
jQuery('#site-navigation ul:first-child').clone().appendTo('.responsive-mainnav');
|
||||
|
||||
jQuery('#main-nav-button').click(function(event){
|
||||
event.preventDefault();
|
||||
jQuery('.responsive-mainnav').slideToggle('fast');
|
||||
});
|
||||
|
||||
//sub-menu toggle
|
||||
jQuery('.sub-menu').hide();
|
||||
|
||||
jQuery("li:has(ul)").click(function(){
|
||||
|
||||
jQuery("ul",this).slideToggle();
|
||||
});
|
||||
|
||||
//close menu clicking anywhere
|
||||
// jQuery(document).click(function() {
|
||||
// jQuery(".responsive-mainnav").hide();
|
||||
// });
|
||||
// jQuery("#main-nav-button").click(function(e) {
|
||||
// e.stopPropagation();
|
||||
// return false;
|
||||
// });
|
||||
|
||||
});
|
||||
3448
wp/wp-content/themes/child-theme/js/owl.carousel.js
Normal file
3448
wp/wp-content/themes/child-theme/js/owl.carousel.js
Normal file
File diff suppressed because it is too large
Load Diff
7
wp/wp-content/themes/child-theme/js/owl.carousel.min.js
vendored
Normal file
7
wp/wp-content/themes/child-theme/js/owl.carousel.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
wp/wp-content/themes/child-theme/js/recaptcha.js
Normal file
6
wp/wp-content/themes/child-theme/js/recaptcha.js
Normal file
@@ -0,0 +1,6 @@
|
||||
jQuery(window).on('load', function () {
|
||||
let textarea = document.getElementById("g-recaptcha-response-100000");
|
||||
textarea.setAttribute("aria-hidden", "true");
|
||||
textarea.setAttribute("aria-label", "do not use");
|
||||
textarea.setAttribute("aria-readonly", "true");
|
||||
});
|
||||
6
wp/wp-content/themes/child-theme/js/respond.min.js
vendored
Normal file
6
wp/wp-content/themes/child-theme/js/respond.min.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*! Respond.js v1.4.2: min/max-width media query polyfill
|
||||
* Copyright 2014 Scott Jehl
|
||||
* Licensed under MIT
|
||||
* http://j.mp/respondjs */
|
||||
|
||||
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b<t.length;b++){var c=t[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!p[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(w(c.styleSheet.rawCssText,e,f),p[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!s||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}x()};y(),c.update=y,c.getEmValue=u,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
|
||||
28
wp/wp-content/themes/child-theme/js/scripts.js
Normal file
28
wp/wp-content/themes/child-theme/js/scripts.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/* SCROLL UP */
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
jQuery(window).scroll(function(){
|
||||
if (jQuery(this).scrollTop() > 350) {
|
||||
jQuery('.scrollup, .scrollup:before').fadeIn();
|
||||
} else {
|
||||
jQuery('.scrollup, .scrollup:before').fadeOut();
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('.scrollup').click(function(){
|
||||
jQuery("html, body").animate({ scrollTop: 0 }, 600);
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
/* SEARCH BOX */
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
jQuery(".th-search-button-icon").click(function(){
|
||||
jQuery(".th-search-box-container").toggle('fast');
|
||||
}
|
||||
);
|
||||
});
|
||||
34
wp/wp-content/themes/child-theme/js/settings.js
Normal file
34
wp/wp-content/themes/child-theme/js/settings.js
Normal file
@@ -0,0 +1,34 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#blog .owl-carousel').owlCarousel({
|
||||
autoplay: true,
|
||||
autoPlaySpeed: 5000,
|
||||
smartSpeed: 3000,
|
||||
autoplayTimeout: 10000,
|
||||
loop:true,
|
||||
responsiveClass:true,
|
||||
dots: true,
|
||||
nav: false,
|
||||
//navText: ['<i class="fa fa-arrow-left fa-2x"></i>','<i class="fa fa-arrow-right fa-2x"></i>'], //Note, if you are not using Font Awesome in your theme, you can change this to Previous & Next
|
||||
responsive:{
|
||||
0:{
|
||||
items: 1
|
||||
}
|
||||
// ,
|
||||
// 600:{
|
||||
// items: 2
|
||||
// },
|
||||
// 1000:{
|
||||
// items: 2
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
})
|
||||
})(jQuery);
|
||||
18
wp/wp-content/themes/child-theme/js/skip-link-focus-fix.js
Normal file
18
wp/wp-content/themes/child-theme/js/skip-link-focus-fix.js
Normal file
@@ -0,0 +1,18 @@
|
||||
( function() {
|
||||
var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
|
||||
is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1,
|
||||
is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1;
|
||||
|
||||
if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {
|
||||
window.addEventListener( 'hashchange', function() {
|
||||
var element = document.getElementById( location.hash.substring( 1 ) );
|
||||
|
||||
if ( element ) {
|
||||
if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) )
|
||||
element.tabIndex = -1;
|
||||
|
||||
element.focus();
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
})();
|
||||
33
wp/wp-content/themes/child-theme/js/subid.js
Normal file
33
wp/wp-content/themes/child-theme/js/subid.js
Normal file
@@ -0,0 +1,33 @@
|
||||
jQuery(document).ready(function(){
|
||||
function setCookie(name, value, days){
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days*24*60*60*1000));
|
||||
var expires = "; expires=" + date.toGMTString();
|
||||
document.cookie = name + "=" + value + expires;
|
||||
|
||||
}
|
||||
function getParam(p){
|
||||
var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search);
|
||||
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
|
||||
}
|
||||
var subid1 = getParam('subid1');
|
||||
var subid2 = getParam('subid2');
|
||||
var subid3 = getParam('subid3');
|
||||
var subid4 = getParam('subid4');
|
||||
|
||||
function readCookie(name) {
|
||||
var match = document.cookie.match(new RegExp(name + '=([^;]+)'));
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
jQuery('input[name="subid1"]').val(readCookie('subid1'));
|
||||
jQuery('input[name="subid2"]').val(readCookie('subid2'));
|
||||
jQuery('input[name="subid3"]').val(readCookie('subid3'));
|
||||
jQuery('input[name="subid4"]').val(readCookie('subid4'));
|
||||
|
||||
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
jQuery(window).load(function() {
|
||||
jQuery('.flexslider').flexslider({
|
||||
// animation: "slide",
|
||||
// direction: "horizontal",
|
||||
animationLoop: false,
|
||||
// slideshowSpeed: 7000,
|
||||
// animationSpeed: 600
|
||||
});
|
||||
});
|
||||
128
wp/wp-content/themes/child-theme/js/tree.js
Normal file
128
wp/wp-content/themes/child-theme/js/tree.js
Normal file
@@ -0,0 +1,128 @@
|
||||
(function( $ ) {
|
||||
var settings;
|
||||
var currentCard;
|
||||
var prevCard = [];
|
||||
|
||||
// Plugin definition.
|
||||
$.fn.decisionTree = function( options ) {
|
||||
var elem = $( this );
|
||||
settings = $.extend( {}, $.fn.decisionTree.defaults, options );
|
||||
|
||||
elem.addClass(settings.containerClass);
|
||||
renderRecursive(settings.data, elem, "dctree-first");
|
||||
|
||||
$('.dctree-prev').on('click', function() {
|
||||
showCard(prevCard.pop(), true);
|
||||
});
|
||||
|
||||
currentCard = $('#dctree-first');
|
||||
currentCard.show();
|
||||
};
|
||||
|
||||
|
||||
$.fn.decisionTree.defaults = {
|
||||
data: null,
|
||||
animationSpeed: "fast",
|
||||
animation: "slide-left",
|
||||
containerClass: "dc-tree",
|
||||
cardClass: "dctree-card",
|
||||
messageClass: "dctree-message"
|
||||
};
|
||||
|
||||
function renderRecursive(data, elem, id) {
|
||||
var container = $('<div></div>')
|
||||
.addClass(settings.cardClass)
|
||||
.addClass('col-xs-12');
|
||||
var message = $('<div></div>').addClass(settings.messageClass).append(data.message);
|
||||
container.append(message);
|
||||
|
||||
if (id != null) {
|
||||
container.attr('id', id)
|
||||
}
|
||||
|
||||
if (typeof data.decisions != "undefined") {
|
||||
var decisions = $('<div></div>').addClass('dctree-decisions');
|
||||
for(var i=0; data.decisions.length > i; i++) {
|
||||
var decision = data.decisions[i];
|
||||
var genId = guid();
|
||||
var grid = $('<div></div>').addClass('col-md-6');
|
||||
var answer = $('<div></div>')
|
||||
.addClass("dctree-answer-" + i)
|
||||
.append(decision.answer)
|
||||
.on('click', function() {
|
||||
getNextCard(this);
|
||||
})
|
||||
.attr('data-dctree-targetid', genId);
|
||||
if (typeof decision.class != "undefined") {
|
||||
answer.addClass(decision.class);
|
||||
}
|
||||
grid.append(answer);
|
||||
decisions.append(grid);
|
||||
renderRecursive(decision, elem, genId);
|
||||
}
|
||||
container.append(decisions);
|
||||
}
|
||||
|
||||
|
||||
if (id != 'dctree-first') {
|
||||
var controls = $('<div></div>').addClass('dctree-controls col-md-12');
|
||||
controls.append($('<a href="javascrip:;" class="dctree-prev">< Back</a>'));
|
||||
container.append(controls);
|
||||
}
|
||||
|
||||
elem.append(container);
|
||||
}
|
||||
|
||||
function getNextCard(elem)
|
||||
{
|
||||
var e = $(elem);
|
||||
currentCard = e.parents('.' + settings.cardClass)[0];
|
||||
prevCard.push(currentCard.id);
|
||||
var nextCard = e.attr('data-dctree-targetid');
|
||||
showCard(nextCard);
|
||||
}
|
||||
|
||||
function showCard(id, backward)
|
||||
{
|
||||
var nextCard = $("#" + id);
|
||||
|
||||
if (settings.animation == 'slide') {
|
||||
$(currentCard).slideUp(settings.animationSpeed, function(){
|
||||
nextCard.slideDown(settings.animationSpeed);
|
||||
});
|
||||
} else if (settings.animation == 'fade') {
|
||||
$(currentCard).fadeOut(settings.animationSpeed, function(){
|
||||
nextCard.fadeIn(settings.animationSpeed);
|
||||
});
|
||||
} else if (settings.animation == 'slide-left') {
|
||||
var left = {left: "-100%"};
|
||||
var card = $(currentCard);
|
||||
|
||||
if (backward) {
|
||||
left = {left: "100%"};
|
||||
}
|
||||
card.animate(left, settings.animationSpeed, function(){
|
||||
card.hide();
|
||||
});
|
||||
|
||||
if (nextCard.css('left') == "-100%" || nextCard.css('left') == "100%") {
|
||||
left.left = 0;
|
||||
nextCard.show().animate(left, settings.animationSpeed);
|
||||
} else {
|
||||
nextCard.fadeIn(settings.animationSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
currentCard = nextCard;
|
||||
}
|
||||
|
||||
function guid() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
// End of closure.
|
||||
|
||||
})( jQuery );
|
||||
1
wp/wp-content/themes/child-theme/js/yotpo.js
Normal file
1
wp/wp-content/themes/child-theme/js/yotpo.js
Normal file
@@ -0,0 +1 @@
|
||||
(function e(){var e=document.createElement("script");e.type="text/javascript",e.async=true,e.src="//staticw2.yotpo.com/Wa9yFWn0NZFPaLcRAvKeG7rI36Y3OBx8db4JyjFz/widget.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();
|
||||
Reference in New Issue
Block a user