From: Robert R. <rra...@ya...> - 2000-12-01 19:03:42
|
When you use DynAPI.include(), you do not have to put the .js extension with the current implementation. The reason it is done in the addLibrary is so it does not have to be concatenated on each library item in the for loop. So, it is more efficient to add the .js to the files in addLibrary (this is usually done internally in the DynAPI, anyways). And, currently the .js is not required in the include(). So, I don't see a reason to change this. I don't think any other solution will be quite as fast as now (unless you require the .js). -- // Robert Rainwater On Sat, 02 Dec 2000 02:48:28 +1100 Michael Pemberton <mp...@ph...> wrote: > Does anyone here name their javascript files with any extension other than.js?I only ask this because I find it annoying that I have to put .js atthe end of each library entry and also in all of the include lines.Surely it is easier if you just place .js in the include code and thenwe don't have to worry about it ever again.Here's what I'm talking about: include : function(src,path) { > if(src.substring(src.length-3)!=".js")src+=src.substring(0,src.length-3) > if (!path) var path=DynAPI.librarypath > var pckg=src.substring(0,src.indexOf('.')) > var groupname=src.substring(src.indexOf('.')+1) > var realsrc=groupname.substring(groupname.indexOf('.')+1) > groupname=groupname.substring(0,groupname.indexOf('.')) > if (src.indexOf('.*')>0){ > src=src.substring(0,src.indexOf('.*')) > if (DynAPI.packages[pckg]) group=DynAPI.packages[pckg].libs[groupname] > if (group) for (var i in group) document.write('<script language="Javascript1.2"_ > src="'+path+pckg+'/'+groupname+'/'+group[i]+'.js"><\/script>') > else alert(DynAPI.toString()+'\n\nError occured\nThe following packagecould not_ > be loaded:\n'+src+'\n\nmake sure you specified the correct path.') > } else document.write('<scriptLanguage="Javascript1.2"_ > src="'+path+pckg+'/'+groupname+'/'+realsrc+'.js"><\/script>') > } > DynAPI.addLibrary('dynapi.api',["dynlayer","browser","dyndocument","events","dragevent"]) > I know this is not as important as getting the bugs worked out, butit does make it alot more "MS User" friendly. (what, the files have extensions?: P ) > -- > Michael Pemberton > mp...@ph... > ICQ: 12107010_______________________________________________Dynapi-Dev mailing lis...@li...http://lists.sourceforge.net/mailman/listinfo/dynapi-dev |