mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-25 23:13:42 +00:00
Merge branch 'master' of github.com:systemed/iD
This commit is contained in:
@@ -32,4 +32,7 @@ en:
|
||||
road: "**Select Road from the grid**"
|
||||
residential: "There are different types of roads, the most common of which is Residential. **Choose the Residential road type**"
|
||||
describe: "**Name the road and close the feature editor.**"
|
||||
startediting:
|
||||
help: "More documentation and this walkthrough are available here."
|
||||
save: "Don't forget to regularly save your changes!"
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
<script src='js/id/ui/intro/point.js'></script>
|
||||
<script src='js/id/ui/intro/area.js'></script>
|
||||
<script src='js/id/ui/intro/line.js'></script>
|
||||
<script src='js/id/ui/intro/start_editing.js'></script>
|
||||
|
||||
<script src='js/id/actions.js'></script>
|
||||
<script src="js/id/actions/add_midpoint.js"></script>
|
||||
|
||||
@@ -18,12 +18,17 @@ iD.ui.intro = function(context) {
|
||||
context.history().reset();
|
||||
context.history().merge(iD.Graph().load(JSON.parse(iD.introGraph)).entities);
|
||||
|
||||
// Block saving
|
||||
var savebutton = d3.select('#bar button.save'),
|
||||
save = savebutton.on('click');
|
||||
savebutton.on('click', null);
|
||||
|
||||
d3.select('.layer-layer:first-child').style('opacity', 1);
|
||||
|
||||
var curtain = d3.curtain();
|
||||
selection.call(curtain);
|
||||
|
||||
var steps = ['navigation', 'point', 'area', 'line'].map(function(step, i) {
|
||||
var steps = ['navigation', 'point', 'area', 'line', 'startEditing'].map(function(step, i) {
|
||||
var s = iD.ui.intro[step](context, curtain)
|
||||
.on('done', function() {
|
||||
entered.filter(function(d) {
|
||||
@@ -34,17 +39,15 @@ iD.ui.intro = function(context) {
|
||||
return s;
|
||||
});
|
||||
|
||||
steps.push({
|
||||
name: 'Start Editing',
|
||||
enter: function() {
|
||||
curtain.remove();
|
||||
navwrap.remove();
|
||||
d3.select('.layer-layer:first-child').style('opacity', opacity);
|
||||
context.connection().toggle(true).flush().loadedTiles(loadedTiles);
|
||||
context.history().reset().merge(baseEntities);
|
||||
if (history) context.history().fromJSON(history);
|
||||
window.location.replace(hash);
|
||||
}
|
||||
steps[steps.length - 1].on('startEditing', function() {
|
||||
curtain.remove();
|
||||
navwrap.remove();
|
||||
d3.select('.layer-layer:first-child').style('opacity', opacity);
|
||||
context.connection().toggle(true).flush().loadedTiles(loadedTiles);
|
||||
context.history().reset().merge(baseEntities);
|
||||
if (history) context.history().fromJSON(history);
|
||||
window.location.replace(hash);
|
||||
d3.select('#bar button.save').on('click', save);
|
||||
});
|
||||
|
||||
var navwrap = selection.append('div').attr('class', 'intro-nav-wrap');
|
||||
@@ -56,9 +59,7 @@ iD.ui.intro = function(context) {
|
||||
var entered = buttonwrap.data(steps)
|
||||
.enter().append('button')
|
||||
.attr('class', 'step')
|
||||
.on('click', function(d) {
|
||||
enter(d);
|
||||
});
|
||||
.on('click', enter);
|
||||
|
||||
entered.append('label').text(function(d) { return d.name; });
|
||||
enter(steps[0]);
|
||||
|
||||
34
js/id/ui/intro/start_editing.js
Normal file
34
js/id/ui/intro/start_editing.js
Normal file
@@ -0,0 +1,34 @@
|
||||
iD.ui.intro.startEditing = function(context, curtain) {
|
||||
|
||||
var event = d3.dispatch('done', 'startEditing'),
|
||||
timeouts = [];
|
||||
|
||||
var step = {
|
||||
name: 'Start Editing'
|
||||
};
|
||||
|
||||
function timeout(f, t) {
|
||||
timeouts.push(window.setTimeout(f, t));
|
||||
}
|
||||
|
||||
step.enter = function() {
|
||||
|
||||
curtain.reveal('.map-control.help-control', t('intro.startediting.help'));
|
||||
|
||||
timeout(function() {
|
||||
curtain.reveal('#bar button.save', t('intro.startediting.save'));
|
||||
}, 3500);
|
||||
|
||||
timeout(function() {
|
||||
curtain.reveal('#surface', t('intro.startediting.save'));
|
||||
}, 7000);
|
||||
|
||||
timeout(event.startEditing, 7500);
|
||||
};
|
||||
|
||||
step.exit = function() {
|
||||
timeouts.forEach(window.clearTimeout);
|
||||
};
|
||||
|
||||
return d3.rebind(step, event, 'on');
|
||||
};
|
||||
Reference in New Issue
Block a user