diff --git a/4chan_x.user.js b/4chan_x.user.js index 36878d91c..f2b11af6c 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -395,7 +395,7 @@ }, x: function(path, root) { if (root == null) root = d.body; - return d.evaluate(path, root, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue; + return d.evaluate(path, root, null, 8, null).singleNodeValue; }, replace: function(root, el) { return root.parentNode.replaceChild(el, root); @@ -633,7 +633,7 @@ }, email: function(root) { var mail; - if (!(mail = $('.linkmail', root))) return mail.href; + if (mail = $('.linkmail', root)) return mail.href; return false; }, subject: function(root, isOP) { @@ -642,18 +642,13 @@ return sub.textContent; }, comment: function(root) { - var i, len, node, nodes, text; + var data, i, len, nodes, text; text = []; - nodes = d.evaluate('.//node()', root.lastChild, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); + nodes = d.evaluate('.//br|.//text()', root.lastChild, null, 7, null); i = 0; len = nodes.snapshotLength; while (i < len) { - node = nodes.snapshotItem(i++); - if (node instanceof Text) { - text.push(node.data); - } else if (node instanceof HTMLBRElement) { - text.push('\n'); - } + text.push((data = nodes.snapshotItem(i++).data) ? data : '\n'); } return text.join(''); }, @@ -798,6 +793,7 @@ num = (function() { switch (g.BOARD) { case 'b': + case 'vg': return 3; case 't': return 1; @@ -1530,7 +1526,7 @@ className: 'preview', draggable: true, href: 'javascript:;', - innerHTML: 'x' + innerHTML: '×' }); $('input', this.el).checked = this.spoiler; $.on(this.el, 'click', function() { @@ -1724,7 +1720,7 @@ qr.el = ui.dialog('qr', 'top:0;right:0;', '\
\