{"action":"created","comment":{"url":"https://api.github.com/repos/r-ume/chatspace/pulls/comments/89110478","pull_request_review_id":9658851,"id":89110478,"diff_hunk":"@@ -0,0 +1,108 @@\n+//jQueryを書くのは、本当に初めてで、あとで見て、わけわからなくなるので、chatspaceが完成するまで、丁寧にコメントを入れていく。\n+// http://qiita.com/mpyw/items/62e6e415f86eb30a5ff4 - jQueryからPHPのAPIを利用する。\n+\n+// shorthand for\n+// $(document).ready(function()(\n+// ));\n+$(function(){\n+\n+    // ユーザー検索(インクリメンタルサーチ)\n+    function usersSearch() {\n+        //'users.json'指定\n+        $.ajax('/users.json', {\n+            //'users.json'の情報をゲット\n+            method: 'GET',\n+             //jsonのなかで、emailカラムを見ているってことか？（要勉強)\n+             //idがuser-search-fieldのinputから、取得\n+            data: {\n+                name: $('#user-search-field').val()\n+            },\n+            dataType: 'json'\n+        })\n+        // ・ステータスコードは正常で、dataTypeで定義したようにパース出来たとき\n+        .done(function(json){\n+            var insertHtml = '';\n+            json.forEach(function(user){\n+                insertHtml += buildAddUserHTML(user);\n+            });\n+            $('#user-search-result').html(insertHtml);\n+        })\n+        // ・サーバからステータスコード400以上が返ってきたとき\n+        // ・ステータスコードは正常だが、dataTypeで定義したようにパース出来なかったとき\n+        // ・通信に失敗したとき\n+        .fail(function(){\n+            alert('エラー発生');\n+        })\n+    }\n+\n+    // ユーザー検索\n+    // idがuser-search-fieldのところが、\n+    //  change = フォーカスが外れたときに発生する\n+    //  keyupはカーソル移動や全角・半角の切り替えなどすべてのキー操作を拾う\n+    //　userSearch関数を起こす。\n+    $('#user-search-field').on('change keyup', usersSearch);\n+\n+\n+    // 結果をidがuser-search-fieldに出していく。","path":"app/assets/javascripts/chat_group.js","position":46,"original_position":46,"commit_id":"bdd3a90795621b643a6423e7938c690f97a80deb","original_commit_id":"bdd3a90795621b643a6423e7938c690f97a80deb","user":{"login":"yogoken","id":17805440,"avatar_url":"https://avatars.githubusercontent.com/u/17805440?v=3","gravatar_id":"","url":"https://api.github.com/users/yogoken","html_url":"https://github.com/yogoken","followers_url":"https://api.github.com/users/yogoken/followers","following_url":"https://api.github.com/users/yogoken/following{/other_user}","gists_url":"https://api.github.com/users/yogoken/gists{/gist_id}","starred_url":"https://api.github.com/users/yogoken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yogoken/subscriptions","organizations_url":"https://api.github.com/users/yogoken/orgs","repos_url":"https://api.github.com/users/yogoken/repos","events_url":"https://api.github.com/users/yogoken/events{/privacy}","received_events_url":"https://api.github.com/users/yogoken/received_events","type":"User","site_admin":false},"body":"日本語素晴らしいです！！めちゃくちゃ読みやすいですね！","created_at":"2016-11-22T13:03:50Z","updated_at":"2016-11-22T13:05:06Z","html_url":"https://github.com/r-ume/chatspace/pull/5#discussion_r89110478","pull_request_url":"https://api.github.com/repos/r-ume/chatspace/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/r-ume/chatspace/pulls/comments/89110478"},"html":{"href":"https://github.com/r-ume/chatspace/pull/5#discussion_r89110478"},"pull_request":{"href":"https://api.github.com/repos/r-ume/chatspace/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/r-ume/chatspace/pulls/5","id":94809264,"html_url":"https://github.com/r-ume/chatspace/pull/5","diff_url":"https://github.com/r-ume/chatspace/pull/5.diff","patch_url":"https://github.com/r-ume/chatspace/pull/5.patch","issue_url":"https://api.github.com/repos/r-ume/chatspace/issues/5","number":5,"state":"open","locked":false,"title":"Step/05 incremental search","user":{"login":"r-ume","id":22656143,"avatar_url":"https://avatars.githubusercontent.com/u/22656143?v=3","gravatar_id":"","url":"https://api.github.com/users/r-ume","html_url":"https://github.com/r-ume","followers_url":"https://api.github.com/users/r-ume/followers","following_url":"https://api.github.com/users/r-ume/following{/other_user}","gists_url":"https://api.github.com/users/r-ume/gists{/gist_id}","starred_url":"https://api.github.com/users/r-ume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-ume/subscriptions","organizations_url":"https://api.github.com/users/r-ume/orgs","repos_url":"https://api.github.com/users/r-ume/repos","events_url":"https://api.github.com/users/r-ume/events{/privacy}","received_events_url":"https://api.github.com/users/r-ume/received_events","type":"User","site_admin":false},"body":"内部apiとインクリメンタルサーチ作成","created_at":"2016-11-22T13:01:36Z","updated_at":"2016-11-22T13:05:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d536cf40c1e6be0ee0d1ddd9f403bb6e5c4c5ed5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/r-ume/chatspace/pulls/5/commits","review_comments_url":"https://api.github.com/repos/r-ume/chatspace/pulls/5/comments","review_comment_url":"https://api.github.com/repos/r-ume/chatspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/r-ume/chatspace/issues/5/comments","statuses_url":"https://api.github.com/repos/r-ume/chatspace/statuses/bdd3a90795621b643a6423e7938c690f97a80deb","head":{"label":"r-ume:step/05-incremental_search","ref":"step/05-incremental_search","sha":"bdd3a90795621b643a6423e7938c690f97a80deb","user":{"login":"r-ume","id":22656143,"avatar_url":"https://avatars.githubusercontent.com/u/22656143?v=3","gravatar_id":"","url":"https://api.github.com/users/r-ume","html_url":"https://github.com/r-ume","followers_url":"https://api.github.com/users/r-ume/followers","following_url":"https://api.github.com/users/r-ume/following{/other_user}","gists_url":"https://api.github.com/users/r-ume/gists{/gist_id}","starred_url":"https://api.github.com/users/r-ume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-ume/subscriptions","organizations_url":"https://api.github.com/users/r-ume/orgs","repos_url":"https://api.github.com/users/r-ume/repos","events_url":"https://api.github.com/users/r-ume/events{/privacy}","received_events_url":"https://api.github.com/users/r-ume/received_events","type":"User","site_admin":false},"repo":{"id":70593780,"name":"chatspace","full_name":"r-ume/chatspace","owner":{"login":"r-ume","id":22656143,"avatar_url":"https://avatars.githubusercontent.com/u/22656143?v=3","gravatar_id":"","url":"https://api.github.com/users/r-ume","html_url":"https://github.com/r-ume","followers_url":"https://api.github.com/users/r-ume/followers","following_url":"https://api.github.com/users/r-ume/following{/other_user}","gists_url":"https://api.github.com/users/r-ume/gists{/gist_id}","starred_url":"https://api.github.com/users/r-ume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-ume/subscriptions","organizations_url":"https://api.github.com/users/r-ume/orgs","repos_url":"https://api.github.com/users/r-ume/repos","events_url":"https://api.github.com/users/r-ume/events{/privacy}","received_events_url":"https://api.github.com/users/r-ume/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/r-ume/chatspace","description":null,"fork":false,"url":"https://api.github.com/repos/r-ume/chatspace","forks_url":"https://api.github.com/repos/r-ume/chatspace/forks","keys_url":"https://api.github.com/repos/r-ume/chatspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/r-ume/chatspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/r-ume/chatspace/teams","hooks_url":"https://api.github.com/repos/r-ume/chatspace/hooks","issue_events_url":"https://api.github.com/repos/r-ume/chatspace/issues/events{/number}","events_url":"https://api.github.com/repos/r-ume/chatspace/events","assignees_url":"https://api.github.com/repos/r-ume/chatspace/assignees{/user}","branches_url":"https://api.github.com/repos/r-ume/chatspace/branches{/branch}","tags_url":"https://api.github.com/repos/r-ume/chatspace/tags","blobs_url":"https://api.github.com/repos/r-ume/chatspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/r-ume/chatspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/r-ume/chatspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/r-ume/chatspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/r-ume/chatspace/statuses/{sha}","languages_url":"https://api.github.com/repos/r-ume/chatspace/languages","stargazers_url":"https://api.github.com/repos/r-ume/chatspace/stargazers","contributors_url":"https://api.github.com/repos/r-ume/chatspace/contributors","subscribers_url":"https://api.github.com/repos/r-ume/chatspace/subscribers","subscription_url":"https://api.github.com/repos/r-ume/chatspace/subscription","commits_url":"https://api.github.com/repos/r-ume/chatspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/r-ume/chatspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/r-ume/chatspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/r-ume/chatspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/r-ume/chatspace/contents/{+path}","compare_url":"https://api.github.com/repos/r-ume/chatspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/r-ume/chatspace/merges","archive_url":"https://api.github.com/repos/r-ume/chatspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/r-ume/chatspace/downloads","issues_url":"https://api.github.com/repos/r-ume/chatspace/issues{/number}","pulls_url":"https://api.github.com/repos/r-ume/chatspace/pulls{/number}","milestones_url":"https://api.github.com/repos/r-ume/chatspace/milestones{/number}","notifications_url":"https://api.github.com/repos/r-ume/chatspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/r-ume/chatspace/labels{/name}","releases_url":"https://api.github.com/repos/r-ume/chatspace/releases{/id}","deployments_url":"https://api.github.com/repos/r-ume/chatspace/deployments","created_at":"2016-10-11T13:01:57Z","updated_at":"2016-10-12T00:11:24Z","pushed_at":"2016-11-22T13:01:36Z","git_url":"git://github.com/r-ume/chatspace.git","ssh_url":"git@github.com:r-ume/chatspace.git","clone_url":"https://github.com/r-ume/chatspace.git","svn_url":"https://github.com/r-ume/chatspace","homepage":null,"size":108,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":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":"r-ume:master","ref":"master","sha":"1c5e10b636168b7b5d78f4d8061ab16ca355c1e4","user":{"login":"r-ume","id":22656143,"avatar_url":"https://avatars.githubusercontent.com/u/22656143?v=3","gravatar_id":"","url":"https://api.github.com/users/r-ume","html_url":"https://github.com/r-ume","followers_url":"https://api.github.com/users/r-ume/followers","following_url":"https://api.github.com/users/r-ume/following{/other_user}","gists_url":"https://api.github.com/users/r-ume/gists{/gist_id}","starred_url":"https://api.github.com/users/r-ume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-ume/subscriptions","organizations_url":"https://api.github.com/users/r-ume/orgs","repos_url":"https://api.github.com/users/r-ume/repos","events_url":"https://api.github.com/users/r-ume/events{/privacy}","received_events_url":"https://api.github.com/users/r-ume/received_events","type":"User","site_admin":false},"repo":{"id":70593780,"name":"chatspace","full_name":"r-ume/chatspace","owner":{"login":"r-ume","id":22656143,"avatar_url":"https://avatars.githubusercontent.com/u/22656143?v=3","gravatar_id":"","url":"https://api.github.com/users/r-ume","html_url":"https://github.com/r-ume","followers_url":"https://api.github.com/users/r-ume/followers","following_url":"https://api.github.com/users/r-ume/following{/other_user}","gists_url":"https://api.github.com/users/r-ume/gists{/gist_id}","starred_url":"https://api.github.com/users/r-ume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-ume/subscriptions","organizations_url":"https://api.github.com/users/r-ume/orgs","repos_url":"https://api.github.com/users/r-ume/repos","events_url":"https://api.github.com/users/r-ume/events{/privacy}","received_events_url":"https://api.github.com/users/r-ume/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/r-ume/chatspace","description":null,"fork":false,"url":"https://api.github.com/repos/r-ume/chatspace","forks_url":"https://api.github.com/repos/r-ume/chatspace/forks","keys_url":"https://api.github.com/repos/r-ume/chatspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/r-ume/chatspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/r-ume/chatspace/teams","hooks_url":"https://api.github.com/repos/r-ume/chatspace/hooks","issue_events_url":"https://api.github.com/repos/r-ume/chatspace/issues/events{/number}","events_url":"https://api.github.com/repos/r-ume/chatspace/events","assignees_url":"https://api.github.com/repos/r-ume/chatspace/assignees{/user}","branches_url":"https://api.github.com/repos/r-ume/chatspace/branches{/branch}","tags_url":"https://api.github.com/repos/r-ume/chatspace/tags","blobs_url":"https://api.github.com/repos/r-ume/chatspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/r-ume/chatspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/r-ume/chatspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/r-ume/chatspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/r-ume/chatspace/statuses/{sha}","languages_url":"https://api.github.com/repos/r-ume/chatspace/languages","stargazers_url":"https://api.github.com/repos/r-ume/chatspace/stargazers","contributors_url":"https://api.github.com/repos/r-ume/chatspace/contributors","subscribers_url":"https://api.github.com/repos/r-ume/chatspace/subscribers","subscription_url":"https://api.github.com/repos/r-ume/chatspace/subscription","commits_url":"https://api.github.com/repos/r-ume/chatspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/r-ume/chatspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/r-ume/chatspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/r-ume/chatspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/r-ume/chatspace/contents/{+path}","compare_url":"https://api.github.com/repos/r-ume/chatspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/r-ume/chatspace/merges","archive_url":"https://api.github.com/repos/r-ume/chatspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/r-ume/chatspace/downloads","issues_url":"https://api.github.com/repos/r-ume/chatspace/issues{/number}","pulls_url":"https://api.github.com/repos/r-ume/chatspace/pulls{/number}","milestones_url":"https://api.github.com/repos/r-ume/chatspace/milestones{/number}","notifications_url":"https://api.github.com/repos/r-ume/chatspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/r-ume/chatspace/labels{/name}","releases_url":"https://api.github.com/repos/r-ume/chatspace/releases{/id}","deployments_url":"https://api.github.com/repos/r-ume/chatspace/deployments","created_at":"2016-10-11T13:01:57Z","updated_at":"2016-10-12T00:11:24Z","pushed_at":"2016-11-22T13:01:36Z","git_url":"git://github.com/r-ume/chatspace.git","ssh_url":"git@github.com:r-ume/chatspace.git","clone_url":"https://github.com/r-ume/chatspace.git","svn_url":"https://github.com/r-ume/chatspace","homepage":null,"size":108,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":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/r-ume/chatspace/pulls/5"},"html":{"href":"https://github.com/r-ume/chatspace/pull/5"},"issue":{"href":"https://api.github.com/repos/r-ume/chatspace/issues/5"},"comments":{"href":"https://api.github.com/repos/r-ume/chatspace/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/r-ume/chatspace/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/r-ume/chatspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/r-ume/chatspace/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/r-ume/chatspace/statuses/bdd3a90795621b643a6423e7938c690f97a80deb"}}}}
{"actor":{"display_login":"yogoken"}}