As I have it now there is no way to call an event because the loader itself can load
the event objects, and is meant to be included before any other files. I could add a
subobject (if event.js is included manually) to call such events. I agree this is is
a good idea so I will keep it in mind.
As Robert mentioned, you can't call DynAPI.library.load() inside the file, the
dependencies must be assigned before you load the file. The dependency list for all
the files within DynAPI will already be there. But for your own objects, you'll need
to include that code in your page (or in a js file that is loaded through the
libloader beforehand).
For adding scripts to the library loader they are case sensitive, they should be the
same as the object names because I deal with finding those objects after they are
loaded, and display output in the debugger that they are found.
The library loader is growing kinda big now (7kb), but I think I'm still going to
include it in dynapi.js by default because it's very good code even for just replacing
DynAPI.include(). You'll want use it.
On other topics...
- Does anyone else tire of having to type "DynAPI" instead of just "dynapi", or am I
just getting lazy? I'm going to include a duplicate pointer for that. An aesthetic
argument for such a change is that global objects in JavaScript and Java are lowercase
also "java", "navigator", "location" - so "dynapi" makes sense also.
- dynapi.library.setPath() and getPath() will replace DynAPI.setLibraryPath()
instead of using dynapi.librarypath or dynapi.libraryPath you should now use
dynapi.library.path
- updated library add() and addPackage() syntax will be:
dynapi.library.addPackage(packageName, packagePath); // path is relative to
dynapi.library.path
dynapi.library.add(objectName,objectSrc,dependedObjects,packageName);
Examples:
dynapi.library.addPackage('mypackage','mypackage/');
dynapi.library.addPackage('mypackage.tools', 'mypackage/tools/');
dynapi.library.add('MyObject0', 'obj0.js', null, 'mypackage/tools/');
dynapi.library.add('MyObject1', 'obj1.js', 'MyObject0', 'mypackage/tools');
// when a package is assigned in add(), the src location becomes relative to the
package path
- you can load up scripts without a package assigned:
dynapi.library.add('Obj','obj.src');
- you can load a script with no object(s) assigned:
dynapi.library.loadScript('obj.src');
- instead of loading the scripts dynamically you can insert them just as
DynAPI.include() did:
dynapi.library.add('Obj','obj.src');
dynapi.library.include('Obj');
- I've got a class/inherit system pretty much down. Instead of doing the following
inside widget constructors::
this.DynLayer = DynLayer;
this.DynLayer();
you can now do:
this.inherit('ThisObject','ParentObject', argument1, argument2.... argument8);
This will set up some nice links between the objects, so you have methods like
getClassName(), getClass(), and isClass('obj') which finds if an object inherited
from, or is the same as the one given. Thus we no longer need ugly .isDynLayer
properties.
For a version number I'd at most like to go with 2.9. I hate inflated version
numbers, and I wouldn't want to call a beta version 3.0 because it needs even more
work yet before I'd call it complete - delete/remove() doesn't work, I haven't been
testing in Mozilla/Mac/IE4 very much, and mouse events need to be redone.
Cheers,
Dan Steinman
On Fri, Jan 04, 2002 at 07:33:29AM -0800, Raymond Irving wrote:
> Hello,
>
> It would also be nice if there was an event (e.g.
> onloadlibrary) that would get triggered whenever a
> library is loaded. This event could pass the current
> file and the total number of files to be loaded. Such
> an event could be used to create a progress bar to
> show the loading process.
>
> It would also be nice if the dependency structure was
> part of the widget specs
>
> example (Button Widget)
>
> // Button Widget 1.0
> // Dependencies
> DynAPI.library.add('Obj','obj.js','DependentObj');
>
> Button=function(){
> // code here...
> }
>
> Questions:
>
> 1) Are Object names case-sensitive?
> In other words, Is DynAPI.library.add('Obj') the same
> as DynAPI.library.add('obj')?
>
> 2) What happens if a user should add an object twice?
> Example:
> DynAPI.library.add('Obj')
> DynAPI.library.add('Obj')
> Will this create two entries in the library tree will
> it a attempt to reload the object?
>
>
> --- Dan Steinman <[EMAIL PROTECTED]> wrote:
> > When you "add()" an object to the library tree it
> > simply ensures that any objects that are required by
> > the script are loaded before it:
> >
> > DynAPI.library.add('DependentObj','dep.src');
> > DynAPI.library.add('Obj','obj.js','DependentObj');
> > DynAPI.library.load('Obj'); // loads DependentObj
> > before Obj
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
>
> _______________________________________________
> Dynapi-Dev mailing list
> [EMAIL PROTECTED]
> http://www.mail-archive.com/[email protected]/
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[email protected]/