transmission-web-control/template/dialog-system-replaceTracker.html
ronggang.zhou@gmail.com 2a0c1139b6 新增:
# 新增参数配置文件 config.js ,用于自定义启动参数,当前可用参数:是否自动刷新、刷新频率、默认选中的节点等
# 新增针对种子服务器(Tracker)的更新/增加/删除功能
# 新增种子服务器(Tracker) 批量替换功能
# 新增在本地保存一些参数的功能(cookies),方便用户下次在本地打开时,回到上次关闭前的状态
# 新增原版切换链接(保留原版时,需将原版的 index.html 先重命名为 index.original.html,然后再解压所有文件到web目录)
# 新增种子描述中超链接替换功能
# 新增种子列表中显示“添加时间”
# 新增适应移动设备的模板,当前基本功能:
 1、种子分类 
 2、开始、暂停、重新校验已选择的种子
 3、种子列表分页显示

更新:
# 更新语言文件中的 tree.server 为 tree.servers
# 更新自动刷新时,如果有错误的种子,则根据种子的“下次更新时间”来判断本次是否需要重新获取数据,以减少数据量
# 更新种子列表排序方式,以支持所有页的数据排序 

修复:
# 拖放文件时,几个变量未定义的BUG
# 删除种子时,列表显示错误的BUG
2013-01-29 02:01:00 +00:00

102 lines
3.3 KiB
HTML

<div class="easyui-layout" data-options="fit:true" style="width:100%;height:100%;">
<div data-options="region:'center'" style="padding:3px;border:0px;">
<div id="" class="dialog" style="width:100%;padding:0px;">
<span id="dialog-system-replaceTracker-tip" class="tip"></span>
<table style="width:100%;">
<tr>
<td width="20%" class="title"><span id="dialog-system-replaceTracker-old-tracker"></span></td>
<td width="80%">
<input type="text" id="old-tracker-url" />
</td>
</tr>
<tr>
<td class="title"><span id="dialog-system-replaceTracker-new-tracker"></span></td>
<td>
<input type="text" id="new-tracker-url" />
</td>
</tr>
<tr>
<td colspan="2"><hr/></td>
</tr>
</table>
</div>
</div>
<div data-options="region:'south',border:false" style="text-align:right;padding:6px;">
<span id="text-nochange" style="display:none;"></span>
<a id="replaceTracker-button-ok" class="easyui-linkbutton" data-options="iconCls:'icon-ok',plain:true" href="javascript:void(0);">Ok</a>
<a id="replaceTracker-button-cancel" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true" href="javascript:void(0);">Cancel</a>
</div>
</div>
<script type="text/javascript">
(function(thisDialog){
var title = "old-tracker,new-tracker,tip".split(",");
var torrent = transmission.torrents.all[system.currentTorrentId];
$.each(title, function(i, item){
thisDialog.find("#dialog-system-replaceTracker-"+item).html(system.lang.dialog["system-replaceTracker"][item]);
});
thisDialog.find(".title").css({background:"#e6e6e6"});
title = "button-ok,button-cancel".split(",");
$.each(title, function(i, item){
thisDialog.find("#replaceTracker-"+item).html(system.lang.dialog["public"][item]);
});
thisDialog.find("#text-nochange").html(system.lang["public"]["text-nochange"]);
// 确认
thisDialog.find("#replaceTracker-button-ok").click(function()
{
var oldValue = thisDialog.find("#old-tracker-url").val();
var newValue = thisDialog.find("#new-tracker-url").val();
var button = $(this);
// 如果有指定參數時,開始替換
if (oldValue&&newValue&&(oldValue!=newValue))
{
if (confirm(system.lang["public"]["text-confirm"])==false)
{
return;
}
var icon = button.linkbutton("options").iconCls;
button.linkbutton({disabled:true,iconCls:"icon-loading"});
// 开始设置参数
transmission.torrents.searchAndReplaceTrackers(
oldValue
,newValue
,function(ids,count){
button.linkbutton({iconCls:icon,disabled:false});
if (count==0)
{
thisDialog.find("#text-nochange").html(system.lang["public"]["not-found"]).fadeInAndOut();
return;
}
if (ids==null)
{
thisDialog.find("#text-nochange").html(system.lang.dialog["error"]["data-error"]).fadeInAndOut();
return;
}
system.reloadTorrentBaseInfos(ids);
thisDialog.dialog("close");
}
);
}
else
{
thisDialog.find("#text-nochange").html(system.lang["public"]["text-nochange"]).fadeInAndOut();
}
});
thisDialog.find("#replaceTracker-button-cancel").click(function()
{
thisDialog.dialog("close");
});
})($("#dialog-system-replaceTracker"));
</script>