X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5aa09fbfd069faf1eb04d4be201a6a1f1eca6cd9..d6a8aaa3690a86820ecc6198f1d5455d8f6cbbe5:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e40465f06..4a653f956 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -2,6 +2,7 @@ //= require jquery_ujs //= require jquery.autogrowtextarea //= require jquery.timers +//= require augment //= require openlayers //= require i18n/translations //= require globals @@ -9,6 +10,7 @@ //= require export //= require map //= require menu +//= require sidebar /* * Called as the user scrolls/zooms around to aniplate hrefs of the @@ -254,3 +256,20 @@ $(document).ready(function () { $(".richtext_doedit").click(editRichtext); $(".richtext_dopreview").click(previewRichtext); }); + +/* + * Forms which have been cached by rails may have he wrong + * authenticity token, so patch up any forms with the correct + * token taken from the page header. + */ +$(document).ready(function () { + var auth_token = $("meta[name=csrf-token]").attr("content"); + $("form input[name=authenticity_token]").val(auth_token); +}); + +/* + * Enable auto expansion for all text areas + */ +$(document).ready(function () { + $("textarea").autoGrow(); +});