Skip to content

Commit

Permalink
Merge pull request #16 from M-Valentino/1.6
Browse files Browse the repository at this point in the history
1.6
  • Loading branch information
M-Valentino authored Sep 6, 2024
2 parents 4908edb + 363bd4e commit 50ccd5d
Show file tree
Hide file tree
Showing 18 changed files with 162 additions and 53 deletions.
Binary file modified assetMasters/appstore.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 modified assetMasters/dog.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/executable.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 modified assetMasters/math.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 modified assetMasters/tetris.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.5 Update Utility",
"name": "Sacred OS v1.6 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.5.html";
const appName = "osUpdate1.6.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,15 +14,17 @@

<body>
<main>
<h1>𓍰 Sacred OS v1.5 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
<h1>𓍰 Sacred OS v1.6 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
overwrite any other data. Please make sure you have saved your session before updating to avoid losing data. You may delete this program after installing the update.</p>
overwrite any other data. Please make sure you have saved your session before updating to avoid losing data. You
may delete this program after installing the update.</p>
<button class="osElemBase oSButton" id="updateSystem">Update System</button>
</main>
<script>
let currentOSversion;
const updateVersion = 1.5;
const updateVersion = 1.6;

window.top.postMessage("REQ:SS", "*");
window.top.postMessage("REQ:OSV", "*");
Expand Down Expand Up @@ -60,6 +62,7 @@ <h1>𓍰 Sacred OS v1.5 Update</h1>
{
icons: [
"document.json",
"executable.json",
"folder.json",
"picture.json",
"deleteIndicator.json"
Expand Down Expand Up @@ -115,9 +118,11 @@ <h1>𓍰 Sacred OS v1.5 Update</h1>
}
} else {
console.error(`Error fetching file ${fileURL}: HTTP status ${response.status}`);
return null;
}
} catch (err) {
console.error(`Error fetching file ${fileURL}: ${err}`);
return null;
}
}

