diff --git a/js/input.js b/js/input.js deleted file mode 100644 index 49998ff..0000000 --- a/js/input.js +++ /dev/null @@ -1,16 +0,0 @@ -[ -"00:01:e8:04:99:be", -"00:0a:e4:2f:30:15", -"00:0a:e4:30:e3:49", -"00:0a:e4:3b:fa:33", -"00:0a:e4:3d:a4:fd", -"00:0b:5d:24:25:de", -"00:0d:29:04:49:c5", -"00:0d:56:74:45:ab", -"00:0d:56:b7:fd:ac", -"00:0d:60:12:a7:be", -"00:0d:60:5d:eb:c7", -"40:61:86:11:72:b2", -"90:e6:ba:1f:0b:75", -"90:e6:ba:62:2b:da", -] diff --git a/js/input.php b/js/input.php index 9d66540..d706e99 100644 --- a/js/input.php +++ b/js/input.php @@ -1,4 +1,25 @@ - [ "00:01:e8:04:99:be", +. +*/ + + +header("Content-type: application/pdf"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-cache"); header("Pragma: no-cache"); ?> [ "00:01:e8:04:99:be", "00:05:4e:40:1e:97", "00:0c:f1:16:10:ba", "00:0c:f1:1d:dc:70", diff --git a/js/pamela-buttons.js b/js/pamela-buttons.js index bddda35..d5d09d8 100644 --- a/js/pamela-buttons.js +++ b/js/pamela-buttons.js @@ -1,3 +1,22 @@ +/* + Copyright 2009 Pieter Iserbyt + + This file is part of Pamela. + + Pamela 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. + + Pamela 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 Pamela. If not, see . +*/ + // Class IFace button function IFaceButton(x, y, width, height) { this.width = width; diff --git a/js/pamela-matrices.js b/js/pamela-matrices.js index 728a574..bbf3011 100644 --- a/js/pamela-matrices.js +++ b/js/pamela-matrices.js @@ -1,3 +1,22 @@ +/* + Copyright 2009 Pieter Iserbyt + + This file is part of Pamela. + + Pamela 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. + + Pamela 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 Pamela. If not, see . +*/ + // Class Vector function Vector(x, y, z) { this.x = x; diff --git a/js/pamela-nodes.js b/js/pamela-nodes.js index 5d1b632..2070561 100644 --- a/js/pamela-nodes.js +++ b/js/pamela-nodes.js @@ -1,3 +1,22 @@ +/* + Copyright 2009 Pieter Iserbyt + + This file is part of Pamela. + + Pamela 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. + + Pamela 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 Pamela. If not, see . +*/ + // Class Node function Node(name) { diff --git a/js/pamela-nodes.js~ b/js/pamela-nodes.js~ deleted file mode 100644 index ce5b4b1..0000000 --- a/js/pamela-nodes.js~ +++ /dev/null @@ -1,144 +0,0 @@ -// Class Node -function Node(name) { - - this.name = name; - this.modeTime = (new Date).getTime(); - this.setMode("newNode"); - - var size = Math.min(width, height); - this.color = [ - Math.random() * 128, - Math.random() * 128, - Math.random() * 128]; - this.position = new Vector( - (Math.random() * size) - (size / 2), - (Math.random() * size) - (size / 2), - (Math.random() * size) - (size / 2)); - this.position.scale(0.5); -} - -Node.prototype.setMode = function(mode) { - this.modeTime = (new Date).getTime(); - if (mode == "newNode") { - jQuery.extend(this, Node.prototype.newNode); - } else if (mode == "dying") { - jQuery.extend(this, Node.prototype.dying); - } else if (mode == "dead") { - jQuery.extend(this, Node.prototype.dead); - this.isDead = true; - } else { - jQuery.extend(this, Node.prototype.normal); - } -}; - -Node.prototype.alphaForDepth = function(d, start, cutoff) { - d = d < cutoff ? cutoff : d > start ? start : d; - return 1 - (d - start) / (cutoff - start); -}; - - -//Normal mode -Node.prototype.normal = { - - project: function(m) { - this.projection = m.project(this.position); - this.alpha = 255 * this.alphaForDepth(this.projection.z, 0, -400); - }, - - draw: function() { - if (this.projection.z > -1) return; - var scale = width * 3 / -this.projection.z; - var alphaScale = this.alpha / 255; - var invAlphaScale = 1 - alphaScale; - var col = - /* [ - Math.round(this.color[0]), - Math.round(this.color[1]), - Math.round(this.color[2]), - ]; */ - [ - Math.round(128 * invAlphaScale + this.color[0] * alphaScale), - Math.round(128 * invAlphaScale + this.color[1] * alphaScale), - Math.round(128 * invAlphaScale + this.color[2] * alphaScale), - ]; - context.fillStyle = 'rgb(' + col[0] + ',' + col[1] + ',' + col[2] + ')'; - context.globalAlpha = 128 + this.alpha / 512; - context.beginPath(); - context.arc(this.projection.x, this.projection.y, scale, 0, Math.PI * 2, false); - context.fill(); - context.font = scale + "pt sans-serif"; - context.fillText(this.name, this.projection.x + (scale * 1.5), this.projection.y + (scale / 1.5)); - context.closePath(); - context.globalAlpha = 1; - } -}; - -//New mode -Node.prototype.newNode = { - - project: function(m) { - - var newTime = (new Date).getTime() - this.modeTime; - if (newTime > 1000) { - this.setMode("normal"); - this.project(m); - return; - } - - var scale = Math.sqrt(1000 / Math.max(newTime, 1)); - this.projection = m.clone().scale(scale, scale, scale).project(this.position); - this.alpha = 255 * this.alphaForDepth(this.projection.z, 0, -500); - } - -}; - -//Dying mode -Node.prototype.dying = { - - project: function(m) { - var dyingTime = (new Date).getTime() - this.modeTime; - if (dyingTime > 1000) { - this.setMode("dead"); - return; - } - - var scale = Math.sqrt(1000 / Math.max(1000 - dyingTime, 1)); - this.projection = m.clone().scale(scale, scale, scale).project(this.position); - this.alpha = 255 * this.alphaForDepth(this.projection.z, 0, -500); - } - -}; - -//Dead mode -Node.prototype.dead = { - - project: function(m) { - }, - - draw: function() { - } - -}; - -// For inheriting classes -Node.prototype.project = Node.prototype.normal.project; -Node.prototype.draw = Node.prototype.normal.draw; - -// Class NorbertNode -jQuery.extend(NorbertNode.prototype, Node.prototype); -function NorbertNode() { - this.norbert = new Image(); - this.norbert.src = "img/ccc.png"; - this.position = new Vector(0, 0, 0); -} - -NorbertNode.prototype.draw = function() { - var s = Math.abs(this.projection.z / (width / 2)); - s *= 2; - //var x = Math.floor(this.projection.x - (186 / s)); - //var y = Math.floor(this.projection.y - (50 / s)); - var x = Math.floor(this.projection.x - (250 / s)); - var y = Math.floor(this.projection.y - (180 / s)); - context.drawImage(this.norbert, x, y); -}; - diff --git a/js/pamela.js b/js/pamela.js index 3ba681f..1231fa7 100644 --- a/js/pamela.js +++ b/js/pamela.js @@ -1,4 +1,21 @@ -//http://192.168.42.53:5984/pamela/_design/pamela/_view/online +/* + Copyright 2009 Pieter Iserbyt + + This file is part of Pamela. + + Pamela 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. + + Pamela 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 Pamela. If not, see . +*/ var context; var width;