Revert "Better detection of when the captcha is open."
This reverts commit 7f32648ed0e837c0adb44e08527837e606526470.
This commit is contained in:
parent
fcc1a60d51
commit
6fb037eb9e
@ -30,19 +30,15 @@ QR.captcha =
|
|||||||
shouldFocus: false
|
shouldFocus: false
|
||||||
timeouts: {}
|
timeouts: {}
|
||||||
|
|
||||||
occupied: ->
|
|
||||||
{container} = @nodes
|
|
||||||
(container.firstChild or container.dataset.widgetID) and !@timeouts.destroy
|
|
||||||
|
|
||||||
needed: ->
|
needed: ->
|
||||||
captchaCount = @captchas.length
|
captchaCount = @captchas.length
|
||||||
captchaCount++ if @occupied()
|
captchaCount++ if @nodes.container.dataset.widgetID and !@timeouts.destroy
|
||||||
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
|
||||||
|
|
||||||
toggle: ->
|
toggle: ->
|
||||||
if @occupied()
|
if @nodes.container.dataset.widgetID and !@timeouts.destroy
|
||||||
@destroy()
|
@destroy()
|
||||||
else
|
else
|
||||||
@shouldFocus = true
|
@shouldFocus = true
|
||||||
@ -55,7 +51,7 @@ QR.captcha =
|
|||||||
clearTimeout @timeouts.destroy
|
clearTimeout @timeouts.destroy
|
||||||
delete @timeouts.destroy
|
delete @timeouts.destroy
|
||||||
return @reload()
|
return @reload()
|
||||||
return if @occupied()
|
return if @nodes.container.dataset.widgetID
|
||||||
$.globalEval '''
|
$.globalEval '''
|
||||||
(function() {
|
(function() {
|
||||||
var container = document.querySelector("#qr .captcha-container");
|
var container = document.querySelector("#qr .captcha-container");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user