diff --git a/package.json b/package.json
index 87076441e..65f5e932b 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"chromeStoreID": "ohnjgmpcibpbafdlkimncjhflgedgpam",
"recaptchaKey": "6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc",
"youtubeAPIKey": "AIzaSyB5_zaen_-46Uhz1xGR-lz1YoUMHqCD6CE",
+ "captchaServiceLinks": [["captcha.guru", "https://captcha.guru/en/regen/?ref=104127"], ["2captcha", "https://2captcha.com?from=7935487"]],
"distBranch": "gh-pages",
"includes_only": [
"*://boards.4chan.org/*",
diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee
index 43dad3dc2..dca022b7d 100644
--- a/src/General/Settings.coffee
+++ b/src/General/Settings.coffee
@@ -555,7 +555,7 @@ Settings =
$.id('lastarchivecheck').textContent = 'never'
items = {}
- for name in ['archiveLists', 'archiveAutoUpdate', 'captchaLanguage', 'boardnav', 'time', 'timeLocale', 'backlink', 'pastedname', 'fileInfo', 'QR.personas', 'favicon', 'usercss', 'customCooldown', 'jsWhitelist']
+ for name in ['archiveLists', 'archiveAutoUpdate', 'captchaLanguage', 'captchaServiceDomain', 'boardnav', 'time', 'timeLocale', 'backlink', 'pastedname', 'fileInfo', 'QR.personas', 'favicon', 'usercss', 'customCooldown', 'jsWhitelist']
items[name] = Conf[name]
input = inputs[name]
event = if name in ['archiveLists', 'archiveAutoUpdate', 'QR.personas', 'favicon', 'usercss'] then 'change' else 'input'
@@ -571,6 +571,11 @@ Settings =
Settings[key].call input
return
+ $.on inputs['captchaServiceKey'], 'input', Settings.captchaServiceKey
+ $.get 'captchaServiceKey', Conf['captchaServiceKey'], ({captchaServiceKey}) ->
+ Conf['captchaServiceKey'] = captchaServiceKey
+ Settings.captchaServiceDomainList()
+
interval = inputs['Interval']
customCSS = inputs['Custom CSS']
applyCSS = $ '#apply-css', section
@@ -702,6 +707,31 @@ Settings =
Conf['selectedArchives'] = selectedArchives
Redirect.selectArchives()
+ captchaServiceDomain: ->
+ $.get 'captchaServiceKey', Conf['captchaServiceKey'], ({captchaServiceKey}) =>
+ keyInput = $('[name=captchaServiceKey]')
+ keyInput.value = captchaServiceKey[@value.trim()] or ''
+ keyInput.disabled = !@value.trim()
+
+ captchaServiceKey: ->
+ domain = Conf['captchaServiceDomain']
+ value = @value.trim()
+ Conf['captchaServiceKey'][domain] = value
+ $.get 'captchaServiceKey', Conf['captchaServiceKey'], ({captchaServiceKey}) ->
+ captchaServiceKey[domain] = value
+ delete captchaServiceKey[domain] unless value or (domain of Config['captchaServiceKey'][0])
+ Conf['captchaServiceKey'] = captchaServiceKey
+ $.set 'captchaServiceKey', captchaServiceKey
+ Settings.captchaServiceDomainList()
+
+ captchaServiceDomainList: ->
+ list = $.id 'list-captchaServiceDomain'
+ $.rmAll list
+ for domain of Conf['captchaServiceKey']
+ $.add list, $.el 'option',
+ textContent: domain
+ return
+
boardnav: ->
Header.generateBoardList @value
diff --git a/src/General/Settings/Advanced.html b/src/General/Settings/Advanced.html
index 779ac3bd6..2fd445cc2 100644
--- a/src/General/Settings/Advanced.html
+++ b/src/General/Settings/Advanced.html
@@ -25,6 +25,20 @@
+