Nekrocuck

This commit is contained in:
2025-09-28 12:59:09 +02:00
commit a2d093954d
402 changed files with 13763 additions and 0 deletions

36
static/js/quote.js Normal file
View File

@@ -0,0 +1,36 @@
$(function () {
let quoted_post = window.localStorage.getItem("quoted_post");
if (quoted_post) {
$("#post-form").attr("data-visible", true);
$("#content").append(`>>${quoted_post}\n`);
window.localStorage.removeItem("quoted_post");
}
$(window).on("setup_post_events", function (event) {
setup_events($(`#${event.id}`).find(".quote-link"));
});
setup_events($(".quote-link"));
function setup_events(elements) {
elements.each(function () {
$(this).click(function () {
let post_id = $(this).text();
let thread_url = $(this).attr("data-thread-url");
let current_url = window.location.pathname;
if (current_url !== thread_url) {
window.localStorage.setItem("quoted_post", post_id);
window.location.href = `${thread_url}#${post_id}`;
return false;
}
$("#post-form").attr("data-visible", true);
$("#content").append(`>>${post_id}\n`);
return false;
});
});
}
});