diff --git a/comments/Love%20Live!%20Custom%20Arcade%20Controller.comment b/comments/Love%20Live!%20Custom%20Arcade%20Controller.comment new file mode 100644 index 0000000..6958bba --- /dev/null +++ b/comments/Love%20Live!%20Custom%20Arcade%20Controller.comment @@ -0,0 +1,5 @@ +2 +First! +Sig2022-08-01T15:32:36.648104Z[Etc/UTC];MAGENTA +Second!
+Sig2022-08-01T16:00:26.660317Z[Etc/UTC];RED diff --git a/out/DIRECTORY_LISTING b/out/DIRECTORY_LISTING index 09e1fea..f366dfb 100644 --- a/out/DIRECTORY_LISTING +++ b/out/DIRECTORY_LISTING @@ -17,15 +17,15 @@
-

Directory Listing for /

📁.. (Previous Directory)
📁articles 2022-08-01T15:25:23.920536Z gitpod 4096
-
📁images 2022-08-01T15:25:23.916536Z gitpod 77
-
🗎codeBackground 2022-08-01T15:25:23.800536Z gitpod 2635
-
🗎otherpage.html 2022-08-01T15:25:23.836536Z gitpod 88370
-
🗎reset.css 2022-08-01T15:25:23.808536Z gitpod 1092
-
🗎testfile.html 2022-08-01T15:25:23.836536Z gitpod 1627
-
🗎uploadform.html 2022-08-01T15:25:23.836536Z gitpod 1707
-
🗎sig.css 2022-08-01T15:25:23.824536Z gitpod 10595
-
🗎error.html 2022-08-01T15:25:23.840536Z gitpod 1672
+

Directory Listing for /

📁.. (Previous Directory)
📁articles 2022-08-01T15:59:35.330694Z gitpod 4096
+
📁images 2022-08-01T15:59:35.326694Z gitpod 77
+
🗎codeBackground 2022-08-01T15:59:35.214694Z gitpod 2635
+
🗎otherpage.html 2022-08-01T15:59:35.258694Z gitpod 88370
+
🗎reset.css 2022-08-01T15:59:35.218694Z gitpod 1092
+
🗎testfile.html 2022-08-01T15:59:35.262694Z gitpod 1627
+
🗎uploadform.html 2022-08-01T15:59:35.262694Z gitpod 1707
+
🗎sig.css 2022-08-01T15:59:35.246694Z gitpod 10595
+
🗎error.html 2022-08-01T15:59:35.262694Z gitpod 1672
diff --git a/out/articles/DIRECTORY_LISTING b/out/articles/DIRECTORY_LISTING index 68687b0..1c2c0c1 100644 --- a/out/articles/DIRECTORY_LISTING +++ b/out/articles/DIRECTORY_LISTING @@ -17,13 +17,13 @@
-

Directory Listing for /articles/

📁.. (Previous Directory)
📁test articles 2022-08-01T15:25:23.848536Z gitpod 147
-
🗎Love Live! Custom Arcade Controller.article 2022-08-01T15:25:23.320536Z gitpod 497
-
🗎curabitur vel tempus ex.article 2022-08-01T15:25:23.356536Z gitpod 730
-
🗎sigplace1.article 2022-08-01T15:25:23.796536Z gitpod 80858
-
🗎Love Live! Custom Arcade Controller.article.html 2022-08-01T15:25:23.852536Z gitpod 8268
-
🗎curabitur vel tempus ex.article.html 2022-08-01T15:25:23.900536Z gitpod 8477
-
🗎sigplace1.article.html 2022-08-01T15:25:23.904536Z gitpod 88577
+

Directory Listing for /articles/

