|
From: Michael P. <mp...@ph...> - 2000-12-01 15:50:38
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Does anyone here name their javascript files with any extension other than
.js?
<p>I only ask this because I find it annoying that I have to put .js at
the end of each library entry and also in all of the include lines.
<p>Surely it is easier if you just place .js in the include code and then
we don't have to worry about it ever again.
<p>Here's what I'm talking about:<tt></tt>
<p><tt> include : function(src,path) {</tt>
<br><tt> if(src.substring(src.length-3)!=".js")
src+=src.substring(0,src.length-3)</tt>
<br><tt> if (!path) var path=DynAPI.librarypath</tt>
<br><tt> var pckg=src.substring(0,src.indexOf('.'))</tt>
<br><tt> var groupname=src.substring(src.indexOf('.')+1)</tt>
<br><tt> var realsrc=groupname.substring(groupname.indexOf('.')+1)</tt>
<br><tt> groupname=groupname.substring(0,groupname.indexOf('.'))</tt>
<br><tt> if (src.indexOf('.*')>0)
{</tt>
<br><tt>
src=src.substring(0,src.indexOf('.*'))</tt>
<br><tt>
if (DynAPI.packages[pckg]) group=DynAPI.packages[pckg].libs[groupname]</tt>
<br><tt>
if (group) for (var i in group) document.write('<script language="Javascript1.2"_</tt>
<br><tt>
src="'+path+pckg+'/'+groupname+'/'+group[i]+'<b>.js</b>"><\/script>')</tt>
<br><tt>
else alert(DynAPI.toString()+'\n\nError occured\nThe following package
could not_</tt>
<br><tt>
be loaded:\n'+src+'\n\nmake sure you specified the correct path.')</tt>
<br><tt> } else document.write('<script
Language="Javascript1.2"_</tt>
<br><tt>
src="'+path+pckg+'/'+groupname+'/'+realsrc+'<b>.js</b>"><\/script>')</tt>
<br><tt> }</tt><tt></tt>
<p><tt> DynAPI.addLibrary('dynapi.api',["dynlayer","browser","dyndocument","events","dragevent"])</tt><tt></tt>
<p>I know this is not as important as getting the bugs worked out, but
it does make it alot more "MS User" friendly. (what, the files have extensions?
: P )
<p>--
<br>Michael Pemberton
<br>mp...@ph...
<br>ICQ: 12107010</html>
|