Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
FallBackITA27 committed Apr 11, 2024
1 parent 1bd1692 commit 63cdf23
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions mkwpp-parser/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
let data = {};
let data = {
submissions: [],
};

function writeToOutput(d) {
if (d == null) return;
Expand All @@ -21,18 +23,19 @@ document.addEventListener("DOMContentLoaded", async function() {

document.getElementById("readInput").addEventListener("click", async function() {
let parserData = document.getElementById("inputTextArea").value.split("\n").filter(r=>r !== "");
let currentSubmission = {
name: "",
date: "",
flapCatch: false,
noscCatch: false,
};
let currentSubmission = {skip:true};
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);
if (keywords[0].contains("name")) {
if (!currentSubmission.skip) data.submissions.push(currentSubmission);
currentSubmission = {
name: keywords.slice(1,keywords.length).join(" "),
date: "",
flapCatch: false,
noscCatch: false,
};
console.log(currentSubmission);
}
}
});
Expand Down

0 comments on commit 63cdf23

Please sign in to comment.