Merge branch 'master' of github.com:aeosynth/4chan-x

This commit is contained in:
James Campos 2011-07-31 21:55:32 -07:00
commit 0ef3248f81
3 changed files with 25 additions and 12 deletions

View File

@ -624,7 +624,7 @@
} }
}, },
parse: function(req, pathname, thread, a) { parse: function(req, pathname, thread, a) {
var body, br, next, quote, table, tables, _i, _j, _len, _len2, _ref, _results; var body, br, link, next, quote, reply, table, tables, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _results;
if (req.status !== 200) { if (req.status !== 200) {
a.textContent = "" + req.status + " " + req.statusText; a.textContent = "" + req.status + " " + req.statusText;
$.unbind(a, 'click', expandThread.cb.toggle); $.unbind(a, 'click', expandThread.cb.toggle);
@ -638,18 +638,25 @@
body = $.el('body', { body = $.el('body', {
innerHTML: req.responseText innerHTML: req.responseText
}); });
_ref = $$('a.quotelink', body); _ref = $$('td[id]', body);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i]; reply = _ref[_i];
if (quote.getAttribute('href') === quote.hash) { _ref2 = $$('a.quotelink', reply);
quote.pathname = pathname; for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
quote = _ref2[_j];
if (quote.getAttribute('href') === quote.hash) {
quote.pathname = pathname;
}
} }
link = $('a.quotejs', reply);
link.href = "res/" + thread.firstChild.id + "#" + reply.id;
link.nextSibling.href = "res/" + thread.firstChild.id + "#q" + reply.id;
} }
tables = $$('form[name=delform] table', body); tables = $$('form[name=delform] table', body);
tables.pop(); tables.pop();
_results = []; _results = [];
for (_j = 0, _len2 = tables.length; _j < _len2; _j++) { for (_k = 0, _len3 = tables.length; _k < _len3; _k++) {
table = tables[_j]; table = tables[_k];
_results.push($.before(br, table)); _results.push($.before(br, table));
} }
return _results; return _results;
@ -2736,7 +2743,7 @@
$.bind(form, 'submit', qr.submit); $.bind(form, 'submit', qr.submit);
} }
threading.init(); threading.init();
if ((id = location.hash.slice(1)) && !$.id(id)) { if ((id = location.hash.slice(1)) && !$.id(id) && !/\D/.test(id)) {
scrollTo(0, d.body.scrollHeight); scrollTo(0, d.body.scrollHeight);
} }
if (conf['Auto Noko']) { if (conf['Auto Noko']) {

View File

@ -1,4 +1,6 @@
github github
- mayhem:
- fix post links in expanded threads
- aeosynth: - aeosynth:
- only auto scroll focused tabs - only auto scroll focused tabs
- quote inlining: only work on unmodified left-click - quote inlining: only work on unmodified left-click

View File

@ -452,9 +452,13 @@ expandThread =
body = $.el 'body', body = $.el 'body',
innerHTML: req.responseText innerHTML: req.responseText
for quote in $$ 'a.quotelink', body for reply in $$ 'td[id]', body
if quote.getAttribute('href') is quote.hash for quote in $$ 'a.quotelink', reply
quote.pathname = pathname if quote.getAttribute('href') is quote.hash
quote.pathname = pathname
link = $ 'a.quotejs', reply
link.href = "res/#{thread.firstChild.id}##{reply.id}"
link.nextSibling.href = "res/#{thread.firstChild.id}#q#{reply.id}"
tables = $$ 'form[name=delform] table', body tables = $$ 'form[name=delform] table', body
tables.pop() tables.pop()
for table in tables for table in tables
@ -2124,7 +2128,7 @@ main =
# scroll to bottom if post isn't found # scroll to bottom if post isn't found
# thumbnail generation takes time # thumbnail generation takes time
if (id = location.hash[1..]) and !$.id id if (id = location.hash[1..]) and !$.id(id) and !/\D/.test id
scrollTo 0, d.body.scrollHeight scrollTo 0, d.body.scrollHeight
if conf['Auto Noko'] if conf['Auto Noko']