📁.. (Previous Directory)
📁test articles 2022-08-01T15:59:35.278694Z gitpod 147
+
🗎Love Live! Custom Arcade Controller.article 2022-08-01T15:59:34.742695Z gitpod 497
+
🗎curabitur vel tempus ex.article 2022-08-01T15:59:34.770695Z gitpod 730
+
🗎sigplace1.article 2022-08-01T15:59:35.210694Z gitpod 80858
+
🗎Love Live! Custom Arcade Controller.article.html 2022-08-01T15:59:35.278694Z gitpod 8626
+
🗎curabitur vel tempus ex.article.html 2022-08-01T15:59:35.306694Z gitpod 8835
+
🗎sigplace1.article.html 2022-08-01T15:59:35.318694Z gitpod 88935
diff --git a/out/articles/Love Live! Custom Arcade Controller.article.html b/out/articles/Love Live! Custom Arcade Controller.article.html index 6997f6d..cb830e1 100644 --- a/out/articles/Love Live! Custom Arcade Controller.article.html +++ b/out/articles/Love Live! Custom Arcade Controller.article.html @@ -67,6 +67,12 @@ For over a year since I first got into Love Live! School Idol Festival ~after document.getElementById("msg").disabled=false; fetchComments() }) + .catch((err)=>{ + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; + }) } function insert(c1,c2) { if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) { @@ -124,17 +130,19 @@ For over a year since I first got into Love Live! School Idol Festival ~after fetch("/COMMENTS?article=Love Live! Custom Arcade Controller.comment").then((data)=>data.text()) .then((data)=>{ data=data.split("\n"); - document.getElementById("comments").innerHTML=""; - document.getElementById("commentCounter").innerText=data[0] - for (var i=data.length-3;i>=1;i-=2) { - if (data[i].trim().length>0&&data[i+1].trim().length>0) { - document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" - data2=data[i+1].split(";"); - document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] - document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + if (!isNaN(Number(data[0]))) { + document.getElementById("comments").innerHTML=""; + document.getElementById("commentCounter").innerText=data[0] + for (var i=data.length-3;i>=1;i-=2) { + if (data[i].trim().length>0&&data[i+1].trim().length>0) { + document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" + data2=data[i+1].split(";"); + document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] + document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + } } + document.getElementById("commentContainer").style.visibility="visible" } - document.getElementById("commentContainer").style.visibility="visible" }) } fetchComments() diff --git a/out/articles/curabitur vel tempus ex.article.html b/out/articles/curabitur vel tempus ex.article.html index e449d9c..da7f984 100644 --- a/out/articles/curabitur vel tempus ex.article.html +++ b/out/articles/curabitur vel tempus ex.article.html @@ -71,6 +71,12 @@ Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut. document.getElementById("msg").disabled=false; fetchComments() }) + .catch((err)=>{ + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; + }) } function insert(c1,c2) { if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) { @@ -128,17 +134,19 @@ Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut. fetch("/COMMENTS?article=curabitur vel tempus ex.comment").then((data)=>data.text()) .then((data)=>{ data=data.split("\n"); - document.getElementById("comments").innerHTML=""; - document.getElementById("commentCounter").innerText=data[0] - for (var i=data.length-3;i>=1;i-=2) { - if (data[i].trim().length>0&&data[i+1].trim().length>0) { - document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" - data2=data[i+1].split(";"); - document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] - document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + if (!isNaN(Number(data[0]))) { + document.getElementById("comments").innerHTML=""; + document.getElementById("commentCounter").innerText=data[0] + for (var i=data.length-3;i>=1;i-=2) { + if (data[i].trim().length>0&&data[i+1].trim().length>0) { + document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" + data2=data[i+1].split(";"); + document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] + document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + } } + document.getElementById("commentContainer").style.visibility="visible" } - document.getElementById("commentContainer").style.visibility="visible" }) } fetchComments() diff --git a/out/articles/sigplace1.article.html b/out/articles/sigplace1.article.html index d1515ea..856e9f7 100644 --- a/out/articles/sigplace1.article.html +++ b/out/articles/sigplace1.article.html @@ -546,6 +546,12 @@ Here we demonstrate the love live logo. But wait, it's literally like in the mid document.getElementById("msg").disabled=false; fetchComments() }) + .catch((err)=>{ + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; + }) } function insert(c1,c2) { if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) { @@ -603,17 +609,19 @@ Here we demonstrate the love live logo. But wait, it's literally like in the mid fetch("/COMMENTS?article=sigplace1.comment").then((data)=>data.text()) .then((data)=>{ data=data.split("\n"); - document.getElementById("comments").innerHTML=""; - document.getElementById("commentCounter").innerText=data[0] - for (var i=data.length-3;i>=1;i-=2) { - if (data[i].trim().length>0&&data[i+1].trim().length>0) { - document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" - data2=data[i+1].split(";"); - document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] - document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + if (!isNaN(Number(data[0]))) { + document.getElementById("comments").innerHTML=""; + document.getElementById("commentCounter").innerText=data[0] + for (var i=data.length-3;i>=1;i-=2) { + if (data[i].trim().length>0&&data[i+1].trim().length>0) { + document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" + data2=data[i+1].split(";"); + document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] + document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + } } + document.getElementById("commentContainer").style.visibility="visible" } - document.getElementById("commentContainer").style.visibility="visible" }) } fetchComments() diff --git a/out/articles/test articles/DIRECTORY_LISTING b/out/articles/test articles/DIRECTORY_LISTING index 6950a20..aab4e92 100644 --- a/out/articles/test articles/DIRECTORY_LISTING +++ b/out/articles/test articles/DIRECTORY_LISTING @@ -17,12 +17,12 @@
-

