GitHub PullRequestReviewCommentEvent at 2014-10-05 22:55:43
Repository: htmlbars
Actor: cibernox
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/tildeio/htmlbars/pulls/comments/18438263","id":18438263,"diff_hunk":"@@ -0,0 +1,52 @@\n+import { svgNamespace } from \"./build-html-dom\";\n+\n+function buildClassList(element) {\n+  var classString = (element.getAttribute('class') || '');\n+  return classString !== '' && classString !== ' ' ? classString.split(' ') : [];\n+}\n+\n+function addClassViaAttribute(element, className) {\n+  var existingClasses = buildClassList(element);\n+  var classIndex = -1;\n+  for (var i=0;i<existingClasses.length;i++) {\n+    if (className === existingClasses[i]) {\n+      classIndex = i;\n+      break;\n+    }\n+  }\n+  if (classIndex === -1) {\n+    existingClasses.push(className);\n+    element.setAttribute('class', existingClasses.join(' '));\n+  }\n+}\n+\n+function removeClassViaAttribute(element, className) {\n+  var existingClasses = buildClassList(element);\n+  var classIndex = -1;\n+  for (var i=0;i<existingClasses.length;i++) {","path":"packages/morph/lib/dom-helper/classes.js","position":26,"original_position":26,"commit_id":"e9fd570d00f85160f68570d63fb621fac381684d","original_commit_id":"e9fd570d00f85160f68570d63fb621fac381684d","user":{"login":"cibernox","id":265339,"avatar_url":"https://avatars.githubusercontent.com/u/265339?v=2","gravatar_id":"","url":"https://api.github.com/users/cibernox","html_url":"https://github.com/cibernox","followers_url":"https://api.github.com/users/cibernox/followers","following_url":"https://api.github.com/users/cibernox/following{/other_user}","gists_url":"https://api.github.com/users/cibernox/gists{/gist_id}","starred_url":"https://api.github.com/users/cibernox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cibernox/subscriptions","organizations_url":"https://api.github.com/users/cibernox/orgs","repos_url":"https://api.github.com/users/cibernox/repos","events_url":"https://api.github.com/users/cibernox/events{/privacy}","received_events_url":"https://api.github.com/users/cibernox/received_events","type":"User","site_admin":false},"body":"cache length for performance here.","created_at":"2014-10-05T22:55:43Z","updated_at":"2014-10-05T22:55:43Z","html_url":"https://github.com/tildeio/htmlbars/pull/99#discussion_r18438263","pull_request_url":"https://api.github.com/repos/tildeio/htmlbars/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/comments/18438263"},"html":{"href":"https://github.com/tildeio/htmlbars/pull/99#discussion_r18438263"},"pull_request":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/tildeio/htmlbars/pulls/99","id":22260202,"html_url":"https://github.com/tildeio/htmlbars/pull/99","diff_url":"https://github.com/tildeio/htmlbars/pull/99.diff","patch_url":"https://github.com/tildeio/htmlbars/pull/99.patch","issue_url":"https://api.github.com/repos/tildeio/htmlbars/issues/99","number":99,"state":"open","locked":false,"title":"A classList based add/removeClass, setAttribute fallback","user":{"login":"mixonic","id":8752,"avatar_url":"https://avatars.githubusercontent.com/u/8752?v=2","gravatar_id":"","url":"https://api.github.com/users/mixonic","html_url":"https://github.com/mixonic","followers_url":"https://api.github.com/users/mixonic/followers","following_url":"https://api.github.com/users/mixonic/following{/other_user}","gists_url":"https://api.github.com/users/mixonic/gists{/gist_id}","starred_url":"https://api.github.com/users/mixonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixonic/subscriptions","organizations_url":"https://api.github.com/users/mixonic/orgs","repos_url":"https://api.github.com/users/mixonic/repos","events_url":"https://api.github.com/users/mixonic/events{/privacy}","received_events_url":"https://api.github.com/users/mixonic/received_events","type":"User","site_admin":false},"body":"In prep for removing the Ember.js `jQuery` dependency on `.addClass`. By using `classList` (with a `setAttribute` fallback) we also gain better performance and SVG compatibility.","created_at":"2014-10-05T22:53:36Z","updated_at":"2014-10-05T22:55:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5a5cfbfecb94bb31951983408eee19082aa42cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tildeio/htmlbars/pulls/99/commits","review_comments_url":"https://api.github.com/repos/tildeio/htmlbars/pulls/99/comments","review_comment_url":"https://api.github.com/repos/tildeio/htmlbars/pulls/comments/{number}","comments_url":"https://api.github.com/repos/tildeio/htmlbars/issues/99/comments","statuses_url":"https://api.github.com/repos/tildeio/htmlbars/statuses/e9fd570d00f85160f68570d63fb621fac381684d","head":{"label":"mixonic:add-remove-class","ref":"add-remove-class","sha":"e9fd570d00f85160f68570d63fb621fac381684d","user":{"login":"mixonic","id":8752,"avatar_url":"https://avatars.githubusercontent.com/u/8752?v=2","gravatar_id":"","url":"https://api.github.com/users/mixonic","html_url":"https://github.com/mixonic","followers_url":"https://api.github.com/users/mixonic/followers","following_url":"https://api.github.com/users/mixonic/following{/other_user}","gists_url":"https://api.github.com/users/mixonic/gists{/gist_id}","starred_url":"https://api.github.com/users/mixonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixonic/subscriptions","organizations_url":"https://api.github.com/users/mixonic/orgs","repos_url":"https://api.github.com/users/mixonic/repos","events_url":"https://api.github.com/users/mixonic/events{/privacy}","received_events_url":"https://api.github.com/users/mixonic/received_events","type":"User","site_admin":false},"repo":{"id":20219689,"name":"htmlbars","full_name":"mixonic/htmlbars","owner":{"login":"mixonic","id":8752,"avatar_url":"https://avatars.githubusercontent.com/u/8752?v=2","gravatar_id":"","url":"https://api.github.com/users/mixonic","html_url":"https://github.com/mixonic","followers_url":"https://api.github.com/users/mixonic/followers","following_url":"https://api.github.com/users/mixonic/following{/other_user}","gists_url":"https://api.github.com/users/mixonic/gists{/gist_id}","starred_url":"https://api.github.com/users/mixonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixonic/subscriptions","organizations_url":"https://api.github.com/users/mixonic/orgs","repos_url":"https://api.github.com/users/mixonic/repos","events_url":"https://api.github.com/users/mixonic/events{/privacy}","received_events_url":"https://api.github.com/users/mixonic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mixonic/htmlbars","description":"A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes (very much still a WIP, and focused on the data binding use-case)","fork":true,"url":"https://api.github.com/repos/mixonic/htmlbars","forks_url":"https://api.github.com/repos/mixonic/htmlbars/forks","keys_url":"https://api.github.com/repos/mixonic/htmlbars/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixonic/htmlbars/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixonic/htmlbars/teams","hooks_url":"https://api.github.com/repos/mixonic/htmlbars/hooks","issue_events_url":"https://api.github.com/repos/mixonic/htmlbars/issues/events{/number}","events_url":"https://api.github.com/repos/mixonic/htmlbars/events","assignees_url":"https://api.github.com/repos/mixonic/htmlbars/assignees{/user}","branches_url":"https://api.github.com/repos/mixonic/htmlbars/branches{/branch}","tags_url":"https://api.github.com/repos/mixonic/htmlbars/tags","blobs_url":"https://api.github.com/repos/mixonic/htmlbars/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixonic/htmlbars/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixonic/htmlbars/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixonic/htmlbars/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixonic/htmlbars/statuses/{sha}","languages_url":"https://api.github.com/repos/mixonic/htmlbars/languages","stargazers_url":"https://api.github.com/repos/mixonic/htmlbars/stargazers","contributors_url":"https://api.github.com/repos/mixonic/htmlbars/contributors","subscribers_url":"https://api.github.com/repos/mixonic/htmlbars/subscribers","subscription_url":"https://api.github.com/repos/mixonic/htmlbars/subscription","commits_url":"https://api.github.com/repos/mixonic/htmlbars/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixonic/htmlbars/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixonic/htmlbars/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixonic/htmlbars/issues/comments/{number}","contents_url":"https://api.github.com/repos/mixonic/htmlbars/contents/{+path}","compare_url":"https://api.github.com/repos/mixonic/htmlbars/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixonic/htmlbars/merges","archive_url":"https://api.github.com/repos/mixonic/htmlbars/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixonic/htmlbars/downloads","issues_url":"https://api.github.com/repos/mixonic/htmlbars/issues{/number}","pulls_url":"https://api.github.com/repos/mixonic/htmlbars/pulls{/number}","milestones_url":"https://api.github.com/repos/mixonic/htmlbars/milestones{/number}","notifications_url":"https://api.github.com/repos/mixonic/htmlbars/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixonic/htmlbars/labels{/name}","releases_url":"https://api.github.com/repos/mixonic/htmlbars/releases{/id}","created_at":"2014-05-27T12:47:04Z","updated_at":"2014-06-29T18:35:05Z","pushed_at":"2014-10-05T22:51:35Z","git_url":"git://github.com/mixonic/htmlbars.git","ssh_url":"git@github.com:mixonic/htmlbars.git","clone_url":"https://github.com/mixonic/htmlbars.git","svn_url":"https://github.com/mixonic/htmlbars","homepage":null,"size":2189,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"tildeio:master","ref":"master","sha":"a3e2369f1859f4993a9b64a80d50556ef2ebe246","user":{"login":"tildeio","id":1355851,"avatar_url":"https://avatars.githubusercontent.com/u/1355851?v=2","gravatar_id":"","url":"https://api.github.com/users/tildeio","html_url":"https://github.com/tildeio","followers_url":"https://api.github.com/users/tildeio/followers","following_url":"https://api.github.com/users/tildeio/following{/other_user}","gists_url":"https://api.github.com/users/tildeio/gists{/gist_id}","starred_url":"https://api.github.com/users/tildeio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildeio/subscriptions","organizations_url":"https://api.github.com/users/tildeio/orgs","repos_url":"https://api.github.com/users/tildeio/repos","events_url":"https://api.github.com/users/tildeio/events{/privacy}","received_events_url":"https://api.github.com/users/tildeio/received_events","type":"Organization","site_admin":false},"repo":{"id":8921879,"name":"htmlbars","full_name":"tildeio/htmlbars","owner":{"login":"tildeio","id":1355851,"avatar_url":"https://avatars.githubusercontent.com/u/1355851?v=2","gravatar_id":"","url":"https://api.github.com/users/tildeio","html_url":"https://github.com/tildeio","followers_url":"https://api.github.com/users/tildeio/followers","following_url":"https://api.github.com/users/tildeio/following{/other_user}","gists_url":"https://api.github.com/users/tildeio/gists{/gist_id}","starred_url":"https://api.github.com/users/tildeio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tildeio/subscriptions","organizations_url":"https://api.github.com/users/tildeio/orgs","repos_url":"https://api.github.com/users/tildeio/repos","events_url":"https://api.github.com/users/tildeio/events{/privacy}","received_events_url":"https://api.github.com/users/tildeio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tildeio/htmlbars","description":"A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes (very much still a WIP, and focused on the data binding use-case)","fork":false,"url":"https://api.github.com/repos/tildeio/htmlbars","forks_url":"https://api.github.com/repos/tildeio/htmlbars/forks","keys_url":"https://api.github.com/repos/tildeio/htmlbars/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tildeio/htmlbars/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tildeio/htmlbars/teams","hooks_url":"https://api.github.com/repos/tildeio/htmlbars/hooks","issue_events_url":"https://api.github.com/repos/tildeio/htmlbars/issues/events{/number}","events_url":"https://api.github.com/repos/tildeio/htmlbars/events","assignees_url":"https://api.github.com/repos/tildeio/htmlbars/assignees{/user}","branches_url":"https://api.github.com/repos/tildeio/htmlbars/branches{/branch}","tags_url":"https://api.github.com/repos/tildeio/htmlbars/tags","blobs_url":"https://api.github.com/repos/tildeio/htmlbars/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tildeio/htmlbars/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tildeio/htmlbars/git/refs{/sha}","trees_url":"https://api.github.com/repos/tildeio/htmlbars/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tildeio/htmlbars/statuses/{sha}","languages_url":"https://api.github.com/repos/tildeio/htmlbars/languages","stargazers_url":"https://api.github.com/repos/tildeio/htmlbars/stargazers","contributors_url":"https://api.github.com/repos/tildeio/htmlbars/contributors","subscribers_url":"https://api.github.com/repos/tildeio/htmlbars/subscribers","subscription_url":"https://api.github.com/repos/tildeio/htmlbars/subscription","commits_url":"https://api.github.com/repos/tildeio/htmlbars/commits{/sha}","git_commits_url":"https://api.github.com/repos/tildeio/htmlbars/git/commits{/sha}","comments_url":"https://api.github.com/repos/tildeio/htmlbars/comments{/number}","issue_comment_url":"https://api.github.com/repos/tildeio/htmlbars/issues/comments/{number}","contents_url":"https://api.github.com/repos/tildeio/htmlbars/contents/{+path}","compare_url":"https://api.github.com/repos/tildeio/htmlbars/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tildeio/htmlbars/merges","archive_url":"https://api.github.com/repos/tildeio/htmlbars/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tildeio/htmlbars/downloads","issues_url":"https://api.github.com/repos/tildeio/htmlbars/issues{/number}","pulls_url":"https://api.github.com/repos/tildeio/htmlbars/pulls{/number}","milestones_url":"https://api.github.com/repos/tildeio/htmlbars/milestones{/number}","notifications_url":"https://api.github.com/repos/tildeio/htmlbars/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tildeio/htmlbars/labels{/name}","releases_url":"https://api.github.com/repos/tildeio/htmlbars/releases{/id}","created_at":"2013-03-21T05:32:02Z","updated_at":"2014-10-02T11:09:14Z","pushed_at":"2014-09-29T19:12:16Z","git_url":"git://github.com/tildeio/htmlbars.git","ssh_url":"git@github.com:tildeio/htmlbars.git","clone_url":"https://github.com/tildeio/htmlbars.git","svn_url":"https://github.com/tildeio/htmlbars","homepage":null,"size":3502,"stargazers_count":922,"watchers_count":922,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"open_issues_count":9,"forks":69,"open_issues":9,"watchers":922,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/99"},"html":{"href":"https://github.com/tildeio/htmlbars/pull/99"},"issue":{"href":"https://api.github.com/repos/tildeio/htmlbars/issues/99"},"comments":{"href":"https://api.github.com/repos/tildeio/htmlbars/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/tildeio/htmlbars/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/tildeio/htmlbars/statuses/e9fd570d00f85160f68570d63fb621fac381684d"}}}}