112 Commits

Author SHA1 Message Date
Nick Doiron
6dcc73cf7c Add lang atttribute on multilingual names, wikidata/wikipedia fields (#10716)
This improves rendering of CJK names that contain unified ideographs that share a unicode codepoint, such as 化.
2025-01-31 13:49:49 +01:00
Martin Raifer
42f274f73f move reused regex to exported constant 2024-07-16 17:04:49 +02:00
Martin Raifer
43784e2eff take entity loc into account when resolving fields via parent preset, fixes #9524
this necessary when a regional preset (e.g. from NSI) is supposed to inherit fields from a parent preset, but the direct parent does NOT apply at the location of the entity to be added/edited. In that case we need to search for a potential regional variant of the parent preset.
2023-05-25 19:19:09 +02:00
archpdx
e466ad4bf8 Update dependencies country-coder and location-conflation (#9546) 2023-03-30 12:53:38 +02:00
Martin Raifer
f931d447af add length indicator to regular text (and localized) fields 2022-11-25 18:10:14 +01:00
Martin Raifer
ac77289b4d refactor localized text rendering in tooltips, flash messages 2022-06-23 18:55:57 +02:00
William Edmisten
67bd692bc0 Add multilingual field exceptions (#9124)
* Add multilingual field exceptions

* Add name:etymology

* Match language code in regex

* Restrict ISO 15924 code to 4 letters

* Allow country codes in name subkeys; match key case sensitively

Co-authored-by: Minh Nguyễn <mxn@1ec5.org>
2022-05-21 15:09:41 -07:00
Gabor Hodi
2ecce0e47e [Issue8871] Do not open disabled localized combobox when clicking on it 2022-01-23 18:51:14 +01:00
Martin Raifer
cc6f16d480 Merge branch 'develop' into accessible_ui 2021-12-07 16:22:01 +01:00
Martin Raifer
9f3f8e1366 rename method 2021-11-29 19:26:18 +01:00
Martin Raifer
d78c357588 replace raw html injection of localized texts
by using d3 to insert the localized text spans directly into the DOM
2021-11-26 18:51:45 +01:00
Milos Brzakovic (E-Search)
fcd8d920ba operation remove 2021-11-26 16:20:50 +01:00
Milos Brzakovic (E-Search)
1170f25ebf plus, add 2021-11-26 13:17:19 +01:00
Bryan Housel
90bbe38fe8 Remove the brand combo from the name field
This has caused problems going back a long time, and now that we have a validator
and very visible brand presets with logos, it's not necessary anymore.
(re: #5558, closes #8271, closes #8304)
2021-02-12 10:41:47 -05:00
Bryan Housel
96298f2836 Preserve name value if this preset shows brand or operator field
This also fixes the logic for calculating whether the preset shows a
`brand` or `operator` field - it needs to use `fields()` to actually
resolve the fields, as these fields can be inherited from another preset.

This also includes a change to match "primary" names before
"alternate" names (aka the "Baby Gap" / "Gap" problem)
2021-01-19 13:15:16 -05:00
Bryan Housel
4228b65602 Support more *:wikidata tags for field locking and pin styling 2021-01-18 17:18:37 -05:00
Quincy Morgan
40362f1d08 Fix issue with removing multilingual name entries 2020-12-04 11:59:51 -05:00
Quincy Morgan
0bc2b1b6a0 Improve multilingual name UI updates, don't use blank tag values (re: #8164) 2020-12-04 10:22:18 -05:00
Quincy Morgan
0bd2351d68 Don't remove multilingual name list items when deleting the name value (close #8164)
Allow removing multilingual name list items that don't have full values
2020-12-03 16:26:58 -05:00
Quincy Morgan
8147fcfa84 Show multilingual values in the Name field even for keys with spaces or other unexpected characters (re: #8165) 2020-11-06 17:38:09 -05:00
Quincy Morgan
1a43dbe1fe Use the actual dropdown label for the localized name language input label (re: #8165) 2020-11-06 17:36:32 -05:00
Quincy Morgan
baace6d092 Update more code for D3 v6 2020-10-07 11:57:25 -04:00
Quincy Morgan
21a49bbec8 Initial support for D3 v6.2.0 2020-10-06 15:08:39 -04:00
Quincy Morgan
3b793351f7 Fix issue where names with en dashes couldn't be added (close #7536)
Add `lang` attribute to brand name dropdown labels (re: #7963)
2020-09-28 15:28:07 -04:00
Quincy Morgan
9a8cae70d2 Fix lint errors 2020-09-24 11:35:38 -04:00
Quincy Morgan
4d51713253 Add lang attribute to more display text (re: #7963) 2020-09-24 11:34:33 -04:00
Quincy Morgan
9da4c4bb62 Add lang attribute to more labels (re: #7963) 2020-09-23 10:44:38 -04:00
Quincy Morgan
5435082d9c Revert t function to returning the plain string by default
Add `t.html` function for getting the string with the `lang` attribute
2020-09-22 12:03:29 -04:00
Quincy Morgan
a3549f9a76 Merge branch 'develop' into lang-attributes
# Conflicts:
#	modules/ui/commit_warnings.js
#	modules/ui/field.js
#	modules/ui/fields/wikidata.js
#	modules/ui/fields/wikipedia.js
#	modules/ui/full_screen.js
#	modules/ui/panels/history.js
#	modules/ui/sections/entity_issues.js
#	modules/ui/sections/map_features.js
#	modules/ui/sections/raw_member_editor.js
#	modules/ui/sections/validation_rules.js
#	modules/ui/tag_reference.js
2020-09-22 10:55:07 -04:00
Quincy Morgan
58014ace62 Don't prevent default tabbing to elements (re: #8004) 2020-09-17 12:07:20 -04:00
Quincy Morgan
32f8274929 Make t function return a span element with a lang attribute unless html: false is specified in the options (re: #7963)
Update `text` functions to `html` to support inserting the `span` elements
Specify `html: false` for various instances where a `span` is not desired, e.g. `placeholder` and `title` attributes
2020-09-15 21:56:22 -04:00
Peter Newman
4205ca1d07 Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.

(cherry picked from commit 2c47a11008)
2020-08-10 17:32:37 +01:00
Quincy Morgan
5f93da5a59 Add a reusable function for calculating the combined extent of multiple entities (re: #7706) 2020-06-16 13:17:43 -04:00
Quincy Morgan
4467c4a501 Fix issue where spaces couldn't be typed in the changeset comment (re: #6817) 2020-06-11 10:52:58 -04:00
Quincy Morgan
874c412b74 Enforce max unicode charachter length of keys, values, and relation roles through truncation upon input rather than HTML maxlength attribute (close #6817)
Normalize unicode when changing keys, values, and relation roles
2020-06-10 14:11:55 -04:00
Quincy Morgan
d01f1598d3 Show the delete button for filled multilingual name fields even if no name tag is present (close #7572)
Focus the language input when clicking a multilingual name field label instead of deleting the value
Be more lenient with `utilUniqueDomId` function input
2020-06-10 10:35:03 -04:00
Quincy Morgan
63aa47f02f Fix issue with entering language codes directly in multilingual name fields (close #7156) 2020-05-21 14:33:10 -04:00
Quincy Morgan
60f7dc7c0b Replace presets property of context with singleton
Remove utilPreset
2020-04-01 13:08:45 -07:00
Quincy Morgan
a1af118f0e Ensure locales and presets are loaded before the UI loads (close #7406)
Consolidate localization behavior and init to a coreLocalizer function and singleton
Explicitly support `en-US` locale
Rename coreData to coreFileFetcher and export a singleton rather than using a property of coreContext
Add `apiConnections` property of coreContext to simplify adding a source switcher
Replace some init functions with re-callable, promise-supporting `ensureLoaded` functions
Make coreContext itself load the UI if a container has been specified at init time
Fix code tests
2020-03-31 12:23:31 -07:00
Quincy Morgan
d62a62cba8 Make popover and tooltip part of the UI module instead of utils 2020-03-24 17:32:09 -07:00
Quincy Morgan
4872b06a28 Randomize form field ids to thwart browser memory and help with embedding iD (close #6444) 2020-03-21 13:16:40 -07:00
Bryan Housel
3608659d21 Restore field inheritance 2020-02-10 16:22:13 -05:00
Bryan Housel
4aa4686e7f Fix test failures in localized and suspicious_names 2020-02-03 12:38:17 -05:00
Quincy Morgan
8d9adbd902 Lock the name field if any of the selected features should be locked (re: #7306) 2020-01-31 11:23:42 -05:00
Quincy Morgan
b3262a71dc Use newlines instead of semicolons to separate mutliselection tag values in tooltips (re: #7306) 2020-01-31 10:49:31 -05:00
Quincy Morgan
15e9599ff7 Support editing the Name and Multilingual Name fields during multiselection 2020-01-30 17:09:19 -05:00
Quincy Morgan
1b331bb678 Add mechanism for fields to support editing during multiselection (re: #7276)
Add `utilCombinedTags` method and use it for the raw tag editor as well as fields
Pass `entityIDs` array into fields instead of single `entity` object
Give field revertion its own path separate from `change`
Add multiselection editing to fields in files: access, address, check, combo, cycleway, input, maxspeed, textarea, and wikidata
2020-01-30 13:53:29 -05:00
Bryan Housel
567eeac587 Make several data external instead of bundled:
Also dist/data/* contains minified files now

These are now external and will fetch as needed:
-export { dataAddressFormats } from './address-formats.json';
-export { dataDeprecated } from './deprecated.json';
-export { dataDiscarded } from './discarded.json';
-export { dataLanguages } from './languages.json';
-export { dataPhoneFormats } from './phone-formats.json';
-export { dataShortcuts } from './shortcuts.json';
-export { dataTerritoryLanguages } from './territory-languages.json';
2020-01-28 22:21:31 -05:00
Quincy Morgan
89ce98f510 Don't require services/osm in order to get max OSM character lengths 2020-01-28 09:28:23 -05:00
Quincy Morgan
17ae12b3d7 Address most common places where tag keys or values could exceed the 255 character API limit (close #6817) 2020-01-27 15:57:55 -05:00