//= 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
//= require oauth
//= require piwik
//= require richtext
-//= require querystring
+//= require qs/dist/qs
//= require bs-custom-file-input
//= require bs-custom-file-input-init
*/
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;
args[object.type] = object.id;
}
- var query = querystring.stringify(args);
+ var query = Qs.stringify(args);
if (query) href += "?" + query;
args = {
-//= require querystring
+//= require qs/dist/qs
$(document).ready(function () {
- var querystring = require("querystring-component");
var id = $("#id-embed");
if (id.data("key")) {
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"));
}
//= 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", {
var iframe = $("<iframe>")
.hide()
.appendTo("body")
- .attr("src", url + querystring.stringify(query))
+ .attr("src", url + Qs.stringify(query))
.on("load", function () {
$(this).remove();
loaded = true;
};
page.load = function () {
- var params = querystring.parse(location.search.substring(1));
+ var params = Qs.parse(location.search.substring(1));
if (params.query) {
$("#sidebar .search_form input[name=query]").value(params.query);
}
-//= require querystring
+//= require qs/dist/qs
OSM.initializeContextMenu = function (map) {
- var querystring = require("querystring-component");
-
map.contextmenu.addItem({
text: I18n.t("javascripts.context.directions_from"),
callback: function directionsFromHere(e) {
lat = latlng.lat.toFixed(precision),
lng = latlng.lng.toFixed(precision);
- OSM.router.route("/directions?" + querystring.stringify({
+ OSM.router.route("/directions?" + Qs.stringify({
from: lat + "," + lng,
to: $("#route_to").val()
}));
lat = latlng.lat.toFixed(precision),
lng = latlng.lng.toFixed(precision);
- OSM.router.route("/directions?" + querystring.stringify({
+ OSM.router.route("/directions?" + Qs.stringify({
from: $("#route_from").val(),
to: lat + "," + lng
}));
//= require_self
//= require_tree ./directions
-//= require querystring
+//= require qs/dist/qs
OSM.Directions = function (map) {
- var querystring = require("querystring-component");
-
var awaitingGeocode; // true if the user has requested a route, but we're waiting on a geocode result
var awaitingRoute; // true if we've asked the engine for a route and are waiting to hear back
var chosenEngine;
routeTo = coordTo.lat + "," + coordTo.lng;
}
- OSM.router.route("/directions?" + querystring.stringify({
+ OSM.router.route("/directions?" + Qs.stringify({
from: $("#route_to").val(),
to: $("#route_from").val(),
route: routeTo + ";" + routeFrom
var precision = OSM.zoomPrecision(map.getZoom());
- OSM.router.replace("/directions?" + querystring.stringify({
+ OSM.router.replace("/directions?" + Qs.stringify({
engine: chosenEngine.id,
route: o.lat.toFixed(precision) + "," + o.lng.toFixed(precision) + ";" +
d.lat.toFixed(precision) + "," + d.lng.toFixed(precision)
getRoute(true, true);
});
- var params = querystring.parse(location.search.substring(1)),
+ var params = Qs.parse(location.search.substring(1)),
route = (params.route || "").split(";"),
from = route[0] && L.latLng(route[0].split(",")),
to = route[1] && L.latLng(route[1].split(","));
-//= require querystring
+//= require qs/dist/qs
OSM.NewNote = function (map) {
- var querystring = require("querystring-component");
-
var noteLayer = map.noteLayer,
content = $("#sidebar_content"),
page = {},
map.addLayer(noteLayer);
- var params = querystring.parse(path.substring(path.indexOf("?") + 1));
+ var params = Qs.parse(path.substring(path.indexOf("?") + 1));
var markerLatlng;
if (params.lat && params.lon) {
//= require jquery-simulate/jquery.simulate
-//= require querystring
+//= require qs/dist/qs
OSM.Query = function (map) {
- var querystring = require("querystring-component");
-
var url = OSM.OVERPASS_URL,
queryButton = $(".control-query .control-button"),
uninterestingTags = ["source", "source_ref", "source:ref", "history", "attribution", "created_by", "tiger:county", "tiger:tlid", "tiger:upload_uuid", "KSJ2:curve_id", "KSJ2:lat", "KSJ2:lon", "KSJ2:coordinate", "KSJ2:filename", "note:ja"],
};
page.load = function (path, noCentre) {
- var params = querystring.parse(path.substring(path.indexOf("?") + 1)),
+ var params = Qs.parse(path.substring(path.indexOf("?") + 1)),
latlng = L.latLng(params.lat, params.lon);
if (!window.location.hash && !noCentre && !map.getBounds().contains(latlng)) {
//= require jquery-simulate/jquery.simulate
-//= require querystring
+//= require qs/dist/qs
OSM.Search = function (map) {
- var querystring = require("querystring-component");
-
$(".search_form input[name=query]").on("input", function (e) {
if ($(e.target).val() === "") {
$(".describe_location").fadeIn(100);
var page = {};
page.pushstate = page.popstate = function (path) {
- var params = querystring.parse(path.substring(path.indexOf("?") + 1));
+ var params = Qs.parse(path.substring(path.indexOf("?") + 1));
$(".search_form input[name=query]").val(params.query);
$(".describe_location").hide();
OSM.loadSidebarContent(path, page.load);
-//= require querystring
+//= require qs/dist/qs
L.extend(L.LatLngBounds.prototype, {
getSize: function () {
params.mlon = latLng.lng.toFixed(precision);
}
- var querystring = require("querystring-component"),
- url = window.location.protocol + "//" + OSM.SERVER_URL + "/",
- query = querystring.stringify(params),
+ var url = window.location.protocol + "//" + OSM.SERVER_URL + "/",
+ query = Qs.stringify(params),
hash = OSM.formatHash(this);
if (query) url += "?" + query;
params[this._object.type] = this._object.id;
}
- var querystring = require("querystring-component"),
- query = querystring.stringify(params);
+ var query = Qs.stringify(params);
if (query) {
str += "?" + query;
}
-//= querystring
+//= qs/dist/qs
$(document).ready(function () {
- var querystring = require("querystring-component");
-
// Preserve location hash in referer
if (window.location.hash) {
$("#referer").val($("#referer").val() + window.location.hash);
// Attach referer to authentication buttons
$(".auth_button").each(function () {
- var params = querystring.parse(this.search.substring(1));
+ var params = Qs.parse(this.search.substring(1));
params.referer = $("#referer").val();
- this.search = querystring.stringify(params);
+ this.search = Qs.stringify(params);
});
// Add click handler to show OpenID field
if (referer) {
args.referer = referer;
}
- window.location = action + "?" + querystring.stringify(args);
+ window.location = action + "?" + Qs.stringify(args);
return false;
});
});
//= depend_on settings.yml
//= depend_on settings.local.yml
-//= require querystring
+//= require qs/dist/qs
OSM = {
<% if defined?(PIWIK) %>
},
parseHash: function(hash) {
- var querystring = require("querystring-component"),
- args = {};
+ var args = {};
var i = hash.indexOf('#');
if (i < 0) {
return args;
}
- hash = querystring.parse(hash.substr(i + 1));
+ hash = Qs.parse(hash.substr(i + 1));
var map = (hash.map || '').split('/'),
zoom = parseInt(map[0], 10),
"jquery.cookie": "^1.4.1",
"leaflet": "^1.6.0",
"leaflet.locatecontrol": "^0.71.1",
- "ohauth": "^0.2.2"
+ "ohauth": "^0.2.2",
+ "qs": "^6.9.4"
},
"devDependencies": {
"eslint": "^7.3.1"
//= require leaflet.osm
//= require leaflet.map
//= require i18n/translations
-//= require querystring
-
-var querystring = require('querystring-component');
+//= require qs/dist/qs
describe("OSM", function () {
describe(".apiUrl", function () {
+++ /dev/null
-require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({"querystring-component":[function(require,module,exports){
-module.exports=require('Xr2wId');
-},{}],"Xr2wId":[function(require,module,exports){
-
-/**
- * Module dependencies.
- */
-
-var trim = require('trim');
-
-/**
- * Parse the given query `str`.
- *
- * @param {String} str
- * @return {Object}
- * @api public
- */
-
-exports.parse = function(str){
- if ('string' !== typeof str) return {};
-
- str = trim(str);
- if ('' === str) return {};
-
- var obj = {};
- var pairs = str.split('&');
- for (var i = 0; i < pairs.length; i++) {
- var parts = pairs[i].split('=');
- obj[parts[0]] = null === parts[1]
- ? ''
- : decodeURIComponent(parts[1]);
- }
-
- return obj;
-};
-
-/**
- * Stringify the given `obj`.
- *
- * @param {Object} obj
- * @return {String}
- * @api public
- */
-
-exports.stringify = function(obj){
- if (!obj) return '';
- var pairs = [];
- for (var key in obj) {
- pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]));
- }
- return pairs.join('&');
-};
-
-},{"trim":1}],1:[function(require,module,exports){
-
-exports = module.exports = trim;
-
-function trim(str){
- return str.replace(/^\s*|\s*$/g, '');
-}
-
-exports.left = function(str){
- return str.replace(/^\s*/, '');
-};
-
-exports.right = function(str){
- return str.replace(/\s*$/, '');
-};
-
-},{}]},{},[])
-;
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
+qs@^6.9.4:
+ version "6.9.4"
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.4.tgz#9090b290d1f91728d3c22e54843ca44aea5ab687"
+ integrity sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==
+
regexpp@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2"