{"action":"created","comment":{"url":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/comments/33168027","id":33168027,"diff_hunk":"@@ -0,0 +1,66 @@\n+<script src=\"https://d2g9qbzl5h49rh.cloudfront.net/static/prototype.forms.js\" type=\"text/javascript\"></script>\n+<script src=\"https://d2g9qbzl5h49rh.cloudfront.net/static/jotform.forms.js?3.2.6775\" type=\"text/javascript\"></script>\n+<script type=\"text/javascript\">\n+    JotForm.init(function(){\n+        JotForm.onSubmissionError=\"jumpToSubmit\";\n+    });\n+\n+    // do some basic validation on the contact form.  jQuery is not available here.\n+    document.ready(function() {\n+        var selectors = {\n+            emailAddressBox:  'emailAddress',\n+            emailAgreeCheckbox: 'emailAgree',\n+            emailSubscribeButton: 'emailSubscribe'\n+        };\n+\n+        // http://badsyntax.co/post/javascript-email-validation-rfc822\n+        var emailRegex = /^([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*$/;\n+\n+        // Check email address entrered and checkbox checked before allowing submission of contact form\n+        var validateContactForm = function() {\n+            var emailAddress = document.getElementById(selectors.emailAddressBox).value;\n+            var checkedAgree = document.getElementById(selectors.emailAgreeCheckbox).checked;\n+\n+            if (checkedAgree && emailRegex.test(emailAddress)) {\n+                document.getElementById(selectors.emailSubscribeButton).disabled = false;\n+            } else {\n+                document.getElementById(selectors.emailSubscribeButton).disabled = true;\n+            }\n+        }\n+\n+        // contact form validation\n+        document.getElementById(selectors.emailAddressBox).on('change', validateContactForm);\n+        document.getElementById(selectors.emailAgreeCheckbox).on('change', validateContactForm);\n+    });\n+</script>\n+<div class=\"contact-form\">\n+    <div class=\"container text-center form-group\">\n+        <h4>Contact Us</h4>\n+        <p>Stay up to date on all things GoPhillyGo. Enter your information below to be updated on GoPhillyGo events and featured content from the site.</p><br />\n+        <form class=\"jotform-form\" action=\"https://submit.jotform.us/submit/51094584186159/\" method=\"post\"\n+            target=\"_blank\" name=\"form_51094584186159\" id=\"51094584186159\" accept-charset=\"utf-8\">\n+            <input type=\"hidden\" name=\"formID\" value=\"51094584186159\" />\n+            <ul class=\"list-inline\">\n+                <li><input class=\"form-control\" type=\"text\" name=\"q1_firstName\"\n+                    placeholder=\"First Name\" value=\"\"></li>\n+                <li><input class=\"form-control\" type=\"text\" name=\"q3_lastName\"\n+                    placeholder=\"Last Name\" value=\"\"></li>\n+                <li><input class=\"form-control\" type=\"text\" id=\"emailAddress\"\n+                    name=\"q4_emailAddress\" placeholder=\"Email Address\" value=\"\"></li>\n+            </ul>\n+            <div class=\"submit\">\n+                <div class=\"checkbox\">\n+                    <label>\n+                        <input type=\"checkbox\" id=\"emailAgree\" value=\"\"\n+                            name=\"agree\"> I agree to receive emails from GoPhillyGo </label>\n+                </div>\n+                <br />\n+                <input type=\"submit\" id=\"emailSubscribe\" value=\"subscribe\" disabled />\n+            </div>\n+            <input type=\"hidden\" id=\"simple_spc\" name=\"simple_spc\" value=\"51094584186159\" />\n+            <script type=\"text/javascript\">\n+                document.getElementById(\"si\" + \"mple\" + \"_spc\").value = \"51094584186159-51094584186159\";","path":"python/cac_tripplanner/templates/contact-form-mixin.html","position":62,"original_position":62,"commit_id":"1d2c8ca45a544ec3966dbba22d164b696421b412","original_commit_id":"1d2c8ca45a544ec3966dbba22d164b696421b412","user":{"login":"flibbertigibbet","id":960264,"avatar_url":"https://avatars.githubusercontent.com/u/960264?v=3","gravatar_id":"","url":"https://api.github.com/users/flibbertigibbet","html_url":"https://github.com/flibbertigibbet","followers_url":"https://api.github.com/users/flibbertigibbet/followers","following_url":"https://api.github.com/users/flibbertigibbet/following{/other_user}","gists_url":"https://api.github.com/users/flibbertigibbet/gists{/gist_id}","starred_url":"https://api.github.com/users/flibbertigibbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flibbertigibbet/subscriptions","organizations_url":"https://api.github.com/users/flibbertigibbet/orgs","repos_url":"https://api.github.com/users/flibbertigibbet/repos","events_url":"https://api.github.com/users/flibbertigibbet/events{/privacy}","received_events_url":"https://api.github.com/users/flibbertigibbet/received_events","type":"User","site_admin":false},"body":"It's a mystery.  That's a copy-paste from the provided snippet.","created_at":"2015-06-24T16:41:22Z","updated_at":"2015-06-24T16:41:22Z","html_url":"https://github.com/azavea/cac-tripplanner/pull/401#discussion_r33168027","pull_request_url":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/401","_links":{"self":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/comments/33168027"},"html":{"href":"https://github.com/azavea/cac-tripplanner/pull/401#discussion_r33168027"},"pull_request":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/401"}}},"pull_request":{"url":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/401","id":38460172,"html_url":"https://github.com/azavea/cac-tripplanner/pull/401","diff_url":"https://github.com/azavea/cac-tripplanner/pull/401.diff","patch_url":"https://github.com/azavea/cac-tripplanner/pull/401.patch","issue_url":"https://api.github.com/repos/azavea/cac-tripplanner/issues/401","number":401,"state":"open","locked":false,"title":"Feature/contact form","user":{"login":"flibbertigibbet","id":960264,"avatar_url":"https://avatars.githubusercontent.com/u/960264?v=3","gravatar_id":"","url":"https://api.github.com/users/flibbertigibbet","html_url":"https://github.com/flibbertigibbet","followers_url":"https://api.github.com/users/flibbertigibbet/followers","following_url":"https://api.github.com/users/flibbertigibbet/following{/other_user}","gists_url":"https://api.github.com/users/flibbertigibbet/gists{/gist_id}","starred_url":"https://api.github.com/users/flibbertigibbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flibbertigibbet/subscriptions","organizations_url":"https://api.github.com/users/flibbertigibbet/orgs","repos_url":"https://api.github.com/users/flibbertigibbet/repos","events_url":"https://api.github.com/users/flibbertigibbet/events{/privacy}","received_events_url":"https://api.github.com/users/flibbertigibbet/received_events","type":"User","site_admin":false},"body":"JotForms conflicts with jQuery, which is why I've put the little bit of validation logic for the form into plain Javascript, inline.\r\n","created_at":"2015-06-24T16:20:35Z","updated_at":"2015-06-24T16:41:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9436d759d0a8e92ac6d7d8b903a4e4f3a870d741","assignee":{"login":"kshepard","id":6386,"avatar_url":"https://avatars.githubusercontent.com/u/6386?v=3","gravatar_id":"","url":"https://api.github.com/users/kshepard","html_url":"https://github.com/kshepard","followers_url":"https://api.github.com/users/kshepard/followers","following_url":"https://api.github.com/users/kshepard/following{/other_user}","gists_url":"https://api.github.com/users/kshepard/gists{/gist_id}","starred_url":"https://api.github.com/users/kshepard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kshepard/subscriptions","organizations_url":"https://api.github.com/users/kshepard/orgs","repos_url":"https://api.github.com/users/kshepard/repos","events_url":"https://api.github.com/users/kshepard/events{/privacy}","received_events_url":"https://api.github.com/users/kshepard/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/401/commits","review_comments_url":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/401/comments","review_comment_url":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/azavea/cac-tripplanner/issues/401/comments","statuses_url":"https://api.github.com/repos/azavea/cac-tripplanner/statuses/1d2c8ca45a544ec3966dbba22d164b696421b412","head":{"label":"flibbertigibbet:feature/contact-form","ref":"feature/contact-form","sha":"1d2c8ca45a544ec3966dbba22d164b696421b412","user":{"login":"flibbertigibbet","id":960264,"avatar_url":"https://avatars.githubusercontent.com/u/960264?v=3","gravatar_id":"","url":"https://api.github.com/users/flibbertigibbet","html_url":"https://github.com/flibbertigibbet","followers_url":"https://api.github.com/users/flibbertigibbet/followers","following_url":"https://api.github.com/users/flibbertigibbet/following{/other_user}","gists_url":"https://api.github.com/users/flibbertigibbet/gists{/gist_id}","starred_url":"https://api.github.com/users/flibbertigibbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flibbertigibbet/subscriptions","organizations_url":"https://api.github.com/users/flibbertigibbet/orgs","repos_url":"https://api.github.com/users/flibbertigibbet/repos","events_url":"https://api.github.com/users/flibbertigibbet/events{/privacy}","received_events_url":"https://api.github.com/users/flibbertigibbet/received_events","type":"User","site_admin":false},"repo":{"id":31267987,"name":"cac-tripplanner","full_name":"flibbertigibbet/cac-tripplanner","owner":{"login":"flibbertigibbet","id":960264,"avatar_url":"https://avatars.githubusercontent.com/u/960264?v=3","gravatar_id":"","url":"https://api.github.com/users/flibbertigibbet","html_url":"https://github.com/flibbertigibbet","followers_url":"https://api.github.com/users/flibbertigibbet/followers","following_url":"https://api.github.com/users/flibbertigibbet/following{/other_user}","gists_url":"https://api.github.com/users/flibbertigibbet/gists{/gist_id}","starred_url":"https://api.github.com/users/flibbertigibbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flibbertigibbet/subscriptions","organizations_url":"https://api.github.com/users/flibbertigibbet/orgs","repos_url":"https://api.github.com/users/flibbertigibbet/repos","events_url":"https://api.github.com/users/flibbertigibbet/events{/privacy}","received_events_url":"https://api.github.com/users/flibbertigibbet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/flibbertigibbet/cac-tripplanner","description":"","fork":true,"url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner","forks_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/forks","keys_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/teams","hooks_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/hooks","issue_events_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/issues/events{/number}","events_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/events","assignees_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/assignees{/user}","branches_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/branches{/branch}","tags_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/tags","blobs_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/git/refs{/sha}","trees_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/statuses/{sha}","languages_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/languages","stargazers_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/stargazers","contributors_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/contributors","subscribers_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/subscribers","subscription_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/subscription","commits_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/commits{/sha}","git_commits_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/git/commits{/sha}","comments_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/comments{/number}","issue_comment_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/issues/comments{/number}","contents_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/contents/{+path}","compare_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/merges","archive_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/downloads","issues_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/issues{/number}","pulls_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/pulls{/number}","milestones_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/milestones{/number}","notifications_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/labels{/name}","releases_url":"https://api.github.com/repos/flibbertigibbet/cac-tripplanner/releases{/id}","created_at":"2015-02-24T16:00:30Z","updated_at":"2015-05-08T19:59:38Z","pushed_at":"2015-06-24T16:16:14Z","git_url":"git://github.com/flibbertigibbet/cac-tripplanner.git","ssh_url":"git@github.com:flibbertigibbet/cac-tripplanner.git","clone_url":"https://github.com/flibbertigibbet/cac-tripplanner.git","svn_url":"https://github.com/flibbertigibbet/cac-tripplanner","homepage":null,"size":4962,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"azavea:develop","ref":"develop","sha":"9829d6de4b2b4e23d01c4302f2de3950f3789887","user":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"repo":{"id":27089530,"name":"cac-tripplanner","full_name":"azavea/cac-tripplanner","owner":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azavea/cac-tripplanner","description":"Clean Air Council Circuit Trip Planner and Travelshed","fork":false,"url":"https://api.github.com/repos/azavea/cac-tripplanner","forks_url":"https://api.github.com/repos/azavea/cac-tripplanner/forks","keys_url":"https://api.github.com/repos/azavea/cac-tripplanner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azavea/cac-tripplanner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azavea/cac-tripplanner/teams","hooks_url":"https://api.github.com/repos/azavea/cac-tripplanner/hooks","issue_events_url":"https://api.github.com/repos/azavea/cac-tripplanner/issues/events{/number}","events_url":"https://api.github.com/repos/azavea/cac-tripplanner/events","assignees_url":"https://api.github.com/repos/azavea/cac-tripplanner/assignees{/user}","branches_url":"https://api.github.com/repos/azavea/cac-tripplanner/branches{/branch}","tags_url":"https://api.github.com/repos/azavea/cac-tripplanner/tags","blobs_url":"https://api.github.com/repos/azavea/cac-tripplanner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azavea/cac-tripplanner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azavea/cac-tripplanner/git/refs{/sha}","trees_url":"https://api.github.com/repos/azavea/cac-tripplanner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azavea/cac-tripplanner/statuses/{sha}","languages_url":"https://api.github.com/repos/azavea/cac-tripplanner/languages","stargazers_url":"https://api.github.com/repos/azavea/cac-tripplanner/stargazers","contributors_url":"https://api.github.com/repos/azavea/cac-tripplanner/contributors","subscribers_url":"https://api.github.com/repos/azavea/cac-tripplanner/subscribers","subscription_url":"https://api.github.com/repos/azavea/cac-tripplanner/subscription","commits_url":"https://api.github.com/repos/azavea/cac-tripplanner/commits{/sha}","git_commits_url":"https://api.github.com/repos/azavea/cac-tripplanner/git/commits{/sha}","comments_url":"https://api.github.com/repos/azavea/cac-tripplanner/comments{/number}","issue_comment_url":"https://api.github.com/repos/azavea/cac-tripplanner/issues/comments{/number}","contents_url":"https://api.github.com/repos/azavea/cac-tripplanner/contents/{+path}","compare_url":"https://api.github.com/repos/azavea/cac-tripplanner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azavea/cac-tripplanner/merges","archive_url":"https://api.github.com/repos/azavea/cac-tripplanner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azavea/cac-tripplanner/downloads","issues_url":"https://api.github.com/repos/azavea/cac-tripplanner/issues{/number}","pulls_url":"https://api.github.com/repos/azavea/cac-tripplanner/pulls{/number}","milestones_url":"https://api.github.com/repos/azavea/cac-tripplanner/milestones{/number}","notifications_url":"https://api.github.com/repos/azavea/cac-tripplanner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azavea/cac-tripplanner/labels{/name}","releases_url":"https://api.github.com/repos/azavea/cac-tripplanner/releases{/id}","created_at":"2014-11-24T18:46:16Z","updated_at":"2015-05-08T19:59:27Z","pushed_at":"2015-06-24T16:20:35Z","git_url":"git://github.com/azavea/cac-tripplanner.git","ssh_url":"git@github.com:azavea/cac-tripplanner.git","clone_url":"https://github.com/azavea/cac-tripplanner.git","svn_url":"https://github.com/azavea/cac-tripplanner","homepage":"","size":5728,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/401"},"html":{"href":"https://github.com/azavea/cac-tripplanner/pull/401"},"issue":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/issues/401"},"comments":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/issues/401/comments"},"review_comments":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/401/comments"},"review_comment":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/pulls/401/commits"},"statuses":{"href":"https://api.github.com/repos/azavea/cac-tripplanner/statuses/1d2c8ca45a544ec3966dbba22d164b696421b412"}}}}