Fix QR cooldown on /q/ according to 4chan-JS.

This commit is contained in:
Nicolas Stepien 2012-09-27 01:26:57 +02:00
parent 76b06eba97
commit 3ef78f8461
2 changed files with 19 additions and 3 deletions

View File

@ -2498,7 +2498,7 @@
return QR.ajax = $.ajax($.id('postForm').parentNode.action, callbacks, opts);
},
response: function(html) {
var bs, doc, err, msg, persona, postID, reply, threadID, _, _ref, _ref1;
var bs, doc, err, msg, persona, postID, reply, sage, seconds, threadID, _, _ref, _ref1;
doc = d.implementation.createHTMLDocument('');
doc.documentElement.innerHTML = html;
if (doc.title === '4chan - Banned') {
@ -2547,7 +2547,9 @@
location.pathname = "/" + g.BOARD + "/res/" + postID;
} else {
QR.cooldown.auto = QR.replies.length > 1;
QR.cooldown.set(g.BOARD === 'q' || /sage/i.test(reply.email) ? 60 : 30);
sage = /sage/i.test(reply.email);
seconds = g.BOARD === 'q' ? reply.file ? 300 : sage ? 600 : 60 : sage ? 60 : 30;
QR.cooldown.set(seconds);
if (Conf['Open Reply in New Tab'] && !g.REPLY && !QR.cooldown.auto) {
$.open("//boards.4chan.org/" + g.BOARD + "/res/" + threadID + "#p" + postID);
}

View File

@ -1999,7 +1999,21 @@ QR =
else
# Enable auto-posting if we have stuff to post, disable it otherwise.
QR.cooldown.auto = QR.replies.length > 1
QR.cooldown.set if g.BOARD is 'q' or /sage/i.test reply.email then 60 else 30
sage = /sage/i.test reply.email
seconds =
if g.BOARD is 'q'
# that makes no sense.png
if reply.file
300
else if sage
600
else
60
else if sage
60
else
30
QR.cooldown.set seconds
if Conf['Open Reply in New Tab'] and !g.REPLY and !QR.cooldown.auto
$.open "//boards.4chan.org/#{g.BOARD}/res/#{threadID}#p#{postID}"