{"action":"created","comment":{"url":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/comments/39001037","id":39001037,"diff_hunk":"@@ -0,0 +1,28 @@\n+$(document).on(\"ready page:load\",function(){\n+  $(\"#like_button\").on(\"click\", function(){\n+    var prototypeId = $(this).data(\"prototype-id\");\n+    var existData = $(this).data(\"judge\");\n+    if(existData){\n+      $.ajax({\n+        type: \"DELETE\",\n+        url: \"/likes/\" + String(prototypeId),\n+        error: function(XMLHttpRequest, textStatus, errorThrown) {\n+          console.log(\"XMLHttpRequest : \" + XMLHttpRequest.status);\n+          console.log(\"textStatus : \" + textStatus);\n+          console.log(\"errorThrown : \" + errorThrown.message);\n+        }\n+      })\n+    } else {\n+      $.ajax({\n+        type: \"POST\",\n+        url: '/likes',\n+        data: \"prototype_id=\" + prototypeId,\n+        error: function(XMLHttpRequest, textStatus, errorThrown) {\n+          console.log(\"XMLHttpRequest : \" + XMLHttpRequest.status);\n+          console.log(\"textStatus : \" + textStatus);\n+          console.log(\"errorThrown : \" + errorThrown.message);","path":"app/assets/javascripts/like.js","position":23,"original_position":23,"commit_id":"4bee351d987fd9b5dde58e345d48888bd7538ed7","original_commit_id":"4bee351d987fd9b5dde58e345d48888bd7538ed7","user":{"login":"junjungoal","id":9709386,"avatar_url":"https://avatars.githubusercontent.com/u/9709386?v=3","gravatar_id":"","url":"https://api.github.com/users/junjungoal","html_url":"https://github.com/junjungoal","followers_url":"https://api.github.com/users/junjungoal/followers","following_url":"https://api.github.com/users/junjungoal/following{/other_user}","gists_url":"https://api.github.com/users/junjungoal/gists{/gist_id}","starred_url":"https://api.github.com/users/junjungoal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junjungoal/subscriptions","organizations_url":"https://api.github.com/users/junjungoal/orgs","repos_url":"https://api.github.com/users/junjungoal/repos","events_url":"https://api.github.com/users/junjungoal/events{/privacy}","received_events_url":"https://api.github.com/users/junjungoal/received_events","type":"User","site_admin":false},"body":"ここらへん、consoleよりalertの方がいいかと！","created_at":"2015-09-09T02:03:11Z","updated_at":"2015-09-09T02:03:11Z","html_url":"https://github.com/saino-katsutoshi/protospace/pull/15#discussion_r39001037","pull_request_url":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/comments/39001037"},"html":{"href":"https://github.com/saino-katsutoshi/protospace/pull/15#discussion_r39001037"},"pull_request":{"href":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/15","id":43956762,"html_url":"https://github.com/saino-katsutoshi/protospace/pull/15","diff_url":"https://github.com/saino-katsutoshi/protospace/pull/15.diff","patch_url":"https://github.com/saino-katsutoshi/protospace/pull/15.patch","issue_url":"https://api.github.com/repos/saino-katsutoshi/protospace/issues/15","number":15,"state":"open","locked":false,"title":"likeボタンをつくる","user":{"login":"saino-katsutoshi","id":12888685,"avatar_url":"https://avatars.githubusercontent.com/u/12888685?v=3","gravatar_id":"","url":"https://api.github.com/users/saino-katsutoshi","html_url":"https://github.com/saino-katsutoshi","followers_url":"https://api.github.com/users/saino-katsutoshi/followers","following_url":"https://api.github.com/users/saino-katsutoshi/following{/other_user}","gists_url":"https://api.github.com/users/saino-katsutoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/saino-katsutoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saino-katsutoshi/subscriptions","organizations_url":"https://api.github.com/users/saino-katsutoshi/orgs","repos_url":"https://api.github.com/users/saino-katsutoshi/repos","events_url":"https://api.github.com/users/saino-katsutoshi/events{/privacy}","received_events_url":"https://api.github.com/users/saino-katsutoshi/received_events","type":"User","site_admin":false},"body":"# what\r\n\r\nlikeボタンをajaxで作った\r\n\r\n# why\r\n\r\nprototypeの人気順をつくるため","created_at":"2015-09-02T06:05:28Z","updated_at":"2015-09-09T02:03:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21f5a00d9eeee6dee9d855f276208d611c3b9400","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/15/commits","review_comments_url":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/15/comments","review_comment_url":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/saino-katsutoshi/protospace/issues/15/comments","statuses_url":"https://api.github.com/repos/saino-katsutoshi/protospace/statuses/4bee351d987fd9b5dde58e345d48888bd7538ed7","head":{"label":"saino-katsutoshi:add_like_function","ref":"add_like_function","sha":"4bee351d987fd9b5dde58e345d48888bd7538ed7","user":{"login":"saino-katsutoshi","id":12888685,"avatar_url":"https://avatars.githubusercontent.com/u/12888685?v=3","gravatar_id":"","url":"https://api.github.com/users/saino-katsutoshi","html_url":"https://github.com/saino-katsutoshi","followers_url":"https://api.github.com/users/saino-katsutoshi/followers","following_url":"https://api.github.com/users/saino-katsutoshi/following{/other_user}","gists_url":"https://api.github.com/users/saino-katsutoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/saino-katsutoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saino-katsutoshi/subscriptions","organizations_url":"https://api.github.com/users/saino-katsutoshi/orgs","repos_url":"https://api.github.com/users/saino-katsutoshi/repos","events_url":"https://api.github.com/users/saino-katsutoshi/events{/privacy}","received_events_url":"https://api.github.com/users/saino-katsutoshi/received_events","type":"User","site_admin":false},"repo":{"id":40581085,"name":"protospace","full_name":"saino-katsutoshi/protospace","owner":{"login":"saino-katsutoshi","id":12888685,"avatar_url":"https://avatars.githubusercontent.com/u/12888685?v=3","gravatar_id":"","url":"https://api.github.com/users/saino-katsutoshi","html_url":"https://github.com/saino-katsutoshi","followers_url":"https://api.github.com/users/saino-katsutoshi/followers","following_url":"https://api.github.com/users/saino-katsutoshi/following{/other_user}","gists_url":"https://api.github.com/users/saino-katsutoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/saino-katsutoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saino-katsutoshi/subscriptions","organizations_url":"https://api.github.com/users/saino-katsutoshi/orgs","repos_url":"https://api.github.com/users/saino-katsutoshi/repos","events_url":"https://api.github.com/users/saino-katsutoshi/events{/privacy}","received_events_url":"https://api.github.com/users/saino-katsutoshi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/saino-katsutoshi/protospace","description":"","fork":false,"url":"https://api.github.com/repos/saino-katsutoshi/protospace","forks_url":"https://api.github.com/repos/saino-katsutoshi/protospace/forks","keys_url":"https://api.github.com/repos/saino-katsutoshi/protospace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saino-katsutoshi/protospace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saino-katsutoshi/protospace/teams","hooks_url":"https://api.github.com/repos/saino-katsutoshi/protospace/hooks","issue_events_url":"https://api.github.com/repos/saino-katsutoshi/protospace/issues/events{/number}","events_url":"https://api.github.com/repos/saino-katsutoshi/protospace/events","assignees_url":"https://api.github.com/repos/saino-katsutoshi/protospace/assignees{/user}","branches_url":"https://api.github.com/repos/saino-katsutoshi/protospace/branches{/branch}","tags_url":"https://api.github.com/repos/saino-katsutoshi/protospace/tags","blobs_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/refs{/sha}","trees_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saino-katsutoshi/protospace/statuses/{sha}","languages_url":"https://api.github.com/repos/saino-katsutoshi/protospace/languages","stargazers_url":"https://api.github.com/repos/saino-katsutoshi/protospace/stargazers","contributors_url":"https://api.github.com/repos/saino-katsutoshi/protospace/contributors","subscribers_url":"https://api.github.com/repos/saino-katsutoshi/protospace/subscribers","subscription_url":"https://api.github.com/repos/saino-katsutoshi/protospace/subscription","commits_url":"https://api.github.com/repos/saino-katsutoshi/protospace/commits{/sha}","git_commits_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/commits{/sha}","comments_url":"https://api.github.com/repos/saino-katsutoshi/protospace/comments{/number}","issue_comment_url":"https://api.github.com/repos/saino-katsutoshi/protospace/issues/comments{/number}","contents_url":"https://api.github.com/repos/saino-katsutoshi/protospace/contents/{+path}","compare_url":"https://api.github.com/repos/saino-katsutoshi/protospace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saino-katsutoshi/protospace/merges","archive_url":"https://api.github.com/repos/saino-katsutoshi/protospace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saino-katsutoshi/protospace/downloads","issues_url":"https://api.github.com/repos/saino-katsutoshi/protospace/issues{/number}","pulls_url":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls{/number}","milestones_url":"https://api.github.com/repos/saino-katsutoshi/protospace/milestones{/number}","notifications_url":"https://api.github.com/repos/saino-katsutoshi/protospace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saino-katsutoshi/protospace/labels{/name}","releases_url":"https://api.github.com/repos/saino-katsutoshi/protospace/releases{/id}","created_at":"2015-08-12T05:03:01Z","updated_at":"2015-08-12T05:04:24Z","pushed_at":"2015-09-08T17:03:55Z","git_url":"git://github.com/saino-katsutoshi/protospace.git","ssh_url":"git@github.com:saino-katsutoshi/protospace.git","clone_url":"https://github.com/saino-katsutoshi/protospace.git","svn_url":"https://github.com/saino-katsutoshi/protospace","homepage":"","size":1265,"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":"saino-katsutoshi:master","ref":"master","sha":"3ec63dbf07696287ed4bdeb974fe8238e8995452","user":{"login":"saino-katsutoshi","id":12888685,"avatar_url":"https://avatars.githubusercontent.com/u/12888685?v=3","gravatar_id":"","url":"https://api.github.com/users/saino-katsutoshi","html_url":"https://github.com/saino-katsutoshi","followers_url":"https://api.github.com/users/saino-katsutoshi/followers","following_url":"https://api.github.com/users/saino-katsutoshi/following{/other_user}","gists_url":"https://api.github.com/users/saino-katsutoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/saino-katsutoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saino-katsutoshi/subscriptions","organizations_url":"https://api.github.com/users/saino-katsutoshi/orgs","repos_url":"https://api.github.com/users/saino-katsutoshi/repos","events_url":"https://api.github.com/users/saino-katsutoshi/events{/privacy}","received_events_url":"https://api.github.com/users/saino-katsutoshi/received_events","type":"User","site_admin":false},"repo":{"id":40581085,"name":"protospace","full_name":"saino-katsutoshi/protospace","owner":{"login":"saino-katsutoshi","id":12888685,"avatar_url":"https://avatars.githubusercontent.com/u/12888685?v=3","gravatar_id":"","url":"https://api.github.com/users/saino-katsutoshi","html_url":"https://github.com/saino-katsutoshi","followers_url":"https://api.github.com/users/saino-katsutoshi/followers","following_url":"https://api.github.com/users/saino-katsutoshi/following{/other_user}","gists_url":"https://api.github.com/users/saino-katsutoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/saino-katsutoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saino-katsutoshi/subscriptions","organizations_url":"https://api.github.com/users/saino-katsutoshi/orgs","repos_url":"https://api.github.com/users/saino-katsutoshi/repos","events_url":"https://api.github.com/users/saino-katsutoshi/events{/privacy}","received_events_url":"https://api.github.com/users/saino-katsutoshi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/saino-katsutoshi/protospace","description":"","fork":false,"url":"https://api.github.com/repos/saino-katsutoshi/protospace","forks_url":"https://api.github.com/repos/saino-katsutoshi/protospace/forks","keys_url":"https://api.github.com/repos/saino-katsutoshi/protospace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saino-katsutoshi/protospace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saino-katsutoshi/protospace/teams","hooks_url":"https://api.github.com/repos/saino-katsutoshi/protospace/hooks","issue_events_url":"https://api.github.com/repos/saino-katsutoshi/protospace/issues/events{/number}","events_url":"https://api.github.com/repos/saino-katsutoshi/protospace/events","assignees_url":"https://api.github.com/repos/saino-katsutoshi/protospace/assignees{/user}","branches_url":"https://api.github.com/repos/saino-katsutoshi/protospace/branches{/branch}","tags_url":"https://api.github.com/repos/saino-katsutoshi/protospace/tags","blobs_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/refs{/sha}","trees_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saino-katsutoshi/protospace/statuses/{sha}","languages_url":"https://api.github.com/repos/saino-katsutoshi/protospace/languages","stargazers_url":"https://api.github.com/repos/saino-katsutoshi/protospace/stargazers","contributors_url":"https://api.github.com/repos/saino-katsutoshi/protospace/contributors","subscribers_url":"https://api.github.com/repos/saino-katsutoshi/protospace/subscribers","subscription_url":"https://api.github.com/repos/saino-katsutoshi/protospace/subscription","commits_url":"https://api.github.com/repos/saino-katsutoshi/protospace/commits{/sha}","git_commits_url":"https://api.github.com/repos/saino-katsutoshi/protospace/git/commits{/sha}","comments_url":"https://api.github.com/repos/saino-katsutoshi/protospace/comments{/number}","issue_comment_url":"https://api.github.com/repos/saino-katsutoshi/protospace/issues/comments{/number}","contents_url":"https://api.github.com/repos/saino-katsutoshi/protospace/contents/{+path}","compare_url":"https://api.github.com/repos/saino-katsutoshi/protospace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saino-katsutoshi/protospace/merges","archive_url":"https://api.github.com/repos/saino-katsutoshi/protospace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saino-katsutoshi/protospace/downloads","issues_url":"https://api.github.com/repos/saino-katsutoshi/protospace/issues{/number}","pulls_url":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls{/number}","milestones_url":"https://api.github.com/repos/saino-katsutoshi/protospace/milestones{/number}","notifications_url":"https://api.github.com/repos/saino-katsutoshi/protospace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saino-katsutoshi/protospace/labels{/name}","releases_url":"https://api.github.com/repos/saino-katsutoshi/protospace/releases{/id}","created_at":"2015-08-12T05:03:01Z","updated_at":"2015-08-12T05:04:24Z","pushed_at":"2015-09-08T17:03:55Z","git_url":"git://github.com/saino-katsutoshi/protospace.git","ssh_url":"git@github.com:saino-katsutoshi/protospace.git","clone_url":"https://github.com/saino-katsutoshi/protospace.git","svn_url":"https://github.com/saino-katsutoshi/protospace","homepage":"","size":1265,"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/saino-katsutoshi/protospace/pulls/15"},"html":{"href":"https://github.com/saino-katsutoshi/protospace/pull/15"},"issue":{"href":"https://api.github.com/repos/saino-katsutoshi/protospace/issues/15"},"comments":{"href":"https://api.github.com/repos/saino-katsutoshi/protospace/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/saino-katsutoshi/protospace/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/saino-katsutoshi/protospace/statuses/4bee351d987fd9b5dde58e345d48888bd7538ed7"}}}}