Captcha.language -> Captcha.replace
This commit is contained in:
parent
bf461e1d6a
commit
5dec400267
@ -64,7 +64,7 @@ Main =
|
|||||||
|
|
||||||
switch location.hostname
|
switch location.hostname
|
||||||
when 'www.4chan.org'
|
when 'www.4chan.org'
|
||||||
Captcha.language.init()
|
Captcha.replace.init()
|
||||||
return
|
return
|
||||||
when 'a.4cdn.org'
|
when 'a.4cdn.org'
|
||||||
return
|
return
|
||||||
@ -307,7 +307,7 @@ Main =
|
|||||||
|
|
||||||
features: [
|
features: [
|
||||||
['Polyfill', Polyfill]
|
['Polyfill', Polyfill]
|
||||||
['Captcha Language', Captcha.language]
|
['Captcha Replacement', Captcha.replace]
|
||||||
['Redirect', Redirect]
|
['Redirect', Redirect]
|
||||||
['Header', Header]
|
['Header', Header]
|
||||||
['Catalog Links', CatalogLinks]
|
['Catalog Links', CatalogLinks]
|
||||||
|
|||||||
@ -3,7 +3,7 @@ Report =
|
|||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
return unless /\bmode=report\b/.test(location.search) and match = location.search.match /\bno=(\d+)/
|
return unless /\bmode=report\b/.test(location.search) and match = location.search.match /\bno=(\d+)/
|
||||||
Captcha.language.init() unless Conf['Use Recaptcha v2 in Reports']
|
Captcha.replace.init() unless Conf['Use Recaptcha v2 in Reports']
|
||||||
@postID = +match[1]
|
@postID = +match[1]
|
||||||
$.ready @ready
|
$.ready @ready
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
Captcha.language =
|
Captcha.replace =
|
||||||
init: ->
|
init: ->
|
||||||
return unless d.cookie.indexOf('pass_enabled=1') < 0
|
return unless d.cookie.indexOf('pass_enabled=1') < 0
|
||||||
return if location.hostname is 'boards.4chan.org' and Conf['Hide Original Post Form']
|
return if location.hostname is 'boards.4chan.org' and Conf['Hide Original Post Form']
|
||||||
|
|
||||||
if Conf['captchaLanguage'].trim()
|
if Conf['captchaLanguage'].trim()
|
||||||
if location.hostname is 'boards.4chan.org'
|
if location.hostname is 'boards.4chan.org'
|
||||||
$.onExists doc, '#captchaFormPart', true, (node) -> $.onExists node, 'iframe', true, Captcha.language.fixIframe
|
$.onExists doc, '#captchaFormPart', true, (node) -> $.onExists node, 'iframe', true, Captcha.replace.iframe
|
||||||
else
|
else
|
||||||
$.onExists doc, 'iframe', true, Captcha.language.fixIframe
|
$.onExists doc, 'iframe', true, Captcha.replace.iframe
|
||||||
|
|
||||||
fixIframe: (el) ->
|
iframe: (el) ->
|
||||||
return unless lang = Conf['captchaLanguage'].trim()
|
return unless lang = Conf['captchaLanguage'].trim()
|
||||||
src = if /[?&]hl=/.test el.src
|
src = if /[?&]hl=/.test el.src
|
||||||
el.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent lang)
|
el.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent lang)
|
||||||
@ -131,7 +131,7 @@ Captcha.v2 =
|
|||||||
return
|
return
|
||||||
|
|
||||||
setupIFrame: (iframe) ->
|
setupIFrame: (iframe) ->
|
||||||
Captcha.language.fixIframe iframe
|
Captcha.replace.iframe iframe
|
||||||
$.addClass QR.nodes.el, 'captcha-open'
|
$.addClass QR.nodes.el, 'captcha-open'
|
||||||
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user