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

Commit

Permalink
😫
Browse files Browse the repository at this point in the history
  • Loading branch information
novafurry committed May 9, 2024
1 parent 5a19cbd commit 84487c7
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 1,294 deletions.
32 changes: 28 additions & 4 deletions appStyle.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
body{
width: calc(100vw - 20px);
padding: 10px;
height: calc(100vh - 20px);
width: 100vw;
padding:0px;
height: 100vh;
margin: 0px;
background-color: none;
}
@font-face {
font-family: "lucide";
src: url("lucide.woff") format("woff");

}
*{
font-family: system-ui, 'lucide';
}
navRail{
width: calc(100vw - 20px);
width: 100vw;
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;
}
back::after{
display: inline;
content: "\e04c";
padding-top:0.2em;
padding-left:0.5em;
font-size: 1.3em;
color:white;
}
forward::after{
display: inline;
content: "\e04c";
padding-top:0.2em;
padding-left:0.5em;
font-size: 1.3em;
color:white;
}
25 changes: 14 additions & 11 deletions applications/fm.nvapp.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<body>
<link rel="stylesheet" href="../assets/lucide.css">
<appContent>
<link rel="stylesheet" href="../appStyle.css">
<navRail>
<back />
<forward />
<up />
<back></back>
<forward></forward>
<up></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>
<main>
<ul id="files"></ul>
</main>
<script src="../libraries/foxyfs.js"></script>
<script>
root = foxyfs.ls("/")
console.log(root)
</script>
</inline>
47 changes: 42 additions & 5 deletions libraries/foxyfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,32 @@ window.foxyfs = {
}
return content[nameofFile]
},
getDirHandle: 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);
}
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)
}
}
} else if (path.length == 1) {
var dirHandle = await opfsRoot.getDirectoryHandle(path[0]);
}
return dirHandle
},
init: async function () {
var directoryHandle = await opfsRoot.getDirectoryHandle('sys', { create: true });
directoryHandle = await opfsRoot.getDirectoryHandle('user', { create: true });
Expand Down Expand Up @@ -149,7 +175,7 @@ window.foxyfs = {
return content[nameofFile]
},
read: async function (path) {
var h = await foxyfs.getFileHandle(path)
var h = await foxyfs.getFileHandle(path)
var file = await h.getFile()
return await file.text()
},
Expand All @@ -160,12 +186,23 @@ window.foxyfs = {
stream.close()
return h;
},
rmfile: async function (path){
h = await foxyfs.getFileHandle(path)
rmfile: async function (path) {
var h = await foxyfs.getFileHandle(path)
h.remove()
},
rmdir: async function (path, recursive=false){

rmdir: async function (path) {
var h = await foxyfs.getDirHandle(path)
var returnVal = "it no worky :(";
try {
h.remove({ recursive: false })
returnVal = "Successful"
} catch {

h.remove({ recursive: true })
returnVal = "Successful, but had to work recursivly"

}
return returnVal;
}
}
foxyfs.init()
2 changes: 1 addition & 1 deletion libraries/foxywm.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"fm": {
"title": "File Manager",
"appContentID": "fm.nvapp.html",
"content": "If this is visible, your FoxyWM version does not support appContentIDs"
"content": "<iframe frameborder=0 width='100%' height='100%' src='./applications/fm.nvapp.html'></iframe>"
}
}
Loading

0 comments on commit 84487c7

Please sign in to comment.