function openlistformatwin()
{
var addwin = showModelessDialog("listformat.html",window,'dialogWidth:630px;dialogHeight:300px;dialogLeft:0px;dialogTop:0px;center:no;help:no;resizable:yes;status:no;scroll:no');
}function savelist()
{
var html = null;
try
{
html = listwin.document.documentElement.outerHTML;
}catch(e){ return 1 ;}
if( html == null ) return 1;
var fn = ( new ActiveXObject("Scripting.FileSystemObject") ).openTextFile( unescape( location.pathname ).replace(/\\/g,'/').replace( /\/[^\/]*$/g,"/") + "播放列表.html",2,true);
fn.write( html );
fn.close();
fn = null;
}function window.onunload()
{
player.close();
listwin.document.body.buffertime = buffertime.value;
return savelist();
}//-->
</script><body scroll=no TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" BottomMARGIN="0" rightMARGIN="0" bgcolor=black style="color:#87D200"><input type=button value="加歌" title="把你刚才复制的文本或你自己在歌曲文本框输入一行一条歌曲,然后根据你指定的规律提取成播放能识别的歌曲列表,就可能查看下是否选择添加" onclick=openlistformatwin();>
<input type=button value="下首" onclick="nextlist()" title="随机选择下一首歌曲播放">
<input type=button value="换地址" title="更换一个不用缓冲的歌曲地址" onclick="changeurl();">
<input type=button value="显示歌曲" title="在列表框中的第一行处显示正在播放的歌曲,以便查看或删除" onclick="listwin.document.all[ eval( 'listindex' + current ) ].scrollIntoView(true) ">
<input type=checkbox title="打扣后就只是重复播放正在播放的歌曲" onclick="if(this.checked){ player.settings.playCount = 999; }else{ player.settings.playCount = 1; }">重复播放
<input id=showtxt type=checkbox title="打扣后一播放歌曲就自动搜索并显示歌词" onclick="if(this.checked){ play2showtxt(); txtdiv.style.display = ''; }else{ txtdiv.style.display = 'none'; }">显示歌词
<input id=buffertime title="只能输入大于0的数字; 你能够忍耐的一首歌曲从找到地址到播放的最长的时间(秒).超过这个时间的地址将被抛弃而再寻找此时间短的地址来播放" style="width:20px">秒忍耐上限<OBJECT ID="player" classID="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="width:100%;height:65px;" title="免打扰请选择静音或在播放时选择暂停">
<PARAM name="autoStart" value="0">
<PARAM name="windowlessVideo" value="0">
<PARAM name="volume" value="100">
<PARAM name="uiMode" value="full">
<PARAM name="rate" value="1.0">
<PARAM name="playCount" value="1">
<PARAM name="mute" value="0">
<PARAM name="invokeURLs" value="0">
</OBJECT><div id=listwindiv style="width:100%">
<iframe id="listwin" src="播放列表.html" style="width:100%; height:100%;" ></iframe>
</div><div id=txtdiv name=txtdiv style="display:none; padding: 0px; margin: 0px; left:500px; top:58px; width:497px; height:635px; background-color:transparent; position:absolute;color: red" onmouseup="if(parseInt(this.style.left) < 0){this.style.left = 0;}if(parseInt(this.style.top) < 0){this.style.top = 0;}" title="按住可移动此框">
<div style="font-size: 50%;cursor:hand;background-color:#666666;border:1 solid #666666;width:100%;" align="center" onmousedown="movestart(this,'txtdiv')" onmousemove="moving('txtdiv')" onmouseup="moveend()"> </div>
<iframe id="txtwin" style="width:100%; height:100%; "></iframe>
</div><script language="javascript" for=player event=playstateChange(playstate)>
switch(playstate)
{
case 1: //stop
clearTimeout( stop2nexttimer );
stop2nexttimer = setTimeout( "nextlist( )", 300 );
break;
}
</script><script language="javascript" for=player event=error()> changeurl( ); </script><script language="javascript" for=player event=Buffering(Start)>
if( Start == 0 )
{
clearTimeout( buffertimer );
}</script><script>function listwin.document.ondblclick()
{
var where = listwin.event.srcElement;
if( where.tagName == "A")
{
eval( "searchwin" + current + ".location = 'about:blank'");
eval( "listindex" + current + " = where.sourceIndex" );
setlistindex( current );
}
}
{
var addwin = showModelessDialog("listformat.html",window,'dialogWidth:630px;dialogHeight:300px;dialogLeft:0px;dialogTop:0px;center:no;help:no;resizable:yes;status:no;scroll:no');
}function savelist()
{
var html = null;
try
{
html = listwin.document.documentElement.outerHTML;
}catch(e){ return 1 ;}
if( html == null ) return 1;
var fn = ( new ActiveXObject("Scripting.FileSystemObject") ).openTextFile( unescape( location.pathname ).replace(/\\/g,'/').replace( /\/[^\/]*$/g,"/") + "播放列表.html",2,true);
fn.write( html );
fn.close();
fn = null;
}function window.onunload()
{
player.close();
listwin.document.body.buffertime = buffertime.value;
return savelist();
}//-->
</script><body scroll=no TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" BottomMARGIN="0" rightMARGIN="0" bgcolor=black style="color:#87D200"><input type=button value="加歌" title="把你刚才复制的文本或你自己在歌曲文本框输入一行一条歌曲,然后根据你指定的规律提取成播放能识别的歌曲列表,就可能查看下是否选择添加" onclick=openlistformatwin();>
<input type=button value="下首" onclick="nextlist()" title="随机选择下一首歌曲播放">
<input type=button value="换地址" title="更换一个不用缓冲的歌曲地址" onclick="changeurl();">
<input type=button value="显示歌曲" title="在列表框中的第一行处显示正在播放的歌曲,以便查看或删除" onclick="listwin.document.all[ eval( 'listindex' + current ) ].scrollIntoView(true) ">
<input type=checkbox title="打扣后就只是重复播放正在播放的歌曲" onclick="if(this.checked){ player.settings.playCount = 999; }else{ player.settings.playCount = 1; }">重复播放
<input id=showtxt type=checkbox title="打扣后一播放歌曲就自动搜索并显示歌词" onclick="if(this.checked){ play2showtxt(); txtdiv.style.display = ''; }else{ txtdiv.style.display = 'none'; }">显示歌词
<input id=buffertime title="只能输入大于0的数字; 你能够忍耐的一首歌曲从找到地址到播放的最长的时间(秒).超过这个时间的地址将被抛弃而再寻找此时间短的地址来播放" style="width:20px">秒忍耐上限<OBJECT ID="player" classID="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="width:100%;height:65px;" title="免打扰请选择静音或在播放时选择暂停">
<PARAM name="autoStart" value="0">
<PARAM name="windowlessVideo" value="0">
<PARAM name="volume" value="100">
<PARAM name="uiMode" value="full">
<PARAM name="rate" value="1.0">
<PARAM name="playCount" value="1">
<PARAM name="mute" value="0">
<PARAM name="invokeURLs" value="0">
</OBJECT><div id=listwindiv style="width:100%">
<iframe id="listwin" src="播放列表.html" style="width:100%; height:100%;" ></iframe>
</div><div id=txtdiv name=txtdiv style="display:none; padding: 0px; margin: 0px; left:500px; top:58px; width:497px; height:635px; background-color:transparent; position:absolute;color: red" onmouseup="if(parseInt(this.style.left) < 0){this.style.left = 0;}if(parseInt(this.style.top) < 0){this.style.top = 0;}" title="按住可移动此框">
<div style="font-size: 50%;cursor:hand;background-color:#666666;border:1 solid #666666;width:100%;" align="center" onmousedown="movestart(this,'txtdiv')" onmousemove="moving('txtdiv')" onmouseup="moveend()"> </div>
<iframe id="txtwin" style="width:100%; height:100%; "></iframe>
</div><script language="javascript" for=player event=playstateChange(playstate)>
switch(playstate)
{
case 1: //stop
clearTimeout( stop2nexttimer );
stop2nexttimer = setTimeout( "nextlist( )", 300 );
break;
}
</script><script language="javascript" for=player event=error()> changeurl( ); </script><script language="javascript" for=player event=Buffering(Start)>
if( Start == 0 )
{
clearTimeout( buffertimer );
}</script><script>function listwin.document.ondblclick()
{
var where = listwin.event.srcElement;
if( where.tagName == "A")
{
eval( "searchwin" + current + ".location = 'about:blank'");
eval( "listindex" + current + " = where.sourceIndex" );
setlistindex( current );
}
}
解决方案 »
- window7 系统 Aptana Studio 3 无法启动
- js中怎么能令下条语句延时5秒钟执行??急!!!!!!!!!!!
- 怎样修改onclick?!!谢谢,在线等!
- nobr和nowrap什么区别?
- 颜色选择的问题
- what's mean is this?
- 设DIV为绝对定位,但在style中不设top,如何得到他的实际top?
- javascript的confirm对话框,点击“确定”后,触发form中的一个按钮(submit)的onclick事件
- show()函数有什么用
- 再问一个<a href>标记的javascript问题
- 框架网页中使用js的问题
- <SCRIPT language=JavaScript>......</SCRIPT>这个代码里的内容可以做成JS吗
{
var where = listwin.event.srcElement;
if( where.tagName == "A" && confirm( "确定要删除\n\n" + where.innerText + "\n\n?" ) )
{
listwin.document.body.removeChild( where );
}
}
var moveobj = null;
var xx = 0 ;
var yy = 0;
function movestart(o,n)
{
moveobj = o;
moveobj.setCapture(); xx = event.x - eval(n).offsetLeft;
yy = event.y - eval(n).offsetTop;
}function moving(n)
{
if(moveobj != null){
eval(n).style.left = event.x - xx;
eval(n).style.top = event.y - yy;
}
}function moveend()
{
moveobj.releaseCapture();
moveobj = null;
}</script>
<iframe id="searchwin0" style="display:none; width:0px; height:0px;" onload = "selecturl(0)"></iframe>
<iframe id="searchwin1" style="display:none; width:0px; height:0px;" onload = "selecturl(1)"></iframe>
</body>
</html>
-------------
制作歌曲列表文件:listformat.html
--------------
<html APPLICATION=yes><HEAD>
<title>歌曲列表制作(提取歌曲名称或及歌手)窗口</title>
</head>
<body onload="textlist.value =window.clipboardData.getData('Text')" bgcolor=green style="color:#87D200">
<textarea id=textlist style="width:50%; height:70%" title="文本输入框:文本格式的歌曲信息,具有一定规律性的文本歌曲信息文本段,可自己按一行一条歌曲的形式编辑,也可以粘贴网站上的" wrap=off ></textarea><span id=htmllist style="overflow:auto; width:50%; height:70%; white-space: nowrap" title=播放器可使用的网页格式歌曲信息框,即歌曲列表 ></span>
尝试按照以下规律提取出歌曲信息:<BR><input type=radio name=format onclick='formatlist("song")' title=文本输入框中是一行一条歌曲信息的规律排列>一行一歌<input type=radio name=format onclick='formatlist("1 song")' title="文本歌曲信息框中是:纯数字编号+空格+歌曲信息+再空格+纯数字编号+空格+歌曲信息...的规律排列">编号+空格+歌曲信息<input type=radio name=format onclick='formatlist("1. song")' title="文本歌曲信息框中是:纯数字编号+圆点+空格+歌曲信息+再空格+纯数字编号+圆点+空格+歌曲信息...的规律排列">编号+圆点+空格+歌曲信息<input type=radio name=format onclick='formatlist("1.song")' title="文本歌曲信息框中是:纯数字编号+圆点+空格+歌曲信息+再空格+纯数字编号+圆点+歌曲信息...的规律排列">编号+圆点+歌曲信息
<input type=button value='正确提取,现加入播放列表' onclick="alert( window.dialogArguments.listwin.document.body.insertAdjacentHTML( 'beforeEnd', htmllist.innerHTML ) ? '添加新的歌曲列表出错' : '完成新的歌曲列表的添加' );" style="width:100%"><script>function formatlist( how )
{
switch( how )
{
case "song":
var music;
var reg = / *(.+) */g;
htmllist.innerHTML = "";
while( ( music = reg.exec(textlist.value) ) != null )
{
htmllist.innerHTML += "<A>" + music[1] + "<br></A>";
}
break;
case "1 song":
case "1. song":
var music;
var reg = /※([^※\n\r]+)/g;
htmllist.innerHTML = "";
while( ( music = reg.exec(textlist.value.replace( /(?:^ *\d+\.? +)|(?: +\d+\.? +)|(?:\n *\d+\.? +)/g, "※" ) ) ) != null )
{
htmllist.innerHTML += "<A>" + music[1] + "<br></A>";
}
break;
case "1.song":
var music;
var reg = /※([^※\n\r]+)/g;
htmllist.innerHTML = "";
while( ( music = reg.exec(textlist.value.replace( /(?:^ *\d+\.)|(?: +\d+\.)|(?:\n *\d+\.)/g, "※" ) ) ) != null )
{
htmllist.innerHTML += "<A>" + music[1] + "<br></A>";
}
break;
default:
var music;
var reg = /※([^※\n\r]+)/g;
htmllist.innerHTML = "";
while( ( music = reg.exec( eval( 'textlist.value.replace( /' + myformat.value + '/g, "※" )' ) ) ) != null )
{
htmllist.innerHTML += "<A>" + music[1] + "<br></A>";
}
}
}</script>
</body></html>
-----------
列表文件:播放列表.html
-----------
<HTML><HEAD></HEAD>
<BODY title=" ①播放某条歌曲:双击它 ②删除某条歌曲:右键点它后选择确定 ③查找指定歌曲:点下播放列表任何地方,先按住CTRL键,再接着按下F键,全放开,输入你要的歌曲名部分或全部进行查找" style="COLOR: yellow" bgColor=green buffertime="60"><A url="http://218.3.207.15/source/upload/26152.mp3">两只蝴蝶<BR></A><A url="http://www.no4hospital-sz.com/qfmy/fun/flash/ricerat.mp3">老鼠爱大米<BR></A><A url="http://101560.iuni.com.cn/obb/01/bsnwsw.wma">别说我的眼泪你无所谓<BR></A><A url="http://www.digitalsoundplanet.com/Members/000132390_000010912_proj.mp3">欧若拉 <BR></A><A url="http://www.zujia.net/music/21你到底爱谁.mp3">你到底爱谁(刘嘉亮)<BR></A><A url="http://play8.tom.com/upload/14495.mp3">快乐崇拜<BR></A><A url="http://3our.com/top/mp3/7.mp3">丁香花<BR></A><A url="http://www.yueqi.com/forum/uploadImages/1125856500000.mp3">江南 <BR></A><A url="http://www.3our.com/top/mp3/9.mp3">我们的爱<BR></A><A url="http://220.181.26.88/Songs/Chinese/Male/张学友/1995-真爱新曲+真正精选/吻别.mp3?wxc">吻别<BR></A><A url="http://www.shanghaiboy.com/music/box/lyy.mp3">六月的雨<BR></A><A url="http://file.qyule.com/upload/2005-05-20/rlCVS5vxlvgEdcgN.mp3">孤单北半球 <BR></A><A url="http://www.dreammates.com.cn/uploads/videos/15821/20051019083307.mp3">童话(光良)<BR></A></BODY></HTML>
-----
还有一个图标文件:图标.ICO
可以自已找个
{//列表变量值对象未有URL
eval( "urlindex" + which + " = 0" ); //未有URL,必须查找,先置URL指示变量为零
if( eval( "searchwin" + which ).location == "http://d.sogou.com/music?class=1&query=" + escape( listwin.document.all[ eval( "listindex" + which ) ].innerText ) )
{//已打开,直接查找即可
selecturl( which );
}else
{//未打开查找网页
eval( "searchwin" + which ).location = "http://d.sogou.com/music?class=1&query=" + escape( listwin.document.all[ eval( "listindex" + which ) ].innerText ); //打开查找网页,等待loaded状态事件
}
改成 if ( listwin.document.all[ eval( "listindex" + which ) ].url == null || listwin.document.all[ eval( "listindex" + which ) ].url == "" )
{//列表变量值对象未有URL
if( eval( "searchwin" + which ).location == "http://d.sogou.com/music?class=1&query=" + escape( listwin.document.all[ eval( "listindex" + which ) ].innerText ) )
{//已打开,直接查找即可
selecturl( which );
}else
{//未打开查找网页
eval( "urlindex" + which + " = 0" ); //未有URL,必须查找,先置URL指示变量为零
eval( "searchwin" + which ).location = "http://d.sogou.com/music?class=1&query=" + escape( listwin.document.all[ eval( "listindex" + which ) ].innerText ); //打开查找网页,等待loaded状态事件
}