Works with Allaire Corp's ColdFusion Studio or HomeSite, v4.0 and up
(c) 2000 by Nate Weiss (nate@nateweiss.com). All rights reserved.
Visit www.nateweiss.com from time to time for updates, etc.
also:
The Script Explorer was put together while I was working on a project that called for a large number of client-side JavaScript functions. The files were in several separate files, and I found that I was constantly printing them out or switching back and forth between them to remind myself of the exact function names and arguments, etc.
Note:
In this document, the term JavaScript refers to both JavaScript
and JScript. The term function
refers to a JavaScript function, a VBScript Sub, or a VBScript Function (unless
stated otherwise).
So I put together this little utility, which gives you a handy way to look at all the functions in all your open files (see screenshot below). In addition to giving you this quick "jog your memory" listing, it also lets you "jump" quickly to a function, or insert a call to the function into your work. It will also add a comment block to the top of your file to enumerate all the functions in the file, to make your files somewhat more "self-documenting". At first, it worked only with .js files, but I expanded it to work with either JavaScript/JScript or VBScript, in straight HTML files, or code files like .cfm, .asp, etc.
The Explorer was designed with client-side scripts in mind, but I imagine it will also be helpful for people working with server-side JavaScript (via Netscape Enterprise/iPlanet/LiveWire) or server-side JScript/VBScript (via Active Server Pages, etc).
This is a simple utility. It's useful but not particularly ambitious. For now, note that:
It's possible that I might expand/improve upon this thing in the future. Feel free to send suggestions my way, although I may not respond.
That's it! Close the dialogs and the button should be available. Test it out by clicking the new Toolbar button. If you get an "Automation Server" error message, then see ScriptX Requirement, below. If you get any kind of "file not found" message, then you probably didn't put the files in the right place (see step 1, above).
While you're working with files that contain JavaScript or VBScript functions, just click the toolbar button to bring up the Script Explorer.

|
|
Annotate - Inserts a comment block at the top of the selected document, enumerating all the functions in the file, with their line numbers and comments.
|
|
|
Go To: Brings the editor to the selected function, and closes the dialog box. You're ready to edit or take a look at the function. |
|
|
Scroll To: Same as Go To, execpt the dialog stays open. Useful for jogging your memory about how a function works. |
|
|
Insert: Inserts the selected function name and arguments into the current document (that is, the document you were working on when you opened the dialog). |
The Script Explorer supports a little bit of customization:
· Color Coding: By default, JavaScript functions are shown with black text on white, and VBScript functions are shown with navy text on light blue. The file langs.css can be adjusted to use different colors for each, using standard CSS syntax.
·
File Extensions: The Script Explorer usually scans files for both JavaScript and
VBScript functions. For some files,
though, it's obvious that there will never be both types of functions present. For instance, .js
files would presumably never contain a VBScript function declaration. You can adjust the DONT_SCAN_FOR_JS_EXTS
and DONT_SCAN_FOR_VB_EXTS values in the Preferences.js file to change which files do not
get scanned for which script languages.
For instance, if you knew you were never going to have any VBScript
functions in your straight HTML files, you could add "htm" and
"html" to the list of extensions for which VBScript scanning should
be skipped.
·
Double-Click Behavior: By default, when you
double-click in the list of functions, you are brought to that spot in the file
(as if you had clicked the "Go To" button). If you wish, you can change this behavior so that double-clicking
inserts the current function, or merely scrolls to it. To change the behavior, change the ON_DOUBLE_CLICK value in the Preferences.js
file. Allowable values are
"Insert", "Go To", or "Scroll To"
(case-sensitive).
The
Script Explorer requires that the ScriptX
runtime files be installed on your system.
Depending on the version of CF Studio or HomeSite you're using, this may
or may not be the case already.
|
Studio/HomeSite |
What
you need to do |
|
4.0 |
You will need to download and install ScriptX. |
|
4.01 |
You
should be all set. |
|
4.5 |
|
|
4.51 |
You
should be all set. |
You can also install the
Script Explorer "manually", if you don't want to use the Install.js
script or if it doesn't work for some reason.
o For "Script File": specify jsFnBrowser.js
o For "Button Image": specify jsFnBrowser.bmp
o For "Button Caption": leave blank
o For "Button Hint": type "Script Explorer"

2/10/99: Initial Release
2/17/99: Added support for VBScript, Preferences.js, langs.css.