Unify captcha module interfaces.
This commit is contained in:
parent
183f878f0c
commit
e028273eed
@ -1,7 +1,6 @@
|
|||||||
Captcha.noscript =
|
Captcha.noscript =
|
||||||
lifetime: 120 * $.SECOND
|
lifetime: 2 * $.MINUTE
|
||||||
iframeURL: '//www.google.com/recaptcha/api/fallback?k=<%= meta.recaptchaKey %>'
|
iframeURL: '//www.google.com/recaptcha/api/fallback?k=<%= meta.recaptchaKey %>'
|
||||||
timers: {}
|
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
return if d.cookie.indexOf('pass_enabled=1') >= 0
|
return if d.cookie.indexOf('pass_enabled=1') >= 0
|
||||||
@ -20,7 +19,9 @@ Captcha.noscript =
|
|||||||
$.on input, 'blur', QR.focusout
|
$.on input, 'blur', QR.focusout
|
||||||
$.on input, 'focus', QR.focusin
|
$.on input, 'focus', QR.focusin
|
||||||
$.on input, 'keydown', @keydown.bind @
|
$.on input, 'keydown', @keydown.bind @
|
||||||
$.on @nodes.container, 'click', @reload.bind(@, true)
|
$.on @nodes.container, 'click', =>
|
||||||
|
@reload()
|
||||||
|
@nodes.input.focus()
|
||||||
|
|
||||||
@conn = new Connection null, "#{location.protocol}//www.google.com",
|
@conn = new Connection null, "#{location.protocol}//www.google.com",
|
||||||
challenge: @load.bind @
|
challenge: @load.bind @
|
||||||
@ -37,7 +38,7 @@ Captcha.noscript =
|
|||||||
$.sync 'captchas', @sync
|
$.sync 'captchas', @sync
|
||||||
|
|
||||||
@beforeSetup()
|
@beforeSetup()
|
||||||
@setup() if Conf['Auto-load captcha']
|
@setup()
|
||||||
|
|
||||||
initFrame: ->
|
initFrame: ->
|
||||||
conn = new Connection window.top, "#{location.protocol}//boards.4chan.org",
|
conn = new Connection window.top, "#{location.protocol}//boards.4chan.org",
|
||||||
@ -51,8 +52,10 @@ Captcha.noscript =
|
|||||||
error = $('.fbc-error')?.textContent
|
error = $('.fbc-error')?.textContent
|
||||||
conn.send {challenge, token, error}
|
conn.send {challenge, token, error}
|
||||||
|
|
||||||
|
timers: {}
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
focus: -> QR.captcha.setup()
|
focus: -> QR.captcha.setup false, true
|
||||||
|
|
||||||
beforeSetup: ->
|
beforeSetup: ->
|
||||||
{container, input} = @nodes
|
{container, input} = @nodes
|
||||||
@ -60,38 +63,51 @@ Captcha.noscript =
|
|||||||
input.value = ''
|
input.value = ''
|
||||||
input.placeholder = 'Focus to load reCAPTCHA'
|
input.placeholder = 'Focus to load reCAPTCHA'
|
||||||
@count()
|
@count()
|
||||||
$.on input, 'focus', @cb.focus
|
$.on input, 'focus click', @cb.focus
|
||||||
|
|
||||||
setup: ->
|
needed: ->
|
||||||
|
captchaCount = @captchas.length
|
||||||
|
captchaCount++ if QR.req
|
||||||
|
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
|
||||||
|
captchaCount < postsCount
|
||||||
|
|
||||||
|
onNewPost: ->
|
||||||
|
|
||||||
|
onPostChange: ->
|
||||||
|
|
||||||
|
setup: (focus, force) ->
|
||||||
|
return unless @isEnabled and (@needed() or force)
|
||||||
if !@nodes.iframe
|
if !@nodes.iframe
|
||||||
@nodes.iframe = $.el 'iframe',
|
@nodes.iframe = $.el 'iframe',
|
||||||
id: 'qr-captcha-iframe'
|
id: 'qr-captcha-iframe'
|
||||||
src: @iframeURL
|
src: @iframeURL
|
||||||
delete @iframeUsed
|
|
||||||
$.add d.body, @nodes.iframe
|
$.add d.body, @nodes.iframe
|
||||||
@conn.target = @nodes.iframe.contentWindow
|
@conn.target = @nodes.iframe.contentWindow
|
||||||
else if @iframeUsed or !@nodes.img
|
else if !@occupied
|
||||||
@nodes.iframe.src = @iframeURL
|
@nodes.iframe.src = @iframeURL
|
||||||
delete @iframeUsed
|
@occupied = true
|
||||||
else if !@nodes.img.complete
|
@nodes.input.focus() if focus
|
||||||
@conn.send queryChallenge: null
|
|
||||||
|
|
||||||
afterSetup: ->
|
afterSetup: ->
|
||||||
{container, input} = @nodes
|
{container, input} = @nodes
|
||||||
container.hidden = false
|
container.hidden = false
|
||||||
input.placeholder = 'Verification'
|
input.placeholder = 'Verification'
|
||||||
@count()
|
@count()
|
||||||
$.off input, 'focus', @cb.focus
|
$.off input, 'focus click', @cb.focus
|
||||||
|
|
||||||
if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
|
if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
|
||||||
QR.nodes.el.style.top = null
|
QR.nodes.el.style.top = null
|
||||||
QR.nodes.el.style.bottom = '0px'
|
QR.nodes.el.style.bottom = '0px'
|
||||||
|
|
||||||
destroy: ->
|
destroy: ->
|
||||||
$.rm @nodes.img
|
return unless @isEnabled
|
||||||
|
$.rm @nodes.img if @nodes.img
|
||||||
delete @nodes.img
|
delete @nodes.img
|
||||||
$.rm @nodes.iframe
|
$.rm @nodes.iframe if @nodes.iframe
|
||||||
delete @nodes.iframe
|
delete @nodes.iframe
|
||||||
|
delete @occupied
|
||||||
|
@unflag()
|
||||||
@beforeSetup()
|
@beforeSetup()
|
||||||
|
|
||||||
sync: (captchas=[]) ->
|
sync: (captchas=[]) ->
|
||||||
@ -115,14 +131,14 @@ Captcha.noscript =
|
|||||||
response = @nodes.input.value
|
response = @nodes.input.value
|
||||||
if /\S/.test response
|
if /\S/.test response
|
||||||
@conn.send {response}
|
@conn.send {response}
|
||||||
@iframeUsed = true
|
|
||||||
|
|
||||||
save: (token) ->
|
save: (token) ->
|
||||||
|
delete @occupied
|
||||||
@nodes.input.value = ''
|
@nodes.input.value = ''
|
||||||
if @submitCB
|
if @submitCB
|
||||||
@submitCB token
|
@submitCB token
|
||||||
delete @submitCB
|
delete @submitCB
|
||||||
if Conf['Auto-load captcha'] then @reload() else @destroy()
|
if @needed() then @reload() else @destroy()
|
||||||
else
|
else
|
||||||
$.forceSync 'captchas'
|
$.forceSync 'captchas'
|
||||||
@captchas.push
|
@captchas.push
|
||||||
@ -133,11 +149,22 @@ Captcha.noscript =
|
|||||||
@reload()
|
@reload()
|
||||||
|
|
||||||
error: (message) ->
|
error: (message) ->
|
||||||
|
@occupied = true
|
||||||
@nodes.input.value = ''
|
@nodes.input.value = ''
|
||||||
QR.error "CAPTCHA Error: #{message}"
|
|
||||||
if @submitCB
|
if @submitCB
|
||||||
@submitCB()
|
@submitCB()
|
||||||
delete @submitCB
|
delete @submitCB
|
||||||
|
QR.error "Captcha Error: #{message}"
|
||||||
|
|
||||||
|
notify: (el) ->
|
||||||
|
if Conf['Captcha Warning Notifications'] and !d.hidden
|
||||||
|
QR.notify el
|
||||||
|
else
|
||||||
|
$.addClass @nodes.input, 'error'
|
||||||
|
$.one @nodes.input, 'keydown', @unflag.bind @
|
||||||
|
|
||||||
|
unflag: ->
|
||||||
|
$.rmClass @nodes.input, 'error'
|
||||||
|
|
||||||
clear: ->
|
clear: ->
|
||||||
return unless @captchas.length
|
return unless @captchas.length
|
||||||
@ -152,6 +179,7 @@ Captcha.noscript =
|
|||||||
|
|
||||||
load: (src) ->
|
load: (src) ->
|
||||||
{container, input, img} = @nodes
|
{container, input, img} = @nodes
|
||||||
|
@occupied = true
|
||||||
@timeout = Date.now() + @lifetime
|
@timeout = Date.now() + @lifetime
|
||||||
unless img
|
unless img
|
||||||
img = @nodes.img = new Image
|
img = @nodes.img = new Image
|
||||||
@ -160,8 +188,8 @@ Captcha.noscript =
|
|||||||
img.src = src
|
img.src = src
|
||||||
input.value = ''
|
input.value = ''
|
||||||
@clear()
|
@clear()
|
||||||
clearTimeout @timers.reload
|
clearTimeout @timers.expire
|
||||||
@timers.reload = setTimeout @reload.bind(@), @lifetime
|
@timers.expire = setTimeout @expire.bind(@), @lifetime
|
||||||
|
|
||||||
count: ->
|
count: ->
|
||||||
count = if @captchas then @captchas.length else 0
|
count = if @captchas then @captchas.length else 0
|
||||||
@ -179,15 +207,20 @@ Captcha.noscript =
|
|||||||
if @captchas.length
|
if @captchas.length
|
||||||
@timers.clear = setTimeout @clear.bind(@), @captchas[0].timeout - Date.now()
|
@timers.clear = setTimeout @clear.bind(@), @captchas[0].timeout - Date.now()
|
||||||
|
|
||||||
reload: (focus) ->
|
expire: ->
|
||||||
return unless @nodes.iframe
|
return unless @nodes.iframe
|
||||||
|
if @needed() or d.activeElement is @nodes.input
|
||||||
|
@reload()
|
||||||
|
else
|
||||||
|
@destroy()
|
||||||
|
|
||||||
|
reload: ->
|
||||||
@nodes.iframe.src = @iframeURL
|
@nodes.iframe.src = @iframeURL
|
||||||
delete @iframeUsed
|
@occupied = true
|
||||||
@nodes.input.focus() if focus
|
|
||||||
|
|
||||||
keydown: (e) ->
|
keydown: (e) ->
|
||||||
if e.keyCode is 8 and not @nodes.input.value
|
if e.keyCode is 8 and not @nodes.input.value
|
||||||
@reload()
|
if @nodes.iframe then @reload() else @setup()
|
||||||
else if e.keyCode is 13 and e.shiftKey
|
else if e.keyCode is 13 and e.shiftKey
|
||||||
@sendResponse()
|
@sendResponse()
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
Captcha.v2 =
|
Captcha.v2 =
|
||||||
|
lifetime: 2 * $.MINUTE
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
return if d.cookie.indexOf('pass_enabled=1') >= 0
|
return if d.cookie.indexOf('pass_enabled=1') >= 0
|
||||||
return unless @isEnabled = !!$.id 'g-recaptcha'
|
return unless @isEnabled = !!$.id 'g-recaptcha'
|
||||||
@ -27,11 +29,14 @@ Captcha.v2 =
|
|||||||
|
|
||||||
needed: ->
|
needed: ->
|
||||||
captchaCount = @captchas.length
|
captchaCount = @captchas.length
|
||||||
captchaCount++ if @nodes.container and !@timeouts.destroy
|
captchaCount++ if QR.req
|
||||||
@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
|
||||||
|
|
||||||
|
onNewPost: ->
|
||||||
|
@setup()
|
||||||
|
|
||||||
onPostChange: ->
|
onPostChange: ->
|
||||||
@setup() if @postsCount is 0
|
@setup() if @postsCount is 0
|
||||||
@postsCount = 0 if QR.posts.length is 1 and !Conf['Auto-load captcha'] and !QR.posts[0].com and !QR.posts[0].file
|
@postsCount = 0 if QR.posts.length is 1 and !Conf['Auto-load captcha'] and !QR.posts[0].com and !QR.posts[0].file
|
||||||
@ -51,7 +56,11 @@ Captcha.v2 =
|
|||||||
delete @timeouts.destroy
|
delete @timeouts.destroy
|
||||||
return @reload()
|
return @reload()
|
||||||
|
|
||||||
return if @nodes.container
|
if @nodes.container
|
||||||
|
if @shouldFocus and iframe = $ 'textarea', @nodes.container
|
||||||
|
iframe.focus()
|
||||||
|
delete @shouldFocus
|
||||||
|
return
|
||||||
|
|
||||||
@nodes.container = $.el 'div', className: 'captcha-container'
|
@nodes.container = $.el 'div', className: 'captcha-container'
|
||||||
$.prepend @nodes.root, @nodes.container
|
$.prepend @nodes.root, @nodes.container
|
||||||
@ -116,22 +125,21 @@ Captcha.v2 =
|
|||||||
getOne: ->
|
getOne: ->
|
||||||
@clear()
|
@clear()
|
||||||
if captcha = @captchas.shift()
|
if captcha = @captchas.shift()
|
||||||
@count()
|
|
||||||
$.set 'captchas', @captchas
|
$.set 'captchas', @captchas
|
||||||
|
@count()
|
||||||
captcha.response
|
captcha.response
|
||||||
else
|
else
|
||||||
null
|
null
|
||||||
|
|
||||||
save: (pasted) ->
|
save: (pasted) ->
|
||||||
$.forceSync 'captchas'
|
$.forceSync 'captchas'
|
||||||
reload = (QR.cooldown.auto or Conf['Post on Captcha Completion']) and @needed()
|
|
||||||
@captchas.push
|
@captchas.push
|
||||||
response: $('textarea', @nodes.container).value
|
response: $('textarea', @nodes.container).value
|
||||||
timeout: (if pasted then @setupTime else Date.now()) + 2 * $.MINUTE
|
timeout: (if pasted then @setupTime else Date.now()) + @lifetime
|
||||||
@count()
|
|
||||||
$.set 'captchas', @captchas
|
$.set 'captchas', @captchas
|
||||||
|
@count()
|
||||||
|
|
||||||
if reload
|
if (QR.cooldown.auto or Conf['Post on Captcha Completion']) and @needed()
|
||||||
@shouldFocus = true
|
@shouldFocus = true
|
||||||
@reload()
|
@reload()
|
||||||
else
|
else
|
||||||
@ -143,6 +151,9 @@ Captcha.v2 =
|
|||||||
|
|
||||||
QR.submit() if Conf['Post on Captcha Completion'] and !QR.cooldown.auto
|
QR.submit() if Conf['Post on Captcha Completion'] and !QR.cooldown.auto
|
||||||
|
|
||||||
|
notify: (el) ->
|
||||||
|
QR.notify el
|
||||||
|
|
||||||
clear: ->
|
clear: ->
|
||||||
return unless @captchas.length
|
return unless @captchas.length
|
||||||
$.forceSync 'captchas'
|
$.forceSync 'captchas'
|
||||||
@ -161,7 +172,7 @@ Captcha.v2 =
|
|||||||
if @captchas.length
|
if @captchas.length
|
||||||
@timeouts.clear = setTimeout @clear.bind(@), @captchas[0].timeout - Date.now()
|
@timeouts.clear = setTimeout @clear.bind(@), @captchas[0].timeout - Date.now()
|
||||||
|
|
||||||
reload: (focus) ->
|
reload: ->
|
||||||
$.globalEval '''
|
$.globalEval '''
|
||||||
(function() {
|
(function() {
|
||||||
var container = document.querySelector("#qr .captcha-container");
|
var container = document.querySelector("#qr .captcha-container");
|
||||||
|
|||||||
@ -95,9 +95,9 @@ QR =
|
|||||||
|
|
||||||
open: ->
|
open: ->
|
||||||
if QR.nodes
|
if QR.nodes
|
||||||
|
QR.captcha.setup() if QR.nodes.el.hidden
|
||||||
QR.nodes.el.hidden = false
|
QR.nodes.el.hidden = false
|
||||||
QR.unhide()
|
QR.unhide()
|
||||||
QR.captcha.setup() unless QR.captcha is Captcha.noscript
|
|
||||||
return
|
return
|
||||||
try
|
try
|
||||||
QR.dialog()
|
QR.dialog()
|
||||||
@ -114,8 +114,6 @@ QR =
|
|||||||
QR.cleanNotifications()
|
QR.cleanNotifications()
|
||||||
d.activeElement.blur()
|
d.activeElement.blur()
|
||||||
$.rmClass QR.nodes.el, 'dump'
|
$.rmClass QR.nodes.el, 'dump'
|
||||||
if QR.captcha is Captcha.noscript and !Conf['Captcha Warning Notifications']
|
|
||||||
$.rmClass QR.captcha.nodes.input, 'error' if QR.captcha.isEnabled
|
|
||||||
if Conf['QR Shortcut']
|
if Conf['QR Shortcut']
|
||||||
$.toggleClass $('.qr-shortcut'), 'disabled'
|
$.toggleClass $('.qr-shortcut'), 'disabled'
|
||||||
new QR.post true
|
new QR.post true
|
||||||
@ -123,8 +121,7 @@ QR =
|
|||||||
post.delete()
|
post.delete()
|
||||||
QR.cooldown.auto = false
|
QR.cooldown.auto = false
|
||||||
QR.status()
|
QR.status()
|
||||||
if QR.captcha isnt Captcha.noscript or (QR.captcha.isEnabled and not Conf['Auto-load captcha'])
|
QR.captcha.destroy()
|
||||||
QR.captcha.destroy()
|
|
||||||
focusin: ->
|
focusin: ->
|
||||||
QR.captcha.setup() if $.hasClass(QR.nodes.el, 'autohide') and !$.hasClass(QR.nodes.el, 'focus')
|
QR.captcha.setup() if $.hasClass(QR.nodes.el, 'autohide') and !$.hasClass(QR.nodes.el, 'focus')
|
||||||
$.addClass QR.nodes.el, 'focus'
|
$.addClass QR.nodes.el, 'focus'
|
||||||
@ -135,6 +132,7 @@ QR =
|
|||||||
$.addClass QR.nodes.el, 'autohide'
|
$.addClass QR.nodes.el, 'autohide'
|
||||||
QR.nodes.autohide.checked = true
|
QR.nodes.autohide.checked = true
|
||||||
unhide: ->
|
unhide: ->
|
||||||
|
QR.captcha.setup() if $.hasClass(QR.nodes.el, 'autohide') and !$.hasClass(QR.nodes.el, 'focus')
|
||||||
$.rmClass QR.nodes.el, 'autohide'
|
$.rmClass QR.nodes.el, 'autohide'
|
||||||
QR.nodes.autohide.checked = false
|
QR.nodes.autohide.checked = false
|
||||||
toggleHide: ->
|
toggleHide: ->
|
||||||
@ -150,20 +148,10 @@ QR =
|
|||||||
else
|
else
|
||||||
el = err
|
el = err
|
||||||
el.removeAttribute 'style'
|
el.removeAttribute 'style'
|
||||||
captchaErr = QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
|
if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
|
||||||
if captchaErr and QR.captcha is Captcha.noscript
|
QR.captcha.setup true
|
||||||
if QR.captcha.captchas.length is 0
|
QR.captcha.notify el
|
||||||
# Focus the captcha input on captcha error.
|
|
||||||
QR.captcha.nodes.input.focus()
|
|
||||||
QR.captcha.setup()
|
|
||||||
if Conf['Captcha Warning Notifications'] and !d.hidden
|
|
||||||
QR.notify el
|
|
||||||
else
|
|
||||||
$.addClass QR.captcha.nodes.input, 'error'
|
|
||||||
$.on QR.captcha.nodes.input, 'keydown', ->
|
|
||||||
$.rmClass QR.captcha.nodes.input, 'error'
|
|
||||||
else
|
else
|
||||||
QR.captcha.setup true if captchaErr and QR.captcha isnt Captcha.noscript
|
|
||||||
QR.notify el
|
QR.notify el
|
||||||
alert el.textContent if d.hidden
|
alert el.textContent if d.hidden
|
||||||
|
|
||||||
@ -567,7 +555,7 @@ QR =
|
|||||||
QR.cooldown.init()
|
QR.cooldown.init()
|
||||||
QR.captcha.init()
|
QR.captcha.init()
|
||||||
$.add d.body, dialog
|
$.add d.body, dialog
|
||||||
QR.captcha.setup() unless QR.captcha is Captcha.noscript
|
QR.captcha.setup()
|
||||||
|
|
||||||
# Create a custom event when the QR dialog is first initialized.
|
# Create a custom event when the QR dialog is first initialized.
|
||||||
# Use it to extend the QR's functionalities, or for XTRM RICE.
|
# Use it to extend the QR's functionalities, or for XTRM RICE.
|
||||||
@ -794,6 +782,7 @@ QR =
|
|||||||
else
|
else
|
||||||
true
|
true
|
||||||
QR.cooldown.addDelay post, +m[1]
|
QR.cooldown.addDelay post, +m[1]
|
||||||
|
QR.captcha.setup (d.activeElement is QR.nodes.status)
|
||||||
else # stop auto-posting
|
else # stop auto-posting
|
||||||
QR.cooldown.auto = false
|
QR.cooldown.auto = false
|
||||||
QR.status()
|
QR.status()
|
||||||
@ -838,8 +827,8 @@ QR =
|
|||||||
icon: Favicon.logo
|
icon: Favicon.logo
|
||||||
notif.onclick = ->
|
notif.onclick = ->
|
||||||
QR.open()
|
QR.open()
|
||||||
QR.captcha.nodes.input.focus() if QR.captcha is Captcha.noscript
|
|
||||||
window.focus()
|
window.focus()
|
||||||
|
QR.captcha.setup true
|
||||||
notif.onshow = ->
|
notif.onshow = ->
|
||||||
setTimeout ->
|
setTimeout ->
|
||||||
notif.close()
|
notif.close()
|
||||||
@ -848,10 +837,8 @@ QR =
|
|||||||
unless Conf['Persistent QR'] or postsCount
|
unless Conf['Persistent QR'] or postsCount
|
||||||
QR.close()
|
QR.close()
|
||||||
else
|
else
|
||||||
if QR.captcha is Captcha.noscript and QR.posts.length > 1 and QR.captcha.isEnabled and QR.captcha.captchas.length is 0
|
|
||||||
QR.captcha.setup()
|
|
||||||
post.rm()
|
post.rm()
|
||||||
QR.captcha.setup true unless QR.captcha is Captcha.noscript
|
QR.captcha.setup (d.activeElement is QR.nodes.status)
|
||||||
|
|
||||||
QR.cooldown.add req.uploadEndTime, threadID, postID
|
QR.cooldown.add req.uploadEndTime, threadID, postID
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ QR.post = class
|
|||||||
@select() if select
|
@select() if select
|
||||||
@unlock()
|
@unlock()
|
||||||
# Post count temporarily off by 1 when called from QR.post.rm
|
# Post count temporarily off by 1 when called from QR.post.rm
|
||||||
$.queueTask -> QR.captcha.setup() unless QR.captcha is Captcha.noscript
|
$.queueTask -> QR.captcha.onNewPost()
|
||||||
|
|
||||||
rm: ->
|
rm: ->
|
||||||
@delete()
|
@delete()
|
||||||
@ -133,7 +133,7 @@ QR.post = class
|
|||||||
QR.status()
|
QR.status()
|
||||||
when 'com'
|
when 'com'
|
||||||
@nodes.span.textContent = @com
|
@nodes.span.textContent = @com
|
||||||
QR.captcha.onPostChange() unless QR.captcha is Captcha.noscript
|
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.
|
||||||
@ -162,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.onPostChange() unless QR.captcha is Captcha.noscript
|
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