Spring cleaning

Cleaned up the file structure a bit.
Also made the terminal portable.
This commit is contained in:
Innovation Inc 2021-03-26 02:34:24 -05:00
parent 5678a476ed
commit 404026a4c2
41 changed files with 162 additions and 171 deletions

View file

@ -1,20 +0,0 @@
<html>
<head>
<title>ERROR - 404</title>
<meta http-equiv="refresh" content="5; url='index-closed.html'" />
<link rel="icon" href="error.ico" type="image/x-icon" />
<style>
body {
background-color: #084fdd;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<img src="404.png">
</body>
</html>

BIN
404.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

View file

@ -47,7 +47,16 @@
+File Manager<br />
+Notepad<br />
+A right-click context menu<br />
-Removed ambient music on most applications<br />
+Added new folders<br />
&nbsp;+ /etc - Used for holding configuration files<br />
&nbsp;+ /assets - Holds assets for use by DremJS<br />
&nbsp;+ /assets/media/images - Holds specifically images<br />
Spring cleaning<br />
&nbsp;-Removed ambient music on all applications<br />
&nbsp;-Removed 404 error screen (since it wasn't used anyway)<br />
&nbsp;-Removed background.png (same reason as the above)<br />
&nbsp;-Removed the old favicon<br />
~Made the terminal portable<br />
~General system stability improvements to enhance the user's experience.<br /><br />
Version 0.1.6b<br />
+Widget support (see wiki for more information)<br />

Binary file not shown.

View file

@ -18,7 +18,6 @@
<script>
document.addEventListener('contextmenu', event => event.preventDefault());
</script>
<!--<embed src="ambient.mp3" width="0" height="0" loop="true" autostart="true" hidden="true">-->
<h1>
How to Install Applications On DremJS
</h1>

View file

@ -1,9 +1,112 @@
<!-- Terminal Forwarder -->
<html>
<head>
<script>
document.addEventListener('contextmenu', event => event.preventDefault());
</script>
<meta http-equiv="refresh" content="0;url=../../terminal.html" />
</head>
</html>
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>DremJS Terminal</title>
<link rel="stylesheet" type="text/css" title="dark" href="css/dark.css">
<!--<link rel="alternate stylesheet" type="text/css" title="lite" href="css/lite.css">-->
</head>
<body>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<title>DremJS</title>
<link href="https://fonts.googleapis.com/css?family=Inconsolata"
rel="stylesheet" type="text/css" />
</head>
<body onload="getTheme();">
<script>
function getTheme() {
var path = $('script[src*=terminal]').attr('src').replace('terminal.js', '');
jQuery.get(path + 'configs/theme.conf', function(data) {
if(data == "1") {
var cssLink = $('link[href*="/css/dark.css"]');
cssLink.replaceWith('<link href="' + path + 'css/lite.css" type="text/css" rel="stylesheet">');
} else {
var cssLink = $('link[href*="css/lite.css"]');
cssLink.replaceWith('<link href="' + path + 'css/dark.css" type="text/css" rel="stylesheet">');
}
});
}
</script>
<!--<script> old script
function setTheme() {
if (checkCookie('terminalTheme') == false) {
document.cookie = "terminalTheme=0";
} else {
theme = getCookie('terminalTheme');
if (theme == 1) {
/*var stylesheet = document.getElementById("stylesheet");
stylesheet.setAttribute('href', 'css/lite.css');*/
var cssLink = $('link[href*="css/dark.css"]');
cssLink.replaceWith('<link href="css/lite.css" type="text/css" rel="stylesheet">');
}
}
}
function checkCookie(cname) {
var cookie = getCookie(cname);
if (cookie != "") {
return true;
} else {
return false;
}
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
</script>-->
<div id="container">
<output></output>
<div id="input-line" class="input-line">
<div class="prompt"></div><div><input class="cmdline" autofocus /></div>
</div>
</div>
<!--<script src="http://www.codehelper.io/api/ips/?js"></script>-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="./terminal/terminal.js"></script>
<div class="clock-container">
<svg viewBox="0 0 100 100">
<circle cx="50" cy="50" r="45"/>
<g>
<rect class="hour" x="47.5" y="12.5" width="5" height="40" rx="2.5" ry="2.55" />
<rect class="min" x="48.5" y="12.5" width="3" height="40" rx="2" ry="2"/>
<line class="sec" x1="50" y1="50" x2="50" y2="16" />
</g>
</svg>
</div>
</body>
</html>
<script src="./terminal/index.js"></script>
</body>
</html>

View file

@ -1,10 +1,10 @@
<?php
$theme = file_get_contents('../configs/theme.conf');
if($theme == "1") {
file_put_contents('../configs/theme.conf', '0');
} else {
file_put_contents('../configs/theme.conf', '1');
}
?>
<?php
$theme = file_get_contents('../configs/theme.conf');
if($theme == "1") {
file_put_contents('../configs/theme.conf', '0');
} else {
file_put_contents('../configs/theme.conf', '1');
}
?>

View file

Before

Width:  |  Height:  |  Size: 928 KiB

After

Width:  |  Height:  |  Size: 928 KiB

View file

@ -188,7 +188,7 @@ var Terminal = Terminal || function(cmdLineContainer, outputContainer) {
break;
case 'spin':
//show_image('spin.gif', 100, 100, 'Spinny');
output('<img align="left" src="spin.gif" width="100" height="100">');
output('<img align="left" src="' + $('script[src*=terminal]').attr('src').replace('terminal.js', '') +'/spin.gif" width="100" height="100">');
break;
case 'procman':
var arguments = args.join(' ');
@ -410,9 +410,9 @@ var Terminal = Terminal || function(cmdLineContainer, outputContainer) {
init: function() {
jQuery.get('terminal/configs/theme.conf', function(data) {
if(data == "1") {
output('<img align="left" src="termlogo-lite.png" width="100" height="100" style="padding: 0px 10px 20px 0px"><h2 style="letter-spacing: 4px">DremJS Terminal</h2><p>' + new Date() + '</p><p>Enter "help" for more information.</p>');
output('<img align="left" src="/assets/media/images/termlogo-lite.png" width="100" height="100" style="padding: 0px 10px 20px 0px"><h2 style="letter-spacing: 4px">DremJS Terminal</h2><p>' + new Date() + '</p><p>Enter "help" for more information.</p>');
} else {
output('<img align="left" src="termlogo-dark.png" width="100" height="100" style="padding: 0px 10px 20px 0px"><h2 style="letter-spacing: 4px">DremJS Terminal</h2><p>' + new Date() + '</p><p>Enter "help" for more information.</p>');
output('<img align="left" src="/assets/media/images/termlogo-dark.png" width="100" height="100" style="padding: 0px 10px 20px 0px"><h2 style="letter-spacing: 4px">DremJS Terminal</h2><p>' + new Date() + '</p><p>Enter "help" for more information.</p>');
}
});
},

View file

@ -14,7 +14,7 @@
echo $temp[sizeof($temp)-1].' ';
}
echo "<br /><br />Currently enabled widgets:<br />";
$enabledWidgets = explode("\n", file_get_contents(getenv('DOCUMENT_ROOT')."/enabled_widgets"));
$enabledWidgets = explode("\n", file_get_contents(getenv('DOCUMENT_ROOT')."/etc/enabled_widgets"));
for($i = 0; $i<=sizeof($enabledWidgets)-1; $i++)
echo $enabledWidgets[$i].' ';
echo "<br />";
@ -24,12 +24,12 @@
function addWidget() {
$widget = $_REQUEST['widget'];
$widgets = array_filter(glob(getenv('DOCUMENT_ROOT').'/widgets/*'), 'is_dir');
$enabledWidgets = explode("\n", file_get_contents(getenv('DOCUMENT_ROOT')."/enabled_widgets"));
$enabledWidgets = explode("\n", file_get_contents(getenv('DOCUMENT_ROOT')."/etc/enabled_widgets"));
//print($widget.'<br />');
//print_r($widgets);
//print_r($enabledWidgets);
if(in_array(getenv('DOCUMENT_ROOT').'/widgets/'.$widget, $widgets) && !(in_array($widget, $enabledWidgets))) {
$file = fopen(getenv('DOCUMENT_ROOT').'/enabled_widgets', 'a');
$file = fopen(getenv('DOCUMENT_ROOT').'/etc/enabled_widgets', 'a');
fwrite($file, $widget."\n");
fclose($file);
echo "Added ".$widget;

View file

@ -14,7 +14,7 @@
echo $temp[sizeof($temp)-1].' ';
}
echo "<br /><br />Currently enabled widgets:<br />";
$enabledWidgets = explode("\n", file_get_contents(getenv('DOCUMENT_ROOT')."/enabled_widgets"));
$enabledWidgets = explode("\n", file_get_contents(getenv('DOCUMENT_ROOT')."/etc/enabled_widgets"));
for($i = 0; $i<=sizeof($enabledWidgets)-1; $i++)
echo $enabledWidgets[$i].' ';
echo "<br />";

View file

@ -1,4 +1,4 @@
<?php
header("Location: index.php");
file_put_contents(getenv('DOCUMENT_ROOT').'/enabled_widgets', '');
file_put_contents(getenv('DOCUMENT_ROOT').'/etc/enabled_widgets', '');
?>

View file

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 508 KiB

After

Width:  |  Height:  |  Size: 508 KiB

View file

Before

Width:  |  Height:  |  Size: 998 B

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

BIN
error.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

0
enabled_widgets → etc/enabled_widgets Executable file → Normal file
View file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -2,7 +2,7 @@
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script src="jquery.ui.touch-punch.min.js"></script>
<script src="/js/jquery.ui.touch-punch.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>
<!-- classes were from SparrOS Developer Team -->
<title>DremJS</title>
@ -97,8 +97,18 @@
text-align: center;
float: left;
margin-left: 5px;
margin-top: 2px;
padding: 2px;
border-radius: 6px;
//border: 2px solid #FFFFFF;
}
.taskbarAppOpen {
border: 2px solid #FFFFFF;
//border-style: solid;
//border-color: white;
//border-width: 2px;
//background-color: white;
//border: 2px solid #FFFFFF;
}
.startbtn {
background-color: transparent;
color: black;
@ -170,7 +180,7 @@
</div>
<div class="start">
<button class="startbtn"><img src="logo.png" style="width:24px;height24px;"></button>
<button class="startbtn"><img src="/assets/media/images/logo.png" style="width:24px;height24px;"></button>
<div class="start-content">
<a onclick="openApplication('about', 800, 500, 'about.png')"><p><img src="apps/about/about.png" align="top"> About DremJS</p></a>
<a onclick="openApplication('howto', 800, 500, 'howto.png')"><p><img src="apps/howto/howto.png" align="top"> How to Install Applications</p></a>
@ -183,7 +193,7 @@
<a onclick="openApplication('serverstatus', '300', '300', 'serverstatus.png')"><p><img src="apps/serverstatus/serverstatus.png" align="top" style="width:16px;height:16px;"> Server Status</p></a>
<a onclick="openApplication('widgets-settings', -1, -1, 'widgets-settings.png')"><p><img src="apps/widgets-settings/widgets-settings.png" align="top" style="width:16px;height:16px"> Widgets Settings</p></a>
<hr />
<a target="_top" href="shuttingdown.html"><p><img src="shutdown.png" align="top" style="width:16px;height:16px;"> Shutdown DremJS</p></a>
<a target="_top" href="shuttingdown.html"><p><img src="/assets/media/images/shutdown.png" align="top" style="width:16px;height:16px;"> Shutdown DremJS</p></a>
</div>
</div>
<div id="appContainer">
@ -193,14 +203,14 @@
<!-- Add apps here -->
<div class="cwhite" style="text-align:left" id="txt"></div> <a onclick="openApplication('about', 800, 500, 'about.png')"><img src="apps/about/about.png"> |</a>
</div>
<div id="taskbarApps" class="taskbarApps">
<div id="taskbarApps">
</div>
</div>
</div>
</div>
<script src="mobile-detect.js"></script>
<script src="agenda-wm.js"></script>
<script src="/js/agenda/mobile-detect.js"></script>
<script src="/js/agenda/agenda-wm.js"></script>
<script>
var counter;
var pressHoldDuration = 50;

View file

@ -88,7 +88,7 @@ function openApplication(app, width, height, appIcon, filename) {
//var taskbarApp="<div id='task" + i + "' onclick=\"moveToFront('" + i + "')\" class='taskbarApps'><img src='apps/" + app + "/" + appIcon + "' style='width:32px;height:32px' align='middle' /></div>";
if (!(detector.mobile())) {
var application="<div onclick=\"moveToFront('" + i + "')\" name='" + app + "' id='" + i + "' class='framewrap' style='width:" + width + "px; height:" + height + "px'><input type='button' onclick=\"closeApplication('" + i + "')\" value='X' /><input type='button' onclick=\"maximizeApplication('" + i + "')\" value='\u25A1' /><input type='button' onclick=\"minimizeApplication('" + i + "')\" value='_' /><iframe name='" + i + "' id='app" + i + "' class='appFrame' src='apps/" + app + "/'></iframe></div>";
var taskbarApp="<div onmousedown='SetCurrentTaskbarApp(" + i + ")' onmouseup='SetCurrentTaskbarApp(\"\")' id='task" + i + "' onclick=\"minimizeApplication('" + i + "')\" class='taskbarApps'><img src='apps/" + app + "/" + appIcon + "' style='width:32px;height:32px' align='middle' /></div>";
var taskbarApp="<div onmousedown='SetCurrentTaskbarApp(" + i + ")' onmouseup='SetCurrentTaskbarApp(\"\")' id='task" + i + "' onclick=\"minimizeApplication('" + i + "')\" class='taskbarApps taskbarAppOpen'><img src='apps/" + app + "/" + appIcon + "' style='width:32px;height:32px' align='middle' /></div>";
} else {
var application="<div onclick=\"moveToFront('" + i + "')\" name='" + app + "' id='" + i + "' class='framewrapMobile' style='width:" + width + "px; height:" + height + "px'><input type='button' onclick=\"showContextMenu('app" + i + "')\" value='&#9660;' /><iframe name='" + i + "' id='app" + i + "' class='appFrameMobile' src='apps/" + app + "/'></iframe></div>";
var taskbarApp="<div tabindex='0' onmousedown='SetCurrentTaskbarApp(" + i + ")' id='task" + i + "' onclick=\"moveToFront('" + i + "'); SetCurrentTaskbarApp(" + i + ")\" class='taskbarApps'><img src='apps/" + app + "/" + appIcon + "' style='width:32px;height:32px' align='middle' /></div>";
@ -126,7 +126,7 @@ function openApplication(app, width, height, appIcon, filename) {
} // Start a new widget
function startWidgets() {
jQuery.get('/enabled_widgets', function(data) {
jQuery.get('/etc/enabled_widgets', function(data) {
var widgets = data.split("\n");
for(i = 0; i < widgets.length-1; i++) {
if(true) {
@ -271,4 +271,4 @@ $(window).resize(function() {
try {
parent.showContextMenu();
} catch(e) { }
}*/
}*/

View file

@ -24,9 +24,9 @@
</style>
</head>
<body>
<embed src="shutdown.mp3" width="0" height="0" loop="false" autostart="true" hidden="true" />
<embed src="/assets/media/music/shutdown.mp3" width="0" height="0" loop="false" autostart="true" hidden="true" />
<div class="my-block">
<img src="goodbye.gif">
<img src="/assets/media/images/goodbye.gif">
</div>
</body>
</html>

View file

@ -1,110 +0,0 @@
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>DremJS Terminal</title>
<link rel="stylesheet" type="text/css" title="dark" href="css/dark.css">
<!--<link rel="alternate stylesheet" type="text/css" title="lite" href="css/lite.css">-->
</head>
<body>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<title>DremJS</title>
<link href="https://fonts.googleapis.com/css?family=Inconsolata"
rel="stylesheet" type="text/css" />
</head>
<body onload="getTheme();">
<script>
function getTheme() {
jQuery.get('terminal/configs/theme.conf', function(data) {
if(data == "1") {
var cssLink = $('link[href*="css/dark.css"]');
cssLink.replaceWith('<link href="css/lite.css" type="text/css" rel="stylesheet">');
} else {
var cssLink = $('link[href*="css/lite.css"]');
cssLink.replaceWith('<link href="css/dark.css" type="text/css" rel="stylesheet">');
}
});
}
</script>
<!--<script> old script
function setTheme() {
if (checkCookie('terminalTheme') == false) {
document.cookie = "terminalTheme=0";
} else {
theme = getCookie('terminalTheme');
if (theme == 1) {
/*var stylesheet = document.getElementById("stylesheet");
stylesheet.setAttribute('href', 'css/lite.css');*/
var cssLink = $('link[href*="css/dark.css"]');
cssLink.replaceWith('<link href="css/lite.css" type="text/css" rel="stylesheet">');
}
}
}
function checkCookie(cname) {
var cookie = getCookie(cname);
if (cookie != "") {
return true;
} else {
return false;
}
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
</script>-->
<div id="container">
<output></output>
<div id="input-line" class="input-line">
<div class="prompt"></div><div><input class="cmdline" autofocus /></div>
</div>
</div>
<!--<script src="http://www.codehelper.io/api/ips/?js"></script>-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="terminal/terminal.js"></script>
<div class="clock-container">
<svg viewBox="0 0 100 100">
<circle cx="50" cy="50" r="45"/>
<g>
<rect class="hour" x="47.5" y="12.5" width="5" height="40" rx="2.5" ry="2.55" />
<rect class="min" x="48.5" y="12.5" width="3" height="40" rx="2" ry="2"/>
<line class="sec" x1="50" y1="50" x2="50" y2="16" />
</g>
</svg>
</div>
</body>
</html>
<script src="terminal/index.js"></script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB