Open sottey opened 1 year ago
I checked my server instance and don't see the same thing
Hmm. I will continue looking at my implementation. thanks!
How did you disable those custom widgets?
The algorithm is to find all notes with label #widget
and those classes have to have a parentWidget
property, like:
class WordCountWidget extends api.NoteContextAwareWidget {
get position() { return 100; } // higher value means position towards the bottom/right
get parentWidget() { return 'center-pane'; }
...
}
My habit is to change #widget to #DISABLEDwidget and reload the frontend. Is it possible that this is causing the issue?
...or perhaps I am using #widget improperly... I use this for items I want to be able to call via key combos or events.
My habit is to change #widget to #DISABLEDwidget and reload the frontend. Is it possible that this is causing the issue?
Sounds okay.
...or perhaps I am using #widget improperly... I use this for items I want to be able to call via key combos or events.
Not sure what this means. Notes with #widget
are expected to contain widget classes similar to the one I posted above.
If you just want a random JS code run on the frontend startup, then it's better to use #run=frontendStartup
iirc the usage of the term "widget" comes from jQuery UI so as zadam said for just making keyboard shortcuts and such that don't require a UI, no need to make it a widget!
iirc the usage of the term "widget" comes from jQuery UI
Hmm, not really. widget is just a general UI concept
Trilium used jQuery UI in early versions for a couple of things, but now it's gone. It's true that the whole Trilium uses jQuery core for selectors etc (it's just more egonomic API than the native DOM), including widgets, but Trilium widgets otherwise don't come from jQuery world.
zadam said for just making keyboard shortcuts and such that don't require a UI, no need to make it a widget!
Yes, "widget" is useful when you need an UI. Could be used also for non-UI things if you need to listen to application events (it's added to the component tree through which events flow).
But if you just need some basic script, then it's not necessary to use widgets ...
Ah that's my mistake, an interesting overlap though.
Trilium Version
0.60.4
What operating system are you using?
Ubuntu
What is your setup?
Server access only
Operating System Version
Ubuntu 20
Description
Not a big deal, but something is causing the error:
"Custom widget does not have mandatory 'getParent()' method defined"
I have disabled all of my widgets and it is still occurring, so I wonder if it is an issue in the services.js...
Error logs