/************************************************** * The Basic Lib for HUTIA frame work * Author: Hutia * E-Mail: Hutia2@gmail.com * Create: 2006-08-21 * Last Modify: 2006-08-26 * Version: 1.02 * Copyright Declare: Everybody can use for freely but can not be used in commerce. * * Please keep this information while quote. **/
//******** BEFORE ALL ************** var currentLibName="main.basic";
try{ // catch all the exceptions during loading
//================= Declare CONSTANT Section === Start =========== var vbOK=0; var vbOKCancel=1; var vbAbortRetryIgnor=2; var vbYesNoCancel=3; var vbYesNo=4; var vbRetryCacel=5; var vbStop=16; var vbQuest=32; var vbAlert=48; var vbInfo=64; var vbReturnOK=1; var vbReturnCacel=2; var vbReturnAbort=3; var vbReturnRetry=4; var vbReturnIgnor=5; var vbReturnYes=6; var vbReturnNo=7; var vbCrLf="rn";
//----------------- Declare CONSTANT Section - End --------------- ///////////////////////////////////////////////////////////////////////// //================= Declare Global Variable Section === Start =========== var SITE_ROOT="E:\hutia\program\Developing\GJS_v3".replace(/\/g,"/").replace(/([^/])$/,"$1/");
//----------------- Declare Global Variable Section - End --------------- ///////////////////////////////////////////////////////////////////////// //================= Declare Global Function Section === Start ===========
// Alia Name for AsynLoader.depend $depend=function(str,currentLibName,defer){ AsynLoader.depend(str,currentLibName,defer); }
// Alia Name for AsynLoader.include $include=function(str){ AsynLoader.include(str); }
function say(str){ alert(str); }
function uid(){ return("u" (new Date()).getTime().toString(35) parseInt(Math.random()*999999).toString(35)); }
//----------------- Declare Global Function Section - End --------------- ///////////////////////////////////////////////////////////////////////// //================= Declare Global Object Section === Start =========== // The asynchronous loader var AsynLoader= new function(){ // delare private variable var alias, currentPath, dependences, dependent, libs, paths; }
AsynLoader.alertLoadResult=function(){ var str=""; for(var i in libs){if(libs[i]=="loaded"){str ="Load "" i "" Successfully.rn";}else{str =libs[i] "rn";}} say(str); }
AsynLoader.getLibs=function(){ var re=new Array(), hash=new Array(); for(var i in libs)if(!hash[i]){hash[i]=true;re.push(i);} re.sort(); return(re.join(";")); }
AsynLoader.getPath=function(strPath){ var ext, i, re, strPath; if(typeof(strPath)!="string"||strPath=="")return(false); ext="js"; if(strPath.indexOf(":")==-1)if(this.pathType=="absolute"){strPath=SITE_ROOT currentPath strPath;}else{strPath=currentPath strPath;} i=strPath.lastIndexOf("."); if(i!=-1&&i ext=strPath.substring(i 1).toLowerCase(); }else{ strPath=strPath "." ext; } return([strPath,ext]); }
AsynLoader.include=function(strPath,className){ var ext, i, singleInstance, strPath; if(alias[strPath]){ strPath=alias[strPath]; }else{ strPath=this.getPath(strPath); } if(!strPath)return(false); ext=strPath[1]; singleInstance=Boolean(strPath[2])||className=="singleInstance"||paths[strPath]=="singleInstance"; strPath=strPath[0]; if(singleInstance&&paths[strPath])return; paths[strPath]=singleInstance?"singleInstance":true; switch(ext){ case "js": document.write(""); 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.libs=function(blnNotLoaded){ var re=new Array(); for(var i in libs)if((libs[i]=="loaded")^blnNotLoaded)re.push(i); return(re); }
AsynLoader.loadFailure=function(strLibName,e){ if(e=="exit")return; libs[strLibName]="Loading " strLibName " model Failed:rn"; for(var i in e)libs[strLibName] =" " i ":" e[i] "rn"; }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn