diff --git a/comments/sigplace1.comment b/comments/sigplace1.comment index b618cc3..76e348b 100644 --- a/comments/sigplace1.comment +++ b/comments/sigplace1.comment @@ -1,4 +1,4 @@ -5 +17 That is a great idea! username,17May2021 08:29:10;GREEN That is a great idea! <p>There used to be folks I worked with who would use the same technique, and it worked great!</p> @@ -8,4 +8,28 @@ username,17May2021 08:29:10;WHITE That is a great idea! username,17May2021 08:29:10;WHITE That is a great idea! -username,17May2021 08:29:10;BLUE \ No newline at end of file +username,17May2021 08:29:10;BLUE +Test%20Post! +Sig,2022-07-27T19:58:15.795757Z[Etc/UTC];GREEN +test2 +Sig22022-07-27T20:04:47.688373Z[Etc/UTC];MAGENTA +Hello%20World! +Test%20Name2022-07-27T20:11:39.437544Z[Etc/UTC];RED +Hello%20World! +Test%20Name2022-07-27T20:12:53.276316Z[Etc/UTC];RED +Great%20article!%20Thanks%20for%20that! +Anonymous2022-07-27T20:14:53.796103Z[Etc/UTC];CYAN +test%20%0A%0Amultiple%20new%20lines%0A%0Ayeah%3F +testing2022-07-27T20:15:38.907522Z[Etc/UTC];CYAN +vdsavdsa%0A%0Avdsavdsa%0Asf%0A%0A%0A%0Avdsavdsa +fdsavdsa2022-07-27T20:17:44.148397Z[Etc/UTC];CYAN +bdsabdsa%20fdsa

vdsavdsa


vdsavdsa +vdsavdsa2022-07-27T20:18:09.917699Z[Etc/UTC];CYAN +%3Cb%3ETest%3C%2Fb%3E +bdsabdsa2022-07-27T20:18:24.565649Z[Etc/UTC];WHITE +%3Cdiv%3ETesting%202%3C%2Fdiv%3E +bdsabdsabdsa2022-07-27T20:18:37.856524Z[Etc/UTC];WHITE +%3Cfont%20color%3D%22red%22%3ETesting3%3C%2Ffont%3E +dsavbsabva2022-07-27T20:18:48.676512Z[Etc/UTC];WHITE +<i%3ETest4<%2Fi%3E +bdsabdasbdsa2022-07-27T20:19:25.201305Z[Etc/UTC];WHITE diff --git a/out/DIRECTORY_LISTING b/out/DIRECTORY_LISTING index 56b289d..c101408 100644 --- a/out/DIRECTORY_LISTING +++ b/out/DIRECTORY_LISTING @@ -17,14 +17,14 @@
-

Directory Listing for /

📁.. (Previous Directory)
📁articles 2022-07-27T19:51:46.517005Z gitpod 4096
-
🗎codeBackground 2022-07-27T19:51:46.433006Z gitpod 5925
-
📁images 2022-07-27T19:51:46.513005Z gitpod 58
-
🗎otherpage.html 2022-07-27T19:51:46.437006Z gitpod 4229
-
🗎reset.css 2022-07-27T19:51:46.437006Z gitpod 4372
-
🗎sig.css 2022-07-27T19:51:46.449006Z gitpod 12414
-
🗎testfile.html 2022-07-27T19:51:46.461006Z gitpod 4090
-
🗎uploadform.html 2022-07-27T19:51:46.461006Z gitpod 4174
+

Directory Listing for /

