GitHub PullRequestReviewCommentEvent at 2014-10-28 17:32:21
Repository: reddit-plugin-gold
Actor: ajacksified
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/comments/19488296","id":19488296,"diff_hunk":"@@ -29,8 +52,16 @@ def add_routes(self, mc):\n         mc('/gold/partners', controller='gold', action='partners')\n         mc('/api/claim_gold_partner_deal_code', controller='goldapi', action='claim_gold_partner_deal_code')\n \n+        mc('/user/:username/snoo', controller='gold', action=\"snoovatar\")\n+        mc(\"/api/gold/snoovatar\", controller=\"goldapi\", action=\"snoovatar\")","path":"reddit_gold/__init__.py","position":42,"original_position":42,"commit_id":"74519ece73d5b1e283b97d5435ab3eebe06330a7","original_commit_id":"74519ece73d5b1e283b97d5435ab3eebe06330a7","user":{"login":"ajacksified","id":175515,"avatar_url":"https://avatars.githubusercontent.com/u/175515?v=2","gravatar_id":"","url":"https://api.github.com/users/ajacksified","html_url":"https://github.com/ajacksified","followers_url":"https://api.github.com/users/ajacksified/followers","following_url":"https://api.github.com/users/ajacksified/following{/other_user}","gists_url":"https://api.github.com/users/ajacksified/gists{/gist_id}","starred_url":"https://api.github.com/users/ajacksified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajacksified/subscriptions","organizations_url":"https://api.github.com/users/ajacksified/orgs","repos_url":"https://api.github.com/users/ajacksified/repos","events_url":"https://api.github.com/users/ajacksified/events{/privacy}","received_events_url":"https://api.github.com/users/ajacksified/received_events","type":"User","site_admin":false},"body":"Nit: inconsistent quotes. Not sure if should be double or single though.","created_at":"2014-10-28T17:32:21Z","updated_at":"2014-10-28T17:32:21Z","html_url":"https://github.com/reddit/reddit-plugin-gold/pull/36#discussion_r19488296","pull_request_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/comments/19488296"},"html":{"href":"https://github.com/reddit/reddit-plugin-gold/pull/36#discussion_r19488296"},"pull_request":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/36","id":23056153,"html_url":"https://github.com/reddit/reddit-plugin-gold/pull/36","diff_url":"https://github.com/reddit/reddit-plugin-gold/pull/36.diff","patch_url":"https://github.com/reddit/reddit-plugin-gold/pull/36.patch","issue_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/issues/36","number":36,"state":"open","locked":false,"title":"Add Snoovatars.","user":{"login":"madbook","id":2260961,"avatar_url":"https://avatars.githubusercontent.com/u/2260961?v=2","gravatar_id":"","url":"https://api.github.com/users/madbook","html_url":"https://github.com/madbook","followers_url":"https://api.github.com/users/madbook/followers","following_url":"https://api.github.com/users/madbook/following{/other_user}","gists_url":"https://api.github.com/users/madbook/gists{/gist_id}","starred_url":"https://api.github.com/users/madbook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madbook/subscriptions","organizations_url":"https://api.github.com/users/madbook/orgs","repos_url":"https://api.github.com/users/madbook/repos","events_url":"https://api.github.com/users/madbook/events{/privacy}","received_events_url":"https://api.github.com/users/madbook/received_events","type":"User","site_admin":false},"body":"Snoovatars feature for gold user.  Design/concept and prototype by @powerlanguage, backend by @spladug.  Currently looks like this:\r\n\r\n![screen shot 2014-10-20 at 5 00 11 pm](https://cloud.githubusercontent.com/assets/2260961/4711136/4e204472-58b5-11e4-996e-b43cbf050dd5.png)\r\n\r\nThis feature allows gold users to create a custom \"snoovatar\".  Users can choose to make their creations publicly available via the `/user/<username>/snoo` URL.\r\n\r\n- - - - -\r\n\r\n## frontend\r\nSince the js is pretty one-off, I added way more comments than we normally do.  `snoovatars.js` is structured thusly:\r\n\r\n1. **init code** – top half of the file, all of the init code is done via [jQuery Promises](http://api.jquery.com/jQuery.Deferred/).  The general flow is:\r\n    * `tailors.json` and existing snoovatar data are passed in from the template\r\n    * spritesheet images defined in `tailors.json` are preloaded\r\n    * when the images are ready, `Tailor` objects are created to manage each configurable part of the snoovatar\r\n    * a `Haberdashery` object is instantiated to manage the tailors and overall state of the snoovatar widget\r\n    * canvas elements and dynamic UI elements are generated and added to the DOM,\r\n    * a generic `view` object is created and event handlers are bound to hook up UI elements to methods of the `Haberdashery`\r\n\r\n2. **\"classes\"** — bottom half of the file, defines a couple of one-off object types used to manage the widget:\r\n    * `CanvasArray` contains shared code between `Tailor` and `Haberdashery` types (basically, having a canvas property and an array of things).\r\n    * `Tailor` manages a single category of things that users can customize about their snoovatar (e.g. hats, glasses, etc.).\r\n    * `Haberdashery` manages state, handles importing and exporting data, and renders the composite snoovatar from the configured `Tailor` objects.\r\n\r\n## backend\r\nthe configured snoovatar is stored as a blob of json, so the backend is pretty simple.  @spladug, the only thing I changes (i think) is that I ended up wanting to store `key:value` pairs rather than just an array of `value`s, so I swapped out the `VPrintable` validator with `VJSON`, which seems to work fine.\r\n\r\n## design/art assets\r\nDesign, spritesheet images, and data in `tailors.json` is likely to change, as @powerlanguage is still working on some of those assets and getting feedback from the design mailing list.  Feel free to comment, though.  I tried to keep the structure of `tailors.json` flexible, and derive as much of the UI from it as possible to minimize the need to edit the code when making simple updates in the future (e.g. adding new graphics).\r\n\r\n:eyeglasses: @powerlanguage @spladug @Deimos","created_at":"2014-10-21T00:53:39Z","updated_at":"2014-10-28T17:32:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"846965fee8a4f83407f65177fd42d3fdabafe7dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/36/commits","review_comments_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/36/comments","review_comment_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/comments/{number}","comments_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/issues/36/comments","statuses_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/statuses/74519ece73d5b1e283b97d5435ab3eebe06330a7","head":{"label":"madbook:snoovatar-frontend","ref":"snoovatar-frontend","sha":"74519ece73d5b1e283b97d5435ab3eebe06330a7","user":{"login":"madbook","id":2260961,"avatar_url":"https://avatars.githubusercontent.com/u/2260961?v=2","gravatar_id":"","url":"https://api.github.com/users/madbook","html_url":"https://github.com/madbook","followers_url":"https://api.github.com/users/madbook/followers","following_url":"https://api.github.com/users/madbook/following{/other_user}","gists_url":"https://api.github.com/users/madbook/gists{/gist_id}","starred_url":"https://api.github.com/users/madbook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madbook/subscriptions","organizations_url":"https://api.github.com/users/madbook/orgs","repos_url":"https://api.github.com/users/madbook/repos","events_url":"https://api.github.com/users/madbook/events{/privacy}","received_events_url":"https://api.github.com/users/madbook/received_events","type":"User","site_admin":false},"repo":{"id":20912373,"name":"reddit-plugin-gold","full_name":"madbook/reddit-plugin-gold","owner":{"login":"madbook","id":2260961,"avatar_url":"https://avatars.githubusercontent.com/u/2260961?v=2","gravatar_id":"","url":"https://api.github.com/users/madbook","html_url":"https://github.com/madbook","followers_url":"https://api.github.com/users/madbook/followers","following_url":"https://api.github.com/users/madbook/following{/other_user}","gists_url":"https://api.github.com/users/madbook/gists{/gist_id}","starred_url":"https://api.github.com/users/madbook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madbook/subscriptions","organizations_url":"https://api.github.com/users/madbook/orgs","repos_url":"https://api.github.com/users/madbook/repos","events_url":"https://api.github.com/users/madbook/events{/privacy}","received_events_url":"https://api.github.com/users/madbook/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/madbook/reddit-plugin-gold","description":"reddit gold plugin","fork":true,"url":"https://api.github.com/repos/madbook/reddit-plugin-gold","forks_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/forks","keys_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/teams","hooks_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/hooks","issue_events_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/issues/events{/number}","events_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/events","assignees_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/assignees{/user}","branches_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/branches{/branch}","tags_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/tags","blobs_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/git/refs{/sha}","trees_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/statuses/{sha}","languages_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/languages","stargazers_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/stargazers","contributors_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/contributors","subscribers_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/subscribers","subscription_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/subscription","commits_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/commits{/sha}","git_commits_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/git/commits{/sha}","comments_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/comments{/number}","issue_comment_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/issues/comments/{number}","contents_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/contents/{+path}","compare_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/merges","archive_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/downloads","issues_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/issues{/number}","pulls_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/pulls{/number}","milestones_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/milestones{/number}","notifications_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/labels{/name}","releases_url":"https://api.github.com/repos/madbook/reddit-plugin-gold/releases{/id}","created_at":"2014-06-17T06:17:07Z","updated_at":"2014-07-16T20:13:09Z","pushed_at":"2014-10-28T17:23:55Z","git_url":"git://github.com/madbook/reddit-plugin-gold.git","ssh_url":"git@github.com:madbook/reddit-plugin-gold.git","clone_url":"https://github.com/madbook/reddit-plugin-gold.git","svn_url":"https://github.com/madbook/reddit-plugin-gold","homepage":null,"size":1818,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"reddit:master","ref":"master","sha":"9a654521e31be558127559427602aa24caab5ac2","user":{"login":"reddit","id":14248,"avatar_url":"https://avatars.githubusercontent.com/u/14248?v=2","gravatar_id":"","url":"https://api.github.com/users/reddit","html_url":"https://github.com/reddit","followers_url":"https://api.github.com/users/reddit/followers","following_url":"https://api.github.com/users/reddit/following{/other_user}","gists_url":"https://api.github.com/users/reddit/gists{/gist_id}","starred_url":"https://api.github.com/users/reddit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reddit/subscriptions","organizations_url":"https://api.github.com/users/reddit/orgs","repos_url":"https://api.github.com/users/reddit/repos","events_url":"https://api.github.com/users/reddit/events{/privacy}","received_events_url":"https://api.github.com/users/reddit/received_events","type":"Organization","site_admin":false},"repo":{"id":12880208,"name":"reddit-plugin-gold","full_name":"reddit/reddit-plugin-gold","owner":{"login":"reddit","id":14248,"avatar_url":"https://avatars.githubusercontent.com/u/14248?v=2","gravatar_id":"","url":"https://api.github.com/users/reddit","html_url":"https://github.com/reddit","followers_url":"https://api.github.com/users/reddit/followers","following_url":"https://api.github.com/users/reddit/following{/other_user}","gists_url":"https://api.github.com/users/reddit/gists{/gist_id}","starred_url":"https://api.github.com/users/reddit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reddit/subscriptions","organizations_url":"https://api.github.com/users/reddit/orgs","repos_url":"https://api.github.com/users/reddit/repos","events_url":"https://api.github.com/users/reddit/events{/privacy}","received_events_url":"https://api.github.com/users/reddit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reddit/reddit-plugin-gold","description":"reddit gold plugin","fork":false,"url":"https://api.github.com/repos/reddit/reddit-plugin-gold","forks_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/forks","keys_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/teams","hooks_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/hooks","issue_events_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/issues/events{/number}","events_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/events","assignees_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/assignees{/user}","branches_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/branches{/branch}","tags_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/tags","blobs_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/git/refs{/sha}","trees_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/statuses/{sha}","languages_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/languages","stargazers_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/stargazers","contributors_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/contributors","subscribers_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/subscribers","subscription_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/subscription","commits_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/commits{/sha}","git_commits_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/git/commits{/sha}","comments_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/comments{/number}","issue_comment_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/issues/comments/{number}","contents_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/contents/{+path}","compare_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/merges","archive_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/downloads","issues_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/issues{/number}","pulls_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls{/number}","milestones_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/milestones{/number}","notifications_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/labels{/name}","releases_url":"https://api.github.com/repos/reddit/reddit-plugin-gold/releases{/id}","created_at":"2013-09-16T22:17:40Z","updated_at":"2014-10-12T23:07:40Z","pushed_at":"2014-10-21T19:08:47Z","git_url":"git://github.com/reddit/reddit-plugin-gold.git","ssh_url":"git@github.com:reddit/reddit-plugin-gold.git","clone_url":"https://github.com/reddit/reddit-plugin-gold.git","svn_url":"https://github.com/reddit/reddit-plugin-gold","homepage":null,"size":2313,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/36"},"html":{"href":"https://github.com/reddit/reddit-plugin-gold/pull/36"},"issue":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/issues/36"},"comments":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/reddit/reddit-plugin-gold/statuses/74519ece73d5b1e283b97d5435ab3eebe06330a7"}}}}