Comparing version 2.0.7 to 2.1.0
# Change Log | ||
## Dom7 v2.1.0 - Released on August 31, 2018 | ||
* Added TypeScript definitions | ||
## Dom7 v2.0.7 - Released on June 14, 2018 | ||
@@ -4,0 +7,0 @@ * Fixed issue with undefined elements in classList access (#13) |
2754
dist/dom7.js
/** | ||
* Dom7 2.0.7 | ||
* Dom7 2.1.0 | ||
* Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API | ||
@@ -12,24 +12,22 @@ * http://framework7.io/docs/dom.html | ||
* | ||
* Released on: June 14, 2018 | ||
* Released on: August 31, 2018 | ||
*/ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.Dom7 = factory()); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.Dom7 = factory()); | ||
}(this, (function () { 'use strict'; | ||
/** | ||
* SSR Window 1.0.0 | ||
* Better handling for window object in SSR environment | ||
* https://github.com/nolimits4web/ssr-window | ||
* | ||
* Copyright 2018, Vladimir Kharlampidi | ||
* | ||
* Licensed under MIT | ||
* | ||
* Released on: February 10, 2018 | ||
*/ | ||
var d; | ||
if (typeof document === 'undefined') { | ||
d = { | ||
/** | ||
* SSR Window 1.0.1 | ||
* Better handling for window object in SSR environment | ||
* https://github.com/nolimits4web/ssr-window | ||
* | ||
* Copyright 2018, Vladimir Kharlampidi | ||
* | ||
* Licensed under MIT | ||
* | ||
* Released on: July 18, 2018 | ||
*/ | ||
var doc = (typeof document === 'undefined') ? { | ||
body: {}, | ||
@@ -68,13 +66,5 @@ addEventListener: function addEventListener() {}, | ||
location: { hash: '' }, | ||
}; | ||
} else { | ||
// eslint-disable-next-line | ||
d = document; | ||
} | ||
} : document; // eslint-disable-line | ||
var doc = d; | ||
var w; | ||
if (typeof window === 'undefined') { | ||
w = { | ||
var win = (typeof window === 'undefined') ? { | ||
document: doc, | ||
@@ -103,193 +93,154 @@ navigator: { | ||
clearTimeout: function clearTimeout() {}, | ||
} : window; // eslint-disable-line | ||
var Dom7 = function Dom7(arr) { | ||
var self = this; | ||
// Create array-like object | ||
for (var i = 0; i < arr.length; i += 1) { | ||
self[i] = arr[i]; | ||
} | ||
self.length = arr.length; | ||
// Return collection with methods | ||
return this; | ||
}; | ||
} else { | ||
// eslint-disable-next-line | ||
w = window; | ||
} | ||
var win = w; | ||
var Dom7 = function Dom7(arr) { | ||
var self = this; | ||
// Create array-like object | ||
for (var i = 0; i < arr.length; i += 1) { | ||
self[i] = arr[i]; | ||
} | ||
self.length = arr.length; | ||
// Return collection with methods | ||
return this; | ||
}; | ||
function $$1(selector, context) { | ||
var arr = []; | ||
var i = 0; | ||
if (selector && !context) { | ||
if (selector instanceof Dom7) { | ||
return selector; | ||
function $(selector, context) { | ||
var arr = []; | ||
var i = 0; | ||
if (selector && !context) { | ||
if (selector instanceof Dom7) { | ||
return selector; | ||
} | ||
} | ||
} | ||
if (selector) { | ||
// String | ||
if (typeof selector === 'string') { | ||
var els; | ||
var tempParent; | ||
var html = selector.trim(); | ||
if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) { | ||
var toCreate = 'div'; | ||
if (html.indexOf('<li') === 0) { toCreate = 'ul'; } | ||
if (html.indexOf('<tr') === 0) { toCreate = 'tbody'; } | ||
if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) { toCreate = 'tr'; } | ||
if (html.indexOf('<tbody') === 0) { toCreate = 'table'; } | ||
if (html.indexOf('<option') === 0) { toCreate = 'select'; } | ||
tempParent = doc.createElement(toCreate); | ||
tempParent.innerHTML = html; | ||
for (i = 0; i < tempParent.childNodes.length; i += 1) { | ||
arr.push(tempParent.childNodes[i]); | ||
} | ||
} else { | ||
if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) { | ||
// Pure ID selector | ||
els = [doc.getElementById(selector.trim().split('#')[1])]; | ||
if (selector) { | ||
// String | ||
if (typeof selector === 'string') { | ||
var els; | ||
var tempParent; | ||
var html = selector.trim(); | ||
if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) { | ||
var toCreate = 'div'; | ||
if (html.indexOf('<li') === 0) { toCreate = 'ul'; } | ||
if (html.indexOf('<tr') === 0) { toCreate = 'tbody'; } | ||
if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) { toCreate = 'tr'; } | ||
if (html.indexOf('<tbody') === 0) { toCreate = 'table'; } | ||
if (html.indexOf('<option') === 0) { toCreate = 'select'; } | ||
tempParent = doc.createElement(toCreate); | ||
tempParent.innerHTML = html; | ||
for (i = 0; i < tempParent.childNodes.length; i += 1) { | ||
arr.push(tempParent.childNodes[i]); | ||
} | ||
} else { | ||
// Other selectors | ||
els = (context || doc).querySelectorAll(selector.trim()); | ||
if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) { | ||
// Pure ID selector | ||
els = [doc.getElementById(selector.trim().split('#')[1])]; | ||
} else { | ||
// Other selectors | ||
els = (context || doc).querySelectorAll(selector.trim()); | ||
} | ||
for (i = 0; i < els.length; i += 1) { | ||
if (els[i]) { arr.push(els[i]); } | ||
} | ||
} | ||
for (i = 0; i < els.length; i += 1) { | ||
if (els[i]) { arr.push(els[i]); } | ||
} else if (selector.nodeType || selector === win || selector === doc) { | ||
// Node/element | ||
arr.push(selector); | ||
} else if (selector.length > 0 && selector[0].nodeType) { | ||
// Array of elements or instance of Dom | ||
for (i = 0; i < selector.length; i += 1) { | ||
arr.push(selector[i]); | ||
} | ||
} | ||
} else if (selector.nodeType || selector === win || selector === doc) { | ||
// Node/element | ||
arr.push(selector); | ||
} else if (selector.length > 0 && selector[0].nodeType) { | ||
// Array of elements or instance of Dom | ||
for (i = 0; i < selector.length; i += 1) { | ||
arr.push(selector[i]); | ||
} | ||
} | ||
return new Dom7(arr); | ||
} | ||
return new Dom7(arr); | ||
} | ||
$$1.fn = Dom7.prototype; | ||
$$1.Class = Dom7; | ||
$$1.Dom7 = Dom7; | ||
$.fn = Dom7.prototype; | ||
$.Class = Dom7; | ||
$.Dom7 = Dom7; | ||
function unique(arr) { | ||
var uniqueArray = []; | ||
for (var i = 0; i < arr.length; i += 1) { | ||
if (uniqueArray.indexOf(arr[i]) === -1) { uniqueArray.push(arr[i]); } | ||
function unique(arr) { | ||
var uniqueArray = []; | ||
for (var i = 0; i < arr.length; i += 1) { | ||
if (uniqueArray.indexOf(arr[i]) === -1) { uniqueArray.push(arr[i]); } | ||
} | ||
return uniqueArray; | ||
} | ||
return uniqueArray; | ||
} | ||
function toCamelCase(string) { | ||
return string.toLowerCase().replace(/-(.)/g, function (match, group1) { return group1.toUpperCase(); }); | ||
} | ||
function toCamelCase(string) { | ||
return string.toLowerCase().replace(/-(.)/g, function (match, group1) { return group1.toUpperCase(); }); | ||
} | ||
function requestAnimationFrame(callback) { | ||
if (win.requestAnimationFrame) { return win.requestAnimationFrame(callback); } | ||
else if (win.webkitRequestAnimationFrame) { return win.webkitRequestAnimationFrame(callback); } | ||
return win.setTimeout(callback, 1000 / 60); | ||
} | ||
function cancelAnimationFrame(id) { | ||
if (win.cancelAnimationFrame) { return win.cancelAnimationFrame(id); } | ||
else if (win.webkitCancelAnimationFrame) { return win.webkitCancelAnimationFrame(id); } | ||
return win.clearTimeout(id); | ||
} | ||
// Classes and attributes | ||
function addClass(className) { | ||
var this$1 = this; | ||
if (typeof className === 'undefined') { | ||
return this; | ||
function requestAnimationFrame(callback) { | ||
if (win.requestAnimationFrame) { return win.requestAnimationFrame(callback); } | ||
else if (win.webkitRequestAnimationFrame) { return win.webkitRequestAnimationFrame(callback); } | ||
return win.setTimeout(callback, 1000 / 60); | ||
} | ||
var classes = className.split(' '); | ||
for (var i = 0; i < classes.length; i += 1) { | ||
for (var j = 0; j < this.length; j += 1) { | ||
if (typeof this$1[j] !== 'undefined' && typeof this$1[j].classList !== 'undefined') { this$1[j].classList.add(classes[i]); } | ||
} | ||
function cancelAnimationFrame(id) { | ||
if (win.cancelAnimationFrame) { return win.cancelAnimationFrame(id); } | ||
else if (win.webkitCancelAnimationFrame) { return win.webkitCancelAnimationFrame(id); } | ||
return win.clearTimeout(id); | ||
} | ||
return this; | ||
} | ||
function removeClass(className) { | ||
var this$1 = this; | ||
var classes = className.split(' '); | ||
for (var i = 0; i < classes.length; i += 1) { | ||
for (var j = 0; j < this.length; j += 1) { | ||
if (typeof this$1[j] !== 'undefined' && typeof this$1[j].classList !== 'undefined') { this$1[j].classList.remove(classes[i]); } | ||
// Classes and attributes | ||
function addClass(className) { | ||
var this$1 = this; | ||
if (typeof className === 'undefined') { | ||
return this; | ||
} | ||
var classes = className.split(' '); | ||
for (var i = 0; i < classes.length; i += 1) { | ||
for (var j = 0; j < this.length; j += 1) { | ||
if (typeof this$1[j] !== 'undefined' && typeof this$1[j].classList !== 'undefined') { this$1[j].classList.add(classes[i]); } | ||
} | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function hasClass(className) { | ||
if (!this[0]) { return false; } | ||
return this[0].classList.contains(className); | ||
} | ||
function toggleClass(className) { | ||
var this$1 = this; | ||
function removeClass(className) { | ||
var this$1 = this; | ||
var classes = className.split(' '); | ||
for (var i = 0; i < classes.length; i += 1) { | ||
for (var j = 0; j < this.length; j += 1) { | ||
if (typeof this$1[j] !== 'undefined' && typeof this$1[j].classList !== 'undefined') { this$1[j].classList.toggle(classes[i]); } | ||
var classes = className.split(' '); | ||
for (var i = 0; i < classes.length; i += 1) { | ||
for (var j = 0; j < this.length; j += 1) { | ||
if (typeof this$1[j] !== 'undefined' && typeof this$1[j].classList !== 'undefined') { this$1[j].classList.remove(classes[i]); } | ||
} | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function attr(attrs, value) { | ||
var arguments$1 = arguments; | ||
var this$1 = this; | ||
if (arguments.length === 1 && typeof attrs === 'string') { | ||
// Get attr | ||
if (this[0]) { return this[0].getAttribute(attrs); } | ||
return undefined; | ||
function hasClass(className) { | ||
if (!this[0]) { return false; } | ||
return this[0].classList.contains(className); | ||
} | ||
function toggleClass(className) { | ||
var this$1 = this; | ||
// Set attrs | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (arguments$1.length === 2) { | ||
// String | ||
this$1[i].setAttribute(attrs, value); | ||
} else { | ||
// Object | ||
// eslint-disable-next-line | ||
for (var attrName in attrs) { | ||
this$1[i][attrName] = attrs[attrName]; | ||
this$1[i].setAttribute(attrName, attrs[attrName]); | ||
var classes = className.split(' '); | ||
for (var i = 0; i < classes.length; i += 1) { | ||
for (var j = 0; j < this.length; j += 1) { | ||
if (typeof this$1[j] !== 'undefined' && typeof this$1[j].classList !== 'undefined') { this$1[j].classList.toggle(classes[i]); } | ||
} | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
// eslint-disable-next-line | ||
function removeAttr(attr) { | ||
var this$1 = this; | ||
function attr(attrs, value) { | ||
var arguments$1 = arguments; | ||
var this$1 = this; | ||
for (var i = 0; i < this.length; i += 1) { | ||
this$1[i].removeAttribute(attr); | ||
} | ||
return this; | ||
} | ||
// eslint-disable-next-line | ||
function prop(props, value) { | ||
var arguments$1 = arguments; | ||
var this$1 = this; | ||
if (arguments.length === 1 && typeof attrs === 'string') { | ||
// Get attr | ||
if (this[0]) { return this[0].getAttribute(attrs); } | ||
return undefined; | ||
} | ||
if (arguments.length === 1 && typeof props === 'string') { | ||
// Get prop | ||
if (this[0]) { return this[0][props]; } | ||
} else { | ||
// Set props | ||
// Set attrs | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (arguments$1.length === 2) { | ||
// String | ||
this$1[i][props] = value; | ||
this$1[i].setAttribute(attrs, value); | ||
} else { | ||
// Object | ||
// eslint-disable-next-line | ||
for (var propName in props) { | ||
this$1[i][propName] = props[propName]; | ||
for (var attrName in attrs) { | ||
this$1[i][attrName] = attrs[attrName]; | ||
this$1[i].setAttribute(attrName, attrs[attrName]); | ||
} | ||
@@ -300,228 +251,262 @@ } | ||
} | ||
} | ||
function data(key, value) { | ||
var this$1 = this; | ||
// eslint-disable-next-line | ||
function removeAttr(attr) { | ||
var this$1 = this; | ||
var el; | ||
if (typeof value === 'undefined') { | ||
el = this[0]; | ||
// Get value | ||
if (el) { | ||
if (el.dom7ElementDataStorage && (key in el.dom7ElementDataStorage)) { | ||
return el.dom7ElementDataStorage[key]; | ||
for (var i = 0; i < this.length; i += 1) { | ||
this$1[i].removeAttribute(attr); | ||
} | ||
return this; | ||
} | ||
// eslint-disable-next-line | ||
function prop(props, value) { | ||
var arguments$1 = arguments; | ||
var this$1 = this; | ||
if (arguments.length === 1 && typeof props === 'string') { | ||
// Get prop | ||
if (this[0]) { return this[0][props]; } | ||
} else { | ||
// Set props | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (arguments$1.length === 2) { | ||
// String | ||
this$1[i][props] = value; | ||
} else { | ||
// Object | ||
// eslint-disable-next-line | ||
for (var propName in props) { | ||
this$1[i][propName] = props[propName]; | ||
} | ||
} | ||
} | ||
return this; | ||
} | ||
} | ||
function data(key, value) { | ||
var this$1 = this; | ||
var dataKey = el.getAttribute(("data-" + key)); | ||
if (dataKey) { | ||
return dataKey; | ||
var el; | ||
if (typeof value === 'undefined') { | ||
el = this[0]; | ||
// Get value | ||
if (el) { | ||
if (el.dom7ElementDataStorage && (key in el.dom7ElementDataStorage)) { | ||
return el.dom7ElementDataStorage[key]; | ||
} | ||
var dataKey = el.getAttribute(("data-" + key)); | ||
if (dataKey) { | ||
return dataKey; | ||
} | ||
return undefined; | ||
} | ||
return undefined; | ||
} | ||
return undefined; | ||
} | ||
// Set value | ||
for (var i = 0; i < this.length; i += 1) { | ||
el = this$1[i]; | ||
if (!el.dom7ElementDataStorage) { el.dom7ElementDataStorage = {}; } | ||
el.dom7ElementDataStorage[key] = value; | ||
// Set value | ||
for (var i = 0; i < this.length; i += 1) { | ||
el = this$1[i]; | ||
if (!el.dom7ElementDataStorage) { el.dom7ElementDataStorage = {}; } | ||
el.dom7ElementDataStorage[key] = value; | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function removeData(key) { | ||
var this$1 = this; | ||
function removeData(key) { | ||
var this$1 = this; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var el = this$1[i]; | ||
if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) { | ||
el.dom7ElementDataStorage[key] = null; | ||
delete el.dom7ElementDataStorage[key]; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var el = this$1[i]; | ||
if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) { | ||
el.dom7ElementDataStorage[key] = null; | ||
delete el.dom7ElementDataStorage[key]; | ||
} | ||
} | ||
} | ||
} | ||
function dataset() { | ||
var el = this[0]; | ||
if (!el) { return undefined; } | ||
var dataset = {}; // eslint-disable-line | ||
if (el.dataset) { | ||
// eslint-disable-next-line | ||
for (var dataKey in el.dataset) { | ||
dataset[dataKey] = el.dataset[dataKey]; | ||
} | ||
} else { | ||
for (var i = 0; i < el.attributes.length; i += 1) { | ||
function dataset() { | ||
var el = this[0]; | ||
if (!el) { return undefined; } | ||
var dataset = {}; // eslint-disable-line | ||
if (el.dataset) { | ||
// eslint-disable-next-line | ||
var attr = el.attributes[i]; | ||
if (attr.name.indexOf('data-') >= 0) { | ||
dataset[toCamelCase(attr.name.split('data-')[1])] = attr.value; | ||
for (var dataKey in el.dataset) { | ||
dataset[dataKey] = el.dataset[dataKey]; | ||
} | ||
} else { | ||
for (var i = 0; i < el.attributes.length; i += 1) { | ||
// eslint-disable-next-line | ||
var attr = el.attributes[i]; | ||
if (attr.name.indexOf('data-') >= 0) { | ||
dataset[toCamelCase(attr.name.split('data-')[1])] = attr.value; | ||
} | ||
} | ||
} | ||
// eslint-disable-next-line | ||
for (var key in dataset) { | ||
if (dataset[key] === 'false') { dataset[key] = false; } | ||
else if (dataset[key] === 'true') { dataset[key] = true; } | ||
else if (parseFloat(dataset[key]) === dataset[key] * 1) { dataset[key] *= 1; } | ||
} | ||
return dataset; | ||
} | ||
// eslint-disable-next-line | ||
for (var key in dataset) { | ||
if (dataset[key] === 'false') { dataset[key] = false; } | ||
else if (dataset[key] === 'true') { dataset[key] = true; } | ||
else if (parseFloat(dataset[key]) === dataset[key] * 1) { dataset[key] *= 1; } | ||
} | ||
return dataset; | ||
} | ||
function val(value) { | ||
var dom = this; | ||
if (typeof value === 'undefined') { | ||
if (dom[0]) { | ||
if (dom[0].multiple && dom[0].nodeName.toLowerCase() === 'select') { | ||
var values = []; | ||
for (var i = 0; i < dom[0].selectedOptions.length; i += 1) { | ||
values.push(dom[0].selectedOptions[i].value); | ||
function val(value) { | ||
var dom = this; | ||
if (typeof value === 'undefined') { | ||
if (dom[0]) { | ||
if (dom[0].multiple && dom[0].nodeName.toLowerCase() === 'select') { | ||
var values = []; | ||
for (var i = 0; i < dom[0].selectedOptions.length; i += 1) { | ||
values.push(dom[0].selectedOptions[i].value); | ||
} | ||
return values; | ||
} | ||
return values; | ||
return dom[0].value; | ||
} | ||
return dom[0].value; | ||
return undefined; | ||
} | ||
return undefined; | ||
} | ||
for (var i$1 = 0; i$1 < dom.length; i$1 += 1) { | ||
var el = dom[i$1]; | ||
if (Array.isArray(value) && el.multiple && el.nodeName.toLowerCase() === 'select') { | ||
for (var j = 0; j < el.options.length; j += 1) { | ||
el.options[j].selected = value.indexOf(el.options[j].value) >= 0; | ||
for (var i$1 = 0; i$1 < dom.length; i$1 += 1) { | ||
var el = dom[i$1]; | ||
if (Array.isArray(value) && el.multiple && el.nodeName.toLowerCase() === 'select') { | ||
for (var j = 0; j < el.options.length; j += 1) { | ||
el.options[j].selected = value.indexOf(el.options[j].value) >= 0; | ||
} | ||
} else { | ||
el.value = value; | ||
} | ||
} else { | ||
el.value = value; | ||
} | ||
return dom; | ||
} | ||
return dom; | ||
} | ||
// Transforms | ||
// eslint-disable-next-line | ||
function transform(transform) { | ||
var this$1 = this; | ||
// Transforms | ||
// eslint-disable-next-line | ||
function transform(transform) { | ||
var this$1 = this; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var elStyle = this$1[i].style; | ||
elStyle.webkitTransform = transform; | ||
elStyle.transform = transform; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var elStyle = this$1[i].style; | ||
elStyle.webkitTransform = transform; | ||
elStyle.transform = transform; | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function transition(duration) { | ||
var this$1 = this; | ||
function transition(duration) { | ||
var this$1 = this; | ||
if (typeof duration !== 'string') { | ||
duration = duration + "ms"; // eslint-disable-line | ||
if (typeof duration !== 'string') { | ||
duration = duration + "ms"; // eslint-disable-line | ||
} | ||
for (var i = 0; i < this.length; i += 1) { | ||
var elStyle = this$1[i].style; | ||
elStyle.webkitTransitionDuration = duration; | ||
elStyle.transitionDuration = duration; | ||
} | ||
return this; | ||
} | ||
for (var i = 0; i < this.length; i += 1) { | ||
var elStyle = this$1[i].style; | ||
elStyle.webkitTransitionDuration = duration; | ||
elStyle.transitionDuration = duration; | ||
} | ||
return this; | ||
} | ||
// Events | ||
function on() { | ||
var this$1 = this; | ||
var assign; | ||
// Events | ||
function on() { | ||
var this$1 = this; | ||
var assign; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var eventType = args[0]; | ||
var targetSelector = args[1]; | ||
var listener = args[2]; | ||
var capture = args[3]; | ||
if (typeof args[1] === 'function') { | ||
(assign = args, eventType = assign[0], listener = assign[1], capture = assign[2]); | ||
targetSelector = undefined; | ||
} | ||
if (!capture) { capture = false; } | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var eventType = args[0]; | ||
var targetSelector = args[1]; | ||
var listener = args[2]; | ||
var capture = args[3]; | ||
if (typeof args[1] === 'function') { | ||
(assign = args, eventType = assign[0], listener = assign[1], capture = assign[2]); | ||
targetSelector = undefined; | ||
} | ||
if (!capture) { capture = false; } | ||
function handleLiveEvent(e) { | ||
var target = e.target; | ||
if (!target) { return; } | ||
var eventData = e.target.dom7EventData || []; | ||
if (eventData.indexOf(e) < 0) { | ||
eventData.unshift(e); | ||
function handleLiveEvent(e) { | ||
var target = e.target; | ||
if (!target) { return; } | ||
var eventData = e.target.dom7EventData || []; | ||
if (eventData.indexOf(e) < 0) { | ||
eventData.unshift(e); | ||
} | ||
if ($(target).is(targetSelector)) { listener.apply(target, eventData); } | ||
else { | ||
var parents = $(target).parents(); // eslint-disable-line | ||
for (var k = 0; k < parents.length; k += 1) { | ||
if ($(parents[k]).is(targetSelector)) { listener.apply(parents[k], eventData); } | ||
} | ||
} | ||
} | ||
if ($$1(target).is(targetSelector)) { listener.apply(target, eventData); } | ||
else { | ||
var parents = $$1(target).parents(); // eslint-disable-line | ||
for (var k = 0; k < parents.length; k += 1) { | ||
if ($$1(parents[k]).is(targetSelector)) { listener.apply(parents[k], eventData); } | ||
function handleEvent(e) { | ||
var eventData = e && e.target ? e.target.dom7EventData || [] : []; | ||
if (eventData.indexOf(e) < 0) { | ||
eventData.unshift(e); | ||
} | ||
listener.apply(this, eventData); | ||
} | ||
} | ||
function handleEvent(e) { | ||
var eventData = e && e.target ? e.target.dom7EventData || [] : []; | ||
if (eventData.indexOf(e) < 0) { | ||
eventData.unshift(e); | ||
} | ||
listener.apply(this, eventData); | ||
} | ||
var events = eventType.split(' '); | ||
var j; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var el = this$1[i]; | ||
if (!targetSelector) { | ||
for (j = 0; j < events.length; j += 1) { | ||
var event = events[j]; | ||
if (!el.dom7Listeners) { el.dom7Listeners = {}; } | ||
if (!el.dom7Listeners[event]) { el.dom7Listeners[event] = []; } | ||
el.dom7Listeners[event].push({ | ||
listener: listener, | ||
proxyListener: handleEvent, | ||
}); | ||
el.addEventListener(event, handleEvent, capture); | ||
var events = eventType.split(' '); | ||
var j; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var el = this$1[i]; | ||
if (!targetSelector) { | ||
for (j = 0; j < events.length; j += 1) { | ||
var event = events[j]; | ||
if (!el.dom7Listeners) { el.dom7Listeners = {}; } | ||
if (!el.dom7Listeners[event]) { el.dom7Listeners[event] = []; } | ||
el.dom7Listeners[event].push({ | ||
listener: listener, | ||
proxyListener: handleEvent, | ||
}); | ||
el.addEventListener(event, handleEvent, capture); | ||
} | ||
} else { | ||
// Live events | ||
for (j = 0; j < events.length; j += 1) { | ||
var event$1 = events[j]; | ||
if (!el.dom7LiveListeners) { el.dom7LiveListeners = {}; } | ||
if (!el.dom7LiveListeners[event$1]) { el.dom7LiveListeners[event$1] = []; } | ||
el.dom7LiveListeners[event$1].push({ | ||
listener: listener, | ||
proxyListener: handleLiveEvent, | ||
}); | ||
el.addEventListener(event$1, handleLiveEvent, capture); | ||
} | ||
} | ||
} else { | ||
// Live events | ||
for (j = 0; j < events.length; j += 1) { | ||
var event$1 = events[j]; | ||
if (!el.dom7LiveListeners) { el.dom7LiveListeners = {}; } | ||
if (!el.dom7LiveListeners[event$1]) { el.dom7LiveListeners[event$1] = []; } | ||
el.dom7LiveListeners[event$1].push({ | ||
listener: listener, | ||
proxyListener: handleLiveEvent, | ||
}); | ||
el.addEventListener(event$1, handleLiveEvent, capture); | ||
} | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function off() { | ||
var this$1 = this; | ||
var assign; | ||
function off() { | ||
var this$1 = this; | ||
var assign; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var eventType = args[0]; | ||
var targetSelector = args[1]; | ||
var listener = args[2]; | ||
var capture = args[3]; | ||
if (typeof args[1] === 'function') { | ||
(assign = args, eventType = assign[0], listener = assign[1], capture = assign[2]); | ||
targetSelector = undefined; | ||
} | ||
if (!capture) { capture = false; } | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var eventType = args[0]; | ||
var targetSelector = args[1]; | ||
var listener = args[2]; | ||
var capture = args[3]; | ||
if (typeof args[1] === 'function') { | ||
(assign = args, eventType = assign[0], listener = assign[1], capture = assign[2]); | ||
targetSelector = undefined; | ||
} | ||
if (!capture) { capture = false; } | ||
var events = eventType.split(' '); | ||
for (var i = 0; i < events.length; i += 1) { | ||
var event = events[i]; | ||
for (var j = 0; j < this.length; j += 1) { | ||
var el = this$1[j]; | ||
var handlers = (void 0); | ||
if (!targetSelector && el.dom7Listeners) { | ||
handlers = el.dom7Listeners[event]; | ||
} else if (targetSelector && el.dom7LiveListeners) { | ||
handlers = el.dom7LiveListeners[event]; | ||
} | ||
if (handlers && handlers.length) { | ||
for (var k = handlers.length - 1; k >= 0; k -= 1) { | ||
var handler = handlers[k]; | ||
if (listener && handler.listener === listener) { | ||
el.removeEventListener(event, handler.proxyListener, capture); | ||
handlers.splice(k, 1); | ||
} else if (!listener) { | ||
el.removeEventListener(event, handler.proxyListener, capture); | ||
handlers.splice(k, 1); | ||
var events = eventType.split(' '); | ||
for (var i = 0; i < events.length; i += 1) { | ||
var event = events[i]; | ||
for (var j = 0; j < this.length; j += 1) { | ||
var el = this$1[j]; | ||
var handlers = (void 0); | ||
if (!targetSelector && el.dom7Listeners) { | ||
handlers = el.dom7Listeners[event]; | ||
} else if (targetSelector && el.dom7LiveListeners) { | ||
handlers = el.dom7LiveListeners[event]; | ||
} | ||
if (handlers && handlers.length) { | ||
for (var k = handlers.length - 1; k >= 0; k -= 1) { | ||
var handler = handlers[k]; | ||
if (listener && handler.listener === listener) { | ||
el.removeEventListener(event, handler.proxyListener, capture); | ||
handlers.splice(k, 1); | ||
} else if (!listener) { | ||
el.removeEventListener(event, handler.proxyListener, capture); | ||
handlers.splice(k, 1); | ||
} | ||
} | ||
@@ -531,1218 +516,1205 @@ } | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function once() { | ||
var assign; | ||
function once() { | ||
var assign; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var dom = this; | ||
var eventName = args[0]; | ||
var targetSelector = args[1]; | ||
var listener = args[2]; | ||
var capture = args[3]; | ||
if (typeof args[1] === 'function') { | ||
(assign = args, eventName = assign[0], listener = assign[1], capture = assign[2]); | ||
targetSelector = undefined; | ||
} | ||
function proxy() { | ||
var eventArgs = [], len = arguments.length; | ||
while ( len-- ) eventArgs[ len ] = arguments[ len ]; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var dom = this; | ||
var eventName = args[0]; | ||
var targetSelector = args[1]; | ||
var listener = args[2]; | ||
var capture = args[3]; | ||
if (typeof args[1] === 'function') { | ||
(assign = args, eventName = assign[0], listener = assign[1], capture = assign[2]); | ||
targetSelector = undefined; | ||
} | ||
function proxy() { | ||
var eventArgs = [], len = arguments.length; | ||
while ( len-- ) eventArgs[ len ] = arguments[ len ]; | ||
listener.apply(this, eventArgs); | ||
dom.off(eventName, targetSelector, proxy, capture); | ||
listener.apply(this, eventArgs); | ||
dom.off(eventName, targetSelector, proxy, capture); | ||
} | ||
return dom.on(eventName, targetSelector, proxy, capture); | ||
} | ||
return dom.on(eventName, targetSelector, proxy, capture); | ||
} | ||
function trigger() { | ||
var this$1 = this; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
function trigger() { | ||
var this$1 = this; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var events = args[0].split(' '); | ||
var eventData = args[1]; | ||
for (var i = 0; i < events.length; i += 1) { | ||
var event = events[i]; | ||
for (var j = 0; j < this.length; j += 1) { | ||
var el = this$1[j]; | ||
var evt = (void 0); | ||
try { | ||
evt = new win.CustomEvent(event, { | ||
detail: eventData, | ||
bubbles: true, | ||
cancelable: true, | ||
}); | ||
} catch (e) { | ||
evt = doc.createEvent('Event'); | ||
evt.initEvent(event, true, true); | ||
evt.detail = eventData; | ||
var events = args[0].split(' '); | ||
var eventData = args[1]; | ||
for (var i = 0; i < events.length; i += 1) { | ||
var event = events[i]; | ||
for (var j = 0; j < this.length; j += 1) { | ||
var el = this$1[j]; | ||
var evt = (void 0); | ||
try { | ||
evt = new win.CustomEvent(event, { | ||
detail: eventData, | ||
bubbles: true, | ||
cancelable: true, | ||
}); | ||
} catch (e) { | ||
evt = doc.createEvent('Event'); | ||
evt.initEvent(event, true, true); | ||
evt.detail = eventData; | ||
} | ||
// eslint-disable-next-line | ||
el.dom7EventData = args.filter(function (data, dataIndex) { return dataIndex > 0; }); | ||
el.dispatchEvent(evt); | ||
el.dom7EventData = []; | ||
delete el.dom7EventData; | ||
} | ||
// eslint-disable-next-line | ||
el.dom7EventData = args.filter(function (data, dataIndex) { return dataIndex > 0; }); | ||
el.dispatchEvent(evt); | ||
el.dom7EventData = []; | ||
delete el.dom7EventData; | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function transitionEnd(callback) { | ||
var events = ['webkitTransitionEnd', 'transitionend']; | ||
var dom = this; | ||
var i; | ||
function fireCallBack(e) { | ||
/* jshint validthis:true */ | ||
if (e.target !== this) { return; } | ||
callback.call(this, e); | ||
for (i = 0; i < events.length; i += 1) { | ||
dom.off(events[i], fireCallBack); | ||
function transitionEnd(callback) { | ||
var events = ['webkitTransitionEnd', 'transitionend']; | ||
var dom = this; | ||
var i; | ||
function fireCallBack(e) { | ||
/* jshint validthis:true */ | ||
if (e.target !== this) { return; } | ||
callback.call(this, e); | ||
for (i = 0; i < events.length; i += 1) { | ||
dom.off(events[i], fireCallBack); | ||
} | ||
} | ||
if (callback) { | ||
for (i = 0; i < events.length; i += 1) { | ||
dom.on(events[i], fireCallBack); | ||
} | ||
} | ||
return this; | ||
} | ||
if (callback) { | ||
for (i = 0; i < events.length; i += 1) { | ||
dom.on(events[i], fireCallBack); | ||
function animationEnd(callback) { | ||
var events = ['webkitAnimationEnd', 'animationend']; | ||
var dom = this; | ||
var i; | ||
function fireCallBack(e) { | ||
if (e.target !== this) { return; } | ||
callback.call(this, e); | ||
for (i = 0; i < events.length; i += 1) { | ||
dom.off(events[i], fireCallBack); | ||
} | ||
} | ||
if (callback) { | ||
for (i = 0; i < events.length; i += 1) { | ||
dom.on(events[i], fireCallBack); | ||
} | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function animationEnd(callback) { | ||
var events = ['webkitAnimationEnd', 'animationend']; | ||
var dom = this; | ||
var i; | ||
function fireCallBack(e) { | ||
if (e.target !== this) { return; } | ||
callback.call(this, e); | ||
for (i = 0; i < events.length; i += 1) { | ||
dom.off(events[i], fireCallBack); | ||
// Sizing/Styles | ||
function width() { | ||
if (this[0] === win) { | ||
return win.innerWidth; | ||
} | ||
if (this.length > 0) { | ||
return parseFloat(this.css('width')); | ||
} | ||
return null; | ||
} | ||
if (callback) { | ||
for (i = 0; i < events.length; i += 1) { | ||
dom.on(events[i], fireCallBack); | ||
function outerWidth(includeMargins) { | ||
if (this.length > 0) { | ||
if (includeMargins) { | ||
// eslint-disable-next-line | ||
var styles = this.styles(); | ||
return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left')); | ||
} | ||
return this[0].offsetWidth; | ||
} | ||
return null; | ||
} | ||
return this; | ||
} | ||
// Sizing/Styles | ||
function width() { | ||
if (this[0] === win) { | ||
return win.innerWidth; | ||
} | ||
function height() { | ||
if (this[0] === win) { | ||
return win.innerHeight; | ||
} | ||
if (this.length > 0) { | ||
return parseFloat(this.css('width')); | ||
if (this.length > 0) { | ||
return parseFloat(this.css('height')); | ||
} | ||
return null; | ||
} | ||
return null; | ||
} | ||
function outerWidth(includeMargins) { | ||
if (this.length > 0) { | ||
if (includeMargins) { | ||
// eslint-disable-next-line | ||
var styles = this.styles(); | ||
return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left')); | ||
function outerHeight(includeMargins) { | ||
if (this.length > 0) { | ||
if (includeMargins) { | ||
// eslint-disable-next-line | ||
var styles = this.styles(); | ||
return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom')); | ||
} | ||
return this[0].offsetHeight; | ||
} | ||
return this[0].offsetWidth; | ||
return null; | ||
} | ||
return null; | ||
} | ||
function height() { | ||
if (this[0] === win) { | ||
return win.innerHeight; | ||
} | ||
function offset() { | ||
if (this.length > 0) { | ||
var el = this[0]; | ||
var box = el.getBoundingClientRect(); | ||
var body = doc.body; | ||
var clientTop = el.clientTop || body.clientTop || 0; | ||
var clientLeft = el.clientLeft || body.clientLeft || 0; | ||
var scrollTop = el === win ? win.scrollY : el.scrollTop; | ||
var scrollLeft = el === win ? win.scrollX : el.scrollLeft; | ||
return { | ||
top: (box.top + scrollTop) - clientTop, | ||
left: (box.left + scrollLeft) - clientLeft, | ||
}; | ||
} | ||
if (this.length > 0) { | ||
return parseFloat(this.css('height')); | ||
return null; | ||
} | ||
function hide() { | ||
var this$1 = this; | ||
return null; | ||
} | ||
function outerHeight(includeMargins) { | ||
if (this.length > 0) { | ||
if (includeMargins) { | ||
// eslint-disable-next-line | ||
var styles = this.styles(); | ||
return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom')); | ||
for (var i = 0; i < this.length; i += 1) { | ||
this$1[i].style.display = 'none'; | ||
} | ||
return this[0].offsetHeight; | ||
return this; | ||
} | ||
return null; | ||
} | ||
function offset() { | ||
if (this.length > 0) { | ||
var el = this[0]; | ||
var box = el.getBoundingClientRect(); | ||
var body = doc.body; | ||
var clientTop = el.clientTop || body.clientTop || 0; | ||
var clientLeft = el.clientLeft || body.clientLeft || 0; | ||
var scrollTop = el === win ? win.scrollY : el.scrollTop; | ||
var scrollLeft = el === win ? win.scrollX : el.scrollLeft; | ||
return { | ||
top: (box.top + scrollTop) - clientTop, | ||
left: (box.left + scrollLeft) - clientLeft, | ||
}; | ||
} | ||
function show() { | ||
var this$1 = this; | ||
return null; | ||
} | ||
function hide() { | ||
var this$1 = this; | ||
for (var i = 0; i < this.length; i += 1) { | ||
this$1[i].style.display = 'none'; | ||
} | ||
return this; | ||
} | ||
function show() { | ||
var this$1 = this; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var el = this$1[i]; | ||
if (el.style.display === 'none') { | ||
el.style.display = ''; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var el = this$1[i]; | ||
if (el.style.display === 'none') { | ||
el.style.display = ''; | ||
} | ||
if (win.getComputedStyle(el, null).getPropertyValue('display') === 'none') { | ||
// Still not visible | ||
el.style.display = 'block'; | ||
} | ||
} | ||
if (win.getComputedStyle(el, null).getPropertyValue('display') === 'none') { | ||
// Still not visible | ||
el.style.display = 'block'; | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function styles() { | ||
if (this[0]) { return win.getComputedStyle(this[0], null); } | ||
return {}; | ||
} | ||
function css(props, value) { | ||
var this$1 = this; | ||
function styles() { | ||
if (this[0]) { return win.getComputedStyle(this[0], null); } | ||
return {}; | ||
} | ||
function css(props, value) { | ||
var this$1 = this; | ||
var i; | ||
if (arguments.length === 1) { | ||
if (typeof props === 'string') { | ||
if (this[0]) { return win.getComputedStyle(this[0], null).getPropertyValue(props); } | ||
} else { | ||
for (i = 0; i < this.length; i += 1) { | ||
// eslint-disable-next-line | ||
for (var prop in props) { | ||
this$1[i].style[prop] = props[prop]; | ||
var i; | ||
if (arguments.length === 1) { | ||
if (typeof props === 'string') { | ||
if (this[0]) { return win.getComputedStyle(this[0], null).getPropertyValue(props); } | ||
} else { | ||
for (i = 0; i < this.length; i += 1) { | ||
// eslint-disable-next-line | ||
for (var prop in props) { | ||
this$1[i].style[prop] = props[prop]; | ||
} | ||
} | ||
return this; | ||
} | ||
} | ||
if (arguments.length === 2 && typeof props === 'string') { | ||
for (i = 0; i < this.length; i += 1) { | ||
this$1[i].style[props] = value; | ||
} | ||
return this; | ||
} | ||
} | ||
if (arguments.length === 2 && typeof props === 'string') { | ||
for (i = 0; i < this.length; i += 1) { | ||
this$1[i].style[props] = value; | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
// Dom manipulation | ||
function toArray() { | ||
var this$1 = this; | ||
// Dom manipulation | ||
function toArray() { | ||
var this$1 = this; | ||
var arr = []; | ||
for (var i = 0; i < this.length; i += 1) { | ||
arr.push(this$1[i]); | ||
var arr = []; | ||
for (var i = 0; i < this.length; i += 1) { | ||
arr.push(this$1[i]); | ||
} | ||
return arr; | ||
} | ||
return arr; | ||
} | ||
// Iterate over the collection passing elements to `callback` | ||
function each(callback) { | ||
var this$1 = this; | ||
// Iterate over the collection passing elements to `callback` | ||
function each(callback) { | ||
var this$1 = this; | ||
// Don't bother continuing without a callback | ||
if (!callback) { return this; } | ||
// Iterate over the current collection | ||
for (var i = 0; i < this.length; i += 1) { | ||
// If the callback returns false | ||
if (callback.call(this$1[i], i, this$1[i]) === false) { | ||
// End the loop early | ||
return this$1; | ||
// Don't bother continuing without a callback | ||
if (!callback) { return this; } | ||
// Iterate over the current collection | ||
for (var i = 0; i < this.length; i += 1) { | ||
// If the callback returns false | ||
if (callback.call(this$1[i], i, this$1[i]) === false) { | ||
// End the loop early | ||
return this$1; | ||
} | ||
} | ||
// Return `this` to allow chained DOM operations | ||
return this; | ||
} | ||
// Return `this` to allow chained DOM operations | ||
return this; | ||
} | ||
function forEach(callback) { | ||
var this$1 = this; | ||
function forEach(callback) { | ||
var this$1 = this; | ||
// Don't bother continuing without a callback | ||
if (!callback) { return this; } | ||
// Iterate over the current collection | ||
for (var i = 0; i < this.length; i += 1) { | ||
// If the callback returns false | ||
if (callback.call(this$1[i], this$1[i], i) === false) { | ||
// End the loop early | ||
return this$1; | ||
// Don't bother continuing without a callback | ||
if (!callback) { return this; } | ||
// Iterate over the current collection | ||
for (var i = 0; i < this.length; i += 1) { | ||
// If the callback returns false | ||
if (callback.call(this$1[i], this$1[i], i) === false) { | ||
// End the loop early | ||
return this$1; | ||
} | ||
} | ||
// Return `this` to allow chained DOM operations | ||
return this; | ||
} | ||
// Return `this` to allow chained DOM operations | ||
return this; | ||
} | ||
function filter(callback) { | ||
var matchedItems = []; | ||
var dom = this; | ||
for (var i = 0; i < dom.length; i += 1) { | ||
if (callback.call(dom[i], i, dom[i])) { matchedItems.push(dom[i]); } | ||
function filter(callback) { | ||
var matchedItems = []; | ||
var dom = this; | ||
for (var i = 0; i < dom.length; i += 1) { | ||
if (callback.call(dom[i], i, dom[i])) { matchedItems.push(dom[i]); } | ||
} | ||
return new Dom7(matchedItems); | ||
} | ||
return new Dom7(matchedItems); | ||
} | ||
function map(callback) { | ||
var modifiedItems = []; | ||
var dom = this; | ||
for (var i = 0; i < dom.length; i += 1) { | ||
modifiedItems.push(callback.call(dom[i], i, dom[i])); | ||
function map(callback) { | ||
var modifiedItems = []; | ||
var dom = this; | ||
for (var i = 0; i < dom.length; i += 1) { | ||
modifiedItems.push(callback.call(dom[i], i, dom[i])); | ||
} | ||
return new Dom7(modifiedItems); | ||
} | ||
return new Dom7(modifiedItems); | ||
} | ||
// eslint-disable-next-line | ||
function html(html) { | ||
var this$1 = this; | ||
// eslint-disable-next-line | ||
function html(html) { | ||
var this$1 = this; | ||
if (typeof html === 'undefined') { | ||
return this[0] ? this[0].innerHTML : undefined; | ||
} | ||
if (typeof html === 'undefined') { | ||
return this[0] ? this[0].innerHTML : undefined; | ||
} | ||
for (var i = 0; i < this.length; i += 1) { | ||
this$1[i].innerHTML = html; | ||
for (var i = 0; i < this.length; i += 1) { | ||
this$1[i].innerHTML = html; | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
// eslint-disable-next-line | ||
function text(text) { | ||
var this$1 = this; | ||
// eslint-disable-next-line | ||
function text(text) { | ||
var this$1 = this; | ||
if (typeof text === 'undefined') { | ||
if (this[0]) { | ||
return this[0].textContent.trim(); | ||
if (typeof text === 'undefined') { | ||
if (this[0]) { | ||
return this[0].textContent.trim(); | ||
} | ||
return null; | ||
} | ||
return null; | ||
} | ||
for (var i = 0; i < this.length; i += 1) { | ||
this$1[i].textContent = text; | ||
for (var i = 0; i < this.length; i += 1) { | ||
this$1[i].textContent = text; | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function is(selector) { | ||
var el = this[0]; | ||
var compareWith; | ||
var i; | ||
if (!el || typeof selector === 'undefined') { return false; } | ||
if (typeof selector === 'string') { | ||
if (el.matches) { return el.matches(selector); } | ||
else if (el.webkitMatchesSelector) { return el.webkitMatchesSelector(selector); } | ||
else if (el.msMatchesSelector) { return el.msMatchesSelector(selector); } | ||
function is(selector) { | ||
var el = this[0]; | ||
var compareWith; | ||
var i; | ||
if (!el || typeof selector === 'undefined') { return false; } | ||
if (typeof selector === 'string') { | ||
if (el.matches) { return el.matches(selector); } | ||
else if (el.webkitMatchesSelector) { return el.webkitMatchesSelector(selector); } | ||
else if (el.msMatchesSelector) { return el.msMatchesSelector(selector); } | ||
compareWith = $$1(selector); | ||
for (i = 0; i < compareWith.length; i += 1) { | ||
if (compareWith[i] === el) { return true; } | ||
} | ||
return false; | ||
} else if (selector === doc) { return el === doc; } | ||
else if (selector === win) { return el === win; } | ||
compareWith = $(selector); | ||
for (i = 0; i < compareWith.length; i += 1) { | ||
if (compareWith[i] === el) { return true; } | ||
} | ||
return false; | ||
} else if (selector === doc) { return el === doc; } | ||
else if (selector === win) { return el === win; } | ||
if (selector.nodeType || selector instanceof Dom7) { | ||
compareWith = selector.nodeType ? [selector] : selector; | ||
for (i = 0; i < compareWith.length; i += 1) { | ||
if (compareWith[i] === el) { return true; } | ||
if (selector.nodeType || selector instanceof Dom7) { | ||
compareWith = selector.nodeType ? [selector] : selector; | ||
for (i = 0; i < compareWith.length; i += 1) { | ||
if (compareWith[i] === el) { return true; } | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
function indexOf(el) { | ||
var this$1 = this; | ||
function indexOf(el) { | ||
var this$1 = this; | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (this$1[i] === el) { return i; } | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (this$1[i] === el) { return i; } | ||
} | ||
return -1; | ||
} | ||
return -1; | ||
} | ||
function index() { | ||
var child = this[0]; | ||
var i; | ||
if (child) { | ||
i = 0; | ||
// eslint-disable-next-line | ||
while ((child = child.previousSibling) !== null) { | ||
if (child.nodeType === 1) { i += 1; } | ||
function index() { | ||
var child = this[0]; | ||
var i; | ||
if (child) { | ||
i = 0; | ||
// eslint-disable-next-line | ||
while ((child = child.previousSibling) !== null) { | ||
if (child.nodeType === 1) { i += 1; } | ||
} | ||
return i; | ||
} | ||
return i; | ||
return undefined; | ||
} | ||
return undefined; | ||
} | ||
// eslint-disable-next-line | ||
function eq(index) { | ||
if (typeof index === 'undefined') { return this; } | ||
var length = this.length; | ||
var returnIndex; | ||
if (index > length - 1) { | ||
return new Dom7([]); | ||
// eslint-disable-next-line | ||
function eq(index) { | ||
if (typeof index === 'undefined') { return this; } | ||
var length = this.length; | ||
var returnIndex; | ||
if (index > length - 1) { | ||
return new Dom7([]); | ||
} | ||
if (index < 0) { | ||
returnIndex = length + index; | ||
if (returnIndex < 0) { return new Dom7([]); } | ||
return new Dom7([this[returnIndex]]); | ||
} | ||
return new Dom7([this[index]]); | ||
} | ||
if (index < 0) { | ||
returnIndex = length + index; | ||
if (returnIndex < 0) { return new Dom7([]); } | ||
return new Dom7([this[returnIndex]]); | ||
function append() { | ||
var this$1 = this; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var newChild; | ||
for (var k = 0; k < args.length; k += 1) { | ||
newChild = args[k]; | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (typeof newChild === 'string') { | ||
var tempDiv = doc.createElement('div'); | ||
tempDiv.innerHTML = newChild; | ||
while (tempDiv.firstChild) { | ||
this$1[i].appendChild(tempDiv.firstChild); | ||
} | ||
} else if (newChild instanceof Dom7) { | ||
for (var j = 0; j < newChild.length; j += 1) { | ||
this$1[i].appendChild(newChild[j]); | ||
} | ||
} else { | ||
this$1[i].appendChild(newChild); | ||
} | ||
} | ||
} | ||
return this; | ||
} | ||
return new Dom7([this[index]]); | ||
} | ||
function append() { | ||
var this$1 = this; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
// eslint-disable-next-line | ||
function appendTo(parent) { | ||
$(parent).append(this); | ||
return this; | ||
} | ||
function prepend(newChild) { | ||
var this$1 = this; | ||
var newChild; | ||
for (var k = 0; k < args.length; k += 1) { | ||
newChild = args[k]; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var i; | ||
var j; | ||
for (i = 0; i < this.length; i += 1) { | ||
if (typeof newChild === 'string') { | ||
var tempDiv = doc.createElement('div'); | ||
tempDiv.innerHTML = newChild; | ||
while (tempDiv.firstChild) { | ||
this$1[i].appendChild(tempDiv.firstChild); | ||
for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) { | ||
this$1[i].insertBefore(tempDiv.childNodes[j], this$1[i].childNodes[0]); | ||
} | ||
} else if (newChild instanceof Dom7) { | ||
for (var j = 0; j < newChild.length; j += 1) { | ||
this$1[i].appendChild(newChild[j]); | ||
for (j = 0; j < newChild.length; j += 1) { | ||
this$1[i].insertBefore(newChild[j], this$1[i].childNodes[0]); | ||
} | ||
} else { | ||
this$1[i].appendChild(newChild); | ||
this$1[i].insertBefore(newChild, this$1[i].childNodes[0]); | ||
} | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
// eslint-disable-next-line | ||
function appendTo(parent) { | ||
$$1(parent).append(this); | ||
return this; | ||
} | ||
function prepend(newChild) { | ||
var this$1 = this; | ||
var i; | ||
var j; | ||
for (i = 0; i < this.length; i += 1) { | ||
if (typeof newChild === 'string') { | ||
var tempDiv = doc.createElement('div'); | ||
tempDiv.innerHTML = newChild; | ||
for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) { | ||
this$1[i].insertBefore(tempDiv.childNodes[j], this$1[i].childNodes[0]); | ||
} | ||
} else if (newChild instanceof Dom7) { | ||
for (j = 0; j < newChild.length; j += 1) { | ||
this$1[i].insertBefore(newChild[j], this$1[i].childNodes[0]); | ||
} | ||
} else { | ||
this$1[i].insertBefore(newChild, this$1[i].childNodes[0]); | ||
} | ||
// eslint-disable-next-line | ||
function prependTo(parent) { | ||
$(parent).prepend(this); | ||
return this; | ||
} | ||
return this; | ||
} | ||
// eslint-disable-next-line | ||
function prependTo(parent) { | ||
$$1(parent).prepend(this); | ||
return this; | ||
} | ||
function insertBefore(selector) { | ||
var this$1 = this; | ||
function insertBefore(selector) { | ||
var this$1 = this; | ||
var before = $$1(selector); | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (before.length === 1) { | ||
before[0].parentNode.insertBefore(this$1[i], before[0]); | ||
} else if (before.length > 1) { | ||
for (var j = 0; j < before.length; j += 1) { | ||
before[j].parentNode.insertBefore(this$1[i].cloneNode(true), before[j]); | ||
var before = $(selector); | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (before.length === 1) { | ||
before[0].parentNode.insertBefore(this$1[i], before[0]); | ||
} else if (before.length > 1) { | ||
for (var j = 0; j < before.length; j += 1) { | ||
before[j].parentNode.insertBefore(this$1[i].cloneNode(true), before[j]); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
function insertAfter(selector) { | ||
var this$1 = this; | ||
function insertAfter(selector) { | ||
var this$1 = this; | ||
var after = $$1(selector); | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (after.length === 1) { | ||
after[0].parentNode.insertBefore(this$1[i], after[0].nextSibling); | ||
} else if (after.length > 1) { | ||
for (var j = 0; j < after.length; j += 1) { | ||
after[j].parentNode.insertBefore(this$1[i].cloneNode(true), after[j].nextSibling); | ||
var after = $(selector); | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (after.length === 1) { | ||
after[0].parentNode.insertBefore(this$1[i], after[0].nextSibling); | ||
} else if (after.length > 1) { | ||
for (var j = 0; j < after.length; j += 1) { | ||
after[j].parentNode.insertBefore(this$1[i].cloneNode(true), after[j].nextSibling); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
function next(selector) { | ||
if (this.length > 0) { | ||
if (selector) { | ||
if (this[0].nextElementSibling && $$1(this[0].nextElementSibling).is(selector)) { | ||
return new Dom7([this[0].nextElementSibling]); | ||
function next(selector) { | ||
if (this.length > 0) { | ||
if (selector) { | ||
if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) { | ||
return new Dom7([this[0].nextElementSibling]); | ||
} | ||
return new Dom7([]); | ||
} | ||
if (this[0].nextElementSibling) { return new Dom7([this[0].nextElementSibling]); } | ||
return new Dom7([]); | ||
} | ||
if (this[0].nextElementSibling) { return new Dom7([this[0].nextElementSibling]); } | ||
return new Dom7([]); | ||
} | ||
return new Dom7([]); | ||
} | ||
function nextAll(selector) { | ||
var nextEls = []; | ||
var el = this[0]; | ||
if (!el) { return new Dom7([]); } | ||
while (el.nextElementSibling) { | ||
var next = el.nextElementSibling; // eslint-disable-line | ||
if (selector) { | ||
if ($$1(next).is(selector)) { nextEls.push(next); } | ||
} else { nextEls.push(next); } | ||
el = next; | ||
function nextAll(selector) { | ||
var nextEls = []; | ||
var el = this[0]; | ||
if (!el) { return new Dom7([]); } | ||
while (el.nextElementSibling) { | ||
var next = el.nextElementSibling; // eslint-disable-line | ||
if (selector) { | ||
if ($(next).is(selector)) { nextEls.push(next); } | ||
} else { nextEls.push(next); } | ||
el = next; | ||
} | ||
return new Dom7(nextEls); | ||
} | ||
return new Dom7(nextEls); | ||
} | ||
function prev(selector) { | ||
if (this.length > 0) { | ||
var el = this[0]; | ||
if (selector) { | ||
if (el.previousElementSibling && $$1(el.previousElementSibling).is(selector)) { | ||
return new Dom7([el.previousElementSibling]); | ||
function prev(selector) { | ||
if (this.length > 0) { | ||
var el = this[0]; | ||
if (selector) { | ||
if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) { | ||
return new Dom7([el.previousElementSibling]); | ||
} | ||
return new Dom7([]); | ||
} | ||
if (el.previousElementSibling) { return new Dom7([el.previousElementSibling]); } | ||
return new Dom7([]); | ||
} | ||
if (el.previousElementSibling) { return new Dom7([el.previousElementSibling]); } | ||
return new Dom7([]); | ||
} | ||
return new Dom7([]); | ||
} | ||
function prevAll(selector) { | ||
var prevEls = []; | ||
var el = this[0]; | ||
if (!el) { return new Dom7([]); } | ||
while (el.previousElementSibling) { | ||
var prev = el.previousElementSibling; // eslint-disable-line | ||
if (selector) { | ||
if ($$1(prev).is(selector)) { prevEls.push(prev); } | ||
} else { prevEls.push(prev); } | ||
el = prev; | ||
function prevAll(selector) { | ||
var prevEls = []; | ||
var el = this[0]; | ||
if (!el) { return new Dom7([]); } | ||
while (el.previousElementSibling) { | ||
var prev = el.previousElementSibling; // eslint-disable-line | ||
if (selector) { | ||
if ($(prev).is(selector)) { prevEls.push(prev); } | ||
} else { prevEls.push(prev); } | ||
el = prev; | ||
} | ||
return new Dom7(prevEls); | ||
} | ||
return new Dom7(prevEls); | ||
} | ||
function siblings(selector) { | ||
return this.nextAll(selector).add(this.prevAll(selector)); | ||
} | ||
function parent(selector) { | ||
var this$1 = this; | ||
function siblings(selector) { | ||
return this.nextAll(selector).add(this.prevAll(selector)); | ||
} | ||
function parent(selector) { | ||
var this$1 = this; | ||
var parents = []; // eslint-disable-line | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (this$1[i].parentNode !== null) { | ||
if (selector) { | ||
if ($$1(this$1[i].parentNode).is(selector)) { parents.push(this$1[i].parentNode); } | ||
} else { | ||
parents.push(this$1[i].parentNode); | ||
var parents = []; // eslint-disable-line | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (this$1[i].parentNode !== null) { | ||
if (selector) { | ||
if ($(this$1[i].parentNode).is(selector)) { parents.push(this$1[i].parentNode); } | ||
} else { | ||
parents.push(this$1[i].parentNode); | ||
} | ||
} | ||
} | ||
return $(unique(parents)); | ||
} | ||
return $$1(unique(parents)); | ||
} | ||
function parents(selector) { | ||
var this$1 = this; | ||
function parents(selector) { | ||
var this$1 = this; | ||
var parents = []; // eslint-disable-line | ||
for (var i = 0; i < this.length; i += 1) { | ||
var parent = this$1[i].parentNode; // eslint-disable-line | ||
while (parent) { | ||
if (selector) { | ||
if ($$1(parent).is(selector)) { parents.push(parent); } | ||
} else { | ||
parents.push(parent); | ||
var parents = []; // eslint-disable-line | ||
for (var i = 0; i < this.length; i += 1) { | ||
var parent = this$1[i].parentNode; // eslint-disable-line | ||
while (parent) { | ||
if (selector) { | ||
if ($(parent).is(selector)) { parents.push(parent); } | ||
} else { | ||
parents.push(parent); | ||
} | ||
parent = parent.parentNode; | ||
} | ||
parent = parent.parentNode; | ||
} | ||
return $(unique(parents)); | ||
} | ||
return $$1(unique(parents)); | ||
} | ||
function closest(selector) { | ||
var closest = this; // eslint-disable-line | ||
if (typeof selector === 'undefined') { | ||
return new Dom7([]); | ||
function closest(selector) { | ||
var closest = this; // eslint-disable-line | ||
if (typeof selector === 'undefined') { | ||
return new Dom7([]); | ||
} | ||
if (!closest.is(selector)) { | ||
closest = closest.parents(selector).eq(0); | ||
} | ||
return closest; | ||
} | ||
if (!closest.is(selector)) { | ||
closest = closest.parents(selector).eq(0); | ||
} | ||
return closest; | ||
} | ||
function find(selector) { | ||
var this$1 = this; | ||
function find(selector) { | ||
var this$1 = this; | ||
var foundElements = []; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var found = this$1[i].querySelectorAll(selector); | ||
for (var j = 0; j < found.length; j += 1) { | ||
foundElements.push(found[j]); | ||
var foundElements = []; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var found = this$1[i].querySelectorAll(selector); | ||
for (var j = 0; j < found.length; j += 1) { | ||
foundElements.push(found[j]); | ||
} | ||
} | ||
return new Dom7(foundElements); | ||
} | ||
return new Dom7(foundElements); | ||
} | ||
function children(selector) { | ||
var this$1 = this; | ||
function children(selector) { | ||
var this$1 = this; | ||
var children = []; // eslint-disable-line | ||
for (var i = 0; i < this.length; i += 1) { | ||
var childNodes = this$1[i].childNodes; | ||
var children = []; // eslint-disable-line | ||
for (var i = 0; i < this.length; i += 1) { | ||
var childNodes = this$1[i].childNodes; | ||
for (var j = 0; j < childNodes.length; j += 1) { | ||
if (!selector) { | ||
if (childNodes[j].nodeType === 1) { children.push(childNodes[j]); } | ||
} else if (childNodes[j].nodeType === 1 && $$1(childNodes[j]).is(selector)) { | ||
children.push(childNodes[j]); | ||
for (var j = 0; j < childNodes.length; j += 1) { | ||
if (!selector) { | ||
if (childNodes[j].nodeType === 1) { children.push(childNodes[j]); } | ||
} else if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) { | ||
children.push(childNodes[j]); | ||
} | ||
} | ||
} | ||
return new Dom7(unique(children)); | ||
} | ||
return new Dom7(unique(children)); | ||
} | ||
function remove() { | ||
var this$1 = this; | ||
function remove() { | ||
var this$1 = this; | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (this$1[i].parentNode) { this$1[i].parentNode.removeChild(this$1[i]); } | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (this$1[i].parentNode) { this$1[i].parentNode.removeChild(this$1[i]); } | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
function detach() { | ||
return this.remove(); | ||
} | ||
function add() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
function detach() { | ||
return this.remove(); | ||
} | ||
function add() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var dom = this; | ||
var i; | ||
var j; | ||
for (i = 0; i < args.length; i += 1) { | ||
var toAdd = $$1(args[i]); | ||
for (j = 0; j < toAdd.length; j += 1) { | ||
dom[dom.length] = toAdd[j]; | ||
dom.length += 1; | ||
var dom = this; | ||
var i; | ||
var j; | ||
for (i = 0; i < args.length; i += 1) { | ||
var toAdd = $(args[i]); | ||
for (j = 0; j < toAdd.length; j += 1) { | ||
dom[dom.length] = toAdd[j]; | ||
dom.length += 1; | ||
} | ||
} | ||
return dom; | ||
} | ||
return dom; | ||
} | ||
function empty() { | ||
var this$1 = this; | ||
function empty() { | ||
var this$1 = this; | ||
for (var i = 0; i < this.length; i += 1) { | ||
var el = this$1[i]; | ||
if (el.nodeType === 1) { | ||
for (var j = 0; j < el.childNodes.length; j += 1) { | ||
if (el.childNodes[j].parentNode) { | ||
el.childNodes[j].parentNode.removeChild(el.childNodes[j]); | ||
for (var i = 0; i < this.length; i += 1) { | ||
var el = this$1[i]; | ||
if (el.nodeType === 1) { | ||
for (var j = 0; j < el.childNodes.length; j += 1) { | ||
if (el.childNodes[j].parentNode) { | ||
el.childNodes[j].parentNode.removeChild(el.childNodes[j]); | ||
} | ||
} | ||
el.textContent = ''; | ||
} | ||
el.textContent = ''; | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
var Methods = /*#__PURE__*/Object.freeze({ | ||
addClass: addClass, | ||
removeClass: removeClass, | ||
hasClass: hasClass, | ||
toggleClass: toggleClass, | ||
attr: attr, | ||
removeAttr: removeAttr, | ||
prop: prop, | ||
data: data, | ||
removeData: removeData, | ||
dataset: dataset, | ||
val: val, | ||
transform: transform, | ||
transition: transition, | ||
on: on, | ||
off: off, | ||
once: once, | ||
trigger: trigger, | ||
transitionEnd: transitionEnd, | ||
animationEnd: animationEnd, | ||
width: width, | ||
outerWidth: outerWidth, | ||
height: height, | ||
outerHeight: outerHeight, | ||
offset: offset, | ||
hide: hide, | ||
show: show, | ||
styles: styles, | ||
css: css, | ||
toArray: toArray, | ||
each: each, | ||
forEach: forEach, | ||
filter: filter, | ||
map: map, | ||
html: html, | ||
text: text, | ||
is: is, | ||
indexOf: indexOf, | ||
index: index, | ||
eq: eq, | ||
append: append, | ||
appendTo: appendTo, | ||
prepend: prepend, | ||
prependTo: prependTo, | ||
insertBefore: insertBefore, | ||
insertAfter: insertAfter, | ||
next: next, | ||
nextAll: nextAll, | ||
prev: prev, | ||
prevAll: prevAll, | ||
siblings: siblings, | ||
parent: parent, | ||
parents: parents, | ||
closest: closest, | ||
find: find, | ||
children: children, | ||
remove: remove, | ||
detach: detach, | ||
add: add, | ||
empty: empty | ||
}); | ||
function scrollTo() { | ||
var assign; | ||
var Methods = Object.freeze({ | ||
addClass: addClass, | ||
removeClass: removeClass, | ||
hasClass: hasClass, | ||
toggleClass: toggleClass, | ||
attr: attr, | ||
removeAttr: removeAttr, | ||
prop: prop, | ||
data: data, | ||
removeData: removeData, | ||
dataset: dataset, | ||
val: val, | ||
transform: transform, | ||
transition: transition, | ||
on: on, | ||
off: off, | ||
once: once, | ||
trigger: trigger, | ||
transitionEnd: transitionEnd, | ||
animationEnd: animationEnd, | ||
width: width, | ||
outerWidth: outerWidth, | ||
height: height, | ||
outerHeight: outerHeight, | ||
offset: offset, | ||
hide: hide, | ||
show: show, | ||
styles: styles, | ||
css: css, | ||
toArray: toArray, | ||
each: each, | ||
forEach: forEach, | ||
filter: filter, | ||
map: map, | ||
html: html, | ||
text: text, | ||
is: is, | ||
indexOf: indexOf, | ||
index: index, | ||
eq: eq, | ||
append: append, | ||
appendTo: appendTo, | ||
prepend: prepend, | ||
prependTo: prependTo, | ||
insertBefore: insertBefore, | ||
insertAfter: insertAfter, | ||
next: next, | ||
nextAll: nextAll, | ||
prev: prev, | ||
prevAll: prevAll, | ||
siblings: siblings, | ||
parent: parent, | ||
parents: parents, | ||
closest: closest, | ||
find: find, | ||
children: children, | ||
remove: remove, | ||
detach: detach, | ||
add: add, | ||
empty: empty | ||
}); | ||
function scrollTo() { | ||
var assign; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var left = args[0]; | ||
var top = args[1]; | ||
var duration = args[2]; | ||
var easing = args[3]; | ||
var callback = args[4]; | ||
if (args.length === 4 && typeof easing === 'function') { | ||
callback = easing; | ||
(assign = args, left = assign[0], top = assign[1], duration = assign[2], callback = assign[3], easing = assign[4]); | ||
} | ||
if (typeof easing === 'undefined') { easing = 'swing'; } | ||
return this.each(function animate() { | ||
var el = this; | ||
var currentTop; | ||
var currentLeft; | ||
var maxTop; | ||
var maxLeft; | ||
var newTop; | ||
var newLeft; | ||
var scrollTop; // eslint-disable-line | ||
var scrollLeft; // eslint-disable-line | ||
var animateTop = top > 0 || top === 0; | ||
var animateLeft = left > 0 || left === 0; | ||
if (typeof easing === 'undefined') { | ||
easing = 'swing'; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var left = args[0]; | ||
var top = args[1]; | ||
var duration = args[2]; | ||
var easing = args[3]; | ||
var callback = args[4]; | ||
if (args.length === 4 && typeof easing === 'function') { | ||
callback = easing; | ||
(assign = args, left = assign[0], top = assign[1], duration = assign[2], callback = assign[3], easing = assign[4]); | ||
} | ||
if (animateTop) { | ||
currentTop = el.scrollTop; | ||
if (!duration) { | ||
el.scrollTop = top; | ||
} | ||
} | ||
if (animateLeft) { | ||
currentLeft = el.scrollLeft; | ||
if (!duration) { | ||
el.scrollLeft = left; | ||
} | ||
} | ||
if (!duration) { return; } | ||
if (animateTop) { | ||
maxTop = el.scrollHeight - el.offsetHeight; | ||
newTop = Math.max(Math.min(top, maxTop), 0); | ||
} | ||
if (animateLeft) { | ||
maxLeft = el.scrollWidth - el.offsetWidth; | ||
newLeft = Math.max(Math.min(left, maxLeft), 0); | ||
} | ||
var startTime = null; | ||
if (animateTop && newTop === currentTop) { animateTop = false; } | ||
if (animateLeft && newLeft === currentLeft) { animateLeft = false; } | ||
function render(time) { | ||
if ( time === void 0 ) time = new Date().getTime(); | ||
if (typeof easing === 'undefined') { easing = 'swing'; } | ||
if (startTime === null) { | ||
startTime = time; | ||
return this.each(function animate() { | ||
var el = this; | ||
var currentTop; | ||
var currentLeft; | ||
var maxTop; | ||
var maxLeft; | ||
var newTop; | ||
var newLeft; | ||
var scrollTop; // eslint-disable-line | ||
var scrollLeft; // eslint-disable-line | ||
var animateTop = top > 0 || top === 0; | ||
var animateLeft = left > 0 || left === 0; | ||
if (typeof easing === 'undefined') { | ||
easing = 'swing'; | ||
} | ||
var progress = Math.max(Math.min((time - startTime) / duration, 1), 0); | ||
var easeProgress = easing === 'linear' ? progress : (0.5 - (Math.cos(progress * Math.PI) / 2)); | ||
var done; | ||
if (animateTop) { scrollTop = currentTop + (easeProgress * (newTop - currentTop)); } | ||
if (animateLeft) { scrollLeft = currentLeft + (easeProgress * (newLeft - currentLeft)); } | ||
if (animateTop && newTop > currentTop && scrollTop >= newTop) { | ||
el.scrollTop = newTop; | ||
done = true; | ||
if (animateTop) { | ||
currentTop = el.scrollTop; | ||
if (!duration) { | ||
el.scrollTop = top; | ||
} | ||
} | ||
if (animateTop && newTop < currentTop && scrollTop <= newTop) { | ||
el.scrollTop = newTop; | ||
done = true; | ||
if (animateLeft) { | ||
currentLeft = el.scrollLeft; | ||
if (!duration) { | ||
el.scrollLeft = left; | ||
} | ||
} | ||
if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) { | ||
el.scrollLeft = newLeft; | ||
done = true; | ||
if (!duration) { return; } | ||
if (animateTop) { | ||
maxTop = el.scrollHeight - el.offsetHeight; | ||
newTop = Math.max(Math.min(top, maxTop), 0); | ||
} | ||
if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) { | ||
el.scrollLeft = newLeft; | ||
done = true; | ||
if (animateLeft) { | ||
maxLeft = el.scrollWidth - el.offsetWidth; | ||
newLeft = Math.max(Math.min(left, maxLeft), 0); | ||
} | ||
var startTime = null; | ||
if (animateTop && newTop === currentTop) { animateTop = false; } | ||
if (animateLeft && newLeft === currentLeft) { animateLeft = false; } | ||
function render(time) { | ||
if ( time === void 0 ) time = new Date().getTime(); | ||
if (done) { | ||
if (callback) { callback(); } | ||
return; | ||
if (startTime === null) { | ||
startTime = time; | ||
} | ||
var progress = Math.max(Math.min((time - startTime) / duration, 1), 0); | ||
var easeProgress = easing === 'linear' ? progress : (0.5 - (Math.cos(progress * Math.PI) / 2)); | ||
var done; | ||
if (animateTop) { scrollTop = currentTop + (easeProgress * (newTop - currentTop)); } | ||
if (animateLeft) { scrollLeft = currentLeft + (easeProgress * (newLeft - currentLeft)); } | ||
if (animateTop && newTop > currentTop && scrollTop >= newTop) { | ||
el.scrollTop = newTop; | ||
done = true; | ||
} | ||
if (animateTop && newTop < currentTop && scrollTop <= newTop) { | ||
el.scrollTop = newTop; | ||
done = true; | ||
} | ||
if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) { | ||
el.scrollLeft = newLeft; | ||
done = true; | ||
} | ||
if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) { | ||
el.scrollLeft = newLeft; | ||
done = true; | ||
} | ||
if (done) { | ||
if (callback) { callback(); } | ||
return; | ||
} | ||
if (animateTop) { el.scrollTop = scrollTop; } | ||
if (animateLeft) { el.scrollLeft = scrollLeft; } | ||
requestAnimationFrame(render); | ||
} | ||
if (animateTop) { el.scrollTop = scrollTop; } | ||
if (animateLeft) { el.scrollLeft = scrollLeft; } | ||
requestAnimationFrame(render); | ||
}); | ||
} | ||
// scrollTop(top, duration, easing, callback) { | ||
function scrollTop() { | ||
var assign; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var top = args[0]; | ||
var duration = args[1]; | ||
var easing = args[2]; | ||
var callback = args[3]; | ||
if (args.length === 3 && typeof easing === 'function') { | ||
(assign = args, top = assign[0], duration = assign[1], callback = assign[2], easing = assign[3]); | ||
} | ||
requestAnimationFrame(render); | ||
}); | ||
} | ||
// scrollTop(top, duration, easing, callback) { | ||
function scrollTop() { | ||
var assign; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var top = args[0]; | ||
var duration = args[1]; | ||
var easing = args[2]; | ||
var callback = args[3]; | ||
if (args.length === 3 && typeof easing === 'function') { | ||
(assign = args, top = assign[0], duration = assign[1], callback = assign[2], easing = assign[3]); | ||
var dom = this; | ||
if (typeof top === 'undefined') { | ||
if (dom.length > 0) { return dom[0].scrollTop; } | ||
return null; | ||
} | ||
return dom.scrollTo(undefined, top, duration, easing, callback); | ||
} | ||
var dom = this; | ||
if (typeof top === 'undefined') { | ||
if (dom.length > 0) { return dom[0].scrollTop; } | ||
return null; | ||
} | ||
return dom.scrollTo(undefined, top, duration, easing, callback); | ||
} | ||
function scrollLeft() { | ||
var assign; | ||
function scrollLeft() { | ||
var assign; | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var left = args[0]; | ||
var duration = args[1]; | ||
var easing = args[2]; | ||
var callback = args[3]; | ||
if (args.length === 3 && typeof easing === 'function') { | ||
(assign = args, left = assign[0], duration = assign[1], callback = assign[2], easing = assign[3]); | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
var left = args[0]; | ||
var duration = args[1]; | ||
var easing = args[2]; | ||
var callback = args[3]; | ||
if (args.length === 3 && typeof easing === 'function') { | ||
(assign = args, left = assign[0], duration = assign[1], callback = assign[2], easing = assign[3]); | ||
} | ||
var dom = this; | ||
if (typeof left === 'undefined') { | ||
if (dom.length > 0) { return dom[0].scrollLeft; } | ||
return null; | ||
} | ||
return dom.scrollTo(left, undefined, duration, easing, callback); | ||
} | ||
var dom = this; | ||
if (typeof left === 'undefined') { | ||
if (dom.length > 0) { return dom[0].scrollLeft; } | ||
return null; | ||
} | ||
return dom.scrollTo(left, undefined, duration, easing, callback); | ||
} | ||
var Scroll = /*#__PURE__*/Object.freeze({ | ||
scrollTo: scrollTo, | ||
scrollTop: scrollTop, | ||
scrollLeft: scrollLeft | ||
}); | ||
function animate(initialProps, initialParams) { | ||
var els = this; | ||
var a = { | ||
props: Object.assign({}, initialProps), | ||
params: Object.assign({ | ||
duration: 300, | ||
easing: 'swing', // or 'linear' | ||
/* Callbacks | ||
begin(elements) | ||
complete(elements) | ||
progress(elements, complete, remaining, start, tweenValue) | ||
*/ | ||
}, initialParams), | ||
elements: els, | ||
animating: false, | ||
que: [], | ||
var Scroll = Object.freeze({ | ||
scrollTo: scrollTo, | ||
scrollTop: scrollTop, | ||
scrollLeft: scrollLeft | ||
}); | ||
easingProgress: function easingProgress(easing, progress) { | ||
if (easing === 'swing') { | ||
return 0.5 - (Math.cos(progress * Math.PI) / 2); | ||
} | ||
if (typeof easing === 'function') { | ||
return easing(progress); | ||
} | ||
return progress; | ||
}, | ||
stop: function stop() { | ||
if (a.frameId) { | ||
cancelAnimationFrame(a.frameId); | ||
} | ||
a.animating = false; | ||
a.elements.each(function (index, el) { | ||
var element = el; | ||
delete element.dom7AnimateInstance; | ||
}); | ||
a.que = []; | ||
}, | ||
done: function done(complete) { | ||
a.animating = false; | ||
a.elements.each(function (index, el) { | ||
var element = el; | ||
delete element.dom7AnimateInstance; | ||
}); | ||
if (complete) { complete(els); } | ||
if (a.que.length > 0) { | ||
var que = a.que.shift(); | ||
a.animate(que[0], que[1]); | ||
} | ||
}, | ||
animate: function animate(props, params) { | ||
if (a.animating) { | ||
a.que.push([props, params]); | ||
return a; | ||
} | ||
var elements = []; | ||
function animate(initialProps, initialParams) { | ||
var els = this; | ||
var a = { | ||
props: Object.assign({}, initialProps), | ||
params: Object.assign({ | ||
duration: 300, | ||
easing: 'swing', // or 'linear' | ||
/* Callbacks | ||
begin(elements) | ||
complete(elements) | ||
progress(elements, complete, remaining, start, tweenValue) | ||
*/ | ||
}, initialParams), | ||
// Define & Cache Initials & Units | ||
a.elements.each(function (index, el) { | ||
var initialFullValue; | ||
var initialValue; | ||
var unit; | ||
var finalValue; | ||
var finalFullValue; | ||
elements: els, | ||
animating: false, | ||
que: [], | ||
if (!el.dom7AnimateInstance) { a.elements[index].dom7AnimateInstance = a; } | ||
easingProgress: function easingProgress(easing, progress) { | ||
if (easing === 'swing') { | ||
return 0.5 - (Math.cos(progress * Math.PI) / 2); | ||
} | ||
if (typeof easing === 'function') { | ||
return easing(progress); | ||
} | ||
return progress; | ||
}, | ||
stop: function stop() { | ||
if (a.frameId) { | ||
cancelAnimationFrame(a.frameId); | ||
} | ||
a.animating = false; | ||
a.elements.each(function (index, el) { | ||
var element = el; | ||
delete element.dom7AnimateInstance; | ||
}); | ||
a.que = []; | ||
}, | ||
done: function done(complete) { | ||
a.animating = false; | ||
a.elements.each(function (index, el) { | ||
var element = el; | ||
delete element.dom7AnimateInstance; | ||
}); | ||
if (complete) { complete(els); } | ||
if (a.que.length > 0) { | ||
var que = a.que.shift(); | ||
a.animate(que[0], que[1]); | ||
} | ||
}, | ||
animate: function animate(props, params) { | ||
if (a.animating) { | ||
a.que.push([props, params]); | ||
return a; | ||
} | ||
var elements = []; | ||
// Define & Cache Initials & Units | ||
a.elements.each(function (index, el) { | ||
var initialFullValue; | ||
var initialValue; | ||
var unit; | ||
var finalValue; | ||
var finalFullValue; | ||
if (!el.dom7AnimateInstance) { a.elements[index].dom7AnimateInstance = a; } | ||
elements[index] = { | ||
container: el, | ||
}; | ||
Object.keys(props).forEach(function (prop) { | ||
initialFullValue = win.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.'); | ||
initialValue = parseFloat(initialFullValue); | ||
unit = initialFullValue.replace(initialValue, ''); | ||
finalValue = parseFloat(props[prop]); | ||
finalFullValue = props[prop] + unit; | ||
elements[index][prop] = { | ||
initialFullValue: initialFullValue, | ||
initialValue: initialValue, | ||
unit: unit, | ||
finalValue: finalValue, | ||
finalFullValue: finalFullValue, | ||
currentValue: initialValue, | ||
elements[index] = { | ||
container: el, | ||
}; | ||
Object.keys(props).forEach(function (prop) { | ||
initialFullValue = win.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.'); | ||
initialValue = parseFloat(initialFullValue); | ||
unit = initialFullValue.replace(initialValue, ''); | ||
finalValue = parseFloat(props[prop]); | ||
finalFullValue = props[prop] + unit; | ||
elements[index][prop] = { | ||
initialFullValue: initialFullValue, | ||
initialValue: initialValue, | ||
unit: unit, | ||
finalValue: finalValue, | ||
finalFullValue: finalFullValue, | ||
currentValue: initialValue, | ||
}; | ||
}); | ||
}); | ||
}); | ||
var startTime = null; | ||
var time; | ||
var elementsDone = 0; | ||
var propsDone = 0; | ||
var done; | ||
var began = false; | ||
var startTime = null; | ||
var time; | ||
var elementsDone = 0; | ||
var propsDone = 0; | ||
var done; | ||
var began = false; | ||
a.animating = true; | ||
a.animating = true; | ||
function render() { | ||
time = new Date().getTime(); | ||
var progress; | ||
var easeProgress; | ||
// let el; | ||
if (!began) { | ||
began = true; | ||
if (params.begin) { params.begin(els); } | ||
} | ||
if (startTime === null) { | ||
startTime = time; | ||
} | ||
if (params.progress) { | ||
// eslint-disable-next-line | ||
params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), ((startTime + params.duration) - time < 0 ? 0 : (startTime + params.duration) - time), startTime); | ||
} | ||
function render() { | ||
time = new Date().getTime(); | ||
var progress; | ||
var easeProgress; | ||
// let el; | ||
if (!began) { | ||
began = true; | ||
if (params.begin) { params.begin(els); } | ||
} | ||
if (startTime === null) { | ||
startTime = time; | ||
} | ||
if (params.progress) { | ||
// eslint-disable-next-line | ||
params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), ((startTime + params.duration) - time < 0 ? 0 : (startTime + params.duration) - time), startTime); | ||
} | ||
elements.forEach(function (element) { | ||
var el = element; | ||
if (done || el.done) { return; } | ||
Object.keys(props).forEach(function (prop) { | ||
elements.forEach(function (element) { | ||
var el = element; | ||
if (done || el.done) { return; } | ||
progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0); | ||
easeProgress = a.easingProgress(params.easing, progress); | ||
var ref = el[prop]; | ||
var initialValue = ref.initialValue; | ||
var finalValue = ref.finalValue; | ||
var unit = ref.unit; | ||
el[prop].currentValue = initialValue + (easeProgress * (finalValue - initialValue)); | ||
var currentValue = el[prop].currentValue; | ||
Object.keys(props).forEach(function (prop) { | ||
if (done || el.done) { return; } | ||
progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0); | ||
easeProgress = a.easingProgress(params.easing, progress); | ||
var ref = el[prop]; | ||
var initialValue = ref.initialValue; | ||
var finalValue = ref.finalValue; | ||
var unit = ref.unit; | ||
el[prop].currentValue = initialValue + (easeProgress * (finalValue - initialValue)); | ||
var currentValue = el[prop].currentValue; | ||
if ( | ||
(finalValue > initialValue && currentValue >= finalValue) || | ||
(finalValue < initialValue && currentValue <= finalValue)) { | ||
el.container.style[prop] = finalValue + unit; | ||
propsDone += 1; | ||
if (propsDone === Object.keys(props).length) { | ||
el.done = true; | ||
elementsDone += 1; | ||
if ( | ||
(finalValue > initialValue && currentValue >= finalValue) || | ||
(finalValue < initialValue && currentValue <= finalValue)) { | ||
el.container.style[prop] = finalValue + unit; | ||
propsDone += 1; | ||
if (propsDone === Object.keys(props).length) { | ||
el.done = true; | ||
elementsDone += 1; | ||
} | ||
if (elementsDone === elements.length) { | ||
done = true; | ||
} | ||
} | ||
if (elementsDone === elements.length) { | ||
done = true; | ||
if (done) { | ||
a.done(params.complete); | ||
return; | ||
} | ||
} | ||
if (done) { | ||
a.done(params.complete); | ||
return; | ||
} | ||
el.container.style[prop] = currentValue + unit; | ||
el.container.style[prop] = currentValue + unit; | ||
}); | ||
}); | ||
}); | ||
if (done) { return; } | ||
// Then call | ||
if (done) { return; } | ||
// Then call | ||
a.frameId = requestAnimationFrame(render); | ||
} | ||
a.frameId = requestAnimationFrame(render); | ||
} | ||
a.frameId = requestAnimationFrame(render); | ||
return a; | ||
}, | ||
}; | ||
return a; | ||
}, | ||
}; | ||
if (a.elements.length === 0) { | ||
return els; | ||
} | ||
if (a.elements.length === 0) { | ||
return els; | ||
} | ||
var animateInstance; | ||
for (var i = 0; i < a.elements.length; i += 1) { | ||
if (a.elements[i].dom7AnimateInstance) { | ||
animateInstance = a.elements[i].dom7AnimateInstance; | ||
} else { a.elements[i].dom7AnimateInstance = a; } | ||
} | ||
if (!animateInstance) { | ||
animateInstance = a; | ||
} | ||
var animateInstance; | ||
for (var i = 0; i < a.elements.length; i += 1) { | ||
if (a.elements[i].dom7AnimateInstance) { | ||
animateInstance = a.elements[i].dom7AnimateInstance; | ||
} else { a.elements[i].dom7AnimateInstance = a; } | ||
} | ||
if (!animateInstance) { | ||
animateInstance = a; | ||
} | ||
if (initialProps === 'stop') { | ||
animateInstance.stop(); | ||
} else { | ||
animateInstance.animate(a.props, a.params); | ||
if (initialProps === 'stop') { | ||
animateInstance.stop(); | ||
} else { | ||
animateInstance.animate(a.props, a.params); | ||
} | ||
return els; | ||
} | ||
return els; | ||
} | ||
function stop() { | ||
var els = this; | ||
for (var i = 0; i < els.length; i += 1) { | ||
if (els[i].dom7AnimateInstance) { | ||
els[i].dom7AnimateInstance.stop(); | ||
function stop() { | ||
var els = this; | ||
for (var i = 0; i < els.length; i += 1) { | ||
if (els[i].dom7AnimateInstance) { | ||
els[i].dom7AnimateInstance.stop(); | ||
} | ||
} | ||
} | ||
} | ||
var Animate = /*#__PURE__*/Object.freeze({ | ||
animate: animate, | ||
stop: stop | ||
}); | ||
var noTrigger = ('resize scroll').split(' '); | ||
function eventShortcut(name) { | ||
var this$1 = this; | ||
var ref; | ||
var Animate = Object.freeze({ | ||
animate: animate, | ||
stop: stop | ||
}); | ||
var noTrigger = ('resize scroll').split(' '); | ||
function eventShortcut(name) { | ||
var this$1 = this; | ||
var ref; | ||
var args = [], len = arguments.length - 1; | ||
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; | ||
if (typeof args[0] === 'undefined') { | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (noTrigger.indexOf(name) < 0) { | ||
if (name in this$1[i]) { this$1[i][name](); } | ||
else { | ||
$$1(this$1[i]).trigger(name); | ||
var args = [], len = arguments.length - 1; | ||
while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; | ||
if (typeof args[0] === 'undefined') { | ||
for (var i = 0; i < this.length; i += 1) { | ||
if (noTrigger.indexOf(name) < 0) { | ||
if (name in this$1[i]) { this$1[i][name](); } | ||
else { | ||
$(this$1[i]).trigger(name); | ||
} | ||
} | ||
} | ||
return this; | ||
} | ||
return this; | ||
return (ref = this).on.apply(ref, [ name ].concat( args )); | ||
} | ||
return (ref = this).on.apply(ref, [ name ].concat( args )); | ||
} | ||
function click() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
function click() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'click' ].concat( args )); | ||
} | ||
function blur() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'click' ].concat( args )); | ||
} | ||
function blur() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'blur' ].concat( args )); | ||
} | ||
function focus() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'blur' ].concat( args )); | ||
} | ||
function focus() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'focus' ].concat( args )); | ||
} | ||
function focusin() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'focus' ].concat( args )); | ||
} | ||
function focusin() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'focusin' ].concat( args )); | ||
} | ||
function focusout() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'focusin' ].concat( args )); | ||
} | ||
function focusout() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'focusout' ].concat( args )); | ||
} | ||
function keyup() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'focusout' ].concat( args )); | ||
} | ||
function keyup() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'keyup' ].concat( args )); | ||
} | ||
function keydown() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'keyup' ].concat( args )); | ||
} | ||
function keydown() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'keydown' ].concat( args )); | ||
} | ||
function keypress() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'keydown' ].concat( args )); | ||
} | ||
function keypress() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'keypress' ].concat( args )); | ||
} | ||
function submit() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'keypress' ].concat( args )); | ||
} | ||
function submit() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'submit' ].concat( args )); | ||
} | ||
function change() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'submit' ].concat( args )); | ||
} | ||
function change() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'change' ].concat( args )); | ||
} | ||
function mousedown() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'change' ].concat( args )); | ||
} | ||
function mousedown() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mousedown' ].concat( args )); | ||
} | ||
function mousemove() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mousedown' ].concat( args )); | ||
} | ||
function mousemove() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mousemove' ].concat( args )); | ||
} | ||
function mouseup() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mousemove' ].concat( args )); | ||
} | ||
function mouseup() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseup' ].concat( args )); | ||
} | ||
function mouseenter() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseup' ].concat( args )); | ||
} | ||
function mouseenter() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseenter' ].concat( args )); | ||
} | ||
function mouseleave() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseenter' ].concat( args )); | ||
} | ||
function mouseleave() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseleave' ].concat( args )); | ||
} | ||
function mouseout() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseleave' ].concat( args )); | ||
} | ||
function mouseout() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseout' ].concat( args )); | ||
} | ||
function mouseover() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseout' ].concat( args )); | ||
} | ||
function mouseover() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseover' ].concat( args )); | ||
} | ||
function touchstart() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'mouseover' ].concat( args )); | ||
} | ||
function touchstart() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'touchstart' ].concat( args )); | ||
} | ||
function touchend() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'touchstart' ].concat( args )); | ||
} | ||
function touchend() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'touchend' ].concat( args )); | ||
} | ||
function touchmove() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'touchend' ].concat( args )); | ||
} | ||
function touchmove() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'touchmove' ].concat( args )); | ||
} | ||
function resize() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'touchmove' ].concat( args )); | ||
} | ||
function resize() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'resize' ].concat( args )); | ||
} | ||
function scroll() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'resize' ].concat( args )); | ||
} | ||
function scroll() { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return eventShortcut.bind(this).apply(void 0, [ 'scroll' ].concat( args )); | ||
} | ||
return eventShortcut.bind(this).apply(void 0, [ 'scroll' ].concat( args )); | ||
} | ||
var eventShortcuts = /*#__PURE__*/Object.freeze({ | ||
click: click, | ||
blur: blur, | ||
focus: focus, | ||
focusin: focusin, | ||
focusout: focusout, | ||
keyup: keyup, | ||
keydown: keydown, | ||
keypress: keypress, | ||
submit: submit, | ||
change: change, | ||
mousedown: mousedown, | ||
mousemove: mousemove, | ||
mouseup: mouseup, | ||
mouseenter: mouseenter, | ||
mouseleave: mouseleave, | ||
mouseout: mouseout, | ||
mouseover: mouseover, | ||
touchstart: touchstart, | ||
touchend: touchend, | ||
touchmove: touchmove, | ||
resize: resize, | ||
scroll: scroll | ||
}); | ||
var eventShortcuts = Object.freeze({ | ||
click: click, | ||
blur: blur, | ||
focus: focus, | ||
focusin: focusin, | ||
focusout: focusout, | ||
keyup: keyup, | ||
keydown: keydown, | ||
keypress: keypress, | ||
submit: submit, | ||
change: change, | ||
mousedown: mousedown, | ||
mousemove: mousemove, | ||
mouseup: mouseup, | ||
mouseenter: mouseenter, | ||
mouseleave: mouseleave, | ||
mouseout: mouseout, | ||
mouseover: mouseover, | ||
touchstart: touchstart, | ||
touchend: touchend, | ||
touchmove: touchmove, | ||
resize: resize, | ||
scroll: scroll | ||
}); | ||
[Methods, Scroll, Animate, eventShortcuts].forEach(function (group) { | ||
Object.keys(group).forEach(function (methodName) { | ||
$$1.fn[methodName] = group[methodName]; | ||
[Methods, Scroll, Animate, eventShortcuts].forEach(function (group) { | ||
Object.keys(group).forEach(function (methodName) { | ||
$.fn[methodName] = group[methodName]; | ||
}); | ||
}); | ||
}); | ||
return $$1; | ||
return $; | ||
}))); |
/** | ||
* Dom7 2.0.7 | ||
* Dom7 2.1.0 | ||
* Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API | ||
@@ -12,4 +12,4 @@ * http://framework7.io/docs/dom.html | ||
* | ||
* Released on: June 14, 2018 | ||
*/!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Dom7=e()}(this,function(){"use strict";var t="undefined"==typeof document?{body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},location:{hash:""}}:document,e="undefined"==typeof window?{document:t,navigator:{userAgent:""},location:{},history:{},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){}}:window,n=function(t){for(var e=0;e<t.length;e+=1)this[e]=t[e];return this.length=t.length,this};function i(i,r){var o=[],s=0;if(i&&!r&&i instanceof n)return i;if(i)if("string"==typeof i){var a,l,h=i.trim();if(h.indexOf("<")>=0&&h.indexOf(">")>=0){var u="div";for(0===h.indexOf("<li")&&(u="ul"),0===h.indexOf("<tr")&&(u="tbody"),0!==h.indexOf("<td")&&0!==h.indexOf("<th")||(u="tr"),0===h.indexOf("<tbody")&&(u="table"),0===h.indexOf("<option")&&(u="select"),(l=t.createElement(u)).innerHTML=h,s=0;s<l.childNodes.length;s+=1)o.push(l.childNodes[s])}else for(a=r||"#"!==i[0]||i.match(/[ .<>:~]/)?(r||t).querySelectorAll(i.trim()):[t.getElementById(i.trim().split("#")[1])],s=0;s<a.length;s+=1)a[s]&&o.push(a[s])}else if(i.nodeType||i===e||i===t)o.push(i);else if(i.length>0&&i[0].nodeType)for(s=0;s<i.length;s+=1)o.push(i[s]);return new n(o)}function r(t){for(var e=[],n=0;n<t.length;n+=1)-1===e.indexOf(t[n])&&e.push(t[n]);return e}function o(t){return e.requestAnimationFrame?e.requestAnimationFrame(t):e.webkitRequestAnimationFrame?e.webkitRequestAnimationFrame(t):e.setTimeout(t,1e3/60)}i.fn=n.prototype,i.Class=n,i.Dom7=n;var s=Object.freeze({addClass:function(t){if(void 0===t)return this;for(var e=t.split(" "),n=0;n<e.length;n+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.add(e[n]);return this},removeClass:function(t){for(var e=t.split(" "),n=0;n<e.length;n+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.remove(e[n]);return this},hasClass:function(t){return!!this[0]&&this[0].classList.contains(t)},toggleClass:function(t){for(var e=t.split(" "),n=0;n<e.length;n+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.toggle(e[n]);return this},attr:function(t,e){var n=arguments;if(1===arguments.length&&"string"==typeof t)return this[0]?this[0].getAttribute(t):void 0;for(var i=0;i<this.length;i+=1)if(2===n.length)this[i].setAttribute(t,e);else for(var r in t)this[i][r]=t[r],this[i].setAttribute(r,t[r]);return this},removeAttr:function(t){for(var e=0;e<this.length;e+=1)this[e].removeAttribute(t);return this},prop:function(t,e){var n=arguments;if(1!==arguments.length||"string"!=typeof t){for(var i=0;i<this.length;i+=1)if(2===n.length)this[i][t]=e;else for(var r in t)this[i][r]=t[r];return this}if(this[0])return this[0][t]},data:function(t,e){var n;if(void 0!==e){for(var i=0;i<this.length;i+=1)(n=this[i]).dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[t]=e;return this}if(n=this[0]){if(n.dom7ElementDataStorage&&t in n.dom7ElementDataStorage)return n.dom7ElementDataStorage[t];var r=n.getAttribute("data-"+t);return r||void 0}},removeData:function(t){for(var e=0;e<this.length;e+=1){var n=this[e];n.dom7ElementDataStorage&&n.dom7ElementDataStorage[t]&&(n.dom7ElementDataStorage[t]=null,delete n.dom7ElementDataStorage[t])}},dataset:function(){var t=this[0];if(t){var e,n={};if(t.dataset)for(var i in t.dataset)n[i]=t.dataset[i];else for(var r=0;r<t.attributes.length;r+=1){var o=t.attributes[r];o.name.indexOf("data-")>=0&&(n[(e=o.name.split("data-")[1],e.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}))]=o.value)}for(var s in n)"false"===n[s]?n[s]=!1:"true"===n[s]?n[s]=!0:parseFloat(n[s])===1*n[s]&&(n[s]*=1);return n}},val:function(t){var e=this;if(void 0!==t){for(var n=0;n<e.length;n+=1){var i=e[n];if(Array.isArray(t)&&i.multiple&&"select"===i.nodeName.toLowerCase())for(var r=0;r<i.options.length;r+=1)i.options[r].selected=t.indexOf(i.options[r].value)>=0;else i.value=t}return e}if(e[0]){if(e[0].multiple&&"select"===e[0].nodeName.toLowerCase()){for(var o=[],s=0;s<e[0].selectedOptions.length;s+=1)o.push(e[0].selectedOptions[s].value);return o}return e[0].value}},transform:function(t){for(var e=0;e<this.length;e+=1){var n=this[e].style;n.webkitTransform=t,n.transform=t}return this},transition:function(t){"string"!=typeof t&&(t+="ms");for(var e=0;e<this.length;e+=1){var n=this[e].style;n.webkitTransitionDuration=t,n.transitionDuration=t}return this},on:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=e[0],o=e[1],s=e[2],a=e[3];function l(t){var e=t.target;if(e){var n=t.target.dom7EventData||[];if(n.indexOf(t)<0&&n.unshift(t),i(e).is(o))s.apply(e,n);else for(var r=i(e).parents(),a=0;a<r.length;a+=1)i(r[a]).is(o)&&s.apply(r[a],n)}}function h(t){var e=t&&t.target&&t.target.dom7EventData||[];e.indexOf(t)<0&&e.unshift(t),s.apply(this,e)}"function"==typeof e[1]&&(r=(t=e)[0],s=t[1],a=t[2],o=void 0),a||(a=!1);for(var u,f=r.split(" "),c=0;c<this.length;c+=1){var d=this[c];if(o)for(u=0;u<f.length;u+=1){var v=f[u];d.dom7LiveListeners||(d.dom7LiveListeners={}),d.dom7LiveListeners[v]||(d.dom7LiveListeners[v]=[]),d.dom7LiveListeners[v].push({listener:s,proxyListener:l}),d.addEventListener(v,l,a)}else for(u=0;u<f.length;u+=1){var g=f[u];d.dom7Listeners||(d.dom7Listeners={}),d.dom7Listeners[g]||(d.dom7Listeners[g]=[]),d.dom7Listeners[g].push({listener:s,proxyListener:h}),d.addEventListener(g,h,a)}}return this},off:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],r=e[1],o=e[2],s=e[3];"function"==typeof e[1]&&(i=(t=e)[0],o=t[1],s=t[2],r=void 0),s||(s=!1);for(var a=i.split(" "),l=0;l<a.length;l+=1)for(var h=a[l],u=0;u<this.length;u+=1){var f=this[u],c=void 0;if(!r&&f.dom7Listeners?c=f.dom7Listeners[h]:r&&f.dom7LiveListeners&&(c=f.dom7LiveListeners[h]),c&&c.length)for(var d=c.length-1;d>=0;d-=1){var v=c[d];o&&v.listener===o?(f.removeEventListener(h,v.proxyListener,s),c.splice(d,1)):o||(f.removeEventListener(h,v.proxyListener,s),c.splice(d,1))}}return this},once:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=this,r=e[0],o=e[1],s=e[2],a=e[3];return"function"==typeof e[1]&&(r=(t=e)[0],s=t[1],a=t[2],o=void 0),i.on(r,o,function t(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];s.apply(this,e),i.off(r,o,t,a)},a)},trigger:function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];for(var r=n[0].split(" "),o=n[1],s=0;s<r.length;s+=1)for(var a=r[s],l=0;l<this.length;l+=1){var h=this[l],u=void 0;try{u=new e.CustomEvent(a,{detail:o,bubbles:!0,cancelable:!0})}catch(e){(u=t.createEvent("Event")).initEvent(a,!0,!0),u.detail=o}h.dom7EventData=n.filter(function(t,e){return e>0}),h.dispatchEvent(u),h.dom7EventData=[],delete h.dom7EventData}return this},transitionEnd:function(t){var e,n=["webkitTransitionEnd","transitionend"],i=this;function r(o){if(o.target===this)for(t.call(this,o),e=0;e<n.length;e+=1)i.off(n[e],r)}if(t)for(e=0;e<n.length;e+=1)i.on(n[e],r);return this},animationEnd:function(t){var e,n=["webkitAnimationEnd","animationend"],i=this;function r(o){if(o.target===this)for(t.call(this,o),e=0;e<n.length;e+=1)i.off(n[e],r)}if(t)for(e=0;e<n.length;e+=1)i.on(n[e],r);return this},width:function(){return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null},outerWidth:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+parseFloat(e.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},height:function(){return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null},outerHeight:function(t){if(this.length>0){if(t){var e=this.styles();return this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},offset:function(){if(this.length>0){var n=this[0],i=n.getBoundingClientRect(),r=t.body,o=n.clientTop||r.clientTop||0,s=n.clientLeft||r.clientLeft||0,a=n===e?e.scrollY:n.scrollTop,l=n===e?e.scrollX:n.scrollLeft;return{top:i.top+a-o,left:i.left+l-s}}return null},hide:function(){for(var t=0;t<this.length;t+=1)this[t].style.display="none";return this},show:function(){for(var t=0;t<this.length;t+=1){var n=this[t];"none"===n.style.display&&(n.style.display=""),"none"===e.getComputedStyle(n,null).getPropertyValue("display")&&(n.style.display="block")}return this},styles:function(){return this[0]?e.getComputedStyle(this[0],null):{}},css:function(t,n){var i;if(1===arguments.length){if("string"!=typeof t){for(i=0;i<this.length;i+=1)for(var r in t)this[i].style[r]=t[r];return this}if(this[0])return e.getComputedStyle(this[0],null).getPropertyValue(t)}if(2===arguments.length&&"string"==typeof t){for(i=0;i<this.length;i+=1)this[i].style[t]=n;return this}return this},toArray:function(){for(var t=[],e=0;e<this.length;e+=1)t.push(this[e]);return t},each:function(t){if(!t)return this;for(var e=0;e<this.length;e+=1)if(!1===t.call(this[e],e,this[e]))return this;return this},forEach:function(t){if(!t)return this;for(var e=0;e<this.length;e+=1)if(!1===t.call(this[e],this[e],e))return this;return this},filter:function(t){for(var e=[],i=0;i<this.length;i+=1)t.call(this[i],i,this[i])&&e.push(this[i]);return new n(e)},map:function(t){for(var e=[],i=0;i<this.length;i+=1)e.push(t.call(this[i],i,this[i]));return new n(e)},html:function(t){if(void 0===t)return this[0]?this[0].innerHTML:void 0;for(var e=0;e<this.length;e+=1)this[e].innerHTML=t;return this},text:function(t){if(void 0===t)return this[0]?this[0].textContent.trim():null;for(var e=0;e<this.length;e+=1)this[e].textContent=t;return this},is:function(r){var o,s,a=this[0];if(!a||void 0===r)return!1;if("string"==typeof r){if(a.matches)return a.matches(r);if(a.webkitMatchesSelector)return a.webkitMatchesSelector(r);if(a.msMatchesSelector)return a.msMatchesSelector(r);for(o=i(r),s=0;s<o.length;s+=1)if(o[s]===a)return!0;return!1}if(r===t)return a===t;if(r===e)return a===e;if(r.nodeType||r instanceof n){for(o=r.nodeType?[r]:r,s=0;s<o.length;s+=1)if(o[s]===a)return!0;return!1}return!1},indexOf:function(t){for(var e=0;e<this.length;e+=1)if(this[e]===t)return e;return-1},index:function(){var t,e=this[0];if(e){for(t=0;null!==(e=e.previousSibling);)1===e.nodeType&&(t+=1);return t}},eq:function(t){if(void 0===t)return this;var e,i=this.length;return new n(t>i-1?[]:t<0?(e=i+t)<0?[]:[this[e]]:[this[t]])},append:function(){for(var e,i=[],r=arguments.length;r--;)i[r]=arguments[r];for(var o=0;o<i.length;o+=1){e=i[o];for(var s=0;s<this.length;s+=1)if("string"==typeof e){var a=t.createElement("div");for(a.innerHTML=e;a.firstChild;)this[s].appendChild(a.firstChild)}else if(e instanceof n)for(var l=0;l<e.length;l+=1)this[s].appendChild(e[l]);else this[s].appendChild(e)}return this},appendTo:function(t){return i(t).append(this),this},prepend:function(e){var i,r,o=this;for(i=0;i<this.length;i+=1)if("string"==typeof e){var s=t.createElement("div");for(s.innerHTML=e,r=s.childNodes.length-1;r>=0;r-=1)o[i].insertBefore(s.childNodes[r],o[i].childNodes[0])}else if(e instanceof n)for(r=0;r<e.length;r+=1)o[i].insertBefore(e[r],o[i].childNodes[0]);else o[i].insertBefore(e,o[i].childNodes[0]);return this},prependTo:function(t){return i(t).prepend(this),this},insertBefore:function(t){for(var e=i(t),n=0;n<this.length;n+=1)if(1===e.length)e[0].parentNode.insertBefore(this[n],e[0]);else if(e.length>1)for(var r=0;r<e.length;r+=1)e[r].parentNode.insertBefore(this[n].cloneNode(!0),e[r])},insertAfter:function(t){for(var e=i(t),n=0;n<this.length;n+=1)if(1===e.length)e[0].parentNode.insertBefore(this[n],e[0].nextSibling);else if(e.length>1)for(var r=0;r<e.length;r+=1)e[r].parentNode.insertBefore(this[n].cloneNode(!0),e[r].nextSibling)},next:function(t){return this.length>0?t?this[0].nextElementSibling&&i(this[0].nextElementSibling).is(t)?new n([this[0].nextElementSibling]):new n([]):this[0].nextElementSibling?new n([this[0].nextElementSibling]):new n([]):new n([])},nextAll:function(t){var e=[],r=this[0];if(!r)return new n([]);for(;r.nextElementSibling;){var o=r.nextElementSibling;t?i(o).is(t)&&e.push(o):e.push(o),r=o}return new n(e)},prev:function(t){if(this.length>0){var e=this[0];return t?e.previousElementSibling&&i(e.previousElementSibling).is(t)?new n([e.previousElementSibling]):new n([]):e.previousElementSibling?new n([e.previousElementSibling]):new n([])}return new n([])},prevAll:function(t){var e=[],r=this[0];if(!r)return new n([]);for(;r.previousElementSibling;){var o=r.previousElementSibling;t?i(o).is(t)&&e.push(o):e.push(o),r=o}return new n(e)},siblings:function(t){return this.nextAll(t).add(this.prevAll(t))},parent:function(t){for(var e=[],n=0;n<this.length;n+=1)null!==this[n].parentNode&&(t?i(this[n].parentNode).is(t)&&e.push(this[n].parentNode):e.push(this[n].parentNode));return i(r(e))},parents:function(t){for(var e=[],n=0;n<this.length;n+=1)for(var o=this[n].parentNode;o;)t?i(o).is(t)&&e.push(o):e.push(o),o=o.parentNode;return i(r(e))},closest:function(t){var e=this;return void 0===t?new n([]):(e.is(t)||(e=e.parents(t).eq(0)),e)},find:function(t){for(var e=[],i=0;i<this.length;i+=1)for(var r=this[i].querySelectorAll(t),o=0;o<r.length;o+=1)e.push(r[o]);return new n(e)},children:function(t){for(var e=[],o=0;o<this.length;o+=1)for(var s=this[o].childNodes,a=0;a<s.length;a+=1)t?1===s[a].nodeType&&i(s[a]).is(t)&&e.push(s[a]):1===s[a].nodeType&&e.push(s[a]);return new n(r(e))},remove:function(){for(var t=0;t<this.length;t+=1)this[t].parentNode&&this[t].parentNode.removeChild(this[t]);return this},detach:function(){return this.remove()},add:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n,r;for(n=0;n<t.length;n+=1){var o=i(t[n]);for(r=0;r<o.length;r+=1)this[this.length]=o[r],this.length+=1}return this},empty:function(){for(var t=0;t<this.length;t+=1){var e=this[t];if(1===e.nodeType){for(var n=0;n<e.childNodes.length;n+=1)e.childNodes[n].parentNode&&e.childNodes[n].parentNode.removeChild(e.childNodes[n]);e.textContent=""}}return this}});var a=Object.freeze({scrollTo:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],r=e[1],s=e[2],a=e[3],l=e[4];return 4===e.length&&"function"==typeof a&&(l=a,i=(t=e)[0],r=t[1],s=t[2],l=t[3],a=t[4]),void 0===a&&(a="swing"),this.each(function(){var t,e,n,h,u,f,c,d,v=this,g=r>0||0===r,p=i>0||0===i;if(void 0===a&&(a="swing"),g&&(t=v.scrollTop,s||(v.scrollTop=r)),p&&(e=v.scrollLeft,s||(v.scrollLeft=i)),s){g&&(n=v.scrollHeight-v.offsetHeight,u=Math.max(Math.min(r,n),0)),p&&(h=v.scrollWidth-v.offsetWidth,f=Math.max(Math.min(i,h),0));var m=null;g&&u===t&&(g=!1),p&&f===e&&(p=!1),o(function n(i){void 0===i&&(i=(new Date).getTime()),null===m&&(m=i);var r,h=Math.max(Math.min((i-m)/s,1),0),y="linear"===a?h:.5-Math.cos(h*Math.PI)/2;g&&(c=t+y*(u-t)),p&&(d=e+y*(f-e)),g&&u>t&&c>=u&&(v.scrollTop=u,r=!0),g&&u<t&&c<=u&&(v.scrollTop=u,r=!0),p&&f>e&&d>=f&&(v.scrollLeft=f,r=!0),p&&f<e&&d<=f&&(v.scrollLeft=f,r=!0),r?l&&l():(g&&(v.scrollTop=c),p&&(v.scrollLeft=d),o(n))})}})},scrollTop:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],r=e[1],o=e[2],s=e[3];return 3===e.length&&"function"==typeof o&&(i=(t=e)[0],r=t[1],s=t[2],o=t[3]),void 0===i?this.length>0?this[0].scrollTop:null:this.scrollTo(void 0,i,r,o,s)},scrollLeft:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],r=e[1],o=e[2],s=e[3];return 3===e.length&&"function"==typeof o&&(i=(t=e)[0],r=t[1],s=t[2],o=t[3]),void 0===i?this.length>0?this[0].scrollLeft:null:this.scrollTo(i,void 0,r,o,s)}});var l=Object.freeze({animate:function(t,n){var i,r=this,s={props:Object.assign({},t),params:Object.assign({duration:300,easing:"swing"},n),elements:r,animating:!1,que:[],easingProgress:function(t,e){return"swing"===t?.5-Math.cos(e*Math.PI)/2:"function"==typeof t?t(e):e},stop:function(){var t;s.frameId&&(t=s.frameId,e.cancelAnimationFrame?e.cancelAnimationFrame(t):e.webkitCancelAnimationFrame?e.webkitCancelAnimationFrame(t):e.clearTimeout(t)),s.animating=!1,s.elements.each(function(t,e){delete e.dom7AnimateInstance}),s.que=[]},done:function(t){if(s.animating=!1,s.elements.each(function(t,e){delete e.dom7AnimateInstance}),t&&t(r),s.que.length>0){var e=s.que.shift();s.animate(e[0],e[1])}},animate:function(t,n){if(s.animating)return s.que.push([t,n]),s;var i=[];s.elements.each(function(n,r){var o,a,l,h,u;r.dom7AnimateInstance||(s.elements[n].dom7AnimateInstance=s),i[n]={container:r},Object.keys(t).forEach(function(s){o=e.getComputedStyle(r,null).getPropertyValue(s).replace(",","."),a=parseFloat(o),l=o.replace(a,""),h=parseFloat(t[s]),u=t[s]+l,i[n][s]={initialFullValue:o,initialValue:a,unit:l,finalValue:h,finalFullValue:u,currentValue:a}})});var a,l,h=null,u=0,f=0,c=!1;return s.animating=!0,s.frameId=o(function e(){var d,v;a=(new Date).getTime(),c||(c=!0,n.begin&&n.begin(r)),null===h&&(h=a),n.progress&&n.progress(r,Math.max(Math.min((a-h)/n.duration,1),0),h+n.duration-a<0?0:h+n.duration-a,h),i.forEach(function(e){var r=e;l||r.done||Object.keys(t).forEach(function(e){if(!l&&!r.done){d=Math.max(Math.min((a-h)/n.duration,1),0),v=s.easingProgress(n.easing,d);var o=r[e],c=o.initialValue,g=o.finalValue,p=o.unit;r[e].currentValue=c+v*(g-c);var m=r[e].currentValue;(g>c&&m>=g||g<c&&m<=g)&&(r.container.style[e]=g+p,(f+=1)===Object.keys(t).length&&(r.done=!0,u+=1),u===i.length&&(l=!0)),l?s.done(n.complete):r.container.style[e]=m+p}})}),l||(s.frameId=o(e))}),s}};if(0===s.elements.length)return r;for(var a=0;a<s.elements.length;a+=1)s.elements[a].dom7AnimateInstance?i=s.elements[a].dom7AnimateInstance:s.elements[a].dom7AnimateInstance=s;return i||(i=s),"stop"===t?i.stop():i.animate(s.props,s.params),r},stop:function(){for(var t=0;t<this.length;t+=1)this[t].dom7AnimateInstance&&this[t].dom7AnimateInstance.stop()}}),h="resize scroll".split(" ");function u(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];if(void 0===n[0]){for(var o=0;o<this.length;o+=1)h.indexOf(t)<0&&(t in this[o]?this[o][t]():i(this[o]).trigger(t));return this}return(e=this).on.apply(e,[t].concat(n))}return[s,a,l,Object.freeze({click:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["click"].concat(t))},blur:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["blur"].concat(t))},focus:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["focus"].concat(t))},focusin:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["focusin"].concat(t))},focusout:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["focusout"].concat(t))},keyup:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["keyup"].concat(t))},keydown:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["keydown"].concat(t))},keypress:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["keypress"].concat(t))},submit:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["submit"].concat(t))},change:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["change"].concat(t))},mousedown:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["mousedown"].concat(t))},mousemove:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["mousemove"].concat(t))},mouseup:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["mouseup"].concat(t))},mouseenter:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["mouseenter"].concat(t))},mouseleave:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["mouseleave"].concat(t))},mouseout:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["mouseout"].concat(t))},mouseover:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["mouseover"].concat(t))},touchstart:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["touchstart"].concat(t))},touchend:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["touchend"].concat(t))},touchmove:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["touchmove"].concat(t))},resize:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["resize"].concat(t))},scroll:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u.bind(this).apply(void 0,["scroll"].concat(t))}})].forEach(function(t){Object.keys(t).forEach(function(e){i.fn[e]=t[e]})}),i}); | ||
* Released on: August 31, 2018 | ||
*/!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Dom7=e()}(this,function(){"use strict";var h="undefined"==typeof document?{body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},location:{hash:""}}:document,y="undefined"==typeof window?{document:h,navigator:{userAgent:""},location:{},history:{},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){}}:window,l=function(t){for(var e=0;e<t.length;e+=1)this[e]=t[e];return this.length=t.length,this};function g(t,e){var n=[],i=0;if(t&&!e&&t instanceof l)return t;if(t)if("string"==typeof t){var r,o,s=t.trim();if(0<=s.indexOf("<")&&0<=s.indexOf(">")){var a="div";for(0===s.indexOf("<li")&&(a="ul"),0===s.indexOf("<tr")&&(a="tbody"),0!==s.indexOf("<td")&&0!==s.indexOf("<th")||(a="tr"),0===s.indexOf("<tbody")&&(a="table"),0===s.indexOf("<option")&&(a="select"),(o=h.createElement(a)).innerHTML=s,i=0;i<o.childNodes.length;i+=1)n.push(o.childNodes[i])}else for(r=e||"#"!==t[0]||t.match(/[ .<>:~]/)?(e||h).querySelectorAll(t.trim()):[h.getElementById(t.trim().split("#")[1])],i=0;i<r.length;i+=1)r[i]&&n.push(r[i])}else if(t.nodeType||t===y||t===h)n.push(t);else if(0<t.length&&t[0].nodeType)for(i=0;i<t.length;i+=1)n.push(t[i]);return new l(n)}function o(t){for(var e=[],n=0;n<t.length;n+=1)-1===e.indexOf(t[n])&&e.push(t[n]);return e}function b(t){return y.requestAnimationFrame?y.requestAnimationFrame(t):y.webkitRequestAnimationFrame?y.webkitRequestAnimationFrame(t):y.setTimeout(t,1e3/60)}g.fn=l.prototype,g.Class=l,g.Dom7=l;var t=Object.freeze({addClass:function(t){if(void 0===t)return this;for(var e=t.split(" "),n=0;n<e.length;n+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.add(e[n]);return this},removeClass:function(t){for(var e=t.split(" "),n=0;n<e.length;n+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.remove(e[n]);return this},hasClass:function(t){return!!this[0]&&this[0].classList.contains(t)},toggleClass:function(t){for(var e=t.split(" "),n=0;n<e.length;n+=1)for(var i=0;i<this.length;i+=1)void 0!==this[i]&&void 0!==this[i].classList&&this[i].classList.toggle(e[n]);return this},attr:function(t,e){var n=arguments;if(1===arguments.length&&"string"==typeof t)return this[0]?this[0].getAttribute(t):void 0;for(var i=0;i<this.length;i+=1)if(2===n.length)this[i].setAttribute(t,e);else for(var r in t)this[i][r]=t[r],this[i].setAttribute(r,t[r]);return this},removeAttr:function(t){for(var e=0;e<this.length;e+=1)this[e].removeAttribute(t);return this},prop:function(t,e){var n=arguments;if(1!==arguments.length||"string"!=typeof t){for(var i=0;i<this.length;i+=1)if(2===n.length)this[i][t]=e;else for(var r in t)this[i][r]=t[r];return this}if(this[0])return this[0][t]},data:function(t,e){var n;if(void 0!==e){for(var i=0;i<this.length;i+=1)(n=this[i]).dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[t]=e;return this}if(n=this[0]){if(n.dom7ElementDataStorage&&t in n.dom7ElementDataStorage)return n.dom7ElementDataStorage[t];var r=n.getAttribute("data-"+t);return r||void 0}},removeData:function(t){for(var e=0;e<this.length;e+=1){var n=this[e];n.dom7ElementDataStorage&&n.dom7ElementDataStorage[t]&&(n.dom7ElementDataStorage[t]=null,delete n.dom7ElementDataStorage[t])}},dataset:function(){var t=this[0];if(t){var e,n={};if(t.dataset)for(var i in t.dataset)n[i]=t.dataset[i];else for(var r=0;r<t.attributes.length;r+=1){var o=t.attributes[r];0<=o.name.indexOf("data-")&&(n[(e=o.name.split("data-")[1],e.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}))]=o.value)}for(var s in n)"false"===n[s]?n[s]=!1:"true"===n[s]?n[s]=!0:parseFloat(n[s])===1*n[s]&&(n[s]*=1);return n}},val:function(t){var e=this;if(void 0!==t){for(var n=0;n<e.length;n+=1){var i=e[n];if(Array.isArray(t)&&i.multiple&&"select"===i.nodeName.toLowerCase())for(var r=0;r<i.options.length;r+=1)i.options[r].selected=0<=t.indexOf(i.options[r].value);else i.value=t}return e}if(e[0]){if(e[0].multiple&&"select"===e[0].nodeName.toLowerCase()){for(var o=[],s=0;s<e[0].selectedOptions.length;s+=1)o.push(e[0].selectedOptions[s].value);return o}return e[0].value}},transform:function(t){for(var e=0;e<this.length;e+=1){var n=this[e].style;n.webkitTransform=t,n.transform=t}return this},transition:function(t){"string"!=typeof t&&(t+="ms");for(var e=0;e<this.length;e+=1){var n=this[e].style;n.webkitTransitionDuration=t,n.transitionDuration=t}return this},on:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],o=e[1],s=e[2],r=e[3];function a(t){var e=t.target;if(e){var n=t.target.dom7EventData||[];if(n.indexOf(t)<0&&n.unshift(t),g(e).is(o))s.apply(e,n);else for(var i=g(e).parents(),r=0;r<i.length;r+=1)g(i[r]).is(o)&&s.apply(i[r],n)}}function l(t){var e=t&&t.target&&t.target.dom7EventData||[];e.indexOf(t)<0&&e.unshift(t),s.apply(this,e)}"function"==typeof e[1]&&(i=(t=e)[0],s=t[1],r=t[2],o=void 0),r||(r=!1);for(var h,u=i.split(" "),f=0;f<this.length;f+=1){var c=this[f];if(o)for(h=0;h<u.length;h+=1){var d=u[h];c.dom7LiveListeners||(c.dom7LiveListeners={}),c.dom7LiveListeners[d]||(c.dom7LiveListeners[d]=[]),c.dom7LiveListeners[d].push({listener:s,proxyListener:a}),c.addEventListener(d,a,r)}else for(h=0;h<u.length;h+=1){var v=u[h];c.dom7Listeners||(c.dom7Listeners={}),c.dom7Listeners[v]||(c.dom7Listeners[v]=[]),c.dom7Listeners[v].push({listener:s,proxyListener:l}),c.addEventListener(v,l,r)}}return this},off:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],r=e[1],o=e[2],s=e[3];"function"==typeof e[1]&&(i=(t=e)[0],o=t[1],s=t[2],r=void 0),s||(s=!1);for(var a=i.split(" "),l=0;l<a.length;l+=1)for(var h=a[l],u=0;u<this.length;u+=1){var f=this[u],c=void 0;if(!r&&f.dom7Listeners?c=f.dom7Listeners[h]:r&&f.dom7LiveListeners&&(c=f.dom7LiveListeners[h]),c&&c.length)for(var d=c.length-1;0<=d;d-=1){var v=c[d];o&&v.listener===o?(f.removeEventListener(h,v.proxyListener,s),c.splice(d,1)):o||(f.removeEventListener(h,v.proxyListener,s),c.splice(d,1))}}return this},once:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=this,r=e[0],o=e[1],s=e[2],a=e[3];return"function"==typeof e[1]&&(r=(t=e)[0],s=t[1],a=t[2],o=void 0),i.on(r,o,function t(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];s.apply(this,e),i.off(r,o,t,a)},a)},trigger:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var n=t[0].split(" "),i=t[1],r=0;r<n.length;r+=1)for(var o=n[r],s=0;s<this.length;s+=1){var a=this[s],l=void 0;try{l=new y.CustomEvent(o,{detail:i,bubbles:!0,cancelable:!0})}catch(t){(l=h.createEvent("Event")).initEvent(o,!0,!0),l.detail=i}a.dom7EventData=t.filter(function(t,e){return 0<e}),a.dispatchEvent(l),a.dom7EventData=[],delete a.dom7EventData}return this},transitionEnd:function(e){var n,i=["webkitTransitionEnd","transitionend"],r=this;function o(t){if(t.target===this)for(e.call(this,t),n=0;n<i.length;n+=1)r.off(i[n],o)}if(e)for(n=0;n<i.length;n+=1)r.on(i[n],o);return this},animationEnd:function(e){var n,i=["webkitAnimationEnd","animationend"],r=this;function o(t){if(t.target===this)for(e.call(this,t),n=0;n<i.length;n+=1)r.off(i[n],o)}if(e)for(n=0;n<i.length;n+=1)r.on(i[n],o);return this},width:function(){return this[0]===y?y.innerWidth:0<this.length?parseFloat(this.css("width")):null},outerWidth:function(t){if(0<this.length){if(t){var e=this.styles();return this[0].offsetWidth+parseFloat(e.getPropertyValue("margin-right"))+parseFloat(e.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},height:function(){return this[0]===y?y.innerHeight:0<this.length?parseFloat(this.css("height")):null},outerHeight:function(t){if(0<this.length){if(t){var e=this.styles();return this[0].offsetHeight+parseFloat(e.getPropertyValue("margin-top"))+parseFloat(e.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},offset:function(){if(0<this.length){var t=this[0],e=t.getBoundingClientRect(),n=h.body,i=t.clientTop||n.clientTop||0,r=t.clientLeft||n.clientLeft||0,o=t===y?y.scrollY:t.scrollTop,s=t===y?y.scrollX:t.scrollLeft;return{top:e.top+o-i,left:e.left+s-r}}return null},hide:function(){for(var t=0;t<this.length;t+=1)this[t].style.display="none";return this},show:function(){for(var t=0;t<this.length;t+=1){var e=this[t];"none"===e.style.display&&(e.style.display=""),"none"===y.getComputedStyle(e,null).getPropertyValue("display")&&(e.style.display="block")}return this},styles:function(){return this[0]?y.getComputedStyle(this[0],null):{}},css:function(t,e){var n;if(1===arguments.length){if("string"!=typeof t){for(n=0;n<this.length;n+=1)for(var i in t)this[n].style[i]=t[i];return this}if(this[0])return y.getComputedStyle(this[0],null).getPropertyValue(t)}if(2!==arguments.length||"string"!=typeof t)return this;for(n=0;n<this.length;n+=1)this[n].style[t]=e;return this},toArray:function(){for(var t=[],e=0;e<this.length;e+=1)t.push(this[e]);return t},each:function(t){if(!t)return this;for(var e=0;e<this.length;e+=1)if(!1===t.call(this[e],e,this[e]))return this;return this},forEach:function(t){if(!t)return this;for(var e=0;e<this.length;e+=1)if(!1===t.call(this[e],this[e],e))return this;return this},filter:function(t){for(var e=[],n=0;n<this.length;n+=1)t.call(this[n],n,this[n])&&e.push(this[n]);return new l(e)},map:function(t){for(var e=[],n=0;n<this.length;n+=1)e.push(t.call(this[n],n,this[n]));return new l(e)},html:function(t){if(void 0===t)return this[0]?this[0].innerHTML:void 0;for(var e=0;e<this.length;e+=1)this[e].innerHTML=t;return this},text:function(t){if(void 0===t)return this[0]?this[0].textContent.trim():null;for(var e=0;e<this.length;e+=1)this[e].textContent=t;return this},is:function(t){var e,n,i=this[0];if(!i||void 0===t)return!1;if("string"==typeof t){if(i.matches)return i.matches(t);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(t);if(i.msMatchesSelector)return i.msMatchesSelector(t);for(e=g(t),n=0;n<e.length;n+=1)if(e[n]===i)return!0;return!1}if(t===h)return i===h;if(t===y)return i===y;if(t.nodeType||t instanceof l){for(e=t.nodeType?[t]:t,n=0;n<e.length;n+=1)if(e[n]===i)return!0;return!1}return!1},indexOf:function(t){for(var e=0;e<this.length;e+=1)if(this[e]===t)return e;return-1},index:function(){var t,e=this[0];if(e){for(t=0;null!==(e=e.previousSibling);)1===e.nodeType&&(t+=1);return t}},eq:function(t){if(void 0===t)return this;var e,n=this.length;return new l(n-1<t?[]:t<0?(e=n+t)<0?[]:[this[e]]:[this[t]])},append:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];for(var i=0;i<e.length;i+=1){t=e[i];for(var r=0;r<this.length;r+=1)if("string"==typeof t){var o=h.createElement("div");for(o.innerHTML=t;o.firstChild;)this[r].appendChild(o.firstChild)}else if(t instanceof l)for(var s=0;s<t.length;s+=1)this[r].appendChild(t[s]);else this[r].appendChild(t)}return this},appendTo:function(t){return g(t).append(this),this},prepend:function(t){var e,n,i=this;for(e=0;e<this.length;e+=1)if("string"==typeof t){var r=h.createElement("div");for(r.innerHTML=t,n=r.childNodes.length-1;0<=n;n-=1)i[e].insertBefore(r.childNodes[n],i[e].childNodes[0])}else if(t instanceof l)for(n=0;n<t.length;n+=1)i[e].insertBefore(t[n],i[e].childNodes[0]);else i[e].insertBefore(t,i[e].childNodes[0]);return this},prependTo:function(t){return g(t).prepend(this),this},insertBefore:function(t){for(var e=g(t),n=0;n<this.length;n+=1)if(1===e.length)e[0].parentNode.insertBefore(this[n],e[0]);else if(1<e.length)for(var i=0;i<e.length;i+=1)e[i].parentNode.insertBefore(this[n].cloneNode(!0),e[i])},insertAfter:function(t){for(var e=g(t),n=0;n<this.length;n+=1)if(1===e.length)e[0].parentNode.insertBefore(this[n],e[0].nextSibling);else if(1<e.length)for(var i=0;i<e.length;i+=1)e[i].parentNode.insertBefore(this[n].cloneNode(!0),e[i].nextSibling)},next:function(t){return 0<this.length?t?this[0].nextElementSibling&&g(this[0].nextElementSibling).is(t)?new l([this[0].nextElementSibling]):new l([]):this[0].nextElementSibling?new l([this[0].nextElementSibling]):new l([]):new l([])},nextAll:function(t){var e=[],n=this[0];if(!n)return new l([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;t?g(i).is(t)&&e.push(i):e.push(i),n=i}return new l(e)},prev:function(t){if(0<this.length){var e=this[0];return t?e.previousElementSibling&&g(e.previousElementSibling).is(t)?new l([e.previousElementSibling]):new l([]):e.previousElementSibling?new l([e.previousElementSibling]):new l([])}return new l([])},prevAll:function(t){var e=[],n=this[0];if(!n)return new l([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;t?g(i).is(t)&&e.push(i):e.push(i),n=i}return new l(e)},siblings:function(t){return this.nextAll(t).add(this.prevAll(t))},parent:function(t){for(var e=[],n=0;n<this.length;n+=1)null!==this[n].parentNode&&(t?g(this[n].parentNode).is(t)&&e.push(this[n].parentNode):e.push(this[n].parentNode));return g(o(e))},parents:function(t){for(var e=[],n=0;n<this.length;n+=1)for(var i=this[n].parentNode;i;)t?g(i).is(t)&&e.push(i):e.push(i),i=i.parentNode;return g(o(e))},closest:function(t){var e=this;return void 0===t?new l([]):(e.is(t)||(e=e.parents(t).eq(0)),e)},find:function(t){for(var e=[],n=0;n<this.length;n+=1)for(var i=this[n].querySelectorAll(t),r=0;r<i.length;r+=1)e.push(i[r]);return new l(e)},children:function(t){for(var e=[],n=0;n<this.length;n+=1)for(var i=this[n].childNodes,r=0;r<i.length;r+=1)t?1===i[r].nodeType&&g(i[r]).is(t)&&e.push(i[r]):1===i[r].nodeType&&e.push(i[r]);return new l(o(e))},remove:function(){for(var t=0;t<this.length;t+=1)this[t].parentNode&&this[t].parentNode.removeChild(this[t]);return this},detach:function(){return this.remove()},add:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n,i;for(n=0;n<t.length;n+=1){var r=g(t[n]);for(i=0;i<r.length;i+=1)this[this.length]=r[i],this.length+=1}return this},empty:function(){for(var t=0;t<this.length;t+=1){var e=this[t];if(1===e.nodeType){for(var n=0;n<e.childNodes.length;n+=1)e.childNodes[n].parentNode&&e.childNodes[n].parentNode.removeChild(e.childNodes[n]);e.textContent=""}}return this}});var e=Object.freeze({scrollTo:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],r=e[1],g=e[2],p=e[3],m=e[4];return 4===e.length&&"function"==typeof p&&(m=p,i=(t=e)[0],r=t[1],g=t[2],m=t[3],p=t[4]),void 0===p&&(p="swing"),this.each(function(){var o,s,t,e,a,l,h,u,f=this,c=0<r||0===r,d=0<i||0===i;if(void 0===p&&(p="swing"),c&&(o=f.scrollTop,g||(f.scrollTop=r)),d&&(s=f.scrollLeft,g||(f.scrollLeft=i)),g){c&&(t=f.scrollHeight-f.offsetHeight,a=Math.max(Math.min(r,t),0)),d&&(e=f.scrollWidth-f.offsetWidth,l=Math.max(Math.min(i,e),0));var v=null;c&&a===o&&(c=!1),d&&l===s&&(d=!1),b(function t(e){void 0===e&&(e=(new Date).getTime()),null===v&&(v=e);var n,i=Math.max(Math.min((e-v)/g,1),0),r="linear"===p?i:.5-Math.cos(i*Math.PI)/2;c&&(h=o+r*(a-o)),d&&(u=s+r*(l-s)),c&&o<a&&a<=h&&(f.scrollTop=a,n=!0),c&&a<o&&h<=a&&(f.scrollTop=a,n=!0),d&&s<l&&l<=u&&(f.scrollLeft=l,n=!0),d&&l<s&&u<=l&&(f.scrollLeft=l,n=!0),n?m&&m():(c&&(f.scrollTop=h),d&&(f.scrollLeft=u),b(t))})}})},scrollTop:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],r=e[1],o=e[2],s=e[3];return 3===e.length&&"function"==typeof o&&(i=(t=e)[0],r=t[1],s=t[2],o=t[3]),void 0===i?0<this.length?this[0].scrollTop:null:this.scrollTo(void 0,i,r,o,s)},scrollLeft:function(){for(var t,e=[],n=arguments.length;n--;)e[n]=arguments[n];var i=e[0],r=e[1],o=e[2],s=e[3];return 3===e.length&&"function"==typeof o&&(i=(t=e)[0],r=t[1],s=t[2],o=t[3]),void 0===i?0<this.length?this[0].scrollLeft:null:this.scrollTo(i,void 0,r,o,s)}});var n=Object.freeze({animate:function(t,e){var n,i=this,m={props:Object.assign({},t),params:Object.assign({duration:300,easing:"swing"},e),elements:i,animating:!1,que:[],easingProgress:function(t,e){return"swing"===t?.5-Math.cos(e*Math.PI)/2:"function"==typeof t?t(e):e},stop:function(){var t;m.frameId&&(t=m.frameId,y.cancelAnimationFrame?y.cancelAnimationFrame(t):y.webkitCancelAnimationFrame?y.webkitCancelAnimationFrame(t):y.clearTimeout(t)),m.animating=!1,m.elements.each(function(t,e){delete e.dom7AnimateInstance}),m.que=[]},done:function(t){if(m.animating=!1,m.elements.each(function(t,e){delete e.dom7AnimateInstance}),t&&t(i),0<m.que.length){var e=m.que.shift();m.animate(e[0],e[1])}},animate:function(h,u){if(m.animating)return m.que.push([h,u]),m;var f=[];m.elements.each(function(e,n){var i,r,o,s,a;n.dom7AnimateInstance||(m.elements[e].dom7AnimateInstance=m),f[e]={container:n},Object.keys(h).forEach(function(t){i=y.getComputedStyle(n,null).getPropertyValue(t).replace(",","."),r=parseFloat(i),o=i.replace(r,""),s=parseFloat(h[t]),a=h[t]+o,f[e][t]={initialFullValue:i,initialValue:r,unit:o,finalValue:s,finalFullValue:a,currentValue:r}})});var c,d,v=null,g=0,p=0,e=!1;return m.animating=!0,m.frameId=b(function t(){var a,l;c=(new Date).getTime(),e||(e=!0,u.begin&&u.begin(i)),null===v&&(v=c),u.progress&&u.progress(i,Math.max(Math.min((c-v)/u.duration,1),0),v+u.duration-c<0?0:v+u.duration-c,v),f.forEach(function(t){var s=t;d||s.done||Object.keys(h).forEach(function(t){if(!d&&!s.done){a=Math.max(Math.min((c-v)/u.duration,1),0),l=m.easingProgress(u.easing,a);var e=s[t],n=e.initialValue,i=e.finalValue,r=e.unit;s[t].currentValue=n+l*(i-n);var o=s[t].currentValue;(n<i&&i<=o||i<n&&o<=i)&&(s.container.style[t]=i+r,(p+=1)===Object.keys(h).length&&(s.done=!0,g+=1),g===f.length&&(d=!0)),d?m.done(u.complete):s.container.style[t]=o+r}})}),d||(m.frameId=b(t))}),m}};if(0===m.elements.length)return i;for(var r=0;r<m.elements.length;r+=1)m.elements[r].dom7AnimateInstance?n=m.elements[r].dom7AnimateInstance:m.elements[r].dom7AnimateInstance=m;return n||(n=m),"stop"===t?n.stop():n.animate(m.props,m.params),i},stop:function(){for(var t=0;t<this.length;t+=1)this[t].dom7AnimateInstance&&this[t].dom7AnimateInstance.stop()}}),s="resize scroll".split(" ");function i(t){for(var e,n=[],i=arguments.length-1;0<i--;)n[i]=arguments[i+1];if(void 0!==n[0])return(e=this).on.apply(e,[t].concat(n));for(var r=0;r<this.length;r+=1)s.indexOf(t)<0&&(t in this[r]?this[r][t]():g(this[r]).trigger(t));return this}return[t,e,n,Object.freeze({click:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["click"].concat(t))},blur:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["blur"].concat(t))},focus:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["focus"].concat(t))},focusin:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["focusin"].concat(t))},focusout:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["focusout"].concat(t))},keyup:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["keyup"].concat(t))},keydown:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["keydown"].concat(t))},keypress:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["keypress"].concat(t))},submit:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["submit"].concat(t))},change:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["change"].concat(t))},mousedown:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["mousedown"].concat(t))},mousemove:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["mousemove"].concat(t))},mouseup:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["mouseup"].concat(t))},mouseenter:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["mouseenter"].concat(t))},mouseleave:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["mouseleave"].concat(t))},mouseout:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["mouseout"].concat(t))},mouseover:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["mouseover"].concat(t))},touchstart:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["touchstart"].concat(t))},touchend:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["touchend"].concat(t))},touchmove:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["touchmove"].concat(t))},resize:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["resize"].concat(t))},scroll:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i.bind(this).apply(void 0,["scroll"].concat(t))}})].forEach(function(e){Object.keys(e).forEach(function(t){g.fn[t]=e[t]})}),g}); | ||
//# sourceMappingURL=dom7.min.js.map |
/** | ||
* Dom7 2.0.7 | ||
* Dom7 2.1.0 | ||
* Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API | ||
@@ -12,5 +12,5 @@ * http://framework7.io/docs/dom.html | ||
* | ||
* Released on: June 14, 2018 | ||
* Released on: August 31, 2018 | ||
*/ | ||
import { document, window } from 'ssr-window'; | ||
import { window, document } from 'ssr-window'; | ||
@@ -17,0 +17,0 @@ class Dom7 { |
/** | ||
* Dom7 2.0.7 | ||
* Dom7 2.1.0 | ||
* Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API | ||
@@ -12,5 +12,5 @@ * http://framework7.io/docs/dom.html | ||
* | ||
* Released on: June 14, 2018 | ||
* Released on: August 31, 2018 | ||
*/ | ||
import { document, window } from 'ssr-window'; | ||
import { window, document } from 'ssr-window'; | ||
@@ -30,3 +30,3 @@ class Dom7 { | ||
function $$1(selector, context) { | ||
function $(selector, context) { | ||
const arr = []; | ||
@@ -82,5 +82,5 @@ let i = 0; | ||
$$1.fn = Dom7.prototype; | ||
$$1.Class = Dom7; | ||
$$1.Dom7 = Dom7; | ||
$.fn = Dom7.prototype; | ||
$.Class = Dom7; | ||
$.Dom7 = Dom7; | ||
@@ -323,7 +323,7 @@ function unique(arr) { | ||
} | ||
if ($$1(target).is(targetSelector)) listener.apply(target, eventData); | ||
if ($(target).is(targetSelector)) listener.apply(target, eventData); | ||
else { | ||
const parents = $$1(target).parents(); // eslint-disable-line | ||
const parents = $(target).parents(); // eslint-disable-line | ||
for (let k = 0; k < parents.length; k += 1) { | ||
if ($$1(parents[k]).is(targetSelector)) listener.apply(parents[k], eventData); | ||
if ($(parents[k]).is(targetSelector)) listener.apply(parents[k], eventData); | ||
} | ||
@@ -680,3 +680,3 @@ } | ||
compareWith = $$1(selector); | ||
compareWith = $(selector); | ||
for (i = 0; i < compareWith.length; i += 1) { | ||
@@ -758,3 +758,3 @@ if (compareWith[i] === el) return true; | ||
function appendTo(parent) { | ||
$$1(parent).append(this); | ||
$(parent).append(this); | ||
return this; | ||
@@ -784,7 +784,7 @@ } | ||
function prependTo(parent) { | ||
$$1(parent).prepend(this); | ||
$(parent).prepend(this); | ||
return this; | ||
} | ||
function insertBefore(selector) { | ||
const before = $$1(selector); | ||
const before = $(selector); | ||
for (let i = 0; i < this.length; i += 1) { | ||
@@ -801,3 +801,3 @@ if (before.length === 1) { | ||
function insertAfter(selector) { | ||
const after = $$1(selector); | ||
const after = $(selector); | ||
for (let i = 0; i < this.length; i += 1) { | ||
@@ -816,3 +816,3 @@ if (after.length === 1) { | ||
if (selector) { | ||
if (this[0].nextElementSibling && $$1(this[0].nextElementSibling).is(selector)) { | ||
if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) { | ||
return new Dom7([this[0].nextElementSibling]); | ||
@@ -835,3 +835,3 @@ } | ||
if (selector) { | ||
if ($$1(next).is(selector)) nextEls.push(next); | ||
if ($(next).is(selector)) nextEls.push(next); | ||
} else nextEls.push(next); | ||
@@ -846,3 +846,3 @@ el = next; | ||
if (selector) { | ||
if (el.previousElementSibling && $$1(el.previousElementSibling).is(selector)) { | ||
if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) { | ||
return new Dom7([el.previousElementSibling]); | ||
@@ -865,3 +865,3 @@ } | ||
if (selector) { | ||
if ($$1(prev).is(selector)) prevEls.push(prev); | ||
if ($(prev).is(selector)) prevEls.push(prev); | ||
} else prevEls.push(prev); | ||
@@ -880,3 +880,3 @@ el = prev; | ||
if (selector) { | ||
if ($$1(this[i].parentNode).is(selector)) parents.push(this[i].parentNode); | ||
if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode); | ||
} else { | ||
@@ -887,3 +887,3 @@ parents.push(this[i].parentNode); | ||
} | ||
return $$1(unique(parents)); | ||
return $(unique(parents)); | ||
} | ||
@@ -896,3 +896,3 @@ function parents(selector) { | ||
if (selector) { | ||
if ($$1(parent).is(selector)) parents.push(parent); | ||
if ($(parent).is(selector)) parents.push(parent); | ||
} else { | ||
@@ -904,3 +904,3 @@ parents.push(parent); | ||
} | ||
return $$1(unique(parents)); | ||
return $(unique(parents)); | ||
} | ||
@@ -935,3 +935,3 @@ function closest(selector) { | ||
if (childNodes[j].nodeType === 1) children.push(childNodes[j]); | ||
} else if (childNodes[j].nodeType === 1 && $$1(childNodes[j]).is(selector)) { | ||
} else if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) { | ||
children.push(childNodes[j]); | ||
@@ -957,3 +957,3 @@ } | ||
for (i = 0; i < args.length; i += 1) { | ||
const toAdd = $$1(args[i]); | ||
const toAdd = $(args[i]); | ||
for (j = 0; j < toAdd.length; j += 1) { | ||
@@ -981,65 +981,62 @@ dom[dom.length] = toAdd[j]; | ||
var Methods = Object.freeze({ | ||
addClass: addClass, | ||
removeClass: removeClass, | ||
hasClass: hasClass, | ||
toggleClass: toggleClass, | ||
attr: attr, | ||
removeAttr: removeAttr, | ||
prop: prop, | ||
data: data, | ||
removeData: removeData, | ||
dataset: dataset, | ||
val: val, | ||
transform: transform, | ||
transition: transition, | ||
on: on, | ||
off: off, | ||
once: once, | ||
trigger: trigger, | ||
transitionEnd: transitionEnd, | ||
animationEnd: animationEnd, | ||
width: width, | ||
outerWidth: outerWidth, | ||
height: height, | ||
outerHeight: outerHeight, | ||
offset: offset, | ||
hide: hide, | ||
show: show, | ||
styles: styles, | ||
css: css, | ||
toArray: toArray, | ||
each: each, | ||
forEach: forEach, | ||
filter: filter, | ||
map: map, | ||
html: html, | ||
text: text, | ||
is: is, | ||
indexOf: indexOf, | ||
index: index, | ||
eq: eq, | ||
append: append, | ||
appendTo: appendTo, | ||
prepend: prepend, | ||
prependTo: prependTo, | ||
insertBefore: insertBefore, | ||
insertAfter: insertAfter, | ||
next: next, | ||
nextAll: nextAll, | ||
prev: prev, | ||
prevAll: prevAll, | ||
siblings: siblings, | ||
parent: parent, | ||
parents: parents, | ||
closest: closest, | ||
find: find, | ||
children: children, | ||
remove: remove, | ||
detach: detach, | ||
add: add, | ||
empty: empty | ||
var Methods = /*#__PURE__*/Object.freeze({ | ||
addClass: addClass, | ||
removeClass: removeClass, | ||
hasClass: hasClass, | ||
toggleClass: toggleClass, | ||
attr: attr, | ||
removeAttr: removeAttr, | ||
prop: prop, | ||
data: data, | ||
removeData: removeData, | ||
dataset: dataset, | ||
val: val, | ||
transform: transform, | ||
transition: transition, | ||
on: on, | ||
off: off, | ||
once: once, | ||
trigger: trigger, | ||
transitionEnd: transitionEnd, | ||
animationEnd: animationEnd, | ||
width: width, | ||
outerWidth: outerWidth, | ||
height: height, | ||
outerHeight: outerHeight, | ||
offset: offset, | ||
hide: hide, | ||
show: show, | ||
styles: styles, | ||
css: css, | ||
toArray: toArray, | ||
each: each, | ||
forEach: forEach, | ||
filter: filter, | ||
map: map, | ||
html: html, | ||
text: text, | ||
is: is, | ||
indexOf: indexOf, | ||
index: index, | ||
eq: eq, | ||
append: append, | ||
appendTo: appendTo, | ||
prepend: prepend, | ||
prependTo: prependTo, | ||
insertBefore: insertBefore, | ||
insertAfter: insertAfter, | ||
next: next, | ||
nextAll: nextAll, | ||
prev: prev, | ||
prevAll: prevAll, | ||
siblings: siblings, | ||
parent: parent, | ||
parents: parents, | ||
closest: closest, | ||
find: find, | ||
children: children, | ||
remove: remove, | ||
detach: detach, | ||
add: add, | ||
empty: empty | ||
}); | ||
@@ -1157,9 +1154,6 @@ | ||
var Scroll = Object.freeze({ | ||
scrollTo: scrollTo, | ||
scrollTop: scrollTop, | ||
scrollLeft: scrollLeft | ||
var Scroll = /*#__PURE__*/Object.freeze({ | ||
scrollTo: scrollTo, | ||
scrollTop: scrollTop, | ||
scrollLeft: scrollLeft | ||
}); | ||
@@ -1352,8 +1346,5 @@ | ||
var Animate = Object.freeze({ | ||
animate: animate, | ||
stop: stop | ||
var Animate = /*#__PURE__*/Object.freeze({ | ||
animate: animate, | ||
stop: stop | ||
}); | ||
@@ -1368,3 +1359,3 @@ | ||
else { | ||
$$1(this[i]).trigger(name); | ||
$(this[i]).trigger(name); | ||
} | ||
@@ -1445,28 +1436,25 @@ } | ||
var eventShortcuts = Object.freeze({ | ||
click: click, | ||
blur: blur, | ||
focus: focus, | ||
focusin: focusin, | ||
focusout: focusout, | ||
keyup: keyup, | ||
keydown: keydown, | ||
keypress: keypress, | ||
submit: submit, | ||
change: change, | ||
mousedown: mousedown, | ||
mousemove: mousemove, | ||
mouseup: mouseup, | ||
mouseenter: mouseenter, | ||
mouseleave: mouseleave, | ||
mouseout: mouseout, | ||
mouseover: mouseover, | ||
touchstart: touchstart, | ||
touchend: touchend, | ||
touchmove: touchmove, | ||
resize: resize, | ||
scroll: scroll | ||
var eventShortcuts = /*#__PURE__*/Object.freeze({ | ||
click: click, | ||
blur: blur, | ||
focus: focus, | ||
focusin: focusin, | ||
focusout: focusout, | ||
keyup: keyup, | ||
keydown: keydown, | ||
keypress: keypress, | ||
submit: submit, | ||
change: change, | ||
mousedown: mousedown, | ||
mousemove: mousemove, | ||
mouseup: mouseup, | ||
mouseenter: mouseenter, | ||
mouseleave: mouseleave, | ||
mouseout: mouseout, | ||
mouseover: mouseover, | ||
touchstart: touchstart, | ||
touchend: touchend, | ||
touchmove: touchmove, | ||
resize: resize, | ||
scroll: scroll | ||
}); | ||
@@ -1476,6 +1464,6 @@ | ||
Object.keys(group).forEach((methodName) => { | ||
$$1.fn[methodName] = group[methodName]; | ||
$.fn[methodName] = group[methodName]; | ||
}); | ||
}); | ||
export default $$1; | ||
export default $; |
122
gulpfile.js
@@ -0,1 +1,2 @@ | ||
const fs = require('fs'); | ||
const gulp = require('gulp'); | ||
@@ -7,7 +8,5 @@ const connect = require('gulp-connect'); | ||
const sourcemaps = require('gulp-sourcemaps'); | ||
const rollup = require('rollup-stream'); | ||
const rollup = require('rollup'); | ||
const resolve = require('rollup-plugin-node-resolve'); | ||
const buble = require('rollup-plugin-buble'); | ||
const source = require('vinyl-source-stream'); | ||
const buffer = require('vinyl-buffer'); | ||
const rename = require('gulp-rename'); | ||
@@ -43,69 +42,76 @@ const modifyFile = require('gulp-modify-file'); | ||
const env = process.env.NODE_ENV || 'development'; | ||
rollup({ | ||
const output = env === 'development' ? './build' : './dist'; | ||
rollup.rollup({ | ||
input: './src/dom7.js', | ||
plugins: [resolve(), buble()], | ||
format: 'umd', | ||
name: 'Dom7', | ||
strict: true, | ||
sourcemap: env === 'development', | ||
banner, | ||
}) | ||
.pipe(source('dom7.js', './src')) | ||
.pipe(buffer()) | ||
.pipe(gulp.dest(`./${env === 'development' ? 'build' : 'dist'}/`)) | ||
.on('end', () => { | ||
if (env === 'development') { | ||
}).then((bundle) => { | ||
return bundle.write({ | ||
strict: true, | ||
file: `${output}/dom7.js`, | ||
format: 'umd', | ||
name: 'Dom7', | ||
sourcemap: env === 'development', | ||
sourcemapFile: `${output}/dom7.js.map`, | ||
banner, | ||
}); | ||
}).then(() => { | ||
if (env === 'development') { | ||
if (cb) cb(); | ||
return; | ||
} | ||
gulp.src('./dist/dom7.js') | ||
.pipe(sourcemaps.init()) | ||
.pipe(uglify()) | ||
.pipe(header(banner)) | ||
.pipe(rename('dom7.min.js')) | ||
.pipe(sourcemaps.write('./')) | ||
.pipe(gulp.dest('./dist/')) | ||
.on('end', () => { | ||
if (cb) cb(); | ||
return; | ||
} | ||
gulp.src('./dist/dom7.js') | ||
.pipe(sourcemaps.init()) | ||
.pipe(uglify()) | ||
.pipe(header(banner)) | ||
.pipe(rename('dom7.min.js')) | ||
.pipe(sourcemaps.write('./')) | ||
.pipe(gulp.dest('./dist/')) | ||
.on('end', () => { | ||
if (cb) cb(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} | ||
// ES MODULE DIST | ||
function es(cb) { | ||
const env = process.env.NODE_ENV || 'development'; | ||
const output = env === 'development' ? './build' : './dist'; | ||
let cbs = 0; | ||
rollup({ | ||
rollup.rollup({ | ||
input: './src/dom7.js', | ||
format: 'es', | ||
name: 'Dom7', | ||
strict: true, | ||
external: ['ssr-window'], | ||
sourcemap: env === 'development', | ||
banner, | ||
}) | ||
.pipe(source('dom7.js', './src')) | ||
.pipe(buffer()) | ||
.pipe(rename('dom7.module.js')) | ||
.pipe(gulp.dest(`./${env === 'development' ? 'build' : 'dist'}/`)) | ||
.on('end', () => { | ||
cbs += 1; | ||
if (cb && cbs === 2) cb(); | ||
}).then((bundle) => { | ||
return bundle.write({ | ||
strict: true, | ||
file: `${output}/dom7.module.js`, | ||
format: 'es', | ||
name: 'Dom7', | ||
sourcemap: env === 'development', | ||
sourcemapFile: `${output}/dom7.module.js.map`, | ||
banner, | ||
}); | ||
rollup({ | ||
}).then(() => { | ||
cbs += 1; | ||
if (cb && cbs === 2) cb(); | ||
}); | ||
rollup.rollup({ | ||
input: './src/dom7.modular.js', | ||
format: 'es', | ||
name: 'Dom7', | ||
strict: true, | ||
external: ['ssr-window'], | ||
sourcemap: env === 'development', | ||
banner, | ||
}) | ||
.pipe(source('dom7.js', './src')) | ||
.pipe(buffer()) | ||
.pipe(rename('dom7.modular.js')) | ||
.pipe(gulp.dest(`./${env === 'development' ? 'build' : 'dist'}/`)) | ||
.on('end', () => { | ||
cbs += 1; | ||
if (cb && cbs === 2) cb(); | ||
}).then((bundle) => { | ||
return bundle.write({ | ||
strict: true, | ||
file: `${output}/dom7.modular.js`, | ||
format: 'es', | ||
name: 'Dom7', | ||
sourcemap: env === 'development', | ||
sourcemapFile: `${output}/dom7.modular.js.map`, | ||
banner, | ||
}); | ||
}).then(() => { | ||
cbs += 1; | ||
if (cb && cbs === 2) cb(); | ||
}); | ||
} | ||
@@ -115,2 +121,6 @@ | ||
let cbs = 0; | ||
const env = process.env.NODE_ENV || 'development'; | ||
const output = env === 'development' ? './build' : './dist'; | ||
fs.copyFileSync('./src/dom7.d.ts', `${output}/dom7.d.ts`); | ||
umd(() => { | ||
@@ -117,0 +127,0 @@ cbs += 1; |
{ | ||
"name": "dom7", | ||
"version": "2.0.7", | ||
"version": "2.1.0", | ||
"description": "Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API", | ||
"main": "dist/dom7.js", | ||
"types": "dist/dom7.d.ts", | ||
"jsnext:main": "dist/dom7.module.js", | ||
"module": "dist/dom7.module.js", | ||
"scripts": { | ||
"build-dev": "NODE_ENV=development gulp build", | ||
"build-prod": "NODE_ENV=production gulp build", | ||
"dev": "NODE_ENV=development gulp build && NODE_ENV=development gulp demo && gulp server", | ||
"prod": "NODE_ENV=production gulp demo && NODE_ENV=production gulp server", | ||
"build-dev": "cross-env NODE_ENV=development gulp build", | ||
"build-prod": "cross-env NODE_ENV=production gulp build", | ||
"dev": "cross-env NODE_ENV=development gulp build && cross-env NODE_ENV=development gulp demo && gulp server", | ||
"prod": "cross-env NODE_ENV=production gulp demo && cross-env NODE_ENV=production gulp server", | ||
"test": "npm run build-dev" | ||
@@ -33,22 +34,21 @@ }, | ||
"devDependencies": { | ||
"eslint": "^4.9.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^5.4.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"gulp": "^3.9.1", | ||
"gulp-connect": "^5.2.0", | ||
"gulp-header": "^2.0.1", | ||
"gulp-connect": "^5.6.1", | ||
"gulp-header": "^2.0.5", | ||
"gulp-modify-file": "^1.0.1", | ||
"gulp-open": "^2.1.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-open": "^3.0.1", | ||
"gulp-rename": "^1.4.0", | ||
"gulp-sourcemaps": "^2.6.4", | ||
"gulp-uglify": "^3.0.0", | ||
"rollup-plugin-buble": "^0.19.1", | ||
"rollup-plugin-node-resolve": "^3.0.2", | ||
"rollup-stream": "^1.24.1", | ||
"vinyl-buffer": "^1.0.1", | ||
"vinyl-source-stream": "^2.0.0" | ||
"gulp-uglify": "^3.0.1", | ||
"rollup": "^0.65.0", | ||
"rollup-plugin-buble": "^0.19.2", | ||
"rollup-plugin-node-resolve": "^3.3.0" | ||
}, | ||
"dependencies": { | ||
"ssr-window": "^1.0.0" | ||
"ssr-window": "^1.0.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
319113
15
23
6515
5
Updatedssr-window@^1.0.1