From 4f86d769befb978e7fc12502981d25df77db237c Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 18 Jun 2022 15:52:09 +0200 Subject: [PATCH] web view fixes + disclaimer --- src/public/app/services/note_types.js | 2 +- src/public/app/widgets/type_widgets/web_view.js | 12 +++++++++--- src/services/notes.js | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/public/app/services/note_types.js b/src/public/app/services/note_types.js index 523974c13..4f89616fc 100644 --- a/src/public/app/services/note_types.js +++ b/src/public/app/services/note_types.js @@ -12,7 +12,7 @@ async function getNoteTypeItems(command) { { title: "Book", command: command, type: "book", uiIcon: "bx bx-book" }, { title: "Mermaid Diagram", command: command, type: "mermaid", uiIcon: "bx bx-selection" }, { title: "Canvas", command: command, type: "canvas", uiIcon: "bx bx-pen" }, - { title: "Web View", command: command, type: "iframe", uiIcon: "bx bx-globe-alt" }, + { title: "Web View", command: command, type: "web-view", uiIcon: "bx bx-globe-alt" }, ]; const templateNoteIds = await server.get("search-templates"); diff --git a/src/public/app/widgets/type_widgets/web_view.js b/src/public/app/widgets/type_widgets/web_view.js index 5fe466584..e35bd79b3 100644 --- a/src/public/app/widgets/type_widgets/web_view.js +++ b/src/public/app/widgets/type_widgets/web_view.js @@ -3,10 +3,16 @@ import attributeService from "../../services/attributes.js"; const TPL = `
-
-

This help note is shown because this note of type WebView HTML doesn't have required label to function properly.

+
+

Web View

+ +

Note of type Web View allow you to embed websites into Trilium.

-

Please create label with a URL address you want to embed, e.g. #webViewSrc="http://www.google.com"

+

To start, please create a label with a URL address you want to embed, e.g. #webViewSrc="http://www.google.com"

+ +

Disclaimer on the experimental status

+ +

Web View is an experimental note type, and it might be removed or substantially changed in the future. Web View works also only in the desktop build.

diff --git a/src/services/notes.js b/src/services/notes.js index 01c3cc1d4..e3b14de22 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -55,7 +55,7 @@ function deriveMime(type, mime) { mime = 'text/plain'; } else if (['relation-map', 'search', 'canvas'].includes(type)) { mime = 'application/json'; - } else if (['render', 'book', 'iframe'].includes(type)) { + } else if (['render', 'book', 'web-view'].includes(type)) { mime = ''; } else { mime = 'application/octet-stream';