{"action":"created","comment":{"url":"https://api.github.com/repos/18F/myusa/pulls/comments/35934279","id":35934279,"diff_hunk":"@@ -0,0 +1,187 @@\n+/*\n+ \n+ ============================================\n+ License for Application\n+ ============================================\n+ \n+ This license is governed by United States copyright law, and with respect to matters\n+ of tort, contract, and other causes of action it is governed by North Carolina law,\n+ without regard to North Carolina choice of law provisions.  The forum for any dispute\n+ resolution shall be in Wake County, North Carolina.\n+ \n+ Redistribution and use in source and binary forms, with or without modification, are\n+ permitted provided that the following conditions are met:\n+ \n+ 1. Redistributions of source code must retain the above copyright notice, this list\n+ of conditions and the following disclaimer.\n+ \n+ 2. Redistributions in binary form must reproduce the above copyright notice, this\n+ list of conditions and the following disclaimer in the documentation and/or other\n+ materials provided with the distribution.\n+ \n+ 3. The name of the author may not be used to endorse or promote products derived from\n+ this software without specific prior written permission.\n+ \n+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE\n+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ \n+ */\n+\n+// jQuery formatted selector to search for focusable items\n+var focusableElementsString = \"a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]\";\n+\n+// store the item that has focus before opening the modal window\n+var focusedElementBeforeModal;\n+\n+$(document).ready(function() {\n+    jQuery('#startModal').click(function(e) {\n+        showModal($('#modal'));\n+    });\n+    jQuery('#cancel').click(function(e) {\n+        hideModal();\n+    });\n+    jQuery('#cancelButton').click(function(e) {\n+        hideModal();\n+    });\n+    jQuery('#enter').click(function(e) {\n+        enterButtonModal();\n+    });\n+    jQuery('#modalCloseButton').click(function(e) {\n+        hideModal();\n+    });\n+    jQuery('#modal').keydown(function(event) {\n+        trapTabKey($(this), event);\n+    })\n+    jQuery('#modal').keydown(function(event) {\n+        trapEscapeKey($(this), event);\n+    })\n+\n+});\n+\n+\n+function trapSpaceKey(obj, evt, f) {\n+    // if space key pressed\n+    if (evt.which == 32) {\n+        // fire the user passed event\n+        f();\n+        evt.preventDefault();\n+    }\n+}\n+\n+function trapEscapeKey(obj, evt) {\n+\n+    // if escape pressed\n+    if (evt.which == 27) {\n+\n+        // get list of all children elements in given object\n+        var o = obj.find('*');\n+\n+        // get list of focusable items\n+        var cancelElement;\n+        cancelElement = o.filter(\"#cancel\")\n+\n+        // close the modal window\n+        cancelElement.click();\n+        evt.preventDefault();\n+    }\n+\n+}\n+\n+function trapTabKey(obj, evt) {\n+\n+    // if tab or shift-tab pressed\n+    if (evt.which == 9) {\n+\n+        // get list of all children elements in given object\n+        var o = obj.find('*');\n+\n+        // get list of focusable items\n+        var focusableItems;\n+        focusableItems = o.filter(focusableElementsString).filter(':visible')","path":"app/assets/javascripts/modal-window.js","position":107,"original_position":107,"commit_id":"18c6d0c1c4241c385bae71c5c6fdbb9c7b4e3016","original_commit_id":"18c6d0c1c4241c385bae71c5c6fdbb9c7b4e3016","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Mixed double and single quotes.<br>Missing semicolon.","created_at":"2015-07-30T23:44:47Z","updated_at":"2015-07-30T23:44:47Z","html_url":"https://github.com/18F/myusa/pull/741#discussion_r35934279","pull_request_url":"https://api.github.com/repos/18F/myusa/pulls/741","_links":{"self":{"href":"https://api.github.com/repos/18F/myusa/pulls/comments/35934279"},"html":{"href":"https://github.com/18F/myusa/pull/741#discussion_r35934279"},"pull_request":{"href":"https://api.github.com/repos/18F/myusa/pulls/741"}}},"pull_request":{"url":"https://api.github.com/repos/18F/myusa/pulls/741","id":41192147,"html_url":"https://github.com/18F/myusa/pull/741","diff_url":"https://github.com/18F/myusa/pull/741.diff","patch_url":"https://github.com/18F/myusa/pull/741.patch","issue_url":"https://api.github.com/repos/18F/myusa/issues/741","number":741,"state":"open","locked":false,"title":"Updated Contact Us form","user":{"login":"juliaelman","id":955558,"avatar_url":"https://avatars.githubusercontent.com/u/955558?v=3","gravatar_id":"","url":"https://api.github.com/users/juliaelman","html_url":"https://github.com/juliaelman","followers_url":"https://api.github.com/users/juliaelman/followers","following_url":"https://api.github.com/users/juliaelman/following{/other_user}","gists_url":"https://api.github.com/users/juliaelman/gists{/gist_id}","starred_url":"https://api.github.com/users/juliaelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliaelman/subscriptions","organizations_url":"https://api.github.com/users/juliaelman/orgs","repos_url":"https://api.github.com/users/juliaelman/repos","events_url":"https://api.github.com/users/juliaelman/events{/privacy}","received_events_url":"https://api.github.com/users/juliaelman/received_events","type":"User","site_admin":false},"body":"This pull request is an updated version of the contact us form, based off of the updated navigation layout. In the old design, the contact us form was integrated into the page directly. This version creates a modal where the contact us lives and can be accessible on every page through the site. Here are some notes to take into consideration while reviewing:\r\n\r\n- When reviewing the pull request, go to `localhost:3000/redesign` and click on `Contact Us` in the main navigation. \r\n-  While this is not best practice, I spoke with the dev team and we decided to move forward with commenting out the two failing homepage tests for now. The application is going through some major reconstruction at the moment and we need to re-think we way we re-do our integration tests overall //cc @yozlet @harrisj \r\n\r\nHere is a short clip to see the interactions of the working local version of the form:\r\n\r\n![tbw8l7n7ju](https://cloud.githubusercontent.com/assets/955558/8974368/0285d596-363f-11e5-92d4-d1d037d0560a.gif)\r\n\r\nFixes #728 ","created_at":"2015-07-30T02:14:59Z","updated_at":"2015-07-30T23:44:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"445e74c2bfb9fd7c522fe244642cbfd18de7f8a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/myusa/pulls/741/commits","review_comments_url":"https://api.github.com/repos/18F/myusa/pulls/741/comments","review_comment_url":"https://api.github.com/repos/18F/myusa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/myusa/issues/741/comments","statuses_url":"https://api.github.com/repos/18F/myusa/statuses/18c6d0c1c4241c385bae71c5c6fdbb9c7b4e3016","head":{"label":"18F:728-contact-form","ref":"728-contact-form","sha":"18c6d0c1c4241c385bae71c5c6fdbb9c7b4e3016","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":19154916,"name":"myusa","full_name":"18F/myusa","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/myusa","description":"MyUSA is your one account for government. (More info: https://18f.gsa.gov/2015/05/18/myusa/)","fork":false,"url":"https://api.github.com/repos/18F/myusa","forks_url":"https://api.github.com/repos/18F/myusa/forks","keys_url":"https://api.github.com/repos/18F/myusa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/myusa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/myusa/teams","hooks_url":"https://api.github.com/repos/18F/myusa/hooks","issue_events_url":"https://api.github.com/repos/18F/myusa/issues/events{/number}","events_url":"https://api.github.com/repos/18F/myusa/events","assignees_url":"https://api.github.com/repos/18F/myusa/assignees{/user}","branches_url":"https://api.github.com/repos/18F/myusa/branches{/branch}","tags_url":"https://api.github.com/repos/18F/myusa/tags","blobs_url":"https://api.github.com/repos/18F/myusa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/myusa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/myusa/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/myusa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/myusa/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/myusa/languages","stargazers_url":"https://api.github.com/repos/18F/myusa/stargazers","contributors_url":"https://api.github.com/repos/18F/myusa/contributors","subscribers_url":"https://api.github.com/repos/18F/myusa/subscribers","subscription_url":"https://api.github.com/repos/18F/myusa/subscription","commits_url":"https://api.github.com/repos/18F/myusa/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/myusa/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/myusa/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/myusa/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/myusa/contents/{+path}","compare_url":"https://api.github.com/repos/18F/myusa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/myusa/merges","archive_url":"https://api.github.com/repos/18F/myusa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/myusa/downloads","issues_url":"https://api.github.com/repos/18F/myusa/issues{/number}","pulls_url":"https://api.github.com/repos/18F/myusa/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/myusa/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/myusa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/myusa/labels{/name}","releases_url":"https://api.github.com/repos/18F/myusa/releases{/id}","created_at":"2014-04-25T17:44:32Z","updated_at":"2015-07-28T03:02:44Z","pushed_at":"2015-07-30T23:44:37Z","git_url":"git://github.com/18F/myusa.git","ssh_url":"git@github.com:18F/myusa.git","clone_url":"https://github.com/18F/myusa.git","svn_url":"https://github.com/18F/myusa","homepage":"https://my.usa.gov/","size":8684,"stargazers_count":31,"watchers_count":31,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":97,"forks":11,"open_issues":97,"watchers":31,"default_branch":"devel"}},"base":{"label":"18F:devel","ref":"devel","sha":"0f742cddf4768abae99d8e7568bc21f34fad75c2","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":19154916,"name":"myusa","full_name":"18F/myusa","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/myusa","description":"MyUSA is your one account for government. (More info: https://18f.gsa.gov/2015/05/18/myusa/)","fork":false,"url":"https://api.github.com/repos/18F/myusa","forks_url":"https://api.github.com/repos/18F/myusa/forks","keys_url":"https://api.github.com/repos/18F/myusa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/myusa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/myusa/teams","hooks_url":"https://api.github.com/repos/18F/myusa/hooks","issue_events_url":"https://api.github.com/repos/18F/myusa/issues/events{/number}","events_url":"https://api.github.com/repos/18F/myusa/events","assignees_url":"https://api.github.com/repos/18F/myusa/assignees{/user}","branches_url":"https://api.github.com/repos/18F/myusa/branches{/branch}","tags_url":"https://api.github.com/repos/18F/myusa/tags","blobs_url":"https://api.github.com/repos/18F/myusa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/myusa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/myusa/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/myusa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/myusa/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/myusa/languages","stargazers_url":"https://api.github.com/repos/18F/myusa/stargazers","contributors_url":"https://api.github.com/repos/18F/myusa/contributors","subscribers_url":"https://api.github.com/repos/18F/myusa/subscribers","subscription_url":"https://api.github.com/repos/18F/myusa/subscription","commits_url":"https://api.github.com/repos/18F/myusa/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/myusa/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/myusa/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/myusa/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/myusa/contents/{+path}","compare_url":"https://api.github.com/repos/18F/myusa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/myusa/merges","archive_url":"https://api.github.com/repos/18F/myusa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/myusa/downloads","issues_url":"https://api.github.com/repos/18F/myusa/issues{/number}","pulls_url":"https://api.github.com/repos/18F/myusa/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/myusa/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/myusa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/myusa/labels{/name}","releases_url":"https://api.github.com/repos/18F/myusa/releases{/id}","created_at":"2014-04-25T17:44:32Z","updated_at":"2015-07-28T03:02:44Z","pushed_at":"2015-07-30T23:44:37Z","git_url":"git://github.com/18F/myusa.git","ssh_url":"git@github.com:18F/myusa.git","clone_url":"https://github.com/18F/myusa.git","svn_url":"https://github.com/18F/myusa","homepage":"https://my.usa.gov/","size":8684,"stargazers_count":31,"watchers_count":31,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":97,"forks":11,"open_issues":97,"watchers":31,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/myusa/pulls/741"},"html":{"href":"https://github.com/18F/myusa/pull/741"},"issue":{"href":"https://api.github.com/repos/18F/myusa/issues/741"},"comments":{"href":"https://api.github.com/repos/18F/myusa/issues/741/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/myusa/pulls/741/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/myusa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/myusa/pulls/741/commits"},"statuses":{"href":"https://api.github.com/repos/18F/myusa/statuses/18c6d0c1c4241c385bae71c5c6fdbb9c7b4e3016"}}}}