Welcome Guest.   Make a donation to an author on the site December 22, 2014, 06:52:42 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Read the full one-year retrospective report on DonationCoder.com.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 2 [3]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: New FARR plugin : FSubScript enable loading of multiple javascript plugins  (Read 21016 times)
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #50 on: November 22, 2008, 06:42:55 PM »

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

great!
Logged
ewemoa
Honorary Member
**
Posts: 2,524



View Profile Give some DonationCredits to this forum member
« Reply #51 on: November 25, 2008, 07:14:02 AM »

Attached, please find the latest.

Some changes include:

Fubscript/fscript.js:
  • checking for existence of plugin search, trigger, and receive functions before attempting to call them

3 plugins are bundled with this archive:
  • colors
  • Akete
  • Mixer - this is a repackaging of Webgrab

ecaradec, I had a question about some of the code in FSubScript/fscript.js -- specifically the .showSettings() and .settingsChanged() lines that sit outside of the for () {} constructs, but as I was composing this post, I think I figured out that I was confused, so please disregard the comments there smiley

* FSubScriptExperimentalWithPlugins-2008-11-25.zip (29.35 KB - downloaded 196 times.)
Logged
czb
Moderator
*****
Posts: 335



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #52 on: November 27, 2008, 03:37:42 AM »

Could you pls create a txt help file with all functions and other calls that fsubscript coder can use?
also pls bundle fscript.dll smiley
Logged

My open-source online piano game: http://musicope.com/
ewemoa
Honorary Member
**
Posts: 2,524



View Profile Give some DonationCredits to this forum member
« Reply #53 on: November 27, 2008, 06:02:28 AM »

May be ecaradec wouldn't mind updating his "fingers in the nose" guide smiley
Logged
czb
Moderator
*****
Posts: 335



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #54 on: November 27, 2008, 07:23:52 AM »

I must say it is a great plugin  Thmbsup

Just an idea:

  • not only fsubscript.js should be searched but maybe files fsubscript*.js so you can have more files in one folder

Here is my corrected fsubscript plugin
Quote
and JScalc:
Quote

fsubscript changes:
  • all fsubscript*.js are loaded (for example fsubscript_JSON.js)
  • implemented onSetStrValue
  • implemented onInit
JSCalc changes:
  • rewriten to work with fsubscript only
  • new TriggerCharacters settings added where you can define special characters which are to trigger JScalc (default is "TriggerCharacters":"/\\$\\*\\+\\-\\^\\(\\)" )
Logged

My open-source online piano game: http://musicope.com/
ewemoa
Honorary Member
**
Posts: 2,524



View Profile Give some DonationCredits to this forum member
« Reply #55 on: November 27, 2008, 08:43:52 AM »

Haven't tested yet, but hope to soon.

ecaradec: czb and I were chatting and started to wonder about extending things via prototypes -- e.g. String and trim.  Do you have any good ideas about how this might be managed to reduce (or eliminate?) conflicts among code produce by various plugin authors?
Logged
ewemoa
Honorary Member
**
Posts: 2,524



View Profile Give some DonationCredits to this forum member
« Reply #56 on: November 27, 2008, 09:54:36 AM »

Some initial comments on a few things I've looked at so far:

I noticed that for onSearchBegin(), a sub-plugin (?) defines search(), for onReceiveKey(), a sub-plugin defines receive(), and for onProcessTrigger(), a sub-plugin defines trigger().  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?

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.  Is that what we want?  What if more than one sub-plugin returns a value and one returns true while another returns false?  May be the current implementation is what we want -- which would be fine by me, I just don't currently have a sense of what it should be smiley

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'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
Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #57 on: November 27, 2008, 04:24:50 PM »

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.
Inclusion of other files can be done with eval(getTextFile("json.js")) if your plugin is too big to practically work in one file.
Quote
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.

I'm please to see you on board czb smiley
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ewemoa
Honorary Member
**
Posts: 2,524



View Profile Give some DonationCredits to this forum member
« Reply #58 on: November 28, 2008, 08:16:31 AM »

I didn't exactly follow what you meant about the naming of things, but thanks for the review and feedback.

Since my experience and understanding of FARR and FScript is rather limited, I guess my comments are likely to be too smiley
Logged
czb
Moderator
*****
Posts: 335



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #59 on: November 28, 2008, 08:58:29 AM »

hi,

Quote
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

Quote
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.
 
Well this behaviour is for pcommand where you have to tell FARR that at least 1 plugin treated it so FARR would not display error message. I do not know other usage of returning value to FARR from OnSetStrValue, so if you know of any we can implement it Wink But at least some implementation is necessary because pcommand is used quite often.

Quote
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 smiley

Quote
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
Quote
Inclusion of other files can be done with eval(getTextFile("json.js")) if your plugin is too big to practically work in one file.

Well aceradec showed one way which is in fact very easy and straitforward, but still I would keep name variation just for the case when you want to have several small subplugins in one directory which can easily occur. But we can discuss that and if we find it as "baad" idea we can always erase it Wink

Quote
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.

Yes exactly that is what I proposed to ewemoa. To have list of useful functions which make js developers life easier. The problem is to decide which to add on the list Wink

I have also one request to ewemoa and aceradec and maybe mouser. Could one of you pls create any environment where we could colaborate on fsubscript plugin? Like propose new modifications etc... I have no experience with that so I will leave it on somebody else smiley
Logged

My open-source online piano game: http://musicope.com/
Pages: Prev 1 2 [3]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.036s | Server load: 0.41 ]