Skip to content

Commit

Permalink
Renamed to CpAsset
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Croker committed Feb 17, 2021
1 parent 67379f5 commit 859075b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/assets/SnaptchaAsset.php → src/assets/CpAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -50,7 +50,7 @@
//'minimumSubmitTime' => 3,

// The controller actions to exclude from validation.
//'excludedControllerActions' => [],
//'excludeControllerActions' => [],

// IP addresses to allow for all form submissions.
//'allowList' => [],
Expand Down
6 changes: 3 additions & 3 deletions src/models/SettingsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class SettingsModel extends Model
/**
* @var int
*/
public $minimumSubmitTime = 3;
public $minimumSubmitTime = 2;

/**
* @var array|string
Expand Down Expand Up @@ -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'],
];
}
Expand Down
4 changes: 2 additions & 2 deletions src/templates/_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% from _self import configWarning %}

{% do view.registerAssetBundle("putyourlightson\\snaptcha\\assets\\SnaptchaAsset") %}
{% do view.registerAssetBundle("putyourlightson\\snaptcha\\assets\\CpAsset") %}


{{ forms.lightswitchField({
Expand Down Expand Up @@ -162,7 +162,7 @@
<input type="hidden" name="denyList" value="" />
{{ 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',
Expand Down

0 comments on commit 859075b

Please sign in to comment.