Deployment v1

This commit is contained in:
Simon Martens
2023-09-12 01:59:52 +02:00
parent 4cdd59cf89
commit 2c88f22f8e
40 changed files with 1093 additions and 39129 deletions

View File

@@ -227,7 +227,7 @@
}
.ha-index .ha-indexbody .ha-filterlist .ha-personfilter .ha-personlist {
@apply max-h-[23rem] overflow-y-auto overflow-x-hidden py-1 pl-1 mr-2
@apply max-h-[23rem] overflow-y-auto overflow-x-hidden py-1 pl-1 mr-2 transition-all
}
.ha-index .ha-indexbody .ha-filterlist .ha-personfilter .ha-personlist a {
@@ -235,6 +235,6 @@
}
.ha-index .ha-indexbody .ha-filterlist .ha-personfilter .ha-personlist a:nth-child(odd) {
@apply block
}
}
}

View File

@@ -0,0 +1,84 @@
@layer components {
.ha-notifications {
@apply fixed right-5 bottom-4 px-3 min-w-full
}
.ha-notifications a {
@apply underline decoration-dotted hover:decoration-solid
}
.ha-notifications .ha-notcontent {
@apply absolute bottom-0 right-0 flex flex-row
}
.ha-notifications.loading .ha-noticon {
}
.ha-notifications.green {
}
.ha-notifications.green .ha-noticon {
@apply text-emerald-700
}
.ha-notifications.orange {
}
.ha-notifications.orange .ha-noticon {
@apply text-yellow-500
}
.ha-notifications.red {
}
.ha-notifications.red .ha-noticon {
@apply text-rose-600
}
.ha-noticon {
@apply w-5 inline-block pt-1 relative top-[2px] text-slate-400 transition-all duration-500
}
.ha-noticon svg {
@apply shadow-red-800 drop-shadow-md
}
.ha-commslog {
@apply shadow-md inline-block bg-slate-50 mr-2 px-2 py-0.5 opacity-0 transition-all duration-300 text-sm font-mono
}
.ha-notifications:hover .ha-commslog {
@apply !opacity-100
}
.ha-notifications:hover .ha-noticon svg {
@apply !opacity-100 drop-shadow-xl
}
}
.ha-notifications.visible .ha-commslog {
}
.ha-notifications.loading .ha-noticon {
animation: ha-pulse 1.1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes ha-pulse {
0%, 100% {
opacity: .8;
}
50% {
opacity: .6;
}
}
.ha-notifications.imp .ha-commslog {
animation: ha-pulse 5s cubic-bezier(0.4, 0, 0.6, 1);
animation-iteration-count: 1;
}

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@
/* STYLES */
.ha-scrollbutton {
@apply opacity-0 transition-opacity duration-500 cursor-pointer fixed right-0 bottom-6 text-center py-2 pr-6 bg-slate-50 dark:bg-slate-700 dark:text-white px-2 shadow rounded-l-xl transition-all hover:shadow-md text-hamannSlate-700 hover:text-hamannSlate-500
@apply opacity-0 transition-opacity duration-500 cursor-pointer fixed right-0 bottom-48 text-center py-2 pr-6 bg-slate-50 dark:bg-slate-700 dark:text-white px-2 shadow rounded-l-xl transition-all hover:shadow-md text-hamannSlate-700 hover:text-hamannSlate-500
}
.ha-scrollbuttonarrow {

View File

@@ -62,7 +62,7 @@
}
.ha-location {
@apply !text-hamannHighlight absolute text-xl hidden sm:inline-block
@apply !text-hamannSlate-300 absolute text-xl hidden sm:inline-block
}

View File

@@ -11,9 +11,10 @@
@import "./register.css";
@import "./letterhead.css";
@import "./letter.css";
@import "./upload.css";
@import "./xmlstate.css";
@import "./index.css";
@import "./search.css";
@import "./notifications.css";
@import "./print.css";
@layer components {

View File

@@ -1,203 +0,0 @@
@layer components {
/* COLORS */
/* STYLES */
.ha-adminuploadfields {
@apply flex flex-row flex-wrap gap-x-4 gap-y-4
}
.ha-adminuploadfields .ha-uploadfield {
@apply block shrink-0 grow bg-slate-50 rounded shadow basis-64 max-w-xs
}
.ha-adminuploadfields .ha-uploadfield:hover {
@apply brightness-110
}
.ha-adminuploadfields .ha-uploadfield.active {
@apply !text-black brightness-110 shadow-inner
}
.ha-adminuploadfields .ha-uploadfield .ha-uploadfieldname {
@apply px-3 pt-2 pb-1
}
.ha-adminuploadfields .ha-uploadusedfiles {
@apply text-sm whitespace-nowrap overflow-hidden text-ellipsis w-auto bg-slate-200 border-t border-slate-300 bg-opacity-30 px-2 py-0.5
}
.ha-adminuploadfields .ha-uploadusedfiles.ha-uploadusedfilesnotfound {
@apply bg-slate-500 border-slate-500
}
.ha-adminuploadfields .ha-uploadpublishforms {
@apply flex flex-row gap-x-4 grow
}
.ha-adminuploadfields .ha-uploadform {
@apply bg-slate-50 rounded shadow grow relative
}
.ha-adminuploadfields .ha-uploadform .ha-uploadtext {
@apply text-center
}
.ha-adminuploadfields .ha-uploadform .ha-lds-ellipsis {
@apply left-1/2 -ml-[20px]
}
.ha-adminuploadfields .ha-uploadform .ha-uploadfilelabel {
@apply inline-block px-4 py-1 pt-2 cursor-pointer w-full h-full hover:bg-slate-100
}
.ha-adminuploadfields .ha-uploadform .ha-uploadmessage {
@apply text-sm bg-slate-700 bg-opacity-30 px-1 rounded-sm
}
.ha-adminuploadfields .ha-publishbutton {
@apply inline-block px-2 py-1 pt-2 cursor-pointer w-full h-full bg-slate-50 shadow shrink hover:bg-slate-100
}
.ha-adminuploadfields .ha-publishbutton .ha-publishtext {
@apply text-center
}
.ha-adminuploadfields .ha-publishbutton .ha-publishmessage {
@apply text-sm bg-slate-700 bg-opacity-30 px-1 rounded-sm
}
.ha-uploadheader {
@apply bg-slate-50 w-full mt-4 px-16 pt-12 pb-8 flex flex-row
}
.ha-uploadheader h1 {
@apply text-5xl
}
.ha-uploadcontainer {
@apply w-full bg-slate-50 flex flex-col gap-y-2
}
.ha-uploadcontainer .ha-publishfilelist {
@apply px-16 mb-8
}
.ha-uploadcontainer .ha-publishfilelist .ha-publishfilelisttitle {
@apply text-xl mb-2
}
.ha-uploadcontainer .ha-publishfilelist td {
@apply align-text-top pr-6
}
.ha-uploadcontainer .ha-publishfilelist .ha-publishfilelabel {
@apply relative mt-4 ml-6 rounded-md px-3 border-2 border-blue-600 hover:border-2 hover:shadow active:shadow-inner hover:border-blue-800 cursor-pointer float-right;
}
.ha-uploadcontainer .ha-availablefiles {
@apply px-16 border border-slate-200 hover:border-slate-800 py-2 cursor-pointer select-none
}
.ha-uploadcontainer .ha-availablefiles .ha-availablefilestitle {
@apply text-2xl
}
.ha-uploadcontainer .ha-availablefiles .ha-usedfilelist {
}
.ha-filesheader {
@apply mb-4
}
.ha-availablefileslist {
@apply px-16 pt-4
}
.ha-uploadcontainer .ha-errorswarnings {
@apply flex flex-row gap-x-2
}
.ha-uploadcontainer .ha-errorswarnings .ha-criticalerrors,
.ha-uploadcontainer .ha-errorswarnings .ha-warnings {
@apply basis-1/2 min-w-[40%] min-h-[400px] overflow-x-hidden overflow-y-scroll grow shrink
}
.ha-uploadcontainer .ha-errorswarnings .ha-criticalerrors {
@apply bg-red-200
}
.ha-uploadcontainer .ha-errorswarnings .ha-warnings {
@apply bg-orange-200
}
.ha-uploadcontainer .ha-crossfilechecking {
@apply w-full bg-cyan-200 grow shrink-0 h-full min-h-[400px]
}
.ha-uploadcontainer .ha-hamannfilechooser {
@apply px-16 pb-16
}
.ha-uploadcontainer .ha-setendyearform {
@apply px-16 pb-16 float-right
}
.ha-uploadcontainer .ha-setendyearform .ha-setendyearbutton {
@apply mt-4 ml-6 rounded-md px-3 border-2 border-blue-600 hover:border-2 hover:shadow active:shadow-inner hover:border-blue-800 cursor-pointer
}
/* Classes for FileList Component */
.ha-filelistfieldset {
}
.ha-filelistfieldset .ha-filelistlegend {
@apply mb-2 text-xl
}
.ha-selectfilesform {
}
.ha-selectfilesform .ha-filelistfile {
@apply flex flex-row gap-x-4 px-1 items-center
}
.ha-selectfilesform .ha-filelistfile:nth-child(even) {
@apply bg-slate-100
}
.ha-selectfilesform .ha-filelistlist {
@apply h-96 overflow-x-hidden overflow-y-scroll pr-4
}
.ha-selectfilesform .ha-filelistfile .ha-filelistname {
@apply font-mono
}
.ha-selectfilesform .ha-filelistfile .ha-filelistusedproduction {
@apply text-sm
}
.ha-selectfilesform .ha-filelistfile .ha-filelistusedproduction .ha-filelistproduction {
@apply inline-block border rounded-md text-teal-600 border-teal-600 px-2 mr-2
}
.ha-selectfilesform .ha-filelistfile .ha-filelistusedproduction .ha-filelistused {
@apply inline-block border rounded-md text-indigo-600 border-indigo-600 px-2
}
.ha-selectfilesform .ha-filelistfile .ha-filelistmodified {
@apply grow text-right
}
.ha-selectfilesform .ha-filelistoutput {
@apply mt-4 ml-6
}
.ha-selectfilesform .ha-filelistbutton {
@apply mt-4 ml-6 rounded-md px-3 border-2 border-blue-600 hover:border-2 hover:shadow active:shadow-inner hover:border-blue-800 cursor-pointer float-right;
}
}

View File

@@ -0,0 +1,180 @@
@layer components {
.ha-xmlstateheader {
@apply bg-slate-50 w-full mt-4 px-16 pt-12 pb-8 flex flex-row
}
.ha-xmlstateheader h1 {
@apply text-5xl
}
.ha-managedfiles {
@apply mt-4 border border-slate-300 px-4 py-3
}
.ha-repo {
@apply relative
}
.ha-repodata {
@apply bg-slate-50 px-3.5 py-1 w-max shadow
}
.ha-repodata div {
}
.ha-repodata a {
@apply underline decoration-dotted
}
.ha-repofilecount {
@apply absolute right-0 bottom-0 bg-slate-50 px-3 py-1 shadow
}
.ha-managedfileslist {
@apply flex flex-col gap-3 mt-3
}
.ha-managedfileheader {
@apply flex flex-row gap-2 bg-slate-50 pl-3.5 pr-2.5 rounded-md py-1 w-full shadow-md select-none border-b
}
.ha-managedfileheader.expandable {
@apply cursor-pointer rounded-none !rounded-t-md border-b
}
.ha-managedfileheader.orange {
@apply border-b border-orange-300 bg-orange-50
}
.ha-managedfileheader.orange .ha-filestatusicon svg {
@apply text-orange-700 !pt-0
}
.ha-managedfileheader.red {
@apply border-b border-red-400 bg-red-50
}
.ha-managedfileheader.red .ha-filestatusicon svg {
@apply text-red-700 !pt-[0rem]
}
.ha-managedfileheader.green {
@apply bg-teal-50
}
.ha-managedfileheader.green .ha-filestatusicon svg {
@apply text-green-700
}
.ha-managedfileheader.expandable.red+.ha-managedfileannotations {
@apply bg-red-100
}
.ha-managedfileannotations {
@apply hidden font-mono w-full text-base px-4 pt-1.5 pb-1 rounded-b-md shadow bg-orange-100 overflow-x-hidden overflow-y-auto max-h-72
}
.ha-managedfileannotations table {
@apply text-left w-full
}
.ha-managedfileannotations table td,
.ha-managedfileannotations table th {
@apply pr-4
}
.ha-managedfileannotations table th {
@apply border-b border-black
}
.ha-managedfileheader.expandable.expanded+.ha-managedfileannotations {
@apply block
}
.ha-managedfile div:first-child {
@apply grow
}
.ha-managedfile .ha-filestatusicon {
@apply w-5 pt-[.14rem]
}
.ha-scbutton {
@apply mt-4 rounded-md px-4 py-1 border-2 bg-blue-600 shadow-blue-100 hover:shadow-blue-200 duration-500 text-slate-50 shadow-md hover:shadow-xl active:shadow-inner hover:border-blue-600 cursor-pointer absolute bottom-4 right-6 transition-all hover:ease-in-out;
}
.ha-scbutton.loading {
@apply shadow-blue-100 saturate-[.8] shadow-xl transition-all ease-in-out border-blue-600;
}
/* Classes for FileList Component */
.ha-filelistfieldset {
@apply bg-slate-50 px-3 py-2 mt-4
}
.ha-filelistfieldset .ha-filelistlegend {
@apply pb-2 text-xl
}
.ha-selectfilesform {
@apply relative
}
.ha-selectfilesform .ha-filelistfile {
@apply flex flex-row gap-x-4 px-1 items-center
}
.ha-selectfilesform .ha-filelistfile:nth-child(even) {
@apply bg-slate-100
}
.ha-selectfilesform .ha-filelistlist {
@apply h-96 overflow-x-hidden overflow-y-scroll
}
.ha-selectfilesform .ha-filelistfile .ha-filelistname {
@apply font-mono
}
.ha-selectfilesform .ha-filelistfile .ha-filelistusedproduction {
@apply text-sm
}
.ha-selectfilesform .ha-filelistfile .ha-filelistusedproduction .ha-filelistproduction {
@apply inline-block border rounded-md text-teal-600 border-teal-600 px-2 mr-2
}
.ha-selectfilesform .ha-filelistfile .ha-filelistmodified {
@apply grow text-right
}
.ha-selectfilesform .ha-filelistoutput {
@apply mt-4 ml-6
}
.ha-selectfilesform .ha-filelistbutton {
@apply mt-4 rounded-md px-4 py-1 border-2 bg-blue-600 shadow-blue-100 hover:shadow-blue-200 duration-500 text-slate-50 shadow-md hover:shadow-xl active:shadow-inner hover:border-blue-600 cursor-pointer absolute bottom-4 right-6 transition-all hover:ease-in-out;
}
.ha-selectfilesform .ha-filelistbutton.loading {
@apply shadow-blue-100 saturate-[.8] shadow-xl transition-all ease-in-out border-blue-600;
}
}
.ha-scbutton.loading {
animation: ha-pulse .7s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.ha-selectfilesform .ha-filelistbutton.loading {
animation: ha-pulse .7s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes ha-pulse {
0%, 100% {
opacity: .8;
}
50% {
opacity: .6;
}
}

View File

@@ -7,7 +7,7 @@ function getCookie(name) {
const USESubmit = async function (oFormElement, file = null) {
let fd = new FormData(oFormElement);
document.getElementById("ha-filelistbutton").style.pointerEvents = "none";
document.getElementById("ha-lds-ellipsis-load").style.display = "inline-block";
document.getElementById("ha-filelistbutton").classList.add("loading");
await fetch(oFormElement.action, {
method: 'POST',
headers: {
@@ -17,40 +17,97 @@ const USESubmit = async function (oFormElement, file = null) {
})
.then(response => response.json())
.then(json => {
document.getElementById("ha-filelistbutton").classList.remove("loading");
document.getElementById("ha-filelistbutton").style.pointerEvents = "auto";
if ("Error" in json) {
document.getElementById("ha-filelistbutton").style.pointerEvents = "auto";
document.getElementById("ha-lds-ellipsis-load").style.display = "none";
document.getElementById("ha-filelistoutput").textContent = json.Error;
document.getElementById("ha-filelistoutput").textContent = json.Error;
}
else {
document.getElementById("ha-filelistbutton").style.pointerEvents = "auto";
document.getElementById("ha-lds-ellipsis-load").style.display = "none";
location.reload();
location.reload();
}
})
.catch ((e) => {
document.getElementById("ha-filelistbutton").classList.remove("loading");
document.getElementById("ha-filelistbutton").style.pointerEvents = "auto";
document.getElementById("ha-lds-ellipsis-load").style.display = "none";
document.getElementById("ha-filelistoutput").textContent = e;
})
}
const YEARSUBMIT = async function (oFormElement, file = null) {
let fd = new FormData(oFormElement);
document.getElementById("ha-setendyearbutton").style.pointerEvents = "none";
await fetch(oFormElement.action, {
method: 'POST',
headers: {
'RequestVerificationToken': getCookie('RequestVerificationToken')
},
body: fd
})
.then(response => response.json())
.then(json => {
document.getElementById("ha-setendyearbutton").style.pointerEvents = "auto";
location.reload();
})
.catch ((e) => {
document.getElementById("ha-setendyearbutton").style.pointerEvents = "auto";
})
const GETSyntaxCheck = async function (oFormElement, file = null) {
document.getElementById("ha-scbutton").style.pointerEvents = "none";
document.getElementById("ha-scbutton").classList.toggle("loading");
await fetch(oFormElement.action)
.then(response => response.json())
.then(j => {
Object.entries(j).forEach(([key, value]) => {
var e = document.getElementById(key);
if (e !== null && !e.classList.contains("red")) {
var h = e.querySelector(".ha-managedfileheader");
var i = e.querySelector(".ha-filestatusicon");
var a = e.querySelector(".ha-managedfileannotations");
if (value.errors === null) {
h.classList.add("green");
} else {
var icon = i.querySelector("svg");
icon.remove();
i.insertAdjacentHTML("afterbegin", '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><title>alert-decagram-outline</title><path d="M23,12L20.56,14.78L20.9,18.46L17.29,19.28L15.4,22.46L12,21L8.6,22.47L6.71,19.29L3.1,18.47L3.44,14.78L1,12L3.44,9.21L3.1,5.53L6.71,4.72L8.6,1.54L12,3L15.4,1.54L17.29,4.72L20.9,5.54L20.56,9.22L23,12M20.33,12L18.5,9.89L18.74,7.1L16,6.5L14.58,4.07L12,5.18L9.42,4.07L8,6.5L5.26,7.09L5.5,9.88L3.67,12L5.5,14.1L5.26,16.9L8,17.5L9.42,19.93L12,18.81L14.58,19.92L16,17.5L18.74,16.89L18.5,14.1L20.33,12M11,15H13V17H11V15M11,7H13V13H11V7" /></svg>');
h.classList.add("expandable");
h.classList.add("orange");
h.addEventListener("click", () => {
h.classList.toggle("expanded");
});
var t = document.createElement("table");
var thr = document.createElement("tr");
var thl = document.createElement("th");
var thc = document.createElement("th");
var thm = document.createElement("th");
thl.append("Zeile");
thc.append("Spalte");
thm.append("Fehler");
thr.append(thl, thc, thm);
t.append(thr);
value.errors.forEach((error) => {
var tr = document.createElement("tr");
var tdl = document.createElement("td");
var tdc = document.createElement("td");
var tdm = document.createElement("td");
tdl.append(error.line);
tdc.append(error.column);
tdm.append(error.message);
tr.append(tdl, tdc, tdm);
t.append(tr);
})
a.append(t);
}
}
console.log(e, h, i, a);
});
// let coll = document.getElementsByClassName("ha-managedfile");
// for (i = 0; i < coll.length; i++) {
// let e = coll[i];
// if (j[e.id] !== null) {
// if(j[e.id].errors === null) {
// console.log(e.id + " hat keine errors");
// } else {
// console.log(e.id + " hat errors");
// }
// }
// }
document.getElementById("ha-scbutton").classList.toggle("hidden");
})
.catch ((e) => {
console.log(e);
document.getElementById("ha-scbutton").classList.toggle("loading");
document.getElementById("ha-scbutton").style.pointerEvents = "auto";
})
}
var coll = document.getElementsByClassName("expandable");
for (i = 0; i < coll.length; i++) {
let element = coll[i]
coll[i].addEventListener("click", () => {
element.classList.toggle("expanded");
});
}

View File

@@ -21,5 +21,6 @@ if (document.getElementById("ha-scrollbutton") !== null) {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
})
window.addEventListener("scroll", scrollFunction);
// TODO: workaround, bc window does not recieve scroll events anymore
setInterval(() => scrollFunction(), 1000);
}

View File

@@ -0,0 +1,157 @@
var stateSC = null;
var stateValidation = null;
var stateReload = null;
var stateCommit = null;
var firstMessage = true;
var commsLog = document.getElementById("commsLog");
var commsNot = document.getElementById("comm-notifications");
var socket;
var scheme = document.location.protocol === "https:" ? "wss" : "ws";
var port = document.location.port ? (":" + document.location.port) : "";
var connectionUrl = scheme + "://" + document.location.hostname + port + "/WS" ;
function htmlEscape(str) {
return str.toString()
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}
socket = new WebSocket(connectionUrl);
socket.onopen = function (event) {
socket.send("Hello");
updateMessage();
};
socket.onclose = function (event) {
updateMessage();
};
socket.onerror = updateMessage;
socket.onmessage = function (event) {
var msg = JSON.parse(event.data);
if (msg.ValidationState != null) {
stateValidation = msg.ValidationState;
console.log(msg.ValidationState);
switch (msg.ValidationState) {
case 0:
commsNot.classList.remove("loading");
commsNot.classList.remove("green");
if (!commsNot.classList.contains("red")) {
commsNot.classList.add("red");
}
updateMessage();
break;
case 1:
if (!commsNot.classList.contains("loading")) {
commsNot.classList.add("loading");
}
updateMessage();
break;
case 2:
commsNot.classList.remove("red");
commsNot.classList.remove("loading");
if (!commsNot.classList.contains("green")) {
commsNot.classList.add("green");
}
updateMessage();
break;
}
} else if (msg.Commit != null) {
stateCommit = msg;
updateMessage();
} else if (msg.reload != null) {
stateReload = msg.reload;
if (msg.reload) {
setTimeout(() => {
commsNot.remove();
socket.close(1000, "bye");
location.reload();
}, 1500);
}
} else if (msg.SC != null) {
stateSC = msg.SC;
} else {
commsLog.innerHTML = htmlEscape(event.data);
}
};
function updateMessage() {
function disable() {
commsNot.classList.remove("red");
commsNot.classList.remove("loading");
commsNot.classList.remove("green");
}
function enable() {
}
if (!socket) {
disable();
} else {
switch (socket.readyState) {
case WebSocket.CLOSED:
commsLog.innerHTML = "Keine Verbindung";
disable();
break;
case WebSocket.CLOSING:
commsLog.innerHTML = "Verbindung wird geschlossen...";
disable();
break;
case WebSocket.CONNECTING:
commsLog.innerHTML = "Verbinden...";
disable();
break;
case WebSocket.OPEN:
commsLog.innerHTML = "";
// TODO: decide on state what the message is
if (stateValidation == 0 ) {
commsLog.innerHTML = 'Der angezeigte Stand ist nicht aktuell. ' +
'<a href="/Admin">Fehler beheben</a>';
if (!firstMessage) commsNot.classList.add("imp");
} else if (stateValidation == 1) {
commsLog.innerHTML = "Der Server arbeitet...";
} else {
if (stateCommit != null) {
commsLog.innerHTML = "commit " +
stateCommit.Commit.substring(0, 7) +
" geladen"
} else {
commsLog.innerHTML = "OK.";
}
}
firstMessage = false;
enable();
break;
default:
commsLog.innerHTML = "Unknown WebSocket State: " + htmlEscape(socket.readyState);
disable();
break;
}
}
}
// closeButton.onclick = function () {
// if (!socket || socket.readyState !== WebSocket.OPEN) {
// alert("socket not connected");
// }
// socket.close(1000, "Closing from client");
// };
// sendButton.onclick = function () {
// if (!socket || socket.readyState !== WebSocket.OPEN) {
// alert("socket not connected");
// }
// var data = sendMessage.value;
// socket.send(data);
// commsLog.innerHTML += '<tr>' +
// '<td class="commslog-client">Client</td>' +
// '<td class="commslog-server">Server</td>' +
// '<td class="commslog-data">' + htmlEscape(data) + '</td></tr>';
// };