~jpgleeson/caint

58374fc4c69ca82c54870a804448543ef792e379 — Jack Gleeson 1 year, 3 months ago 5a705f8
ADD: Add placeholder comment message when a comment is submitted.

It's weird that there is no feedback on submitting a comment if the site is set to approve comments before showing up. This lets you know it's not just lost in the ether, while still being simpler than checking through the returned thread on submittal to see if the new comment is added.
2 files changed, 12 insertions(+), 0 deletions(-)

M wwwroot/css/caint.css
M wwwroot/js/caint.js
M wwwroot/css/caint.css => wwwroot/css/caint.css +7 -0
@@ 117,3 117,10 @@ button:hover, input[type="submit"]:hover{
    padding-top: 0%;
    margin-block-start: 0%;
}

.unapproved {
	background: #f4f4f4;
	border-bottom: dashed;
	border-bottom-width: 1px;
	border-bottom-color: #dddddd;
}

M wwwroot/js/caint.js => wwwroot/js/caint.js +5 -0
@@ 68,6 68,11 @@ async function addItem() {
      .then(response => response.json())
      .then(() => {
        getThread(commentThreadId);

        var unapprovedMarker = document.createElement('div');
        unapprovedMarker.setAttribute('class', 'comment unapproved');
        unapprovedMarker.innerHTML = 'Your comment has been submitted. It may require approval from the site admin before showing up.';

        commenterNameTextbox.value = '';
        commentBodyTextbox.value = '';
      })