From: Tom Hughes Date: Thu, 6 Aug 2020 19:39:42 +0000 (+0100) Subject: Replace querystring parser with qs yarn module X-Git-Tag: live~2574 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/79447e75497601444a9d4de25220f24a609d2780?hp=447c05fcb8e306b1be53b4108f816ac8d5663324 Replace querystring parser with qs yarn module --- diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 478fc3492..3b9dee6ba 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -10,8 +10,6 @@ //= link_tree ../../../vendor/assets/iD/iD/img //= link_directory ../../../vendor/assets/iD/iD/locales .json -//= link_directory ../../../vendor/assets/javascripts .js - //= link_tree ../../../vendor/assets/leaflet .png //= link_directory ../../../vendor/assets/polyfill .js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d18ece0b1..cbb69119c 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -15,7 +15,7 @@ //= require oauth //= require piwik //= require richtext -//= require querystring +//= require qs/dist/qs //= require bs-custom-file-input //= require bs-custom-file-input-init @@ -25,9 +25,8 @@ */ window.updateLinks = function (loc, zoom, layers, object) { $(".geolink").each(function (index, link) { - var querystring = require("querystring-component"), - href = link.href.split(/[?#]/)[0], - args = querystring.parse(link.search.substring(1)), + var href = link.href.split(/[?#]/)[0], + args = Qs.parse(link.search.substring(1)), editlink = $(link).hasClass("editlink"); delete args.node; @@ -39,7 +38,7 @@ window.updateLinks = function (loc, zoom, layers, object) { args[object.type] = object.id; } - var query = querystring.stringify(args); + var query = Qs.stringify(args); if (query) href += "?" + query; args = { diff --git a/app/assets/javascripts/edit/id.js.erb b/app/assets/javascripts/edit/id.js.erb index 23726519e..8ab9425e2 100644 --- a/app/assets/javascripts/edit/id.js.erb +++ b/app/assets/javascripts/edit/id.js.erb @@ -1,7 +1,6 @@ -//= require querystring +//= require qs/dist/qs $(document).ready(function () { - var querystring = require("querystring-component"); var id = $("#id-embed"); if (id.data("key")) { @@ -39,7 +38,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")); } diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 3e9994a88..f74dd0bb7 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -20,11 +20,9 @@ //= require index/changeset //= require index/query //= require router -//= require querystring +//= require qs/dist/qs $(document).ready(function () { - var querystring = require("querystring-component"); - var loaderTimeout; var map = new L.OSM.Map("map", { @@ -264,7 +262,7 @@ $(document).ready(function () { var iframe = $("