Cooldown fix, from Mayhem

This commit is contained in:
Jordan Bates 2013-12-06 17:09:57 -07:00
parent 16fc57ca2d
commit 382943a266
4 changed files with 15 additions and 41 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@ a {
display: block !important;
overflow: visible !important;
}
.fileText {
.reply > .file > .fileText {
margin: 0 20px;
}
[hidden] {

View File

@ -309,11 +309,11 @@ QR =
if delay
cooldown = {delay}
else
if hasFile = !!post.file
if post.file
upSpd = post.file.size / ((start - req.uploadStartTime) / $.SECOND)
QR.cooldown.upSpdAccuracy = ((upSpd > QR.cooldown.upSpd * .9) + QR.cooldown.upSpdAccuracy) / 2
QR.cooldown.upSpd = upSpd
cooldown = {isReply, hasFile, threadID}
cooldown = {isReply, threadID}
QR.cooldown.cooldowns[start] = cooldown
$.set "cooldown.#{g.BOARD}", QR.cooldown.cooldowns
QR.cooldown.start()
@ -362,16 +362,12 @@ QR =
# reply cooldown with a reply, thread cooldown with a thread
elapsed = Math.floor (now - start) / $.SECOND
continue if elapsed < 0 # clock changed since then?
unless isReply
type = 'thread'
type = unless isReply
'thread'
else if hasFile
# You can post an image reply immediately after a non-image reply.
unless cooldown.hasFile
seconds = Math.max seconds, 0
continue
type = 'image'
'image'
else
type = 'reply'
'reply'
maxTimer = Math.max types[type] or 0, types[type + '_intra'] or 0
unless start <= now <= start + maxTimer * $.SECOND
QR.cooldown.unset start