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) {
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) {
a.textContent = "" + req.status + " " + req.statusText;
$.unbind(a, 'click', expandThread.cb.toggle);
@ -638,18 +638,25 @@
body = $.el('body', {
innerHTML: req.responseText
});
_ref = $$('a.quotelink', body);
_ref = $$('td[id]', body);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (quote.getAttribute('href') === quote.hash) {
quote.pathname = pathname;
reply = _ref[_i];
_ref2 = $$('a.quotelink', reply);
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.pop();
_results = [];
for (_j = 0, _len2 = tables.length; _j < _len2; _j++) {
table = tables[_j];
for (_k = 0, _len3 = tables.length; _k < _len3; _k++) {
table = tables[_k];
_results.push($.before(br, table));
}
return _results;
@ -2736,7 +2743,7 @@
$.bind(form, 'submit', qr.submit);
}
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);
}
if (conf['Auto Noko']) {

View File

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

View File

@ -452,9 +452,13 @@ expandThread =
body = $.el 'body',
innerHTML: req.responseText
for quote in $$ 'a.quotelink', body
if quote.getAttribute('href') is quote.hash
quote.pathname = pathname
for reply in $$ 'td[id]', body
for quote in $$ 'a.quotelink', reply
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.pop()
for table in tables
@ -2124,7 +2128,7 @@ main =
# scroll to bottom if post isn't found
# 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
if conf['Auto Noko']