{"action":"created","comment":{"url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/comments/90842929","pull_request_review_id":11356637,"id":90842929,"diff_hunk":"@@ -1,4 +1,63 @@\n-$(function() {\n+$(document).on('turbolinks:load', function(){\n+  var all_message_num = $('li').length;\n+\n+  setInterval(function(){\n+    reload();\n+  },5000);\n+\n+  function reload(){\n+    $.ajax({\n+    type: 'GET',\n+    url: '/messages.json',\n+    dataType: 'json'\n+  }).done(function(data) {\n+    if (all_message_num !== data.length)\n+      var data_num = data.length;\n+      var messages_num = all_message_num;\n+      all_message_num = data.length;\n+\n+      for (var i = messages_num; i < data_num; i++){\n+        var html_tag = reloadHTML(data[i]);\n+      $('ul.message__main__groups').append(html_tag);\n+    };\n+    });\n+  };\n+\n+  function body_image_upload(message){\n+\n+    if (message.image == null) {\n+      var body =\n+    '<p class=\"message__main__comment\">' +\n+    message.body +\n+    '</p>';\n+    return body;\n+    } else {\n+    var images_body =\n+    '<p class=\"message__main__comment\">' +\n+        message.body +\n+    '</p>'+\n+    '<img src=\"' + message.image +'\">' +\n+    '<p>';\n+    return images_body;\n+  }\n+}\n+\n+  function reloadHTML(message) {","path":"app/assets/javascripts/message.js","position":46,"original_position":46,"commit_id":"3068bf862a6e694695bfb82ee06838db83a8bb78","original_commit_id":"3068bf862a6e694695bfb82ee06838db83a8bb78","user":{"login":"kazuhiro-ootani","id":22571219,"avatar_url":"https://avatars.githubusercontent.com/u/22571219?v=3","gravatar_id":"","url":"https://api.github.com/users/kazuhiro-ootani","html_url":"https://github.com/kazuhiro-ootani","followers_url":"https://api.github.com/users/kazuhiro-ootani/followers","following_url":"https://api.github.com/users/kazuhiro-ootani/following{/other_user}","gists_url":"https://api.github.com/users/kazuhiro-ootani/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuhiro-ootani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuhiro-ootani/subscriptions","organizations_url":"https://api.github.com/users/kazuhiro-ootani/orgs","repos_url":"https://api.github.com/users/kazuhiro-ootani/repos","events_url":"https://api.github.com/users/kazuhiro-ootani/events{/privacy}","received_events_url":"https://api.github.com/users/kazuhiro-ootani/received_events","type":"User","site_admin":false},"body":"buildNewMessageComponent\r\nに関数名を変更しました！","created_at":"2016-12-05T11:01:51Z","updated_at":"2016-12-05T11:01:51Z","html_url":"https://github.com/kazuhiro-ootani/chat-space/pull/21#discussion_r90842929","pull_request_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/comments/90842929"},"html":{"href":"https://github.com/kazuhiro-ootani/chat-space/pull/21#discussion_r90842929"},"pull_request":{"href":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/21","id":96471749,"html_url":"https://github.com/kazuhiro-ootani/chat-space/pull/21","diff_url":"https://github.com/kazuhiro-ootani/chat-space/pull/21.diff","patch_url":"https://github.com/kazuhiro-ootani/chat-space/pull/21.patch","issue_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues/21","number":21,"state":"open","locked":false,"title":"自動更新機能の追加","user":{"login":"kazuhiro-ootani","id":22571219,"avatar_url":"https://avatars.githubusercontent.com/u/22571219?v=3","gravatar_id":"","url":"https://api.github.com/users/kazuhiro-ootani","html_url":"https://github.com/kazuhiro-ootani","followers_url":"https://api.github.com/users/kazuhiro-ootani/followers","following_url":"https://api.github.com/users/kazuhiro-ootani/following{/other_user}","gists_url":"https://api.github.com/users/kazuhiro-ootani/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuhiro-ootani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuhiro-ootani/subscriptions","organizations_url":"https://api.github.com/users/kazuhiro-ootani/orgs","repos_url":"https://api.github.com/users/kazuhiro-ootani/repos","events_url":"https://api.github.com/users/kazuhiro-ootani/events{/privacy}","received_events_url":"https://api.github.com/users/kazuhiro-ootani/received_events","type":"User","site_admin":false},"body":"# WHAT\nmessage.jsに自動更新のための記述を追加\njson.builderを作成\nimageがnullだった場合表示させないような記述を追加\nroutes.rb,controllerを微調整\n\n# WHY\nチャットの重要な機能","created_at":"2016-12-05T05:35:53Z","updated_at":"2016-12-05T11:01:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d21c923de013be58ccfc77cc7cfc5c35507c04d7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/21/commits","review_comments_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/21/comments","review_comment_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues/21/comments","statuses_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/statuses/3068bf862a6e694695bfb82ee06838db83a8bb78","head":{"label":"kazuhiro-ootani:auto-load","ref":"auto-load","sha":"3068bf862a6e694695bfb82ee06838db83a8bb78","user":{"login":"kazuhiro-ootani","id":22571219,"avatar_url":"https://avatars.githubusercontent.com/u/22571219?v=3","gravatar_id":"","url":"https://api.github.com/users/kazuhiro-ootani","html_url":"https://github.com/kazuhiro-ootani","followers_url":"https://api.github.com/users/kazuhiro-ootani/followers","following_url":"https://api.github.com/users/kazuhiro-ootani/following{/other_user}","gists_url":"https://api.github.com/users/kazuhiro-ootani/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuhiro-ootani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuhiro-ootani/subscriptions","organizations_url":"https://api.github.com/users/kazuhiro-ootani/orgs","repos_url":"https://api.github.com/users/kazuhiro-ootani/repos","events_url":"https://api.github.com/users/kazuhiro-ootani/events{/privacy}","received_events_url":"https://api.github.com/users/kazuhiro-ootani/received_events","type":"User","site_admin":false},"repo":{"id":73674948,"name":"chat-space","full_name":"kazuhiro-ootani/chat-space","owner":{"login":"kazuhiro-ootani","id":22571219,"avatar_url":"https://avatars.githubusercontent.com/u/22571219?v=3","gravatar_id":"","url":"https://api.github.com/users/kazuhiro-ootani","html_url":"https://github.com/kazuhiro-ootani","followers_url":"https://api.github.com/users/kazuhiro-ootani/followers","following_url":"https://api.github.com/users/kazuhiro-ootani/following{/other_user}","gists_url":"https://api.github.com/users/kazuhiro-ootani/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuhiro-ootani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuhiro-ootani/subscriptions","organizations_url":"https://api.github.com/users/kazuhiro-ootani/orgs","repos_url":"https://api.github.com/users/kazuhiro-ootani/repos","events_url":"https://api.github.com/users/kazuhiro-ootani/events{/privacy}","received_events_url":"https://api.github.com/users/kazuhiro-ootani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kazuhiro-ootani/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/kazuhiro-ootani/chat-space","forks_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/forks","keys_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/teams","hooks_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/hooks","issue_events_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/events","assignees_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/tags","blobs_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/languages","stargazers_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/stargazers","contributors_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/contributors","subscribers_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/subscribers","subscription_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/subscription","commits_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/merges","archive_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/downloads","issues_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/deployments","created_at":"2016-11-14T06:39:57Z","updated_at":"2016-11-14T06:41:41Z","pushed_at":"2016-12-05T10:33:44Z","git_url":"git://github.com/kazuhiro-ootani/chat-space.git","ssh_url":"git@github.com:kazuhiro-ootani/chat-space.git","clone_url":"https://github.com/kazuhiro-ootani/chat-space.git","svn_url":"https://github.com/kazuhiro-ootani/chat-space","homepage":null,"size":124,"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":"kazuhiro-ootani:master","ref":"master","sha":"fa22931bb50319e15dfa6d5a2b7832ea970cd514","user":{"login":"kazuhiro-ootani","id":22571219,"avatar_url":"https://avatars.githubusercontent.com/u/22571219?v=3","gravatar_id":"","url":"https://api.github.com/users/kazuhiro-ootani","html_url":"https://github.com/kazuhiro-ootani","followers_url":"https://api.github.com/users/kazuhiro-ootani/followers","following_url":"https://api.github.com/users/kazuhiro-ootani/following{/other_user}","gists_url":"https://api.github.com/users/kazuhiro-ootani/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuhiro-ootani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuhiro-ootani/subscriptions","organizations_url":"https://api.github.com/users/kazuhiro-ootani/orgs","repos_url":"https://api.github.com/users/kazuhiro-ootani/repos","events_url":"https://api.github.com/users/kazuhiro-ootani/events{/privacy}","received_events_url":"https://api.github.com/users/kazuhiro-ootani/received_events","type":"User","site_admin":false},"repo":{"id":73674948,"name":"chat-space","full_name":"kazuhiro-ootani/chat-space","owner":{"login":"kazuhiro-ootani","id":22571219,"avatar_url":"https://avatars.githubusercontent.com/u/22571219?v=3","gravatar_id":"","url":"https://api.github.com/users/kazuhiro-ootani","html_url":"https://github.com/kazuhiro-ootani","followers_url":"https://api.github.com/users/kazuhiro-ootani/followers","following_url":"https://api.github.com/users/kazuhiro-ootani/following{/other_user}","gists_url":"https://api.github.com/users/kazuhiro-ootani/gists{/gist_id}","starred_url":"https://api.github.com/users/kazuhiro-ootani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazuhiro-ootani/subscriptions","organizations_url":"https://api.github.com/users/kazuhiro-ootani/orgs","repos_url":"https://api.github.com/users/kazuhiro-ootani/repos","events_url":"https://api.github.com/users/kazuhiro-ootani/events{/privacy}","received_events_url":"https://api.github.com/users/kazuhiro-ootani/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kazuhiro-ootani/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/kazuhiro-ootani/chat-space","forks_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/forks","keys_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/teams","hooks_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/hooks","issue_events_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/events","assignees_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/tags","blobs_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/languages","stargazers_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/stargazers","contributors_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/contributors","subscribers_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/subscribers","subscription_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/subscription","commits_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/merges","archive_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/downloads","issues_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/kazuhiro-ootani/chat-space/deployments","created_at":"2016-11-14T06:39:57Z","updated_at":"2016-11-14T06:41:41Z","pushed_at":"2016-12-05T10:33:44Z","git_url":"git://github.com/kazuhiro-ootani/chat-space.git","ssh_url":"git@github.com:kazuhiro-ootani/chat-space.git","clone_url":"https://github.com/kazuhiro-ootani/chat-space.git","svn_url":"https://github.com/kazuhiro-ootani/chat-space","homepage":null,"size":124,"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/kazuhiro-ootani/chat-space/pulls/21"},"html":{"href":"https://github.com/kazuhiro-ootani/chat-space/pull/21"},"issue":{"href":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues/21"},"comments":{"href":"https://api.github.com/repos/kazuhiro-ootani/chat-space/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kazuhiro-ootani/chat-space/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/kazuhiro-ootani/chat-space/statuses/3068bf862a6e694695bfb82ee06838db83a8bb78"}}}}
{"actor":{"display_login":"kazuhiro-ootani"}}