X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/3e7bc943fe03dcd74666b6f26b3a831e06cac1d8..66656e1d1d58e6073efd453007d7452920531b37:/app/assets/javascripts/edit/id.js.erb?ds=sidebyside diff --git a/app/assets/javascripts/edit/id.js.erb b/app/assets/javascripts/edit/id.js.erb index 2ce8974f5..6a68b6b2d 100644 --- a/app/assets/javascripts/edit/id.js.erb +++ b/app/assets/javascripts/edit/id.js.erb @@ -1,8 +1,11 @@ +//= require qs/dist/qs + $(document).ready(function () { var id = $("#id-embed"); - if (id.data("key")) { - var hashParams = OSM.params(location.hash.substring(1)); + if (id.data("configured") === true) { + var hash = location.hash.substring(1); + var hashParams = hash ? OSM.params(hash) : {}; var mapParams = OSM.mapParams(); var params = {}; @@ -20,14 +23,21 @@ $(document).ready(function () { if (hashParams.background) params.background = hashParams.background; if (hashParams.comment) params.comment = hashParams.comment; - if (hashParams.hashtags) params.hashtags = hashParams.hashtags; - if (hashParams.source) params.source = hashParams.source; if (hashParams.disable_features) params.disable_features = hashParams.disable_features; - if (hashParams.offset) params.offset = hashParams.offset; - if (hashParams.walkthrough) params.walkthrough = hashParams.walkthrough; + if (hashParams.hashtags) params.hashtags = hashParams.hashtags; if (hashParams.locale) params.locale = hashParams.locale; if (hashParams.maprules) params.maprules = hashParams.maprules; + if (hashParams.offset) params.offset = hashParams.offset; + if (hashParams.photo) params.photo = hashParams.photo; + if (hashParams.photo_dates) params.photo_dates = hashParams.photo_dates; + if (hashParams.photo_overlay) params.photo_overlay = hashParams.photo_overlay; + if (hashParams.photo_username) params.photo_username = hashParams.photo_username; if (hashParams.presets) params.presets = hashParams.presets; + if (hashParams.source) params.source = hashParams.source; + if (hashParams.validationDisable) params.validationDisable = hashParams.validationDisable; + if (hashParams.validationWarning) params.validationWarning = hashParams.validationWarning; + if (hashParams.validationError) params.validationError = hashParams.validationError; + if (hashParams.walkthrough) params.walkthrough = hashParams.walkthrough; if (id.data("gpx")) { params.gpx = id.data("gpx"); @@ -35,7 +45,7 @@ $(document).ready(function () { params.gpx = hashParams.gpx; } - id.attr("src", id.data("url") + "#" + querystring.stringify(params)); + id.attr("src", id.data("url") + "#" + Qs.stringify(params)); } else { alert(I18n.t("site.edit.id_not_configured")); }