Directory Listing for /articles/test articles/

🗎test1.article 2022-08-01T15:25:23.312536Z gitpod 1085
-
🗎test2.article 2022-08-01T15:25:23.316536Z gitpod 781
-
🗎test3.article 2022-08-01T15:25:23.316536Z gitpod 994
-
🗎test1.article.html 2022-08-01T15:25:23.844536Z gitpod 8796
-
🗎test2.article.html 2022-08-01T15:25:23.848536Z gitpod 8492
-
🗎test3.article.html 2022-08-01T15:25:23.848536Z gitpod 8705
+

Directory Listing for /articles/test articles/

🗎test1.article 2022-08-01T15:59:34.738695Z gitpod 1085
+
🗎test2.article 2022-08-01T15:59:34.738695Z gitpod 781
+
🗎test3.article 2022-08-01T15:59:34.742695Z gitpod 994
+
🗎test1.article.html 2022-08-01T15:59:35.266694Z gitpod 9154
+
🗎test2.article.html 2022-08-01T15:59:35.274694Z gitpod 8850
+
🗎test3.article.html 2022-08-01T15:59:35.278694Z gitpod 9063
diff --git a/out/articles/test articles/test1.article.html b/out/articles/test articles/test1.article.html index 13cbbc1..57f387f 100644 --- a/out/articles/test articles/test1.article.html +++ b/out/articles/test articles/test1.article.html @@ -65,6 +65,12 @@ document.getElementById("msg").disabled=false; fetchComments() }) + .catch((err)=>{ + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; + }) } function insert(c1,c2) { if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) { @@ -122,17 +128,19 @@ fetch("/COMMENTS?article=test1.comment").then((data)=>data.text()) .then((data)=>{ data=data.split("\n"); - document.getElementById("comments").innerHTML=""; - document.getElementById("commentCounter").innerText=data[0] - for (var i=data.length-3;i>=1;i-=2) { - if (data[i].trim().length>0&&data[i+1].trim().length>0) { - document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" - data2=data[i+1].split(";"); - document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] - document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + if (!isNaN(Number(data[0]))) { + document.getElementById("comments").innerHTML=""; + document.getElementById("commentCounter").innerText=data[0] + for (var i=data.length-3;i>=1;i-=2) { + if (data[i].trim().length>0&&data[i+1].trim().length>0) { + document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" + data2=data[i+1].split(";"); + document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] + document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + } } + document.getElementById("commentContainer").style.visibility="visible" } - document.getElementById("commentContainer").style.visibility="visible" }) } fetchComments() diff --git a/out/articles/test articles/test2.article.html b/out/articles/test articles/test2.article.html index 70c2df5..90ae303 100644 --- a/out/articles/test articles/test2.article.html +++ b/out/articles/test articles/test2.article.html @@ -65,6 +65,12 @@ document.getElementById("msg").disabled=false; fetchComments() }) + .catch((err)=>{ + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; + }) } function insert(c1,c2) { if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) { @@ -122,17 +128,19 @@ fetch("/COMMENTS?article=test2.comment").then((data)=>data.text()) .then((data)=>{ data=data.split("\n"); - document.getElementById("comments").innerHTML=""; - document.getElementById("commentCounter").innerText=data[0] - for (var i=data.length-3;i>=1;i-=2) { - if (data[i].trim().length>0&&data[i+1].trim().length>0) { - document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" - data2=data[i+1].split(";"); - document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] - document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + if (!isNaN(Number(data[0]))) { + document.getElementById("comments").innerHTML=""; + document.getElementById("commentCounter").innerText=data[0] + for (var i=data.length-3;i>=1;i-=2) { + if (data[i].trim().length>0&&data[i+1].trim().length>0) { + document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" + data2=data[i+1].split(";"); + document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] + document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + } } + document.getElementById("commentContainer").style.visibility="visible" } - document.getElementById("commentContainer").style.visibility="visible" }) } fetchComments() diff --git a/out/articles/test articles/test3.article.html b/out/articles/test articles/test3.article.html index 372a7f6..ec79795 100644 --- a/out/articles/test articles/test3.article.html +++ b/out/articles/test articles/test3.article.html @@ -65,6 +65,12 @@ document.getElementById("msg").disabled=false; fetchComments() }) + .catch((err)=>{ + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; + }) } function insert(c1,c2) { if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) { @@ -122,17 +128,19 @@ fetch("/COMMENTS?article=test3.comment").then((data)=>data.text()) .then((data)=>{ data=data.split("\n"); - document.getElementById("comments").innerHTML=""; - document.getElementById("commentCounter").innerText=data[0] - for (var i=data.length-3;i>=1;i-=2) { - if (data[i].trim().length>0&&data[i+1].trim().length>0) { - document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" - data2=data[i+1].split(";"); - document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] - document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + if (!isNaN(Number(data[0]))) { + document.getElementById("comments").innerHTML=""; + document.getElementById("commentCounter").innerText=data[0] + for (var i=data.length-3;i>=1;i-=2) { + if (data[i].trim().length>0&&data[i+1].trim().length>0) { + document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" + data2=data[i+1].split(";"); + document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] + document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + } } + document.getElementById("commentContainer").style.visibility="visible" } - document.getElementById("commentContainer").style.visibility="visible" }) } fetchComments() diff --git a/out/codeBackground b/out/codeBackground index 9e16ede..c5a43b9 100644 --- a/out/codeBackground +++ b/out/codeBackground @@ -12,6 +12,7 @@ String filename=null; OutputStream stream = null; requestLine=in.readLine(); //Read the first line, this should be our request. + System.out.println(requestLine); if (requestLine!=null) { String[] splitter = requestLine.split(Pattern.quote(" ")); boolean ISPOST = splitter[0].equals("POST"); @@ -37,4 +38,3 @@ System.out.println(line); } } else { - File myFile = new File(new File(sigPlace.OUTDIR,sigPlace.UPLOADSDIR),filename); diff --git a/ref/COMMENT.html b/ref/COMMENT.html index cfb202d..a31b198 100644 --- a/ref/COMMENT.html +++ b/ref/COMMENT.html @@ -21,6 +21,12 @@ document.getElementById("msg").disabled=false; fetchComments() }) + .catch((err)=>{ + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; + }) } function insert(c1,c2) { if (document.getElementById("msg").selectionStart==document.getElementById("msg").selectionEnd) { @@ -78,17 +84,19 @@ fetch("/COMMENTS?article=$ARTICLE.comment").then((data)=>data.text()) .then((data)=>{ data=data.split("\n"); - document.getElementById("comments").innerHTML=""; - document.getElementById("commentCounter").innerText=data[0] - for (var i=data.length-3;i>=1;i-=2) { - if (data[i].trim().length>0&&data[i+1].trim().length>0) { - document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" - data2=data[i+1].split(";"); - document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] - document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + if (!isNaN(Number(data[0]))) { + document.getElementById("comments").innerHTML=""; + document.getElementById("commentCounter").innerText=data[0] + for (var i=data.length-3;i>=1;i-=2) { + if (data[i].trim().length>0&&data[i+1].trim().length>0) { + document.getElementById("comments").innerHTML+="
"+decodeURIComponent(data[i])+"

