.attr("class", "form-select w-auto")
.append($("<option>").val("png").text("PNG").prop("selected", true))
.append($("<option>").val("jpeg").text("JPEG"))
+ .append($("<option>").val("webp").text("WEBP"))
.append($("<option>").val("svg").text("SVG"))
.append($("<option>").val("pdf").text("PDF"))));
.appendTo($form);
}
- const csrf_param = $("meta[name=csrf-param]").attr("content"),
- csrf_token = $("meta[name=csrf-token]").attr("content");
+ const csrfAttrs = { type: "hidden" };
+ [[csrfAttrs.name, csrfAttrs.value]] = Object.entries(OSM.csrf);
$("<input>")
- .attr("name", csrf_param)
- .attr("value", csrf_token)
- .attr("type", "hidden")
+ .attr(csrfAttrs)
.appendTo($form);
const args = {