diff --git a/4chan_x.js b/4chan_x.js index 2df11f24e..73a206169 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1595,7 +1595,7 @@ cb: { node: function(root) { var i, link, names, prefix, prefixes, s, span, suffix, _len, _results; - if (root.className === 'inline') { + if (root.className === 'inline' && root.className !== 'crossquote') { return; } prefixes = (function() { @@ -1745,10 +1745,7 @@ return; } if (el = d.getElementById(id)) { - inline = $.el('table', { - className: 'inline', - innerHTML: "" + el.innerHTML + "" - }); + inline = quoteInline.table(id, el.innerHTML); if (this.className === 'backlink') { $.after($('td > br:first-of-type, td > a:last-of-type', this.parentNode), inline); return $.hide($.x('ancestor::table[1]', el)); @@ -1795,11 +1792,15 @@ } } } - newInline = $.el('table', { + newInline = quoteInline.table(id, html); + $.addClass(newInline, 'crossquote'); + return $.replace(inline, newInline); + }, + table: function(id, html) { + return $.el('table', { + className: 'inline', innerHTML: "" + html + "" }); - $.replace(inline, newInline); - return newInline.className = 'inline'; } }; quotePreview = { diff --git a/script.coffee b/script.coffee index 8e805dc95..88669da0d 100644 --- a/script.coffee +++ b/script.coffee @@ -1306,7 +1306,7 @@ sauce = g.callbacks.push sauce.cb.node cb: node: (root) -> - return if root.className is 'inline' + return if root.className is 'inline' and root.className isnt 'crossquote' prefixes = (s for s in ($.config('flavors').split '\n') when s[0] != '#') names = (prefix.match(/(\w+)\./)[1] for prefix in prefixes) if span = $ 'span.filesize', root @@ -1394,9 +1394,7 @@ quoteInline = $.show $.x 'ancestor::table[1]', d.getElementById id return if el = d.getElementById id - inline = $.el 'table', - className: 'inline' - innerHTML: "#{el.innerHTML}" + inline = quoteInline.table id, el.innerHTML if @className is 'backlink' $.after $('td > br:first-of-type, td > a:last-of-type', @parentNode), inline $.hide $.x 'ancestor::table[1]', el @@ -1430,10 +1428,13 @@ quoteInline = if reply.id == id html = reply.innerHTML break - newInline = $.el 'table', - innerHTML: "#{html}" + newInline = quoteInline.table id, html + $.addClass newInline, 'crossquote' $.replace inline, newInline - newInline.className = 'inline' + table: (id, html) -> + $.el 'table', + className: 'inline' + innerHTML: "#{html}" quotePreview = init: ->