diff --git a/js/id/id.js b/js/id/id.js index 071c0773d..296a2bdae 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -36,14 +36,36 @@ window.iD = function(container) { .call(bootstrap.tooltip().placement('bottom')) .on('click', function (mode) { controller.enter(mode); }); - map.on('move.disable-buttons', function() { + function disableTooHigh() { if (map.zoom() < 16) { buttons.attr('disabled', 'disabled'); controller.enter(iD.modes.Browse()); } else { buttons.attr('disabled', null); } - }); + } + + var showUsers = _.debounce(function() { + var users = {}, + entities = map.history().graph().entities; + for (var i in entities) { + users[entities[i].user] = true; + if (Object.keys(users).length > 10) break; + } + var u = Object.keys(users); + var l = d3.select('#user-list') + .selectAll('a.user-link').data(u); + l.enter().append('a') + .attr('class', 'user-link') + .attr('href', function(d) { + return 'http://api06.dev.openstreetmap.org/user/' + d; + }) + .text(String); + l.exit().remove(); + }, 1000); + + map.on('move.disable-buttons', disableTooHigh) + .on('move.show-users', showUsers); buttons.append('span') .attr('class', function(d) { @@ -143,12 +165,15 @@ window.iD = function(container) { .attr('class', 'inspector-wrap fillL') .style('display', 'none'); - this.append('div') + var about = this.append('div') .attr('id', 'about') .html("code " + "report a bug" + " "); + about.append('div') + .attr('id', 'user-list'); + history.on('change.buttons', function() { var undo = history.undoAnnotation(), redo = history.redoAnnotation(); diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js index 9f47c4be5..681436072 100644 --- a/js/id/ui/inspector.js +++ b/js/id/ui/inspector.js @@ -137,14 +137,16 @@ iD.Inspector = function() { selection.append('div') .attr('class', 'inspector-buttons').call(drawbuttons); + function apply(entity) { + event.changeTags(entity, unentries(grabtags())); + event.close(entity); + } + function drawbuttons(selection) { selection.append('button') .attr('class', 'apply wide action') .html("Apply") - .on('click', function(entity) { - event.changeTags(entity, unentries(grabtags())); - event.close(entity); - }); + .on('click', apply); selection.append('button') .attr('class', 'delete wide action fr') .html("Delete")