📁.. (Previous Directory)
📁articles 2022-07-27T20:19:17.211497Z gitpod 4096
+
🗎codeBackground 2022-07-27T20:19:17.091497Z gitpod 6097
+
📁images 2022-07-27T20:19:17.203497Z gitpod 58
+
🗎otherpage.html 2022-07-27T20:19:17.091497Z gitpod 4401
+
🗎reset.css 2022-07-27T20:19:17.095497Z gitpod 4544
+
🗎sig.css 2022-07-27T20:19:17.103497Z gitpod 12586
+
🗎testfile.html 2022-07-27T20:19:17.111497Z gitpod 4262
+
🗎uploadform.html 2022-07-27T20:19:17.115497Z gitpod 4346
diff --git a/out/articles/DIRECTORY_LISTING b/out/articles/DIRECTORY_LISTING index afe004b..553e055 100644 --- a/out/articles/DIRECTORY_LISTING +++ b/out/articles/DIRECTORY_LISTING @@ -17,13 +17,13 @@
-

Directory Listing for /articles/

📁.. (Previous Directory)
🗎Love Live! Custom Arcade Controller.article 2022-07-27T19:51:46.021006Z gitpod 3829
-
🗎curabitur vel tempus ex.article 2022-07-27T19:51:46.045006Z gitpod 4038
-
🗎sigplace1.article 2022-07-27T19:51:46.425006Z gitpod 84138
-
📁test articles 2022-07-27T19:51:46.505005Z gitpod 147
-
🗎Love Live! Custom Arcade Controller.article.html 2022-07-27T19:51:46.465006Z gitpod 4546
-
🗎curabitur vel tempus ex.article.html 2022-07-27T19:51:46.477006Z gitpod 4755
-
🗎sigplace1.article.html 2022-07-27T19:51:46.497005Z gitpod 84855
+

Directory Listing for /articles/

📁.. (Previous Directory)
🗎Love Live! Custom Arcade Controller.article 2022-07-27T20:19:16.655497Z gitpod 4001
+
🗎curabitur vel tempus ex.article 2022-07-27T20:19:16.679497Z gitpod 4210
+
🗎sigplace1.article 2022-07-27T20:19:17.083497Z gitpod 84310
+
📁test articles 2022-07-27T20:19:17.147497Z gitpod 147
+
🗎Love Live! Custom Arcade Controller.article.html 2022-07-27T20:19:17.119497Z gitpod 4718
+
🗎curabitur vel tempus ex.article.html 2022-07-27T20:19:17.127497Z gitpod 4927
+
🗎sigplace1.article.html 2022-07-27T20:19:17.139497Z gitpod 85027
diff --git a/out/articles/Love Live! Custom Arcade Controller.article b/out/articles/Love Live! Custom Arcade Controller.article index 46628ba..318aabc 100644 --- a/out/articles/Love Live! Custom Arcade Controller.article +++ b/out/articles/Love Live! Custom Arcade Controller.article @@ -20,6 +20,12 @@ For over a year since I first got into Love Live! School Idol Festival ~after +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -49,19 +55,13 @@ For over a year since I first got into Love Live! School Idol Festival ~after .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/Love Live! Custom Arcade Controller.article.html b/out/articles/Love Live! Custom Arcade Controller.article.html index b4c368d..e1556de 100644 --- a/out/articles/Love Live! Custom Arcade Controller.article.html +++ b/out/articles/Love Live! Custom Arcade Controller.article.html @@ -39,6 +39,12 @@ For over a year since I first got into Love Live! School Idol Festival ~after +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -68,19 +74,13 @@ For over a year since I first got into Love Live! School Idol Festival ~after .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/curabitur vel tempus ex.article b/out/articles/curabitur vel tempus ex.article index 1f7fb32..91652f1 100644 --- a/out/articles/curabitur vel tempus ex.article +++ b/out/articles/curabitur vel tempus ex.article @@ -24,6 +24,12 @@ Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut. +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -53,19 +59,13 @@ Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut. .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/curabitur vel tempus ex.article.html b/out/articles/curabitur vel tempus ex.article.html index a042068..41e23a0 100644 --- a/out/articles/curabitur vel tempus ex.article.html +++ b/out/articles/curabitur vel tempus ex.article.html @@ -43,6 +43,12 @@ Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut. +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -72,19 +78,13 @@ Curabitur vel tempus ex. Duis cursus sapien nisl, ut pulvinar dui porttitor ut. .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/sigplace1.article b/out/articles/sigplace1.article index 9689e11..d252a41 100644 --- a/out/articles/sigplace1.article +++ b/out/articles/sigplace1.article @@ -499,6 +499,12 @@ Here we demonstrate the love live logo. But wait, it's literally like in the mid +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -528,19 +534,13 @@ Here we demonstrate the love live logo. But wait, it's literally like in the mid .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/sigplace1.article.html b/out/articles/sigplace1.article.html index de4d4cc..4d5752e 100644 --- a/out/articles/sigplace1.article.html +++ b/out/articles/sigplace1.article.html @@ -518,6 +518,12 @@ Here we demonstrate the love live logo. But wait, it's literally like in the mid +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -547,19 +553,13 @@ Here we demonstrate the love live logo. But wait, it's literally like in the mid .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/test articles/DIRECTORY_LISTING b/out/articles/test articles/DIRECTORY_LISTING index 2bde36b..9661e74 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-07-27T19:51:46.429006Z gitpod 4357
-
🗎test2.article 2022-07-27T19:51:46.429006Z gitpod 4053
-
🗎test3.article 2022-07-27T19:51:46.429006Z gitpod 4266
-
🗎test1.article.html 2022-07-27T19:51:46.501005Z gitpod 5074
-
🗎test2.article.html 2022-07-27T19:51:46.501005Z gitpod 4770
-
🗎test3.article.html 2022-07-27T19:51:46.505005Z gitpod 4983
+

