(function(){var t,i,e;(t=class t extends this.OS.GUI.BasicDialog{constructor(){super("ClientDialog",t.scheme)}main(){var t,i,e,n;if(super.main(),e=$(this.scheme).find("input[type=text]"),this.data)for(i=0,n=e.length;ithis.quit(),this.find("btnok").onbtclick=i=>{var n,a,s;for(n={},a=0,s=e.length;a\n \n
\n \n
\n \n \n
\n \n \n
\n \n \n
\n
\n
\n
\n',(i=class i extends this.OS.GUI.BasicDialog{constructor(){super("ClientListDialog",i.scheme)}main(){return super.main(),this.clist=this.find("client-list"),this.clist.buttons=[{text:"",iconclass:"fa fa-plus-circle",onbtclick:i=>this.openDialog(new t,{title:__("Add new client")}).then(t=>(this.parent.setting.clients.push(t),this.clist.data=this.parent.setting.clients))},{text:"",iconclass:"fa fa-minus-circle",onbtclick:t=>{var i,e;if(e=this.clist.selectedItem,i=this.clist.selected,e)return this.ask({text:__("Do you realy want to delete: `{0}`",e.data.text)}).then(t=>{if(t)return this.parent.setting.clients.splice(i,1),this.clist.data=this.parent.setting.clients})}},{text:"",iconclass:"fa fa-pencil-square-o",onbtclick:i=>{var e;if(e=this.clist.selectedItem)return this.openDialog(new t,{title:__("Add new client"),text:e.data.text,url:e.data.url}).then(t=>{if(t)return e.data.text=t.text,e.data.url=t.url,this.clist.data=this.parent.setting.clients})}}],this.find("btnswitch").onbtclick=t=>{var i;if(i=this.clist.selectedItem)return this.parent.setting.curl=i.data.url,this.parent.setting.cname=i.data.text,this.parent.switchClient(),this.quit()},this.clist.data=this.parent.setting.clients}}).scheme='\n \n \n
\n \n
\n \n',(e=class extends this.OS.application.BaseApplication{constructor(t){super("GPClient",t)}main(){return this.setting.clients||(this.setting.clients=[]),this.container=this.find("container"),this.bindKey("CTRL-M",()=>this.openDialog(new i,{title:__("Client Manager")})),this.switchClient()}switchClient(){return this.setting.curl?(this.container.src=this.setting.curl,this.scheme.apptitle=this.setting.cname):this.notify(__("No client selected, manager client in menu Options > Client manager"))}menu(){return[{text:"__(Options)",nodes:[{text:"__(Client manager)",shortcut:"C-M"}],onchildselect:t=>this.openDialog(new i,{title:__("Client Manager")})}]}}).singleton=!0,this.OS.register("GPClient",e)}).call(this);