Commit Graph

67 Commits

Author SHA1 Message Date
Kushan Joshi 6ef52256f3 Migrating to lodash v4 2016-05-17 12:37:25 +05:30
Bryan Housel 649ba856f6 Preset.isFallback() should return true for the area: yes preset 2016-01-29 00:38:33 -05:00
Gautier Pelloux-Prayer 79b4c37733 preset.js: trim terms when retrieving translations to avoid white spaces 2015-09-14 19:15:59 +02:00
M1dgard 209b324bc2 Fix "terms" translations (closes #2756)
Make them lowercase and split them on any combination of commas and whitespace.
2015-09-05 10:28:06 +02:00
Bryan Housel 1db51501a5 switch jshint to eslint (closes #2733) 2015-08-23 03:14:20 -04:00
Bryan Housel 845999558f Preset searching should consider tag values (closes #2719) 2015-07-01 13:20:23 -04:00
Bryan Housel 99d037e97f Better logic for adding area=yes (closes #2578)
This fixes a few issues:

1. before: checked first key in applyTags and break loop, now: check all of them
(this was what caused `area=yes` to be added to 'branded' presets:
the first key is for these is `name` which isn't in areaKeys.)

2. add `area=yes` if user is drawing an area but the preset can be an
area or a line (e.g. `barrier=city_wall`)

3. remove `area=yes` when switching to another preset
2015-04-22 17:04:18 -04:00
John Firebaugh 419d5f359f field.geometry is a string, not an array 2014-05-18 16:02:46 -07:00
John Firebaugh a6a6cd77f9 Placate jshint 2014-01-03 12:51:33 -08:00
John Firebaugh d381812f96 Add area=yes when necessary
Example: highway=pedestrian areas.

Fixes #2069
2014-01-03 12:46:50 -08:00
Aaron Lidman db5ad5223a Put searchable and suggestions back in
Tests were not happy and I’m not going to dive into it right now.
Benchmarked it and it’s pretty quick, no big deal.
2013-11-22 12:58:49 -08:00
Aaron Lidman da7834ab7e Split suggestion presets into their own search results
Allows for refinement of just the suggestions without impacting all the
presets. Also moved searchable.
2013-11-22 12:33:29 -08:00
Aaron Lidman ea7c9f2224 Prevent name descriptions from matching in preset search 2013-11-21 18:36:39 -08:00
Aaron Lidman d034370cdb Add translatable value category to suggestion preset names 2013-11-21 13:36:13 -08:00
Aaron Lidman 7875aad238 Convert suggestions into presets 2013-11-20 15:45:27 -08:00
Aaron Lidman 181f557a60 Limit search results to top 50 2013-11-20 15:41:20 -08:00
John Firebaugh d1b4e04ee4 Don't add addr:housenumber=yes when applying Address preset (#1874) 2013-10-09 16:35:12 -07:00
John Firebaugh 161a4e24a6 Parallelism 2013-09-30 10:37:59 -07:00
Minh Nguyễn 77c7091cf2 Show relation documentation for relation presets
See http://taginfo.openstreetmap.org/taginfo/apidoc#api_4_relation_wiki_pages

Fixes #1862.
2013-09-30 10:35:00 -07:00
John Firebaugh 6cdd928ea3 Default wildcard tags to "yes"
Fixes #1715
2013-08-22 14:30:27 -07:00
John Firebaugh 4bdd49b5fc Adjustments to multipolygon preset
* It shouldn't appear as a search result for simple areas.
* Changing to another area preset shouldn't remove the
  type=multipolygon tag.
* It shouldn't be preferred to the Building preset, which
  matches with score 0.5.

Fixes #1546.
2013-05-29 16:00:34 -07:00
John Firebaugh 9b6b198b3f Don't modify input in place 2013-05-28 17:41:36 -07:00
John Firebaugh e913d564d9 Fix field placeholders 2013-05-28 11:29:31 -07:00
John Firebaugh 182849cbe6 Make preset field placeholders translatable 2013-05-28 11:07:36 -07:00
John Firebaugh a61e0c9fd4 Fix preset search 2013-05-24 17:17:41 -07:00
John Firebaugh 5868875833 Split "other" preset into geometry specific fallbacks
This way the name and icon can be geometry-specific.
2013-05-24 11:14:59 -07:00
John Firebaugh 9e4e794300 Rewrite PresetGrid 2013-05-22 10:22:15 -07:00
John Firebaugh 9502729f5e Optimize presets.match
Previous implementation was linear in the number of
presets. This should be near constant time.
2013-05-13 21:07:26 -07:00
John Firebaugh 525d37c647 Preset#matchTags -> Preset#matchScore 2013-05-13 17:48:18 -07:00
John Firebaugh fdd49233b1 Avoid recomputing geometry in an inner loop 2013-04-25 11:27:53 -07:00
John Firebaugh 19bcd711ec Split categories into separate files; translate 2013-04-15 16:09:49 -07:00
Ansis Brammanis 8c319d0d15 make other presets localizable, and update tests 2013-03-26 16:40:42 -04:00
John Firebaugh 55108a21c8 Fix preset search 2013-03-20 15:56:03 -07:00
John Firebaugh f7652b8858 Remove unused 2013-03-19 15:01:04 -07:00
John Firebaugh 2fc4f041d7 Make preset search terms localizable (fixes #1043) 2013-03-18 16:08:30 -07:00
Ansis Brammanis 0e72dced55 preset search tweaks
prioritize earlier leading name matches
Parking over Bicycle Parking

prioritize shorter matched names
Park over Parking
2013-03-18 16:29:20 -04:00
Ansis Brammanis ae98cd92ae when matching presets, count 'area' match as half 2013-03-18 16:13:59 -04:00
John Firebaugh 7912b33b4c Exclude presets with searchable: false from search (fixes #932) 2013-03-17 20:59:11 -07:00
Ansis Brammanis a18f6f4116 Fix unintentional case sensitivity in preset search 2013-03-15 10:53:33 -04:00
John Firebaugh b840b7e118 Update translations 2013-03-14 17:58:32 -07:00
John Firebaugh d0336a0995 Extract preset names to translations (fixes #1044) 2013-03-14 17:27:34 -07:00
Ansis Brammanis 547f12f822 Fields now have an optional geometry type
field defaults aren't geometry specific
the geometry type determines whether
that field (and default value) apply
to an entity
2013-03-14 16:48:09 -04:00
John Firebaugh 51a217caa2 Refine tagged vertex rendering
Don't render tagged vertices for which we don't have
an icon as the 'marker' icon. Marker shape is for points.
2013-03-14 13:35:24 -07:00
John Firebaugh 41e696a2c5 Flatten presets match properties 2013-03-13 12:45:20 -07:00
John Firebaugh c1aa8e0270 form/forms -> field/fields 2013-03-13 11:34:21 -07:00
John Firebaugh 8509d9f620 Remove inline forms
No good way to give them IDs; better to be consistent.
2013-03-12 17:19:11 -07:00
Ansis Brammanis ca1a7cf7f6 add ability to add general form fields 2013-03-12 17:42:55 -04:00
John Firebaugh 107f6cfeba type -> geometry 2013-03-12 13:00:32 -07:00
John Firebaugh 42be94c97f Localize address placeholders 2013-03-12 11:19:45 -07:00
John Firebaugh a5885ce3c2 Localize preset form labels 2013-03-12 11:19:45 -07:00