diff --git a/src/assets/SnaptchaAsset.php b/src/assets/CpAsset.php similarity index 82% rename from src/assets/SnaptchaAsset.php rename to src/assets/CpAsset.php index f1a2b6f..1bc0e27 100644 --- a/src/assets/SnaptchaAsset.php +++ b/src/assets/CpAsset.php @@ -6,9 +6,9 @@ namespace putyourlightson\snaptcha\assets; use craft\web\AssetBundle; -use craft\web\assets\cp\CpAsset; +use craft\web\assets\cp\CpAsset as CraftCpAsset; -class SnaptchaAsset extends AssetBundle +class CpAsset extends AssetBundle { /** * @inheritdoc @@ -18,7 +18,7 @@ public function init() $this->sourcePath = '@putyourlightson/snaptcha/resources'; $this->depends = [ - CpAsset::class, + CraftCpAsset::class, ]; // define the relative path to CSS/JS files that should be registered with the page when this asset bundle is registered diff --git a/src/config.php b/src/config.php index e092dc2..fab70cb 100755 --- a/src/config.php +++ b/src/config.php @@ -31,7 +31,7 @@ // The name of the hidden Snaptcha input field. //'fieldName' => 'snaptcha', - // The error message that will be displayed if Snaptcha identifies a submission as spam. + // The message that will be displayed if Snaptcha identifies a submission as spam. //'errorMessage' => 'For some reason your submission was flagged as spam. Please click the button below to resubmit your data.' // The error that will be displayed if Snaptcha identifies a submission as spam and JavaScript is disabled. @@ -50,7 +50,7 @@ //'minimumSubmitTime' => 3, // The controller actions to exclude from validation. - //'excludedControllerActions' => [], + //'excludeControllerActions' => [], // IP addresses to allow for all form submissions. //'allowList' => [], diff --git a/src/models/SettingsModel.php b/src/models/SettingsModel.php index b252544..80b3f1c 100644 --- a/src/models/SettingsModel.php +++ b/src/models/SettingsModel.php @@ -67,7 +67,7 @@ class SettingsModel extends Model /** * @var int */ - public $minimumSubmitTime = 3; + public $minimumSubmitTime = 2; /** * @var array|string @@ -98,9 +98,9 @@ class SettingsModel extends Model public function rules(): array { return [ - [['fieldName', 'expirationTime', 'minimumSubmitTime', 'errorMessage'], 'required'], + [['fieldName', 'errorTitle', 'errorMessage', 'errorJavascriptDisabled', 'errorButtonText', 'expirationTime', 'minimumSubmitTime'], 'required'], [['validationEnabled', 'oneTimeKey', 'logRejected'], 'boolean'], - [['fieldName', 'errorMessage'], 'string'], + [['fieldName', 'errorTitle', 'errorMessage', 'errorJavascriptDisabled', 'errorButtonText'], 'string'], [['expirationTime', 'minimumSubmitTime'], 'integer'], ]; } diff --git a/src/templates/_settings.html b/src/templates/_settings.html index e94e37d..7d7570f 100644 --- a/src/templates/_settings.html +++ b/src/templates/_settings.html @@ -6,7 +6,7 @@ {% from _self import configWarning %} -{% do view.registerAssetBundle("putyourlightson\\snaptcha\\assets\\SnaptchaAsset") %} +{% do view.registerAssetBundle("putyourlightson\\snaptcha\\assets\\CpAsset") %} {{ forms.lightswitchField({ @@ -162,7 +162,7 @@ {{ forms.editableTableField({ label: "Deny List"|t('snaptcha'), - instructions: 'IP addresses to deny from all form submissions.'|t('snaptcha'), + instructions: 'IP addresses to deny for all form submissions.'|t('snaptcha'), warning: (config.denyList is defined ? configWarning('denyList')), name: 'denyList', id: 'denyList',