mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Fixing Interdependecy between ui.preset and ui.core
This commit is contained in:
@@ -45,11 +45,7 @@ $(BUILDJS_TARGETS): $(BUILDJS_SOURCES) build.js
|
||||
MODULE_TARGETS = \
|
||||
js/lib/id/index.js \
|
||||
js/lib/id/services.js \
|
||||
js/lib/id/ui/index.js \
|
||||
js/lib/id/svg.js \
|
||||
js/lib/id/ui/core.js \
|
||||
js/lib/id/ui/intro.js \
|
||||
js/lib/id/ui/preset.js
|
||||
js/lib/id/svg.js
|
||||
|
||||
js/lib/id/index.js: $(shell find modules/index.js -type f)
|
||||
@rm -f $@
|
||||
@@ -63,22 +59,6 @@ js/lib/id/svg.js: $(shell find modules/svg -type f)
|
||||
@rm -f $@
|
||||
node_modules/.bin/rollup -c rollup.config.js -f umd -n iD.svg modules/svg/index.js --no-strict -o $@
|
||||
|
||||
js/lib/id/ui/index.js: $(shell find modules/ui -type f)
|
||||
@rm -f $@
|
||||
node_modules/.bin/rollup -c rollup.config.js -f umd -n iD modules/ui/ui.js --no-strict -o $@
|
||||
|
||||
js/lib/id/ui/core.js: $(shell find modules/ui/core -type f)
|
||||
@rm -f $@
|
||||
node_modules/.bin/rollup -c rollup.config.js -f umd -n iD.ui modules/ui/core/index.js --no-strict -o $@
|
||||
|
||||
js/lib/id/ui/intro.js: $(shell find modules/ui/intro -type f)
|
||||
@rm -f $@
|
||||
node_modules/.bin/rollup -c rollup.config.js -f umd -n iD.ui.intro modules/ui/intro/index.js --no-strict -o $@
|
||||
|
||||
js/lib/id/ui/preset.js: $(shell find modules/ui/preset -type f)
|
||||
@rm -f $@
|
||||
node_modules/.bin/rollup -c rollup.config.js -f umd -n iD.ui.preset modules/ui/preset/index.js --no-strict -o $@
|
||||
|
||||
dist/iD.js: \
|
||||
js/lib/bootstrap-tooltip.js \
|
||||
js/lib/d3.v3.js \
|
||||
|
||||
@@ -38,11 +38,6 @@
|
||||
<script src='js/lib/id/svg.js'></script>
|
||||
<script src='js/lib/id/services.js'></script>
|
||||
|
||||
<script src='js/lib/id/ui/index.js'></script>
|
||||
<script src='js/lib/id/ui/core.js'></script>
|
||||
<script src='js/lib/id/ui/intro.js'></script>
|
||||
<script src='js/lib/id/ui/preset.js'></script>
|
||||
|
||||
<script src='data/data_dev.js'></script>
|
||||
|
||||
<script src='js/lib/locale.js'></script>
|
||||
|
||||
+19268
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,251 +0,0 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(factory((global.iD = global.iD || {})));
|
||||
}(this, function (exports) { 'use strict';
|
||||
|
||||
function ui(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([0, 0], 2);
|
||||
}
|
||||
|
||||
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');
|
||||
|
||||
content.append('div')
|
||||
.attr('id', 'map')
|
||||
.call(map);
|
||||
|
||||
content
|
||||
.call(iD.ui.MapInMap(context));
|
||||
|
||||
content.append('div')
|
||||
.call(iD.ui.Info(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', 'full-screen')
|
||||
.call(iD.ui.FullScreen(context));
|
||||
|
||||
bar.append('div')
|
||||
.attr('class', 'spinner')
|
||||
.call(iD.ui.Spinner(context));
|
||||
|
||||
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(context));
|
||||
|
||||
controls.append('div')
|
||||
.attr('class', 'map-control background-control')
|
||||
.call(iD.ui.Background(context));
|
||||
|
||||
controls.append('div')
|
||||
.attr('class', 'map-control map-data-control')
|
||||
.call(iD.ui.MapData(context));
|
||||
|
||||
controls.append('div')
|
||||
.attr('class', 'map-control help-control')
|
||||
.call(iD.ui.Help(context));
|
||||
|
||||
var about = content.append('div')
|
||||
.attr('id', 'about');
|
||||
|
||||
about.append('div')
|
||||
.attr('id', 'attrib')
|
||||
.call(iD.ui.Attribution(context));
|
||||
|
||||
var footer = about.append('div')
|
||||
.attr('id', 'footer')
|
||||
.attr('class', 'fillD');
|
||||
|
||||
footer.append('div')
|
||||
.attr('class', 'api-status')
|
||||
.call(iD.ui.Status(context));
|
||||
|
||||
footer.append('div')
|
||||
.attr('id', 'scale-block')
|
||||
.call(iD.ui.Scale(context));
|
||||
|
||||
var aboutList = footer.append('div')
|
||||
.attr('id', 'info-block')
|
||||
.append('ul')
|
||||
.attr('id', 'about-list');
|
||||
|
||||
if (!context.embed()) {
|
||||
aboutList.call(iD.ui.Account(context));
|
||||
}
|
||||
|
||||
aboutList.append('li')
|
||||
.append('a')
|
||||
.attr('target', '_blank')
|
||||
.attr('tabindex', -1)
|
||||
.attr('href', 'https://github.com/openstreetmap/iD')
|
||||
.text(iD.version);
|
||||
|
||||
var issueLinks = aboutList.append('li');
|
||||
|
||||
issueLinks.append('a')
|
||||
.attr('target', '_blank')
|
||||
.attr('tabindex', -1)
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/issues')
|
||||
.call(iD.svg.Icon('#icon-bug', 'light'))
|
||||
.call(bootstrap.tooltip()
|
||||
.title(t('report_a_bug'))
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
issueLinks.append('a')
|
||||
.attr('target', '_blank')
|
||||
.attr('tabindex', -1)
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/blob/master/CONTRIBUTING.md#translating')
|
||||
.call(iD.svg.Icon('#icon-translate', 'light'))
|
||||
.call(bootstrap.tooltip()
|
||||
.title(t('help_translate'))
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
aboutList.append('li')
|
||||
.attr('class', 'feature-warning')
|
||||
.attr('tabindex', -1)
|
||||
.call(iD.ui.FeatureInfo(context));
|
||||
|
||||
aboutList.append('li')
|
||||
.attr('class', 'user-list')
|
||||
.attr('tabindex', -1)
|
||||
.call(iD.ui.Contributors(context));
|
||||
|
||||
window.onbeforeunload = function() {
|
||||
return context.save();
|
||||
};
|
||||
|
||||
window.onunload = function() {
|
||||
context.history().unlock();
|
||||
};
|
||||
|
||||
var mapDimensions = map.dimensions();
|
||||
|
||||
d3.select(window).on('resize.editor', function() {
|
||||
mapDimensions = content.dimensions(null);
|
||||
map.dimensions(mapDimensions);
|
||||
});
|
||||
|
||||
function pan(d) {
|
||||
return function() {
|
||||
d3.event.preventDefault();
|
||||
if (!context.inIntro()) context.pan(d);
|
||||
};
|
||||
}
|
||||
|
||||
// pan amount
|
||||
var pa = 10;
|
||||
|
||||
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]))
|
||||
.on('⇧←', pan([mapDimensions[0], 0]))
|
||||
.on('⇧↑', pan([0, mapDimensions[1]]))
|
||||
.on('⇧→', pan([-mapDimensions[0], 0]))
|
||||
.on('⇧↓', pan([0, -mapDimensions[1]]))
|
||||
.on(iD.ui.cmd('⌘←'), pan([mapDimensions[0], 0]))
|
||||
.on(iD.ui.cmd('⌘↑'), pan([0, mapDimensions[1]]))
|
||||
.on(iD.ui.cmd('⌘→'), pan([-mapDimensions[0], 0]))
|
||||
.on(iD.ui.cmd('⌘↓'), pan([0, -mapDimensions[1]]));
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
ui.tooltipHtml = function(text, key) {
|
||||
var s = '<span>' + text + '</span>';
|
||||
if (key) {
|
||||
s += '<div class="keyhint-wrap">' +
|
||||
'<span> ' + (t('tooltip_keyhint')) + ' </span>' +
|
||||
'<span class="keyhint"> ' + key + '</span></div>';
|
||||
}
|
||||
return s;
|
||||
};
|
||||
|
||||
exports.ui = ui;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
@@ -1,582 +0,0 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(factory((global.iD = global.iD || {}, global.iD.ui = global.iD.ui || {}, global.iD.ui.intro = global.iD.ui.intro || {})));
|
||||
}(this, function (exports) { 'use strict';
|
||||
|
||||
function area(context, reveal) {
|
||||
var event = d3.dispatch('done'),
|
||||
timeout;
|
||||
|
||||
var step = {
|
||||
title: 'intro.areas.title'
|
||||
};
|
||||
|
||||
step.enter = function() {
|
||||
var playground = [-85.63552, 41.94159],
|
||||
corner = [-85.63565411045074, 41.9417715536927];
|
||||
context.map().centerZoom(playground, 19);
|
||||
reveal('button.add-area',
|
||||
t('intro.areas.add', { button: iD.ui.intro.icon('#icon-area', 'pre-text') }),
|
||||
{ tooltipClass: 'intro-areas-add' });
|
||||
|
||||
context.on('enter.intro', addArea);
|
||||
|
||||
function addArea(mode) {
|
||||
if (mode.id !== 'add-area') return;
|
||||
context.on('enter.intro', drawArea);
|
||||
|
||||
var padding = 120 * Math.pow(2, context.map().zoom() - 19);
|
||||
var pointBox = iD.ui.intro.pad(corner, padding, context);
|
||||
reveal(pointBox, t('intro.areas.corner'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 120 * Math.pow(2, context.map().zoom() - 19);
|
||||
pointBox = iD.ui.intro.pad(corner, padding, context);
|
||||
reveal(pointBox, t('intro.areas.corner'), {duration: 0});
|
||||
});
|
||||
}
|
||||
|
||||
function drawArea(mode) {
|
||||
if (mode.id !== 'draw-area') return;
|
||||
context.on('enter.intro', enterSelect);
|
||||
|
||||
var padding = 150 * Math.pow(2, context.map().zoom() - 19);
|
||||
var pointBox = iD.ui.intro.pad(playground, padding, context);
|
||||
reveal(pointBox, t('intro.areas.place'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 150 * Math.pow(2, context.map().zoom() - 19);
|
||||
pointBox = iD.ui.intro.pad(playground, padding, context);
|
||||
reveal(pointBox, t('intro.areas.place'), {duration: 0});
|
||||
});
|
||||
}
|
||||
|
||||
function enterSelect(mode) {
|
||||
if (mode.id !== 'select') return;
|
||||
context.map().on('move.intro', null);
|
||||
context.on('enter.intro', null);
|
||||
|
||||
timeout = setTimeout(function() {
|
||||
reveal('.preset-search-input',
|
||||
t('intro.areas.search',
|
||||
{ name: context.presets().item('leisure/playground').name() }));
|
||||
d3.select('.preset-search-input').on('keyup.intro', keySearch);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function keySearch() {
|
||||
var first = d3.select('.preset-list-item:first-child');
|
||||
if (first.classed('preset-leisure-playground')) {
|
||||
reveal(first.select('.preset-list-button').node(), t('intro.areas.choose'));
|
||||
d3.selection.prototype.one.call(context.history(), 'change.intro', selectedPreset);
|
||||
d3.select('.preset-search-input').on('keyup.intro', null);
|
||||
}
|
||||
}
|
||||
|
||||
function selectedPreset() {
|
||||
reveal('.pane',
|
||||
t('intro.areas.describe', { button: iD.ui.intro.icon('#icon-apply', 'pre-text') }));
|
||||
context.on('exit.intro', event.done);
|
||||
}
|
||||
};
|
||||
|
||||
step.exit = function() {
|
||||
window.clearTimeout(timeout);
|
||||
context.on('enter.intro', null);
|
||||
context.on('exit.intro', null);
|
||||
context.history().on('change.intro', null);
|
||||
context.map().on('move.intro', null);
|
||||
d3.select('.preset-search-input').on('keyup.intro', null);
|
||||
};
|
||||
|
||||
return d3.rebind(step, event, 'on');
|
||||
}
|
||||
|
||||
function line(context, reveal) {
|
||||
var event = d3.dispatch('done'),
|
||||
timeouts = [];
|
||||
|
||||
var step = {
|
||||
title: 'intro.lines.title'
|
||||
};
|
||||
|
||||
function timeout(f, t) {
|
||||
timeouts.push(window.setTimeout(f, t));
|
||||
}
|
||||
|
||||
function eventCancel() {
|
||||
d3.event.stopPropagation();
|
||||
d3.event.preventDefault();
|
||||
}
|
||||
|
||||
step.enter = function() {
|
||||
var centroid = [-85.62830, 41.95699];
|
||||
var midpoint = [-85.62975395449628, 41.95787501510204];
|
||||
var start = [-85.6297754121684, 41.95805253325314];
|
||||
var intersection = [-85.62974496187628, 41.95742515554585];
|
||||
|
||||
context.map().centerZoom(start, 18);
|
||||
reveal('button.add-line',
|
||||
t('intro.lines.add', { button: iD.ui.intro.icon('#icon-line', 'pre-text') }),
|
||||
{ tooltipClass: 'intro-lines-add' });
|
||||
|
||||
context.on('enter.intro', addLine);
|
||||
|
||||
function addLine(mode) {
|
||||
if (mode.id !== 'add-line') return;
|
||||
context.on('enter.intro', drawLine);
|
||||
|
||||
var padding = 150 * Math.pow(2, context.map().zoom() - 18);
|
||||
var pointBox = iD.ui.intro.pad(start, padding, context);
|
||||
reveal(pointBox, t('intro.lines.start'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 150 * Math.pow(2, context.map().zoom() - 18);
|
||||
pointBox = iD.ui.intro.pad(start, padding, context);
|
||||
reveal(pointBox, t('intro.lines.start'), {duration: 0});
|
||||
});
|
||||
}
|
||||
|
||||
function drawLine(mode) {
|
||||
if (mode.id !== 'draw-line') return;
|
||||
context.history().on('change.intro', addIntersection);
|
||||
context.on('enter.intro', retry);
|
||||
|
||||
var padding = 300 * Math.pow(2, context.map().zoom() - 19);
|
||||
var pointBox = iD.ui.intro.pad(midpoint, padding, context);
|
||||
reveal(pointBox, t('intro.lines.intersect', {name: t('intro.graph.flower_st')}));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 300 * Math.pow(2, context.map().zoom() - 19);
|
||||
pointBox = iD.ui.intro.pad(midpoint, padding, context);
|
||||
reveal(pointBox, t('intro.lines.intersect', {name: t('intro.graph.flower_st')}), {duration: 0});
|
||||
});
|
||||
}
|
||||
|
||||
// ended line before creating intersection
|
||||
function retry(mode) {
|
||||
if (mode.id !== 'select') return;
|
||||
var pointBox = iD.ui.intro.pad(intersection, 30, context),
|
||||
ids = mode.selectedIDs();
|
||||
reveal(pointBox, t('intro.lines.restart', {name: t('intro.graph.flower_st')}));
|
||||
d3.select(window).on('mousedown.intro', eventCancel, true);
|
||||
|
||||
timeout(function() {
|
||||
context.replace(iD.actions.DeleteMultiple(ids));
|
||||
step.exit();
|
||||
step.enter();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
function addIntersection(changes) {
|
||||
if ( _.some(changes.created(), function(d) {
|
||||
return d.type === 'node' && context.graph().parentWays(d).length > 1;
|
||||
})) {
|
||||
context.history().on('change.intro', null);
|
||||
context.on('enter.intro', enterSelect);
|
||||
|
||||
var padding = 900 * Math.pow(2, context.map().zoom() - 19);
|
||||
var pointBox = iD.ui.intro.pad(centroid, padding, context);
|
||||
reveal(pointBox, t('intro.lines.finish'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 900 * Math.pow(2, context.map().zoom() - 19);
|
||||
pointBox = iD.ui.intro.pad(centroid, padding, context);
|
||||
reveal(pointBox, t('intro.lines.finish'), {duration: 0});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function enterSelect(mode) {
|
||||
if (mode.id !== 'select') return;
|
||||
context.map().on('move.intro', null);
|
||||
context.on('enter.intro', null);
|
||||
d3.select('#curtain').style('pointer-events', 'all');
|
||||
|
||||
presetCategory();
|
||||
}
|
||||
|
||||
function presetCategory() {
|
||||
timeout(function() {
|
||||
d3.select('#curtain').style('pointer-events', 'none');
|
||||
var road = d3.select('.preset-category-road .preset-list-button');
|
||||
reveal(road.node(), t('intro.lines.road'));
|
||||
road.one('click.intro', roadCategory);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function roadCategory() {
|
||||
timeout(function() {
|
||||
var grid = d3.select('.subgrid');
|
||||
reveal(grid.node(), t('intro.lines.residential'));
|
||||
grid.selectAll(':not(.preset-highway-residential) .preset-list-button')
|
||||
.one('click.intro', retryPreset);
|
||||
grid.selectAll('.preset-highway-residential .preset-list-button')
|
||||
.one('click.intro', roadDetails);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
// selected wrong road type
|
||||
function retryPreset() {
|
||||
timeout(function() {
|
||||
var preset = d3.select('.entity-editor-pane .preset-list-button');
|
||||
reveal(preset.node(), t('intro.lines.wrong_preset'));
|
||||
preset.one('click.intro', presetCategory);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function roadDetails() {
|
||||
reveal('.pane',
|
||||
t('intro.lines.describe', { button: iD.ui.intro.icon('#icon-apply', 'pre-text') }));
|
||||
context.on('exit.intro', event.done);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
step.exit = function() {
|
||||
d3.select(window).on('mousedown.intro', null, true);
|
||||
d3.select('#curtain').style('pointer-events', 'none');
|
||||
timeouts.forEach(window.clearTimeout);
|
||||
context.on('enter.intro', null);
|
||||
context.on('exit.intro', null);
|
||||
context.map().on('move.intro', null);
|
||||
context.history().on('change.intro', null);
|
||||
};
|
||||
|
||||
return d3.rebind(step, event, 'on');
|
||||
}
|
||||
|
||||
function navigation(context, reveal) {
|
||||
var event = d3.dispatch('done'),
|
||||
timeouts = [];
|
||||
|
||||
var step = {
|
||||
title: 'intro.navigation.title'
|
||||
};
|
||||
|
||||
function set(f, t) {
|
||||
timeouts.push(window.setTimeout(f, t));
|
||||
}
|
||||
|
||||
function eventCancel() {
|
||||
d3.event.stopPropagation();
|
||||
d3.event.preventDefault();
|
||||
}
|
||||
|
||||
step.enter = function() {
|
||||
var rect = context.surfaceRect(),
|
||||
map = {
|
||||
left: rect.left + 10,
|
||||
top: rect.top + 70,
|
||||
width: rect.width - 70,
|
||||
height: rect.height - 170
|
||||
};
|
||||
|
||||
context.map().centerZoom([-85.63591, 41.94285], 19);
|
||||
|
||||
reveal(map, t('intro.navigation.drag'));
|
||||
|
||||
context.map().on('move.intro', _.debounce(function() {
|
||||
context.map().on('move.intro', null);
|
||||
townhall();
|
||||
context.on('enter.intro', inspectTownHall);
|
||||
}, 400));
|
||||
|
||||
function townhall() {
|
||||
var hall = [-85.63645945147184, 41.942986488012565];
|
||||
|
||||
var point = context.projection(hall);
|
||||
if (point[0] < 0 || point[0] > rect.width ||
|
||||
point[1] < 0 || point[1] > rect.height) {
|
||||
context.map().center(hall);
|
||||
}
|
||||
|
||||
var box = iD.ui.intro.pointBox(hall, context);
|
||||
reveal(box, t('intro.navigation.select'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
var box = iD.ui.intro.pointBox(hall, context);
|
||||
reveal(box, t('intro.navigation.select'), {duration: 0});
|
||||
});
|
||||
}
|
||||
|
||||
function inspectTownHall(mode) {
|
||||
if (mode.id !== 'select') return;
|
||||
context.on('enter.intro', null);
|
||||
context.map().on('move.intro', null);
|
||||
set(function() {
|
||||
reveal('.entity-editor-pane',
|
||||
t('intro.navigation.pane', { button: iD.ui.intro.icon('#icon-close', 'pre-text') }));
|
||||
context.on('exit.intro', streetSearch);
|
||||
}, 700);
|
||||
}
|
||||
|
||||
function streetSearch() {
|
||||
context.on('exit.intro', null);
|
||||
reveal('.search-header input',
|
||||
t('intro.navigation.search', { name: t('intro.graph.spring_st') }));
|
||||
d3.select('.search-header input').on('keyup.intro', searchResult);
|
||||
}
|
||||
|
||||
function searchResult() {
|
||||
var first = d3.select('.feature-list-item:nth-child(0n+2)'), // skip No Results item
|
||||
firstName = first.select('.entity-name'),
|
||||
name = t('intro.graph.spring_st');
|
||||
|
||||
if (!firstName.empty() && firstName.text() === name) {
|
||||
reveal(first.node(), t('intro.navigation.choose', { name: name }));
|
||||
context.on('exit.intro', selectedStreet);
|
||||
d3.select('.search-header input')
|
||||
.on('keydown.intro', eventCancel, true)
|
||||
.on('keyup.intro', null);
|
||||
}
|
||||
}
|
||||
|
||||
function selectedStreet() {
|
||||
var springSt = [-85.63585099140167, 41.942506848938926];
|
||||
context.map().center(springSt);
|
||||
context.on('exit.intro', event.done);
|
||||
set(function() {
|
||||
reveal('.entity-editor-pane',
|
||||
t('intro.navigation.chosen', {
|
||||
name: t('intro.graph.spring_st'),
|
||||
button: iD.ui.intro.icon('#icon-close', 'pre-text')
|
||||
}));
|
||||
}, 400);
|
||||
}
|
||||
};
|
||||
|
||||
step.exit = function() {
|
||||
timeouts.forEach(window.clearTimeout);
|
||||
context.map().on('move.intro', null);
|
||||
context.on('enter.intro', null);
|
||||
context.on('exit.intro', null);
|
||||
d3.select('.search-header input')
|
||||
.on('keydown.intro', null)
|
||||
.on('keyup.intro', null);
|
||||
};
|
||||
|
||||
return d3.rebind(step, event, 'on');
|
||||
}
|
||||
|
||||
function point(context, reveal) {
|
||||
var event = d3.dispatch('done'),
|
||||
timeouts = [];
|
||||
|
||||
var step = {
|
||||
title: 'intro.points.title'
|
||||
};
|
||||
|
||||
function setTimeout(f, t) {
|
||||
timeouts.push(window.setTimeout(f, t));
|
||||
}
|
||||
|
||||
function eventCancel() {
|
||||
d3.event.stopPropagation();
|
||||
d3.event.preventDefault();
|
||||
}
|
||||
|
||||
step.enter = function() {
|
||||
context.map().centerZoom([-85.63279, 41.94394], 19);
|
||||
reveal('button.add-point',
|
||||
t('intro.points.add', { button: iD.ui.intro.icon('#icon-point', 'pre-text') }),
|
||||
{ tooltipClass: 'intro-points-add' });
|
||||
|
||||
var corner = [-85.632481,41.944094];
|
||||
|
||||
context.on('enter.intro', addPoint);
|
||||
|
||||
function addPoint(mode) {
|
||||
if (mode.id !== 'add-point') return;
|
||||
context.on('enter.intro', enterSelect);
|
||||
|
||||
var pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.place'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.place'), {duration: 0});
|
||||
});
|
||||
}
|
||||
|
||||
function enterSelect(mode) {
|
||||
if (mode.id !== 'select') return;
|
||||
context.map().on('move.intro', null);
|
||||
context.on('enter.intro', null);
|
||||
|
||||
setTimeout(function() {
|
||||
reveal('.preset-search-input',
|
||||
t('intro.points.search', {name: context.presets().item('amenity/cafe').name()}));
|
||||
d3.select('.preset-search-input').on('keyup.intro', keySearch);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function keySearch() {
|
||||
var first = d3.select('.preset-list-item:first-child');
|
||||
if (first.classed('preset-amenity-cafe')) {
|
||||
reveal(first.select('.preset-list-button').node(), t('intro.points.choose'));
|
||||
d3.selection.prototype.one.call(context.history(), 'change.intro', selectedPreset);
|
||||
d3.select('.preset-search-input')
|
||||
.on('keydown.intro', eventCancel, true)
|
||||
.on('keyup.intro', null);
|
||||
}
|
||||
}
|
||||
|
||||
function selectedPreset() {
|
||||
setTimeout(function() {
|
||||
reveal('.entity-editor-pane', t('intro.points.describe'), {tooltipClass: 'intro-points-describe'});
|
||||
context.history().on('change.intro', closeEditor);
|
||||
context.on('exit.intro', selectPoint);
|
||||
}, 400);
|
||||
}
|
||||
|
||||
function closeEditor() {
|
||||
d3.select('.preset-search-input').on('keydown.intro', null);
|
||||
context.history().on('change.intro', null);
|
||||
reveal('.entity-editor-pane',
|
||||
t('intro.points.close', { button: iD.ui.intro.icon('#icon-apply', 'pre-text') }));
|
||||
}
|
||||
|
||||
function selectPoint() {
|
||||
context.on('exit.intro', null);
|
||||
context.history().on('change.intro', null);
|
||||
context.on('enter.intro', enterReselect);
|
||||
|
||||
var pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.reselect'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.reselect'), {duration: 0});
|
||||
});
|
||||
}
|
||||
|
||||
function enterReselect(mode) {
|
||||
if (mode.id !== 'select') return;
|
||||
context.map().on('move.intro', null);
|
||||
context.on('enter.intro', null);
|
||||
|
||||
setTimeout(function() {
|
||||
reveal('.entity-editor-pane',
|
||||
t('intro.points.fixname', { button: iD.ui.intro.icon('#icon-apply', 'pre-text') }));
|
||||
context.on('exit.intro', deletePoint);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function deletePoint() {
|
||||
context.on('exit.intro', null);
|
||||
context.on('enter.intro', enterDelete);
|
||||
|
||||
var pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.reselect_delete'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.reselect_delete'), {duration: 0});
|
||||
});
|
||||
}
|
||||
|
||||
function enterDelete(mode) {
|
||||
if (mode.id !== 'select') return;
|
||||
context.map().on('move.intro', null);
|
||||
context.on('enter.intro', null);
|
||||
context.on('exit.intro', deletePoint);
|
||||
context.map().on('move.intro', deletePoint);
|
||||
context.history().on('change.intro', deleted);
|
||||
|
||||
setTimeout(function() {
|
||||
var node = d3.select('.radial-menu-item-delete').node();
|
||||
var pointBox = iD.ui.intro.pad(node.getBoundingClientRect(), 50, context);
|
||||
reveal(pointBox,
|
||||
t('intro.points.delete', { button: iD.ui.intro.icon('#operation-delete', 'pre-text') }));
|
||||
}, 300);
|
||||
}
|
||||
|
||||
function deleted(changed) {
|
||||
if (changed.deleted().length) event.done();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
step.exit = function() {
|
||||
timeouts.forEach(window.clearTimeout);
|
||||
context.on('exit.intro', null);
|
||||
context.on('enter.intro', null);
|
||||
context.map().on('move.intro', null);
|
||||
context.history().on('change.intro', null);
|
||||
d3.select('.preset-search-input')
|
||||
.on('keyup.intro', null)
|
||||
.on('keydown.intro', null);
|
||||
};
|
||||
|
||||
return d3.rebind(step, event, 'on');
|
||||
}
|
||||
|
||||
function startEditing(context, reveal) {
|
||||
var event = d3.dispatch('done', 'startEditing'),
|
||||
modal,
|
||||
timeouts = [];
|
||||
|
||||
var step = {
|
||||
title: 'intro.startediting.title'
|
||||
};
|
||||
|
||||
function timeout(f, t) {
|
||||
timeouts.push(window.setTimeout(f, t));
|
||||
}
|
||||
|
||||
step.enter = function() {
|
||||
reveal('.map-control.help-control',
|
||||
t('intro.startediting.help', { button: iD.ui.intro.icon('#icon-help', 'pre-text') }));
|
||||
|
||||
timeout(function() {
|
||||
reveal('#bar button.save', t('intro.startediting.save'));
|
||||
}, 5000);
|
||||
|
||||
timeout(function() {
|
||||
reveal('#surface');
|
||||
}, 10000);
|
||||
|
||||
timeout(function() {
|
||||
modal = iD.ui.modal(context.container());
|
||||
|
||||
modal.select('.modal')
|
||||
.attr('class', 'modal-splash modal col6');
|
||||
|
||||
modal.selectAll('.close').remove();
|
||||
|
||||
var startbutton = modal.select('.content')
|
||||
.attr('class', 'fillL')
|
||||
.append('button')
|
||||
.attr('class', 'modal-section huge-modal-button')
|
||||
.on('click', function() {
|
||||
modal.remove();
|
||||
});
|
||||
|
||||
startbutton.append('div')
|
||||
.attr('class','illustration');
|
||||
startbutton.append('h2')
|
||||
.text(t('intro.startediting.start'));
|
||||
|
||||
event.startEditing();
|
||||
}, 10500);
|
||||
};
|
||||
|
||||
step.exit = function() {
|
||||
if (modal) modal.remove();
|
||||
timeouts.forEach(window.clearTimeout);
|
||||
};
|
||||
|
||||
return d3.rebind(step, event, 'on');
|
||||
}
|
||||
|
||||
exports.area = area;
|
||||
exports.line = line;
|
||||
exports.navigation = navigation;
|
||||
exports.point = point;
|
||||
exports.startEditing = startEditing;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,7 @@ export { Background } from './renderer/background';
|
||||
export { Features } from './renderer/features';
|
||||
export { Map } from './renderer/map';
|
||||
export { TileLayer } from './renderer/tile_layer';
|
||||
export { ui } from './ui/index';
|
||||
|
||||
export {
|
||||
actions,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Select, Browse } from '../modes/index';
|
||||
import { sphericalDistance } from '../geo/index';
|
||||
import { DeleteMultiple } from '../actions/index';
|
||||
import { cmd } from '../ui/core/cmd';
|
||||
export function Delete(selectedIDs, context) {
|
||||
var action = DeleteMultiple(selectedIDs);
|
||||
|
||||
@@ -70,7 +71,7 @@ export function Delete(selectedIDs, context) {
|
||||
};
|
||||
|
||||
operation.id = 'delete';
|
||||
operation.keys = [iD.ui.cmd('⌘⌫'), iD.ui.cmd('⌘⌦')];
|
||||
operation.keys = [cmd('⌘⌫'), cmd('⌘⌦')];
|
||||
operation.title = t('operations.delete.title');
|
||||
|
||||
return operation;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Icon } from '../../svg/index';
|
||||
import { setTransform } from '../../util/index';
|
||||
import { BackgroundSource } from '../../renderer';
|
||||
import { BackgroundSource } from '../../renderer/index';
|
||||
import { offsetToMeters, metersToOffset } from '../../geo/index';
|
||||
import { cmd } from './cmd';
|
||||
import { MapInMap } from './map_in_map';
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Icon } from '../../svg/index';
|
||||
import { Entity, Graph } from '../../core/index';
|
||||
import { Browse } from '../../modes/index';
|
||||
import { Intro } from '../intro/index';
|
||||
|
||||
export function intro(context) {
|
||||
var step;
|
||||
|
||||
@@ -96,7 +98,7 @@ export function intro(context) {
|
||||
}
|
||||
|
||||
var steps = ['navigation', 'point', 'area', 'line', 'startEditing'].map(function(step, i) {
|
||||
var s = intro[step](context, reveal)
|
||||
var s = Intro[step](context, reveal)
|
||||
.on('done', function() {
|
||||
entered.filter(function(d) {
|
||||
return d.title === s.title;
|
||||
@@ -157,3 +159,36 @@ export function intro(context) {
|
||||
}
|
||||
return intro;
|
||||
}
|
||||
|
||||
intro.pointBox = function(point, context) {
|
||||
var rect = context.surfaceRect();
|
||||
point = context.projection(point);
|
||||
return {
|
||||
left: point[0] + rect.left - 30,
|
||||
top: point[1] + rect.top - 50,
|
||||
width: 60,
|
||||
height: 70
|
||||
};
|
||||
};
|
||||
|
||||
intro.pad = function(box, padding, context) {
|
||||
if (box instanceof Array) {
|
||||
var rect = context.surfaceRect();
|
||||
box = context.projection(box);
|
||||
box = {
|
||||
left: box[0] + rect.left,
|
||||
top: box[1] + rect.top
|
||||
};
|
||||
}
|
||||
return {
|
||||
left: box.left - padding,
|
||||
top: box.top - padding,
|
||||
width: (box.width || 0) + 2 * padding,
|
||||
height: (box.width || 0) + 2 * padding
|
||||
};
|
||||
};
|
||||
|
||||
intro.icon = function(name, svgklass) {
|
||||
return '<svg class="icon ' + (svgklass || '') + '">' +
|
||||
'<use xlink:href="' + name + '"></use></svg>';
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Icon } from '../../svg/index';
|
||||
import { Browse } from '../../modes/index';
|
||||
import { ChangePreset } from '../../actions/index';
|
||||
import { Delete } from '../../operations';
|
||||
import { Delete } from '../../operations/index';
|
||||
import { PresetIcon } from './preset_icon';
|
||||
import { TagReference } from './tag_reference';
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
import { ui } from './ui';
|
||||
import { presetObj } from './preset/index';
|
||||
import {
|
||||
Account,
|
||||
Attribution,
|
||||
Background,
|
||||
cmd,
|
||||
Commit,
|
||||
confirm,
|
||||
Conflicts,
|
||||
Contributors,
|
||||
Disclosure,
|
||||
EntityEditor,
|
||||
FeatureInfo,
|
||||
FeatureList,
|
||||
flash,
|
||||
FullScreen,
|
||||
Geolocate,
|
||||
Help,
|
||||
Info,
|
||||
Inspector,
|
||||
intro,
|
||||
Lasso,
|
||||
Loading,
|
||||
MapData,
|
||||
MapInMap,
|
||||
modal,
|
||||
Modes,
|
||||
Notice,
|
||||
preset,
|
||||
PresetIcon,
|
||||
PresetList,
|
||||
RadialMenu,
|
||||
RawMemberEditor,
|
||||
RawMembershipEditor,
|
||||
RawTagEditor,
|
||||
Restore,
|
||||
Save,
|
||||
Scale,
|
||||
SelectionList,
|
||||
Sidebar,
|
||||
SourceSwitch,
|
||||
Spinner,
|
||||
Splash,
|
||||
Status,
|
||||
Success,
|
||||
TagReference,
|
||||
Toggle,
|
||||
tooltipHtml,
|
||||
UndoRedo,
|
||||
ViewOnOSM,
|
||||
Zoom
|
||||
} from './core/index';
|
||||
export {ui};
|
||||
|
||||
ui.preset = preset;
|
||||
Object.keys(presetObj).map(function(p) {
|
||||
ui.preset[p] = presetObj[p];
|
||||
});
|
||||
|
||||
// Need to do for test cases
|
||||
ui.intro = intro;
|
||||
ui.Account = Account;
|
||||
ui.Attribution = Attribution;
|
||||
ui.Background = Background;
|
||||
ui.cmd = cmd;
|
||||
ui.Commit = Commit;
|
||||
ui.confirm = confirm;
|
||||
ui.Conflicts = Conflicts;
|
||||
ui.Contributors = Contributors;
|
||||
ui.Disclosure = Disclosure;
|
||||
ui.EntityEditor = EntityEditor;
|
||||
ui.FeatureInfo = FeatureInfo;
|
||||
ui.FeatureList = FeatureList;
|
||||
ui.flash = flash;
|
||||
ui.FullScreen = FullScreen;
|
||||
ui.Geolocate = Geolocate;
|
||||
ui.Help = Help;
|
||||
ui.Info = Info;
|
||||
ui.Inspector = Inspector;
|
||||
ui.intro = intro;
|
||||
ui.Lasso = Lasso;
|
||||
ui.Loading = Loading;
|
||||
ui.MapData = MapData;
|
||||
ui.MapInMap = MapInMap;
|
||||
ui.modal = modal;
|
||||
ui.Modes = Modes;
|
||||
ui.Notice = Notice;
|
||||
ui.preset = preset;
|
||||
ui.PresetIcon = PresetIcon;
|
||||
ui.PresetList = PresetList;
|
||||
ui.RadialMenu = RadialMenu;
|
||||
ui.RawMemberEditor = RawMemberEditor;
|
||||
ui.RawMembershipEditor = RawMembershipEditor;
|
||||
ui.RawTagEditor = RawTagEditor;
|
||||
ui.Restore = Restore;
|
||||
ui.Save = Save;
|
||||
ui.Scale = Scale;
|
||||
ui.SelectionList = SelectionList;
|
||||
ui.Sidebar = Sidebar;
|
||||
ui.SourceSwitch = SourceSwitch;
|
||||
ui.Spinner = Spinner;
|
||||
ui.Splash = Splash;
|
||||
ui.Status = Status;
|
||||
ui.Success = Success;
|
||||
ui.TagReference = TagReference;
|
||||
ui.Toggle = Toggle;
|
||||
ui.tooltipHtml = tooltipHtml;
|
||||
ui.UndoRedo = UndoRedo;
|
||||
ui.ViewOnOSM = ViewOnOSM;
|
||||
ui.Zoom = Zoom;
|
||||
@@ -1,3 +1,5 @@
|
||||
import { intro } from '../core/index';
|
||||
|
||||
export function area(context, reveal) {
|
||||
var event = d3.dispatch('done'),
|
||||
timeout;
|
||||
@@ -11,7 +13,7 @@ export function area(context, reveal) {
|
||||
corner = [-85.63565411045074, 41.9417715536927];
|
||||
context.map().centerZoom(playground, 19);
|
||||
reveal('button.add-area',
|
||||
t('intro.areas.add', { button: iD.ui.intro.icon('#icon-area', 'pre-text') }),
|
||||
t('intro.areas.add', { button: intro.icon('#icon-area', 'pre-text') }),
|
||||
{ tooltipClass: 'intro-areas-add' });
|
||||
|
||||
context.on('enter.intro', addArea);
|
||||
@@ -21,12 +23,12 @@ export function area(context, reveal) {
|
||||
context.on('enter.intro', drawArea);
|
||||
|
||||
var padding = 120 * Math.pow(2, context.map().zoom() - 19);
|
||||
var pointBox = iD.ui.intro.pad(corner, padding, context);
|
||||
var pointBox = intro.pad(corner, padding, context);
|
||||
reveal(pointBox, t('intro.areas.corner'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 120 * Math.pow(2, context.map().zoom() - 19);
|
||||
pointBox = iD.ui.intro.pad(corner, padding, context);
|
||||
pointBox = intro.pad(corner, padding, context);
|
||||
reveal(pointBox, t('intro.areas.corner'), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -36,12 +38,12 @@ export function area(context, reveal) {
|
||||
context.on('enter.intro', enterSelect);
|
||||
|
||||
var padding = 150 * Math.pow(2, context.map().zoom() - 19);
|
||||
var pointBox = iD.ui.intro.pad(playground, padding, context);
|
||||
var pointBox = intro.pad(playground, padding, context);
|
||||
reveal(pointBox, t('intro.areas.place'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 150 * Math.pow(2, context.map().zoom() - 19);
|
||||
pointBox = iD.ui.intro.pad(playground, padding, context);
|
||||
pointBox = intro.pad(playground, padding, context);
|
||||
reveal(pointBox, t('intro.areas.place'), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -70,7 +72,7 @@ export function area(context, reveal) {
|
||||
|
||||
function selectedPreset() {
|
||||
reveal('.pane',
|
||||
t('intro.areas.describe', { button: iD.ui.intro.icon('#icon-apply', 'pre-text') }));
|
||||
t('intro.areas.describe', { button: intro.icon('#icon-apply', 'pre-text') }));
|
||||
context.on('exit.intro', event.done);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
export { area } from './area';
|
||||
export { line } from './line';
|
||||
export { navigation } from './navigation';
|
||||
export { point } from './point';
|
||||
export { startEditing } from './start_editing';
|
||||
import { area } from './area';
|
||||
import { line } from './line';
|
||||
import { navigation } from './navigation';
|
||||
import { point } from './point';
|
||||
import { startEditing } from './start_editing';
|
||||
|
||||
export var Intro = {
|
||||
area: area,
|
||||
line: line,
|
||||
navigation: navigation,
|
||||
point: point,
|
||||
startEditing: startEditing
|
||||
};
|
||||
|
||||
+13
-10
@@ -1,3 +1,6 @@
|
||||
import { intro } from '../core/index';
|
||||
import { DeleteMultiple } from '../../actions/index';
|
||||
|
||||
export function line(context, reveal) {
|
||||
var event = d3.dispatch('done'),
|
||||
timeouts = [];
|
||||
@@ -23,7 +26,7 @@ export function line(context, reveal) {
|
||||
|
||||
context.map().centerZoom(start, 18);
|
||||
reveal('button.add-line',
|
||||
t('intro.lines.add', { button: iD.ui.intro.icon('#icon-line', 'pre-text') }),
|
||||
t('intro.lines.add', { button: intro.icon('#icon-line', 'pre-text') }),
|
||||
{ tooltipClass: 'intro-lines-add' });
|
||||
|
||||
context.on('enter.intro', addLine);
|
||||
@@ -33,12 +36,12 @@ export function line(context, reveal) {
|
||||
context.on('enter.intro', drawLine);
|
||||
|
||||
var padding = 150 * Math.pow(2, context.map().zoom() - 18);
|
||||
var pointBox = iD.ui.intro.pad(start, padding, context);
|
||||
var pointBox = intro.pad(start, padding, context);
|
||||
reveal(pointBox, t('intro.lines.start'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 150 * Math.pow(2, context.map().zoom() - 18);
|
||||
pointBox = iD.ui.intro.pad(start, padding, context);
|
||||
pointBox = intro.pad(start, padding, context);
|
||||
reveal(pointBox, t('intro.lines.start'), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -49,12 +52,12 @@ export function line(context, reveal) {
|
||||
context.on('enter.intro', retry);
|
||||
|
||||
var padding = 300 * Math.pow(2, context.map().zoom() - 19);
|
||||
var pointBox = iD.ui.intro.pad(midpoint, padding, context);
|
||||
var pointBox = intro.pad(midpoint, padding, context);
|
||||
reveal(pointBox, t('intro.lines.intersect', {name: t('intro.graph.flower_st')}));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 300 * Math.pow(2, context.map().zoom() - 19);
|
||||
pointBox = iD.ui.intro.pad(midpoint, padding, context);
|
||||
pointBox = intro.pad(midpoint, padding, context);
|
||||
reveal(pointBox, t('intro.lines.intersect', {name: t('intro.graph.flower_st')}), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -62,13 +65,13 @@ export function line(context, reveal) {
|
||||
// ended line before creating intersection
|
||||
function retry(mode) {
|
||||
if (mode.id !== 'select') return;
|
||||
var pointBox = iD.ui.intro.pad(intersection, 30, context),
|
||||
var pointBox = intro.pad(intersection, 30, context),
|
||||
ids = mode.selectedIDs();
|
||||
reveal(pointBox, t('intro.lines.restart', {name: t('intro.graph.flower_st')}));
|
||||
d3.select(window).on('mousedown.intro', eventCancel, true);
|
||||
|
||||
timeout(function() {
|
||||
context.replace(iD.actions.DeleteMultiple(ids));
|
||||
context.replace(DeleteMultiple(ids));
|
||||
step.exit();
|
||||
step.enter();
|
||||
}, 3000);
|
||||
@@ -82,12 +85,12 @@ export function line(context, reveal) {
|
||||
context.on('enter.intro', enterSelect);
|
||||
|
||||
var padding = 900 * Math.pow(2, context.map().zoom() - 19);
|
||||
var pointBox = iD.ui.intro.pad(centroid, padding, context);
|
||||
var pointBox = intro.pad(centroid, padding, context);
|
||||
reveal(pointBox, t('intro.lines.finish'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
padding = 900 * Math.pow(2, context.map().zoom() - 19);
|
||||
pointBox = iD.ui.intro.pad(centroid, padding, context);
|
||||
pointBox = intro.pad(centroid, padding, context);
|
||||
reveal(pointBox, t('intro.lines.finish'), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -133,7 +136,7 @@ export function line(context, reveal) {
|
||||
|
||||
function roadDetails() {
|
||||
reveal('.pane',
|
||||
t('intro.lines.describe', { button: iD.ui.intro.icon('#icon-apply', 'pre-text') }));
|
||||
t('intro.lines.describe', { button: intro.icon('#icon-apply', 'pre-text') }));
|
||||
context.on('exit.intro', event.done);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { intro } from '../core/index';
|
||||
|
||||
export function navigation(context, reveal) {
|
||||
var event = d3.dispatch('done'),
|
||||
timeouts = [];
|
||||
@@ -43,11 +45,11 @@ export function navigation(context, reveal) {
|
||||
context.map().center(hall);
|
||||
}
|
||||
|
||||
var box = iD.ui.intro.pointBox(hall, context);
|
||||
var box = intro.pointBox(hall, context);
|
||||
reveal(box, t('intro.navigation.select'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
var box = iD.ui.intro.pointBox(hall, context);
|
||||
var box = intro.pointBox(hall, context);
|
||||
reveal(box, t('intro.navigation.select'), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -58,7 +60,7 @@ export function navigation(context, reveal) {
|
||||
context.map().on('move.intro', null);
|
||||
set(function() {
|
||||
reveal('.entity-editor-pane',
|
||||
t('intro.navigation.pane', { button: iD.ui.intro.icon('#icon-close', 'pre-text') }));
|
||||
t('intro.navigation.pane', { button: intro.icon('#icon-close', 'pre-text') }));
|
||||
context.on('exit.intro', streetSearch);
|
||||
}, 700);
|
||||
}
|
||||
@@ -92,7 +94,7 @@ export function navigation(context, reveal) {
|
||||
reveal('.entity-editor-pane',
|
||||
t('intro.navigation.chosen', {
|
||||
name: t('intro.graph.spring_st'),
|
||||
button: iD.ui.intro.icon('#icon-close', 'pre-text')
|
||||
button: intro.icon('#icon-close', 'pre-text')
|
||||
}));
|
||||
}, 400);
|
||||
}
|
||||
|
||||
+13
-11
@@ -1,3 +1,5 @@
|
||||
import { intro } from '../core/index';
|
||||
|
||||
export function point(context, reveal) {
|
||||
var event = d3.dispatch('done'),
|
||||
timeouts = [];
|
||||
@@ -18,7 +20,7 @@ export function point(context, reveal) {
|
||||
step.enter = function() {
|
||||
context.map().centerZoom([-85.63279, 41.94394], 19);
|
||||
reveal('button.add-point',
|
||||
t('intro.points.add', { button: iD.ui.intro.icon('#icon-point', 'pre-text') }),
|
||||
t('intro.points.add', { button: intro.icon('#icon-point', 'pre-text') }),
|
||||
{ tooltipClass: 'intro-points-add' });
|
||||
|
||||
var corner = [-85.632481,41.944094];
|
||||
@@ -29,11 +31,11 @@ export function point(context, reveal) {
|
||||
if (mode.id !== 'add-point') return;
|
||||
context.on('enter.intro', enterSelect);
|
||||
|
||||
var pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
var pointBox = intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.place'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
pointBox = intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.place'), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -73,7 +75,7 @@ export function point(context, reveal) {
|
||||
d3.select('.preset-search-input').on('keydown.intro', null);
|
||||
context.history().on('change.intro', null);
|
||||
reveal('.entity-editor-pane',
|
||||
t('intro.points.close', { button: iD.ui.intro.icon('#icon-apply', 'pre-text') }));
|
||||
t('intro.points.close', { button: intro.icon('#icon-apply', 'pre-text') }));
|
||||
}
|
||||
|
||||
function selectPoint() {
|
||||
@@ -81,11 +83,11 @@ export function point(context, reveal) {
|
||||
context.history().on('change.intro', null);
|
||||
context.on('enter.intro', enterReselect);
|
||||
|
||||
var pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
var pointBox = intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.reselect'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
pointBox = intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.reselect'), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -97,7 +99,7 @@ export function point(context, reveal) {
|
||||
|
||||
setTimeout(function() {
|
||||
reveal('.entity-editor-pane',
|
||||
t('intro.points.fixname', { button: iD.ui.intro.icon('#icon-apply', 'pre-text') }));
|
||||
t('intro.points.fixname', { button: intro.icon('#icon-apply', 'pre-text') }));
|
||||
context.on('exit.intro', deletePoint);
|
||||
}, 500);
|
||||
}
|
||||
@@ -106,11 +108,11 @@ export function point(context, reveal) {
|
||||
context.on('exit.intro', null);
|
||||
context.on('enter.intro', enterDelete);
|
||||
|
||||
var pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
var pointBox = intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.reselect_delete'));
|
||||
|
||||
context.map().on('move.intro', function() {
|
||||
pointBox = iD.ui.intro.pad(corner, 150, context);
|
||||
pointBox = intro.pad(corner, 150, context);
|
||||
reveal(pointBox, t('intro.points.reselect_delete'), {duration: 0});
|
||||
});
|
||||
}
|
||||
@@ -125,9 +127,9 @@ export function point(context, reveal) {
|
||||
|
||||
setTimeout(function() {
|
||||
var node = d3.select('.radial-menu-item-delete').node();
|
||||
var pointBox = iD.ui.intro.pad(node.getBoundingClientRect(), 50, context);
|
||||
var pointBox = intro.pad(node.getBoundingClientRect(), 50, context);
|
||||
reveal(pointBox,
|
||||
t('intro.points.delete', { button: iD.ui.intro.icon('#operation-delete', 'pre-text') }));
|
||||
t('intro.points.delete', { button: intro.icon('#operation-delete', 'pre-text') }));
|
||||
}, 300);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { intro } from '../core/index';
|
||||
import { modal as Modal } from '../core/modal';
|
||||
|
||||
export function startEditing(context, reveal) {
|
||||
var event = d3.dispatch('done', 'startEditing'),
|
||||
modal,
|
||||
@@ -13,7 +16,7 @@ export function startEditing(context, reveal) {
|
||||
|
||||
step.enter = function() {
|
||||
reveal('.map-control.help-control',
|
||||
t('intro.startediting.help', { button: iD.ui.intro.icon('#icon-help', 'pre-text') }));
|
||||
t('intro.startediting.help', { button: intro.icon('#icon-help', 'pre-text') }));
|
||||
|
||||
timeout(function() {
|
||||
reveal('#bar button.save', t('intro.startediting.save'));
|
||||
@@ -24,7 +27,7 @@ export function startEditing(context, reveal) {
|
||||
}, 10000);
|
||||
|
||||
timeout(function() {
|
||||
modal = iD.ui.modal(context.container());
|
||||
modal = Modal(context.container());
|
||||
|
||||
modal.select('.modal')
|
||||
.attr('class', 'modal-splash modal col6');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { Extent, chooseEdge, sphericalDistance } from '../../geo/index';
|
||||
|
||||
export function address(field, context) {
|
||||
var dispatch = d3.dispatch('init', 'change'),
|
||||
wrap,
|
||||
@@ -15,7 +17,7 @@ export function address(field, context) {
|
||||
function getStreets() {
|
||||
var extent = entity.extent(context.graph()),
|
||||
l = extent.center(),
|
||||
box = iD.geo.Extent(l).padByMeters(200);
|
||||
box = Extent(l).padByMeters(200);
|
||||
|
||||
return context.intersects(box)
|
||||
.filter(isAddressable)
|
||||
@@ -23,7 +25,7 @@ export function address(field, context) {
|
||||
var loc = context.projection([
|
||||
(extent[0][0] + extent[1][0]) / 2,
|
||||
(extent[0][1] + extent[1][1]) / 2]),
|
||||
choice = iD.geo.chooseEdge(context.childNodes(d), loc, context.projection);
|
||||
choice = chooseEdge(context.childNodes(d), loc, context.projection);
|
||||
return {
|
||||
title: d.tags.name,
|
||||
value: d.tags.name,
|
||||
@@ -41,7 +43,7 @@ export function address(field, context) {
|
||||
function getCities() {
|
||||
var extent = entity.extent(context.graph()),
|
||||
l = extent.center(),
|
||||
box = iD.geo.Extent(l).padByMeters(200);
|
||||
box = Extent(l).padByMeters(200);
|
||||
|
||||
return context.intersects(box)
|
||||
.filter(isAddressable)
|
||||
@@ -49,7 +51,7 @@ export function address(field, context) {
|
||||
return {
|
||||
title: d.tags['addr:city'] || d.tags.name,
|
||||
value: d.tags['addr:city'] || d.tags.name,
|
||||
dist: iD.geo.sphericalDistance(d.extent(context.graph()).center(), l)
|
||||
dist: sphericalDistance(d.extent(context.graph()).center(), l)
|
||||
};
|
||||
}).sort(function(a, b) {
|
||||
return a.dist - b.dist;
|
||||
@@ -75,7 +77,7 @@ export function address(field, context) {
|
||||
function getPostCodes() {
|
||||
var extent = entity.extent(context.graph()),
|
||||
l = extent.center(),
|
||||
box = iD.geo.Extent(l).padByMeters(200);
|
||||
box = Extent(l).padByMeters(200);
|
||||
|
||||
return context.intersects(box)
|
||||
.filter(isAddressable)
|
||||
@@ -83,7 +85,7 @@ export function address(field, context) {
|
||||
return {
|
||||
title: d.tags['addr:postcode'],
|
||||
value: d.tags['addr:postcode'],
|
||||
dist: iD.geo.sphericalDistance(d.extent(context.graph()).center(), l)
|
||||
dist: sphericalDistance(d.extent(context.graph()).center(), l)
|
||||
};
|
||||
}).sort(function(a, b) {
|
||||
return a.dist - b.dist;
|
||||
|
||||
+36
-13
@@ -1,13 +1,36 @@
|
||||
export { access } from './access';
|
||||
export { address } from './address';
|
||||
export { check, defaultcheck} from './check';
|
||||
export { combo, typeCombo, multiCombo } from './combo';
|
||||
export { cycleway } from './cycleway';
|
||||
export { text, url, number, email, tel } from './input';
|
||||
export { localized } from './localized';
|
||||
export { lanes } from './lanes';
|
||||
export { maxspeed } from './maxspeed';
|
||||
export { radio } from './radio';
|
||||
export { restrictions } from './restrictions';
|
||||
export { textarea } from './textarea';
|
||||
export { wikipedia } from './wikipedia';
|
||||
import { access } from './access';
|
||||
import { address } from './address';
|
||||
import { check, defaultcheck} from './check';
|
||||
import { combo, typeCombo, multiCombo } from './combo';
|
||||
import { cycleway } from './cycleway';
|
||||
import { text, url, number, email, tel } from './input';
|
||||
import { localized } from './localized';
|
||||
import { lanes } from './lanes';
|
||||
import { maxspeed } from './maxspeed';
|
||||
import { radio } from './radio';
|
||||
import { restrictions } from './restrictions';
|
||||
import { textarea } from './textarea';
|
||||
import { wikipedia } from './wikipedia';
|
||||
|
||||
export var presetObj = {
|
||||
access: access,
|
||||
address: address,
|
||||
check: check,
|
||||
defaultcheck: defaultcheck,
|
||||
combo: combo,
|
||||
typeCombo: typeCombo,
|
||||
multiCombo: multiCombo,
|
||||
cycleway: cycleway,
|
||||
text: text,
|
||||
url: url,
|
||||
number: number,
|
||||
email: email,
|
||||
tel: tel,
|
||||
localized: localized,
|
||||
lanes: lanes,
|
||||
maxspeed: maxspeed,
|
||||
radio: radio,
|
||||
restrictions: restrictions,
|
||||
textarea: textarea,
|
||||
wikipedia: wikipedia
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { Icon } from '../../svg/index';
|
||||
import { SuggestNames } from '../../util/index';
|
||||
export function localized(field, context) {
|
||||
var dispatch = d3.dispatch('change', 'input'),
|
||||
wikipedia = iD.services.wikipedia(),
|
||||
@@ -17,7 +19,7 @@ export function localized(field, context) {
|
||||
if (field.id === 'name') {
|
||||
var preset = context.presets().match(entity, context.graph());
|
||||
input.call(d3.combobox().fetcher(
|
||||
iD.util.SuggestNames(preset, iD.data.suggestions)
|
||||
SuggestNames(preset, iD.data.suggestions)
|
||||
));
|
||||
}
|
||||
|
||||
@@ -33,7 +35,7 @@ export function localized(field, context) {
|
||||
.append('button')
|
||||
.attr('class', 'button-input-action localized-add minor')
|
||||
.attr('tabindex', -1)
|
||||
.call(iD.svg.Icon('#icon-plus'))
|
||||
.call(Icon('#icon-plus'))
|
||||
.call(bootstrap.tooltip()
|
||||
.title(t('translate.translate'))
|
||||
.placement('left'));
|
||||
@@ -150,7 +152,7 @@ export function localized(field, context) {
|
||||
.style('max-height','0px')
|
||||
.remove();
|
||||
})
|
||||
.call(iD.svg.Icon('#operation-delete'));
|
||||
.call(Icon('#operation-delete'));
|
||||
|
||||
wrap.append('input')
|
||||
.attr('class', 'localized-lang')
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { pointInPolygon } from '../../geo/index';
|
||||
export function maxspeed(field, context) {
|
||||
var dispatch = d3.dispatch('change'),
|
||||
entity,
|
||||
@@ -31,7 +32,7 @@ export function maxspeed(field, context) {
|
||||
|
||||
imperial = _.some(iD.data.imperial.features, function(f) {
|
||||
return _.some(f.geometry.coordinates, function(d) {
|
||||
return iD.geo.pointInPolygon(loc, d);
|
||||
return pointInPolygon(loc, d);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { Layers, Vertices, Lines, Turns } from '../../svg/index';
|
||||
import { Hover } from '../../behavior/index';
|
||||
import { Entity } from '../../core/index';
|
||||
import { Intersection, Extent, RawMercator, Turn, inferRestriction } from '../../geo/index';
|
||||
import { UnrestrictTurn, RestrictTurn } from '../../actions/index';
|
||||
|
||||
export function restrictions(field, context) {
|
||||
var dispatch = d3.dispatch('change'),
|
||||
hover = iD.behavior.Hover(context),
|
||||
hover = Hover(context),
|
||||
vertexID,
|
||||
fromNodeID;
|
||||
|
||||
|
||||
function restrictions(selection) {
|
||||
// if form field is hidden or has detached from dom, clean up.
|
||||
if (!d3.select('.inspector-wrap.inspector-hidden').empty() || !selection.node().parentNode) {
|
||||
@@ -24,12 +29,12 @@ export function restrictions(field, context) {
|
||||
.attr('class', 'restriction-help');
|
||||
|
||||
|
||||
var intersection = iD.geo.Intersection(context.graph(), vertexID),
|
||||
var intersection = Intersection(context.graph(), vertexID),
|
||||
graph = intersection.graph,
|
||||
vertex = graph.entity(vertexID),
|
||||
filter = d3.functor(true),
|
||||
extent = iD.geo.Extent(),
|
||||
projection = iD.geo.RawMercator();
|
||||
extent = Extent(),
|
||||
projection = RawMercator();
|
||||
|
||||
var d = wrap.dimensions(),
|
||||
c = [d[0] / 2, d[1] / 2],
|
||||
@@ -44,10 +49,10 @@ export function restrictions(field, context) {
|
||||
.translate([c[0] - s[0], c[1] - s[1]])
|
||||
.clipExtent([[0, 0], d]);
|
||||
|
||||
var drawLayers = iD.svg.Layers(projection, context).only('osm').dimensions(d),
|
||||
drawVertices = iD.svg.Vertices(projection, context),
|
||||
drawLines = iD.svg.Lines(projection, context),
|
||||
drawTurns = iD.svg.Turns(projection, context);
|
||||
var drawLayers = Layers(projection, context).only('osm').dimensions(d),
|
||||
drawVertices = Vertices(projection, context),
|
||||
drawLines = Lines(projection, context),
|
||||
drawTurns = Turns(projection, context);
|
||||
|
||||
enter
|
||||
.call(drawLayers)
|
||||
@@ -91,17 +96,17 @@ export function restrictions(field, context) {
|
||||
|
||||
function click() {
|
||||
var datum = d3.event.target.__data__;
|
||||
if (datum instanceof iD.Entity) {
|
||||
if (datum instanceof Entity) {
|
||||
fromNodeID = intersection.adjacentNodeId(datum.id);
|
||||
render();
|
||||
} else if (datum instanceof iD.geo.Turn) {
|
||||
} else if (datum instanceof Turn) {
|
||||
if (datum.restriction) {
|
||||
context.perform(
|
||||
iD.actions.UnrestrictTurn(datum, projection),
|
||||
UnrestrictTurn(datum, projection),
|
||||
t('operations.restriction.annotation.delete'));
|
||||
} else {
|
||||
context.perform(
|
||||
iD.actions.RestrictTurn(datum, projection),
|
||||
RestrictTurn(datum, projection),
|
||||
t('operations.restriction.annotation.create'));
|
||||
}
|
||||
}
|
||||
@@ -109,7 +114,7 @@ export function restrictions(field, context) {
|
||||
|
||||
function mouseover() {
|
||||
var datum = d3.event.target.__data__;
|
||||
if (datum instanceof iD.geo.Turn) {
|
||||
if (datum instanceof Turn) {
|
||||
var graph = context.graph(),
|
||||
presets = context.presets(),
|
||||
preset;
|
||||
@@ -118,7 +123,7 @@ export function restrictions(field, context) {
|
||||
preset = presets.match(graph.entity(datum.restriction), graph);
|
||||
} else {
|
||||
preset = presets.item('type/restriction/' +
|
||||
iD.geo.inferRestriction(
|
||||
inferRestriction(
|
||||
graph,
|
||||
datum.from,
|
||||
datum.via,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { Icon } from '../../svg/index';
|
||||
import { ChangeTags } from '../../actions/index';
|
||||
export function wikipedia(field, context) {
|
||||
var dispatch = d3.dispatch('change'),
|
||||
wikipedia = iD.services.wikipedia(),
|
||||
@@ -65,7 +67,7 @@ export function wikipedia(field, context) {
|
||||
.attr('class', 'wiki-link button-input-action minor')
|
||||
.attr('tabindex', -1)
|
||||
.attr('target', '_blank')
|
||||
.call(iD.svg.Icon('#icon-out-link', 'inline'));
|
||||
.call(Icon('#icon-out-link', 'inline'));
|
||||
}
|
||||
|
||||
function language() {
|
||||
@@ -148,7 +150,7 @@ export function wikipedia(field, context) {
|
||||
return id.match(/^Q\d+$/);
|
||||
});
|
||||
|
||||
context.overwrite(iD.actions.ChangeTags(currEntityId, currTags), annotation);
|
||||
context.overwrite(ChangeTags(currEntityId, currTags), annotation);
|
||||
dispatch.change(currTags);
|
||||
});
|
||||
}
|
||||
|
||||
+62
-41
@@ -1,10 +1,41 @@
|
||||
import {
|
||||
Account,
|
||||
Attribution,
|
||||
Background,
|
||||
cmd,
|
||||
Contributors,
|
||||
FeatureInfo,
|
||||
FullScreen,
|
||||
Geolocate,
|
||||
Help,
|
||||
Info,
|
||||
Loading,
|
||||
MapData,
|
||||
MapInMap,
|
||||
Modes,
|
||||
Restore,
|
||||
Save,
|
||||
Scale,
|
||||
Sidebar,
|
||||
Spinner,
|
||||
Splash,
|
||||
Status,
|
||||
UndoRedo,
|
||||
Zoom
|
||||
} from './core/index';
|
||||
|
||||
|
||||
import { Defs, Icon } from '../svg/index';
|
||||
import { Hash } from '../behavior/index';
|
||||
import { Browse } from '../modes/index';
|
||||
|
||||
export function ui(context) {
|
||||
function render(container) {
|
||||
var map = context.map();
|
||||
|
||||
if (iD.detect().opera) container.classed('opera', true);
|
||||
|
||||
var hash = iD.behavior.Hash(context);
|
||||
var hash = Hash(context);
|
||||
|
||||
hash();
|
||||
|
||||
@@ -14,7 +45,7 @@ export function ui(context) {
|
||||
|
||||
container.append('svg')
|
||||
.attr('id', 'defs')
|
||||
.call(iD.svg.Defs(context));
|
||||
.call(Defs(context));
|
||||
|
||||
container.append('div')
|
||||
.attr('id', 'sidebar')
|
||||
@@ -33,10 +64,10 @@ export function ui(context) {
|
||||
.call(map);
|
||||
|
||||
content
|
||||
.call(iD.ui.MapInMap(context));
|
||||
.call(MapInMap(context));
|
||||
|
||||
content.append('div')
|
||||
.call(iD.ui.Info(context));
|
||||
.call(Info(context));
|
||||
|
||||
bar.append('div')
|
||||
.attr('class', 'spacer col4');
|
||||
@@ -46,53 +77,53 @@ export function ui(context) {
|
||||
|
||||
limiter.append('div')
|
||||
.attr('class', 'button-wrap joined col3')
|
||||
.call(iD.ui.Modes(context), limiter);
|
||||
.call(Modes(context), limiter);
|
||||
|
||||
limiter.append('div')
|
||||
.attr('class', 'button-wrap joined col1')
|
||||
.call(iD.ui.UndoRedo(context));
|
||||
.call(UndoRedo(context));
|
||||
|
||||
limiter.append('div')
|
||||
.attr('class', 'button-wrap col1')
|
||||
.call(iD.ui.Save(context));
|
||||
.call(Save(context));
|
||||
|
||||
bar.append('div')
|
||||
.attr('class', 'full-screen')
|
||||
.call(iD.ui.FullScreen(context));
|
||||
.call(FullScreen(context));
|
||||
|
||||
bar.append('div')
|
||||
.attr('class', 'spinner')
|
||||
.call(iD.ui.Spinner(context));
|
||||
.call(Spinner(context));
|
||||
|
||||
var controls = bar.append('div')
|
||||
.attr('class', 'map-controls');
|
||||
|
||||
controls.append('div')
|
||||
.attr('class', 'map-control zoombuttons')
|
||||
.call(iD.ui.Zoom(context));
|
||||
.call(Zoom(context));
|
||||
|
||||
controls.append('div')
|
||||
.attr('class', 'map-control geolocate-control')
|
||||
.call(iD.ui.Geolocate(context));
|
||||
.call(Geolocate(context));
|
||||
|
||||
controls.append('div')
|
||||
.attr('class', 'map-control background-control')
|
||||
.call(iD.ui.Background(context));
|
||||
.call(Background(context));
|
||||
|
||||
controls.append('div')
|
||||
.attr('class', 'map-control map-data-control')
|
||||
.call(iD.ui.MapData(context));
|
||||
.call(MapData(context));
|
||||
|
||||
controls.append('div')
|
||||
.attr('class', 'map-control help-control')
|
||||
.call(iD.ui.Help(context));
|
||||
.call(Help(context));
|
||||
|
||||
var about = content.append('div')
|
||||
.attr('id', 'about');
|
||||
|
||||
about.append('div')
|
||||
.attr('id', 'attrib')
|
||||
.call(iD.ui.Attribution(context));
|
||||
.call(Attribution(context));
|
||||
|
||||
var footer = about.append('div')
|
||||
.attr('id', 'footer')
|
||||
@@ -100,11 +131,11 @@ export function ui(context) {
|
||||
|
||||
footer.append('div')
|
||||
.attr('class', 'api-status')
|
||||
.call(iD.ui.Status(context));
|
||||
.call(Status(context));
|
||||
|
||||
footer.append('div')
|
||||
.attr('id', 'scale-block')
|
||||
.call(iD.ui.Scale(context));
|
||||
.call(Scale(context));
|
||||
|
||||
var aboutList = footer.append('div')
|
||||
.attr('id', 'info-block')
|
||||
@@ -112,7 +143,7 @@ export function ui(context) {
|
||||
.attr('id', 'about-list');
|
||||
|
||||
if (!context.embed()) {
|
||||
aboutList.call(iD.ui.Account(context));
|
||||
aboutList.call(Account(context));
|
||||
}
|
||||
|
||||
aboutList.append('li')
|
||||
@@ -128,7 +159,7 @@ export function ui(context) {
|
||||
.attr('target', '_blank')
|
||||
.attr('tabindex', -1)
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/issues')
|
||||
.call(iD.svg.Icon('#icon-bug', 'light'))
|
||||
.call(Icon('#icon-bug', 'light'))
|
||||
.call(bootstrap.tooltip()
|
||||
.title(t('report_a_bug'))
|
||||
.placement('top')
|
||||
@@ -138,7 +169,7 @@ export function ui(context) {
|
||||
.attr('target', '_blank')
|
||||
.attr('tabindex', -1)
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/blob/master/CONTRIBUTING.md#translating')
|
||||
.call(iD.svg.Icon('#icon-translate', 'light'))
|
||||
.call(Icon('#icon-translate', 'light'))
|
||||
.call(bootstrap.tooltip()
|
||||
.title(t('help_translate'))
|
||||
.placement('top')
|
||||
@@ -147,12 +178,12 @@ export function ui(context) {
|
||||
aboutList.append('li')
|
||||
.attr('class', 'feature-warning')
|
||||
.attr('tabindex', -1)
|
||||
.call(iD.ui.FeatureInfo(context));
|
||||
.call(FeatureInfo(context));
|
||||
|
||||
aboutList.append('li')
|
||||
.attr('class', 'user-list')
|
||||
.attr('tabindex', -1)
|
||||
.call(iD.ui.Contributors(context));
|
||||
.call(Contributors(context));
|
||||
|
||||
window.onbeforeunload = function() {
|
||||
return context.save();
|
||||
@@ -189,21 +220,21 @@ export function ui(context) {
|
||||
.on('⇧↑', pan([0, mapDimensions[1]]))
|
||||
.on('⇧→', pan([-mapDimensions[0], 0]))
|
||||
.on('⇧↓', pan([0, -mapDimensions[1]]))
|
||||
.on(iD.ui.cmd('⌘←'), pan([mapDimensions[0], 0]))
|
||||
.on(iD.ui.cmd('⌘↑'), pan([0, mapDimensions[1]]))
|
||||
.on(iD.ui.cmd('⌘→'), pan([-mapDimensions[0], 0]))
|
||||
.on(iD.ui.cmd('⌘↓'), pan([0, -mapDimensions[1]]));
|
||||
.on(cmd('⌘←'), pan([mapDimensions[0], 0]))
|
||||
.on(cmd('⌘↑'), pan([0, mapDimensions[1]]))
|
||||
.on(cmd('⌘→'), pan([-mapDimensions[0], 0]))
|
||||
.on(cmd('⌘↓'), pan([0, -mapDimensions[1]]));
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
context.enter(iD.modes.Browse(context));
|
||||
context.enter(Browse(context));
|
||||
|
||||
context.container()
|
||||
.call(iD.ui.Splash(context))
|
||||
.call(iD.ui.Restore(context));
|
||||
.call(Splash(context))
|
||||
.call(Restore(context));
|
||||
|
||||
var authenticating = iD.ui.Loading(context)
|
||||
var authenticating = Loading(context)
|
||||
.message(t('loading_auth'));
|
||||
|
||||
context.connection()
|
||||
@@ -223,17 +254,7 @@ export function ui(context) {
|
||||
});
|
||||
}
|
||||
|
||||
ui.sidebar = iD.ui.Sidebar(context);
|
||||
ui.sidebar = Sidebar(context);
|
||||
|
||||
return ui;
|
||||
}
|
||||
|
||||
ui.tooltipHtml = function(text, key) {
|
||||
var s = '<span>' + text + '</span>';
|
||||
if (key) {
|
||||
s += '<div class="keyhint-wrap">' +
|
||||
'<span> ' + (t('tooltip_keyhint')) + ' </span>' +
|
||||
'<span class="keyhint"> ' + key + '</span></div>';
|
||||
}
|
||||
return s;
|
||||
};
|
||||
|
||||
+3
-3
@@ -8,9 +8,9 @@ function readFiles(dirname, outdir) {
|
||||
processFile(fileData, outdir + filename);
|
||||
});
|
||||
}
|
||||
var POSSIBLE_MODULES = [ 'actions', 'geo', 'modes', 'util', 'core', 'behavior' ];
|
||||
var POSSIBLE_MODULES = [ 'actions', 'geo', 'modes', 'util', 'core', 'behavior', 'svg' ];
|
||||
function findData(data) {
|
||||
var modules = { 'actions': [], 'geo': [], 'modes': [], 'util': [], 'core': [], 'behavior': [] };
|
||||
var modules = { 'actions': [], 'geo': [], 'modes': [], 'util': [], 'core': [], 'behavior': [], 'svg': [] };
|
||||
var cores = [ 'Entity', 'Way', 'Relation', 'Node', 'Graph', 'Tree', 'Difference', 'History' ];
|
||||
var ret = data.map(function(lineArg) {
|
||||
var line = lineArg;
|
||||
@@ -43,7 +43,7 @@ function findData(data) {
|
||||
POSSIBLE_MODULES.forEach(function(mod) {
|
||||
if (modules[mod].length > 0) {
|
||||
var importStuff = modules[mod].join(', ');
|
||||
ret.unshift(`import { ${importStuff} } from '../${mod}/index';`);
|
||||
ret.unshift(`import { ${importStuff} } from '../../${mod}/index';`);
|
||||
/*eslint-disable */
|
||||
/*eslint-enable */
|
||||
}
|
||||
|
||||
@@ -44,11 +44,6 @@
|
||||
<script src='../js/lib/id/svg.js'></script>
|
||||
<script src='../js/lib/id/services.js'></script>
|
||||
|
||||
<script src='../js/lib/id/ui/index.js'></script>
|
||||
<script src='../js/lib/id/ui/core.js'></script>
|
||||
<script src='../js/lib/id/ui/preset.js'></script>
|
||||
|
||||
|
||||
<script src='../js/lib/locale.js'></script>
|
||||
|
||||
<script src='../data/data_dev.js'></script>
|
||||
|
||||
Reference in New Issue
Block a user