var system={version:"1.6.1",rootPath:"tr-web-control/",codeupdate:"20200913",configHead:"transmission-web-control",config:{autoReload:!0,reloadStep:5e3,pageSize:30,pagination:!0,pageList:[10,20,30,40,50,100,150,200,250,300,5e3],defaultSelectNode:null,autoExpandAttribute:!1,defaultLang:"",foldersShow:!1,theme:"default",showBTServers:!1,ipInfoToken:"",ui:{status:{tree:{},layout:{main:{},body:{},left:{}},panel:{},size:{nav:{},attribute:{}}}},hideSubfolders:!1,simpleCheckMode:!1,nav:{servers:!0,folders:!0,statistics:!0,labels:!1},labels:[],labelMaps:{},ignoreVersion:[]},storageKeys:{dictionary:{folders:"dictionary.folders"}},dictionary:{folders:null},checkUpdateScript:"https://api.github.com/repos/ronggang/transmission-web-control/releases/latest",contextMenus:{},panel:null,lang:null,reloading:!1,autoReloadTimer:null,downloadDir:"",islocal:!1,B64:new Base64,currentTorrentId:0,flags:[],control:{tree:null,torrentlist:null},userConfig:{torrentList:{fields:[],sortName:null,sortOrder:"asc"}},serverConfig:null,serverSessionStats:null,templates:{},checkedRows:[],uiIsInitialized:!1,popoverCount:0,currentListDir:"",setlang:function(lang,callback){lang||(lang=this.config.defaultLang?this.config.defaultLang:navigator.language||navigator.browserLanguage),lang||(lang="zh-CN"),-1!=lang.indexOf("-")&&(lang=lang.split("-")[0].toLocaleLowerCase()+"-"+lang.split("-")[1].toLocaleUpperCase()),this.languages[lang]||(lang="en"),lang=lang.replace("-","_"),$.getJSON(system.rootPath+"i18n/"+lang+".json",(function(result){result&&(system.lang=$.extend(!0,system.defaultLang,result)),system.resetLangText(),$.getScript(system.rootPath+"script/easyui/locale/easyui-lang-"+lang+".js").done((function(script,textStatus){callback&&callback()})).fail((function(jqxhr,settings,exception){$.getScript(system.rootPath+"script/easyui/locale/easyui-lang-en.js",(function(){callback&&callback()}))}))}))},init:function(lang,islocal,devicetype){this.readConfig(),this.lastUIStatus=JSON.parse(JSON.stringify(this.config.ui.status)),this.islocal=1==islocal,this.panel={main:$("#main"),top:$("#m_top"),toolbar:$("#m_toolbar"),left_layout:$("#m_left_layout"),left:$("#m_left"),body:$("#m_body"),layout_body:$("#layout_body"),layout_left:$("#layout_left"),list:$("#m_list"),attribute:$("#m_attribute"),bottom:$("#m_bottom"),title:$("#m_title"),status:$("#m_status"),statusbar:$("#m_statusbar"),status_text:$("#status_text"),droparea:$("#dropArea")},null==this.lang?this.setlang(lang,(function(){system.initdata()})):this.initdata(),this.initThemes(),this.clipboard=new ClipboardJS("#toolbar_copyPath")},resetLangText:function(parent){parent||(parent=$);var items=parent.find("*[system-lang]");$.each(items,(function(key,item){var name=$(item).attr("system-lang");"["==name.substr(0,1)?$(item).html(eval("system.lang"+name)):$(item).html(eval("system.lang."+name))})),items=parent.find("*[system-tip-lang]"),$.each(items,(function(key,item){var name=$(item).attr("system-tip-lang");"["==name.substr(0,1)?$(item).attr("title",eval("system.lang"+name)):$(item).attr("title",eval("system.lang."+name))}))},initdata:function(){$(document).attr("title",this.lang.system.title+" "+this.version),$.fn.switchbutton.defaults.onText=this.lang.public["text-on"],$.fn.switchbutton.defaults.offText=this.lang.public["text-off"];var buttons=new Array,title=""+this.lang.title.left+"";if(buttons.length>1)for(var key in title+=buttons.join(""),this.panel.left_layout.panel("setTitle",title),this.lang.tree.toolbar.nav)switch($("#tree-toolbar-nav-"+key).linkbutton(),key){case"folders":system.config.foldersShow?$("tree-toolbar-nav-"+key).linkbutton({iconCls:"icon-enabled"}).data("status",1):$("tree-toolbar-nav-"+key).linkbutton({iconCls:"icon-disabled"}).data("status",0)}else this.panel.left_layout.panel("setTitle",title);if(title=""+this.lang.title.list+"",buttons.length=0,buttons.length>1)for(var key in title+=buttons.join(""),this.panel.body.panel("setTitle",title),this.lang["torrent-head"].buttons)switch($("#torrent-head-buttons-"+key).linkbutton(),key){case"autoExpandAttribute":system.config.autoExpandAttribute?$("#torrent-head-buttons-"+key).linkbutton({iconCls:"icon-enabled"}).data("status",1):$("#torrent-head-buttons-"+key).linkbutton({iconCls:"icon-disabled"}).data("status",0)}else this.panel.body.panel("setTitle",title);this.panel.status.panel("setTitle",this.lang.title.status),this.panel.attribute.panel({title:this.lang.title.attribute,onExpand:function(){0!=system.currentTorrentId&&$(this).data("isload")?system.getTorrentInfos(system.currentTorrentId):system.clearTorrentAttribute()},onLoad:function(){$(this).data("isload")||($(this).data("isload",!0),0!=system.currentTorrentId&&setTimeout((function(){system.getTorrentInfos(system.currentTorrentId)}),500))}}),$.each(this.languages,(function(key,value){$("