mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Add download button to shared canvases (#7)
thx @sigaloid * Add download button to shared canvases * Update canvas_note_share.js * Update canvas_note_share.js * Update canvas_note_share.js * Change to more accurate language
This commit is contained in:
parent
4e4010e15e
commit
7bcd1c3009
@ -8,6 +8,7 @@ const App = () => {
|
|||||||
width: undefined,
|
width: undefined,
|
||||||
height: appState.height,
|
height: appState.height,
|
||||||
});
|
});
|
||||||
|
const [viewModeEnabled, setViewModeEnabled] = React.useState(false);
|
||||||
console.log("no render?");
|
console.log("no render?");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,6 +46,18 @@ const App = () => {
|
|||||||
className: "excalidraw-wrapper",
|
className: "excalidraw-wrapper",
|
||||||
ref: excalidrawWrapperRef
|
ref: excalidrawWrapperRef
|
||||||
},
|
},
|
||||||
|
React.createElement(
|
||||||
|
"label",
|
||||||
|
null,
|
||||||
|
React.createElement("input", {
|
||||||
|
type: "checkbox",
|
||||||
|
checked: viewModeEnabled,
|
||||||
|
onChange: () => setViewModeEnabled(!viewModeEnabled)
|
||||||
|
}),
|
||||||
|
" Edit mode "
|
||||||
|
),
|
||||||
|
React.createElement("br"),
|
||||||
|
|
||||||
React.createElement(Excalidraw.default, {
|
React.createElement(Excalidraw.default, {
|
||||||
ref: excalidrawRef,
|
ref: excalidrawRef,
|
||||||
width: dimensions.width,
|
width: dimensions.width,
|
||||||
@ -52,7 +65,7 @@ const App = () => {
|
|||||||
initialData: {
|
initialData: {
|
||||||
elements, appState, files
|
elements, appState, files
|
||||||
},
|
},
|
||||||
viewModeEnabled: true,
|
viewModeEnabled: !viewModeEnabled,
|
||||||
zenModeEnabled: false,
|
zenModeEnabled: false,
|
||||||
gridModeEnabled: false,
|
gridModeEnabled: false,
|
||||||
isCollaborating: false,
|
isCollaborating: false,
|
||||||
@ -75,4 +88,4 @@ const App = () => {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
ReactDOM.render(React.createElement(App), document.getElementById("excalidraw-app"));
|
ReactDOM.render(React.createElement(App), document.getElementById("excalidraw-app"));
|
||||||
|
@ -110,8 +110,10 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
</script>
|
</script>
|
||||||
<div id="excalidraw-app">
|
<div id="excalidraw-app">
|
||||||
</div>
|
</div>
|
||||||
|
<hr>
|
||||||
|
<a href="api/images/${note.noteId}/${note.title}?${note.utcDateModified}">Download SVG</a>
|
||||||
<script src="../../libraries/excalidraw/canvas_note_share.js"></script>
|
<script src="../../libraries/excalidraw/canvas_note_share.js"></script>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
content = '<p>This note type cannot be displayed.</p>';
|
content = '<p>This note type cannot be displayed.</p>';
|
||||||
@ -127,7 +129,3 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
getContent
|
getContent
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user