mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
Merge branch 'develop' of https://github.com/Orange-Management/jsOMS into develop
This commit is contained in:
commit
9a9ce50716
|
|
@ -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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Animation.Animation.requestAnimationFrame = (function ()
|
||||
{
|
||||
return window.requestAnimationFrame ||
|
||||
|
|
|
|||
|
|
@ -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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Animation.Canvas.Particle.prototype.draw = function (ctx)
|
||||
{
|
||||
ctx.fillStyle = 'rgba(' + this.color.r + ', ' + this.color.g + ', ' + this.color.b + ', ' + this.color.a + ')';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Particle class.
|
||||
* Particle animation class.
|
||||
*
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
|
|
@ -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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
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 <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Animation.Canvas.ParticleAnimation.prototype.updateDistance = function (p1, p2)
|
||||
{
|
||||
let pos1 = p1.getPosition(),
|
||||
|
|
|
|||
22
Spreadsheet/Cell.js
Normal file
22
Spreadsheet/Cell.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Cell.
|
||||
*
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @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 || {}));
|
||||
0
Spreadsheet/Formatting.js
Normal file
0
Spreadsheet/Formatting.js
Normal file
0
Spreadsheet/Functions.js
Normal file
0
Spreadsheet/Functions.js
Normal file
0
Spreadsheet/Sheet.js
Normal file
0
Spreadsheet/Sheet.js
Normal file
51
Spreadsheet/Spreadsheet.js
Normal file
51
Spreadsheet/Spreadsheet.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* Spreadsheet view.
|
||||
*
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @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 || {}));
|
||||
|
|
@ -36,8 +36,12 @@
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user