2020-06-30 10:43:00 +02:00
|
|
|
//===
|
|
|
|
// VARIABLES
|
|
|
|
//===
|
|
|
|
var EVENTS;
|
|
|
|
(function (EVENTS) {
|
|
|
|
EVENTS[EVENTS["i-click"] = 0] = "i-click";
|
|
|
|
EVENTS[EVENTS["i-scroll-up"] = 1] = "i-scroll-up";
|
|
|
|
EVENTS[EVENTS["i-scroll-down"] = 2] = "i-scroll-down";
|
|
|
|
EVENTS[EVENTS["i-hover"] = 3] = "i-hover";
|
|
|
|
})(EVENTS || (EVENTS = {}));
|
|
|
|
//===
|
|
|
|
// FUNCTIONS
|
|
|
|
//===
|
|
|
|
function validateSyntax() {
|
|
|
|
// Check every event
|
|
|
|
var eventsKeys = Object.keys(EVENTS).filter(function (key) { return !isNaN(Number(EVENTS[key])); });
|
|
|
|
eventsKeys.forEach(function (event) {
|
|
|
|
var ddd = document.querySelector("[" + event + "]").length;
|
|
|
|
console.log(ddd);
|
|
|
|
});
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
//===
|
|
|
|
// LINTER
|
|
|
|
//===
|
|
|
|
//===
|
|
|
|
// INIT
|
|
|
|
//===
|
|
|
|
validateSyntax();
|