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

Commit

Permalink
yeah i improved some things idk bye
Browse files Browse the repository at this point in the history
  • Loading branch information
randomuser691337 committed May 11, 2024
1 parent a5d5d31 commit 4042370
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
4 changes: 4 additions & 0 deletions libraries/foxywm.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
"title": "File Manager",
"appContentID": "fm.nvapp.html",
"content": "<iframe frameborder=0 width='100%' height='100%' src='./applications/fm.nvapp.html'></iframe>"
},
"send": {
"title": "Send Files",
"content": "<p>Sends files from this NovaOS to another NovaOS instance. Also compatible with <a href='https://webdesk-beta.vercel.app' target='_blank'>WebDesk</a>"
}
}
30 changes: 21 additions & 9 deletions libraries/peertest.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@

<body>
<h1>NovaOS Sendit</h1>
<h2>Compatible with WebDesk Drop</h2><br>
My ID: <input type="text" id="myID" readonly><br>
<h2>Compatible with WebDrop</h2><br>
My Name: <input type="text" id="name"><br>
File Name: <input type="text" id="fname"><br>
File Content: <input type="text" id="fcontent"><br>
Recepient: <input type="text" id="recepient"><br>
Recepient's ID: <input type="text" id="recepient"><br>
<button id="send">Send It!</button><br>
Log Goes Here: <br>
<textarea readonly id="log" cols="30" rows="10"></textarea>
Expand All @@ -33,7 +32,8 @@ <h2>Compatible with WebDesk Drop</h2><br>
btn: document.querySelector("#send"),
log: document.querySelector("#log")
}
peer = new Peer()
var fucker = gen(4);
peer = new Peer(fucker)
async function getId() {
setInterval(function () {
if (typeof (installID) === 'undefined') {
Expand All @@ -43,8 +43,18 @@ <h2>Compatible with WebDesk Drop</h2><br>
}
}, 10000);
}



function gen(length) {
if (length <= 0) {
console.error('Length should be greater than 0');
return null;
}

const min = Math.pow(10, length - 1);
const max = Math.pow(10, length) - 1;
return Math.floor(Math.random() * (max - min + 1)) + min;
}

peer.on('open', (peerId) => {
var installID = peerId
els.log.value = els.log.value + "Grabbed ID Successfully! " + peerId + "\n"
Expand All @@ -53,15 +63,17 @@ <h2>Compatible with WebDesk Drop</h2><br>
console.log("A wild connection has appeared")
conn.on('data', (data) => {
if (data.name === "MigrationPackDeskFuck") {
els.log.value = els.log.value + "Sorry, NovaOS does not yet support WebDesk Migration.\n"
els.log.value = els.log.value + "Sorry, NovaOS does not support WebDesk Migration.\n"
} else if (data.name === "YesImAlive-WebKey") {
els.log.value = els.log.value + "File sent successfully!\n"
} else if (data.name === "DesktoDeskMsg-WebKey") {
els.log.value = els.log.value + `Message from WebDesk: ${data.file}\n`
} else {
var conn = peer.connect(data.id);
// on open will be launch when you successfully connect to PeerServer
conn.on('open', function () {
// here you have conn.id
conn.send({name:"YesImAlive-WebKey"});
conn.send({ name: "YesImAlive-WebKey" });
});
}
});
Expand All @@ -71,7 +83,7 @@ <h2>Compatible with WebDesk Drop</h2><br>
name: els.file.name.value,
file: els.file.cunt.value,
uname: els.me.name.value,
id: els.me.id.value
id: fucker
};
var conn = peer.connect(els.recepient.value);
// on open will be launch when you successfully connect to PeerServer
Expand Down
5 changes: 5 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ body, html{
padding: 5px 5px 0px 5px;
text-align: center;
border-top-right-radius: 10px;
border: 1px solid #2a2a2a;
}
.dockicon{
padding: 5px;
Expand Down Expand Up @@ -151,4 +152,8 @@ body, html{
background-color: var(--scroll-bar-color);
border-radius: 20px;
border: 3px solid var(--scroll-bar-bg-color);
}

#logo {
vertical-align: middle;
}

0 comments on commit 4042370

Please sign in to comment.