BeatLink / trilium-scripts

Useful Scripts for Trilium
GNU General Public License v3.0
25 stars 0 forks source link

Mobile View: where to find "scriptNoteId" #5

Closed tiritibambix closed 11 months ago

tiritibambix commented 11 months ago

Hello.

I really want to learn using Trilium, but I'll mostly use it on my phone. So I wanted to give the script a try.

I am not familiar at all with Trilium nor JS, so I have a couple questions.

Where can I find the "scriptNoteId" for each script and how should I write it in the SetupButtons notes ?

Also, are labels to be added in the "Owned attributes" tab ?

Thanks for your help

BeatLink commented 11 months ago

For each javascript script that you add, the note id can be found under the note info tab. Copy that to its respective area in the setupbuttons.js scrip

tiritibambix commented 11 months ago

For each javascript script that you add, the note id can be found under the note info tab. Copy that to its respective area in the setupbuttons.js scrip

Finally found that, thank you. I got the buttons showing up on the left but they do nothing. I am in desktop mode.

Are labels to be added in the "Owned attributes" tab ? Looks like yes but I want to be sure I'm doing things the right way. See my notes if something is not right: bubbler.jpg

Also, I got an error in my SetupButtons.js at line 7 : parsing error: Unexpected token function. Is this normal ? bubbler.jpg

BeatLink commented 11 months ago

Are the note types set to JS Frontend?

tiritibambix commented 11 months ago

Yes, they are : image

BeatLink commented 11 months ago

For the setupbuttons.js as well?

tiritibambix commented 11 months ago

For all 5

BeatLink commented 11 months ago

What version of trilium are you using?

tiritibambix commented 11 months ago

App version: 0.61.13 DB version: 227 Sync Version: 31 Build date : 2023-11-06T00:21:41+01:00 Build revision : 531e9d4aff47b7e8332420645546d25ab28acf85

BeatLink commented 11 months ago

That is weird

BeatLink commented 11 months ago

If the 4 buttons show up that means the buttons are loaded though. What happens if you click the cellphone button then the left arrow button?

tiritibambix commented 11 months ago

Nothing. It happens nothing.

https://github.com/BeatLink/trilium-scripts/assets/69852851/3d3e96cf-5649-4830-9fcb-429e00c64508

tiritibambix commented 11 months ago

Would you be curious to access a test instance of mine with the exact same config ?

BeatLink commented 11 months ago

Sorry for the late reply, It's been a hectic week but sure I can take a look

tiritibambix commented 11 months ago

Sure no problem. You can access my test instance [here](). The password is .

BeatLink commented 11 months ago

Found the problem. You forgot to add two of the files:

https://github.com/BeatLink/trilium-scripts/blob/main/Mobile%20View/MobileView.css

That does the actual changes to the UI

https://github.com/BeatLink/trilium-scripts/blob/main/Mobile%20View/SetHTMLMeta.js

This sets up the scaling for mobile devices so everything isnt so tiny in desktop mode. Add em both and give it another try

tiritibambix commented 11 months ago

Yes ! It's working. I totally misinterpreted the instructions. Thanks for your work and thanks for your time. Hope you'll get some good rest after this week :)

BeatLink commented 11 months ago

No prob, and thanks! :)