Hi Alain,

> because, I guess, the global var *window* is only defined if using a
> browser.
>
> What is the usual way of dealing with this within node.js ??

It is not good style that the lib assumes the window object exists while
it is loaded. Not sure how you can solve this.

I would suggest you replace the occurence of isFirefox
(https://github.com/snowgoon88/TW5-extendedit/blob/df28ef2044a24cb4804af2037719ec08c7b68640/files/cursor-position.js#L91)
with window.mozInnerScreenX != null; and remove the variable so it is
only evaluated at runtime.

Maybe @Jeremy or somebody else can provide a better answer.

Also have a look at the use of $tw.browser in some of the tw lib plugins:

https://github.com/Jermolene/TiddlyWiki5/blob/72941f3e9a916948222ff7be540d896e2b1901f6/plugins/tiddlywiki/codemirror/edit-codemirror.js#L31

In startup modules you usually say:

exports.platforms = ["browser"];

Good luck.

-Felix

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/BLU436-SMTP1918D965DE0BF203778755BCEFB0%40phx.gbl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to