Expand All @@ -127,15 +132,15 @@ <h1>𓍰 Sacred OS v1.5 Update</h1>
for (let item of systemFiles[key]) {
if (typeof item === 'string') {
let fileURL = `https://sacred.neocities.org/${basePath}${key}/${item}`;
try {
let content = await fetchContent(fileURL);
window.top.postMessage(`MK:F[${basePath}${key}/${item}]`, "*");
sleep(100);
window.top.postMessage(`SF:[${basePath}${key}/${item}]${content}`, "*");
sleep(100);
} catch {
let content = await fetchContent(fileURL);
if (content === null) {
return false;
}
window.top.postMessage(`MK:F[${basePath}${key}/${item}]`, "*");
sleep(100);
window.top.postMessage(`SF:[${basePath}${key}/${item}]${content}`, "*");
sleep(100);

} else if (typeof item === 'object') {
for (let nestedKey in item) {
await copyData({ [nestedKey]: item[nestedKey] }, `${basePath}${key}/`);
Expand Down
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ <h2 class="mt-20">Compiling OS From Source:</h2>
{
icons: [
"document.json",
"executable.json",
"folder.json",
"picture.json",
"deleteIndicator.json"
Expand Down
53 changes: 36 additions & 17 deletions public/outsideTheOS/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2 class="mt-0" id="tocHeader">Table of Contents</h2>
<li><a href="#intro">Intro</a></li>
<li><a href="#how-it-works">How it works</a></li>
<li><a href="#kernel-commands">List of Kernel Commands</a></li>
<li><a href="#current-state">Current State</a></li>
<li><a href="#planned-features">Planned Features</a></li>
<li><a href="#change-log">Change Log</a></li>
<li><a href="#qa">Q&A</a></li>
<li><a href="#credits">Credits</a></li>
Expand All @@ -53,7 +53,7 @@ <h2 class="mt-0" id="tocHeaderMobile">Table of Contents</h2>
<li><a href="#intro">Intro</a></li>
<li><a href="#how-it-works">How it works</a></li>
<li><a href="#kernel-commands">List of Kernel Commands</a></li>
<li><a href="#current-state">Current State</a></li>
<li><a href="#planned-features">Planned Features</a></li>
<li><a href="#change-log">Change Log</a></li>
<li><a href="#qa">Q&A</a></li>
<li><a href="#credits">Credits</a></li>
Expand Down Expand Up @@ -138,9 +138,15 @@ <h2 id="kernel-commands">List of Kernel Commands (Incomplete)</h2>
a string to the iframe (program) that sent
the message. The string containing the style sheet is prepended with <code>SS:</code></td>
</tr>
<tr>
<td>RND:[]</td>
<td>The kernel will rename the folder in the path inside the brackets to the text specified after the right
bracket.</td>
</tr>
<tr>
<td>RNF:[]</td>
<td>The kernel will rename the file in the file path inside the brackets to the text after the right
<td>The kernel will rename the file in the file path inside the brackets to the text specified after the
right
bracket.</td>
</tr>
<tr>
Expand All @@ -158,19 +164,8 @@ <h2 id="kernel-commands">List of Kernel Commands (Incomplete)</h2>
<td>Changes the OS's clock to the 24 hour time format.</td>
</tr>
</table>

<h2 id="current-state">
Current State
</h2>
<p>
File manipulation is limited at the moment in Sacred OS. Currently you can't rename folders or do cut and
paste
operations, but I'm working on it. I'm also working on a way to let users update their saved JSON disk backups
to
the latest OS version.
</p>
<h3 id="plannedFeatures">Planned Features</h3>
<ul aria-labelledby="plannedFeatures">
<h2 id="planned-features">Planned Features</h2>
<ul aria-labelledby="planned-features">
<li>Desktop shortcuts</li>
<li>Videogame emulators</li>
<li>Linux-like terminal that can execute JavaScript code</li>
Expand All @@ -184,6 +179,29 @@ <h2 id="change-log">Change Log</h2>
<th>Version</th>
<th>Changes</th>
</tr>
<tr>
<td>1.6</td>
<td>
<ul>
<li>
If programs don't have an icon, they will have the default icon in the start menu.
</li>
<li>
Impoved the looks of some program icons.
</li>
<li>
Program icons in the start menu now are shown as a consistent width of 27x27px.
</li>
<li>
When a dialog is already shown in the files program and a new dialog is shown, the old dialog is
closed.
</li>
<li>
Folders can now be renamed.
</li>
</ul>
</td>
</tr>
<tr>
<td>1.5</td>
<td>
Expand Down Expand Up @@ -262,7 +280,8 @@ <h2 id="qa">Q&A</h2>
do
save and backup your data more easily. I chose to use Vanilla JS as opposed to a framework because it would
allow
me to have more access to low level features in JavaScript, giving me more code control, and potentially more
me to have more access to low level features in JavaScript, giving me more code control, and potentially
more
performance.
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion public/programs/default/appStore.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--width="700" height="600" microIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWBAMAAAA2mnEIAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAC1QTFRFAAAA/AEA/lsA/2oA/SsA/2UA/j4A/AkA/RYA/kwA/SAA/5YA/6cA/3sA/3YARroGrwAAAA90Uk5TAP//////////////////5Y2epgAAALlJREFUeJxjYEAFgoICjAIIpqCgIIgJpBkEc80KQTLiggIMUm/OOQIlGNscBRhErE+HAIUYnRKBWibfMwIqEkxaCJSszAhOFGSQCHUEmzVZHcReKAAyrDUEyA52BJkmKBkmyCCunAiyhlHMCGjNZA1BkCIRo0IGwVZTkDUMUmpAcUnbSyAdkiqCDIzi2metgBKLpgPtFezbswkoVAYyWrD0DYgNdjSjxCSgUkFBAYhfwJ6BeIwRwYQDAExeIT07IdY2AAAAAElFTkSuQmCC"-->
<!--width="700" height="600" microIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAC1QTFRFAAAA/AEA/SsA/lsA/kwA/RYA/AkA/5YA/6cA/3YA/2UA/j4A/SAA/2oA/3sAJNt+9AAAAA90Uk5TAP//////////////////5Y2epgAAAOlJREFUeJxjZEABjCRzBRn+fxB8D+OCeQxAAsxlFGB4zyioKHTmPZgr9vv/B0ahVKXj6z8AuYxRx96DuIw3DrwHcZX6/BkYpQ+tXH8bxBVcxGcPNE7o9DNboCYG0anl90HmSW4o3w/mivsDrRBk0WA5D+LOKHkPslFgTeUtIFdMvSQB5CJBmYpsIFfQ5sUdkIMEd94Gcz0b3D+AHKRZDeYyn2K1A+pmPPQuHshlFFUM9zMFumBT3n2QqwQ85H/Pe88gKKW2HuQFwUi92yAu668PYA+K6L2//x7kTZj3wf6Heh9I8EN5pAUsAOQBXRyos5aNAAAAAElFTkSuQmCC"-->
<!DOCTYPE html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion public/programs/default/calculator.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--width="280" height="240" microIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWAgMAAAC52oSoAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFAAAANQA+/3w9olq+SgAAAAN0Uk5TAP//RFDWIQAAAE5JREFUeJxjYAxlAAHGlchU6MqQ0NAAhqxVS7JWTUCjoHKoGkCmBEBYS+CUCCtYMFPKAWxYlgNIu9RKBhDFtoQBJAjkgZQA5UAagCoR+gBdZCEhwdASdAAAAABJRU5ErkJggg=="-->
<!--width="280" height="240" microIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbAgMAAADwuhzGAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFAAAANQA+/3w9olq+SgAAAAF0Uk5TAEDm2GYAAABeSURBVAjXY2CAgVAHCJ2FSotmhTKEhgYwSK1ayZC1agIGDZNH1wc3DxsAKmdkEGBgXMLAwOaQAqalJq4Ei7MtWwI2jxFoNsh8kHkgGsQHiYPkQepA6pH1g8wDiUMBAKPfI5Bi/HjYAAAAAElFTkSuQmCC"-->
<!DOCTYPE html>
<html lang="en">
<!-- MIT licensed Code modified from https://github.com/Diegogagan2587/Calculator -->
Expand Down
2 changes: 1 addition & 1 deletion public/programs/default/doug.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--width="314" height="321" noRS microIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAMAAADzapwJAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAEtQTFRFAAAAo2Vbs3FjkllWyIVv8M6j7secfkVOhVJT7MCSejlN6phqdC5J67mCAAAA7+T/6axwAhIEaSA/53Vi3GNavh1L5R1i5l1h6B55XoilIwAAABl0Uk5TAP///////////////////////////////zBTSd0AAAEQSURBVHicbVHLbgIxDBznwcKyqhD00P//uh6KhKou7JLE7jiFqodGzmtie+yJ4N8hNPGD9mvwxYxwVH8LwtVgfDWEJoOsHjRUj7G0GrfBZFQU6HjvmWCba0Bm7NikAJHW3EDLFmUq4sli4wt8I5VlmbTFe/5TW9m0GGSCaq5IIndkUZ5KCCCMxHxIqH2ShIsccXlxnicl2T8PhOddp1qxx4yhU9/2gkMh4dXAbPiCjCTNF6FTRvPmJqJsN7K92b2pSG1sHBQgJqry4819JVlhGOJAL/c+UbklsKgtFtapW97PHXY89aqrox3Gqyu37PwH9OYoPvwHOo7oQov3QxTyEOiURBGsnn//8jHeON+fl2+NnnKGHpLpYQAAAABJRU5ErkJggg=="-->
<!--width="314" height="321" noRS microIcon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAEtQTFRFAAAA7MCS7sec67mC6axw3GNa6phqs3Fj8M6jo2VbAhIEdC5JfkVOhVJT53VikllW5R1iejlNaSA/6B555l1hyIVvAAAA7+T/vh1LaL0+IQAAAAF0Uk5TAEDm2GYAAAD5SURBVCjPtZLZroMwDERxFmcnhKXt/3/pHYeAUHVfOwrB44ORmDBNP1JworPuZbhRDQIP75Xy/hAU6kC5BMgRECA5cSWfrJVSa+COADnUWkobLINVtKkvBVPyYCmXnAltguSW0UiDtdwOeuhA42KpFU2kX2+i11uq0tLNktFQjOeltUkXW1dnOjR9YTNuXQfLBsxopWJUCgVsHmwyDIdIIoRwYNhcmTGYBvOCPCYN83TPMWuSvCQ30rCPORhJJARJRx6952ZrZwwSxYhNs/gHExjj54Pv427vA7Qd2gWyHdnHwYu1u7DdfqHzzfu2LNs+///bbND0Y/0BI8ILuwwWvPYAAAAASUVORK5CYII="-->
<!DOCTYPE html>
<html lang="en">

Expand Down
70 changes: 61 additions & 9 deletions public/programs/default/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,10 @@
margin-right: 5px;
}

#newFileDialog {
display: none;
}

#newFolderDialog {
display: none;
}

#fileRenameDialog {
#newFileDialog,
#newFolderDialog,
#fileRenameDialog,
#folderRenameDialog {
display: none;
}

Expand Down Expand Up @@ -143,6 +138,18 @@
</div>
</div>

<!-- hidden dialog div -->
<div id="folderRenameDialog" class="dialog windowRidgeBorder">
<div class="menuHeader">Rename Folder</div>
<div class="dialogBody">
<label for="renameFolderInput">Enter new name:</label>
<input type="text" id="renameFolderInput" class="newInput" placeholder="New name">
<br>
<button id="okButton" class="oSButton osElemBase" onclick="handleOkRenameFolder()"> OK </button>
<button class="oSButton osElemBase" onclick="handleCancelRenameFolder()">Cancel</button>
</div>
</div>

<script>
let diskBackup = {};
const MODES = {
Expand Down Expand Up @@ -227,12 +234,21 @@
toggleDeleteMode();
}

function closeExistingDialogs() {
const dialogs = document.querySelectorAll(".dialog");
dialogs.forEach((d) => {
d.style.display = "none";
});
}

function makeNewFile() {
closeExistingDialogs();
let newFileDialog = document.getElementById("newFileDialog");
newFileDialog.style.display = "initial";
}

function makeNewFolder() {
closeExistingDialogs();
let newFolderDialog = document.getElementById("newFolderDialog");
newFolderDialog.style.display = "initial";
}
Expand Down Expand Up @@ -293,6 +309,19 @@
renameFileDialog.style.display = "none";
}

function handleOkRenameFolder() {
let renameFolderInput = document.getElementById("renameFolderInput");
let renameFolderDialog = document.getElementById("folderRenameDialog");
let newFolderName = renameFolderInput.value.trim();
if (newFolderName === "") {
window.top.postMessage("ALERT:[Empty folder name!");
} else {
window.top.postMessage(`RND:[${renamingFolder}]${newFolderName}`, "*");
renameFolderInput.value = "";
}
renameFolderDialog.style.display = "none";
}

function handleCancelNewFile() {
newFileDialog.style.display = "none";
newFileNameInput.value = "";
Expand All @@ -308,6 +337,11 @@
document.getElementById("renameFileNameInput").value = "";
}

function handleCancelRenameFolder() {
document.getElementById("folderRenameDialog").style.display = "none";
document.getElementById("renameFolderInput").value = "";
}

function removeOldContextMenus() {
const oldMenu = document.getElementsByTagName('div'),
forEach = Array.prototype.forEach,
Expand All @@ -321,6 +355,7 @@
}

let renamingFile = "";
let renamingFolder = "";
function handleContextMenu(e, key) {
e.preventDefault();
// Prevents duplicate context menus from being made
Expand Down Expand Up @@ -351,6 +386,7 @@
fileRenameBttn.textContent = "Rename";
fileRenameBttn.classList.add("oSButton", "osElemBase");
fileRenameBttn.onclick = function () {
closeExistingDialogs();
let renameFileDialog = document.getElementById("fileRenameDialog");
renameFileDialog.style.display = "initial";
const input = document.getElementById("renameFileNameInput");
Expand All @@ -361,6 +397,22 @@
};

contextMenu.appendChild(fileRenameBttn);
} else {
let folderRenameBttn = document.createElement("button");
folderRenameBttn.textContent = "Rename";
folderRenameBttn.classList.add("oSButton", "osElemBase");
folderRenameBttn.onclick = function () {
closeExistingDialogs();
let renameFolderDialog = document.getElementById("folderRenameDialog");
renameFolderDialog.style.display = "initial";
const input = document.getElementById("renameFolderInput");
input.value = key;
input.select();

renamingFolder = `${document.getElementById("fileDir").value.substring(3)}${key}`;
};

contextMenu.appendChild(folderRenameBttn);
}

if (imgExtensions.some(ext => key.includes(ext))) {
Expand Down
Loading

0 comments on commit 50ccd5d

Please sign in to comment.