diff --git a/src/public/app/widgets/buttons/note_actions.ts b/src/public/app/widgets/buttons/note_actions.ts
index 047a950bb..c5a0dafcb 100644
--- a/src/public/app/widgets/buttons/note_actions.ts
+++ b/src/public/app/widgets/buttons/note_actions.ts
@@ -59,8 +59,12 @@ const TPL = `
- ${t("note_actions.print_note")}
+ ${t("note_actions.print_note")}
+
+
+ ${t("note_actions.print_pdf")}
+
@@ -111,6 +115,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
private $convertNoteIntoAttachmentButton!: JQuery;
private $findInTextButton!: JQuery;
private $printActiveNoteButton!: JQuery;
+ private $exportAsPdfButton!: JQuery;
private $showSourceButton!: JQuery;
private $showAttachmentsButton!: JQuery;
private $renderNoteButton!: JQuery;
@@ -136,6 +141,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
this.$convertNoteIntoAttachmentButton = this.$widget.find("[data-trigger-command='convertNoteIntoAttachment']");
this.$findInTextButton = this.$widget.find(".find-in-text-button");
this.$printActiveNoteButton = this.$widget.find(".print-active-note-button");
+ this.$exportAsPdfButton = this.$widget.find("export-as-pdf-button");
this.$showSourceButton = this.$widget.find(".show-source-button");
this.$showAttachmentsButton = this.$widget.find(".show-attachments-button");
this.$renderNoteButton = this.$widget.find(".render-note-button");
@@ -185,7 +191,9 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
this.toggleDisabled(this.$showAttachmentsButton, !isInOptions);
this.toggleDisabled(this.$showSourceButton, ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "geoMap"].includes(note.type));
- this.toggleDisabled(this.$printActiveNoteButton, ["text", "code"].includes(note.type));
+ const canPrint = ["text", "code"].includes(note.type);
+ this.toggleDisabled(this.$printActiveNoteButton, canPrint);
+ this.toggleDisabled(this.$exportAsPdfButton, canPrint);
this.$renderNoteButton.toggle(note.type === "render");
diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.js
index 3fad9f138..ae38b1b93 100644
--- a/src/public/app/widgets/note_detail.js
+++ b/src/public/app/widgets/note_detail.js
@@ -291,6 +291,14 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
});
}
+ async exportAsPdfEvent() {
+ if (!this.noteContext.isActive()) {
+ return;
+ }
+
+ alert("Hi");
+ }
+
hoistedNoteChangedEvent({ ntxId }) {
if (this.isNoteContext(ntxId)) {
this.refresh();
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index d58f0fd56..c0d7d0eb1 100644
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@ -672,7 +672,8 @@
"save_revision": "Save revision",
"convert_into_attachment_failed": "Converting note '{{title}}' failed.",
"convert_into_attachment_successful": "Note '{{title}}' has been converted to attachment.",
- "convert_into_attachment_prompt": "Are you sure you want to convert note '{{title}}' into an attachment of the parent note?"
+ "convert_into_attachment_prompt": "Are you sure you want to convert note '{{title}}' into an attachment of the parent note?",
+ "print_pdf": "Export as PDF..."
},
"onclick_button": {
"no_click_handler": "Button widget '{{componentId}}' has no defined click handler"