标题:
[交流]
theworld程序部分script :)
[打印本页]
作者:
minidick
时间:
2006-2-12 15:35
标题:
theworld程序部分script :)
<html>
<head>
<title>上次访问的网址</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.styleTW {
color: #000000; font-size: 12px
}
A:link {font-size:12px;text-decoration:none;color: 015A9D}
A:visited {font-size:12px;text-decoration:none;color: 015A9D}
A:active {font-size:12px;text-decoration: none;color: #033B7D}
A:hover {font-size:12px;text-decoration:none;color: #FF5A00}
-->
</style>
<script language="JavaScript">
function tw_getOldUrlData( nIndex )
{
return window.external.twgetlasturl( window, "", nIndex, 1 );
}
function tw_getLastUrlData( nIndex )
{
return window.external.twgetlasturl( window, "", nIndex, 0 );
}
function openWindow( str_url )
{
window.external.twnewnavigate( window, "", str_url, //BSTR bstrUrl,
1, //Active
0, //ForceNew
0, //Lock
1 //FindBlank )
);
}
var g_arr_argName = new Array(100);
var g_arr_argUrl = new Array(100);
var g_nCount = 0;
var g_arr_argNameOld = new Array(100);
var g_arr_argUrlOld = new Array(100);
var g_nCountOld = 0;
var g_bShowPic = true;
var g_nPercent = 70;
var g_str_Src = "";
function tw_DeleteItemOld( nIndex )
{
num = new Number( 0 );
num = Number( nIndex ) + 0;
str_url = g_arr_argUrlOld[num];
window.external.twdeletelasturl( window, "", g_arr_argUrlOld[num], 1 );
document.getElementById( str_url ).removeNode( true );// = "hidden";
// alert( document.getElementById( str_url ).style.visibility );
// location.reload();
}
function tw_DeleteItem( nIndex )
{
num = new Number( 0 );
num = Number( nIndex ) + 0;
str_url = g_arr_argUrl[num];
window.external.twdeletelasturl( window, "", g_arr_argUrl[num], 0 );
document.getElementById( str_url ).removeNode( true );
}
function tw_getAllUrl( )
{
var nIndex = 0;
try{
while( 1 )
{
str_data = tw_getLastUrlData( nIndex );
if( str_data.length == 0 )
break;
if(str_data.indexOf("**")!=-1)
arr_temp = str_data.split("**");
else
arr_temp = str_data.split("::");
g_arr_argUrl[nIndex] = arr_temp[0];
g_arr_argName[nIndex] = arr_temp[1];
g_nCount++;
nIndex++;
}
}catch(err){}
nIndex = 0;
try{
while( 1 )
{
str_data = tw_getOldUrlData( nIndex );
if( str_data.length == 0 )
break;
if(str_data.indexOf("**")!=-1)
arr_temp = str_data.split("**");
else
arr_temp = str_data.split("::");
g_arr_argUrlOld[nIndex] = arr_temp[0];
g_arr_argNameOld[nIndex] = arr_temp[1];
g_nCountOld++;
nIndex++;
}
}catch(err){}
}
function tw_Openall()
{
for( i = 0; i < g_nCount; i ++ )
{
str_url = g_arr_argUrl[i];
openWindow( str_url, target="_blank" );
}
if( moreCheck.checked == true )
{
for( i = 0; i < g_nCountOld; i ++ )
{
str_url = g_arr_argUrlOld[i];
openWindow( str_url, target="_blank" );
}
}
}
function tw_Zoom(nIndex)
{
if( nIndex == 1 )
g_nPercent += 10;
else if( nIndex == 0 )
g_nPercent = 100;
else
g_nPercent -= 10;
if( g_nPercent<=0 || g_nPercent>=2000)
g_nPercent = 100;
document.all.frame_moreinfo.style.zoom = g_nPercent+"%";
}
function tw_naviNew()
{
if( g_str_Src != "" )
window.open( g_str_Src, target="_blank" );
}
function tw_ChangeActive( strItem )
{
g_bShowPic = false;
try{
if( strItem.length > 0 )
{
td_ad.style.display = "none";
td_moreinfo.style.display = "";
g_str_Src = strItem;
window.open( strItem, "frame_preview" );
}
}catch(err){}
}
function tw_ShowMoreUrl()
{
if( moreCheck.checked == true )
moreUrlTab.style.display = "";
else
moreUrlTab.style.display = "none";
}
function keepPicSize( imgObj, finWidth, finHeight )
{
// imgObj.width = finWidth;
if( imgObj.width > finWidth
|| imgObj.height > finHeight )
{
xScale = finWidth/imgObj.width;
yScale = finHeight/imgObj.height;
var tempScale;
if( xScale > yScale )
tempScale = yScale;
else
tempScale = xScale;
imgObj.width *= tempScale;
// imgObj.height *= tempScale;
}
}
tw_getAllUrl();
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" class="styleTW">
<table border="0" width="50%" height="24" cellspacing="0" cellpadding="0" bordercolor="#F4F4F4" id="table4" bgcolor="#FFFFFF" class="styleTW">
<tr><td valign='center'>
<a href="javascript:tw_Openall();window.opener=null;window.close();">打开全部页面</a></td>
<td valign='center' align="right">
<input id="moreCheck" type=checkbox onclick="javascript:tw_ShowMoreUrl();" >显示更多</input></td>
</table>
<table border="0" width="100%" height="90%" cellspacing="0" cellpadding="0" bordercolor="#F4F4F4" id="table4" bgcolor="#FFFFFF">
<tr>
<td width="50%" height="100%">
<div style="position:static;width:100%;height:95%;z-index:1; overflow:auto;">
<table border="1" width="100%" bordercolor="#F3F3F3" bgcolor="#F4F4F4" cellpadding="4" cellspacing="0" class="styleTW">
<tr><td width='24' valign='center'>预览</td><td valign='center'>上次退出前访问的网页</td></tr>
</table>
<table style="display:none" id="moreUrlTab" bordercolor="#F3F3F3" bgcolor="#F6F6F6" border="1" width="100%" cellpadding="4" cellspacing="0" class="styleTW">
<script language="JavaScript">
var nIndex = 0;
for( i = 0; i < g_nCountOld; i ++ )
{
str_url = g_arr_argUrlOld[i];
str_name = g_arr_argNameOld[i];
str_td = "<tr ID="+str_url +"><td width='16' align='center' valign='center'><a href=\"javascript:tw_ChangeActive('"+str_url+"');\"><img alt='Click for Preview' border='0' src='IMG/289' width='11' height='11'></a></td>"
document.write( str_td );
str_td = "<td width='16' valign='center'><a href=\"javascript:tw_DeleteItemOld('"+i+"');\">" + "<img border='0' src='IMG/304' width='11' height='11'></a></td>";
document.write( str_td );
str_td = "<td valign='center'><a target='_blank' href=" + str_url + ">" + str_name + "</a></td></tr>";
document.write( str_td );
}
</script>
</table>
<table border="1" width="100%" bordercolor="#F3F3F3" bgcolor="#FAFAFA" cellpadding="4" cellspacing="0" class="styleTW">
<script language="JavaScript">
var nIndex = 0;
for( i = 0; i < g_nCount; i ++ )
{
str_url = g_arr_argUrl[i];
str_name = g_arr_argName[i];
str_td = "<tr ID="+str_url +"><td width='16' align='center' valign='center'><a href=\"javascript:tw_ChangeActive('"+str_url+"');\"><img alt='Click for Preview' border='0' src='IMG/289' width='11' height='11'></a></td>"
document.write( str_td );
str_td = "<td width='16' valign='center'><a href=\"javascript:tw_DeleteItem('"+i+"');\">" + "<img border='0' src='IMG/304' width='11' height='11'></a></td>";
document.write( str_td );
str_td = "<td valign='center'><a target='_blank' href=" + str_url + ">" + str_name + "</a></td></tr>";
document.write( str_td );
}
if( g_nCount == 0 )
{
moreCheck.checked = true;
tw_ShowMoreUrl();
}
</script>
</table>
</div>
</td>
<td width="50%" height="100%" valign="top">
<table border="0" width="100%" height="100%" id="table6" cellpadding="0" cellspacing="0">
<tr>
<td id="td_ad" colspan="2" aligh="right" valign='center'>
<div id="imgdiv" scroll="none" style="position:absolute;width:100%;height:95%;z-index:1; overflow:hidden;">
</div></td>
<td style="display:none" id="td_moreinfo">
<table width="100%" height="100%" border="1" bordercolor="#F4F4F4" cellpadding="0" cellspacing="0" >
<tr><td align="right" bgcolor="DCDCDC" width="100%" height="24"><img src="pbutton.gif" width="82" height="16" usemap="#Map" border="0"></td></tr>
<tr><td><iframe width="100%" height="100%" frameborder="0" name="frame_preview" id="frame_moreinfo" style="zoom:50%"></iframe></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript">
function tw_showRandomPic()
{
if( g_bShowPic )
{
try
{
strPic = window.external.twgetrandompic( window, "" );
if( strPic.length > 0 )
{
strImg = "<img id='ranpicshow' onload='javascript:keepPicSize(this,imgdiv.offsetWidth-2, imgdiv.offsetHeight-2 );' src='" + strPic +"'></img>";
imgdiv.innerHTML = strImg;
window.setTimeout( "tw_showRandomPic();", 10000 );
}
}
catch( err )
{
}
}
}
tw_showRandomPic();
</script>
<map name="Map">
<area shape="rect" coords="0,0,18,16" href="javascript:tw_Zoom(1);" alt="放大">
<area shape="rect" coords="17,0,34,16" href="javascript:tw_Zoom(0);" alt="原始比例">
<area shape="rect" coords="34,0,51,16" href="javascript:tw_Zoom(-1);" alt="缩小">
<area shape="rect" coords="63,0,79,16" href="javascript:tw_naviNew();" alt="在新窗口中浏览">
</map>
</body>
</html>
作者:
zhchgao
时间:
2006-2-12 15:37
反正我是看不懂的。呵呵。
作者:
caten
时间:
2006-2-12 20:39
楼主发这个有嘛意义??
作者:
RAY
时间:
2006-2-13 09:09
看不懂哈!
作者:
sztb
时间:
2006-2-13 12:33
目的何在?
不明白....
作者:
minidick
时间:
2006-2-13 12:51
原帖由
caten
于 2006-2-12 08:39 PM 发表
楼主发这个有嘛意义??
对写script插件有点帮助,呵呵
我自己还没细看
作者:
caten
时间:
2006-2-13 20:51
老大说 要写插件的直接找他
欢迎光临 世界之窗论坛 (http://bbs.theworld.cn/)
Powered by Discuz! 7.2