Skip to content

Commit

Permalink
Adapt validator to ES6
Browse files Browse the repository at this point in the history
[fixes #643]
  • Loading branch information
kewisch committed Apr 1, 2024
1 parent ec0ca19 commit 59245d9
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions tools/validator.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<!-- Note this code is pretty fugly, it needs to be rewritten -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
#descr {
body {
font-family: 'Verdana', sans-serif;
color: #333;
background-color: #f4f4f4;
padding: 20px;
font-size: 16px;
width: 42em;
}
input[type="submit"] {
font-size: 1.2em;
font-size: 1.2rem;
border-radius: 5px;
border: 1px solid black;
margin-top: 1ex;
padding: 10px;
}
textarea {
width: 100%;
height: 22rem;
font-family: monospace;
}

hr {
border: 1px solid black;
border: 1px solid #999;
margin: 0;
}
</style>
<script type="text/javascript" src="https://unpkg.com/ical.js"></script>
<script type="text/javascript">
<script type="module">
import ICAL from "https://unpkg.com/ical.js";

function stringError(e) {
return "Error: " + e +
("fileName" in e ? "\nFilename: " + e.fileName : "") +
("lineNumber" in e ? "\nLine: " + e.lineNumber : "") +
("stack" in e ? "\nStack: " + e.stack : "");
}

function validate() {
window.validate = function validate() {
var duration = document.getElementById("duration");

var data = document.getElementById("data");
Expand All @@ -40,7 +54,7 @@

var beginTime = Date.now();

var jcal, from;
var jcal, ical, from;
try {
jcal = JSON.parse(data.value);
from = "json";
Expand Down

0 comments on commit 59245d9

Please sign in to comment.