//= require jquery.timers
//= require jquery.cookie
//= require jquery.throttle-debounce
+//= require bootstrap.tooltip
+//= require bootstrap.dropdown
//= require augment
//= require osm
//= require leaflet
};
if (select) query.select = select;
- $("#linkloader")
+
+ var iframe = $('<iframe>')
+ .hide()
+ .appendTo('body')
.attr("src", "http://127.0.0.1:8111/load_and_zoom?" + querystring.stringify(query))
- .load(function() { loaded = true; });
+ .on('load', function() {
+ $(this).remove();
+ loaded = true;
+ });
setTimeout(function () {
- if (!loaded) alert(I18n.t('site.index.remote_failed'));
+ if (!loaded) {
+ alert(I18n.t('site.index.remote_failed'));
+ iframe.remove();
+ }
}, 1000);
return false;
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