Skip to content

Commit

Permalink
Added option to disable inline_css
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Mar 21, 2018
1 parent 2d6dfb3 commit 3867777
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,11 @@
# v2.13.1
## 03/21/2018

1. [](#improved)
* CAPTCHA fallback to cURL if fopen() is not allowed [#224](https://github.com/getgrav/grav-plugin-form/pull/244)
* Use `display:non`


# v2.13.0
## 03/09/2018

Expand Down
9 changes: 9 additions & 0 deletions assets/form-styles.css
Expand Up @@ -10,6 +10,15 @@
color: #b52b27;
}

.form-honeybear {
visibility: hidden;
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
}

.form-errors p {
margin: 0;
}
Expand Down
11 changes: 11 additions & 0 deletions blueprints.yaml
Expand Up @@ -43,6 +43,17 @@ form:
validate:
type: bool

inline_css:
type: toggle
label: PLUGIN_FORM.USE_INLINE_CSS
highlight: 1
default: 1
options:
1: Enabled
0: Disabled
validate:
type: bool

refresh_prevention:
type: toggle
label: PLUGIN_FORM.REFRESH_PREVENTION
Expand Down
1 change: 1 addition & 0 deletions form.yaml
@@ -1,5 +1,6 @@
enabled: true
built_in_css: true
inline_css: true
refresh_prevention: false
client_side_validation: true
inline_errors: false
Expand Down
1 change: 1 addition & 0 deletions languages.yaml
Expand Up @@ -20,6 +20,7 @@ en:
RECAPTCHA_SECRET_KEY_HELP: "For more info visit https://developers.google.com/recaptcha"
GENERAL: "General"
USE_BUILT_IN_CSS: "Use built-in CSS"
USE_INLINE_CSS: "Use inline CSS"
FILEUPLOAD_PREVENT_SELF: 'Cannot use "%s" outside of pages.'
FILEUPLOAD_UNABLE_TO_UPLOAD: 'Unable to upload file %s: %s'
FILEUPLOAD_UNABLE_TO_MOVE: 'Unable to move file %s to "%s"'
Expand Down
3 changes: 3 additions & 0 deletions templates/forms/fields/honeypot/honeypot.html.twig
@@ -1,5 +1,8 @@
<input aria-hidden="true"
type="text"
{% if config.plugins.form.inline_css == true %}
style="visibility:hidden;position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);"
{% endif %}
class="form-honeybear"
name="{{ (scope ~ field.name)|fieldName }}"
value="{{ value|join(', ') }}" />

0 comments on commit 3867777

Please sign in to comment.