mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-30 19:59:35 +02:00
Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.
(cherry picked from commit 2c47a11008)
This commit is contained in:
@@ -40,7 +40,7 @@ export function actionCircularize(wayId, projection, maxAngle) {
|
||||
var sign = d3_polygonArea(points) > 0 ? 1 : -1;
|
||||
var ids, i, j, k;
|
||||
|
||||
// we need atleast two key nodes for the algorithm to work
|
||||
// we need at least two key nodes for the algorithm to work
|
||||
if (!keyNodes.length) {
|
||||
keyNodes = [nodes[0]];
|
||||
keyPoints = [points[0]];
|
||||
@@ -55,8 +55,8 @@ export function actionCircularize(wayId, projection, maxAngle) {
|
||||
}
|
||||
|
||||
// key points and nodes are those connected to the ways,
|
||||
// they are projected onto the circle, inbetween nodes are moved
|
||||
// to constant intervals between key nodes, extra inbetween nodes are
|
||||
// they are projected onto the circle, in between nodes are moved
|
||||
// to constant intervals between key nodes, extra in between nodes are
|
||||
// added if necessary.
|
||||
for (i = 0; i < keyPoints.length; i++) {
|
||||
var nextKeyNodeIndex = (i + 1) % keyNodes.length;
|
||||
@@ -119,7 +119,7 @@ export function actionCircularize(wayId, projection, maxAngle) {
|
||||
graph = graph.replace(node);
|
||||
}
|
||||
|
||||
// add new inbetween nodes if necessary
|
||||
// add new in between nodes if necessary
|
||||
for (j = 0; j < numberNewPoints; j++) {
|
||||
angle = startAngle + (indexRange + j) * eachAngle;
|
||||
loc = projection.invert([
|
||||
@@ -147,7 +147,7 @@ export function actionCircularize(wayId, projection, maxAngle) {
|
||||
|
||||
// Check for other ways that share these keyNodes..
|
||||
// If keyNodes are adjacent in both ways,
|
||||
// we can add inBetween nodes to that shared way too..
|
||||
// we can add inBetweenNodes to that shared way too..
|
||||
if (indexRange === 1 && inBetweenNodes.length) {
|
||||
var startIndex1 = way.nodes.lastIndexOf(startNode.id);
|
||||
var endIndex1 = way.nodes.lastIndexOf(endNode.id);
|
||||
|
||||
@@ -13,7 +13,7 @@ export function actionDeleteMultiple(ids) {
|
||||
|
||||
var action = function(graph) {
|
||||
ids.forEach(function(id) {
|
||||
if (graph.hasEntity(id)) { // It may have been deleted aready.
|
||||
if (graph.hasEntity(id)) { // It may have been deleted already.
|
||||
graph = actions[graph.entity(id).type](id)(graph);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { osmNode } from '../osm/node';
|
||||
|
||||
|
||||
// Disconect the ways at the given node.
|
||||
// Disconnect the ways at the given node.
|
||||
//
|
||||
// Optionally, disconnect only the given ways.
|
||||
//
|
||||
|
||||
@@ -167,7 +167,7 @@ export function behaviorDrawWay(context, wayID, mode, startGraph) {
|
||||
if (includeDrawNode) {
|
||||
if (parentWay.isClosed()) {
|
||||
// don't test the last segment for closed ways - #4655
|
||||
// (still test the first segement)
|
||||
// (still test the first segment)
|
||||
nodes.pop();
|
||||
}
|
||||
} else { // discount the draw node
|
||||
|
||||
@@ -156,7 +156,7 @@ export function behaviorHash(context) {
|
||||
var maxdist = 500;
|
||||
|
||||
// Don't allow the hash location to change too much while drawing
|
||||
// This can happen if the user accidently hit the back button. #3996
|
||||
// This can happen if the user accidentally hit the back button. #3996
|
||||
if (mode && mode.id.match(/^draw/) !== null && dist > maxdist) {
|
||||
context.enter(modeBrowse(context));
|
||||
return;
|
||||
|
||||
@@ -75,7 +75,7 @@ export function coreLocalizer() {
|
||||
if (_loadPromise) return _loadPromise;
|
||||
|
||||
return _loadPromise = Promise.all([
|
||||
// load the list of langauges
|
||||
// load the list of languages
|
||||
fileFetcher.get('languages'),
|
||||
// load the list of supported locales
|
||||
fileFetcher.get('locales')
|
||||
@@ -245,7 +245,7 @@ export function coreLocalizer() {
|
||||
|
||||
localizer.languageName = (code, options) => {
|
||||
|
||||
if (_languageNames[code]) { // name in locale langauge
|
||||
if (_languageNames[code]) { // name in locale language
|
||||
// e.g. "German"
|
||||
return _languageNames[code];
|
||||
}
|
||||
@@ -260,9 +260,9 @@ export function coreLocalizer() {
|
||||
return localizer.t('translate.language_and_code', { language: langInfo.nativeName, code: code });
|
||||
|
||||
} else if (langInfo.base && langInfo.script) {
|
||||
const base = langInfo.base; // the code of the langauge this is based on
|
||||
const base = langInfo.base; // the code of the language this is based on
|
||||
|
||||
if (_languageNames[base]) { // base language name in locale langauge
|
||||
if (_languageNames[base]) { // base language name in locale language
|
||||
const scriptCode = langInfo.script;
|
||||
const script = _scriptNames[scriptCode] || scriptCode;
|
||||
// e.g. "Serbian (Cyrillic)"
|
||||
|
||||
@@ -26,7 +26,7 @@ export function coreTree(head) {
|
||||
|
||||
function segmentBBox(segment) {
|
||||
var extent = segment.extent(head);
|
||||
// extent can be null if the node entites aren't in the graph for some reason
|
||||
// extent can be null if the node entities aren't in the graph for some reason
|
||||
if (!extent) return null;
|
||||
|
||||
var bbox = extent.bbox();
|
||||
|
||||
@@ -413,7 +413,7 @@ export function coreValidator(context) {
|
||||
.on('redone.validator', validator.validate); // redo
|
||||
// but not on 'change' (e.g. while drawing)
|
||||
|
||||
// When user chages editing modes:
|
||||
// When user changes editing modes:
|
||||
context
|
||||
.on('exit.validator', validator.validate);
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ export function modeDragNode(context) {
|
||||
for (k = 0; k < rings.length; k++) {
|
||||
if (k === activeIndex) continue;
|
||||
|
||||
// make sure active ring doesnt cross passive rings
|
||||
// make sure active ring doesn't cross passive rings
|
||||
if (geoHasLineIntersections(rings[activeIndex].nodes, rings[k].nodes, entity.id)) {
|
||||
return 'multipolygonRing';
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export function modeSelect(context, selectedIDs) {
|
||||
for (var i = 0; i < selectedIDs.length; i++) {
|
||||
var entity = context.hasEntity(selectedIDs[i]);
|
||||
if (!entity || entity.geometry(graph) !== 'vertex') {
|
||||
return []; // selection includes some not vertexes
|
||||
return []; // selection includes some not vertices
|
||||
}
|
||||
|
||||
var currParents = graph.parentWays(entity).map(function(w) { return w.id; });
|
||||
|
||||
@@ -20,7 +20,7 @@ export class QAItem {
|
||||
}
|
||||
|
||||
update(props) {
|
||||
// You can't override this inital information
|
||||
// You can't override this initial information
|
||||
const { loc, service, itemType, id } = this;
|
||||
|
||||
Object.keys(props).forEach(prop => this[prop] = props[prop]);
|
||||
|
||||
@@ -91,7 +91,7 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) {
|
||||
if (_this.suggestion) {
|
||||
let path = presetID.split('/');
|
||||
path.pop(); // remove brand name
|
||||
// NOTE: insert an en-dash, not a hypen (to avoid conflict with fr - nl names in Brussels etc)
|
||||
// NOTE: insert an en-dash, not a hyphen (to avoid conflict with fr - nl names in Brussels etc)
|
||||
return _this.originalName + ' – ' + t('presets.presets.' + path.join('/') + '.name');
|
||||
}
|
||||
return _this.t('name', { 'default': _this.originalName });
|
||||
|
||||
@@ -500,7 +500,7 @@ export function rendererMap(context) {
|
||||
);
|
||||
|
||||
// On Firefox Windows and Linux we always get +/- the scroll line amount (default 3)
|
||||
// There doesn't seem to be any scroll accelleration.
|
||||
// There doesn't seem to be any scroll acceleration.
|
||||
// This multiplier increases the speed a little bit - #5512
|
||||
if (detected.os !== 'mac') {
|
||||
dY *= 5;
|
||||
|
||||
@@ -104,7 +104,7 @@ function cardinalDirection(bearing) {
|
||||
return t(`QA.improveOSM.directions.${compass[dir]}`);
|
||||
}
|
||||
|
||||
// Errors shouldn't obscure eachother
|
||||
// Errors shouldn't obscure each other
|
||||
function preventCoincident(loc, bumpUp) {
|
||||
let coincident = false;
|
||||
do {
|
||||
|
||||
@@ -518,7 +518,7 @@ export default {
|
||||
//
|
||||
// There is some logic here to batch up clicks into a _mlyClicks array
|
||||
// because the user might click on a lot of markers quickly and nodechanged
|
||||
// may be called out of order asychronously.
|
||||
// may be called out of order asynchronously.
|
||||
//
|
||||
// Clicks are added to the array in `selectedImage` and removed here.
|
||||
//
|
||||
|
||||
@@ -949,7 +949,7 @@ export default {
|
||||
// Calls `status` and dispatches an `apiStatusChange` event if the returned
|
||||
// status differs from the cached status.
|
||||
reloadApiStatus: function() {
|
||||
// throttle to avoid unncessary API calls
|
||||
// throttle to avoid unnecessary API calls
|
||||
if (!this.throttledReloadApiStatus) {
|
||||
var that = this;
|
||||
this.throttledReloadApiStatus = _throttle(function() {
|
||||
|
||||
@@ -49,7 +49,7 @@ function updateRtree(item, replace) {
|
||||
}
|
||||
}
|
||||
|
||||
// Issues shouldn't obscure eachother
|
||||
// Issues shouldn't obscure each other
|
||||
function preventCoincident(loc) {
|
||||
let coincident = false;
|
||||
do {
|
||||
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
type: 'item',
|
||||
// the language to search
|
||||
language: lang,
|
||||
// the langauge for the label and description in the result
|
||||
// the language for the label and description in the result
|
||||
uselang: lang,
|
||||
limit: 10,
|
||||
origin: '*'
|
||||
|
||||
@@ -262,7 +262,7 @@ export function svgStreetside(projection, context, dispatch) {
|
||||
|
||||
/**
|
||||
* drawImages()
|
||||
* drawImages is the method that is returned (and that runs) everytime 'svgStreetside()' is called.
|
||||
* drawImages is the method that is returned (and that runs) every time 'svgStreetside()' is called.
|
||||
* 'svgStreetside()' is called from index.js
|
||||
*/
|
||||
function drawImages(selection) {
|
||||
|
||||
@@ -304,7 +304,7 @@ export function svgVertices(projection, context) {
|
||||
|
||||
function addChildVertices(entity) {
|
||||
|
||||
// avoid redunant work and infinite recursion of circular relations
|
||||
// avoid redundant work and infinite recursion of circular relations
|
||||
if (seenIds[entity.id]) return;
|
||||
seenIds[entity.id] = true;
|
||||
|
||||
@@ -368,7 +368,7 @@ export function svgVertices(projection, context) {
|
||||
}
|
||||
|
||||
// Collect important vertices from the `entities` list..
|
||||
// (during a paritial redraw, it will not contain everything)
|
||||
// (during a partial redraw, it will not contain everything)
|
||||
for (var i = 0; i < entities.length; i++) {
|
||||
var entity = entities[i];
|
||||
var geometry = entity.geometry(graph);
|
||||
|
||||
@@ -304,7 +304,7 @@ export function uiFieldLocalized(field, context) {
|
||||
}
|
||||
|
||||
// Remove whatever is after the last ' – '
|
||||
// NOTE: split/join on en-dash, not a hypen (to avoid conflict with fr - nl names in Brussels etc)
|
||||
// NOTE: split/join on en-dash, not a hyphen (to avoid conflict with fr - nl names in Brussels etc)
|
||||
function cleanName(name) {
|
||||
var parts = name.split(' – ');
|
||||
if (parts.length > 1) {
|
||||
|
||||
@@ -65,7 +65,7 @@ export function uiOsmoseDetails(context) {
|
||||
.append('div')
|
||||
.attr('class', 'qa-details-subsection');
|
||||
|
||||
// Suggested Fix (musn't exist for every issue type)
|
||||
// Suggested Fix (mustn't exist for every issue type)
|
||||
if (issueString(_qaItem, 'fix')) {
|
||||
const div = detailsEnter
|
||||
.append('div')
|
||||
@@ -83,7 +83,7 @@ export function uiOsmoseDetails(context) {
|
||||
.attr('target', '_blank');
|
||||
}
|
||||
|
||||
// Common Pitfalls (musn't exist for every issue type)
|
||||
// Common Pitfalls (mustn't exist for every issue type)
|
||||
if (issueString(_qaItem, 'trap')) {
|
||||
const div = detailsEnter
|
||||
.append('div')
|
||||
|
||||
@@ -128,7 +128,7 @@ export function uiPanelBackground(context) {
|
||||
.selectAll('.background-info-span-vintage')
|
||||
.text(metadata.vintage);
|
||||
|
||||
// update other metdata
|
||||
// update other metadata
|
||||
metadataKeys.forEach(function(k) {
|
||||
if (k === 'zoom' || k === 'vintage') return; // done already
|
||||
var val = result[k];
|
||||
|
||||
@@ -386,7 +386,7 @@ export function uiPresetList(context) {
|
||||
.append('div')
|
||||
.attr('class', 'label-inner');
|
||||
|
||||
// NOTE: split/join on en-dash, not a hypen (to avoid conflict with fr - nl names in Brussels etc)
|
||||
// NOTE: split/join on en-dash, not a hyphen (to avoid conflict with fr - nl names in Brussels etc)
|
||||
label.selectAll('.namepart')
|
||||
.data(preset.name().split(' – '))
|
||||
.enter()
|
||||
|
||||
@@ -95,7 +95,7 @@ export function uiSectionFeatureType(context) {
|
||||
.preset(_presets.length === 1 ? _presets[0] : presetManager.item('point'))
|
||||
);
|
||||
|
||||
// NOTE: split on en-dash, not a hypen (to avoid conflict with hyphenated names)
|
||||
// NOTE: split on en-dash, not a hyphen (to avoid conflict with hyphenated names)
|
||||
var names = _presets.length === 1 ? _presets[0].name().split(' – ') : [t('inspector.multiple_types')];
|
||||
|
||||
var label = selection.select('.label-inner');
|
||||
|
||||
@@ -74,7 +74,7 @@ export function uiSectionRawMembershipEditor(context) {
|
||||
|
||||
|
||||
function changeRole(d) {
|
||||
if (d === 0) return; // called on newrow (shoudn't happen)
|
||||
if (d === 0) return; // called on newrow (shouldn't happen)
|
||||
if (_inChange) return; // avoid accidental recursive call #5731
|
||||
|
||||
var oldRole = d.member.role;
|
||||
@@ -118,7 +118,7 @@ export function uiSectionRawMembershipEditor(context) {
|
||||
|
||||
function deleteMembership(d) {
|
||||
this.blur(); // avoid keeping focus on the button
|
||||
if (d === 0) return; // called on newrow (shoudn't happen)
|
||||
if (d === 0) return; // called on newrow (shouldn't happen)
|
||||
|
||||
// remove the hover-highlight styling
|
||||
utilHighlightEntities([d.relation.id], false, context);
|
||||
|
||||
@@ -170,11 +170,11 @@ export function validationAlmostJunction(context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let occurences = 0;
|
||||
let occurrences = 0;
|
||||
for (const index in way.nodes) {
|
||||
if (way.nodes[index] === node.id) {
|
||||
occurences += 1;
|
||||
if (occurences > 1) {
|
||||
occurrences += 1;
|
||||
if (occurrences > 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,12 +453,12 @@ export function validationCrossingWays(context) {
|
||||
} else if (context.graph().geometry(this.entityIds[0]) === 'line' &&
|
||||
context.graph().geometry(this.entityIds[1]) === 'line') {
|
||||
|
||||
// don't recommend adding bridges to waterways since they're uncommmon
|
||||
// don't recommend adding bridges to waterways since they're uncommon
|
||||
if (allowsBridge(selectedFeatureType) && selectedFeatureType !== 'waterway') {
|
||||
fixes.push(makeAddBridgeOrTunnelFix('add_a_bridge', 'temaki-bridge', 'bridge'));
|
||||
}
|
||||
|
||||
// don't recommend adding tunnels under waterways since they're uncommmon
|
||||
// don't recommend adding tunnels under waterways since they're uncommon
|
||||
var skipTunnelFix = otherFeatureType === 'waterway' && selectedFeatureType !== 'waterway';
|
||||
if (allowsTunnel(selectedFeatureType) && !skipTunnelFix) {
|
||||
fixes.push(makeAddBridgeOrTunnelFix('add_a_tunnel', 'temaki-tunnel', 'tunnel'));
|
||||
|
||||
@@ -46,11 +46,11 @@ export function validationImpossibleOneway() {
|
||||
}
|
||||
|
||||
function nodeOccursMoreThanOnce(way, nodeID) {
|
||||
var occurences = 0;
|
||||
var occurrences = 0;
|
||||
for (var index in way.nodes) {
|
||||
if (way.nodes[index] === nodeID) {
|
||||
occurences += 1;
|
||||
if (occurences > 1) return true;
|
||||
occurrences += 1;
|
||||
if (occurrences > 1) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user