diff --git a/4chan_x.user.js b/4chan_x.user.js index 22bf9f56d..ab54d6346 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1360,7 +1360,7 @@ return $.on(d, 'dragstart dragend', QR.drag); }, node: function(post) { - return $.on($('.quotejs + .quotejs', post.el), 'click', QR.quote); + return $.on($('.postInfo > .postNum > a:last-child', post.el), 'click', QR.quote); }, open: function() { if (QR.el) { @@ -1479,12 +1479,12 @@ } QR.open(); if (!g.REPLY) { - $('select', QR.el).value = $.x('ancestor::div[@class="thread"]', this).firstChild.id; + $('select', QR.el).value = $.x('ancestor::div[@class="thread"]', this).id.slice(1); } - id = this.previousElementSibling.hash.slice(1); + id = this.hash.slice(2); text = ">>" + id + "\n"; sel = window.getSelection(); - if ((s = sel.toString()) && id === ((_ref = $.x('ancestor-or-self::blockquote/preceding-sibling::input', sel.anchorNode)) != null ? _ref.name : void 0)) { + if ((s = sel.toString()) && id === ((_ref = $.x('ancestor-or-self::blockquote', sel.anchorNode)) != null ? _ref.id.slice(1) : void 0)) { s = s.replace(/\n/g, '\n>'); text += ">" + s + "\n"; } @@ -1814,7 +1814,7 @@ } }, dialog: function() { - var e, fileInput, mimeTypes, name, spoiler, ta, thread, threads, _i, _j, _len, _len1, _ref, _ref1; + var e, fileInput, id, mimeTypes, name, spoiler, ta, thread, threads, _i, _j, _len, _len1, _ref, _ref1; QR.el = UI.dialog('qr', 'top:0;right:0;', '\
\ Quick Reply \ @@ -1856,10 +1856,11 @@ spoiler.hidden = !QR.spoiler; if (!g.REPLY) { threads = ''; - _ref = $$('.op'); + _ref = $$('.thread'); for (_i = 0, _len = _ref.length; _i < _len; _i++) { thread = _ref[_i]; - threads += ""; + id = thread.id.slice(1); + threads += ""; } $.prepend($('.move > span', QR.el), $.el('select', { innerHTML: threads, diff --git a/script.coffee b/script.coffee index 5485ee469..829cfc422 100644 --- a/script.coffee +++ b/script.coffee @@ -1030,7 +1030,7 @@ QR = $.on d, 'dragstart dragend', QR.drag node: (post) -> - $.on $('.quotejs + .quotejs', post.el), 'click', QR.quote + $.on $('.postInfo > .postNum > a:last-child', post.el), 'click', QR.quote open: -> if QR.el @@ -1113,14 +1113,14 @@ QR = e?.preventDefault() QR.open() unless g.REPLY - $('select', QR.el).value = $.x('ancestor::div[@class="thread"]', @).firstChild.id + $('select', QR.el).value = $.x('ancestor::div[@class="thread"]', @).id[1..] # Make sure we get the correct number, even with XXX censors - id = @previousElementSibling.hash[1..] + id = @hash[2..] text = ">>#{id}\n" sel = window.getSelection() - if (s = sel.toString()) and id is $.x('ancestor-or-self::blockquote/preceding-sibling::input', sel.anchorNode)?.name + if (s = sel.toString()) and id is $.x('ancestor-or-self::blockquote', sel.anchorNode)?.id[1..] s = s.replace /\n/g, '\n>' text += ">#{s}\n" @@ -1425,8 +1425,9 @@ QR = unless g.REPLY # Make a list with visible threads and an option to create a new one. threads = '' - for thread in $$ '.op' - threads += "" + for thread in $$ '.thread' + id = thread.id[1..] + threads += "" $.prepend $('.move > span', QR.el), $.el 'select' innerHTML: threads title: 'Create a new thread / Reply to a thread'