{ "name": "App Manager", "icon": `apps`, "desc": "The GopalOS file manager. This application is usually included with GopalOS.", "id": "app-manager", "globalID": "GopalOS.System.AppManager", "defaultRelease": "stable", "releases": { "stable": { "version": "v2.0.1", "app-files": { "app-manager": { type: "pgm", content: function() { if (document.getElementById("app_app-manager_window")) { document.getElementById("app_app-manager_window").style.display = "block"; } else { document.getElementById("windows").insertAdjacentHTML("beforeend", getRef("/apps/app-manager/window")); getRef("/apps/app-manager/load")(); } focusWin(document.getElementById("app_app-manager_window")); regTbarIcon("/apps/app-manager/app-manager", "app_app-manager_window", getRef("/apps/app-manager/icon")); refreshWindows(); } }, "icon": { type: "var", content: `apps` }, "load": { type: "js", content: function() { document.getElementById("app_app-manager_applist").innerHTML = ""; for (let i of Object.keys(os.apps).sort()) { document.getElementById("app_app-manager_applist").insertAdjacentHTML("beforeend", `
${os.apps[i].icon || "\u{1F5D4}"}\u00A0${os.apps[i].name}${os.apps[i].version}
${(() => {if (!getRef(`/apps/${i}/${i}`)) {return ``;} else {return ``;}})()}
${os.apps[i].desc || ""}

ID: ${os.apps[i].globalID ? (i + "
Global ID: " + os.apps[i].globalID) : i}
`); } } }, "window": { type: "html", content: `
Application Manager
🗕
🗖
❌︎
Your apps
View and manage all installed apps. Refresh
` }, "uninstall-app": { type: "js", content: function(appID, silent = false) { if (getRef(`/apps/${appID}/uninstall`)) { try{ getRef(`/apps/${appID}/uninstall`)(); } catch(err) { console.error(err); if (silent) {} else { msgbox("App could not be successfully uninstalled. Check the console for details.", "Uninstaller"); } } } else {} delRef(`/apps/${appID}`); delete os.apps[appID]; for (let i of document.getElementById("taskbar-items").children) { if (i.getAttribute("data-winid") == `app_${appID}_window`) { i.remove(); } else {} } if (document.getElementById(`app_${appID}_window`)) { document.getElementById(`app_${appID}_window`).remove(); } else {} refreshWindows(); } } } } } }