@ -1,5 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
console.log("Registering service worker");
|
||||
navigator.serviceWorker.register('/sw.js');
|
||||
}
|
||||
|
||||
class CsvxmlValidator {
|
||||
|
||||
fieldList; // {}{}
|
||||
@ -625,6 +630,7 @@ class CsvxmlPage {
|
||||
const input = document.createElement("input");
|
||||
input.type = "file";
|
||||
input.id = "fileToUpload";
|
||||
input.setAttribute("tabindex", "1");
|
||||
input.accept = ".csv";
|
||||
input.required = "required";
|
||||
input.addEventListener('change', async function() {
|
||||
@ -703,8 +709,9 @@ class CsvxmlPage {
|
||||
|
||||
function genButton(id, text, link = "") {
|
||||
|
||||
const output = document.createElement("a");
|
||||
const output = document.createElement("span");
|
||||
output.id = id;
|
||||
output.setAttribute("tabindex", "1");
|
||||
output.textContent = text;
|
||||
output.classList.add("buttonLike");
|
||||
if (link !== "") output.href = link;
|
||||
@ -719,7 +726,8 @@ class CsvxmlPage {
|
||||
|
||||
const dlAllButton = genButton("dlAll", this.tls.download_csv_all);
|
||||
dlAllButton.cursor = "pointer";
|
||||
dlAllButton.addEventListener('click', function() {
|
||||
dlAllButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
app.generateCsv();
|
||||
});
|
||||
options.appendChild(dlAllButton);
|
||||
@ -739,6 +747,7 @@ class CsvxmlPage {
|
||||
options.appendChild(this.unsetSelectionButton);
|
||||
|
||||
this.csvBySelectionButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let selected = document.getElementsByClassName("humanTLToggled");
|
||||
let selectedFields = [];
|
||||
@ -750,6 +759,7 @@ class CsvxmlPage {
|
||||
});
|
||||
|
||||
optionSelectRequired.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
app.doForFieldList(function(field) {
|
||||
if (field.classList.contains("requiredField") === false) return;
|
||||
@ -763,6 +773,7 @@ class CsvxmlPage {
|
||||
});
|
||||
|
||||
optionSelectAll.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
app.doForFieldList(function(field) {
|
||||
if (field.classList.contains("humanTLToggled") === true) return;
|
||||
@ -775,6 +786,7 @@ class CsvxmlPage {
|
||||
});
|
||||
|
||||
this.unsetSelectionButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
app.doForFieldList(function(field) {
|
||||
if (field.classList.contains("humanTLToggled") === false) return;
|
||||
@ -893,6 +905,7 @@ class CsvxmlPage {
|
||||
}
|
||||
|
||||
const lang = getLang();
|
||||
document.documentElement.setAttribute("lang", lang);
|
||||
|
||||
document.body.classList.add("loading");
|
||||
|
||||
|
Reference in New Issue
Block a user