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

1 line
6.1 KiB
JavaScript
Raw Normal View History

2022-12-31 22:45:42 +01:00
(function(){var t;(t=class extends this.OS.application.BaseApplication{constructor(t){super("ShowCase",t)}main(){var t,e,i,a,o,n,s,l;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")),(o=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"}],o.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(),o.contextmenuHandle=(t,e)=>(e.items=this.menu(),e.show(t)),(a=this.find("grid")).oncelldbclick=t=>this.notify("on dbclick",t),a.onrowselect=t=>this.notify("on rowselect"),a.header=[{text:"header1",width:80},{text:"header2"},{text:"header3"}],a.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"}]],n={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"}]}]}]},(s=this.find("tree")).data=n,s.ontreeselect=t=>this.notify(t.data.item.treepath),s.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)),(i=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))}))}))},i.path="home:///",(l=this.find("viewoption")).data=[{text:"icon"},{text:"list"},{text:"tree"}],l.onlistselect=t=>(this.notify(t.data.item.data.text),i.view=t.data.item.data.text),e=this.find("dialoglist"),t=this.find("btrundia"),e.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"}],t.onbtclick=t=>{var i;if(i=e.selectedItem)switch(i.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,e));case"text":return this.openDialog("TextDialog",{title:"Text dialog review",value:"txt dat