Neutralino & new project structure

This commit is contained in:
2023-12-23 17:03:28 -05:00
parent ebccf275a7
commit 4879f5a7cf
13 changed files with 159 additions and 10 deletions

22
platforms/browser.js Normal file
View File

@@ -0,0 +1,22 @@
function Platform() {
this.save = async (path, data) => {
localStorage.setItem(path, data)
}
this.open = (path) => {
return localStorage.getItem(path)
}
this.readdir = (path) => {
return Object.keys(localStorage)
.filter(key => key.startsWith(path))
}
this.createWindow = url => {
return window.open(url ?? 'about:blank', '_blank')
}
this.createInstance = url => {
return window.open(url ?? this.location)
}
}

3
platforms/neutralino.js Normal file
View File

@@ -0,0 +1,3 @@
function Platform() {
}