Get rid of a redundant directory level.

This commit is contained in:
2016-08-20 22:31:29 +02:00
parent abb6ae9ba0
commit b2256b2454
556 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link href='pages.css' type='text/css' rel='stylesheet' />
<script type='text/javascript' src='pages.js'></script>
</head>
<body>
<p class='header'>About Algo</p>
<p>Algo started development in March 2009 and took about a week to complete. Back then the name of Algo was "Algohol". Algohol was a project that aimed towards making math, physics and chemistry help freely available online in a new and different way. Consisting of a group with four students, we agreed that a desktop environment type website would be the way for us to present our info. The technical part of Algohol went fine, but we never did get to writing the actual content. <a href='http://algohol.org/'>Algohol</a> is still online, but it doesn't serve much purpose.</p>
<p>The source code of Algo is <a href='http://www.gnu.org/licenses/gpl.html' target='_parent'>GPLv3'ed</a>.</p>
<br />
<h3>The action icons</h3>
<img src='../themes/img/action_icons.png' />
<p>The action icons, as seen above, are made by two of my classmates. I never got to asking them whether they wanted to be credited. Using them should be fine, though. For now I'll just release it under the CC-SA license.</p>
</body>
</html>

View File

@@ -0,0 +1,382 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<link href='pages.css' type='text/css' rel='stylesheet' />
<style type='text/css'>
* {
color: #ddd;
font: 12px 'dejavu sans mono';
}
body {
margin: 0;
padding: 0;
background-color: #000;
overflow: hidden;
}
div {
float: left;
}
div.result {
float: none;
width: 100%;
}
textarea {
float: left;
border: none;
background: none;
padding: 0;
overflow: hidden;
}
</style>
<script type='text/javascript' src='pages.js'></script>
<script type='text/javascript'>
/*
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.
*/
window.onload = function() {
var is_firefox
if (navigator.userAgent.indexOf('Firefox') != -1) is_firefox = true
else is_firefox = false
input_margin_top = 0
input_margin_right = 0
input_margin_bottom = 0
if (is_firefox) input_margin_left = -1
else input_margin_left = 0
ans = 0
curr_input_start = document.createElement('div')
curr_input_start.innerHTML = '>'
document.body.appendChild(curr_input_start)
input_start_width = curr_input_start.scrollWidth
input_start_height = curr_input_start.scrollHeight
curr_input = document.createElement('textarea')
curr_input.onkeydown = function() {
this.style.height = this.scrollHeight + 'px'
}
curr_input.onkeyup = function() {
this.style.height = this.scrollHeight + 'px'
}
curr_input.style.marginTop = input_margin_top + 'px'
curr_input.style.marginRight = input_margin_right + 'px'
curr_input.style.marginBottom = input_margin_bottom + 'px'
curr_input.style.marginLeft = input_margin_left + 'px'
curr_input.style.width = getw() - input_start_width - input_margin_left - input_margin_right + 'px'
curr_input.style.height = input_start_height + 'px'
document.body.appendChild(curr_input)
curr_input.focus()
continue_ok = true
window.onresize = function() {
curr_input.style.width = getw() - input_start_width - input_margin_left - input_margin_right + 'px'
setTimeout("curr_input.style.height = curr_input.scrollHeight + 'px'", 100)
}
document.onkeydown = function(event) {
if (!continue_ok) return
var code = getcode(event)
if (code == 13) {
var input_value, caltxt, len, oresult, result, result_elem, nl_elem, replace_elem
input_value = curr_input.value
caltxt = process_all(input_value)
if (caltxt != '') {
try {
oresult = eval(caltxt)
//parent.document.title = caltxt
if (typeof(oresult) == 'number') result = (oresult + '') //.replace(/\./g, ',')
else result = oresult
if (oresult == 'NaN') result = 'Error: Not a number'
else if (oresult == 'Infinity') result = 'Error: Infinity'
else ans = oresult
}
catch(e) {
result = 'Error'
}
if (result.substr(0, 5) == 'Error') result += '<br />Type "help" for help.'
}
else {
result = ''
}
nl_elem = document.createElement('br')
document.body.appendChild(nl_elem)
if (result != '' && result != 'undefined') {
result_elem = document.createElement('div')
result_elem.className = 'result'
result_elem.innerHTML = '>>>' + result
document.body.appendChild(result_elem)
}
replace_elem = document.createElement('div')
replace_elem.innerHTML = '>' + input_value
document.body.insertBefore(replace_elem, curr_input)
document.body.removeChild(curr_input_start)
document.body.removeChild(curr_input)
curr_input_start = document.createElement('div')
curr_input_start.innerHTML = '>'
document.body.appendChild(curr_input_start)
curr_input = document.createElement('textarea')
curr_input.onkeydown = function() {
this.style.height = this.scrollHeight + 'px'
}
curr_input.onkeyup = function() {
this.style.height = this.scrollHeight + 'px'
}
curr_input.style.marginTop = input_margin_top + 'px'
curr_input.style.marginRight = input_margin_right + 'px'
curr_input.style.marginBottom = input_margin_bottom + 'px'
curr_input.style.marginLeft = input_margin_left + 'px'
curr_input.style.width = getw() - input_start_width - input_margin_left - input_margin_right + 'px'
curr_input.style.height = input_start_height + 'px'
window.scrollBy(0, 100000)
}
continue_ok = false
}
document.onkeyup = function(event) {
var code = getcode(event)
if (code == 13) {
document.body.appendChild(curr_input)
curr_input.focus()
curr_input.value = ''
}
continue_ok = true
}
document.ondblclick = function() {
curr_input.focus()
}
}
function getcode(event) {
var e, code
if (window.event) e = window.event
else e = event
if (e.which) code = e.which
else if (e.charCode) code = e.charCode
else if (e.keyCode) code = e.keyCode
else code = 0
return code
}
function getw() {
var w
if (self.innerHeight)
w = self.innerWidth
else if (document.documentElement && document.documentElement.clientHeight)
w = document.documentElement.clientWidth
else if (document.body)
w = document.body.clientWidth
return w
}
function process_all(txt) {
var newtxt, txtspl, txtsta, replaces, len, i
newtxt = txt
if (newtxt.indexOf('=') != -1) {
txtspl = newtxt.split('=')
newtxt = txtspl[1]
txtsta = txtspl[0] + '='
}
else
txtsta = ''
replaces = [
[/\ /g, ''],
//[/\,/g, '.'], // Uncomment to allow "," as "." (used in some countries)
[/\'/g, ','],
[/\_/g, ','],
[/\*\*/g, '^'],
[/\&pi/gi, 'Math.PI'],
[/\&pi;/gi, 'Math.PI'],
[/\&e/gi, 'Math.E'],
[/log\(/gi, 'log('],
[/ln\(/gi, 'ln('],
[/sqrt\(/gi, 'sqrt('],
[/r\(/gi, 'sqrt('],
[/sin\(/gi, 'sin('],
[/sin\^\(-1\)\(/gi, 'asin('],
[/sin\^-1\(/gi, 'asin('],
[/cos\(/gi, 'cos('],
[/cos\^\(-1\)\(/gi, 'acos('],
[/cos\^-1\(/gi, 'acos('],
[/tan\(/gi, 'tan('],
[/tan\^\(-1\)\(/gi, 'atan('],
[/tan\^-1\(/gi, 'atan(']
]
len = replaces.length
for (i = 0; i < len; i++) {
newtxt = newtxt.replace(replaces[i][0], replaces[i][1])
}
if (newtxt == 'help')
return "'This is a simple calculator. It is able to put a number in the power of a number and supports functions like sin(), asin(), cos(), acos(), tan(), atan(), log() og ln(). To take the power of a number, write \"x^y\" or \"x**y\". To take the squareroot of a number, write \"r(x)\". To take another root of a number, write \"r(x,y)\". Type \"&pi\" for pi and \"&e\" for e. Trigonometric functions use degrees, not radians. The log() function uses 10 as its base, while the ln() function uses e. To use a previous result, type \"ans\".'"
else if (newtxt != '')
return txtsta + process_part(newtxt)
else
return txtsta + newtxt
}
function process_part(txt) {
var number_parts, operator_parts, bracket_count, len, i, curr, indexOfBracket, special_characters, newtxt, last, add_operator
number_parts = []
number_parts[0] = ''
operator_parts = []
bracket_count = 0
len = txt.length
for (i = 0; i < len; i++) {
curr = txt.substr(i, 1)
if (curr == '(') bracket_count++
else if (curr == ')') bracket_count--
if ((curr == '+' || curr == '-' || curr == '*' || curr == '/' || curr == '^') && bracket_count == 0) {
number_parts[number_parts.length] = ''
operator_parts[operator_parts.length] = txt.substr(i, 1)
}
else {
number_parts[number_parts.length - 1] += txt.substr(i, 1)
}
}
len = number_parts.length
if (number_parts[0] == '') number_parts[0] = '0'
if (number_parts[len - 1] == '') number_parts[len - 1] = '0'
for (i = 0; i < bracket_count; i++) {
number_parts[len - 1] += ')'
}
for (i = 0; i < len; i++) {
if (number_parts[i] != '') {
indexOfBracket = number_parts[i].indexOf('(')
if (indexOfBracket != -1) number_parts[i] = number_parts[i].substr(0, indexOfBracket) + '(' + process_part(number_parts[i].substr(indexOfBracket + 1, number_parts[i].length - indexOfBracket - 2)) + ')'
}
}
special_characters = '^'
newtxt = ''
for (i = 0; i < len; i++) {
last = (i == len - 1) ? true : false
add_operator = true
if (!last && special_characters.indexOf(operator_parts[i]) != -1) {
add_operator = false
if (operator_parts[i] == '^')
newtxt += 'pow(' + number_parts[i] + ',' + number_parts[i + 1] + ')'
}
else if (special_characters.indexOf(operator_parts[i - 1]) == -1) {
newtxt += number_parts[i]
}
if (!last && add_operator) newtxt += operator_parts[i]
}
return newtxt
}
function sin(num) {
return Math.sin(num * Math.PI / 180)
}
function cos(num) {
return Math.cos(num * Math.PI / 180)
}
function tan(num) {
return Math.tan(num * Math.PI / 180)
}
function asin(num) {
return (Math.asin(num) / Math.PI) * 180
}
function acos(num) {
return (Math.acos(num) / Math.PI) * 180
}
function atan(num) {
return (Math.atan(num) / Math.PI) * 180
}
function sqrt(num1, num2) {
if (num2 == undefined)
return Math.sqrt(num1)
else return pow(num1, 1 / num2)
}
function pow(num1, num2) {
return Math.pow(num1, num2)
}
function log(num) {
return Math.log(num) / Math.log(10)
}
function ln(num) {
return Math.log(num)
}
function max(num1, num2) {
return Math.max(num1, num2)
}
function min(num1, num2) {
return Math.min(num1, num2)
}
function round(num) {
return Math.round(num)
}
function floor(num) {
return Math.floor(num)
}
function ceil(num) {
return Math.ceil(num)
}
function rand() {
return Math.random()
}
function randint(num1, num2) {
return Math.floor(Math.random() * (num2 - num1 + 1)) + num1
}
</script>
</head>
<body></body>
</html>

View File

@@ -0,0 +1 @@
This folder holds the pages used by Algohol. They are fetched by the links.php file. In this folder is also the pages.css file and the pages.js file. These two files serve as a default for the pages in general.

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Error</title>
<link href='pages.css' type='text/css' rel='stylesheet' />
<script type='text/javascript' src='pages.js'></script>
<script type='text/javascript'>
window.onload = function() {
setTimeout("close()", 3000)
}
</script>
</head>
<body>
<p class='header'>Error!</p>
<p>There's no content!</p>
<p style='margin-top: 10px'>Closing...</p>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link href='pages.css' type='text/css' rel='stylesheet' />
<script type='text/javascript' src='pages.js'></script>
</head>
<body>
<p>Using Algo should be pretty straight forward. If you don't get it, send a e-mail to ns@metanohi.name.</p>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

View File

@@ -0,0 +1,4 @@
This folder holds the icons used by Algohol. The default.png icon is used as a default icon, while the other icons are used for specific pages.
Example:
The calculator is opened in Algohol. The links.php file in the previous folder links to calc.htm. What also happens here is that links.php looks for calc.png in the icons folder. If such a file is not found, it defaults to defult.png.

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

View File

@@ -0,0 +1,9 @@
<?php
/* This file keeps an index of the titles of current pages
and gives them to the JavaScript environment when requested */
$u['Welcome'] = 'start.htm';
$u['Help'] = 'help.htm';
$u['Calculator'] = 'calc.htm';
$u['Notes'] = 'notes.php';
$u['About'] = 'about.htm';
?>

View File

@@ -0,0 +1,25 @@
<?php
include('indexes.php'); // Get the indexes
$title = $_GET['title'];
$type = $_GET['type'];
$page = $u[$title];
if ($type == 'png') {
header('Content-type: image/png');
$spl = explode('.', $page);
$page = 'icons/' . substr($page, 0, strlen($page) - strlen($spl[sizeof($spl) - 1]) - 1) . '.png';
if (!is_file($page)) $page = 'icons/default.png';
$filename = $page;
$handle = fopen($filename, "rb"); // Open the icon
$contents = fread($handle, filesize($filename));
fclose($handle);
echo $contents; // Print the icon
}
else {
header('Content-type: text/html; charset=utf-8');
if (!is_file($page)) $page = 'error.htm';
include($page); // Print the page
}
?>

View File

@@ -0,0 +1,47 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<link href='pages.css' type='text/css' rel='stylesheet' />
<style type='text/css'>
body {
margin: 0;
padding: 0;
}
textarea {
font: 14px verdana;
border: none;
width: 100%;
height: 100%;
}
</style>
<script type='text/javascript' src='pages.js'></script>
<script type='text/javascript'>
function geth() {
var h
if (self.innerHeight)
h = self.innerHeight
else if (document.documentElement && document.documentElement.clientHeight)
h = document.documentElement.clientHeight
else if (document.body)
h = document.body.clientHeight
return h
}
window.onload = function() {
tarea = document.getElementsByTagName('textarea')[0]
update()
window.onresize = update
}
function update() {
tarea.style.height = geth() + 'px'
tarea.focus()
}
</script>
</head>
<body>
<textarea>Notes...</textarea>
</body>
</html>

View File

@@ -0,0 +1,63 @@
/*
Algo: a dekstop environment look-a-like in your web browser
Copyright (C) 2009 Niels Serup
This file is part of Algo.
Algo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Algo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Algo. If not, see <http://www.gnu.org/licenses/>.
*/
/* This css file includes some basic formatting stuff,
which can easily be overridden by internal stylesheets. */
* {
margin: 0;
padding: 0;
font-size: 12px;
font-family: 'dejavu sans' arial;
}
body {
padding: 3px;
}
a:link, a:visited {
text-decoration: none;
border-bottom-width: 1px;
border-bottom-style: dotted;
border-bottom-color: #0033ff;
color: #0033ff;
}
a:hover {
border-bottom-color: #003399;
color: #003399;
}
.header {
font-size: 16px;
font-weight: bold;
}
.right {
float: right;
}
.left {
float: left;
}
.center {
text-align: center;
}

View File

@@ -0,0 +1,89 @@
/*
Algo: a dekstop environment look-a-like in your web browser
Copyright (C) 2009 Niels Serup
This file is part of Algo.
Algo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Algo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Algo. If not, see <http://www.gnu.org/licenses/>.
*/
/* This script page must be included by all pages.
Without it, clicking on a window will not focus it.
See the function below */
document.onmousedown = get_focus
function get_focus() {
parent.scr.change_focus(getwnd().num)
}
/* Get the value of the id. There are always two ids and two values.
The first one covers the title, while the second one is a unique number. */
function getget(id) {
var txt, len, ab
txt = window.location.search.substring(1).split('&')
len = txt.length
for (var i = 0; i < len; i++) {
ab = txt[i].split('=')
if (ab[0] == id) return ab[1]
}
}
// Get the window, so to say.
function getwnd() {
var onum = getget('num') * 1
var num = -1
for (var i = 0; i < parent.scr.len; i++) {
if (parent.wnds[i].onum == onum) {
num = i
break
}
}
if (num > -1)
return parent.wnds[num]
}
function minimize() {
getwnd().minimize()
}
function maximize() {
getwnd().maximize()
}
function close() {
getwnd().close()
}
function setwindow(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
parent.scr.setwindow(a, b, c, d, e, f, g, h, i, j, k, l, m, n)
}
function settitle(title) {
getwnd().settitle(title)
}
function getwh() {
if (self.innerHeight) {
h=self.innerHeight
w=self.innerWidth
}
else if (document.documentElement && document.documentElement.clientHeight) {
h=document.documentElement.clientHeight
w=document.documentElement.clientWidth
}
else if (document.body) {
h=document.body.clientHeight
w=document.body.clientWidth
}
}

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link href='pages.css' type='text/css' rel='stylesheet' />
<script type='text/javascript' src='pages.js'></script>
</head>
<body>
<p class='header'>Welcome to Algo!</p>
<p>Algo is a website that imitates the look of a desktop environment. Algo is functional in most browsers and is released under GPLv3. As it is right now, Algo isn't terribly useful, but that might change someday. Navigate by clicking the tabs at the top and the bars at the bottom.</p>
<br />
<div class='center header'><a href='#' onclick='setwindow("Help", true)'>Help</a></div>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link href='pages.css' type='text/css' rel='stylesheet' />
<script type='text/javascript' src='pages.js'></script>
</head>
<body>
</body>
</html>