Hi there,
I have a need to have password protected pages on Logseq desktop app. I do know that those actual page files can be accessed directly from the filesystem and this feature is not really much of a protection layer against the data in the file.
This is useful for me so that when I’m doing a screensharing or showing something to some on my machine, those pages will be locked and the content would not be showing if I accidentally clicked it or something.
That brought me to developing a plugin and need some help:
- I can inject UI element by using
logseq.provideStyle
andlogseq.provideUI
, however is there a way to remove them? I found a hack:
logseq.provideUI({
key: key,
path: path,
template: ``,
});
Providing an empty template will remove the element. Just checking if there is any ‘ideal’ way of remove an DOM element? It feels like I’m doing something stupid here, lol.
- Using
logseq.provideUI
, I’m trying to includeonClick
attribute:
logseq.provideUI({
key: key,
path: path,
template: `
<button onClick="myFunction()" style="bla bla bla">
<i class="gg-lock"></i>
</button>
`,
});
When I load the page with the button
element, for some reason onClick="myFunction()"
is not being included. Am I missing out on something here?
Thank you very much in advance!