GitHub PullRequestReviewCommentEvent at 2014-09-25 21:02:16
Repository: tfc-map
Actor: Resonance1584
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/comments/18059853","id":18059853,"diff_hunk":"@@ -0,0 +1,108 @@\n+'use strict';\n+\n+var fs          = require('fs')\n+var template    = fs.readFileSync(__dirname + '/../templates/key.html', 'utf8')\n+var handlebars  = require('handlebars')\n+var keyTemplate = handlebars.compile(template)\n+var assert      = require('assert')\n+\n+/**\n+ * Class to handle reading and writing to the map key dom structure\n+ */\n+class MapKey {\n+\n+  /**\n+   * @constructor\n+   */\n+  constructor(config) {\n+    this.config = config\n+    this.title_ = ''\n+    this.items = []\n+    this.domElement = document.getElementById(config.domElement)\n+    this.domElement.innerHTML = keyTemplate()\n+  }\n+\n+  /**\n+   * Used to set the title of the key\n+   * @param {string} title\n+   */\n+  set title(title) {\n+    assert.equal(typeof title, 'string', '`title` must be a string')\n+\n+    this.title_ = title\n+    this.domElement.querySelector('.title').innerHTML = title\n+  }\n+\n+  /**\n+   * Returns the title of the key\n+   */\n+  get title() {\n+    return this.title_\n+  }\n+\n+  /**\n+   * Clears all key dom elements\n+   */\n+  clearDomElements() {\n+    this.domElement.querySelector('.items').innerHTML = ''\n+  }\n+\n+  /**\n+   * Renders all key item data from memory onto the dom\n+   * creates a dom node for each item and inserts into list\n+   */\n+  renderDomElements() {\n+    this.items.forEach((item) => {\n+      this.renderDomElement(item)\n+    })\n+  }\n+\n+  /**\n+   * Renders a single dom list element into items list from item object\n+   * @param {object} item\n+   */\n+  renderDomElement(item) {\n+    var li = document.createElement('li')\n+    li.innerHTML = item.value\n+    this.domElement.querySelector('.items').appendChild(li)\n+  }\n+\n+  /**\n+   * Adds item by some unique id. Stores the item by id and renders item\n+   * to the dom\n+   * @param {string} id\n+   * @param {string} item\n+   */\n+  addItem(id, item) {\n+    assert.equal(typeof id, 'string', '`id` must be a string')","path":"wrappers/mapKey.js","position":77,"original_position":77,"commit_id":"d9c062e3c9096a579a95e710700871b6656c1fd7","original_commit_id":"d9c062e3c9096a579a95e710700871b6656c1fd7","user":{"login":"Resonance1584","id":1177082,"avatar_url":"https://avatars.githubusercontent.com/u/1177082?v=2","gravatar_id":"","url":"https://api.github.com/users/Resonance1584","html_url":"https://github.com/Resonance1584","followers_url":"https://api.github.com/users/Resonance1584/followers","following_url":"https://api.github.com/users/Resonance1584/following{/other_user}","gists_url":"https://api.github.com/users/Resonance1584/gists{/gist_id}","starred_url":"https://api.github.com/users/Resonance1584/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Resonance1584/subscriptions","organizations_url":"https://api.github.com/users/Resonance1584/orgs","repos_url":"https://api.github.com/users/Resonance1584/repos","events_url":"https://api.github.com/users/Resonance1584/events{/privacy}","received_events_url":"https://api.github.com/users/Resonance1584/received_events","type":"User","site_admin":false},"body":"correct me if i'm wrong - wont an assert break everything? is that what you want here?","created_at":"2014-09-25T21:02:16Z","updated_at":"2014-09-25T21:02:16Z","html_url":"https://github.com/mediasuitenz/tfc-map/pull/7#discussion_r18059853","pull_request_url":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/comments/18059853"},"html":{"href":"https://github.com/mediasuitenz/tfc-map/pull/7#discussion_r18059853"},"pull_request":{"href":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/7","id":21808758,"html_url":"https://github.com/mediasuitenz/tfc-map/pull/7","diff_url":"https://github.com/mediasuitenz/tfc-map/pull/7.diff","patch_url":"https://github.com/mediasuitenz/tfc-map/pull/7.patch","issue_url":"https://api.github.com/repos/mediasuitenz/tfc-map/issues/7","number":7,"state":"open","locked":false,"title":"Add/map key dom wrapper maps 9","user":{"login":"digitalsadhu","id":1177098,"avatar_url":"https://avatars.githubusercontent.com/u/1177098?v=2","gravatar_id":"","url":"https://api.github.com/users/digitalsadhu","html_url":"https://github.com/digitalsadhu","followers_url":"https://api.github.com/users/digitalsadhu/followers","following_url":"https://api.github.com/users/digitalsadhu/following{/other_user}","gists_url":"https://api.github.com/users/digitalsadhu/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalsadhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalsadhu/subscriptions","organizations_url":"https://api.github.com/users/digitalsadhu/orgs","repos_url":"https://api.github.com/users/digitalsadhu/repos","events_url":"https://api.github.com/users/digitalsadhu/events{/privacy}","received_events_url":"https://api.github.com/users/digitalsadhu/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-09-25T20:04:52Z","updated_at":"2014-09-25T21:02:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"902fe1e37f6d311927ed291d0a13d9b274a52527","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/7/commits","review_comments_url":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/7/comments","review_comment_url":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mediasuitenz/tfc-map/issues/7/comments","statuses_url":"https://api.github.com/repos/mediasuitenz/tfc-map/statuses/d9c062e3c9096a579a95e710700871b6656c1fd7","head":{"label":"mediasuitenz:add/map_key_dom_wrapper_MAPS-9","ref":"add/map_key_dom_wrapper_MAPS-9","sha":"d9c062e3c9096a579a95e710700871b6656c1fd7","user":{"login":"mediasuitenz","id":4219296,"avatar_url":"https://avatars.githubusercontent.com/u/4219296?v=2","gravatar_id":"","url":"https://api.github.com/users/mediasuitenz","html_url":"https://github.com/mediasuitenz","followers_url":"https://api.github.com/users/mediasuitenz/followers","following_url":"https://api.github.com/users/mediasuitenz/following{/other_user}","gists_url":"https://api.github.com/users/mediasuitenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mediasuitenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediasuitenz/subscriptions","organizations_url":"https://api.github.com/users/mediasuitenz/orgs","repos_url":"https://api.github.com/users/mediasuitenz/repos","events_url":"https://api.github.com/users/mediasuitenz/events{/privacy}","received_events_url":"https://api.github.com/users/mediasuitenz/received_events","type":"Organization","site_admin":false},"repo":{"id":23812386,"name":"tfc-map","full_name":"mediasuitenz/tfc-map","owner":{"login":"mediasuitenz","id":4219296,"avatar_url":"https://avatars.githubusercontent.com/u/4219296?v=2","gravatar_id":"","url":"https://api.github.com/users/mediasuitenz","html_url":"https://github.com/mediasuitenz","followers_url":"https://api.github.com/users/mediasuitenz/followers","following_url":"https://api.github.com/users/mediasuitenz/following{/other_user}","gists_url":"https://api.github.com/users/mediasuitenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mediasuitenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediasuitenz/subscriptions","organizations_url":"https://api.github.com/users/mediasuitenz/orgs","repos_url":"https://api.github.com/users/mediasuitenz/repos","events_url":"https://api.github.com/users/mediasuitenz/events{/privacy}","received_events_url":"https://api.github.com/users/mediasuitenz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediasuitenz/tfc-map","description":"The new and shiny TFC map rebuild","fork":false,"url":"https://api.github.com/repos/mediasuitenz/tfc-map","forks_url":"https://api.github.com/repos/mediasuitenz/tfc-map/forks","keys_url":"https://api.github.com/repos/mediasuitenz/tfc-map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediasuitenz/tfc-map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediasuitenz/tfc-map/teams","hooks_url":"https://api.github.com/repos/mediasuitenz/tfc-map/hooks","issue_events_url":"https://api.github.com/repos/mediasuitenz/tfc-map/issues/events{/number}","events_url":"https://api.github.com/repos/mediasuitenz/tfc-map/events","assignees_url":"https://api.github.com/repos/mediasuitenz/tfc-map/assignees{/user}","branches_url":"https://api.github.com/repos/mediasuitenz/tfc-map/branches{/branch}","tags_url":"https://api.github.com/repos/mediasuitenz/tfc-map/tags","blobs_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediasuitenz/tfc-map/statuses/{sha}","languages_url":"https://api.github.com/repos/mediasuitenz/tfc-map/languages","stargazers_url":"https://api.github.com/repos/mediasuitenz/tfc-map/stargazers","contributors_url":"https://api.github.com/repos/mediasuitenz/tfc-map/contributors","subscribers_url":"https://api.github.com/repos/mediasuitenz/tfc-map/subscribers","subscription_url":"https://api.github.com/repos/mediasuitenz/tfc-map/subscription","commits_url":"https://api.github.com/repos/mediasuitenz/tfc-map/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediasuitenz/tfc-map/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediasuitenz/tfc-map/issues/comments/{number}","contents_url":"https://api.github.com/repos/mediasuitenz/tfc-map/contents/{+path}","compare_url":"https://api.github.com/repos/mediasuitenz/tfc-map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediasuitenz/tfc-map/merges","archive_url":"https://api.github.com/repos/mediasuitenz/tfc-map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediasuitenz/tfc-map/downloads","issues_url":"https://api.github.com/repos/mediasuitenz/tfc-map/issues{/number}","pulls_url":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls{/number}","milestones_url":"https://api.github.com/repos/mediasuitenz/tfc-map/milestones{/number}","notifications_url":"https://api.github.com/repos/mediasuitenz/tfc-map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediasuitenz/tfc-map/labels{/name}","releases_url":"https://api.github.com/repos/mediasuitenz/tfc-map/releases{/id}","created_at":"2014-09-08T23:32:18Z","updated_at":"2014-09-08T23:35:23Z","pushed_at":"2014-09-25T20:20:40Z","git_url":"git://github.com/mediasuitenz/tfc-map.git","ssh_url":"git@github.com:mediasuitenz/tfc-map.git","clone_url":"https://github.com/mediasuitenz/tfc-map.git","svn_url":"https://github.com/mediasuitenz/tfc-map","homepage":null,"size":328,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mediasuitenz:master","ref":"master","sha":"dbfb61e8b9f23a18166023e808dda1fe732bc8df","user":{"login":"mediasuitenz","id":4219296,"avatar_url":"https://avatars.githubusercontent.com/u/4219296?v=2","gravatar_id":"","url":"https://api.github.com/users/mediasuitenz","html_url":"https://github.com/mediasuitenz","followers_url":"https://api.github.com/users/mediasuitenz/followers","following_url":"https://api.github.com/users/mediasuitenz/following{/other_user}","gists_url":"https://api.github.com/users/mediasuitenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mediasuitenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediasuitenz/subscriptions","organizations_url":"https://api.github.com/users/mediasuitenz/orgs","repos_url":"https://api.github.com/users/mediasuitenz/repos","events_url":"https://api.github.com/users/mediasuitenz/events{/privacy}","received_events_url":"https://api.github.com/users/mediasuitenz/received_events","type":"Organization","site_admin":false},"repo":{"id":23812386,"name":"tfc-map","full_name":"mediasuitenz/tfc-map","owner":{"login":"mediasuitenz","id":4219296,"avatar_url":"https://avatars.githubusercontent.com/u/4219296?v=2","gravatar_id":"","url":"https://api.github.com/users/mediasuitenz","html_url":"https://github.com/mediasuitenz","followers_url":"https://api.github.com/users/mediasuitenz/followers","following_url":"https://api.github.com/users/mediasuitenz/following{/other_user}","gists_url":"https://api.github.com/users/mediasuitenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mediasuitenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediasuitenz/subscriptions","organizations_url":"https://api.github.com/users/mediasuitenz/orgs","repos_url":"https://api.github.com/users/mediasuitenz/repos","events_url":"https://api.github.com/users/mediasuitenz/events{/privacy}","received_events_url":"https://api.github.com/users/mediasuitenz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediasuitenz/tfc-map","description":"The new and shiny TFC map rebuild","fork":false,"url":"https://api.github.com/repos/mediasuitenz/tfc-map","forks_url":"https://api.github.com/repos/mediasuitenz/tfc-map/forks","keys_url":"https://api.github.com/repos/mediasuitenz/tfc-map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediasuitenz/tfc-map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediasuitenz/tfc-map/teams","hooks_url":"https://api.github.com/repos/mediasuitenz/tfc-map/hooks","issue_events_url":"https://api.github.com/repos/mediasuitenz/tfc-map/issues/events{/number}","events_url":"https://api.github.com/repos/mediasuitenz/tfc-map/events","assignees_url":"https://api.github.com/repos/mediasuitenz/tfc-map/assignees{/user}","branches_url":"https://api.github.com/repos/mediasuitenz/tfc-map/branches{/branch}","tags_url":"https://api.github.com/repos/mediasuitenz/tfc-map/tags","blobs_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediasuitenz/tfc-map/statuses/{sha}","languages_url":"https://api.github.com/repos/mediasuitenz/tfc-map/languages","stargazers_url":"https://api.github.com/repos/mediasuitenz/tfc-map/stargazers","contributors_url":"https://api.github.com/repos/mediasuitenz/tfc-map/contributors","subscribers_url":"https://api.github.com/repos/mediasuitenz/tfc-map/subscribers","subscription_url":"https://api.github.com/repos/mediasuitenz/tfc-map/subscription","commits_url":"https://api.github.com/repos/mediasuitenz/tfc-map/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediasuitenz/tfc-map/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediasuitenz/tfc-map/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediasuitenz/tfc-map/issues/comments/{number}","contents_url":"https://api.github.com/repos/mediasuitenz/tfc-map/contents/{+path}","compare_url":"https://api.github.com/repos/mediasuitenz/tfc-map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediasuitenz/tfc-map/merges","archive_url":"https://api.github.com/repos/mediasuitenz/tfc-map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediasuitenz/tfc-map/downloads","issues_url":"https://api.github.com/repos/mediasuitenz/tfc-map/issues{/number}","pulls_url":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls{/number}","milestones_url":"https://api.github.com/repos/mediasuitenz/tfc-map/milestones{/number}","notifications_url":"https://api.github.com/repos/mediasuitenz/tfc-map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediasuitenz/tfc-map/labels{/name}","releases_url":"https://api.github.com/repos/mediasuitenz/tfc-map/releases{/id}","created_at":"2014-09-08T23:32:18Z","updated_at":"2014-09-08T23:35:23Z","pushed_at":"2014-09-25T20:20:40Z","git_url":"git://github.com/mediasuitenz/tfc-map.git","ssh_url":"git@github.com:mediasuitenz/tfc-map.git","clone_url":"https://github.com/mediasuitenz/tfc-map.git","svn_url":"https://github.com/mediasuitenz/tfc-map","homepage":null,"size":328,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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/mediasuitenz/tfc-map/pulls/7"},"html":{"href":"https://github.com/mediasuitenz/tfc-map/pull/7"},"issue":{"href":"https://api.github.com/repos/mediasuitenz/tfc-map/issues/7"},"comments":{"href":"https://api.github.com/repos/mediasuitenz/tfc-map/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mediasuitenz/tfc-map/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/mediasuitenz/tfc-map/statuses/d9c062e3c9096a579a95e710700871b6656c1fd7"}}}}