sharing fixes

This commit is contained in:
zadam 2022-01-01 22:32:38 +01:00
parent 1fed71a92e
commit 5ecb603e86
2 changed files with 4 additions and 4 deletions

View file

@ -5,10 +5,10 @@
*/ */
async function fetchNote(noteId = null) { async function fetchNote(noteId = null) {
if (!noteId) { if (!noteId) {
noteId = document.getElementsByName("body")[0].getAttribute("data-note-id"); noteId = document.body.getAttribute("data-note-id");
} }
const resp = await fetch(`share/api/notes/${noteId}`); const resp = await fetch(`api/notes/${noteId}`);
return await resp.json(); return await resp.json();
} }

View file

@ -7,7 +7,7 @@
<% } else { %> <% } else { %>
<link rel="shortcut icon" href="../favicon.ico"> <link rel="shortcut icon" href="../favicon.ico">
<% } %> <% } %>
<script src="app/share.js"></script> <script src="../app/share.js"></script>
<% if (!note.hasLabel("shareOmitDefaultCss")) { %> <% if (!note.hasLabel("shareOmitDefaultCss")) { %>
<link href="../libraries/normalize.min.css" rel="stylesheet"> <link href="../libraries/normalize.min.css" rel="stylesheet">
<link href="../stylesheets/share.css" rel="stylesheet"> <link href="../stylesheets/share.css" rel="stylesheet">
@ -19,7 +19,7 @@
<link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet"> <link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet">
<% } %> <% } %>
<% for (const jsRelation of note.getRelations("shareJs")) { %> <% for (const jsRelation of note.getRelations("shareJs")) { %>
<script src="api/notes/<%= jsRelation.value %>/download"></script> <script type="module" src="api/notes/<%= jsRelation.value %>/download"></script>
<% } %> <% } %>
<%- header %> <%- header %>
<title><%= note.title %></title> <title><%= note.title %></title>