From 50b57d049a2ebceba4366c11f4f87d39d83abfbf Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 18 May 2011 16:48:32 +0200 Subject: [PATCH] Fix QR on expanded threads. --- 4chan_x.js | 2 +- script.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index a1a8841f6..48e6dfe29 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1141,7 +1141,7 @@ dialog: function(link) { var MAX_FILE_SIZE, THREAD_ID, challenge, dialog, html, mail, name, pass, spoiler, src; MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value; - THREAD_ID = g.THREAD_ID || link.pathname.split('/').pop(); + THREAD_ID = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', link).id; challenge = $('input[name=recaptcha_challenge_field]').value; src = "http://www.google.com/recaptcha/api/image?c=" + challenge; name = $('input[name=name]').value; diff --git a/script.coffee b/script.coffee index 3c2f2330f..4da2cbb1e 100644 --- a/script.coffee +++ b/script.coffee @@ -897,8 +897,8 @@ qr = dialog: (link) -> #maybe should be global MAX_FILE_SIZE = $('input[name="MAX_FILE_SIZE"]').value - #FIXME inlined quotes - THREAD_ID = g.THREAD_ID or link.pathname.split('/').pop() + #FIXME inlined cross-thread quotes + THREAD_ID = g.THREAD_ID or $.x('ancestor::div[@class="thread"]/div', link).id challenge = $('input[name=recaptcha_challenge_field]').value src = "http://www.google.com/recaptcha/api/image?c=#{challenge}" name = $('input[name=name]').value