add function share , comment button and write comments

This commit is contained in:
DELL 2022-11-19 23:02:45 +07:00
parent 2c39774ff7
commit e3040d99fa
3 changed files with 54 additions and 34 deletions

View file

@ -211,6 +211,26 @@
$comment.find('.comment-body').show();
$comment.find('.bad-comment-body').hide();
};
$("#share-button").click( function() {
navigator.clipboard
.writeText(window.location.href)
.then( () => {
alert("Copied link to this post");
});
});
$("#write-comments").click( function(event) {
event.preventDefault();
$("#new-comment").show("slow");
$("#write-comments").hide();
});
$('#comment-button').click( function() {
$('#comment-section').show();
$('#comment-announcement').hide();
})
});
</script>
</script>
{% endcompress %}