{"action":"created","comment":{"url":"https://api.github.com/repos/Firechess/firechess/pulls/comments/62443835","id":62443835,"diff_hunk":"@@ -0,0 +1,206 @@\n+$(function() {\n+  /* global chessboard */\n+  /* global fabric */\n+  /* global $ */\n+  /* global _ */\n+  // chessboard is global so that it can be accessed by firebase.js\n+  chessboard = new fabric.Canvas('chessboard', {","path":"app/assets/javascripts/chessboard.js","position":7,"original_position":7,"commit_id":"132a064e87a321c470796b39255d196e31aead88","original_commit_id":"132a064e87a321c470796b39255d196e31aead88","user":{"login":"lasley","id":7397578,"avatar_url":"https://avatars.githubusercontent.com/u/7397578?v=3","gravatar_id":"","url":"https://api.github.com/users/lasley","html_url":"https://github.com/lasley","followers_url":"https://api.github.com/users/lasley/followers","following_url":"https://api.github.com/users/lasley/following{/other_user}","gists_url":"https://api.github.com/users/lasley/gists{/gist_id}","starred_url":"https://api.github.com/users/lasley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasley/subscriptions","organizations_url":"https://api.github.com/users/lasley/orgs","repos_url":"https://api.github.com/users/lasley/repos","events_url":"https://api.github.com/users/lasley/events{/privacy}","received_events_url":"https://api.github.com/users/lasley/received_events","type":"User","site_admin":false},"body":"Or maybe the above point is still valid!","created_at":"2016-05-09T01:55:57Z","updated_at":"2016-05-09T01:55:57Z","html_url":"https://github.com/Firechess/firechess/pull/48#discussion_r62443835","pull_request_url":"https://api.github.com/repos/Firechess/firechess/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/Firechess/firechess/pulls/comments/62443835"},"html":{"href":"https://github.com/Firechess/firechess/pull/48#discussion_r62443835"},"pull_request":{"href":"https://api.github.com/repos/Firechess/firechess/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/Firechess/firechess/pulls/48","id":69229003,"html_url":"https://github.com/Firechess/firechess/pull/48","diff_url":"https://github.com/Firechess/firechess/pull/48.diff","patch_url":"https://github.com/Firechess/firechess/pull/48.patch","issue_url":"https://api.github.com/repos/Firechess/firechess/issues/48","number":48,"state":"open","locked":false,"title":"Replace <table> chessboard with <canvas>/fabric.js chessboard","user":{"login":"rjdellecese","id":13547385,"avatar_url":"https://avatars.githubusercontent.com/u/13547385?v=3","gravatar_id":"","url":"https://api.github.com/users/rjdellecese","html_url":"https://github.com/rjdellecese","followers_url":"https://api.github.com/users/rjdellecese/followers","following_url":"https://api.github.com/users/rjdellecese/following{/other_user}","gists_url":"https://api.github.com/users/rjdellecese/gists{/gist_id}","starred_url":"https://api.github.com/users/rjdellecese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjdellecese/subscriptions","organizations_url":"https://api.github.com/users/rjdellecese/orgs","repos_url":"https://api.github.com/users/rjdellecese/repos","events_url":"https://api.github.com/users/rjdellecese/events{/privacy}","received_events_url":"https://api.github.com/users/rjdellecese/received_events","type":"User","site_admin":false},"body":"The bulk of this PR is `chessboard.js` and the modifications necessary to make it functional.\r\n\r\nThese modifications include:\r\n\r\n- Replacing piece `representation`s stored as HTML codes with the actual UTF-8 chess piece characters\r\n- Creating a new JSON response option for the `show` action of the `games_controller`\r\n- Updates to `firebase.js` that allow it to receive moves made and represent them on the board in real-time\r\n\r\nHere are a few features the board still lacks:\r\n\r\n- **Piece movement on mobile devices.** At least in my testing, the 'tap' event doesn't seem to work with my implementation of fabric.js. I've done a bit of research into why that might be, but have yet to figure it out. I suppose this might be considered a bug as well?\r\n- **Castling and en passant animation.** The old board, however, also lacked this.\r\n\r\nAnd I've also noticed that navigating to another page after loading the board and then clicking the back button in the browser brings you to a page displaying the results of the JSON get request (the text of all of the pieces for that game).\r\n\r\n@lasley I have a feeling my JS could use a lot of work, and also none of it is tested. Should it be? What would be the best way to do that?","created_at":"2016-05-07T01:27:39Z","updated_at":"2016-05-09T01:55:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74f2cdbddcc3c4baac6aa3f89c213b8e4acbdd89","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Firechess/firechess/pulls/48/commits","review_comments_url":"https://api.github.com/repos/Firechess/firechess/pulls/48/comments","review_comment_url":"https://api.github.com/repos/Firechess/firechess/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Firechess/firechess/issues/48/comments","statuses_url":"https://api.github.com/repos/Firechess/firechess/statuses/132a064e87a321c470796b39255d196e31aead88","head":{"label":"Firechess:ui-changes","ref":"ui-changes","sha":"132a064e87a321c470796b39255d196e31aead88","user":{"login":"Firechess","id":16727581,"avatar_url":"https://avatars.githubusercontent.com/u/16727581?v=3","gravatar_id":"","url":"https://api.github.com/users/Firechess","html_url":"https://github.com/Firechess","followers_url":"https://api.github.com/users/Firechess/followers","following_url":"https://api.github.com/users/Firechess/following{/other_user}","gists_url":"https://api.github.com/users/Firechess/gists{/gist_id}","starred_url":"https://api.github.com/users/Firechess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firechess/subscriptions","organizations_url":"https://api.github.com/users/Firechess/orgs","repos_url":"https://api.github.com/users/Firechess/repos","events_url":"https://api.github.com/users/Firechess/events{/privacy}","received_events_url":"https://api.github.com/users/Firechess/received_events","type":"Organization","site_admin":false},"repo":{"id":49756309,"name":"firechess","full_name":"Firechess/firechess","owner":{"login":"Firechess","id":16727581,"avatar_url":"https://avatars.githubusercontent.com/u/16727581?v=3","gravatar_id":"","url":"https://api.github.com/users/Firechess","html_url":"https://github.com/Firechess","followers_url":"https://api.github.com/users/Firechess/followers","following_url":"https://api.github.com/users/Firechess/following{/other_user}","gists_url":"https://api.github.com/users/Firechess/gists{/gist_id}","starred_url":"https://api.github.com/users/Firechess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firechess/subscriptions","organizations_url":"https://api.github.com/users/Firechess/orgs","repos_url":"https://api.github.com/users/Firechess/repos","events_url":"https://api.github.com/users/Firechess/events{/privacy}","received_events_url":"https://api.github.com/users/Firechess/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Firechess/firechess","description":"Chess Application","fork":false,"url":"https://api.github.com/repos/Firechess/firechess","forks_url":"https://api.github.com/repos/Firechess/firechess/forks","keys_url":"https://api.github.com/repos/Firechess/firechess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Firechess/firechess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Firechess/firechess/teams","hooks_url":"https://api.github.com/repos/Firechess/firechess/hooks","issue_events_url":"https://api.github.com/repos/Firechess/firechess/issues/events{/number}","events_url":"https://api.github.com/repos/Firechess/firechess/events","assignees_url":"https://api.github.com/repos/Firechess/firechess/assignees{/user}","branches_url":"https://api.github.com/repos/Firechess/firechess/branches{/branch}","tags_url":"https://api.github.com/repos/Firechess/firechess/tags","blobs_url":"https://api.github.com/repos/Firechess/firechess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Firechess/firechess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Firechess/firechess/git/refs{/sha}","trees_url":"https://api.github.com/repos/Firechess/firechess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Firechess/firechess/statuses/{sha}","languages_url":"https://api.github.com/repos/Firechess/firechess/languages","stargazers_url":"https://api.github.com/repos/Firechess/firechess/stargazers","contributors_url":"https://api.github.com/repos/Firechess/firechess/contributors","subscribers_url":"https://api.github.com/repos/Firechess/firechess/subscribers","subscription_url":"https://api.github.com/repos/Firechess/firechess/subscription","commits_url":"https://api.github.com/repos/Firechess/firechess/commits{/sha}","git_commits_url":"https://api.github.com/repos/Firechess/firechess/git/commits{/sha}","comments_url":"https://api.github.com/repos/Firechess/firechess/comments{/number}","issue_comment_url":"https://api.github.com/repos/Firechess/firechess/issues/comments{/number}","contents_url":"https://api.github.com/repos/Firechess/firechess/contents/{+path}","compare_url":"https://api.github.com/repos/Firechess/firechess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Firechess/firechess/merges","archive_url":"https://api.github.com/repos/Firechess/firechess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Firechess/firechess/downloads","issues_url":"https://api.github.com/repos/Firechess/firechess/issues{/number}","pulls_url":"https://api.github.com/repos/Firechess/firechess/pulls{/number}","milestones_url":"https://api.github.com/repos/Firechess/firechess/milestones{/number}","notifications_url":"https://api.github.com/repos/Firechess/firechess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Firechess/firechess/labels{/name}","releases_url":"https://api.github.com/repos/Firechess/firechess/releases{/id}","deployments_url":"https://api.github.com/repos/Firechess/firechess/deployments","created_at":"2016-01-16T02:48:31Z","updated_at":"2016-03-19T21:38:04Z","pushed_at":"2016-05-08T20:10:47Z","git_url":"git://github.com/Firechess/firechess.git","ssh_url":"git@github.com:Firechess/firechess.git","clone_url":"https://github.com/Firechess/firechess.git","svn_url":"https://github.com/Firechess/firechess","homepage":"https://firechess.herokuapp.com/","size":734,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":2,"default_branch":"master"}},"base":{"label":"Firechess:master","ref":"master","sha":"f141a420104d2ee58456560579bc1ed1b94b55d9","user":{"login":"Firechess","id":16727581,"avatar_url":"https://avatars.githubusercontent.com/u/16727581?v=3","gravatar_id":"","url":"https://api.github.com/users/Firechess","html_url":"https://github.com/Firechess","followers_url":"https://api.github.com/users/Firechess/followers","following_url":"https://api.github.com/users/Firechess/following{/other_user}","gists_url":"https://api.github.com/users/Firechess/gists{/gist_id}","starred_url":"https://api.github.com/users/Firechess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firechess/subscriptions","organizations_url":"https://api.github.com/users/Firechess/orgs","repos_url":"https://api.github.com/users/Firechess/repos","events_url":"https://api.github.com/users/Firechess/events{/privacy}","received_events_url":"https://api.github.com/users/Firechess/received_events","type":"Organization","site_admin":false},"repo":{"id":49756309,"name":"firechess","full_name":"Firechess/firechess","owner":{"login":"Firechess","id":16727581,"avatar_url":"https://avatars.githubusercontent.com/u/16727581?v=3","gravatar_id":"","url":"https://api.github.com/users/Firechess","html_url":"https://github.com/Firechess","followers_url":"https://api.github.com/users/Firechess/followers","following_url":"https://api.github.com/users/Firechess/following{/other_user}","gists_url":"https://api.github.com/users/Firechess/gists{/gist_id}","starred_url":"https://api.github.com/users/Firechess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firechess/subscriptions","organizations_url":"https://api.github.com/users/Firechess/orgs","repos_url":"https://api.github.com/users/Firechess/repos","events_url":"https://api.github.com/users/Firechess/events{/privacy}","received_events_url":"https://api.github.com/users/Firechess/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Firechess/firechess","description":"Chess Application","fork":false,"url":"https://api.github.com/repos/Firechess/firechess","forks_url":"https://api.github.com/repos/Firechess/firechess/forks","keys_url":"https://api.github.com/repos/Firechess/firechess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Firechess/firechess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Firechess/firechess/teams","hooks_url":"https://api.github.com/repos/Firechess/firechess/hooks","issue_events_url":"https://api.github.com/repos/Firechess/firechess/issues/events{/number}","events_url":"https://api.github.com/repos/Firechess/firechess/events","assignees_url":"https://api.github.com/repos/Firechess/firechess/assignees{/user}","branches_url":"https://api.github.com/repos/Firechess/firechess/branches{/branch}","tags_url":"https://api.github.com/repos/Firechess/firechess/tags","blobs_url":"https://api.github.com/repos/Firechess/firechess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Firechess/firechess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Firechess/firechess/git/refs{/sha}","trees_url":"https://api.github.com/repos/Firechess/firechess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Firechess/firechess/statuses/{sha}","languages_url":"https://api.github.com/repos/Firechess/firechess/languages","stargazers_url":"https://api.github.com/repos/Firechess/firechess/stargazers","contributors_url":"https://api.github.com/repos/Firechess/firechess/contributors","subscribers_url":"https://api.github.com/repos/Firechess/firechess/subscribers","subscription_url":"https://api.github.com/repos/Firechess/firechess/subscription","commits_url":"https://api.github.com/repos/Firechess/firechess/commits{/sha}","git_commits_url":"https://api.github.com/repos/Firechess/firechess/git/commits{/sha}","comments_url":"https://api.github.com/repos/Firechess/firechess/comments{/number}","issue_comment_url":"https://api.github.com/repos/Firechess/firechess/issues/comments{/number}","contents_url":"https://api.github.com/repos/Firechess/firechess/contents/{+path}","compare_url":"https://api.github.com/repos/Firechess/firechess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Firechess/firechess/merges","archive_url":"https://api.github.com/repos/Firechess/firechess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Firechess/firechess/downloads","issues_url":"https://api.github.com/repos/Firechess/firechess/issues{/number}","pulls_url":"https://api.github.com/repos/Firechess/firechess/pulls{/number}","milestones_url":"https://api.github.com/repos/Firechess/firechess/milestones{/number}","notifications_url":"https://api.github.com/repos/Firechess/firechess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Firechess/firechess/labels{/name}","releases_url":"https://api.github.com/repos/Firechess/firechess/releases{/id}","deployments_url":"https://api.github.com/repos/Firechess/firechess/deployments","created_at":"2016-01-16T02:48:31Z","updated_at":"2016-03-19T21:38:04Z","pushed_at":"2016-05-08T20:10:47Z","git_url":"git://github.com/Firechess/firechess.git","ssh_url":"git@github.com:Firechess/firechess.git","clone_url":"https://github.com/Firechess/firechess.git","svn_url":"https://github.com/Firechess/firechess","homepage":"https://firechess.herokuapp.com/","size":734,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Firechess/firechess/pulls/48"},"html":{"href":"https://github.com/Firechess/firechess/pull/48"},"issue":{"href":"https://api.github.com/repos/Firechess/firechess/issues/48"},"comments":{"href":"https://api.github.com/repos/Firechess/firechess/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/Firechess/firechess/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/Firechess/firechess/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Firechess/firechess/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/Firechess/firechess/statuses/132a064e87a321c470796b39255d196e31aead88"}}}}