From e672cf9ba1b80d00c56c35ae73a627753316dd2b Mon Sep 17 00:00:00 2001 From: tlm-2501 <13thSlayer@gmail.com> Date: Mon, 23 Jan 2017 21:15:13 +0300 Subject: [PATCH] Show backlinks on OP's as well, and disable the script on Ukko boards (it's broken there anyway) --- js/show-backlinks.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/js/show-backlinks.js b/js/show-backlinks.js index fa4865fd..b52434ee 100644 --- a/js/show-backlinks.js +++ b/js/show-backlinks.js @@ -14,8 +14,9 @@ */ onready(function(){ + if($('body').hasClass('active-ukko')) return; var showBackLinks = function() { - var reply_id = $(this).attr('id').replace(/^reply_/, ''); + var reply_id = $(this).attr('id').replace(/(^reply_)|(^op_)/, ''); $(this).find('div.body a:not([rel="nofollow"])').each(function() { var id, post, $mentioned; @@ -26,8 +27,11 @@ onready(function(){ return; $post = $('#reply_' + id); - if($post.length == 0) - return; + if($post.length == 0){ + $post = $('#op_' + id); + if($post.length == 0) + return; + } $mentioned = $post.find('p.intro span.mentioned'); if($mentioned.length == 0) @@ -47,14 +51,12 @@ onready(function(){ }; $('div.post.reply').each(showBackLinks); + $('div.post.op').each(showBackLinks); $(document).on('new_post', function(e, post) { - if ($(post).hasClass("reply")) { - showBackLinks.call(post); - } - else { + showBackLinks.call(post); + if ($(post).hasClass("op")) { $(post).find('div.post.reply').each(showBackLinks); } }); }); -