mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
feat: update novice captcha creation form to include publish_benchmarks
preference
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
/>
|
||||
</label>
|
||||
|
||||
|
||||
<label class="sitekey-form__label" for="avg_traffic">
|
||||
Average Traffic of your website
|
||||
<input
|
||||
@@ -38,7 +39,6 @@
|
||||
</label>
|
||||
|
||||
|
||||
|
||||
<label class="sitekey-form__label" for="avg_traffic">
|
||||
Maximum traffic that your website can handle
|
||||
<input
|
||||
@@ -68,5 +68,17 @@
|
||||
/>
|
||||
</label>
|
||||
|
||||
|
||||
<label class="sitekey-form__label" for="publish_benchmarks">
|
||||
Anonymously publish CAPTCHA performance statistics to help other webmasters
|
||||
<input
|
||||
class="sitekey-form__input"
|
||||
type="checkbox"
|
||||
name="publish_benchmarks"
|
||||
id="publish_benchmarks"
|
||||
/>
|
||||
</label>
|
||||
|
||||
|
||||
<button class="sitekey-form__submit" type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
@@ -42,6 +42,7 @@ type TrafficPattern = {
|
||||
peak_sustainable_traffic: number;
|
||||
broke_my_site_traffic?: number;
|
||||
description: string;
|
||||
publish_benchmarks: boolean;
|
||||
};
|
||||
|
||||
export const validate = (e: Event): TrafficPattern => {
|
||||
@@ -49,9 +50,7 @@ export const validate = (e: Event): TrafficPattern => {
|
||||
|
||||
let broke_is_set = false;
|
||||
|
||||
const AVG_TRAFFIC = <HTMLInputElement>(
|
||||
FORM.querySelector("#avg_traffic")
|
||||
);
|
||||
const AVG_TRAFFIC = <HTMLInputElement>FORM.querySelector("#avg_traffic");
|
||||
const PEAK_TRAFFIC = <HTMLInputElement>(
|
||||
FORM.querySelector("#peak_sustainable_traffic")
|
||||
);
|
||||
@@ -59,6 +58,10 @@ export const validate = (e: Event): TrafficPattern => {
|
||||
FORM.querySelector("#broke_my_site_traffic")
|
||||
);
|
||||
|
||||
const PUBLISH_BENCHMARKS = <HTMLInputElement>(
|
||||
FORM.querySelector("#publish_benchmarks")
|
||||
);
|
||||
|
||||
isBlankString(AVG_TRAFFIC.value, avg_traffic_name);
|
||||
isBlankString(PEAK_TRAFFIC.value, peak_traffic_name);
|
||||
|
||||
@@ -101,6 +104,7 @@ export const validate = (e: Event): TrafficPattern => {
|
||||
peak_sustainable_traffic,
|
||||
broke_my_site_traffic,
|
||||
description,
|
||||
publish_benchmarks: PUBLISH_BENCHMARKS.checked,
|
||||
};
|
||||
|
||||
return payload;
|
||||
|
||||
Reference in New Issue
Block a user