From cdda342bcc4eb41433a8b68ada21a4830f17ebc2 Mon Sep 17 00:00:00 2001 From: "P. Warren Groves Jr." Date: Mon, 14 Jul 2025 20:21:18 -0500 Subject: [PATCH 1/9] initial commit --- index.html | 0 main.js | 0 style.css | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 index.html create mode 100644 main.js create mode 100644 style.css diff --git a/index.html b/index.html new file mode 100644 index 00000000..e69de29b diff --git a/main.js b/main.js new file mode 100644 index 00000000..e69de29b diff --git a/style.css b/style.css new file mode 100644 index 00000000..e69de29b From 792d5cfec5393eafaadfeebf5b38fbc695c2120a Mon Sep 17 00:00:00 2001 From: "P. Warren Groves Jr." Date: Mon, 14 Jul 2025 21:26:17 -0500 Subject: [PATCH 2/9] title message board and inputs framework laid --- index.html | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/index.html b/index.html index e69de29b..1f2f5d9c 100644 --- a/index.html +++ b/index.html @@ -0,0 +1,34 @@ + + + + + + + ReReddit + + +
+
+
ReReddit
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+ + From ab9b4d11ed5923ed4d53c572c5941048556c668a Mon Sep 17 00:00:00 2001 From: "P. Warren Groves Jr." Date: Tue, 15 Jul 2025 21:56:21 -0500 Subject: [PATCH 3/9] structure finished no functionality html linked with js --- index.html | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 1f2f5d9c..156dc29d 100644 --- a/index.html +++ b/index.html @@ -10,23 +10,29 @@ crossorigin="anonymous" /> ReReddit +
-
-
ReReddit
+
+
ReReddit
+
+
+
-
+
+ +
-
- +
+
-
- +
+
From 4ab3afd600a0889223aa48ab59429321023e7d7a Mon Sep 17 00:00:00 2001 From: "P. Warren Groves Jr." Date: Thu, 17 Jul 2025 23:26:43 -0500 Subject: [PATCH 4/9] basic message board function working --- index.html | 22 ++++++++++++++++------ main.js | 8 ++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 156dc29d..e58eb14d 100644 --- a/index.html +++ b/index.html @@ -17,22 +17,32 @@
ReReddit
-
-
-
+
- +
- +
- +
diff --git a/main.js b/main.js index e69de29b..3734e289 100644 --- a/main.js +++ b/main.js @@ -0,0 +1,8 @@ +var messageBoard = document.getElementById("message-board") +var userName = document.getElementById("your-name"); +var postText = document.getElementById("post-text"); +const btn = document.getElementById("btn"); + +btn.addEventListener("click", function () { + messageBoard.insertAdjacentHTML("beforeend", `
${postText.value} - Posted By: ${userName.value}
`) +}) \ No newline at end of file From 721437fd3495880ae420969ee8eae5b1c79a6457 Mon Sep 17 00:00:00 2001 From: "P. Warren Groves Jr." Date: Tue, 22 Jul 2025 21:21:43 -0500 Subject: [PATCH 5/9] inputs posting and resetting after clicking submit --- main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 3734e289..5544728a 100644 --- a/main.js +++ b/main.js @@ -4,5 +4,8 @@ var postText = document.getElementById("post-text"); const btn = document.getElementById("btn"); btn.addEventListener("click", function () { - messageBoard.insertAdjacentHTML("beforeend", `
${postText.value} - Posted By: ${userName.value}
`) + messageBoard.insertAdjacentHTML("beforeend", `
${postText.value} - Posted By: ${userName.value}
`); + + userName.value = ''; + postText.value = ''; }) \ No newline at end of file From 693a490765068c56e6d8316aa862f3942501c821 Mon Sep 17 00:00:00 2001 From: "P. Warren Groves Jr." Date: Wed, 23 Jul 2025 00:56:24 -0500 Subject: [PATCH 6/9] added collapsible feature for comment thread but nonfunctional --- index.html | 16 ++++++++++++---- main.js | 42 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index e58eb14d..f4ff6ab8 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,10 @@ integrity="sha384-LN+7fdVzj6u52u30Kp6M/trliBMCMKTyK833zpbD+pXdCLuTusPj697FH4R/5mcr" crossorigin="anonymous" /> + ReReddit @@ -20,12 +24,11 @@
- + >
@@ -40,11 +43,16 @@
-
+ diff --git a/main.js b/main.js index 5544728a..ced5baac 100644 --- a/main.js +++ b/main.js @@ -1,11 +1,49 @@ var messageBoard = document.getElementById("message-board") +let clickCount = 0; var userName = document.getElementById("your-name"); var postText = document.getElementById("post-text"); const btn = document.getElementById("btn"); +const reply = document.getElementById("reply-thread"); btn.addEventListener("click", function () { - messageBoard.insertAdjacentHTML("beforeend", `
${postText.value} - Posted By: ${userName.value}
`); + clickCount++; + + messageBoard.insertAdjacentHTML("beforeend", ` +
+ + + ${postText.value} - Posted By: ${userName.value} +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
`); userName.value = ''; postText.value = ''; -}) \ No newline at end of file +}); \ No newline at end of file From d88765734a95f1e7aa47c6a5ad103adb1fdca223 Mon Sep 17 00:00:00 2001 From: "P. Warren Groves Jr." Date: Wed, 23 Jul 2025 01:08:49 -0500 Subject: [PATCH 7/9] added collapsible feature for comment thread but nonfunctional - corrected --- index.html | 2 +- main.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index f4ff6ab8..2e5766ca 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,7 @@
-
diff --git a/main.js b/main.js index ced5baac..24cadd68 100644 --- a/main.js +++ b/main.js @@ -2,10 +2,10 @@ var messageBoard = document.getElementById("message-board") let clickCount = 0; var userName = document.getElementById("your-name"); var postText = document.getElementById("post-text"); -const btn = document.getElementById("btn"); +const submitPost = document.getElementById("submitPost"); const reply = document.getElementById("reply-thread"); -btn.addEventListener("click", function () { +submitPost.addEventListener("click", function () { clickCount++; messageBoard.insertAdjacentHTML("beforeend", ` @@ -16,7 +16,7 @@ btn.addEventListener("click", function () {
-
+
-
+
-
+
diff --git a/main.js b/main.js index 24cadd68..21a0d34a 100644 --- a/main.js +++ b/main.js @@ -1,49 +1,74 @@ -var messageBoard = document.getElementById("message-board") -let clickCount = 0; -var userName = document.getElementById("your-name"); -var postText = document.getElementById("post-text"); +// To do: +// 1. Add event listener to delete posts and comments. + +var posts = document.getElementById("posts") +let postCount = 0; +var poster = document.getElementById("poster"); +var post = document.getElementById("post"); const submitPost = document.getElementById("submitPost"); -const reply = document.getElementById("reply-thread"); submitPost.addEventListener("click", function () { - clickCount++; - - messageBoard.insertAdjacentHTML("beforeend", ` -
- - - ${postText.value} - Posted By: ${userName.value} -
-
-
-
- + if (post.value === '' && poster.value === '') { + alert('Oops! Looks like you hit submit by accident. Make sure you add your post text and name below.') + } else { + postCount++; + + posts.insertAdjacentHTML("beforeend", ` +
+ + + ${post.value} - Posted By: ${poster.value} +
+
+
+
+ +
-
-
-
- +
+
+ +
-
-
-
- +
+
+ +
-
-
`); - - userName.value = ''; - postText.value = ''; +
`); + + poster.value = ''; + post.value = ''; + + var comments = document.getElementById(`post${postCount}-comments`) + let commentCount = 0; + var commenter = document.getElementById(`post${postCount}-commenter`); + var comment = document.getElementById(`post${postCount}-comment`); + const submitComment = document.getElementById(`post${postCount}-submitComment`); + + submitComment.addEventListener("click", function () { + commentCount++; + + comments.insertAdjacentHTML("beforeend", ` +
+ + ${comment.value} - Posted By: ${commenter.value} +
`); + + comment.value = ''; + commenter.value = ''; + }); + }; }); \ No newline at end of file From 8f1b7000f0e93cc053d6f77a842ad48046f7868a Mon Sep 17 00:00:00 2001 From: "P. Warren Groves Jr." Date: Sat, 26 Jul 2025 18:36:49 -0500 Subject: [PATCH 9/9] completed project - no extensions --- index.html | 2 +- main.js | 34 ++++++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 1b37113e..7029a4d0 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@
ReReddit
-
+