Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Croker committed Mar 28, 2021
1 parent f3a7a8e commit 133c1df
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
14 changes: 7 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Changelog

## 3.0.0 - Unreleased
> {warning} The Excluded URI Patterns setting has been removed. Use the new Exclude Controller Actions setting instead.
> {warning} The Excluded URI Patterns setting has been removed. Use the new Exclude Controller Actions setting instead.
> {tip} The error screen has been updated. If you previously set a custom error message then it may need some tweaking.
> {tip} The error screen has been updated. If you previously set a custom error message then you should review the plugin settings.
### Added
- Added a customisable error screen that allows users to resubmit their data if a submission is flagged as spam.
- Added an Exclude Controller Actions setting.
- Added an Allow List of IP addresses that will not be validated.
- Added an Exclude Controller Actions setting.
- Added an Allow List of IP addresses that will not be validated.
- Added unit tests.

### Changed
- Changed minimum requirement of Craft to version 3.2.1.
- Renamed Blacklist to Deny List, a list of IP addresses that will always be denied.
- Changed the minimum requirement of Craft to version 3.2.1.
- Renamed Blacklist to Deny List, a list of IP addresses that will always be denied.
- The hidden input field now has an `autocomplete` attribute set to `off`.

### Removed
- Removed the Excluded URI Patterns setting. Use the new Exclude Controller Actions setting instead.
- Removed the Excluded URI Patterns setting. Use the new Exclude Controller Actions setting instead.

## 2.3.1 - 2020-12-21
### Changed
Expand Down
2 changes: 1 addition & 1 deletion 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 = 1;

/**
* @var array|string
Expand Down
2 changes: 1 addition & 1 deletion src/resources/js/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ document.getElementById('graphic').classList.remove('hidden');
setTimeout(function() {
document.getElementById('graphic').remove();
document.getElementById('resubmit').classList.remove('disabled');
}, document.getElementById('resubmit').dataset.timeout);
}, document.getElementById('resubmit').dataset.timeout * 1000);
2 changes: 1 addition & 1 deletion src/templates/_error.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2>{{ settings.errorTitle }}</h2>

{{ craft.snaptcha.field }}

<button id="resubmit" type="submit" class="btn submit disabled" data-timeout="{{ settings.minimumSubmitTime * 1000 }}">
<button id="resubmit" type="submit" class="btn submit disabled" data-timeout="{{ settings.minimumSubmitTime }}">
{{ settings.errorButtonText }}
</button>
<div id="graphic" class="spinner hidden"></div>
Expand Down
2 changes: 2 additions & 0 deletions src/templates/_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
{
type: 'text',
heading: 'IP Address'|t('snaptcha'),
code: true,
},
],
rows: settings.allowList,
Expand All @@ -170,6 +171,7 @@
{
type: 'text',
heading: 'IP Address'|t('snaptcha'),
code: true,
},
],
rows: settings.denyList,
Expand Down

0 comments on commit 133c1df

Please sign in to comment.