Hutia 的 JS 代码集_javascript技巧_脚本之家

main.basic.js复制代码
代码如下:/**************************************************
*TheBasicLibforHUTIAframework *Author:Hutia *E-Mail:Hutia2@gmail.com
*Create:2006-08-21 *LastModify:2006-08-26 *Version:1.02
*CopyrightDeclare:Everybodycanuseforfreelybutcannotbeusedincommerce. *
*Pleasekeepthisinformationwhilequote. **/
//********BEFOREALL**************
varcurrentLibName=”main.basic”; try{//catchalltheexceptionsduringloading
//=================DeclareCONSTANTSection===Start===========
varvbOK=0;varvbOKCancel=1;varvbAbortRetryIgnor=2;varvbYesNoCancel=3;
varvbYesNo=4;varvbRetryCacel=5;varvbStop=16;varvbQuest=32;varvbAlert=48;
varvbInfo=64;varvbReturnOK=1;varvbReturnCacel=2;varvbReturnAbort=3;
varvbReturnRetry=4;varvbReturnIgnor=5;varvbReturnYes=6;varvbReturnNo=7;
varvbCrLf=”\r\n”;
//—————–DeclareCONSTANTSection-End—————
/////////////////////////////////////////////////////////////////////////
//=================DeclareGlobalVariableSection===Start===========
varSITE_ROOT=”E:\\hutia\\program\\Developing\\GJS_v3″.replace.replace;
//—————–DeclareGlobalVariableSection-End—————
/////////////////////////////////////////////////////////////////////////
//=================DeclareGlobalFunctionSection===Start===========
//AliaNameforAsynLoader.depend
$depend=function(str,currentLibName,defer){
AsynLoader.depend(str,currentLibName,defer); }
//AliaNameforAsynLoader.include $include=function{ AsynLoader.include; }
functionsay; } functionuid(){ return.getTime+parseInt.toString; }
//—————–DeclareGlobalFunctionSection-End—————
/////////////////////////////////////////////////////////////////////////
//=================DeclareGlobalObjectSection===Start===========
//Theasynchronousloader varAsynLoader=newfunction(){
//delareprivatevariable
varalias,currentPath,dependences,dependent,libs,paths; }
AsynLoader.alertLoadResult=function(){ varstr=””;
for{if{str+=”Load\””+i+”\”Successfully.\r\n”;}else{str+=libs[i]+”\r\n”;}}
say; } AsynLoader.alias=function(aliasName,strPath,singleInstance){
strPath=this.getPath;
if(!strPath||typeof!=”string”||aliasName==””)return;
alias[aliasName]=strPath; alias[aliasName][2]=Boolean; }
AsynLoader.depend=function(strLibName,strSrcLibName,defer){
if!=”string”||strLibName==””)throw; if(libs[strLibName]!=”loaded”){
if(defer&&alias[strLibName]){ AsynLoader.include;
}elsethrow(“Dependencevalidationfailure.\r\n”+libs[strLibName]); }
if==”string”&&strSrcLibName!=””){ temp=strSrcLibName+”=>”+strLibName;
dependences.push; } } AsynLoader.getDependBy=function{ varre=newArray();
for(vari=0;i”); break; case”vbs”: document.write(“”); break; case”css”:
document.write(“”); break;
case”jpg”:case”gif”:case”bmp”:case”jpeg”:case”png”: document.write(“”);
break; default: document.write(“”); break; } } AsynLoader.init=function;
currentPath=””; dependences=newArray(); dependent=newArray;
paths=newArray(); this.pathType=”absolute”; } AsynLoader.libs=function{
varre=newArrayif^blnNotLoaded)re.push; }
AsynLoader.loadFailure=function{ ifreturn;
libs[strLibName]=”Loading”+strLibName+”modelFailed:\r\n”;
forlibs[strLibName]+=””+i+”:”+e[i]+”\r\n”; }
AsynLoader.loadSuccess=function{ libs[strLibName]=”loaded”; }
AsynLoader.setPath=function{ if!=”string”)return;
currentPath=strPath.replace.replace; }
AsynLoader.singleInstance=function{ if{ strPath=alias[strPath]; }else{
strPath=this.getPath; } ifreturn; strPath=strPath[0]; if{ throw;
}else{ paths[strPath]=true; } } AsynLoader.init();
//—————–DeclareGlobalObjectSection-End—————
/////////////////////////////////////////////////////////////////////////
//=================InitializationSection===Start===========
AsynLoader.pathType=”relative”; AsynLoader.include;
//—————–InitializationSection-End—————
//*****************AFTERALL***********************
AsynLoader.loadSuccess; }catch{AsynLoader.loadFailure;}
////////////////////////////////////////////////////////////////
///////////////////FileEnd//////////////////////////
////////////////////////////////////////////////////////////////

发表评论

电子邮件地址不会被公开。 必填项已用*标注