//= require openlayers
//= require i18n/translations
//= require globals
+//= require compat
//= require browse
//= require export
//= require map
//= require menu
+if ( !Array.prototype.forEach ) {
+ Array.prototype.forEach = function(fn, scope) {
+ for(var i = 0, len = this.length; i < len; ++i) {
+ fn.call(scope || this, this[i], i, this);
+ }
+ }
+}
+
/*
* Called as the user scrolls/zooms around to aniplate hrefs of the
* view tab and various other links
$(".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();
+});