show-backlinks.js: fix and format

This commit is contained in:
Zankaria 2024-09-02 23:20:56 +02:00 committed by Zankaria
parent 2311035748
commit 5c8c851681

View File

@ -14,7 +14,7 @@
onReady(function() { onReady(function() {
let showBackLinks = function() { let showBackLinks = function() {
let reply_id = $(this).attr('id').replace(/(^reply_)|(^op_)/, ''); let replyId = $(this).attr('id').replace(/(^reply_)|(^op_)/, '');
$(this).find('div.body a:not([rel="nofollow"])').each(function() { $(this).find('div.body a:not([rel="nofollow"])').each(function() {
let id = $(this).text().match(/^>>(\d+)$/); let id = $(this).text().match(/^>>(\d+)$/);
@ -41,9 +41,9 @@ onReady(function() {
return; return;
} }
let link = $('<a class="mentioned-' + reply_id + '" onclick="highlightReply(\'' + reply_id + '\');" href="#' + reply_id + '">&gt;&gt;' + let link = $('<a class="mentioned-' + replyId + '" onclick="highlightReply(\'' + replyId + '\');" href="#'
reply_id + '</a>'); + replyId + '">&gt;&gt;' + replyId + '</a>');
link.appendTo(mentioned) link.appendTo(mentioned);
if (window.init_hover) { if (window.init_hover) {
link.each(init_hover); link.each(init_hover);