antosdk-apps/ShowCase/build/debug/main.js

1 line
6.2 KiB
JavaScript
Raw Normal View History

2023-07-14 12:05:12 +02:00
(function(){var t,e;t=this,(e=class extends this.OS.application.BaseApplication{constructor(t){super("ShowCase",t)}main(){var e,i,a,o,n,s,l,d;return this.find("bttest"),this.observable.on("btclick",t=>this.notify("button clicked")),this.bindKey("CTRL-SHIFT-P",t=>this.notify("CTRL-SHIFT-P shortcut executed")),(n=this.find("list")).data=[{text:"some thing with avery long text"},{text:"some thing 1",closable:!0},{text:"some thing 2",iconclass:"fa fa-camera-retro fa-lg"},{text:"some thing 3"},{text:"some thing 4"},{text:"some thing 5"}],n.onlistselect=t=>this.notify(t.data.items),this.find("switch").onswchange=t=>this.notify(t.data),this.find("spin").onvaluechange=t=>this.notify(t.data),this.find("menu").nodes=this.menu(),n.contextmenuHandle=(t,e)=>(e.items=this.menu(),e.show(t)),(o=this.find("grid")).oncelldbclick=t=>this.notify("on dbclick",t),o.onrowselect=t=>this.notify("on rowselect"),o.header=[{text:"header1",width:80},{text:"header2"},{text:"header3"}],o.rows=[[{text:"text 1"},{text:"text 2"},{text:"text 3"}],[{text:"text 4"},{text:"text 5"},{text:"text 6"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}],[{text:"text 10"},{text:"this is a long text"},{text:"text 11"}]],s={text:"Tree root",nodes:[{text:"leaf 1",iconclass:"fa fa-car"},{text:"leaf 2"},{text:"sub tree 1",nodes:[{text:"sub sub tree 1",nodes:[{text:"leaf 1 of sub sub tree 1"},{text:"leaf 2 of sub sub tree 1"}]},{text:"leaf 1 of sub tree"},{text:"leaf 2 of sub tree"},{text:"sub sub tree 2",nodes:[{text:"leaf 1 of sub sub tree 2"},{text:"leaf 2 of sub sub tree 2"}]}]}]},(l=this.find("tree")).data=s,l.ontreeselect=t=>this.notify(t.data.item.treepath),l.ontreedbclick=t=>this.notify("treedbclick"),this.observable.on("treedbclick",t=>this.notify("observable treedbclick")),this.find("slider").onvaluechange=t=>this.notify(t),this.find("cal").ondateselect=t=>this.notify(t.data.toString()),this.find("cpk").oncolorselect=t=>this.notify(JSON.stringify(t)),(a=this.find("fileview")).fetch=function(t){return new Promise((function(e,i){var a;return(a=t.asFileHandle()).read().then((function(t){var o;return(o=a.parent().asFileHandle()).filename="[..]",o.type="dir",t.error?i(t.error):(t.result.unshift(o),e(t.result))}))}))},a.path="home:///",(d=this.find("viewoption")).data=[{text:"icon"},{text:"list"},{text:"tree"}],d.onlistselect=t=>(this.notify(t.data.item.data.text),a.view=t.data.item.data.text),i=this.find("dialoglist"),e=this.find("btrundia"),i.data=[{text:"Prompt dialog",id:"prompt"},{text:"Calendar dialog",id:"calendar"},{text:"Color picker dialog",id:"colorpicker"},{text:"Info dialog",id:"info"},{text:"YesNo dialog",id:"yesno"},{text:"Selection dialog",id:"selection"},{text:"About dialog",id:"about"},{text:"File dialog",id:"file"},{text:"Text dialog",id:"text"},{text:"Multi-input dialog",id:"minputs"},{text:"Multi key value dialog",id:"mkv"}],this.morphon(t.OS.GUI.RESPONSIVE.MEDIUM,t=>this.find("tabctn").dir=t?"row":"column"),e.onbtclick=t=>{var e;if(e=i.selectedItem)switch(e.data.id){case"prompt":return this.openDialog("PromptDialog",{title:"Prompt review",value:"txt data",label:"enter value"}).then(t=>this.notify(t));case"calendar":return this.openDialog("CalendarDialog",{title:"Calendar dialog"}).then(t=>this.notify(t.toString()));case"colorpicker":return this.openDialog("ColorPickerDialog").then(t=>this.notify(JSON.stringify(t)));case"info":return this.openDialog("InfoDialog",{title:"Info application",name:"Show case",date:"10/12/2014",description:"the brown fox jumps over the lazy dog"}).then((function(t){}));case"yesno":return this.openDialog("YesNoDialog",{title:"Question ?",text:"Do you realy want to delete file ?"}).then(t=>this.notify(t));case"selection":return this.openDialog("SelectionDialog",{title:"Select data ?",data:[{text:"Option 1"},{text:"Option 2"},{text:"Option 3",iconclass:"fa fa-camera-retro fa-lg"}]}).then(t=>this.notify(t.text));case"about":return this.openDialog("AboutDialog").then(t=>{});case"file":return this.openDialog("FileDialog",{title:"Select file ?",mimes:["text/*","dir"],file:"Untitled".asFileHandle()}).then((t,e)=>this.notify(t