From 1bd1692d763b49cfdcd0f552b937a4814ef96927 Mon Sep 17 00:00:00 2001 From: FallBackITA27 Date: Thu, 11 Apr 2024 14:21:29 +0200 Subject: [PATCH] check for name --- mkwpp-parser/script.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mkwpp-parser/script.js b/mkwpp-parser/script.js index 51fe00e..9c176a6 100644 --- a/mkwpp-parser/script.js +++ b/mkwpp-parser/script.js @@ -21,7 +21,20 @@ document.addEventListener("DOMContentLoaded", async function() { document.getElementById("readInput").addEventListener("click", async function() { let parserData = document.getElementById("inputTextArea").value.split("\n").filter(r=>r !== ""); - console.log(parserData); + let currentSubmission = { + name: "", + date: "", + flapCatch: false, + noscCatch: false, + }; + for (let line of parserData) { + let keywords = line.toLowerCase().split(" ").filter(r=>r !== ""); + console.log(keywords); + if (keywords[0] === "name") { + let name = keywords.slice(1,keywords.length).join(" "); + console.log(name); + } + } }); /* example data