{"action":"created","comment":{"url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/comments/42078048","id":42078048,"diff_hunk":"@@ -569,70 +634,95 @@\n     var doInit = function() {\n       var s = $location.search();\n       $scope.map = s.map || \"US\";\n-      $scope.orig = (s.orig === undefined) ? -1 : +s.orig;\n-      $scope.dest = (s.dest === undefined) ? -1 : +s.dest;\n-      $scope.playerColor = (s.color === undefined) ? \"white\" : s.color;\n+      try {\n+        $scope.players = JSON.parse(s.players);\n+      } catch (e) {\n+        $scope.players = [];\n+      }\n+      // There should always be at least one player\n+      $scope.numPlayers = Math.max(1, $scope.players.length);\n+      $scope.updateNumPlayers();\n     };\n-    $scope.$on(\"$locationChangeSuccess\", doInit);\n     doInit();\n   });\n+\n+  /**\n+   * Allow representing models directly as numbers, not strings.\n+   */\n+  app.directive('convertToNumber', function() {","path":"index.html","position":null,"original_position":216,"commit_id":"18c12ffdef5ca5eb66116c3c1d25e7bf6fb738ab","original_commit_id":"93f6f49fff6717e797b0bcf1aacd4bc2186019f9","user":{"login":"arensonjr","id":1350164,"avatar_url":"https://avatars.githubusercontent.com/u/1350164?v=3","gravatar_id":"","url":"https://api.github.com/users/arensonjr","html_url":"https://github.com/arensonjr","followers_url":"https://api.github.com/users/arensonjr/followers","following_url":"https://api.github.com/users/arensonjr/following{/other_user}","gists_url":"https://api.github.com/users/arensonjr/gists{/gist_id}","starred_url":"https://api.github.com/users/arensonjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arensonjr/subscriptions","organizations_url":"https://api.github.com/users/arensonjr/orgs","repos_url":"https://api.github.com/users/arensonjr/repos","events_url":"https://api.github.com/users/arensonjr/events{/privacy}","received_events_url":"https://api.github.com/users/arensonjr/received_events","type":"User","site_admin":false},"body":"Nope -- I originally had it set up on the numPlayers select box, but that got refactored away. Deleted.","created_at":"2015-10-15T02:37:52Z","updated_at":"2015-10-15T02:37:52Z","html_url":"https://github.com/sir-buckyball/boxcars_payoff/pull/8#discussion_r42078048","pull_request_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/comments/42078048"},"html":{"href":"https://github.com/sir-buckyball/boxcars_payoff/pull/8#discussion_r42078048"},"pull_request":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/8","id":47614080,"html_url":"https://github.com/sir-buckyball/boxcars_payoff/pull/8","diff_url":"https://github.com/sir-buckyball/boxcars_payoff/pull/8.diff","patch_url":"https://github.com/sir-buckyball/boxcars_payoff/pull/8.patch","issue_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/issues/8","number":8,"state":"open","locked":false,"title":"Add support for tracking multiple players' game state.","user":{"login":"arensonjr","id":1350164,"avatar_url":"https://avatars.githubusercontent.com/u/1350164?v=3","gravatar_id":"","url":"https://api.github.com/users/arensonjr","html_url":"https://github.com/arensonjr","followers_url":"https://api.github.com/users/arensonjr/followers","following_url":"https://api.github.com/users/arensonjr/following{/other_user}","gists_url":"https://api.github.com/users/arensonjr/gists{/gist_id}","starred_url":"https://api.github.com/users/arensonjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arensonjr/subscriptions","organizations_url":"https://api.github.com/users/arensonjr/orgs","repos_url":"https://api.github.com/users/arensonjr/repos","events_url":"https://api.github.com/users/arensonjr/events{/privacy}","received_events_url":"https://api.github.com/users/arensonjr/received_events","type":"User","site_admin":false},"body":"* Site can now track cities/payoffs for 1-5 players\r\n  - Each player has their own colored div (chosen in settings)\r\n  - Number of players can be changed/chosen in settings as well\r\n  - Modified URL params to be \"&players=<json-string>&players=<json-string>\" so that we could persist cities for each player\r\n* Refactored $watchGroup() code to $watch() each variable individually instead\r\n  - Impossible to \"deep-watch\" the list of players unless I watch it on its own\r\n  - Also, tracking numPlayers would have produced some spaghetti code\r\n\r\nFeel free to nitpick this as much as you want. I'm mostly new to Javascript and completely new to Angular, so if you're wondering why I didn't do X/Y/Z, it's probably because I didn't know it was an option. Thanks!","created_at":"2015-10-14T03:22:25Z","updated_at":"2015-10-15T02:37:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e81607f8a4382fc8d8945d18b6b3e09b6b39ea4a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/8/commits","review_comments_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/8/comments","review_comment_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/issues/8/comments","statuses_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/statuses/18c12ffdef5ca5eb66116c3c1d25e7bf6fb738ab","head":{"label":"arensonjr:master","ref":"master","sha":"18c12ffdef5ca5eb66116c3c1d25e7bf6fb738ab","user":{"login":"arensonjr","id":1350164,"avatar_url":"https://avatars.githubusercontent.com/u/1350164?v=3","gravatar_id":"","url":"https://api.github.com/users/arensonjr","html_url":"https://github.com/arensonjr","followers_url":"https://api.github.com/users/arensonjr/followers","following_url":"https://api.github.com/users/arensonjr/following{/other_user}","gists_url":"https://api.github.com/users/arensonjr/gists{/gist_id}","starred_url":"https://api.github.com/users/arensonjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arensonjr/subscriptions","organizations_url":"https://api.github.com/users/arensonjr/orgs","repos_url":"https://api.github.com/users/arensonjr/repos","events_url":"https://api.github.com/users/arensonjr/events{/privacy}","received_events_url":"https://api.github.com/users/arensonjr/received_events","type":"User","site_admin":false},"repo":{"id":44079832,"name":"boxcars_payoff","full_name":"arensonjr/boxcars_payoff","owner":{"login":"arensonjr","id":1350164,"avatar_url":"https://avatars.githubusercontent.com/u/1350164?v=3","gravatar_id":"","url":"https://api.github.com/users/arensonjr","html_url":"https://github.com/arensonjr","followers_url":"https://api.github.com/users/arensonjr/followers","following_url":"https://api.github.com/users/arensonjr/following{/other_user}","gists_url":"https://api.github.com/users/arensonjr/gists{/gist_id}","starred_url":"https://api.github.com/users/arensonjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arensonjr/subscriptions","organizations_url":"https://api.github.com/users/arensonjr/orgs","repos_url":"https://api.github.com/users/arensonjr/repos","events_url":"https://api.github.com/users/arensonjr/events{/privacy}","received_events_url":"https://api.github.com/users/arensonjr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arensonjr/boxcars_payoff","description":"A payoff webapp for the Boxcars board game","fork":true,"url":"https://api.github.com/repos/arensonjr/boxcars_payoff","forks_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/forks","keys_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/teams","hooks_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/hooks","issue_events_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/issues/events{/number}","events_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/events","assignees_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/assignees{/user}","branches_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/branches{/branch}","tags_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/tags","blobs_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/git/refs{/sha}","trees_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/statuses/{sha}","languages_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/languages","stargazers_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/stargazers","contributors_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/contributors","subscribers_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/subscribers","subscription_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/subscription","commits_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/commits{/sha}","git_commits_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/git/commits{/sha}","comments_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/comments{/number}","issue_comment_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/issues/comments{/number}","contents_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/contents/{+path}","compare_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/merges","archive_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/downloads","issues_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/issues{/number}","pulls_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/pulls{/number}","milestones_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/milestones{/number}","notifications_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/labels{/name}","releases_url":"https://api.github.com/repos/arensonjr/boxcars_payoff/releases{/id}","created_at":"2015-10-12T02:32:37Z","updated_at":"2015-10-12T02:32:38Z","pushed_at":"2015-10-15T02:37:08Z","git_url":"git://github.com/arensonjr/boxcars_payoff.git","ssh_url":"git@github.com:arensonjr/boxcars_payoff.git","clone_url":"https://github.com/arensonjr/boxcars_payoff.git","svn_url":"https://github.com/arensonjr/boxcars_payoff","homepage":null,"size":113,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sir-buckyball:master","ref":"master","sha":"5cb81a93ebf235486b1d3ea7dc0f212108759a01","user":{"login":"sir-buckyball","id":1843109,"avatar_url":"https://avatars.githubusercontent.com/u/1843109?v=3","gravatar_id":"","url":"https://api.github.com/users/sir-buckyball","html_url":"https://github.com/sir-buckyball","followers_url":"https://api.github.com/users/sir-buckyball/followers","following_url":"https://api.github.com/users/sir-buckyball/following{/other_user}","gists_url":"https://api.github.com/users/sir-buckyball/gists{/gist_id}","starred_url":"https://api.github.com/users/sir-buckyball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sir-buckyball/subscriptions","organizations_url":"https://api.github.com/users/sir-buckyball/orgs","repos_url":"https://api.github.com/users/sir-buckyball/repos","events_url":"https://api.github.com/users/sir-buckyball/events{/privacy}","received_events_url":"https://api.github.com/users/sir-buckyball/received_events","type":"User","site_admin":false},"repo":{"id":42034180,"name":"boxcars_payoff","full_name":"sir-buckyball/boxcars_payoff","owner":{"login":"sir-buckyball","id":1843109,"avatar_url":"https://avatars.githubusercontent.com/u/1843109?v=3","gravatar_id":"","url":"https://api.github.com/users/sir-buckyball","html_url":"https://github.com/sir-buckyball","followers_url":"https://api.github.com/users/sir-buckyball/followers","following_url":"https://api.github.com/users/sir-buckyball/following{/other_user}","gists_url":"https://api.github.com/users/sir-buckyball/gists{/gist_id}","starred_url":"https://api.github.com/users/sir-buckyball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sir-buckyball/subscriptions","organizations_url":"https://api.github.com/users/sir-buckyball/orgs","repos_url":"https://api.github.com/users/sir-buckyball/repos","events_url":"https://api.github.com/users/sir-buckyball/events{/privacy}","received_events_url":"https://api.github.com/users/sir-buckyball/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sir-buckyball/boxcars_payoff","description":"A payoff webapp for the Boxcars board game","fork":false,"url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff","forks_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/forks","keys_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/teams","hooks_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/hooks","issue_events_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/issues/events{/number}","events_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/events","assignees_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/assignees{/user}","branches_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/branches{/branch}","tags_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/tags","blobs_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/git/refs{/sha}","trees_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/statuses/{sha}","languages_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/languages","stargazers_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/stargazers","contributors_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/contributors","subscribers_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/subscribers","subscription_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/subscription","commits_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/commits{/sha}","git_commits_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/git/commits{/sha}","comments_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/comments{/number}","issue_comment_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/issues/comments{/number}","contents_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/contents/{+path}","compare_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/merges","archive_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/downloads","issues_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/issues{/number}","pulls_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls{/number}","milestones_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/milestones{/number}","notifications_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/labels{/name}","releases_url":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/releases{/id}","created_at":"2015-09-07T06:01:01Z","updated_at":"2015-09-07T16:46:56Z","pushed_at":"2015-10-15T02:37:08Z","git_url":"git://github.com/sir-buckyball/boxcars_payoff.git","ssh_url":"git@github.com:sir-buckyball/boxcars_payoff.git","clone_url":"https://github.com/sir-buckyball/boxcars_payoff.git","svn_url":"https://github.com/sir-buckyball/boxcars_payoff","homepage":null,"size":180,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/8"},"html":{"href":"https://github.com/sir-buckyball/boxcars_payoff/pull/8"},"issue":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/issues/8"},"comments":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/sir-buckyball/boxcars_payoff/statuses/18c12ffdef5ca5eb66116c3c1d25e7bf6fb738ab"}}}}