asfman
android developer
posts - 90,  comments - 213,  trackbacks - 0

var asfman = {};
var scriptNode = document.scripts[document.scripts.length-1];
 asfman.createDate = "2007-06-15";      
 asfman.version = "asfman 1.0";      
 asfman.author = "asfman";        
 asfman.path = scriptNode.src.replace(/[^\/]+$/i,"");  
 asfman.fileList = {};        
 if (scriptNode.getAttribute("import"))
 {
  $_$import(scriptNode.getAttribute("import"));
 }
ScriptNode = null;

(function $_$import(filePath)
{
 filePath = filePath.replace(/[^\|]+/g,function (str)
 {
  if(/\([^\)]+\)/.test(str))
  {
   var l = RegExp.leftContext;
   var m = RegExp.lastMatch;
   var r = RegExp.rightContext;
   str = m.slice(1,-1).replace(/[^\+]+/g,l+"$&"+r);alert(str);
  }
  str.replace(/[^\+]+/g,function(s)
  {
   if (!(/\.js$/.test(str)))
   {
    s = asfman.path + s.replace(/\./g,"/") + ".js";
   }
   if (!asfman.fileList[s])
   {
    document.write('<script src="'+s+'" language="javascript"><\/script>');
    asfman.fileList[s] = true;
   }
  });

 });
})("Function.(test1+test2)1|Prototype.String.(string1+string2)");

posted on 2007-06-15 14:34 汪杰 阅读(307) 评论(3)  编辑 收藏 引用 所属分类: javascript

FeedBack:
# re: framework 1.0
2007-06-15 16:28 | 汪杰
var asfman={}
var scriptNode = document.scripts[document.scripts.length-1];
asfman.createDate = "2007-06-15";
asfman.version = "asfman 1.0";
asfman.author = "asfman";
asfman.path = scriptNode.src.replace(/[^\/]+$/i,"");
asfman.fileList={};
if (scriptNode.getAttribute("import"))
{
$_$import(scriptNode.getAttribute("import"));
}
(function $_$import(filePath)
{
var re=/[^|]+/g;
var re2=/[^+]+/g;
var str,str2,l,r,m,path1,path2;
while(str=re.exec(filePath))
{
if(/\(([^)]+)\)/.test(str[0]))
{
l=RegExp.leftContext;
m=RegExp.lastParen;
r=RegExp.rightContext;
path1=m.replace(/[^+]+/g,l+"$&"+r);
}else{
path1=str[0];
}
while(str2=re2.exec(path1))
{
if(!(/\.js$/.test(str2[0])))
{
path2 = asfman.path + str2[0].replace(/\./g,"/") + ".js";
if(!asfman.fileList[path2])
{
document.write('<script src="'+path2+'" language="javascript"><\/script>');
asfman.fileList[path2] = true;
}
}
}
}
})("Function.dom|Prototype.String.trim")
  回复  更多评论
  
# re: framework 1.0
2007-06-15 17:01 | 汪杰
var asfman={}
var scriptNode = document.getElementsByTagName("script")[document.getElementsByTagName("script").length-1];
asfman.createDate = "2007-06-15";
asfman.version = "asfman 1.2";
asfman.author = "asfman";
asfman.path = scriptNode.src.replace(/[^\/]+$/i,"");
asfman.fileList={};
if (scriptNode.getAttribute("import"))
{
$_$import(scriptNode.getAttribute("import"));
}
(function $_$import(filePath)
{
var re=/[^|]+/g;
var re2=/[^+]+/g;
var str,str2,l,r,m,path1,path2;
while(str=re.exec(filePath))
{
path1=str[0];
if(/\(([^)]+)\)/.test(path1))
{
l=RegExp.leftContext;
m=RegExp.lastParen;
r=RegExp.rightContext;
path1=m.replace(/[^+]+/g,l+"$&"+r);
}
while(str2=re2.exec(path1))
{
path2=str2[0];
if(!(/\.js$/.test(path2)))
{
path2 = asfman.path + str2[0].replace(/\./g,"/") + ".js";
}
if(!asfman.fileList[path2])
{
document.write('<script src="'+path2+'" language="javascript"><\/script>');
asfman.fileList[path2] = true;
}
}
}
})("Function.dom|Prototype.String.trim")
  回复  更多评论
  
# re: framework 1.0
2007-10-07 15:28 | 汪杰
var isIE=(navigator.appName=="Microsoft Internet Explorer");
var asfman={};

//initialize
(function(){
var scriptNode = document.getElementsByTagName("script")[document.getElementsByTagName("script").length-1];
asfman.createDate = "2007-06-15";
asfman.lastEditDate ="2007-09-29";
asfman.author = "asfman";
asfman.path = scriptNode.src.replace(/[^\/]+$/i,"");
asfman.fileList = {};
$import("base");
if (scriptNode.getAttribute("import"))
{
$import(scriptNode.getAttribute("import"));
}
scriptNode = null;
})();

//construct main funciton
function $import(filePath)
{
var re=/[^|]+/g;
var re2;
var l,r,m,path1,path2;
while(re.test(filePath))
{
path1=RegExp.lastMatch;
if(/\((.+?)\)/.test(path1))
{
l=RegExp.leftContext;
m=RegExp.lastParen;
r=RegExp.rightContext;
path1=m.replace(/[^+]+/g,l+"$&"+r);
}
re2=/[^+]+/g;
while(re2.test(path1))
{
path2=RegExp.lastMatch;
if(!(/\.js$/.test(path2)))
{
path2 = asfman.path + path2.replace(/\./g,"/") + ".js";
}
else
{
path2=asfman.path + path2.replace(/\.(?!js$)/g,"/");
}
if(!asfman.fileList[path2])
{
document.write('<script src="'+path2+'" language="javascript"><\/script>');
asfman.fileList[path2] = true;
}
}
}
}

$import("function.(dom+createXmlhttp+json+cookie+calendar+$load+date+swfobject)|class.HighLightClass|prototype.String.(trim+urlEncode)|css.(createCss+skin)|debug");  回复  更多评论
  
只有注册用户登录后才能发表评论。

<2024年12月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

常用链接

留言簿(15)

随笔分类(1)

随笔档案(90)

文章分类(727)

文章档案(712)

相册

收藏夹

http://blog.csdn.net/prodigynonsense

友情链接

最新随笔

搜索

  •  

积分与排名

  • 积分 - 468991
  • 排名 - 6

最新随笔

最新评论

阅读排行榜

评论排行榜