71 Commits

Author SHA1 Message Date
Martin Raifer
96e6dc124f Show message about how to support OSM after a successful save, closes #10054
for example in form of a donation

this can be disabled by setting an env variable (`ID_SHOW_DONATION_MESSAGE=false`)

the icon is from https://uxwing.com/charity-donation-hand-love-icon/
2024-02-24 12:48:35 +01:00
Bryan Housel
2b2a71f597 Don't pre-resolve and index complex locationSets into GeoJSON.
This was taking a lot of time at app startup.

Instad now we resolve and index only the include and exclude parts.
We can still determine the valid locationSets at runtime in `locationSetsAt()`
by checking the `_locationIncludedIn` and `_locationExcludedIn` caches.

This also upgrades the locationManger to an ES6 class.

This also includes some hacky code in nsi.js so that the NSI will continue to work.
The NSI matcher can build its own location index, but it doesn't need to do this.
We monkeypatch a few of the matcher collections to work with the new LocationManager.
2022-10-28 10:49:01 -04:00
Martin Raifer
6626ea0682 refactor panels to not inject html 2022-06-24 12:19:17 +02:00
CommanderRoot
76738daff8 Replace deprecated String.prototype.substr() (#8988)
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-06-06 16:16:38 +02:00
Martin Raifer
cc6f16d480 Merge branch 'develop' into accessible_ui 2021-12-07 16:22:01 +01:00
Milos Brzakovic (E-Search)
30ef0b80e1 headings - more appropriate h2's and disclosure h3 2021-12-01 18:17:19 +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
Martin Raifer
ca0b131542 fix html formatting 2021-11-26 18:48:56 +01:00
Milos Brzakovic (E-Search)
4db3e720c0 close icon button 2021-11-26 12:25:12 +01:00
Martin Raifer
040257fd44 replace unnecessary setting of raw "html" with "text" 2021-11-18 18:53:33 +01:00
Milos Brzakovic
c8aedcbb79 minor trailing spaces 2021-08-05 18:36:25 +02:00
Milos Brzakovic (E-Search)
d2036996e3 Merge conflicts resolved 2021-07-05 10:26:44 +02:00
Bryan Housel
b47952b369 Move the complicated linkification code from iD to resolveStrings
It's easier to insert the links there, and then the HTML strings are availble for anyone who wants them
2021-04-30 11:26:24 -04:00
Bryan Housel
25bf950458 Upgrade to osm-community-index (oci) v4
The main differences here is:
- oci now supports default strings and exports a "resolveStrings" function
- this makes linkifying any urls embedded in descriptions a bit more complicated
  because urls and descriptions might need resolution, we can't use iD's normal
  t() function to do the token replacement like before
2021-04-29 17:53:53 -04:00
Bryan Housel
868db8819f Have mergeLocationSets work on Objects, add locationSetID property
This means less work for the other parts of the code,
now they don't need to chain that extra step after the promise.
2021-01-09 10:34:58 -05:00
Bryan Housel
c4daf1b377 Use locationManager to resolve/query community index 2021-01-08 17:05:37 -05:00
Bryan Housel
9e93701c58 Update osm-community-index to v3.0.1
The major version bump is because
- it no longer distributes index.js/index.mjs code bundles
   (which iD hasn't needed in a long time anyway)
- renamed dist/features.json -> dist/featureCollection.json
2020-12-16 09:25:11 -05:00
Quincy Morgan
42fd0a8ea8 Followup to #8067 2020-10-09 08:58:51 -04:00
Quincy Morgan
b92f0a6d09 Fix styling issue in panels
Add lang attribute to more text (re: #7963)
2020-09-22 15:11:12 -04:00
Quincy Morgan
f2c150e83e Rename several title properties to label and pass in attributed HTML instead of string 2020-09-22 13:15:19 -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
Quincy Morgan
3d4703b60c Fix various CSS issues 2020-07-06 15:28:25 -04: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
0b1ce05f35 Fix JS error when loading post-save community resources 2020-02-25 11:15:05 -08:00
Bryan Housel
fb4d658860 Don't bundle the community index anymore, fetch from CDN instead
Start fetching and preparing it just before the changeset gets sent
2020-01-29 15:24:26 -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
Bryan Housel
2a2668b01b Can't use ES6 fat-arrow functions with arguments
see buble bug https://github.com/bublejs/buble/issues/208
2020-01-24 17:22:03 -05:00
Bryan Housel
a45b4133c5 indent 2020-01-16 10:37:24 -05:00
Bryan Housel
1c998d186a Correctly gather the community index resources
- old code assumed that each resource had a link back to a single geojson featureId
- this isn't the case anymore so we need to link them in data/index.js
2020-01-16 10:06:35 -05:00
Bryan Housel
7391266aa7 ES6-ify success.js 2020-01-15 18:27:45 -05:00
Bryan Housel
7959891a8b Switch from hardcoded community rank to resource.order
The next version of the community index will include the `order` property
(re: #6752, osmlab/osm-community-index#114)
2019-08-27 10:14:09 -04:00
Quincy Morgan
c28f0437e5 Make the successfully uploaded changeset number clickable (close #6644) 2019-08-08 15:03:28 -05:00
Quincy Morgan
e37948fe9a Use CLDR for a translated language list in the localized name field instead of untranslated wmf site matrix (close #2457)
Translate language names in the community index list (close #4990)
2019-07-31 13:47:53 -04:00
Quincy Morgan
ca19d50558 Fix issue where duplicate expanded community entries could appear (close #6422) 2019-05-23 17:02:15 -04:00
Quincy Morgan
d01bb78707 Reduce circular dependencies caused by importing from indexes, the location of the validation models, and the location of areaKeys (close #6237) 2019-04-24 13:45:59 -07:00
Bryan Housel
710966801f Make sure community index filters on value array, not object
(closes #6092)

This is breakage related to #6087 in replacing lodash `_.filter`
(which can iterate (v,k) over an object) with `Array.filter`
2019-03-27 09:34:38 -04:00
Bryan Housel
76e0d13729 Remove lodash every and filter
(re: #6087)
2019-03-23 01:22:56 -04:00
Bryan Housel
470835b38f Extract all graphics from iD sprite, reassemble with svg-sprite
All iD sprite graphics are now prefixed with `iD-`
Also includes support for sending the preset logos to taginfo
2018-06-08 16:06:46 -04:00
Bryan Housel
672d3dfa5b Make date parsing from community index more consistent
(closes #5011)
2018-05-12 10:41:58 -04:00
Bryan Housel
a86167f0d1 Linkify subreddit in community description
(closes #4997)
2018-04-18 17:10:54 -04:00
Bryan Housel
eaa96ce0ae Fix for empty array when querying for local community geometries 2018-04-16 15:40:41 -04:00
Bryan Housel
f0d8583f74 Adjust sort weight by community type 2018-04-09 09:20:55 -04:00
Bryan Housel
514ddffd22 Add link to report missing info in the community list 2018-04-08 23:41:51 -04:00
Bryan Housel
c35b4906fd Add support for translated i18n events 2018-04-08 22:23:26 -04:00
Bryan Housel
cab78c2c6b Add notification badge for events, default disclosures to closed 2018-04-08 21:55:36 -04:00
Bryan Housel
cd2d42799e Show events 2018-04-08 21:23:05 -04:00