Defer.js v2.5.0 オリジナル→JetTheme差分

Created Diff never expires
1 removal
70 lines
2 additions
70 lines
/*@shinsenter/defer.js@2.5.0*/ ! function(r, i, t) {
/*@shinsenter/defer.js@2.5.0*/ ! function(r, i, t) {
var u, o = /^data-(.+)/,
var u, o = /^data-(.+)/,
a = 'IntersectionObserver',
a = 'IntersectionObserver',
c = /p/.test(i.readyState),
c = /p/.test(i.readyState),
s = [],
s = [],
f = s.slice,
f = s.slice,
l = 'deferjs',
l = 'deferjs',
n = 'load',
n = 'load',
e = 'pageshow',
e = 'pageshow',
d = 'forEach',
d = 'forEach',
h = 'shift';
h = 'shift';


function m(e) {
function m(e) {
i.head.appendChild(e)
i.head.appendChild(e)
}
}


function v(e, n) {
function v(e, n) {
f.call(e.attributes)[d](n)
f.call(e.attributes)[d](n)
}
}


function p(e, n, t, o) {
function p(e, n, t, o) {
return o = (o = n ? i.getElementById(n) : o) || i.createElement(e), n && (o.id = n), t && (o.onload = t), o
return o = (o = n ? i.getElementById(n) : o) || i.createElement(e), n && (o.id = n), t && (o.onload = t), o
}
}


function y(e, n) {
function y(e, n) {
return f.call((n || i).querySelectorAll(e))
return f.call((n || i).querySelectorAll(e))
}
}


function b(t, e) {
function b(t, e) {
y('source', t)[d](b), v(t, function(e, n) {
y('source', t)[d](b), v(t, function(e, n) {
(n = o.exec(e.name)) && (t[n[1]] = e.value)
(n = o.exec(e.name)) && (t[n[1]] = e.value)
}), e && (t.className += ' ' + e), n in t && t[n]()
}), e && (t.className += ' ' + e), n in t && t[n]()
}
}


function I(e) {
function I(e) {
u(function(o) {
u(function(o) {
o = y(e || '[type=deferjs]'),
o = y(e || '[type=deferjs]'),
function e(n, t) {
function e(n, t) {
(n = o[h]()) && (n.parentNode.removeChild(n), (t = p(n.nodeName)).text = n.text, v(n, function(e) {
(n = o[h]()) && (n.parentNode.removeChild(n), (t = p(n.nodeName)).text = n.text, v(n, function(e) {
'type' != e.name && t.setAttribute(e.name, e.value)
'type' != e.name && t.setAttribute(e.name, e.value)
}), t.src && !t.hasAttribute('async') ? (t.onload = t.onerror = e, m(t)) : (m(t), e()))
}), t.src && !t.hasAttribute('async') ? (t.onload = t.onerror = e, m(t)) : (m(t), e()))
}()
}()
})
})
}(u = function(e, n) {
}(u = function(e, n) {
c ? t(e, n) : s.push(e, n)
c ? t(e, n) : s.push(e, n)
}).all = I, u.js = function(n, t, e, o) {
}).all = I, u.js = function(n, t, e, o) {
u(function(e) {
u(function(e) {
(e = p('SCRIPT', t, o)).src = n, m(e)
(e = p('SCRIPT', t, o)).src = n, m(e)
}, e)
}, e)
}, u.css = function(n, t, e, o) {
}, u.css = function(n, t, e, o) {
u(function(e) {
u(function(e) {
(e = p('LINK', t, o)).rel = 'stylesheet', e.href = n, m(e)
(e = p('LINK', t, o)).rel = 'stylesheet', e.href = n, m(e)
}, e)
}, e)
}, u.dom = function(e, n, t, o, i) {
}, u.dom = function(e, n, t, z, o, i) {
function c(e) {
function c(e) {
o && !1 === o(e) || b(e, t)
o && !1 === o(e) || b(e, t)
}
}
u(function(t) {
u(function(t) {
t = a in r && new r[a](function(e) {
t = a in r && new r[a](function(e) {
e[d](function(e, n) {
e[d](function(e, n) {
e.isIntersecting && (n = e.target) && (t.unobserve(n), c(n))
e.isIntersecting && (n = e.target) && (z && z(n), t.unobserve(n), c(n))
})
})
}, i), y(e || '[data-src]')[d](function(e) {
}, i), y(e || '[data-src]')[d](function(e) {
l in e || (e[l] = 1, t ? t.observe(e) : c(e))
l in e || (e[l] = 1, t ? t.observe(e) : c(e))
})
})
}, n)
}, n)
}, u.reveal = b, r.Defer = u, r.addEventListener('on' + e in r ? e : n, function() {
}, u.reveal = b, r.Defer = u, r.addEventListener('on' + e in r ? e : n, function() {
for(I(); s[0]; t(s[h](), s[h]())) c = 1
for(I(); s[0]; t(s[h](), s[h]())) c = 1
})
})
}(this, document, setTimeout);
}(this, document, setTimeout);