Rename infobox to info-panels

This commit is contained in:
Bryan Housel
2017-07-04 02:14:30 -04:00
parent 562edc8121
commit 3043323ba9
10 changed files with 58 additions and 58 deletions
+9 -9
View File
@@ -2647,7 +2647,7 @@ img.tile-removing {
/* Info Box
------------------------------------------------------- */
.infobox {
.info-panels {
display: flex;
flex-flow: row-reverse wrap-reverse;
position: absolute;
@@ -2657,18 +2657,18 @@ img.tile-removing {
-ms-user-select: element;
}
.infobox h1,
.infobox h2,
.infobox h3,
.infobox h4,
.infobox h5 {
.info-panels h1,
.info-panels h2,
.info-panels h3,
.info-panels h4,
.info-panels h5 {
display: inline-block;
margin-bottom: 0;
}
.infobox h1,
.infobox h2,
.infobox h3 {
.info-panels h1,
.info-panels h2,
.info-panels h3 {
color: #ff8;
}
+2 -2
View File
@@ -272,7 +272,7 @@ en:
contributors:
list: "Edits by {users}"
truncated_list: "Edits by {users} and {count} others"
infobox:
info_panels:
key: I
history:
key: H
@@ -1101,7 +1101,7 @@ en:
lasso: "Draw a selection lasso around features"
with_selected:
title: "With feature selected"
infobox: "Toggle info / measurement box"
info_panels: "Toggle information panels"
edit_menu: "Toggle edit menu"
vertex_selected:
title: "With node selected"
+2 -2
View File
@@ -94,8 +94,8 @@
"text": "shortcuts.browsing.with_selected.edit_menu"
}, {
"modifiers": ["⌘"],
"shortcuts": ["infobox.key"],
"text": "shortcuts.browsing.with_selected.infobox"
"shortcuts": ["info_panels.key"],
"text": "shortcuts.browsing.with_selected.info_panels"
},
{
+2 -2
View File
@@ -348,7 +348,7 @@
"list": "Edits by {users}",
"truncated_list": "Edits by {users} and {count} others"
},
"infobox": {
"info_panels": {
"key": "I",
"history": {
"key": "H",
@@ -979,7 +979,7 @@
},
"with_selected": {
"title": "With feature selected",
"infobox": "Toggle info / measurement box",
"info_panels": "Toggle information panels",
"edit_menu": "Toggle edit menu"
},
"vertex_selected": {
+1 -1
View File
@@ -244,7 +244,7 @@ export function rendererTileLayer(context) {
var center = context.projection.invert(tileCenter(d));
source.getVintage(center, d, function(err, result) {
span.text((result && result.range) ||
t('infobox.background.vintage') + ': ' + t('infobox.background.unknown')
t('info_panels.background.vintage') + ': ' + t('info_panels.background.unknown')
);
});
});
+8 -8
View File
@@ -26,7 +26,7 @@ export function uiInfo(context) {
function redraw() {
var activeids = ids.filter(function(k) { return active[k]; }).sort();
var containers = infobox.selectAll('.panel-container')
var containers = infoPanels.selectAll('.panel-container')
.data(activeids, function(k) { return k; });
containers.exit()
@@ -70,7 +70,7 @@ export function uiInfo(context) {
// redraw the panels
infobox.selectAll('.panel-content')
infoPanels.selectAll('.panel-content')
.each(function(d) {
d3.select(this).call(panels[d]);
});
@@ -100,21 +100,21 @@ export function uiInfo(context) {
}
var infobox = selection.selectAll('.infobox')
var infoPanels = selection.selectAll('.info-panels')
.data([0]);
infobox = infobox.enter()
infoPanels = infoPanels.enter()
.append('div')
.attr('class', 'infobox')
.merge(infobox);
.attr('class', 'info-panels')
.merge(infoPanels);
redraw();
var keybinding = d3keybinding('info')
.on(uiCmd('⌘' + t('infobox.key')), toggle);
.on(uiCmd('⌘' + t('info_panels.key')), toggle);
ids.forEach(function(k) {
var key = t('infobox.' + k + '.key', { default: null });
var key = t('info_panels.' + k + '.key', { default: null });
if (!key) return;
keybinding
.on(uiCmd('⌘⇧' + key), function() { toggle(k); });
+6 -6
View File
@@ -29,14 +29,14 @@ export function uiPanelBackground(context) {
list
.append('li')
.text(t('infobox.background.zoom') + ': ')
.text(t('info_panels.background.zoom') + ': ')
.append('span')
.attr('class', 'zoom')
.text(currZoom);
list
.append('li')
.text(t('infobox.background.vintage') + ': ')
.text(t('info_panels.background.vintage') + ': ')
.append('span')
.attr('class', 'vintage')
.text(currVintage);
@@ -49,7 +49,7 @@ export function uiPanelBackground(context) {
selection
.append('a')
.text(t('infobox.background.' + toggle))
.text(t('info_panels.background.' + toggle))
.attr('href', '#')
.attr('class', 'button button-toggle-tiles')
.on('click', function() {
@@ -75,7 +75,7 @@ export function uiPanelBackground(context) {
if (!d || !d.length >= 3) return;
background.baseLayerSource().getVintage(center, d, function(err, result) {
currVintage = (result && result.range) || t('infobox.background.unknown');
currVintage = (result && result.range) || t('info_panels.background.unknown');
selection.selectAll('.vintage')
.text(currVintage);
});
@@ -102,8 +102,8 @@ export function uiPanelBackground(context) {
};
panel.id = 'background';
panel.title = t('infobox.background.title');
panel.key = t('infobox.background.key');
panel.title = t('info_panels.background.title');
panel.key = t('info_panels.background.key');
return panel;
+12 -12
View File
@@ -7,10 +7,10 @@ export function uiPanelHistory(context) {
function displayTimestamp(entity) {
if (!entity.timestamp) return t('infobox.history.unknown');
if (!entity.timestamp) return t('info_panels.history.unknown');
var d = new Date(entity.timestamp);
if (isNaN(d.getTime())) return t('infobox.history.unknown');
if (isNaN(d.getTime())) return t('info_panels.history.unknown');
return d.toLocaleString();
}
@@ -20,7 +20,7 @@ export function uiPanelHistory(context) {
if (!entity.user) {
selection
.append('span')
.text(t('infobox.history.unknown'));
.text(t('info_panels.history.unknown'));
return;
}
@@ -55,7 +55,7 @@ export function uiPanelHistory(context) {
if (!entity.changeset) {
selection
.append('span')
.text(t('infobox.history.unknown'));
.text(t('info_panels.history.unknown'));
return;
}
@@ -95,7 +95,7 @@ export function uiPanelHistory(context) {
selection
.append('h4')
.attr('class', 'history-heading')
.text(singular || t('infobox.history.selected', { n: selected.length }));
.text(singular || t('info_panels.history.selected', { n: selected.length }));
if (!singular) return;
@@ -106,20 +106,20 @@ export function uiPanelHistory(context) {
list
.append('li')
.text(t('infobox.history.version') + ': ' + entity.version);
.text(t('info_panels.history.version') + ': ' + entity.version);
list
.append('li')
.text(t('infobox.history.last_edit') + ': ' + displayTimestamp(entity));
.text(t('info_panels.history.last_edit') + ': ' + displayTimestamp(entity));
list
.append('li')
.text(t('infobox.history.edited_by') + ': ')
.text(t('info_panels.history.edited_by') + ': ')
.call(displayUser, entity);
list
.append('li')
.text(t('infobox.history.changeset') + ': ')
.text(t('info_panels.history.changeset') + ': ')
.call(displayChangeset, entity);
selection
@@ -130,7 +130,7 @@ export function uiPanelHistory(context) {
.attr('href', context.connection().historyURL(entity))
.call(svgIcon('#icon-out-link', 'inline'))
.append('span')
.text(t('infobox.history.link_text'));
.text(t('info_panels.history.link_text'));
}
@@ -149,8 +149,8 @@ export function uiPanelHistory(context) {
};
panel.id = 'history';
panel.title = t('infobox.history.title');
panel.key = t('infobox.history.key');
panel.title = t('info_panels.history.title');
panel.key = t('info_panels.history.key');
return panel;
+4 -4
View File
@@ -52,12 +52,12 @@ export function uiPanelLocation(context) {
var debouncedGetLocation = _.debounce(getLocation, 250);
function getLocation(selection, coord) {
if (!services.geocoder) {
currLocation = t('infobox.location.unknown_location');
currLocation = t('info_panels.location.unknown_location');
selection.selectAll('.location-info')
.text(currLocation);
} else {
services.geocoder.reverse(coord, function(err, result) {
currLocation = result ? result.display_name : t('infobox.location.unknown_location');
currLocation = result ? result.display_name : t('info_panels.location.unknown_location');
selection.selectAll('.location-info')
.text(currLocation);
});
@@ -80,8 +80,8 @@ export function uiPanelLocation(context) {
};
panel.id = 'location';
panel.title = t('infobox.location.title');
panel.key = t('infobox.location.key');
panel.title = t('info_panels.location.title');
panel.key = t('info_panels.location.key');
return panel;
+12 -12
View File
@@ -121,7 +121,7 @@ export function uiPanelMeasurement(context) {
selection
.append('h4')
.attr('class', 'measurement-heading')
.text(singular || t('infobox.measurement.selected', { n: selected.length }));
.text(singular || t('info_panels.measurement.selected', { n: selected.length }));
if (!selected.length) return;
@@ -140,7 +140,7 @@ export function uiPanelMeasurement(context) {
if (!singular) {
list
.append('li')
.text(t('infobox.measurement.center') + ': ' +
.text(t('info_panels.measurement.center') + ': ' +
center[0].toFixed(OSM_PRECISION) + ', ' + center[1].toFixed(OSM_PRECISION)
);
return;
@@ -154,19 +154,19 @@ export function uiPanelMeasurement(context) {
var closed = (entity.type === 'relation') || (entity.isClosed() && !entity.isDegenerate()),
feature = entity.asGeoJSON(resolver),
length = radiansToMeters(d3GeoLength(toLineString(feature))),
lengthLabel = t('infobox.measurement.' + (closed ? 'perimeter' : 'length')),
lengthLabel = t('info_panels.measurement.' + (closed ? 'perimeter' : 'length')),
centroid = d3GeoCentroid(feature);
list
.append('li')
.text(t('infobox.measurement.geometry') + ': ' +
(closed ? t('infobox.measurement.closed') + ' ' : '') + t('geometry.' + geometry) );
.text(t('info_panels.measurement.geometry') + ': ' +
(closed ? t('info_panels.measurement.closed') + ' ' : '') + t('geometry.' + geometry) );
if (closed) {
var area = steradiansToSqmeters(entity.area(resolver));
list
.append('li')
.text(t('infobox.measurement.area') + ': ' + displayArea(area));
.text(t('info_panels.measurement.area') + ': ' + displayArea(area));
}
list
@@ -175,7 +175,7 @@ export function uiPanelMeasurement(context) {
list
.append('li')
.text(t('infobox.measurement.centroid') + ': ' +
.text(t('info_panels.measurement.centroid') + ': ' +
centroid[0].toFixed(OSM_PRECISION) + ', ' + centroid[1].toFixed(OSM_PRECISION)
);
@@ -184,7 +184,7 @@ export function uiPanelMeasurement(context) {
selection
.append('a')
.text(t('infobox.measurement.' + toggle))
.text(t('info_panels.measurement.' + toggle))
.attr('href', '#')
.attr('class', 'button button-toggle-units')
.on('click', function() {
@@ -194,11 +194,11 @@ export function uiPanelMeasurement(context) {
});
} else {
var centerLabel = t('infobox.measurement.' + (entity.type === 'node' ? 'location' : 'center'));
var centerLabel = t('info_panels.measurement.' + (entity.type === 'node' ? 'location' : 'center'));
list
.append('li')
.text(t('infobox.measurement.geometry') + ': ' + t('geometry.' + geometry));
.text(t('info_panels.measurement.geometry') + ': ' + t('geometry.' + geometry));
list
.append('li')
@@ -224,8 +224,8 @@ export function uiPanelMeasurement(context) {
};
panel.id = 'measurement';
panel.title = t('infobox.measurement.title');
panel.key = t('infobox.measurement.key');
panel.title = t('info_panels.measurement.title');
panel.key = t('info_panels.measurement.key');
return panel;