main.basic.js
复制代码 代码如下:
/**************************************************
* 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="\r\n";
//----------------- 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.\r\n";}else{str+=libs[i]+"\r\n";}}
say(str);
}
AsynLoader.alias=function(aliasName,strPath,singleInstance){
strPath=this.getPath(strPath);
if(!strPath||typeof(aliasName)!="string"||aliasName=="")return;
alias[aliasName]=strPath;
alias[aliasName][2]=Boolean(singleInstance);
}
AsynLoader.depend=function(strLibName,strSrcLibName,defer){
if(typeof(strLibName)!="string"||strLibName=="")throw("Invalid Lib Name.");
if(libs[strLibName]!="loaded"){
if(defer&&alias[strLibName]){
AsynLoader.include(strLibName);
}else throw("Dependence validation failure.\r\n"+libs[strLibName]);
}
if(typeof(strSrcLibName)=="string"&&strSrcLibName!=""){
temp=strSrcLibName+" => "+strLibName;
dependences.push(temp);
}
}
AsynLoader.getDependBy=function(str){
var re=new Array();
for(var i=0;i<dependences.length;i++)if(dependences[i].split(" => ")[1]==str)re.push(dependences[i].split(" => ")[0]);
return(re.join(";"));
}
AsynLoader.getDependOn=function(str){
var re=new Array();
for(var i=0;i<dependences.length;i++)if(dependences[i].split(" => ")[0]==str)re.push(dependences[i].split(" => ")[1]);
return(re.join(";"));
}
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<strPath.length-2){
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("<scr"+"ipt type=\"text\/javascript\" src=\""+strPath+"\" ><\/scr"+"ipt>");
break;
case "vbs":
document.write("<scr"+"ipt type=\"text\/vbscript\" src=\""+strPath+"\"><\/scr"+"ipt>");
break;
case "css":
document.write("<link rel=\"stylesheet\" type=\"text\/css\" href=\""+strPath+"\" \/>");
break;
case "jpg": case "gif": case "bmp": case "jpeg": case "png":
document.write("<img alt=\"\" "+(className?" class=\""+className+"\" ":"")+" src=\""+strPath+"\" \/>");
break;
default:
document.write("<iframe frameBorder=\"0\" "+(className?" class=\""+className+"\" ":"")+" src=\""+strPath+"\"><\/iframe>");
break;
}
}
AsynLoader.init=function(){
alias=new Array();
currentPath="";
dependences=new Array();
dependent=new Array();
libs=new Array();
paths=new Array();
this.pathType="absolute";
}
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:\r\n";
for(var i in e)libs[strLibName]+=" "+i+":"+e[i]+"\r\n";
}
AsynLoader.loadSuccess=function(strLibName){
libs[strLibName]="loaded";
}
AsynLoader.setPath=function(strPath){
if(typeof(strPath)!="string")return;
currentPath=strPath.replace(/\\/g,"\/").replace(/([^\/])$/,"$1\/");
}
AsynLoader.singleInstance=function(strPath){
if(alias[strPath]){
strPath=alias[strPath];
}else{
strPath=this.getPath(strPath);
}
if(!strPath)return(false);
strPath=strPath[0];
if(paths[strPath]){
throw("exit");
}else{
paths[strPath]=true;
}
}
AsynLoader.init();
//----------------- Declare Global Object Section - End ---------------
/////////////////////////////////////////////////////////////////////////
//================= Initialization Section === Start ===========
AsynLoader.pathType="relative";
AsynLoader.include("js/main.alias.js");
//----------------- Initialization Section - End ---------------
//***************** AFTER ALL ***********************
AsynLoader.loadSuccess(currentLibName);
}catch(e){ AsynLoader.loadFailure(currentLibName); }
////////////////////////////////////////////////////////////////
/////////////////// File End //////////////////////////
////////////////////////////////////////////////////////////////
复制代码 代码如下:
/**************************************************
* 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="\r\n";
//----------------- 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.\r\n";}else{str+=libs[i]+"\r\n";}}
say(str);
}
AsynLoader.alias=function(aliasName,strPath,singleInstance){
strPath=this.getPath(strPath);
if(!strPath||typeof(aliasName)!="string"||aliasName=="")return;
alias[aliasName]=strPath;
alias[aliasName][2]=Boolean(singleInstance);
}
AsynLoader.depend=function(strLibName,strSrcLibName,defer){
if(typeof(strLibName)!="string"||strLibName=="")throw("Invalid Lib Name.");
if(libs[strLibName]!="loaded"){
if(defer&&alias[strLibName]){
AsynLoader.include(strLibName);
}else throw("Dependence validation failure.\r\n"+libs[strLibName]);
}
if(typeof(strSrcLibName)=="string"&&strSrcLibName!=""){
temp=strSrcLibName+" => "+strLibName;
dependences.push(temp);
}
}
AsynLoader.getDependBy=function(str){
var re=new Array();
for(var i=0;i<dependences.length;i++)if(dependences[i].split(" => ")[1]==str)re.push(dependences[i].split(" => ")[0]);
return(re.join(";"));
}
AsynLoader.getDependOn=function(str){
var re=new Array();
for(var i=0;i<dependences.length;i++)if(dependences[i].split(" => ")[0]==str)re.push(dependences[i].split(" => ")[1]);
return(re.join(";"));
}
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<strPath.length-2){
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("<scr"+"ipt type=\"text\/javascript\" src=\""+strPath+"\" ><\/scr"+"ipt>");
break;
case "vbs":
document.write("<scr"+"ipt type=\"text\/vbscript\" src=\""+strPath+"\"><\/scr"+"ipt>");
break;
case "css":
document.write("<link rel=\"stylesheet\" type=\"text\/css\" href=\""+strPath+"\" \/>");
break;
case "jpg": case "gif": case "bmp": case "jpeg": case "png":
document.write("<img alt=\"\" "+(className?" class=\""+className+"\" ":"")+" src=\""+strPath+"\" \/>");
break;
default:
document.write("<iframe frameBorder=\"0\" "+(className?" class=\""+className+"\" ":"")+" src=\""+strPath+"\"><\/iframe>");
break;
}
}
AsynLoader.init=function(){
alias=new Array();
currentPath="";
dependences=new Array();
dependent=new Array();
libs=new Array();
paths=new Array();
this.pathType="absolute";
}
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:\r\n";
for(var i in e)libs[strLibName]+=" "+i+":"+e[i]+"\r\n";
}
AsynLoader.loadSuccess=function(strLibName){
libs[strLibName]="loaded";
}
AsynLoader.setPath=function(strPath){
if(typeof(strPath)!="string")return;
currentPath=strPath.replace(/\\/g,"\/").replace(/([^\/])$/,"$1\/");
}
AsynLoader.singleInstance=function(strPath){
if(alias[strPath]){
strPath=alias[strPath];
}else{
strPath=this.getPath(strPath);
}
if(!strPath)return(false);
strPath=strPath[0];
if(paths[strPath]){
throw("exit");
}else{
paths[strPath]=true;
}
}
AsynLoader.init();
//----------------- Declare Global Object Section - End ---------------
/////////////////////////////////////////////////////////////////////////
//================= Initialization Section === Start ===========
AsynLoader.pathType="relative";
AsynLoader.include("js/main.alias.js");
//----------------- Initialization Section - End ---------------
//***************** AFTER ALL ***********************
AsynLoader.loadSuccess(currentLibName);
}catch(e){ AsynLoader.loadFailure(currentLibName); }
////////////////////////////////////////////////////////////////
/////////////////// File End //////////////////////////
////////////////////////////////////////////////////////////////
标签:
Hutia,的,JS,代码集
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“Hutia 的 JS 代码集”评论...
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。