diff --git a/src/public/app/widgets/dialogs/revisions.js b/src/public/app/widgets/dialogs/revisions.ts similarity index 78% rename from src/public/app/widgets/dialogs/revisions.js rename to src/public/app/widgets/dialogs/revisions.ts index a476da4a8..94c1979ec 100644 --- a/src/public/app/widgets/dialogs/revisions.js +++ b/src/public/app/widgets/dialogs/revisions.ts @@ -9,6 +9,8 @@ import protectedSessionHolder from "../../services/protected_session_holder.js"; import BasicWidget from "../basic_widget.js"; import dialogService from "../../services/dialog.js"; import options from "../../services/options.js"; +import type FNote from "../../entities/fnote.js"; +import type { NoteType } from "../../entities/fnote.js"; const TPL = `
").text(fullRevision.content));
+ this.$content.html($("")
+ .text(fullRevision.content).html());
} else if (revisionItem.type === "image") {
if (fullRevision.mime === "image/svg+xml") {
let encodedSVG = encodeURIComponent(fullRevision.content); //Base64 of other format images may be embedded in svg
- this.$content.html($("
").attr("src", `data:${fullRevision.mime};utf8,${encodedSVG}`).css("max-width", "100%").css("max-height", "100%"));
+ this.$content.html($("
")
+ .attr("src", `data:${fullRevision.mime};utf8,${encodedSVG}`)
+ .css("max-width", "100%")
+ .css("max-height", "100%").html());
} else {
this.$content.html(
$("
")
@@ -278,13 +335,16 @@ export default class RevisionsDialog extends BasicWidget {
// as a URL to be used in a note. Instead, if they copy and paste it into a note, it will be uploaded as a new note
.attr("src", `data:${fullRevision.mime};base64,${fullRevision.content}`)
.css("max-width", "100%")
- .css("max-height", "100%")
+ .css("max-height", "100%").html()
);
}
} else if (revisionItem.type === "file") {
const $table = $("| ").text(t("revisions.mime")), $(" | ").text(revisionItem.mime))) - .append($(" |
|---|---|
| ").text(t("revisions.file_size")), $(" | ").text(utils.formatSize(revisionItem.contentLength)))); + .append($(" |
| ").text(t("revisions.mime")), + $(" | ").text(revisionItem.mime))) + .append($(" |
| ").text(t("revisions.file_size")), $(" | ").text(utils.formatSize(revisionItem.contentLength))));
if (fullRevision.content) {
$table.append(
@@ -294,15 +354,23 @@ export default class RevisionsDialog extends BasicWidget {
);
}
- this.$content.html($table);
+ this.$content.html($table.html());
} else if (["canvas", "mindMap"].includes(revisionItem.type)) {
const encodedTitle = encodeURIComponent(revisionItem.title);
- this.$content.html($("").text(fullRevision.content));
} else {
|