If you use Windows, you can try to install it like this
winget install tiddlywiki-app
Can something be done about this
One possible solution is to introduce a setting that lets users temporarily turn off the right-click menu.
What do you think (about this)?
That can be an option for the time being.
I would like the right click menu to be disabled if a modifier key (like shift, alt or ctrl) is pressed, if possible.
After some testing, it currently appears that manually stopping the server has a high probability of taking a long time to wait. I suspect that there might be something blocking this process.
@EricShulman
I wanted to get the windowsize info
using this tool of yours for a wiki loaded in this new app by @oeyoews
But the wiki was unable to load when I restarted the app after adding this tiddler. Any way to fix this?
Can this be implemented ?
The right-click menu conflict should only be with TiddlyWiki’s own right-click events. There shouldn’t be any other conflicting events, right? I can’t think of any other cases that would use the right-click menu. Can you give examples of other use cases?
This can’t be implemented for now, as it may cause some other logical issues. As for alternative temporary solutions, I might add them later.
I tested it briefly, and everything seems okay. I’m not sure what problem you mean by “can’t load.”
Try this instead: TiddlyTools/Modules/Info/WindowSize.js
Instead of using a “startup” module to directly create/update the $:/info/browser/window/width
and $:/info/browser/window/height
tiddlers, this newer code uses a TWCore “info” module to get and track the window size values.
Let me know if it works any better for you.
-e
Actually the code given in this post is working - Would it be a good idea to implement in TW to update the infomechanism when entering/leaving fullscreen? - #2 by EricShulman
Error in the tiddlywiki-app occurred when I used the code given in the TiddlyTools site - TiddlyTools for TW v5.3.6 — Small Tools for Big Ideas!™. But this code worked in my browser.
I thought both codes were the same and took the one from TiddlyTools site thinking that it might be a updated version. Sorry for the confusion guys.
@EricShulman any particular reason why one code shows error while the other doesn’t. It would be better to give both code in TiddlyTools website since both have separate usecases
I guess this was due to some issues with my modifier keys and mac keyboard or bluetooth keyboard. When ever I use ctrl
as the modifier key the right click menu pop ups. As a temporary solution, I am changing the ctrl
modifier key to something else
The “window size” info add-on uses the following code logic:
if (!$tw.browser) return([]);
var w=( window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth );
var h=( window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight );
Note how it first checks to ensure that it is running in a browser environment (where $tw.browser
has a value). If the tiddlywiki-app doesn’t pass this check, then the code simply returns an empty array and the $:/info/browser/window/width
and $:/info/browser/window/height
tiddlers are not created.
Next, the code uses values contained in objects that are defined by the browser itself (window
OR document.documentElement
OR document.body
) to fetch the current window width and height values. The different object references are there to handle different browser-specific implementations, where window.innerWidth
and window.innerHeight
are the most common standard, and document.documentElement
and document.body
are there as “fallback” values for older browsers.
If none of these browser-specific objects exist in the tiddlywiki-app environment, then w
and h
will be undefined, and the subsequent w.toString()
and h.toString()
calls that set the $:/info
tiddler values will fail and throw an uncaught error: “Cannot read properties of null (reading ‘toString’)`”.
To address this, I’ve added a new check in the TiddlyTools/Modules/Info/WindowSize.js
code so that the $:/info
tiddlers will not be created in this case:
if (!w || !h) return([]);
Of course, this doesn’t really solve your issue, since you will still want to have useful window width/height values, even when running within the tiddlywiki-app. To make that work, I suggest that the tiddlywiki-app should ensure that it defines valid window.innerWidth
and window.innerHeight
object attributes that my code can then use properly.
-e
Code given in this above given post was working in my wiki loaded in tiddlywiki-app.
@oeyoews I think you should give a different name to your app. Something other than tiddlywiki-app. The current name can cause confusion sometimes
Since the old startup
module code does return valid width/height values, it suggests that there may be a problem in the tiddlywiki-app handling for the $:/info
module mechanism.
-e
Follow-up:
The old startup
module code works for the tiddlywiki-app because it doesn’t check for $tw.browser
but still has window.innerWidth
and window.innerHeight
defined so it can return valid values.
I have just updated the newer info
module code to use a try/catch
wrapper instead of checking for $tw.browser
. This should allow it to work for the tiddlywiki-app, while suppressing RSOD errors that may occur in other non-browser environments.
Please try removing the old startup
module code and use the latest update from here: TiddlyTools/Modules/Info/WindowSize.js
Let me know if it works or not.
-e
I got the same error after drag dropping the windowsize js tiddler and reloading the wiki
I should have asked this previously… EXACTLY what error is being reported?
This was the error