diff --git a/agenda-wm.js b/agenda-wm.js index e2b10b0..0141f71 100644 --- a/agenda-wm.js +++ b/agenda-wm.js @@ -13,8 +13,12 @@ */ function initAgendaWM() { + console.log("Initializing Agenda WM"); startTime(); + console.log("Starting widgets"); + startWidgets(); makeDraggable(); + console.log("Agenda WM Initialized"); } // Initialize Agenda function makeDraggable() { @@ -28,12 +32,17 @@ function moveToFront(app) { $('#' + app).css('z-index', 9999); } // Move a clicked application to the front -function openApplication(app, width, height, appIcon) { +function openApplication(app, width, height, appIcon, filename) { // Set width and height as default if one is <=-1 if (width <= -1 || height <= -1 || width == undefined || height == undefined) { width="500"; height="300"; } + if (filename == undefined) { + file = ""; + } else { + file = filename; + } var i = 0; // Get the first available application ID. while ($('#' + i).length) @@ -54,8 +63,8 @@ function openApplication(app, width, height, appIcon) { Quite frustrating to work with, but it works. I'll make it fancier later, but right now it is good enough. */ - var application="
"; - var taskbarApp=" "; + var application=""; + var taskbarApp=" "; var parent=document.getElementById('appContainer'); parent.insertAdjacentHTML('beforeend', application); var parent=document.getElementById('taskbarApps'); @@ -65,12 +74,46 @@ function openApplication(app, width, height, appIcon) { moveToFront(i); makeDraggable(); } // Opens an application. + function openWidget(widget, filename) { + if (filename == undefined) { + file = ""; + } else { + file = filename; + } + var i = 0; + // Get the first available application ID. + while ($('#' + i).length) + i++; + var newWidget = ""; + var parent=document.getElementById('appContainer'); + parent.insertAdjacentHTML('beforeend', newWidget); + makeDraggable(); + } // Start a new widget - function closeApplication(id) { - var application = document.getElementById(id); - var taskbarApp = document.getElementById('task' + id); - application.parentNode.removeChild(application); - taskbarApp.parentNode.removeChild(taskbarApp); + function startWidgets() { + jQuery.get('/enabled_widgets', function(data) { + var widgets = data.split("\n"); + for(i = 0; i < widgets.length-1; i++) { + if(true) { + console.log('Opening ' + widgets[i]); + openWidget(widgets[i]); + } else { + console.log("ERROR: Can't open widget - a network error occurred. This probably means this widget does not exist. Ignoring."); + } + } + }); + } // Start all enabled widgets + + function closeApplication(id) { + if(idExists(id)) { + var application = document.getElementById(id); + var taskbarApp = document.getElementById('task' + id); + application.parentNode.removeChild(application); + if(taskbarApp != null) + taskbarApp.parentNode.removeChild(taskbarApp); + } else { + console.log("Application with ID " + id + " does not exist. Ignoring."); + } } // Closes an application. function maximizeApplication(id) { @@ -108,4 +151,26 @@ function startTime() { function checkTime(i) { if (i < 10) {i = "0" + i}; // add zero in front of numbers < 10 return i; -} \ No newline at end of file +} + +/*function returnStatus(req, status) { + //console.log(req); + if(status == 200) { + console.log("The url is available"); + // send an event + } else { + console.log("The url returned status code " + status); + // send a different event + } +}*/ + +function fetchStatus(address) { + var client = new XMLHttpRequest(); + client.onreadystatechange = function() { + // in case of network errors this might not give reliable results + if(this.readyState == 4) + return this.status; + } + client.open("HEAD", address); + client.send(); +} diff --git a/apps/About/about.png b/apps/about/about.png similarity index 100% rename from apps/About/about.png rename to apps/about/about.png diff --git a/apps/About/index.html b/apps/about/index.html similarity index 90% rename from apps/About/index.html rename to apps/about/index.html index 9dd5754..e787a89 100644 --- a/apps/About/index.html +++ b/apps/about/index.html @@ -26,11 +26,22 @@Changelog:
+ Version 0.1.6b
+ +Widget support (see wiki for more information)
+ +Made clicking apps in the taskbar move applications to the front instead of minimizing.
+ +Cowsay (PHP and JS interfacing experiment)
+ +Changed the start menu to the Drem Logo
+ +Added a task manager (combined with Server Status application)
+ +Added a CPU/memory monitor (see wiki for more information)
+ ~Windows now have a shaded background
+ ~Fixed a bug in terminal where white-space is ignored by output().
+ ~Made terminal themes consistent (no more cookies)
+ ~General system stability improvements to enhance the user's experience.
Version 0.1.5b
+Readded the start menu
+A lite theme for the terminal, if that's your thing. You can toggle the theme with "settheme".
diff --git a/apps/About/logo.png b/apps/about/logo.png
similarity index 100%
rename from apps/About/logo.png
rename to apps/about/logo.png
diff --git a/apps/about/name b/apps/about/name
new file mode 100644
index 0000000..0c23b01
--- /dev/null
+++ b/apps/about/name
@@ -0,0 +1 @@
+About
diff --git a/apps/debug/name b/apps/debug/name
new file mode 100644
index 0000000..329d484
--- /dev/null
+++ b/apps/debug/name
@@ -0,0 +1 @@
+Debug
diff --git a/apps/HowTo/ambient.mp3 b/apps/howto/ambient.mp3
similarity index 100%
rename from apps/HowTo/ambient.mp3
rename to apps/howto/ambient.mp3
diff --git a/apps/HowTo/apps.png b/apps/howto/apps.png
similarity index 100%
rename from apps/HowTo/apps.png
rename to apps/howto/apps.png
diff --git a/apps/HowTo/howto.png b/apps/howto/howto.png
similarity index 100%
rename from apps/HowTo/howto.png
rename to apps/howto/howto.png
diff --git a/apps/HowTo/index.html b/apps/howto/index.html
similarity index 100%
rename from apps/HowTo/index.html
rename to apps/howto/index.html
diff --git a/apps/howto/name b/apps/howto/name
new file mode 100644
index 0000000..2ffb473
--- /dev/null
+++ b/apps/howto/name
@@ -0,0 +1 @@
+How to Install Applications
diff --git a/apps/HowTo/script.png b/apps/howto/script.png
similarity index 100%
rename from apps/HowTo/script.png
rename to apps/howto/script.png
diff --git a/apps/Market/index.html b/apps/market/index.html
similarity index 100%
rename from apps/Market/index.html
rename to apps/market/index.html
diff --git a/apps/Market/market.png b/apps/market/market.png
similarity index 100%
rename from apps/Market/market.png
rename to apps/market/market.png
diff --git a/apps/market/name b/apps/market/name
new file mode 100644
index 0000000..8c5e7cb
--- /dev/null
+++ b/apps/market/name
@@ -0,0 +1 @@
+DremJS Market
diff --git a/apps/serverstatus/TaskManager.html b/apps/serverstatus/TaskManager.html
new file mode 100644
index 0000000..845fa3c
--- /dev/null
+++ b/apps/serverstatus/TaskManager.html
@@ -0,0 +1,60 @@
+
+
ID | +Process Name | ++ |
---|