Fix unwanted captcha loads.
This commit is contained in:
parent
0baec018e9
commit
f032a52407
@ -29,6 +29,7 @@ QR.captcha =
|
|||||||
|
|
||||||
shouldFocus: false
|
shouldFocus: false
|
||||||
timeouts: {}
|
timeouts: {}
|
||||||
|
postsCount: 0
|
||||||
|
|
||||||
occupied: ->
|
occupied: ->
|
||||||
{container} = @nodes
|
{container} = @nodes
|
||||||
@ -37,9 +38,12 @@ QR.captcha =
|
|||||||
needed: ->
|
needed: ->
|
||||||
captchaCount = @captchas.length
|
captchaCount = @captchas.length
|
||||||
captchaCount++ if @occupied()
|
captchaCount++ if @occupied()
|
||||||
postsCount = QR.posts.length
|
@postsCount = QR.posts.length
|
||||||
postsCount = 0 if postsCount is 1 and !Conf['Auto-load captcha'] and !QR.posts[0].com and !QR.posts[0].file
|
@postsCount = 0 if @postsCount is 1 and !Conf['Auto-load captcha'] and !QR.posts[0].com and !QR.posts[0].file
|
||||||
captchaCount < postsCount
|
captchaCount < @postsCount
|
||||||
|
|
||||||
|
onPostChange: ->
|
||||||
|
@setup() if @postsCount is 0
|
||||||
|
|
||||||
toggle: ->
|
toggle: ->
|
||||||
if @occupied()
|
if @occupied()
|
||||||
|
|||||||
@ -37,7 +37,6 @@ QR.post = class
|
|||||||
|
|
||||||
prev = QR.posts[QR.posts.length - 1]
|
prev = QR.posts[QR.posts.length - 1]
|
||||||
QR.posts.push @
|
QR.posts.push @
|
||||||
QR.captcha.setup()
|
|
||||||
@nodes.spoiler.checked = @spoiler = if prev and Conf['Remember Spoiler']
|
@nodes.spoiler.checked = @spoiler = if prev and Conf['Remember Spoiler']
|
||||||
prev.spoiler
|
prev.spoiler
|
||||||
else
|
else
|
||||||
@ -70,6 +69,8 @@ QR.post = class
|
|||||||
@load() if QR.selected is @ # load persona
|
@load() if QR.selected is @ # load persona
|
||||||
@select() if select
|
@select() if select
|
||||||
@unlock()
|
@unlock()
|
||||||
|
# Post count temporarily off by 1 when called from QR.post.rm
|
||||||
|
$.queueTask -> QR.captcha.setup()
|
||||||
|
|
||||||
rm: ->
|
rm: ->
|
||||||
@delete()
|
@delete()
|
||||||
@ -132,7 +133,7 @@ QR.post = class
|
|||||||
QR.status()
|
QR.status()
|
||||||
when 'com'
|
when 'com'
|
||||||
@nodes.span.textContent = @com
|
@nodes.span.textContent = @com
|
||||||
QR.captcha.setup()
|
QR.captcha.onPostChange()
|
||||||
QR.characterCount()
|
QR.characterCount()
|
||||||
# Disable auto-posting if you're typing in the first post
|
# Disable auto-posting if you're typing in the first post
|
||||||
# during the last 5 seconds of the cooldown.
|
# during the last 5 seconds of the cooldown.
|
||||||
@ -161,7 +162,7 @@ QR.post = class
|
|||||||
@filename = file.name
|
@filename = file.name
|
||||||
@filesize = $.bytesToString file.size
|
@filesize = $.bytesToString file.size
|
||||||
@nodes.label.hidden = false if QR.spoiler
|
@nodes.label.hidden = false if QR.spoiler
|
||||||
QR.captcha.setup()
|
QR.captcha.onPostChange()
|
||||||
URL.revokeObjectURL @URL
|
URL.revokeObjectURL @URL
|
||||||
if @ is QR.selected
|
if @ is QR.selected
|
||||||
@showFileData()
|
@showFileData()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user