" + data2=data[i+1].split(";"); + document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1] + document.getElementById("comments").innerHTML+="
- "+decodeURIComponent(data2[0])+"

" + } } + document.getElementById("commentContainer").style.visibility="visible" } - document.getElementById("commentContainer").style.visibility="visible" }) } fetchComments() diff --git a/sigServer.java b/sigServer.java index 5db0dc3..52986f8 100644 --- a/sigServer.java +++ b/sigServer.java @@ -462,16 +462,16 @@ public class sigServer { } System.out.println("Sent "+file+" to client "+client+"."); } else { + System.out.println("Did not find "+file+". Sending an error instead."); file=Paths.get(sigPlace.OUTDIR,"error.html"); - CreateRawRequest(clientOutput,statusCode,statusMsg,Files.probeContentType(file),Files.readAllBytes(file),Files.getLastModifiedTime(file)); + CreateRawRequest(clientOutput,"404",statusMsg,Files.probeContentType(file),Files.readAllBytes(file),Files.getLastModifiedTime(file)); String contentType = Files.probeContentType(file); if (contentType!=null&&contentType.equals("text/html")) { clientOutput.write(("
Webpage generated in "+(System.currentTimeMillis()-startTime)+"ms
\r\n").getBytes()); } } } else { - file=Paths.get(sigPlace.OUTDIR,"error.html"); - CreateRawRequest(clientOutput,"404",statusMsg,Files.probeContentType(file),Files.readAllBytes(file),Files.getLastModifiedTime(file)); + CreateRawRequest(clientOutput,statusCode,statusMsg,Files.probeContentType(file),Files.readAllBytes(file),Files.getLastModifiedTime(file)); String contentType = Files.probeContentType(file); if (contentType!=null&&contentType.equals("text/html")) { clientOutput.write(("
Webpage generated in "+(System.currentTimeMillis()-startTime)+"ms
\r\n").getBytes());