X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/d4135390acff291f2f2c15d9fb86723ebf4fe755..8390d1f6c61c1a26051d8685ca1cbd358b221a92:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b257f7fed..a33e281ce 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -3,6 +3,7 @@ //= require jquery.timers //= require jquery.cookie //= require jquery.throttle-debounce +//= require bootstrap.tooltip //= require augment //= require osm //= require leaflet @@ -122,6 +123,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