Directory Listing for /articles/test articles/

🗎test1.article 2022-07-27T20:19:17.087497Z gitpod 4529
+
🗎test2.article 2022-07-27T20:19:17.087497Z gitpod 4225
+
🗎test3.article 2022-07-27T20:19:17.087497Z gitpod 4438
+
🗎test1.article.html 2022-07-27T20:19:17.139497Z gitpod 5246
+
🗎test2.article.html 2022-07-27T20:19:17.143497Z gitpod 4942
+
🗎test3.article.html 2022-07-27T20:19:17.147497Z gitpod 5155
diff --git a/out/articles/test articles/test1.article b/out/articles/test articles/test1.article index fd33c0b..6321b7f 100644 --- a/out/articles/test articles/test1.article +++ b/out/articles/test articles/test1.article @@ -18,6 +18,12 @@ +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -47,19 +53,13 @@ .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/test articles/test1.article.html b/out/articles/test articles/test1.article.html index b97c731..06152b8 100644 --- a/out/articles/test articles/test1.article.html +++ b/out/articles/test articles/test1.article.html @@ -37,6 +37,12 @@ +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -66,19 +72,13 @@ .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/test articles/test2.article b/out/articles/test articles/test2.article index 50d7b67..d13d3a2 100644 --- a/out/articles/test articles/test2.article +++ b/out/articles/test articles/test2.article @@ -18,6 +18,12 @@ +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -47,19 +53,13 @@ .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/test articles/test2.article.html b/out/articles/test articles/test2.article.html index b361ad2..7fc37f0 100644 --- a/out/articles/test articles/test2.article.html +++ b/out/articles/test articles/test2.article.html @@ -37,6 +37,12 @@ +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -66,19 +72,13 @@ .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/test articles/test3.article b/out/articles/test articles/test3.article index ad7e3d6..a64d833 100644 --- a/out/articles/test articles/test3.article +++ b/out/articles/test articles/test3.article @@ -18,6 +18,12 @@ +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -47,19 +53,13 @@ .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/articles/test articles/test3.article.html b/out/articles/test articles/test3.article.html index 624c63e..a00280a 100644 --- a/out/articles/test articles/test3.article.html +++ b/out/articles/test articles/test3.article.html @@ -37,6 +37,12 @@ +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -66,19 +72,13 @@ .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/otherpage.html b/out/otherpage.html index 0fb94bd..3dd0a2c 100644 --- a/out/otherpage.html +++ b/out/otherpage.html @@ -45,6 +45,12 @@ $ARTICLE_PREVIEW curabitur vel tempus ex +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -74,19 +80,13 @@ $ARTICLE_PREVIEW curabitur vel tempus ex .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/reset.css b/out/reset.css index 85236c9..a216953 100644 --- a/out/reset.css +++ b/out/reset.css @@ -60,6 +60,12 @@ table { +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -89,19 +95,13 @@ table { .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/sig.css b/out/sig.css index 054b3c2..7ce5805 100644 --- a/out/sig.css +++ b/out/sig.css @@ -388,6 +388,12 @@ textarea:disabled{ +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -417,19 +423,13 @@ textarea:disabled{ .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/testfile.html b/out/testfile.html index 249f1e2..5477544 100644 --- a/out/testfile.html +++ b/out/testfile.html @@ -44,6 +44,12 @@ SigPlace +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -73,19 +79,13 @@ SigPlace .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/out/uploadform.html b/out/uploadform.html index fe5bf34..6acaee4 100644 --- a/out/uploadform.html +++ b/out/uploadform.html @@ -44,6 +44,12 @@ SigPlace +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -73,19 +79,13 @@ SigPlace .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/ref/COMMENT.html b/ref/COMMENT.html index a56d615..f8bc36f 100644 --- a/ref/COMMENT.html +++ b/ref/COMMENT.html @@ -13,6 +13,12 @@ +encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text) ).then((data)=>data.text()) .then((data)=>{ + document.getElementById("msg").value="" + document.getElementById("name").value="" + document.getElementById("submit").disabled= + document.getElementById("name").disabled= + document.getElementById("col").disabled= + document.getElementById("msg").disabled=false; fetchComments() }) } @@ -42,19 +48,13 @@ .then((data)=>{ data=data.split("\n"); document.getElementById("comments").innerHTML=""; - for (var i=0;i0) { - if (i%2==1) { - document.getElementById("comments").innerHTML+="
"+data[i]+"

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

" - } - } + 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" diff --git a/sigServer.java b/sigServer.java index b5ecc93..68365ac 100644 --- a/sigServer.java +++ b/sigServer.java @@ -8,17 +8,21 @@ import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; import java.net.URLDecoder; +import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; import java.nio.file.attribute.FileTime; import java.time.Instant; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.regex.Pattern; public class sigServer { @@ -139,7 +143,19 @@ public class sigServer { file = Paths.get(sigPlace.OUTDIR,location); } if (location.equals("COMMENTS")&&requestParams.containsKey("message")&&requestParams.containsKey("name")&&requestParams.containsKey("color")) { - System.out.println(requestParams); + //System.out.println(requestParams); + String finalMsg = requestParams.get("message").replaceAll(Pattern.quote("%0A"),"
").replaceAll(Pattern.quote("%3C"),"<"); + if (Files.exists(Paths.get(sigPlace.COMMENTSDIR,requestParams.get("article")))) { + List data = Files.readAllLines(Paths.get(sigPlace.COMMENTSDIR,requestParams.get("article"))); + data.set(0,Integer.toString(Integer.parseInt(data.get(0))+1)); + data.add(finalMsg+"\n"+requestParams.get("name")+ZonedDateTime.now()+";"+requestParams.get("color")); + Files.write(Paths.get(sigPlace.COMMENTSDIR,requestParams.get("article")), data, StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE); + } else { + List data = new ArrayList(); + data.add("1"); + data.add(finalMsg+"\n"+requestParams.get("name")+ZonedDateTime.now()+";"+requestParams.get("color")); + Files.write(Paths.get(sigPlace.COMMENTSDIR,requestParams.get("article")), data, StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE,StandardOpenOption.CREATE_NEW); + } CreateRequest(client,"200","OK",Paths.get(sigPlace.OUTDIR,"testfile.html")); } else { if (modifiedDate==null||Files.exists(file)&&modifiedDate.isBefore(GetLastModifiedDate(file)))