Merge branch 'master' of git://github.com/MayhemYDG/4chan-x into filesize

This commit is contained in:
ahodesuka 2012-02-21 18:11:19 -06:00
commit 56dd919b0b
5 changed files with 33 additions and 10 deletions

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan x // @name 4chan x
// @version 2.26.4 // @version 2.27.0
// @namespace aeosynth // @namespace aeosynth
// @description Adds various features. // @description Adds various features.
// @copyright 2009-2011 James Campos <james.r.campos@gmail.com> // @copyright 2009-2011 James Campos <james.r.campos@gmail.com>
@ -20,7 +20,7 @@
* Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com> * Copyright (c) 2009-2011 James Campos <james.r.campos@gmail.com>
* Copyright (c) 2012 Nicolas Stepien <stepien.nicolas@gmail.com> * Copyright (c) 2012 Nicolas Stepien <stepien.nicolas@gmail.com>
* http://mayhemydg.github.com/4chan-x/ * 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 * Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation * obtaining a copy of this software and associated documentation
@ -209,7 +209,7 @@
NAMESPACE = '4chan_x.'; NAMESPACE = '4chan_x.';
VERSION = '2.26.4'; VERSION = '2.27.0';
SECOND = 1000; SECOND = 1000;
@ -634,9 +634,20 @@
return sub.textContent; return sub.textContent;
}, },
comment: function(root) { comment: function(root) {
return ($.el('a', { var i, len, node, nodes, text;
innerHTML: root.lastChild.innerHTML.replace(/<br>/g, '\n') text = [];
})).textContent; 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) { filename: function(root) {
var file; var file;

View File

@ -2,7 +2,7 @@
{exec} = require 'child_process' {exec} = require 'child_process'
fs = require 'fs' fs = require 'fs'
VERSION = '2.26.4' VERSION = '2.27.0'
HEADER = """ HEADER = """
// ==UserScript== // ==UserScript==

View File

@ -1,4 +1,6 @@
master master
2.27.0
- aeosynth / ahodesuka - aeosynth / ahodesuka
new option: expand images from current position new option: expand images from current position
- ahodesuka - ahodesuka

View File

@ -1 +1 @@
postMessage({version:'2.26.4'},'*'); postMessage({version:'2.27.0'},'*');

View File

@ -156,7 +156,7 @@ conf = {}
) null, config ) null, config
NAMESPACE = '4chan_x.' NAMESPACE = '4chan_x.'
VERSION = '2.26.4' VERSION = '2.27.0'
SECOND = 1000 SECOND = 1000
MINUTE = 60*SECOND MINUTE = 60*SECOND
HOUR = 60*MINUTE HOUR = 60*MINUTE
@ -546,7 +546,17 @@ filter =
sub = if isOP then $ '.filetitle', root else $ '.replytitle', root sub = if isOP then $ '.filetitle', root else $ '.replytitle', root
sub.textContent sub.textContent
comment: (root) -> comment: (root) ->
($.el 'a', innerHTML: root.lastChild.innerHTML.replace /<br>/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) -> filename: (root) ->
if file = $ '.filesize > span', root if file = $ '.filesize > span', root
return file.title return file.title