Last active
August 29, 2015 14:07
-
-
Save zackbloom/2c35b3d14bf4907db16c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .gotcha { | |
| width: 100%; | |
| } | |
| .gotcha:after { | |
| content: "OPT OUT OF OUR WEEKLY NEWSLETTER"; | |
| padding-left: 40px; | |
| } | |
| .gotcha:checked:after { | |
| content: "I WANT TO RECEIVE OCCASIONAL EMAILS ABOUT NEW PRODUCTS, PROMOTIONS AND OTHER NEWS"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.addEventListener('DOMContentLoaded', function(){ | |
| var form = document.querySelector(INSTALL_OPTIONS.form.selector); | |
| var checkbox = document.createElement('input'); | |
| checkbox.setAttribute('type', 'checkbox'); | |
| checkbox.setAttribute('class', 'gotcha'); | |
| var submit = form.querySelector('input[type=submit]'); | |
| if (submit){ | |
| form.insertBefore(checkbox, submit); | |
| } else { | |
| form.appendChild(checkbox); | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "resources": { | |
| "head": [ | |
| { | |
| "type": "style", | |
| "src": "./gotcha.css" | |
| }, | |
| { | |
| "type": "script", | |
| "src": "./gotcha.js" | |
| } | |
| ] | |
| }, | |
| "options": { | |
| "properties": { | |
| "form": { | |
| "title": "Form", | |
| "type": "object", | |
| "format": "element" | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment