11 lines
2.4 KiB
JavaScript
11 lines
2.4 KiB
JavaScript
import{H as o,d as w}from"./index-e011716a.js";import{n as f}from"./application-default-icon-a19c8ba0.js";const T={config:{name:"Desktop",type:"process",targetVer:"1.0.0-indev.0"},run:async e=>{const c=(await e.loadLibrary("lib/SplashScreen")).getElement();c.appendTo(document.body);const{fs:s}=e,y=await e.loadLibrary("lib/WindowManager"),t=await e.loadLibrary("lib/Launcher"),{Input:b}=await e.loadLibrary("lib/Components"),p=b.new().attr({type:"text",placeholder:"Search"}).style({width:"100%","border-radius":"10px",padding:"5px","margin-bottom":"10px",position:"sticky",top:"0"}).on("keyup",()=>{n.elm.innerHTML="",i().catch(a=>console.error(a))}).appendTo(t.element),n=new o("div").style({overflow:"scroll",height:"max-content",position:"relative"});new o("div").style({height:"100%",overflow:"scroll","padding-bottom":"30px"}).append(n).appendTo(t.element).class("gradient-blur");const i=async()=>{n.html(""),(await s.readdir("/home/Applications/")).filter(l=>l.endsWith(".app")&&(p.elm!==null?l.toLowerCase().includes(p.elm.value.toLowerCase()):!0)).forEach(l=>{s.readFile(`/home/Applications/${l}`).then(async r=>{const u=w.Buffer.from(r).toString(),d=await e.kernel.getExecutable(u),g=new o("div").style({display:"flex","align-items":"center",padding:"5px",cursor:"pointer",gap:"10px","border-bottom":"1px solid var(--surface-0)"}).on("click",()=>{e.launch(u).catch(h=>console.error(h)),t.toggle()}).appendTo(n);new o("img").attr({src:d.config.icon??f,alt:`${d.config.name} icon`,height:"40px"}).appendTo(g),new o("div").text(d.config.name).appendTo(g)}).catch(r=>console.error(r))})};await i(),document.addEventListener("fs_update",()=>{i().catch(a=>console.error(a))}),t.element.on("click",a=>{a.target===a.currentTarget&&t.toggle()});const m=await e.loadLibrary("lib/StatusBar");m.element.qs('div[data-toolbar-id="start"]')?.on("click",()=>{t.toggle()}),document.body.style.flexDirection="column-reverse",await m.element.appendTo(document.body),await t.element.appendTo(document.body),await y.windowArea.appendTo(document.body),c.cleanup(),t.element.prepend(new o("div").html(`
|
|
<ins class="adsbygoogle"
|
|
style="display:block"
|
|
data-ad-format="fluid"
|
|
data-ad-layout-key="-if+5+1+2-3"
|
|
data-ad-client="ca-pub-9675905177363247"
|
|
data-ad-slot="2569234651"></ins>
|
|
<script>
|
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
|
<\/script>
|
|
`))}};export{T as default};
|