{"action":"created","comment":{"url":"https://api.github.com/repos/meijp/chat-space/pulls/comments/141786312","pull_request_review_id":66055309,"id":141786312,"diff_hunk":"@@ -0,0 +1,63 @@\n+$(function() {\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+    return html;\n+ }\n+\n+  function appendUserList(id, name) {\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=${id}>\n+                    <p class='chat-group-user__name'>${ name }</p>\n+                    <a class='user-search-remove chat-group-user__btn chat-group-user__btn--remove js-remove-btn' data-user-id=\"${ id }\">削除</a>\n+                </div>`\n+    return html;\n+ }\n+\n+  $(\".chat-group-form__text\").on(\"keyup\", function() {\n+    var input = $(\".chat-group-form__text\").val();\n+\n+    $.ajax({\n+      type: 'GET',\n+      url: '/users',\n+      data: { keyword: input },\n+      dataType: 'json'\n+    })\n+    .done(function(users) {\n+       $(\".chat-group-form__text\").empty();\n+       $(\".chat-group-user\").remove();\n+       if (users.length !== 0) {\n+         users.forEach(function(user){\n+           var html = appendUser(user);\n+           $(\"#user-search-result\").append(html);\n+         });\n+       }\n+       else {\n+         alert(\"ユーザー検索に失敗しました\");\n+       }\n+   })\n+  });\n+\n+  //追加ボタンをクリック\n+    $(document).on('click',\".chat-group-user__btn--add\", function(e) {\n+      e.preventDefault();\n+      var id = $(this).attr('data-user-id');\n+      var name = $(this).attr('data-user-name');\n+      var html = appendUserList(id, name);\n+      $('#chat-group-users').append(html);\n+      $(this).parents('.chat-group-user').remove();\n+    });\n+\n+  //削除ボタンをクリック\n+    $(document).on('click',\".chat-group-user__btn--remove\", function(e) {\n+      e.preventDefault();","path":"app/assets/javascripts/index.js","position":56,"original_position":56,"commit_id":"a9de2c2c43bed349030748d39a1b5f2e318d004b","original_commit_id":"a9de2c2c43bed349030748d39a1b5f2e318d004b","user":{"login":"meijp","id":31642432,"avatar_url":"https://avatars3.githubusercontent.com/u/31642432?v=4","gravatar_id":"","url":"https://api.github.com/users/meijp","html_url":"https://github.com/meijp","followers_url":"https://api.github.com/users/meijp/followers","following_url":"https://api.github.com/users/meijp/following{/other_user}","gists_url":"https://api.github.com/users/meijp/gists{/gist_id}","starred_url":"https://api.github.com/users/meijp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meijp/subscriptions","organizations_url":"https://api.github.com/users/meijp/orgs","repos_url":"https://api.github.com/users/meijp/repos","events_url":"https://api.github.com/users/meijp/events{/privacy}","received_events_url":"https://api.github.com/users/meijp/received_events","type":"User","site_admin":false},"body":"削除しました。","created_at":"2017-09-29T04:01:12Z","updated_at":"2017-09-29T04:01:12Z","html_url":"https://github.com/meijp/chat-space/pull/15#discussion_r141786312","pull_request_url":"https://api.github.com/repos/meijp/chat-space/pulls/15","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/meijp/chat-space/pulls/comments/141786312"},"html":{"href":"https://github.com/meijp/chat-space/pull/15#discussion_r141786312"},"pull_request":{"href":"https://api.github.com/repos/meijp/chat-space/pulls/15"}},"in_reply_to_id":141785772},"pull_request":{"url":"https://api.github.com/repos/meijp/chat-space/pulls/15","id":143799511,"html_url":"https://github.com/meijp/chat-space/pull/15","diff_url":"https://github.com/meijp/chat-space/pull/15.diff","patch_url":"https://github.com/meijp/chat-space/pull/15.patch","issue_url":"https://api.github.com/repos/meijp/chat-space/issues/15","number":15,"state":"open","locked":false,"title":"Create incremental search","user":{"login":"meijp","id":31642432,"avatar_url":"https://avatars3.githubusercontent.com/u/31642432?v=4","gravatar_id":"","url":"https://api.github.com/users/meijp","html_url":"https://github.com/meijp","followers_url":"https://api.github.com/users/meijp/followers","following_url":"https://api.github.com/users/meijp/following{/other_user}","gists_url":"https://api.github.com/users/meijp/gists{/gist_id}","starred_url":"https://api.github.com/users/meijp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meijp/subscriptions","organizations_url":"https://api.github.com/users/meijp/orgs","repos_url":"https://api.github.com/users/meijp/repos","events_url":"https://api.github.com/users/meijp/events{/privacy}","received_events_url":"https://api.github.com/users/meijp/received_events","type":"User","site_admin":false},"body":"# WHAT\nインクリメンタルサーチの実装\n\n# WHY\nユーザーエクスペリエンスの向上","created_at":"2017-09-29T03:14:07Z","updated_at":"2017-09-29T04:01:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83c4dfc7008dc0528eb88a3483bd91d029422311","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/meijp/chat-space/pulls/15/commits","review_comments_url":"https://api.github.com/repos/meijp/chat-space/pulls/15/comments","review_comment_url":"https://api.github.com/repos/meijp/chat-space/pulls/comments{/number}","comments_url":"https://api.github.com/repos/meijp/chat-space/issues/15/comments","statuses_url":"https://api.github.com/repos/meijp/chat-space/statuses/a9de2c2c43bed349030748d39a1b5f2e318d004b","head":{"label":"meijp:incremental-search","ref":"incremental-search","sha":"a9de2c2c43bed349030748d39a1b5f2e318d004b","user":{"login":"meijp","id":31642432,"avatar_url":"https://avatars3.githubusercontent.com/u/31642432?v=4","gravatar_id":"","url":"https://api.github.com/users/meijp","html_url":"https://github.com/meijp","followers_url":"https://api.github.com/users/meijp/followers","following_url":"https://api.github.com/users/meijp/following{/other_user}","gists_url":"https://api.github.com/users/meijp/gists{/gist_id}","starred_url":"https://api.github.com/users/meijp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meijp/subscriptions","organizations_url":"https://api.github.com/users/meijp/orgs","repos_url":"https://api.github.com/users/meijp/repos","events_url":"https://api.github.com/users/meijp/events{/privacy}","received_events_url":"https://api.github.com/users/meijp/received_events","type":"User","site_admin":false},"repo":{"id":102458577,"name":"chat-space","full_name":"meijp/chat-space","owner":{"login":"meijp","id":31642432,"avatar_url":"https://avatars3.githubusercontent.com/u/31642432?v=4","gravatar_id":"","url":"https://api.github.com/users/meijp","html_url":"https://github.com/meijp","followers_url":"https://api.github.com/users/meijp/followers","following_url":"https://api.github.com/users/meijp/following{/other_user}","gists_url":"https://api.github.com/users/meijp/gists{/gist_id}","starred_url":"https://api.github.com/users/meijp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meijp/subscriptions","organizations_url":"https://api.github.com/users/meijp/orgs","repos_url":"https://api.github.com/users/meijp/repos","events_url":"https://api.github.com/users/meijp/events{/privacy}","received_events_url":"https://api.github.com/users/meijp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meijp/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/meijp/chat-space","forks_url":"https://api.github.com/repos/meijp/chat-space/forks","keys_url":"https://api.github.com/repos/meijp/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meijp/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meijp/chat-space/teams","hooks_url":"https://api.github.com/repos/meijp/chat-space/hooks","issue_events_url":"https://api.github.com/repos/meijp/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/meijp/chat-space/events","assignees_url":"https://api.github.com/repos/meijp/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/meijp/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/meijp/chat-space/tags","blobs_url":"https://api.github.com/repos/meijp/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meijp/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meijp/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/meijp/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meijp/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/meijp/chat-space/languages","stargazers_url":"https://api.github.com/repos/meijp/chat-space/stargazers","contributors_url":"https://api.github.com/repos/meijp/chat-space/contributors","subscribers_url":"https://api.github.com/repos/meijp/chat-space/subscribers","subscription_url":"https://api.github.com/repos/meijp/chat-space/subscription","commits_url":"https://api.github.com/repos/meijp/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/meijp/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/meijp/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/meijp/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/meijp/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/meijp/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meijp/chat-space/merges","archive_url":"https://api.github.com/repos/meijp/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meijp/chat-space/downloads","issues_url":"https://api.github.com/repos/meijp/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/meijp/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/meijp/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/meijp/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meijp/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/meijp/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/meijp/chat-space/deployments","created_at":"2017-09-05T08:57:41Z","updated_at":"2017-09-05T08:57:52Z","pushed_at":"2017-09-29T03:20:34Z","git_url":"git://github.com/meijp/chat-space.git","ssh_url":"git@github.com:meijp/chat-space.git","clone_url":"https://github.com/meijp/chat-space.git","svn_url":"https://github.com/meijp/chat-space","homepage":null,"size":149,"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,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"meijp:master","ref":"master","sha":"0827c201cee581659d31d73d48b587d9d2715ae1","user":{"login":"meijp","id":31642432,"avatar_url":"https://avatars3.githubusercontent.com/u/31642432?v=4","gravatar_id":"","url":"https://api.github.com/users/meijp","html_url":"https://github.com/meijp","followers_url":"https://api.github.com/users/meijp/followers","following_url":"https://api.github.com/users/meijp/following{/other_user}","gists_url":"https://api.github.com/users/meijp/gists{/gist_id}","starred_url":"https://api.github.com/users/meijp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meijp/subscriptions","organizations_url":"https://api.github.com/users/meijp/orgs","repos_url":"https://api.github.com/users/meijp/repos","events_url":"https://api.github.com/users/meijp/events{/privacy}","received_events_url":"https://api.github.com/users/meijp/received_events","type":"User","site_admin":false},"repo":{"id":102458577,"name":"chat-space","full_name":"meijp/chat-space","owner":{"login":"meijp","id":31642432,"avatar_url":"https://avatars3.githubusercontent.com/u/31642432?v=4","gravatar_id":"","url":"https://api.github.com/users/meijp","html_url":"https://github.com/meijp","followers_url":"https://api.github.com/users/meijp/followers","following_url":"https://api.github.com/users/meijp/following{/other_user}","gists_url":"https://api.github.com/users/meijp/gists{/gist_id}","starred_url":"https://api.github.com/users/meijp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meijp/subscriptions","organizations_url":"https://api.github.com/users/meijp/orgs","repos_url":"https://api.github.com/users/meijp/repos","events_url":"https://api.github.com/users/meijp/events{/privacy}","received_events_url":"https://api.github.com/users/meijp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meijp/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/meijp/chat-space","forks_url":"https://api.github.com/repos/meijp/chat-space/forks","keys_url":"https://api.github.com/repos/meijp/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meijp/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meijp/chat-space/teams","hooks_url":"https://api.github.com/repos/meijp/chat-space/hooks","issue_events_url":"https://api.github.com/repos/meijp/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/meijp/chat-space/events","assignees_url":"https://api.github.com/repos/meijp/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/meijp/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/meijp/chat-space/tags","blobs_url":"https://api.github.com/repos/meijp/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meijp/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meijp/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/meijp/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meijp/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/meijp/chat-space/languages","stargazers_url":"https://api.github.com/repos/meijp/chat-space/stargazers","contributors_url":"https://api.github.com/repos/meijp/chat-space/contributors","subscribers_url":"https://api.github.com/repos/meijp/chat-space/subscribers","subscription_url":"https://api.github.com/repos/meijp/chat-space/subscription","commits_url":"https://api.github.com/repos/meijp/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/meijp/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/meijp/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/meijp/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/meijp/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/meijp/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meijp/chat-space/merges","archive_url":"https://api.github.com/repos/meijp/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meijp/chat-space/downloads","issues_url":"https://api.github.com/repos/meijp/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/meijp/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/meijp/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/meijp/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meijp/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/meijp/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/meijp/chat-space/deployments","created_at":"2017-09-05T08:57:41Z","updated_at":"2017-09-05T08:57:52Z","pushed_at":"2017-09-29T03:20:34Z","git_url":"git://github.com/meijp/chat-space.git","ssh_url":"git@github.com:meijp/chat-space.git","clone_url":"https://github.com/meijp/chat-space.git","svn_url":"https://github.com/meijp/chat-space","homepage":null,"size":149,"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,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/meijp/chat-space/pulls/15"},"html":{"href":"https://github.com/meijp/chat-space/pull/15"},"issue":{"href":"https://api.github.com/repos/meijp/chat-space/issues/15"},"comments":{"href":"https://api.github.com/repos/meijp/chat-space/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/meijp/chat-space/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/meijp/chat-space/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/meijp/chat-space/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/meijp/chat-space/statuses/a9de2c2c43bed349030748d39a1b5f2e318d004b"}},"author_association":"OWNER"}}
{"actor":{"display_login":"meijp"}}