mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-22 02:53:35 +00:00
44 lines
1.5 KiB
JavaScript
44 lines
1.5 KiB
JavaScript
iD.ui.success = function() {
|
|
var event = d3.dispatch('cancel', 'save');
|
|
|
|
function success(selection) {
|
|
var changeset = selection.datum(),
|
|
header = selection.append('div').attr('class', 'header fillL modal-section'),
|
|
body = selection.append('div').attr('class', 'body');
|
|
|
|
var section = body.append('div').attr('class','modal-section fillD');
|
|
|
|
header.append('h2').text('You Just Edited OpenStreetMap!');
|
|
header.append('p').text('You just improved the world\'s best free map');
|
|
|
|
var m = '';
|
|
if (changeset.comment) {
|
|
m = '"' + changeset.comment.substring(0, 20) + '" ';
|
|
}
|
|
|
|
var message = 'Edited OpenStreetMap! ' + m +
|
|
'http://osm.org/browse/changeset/' + changeset.id;
|
|
|
|
section.append('a')
|
|
.attr('href', function(d) {
|
|
return 'https://twitter.com/intent/tweet?source=webclient&text=' +
|
|
encodeURIComponent(message);
|
|
})
|
|
.text('Tweet: ' + message);
|
|
|
|
var buttonwrap = section.append('div')
|
|
.attr('class', 'buttons cf');
|
|
|
|
var okbutton = buttonwrap.append('button')
|
|
.attr('class', 'action col2')
|
|
.on('click.save', function() {
|
|
event.cancel();
|
|
});
|
|
|
|
okbutton.append('span').attr('class','icon apply icon-pre-text');
|
|
okbutton.append('span').attr('class','label').text('Okay');
|
|
}
|
|
|
|
return d3.rebind(success, event, 'on');
|
|
};
|