* Field: fix wikiURL by URL encoding it - and slight refactors
* Field: fix wikiURL only encodeURIComponent instead of redundant full URL
* Field: refactors function to generate wikiURL, ensures anchor part is also URI encoded, ensures the anchor ref is not encoded, adds unit tests
* Field: refactors wikipedia URI encoding of the anchor logic, removes legacy anchorencode effort via try-catch that replaced percentage character with dots, adds unit further tests, reduces exessive inlining
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
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
This also includes a bunch of tweaks to make the tests work
in both PhantomJS and modern browsers like Chrome.
Basically - introduce some more async into the test code so that
the coreData.get promise is guaranteed to settle. Because in
PhantomJS the promise is polyfilled, and Chrome it's native, they
work slightly differently.
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';
- Many text expects are now wrapped in setTimeout, as the fetch
promises settle async now.
- This makes the tests somewhat brittle, and we should maybe consider
reworking some of them. For example it is very hard to perform
a test like `expect(spy).to.have.not.been.called` in an async way.
(We could instead inspect the fakeServer requests() to know this.)
- Also includes some trickery for osm.js, which uses d3-xml (fetch)
now for unauthenticated calls and osmauth (xhr) for authenticated calls
1. All services are disabled in testing now to prevent network accesses
2. Only services are enabled when needed to test something
3. Many changes throughout code to allow iD to run with services disabled
(e.g. check for osm service instead of assuming context.connection() will work)
4. Actually export the services so we can disable and enable them