{"action":"created","comment":{"url":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/comments/190465452","pull_request_review_id":122845056,"id":190465452,"diff_hunk":"@@ -0,0 +1,71 @@\n+$(function() {\n+\n+  var search_list = $('#user-search-result');\n+\n+  function appendUser(user) {\n+    var html = `<div class=\"chat-group-user clearfix\">\n+                  <p class=\"chat-group-user__name\">${ user.name }</p>\n+                  <a class=\"user-search-add chat-group-user__btn chat-group-user__btn--add\" data-user-id=\"${ user.id }\" data-user-name=\"${ user.name }\">追加</a>\n+                </div>`\n+    search_list.append(html);\n+  }\n+\n+  function appendNoUser(user) {\n+    var html = `<div class=\"chat-group-user clearfix\">${ user }</div>`\n+    search_list.append(html);\n+  }\n+\n+  $('#user-search-field').on('focus', function() {\n+    var oldInput = $('#user-search-field').val();\n+\n+    $('#user-search-field').on('keyup', function() {\n+      var input = $('#user-search-field').val();\n+\n+      if (oldInput !== input) {\n+        $.ajax({\n+          type: 'GET',\n+          url: '/users',\n+          data: { keyword: input },\n+          dataType: 'json'\n+        })\n+        .done(function(users) {\n+          $('#user-search-result').empty();\n+          if (users.length !== 0) {\n+            users.forEach(function(user) {\n+              appendUser(user);\n+            });\n+          }\n+          else {\n+            appendNoUser('一致するユーザーはいません')\n+          }\n+        })\n+        .fail(function() {\n+          alert('error');\n+        });\n+        oldInput = input\n+      }\n+    });\n+  });\n+\n+  // ここからグループへのユーザー追加と削除\n+  function addUser(user) {\n+    var html = `<div class='chat-group-user clearfix js-chat-member' id='chat-group-user-8'>\n+                  <input name='group[user_ids][]' type='hidden' value='${ user['userId'] }'>\n+                  <p class='chat-group-user__name'>${ user['userName'] }</p>\n+                  <a class='user-search-remove chat-group-user__btn chat-group-user__btn--remove js-remove-btn'>削除</a>\n+                </div>`\n+      $('#chat-group-users').append(html)\n+  };\n+\n+  $(document).on('click', '.user-search-add', function(e) {","path":"app/assets/javascripts/search.js","position":60,"original_position":60,"commit_id":"7e9a144ae0dd6fb938cb4702d725a60c21c29a4a","original_commit_id":"7e9a144ae0dd6fb938cb4702d725a60c21c29a4a","user":{"login":"MrUrakou","id":18899359,"avatar_url":"https://avatars1.githubusercontent.com/u/18899359?v=4","gravatar_id":"","url":"https://api.github.com/users/MrUrakou","html_url":"https://github.com/MrUrakou","followers_url":"https://api.github.com/users/MrUrakou/followers","following_url":"https://api.github.com/users/MrUrakou/following{/other_user}","gists_url":"https://api.github.com/users/MrUrakou/gists{/gist_id}","starred_url":"https://api.github.com/users/MrUrakou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrUrakou/subscriptions","organizations_url":"https://api.github.com/users/MrUrakou/orgs","repos_url":"https://api.github.com/users/MrUrakou/repos","events_url":"https://api.github.com/users/MrUrakou/events{/privacy}","received_events_url":"https://api.github.com/users/MrUrakou/received_events","type":"User","site_admin":false},"body":"documentから変更できますのでもう少し頑張ってみてください。\r\n以下も同様です。","created_at":"2018-05-24T04:52:04Z","updated_at":"2018-05-24T04:55:36Z","html_url":"https://github.com/wataru-hasegawa/chat-space/pull/13#discussion_r190465452","pull_request_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/13","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/comments/190465452"},"html":{"href":"https://github.com/wataru-hasegawa/chat-space/pull/13#discussion_r190465452"},"pull_request":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/13","id":189871805,"html_url":"https://github.com/wataru-hasegawa/chat-space/pull/13","diff_url":"https://github.com/wataru-hasegawa/chat-space/pull/13.diff","patch_url":"https://github.com/wataru-hasegawa/chat-space/pull/13.patch","issue_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues/13","number":13,"state":"open","locked":false,"title":"インクリメンタルサーチの実装","user":{"login":"wataru-hasegawa","id":38719670,"avatar_url":"https://avatars2.githubusercontent.com/u/38719670?v=4","gravatar_id":"","url":"https://api.github.com/users/wataru-hasegawa","html_url":"https://github.com/wataru-hasegawa","followers_url":"https://api.github.com/users/wataru-hasegawa/followers","following_url":"https://api.github.com/users/wataru-hasegawa/following{/other_user}","gists_url":"https://api.github.com/users/wataru-hasegawa/gists{/gist_id}","starred_url":"https://api.github.com/users/wataru-hasegawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wataru-hasegawa/subscriptions","organizations_url":"https://api.github.com/users/wataru-hasegawa/orgs","repos_url":"https://api.github.com/users/wataru-hasegawa/repos","events_url":"https://api.github.com/users/wataru-hasegawa/events{/privacy}","received_events_url":"https://api.github.com/users/wataru-hasegawa/received_events","type":"User","site_admin":false},"body":"# WHAT\r\nインクリメンタルサーチの実装\r\n\r\n# WHY\r\nユーザービリティ向上の為","created_at":"2018-05-23T06:48:23Z","updated_at":"2018-05-24T04:55:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f12a93e71adc7ca949386ae764851a9d6a6fd9e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/13/commits","review_comments_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/13/comments","review_comment_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues/13/comments","statuses_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/statuses/7e9a144ae0dd6fb938cb4702d725a60c21c29a4a","head":{"label":"wataru-hasegawa:Add_Incremental_search","ref":"Add_Incremental_search","sha":"7e9a144ae0dd6fb938cb4702d725a60c21c29a4a","user":{"login":"wataru-hasegawa","id":38719670,"avatar_url":"https://avatars2.githubusercontent.com/u/38719670?v=4","gravatar_id":"","url":"https://api.github.com/users/wataru-hasegawa","html_url":"https://github.com/wataru-hasegawa","followers_url":"https://api.github.com/users/wataru-hasegawa/followers","following_url":"https://api.github.com/users/wataru-hasegawa/following{/other_user}","gists_url":"https://api.github.com/users/wataru-hasegawa/gists{/gist_id}","starred_url":"https://api.github.com/users/wataru-hasegawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wataru-hasegawa/subscriptions","organizations_url":"https://api.github.com/users/wataru-hasegawa/orgs","repos_url":"https://api.github.com/users/wataru-hasegawa/repos","events_url":"https://api.github.com/users/wataru-hasegawa/events{/privacy}","received_events_url":"https://api.github.com/users/wataru-hasegawa/received_events","type":"User","site_admin":false},"repo":{"id":132698382,"name":"chat-space","full_name":"wataru-hasegawa/chat-space","owner":{"login":"wataru-hasegawa","id":38719670,"avatar_url":"https://avatars2.githubusercontent.com/u/38719670?v=4","gravatar_id":"","url":"https://api.github.com/users/wataru-hasegawa","html_url":"https://github.com/wataru-hasegawa","followers_url":"https://api.github.com/users/wataru-hasegawa/followers","following_url":"https://api.github.com/users/wataru-hasegawa/following{/other_user}","gists_url":"https://api.github.com/users/wataru-hasegawa/gists{/gist_id}","starred_url":"https://api.github.com/users/wataru-hasegawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wataru-hasegawa/subscriptions","organizations_url":"https://api.github.com/users/wataru-hasegawa/orgs","repos_url":"https://api.github.com/users/wataru-hasegawa/repos","events_url":"https://api.github.com/users/wataru-hasegawa/events{/privacy}","received_events_url":"https://api.github.com/users/wataru-hasegawa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wataru-hasegawa/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/wataru-hasegawa/chat-space","forks_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/forks","keys_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/teams","hooks_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/hooks","issue_events_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/events","assignees_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/tags","blobs_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/languages","stargazers_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/stargazers","contributors_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/contributors","subscribers_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/subscribers","subscription_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/subscription","commits_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/merges","archive_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/downloads","issues_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/deployments","created_at":"2018-05-09T03:44:57Z","updated_at":"2018-05-22T07:39:22Z","pushed_at":"2018-05-24T04:41:28Z","git_url":"git://github.com/wataru-hasegawa/chat-space.git","ssh_url":"git@github.com:wataru-hasegawa/chat-space.git","clone_url":"https://github.com/wataru-hasegawa/chat-space.git","svn_url":"https://github.com/wataru-hasegawa/chat-space","homepage":null,"size":869,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"wataru-hasegawa:master","ref":"master","sha":"040ef2b63dc648d7a11eb3d627c30a9693bdefb7","user":{"login":"wataru-hasegawa","id":38719670,"avatar_url":"https://avatars2.githubusercontent.com/u/38719670?v=4","gravatar_id":"","url":"https://api.github.com/users/wataru-hasegawa","html_url":"https://github.com/wataru-hasegawa","followers_url":"https://api.github.com/users/wataru-hasegawa/followers","following_url":"https://api.github.com/users/wataru-hasegawa/following{/other_user}","gists_url":"https://api.github.com/users/wataru-hasegawa/gists{/gist_id}","starred_url":"https://api.github.com/users/wataru-hasegawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wataru-hasegawa/subscriptions","organizations_url":"https://api.github.com/users/wataru-hasegawa/orgs","repos_url":"https://api.github.com/users/wataru-hasegawa/repos","events_url":"https://api.github.com/users/wataru-hasegawa/events{/privacy}","received_events_url":"https://api.github.com/users/wataru-hasegawa/received_events","type":"User","site_admin":false},"repo":{"id":132698382,"name":"chat-space","full_name":"wataru-hasegawa/chat-space","owner":{"login":"wataru-hasegawa","id":38719670,"avatar_url":"https://avatars2.githubusercontent.com/u/38719670?v=4","gravatar_id":"","url":"https://api.github.com/users/wataru-hasegawa","html_url":"https://github.com/wataru-hasegawa","followers_url":"https://api.github.com/users/wataru-hasegawa/followers","following_url":"https://api.github.com/users/wataru-hasegawa/following{/other_user}","gists_url":"https://api.github.com/users/wataru-hasegawa/gists{/gist_id}","starred_url":"https://api.github.com/users/wataru-hasegawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wataru-hasegawa/subscriptions","organizations_url":"https://api.github.com/users/wataru-hasegawa/orgs","repos_url":"https://api.github.com/users/wataru-hasegawa/repos","events_url":"https://api.github.com/users/wataru-hasegawa/events{/privacy}","received_events_url":"https://api.github.com/users/wataru-hasegawa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wataru-hasegawa/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/wataru-hasegawa/chat-space","forks_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/forks","keys_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/teams","hooks_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/hooks","issue_events_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/events","assignees_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/tags","blobs_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/languages","stargazers_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/stargazers","contributors_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/contributors","subscribers_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/subscribers","subscription_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/subscription","commits_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/merges","archive_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/downloads","issues_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/wataru-hasegawa/chat-space/deployments","created_at":"2018-05-09T03:44:57Z","updated_at":"2018-05-22T07:39:22Z","pushed_at":"2018-05-24T04:41:28Z","git_url":"git://github.com/wataru-hasegawa/chat-space.git","ssh_url":"git@github.com:wataru-hasegawa/chat-space.git","clone_url":"https://github.com/wataru-hasegawa/chat-space.git","svn_url":"https://github.com/wataru-hasegawa/chat-space","homepage":null,"size":869,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/13"},"html":{"href":"https://github.com/wataru-hasegawa/chat-space/pull/13"},"issue":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues/13"},"comments":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/wataru-hasegawa/chat-space/statuses/7e9a144ae0dd6fb938cb4702d725a60c21c29a4a"}},"author_association":"OWNER"}}
{"actor":{"display_login":"MrUrakou"}}