mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-07 03:41:33 +00:00
move changes to svg display name
This commit is contained in:
@@ -7,8 +7,6 @@ import { geoExtent } from '../geo/index';
|
||||
import { osmEntity, osmNode, osmRelation, osmWay } from '../osm/index';
|
||||
import { utilDetect } from '../util/detect';
|
||||
import { utilRebind } from '../util/rebind';
|
||||
import { fixArabicScriptTextForSvg } from '../util/svg_paths_arabic_fix';
|
||||
|
||||
|
||||
var dispatch = d3.dispatch('authLoading', 'authDone', 'change', 'loading', 'loaded'),
|
||||
useHttps = window.location.protocol === 'https:',
|
||||
@@ -71,12 +69,7 @@ function getTags(obj) {
|
||||
var attrs = elems[i].attributes;
|
||||
tags[attrs.k.value] = attrs.v.value;
|
||||
}
|
||||
var isFirefox = utilDetect().browser.toLowerCase().indexOf('firefox') > -1
|
||||
var arabicRegex = /[\u0600-\u06FF]/g
|
||||
if(tags.name && tags.highway && !isFirefox && arabicRegex.test(tags.name)){
|
||||
tags.real_name = tags.name;
|
||||
tags.name = fixArabicScriptTextForSvg(tags.real_name);
|
||||
}
|
||||
|
||||
return tags;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ import { uiRawTagEditor } from './raw_tag_editor';
|
||||
import { uiTagReference } from './tag_reference';
|
||||
import { uiPreset } from './preset';
|
||||
import { utilRebind } from '../util/rebind';
|
||||
import { fixArabicScriptTextForSvg } from '../util/svg_paths_arabic_fix';
|
||||
|
||||
|
||||
export function uiEntityEditor(context) {
|
||||
var dispatch = d3.dispatch('choose'),
|
||||
@@ -225,14 +223,6 @@ export function uiEntityEditor(context) {
|
||||
tags[k] = v;
|
||||
}
|
||||
});
|
||||
var arabicRegex = /[\u0600-\u06FF]/g
|
||||
if(tags.highway && tags.real_name){
|
||||
if(arabicRegex.test(tags.real_name)){
|
||||
tags.name = fixArabicScriptTextForSvg(tags.real_name);
|
||||
} else{
|
||||
tags.name = tags.real_name;
|
||||
}
|
||||
}
|
||||
|
||||
if (!onInput) {
|
||||
tags = clean(tags);
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as d3 from 'd3';
|
||||
import { t, textDirection } from './locale';
|
||||
import { utilDetect } from './detect';
|
||||
import { remove as removeDiacritics } from 'diacritics';
|
||||
|
||||
import { fixArabicScriptTextForSvg } from '../util/svg_paths_arabic_fix';
|
||||
|
||||
export function utilTagText(entity) {
|
||||
return d3.entries(entity.tags).map(function(e) {
|
||||
@@ -66,6 +66,13 @@ export function utilDisplayName(entity) {
|
||||
name = network + ' ' + name;
|
||||
}
|
||||
}
|
||||
|
||||
var isFirefox = utilDetect().browser.toLowerCase().indexOf('firefox') > -1
|
||||
var arabicRegex = /[\u0600-\u06FF]/g
|
||||
if(!isFirefox && name && entity.tags.highway && arabicRegex.test(name)){
|
||||
name = fixArabicScriptTextForSvg(name);
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user