This commit is contained in:
Andros Fenollosa 2020-06-30 10:43:00 +02:00
parent 4777f8dd9d
commit bf1e55c0dc
3 changed files with 60 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
test.html

29
dist/ffnm.min.js vendored
View File

@ -0,0 +1,29 @@
//===
// 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();

View File

@ -0,0 +1,29 @@
//===
// VARIABLES
//===
enum EVENTS {'i-click', 'i-scroll-up', 'i-scroll-down', 'i-hover'}
//===
// FUNCTIONS
//===
function validateSyntax(): boolean {
// Check every event
let eventsKeys = Object.keys(EVENTS).filter(key => !isNaN(Number(EVENTS[key])));
eventsKeys.forEach((event) => {
let ddd = document.querySelector(`[${event}]`).length
console.log(ddd)
})
return true
}
//===
// LINTER
//===
//===
// INIT
//===
validateSyntax()