ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > FARR Plugins and Aliases

FSubScript Feature Requests

<< < (3/5) > >>

ecaradec:
The original purpose of FSubScript was to enable to write and share plugins more easily. It is good news that people experiment FSubScript versions. However I'm a bit lost in the rapid evolutions and the various versions. I don't know what to merge, what is the context and purpose of changes added.
May be the real purpose of FSubScript is to enable FARR user to write their own small plugins and the fact that there is no official FSubScript version is not an issue ? However I find that the original purpose would still be nice.

Here are possibilities we could change the current state :

I may eventually package an official version. However this would only be useful if we want to share plugins.

I think there is two kind of changes : extension functions and fsubscript behavior change.

Extension functions could be easily packaged as individual files and loaded by fsubscript. Functions like this could be store in individual file of folder and be managed by individual person. Ex : a function like enumRegistryKey could be defined in a fsubscriptExt.js and loaded by fsubscript before all scripts. This function could be used by any subscript. Plugins writer could propose individual extensions package whose purpose would be well identified and thus would be easier to track.

FSubscript behavioral changes could be done a bit the same way by replacing fsubscript default methods, but this is more fragile and I'm not sure it is a good idea. I would not go for it right now.

ewemoa:
The original purpose of FSubScript was to enable to write and share plugins more easily.
-ecaradec (December 14, 2008, 05:49 AM)
--- End quote ---

I don't think I'm alone in saying that I still believe this to be a good purpose.

However I'm a bit lost in the rapid evolutions and the various versions. I don't know what to merge, what is the context and purpose of changes added.

--- End quote ---

The main thing I worked on w/ mouser that I did not explain well (to the best of my memory) is improvement of the behavior of onBeginSearch().  I think (most of) the changes we made came about as a result of working on getting the Keyser plugin (the original FSubScript version) to function properly.  We found that the experimental changes we made to FSubScript for it to handle aliases not prefixed w/ "fssc" originally were insufficient to work correctly in certain scenarios so we tried to see if we could get better behavior by modifying FSubScript's fscript.js (and in the process, IIRC, FARR was brushed up a bit too).  In retrospect, I guess it might have been better if we explicitly posted the problems we found and the changes we made as attempts to address these issues.  I am sorry we didn't do that.

If there are specific things in our version of onBeginSearch() that don't make sense to you, please ask us.  I can try to explain why some code is the way it is, and although I may not succeed at this, mouser is likely to be able to clear up my poor attempts ;)

ewemoa:
Since the typeof operator appears to be slightly broken, may be we can consider adding the following (typeOf function) in some capacity:

typeOf

The typeof prefix operator returns a string based on the type of its parameter. Unfortunately, it provides the wrong result if the operand is null or an array.

The new typeOf global function is intended to replace the defective typeof operator. It produces the same result as typeof, except that it returns 'null' for null and 'array' for arrays.

It can be implemented in JavaScript:

function typeOf(value) {
    var s = typeof value;
    if (s === 'object') {
        if (value) {
            if (typeof value.length === 'number' &&
                    !(value.propertyIsEnumerable('length')) &&
                    typeof value.splice === 'function') {             
                s = 'array';
            }
        } else {
            s = 'null';
        }
    }
    return s;
}

--- End quote ---

I found it at:

http://javascript.crockford.com/recommend.html

ewemoa:
I miss the x flag and named capture for regular expressions that Perl and Python have.

I noticed that someone has an extended regular expression library for JavaScript:

http://stevenlevithan.com/regex/xregexp/

It appears to have support for both of these things (and the license is MIT) :)

May be others will find this of some use and perhaps at some point we might consider it for FSubScript.

ecaradec:
Ewemoa I'm not sure we should add a regex library. Javascript has got one and even if this one is more powerful, most people don't master enough regexes so that it would make a difference (me included ).

However it could make sense as a extension library. If some plugin need it then it could chose to package itself as a fsubscript.js AND a extension.js that would be put in an extensions folder and evaluated in the global script space. That way other plugins could use the library, just tell that they require it to function and code won't be duplicated across many plugins.

There could be a separate maintainer for the library.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version