<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>资源收集</title>
<script src="../max.src" type="text/javascript"></script>
<script language="javascript">
window.onerror=function(){return true};
var oFrames=new VBArray(external.max_frames(current_Win)).toArray();
var Tab=1; //1=Image, 2=Media; 3=Links;
var TabNum=3;
var length, tipTimer, blurTimer=false;
var cfgPath=external.max_getObj($mx_sID, 'info').getFolderPluginData('Auto Addons')+'config.ini';
var scriptFso=external.max_activex($mx_sID, 'Scripting.FileSystemObject');
var shlApp=external.max_activex($mx_sID, 'Shell.Application');
var WsciptShl=external.max_activex($mx_sID, 'WScript.Shell');
if(typeof(scriptFso)=='undefined' || typeof(shlApp)=='undefined' || typeof(WsciptShl)=='undefined')
alert('无法创建 ActiveX, 大量功能不可用!');
function readConfig(section, item, value){
return external.m2_readIni($mx_sID,'Auto Addons',cfgPath,section,item,value);
}
</script>
<!-- 提取资源 -->
<script language="Javascript">
var imageFileUrl=[], imageFileTitle=[], movieFileUrl=[], cursorFileUrl=[], linkFileUrl=[], linkFileTitle=[];
function getAppletParam(applet, paramName){
if(!applet)
return null;
var params;
if(applet.tags){
params=applet.tags('param');
}else if(applet.getElementsByTagName){
params=applet.getElementsByTagName('param');
}
if(!params){
return null;
}
paramName=paramName.toLowerCase();
var len=params.length;
for(var i=0; i<len; i++){
if(params[i].name.toLowerCase()==paramName){
return params[i].value;
}
} return null;
}
function addNewtoArr(arr, elem, mArr, mElem){
if(elem==null || elem=='') return;
var len=arr.length;
for(var i=0; i<len; i++){
if(arr[i]==elem) return;
}
arr[len]=elem;
if(mArr!=null) mArr[len]=mElem;
}
function processurl(myurl,srcDoc){
// remove codes in URL
myurl=myurl.replace(/(\r|\n)/ig, "");
var endurl;
if(myurl.match(/^\w+:/i)!=null){
endurl=myurl;
}else{
var pageurl;
var srcUrl=srcDoc.URL;
var Elem=urlElem;
Elem.href=srcUrl;
var hostname=Elem.hostname;
var pathname='/'+Elem.pathname;
var portname=Elem.port;
var protocolname=Elem.protocol;
if((portname=='80' && protocolname=='http:') || (portname=='443' && protocolname=='https:') || (portname=='21' && protocolname=='ftp:'))
portname='';
var regexp=new RegExp("^"+protocolname+"/+", "i");
protocolname=srcUrl.match(regexp);
pageurl=(portname.length==0) ? (protocolname+hostname+pathname) : (protocolname+hostname+":"+portname+pathname);
var pagepath=pageurl.substring(0,pageurl.lastIndexOf("/")+1);
if(myurl.charAt(0)!="." && myurl.charAt(0)!="/")
endurl=pagepath+myurl;
else if(myurl.charAt(0)=="/")
endurl=protocolname+hostname+myurl;
else{
if(myurl.charAt(0)=="."){
endurl=pagepath;
while(myurl.charAt(0)=="."){
myurl=myurl.substr(3);
endurl=endurl.substring(0,endurl.length-1);
endurl=endurl.substring(0,endurl.lastIndexOf("/")+1);
}
endurl=endurl+myurl;
}
}
}
return(endurl);
}
function get_srcDoc_info(srcDoc, tabID){
var tObjs, tObject, tt, classId, cb, type, i, len;
if(tabID==1){
/// IMAGE INLINES ///
tObjs=srcDoc.images;
len=tObjs.length;
for(i=0;i<len;i++){
tObject=tObjs[i];
tt=tObject.src;
tt=processurl(tt,srcDoc);
addNewtoArr(imageFileUrl, tt, imageFileTitle, tObject.alt||tObject.title);
}
/// Background IMAGE ///
if(readConfig('collection','BgImage','0')=='1'){
tObjs=srcDoc.getElementsByTagName("INPUT");
len=tObjs.length;
for(i=0; i<len; i++){
tObject=tObjs[i];
if(tObject.type=="image"){
tt=tObject.src;
tt=processurl(tt,srcDoc);
addNewtoArr(imageFileUrl, tt, imageFileTitle, tObject.alt||tObject.title);
}
}
tObjs=srcDoc.all;
len=tObjs.length;
for(i=0; i<len; i++){
tObject=getsrcDoc_BgObj(tObjs[i]);
if(tObject){
tt=tObject.src;
tt=processurl(tt,srcDoc);
addNewtoArr(imageFileUrl, tt, imageFileTitle, '背景图像');
}
}
}
}
if(tabID==2){
/// MOVIE OBJECTS ///
tObjs=srcDoc.applets;
len=tObjs.length;
for(i=0; i<len; i++){
tObject=tObjs[i];
cb=tObject.codeBase.toLowerCase();
classId=tObject.classid.toLowerCase();
type=tObject.type.toLowerCase();
// .swf
if(cb.indexOf("macromedia.com")>=0 || classId.indexOf("d27cdb6e-ae6d-11cf-96b8-444553540000")>=0 || type.indexOf("x-shockwave-flash")>0){
tt=tObject.getAttribute("Movie");
tt=processurl(tt,srcDoc);
addNewtoArr(movieFileUrl, tt, null, null);
}
// .mov
if(classId.indexOf("02bf25d5-8c17-4b23-bc80-d3488abddc6b")>=0){
tt=tObject.getAttribute("classId");
appSrc=getAppletParam(tObject, 'src');
if(appSrc!=null){ // .mov itself
appSrc=processurl(appSrc,srcDoc);
addNewtoArr(movieFileUrl, appSrc, null, null);
}
appHref=getAppletParam(tObject, 'href');
if(appHref!=null){ // click on .mov
appHref=processurl(appHref,srcDoc);
addNewtoArr(movieFileUrl, appHref, null, null);
}
}
// .wmv
if(classId.indexOf("6bf52a52-394a-11d3-b153-00c04f79faa6")>=0){
tt=tObject.getAttribute("classId");
appSrc=getAppletParam(tObject, 'src');
if(appSrc!=null){
appSrc=processurl(appSrc,srcDoc);
addNewtoArr(movieFileUrl, appSrc, null, null);
}
appHref=getAppletParam(tObject, 'url');
if(appHref!=null){
appHref=processurl(appHref,srcDoc);
addNewtoArr(movieFileUrl, appHref, null, null);
}
}
if(classId.indexOf("22d6f312-b0f6-11d0-94ab-0080c74c7e95")>=0){
tt=tObject.getAttribute("Filename");
tt=processurl(tt,srcDoc);
addNewtoArr(movieFileUrl, tt, null, null);
}
if(classId.indexOf("cfcdaa03-8be4-11cf-b84b-0020afbbccfa")>=0){
tt=tObject.getAttribute("Filename");
tt=processurl(tt,srcDoc);
addNewtoArr(movieFileUrl, tt, null, null);
}
}
/// MOVIE EMBEDS ///
var regexp=/\.(swf|mp3|wma|wmv|avi|mid|midi|m3u|asx|wav|rm|rmvb|mp3pro|ogg|ape|ra|mpeg|mpg|mov|qt|flv|fla|mp4|3gp|mpa|au|rmi|snd|cda|mpe|mkv|ogm|wvx|ram|smi)(?:$|\W)/i;
tObjs=srcDoc.embeds;
len=tObjs.length;
for(i=0; i<len; i++){
tObject=tObjs[i];
t=tObject.src;
if(regexp.test(t)){
tt=tObject.src;
tt=processurl(tt,srcDoc);
addNewtoArr(movieFileUrl, tt, null, null);
}
}
tObjs=srcDoc.links;
len=tObjs.length;
for(i=0; i<len; i++){
tObject=tObjs[i];
tt=tObject.href;
if(regexp.test(tt)){
tt=processurl(tt,srcDoc);
addNewtoArr(movieFileUrl, tt, null, null);
}
}
/// BgSound ///
if(readConfig('collection','BgSound','0')=='1'){
tObjs=srcDoc.getElementsByTagName('bgsound');
len=tObjs.length;
for(i=0; i<len; i++){
tt=tObjs[i].src;
processurl(tt,srcDoc);
addNewtoArr(movieFileUrl, tt, null, null);
}
}
/// Cursor ///
if(readConfig('collection','Cursor','0')=='1'){
tObjs=srcDoc.all;
len=tObjs.length;
for(i=0; i<len; i++){
tt=getsrcDoc_Cursor(tObjs[i]);
if(tt){
tt=processurl(tt,srcDoc);
addNewtoArr(cursorFileUrl, tt, null, null);
}
}
}
}
if(tabID==3){
/// Links ///
var ex_link=/^(javascript:;\s*|javascript:void\s*\(.*|#)$/i;
var ttl;
tObjs=srcDoc.links;
len=tObjs.length;
for(i=0; i<len; i++){
tObject=tObjs[i];
tt=tObject.href;
if(!ex_link.test(tt) && tt!=srcDoc.URL+"#"){
tt=processurl(tt,srcDoc);
ttl=tObject.innerText||tObject.title;
ttl=ttl.replace(/"/ig, '"').replace(/\r/ig, ' ').replace(/\n/ig, ' ');
addNewtoArr(linkFileUrl, tt, linkFileTitle, ttl);
}
}
}
}
function getsrcDoc_BgObj(x){
var z=false;
try{
y=x.currentStyle['backgroundImage'];
var t=y.substring(y.indexOf('"')+1,y.lastIndexOf('"'));
if(t.length<=0) t=y.substring(y.indexOf('(')+1,y.lastIndexOf