{"action":"created","comment":{"url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/comments/49289821","id":49289821,"diff_hunk":"@@ -79,10 +79,22 @@\n \n   function registerInput(){\n     options.searchInput.addEventListener('keyup', function(e){\n-      emptyResultsContainer()\n-      if( e.target.value.length > 0 ){\n-        render( repository.search(e.target.value) )\n+\n+      // whitelist the following keycodes\n+      var whitelist = [13,16,20,37,38,39,40,91];\n+\n+      var keyCodes = whitelist.map(function(code){\n+        return 'e.which != ' + code;\n+      }).join(' && ');\n+\n+      // if the key pressed isn't one of the following whitelisted codes precede\n+      if( eval(keyCodes) ){\n+        emptyResultsContainer()\n+        if( e.target.value.length > 0 ){\n+          render( repository.search(e.target.value) )","path":"src/index.js","position":19,"original_position":19,"commit_id":"4a3daa3d664de13c689dac1dfe90a2934e312582","original_commit_id":"4a3daa3d664de13c689dac1dfe90a2934e312582","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":"Missing semicolon.","created_at":"2016-01-11T04:40:23Z","updated_at":"2016-01-11T04:40:23Z","html_url":"https://github.com/christian-fei/Simple-Jekyll-Search/pull/56#discussion_r49289821","pull_request_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/comments/49289821"},"html":{"href":"https://github.com/christian-fei/Simple-Jekyll-Search/pull/56#discussion_r49289821"},"pull_request":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/56","id":55586535,"html_url":"https://github.com/christian-fei/Simple-Jekyll-Search/pull/56","diff_url":"https://github.com/christian-fei/Simple-Jekyll-Search/pull/56.diff","patch_url":"https://github.com/christian-fei/Simple-Jekyll-Search/pull/56.patch","issue_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/56","number":56,"state":"open","locked":false,"title":"whitelist specific keys to prevent re-rendering search results","user":{"login":"egladman","id":8713153,"avatar_url":"https://avatars.githubusercontent.com/u/8713153?v=3","gravatar_id":"","url":"https://api.github.com/users/egladman","html_url":"https://github.com/egladman","followers_url":"https://api.github.com/users/egladman/followers","following_url":"https://api.github.com/users/egladman/following{/other_user}","gists_url":"https://api.github.com/users/egladman/gists{/gist_id}","starred_url":"https://api.github.com/users/egladman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egladman/subscriptions","organizations_url":"https://api.github.com/users/egladman/orgs","repos_url":"https://api.github.com/users/egladman/repos","events_url":"https://api.github.com/users/egladman/events{/privacy}","received_events_url":"https://api.github.com/users/egladman/received_events","type":"User","site_admin":false},"body":"This addresses issue #55.\r\n\r\nThis whitelists the following keys:\r\n- up/down/left/right arrow keys\r\n- modifier key\r\n- shift key\r\n- enter key\r\n- caps lock key\r\n\r\n`event.which` is [technically deprecated](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which), however it still is the 'go-to' means of detecting keyevents until `KeyboardEvent.code` [gains support](http://caniuse.com/#search=KeyboardEvent.code). Even jQuery still uses `event.which`. \r\n\r\nIf your curious how these changes effect the scripts behavior, checkout [this site](https://opensource.osu.edu/) where I'm using this patched version.\r\n\r\nThanks for creating and maintaining this project","created_at":"2016-01-11T04:40:18Z","updated_at":"2016-01-11T04:40:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1257293aade717f81afeaa9d06bf4e893ebe664","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/56/commits","review_comments_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/56/comments","review_comment_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/comments{/number}","comments_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/56/comments","statuses_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/statuses/4a3daa3d664de13c689dac1dfe90a2934e312582","head":{"label":"egladman:master","ref":"master","sha":"4a3daa3d664de13c689dac1dfe90a2934e312582","user":{"login":"egladman","id":8713153,"avatar_url":"https://avatars.githubusercontent.com/u/8713153?v=3","gravatar_id":"","url":"https://api.github.com/users/egladman","html_url":"https://github.com/egladman","followers_url":"https://api.github.com/users/egladman/followers","following_url":"https://api.github.com/users/egladman/following{/other_user}","gists_url":"https://api.github.com/users/egladman/gists{/gist_id}","starred_url":"https://api.github.com/users/egladman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egladman/subscriptions","organizations_url":"https://api.github.com/users/egladman/orgs","repos_url":"https://api.github.com/users/egladman/repos","events_url":"https://api.github.com/users/egladman/events{/privacy}","received_events_url":"https://api.github.com/users/egladman/received_events","type":"User","site_admin":false},"repo":{"id":49238592,"name":"Simple-Jekyll-Search","full_name":"egladman/Simple-Jekyll-Search","owner":{"login":"egladman","id":8713153,"avatar_url":"https://avatars.githubusercontent.com/u/8713153?v=3","gravatar_id":"","url":"https://api.github.com/users/egladman","html_url":"https://github.com/egladman","followers_url":"https://api.github.com/users/egladman/followers","following_url":"https://api.github.com/users/egladman/following{/other_user}","gists_url":"https://api.github.com/users/egladman/gists{/gist_id}","starred_url":"https://api.github.com/users/egladman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egladman/subscriptions","organizations_url":"https://api.github.com/users/egladman/orgs","repos_url":"https://api.github.com/users/egladman/repos","events_url":"https://api.github.com/users/egladman/events{/privacy}","received_events_url":"https://api.github.com/users/egladman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/egladman/Simple-Jekyll-Search","description":"A JavaScript library to add search functionality to any Jekyll blog.","fork":true,"url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search","forks_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/forks","keys_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/keys{/key_id}","collaborators_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/teams","hooks_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/hooks","issue_events_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/issues/events{/number}","events_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/events","assignees_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/assignees{/user}","branches_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/branches{/branch}","tags_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/tags","blobs_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/git/refs{/sha}","trees_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/git/trees{/sha}","statuses_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/statuses/{sha}","languages_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/languages","stargazers_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/stargazers","contributors_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/contributors","subscribers_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/subscribers","subscription_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/subscription","commits_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/commits{/sha}","git_commits_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/git/commits{/sha}","comments_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/comments{/number}","issue_comment_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/issues/comments{/number}","contents_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/contents/{+path}","compare_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/compare/{base}...{head}","merges_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/merges","archive_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/downloads","issues_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/issues{/number}","pulls_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/pulls{/number}","milestones_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/milestones{/number}","notifications_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/labels{/name}","releases_url":"https://api.github.com/repos/egladman/Simple-Jekyll-Search/releases{/id}","created_at":"2016-01-08T00:06:01Z","updated_at":"2016-01-08T00:06:02Z","pushed_at":"2016-01-10T01:21:54Z","git_url":"git://github.com/egladman/Simple-Jekyll-Search.git","ssh_url":"git@github.com:egladman/Simple-Jekyll-Search.git","clone_url":"https://github.com/egladman/Simple-Jekyll-Search.git","svn_url":"https://github.com/egladman/Simple-Jekyll-Search","homepage":"http://christian-fei.github.io/Simple-Jekyll-Search/","size":209,"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":"master"}},"base":{"label":"christian-fei:master","ref":"master","sha":"2d62e7366150be665dad5c8bd54d23f480a36da6","user":{"login":"christian-fei","id":2662706,"avatar_url":"https://avatars.githubusercontent.com/u/2662706?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-fei","html_url":"https://github.com/christian-fei","followers_url":"https://api.github.com/users/christian-fei/followers","following_url":"https://api.github.com/users/christian-fei/following{/other_user}","gists_url":"https://api.github.com/users/christian-fei/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-fei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-fei/subscriptions","organizations_url":"https://api.github.com/users/christian-fei/orgs","repos_url":"https://api.github.com/users/christian-fei/repos","events_url":"https://api.github.com/users/christian-fei/events{/privacy}","received_events_url":"https://api.github.com/users/christian-fei/received_events","type":"User","site_admin":false},"repo":{"id":11387755,"name":"Simple-Jekyll-Search","full_name":"christian-fei/Simple-Jekyll-Search","owner":{"login":"christian-fei","id":2662706,"avatar_url":"https://avatars.githubusercontent.com/u/2662706?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-fei","html_url":"https://github.com/christian-fei","followers_url":"https://api.github.com/users/christian-fei/followers","following_url":"https://api.github.com/users/christian-fei/following{/other_user}","gists_url":"https://api.github.com/users/christian-fei/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-fei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-fei/subscriptions","organizations_url":"https://api.github.com/users/christian-fei/orgs","repos_url":"https://api.github.com/users/christian-fei/repos","events_url":"https://api.github.com/users/christian-fei/events{/privacy}","received_events_url":"https://api.github.com/users/christian-fei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/christian-fei/Simple-Jekyll-Search","description":"A JavaScript library to add search functionality to any Jekyll blog.","fork":false,"url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search","forks_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/forks","keys_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/teams","hooks_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/hooks","issue_events_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/events{/number}","events_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/events","assignees_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/assignees{/user}","branches_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/branches{/branch}","tags_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/tags","blobs_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/git/refs{/sha}","trees_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/statuses/{sha}","languages_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/languages","stargazers_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/stargazers","contributors_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/contributors","subscribers_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/subscribers","subscription_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/subscription","commits_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/commits{/sha}","git_commits_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/git/commits{/sha}","comments_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/comments{/number}","issue_comment_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/comments{/number}","contents_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/contents/{+path}","compare_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/merges","archive_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/downloads","issues_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues{/number}","pulls_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls{/number}","milestones_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/milestones{/number}","notifications_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/labels{/name}","releases_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/releases{/id}","created_at":"2013-07-13T12:30:16Z","updated_at":"2016-01-10T13:56:20Z","pushed_at":"2016-01-11T04:40:19Z","git_url":"git://github.com/christian-fei/Simple-Jekyll-Search.git","ssh_url":"git@github.com:christian-fei/Simple-Jekyll-Search.git","clone_url":"https://github.com/christian-fei/Simple-Jekyll-Search.git","svn_url":"https://github.com/christian-fei/Simple-Jekyll-Search","homepage":"http://christian-fei.github.io/Simple-Jekyll-Search/","size":213,"stargazers_count":414,"watchers_count":414,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":46,"mirror_url":null,"open_issues_count":2,"forks":46,"open_issues":2,"watchers":414,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/56"},"html":{"href":"https://github.com/christian-fei/Simple-Jekyll-Search/pull/56"},"issue":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/56"},"comments":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/statuses/4a3daa3d664de13c689dac1dfe90a2934e312582"}}}}