diff --git a/4chan_x.user.js b/4chan_x.user.js index 6e433146e..0f93476be 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan x -// @version 2.26.4 +// @version 2.27.0 // @namespace aeosynth // @description Adds various features. // @copyright 2009-2011 James Campos @@ -20,7 +20,7 @@ * Copyright (c) 2009-2011 James Campos * Copyright (c) 2012 Nicolas Stepien * http://mayhemydg.github.com/4chan-x/ - * 4chan X 2.26.4 + * 4chan X 2.27.0 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -209,7 +209,7 @@ NAMESPACE = '4chan_x.'; - VERSION = '2.26.4'; + VERSION = '2.27.0'; SECOND = 1000; @@ -634,9 +634,20 @@ return sub.textContent; }, comment: function(root) { - return ($.el('a', { - innerHTML: root.lastChild.innerHTML.replace(/
/g, '\n') - })).textContent; + var i, len, node, nodes, text; + text = []; + nodes = d.evaluate('.//node()', root.lastChild, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, 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'); + } + } + return text.join(''); }, filename: function(root) { var file; diff --git a/Cakefile b/Cakefile index ab17fad6b..c8602f9bd 100644 --- a/Cakefile +++ b/Cakefile @@ -2,7 +2,7 @@ {exec} = require 'child_process' fs = require 'fs' -VERSION = '2.26.4' +VERSION = '2.27.0' HEADER = """ // ==UserScript== diff --git a/changelog b/changelog index dc82babf8..8eac93dc7 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master + +2.27.0 - aeosynth / ahodesuka new option: expand images from current position - ahodesuka diff --git a/latest.js b/latest.js index 5514e3b3d..6af921b2e 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'2.26.4'},'*'); +postMessage({version:'2.27.0'},'*'); diff --git a/script.coffee b/script.coffee index 46c64c395..b463d6f6f 100644 --- a/script.coffee +++ b/script.coffee @@ -156,7 +156,7 @@ conf = {} ) null, config NAMESPACE = '4chan_x.' -VERSION = '2.26.4' +VERSION = '2.27.0' SECOND = 1000 MINUTE = 60*SECOND HOUR = 60*MINUTE @@ -546,7 +546,17 @@ filter = sub = if isOP then $ '.filetitle', root else $ '.replytitle', root sub.textContent comment: (root) -> - ($.el 'a', innerHTML: root.lastChild.innerHTML.replace /
/g, '\n').textContent + text = [] + nodes = d.evaluate './/node()', root.lastChild, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, 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.join '' filename: (root) -> if file = $ '.filesize > span', root return file.title