mirror of
https://github.com/openvk/openvk
synced 2024-12-24 01:21:07 +03:00
73a067a0c5
* rewrite * allow comments scroll * rework to up button * add posts scrolling function and ability to disabl * cloudflare bypass (do not uncomment)
15 lines
773 B
JavaScript
15 lines
773 B
JavaScript
u(document).on("click", ".comment-reply", function(e) {
|
|
let comment = u(e.target).closest(".post");
|
|
let authorId = comment.data("owner-id");
|
|
let authorNm = u(".post-author > a > b", comment.first()).text().trim();
|
|
let fromGroup = Boolean(comment.data("from-group"));
|
|
let postId = comment.data("post-id");
|
|
let inputbox = postId == null ? u("#write textarea") : u("#wall-post-input" + (postId || ""));
|
|
let mention = ("[" + (fromGroup ? "club" : "id") + authorId + "|" + authorNm + "], ");
|
|
|
|
// Substitute pervious mention if present, prepend otherwise
|
|
inputbox.nodes.forEach(node => {
|
|
node.value = node.value.replace(/(^\[([A-Za-z0-9]+)\|([\p{L} 0-9@]+)\], |^)/u, mention);
|
|
})
|
|
inputbox.trigger("focusin");
|
|
});
|