GitHub PullRequestReviewCommentEvent at 2014-09-09 23:09:32
Repository: iD
Actor: tmcw
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/openstreetmap/iD/pulls/comments/17334297","id":17334297,"diff_hunk":"@@ -0,0 +1,94 @@\n+iD.modes.SelectImage = function (context) {\n+    var mode = {\n+        button: 'selectImage',\n+        id: 'selectImage',\n+        title: t('modes.selectImage.title'),\n+        description: t('modes.selectImage.description'),\n+        key: 'm'\n+    }, imageView, currentImage;\n+\n+    var behaviors = [\n+    ];\n+\n+    function click() {\n+        var datum = d3.event.target.__data__;\n+        if (isImage(datum)) {\n+            if (currentImage) {\n+                context.surface().selectAll('.key_' + currentImage.properties.key)\n+                    .classed('selected', false);\n+            }\n+            if(currentImage === datum) {\n+                context.surface().selectAll('.key_' + currentImage.properties.key)\n+                    .classed('selected', false);\n+                currentImage = undefined;\n+\n+            } else {\n+                currentImage = datum;\n+                context.surface().selectAll('.key_' + currentImage.properties.key)\n+                    .classed('selected', true);\n+            }\n+//            imageView.selectedImage(currentImage);\n+            imageView.show(currentImage);\n+        }\n+    }\n+\n+    function isImage(datum) {\n+        return datum !== undefined && datum && datum.properties !== undefined && datum.properties.entityType === 'image';\n+    }\n+\n+    mode.enter = function () {\n+//        console.log('selectImage.enter');\n+        context.map().enableSequences(true);\n+        behaviors.forEach(function (behavior) {\n+            context.install(behavior);\n+        });\n+\n+        // Get focus on the body.\n+        if (document.activeElement && document.activeElement.blur) {\n+            document.activeElement.blur();\n+        }\n+\n+        imageView = context.imageView();\n+        imageView.showEmpty();\n+        context.surface()\n+            .on('click.image', click);\n+        context.surface()\n+            .on('mouseover.image', function () {\n+                var datum = d3.event.target.__data__;\n+                if (isImage(datum)) {\n+                    imageView.hoverImage(datum);\n+                }\n+            })\n+            .on('mouseout.image', function () {\n+                var datum = d3.event.target.__data__;\n+                if (isImage(datum)) {\n+                    if(currentImage) {\n+                        imageView.show(currentImage);\n+                    } else {\n+                        imageView.showEmpty();\n+                    }\n+                }\n+            });\n+    };\n+\n+    mode.exit = function () {\n+        context.map().enableSequences(false);\n+        if(!currentImage) {\n+            d3.select('#mapillaryImage').classed('hidden', true);","path":"js/id/modes/selectImage.js","position":77,"original_position":77,"commit_id":"11733416a52cf4a36ac9278aec7adf9a5a4e7c06","original_commit_id":"11733416a52cf4a36ac9278aec7adf9a5a4e7c06","user":{"login":"tmcw","id":32314,"avatar_url":"https://avatars.githubusercontent.com/u/32314?v=2","gravatar_id":"69a180136f3c237769452a4af0bbb9a1","url":"https://api.github.com/users/tmcw","html_url":"https://github.com/tmcw","followers_url":"https://api.github.com/users/tmcw/followers","following_url":"https://api.github.com/users/tmcw/following{/other_user}","gists_url":"https://api.github.com/users/tmcw/gists{/gist_id}","starred_url":"https://api.github.com/users/tmcw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmcw/subscriptions","organizations_url":"https://api.github.com/users/tmcw/orgs","repos_url":"https://api.github.com/users/tmcw/repos","events_url":"https://api.github.com/users/tmcw/events{/privacy}","received_events_url":"https://api.github.com/users/tmcw/received_events","type":"User","site_admin":false},"body":"All `d3.select`s should be scoped to a known element, otherwise this can clobber elements on the rest of the page or on other iD instances - here `context.container()` would be appropriate.","created_at":"2014-09-09T23:09:32Z","updated_at":"2014-09-09T23:09:32Z","html_url":"https://github.com/openstreetmap/iD/pull/2324#discussion_r17334297","pull_request_url":"https://api.github.com/repos/openstreetmap/iD/pulls/2324","_links":{"self":{"href":"https://api.github.com/repos/openstreetmap/iD/pulls/comments/17334297"},"html":{"href":"https://github.com/openstreetmap/iD/pull/2324#discussion_r17334297"},"pull_request":{"href":"https://api.github.com/repos/openstreetmap/iD/pulls/2324"}}},"pull_request":{"url":"https://api.github.com/repos/openstreetmap/iD/pulls/2324","id":19971422,"html_url":"https://github.com/openstreetmap/iD/pull/2324","diff_url":"https://github.com/openstreetmap/iD/pull/2324.diff","patch_url":"https://github.com/openstreetmap/iD/pull/2324.patch","issue_url":"https://api.github.com/repos/openstreetmap/iD/issues/2324","number":2324,"state":"open","locked":false,"title":"Mapillary inline pictures to iD","user":{"login":"peterneubauer","id":11977,"avatar_url":"https://avatars.githubusercontent.com/u/11977?v=2","gravatar_id":"840ccffd0e89333b608b595ce4782720","url":"https://api.github.com/users/peterneubauer","html_url":"https://github.com/peterneubauer","followers_url":"https://api.github.com/users/peterneubauer/followers","following_url":"https://api.github.com/users/peterneubauer/following{/other_user}","gists_url":"https://api.github.com/users/peterneubauer/gists{/gist_id}","starred_url":"https://api.github.com/users/peterneubauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterneubauer/subscriptions","organizations_url":"https://api.github.com/users/peterneubauer/orgs","repos_url":"https://api.github.com/users/peterneubauer/repos","events_url":"https://api.github.com/users/peterneubauer/events{/privacy}","received_events_url":"https://api.github.com/users/peterneubauer/received_events","type":"User","site_admin":false},"body":"This is just a first stab, intended for comments and hints on how to make the behavior nice, please provide feedback!\r\n\r\nDemo site: http://mapillary.github.io/iD/","created_at":"2014-08-19T10:18:30Z","updated_at":"2014-09-09T23:09:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe9b917f382ef6c04544164d67be8cce138d5808","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openstreetmap/iD/pulls/2324/commits","review_comments_url":"https://api.github.com/repos/openstreetmap/iD/pulls/2324/comments","review_comment_url":"https://api.github.com/repos/openstreetmap/iD/pulls/comments/{number}","comments_url":"https://api.github.com/repos/openstreetmap/iD/issues/2324/comments","statuses_url":"https://api.github.com/repos/openstreetmap/iD/statuses/11733416a52cf4a36ac9278aec7adf9a5a4e7c06","head":{"label":"mapillary:master","ref":"master","sha":"11733416a52cf4a36ac9278aec7adf9a5a4e7c06","user":{"login":"mapillary","id":5332499,"avatar_url":"https://avatars.githubusercontent.com/u/5332499?v=2","gravatar_id":"7de1df4aa5b837430bfe28fef82489f6","url":"https://api.github.com/users/mapillary","html_url":"https://github.com/mapillary","followers_url":"https://api.github.com/users/mapillary/followers","following_url":"https://api.github.com/users/mapillary/following{/other_user}","gists_url":"https://api.github.com/users/mapillary/gists{/gist_id}","starred_url":"https://api.github.com/users/mapillary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapillary/subscriptions","organizations_url":"https://api.github.com/users/mapillary/orgs","repos_url":"https://api.github.com/users/mapillary/repos","events_url":"https://api.github.com/users/mapillary/events{/privacy}","received_events_url":"https://api.github.com/users/mapillary/received_events","type":"Organization","site_admin":false},"repo":{"id":22854307,"name":"iD","full_name":"mapillary/iD","owner":{"login":"mapillary","id":5332499,"avatar_url":"https://avatars.githubusercontent.com/u/5332499?v=2","gravatar_id":"7de1df4aa5b837430bfe28fef82489f6","url":"https://api.github.com/users/mapillary","html_url":"https://github.com/mapillary","followers_url":"https://api.github.com/users/mapillary/followers","following_url":"https://api.github.com/users/mapillary/following{/other_user}","gists_url":"https://api.github.com/users/mapillary/gists{/gist_id}","starred_url":"https://api.github.com/users/mapillary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapillary/subscriptions","organizations_url":"https://api.github.com/users/mapillary/orgs","repos_url":"https://api.github.com/users/mapillary/repos","events_url":"https://api.github.com/users/mapillary/events{/privacy}","received_events_url":"https://api.github.com/users/mapillary/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapillary/iD","description":"The easy-to-use OpenStreetMap editor in JavaScript.","fork":true,"url":"https://api.github.com/repos/mapillary/iD","forks_url":"https://api.github.com/repos/mapillary/iD/forks","keys_url":"https://api.github.com/repos/mapillary/iD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapillary/iD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapillary/iD/teams","hooks_url":"https://api.github.com/repos/mapillary/iD/hooks","issue_events_url":"https://api.github.com/repos/mapillary/iD/issues/events{/number}","events_url":"https://api.github.com/repos/mapillary/iD/events","assignees_url":"https://api.github.com/repos/mapillary/iD/assignees{/user}","branches_url":"https://api.github.com/repos/mapillary/iD/branches{/branch}","tags_url":"https://api.github.com/repos/mapillary/iD/tags","blobs_url":"https://api.github.com/repos/mapillary/iD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapillary/iD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapillary/iD/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapillary/iD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapillary/iD/statuses/{sha}","languages_url":"https://api.github.com/repos/mapillary/iD/languages","stargazers_url":"https://api.github.com/repos/mapillary/iD/stargazers","contributors_url":"https://api.github.com/repos/mapillary/iD/contributors","subscribers_url":"https://api.github.com/repos/mapillary/iD/subscribers","subscription_url":"https://api.github.com/repos/mapillary/iD/subscription","commits_url":"https://api.github.com/repos/mapillary/iD/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapillary/iD/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapillary/iD/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapillary/iD/issues/comments/{number}","contents_url":"https://api.github.com/repos/mapillary/iD/contents/{+path}","compare_url":"https://api.github.com/repos/mapillary/iD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapillary/iD/merges","archive_url":"https://api.github.com/repos/mapillary/iD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapillary/iD/downloads","issues_url":"https://api.github.com/repos/mapillary/iD/issues{/number}","pulls_url":"https://api.github.com/repos/mapillary/iD/pulls{/number}","milestones_url":"https://api.github.com/repos/mapillary/iD/milestones{/number}","notifications_url":"https://api.github.com/repos/mapillary/iD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapillary/iD/labels{/name}","releases_url":"https://api.github.com/repos/mapillary/iD/releases{/id}","created_at":"2014-08-11T20:47:21Z","updated_at":"2014-08-15T05:45:26Z","pushed_at":"2014-09-09T22:35:09Z","git_url":"git://github.com/mapillary/iD.git","ssh_url":"git@github.com:mapillary/iD.git","clone_url":"https://github.com/mapillary/iD.git","svn_url":"https://github.com/mapillary/iD","homepage":"http://ideditor.com/","size":52974,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"openstreetmap:master","ref":"master","sha":"7a6641a5aada6892015b7001f97901806f22d92a","user":{"login":"openstreetmap","id":261431,"avatar_url":"https://avatars.githubusercontent.com/u/261431?v=2","gravatar_id":"a458118ba88e2b1a231c1041d241ade8","url":"https://api.github.com/users/openstreetmap","html_url":"https://github.com/openstreetmap","followers_url":"https://api.github.com/users/openstreetmap/followers","following_url":"https://api.github.com/users/openstreetmap/following{/other_user}","gists_url":"https://api.github.com/users/openstreetmap/gists{/gist_id}","starred_url":"https://api.github.com/users/openstreetmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstreetmap/subscriptions","organizations_url":"https://api.github.com/users/openstreetmap/orgs","repos_url":"https://api.github.com/users/openstreetmap/repos","events_url":"https://api.github.com/users/openstreetmap/events{/privacy}","received_events_url":"https://api.github.com/users/openstreetmap/received_events","type":"Organization","site_admin":false},"repo":{"id":4989235,"name":"iD","full_name":"openstreetmap/iD","owner":{"login":"openstreetmap","id":261431,"avatar_url":"https://avatars.githubusercontent.com/u/261431?v=2","gravatar_id":"a458118ba88e2b1a231c1041d241ade8","url":"https://api.github.com/users/openstreetmap","html_url":"https://github.com/openstreetmap","followers_url":"https://api.github.com/users/openstreetmap/followers","following_url":"https://api.github.com/users/openstreetmap/following{/other_user}","gists_url":"https://api.github.com/users/openstreetmap/gists{/gist_id}","starred_url":"https://api.github.com/users/openstreetmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openstreetmap/subscriptions","organizations_url":"https://api.github.com/users/openstreetmap/orgs","repos_url":"https://api.github.com/users/openstreetmap/repos","events_url":"https://api.github.com/users/openstreetmap/events{/privacy}","received_events_url":"https://api.github.com/users/openstreetmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openstreetmap/iD","description":"The easy-to-use OpenStreetMap editor in JavaScript.","fork":false,"url":"https://api.github.com/repos/openstreetmap/iD","forks_url":"https://api.github.com/repos/openstreetmap/iD/forks","keys_url":"https://api.github.com/repos/openstreetmap/iD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openstreetmap/iD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openstreetmap/iD/teams","hooks_url":"https://api.github.com/repos/openstreetmap/iD/hooks","issue_events_url":"https://api.github.com/repos/openstreetmap/iD/issues/events{/number}","events_url":"https://api.github.com/repos/openstreetmap/iD/events","assignees_url":"https://api.github.com/repos/openstreetmap/iD/assignees{/user}","branches_url":"https://api.github.com/repos/openstreetmap/iD/branches{/branch}","tags_url":"https://api.github.com/repos/openstreetmap/iD/tags","blobs_url":"https://api.github.com/repos/openstreetmap/iD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openstreetmap/iD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openstreetmap/iD/git/refs{/sha}","trees_url":"https://api.github.com/repos/openstreetmap/iD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openstreetmap/iD/statuses/{sha}","languages_url":"https://api.github.com/repos/openstreetmap/iD/languages","stargazers_url":"https://api.github.com/repos/openstreetmap/iD/stargazers","contributors_url":"https://api.github.com/repos/openstreetmap/iD/contributors","subscribers_url":"https://api.github.com/repos/openstreetmap/iD/subscribers","subscription_url":"https://api.github.com/repos/openstreetmap/iD/subscription","commits_url":"https://api.github.com/repos/openstreetmap/iD/commits{/sha}","git_commits_url":"https://api.github.com/repos/openstreetmap/iD/git/commits{/sha}","comments_url":"https://api.github.com/repos/openstreetmap/iD/comments{/number}","issue_comment_url":"https://api.github.com/repos/openstreetmap/iD/issues/comments/{number}","contents_url":"https://api.github.com/repos/openstreetmap/iD/contents/{+path}","compare_url":"https://api.github.com/repos/openstreetmap/iD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openstreetmap/iD/merges","archive_url":"https://api.github.com/repos/openstreetmap/iD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openstreetmap/iD/downloads","issues_url":"https://api.github.com/repos/openstreetmap/iD/issues{/number}","pulls_url":"https://api.github.com/repos/openstreetmap/iD/pulls{/number}","milestones_url":"https://api.github.com/repos/openstreetmap/iD/milestones{/number}","notifications_url":"https://api.github.com/repos/openstreetmap/iD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openstreetmap/iD/labels{/name}","releases_url":"https://api.github.com/repos/openstreetmap/iD/releases{/id}","created_at":"2012-07-11T13:20:04Z","updated_at":"2014-09-08T00:15:51Z","pushed_at":"2014-09-09T20:15:02Z","git_url":"git://github.com/openstreetmap/iD.git","ssh_url":"git@github.com:openstreetmap/iD.git","clone_url":"https://github.com/openstreetmap/iD.git","svn_url":"https://github.com/openstreetmap/iD","homepage":"http://ideditor.com/","size":60103,"stargazers_count":785,"watchers_count":785,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":271,"mirror_url":null,"open_issues_count":180,"forks":271,"open_issues":180,"watchers":785,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openstreetmap/iD/pulls/2324"},"html":{"href":"https://github.com/openstreetmap/iD/pull/2324"},"issue":{"href":"https://api.github.com/repos/openstreetmap/iD/issues/2324"},"comments":{"href":"https://api.github.com/repos/openstreetmap/iD/issues/2324/comments"},"review_comments":{"href":"https://api.github.com/repos/openstreetmap/iD/pulls/2324/comments"},"review_comment":{"href":"https://api.github.com/repos/openstreetmap/iD/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/openstreetmap/iD/pulls/2324/commits"},"statuses":{"href":"https://api.github.com/repos/openstreetmap/iD/statuses/11733416a52cf4a36ac9278aec7adf9a5a4e7c06"}}}}