[openstreetmap/openstreetmap-website] Shorten OSM.params and URLSearchParams (PR #5825)

Marwin Hochfelsner notifications at github.com
Wed Mar 19 19:28:35 UTC 2025


- Replaces `new URLSearchParams(location.search)` with `OSM.params()` when it yields more concise code.
  - All remaining URLSearchParams that aren't initialized empty or with an object use .toString().
- Adds `location.hash` as a default parameter for `OSM.parseHash`.
  - Moves the fallback for `OSM.params` to a default parameter too, which removes the check needed in #3571.

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5825

-- Commit Summary --

  * Shorten OSM.params and URLSearchParams

-- File Changes --

    M app/assets/javascripts/edit/id.js.erb (5)
    M app/assets/javascripts/heatmap.js (2)
    M app/assets/javascripts/index.js (8)
    M app/assets/javascripts/index/changeset.js (2)
    M app/assets/javascripts/index/directions.js (10)
    M app/assets/javascripts/index/history.js (6)
    M app/assets/javascripts/index/new_note.js (6)
    M app/assets/javascripts/index/note.js (2)
    M app/assets/javascripts/index/query.js (6)
    M app/assets/javascripts/index/search.js (10)
    M app/assets/javascripts/osm.js.erb (17)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5825.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5825.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5825
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5825 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250319/9ff47d48/attachment.htm>


More information about the rails-dev mailing list