{"action":"created","comment":{"url":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/comments/170446084","pull_request_review_id":99136128,"id":170446084,"diff_hunk":"@@ -0,0 +1,53 @@\n+$(function(){\n+\n+  function buildHTML(message){\n+    if (message.is_content_present){\n+      var content = `${message.content} `\n+    }else{\n+      var content = ''\n+    }\n+    if (message.is_image_present){\n+      var image =`<img src='${message.image.url}'> `\n+    }else{\n+      var image = ''\n+    }\n+\n+    var html = `<div class = \"main-contents__body__list__message\">\n+                  <div class = \"main-contents__body__list__message__name\">\n+                    ${message.user_name}\n+                  </div>\n+                  <div class = \"main-contents__body__list__message__data\">\n+                    ${message.date}\n+                  </div>\n+                  <div class = \"main-contents__body__list__message__body\">\n+                    ${content}\n+                    ${image}\n+                  </div>\n+                </div>`\n+    return html;\n+  }\n+\n+  $('#new_message').on('submit', function(e){\n+    e.preventDefault();\n+    var formData = new FormData(this);\n+    var url = $(this).attr('action');\n+    $.ajax({\n+      url: url,\n+      type: \"POST\",\n+      data: formData,\n+      dataType: 'json',\n+      processData: false,\n+      contentType: false\n+    })\n+    .done(function(data){\n+      var html = buildHTML(data);\n+      $('.main-contents__body__list').append(html);\n+      $(\".main-contents__body\").animate({scrollTop:$('.main-contents__body__list')[0].scrollHeight});\n+      $('.textbox').val('');","path":"app/assets/javascripts/message.js","position":46,"original_position":46,"commit_id":"6c1ffed7b8dc42cc05528250863383c3712cddd7","original_commit_id":"6c1ffed7b8dc42cc05528250863383c3712cddd7","user":{"login":"takeru56","id":25771265,"avatar_url":"https://avatars3.githubusercontent.com/u/25771265?v=4","gravatar_id":"","url":"https://api.github.com/users/takeru56","html_url":"https://github.com/takeru56","followers_url":"https://api.github.com/users/takeru56/followers","following_url":"https://api.github.com/users/takeru56/following{/other_user}","gists_url":"https://api.github.com/users/takeru56/gists{/gist_id}","starred_url":"https://api.github.com/users/takeru56/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takeru56/subscriptions","organizations_url":"https://api.github.com/users/takeru56/orgs","repos_url":"https://api.github.com/users/takeru56/repos","events_url":"https://api.github.com/users/takeru56/events{/privacy}","received_events_url":"https://api.github.com/users/takeru56/received_events","type":"User","site_admin":false},"body":"毎回ページをリロードしなくても連投できるようにしましょう。","created_at":"2018-02-25T08:53:27Z","updated_at":"2018-02-25T08:55:25Z","html_url":"https://github.com/YukiYanagikubo/chat-space/pull/13#discussion_r170446084","pull_request_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/13","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/comments/170446084"},"html":{"href":"https://github.com/YukiYanagikubo/chat-space/pull/13#discussion_r170446084"},"pull_request":{"href":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/13","id":171219967,"html_url":"https://github.com/YukiYanagikubo/chat-space/pull/13","diff_url":"https://github.com/YukiYanagikubo/chat-space/pull/13.diff","patch_url":"https://github.com/YukiYanagikubo/chat-space/pull/13.patch","issue_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues/13","number":13,"state":"open","locked":false,"title":"メッセージ送信機能の非同期通信化","user":{"login":"YukiYanagikubo","id":36324459,"avatar_url":"https://avatars1.githubusercontent.com/u/36324459?v=4","gravatar_id":"","url":"https://api.github.com/users/YukiYanagikubo","html_url":"https://github.com/YukiYanagikubo","followers_url":"https://api.github.com/users/YukiYanagikubo/followers","following_url":"https://api.github.com/users/YukiYanagikubo/following{/other_user}","gists_url":"https://api.github.com/users/YukiYanagikubo/gists{/gist_id}","starred_url":"https://api.github.com/users/YukiYanagikubo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YukiYanagikubo/subscriptions","organizations_url":"https://api.github.com/users/YukiYanagikubo/orgs","repos_url":"https://api.github.com/users/YukiYanagikubo/repos","events_url":"https://api.github.com/users/YukiYanagikubo/events{/privacy}","received_events_url":"https://api.github.com/users/YukiYanagikubo/received_events","type":"User","site_admin":false},"body":"what\r\nメッセージ送信機能の非同期通信化の実装\r\n\r\nwhy\r\n必須機能のため","created_at":"2018-02-25T08:47:47Z","updated_at":"2018-02-25T08:55:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a95051caf7dc3debe8ca6c8990933b019dff7625","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/13/commits","review_comments_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/13/comments","review_comment_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/comments{/number}","comments_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues/13/comments","statuses_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/statuses/6c1ffed7b8dc42cc05528250863383c3712cddd7","head":{"label":"YukiYanagikubo:メッセージ送信機能の非同期通信化","ref":"メッセージ送信機能の非同期通信化","sha":"6c1ffed7b8dc42cc05528250863383c3712cddd7","user":{"login":"YukiYanagikubo","id":36324459,"avatar_url":"https://avatars1.githubusercontent.com/u/36324459?v=4","gravatar_id":"","url":"https://api.github.com/users/YukiYanagikubo","html_url":"https://github.com/YukiYanagikubo","followers_url":"https://api.github.com/users/YukiYanagikubo/followers","following_url":"https://api.github.com/users/YukiYanagikubo/following{/other_user}","gists_url":"https://api.github.com/users/YukiYanagikubo/gists{/gist_id}","starred_url":"https://api.github.com/users/YukiYanagikubo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YukiYanagikubo/subscriptions","organizations_url":"https://api.github.com/users/YukiYanagikubo/orgs","repos_url":"https://api.github.com/users/YukiYanagikubo/repos","events_url":"https://api.github.com/users/YukiYanagikubo/events{/privacy}","received_events_url":"https://api.github.com/users/YukiYanagikubo/received_events","type":"User","site_admin":false},"repo":{"id":121411688,"name":"chat-space","full_name":"YukiYanagikubo/chat-space","owner":{"login":"YukiYanagikubo","id":36324459,"avatar_url":"https://avatars1.githubusercontent.com/u/36324459?v=4","gravatar_id":"","url":"https://api.github.com/users/YukiYanagikubo","html_url":"https://github.com/YukiYanagikubo","followers_url":"https://api.github.com/users/YukiYanagikubo/followers","following_url":"https://api.github.com/users/YukiYanagikubo/following{/other_user}","gists_url":"https://api.github.com/users/YukiYanagikubo/gists{/gist_id}","starred_url":"https://api.github.com/users/YukiYanagikubo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YukiYanagikubo/subscriptions","organizations_url":"https://api.github.com/users/YukiYanagikubo/orgs","repos_url":"https://api.github.com/users/YukiYanagikubo/repos","events_url":"https://api.github.com/users/YukiYanagikubo/events{/privacy}","received_events_url":"https://api.github.com/users/YukiYanagikubo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/YukiYanagikubo/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/YukiYanagikubo/chat-space","forks_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/forks","keys_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/teams","hooks_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/hooks","issue_events_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/events","assignees_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/tags","blobs_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/languages","stargazers_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/stargazers","contributors_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/contributors","subscribers_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/subscribers","subscription_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/subscription","commits_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/merges","archive_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/downloads","issues_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/deployments","created_at":"2018-02-13T17:17:19Z","updated_at":"2018-02-14T03:26:39Z","pushed_at":"2018-02-25T08:47:48Z","git_url":"git://github.com/YukiYanagikubo/chat-space.git","ssh_url":"git@github.com:YukiYanagikubo/chat-space.git","clone_url":"https://github.com/YukiYanagikubo/chat-space.git","svn_url":"https://github.com/YukiYanagikubo/chat-space","homepage":null,"size":114,"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":"YukiYanagikubo:master","ref":"master","sha":"d069098de4aba0e04765b5d4209cfbf211bbd6b5","user":{"login":"YukiYanagikubo","id":36324459,"avatar_url":"https://avatars1.githubusercontent.com/u/36324459?v=4","gravatar_id":"","url":"https://api.github.com/users/YukiYanagikubo","html_url":"https://github.com/YukiYanagikubo","followers_url":"https://api.github.com/users/YukiYanagikubo/followers","following_url":"https://api.github.com/users/YukiYanagikubo/following{/other_user}","gists_url":"https://api.github.com/users/YukiYanagikubo/gists{/gist_id}","starred_url":"https://api.github.com/users/YukiYanagikubo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YukiYanagikubo/subscriptions","organizations_url":"https://api.github.com/users/YukiYanagikubo/orgs","repos_url":"https://api.github.com/users/YukiYanagikubo/repos","events_url":"https://api.github.com/users/YukiYanagikubo/events{/privacy}","received_events_url":"https://api.github.com/users/YukiYanagikubo/received_events","type":"User","site_admin":false},"repo":{"id":121411688,"name":"chat-space","full_name":"YukiYanagikubo/chat-space","owner":{"login":"YukiYanagikubo","id":36324459,"avatar_url":"https://avatars1.githubusercontent.com/u/36324459?v=4","gravatar_id":"","url":"https://api.github.com/users/YukiYanagikubo","html_url":"https://github.com/YukiYanagikubo","followers_url":"https://api.github.com/users/YukiYanagikubo/followers","following_url":"https://api.github.com/users/YukiYanagikubo/following{/other_user}","gists_url":"https://api.github.com/users/YukiYanagikubo/gists{/gist_id}","starred_url":"https://api.github.com/users/YukiYanagikubo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YukiYanagikubo/subscriptions","organizations_url":"https://api.github.com/users/YukiYanagikubo/orgs","repos_url":"https://api.github.com/users/YukiYanagikubo/repos","events_url":"https://api.github.com/users/YukiYanagikubo/events{/privacy}","received_events_url":"https://api.github.com/users/YukiYanagikubo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/YukiYanagikubo/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/YukiYanagikubo/chat-space","forks_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/forks","keys_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/teams","hooks_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/hooks","issue_events_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/events","assignees_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/tags","blobs_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/languages","stargazers_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/stargazers","contributors_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/contributors","subscribers_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/subscribers","subscription_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/subscription","commits_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/merges","archive_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/downloads","issues_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/YukiYanagikubo/chat-space/deployments","created_at":"2018-02-13T17:17:19Z","updated_at":"2018-02-14T03:26:39Z","pushed_at":"2018-02-25T08:47:48Z","git_url":"git://github.com/YukiYanagikubo/chat-space.git","ssh_url":"git@github.com:YukiYanagikubo/chat-space.git","clone_url":"https://github.com/YukiYanagikubo/chat-space.git","svn_url":"https://github.com/YukiYanagikubo/chat-space","homepage":null,"size":114,"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/YukiYanagikubo/chat-space/pulls/13"},"html":{"href":"https://github.com/YukiYanagikubo/chat-space/pull/13"},"issue":{"href":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues/13"},"comments":{"href":"https://api.github.com/repos/YukiYanagikubo/chat-space/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/YukiYanagikubo/chat-space/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/YukiYanagikubo/chat-space/statuses/6c1ffed7b8dc42cc05528250863383c3712cddd7"}},"author_association":"OWNER"}}
{"actor":{"display_login":"takeru56"}}