Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.18 #27

Merged
merged 9 commits into from
Jan 30, 2025
Merged

1.18 #27

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assetMasters/cd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assetMasters/documentsmallv2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assetMasters/folder upscaled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assetMasters/monalisaiconv2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion public/appStore/appStoreData.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"name": "Sacred OS v1.17 Update Utility",
"name": "Sacred OS v1.18 Update Utility",
"dir": "/apps/sOSUpdateUtility",
"icon": "icon.png",
"description": "This program will update the system files of Sacred OS to the latest version.",
Expand All @@ -26,6 +26,15 @@
"link": "https://nicholas.carlini.com/writing/2019/javascript-doom-clone-13k.html",
"mode": "Install"
},
{
"name": "Audio Player",
"dir": "/apps/audioPlayer",
"icon": "icon.png",
"description": "Play your music and audio files in Sacred OS. Works with WAV, MP3, and more.",
"author": "Mark Valentino",
"link": "https://github.com/M-Valentino",
"mode": "Install"
},
{
"name": "Peter Alert",
"dir": "/apps/peterAlert",
Expand Down
84 changes: 84 additions & 0 deletions public/appStore/apps/audioPlayer/audioPlayer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!--width="400" height="90" microIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAi9JREFUeNq8lq9vAjEUx18JYhK5CRKQp5YpRrIJDgUCyxRjAj0siswMOfT2Dwy3IEDdYZYAiiwTyLEgtgSDnLvt9XiX0mtLEeMl/Opx/fR7/b73yoIggENFEt8YYzv/6LqudlW+7++cAEUlbSG5XE553XEcPpcNNLkLcnfq898DyGknqdfrkQATNGECeXUfLs70K92o4pFKpaDZbBofeUIHuur5W+Pln44WiiAKEzChU9QYAjyVwnGVOlGVHL1eTwmMKcM9ep2F30WgjSqMfD4P4/E4UqiE4SpExxFw116JEAKJxhHVxZQNjlpbQFKHj1LeN1JFEBG0Xq9jC2KYbMViMVDlEU2OIAQ69wCXDxDZut/vB7IaGTKfz2E6nYLnecyY1JHKWQcauDIBhFGpVBgCdRCrPFNBWQ2UiYpAEYQQFchYQWxtblKyF8wGYgvSPkaEEAgdh6/VaqUsQTfvy2ByUrZvMbpaJ+YQuQ/3iMYfV1h40wCFJUxGIfD8a6CFcetjP8PkwyRUVQQM2d7ZWS1KCX79e8k/F6PFFhRtj10g1s9sQBQfo01JgxCYP05zYKaQ4eOklME0vmdI73a7MZAcqEo2BFYZfs8fkAKh7KW91dtiBkGgCFKp4g4stbg6sWiLwM/ba7MbaRXValUJUqkSizYBCSR37ITu8ELAfeO56moPQZEbdR2b+pJOlTPsQLYQfm+/6UHG05VwQyAdamJhglgp+49zIzvkifhXgAEAjikrV9kZf3wAAAAASUVORK5CYII="-->
<!DOCTYPE html>
<html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#audioPlayerContainer {
margin-top: 8px;
}

audio {
width: 100%;
}
</style>
</head>

<body>
<button class="oSButton osElemBase" onclick="openFile()">Open</button>
<div id="audioPlayerContainer">
<audio id="audioPlayer" controls>
Your browser does not support the audio element.
</audio>
</div>
<script>
window.top.postMessage("REQ:SS", "*");

let filePath = null;

function openFile() {
window.top.postMessage("OPWD:[", "*");
}

function getFileName(filePath) {
const directories = filePath.split("/");
return directories.pop();
}

function base64ToBlob(base64, mimeType) {
const binaryString = atob(base64);
const len = binaryString.length;
const bytes = new Uint8Array(len);
for (let i = 0; i < len; i++) {
bytes[i] = binaryString.charCodeAt(i);
}
return new Blob([bytes], { type: mimeType });
}

window.addEventListener("message", function (e) {
if (e.data.startsWith("SS:")) {
const stylesheet = e.data.substring(3);
try {
const styleElement = document.createElement('style');
styleElement.type = 'text/css';
styleElement.innerText = stylesheet;
document.head.appendChild(styleElement);
} catch (error) {
console.error("Error requesting stylesheet:", error);
}
return;
} else if (e.data.startsWith("PHFD:[")) {
const rightBracketIndex = e.data.indexOf("]");
filePath = e.data.substring(6, rightBracketIndex);
const base64Data = e.data.substring(rightBracketIndex + 1).trim();

if (base64Data && filePath) {
const audioMimeType = "audio/mpeg";
const blob = base64ToBlob(base64Data, audioMimeType);
const blobURL = URL.createObjectURL(blob);

const audioPlayer = document.getElementById("audioPlayer");
audioPlayer.src = blobURL;
audioPlayer.load();

window.top.postMessage(`UHI:[${programId}]${getFileName(filePath)}`)
}
} else if (e.data.startsWith("ID:[")) {
programId = e.data.substring(4);
}
});
</script>
</body>

</html>
Binary file added public/appStore/apps/audioPlayer/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions public/appStore/apps/audioPlayer/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
async function copyData() {
try {
const response = await fetch("/appStore/apps/audioPlayer/audioPlayer.html");
if (response.ok) {
const content = await response.text();
window.top.postMessage(`SF:[programs/audioPlayer.html]${content}`, "*");
return true;
} else {
console.error(`Error fetching file HTTP status ${response.status}`);
}
} catch (err) {
console.error(`Error fetching file : ${err}`);
}
return false;
}
async function install() {
window.top.postMessage("MK:F[programs/audioPlayer.html]", "*");
const installedCorrectly = await copyData();

if (installedCorrectly) {
window.top.postMessage("MK:MENU-SC[programs/audioPlayer.html");
window.top.postMessage("ALERT:[Audio Player installed!");
} else {
window.top.postMessage("ALERT:[Could Not install Audio Player.");
}
}

install();
2 changes: 1 addition & 1 deletion public/appStore/apps/sOSUpdateUtility/install.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const appName = "osUpdate1.17.html";
const appName = "osUpdate1.18.html";
async function copyData() {
try {
const response = await fetch(`/appStore/apps/sOSUpdateUtility/${appName}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<body>
<main>
<h1>𓍰 Sacred OS v1.17 Update</h1>
<h1>𓍰 Sacred OS v1.18 Update</h1>
<p id="updateText">This file will update all files in the system folder, and all files in the programs/default
folder. It will
not
Expand All @@ -24,7 +24,7 @@ <h1>𓍰 Sacred OS v1.17 Update</h1>
</main>
<script>
let currentOSversion;
const updateVersion = 1.17;
const updateVersion = 1.18;

window.top.postMessage("REQ:SS", "*");
window.top.postMessage("REQ:OSV", "*");
Expand Down
7 changes: 4 additions & 3 deletions public/programs/default/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
}

.fileOrDir img {
width: 48px;
height: 62px;
width: 54px;
height: 54px;
margin: auto;
}

Expand Down Expand Up @@ -618,7 +618,8 @@
} else if (imgExtensions.some(ext => key.includes(ext))) {
icon.src = imageImage;
} else if (key.indexOf('.html') !== -1) {
icon.src = executableImage;
const iconMatch = backupObject[key].match(/<!--.* microIcon="(.+?)".*-->/);
iconMatch ? icon.src = iconMatch[1] : icon.src = executableImage;
} else {
icon.src = documentImage;
}
Expand Down
Loading