From 61bd5c648e63c0ed65eeb51c0a77ee235da282fd Mon Sep 17 00:00:00 2001 From: Mark Taiwan Date: Sun, 25 Jan 2015 23:48:26 +0800 Subject: [PATCH] highlightReply: check for linking to external post Fix for linking to external posts not working in Chrome. --- templates/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/templates/main.js b/templates/main.js index 254e12c0..8572c0a8 100644 --- a/templates/main.js +++ b/templates/main.js @@ -254,6 +254,17 @@ function get_cookie(cookie_name) { } function highlightReply(id, event) { + if (typeof $ != 'undefined') { + // check if external post + // TODO: Don't use jQuery + var post_list = $('a.post_no').filter(':not([id])').filter(function(){ + if (!$(this).parent().parent().hasClass('hidden')) return true; + }); + post_list = $.map($.makeArray(post_list), function(ele) {return $(ele).html()}); + if (post_list.indexOf(id) == -1) + return true; + } + if (typeof window.event != "undefined") { // don't highlight on middle click var e = event || window.event;