Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt validator to ES6 #652

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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