diff --git a/Animation/Animation.js b/Animation/Animation.js index dc5c5f6..0e83320 100644 --- a/Animation/Animation.js +++ b/Animation/Animation.js @@ -14,6 +14,16 @@ /** @namespace jsOMS.Animation.Animation */ jsOMS.Autoloader.defineNamespace('jsOMS.Animation.Animation'); + /** + * requestAnimationFrame wrapper + * + * @return {function} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Animation.requestAnimationFrame = (function () { return window.requestAnimationFrame || diff --git a/Animation/Canvas/Particle.js b/Animation/Canvas/Particle.js index 911275f..2b714f9 100644 --- a/Animation/Canvas/Particle.js +++ b/Animation/Canvas/Particle.js @@ -32,33 +32,101 @@ this.color = {r: 255, g: 255, b: 255, a: 0.5}; }; + /** + * Get particle radius + * + * @return {int} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.Particle.prototype.getRadius = function () { return this.radius; }; + /** + * Set particle position + * + * @param {int} posX Position x + * @param {int} posY Position y + * + * @return {void} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.Particle.prototype.setPosition = function (posX, posY) { this.posX = posX; this.posY = posY; }; + /** + * Get position + * + * @return {Object} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.Particle.prototype.getPosition = function () { return {x: this.posX, y: this.posY}; }; + /** + * Set particle velocity + * + * @param {float} velX Velocity x + * @param {float} velY Velocity y + * + * @return {void} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.Particle.prototype.setVelocity = function (velX, velY) { this.velX = velX; this.velY = velY; }; + /** + * Get velocity + * + * @return {Object} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.Particle.prototype.getVelocity = function () { return {x: this.velX, y: this.velY}; }; + /** + * Draw particle to canvas + * + * @param {object} ctx Canvas + * + * @return {void} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.Particle.prototype.draw = function (ctx) { ctx.fillStyle = 'rgba(' + this.color.r + ', ' + this.color.g + ', ' + this.color.b + ', ' + this.color.a + ')'; diff --git a/Animation/Canvas/ParticleAnimation.js b/Animation/Canvas/ParticleAnimation.js index 3234ae9..d3f54a9 100644 --- a/Animation/Canvas/ParticleAnimation.js +++ b/Animation/Canvas/ParticleAnimation.js @@ -1,5 +1,5 @@ /** - * Particle class. + * Particle animation class. * * @author OMS Development Team * @author Dennis Eichhorn @@ -15,6 +15,9 @@ jsOMS.Autoloader.defineNamespace('jsOMS.Animation.Canvas'); /** + * + * @param {object} canvas Canvas + * * @constructor * * @since 1.0.0 @@ -45,6 +48,18 @@ } }; + /** + * Draw everything + * + * @param {object} self Object reference for self invoke + * + * @return {void} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.ParticleAnimation.prototype.draw = function (self) { self = typeof self !== 'undefined' ? self : this; @@ -63,11 +78,31 @@ }); }; + /** + * Invalidate/clean canvas + * + * @return {void} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.ParticleAnimation.prototype.invalidate = function () { this.ctx.clearRect(0, 0, this.width, this.height); }; + /** + * Update particle + * + * @return {void} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.ParticleAnimation.prototype.updateParticles = function () { let particle, @@ -107,6 +142,19 @@ } }; + /** + * Handle distance between particles + * + * @param {Particle} p1 Particle + * @param {Particle} p2 Particle + * + * @return {void} + * + * @method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ jsOMS.Animation.Canvas.ParticleAnimation.prototype.updateDistance = function (p1, p2) { let pos1 = p1.getPosition(), diff --git a/Spreadsheet/Cell.js b/Spreadsheet/Cell.js new file mode 100644 index 0000000..d6314d0 --- /dev/null +++ b/Spreadsheet/Cell.js @@ -0,0 +1,22 @@ +/** + * Cell. + * + * @author OMS Development Team + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 * @since 1.0.0 + */ +(function (jsOMS) +{ + "use strict"; + /** @namespace jsOMS.Spreadsheet */ + jsOMS.Autoloader.defineNamespace('jsOMS.Spreadsheet'); + + jsOMS.Spreadsheet.Cell = function(id, raw) + { + this.id = id; + this.raw = raw; + this.formatting = raw.formatting; + }; +}(window.jsOMS = window.jsOMS || {})); \ No newline at end of file diff --git a/Spreadsheet/Formatting.js b/Spreadsheet/Formatting.js new file mode 100644 index 0000000..e69de29 diff --git a/Spreadsheet/Functions.js b/Spreadsheet/Functions.js new file mode 100644 index 0000000..e69de29 diff --git a/Spreadsheet/Sheet.js b/Spreadsheet/Sheet.js new file mode 100644 index 0000000..e69de29 diff --git a/Spreadsheet/Spreadsheet.js b/Spreadsheet/Spreadsheet.js new file mode 100644 index 0000000..7b6afc9 --- /dev/null +++ b/Spreadsheet/Spreadsheet.js @@ -0,0 +1,51 @@ +/** + * Spreadsheet view. + * + * @author OMS Development Team + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 * @since 1.0.0 + */ +(function (jsOMS) +{ + "use strict"; + /** @namespace jsOMS.Spreadsheet */ + jsOMS.Autoloader.defineNamespace('jsOMS.Spreadsheet'); + + jsOMS.Spreadsheet.Spreadsheet = function(id, dataset, options) + { + this.spreadsheet = document.getElementById(id); + this.title = ''; + this.sheets = []; + this.columns = true; + this.rows = true; + this.dataset = []; + this.compiledData = []; + this.scroll = {h: false, v: false}; + }; + + jsOMS.SpreadSheet.prototype.draw = function() + { + let col = 0, + row = 0, + cRows = this.dataset.length(), + cCols = 0; + j = 0, + this.compiledData = this.dataset; + + for(let i = 0; i < cRows; i++) { + cCols = this.compiledData[i].length(); + + for(j = 0; j < cCols; j++) { + this.compiledData[i][j] = Functions.evaluate(this.compiledData[i][j], compiledData); + + this.drawCell(this.compiledData[i][j]); + } + } + }; + + jsOMS.SpreadSheet.prototype.drawCell = function() + { + }; +}(window.jsOMS = window.jsOMS || {})); \ No newline at end of file diff --git a/UI/Input.js b/UI/Input.js index 3229214..8e79345 100644 --- a/UI/Input.js +++ b/UI/Input.js @@ -36,8 +36,12 @@ * @since 1.0.0 * @author Dennis Eichhorn */ - jsOMS.UI.Input.bind = function (input) + jsOMS.UI.Input.bindElement = function (input) { + if(typeof input === 'undefined') { + throw 'Input element required' + } + let self = this; input.addEventListener('change', function changeBind(event)