mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-02 17:33:31 +00:00
- adding a temp wikipedia icon from http://upload.wikimedia.org/wikipedia/commons/4/45/Right-facing-Arrow-icon.jpg Making the click update and rotate an image marker on the map with comapss direction. Needs to be centered etc. now properly enabling/disabling the different Mapillary layers upon activation/deactivation Upgrade to faster Mapillary API better arrow icon, refactoring to have all single-image operations in the image-layer dist build adding mapillary translation adjusting image link trying to adjust the image link for github deploy better layout removing font-awesome, not needed. https for calls consistent quotes taking care of more translation, fix case of no images found on Mapillary more english translations - scoping image calls to selection. - .inspector-wrap and .panewrap are hard to scope, since they are outside the selection, same for the #mapillary-inspector. -scoping calls in sequences layer adding translation fixing jslint errors more jshint errors adding mapillary to tests trying to lay out single markers, please help with the geo translation, @jfirebaugh - adding the image layer to the active iD SVG instead of background - add a new mode for selecting Mapillary images - first stab of adding the image pane in the sidebar itself in order to contain the selections (needs to be layouted) cleaning trying to mark and keep selected image between mouseovers refactoring to contain mapillary into the iamge mode refactoring to contain mapillary into the iamge mode adding to test html cleaning up handling unset selected image cleanup better sidebar moving image into the lower right Minor visual adjustment mapillaryImage better no_image text and toggling of selected image handling of text disappearing intendation fixing test errors making sequences be below images open Mapillary links in new tabs better arrows and selectability on arrows as a workaround for real navigation in panos more contrast for the selected image adjusting image style - adjusting style, removing sequence lines - adding photos as a mode with shortcut 'm' - fix test errors moving switch back to right sidebar, keeping keyboard shortcut. cleanup file rename to avoid GIT mess with casing. - better scoping - removed unused hover function - making the checkbox follow mode changes removing unused icon handling automatic mode exit
200 lines
5.5 KiB
JavaScript
200 lines
5.5 KiB
JavaScript
iD.ui = function(context) {
|
|
function render(container) {
|
|
var map = context.map();
|
|
|
|
if (iD.detect().opera) container.classed('opera', true);
|
|
|
|
var hash = iD.behavior.Hash(context);
|
|
|
|
hash();
|
|
|
|
if (!hash.hadHash) {
|
|
map.centerZoom([-77.02271, 38.90085], 20);
|
|
}
|
|
|
|
container.append('svg')
|
|
.attr('id', 'defs')
|
|
.call(iD.svg.Defs(context));
|
|
|
|
container.append('div')
|
|
.attr('id', 'sidebar')
|
|
.attr('class', 'col4')
|
|
.call(ui.sidebar);
|
|
|
|
var content = container.append('div')
|
|
.attr('id', 'content');
|
|
|
|
var bar = content.append('div')
|
|
.attr('id', 'bar')
|
|
.attr('class', 'fillD');
|
|
|
|
var m = content.append('div')
|
|
.attr('id', 'map')
|
|
.call(map);
|
|
content.append('div')
|
|
.attr('id', 'mapillaryImage')
|
|
.classed('hidden', true)
|
|
.call(iD.ui.ImageView(context));
|
|
|
|
bar.append('div')
|
|
.attr('class', 'spacer col4');
|
|
|
|
var limiter = bar.append('div')
|
|
.attr('class', 'limiter');
|
|
|
|
limiter.append('div')
|
|
.attr('class', 'button-wrap joined col3')
|
|
.call(iD.ui.Modes(context), limiter);
|
|
|
|
limiter.append('div')
|
|
.attr('class', 'button-wrap joined col1')
|
|
.call(iD.ui.UndoRedo(context));
|
|
|
|
limiter.append('div')
|
|
.attr('class', 'button-wrap col1')
|
|
.call(iD.ui.Save(context));
|
|
|
|
bar.append('div')
|
|
.attr('class', 'spinner')
|
|
.call(iD.ui.Spinner(context));
|
|
|
|
content
|
|
.call(iD.ui.Attribution(context));
|
|
|
|
content.append('div')
|
|
.style('display', 'none')
|
|
.attr('class', 'help-wrap map-overlay fillL col5 content');
|
|
|
|
var controls = bar.append('div')
|
|
.attr('class', 'map-controls');
|
|
|
|
controls.append('div')
|
|
.attr('class', 'map-control zoombuttons')
|
|
.call(iD.ui.Zoom(context));
|
|
|
|
controls.append('div')
|
|
.attr('class', 'map-control geolocate-control')
|
|
.call(iD.ui.Geolocate(map));
|
|
|
|
controls.append('div')
|
|
.attr('class', 'map-control background-control')
|
|
.call(iD.ui.Background(context));
|
|
|
|
controls.append('div')
|
|
.attr('class', 'map-control help-control')
|
|
.call(iD.ui.Help(context));
|
|
|
|
var footer = content.append('div')
|
|
.attr('id', 'footer')
|
|
.attr('class', 'fillD');
|
|
|
|
footer.append('div')
|
|
.attr('id', 'scale-block')
|
|
.call(iD.ui.Scale(context));
|
|
|
|
var linkList = footer.append('div')
|
|
.attr('id', 'info-block')
|
|
.append('ul')
|
|
.attr('id', 'about-list')
|
|
.attr('class', 'link-list');
|
|
|
|
if (!context.embed()) {
|
|
linkList.call(iD.ui.Account(context));
|
|
}
|
|
|
|
linkList.append('li')
|
|
.append('a')
|
|
.attr('target', '_blank')
|
|
.attr('tabindex', -1)
|
|
.attr('href', 'http://github.com/openstreetmap/iD')
|
|
.text(iD.version);
|
|
|
|
var bugReport = linkList.append('li')
|
|
.append('a')
|
|
.attr('target', '_blank')
|
|
.attr('tabindex', -1)
|
|
.attr('href', 'https://github.com/openstreetmap/iD/issues');
|
|
|
|
bugReport.append('span')
|
|
.attr('class','icon bug light');
|
|
|
|
bugReport.call(bootstrap.tooltip()
|
|
.title(t('report_a_bug'))
|
|
.placement('top')
|
|
);
|
|
|
|
linkList.append('li')
|
|
.attr('class', 'user-list')
|
|
.attr('tabindex', -1)
|
|
.call(iD.ui.Contributors(context));
|
|
|
|
footer.append('div')
|
|
.attr('class', 'api-status')
|
|
.call(iD.ui.Status(context));
|
|
|
|
window.onbeforeunload = function() {
|
|
return context.save();
|
|
};
|
|
|
|
window.onunload = function() {
|
|
context.history().unlock();
|
|
};
|
|
|
|
d3.select(window).on('resize.editor', function() {
|
|
map.dimensions(m.dimensions());
|
|
});
|
|
|
|
function pan(d) {
|
|
return function() {
|
|
context.pan(d);
|
|
};
|
|
}
|
|
|
|
// pan amount
|
|
var pa = 5;
|
|
|
|
var keybinding = d3.keybinding('main')
|
|
.on('⌫', function() { d3.event.preventDefault(); })
|
|
.on('←', pan([pa, 0]))
|
|
.on('↑', pan([0, pa]))
|
|
.on('→', pan([-pa, 0]))
|
|
.on('↓', pan([0, -pa]));
|
|
|
|
d3.select(document)
|
|
.call(keybinding);
|
|
|
|
context.enter(iD.modes.Browse(context));
|
|
|
|
context.container()
|
|
.call(iD.ui.Splash(context))
|
|
.call(iD.ui.Restore(context));
|
|
|
|
var authenticating = iD.ui.Loading(context)
|
|
.message(t('loading_auth'));
|
|
|
|
context.connection()
|
|
.on('authenticating.ui', function() {
|
|
context.container()
|
|
.call(authenticating);
|
|
})
|
|
.on('authenticated.ui', function() {
|
|
authenticating.close();
|
|
});
|
|
}
|
|
|
|
function ui(container) {
|
|
context.container(container);
|
|
context.loadLocale(function() {
|
|
render(container);
|
|
});
|
|
}
|
|
|
|
ui.sidebar = iD.ui.Sidebar(context);
|
|
|
|
return ui;
|
|
};
|
|
|
|
iD.ui.tooltipHtml = function(text, key) {
|
|
return '<span>' + text + '</span>' + '<div class="keyhint-wrap">' + '<span> ' + (t('tooltip_keyhint')) + ' </span>' + '<span class="keyhint"> ' + key + '</span></div>';
|
|
};
|