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.16 #25

Merged
merged 4 commits into from
Jan 3, 2025
Merged

1.16 #25

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
2 changes: 1 addition & 1 deletion public/appStore/appStoreData.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"name": "Sacred OS v1.15 Update Utility",
"name": "Sacred OS v1.16 Update Utility",
"dir": "/apps/sOSUpdateUtility",
"icon": "icon.png",
"description": "This program will update the system files of Sacred OS to the latest version.",
Expand Down
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.15.html";
const appName = "osUpdate1.16.html";
async function copyData() {
try {
const response = await fetch(`/appStore/apps/sOSUpdateUtility/${appName}`);
Expand Down
4 changes: 2 additions & 2 deletions public/appStore/apps/sOSUpdateUtility/osUpdate1.15.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<body>
<main>
<h1>𓍰 Sacred OS v1.15 Update</h1>
<h1>𓍰 Sacred OS v1.16 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.15 Update</h1>
</main>
<script>
let currentOSversion;
const updateVersion = 1.15;
const updateVersion = 1.16;

window.top.postMessage("REQ:SS", "*");
window.top.postMessage("REQ:OSV", "*");
Expand Down
8 changes: 8 additions & 0 deletions public/outsideTheOS/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ <h2 id="change-log">Change Log</h2>
<th>Version</th>
<th>Changes</th>
</tr>
<tr>1.16</td>
<td>
<ul>
<li>You can now zoom in on pictures in the image viewer.</li>
<li>Fixed bug where folder names and file names could be created with brackets. These characters are incompatible with the kernel.</li>
</ul>
</td>
</tr>
<tr>
<td>1.15</td>
<td>
Expand Down
17 changes: 12 additions & 5 deletions public/programs/default/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,10 @@
fileName = fileName.concat(".txt");
}

fileName = fileName.replace("]", "");
fileName = fileName.replace("[", "");

if (fileName !== "") {
// Only proceed if the filename is not empty
window.top.postMessage(`MK:F[${pwd.substring(3)}${fileName}]`, '*');
}

Expand All @@ -378,6 +380,9 @@
window.top.postMessage("ALERT:[Can't name a folder with \".\"!");
}

folderName = folderName.replace("]", "");
folderName = folderName.replace("[", "");

if (folderName !== "") {
window.top.postMessage(`MK:D[${pwd.substring(3)}${folderName}]`, '*');
} else {
Expand Down Expand Up @@ -528,14 +533,17 @@

document.getElementById("fileUpload").addEventListener("change", async function (event) {
const file = event.target.files[0];
const filename = file.name;
let filename = file.name;
filename = filename.replace("]", "");
filename = filename.replace("[", "");
const extension = file.name.split('.').pop();
const path = pwd.substring(3) + filename;

// For text files
if (file && ['html', 'css', 'json', 'js', 'txt'].includes(extension)) {
const reader = new FileReader();
reader.onload = async function (e) {
const uploadedFile = e.target.result;
const path = pwd.substring(3) + filename;
window.top.postMessage(`SF:[${path}]${uploadedFile}`, "*");
};
reader.readAsText(file);
Expand All @@ -544,7 +552,6 @@
const reader = new FileReader();
reader.onload = function (e) {
const base64File = e.target.result.split(',')[1]; // Strips off the data URL prefix to get pure base64 content
const path = pwd.substring(3) + filename;
window.top.postMessage(`SF:[${path}]${base64File}`, "*");
};
reader.readAsDataURL(file);
Expand All @@ -571,7 +578,7 @@
const imageImage = JSON.parse(diskBackup.system.icons["picture.json"]).normal;
const executableImage = JSON.parse(diskBackup.system.icons["executable.json"]).normal;
let displayArea = document.getElementById("topLevelObjects");
displayArea.innerHTML = ''; // Clear existing content
displayArea.innerHTML = '';

const topLevelKeys = Object.keys(backupObject);
topLevelKeys.forEach(function (key) {
Expand Down
28 changes: 25 additions & 3 deletions public/programs/default/imageViewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,43 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
#imageContainer {
height: calc(100vh - 8px - 26px);
position: absolute;
top: 30px;
}

#img {
transform-origin: top left;
}

.menuButt {
height: 26px;
}

#zoomSelect {
position: absolute;
top: 0;
left: 0;
}
</style>
</head>

<body class="program">
<p id="noValidImage">No valid image opened.</p>
<select id="zoomSelect" class="oSButton osElemBase" onchange="applyZoom(this.value)">
<option value="1">100%</option>
<option value="2">200%</option>
<option value="3">300%</option>
<option value="4">400%</option>
</select>
<div id="imageContainer">
</div>
<script>
window.top.postMessage("REQ:SS", "*");

function applyZoom(value) {
document.getElementById("img").style.transform = `scale(${value})`;
}

// Function to extract file path from comments within the HTML
function extractFilePath() {
const nodes = document.createTreeWalker(document, NodeFilter.SHOW_COMMENT, null, false);
Expand All @@ -38,7 +59,7 @@

const filePath = extractFilePath(); // Extract the file path from a comment
const extension = filePath.split('.').pop();

if (filePath !== null) {
window.top.postMessage(`REQ:PH[${filePath}]`, "*");
}
Expand Down Expand Up @@ -66,7 +87,8 @@
let imageContainer = document.getElementById('imageContainer');
let image = document.createElement("img");

image.src= `data:image/${extension};base64,${fileContent}`;
image.src = `data:image/${extension};base64,${fileContent}`;
image.id = "img";
imageContainer.appendChild(image);
}
}
Expand Down
2 changes: 1 addition & 1 deletion public/system/kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ window.onmessage = function (e) {
}
return;
} else if (e.data == "REQ:OSV") {
e.source.postMessage("OSV:1.15", "*");
e.source.postMessage("OSV:1.16", "*");
} else if (e.data.startsWith("SF:[")) {
const rightBracketIndex = e.data.indexOf("]");

Expand Down