Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Commit

Permalink
piss
Browse files Browse the repository at this point in the history
  • Loading branch information
novafurry committed May 9, 2024
1 parent abc88cd commit 5a19cbd
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 12 deletions.
17 changes: 17 additions & 0 deletions appStyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
body{
width: calc(100vw - 20px);
padding: 10px;
height: calc(100vh - 20px);
margin: 0px;
background-color: none;
}
navRail{
width: calc(100vw - 20px);
background: rgba(14, 14, 14, 0.3);
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25), inset 0px 4px 4px rgba(0, 0, 0, 0.25);
border-radius: 5px;
min-height: 30px;
max-height: 50px;
height: 1em;
display: block;
}
26 changes: 16 additions & 10 deletions applications/fm.nvapp.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<link rel="stylesheet" href="../appStyle.css">
<navRail>
<back/>
<forward/>
<up/>
<breadcrumbs></breadcrumbs>
<search></search>
</navRail>
<partition size="1/4"></partition>
<partition size="3/4"></partition>
<body>
<link rel="stylesheet" href="../appStyle.css">
<navRail>
<back />
<forward />
<up />
<breadcrumbs></breadcrumbs>
<search></search>
</navRail>
<partition size="1/4">
<ul id="fmBkms"></ul>
</partition>
<partition size="3/4">
<ul id="fileListing"></ul>
</partition>
</body>
162 changes: 161 additions & 1 deletion libraries/foxyfs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,171 @@
const opfsRoot = await navigator.storage.getDirectory();
window.foxyfs = {
getFileHandle: async function (path1) {
var path = path1.split("/")
var nameofFile = path[path.length - 1]
path[path.length - 1] = '';
path = path.filter(function (el) {
return el != '';
});
var content = {};
if (path.length == 0) {
var dirHandle = await opfsRoot.getDirectoryHandle(nameofFile);
content[nameofFile] = dirHandle
}
else if (path.length > 1) {
var dirHandle = await opfsRoot.getDirectoryHandle(path[0]);

for (var item of path) {
if (item == path[0]) {

} else {
dirHandle = await dirHandle.getDirectoryHandle(item)
}
}
var content = {};
for await (let [name, handle] of dirHandle.entries()) {
content[name] = handle
}
} else if (path.length == 1) {
var dirHandle = await opfsRoot.getDirectoryHandle(path[0]);

var content = {};
for await (let [name, handle] of dirHandle.entries()) {
content[name] = handle
}
}
return content[nameofFile]
},
init: async function () {
var directoryHandle = await opfsRoot.getDirectoryHandle('sys', { create: true });
directoryHandle = await opfsRoot.getDirectoryHandle('user', { create: true });
},
ls: async function (dir) {
return await opfsRoot.getDirectoryHandle(dir);
var path = dir.split("/")
path = path.filter(function (el) {
return el != '';
});
if (path.length == 0) {
var content = {};
for await (let [name, handle] of opfsRoot.entries()) {
content[name] = handle.kind
}
return content;
}
var dirHandle = await opfsRoot.getDirectoryHandle(path[0]);
if (path.length > 1) {
for (var item of path) {
if (item == path[0]) {

} else {
dirHandle = await dirHandle.getDirectoryHandle(item)
}
}
var content = {};
for await (let [name, handle] of dirHandle.entries()) {
content[name] = handle.kind
}
return content;
} else if (path.length == 1) {
var content = {};
for await (let [name, handle] of dirHandle.entries()) {
content[name] = handle.kind
}
return content;
}
},
mkdir: async function (location, name) {
if (location == '' || location == "/") {
return await opfsRoot.getDirectoryHandle(name, { create: true });
} else {
var path = location.split("/")
path = path.filter(function (el) {
return el != '';
});
var dirHandle = await opfsRoot.getDirectoryHandle(path[0])
for (var item of path) {
if (item == path[0]) {

} else {
dirHandle = await dirHandle.getDirectoryHandle(item)
}
}
return await dirHandle.getDirectoryHandle(name, { create: true })
}
},
touch: async function (location, name) {
if (location == '' || location == "/") {
return await opfsRoot.getFileHandle(name, { create: true });
} else {
var path = location.split("/")
path = path.filter(function (el) {
return el != '';
});
var dirHandle = await opfsRoot.getDirectoryHandle(path[0])
for (var item of path) {
if (item == path[0]) {

} else {
dirHandle = await dirHandle.getDirectoryHandle(item)
}
}
return await dirHandle.getFileHandle(name, { create: true })
}
},
typeof: async function (path1) {
var path = path1.split("/")
var nameofFile = path[path.length - 1]
path[path.length - 1] = '';
path = path.filter(function (el) {
return el != '';
});
var content = {};
if (path.length == 0) {
var dirHandle = await opfsRoot.getDirectoryHandle(nameofFile);
content[nameofFile] = dirHandle.kind
}
else if (path.length > 1) {
var dirHandle = await opfsRoot.getDirectoryHandle(path[0]);

for (var item of path) {
if (item == path[0]) {

} else {
dirHandle = await dirHandle.getDirectoryHandle(item)
}
}
var content = {};
for await (let [name, handle] of dirHandle.entries()) {
content[name] = handle.kind
}
} else if (path.length == 1) {
var dirHandle = await opfsRoot.getDirectoryHandle(path[0]);

var content = {};
for await (let [name, handle] of dirHandle.entries()) {
content[name] = handle.kind
}
}
return content[nameofFile]
},
read: async function (path) {
var h = await foxyfs.getFileHandle(path)
var file = await h.getFile()
return await file.text()
},
write: async function (path, content) {
var h = await foxyfs.getFileHandle(path)
var stream = await h.createWritable()
stream.write(content)
stream.close()
return h;
},
rmfile: async function (path){
h = await foxyfs.getFileHandle(path)
h.remove()
},
rmdir: async function (path, recursive=false){

}
}
foxyfs.init()
7 changes: 6 additions & 1 deletion libraries/foxywm.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
"title": "Welcome to Nova OS",
"content": "Welcome to Nova OS Proto. Keep in mind that this is in early stages."
},
"bi2o": {
"bio": {
"title": "Who is Nova?",
"content": "piss to Nova OS Proto. Keep in mind that this is in early stages."
},
"cvm": {
"title":"bantene shampoo",
"content": "<video src='../assets/I_use_Pantene_shampoo_along_with_Dove_soap_.mov' autoplay loop></video>"
},
"fm": {
"title": "File Manager",
"appContentID": "fm.nvapp.html",
"content": "If this is visible, your FoxyWM version does not support appContentIDs"
}
}

0 comments on commit 5a19cbd

Please sign in to comment.