$(() => { window.DecidimAwesome = window.DecidimAwesome || {}; const token = $('meta[name="csrf-token"]').attr("content"); const $textarea = $("textarea#proposal_body"); const text = window.DecidimAwesome.texts.drag_and_drop_image; if (!$textarea.length) { return; } if (window.DecidimAwesome.allow_images_in_proposals) { // Add the capability to upload images only (they will be presented as links) $textarea.after(`
${text}
`); $textarea.inlineattachment({ uploadUrl: window.DecidimAwesome.editor_uploader_path, uploadFieldName: "image", jsonFieldName: "url", progressText: "[Uploading file...]", urlText: "{filename}", extraHeaders: { "X-CSRF-Token": token } }); } });