GitHub PullRequestReviewCommentEvent at 2014-10-21 02:51:57
Repository: reddit-plugin-gold
Actor: madbook
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/reddit/reddit-plugin-gold/pulls/comments/19127313","id":19127313,"diff_hunk":"@@ -0,0 +1,73 @@\n+<%!\n+  from r2.lib import js\n+  from r2.lib.template_helpers import static\n+%>\n+\n+<%namespace file=\"less.html\" import=\"less_stylesheet\"/>\n+\n+${less_stylesheet('gold.less')}\n+\n+<div class=\"snoovatar-page\">\n+  <div class=\"container\">\n+    %if thing.snoovatar['editable']:\n+      <div class=\"arrow-container left\">\n+        <div id=\"prevButton\" class=\"arrow left\">\n+          <img src=\"${static('snoovatar/icons/arrow.svg')}\">\n+        </div>\n+      </div>\n+    %endif\n+    <div id=\"snoovatar\">\n+    </div>\n+    %if thing.snoovatar['editable']:\n+      <div class=\"arrow-container right\">\n+        <div id=\"nextButton\" class=\"arrow right\">\n+          <img src=\"${static('snoovatar/icons/arrow.svg')}\">\n+        </div>\n+      </div>\n+      <h1>your snoovatar!</h1>\n+      <div class=\"selectors\">\n+        <ul>\n+        </ul>\n+      </div>\n+      <div class=\"actions\">\n+        <div id=\"random\" class=\"button big\"><div class=\"icon\"></div></div>\n+        <div id=\"clear\" class=\"button big\"><div class=\"icon\"></div></div>\n+      </div>\n+      <footer>\n+        <div class=\"buttons\">\n+          <label class=\"checkbox-label\">\n+            <input type=\"checkbox\" id=\"public\"\n+              %if thing.snoovatar['public']:\n+                checked=\"checked\"\n+              %endif\n+            >\n+            <span class=\"proxy-checkbox\"></span>\n+            <span class=\"label\">make my snoovatar public</span>\n+          </label>\n+          <button id=\"save\" class=\"button\">save</button>\n+        </div>\n+        <div id=\"message\" class=\"message\" style=\"display: none;\"></div>\n+      </footer>\n+    %else:\n+      <div class=\"username\">${thing.username}</div>\n+    %endif\n+    <p class=\"\">view and discuss snoovatar in <a href=\"/r/snoovatars\">/r/snoovatars</a>!</p>\n+  </div>\n+</div>\n+\n+${unsafe(js.use(\"snoovatar\"))}\n+\n+<%\n+  snoovatar_source = js.DataSource(\n+  wrap=\"r.snoovatar.initSnoovatar({content})\",\n+    data=thing.snoovatar,\n+  )\n+\n+  tailors_source = js.DataSource(\n+  wrap=\"r.snoovatar.initTailors({content})\",\n+    data=thing.tailors,\n+  )\n+%>\n+\n+${unsafe(snoovatar_source.use())}\n+${unsafe(tailors_source.use())}","path":"reddit_gold/templates/snoovatar.html","position":73,"original_position":73,"commit_id":"cef8d5e3486bc87ae71f9878abad05fa2ad3390c","original_commit_id":"cef8d5e3486bc87ae71f9878abad05fa2ad3390c","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":"mm, that probably makes sense","created_at":"2014-10-21T02:51:57Z","updated_at":"2014-10-21T02:51:57Z","html_url":"https://github.com/reddit/reddit-plugin-gold/pull/36#discussion_r19127313","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/19127313"},"html":{"href":"https://github.com/reddit/reddit-plugin-gold/pull/36#discussion_r19127313"},"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-21T02:51:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d33c143316c18b74e1c20f6fc53ff6c1eea82ecc","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/cef8d5e3486bc87ae71f9878abad05fa2ad3390c","head":{"label":"madbook:snoovatar-frontend","ref":"snoovatar-frontend","sha":"cef8d5e3486bc87ae71f9878abad05fa2ad3390c","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-20T23:50:00Z","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":1742,"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-09-15T19:21:21Z","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":1348,"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/cef8d5e3486bc87ae71f9878abad05fa2ad3390c"}}}}