Created by Samuel Reynolds.
Copyright © 1998 by Samuel Reynolds. All rights reserved.
See The Need
Fill The Need
An Include mechanism is implemented as an embedded macro. This allows you to assemble complex scripts from a library of smaller scripts or script fragments.
- 1.0b17 - 23 May 1999
- Fixed bug in Predefined.Replace.
- Removed calls to DEBUG from Predefined scripts.
- Class and Module renderers now recognize #copyright in the Class or Module table.
- Inserted as comment at start of rendered text for Class or Module.
- May be string, wptext, or outline.
- 1.0b16 - 18 Feb 1999
- In utils.LocateEntry, if item is found in page table, try to resolve original address of item.
- This allows jssource macro to properly generate relative addresses, so duplicate files aren't created.
- jssource macro improved:
- Now calls html.write instead of wp.writeWholeFile -- allows render-to-remote-site (FTP).
- Avoids creation of duplicate files as much as possible.
- Generates file if...
- File does not exist
- File is older than source entity
- Does not generate file if file exists and is newer than source entity.
- New JSInclude macro for doing "client-side includes".
- Avoids creation of duplicate files as much as possible.
- 1.0b15 - 4 Feb 1999
- Always get opening and closing script tags from utils.ScriptStartTag and utils.ScriptEndTag.
- Fixed problem with rendering class, array, and module entities with dependencies from #js subtable of website.
- Called-from addresses of the form website.["#js"].thescript became "website.["#js"].thescript".
- Fix: When generating [[Include(...)]] macros for dependencies, escape quotes in addresses.
- Now addresses of the form website.["#js"].thescript become "website.[\"#js"].thescript".
- Affects: class, array, and module table renderers.
- Added js_allowInheritance preference. Used by class renderer only.
- Reason: Some browsers (esp. Netscape 4.04/Mac) make prototype read-only.
- If TRUE, behavior is as before:
- Class constructor is empty except for assignment of non-null parameters.
- Class prototype is assigned new object of class or of inherited class.
- Default values and methods are assigned to class prototype.
- If FALSE:
- Inheritance is not allowed (presence of #inherits field results in scriptError).
- Prototype is not manipulated directly.
- Default values are assigned to the object IFF the prototype is null (indicating that it is just being created).
- Code is a little smaller.
- 1.0b14 - 17 Jan 1999
- Fixed bug in Init script.
- Now tries to...
- If this fails--if, for example, both tables have an item with the same name--Init puts up notice that user must fix manually.
- 1.0b13 - 12 Jan 1999
- Fixed 2 bugs in utils.LocateEntry.
- Was not finding entities in #js table in a website or directly in a website (as a directive).
- 1.0b12 - 7 Jan 1999
- Added two new prefs:
- LANGUAGE attribute of SCRIPT tag. May not be very useful, since it's global, but here it is.
- TYPE attribute of SCRIPT tag, per HTML 4.0 draft spec.
- Added in response to a suggestion from Deke Smith.
- 1.0b11 - 6 Jan 1999
- Changed log name in CheckDependencies so it has no spaces in it. (The log routines don't properly handle names with spaces.)
- This only shows up if the routine actually writes to the log--i.e., when a dependency error is detected.
- 1.0b10 - 3 Jan 1999
- Compatibility scripts
- Removed references to xfile.compat.
- There should now be no dependency on xfile.
- Modified default outline (script) renderer
- Rewrote default outline (script) renderer to speed it up.
- No longer walks outline (slow!)
- Copies outline contents to temp script object, then converts to text. Frontier does most of the work.
- Munges with regex after conversion to string.
- Speed improvement is greatest for large script (outline) entities, but not much for small ones.
- However, you can turn off some or all of the "prettifying":
- Set js_prettify=FALSE to turn off all unnecessary munging (default is TRUE).
- With js_prettify=TRUE, set js_prettifyComment=FALSE to turn off comment marker (//) alignment (default is TRUE).
- Now handles indented comments.
- Cleaned up occasional double-semicolons.
- Modified default module renderer.
- Now tells renderer to expand macros immediately.
- This is required so that any entity that a given entity depends on will be inserted before the dependent entity.
- Modified default class renderer
- Allow inititializing parameters in attributes that are class instances.
- Now attributes that are strings can be:
- 1. Simple string (becomes default value of attribute).
- Thus, the value could be "new Array(1,2,3,4,5)". However, see (3), below.
- 2. "class " + class_name -- attribute default value becomes "new ()"
- 3. "class " + class_name + "(" + + ")" -- attribute default value becomes "new " + everything after "class "
- Changes for improved class/object support
- When a string beginning with "class" is found in an attribute value, add the class name as another dependency.
- Add these detected dependencies after the explicit dependencies when inserting includes.
- Moved default values for class instance variables and methods from constructor to prototype, to properly support objects, classes, and inheritance.
- Should work for NN3+ and IE4+ browsers.
- Allow method entry to be either an outline or a string
- Script is assumed to be rendered separately.
- Implemented rendered-item cache to speed up rendering.
- Only atomic entities are cached.
- No table entities, because a change in a nested entry doesn't change the mod date of a table.
- First render (when item is entered in the cache) is about the same speed.
- Provides about 15-20% speedup for small script (outline) entities on subsequent renderings.
- Provides up to 60% speedup for large script (outline) entities on subsequent renderings.
- Speedup is highly variable. I'm not sure why, but I think it has to do with Frontier's processes and memory management.
- Speedup will be less for table entities.
- TimeModified() doesn't work with string entries, so each one is stored in its own subtable to get the time stamp.
- This is faster than converting from wptext every time we get the cached entity.
- Turn caching off by setting js_cacheRenderedText=FALSE (default is TRUE if undefined; default setting is FALSE).
- 1.0b9 - 4 Oct 1998
- Make sure you reinstall the html macros.
- Tracked down and fixed "Unable to render because file not found" bug when rendering directly into web page.
- Cause: ExpandInlineMacro() first checks to see if the macro exists as stated.
- html.data.standardMacros.include() treated specifier as file name, and tried to load it.
- Fix: Added special-case code to not accept the macro name as given if it is equal to "include" (case insensitive).
- Tracked down and fixed 'Can't find object ""' bug.
- Cause: LocateEntry() was checking existence of jsInfoTbl^.invokedFrom instead of jsInfoTbl^.invokedFrom^.
- Then it was attempting to create a new address entryAdr = @jsInfoTbl^.invokedFrom.[inEntryName].
- jsInfoTbl^.invokedFrom is an address, or is nil or empty string if undefined.
- Fix: Change jsInfoTbl^.invokedFrom to jsInfoTbl^.invokedFrom^ in both places.
- Fixed Render
- Fixed invokedFrom/invokedFrom^ bug as above.
- Delete threaded temp table when done so include logic works correctly.
- Otherwise, rendering directly into web page intermittently loses includes after first render.
- This happened because the threaded temp table is keyed by thread ID, but thread IDs are reused.
- In particular, the Publish Page command runs with the same thread ID (the main thread?) every time it's invoked from the menu.
- Changed remaining LocateScript calls to LocateEntry (mainly in html macros).
- Deleted LocateScript.
- 1.0b8 - 27 Sep 1998
- Added jssource macro.
- Basic script; works, but not very efficient. Could do much more.
- Added menu update command
- Invoke after adding or removing a custom template.
- Not needed for templates that override default templates.
- Finished up documentation of advanced features.
- 1.0b7 - 21 Sep 1998
- I love it when a design works right!
- It took me about 3 minutes to add the new command, including doc page!
- 1.0b6 - 20 Sep 1998
- Fixed bug in dependency checking.
- Added Module entity support (an entity that groups other entities).
- Removed op.setDisplay calls from outline (script) renderer.
- Getting error when rendering from web page that includes jsrender() macro.
- 1.0b5 - 19 Sep 1998
- Documented dependencies.
- Added dependency checking on install.
- Fixed typo (from dialog to dialog.notify) in menuCmd.ExtractFromText.
- 1.0b4 - 16 Sep 1998
- First public release.
- New Script: Cannot override the script template, due to bug in op.newOutlineObject.
- All other operations work as described in the documentation.