原帖由 拒买日本货 于 2005-7-12 09:19 发表
出错了!
原播放器里有给选择打勾的小框框,,,现在没了?!
也就是说,此功能没有了,,,
请更改...这样才完美..........
说明一下:
选择打勾的小框框,是圆圆的,我拿来用的,谢了圆圆.
在player.js里
查找
- function getPlaylist(target,obj) {
- if(typeof(wmp) != "undefined") {
- var res = "";
- var count = wmp.currentPlaylist.count;
- res += "<table width=100% style=table-layout:fixed; cellpadding=0 cellspacing=0>\n";
- for(i=0;i<=count-1;i++) {
- var itemname = wmp.currentPlaylist.item(i).name;
- var n = i+1;
- res += " <tr><td align=right id=no>"+n+"</td><td nowrap id=name title=""+itemname+""><span style=cursor:hand; onclick=playItem("+n+");>"+itemname+"</span></td><td align=right id=button><img src=images/btn_listen.gif style=cursor:hand; align=absmiddle onclick=playItem("+n+");><img src=images/btn_delete.gif style=cursor:hand; align=absmiddle onclick=deleteItem("+n+");getPlaylist();></td></tr>\n";
- }
- res += "</table>\n";
- if(!target) {
- playlist.innerHTML = res;
- } else {
- target.innerHTML = res;
- }
- }
- }
复制代码
替换为:
- var page=1;
- function getpage(no)
- {
- page=no;
- getPlaylist();
- }
- function getPlaylist(target,obj) {
- if(typeof(wmp) != "undefined") {
- var res = "";
-
- var startpage,pagemax=15,allpage,start,end,j;
-
- var count = wmp.currentPlaylist.count;
-
- startpage=page;
-
- if(pagemax>count)
- pagemax=count;
-
- allpage=Math.ceil(count/pagemax);
-
- start=(startpage-1)*pagemax;
- end=startpage*pagemax;
-
- if(page==allpage)
- end=count;
-
- res += "<table width=100% style=table-layout:fixed; cellpadding=0 cellspacing=0>\n";
- for(i=start;i<=end-1;i++) {
- var itemname = wmp.currentPlaylist.item(i).name;
- var n = i+1;
- res += "<tr><td align=right id=no>"+n+"</td><td id=cb width=25><input type=checkbox name=plitem value="+n+" checked></td><td nowrap id=name title=""+itemname+""><span style=cursor:hand; onclick=playItem("+n+");>"+itemname+"</span></td><td align=right id=button><img src=images/btn_listen.gif style=cursor:hand; align=absmiddle onclick=playItem("+n+");><img src=images/btn_delete.gif style=cursor:hand; align=absmiddle onclick=deleteItem("+n+",true);></td></tr>\n";
- }
-
- res += "</table>\n";
-
- res += "<table width=100% cellpadding=0 cellspacing=0 > ";
- res +="<tr><td nowrap background="images/page01.gif"> 共有: <font color=#FF0000> "+allpage+"</font>页";
- res +=" 当前页: <font color=#FF0000> "+page+"</font>/"+allpage+" <span style=cursor:hand; onclick=deleteItem("+n+",true);>删除所选</span></td></tr>";
- res +=" <tr><td background="images/page.gif"> <font color=red >跳页-></font>";
-
- for( j=1; j<=allpage; j++)
- {
- if(!(j%15))
- res +="<br>";
- res +=" <a href="javascript:getpage(" + j + ")">[" + j + "]<a> ";
- }
- res +="</td></tr>";
- res += "</table>";
- if(!target) {
- playlist.innerHTML = res;
- } else {
- target.innerHTML = res;
- }
- }
- }
复制代码
查找
- function deleteItem(no) {
- var cfm = confirm("Are you sure you want this media to be deleted?");
- if(cfm) {
- var stats = wmp.playState;
- media = wmp.currentPlaylist.item(no-1);
- wmp.currentPlaylist.removeItem(media);
- if(stats == 3) { wmp.controls.play(); }
- }
- }
复制代码
替换为:
- function deleteItem(no,reload) {
- var plitem_sel = 0;
- var cfm_textadd = "";
- var del_count = 0;
- if(typeof(plitem) != "undefined") for(i=0;i<plitem.length;i++) { if(plitem[i].checked == true) plitem_sel++; }
- if(plitem_sel<1 && !no) return false;
- if(plitem_sel>1) cfm_textadd = " 你选定了"+plitem_sel+"首!\n\n ";
- var cfm = confirm(cfm_textadd+"你确定要把它们从播放列表中删除!?\n");
- if(cfm) {
- var stats = wmp.playState;
- if(plitem_sel>1) {
- for(i=0;i<plitem.length;i++) {
- if(plitem[i].checked == true) {
- media = wmp.currentPlaylist.item(plitem[i].value - (1+del_count));
- wmp.currentPlaylist.removeItem(media);
- del_count++;
-
- }
- }
- } else {
- media = wmp.currentPlaylist.item(no-1);
- wmp.currentPlaylist.removeItem(media);
- }
- if(stats == 3) aPlay();
- if(reload == true) getPlaylist();
- } else {
- return false;
- }
- }
复制代码
搞定
[ 本帖最后由 lu5266 于 2005-7-15 11:09 编辑 ] |