X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d4135390acff291f2f2c15d9fb86723ebf4fe755..1727cd7c2b066a4442f6714be7aa170f4d8c1eef:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b257f7fed..564089f3a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -3,6 +3,8 @@ //= require jquery.timers //= require jquery.cookie //= require jquery.throttle-debounce +//= require bootstrap.tooltip +//= require bootstrap.dropdown //= require augment //= require osm //= require leaflet @@ -122,6 +124,19 @@ function cookieContent(map) { return [center.lng, center.lat, map.getZoom(), map.getLayersCode()].join('|'); } +function escapeHTML(string) { + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + return string == null ? '' : (string + '').replace(/[&<>"']/g, function(match) { + return htmlEscapes[match]; + }); +} + /* * Forms which have been cached by rails may have the wrong * authenticity token, so patch up any forms with the correct