{"action":"created","comment":{"url":"https://api.github.com/repos/Jam3/f1/pulls/comments/39108098","id":39108098,"diff_hunk":"@@ -117,6 +121,39 @@ f1.prototype = {\n    */\n   targets: function( targets ) {\n \n+    var instance = this;\n+\n+    if (targets) {\n+      _.forEach(targets, function (el, elementId) {\n+        var elementData = {\n+          id: elementId,\n+          get states() {\n+            return _.keys(instance.defStates).reduce(function (dict, key) {\n+              dict[key] = instance.defStates[key][elementId];\n+              return dict;\n+            }, {});\n+          },\n+          set states(newStates) {\n+            // TODO: what to do about state deletions? this only handles modifications or new states\n+            Object.keys(newStates).forEach(function (stateId) {\n+              instance.defStates[stateId][elementId] = newStates[stateId];\n+            });\n+            instance.go(instance.state);\n+          },\n+          get transitions() {\n+            // TODO. Note: by default it's in the form of [{animation: {elementId1: { properties }, anotherElement: { properties }}, from, to}]\n+            // should change it to [{animation: { properties }, from, to}]\n+            return [];\n+          },\n+          $go: instance.go.bind(instance)\n+        };\n+        // add to global so the devtool can access the list of elements\n+        global.f1targets[elementId] = elementData;","path":"index.js","position":49,"original_position":49,"commit_id":"4653190647e2fdfa4f00f78b32bc27a7e2f238f8","original_commit_id":"4653190647e2fdfa4f00f78b32bc27a7e2f238f8","user":{"login":"cheapsteak","id":743976,"avatar_url":"https://avatars.githubusercontent.com/u/743976?v=3","gravatar_id":"","url":"https://api.github.com/users/cheapsteak","html_url":"https://github.com/cheapsteak","followers_url":"https://api.github.com/users/cheapsteak/followers","following_url":"https://api.github.com/users/cheapsteak/following{/other_user}","gists_url":"https://api.github.com/users/cheapsteak/gists{/gist_id}","starred_url":"https://api.github.com/users/cheapsteak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheapsteak/subscriptions","organizations_url":"https://api.github.com/users/cheapsteak/orgs","repos_url":"https://api.github.com/users/cheapsteak/repos","events_url":"https://api.github.com/users/cheapsteak/events{/privacy}","received_events_url":"https://api.github.com/users/cheapsteak/received_events","type":"User","site_admin":false},"body":"Ideally it would be isolated in the devtool module (where it's more common to fall back to `window` due to a lack of better channels ) if it can hook into the same data. Couldn't figure out how to do that, open to suggestions","created_at":"2015-09-09T23:05:23Z","updated_at":"2015-09-09T23:05:23Z","html_url":"https://github.com/Jam3/f1/pull/7#discussion_r39108098","pull_request_url":"https://api.github.com/repos/Jam3/f1/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/Jam3/f1/pulls/comments/39108098"},"html":{"href":"https://github.com/Jam3/f1/pull/7#discussion_r39108098"},"pull_request":{"href":"https://api.github.com/repos/Jam3/f1/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/Jam3/f1/pulls/7","id":42740990,"html_url":"https://github.com/Jam3/f1/pull/7","diff_url":"https://github.com/Jam3/f1/pull/7.diff","patch_url":"https://github.com/Jam3/f1/pull/7.patch","issue_url":"https://api.github.com/repos/Jam3/f1/issues/7","number":7,"state":"open","locked":false,"title":"added things necessary for browser tool to work","user":{"login":"cheapsteak","id":743976,"avatar_url":"https://avatars.githubusercontent.com/u/743976?v=3","gravatar_id":"","url":"https://api.github.com/users/cheapsteak","html_url":"https://github.com/cheapsteak","followers_url":"https://api.github.com/users/cheapsteak/followers","following_url":"https://api.github.com/users/cheapsteak/following{/other_user}","gists_url":"https://api.github.com/users/cheapsteak/gists{/gist_id}","starred_url":"https://api.github.com/users/cheapsteak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheapsteak/subscriptions","organizations_url":"https://api.github.com/users/cheapsteak/orgs","repos_url":"https://api.github.com/users/cheapsteak/repos","events_url":"https://api.github.com/users/cheapsteak/events{/privacy}","received_events_url":"https://api.github.com/users/cheapsteak/received_events","type":"User","site_admin":false},"body":"Attached f1 states specific to an element to its DOM node so they can be operated on when inspected  \r\n\r\nAttach each f1 element with their states to a global object that will be read by the devtool","created_at":"2015-08-18T19:52:43Z","updated_at":"2015-09-09T23:05:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10fe30106a5aa505a480fceabcfdb466acb31c55","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Jam3/f1/pulls/7/commits","review_comments_url":"https://api.github.com/repos/Jam3/f1/pulls/7/comments","review_comment_url":"https://api.github.com/repos/Jam3/f1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Jam3/f1/issues/7/comments","statuses_url":"https://api.github.com/repos/Jam3/f1/statuses/4653190647e2fdfa4f00f78b32bc27a7e2f238f8","head":{"label":"cheapsteak:browser-tool","ref":"browser-tool","sha":"4653190647e2fdfa4f00f78b32bc27a7e2f238f8","user":{"login":"cheapsteak","id":743976,"avatar_url":"https://avatars.githubusercontent.com/u/743976?v=3","gravatar_id":"","url":"https://api.github.com/users/cheapsteak","html_url":"https://github.com/cheapsteak","followers_url":"https://api.github.com/users/cheapsteak/followers","following_url":"https://api.github.com/users/cheapsteak/following{/other_user}","gists_url":"https://api.github.com/users/cheapsteak/gists{/gist_id}","starred_url":"https://api.github.com/users/cheapsteak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheapsteak/subscriptions","organizations_url":"https://api.github.com/users/cheapsteak/orgs","repos_url":"https://api.github.com/users/cheapsteak/repos","events_url":"https://api.github.com/users/cheapsteak/events{/privacy}","received_events_url":"https://api.github.com/users/cheapsteak/received_events","type":"User","site_admin":false},"repo":{"id":40993874,"name":"f1","full_name":"cheapsteak/f1","owner":{"login":"cheapsteak","id":743976,"avatar_url":"https://avatars.githubusercontent.com/u/743976?v=3","gravatar_id":"","url":"https://api.github.com/users/cheapsteak","html_url":"https://github.com/cheapsteak","followers_url":"https://api.github.com/users/cheapsteak/followers","following_url":"https://api.github.com/users/cheapsteak/following{/other_user}","gists_url":"https://api.github.com/users/cheapsteak/gists{/gist_id}","starred_url":"https://api.github.com/users/cheapsteak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheapsteak/subscriptions","organizations_url":"https://api.github.com/users/cheapsteak/orgs","repos_url":"https://api.github.com/users/cheapsteak/repos","events_url":"https://api.github.com/users/cheapsteak/events{/privacy}","received_events_url":"https://api.github.com/users/cheapsteak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cheapsteak/f1","description":"A stateful ui library","fork":true,"url":"https://api.github.com/repos/cheapsteak/f1","forks_url":"https://api.github.com/repos/cheapsteak/f1/forks","keys_url":"https://api.github.com/repos/cheapsteak/f1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cheapsteak/f1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cheapsteak/f1/teams","hooks_url":"https://api.github.com/repos/cheapsteak/f1/hooks","issue_events_url":"https://api.github.com/repos/cheapsteak/f1/issues/events{/number}","events_url":"https://api.github.com/repos/cheapsteak/f1/events","assignees_url":"https://api.github.com/repos/cheapsteak/f1/assignees{/user}","branches_url":"https://api.github.com/repos/cheapsteak/f1/branches{/branch}","tags_url":"https://api.github.com/repos/cheapsteak/f1/tags","blobs_url":"https://api.github.com/repos/cheapsteak/f1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cheapsteak/f1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cheapsteak/f1/git/refs{/sha}","trees_url":"https://api.github.com/repos/cheapsteak/f1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cheapsteak/f1/statuses/{sha}","languages_url":"https://api.github.com/repos/cheapsteak/f1/languages","stargazers_url":"https://api.github.com/repos/cheapsteak/f1/stargazers","contributors_url":"https://api.github.com/repos/cheapsteak/f1/contributors","subscribers_url":"https://api.github.com/repos/cheapsteak/f1/subscribers","subscription_url":"https://api.github.com/repos/cheapsteak/f1/subscription","commits_url":"https://api.github.com/repos/cheapsteak/f1/commits{/sha}","git_commits_url":"https://api.github.com/repos/cheapsteak/f1/git/commits{/sha}","comments_url":"https://api.github.com/repos/cheapsteak/f1/comments{/number}","issue_comment_url":"https://api.github.com/repos/cheapsteak/f1/issues/comments{/number}","contents_url":"https://api.github.com/repos/cheapsteak/f1/contents/{+path}","compare_url":"https://api.github.com/repos/cheapsteak/f1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cheapsteak/f1/merges","archive_url":"https://api.github.com/repos/cheapsteak/f1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cheapsteak/f1/downloads","issues_url":"https://api.github.com/repos/cheapsteak/f1/issues{/number}","pulls_url":"https://api.github.com/repos/cheapsteak/f1/pulls{/number}","milestones_url":"https://api.github.com/repos/cheapsteak/f1/milestones{/number}","notifications_url":"https://api.github.com/repos/cheapsteak/f1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cheapsteak/f1/labels{/name}","releases_url":"https://api.github.com/repos/cheapsteak/f1/releases{/id}","created_at":"2015-08-18T19:43:28Z","updated_at":"2015-08-18T19:43:28Z","pushed_at":"2015-08-28T21:24:29Z","git_url":"git://github.com/cheapsteak/f1.git","ssh_url":"git@github.com:cheapsteak/f1.git","clone_url":"https://github.com/cheapsteak/f1.git","svn_url":"https://github.com/cheapsteak/f1","homepage":null,"size":118,"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":"Jam3:master","ref":"master","sha":"d45c071affd5865ee11642cf913bd2aac797f54f","user":{"login":"Jam3","id":1165621,"avatar_url":"https://avatars.githubusercontent.com/u/1165621?v=3","gravatar_id":"","url":"https://api.github.com/users/Jam3","html_url":"https://github.com/Jam3","followers_url":"https://api.github.com/users/Jam3/followers","following_url":"https://api.github.com/users/Jam3/following{/other_user}","gists_url":"https://api.github.com/users/Jam3/gists{/gist_id}","starred_url":"https://api.github.com/users/Jam3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jam3/subscriptions","organizations_url":"https://api.github.com/users/Jam3/orgs","repos_url":"https://api.github.com/users/Jam3/repos","events_url":"https://api.github.com/users/Jam3/events{/privacy}","received_events_url":"https://api.github.com/users/Jam3/received_events","type":"Organization","site_admin":false},"repo":{"id":29697192,"name":"f1","full_name":"Jam3/f1","owner":{"login":"Jam3","id":1165621,"avatar_url":"https://avatars.githubusercontent.com/u/1165621?v=3","gravatar_id":"","url":"https://api.github.com/users/Jam3","html_url":"https://github.com/Jam3","followers_url":"https://api.github.com/users/Jam3/followers","following_url":"https://api.github.com/users/Jam3/following{/other_user}","gists_url":"https://api.github.com/users/Jam3/gists{/gist_id}","starred_url":"https://api.github.com/users/Jam3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jam3/subscriptions","organizations_url":"https://api.github.com/users/Jam3/orgs","repos_url":"https://api.github.com/users/Jam3/repos","events_url":"https://api.github.com/users/Jam3/events{/privacy}","received_events_url":"https://api.github.com/users/Jam3/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Jam3/f1","description":"A stateful ui library","fork":false,"url":"https://api.github.com/repos/Jam3/f1","forks_url":"https://api.github.com/repos/Jam3/f1/forks","keys_url":"https://api.github.com/repos/Jam3/f1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jam3/f1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jam3/f1/teams","hooks_url":"https://api.github.com/repos/Jam3/f1/hooks","issue_events_url":"https://api.github.com/repos/Jam3/f1/issues/events{/number}","events_url":"https://api.github.com/repos/Jam3/f1/events","assignees_url":"https://api.github.com/repos/Jam3/f1/assignees{/user}","branches_url":"https://api.github.com/repos/Jam3/f1/branches{/branch}","tags_url":"https://api.github.com/repos/Jam3/f1/tags","blobs_url":"https://api.github.com/repos/Jam3/f1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jam3/f1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jam3/f1/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jam3/f1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jam3/f1/statuses/{sha}","languages_url":"https://api.github.com/repos/Jam3/f1/languages","stargazers_url":"https://api.github.com/repos/Jam3/f1/stargazers","contributors_url":"https://api.github.com/repos/Jam3/f1/contributors","subscribers_url":"https://api.github.com/repos/Jam3/f1/subscribers","subscription_url":"https://api.github.com/repos/Jam3/f1/subscription","commits_url":"https://api.github.com/repos/Jam3/f1/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jam3/f1/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jam3/f1/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jam3/f1/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jam3/f1/contents/{+path}","compare_url":"https://api.github.com/repos/Jam3/f1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jam3/f1/merges","archive_url":"https://api.github.com/repos/Jam3/f1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jam3/f1/downloads","issues_url":"https://api.github.com/repos/Jam3/f1/issues{/number}","pulls_url":"https://api.github.com/repos/Jam3/f1/pulls{/number}","milestones_url":"https://api.github.com/repos/Jam3/f1/milestones{/number}","notifications_url":"https://api.github.com/repos/Jam3/f1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jam3/f1/labels{/name}","releases_url":"https://api.github.com/repos/Jam3/f1/releases{/id}","created_at":"2015-01-22T19:56:27Z","updated_at":"2015-08-24T03:51:32Z","pushed_at":"2015-08-28T21:24:30Z","git_url":"git://github.com/Jam3/f1.git","ssh_url":"git@github.com:Jam3/f1.git","clone_url":"https://github.com/Jam3/f1.git","svn_url":"https://github.com/Jam3/f1","homepage":null,"size":234,"stargazers_count":19,"watchers_count":19,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jam3/f1/pulls/7"},"html":{"href":"https://github.com/Jam3/f1/pull/7"},"issue":{"href":"https://api.github.com/repos/Jam3/f1/issues/7"},"comments":{"href":"https://api.github.com/repos/Jam3/f1/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/Jam3/f1/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/Jam3/f1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Jam3/f1/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/Jam3/f1/statuses/4653190647e2fdfa4f00f78b32bc27a7e2f238f8"}}}}