Quote
please find an attempt at recursively searching for fsubscript.js to a limited depth.
great!
please find an attempt at recursively searching for fsubscript.js to a limited depth.



http://dl.getdropbox.com/u/4571/FARR/FSubScript.zipand JScalc:
http://dl.getdropbox.com/u/4571/FARR/JScalc.zip


I found it a little odd that for onInit(), a sub-plugin defines onInit() -- similarly for onSetStrValue(). I think init() [if that's possible] seems somehow better-fitting in terms of naming -- either that or change all of the other things to match the names used by fscript.js. Or may be some other idea? What do you think?Given it's done one way, I prefer it to stay the same so that we don't loose time talking about useless guidelines.


onInit() onSetStrValue()Yes you are right, that it should be unified. I will leave all naming upon you so I will definitely change it into Init() and SetStrValue
I'm not so clear on how fscript.js/onSetStrValue() should behave -- specifically, the return value seems to get decided purely on whether a single sub-plugin returns true.
But at least some implementation is necessary because pcommand is used quite often.onInit() in the original fscript.js took a single parameter iirc, in the most recent code candidate the sub-plugin's onInit() doesn't take a parameter. I wonder whether mirroring the original interface is preferable or not. May be it's not a big deal. Any thoughts?I did it so because there is already curdir implementation via directory variable, so why to have it twice? So I would keep it without any parameter

I'm not sure about loading all fsubscript*.js files -- I wonder whether the loading order might matter in some cases and with the way the code is currently, a sub-plugin writer can only control this based on coming up with appropriate filenames. I hadn't really thought about multiple files per sub-plugin so I start to wonder about the potential consequences and alternative designs smiley
Inclusion of other files can be done with eval(getTextFile("json.js")) if your plugin is too big to practically work in one file.

I think sub-plugins should not extend global state. fsubscript could expose many useful functions so that plugin developers have less need for sharing things.


Original address: https://www.donationcoder.com/forum/index.php?topic=15686.0