增加 “恢复界面默认设置” 功能

This commit is contained in:
ronggang 2018-03-30 13:46:58 +08:00
parent 0471710cd0
commit d6fee50d20
3 changed files with 28 additions and 4 deletions

View File

@ -204,7 +204,8 @@ system.defaultLang = {
"minutes": "Minutes",
"nochange": "No change",
"saving": "Saving...",
"show-bt-servers": "Show 'BT servers' on Trackers."
"show-bt-servers": "Show 'BT servers' on Trackers.",
"restore-default-settings": "Restore UI Default Settings"
},
"public": {
"button-ok": "OK",
@ -372,7 +373,10 @@ system.defaultLang = {
"tip": {
"button-allow": "Download checked file(s)",
"button-deny": "Skip checked file(s)",
"button-priority": "Set priority"
"button-priority": "Set priority",
"button-tracker-add": "Add New Tracker",
"button-tracker-edit": "Edit Tracker",
"button-tracker-remove": "Remove Tracker"
},
"other": {
"tracker-remove-confim": "Are you sure you want to remove this Tracker?"

View File

@ -203,7 +203,8 @@ system.lang = {
"minuets": "分钟",
"nochange": "参数未改变",
"saveing": "正在保存...",
"show-bt-servers": "在『服务器分布』中显示『BT』服务器列表。"
"show-bt-servers": "在『服务器分布』中显示『BT』服务器列表。",
"restore-default-settings": "恢复界面默认设置(含主题)"
},
"public": {
"button-ok": "确定",
@ -373,7 +374,10 @@ system.lang = {
"tip": {
"button-allow": "下载已选择的文件",
"button-deny": "忽略已选择的文件",
"button-priority": "设置优先级别"
"button-priority": "设置优先级别",
"button-tracker-add": "增加新的 Tracker",
"button-tracker-edit": "修改已选中的 Tracker 地址",
"button-tracker-remove": "删除已选中的 Tracker 地址"
},
"other": {
"tracker-remove-confim": "确认要删除这个 Tracker 吗?"

View File

@ -248,11 +248,13 @@
</div>
<div title="More" style="padding:10px;" class="dialog">
<input id="show-bt-servers" type="checkbox" style="width:16px;" config-type="1"/><label for="show-bt-servers" system-lang="dialog['system-config']['show-bt-servers']"></label>
<hr/>
</div>
</div>
</div>
<div data-options="region:'south',border:false" style="text-align:right;padding:6px;">
<a id="system-config-button-reload" href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload'" style="float:left;display:none;"></a>
<button id="restore-default-settings" style="float:left;" system-lang="dialog['system-config']['restore-default-settings']" data-options="iconCls:'iconfont tr-icon-restore'" class="easyui-linkbutton"></button>
<span id="system-config-nochange" style="display:none;"></span>
<span id="system-config-saved" style="display:none;"></span>
<a id="system-config-button-save" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" href="javascript:void(0);">Ok</a>
@ -626,5 +628,19 @@
button.prop("disabled", false);
});
});
// 恢复界面默认设置
$("#restore-default-settings", thisDialog).click(function(){
if (confirm(system.lang["public"]["text-confirm"])==false)
{
return;
}
system.config = {};
system.userConfig = {};
system.saveConfig();
system.saveUserConfig();
location.href = location.href;
});
})($("#dialog-system-config"));
</script>