Initial commit. Laid future groundwork for boot process and started work
on Agenda2.
This commit is contained in:
parent
ce68c54635
commit
65663ca23b
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
$installation = "main";
|
||||||
|
$init = "/hypervisor/installations/".$installation."/bootloader/os/";
|
||||||
|
echo("DremJS\n");
|
||||||
|
echo("Stage 2 - Bootloader (STUB)\n");
|
||||||
|
header('Location: '.$init);
|
||||||
|
?>
|
|
@ -0,0 +1 @@
|
||||||
|
console.log("DremJS Core Start")
|
27
root/hypervisor/installations/main/bootloader/os/index.php
Normal file
27
root/hypervisor/installations/main/bootloader/os/index.php
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
$installation = "main";
|
||||||
|
$location = "/hypervisor/installations/".$installation."/";
|
||||||
|
$wm = $location."/fs/lib/agenda2";
|
||||||
|
//echo("DremJS\n");
|
||||||
|
//echo("Stage 3 - init\n");
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="<?= $wm ?>/css/desktop.css">
|
||||||
|
<link rel="stylesheet" href="<?= $wm ?>/css/mobile.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="dremjs">
|
||||||
|
<div id="taskbar">
|
||||||
|
</div>
|
||||||
|
<div id="applications">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="core/dremjs-core.js"></script>
|
||||||
|
<script src="<?= $wm ?>/agenda2.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
149
root/hypervisor/installations/main/fs/lib/agenda2/agenda2.js
Normal file
149
root/hypervisor/installations/main/fs/lib/agenda2/agenda2.js
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
/*
|
||||||
|
* _____/\\\\\\\\\________/\\\\\\\\\\\\__/\\\\\\\\\\\\\\\__/\\\\\_____/\\\__/\\\\\\\\\\\\________/\\\\\\\\\_______/\\\\\\\\\_____
|
||||||
|
* ___/\\\\\\\\\\\\\____/\\\//////////__\/\\\///////////__\/\\\\\\___\/\\\_\/\\\////////\\\____/\\\\\\\\\\\\\___/\\\///////\\\___
|
||||||
|
* __/\\\/////////\\\__/\\\_____________\/\\\_____________\/\\\/\\\__\/\\\_\/\\\______\//\\\__/\\\/////////\\\_\///______\//\\\__
|
||||||
|
* _\/\\\_______\/\\\_\/\\\____/\\\\\\\_\/\\\\\\\\\\\_____\/\\\//\\\_\/\\\_\/\\\_______\/\\\_\/\\\_______\/\\\___________/\\\/___
|
||||||
|
* _\/\\\\\\\\\\\\\\\_\/\\\___\/////\\\_\/\\\///////______\/\\\\//\\\\/\\\_\/\\\_______\/\\\_\/\\\\\\\\\\\\\\\________/\\\//_____
|
||||||
|
* _\/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_____________\/\\\_\//\\\/\\\_\/\\\_______\/\\\_\/\\\/////////\\\_____/\\\//________
|
||||||
|
* _\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\_____________\/\\\__\//\\\\\\_\/\\\_______/\\\__\/\\\_______\/\\\___/\\\/___________
|
||||||
|
* _\/\\\_______\/\\\_\//\\\\\\\\\\\\/__\/\\\\\\\\\\\\\\\_\/\\\___\//\\\\\_\/\\\\\\\\\\\\/___\/\\\_______\/\\\__/\\\\\\\\\\\\\\\_
|
||||||
|
* _\///________\///___\////////////____\///////////////__\///_____\/////__\////////////_____\///________\///__\///////////////__
|
||||||
|
*
|
||||||
|
* "Maintaining the agenda is our top priority."
|
||||||
|
* (C) Innovation Science LLC 2024
|
||||||
|
*/
|
||||||
|
|
||||||
|
var currentWID = 0
|
||||||
|
|
||||||
|
var mobileStatus = import("./mobile-detect.js").then((md) => {
|
||||||
|
var detector = new MobileDetect(window.navigator.userAgent);
|
||||||
|
return detector.mobile();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function initAgendaWM() {
|
||||||
|
mobileStatus = await mobileStatus;
|
||||||
|
if(!mobileStatus) {
|
||||||
|
initAgendaDesktop();
|
||||||
|
} else {
|
||||||
|
initAgendaMobile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function initAgendaDesktop() {
|
||||||
|
console.log("AGENDA2 Desktop");
|
||||||
|
|
||||||
|
createWindow("Test App 1", "/temp.html", true);
|
||||||
|
createWindow("Test App 2", "/temp.html", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function initAgendaMobile() {
|
||||||
|
console.log("AGENDA2 Mobile");
|
||||||
|
}
|
||||||
|
|
||||||
|
function createWindow(name, href, draggable) {
|
||||||
|
var wid = getNewWID();
|
||||||
|
var window = `\
|
||||||
|
<div onclick="moveToFront(${wid});"
|
||||||
|
name="${name}"
|
||||||
|
class="dAppWindow"
|
||||||
|
id="window-${wid}">
|
||||||
|
<div class="dAppTask" id="bar-${wid}">
|
||||||
|
<div class="dAppTaskChild">
|
||||||
|
<input type="button" onclick="closeApplication(${wid})" value="X" />
|
||||||
|
<input type="button" onclick="maximizeApplication(${wid})" value="\u25A1" />
|
||||||
|
<input type="button" onclick="minimizeApplication(${wid})" value="_" />
|
||||||
|
</div>
|
||||||
|
<div class="dAppTaskChild">
|
||||||
|
<p>${name}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="dAppFrame">
|
||||||
|
<iframe name="app-${wid}" id="app-${wid}" src="${href}"></iframe>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
var parent=document.getElementById('applications');
|
||||||
|
parent.insertAdjacentHTML('beforeend', window);
|
||||||
|
|
||||||
|
if(draggable && !mobileStatus) {
|
||||||
|
makeDraggable(wid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*function dragWindow(wid) {
|
||||||
|
var windowId = `window-${wid}`;
|
||||||
|
var barId = `bar-${wid}`;
|
||||||
|
var pos1 = 0;
|
||||||
|
var pos2 = 0;
|
||||||
|
var pos3 = 0;
|
||||||
|
var pos4 = 0;
|
||||||
|
|
||||||
|
var element = document.getElementById(windowId);
|
||||||
|
var bar = document.getElementById(barId);
|
||||||
|
|
||||||
|
bar.onmousedown = dragMouseDown;
|
||||||
|
|
||||||
|
function dragMouseDown(e) {
|
||||||
|
e = e || window.event;
|
||||||
|
e.preventDefault();
|
||||||
|
pos3 = e.clientX;
|
||||||
|
pos4 = e.clientY;
|
||||||
|
document.onmouseup = closeDragElement;
|
||||||
|
document.onmousemove = elementDrag;
|
||||||
|
}
|
||||||
|
|
||||||
|
function elementDrag(e) {
|
||||||
|
e = e || window.event;
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
pos1 = pos3 - e.clientX;
|
||||||
|
pos2 = pos4 - e.clientY;
|
||||||
|
pos3 = e.clientX;
|
||||||
|
pos4 = e.clientY;
|
||||||
|
|
||||||
|
element.style.top = (element.offsetTop - pos2) + "px";
|
||||||
|
element.style.left = (element.offsetLeft - pos1) + "px";
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeDragElement() {
|
||||||
|
document.onmouseup = null;
|
||||||
|
document.onmousemove = null;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
function makeDraggable(wid) {
|
||||||
|
win = document.getElementById(`window-${wid}`);
|
||||||
|
|
||||||
|
win.addEventListener('mousedown', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var offsetX = e.clientX - parseInt(window.getComputedStyle(this).left);
|
||||||
|
var offsetY = e.clientY - parseInt(window.getComputedStyle(this).top);
|
||||||
|
|
||||||
|
function mouseMoveHandler(e) {
|
||||||
|
var top = (e.clientY - offsetY);
|
||||||
|
if(top < 51) {
|
||||||
|
top = 51;
|
||||||
|
}
|
||||||
|
win.style.top = top + 'px';
|
||||||
|
win.style.left = (e.clientX - offsetX) + 'px';
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
window.removeEventListener('mousemove', mouseMoveHandler);
|
||||||
|
window.removeEventListener('mouseup', reset);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('mousemove', mouseMoveHandler);
|
||||||
|
window.addEventListener('mouseup', reset);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNewWID() {
|
||||||
|
wid = currentWID;
|
||||||
|
currentWID+=1;
|
||||||
|
return wid;
|
||||||
|
}
|
||||||
|
|
||||||
|
initAgendaWM();
|
|
@ -0,0 +1,68 @@
|
||||||
|
/* Taskbar */
|
||||||
|
#taskbar {
|
||||||
|
height: 48px;
|
||||||
|
width: 96%;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-top: 0px;
|
||||||
|
position: absolute;
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Applications and Windows */
|
||||||
|
#applications {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dAppWindow {
|
||||||
|
width:500px;
|
||||||
|
height:300px;
|
||||||
|
margin:5px;
|
||||||
|
padding: 5px;
|
||||||
|
position: absolute;
|
||||||
|
top: 60px;
|
||||||
|
left: 10px;
|
||||||
|
background-color:#87CEEB;
|
||||||
|
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
||||||
|
resize: both;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dAppWindow br {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dAppFrame {
|
||||||
|
/*float: none;
|
||||||
|
height: 93%;*/
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dAppFrame iframe {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100% - 30px);
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dAppTask {
|
||||||
|
margin-right: 10px;
|
||||||
|
float: left;
|
||||||
|
position: relative;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dAppTaskChild {
|
||||||
|
float: left;
|
||||||
|
margin-right: 5px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dAppTaskChild p {
|
||||||
|
line-height: 0;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
margin-top: 12px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
1004
root/hypervisor/installations/main/fs/lib/agenda2/mobile-detect.js
Normal file
1004
root/hypervisor/installations/main/fs/lib/agenda2/mobile-detect.js
Normal file
File diff suppressed because one or more lines are too long
7
root/index.php
Normal file
7
root/index.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
$installation = "main";
|
||||||
|
$bootloader = "/hypervisor/installations/".$installation."/bootloader/boot/";
|
||||||
|
echo("DremJS\n");
|
||||||
|
echo("Stage 1 - Entry Point (STUB)\n");
|
||||||
|
header('Location: '.$bootloader);
|
||||||
|
?>
|
1
root/temp.html
Normal file
1
root/temp.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<h1>Application</h1>
|
Loading…
Reference in a new issue