Magical auto noko.

This commit is contained in:
Nicolas Stepien 2011-05-23 20:04:54 +02:00
parent 0e62204120
commit 160e9efc52
2 changed files with 10 additions and 7 deletions

View File

@ -1180,7 +1180,7 @@
return qr.autohide.set(); return qr.autohide.set();
}, },
sys: function() { sys: function() {
var board, c, id, recaptcha, thread, _, _ref, _ref2; var c, id, recaptcha, thread, _, _ref;
if (recaptcha = $('#recaptcha_response_field')) { if (recaptcha = $('#recaptcha_response_field')) {
$.bind(recaptcha, 'keydown', Recaptcha.listener); $.bind(recaptcha, 'keydown', Recaptcha.listener);
return; return;
@ -1189,9 +1189,10 @@
if (c.nodeType === 8) { if (c.nodeType === 8) {
_ref = c.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], id = _ref[2]; _ref = c.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], id = _ref[2];
if (thread === '0') { if (thread === '0') {
_ref2 = $('meta', d).content.match(/4chan.org\/(\w+)\//), _ = _ref2[0], board = _ref2[1]; window.location = "http://boards.4chan.org/" + g.BOARD + "/res/" + id + "#watch";
window.location = "http://boards.4chan.org/" + board + "/res/" + id + "#watch";
return; return;
} else {
window.location = "http://boards.4chan.org/" + g.BOARD + "/res/" + thread + "#" + id;
} }
} }
/* /*
@ -1202,8 +1203,8 @@
in the global context. in the global context.
*/ */
return $.globalEval(function() { return $.globalEval(function() {
var data, _ref3; var data, _ref2;
data = ((_ref3 = document.querySelector('table font b')) != null ? _ref3.firstChild.textContent : void 0) || ''; data = ((_ref2 = document.querySelector('table font b')) != null ? _ref2.firstChild.textContent : void 0) || '';
return parent.postMessage(data, '*'); return parent.postMessage(data, '*');
}); });
} }

View File

@ -963,9 +963,11 @@ qr =
if c.nodeType is 8 #comment node if c.nodeType is 8 #comment node
[_, thread, id] = c.textContent.match(/thread:(\d+),no:(\d+)/) [_, thread, id] = c.textContent.match(/thread:(\d+),no:(\d+)/)
if thread is '0' if thread is '0'
[_, board] = $('meta', d).content.match(/4chan.org\/(\w+)\//) window.location = "http://boards.4chan.org/#{g.BOARD}/res/#{id}#watch"
window.location = "http://boards.4chan.org/#{board}/res/#{id}#watch"
return return
else
window.location = "http://boards.4chan.org/#{g.BOARD}/res/#{thread}##{id}"
### ###
http://code.google.com/p/chromium/issues/detail?id=20773 http://code.google.com/p/chromium/issues/detail?id=20773