aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/templates/partials/editor.html
diff options
context:
space:
mode:
Diffstat (limited to 'internal/web/templates/partials/editor.html')
-rw-r--r--internal/web/templates/partials/editor.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/web/templates/partials/editor.html b/internal/web/templates/partials/editor.html
index 8e0acaf..eb2e315 100644
--- a/internal/web/templates/partials/editor.html
+++ b/internal/web/templates/partials/editor.html
@@ -1,9 +1,9 @@
{{define "editor"}}<textarea name="{{.name}}" id="ed-{{.name}}" rows="{{.rows}}"{{if .tall}} class="editor"{{end}}>{{.value}}</textarea>
<div class="editor-tools">
- <label class="upload">Insert image <input type="file" name="inline_image" id="ed-{{.name}}-file" accept="image/*"></label>
+ <label class="upload">{{t "Insert image"}} <input type="file" name="inline_image" id="ed-{{.name}}-file" accept="image/*"></label>
<span class="upload-status" id="ed-{{.name}}-status"></span>
- <span class="muted small">…or paste / drop an image into the text.</span>
- <noscript><span class="muted small">The image is added at the end of the text when you save.</span></noscript>
+ <span class="muted small">{{t "…or paste / drop an image into the text."}}</span>
+ <noscript><span class="muted small">{{t "The image is added at the end of the text when you save."}}</span></noscript>
</div>
{{template "mdhelp"}}
<script>
@@ -18,14 +18,14 @@
ta.focus();
}
function upload(file) {
- st.textContent = "Uploading " + file.name + "…";
+ st.textContent = {{t "Uploading"}} + " " + file.name + "…";
var fd = new FormData();
fd.append("_csrf", {{.csrf}});
fd.append("file", file);
fetch({{.upload}}, { method: "POST", body: fd, credentials: "same-origin", headers: { Accept: "application/json" } })
- .then(function (r) { return r.json().then(function (j) { if (!r.ok || j.error) throw new Error(j.error || "upload failed"); return j; }); })
- .then(function (j) { insert(j.markdown); st.textContent = "Inserted " + j.filename + "."; inp.value = ""; })
- .catch(function (err) { st.textContent = "Could not upload: " + err.message; });
+ .then(function (r) { return r.json().then(function (j) { if (!r.ok || j.error) throw new Error(j.error || {{t "upload failed"}}); return j; }); })
+ .then(function (j) { insert(j.markdown); st.textContent = {{t "Inserted"}} + " " + j.filename + "."; inp.value = ""; })
+ .catch(function (err) { st.textContent = {{t "Could not upload:"}} + " " + err.message; });
}
inp.addEventListener("change", function () { if (inp.files && inp.files[0]) upload(inp.files[0]); });
ta.addEventListener("paste", function (ev) {