From 3043323ba93c8abde03245e86fede7f44e046b9f Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 4 Jul 2017 02:14:30 -0400 Subject: [PATCH] Rename infobox to info-panels --- css/80_app.css | 18 +++++++++--------- data/core.yaml | 4 ++-- data/shortcuts.json | 4 ++-- dist/locales/en.json | 4 ++-- modules/renderer/tile_layer.js | 2 +- modules/ui/info.js | 16 ++++++++-------- modules/ui/panels/background.js | 12 ++++++------ modules/ui/panels/history.js | 24 ++++++++++++------------ modules/ui/panels/location.js | 8 ++++---- modules/ui/panels/measurement.js | 24 ++++++++++++------------ 10 files changed, 58 insertions(+), 58 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index c6fd5e36d..e2ec1530c 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -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; } diff --git a/data/core.yaml b/data/core.yaml index b96b4c482..3653dd58f 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -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" diff --git a/data/shortcuts.json b/data/shortcuts.json index e2b04c9fa..9b9f602f8 100644 --- a/data/shortcuts.json +++ b/data/shortcuts.json @@ -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" }, { diff --git a/dist/locales/en.json b/dist/locales/en.json index e821455f6..dacd734dd 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -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": { diff --git a/modules/renderer/tile_layer.js b/modules/renderer/tile_layer.js index 3c6ccd16c..ffc89a1c5 100644 --- a/modules/renderer/tile_layer.js +++ b/modules/renderer/tile_layer.js @@ -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') ); }); }); diff --git a/modules/ui/info.js b/modules/ui/info.js index 8f2b94fab..6f02ca501 100644 --- a/modules/ui/info.js +++ b/modules/ui/info.js @@ -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); }); diff --git a/modules/ui/panels/background.js b/modules/ui/panels/background.js index 3faea68ac..44725af1b 100644 --- a/modules/ui/panels/background.js +++ b/modules/ui/panels/background.js @@ -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; diff --git a/modules/ui/panels/history.js b/modules/ui/panels/history.js index 1682d77f7..a1c604d00 100644 --- a/modules/ui/panels/history.js +++ b/modules/ui/panels/history.js @@ -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; diff --git a/modules/ui/panels/location.js b/modules/ui/panels/location.js index d6180b078..a0051ab50 100644 --- a/modules/ui/panels/location.js +++ b/modules/ui/panels/location.js @@ -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; diff --git a/modules/ui/panels/measurement.js b/modules/ui/panels/measurement.js index 5dd13005b..3c9345a97 100644 --- a/modules/ui/panels/measurement.js +++ b/modules/ui/panels/measurement.js @@ -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;