2022-05-02 21:03:16 -05:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/reset.css">
|
|
|
|
<link rel="stylesheet" type="text/css" href="/sig.css">
|
2022-05-04 14:01:54 +00:00
|
|
|
<meta charset="UTF-8">
|
2022-05-02 21:03:16 -05:00
|
|
|
<script type="text/javascript">
|
|
|
|
function loadCodeBackground() {
|
2022-05-04 18:46:53 +00:00
|
|
|
fetch("/codeBackground").then((data)=>data.text())
|
2022-05-02 21:03:16 -05:00
|
|
|
.then((data)=>{
|
|
|
|
document.getElementById("codeForeground").innerText=data
|
|
|
|
document.getElementById("codeBackground").innerText=data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
loadCodeBackground();
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-06-03 19:35:03 +00:00
|
|
|
<div class="contentBody">
|
2022-05-02 21:03:16 -05:00
|
|
|
This is a different webpage.<hr>
|
2022-07-26 15:24:41 +00:00
|
|
|
$ARTICLE_PREVIEW sigplace1
|
|
|
|
$ARTICLE_PREVIEW test articles/test1
|
|
|
|
$ARTICLE_PREVIEW test articles/test2
|
|
|
|
$ARTICLE_PREVIEW test articles/test3
|
|
|
|
$ARTICLE_PREVIEW curabitur vel tempus ex
|
2022-05-03 14:58:01 +00:00
|
|
|
</div> <!--End Content Body-->
|
2022-05-02 21:03:16 -05:00
|
|
|
<div class="codeForeground" id="codeForeground"></div>
|
|
|
|
<div class="codeBackground" id="codeBackground"></div>
|
|
|
|
</body>
|
|
|
|
<footer>
|
|
|
|
</footer>
|
|
|
|
</html>
|
2022-07-26 18:40:28 +00:00
|
|
|
<hr/>
|
2022-07-27 18:25:24 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
function changeColor() {
|
|
|
|
document.getElementById("submit").style.borderColor=document.getElementById("msg").style.borderColor=document.getElementById("name").style.borderColor=document.getElementById("col").style.borderColor=document.getElementById("col").options[document.getElementById("col").selectedIndex].text
|
|
|
|
}
|
|
|
|
function submit() {
|
|
|
|
document.getElementById("submit").disabled=
|
|
|
|
document.getElementById("name").disabled=
|
|
|
|
document.getElementById("col").disabled=
|
|
|
|
document.getElementById("msg").disabled=true;
|
|
|
|
fetch("/COMMENTS?submit=true&article=otherpage.html.comment&message="+encodeURIComponent(document.getElementById("msg").value)+"&name="
|
2022-07-27 19:44:20 +00:00
|
|
|
+encodeURIComponent(document.getElementById("name").value)+"&color="
|
2022-07-27 18:25:24 +00:00
|
|
|
+encodeURIComponent(document.getElementById("col").options[document.getElementById("col").selectedIndex].text)
|
|
|
|
).then((data)=>data.text())
|
|
|
|
.then((data)=>{
|
2022-07-27 20:20:09 +00:00
|
|
|
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;
|
2022-07-27 18:25:24 +00:00
|
|
|
fetchComments()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<div id="commentForm">
|
|
|
|
<b>Leave a comment!</b><br/><br/>
|
|
|
|
<label for="name">Display Name: </label><input id="name"><br/><br/>
|
|
|
|
<label for="col">Display Color: </label><select id="col" onchange="changeColor()">
|
|
|
|
<option value="RED">RED</option>
|
|
|
|
<option value="GREEN" selected>GREEN</option>
|
|
|
|
<option value="YELLOW">YELLOW</option>
|
|
|
|
<option value="BLUE">BLUE</option>
|
|
|
|
<option value="MAGENTA">MAGENTA</option>
|
|
|
|
<option value="CYAN">CYAN</option>
|
|
|
|
<option value="WHITE">WHITE</option>
|
|
|
|
</select><br/><br/>
|
|
|
|
<label for="msg" style="vertical-align:top;display:inline;">Message: </label><textarea id="msg"></textarea><br/><br/>
|
2022-07-27 19:52:12 +00:00
|
|
|
<button id="submit" onclick="submit()">POST</button>
|
2022-07-27 18:25:24 +00:00
|
|
|
</div><br/><br/>
|
2022-07-26 19:19:57 +00:00
|
|
|
<div id="commentContainer" style="visibility:hidden;">
|
2022-07-27 18:25:24 +00:00
|
|
|
<h2>Comments <sub>(<span class="commentCounter" id="commentCounter">0</span>)</sub></h2>
|
2022-07-26 19:19:57 +00:00
|
|
|
<div class="comments" id="comments"></div>
|
|
|
|
</div>
|
2022-07-26 18:40:28 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
function fetchComments() {
|
2022-07-26 19:10:12 +00:00
|
|
|
fetch("/COMMENTS?article=otherpage.html.comment").then((data)=>data.text())
|
2022-07-26 18:40:28 +00:00
|
|
|
.then((data)=>{
|
2022-07-26 19:10:12 +00:00
|
|
|
data=data.split("\n");
|
2022-07-27 18:25:24 +00:00
|
|
|
document.getElementById("comments").innerHTML="";
|
2022-07-27 20:20:09 +00:00
|
|
|
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+="<div id=\"msg"+((i+1)/2)+"\" class=\"commentDisplayer\"><div class=\"commentData\">"+decodeURIComponent(data[i])+"</div><br>"
|
|
|
|
data2=data[i+1].split(";");
|
|
|
|
document.getElementById("msg"+((i+1)/2)).style.borderColor=data2[1]
|
|
|
|
document.getElementById("comments").innerHTML+="<div class=\"commentInfo\"><sup>- "+decodeURIComponent(data2[0])+"</sup></div></div><br>"
|
2022-07-26 19:19:57 +00:00
|
|
|
}
|
2022-07-26 19:10:12 +00:00
|
|
|
}
|
2022-07-26 19:19:57 +00:00
|
|
|
document.getElementById("commentContainer").style.visibility="visible"
|
2022-07-26 18:40:28 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
fetchComments()
|
2022-07-27 19:52:12 +00:00
|
|
|
changeColor()
|
2022-07-26 18:40:28 +00:00
|
|
|
</script>
|