Docblock and general minor cleanup

This commit is contained in:
Dennis Eichhorn 2018-12-29 11:55:32 +01:00
parent 97a693fe4b
commit b83b957740
43 changed files with 641 additions and 517 deletions

View File

@ -28,8 +28,6 @@
*
* @return {int}
*
* @method
*
* @since 1.0.0
*/
getId ()

View File

@ -28,7 +28,7 @@
*
* @param {Object} account Account
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -42,7 +42,7 @@
*
* @param {int} id Account id
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -64,8 +64,6 @@
*
* @return {null|Object}
*
* @method
*
* @since 1.0.0
*/
get (id)

View File

@ -29,8 +29,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
registerLoadedAssets ()
@ -54,8 +52,6 @@
*
* @return {string|boolean}
*
* @method
*
* @since 1.0.0
*/
load (path, filetype, callback)
@ -126,9 +122,7 @@
*
* @param {string} key Key of the asset
*
* @return
*
* @method
* @return {null|string}
*
* @since 1.0.0
*/
@ -150,8 +144,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
remove (key)

View File

@ -16,6 +16,8 @@
/**
* @constructor
*
* @param {string} uri Login uri
*
* @since 1.0.0
*/
constructor (uri)
@ -29,8 +31,6 @@
*
* @param {Object} account Account
*
* @method
*
* @since 1.0.0
*/
setAccount (account)
@ -43,8 +43,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
getAccount ()
@ -55,7 +53,7 @@
/**
* Login account.
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -78,7 +76,7 @@
/**
* Logout account.
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -90,7 +88,7 @@
/**
* Handle login result.
*
* @method
* @return {void}
*
* @since 1.0.0
*/

View File

@ -3,7 +3,7 @@
*
* The autoloader is responsible for defining namespaces and dynamically loading javascript
* files that are not yet included. The intention is to provide a similar functionality as
* include, import etc. Contrary to it's name the autoloader is not able to truely autoload
* include, import etc. Contrary to it's name the autoloader is not able to truly autoload
* referenced classes.
*
* @copyright Dennis Eichhorn
@ -25,6 +25,8 @@
*
* @param {string} namespace Namespace
*
* @return {void}
*
* @since 1.0.0
*/
jsOMS.Autoloader.defineNamespace = function (namespace)
@ -51,6 +53,8 @@
/**
* Collect all loaded javascript files
*
* @return {void}
*
* @since 1.0.0
*/
jsOMS.Autoloader.initPreloaded = function ()
@ -74,6 +78,8 @@
*
* @param {string} file Script URI
*
* @return {void}
*
* @since 1.0.0
*/
jsOMS.Autoloader.addPreloaded = function (file)
@ -89,6 +95,8 @@
* @param {string} file Script URI
* @param {function} callback Callback after script loading
*
* @return {void}
*
* @since 1.0.0
*/
jsOMS.Autoloader.include = function (file, callback)

View File

@ -36,8 +36,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
set (key, value, overwrite = false)
@ -58,8 +56,6 @@
*
* @return {boolean|int|float|string|Array}
*
* @method
*
* @since 1.0.0
*/
get (key)
@ -78,8 +74,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
remove (key)

View File

@ -27,8 +27,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
static available()

View File

@ -35,7 +35,7 @@
* @param {string|int} group Group id
* @param {string|int} id Event id
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -55,8 +55,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
reset (group)
@ -75,8 +73,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
hasOutstanding (group)
@ -105,8 +101,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
trigger (group, id = '', data = null)
@ -141,8 +135,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
triggerSingleEvent (group, id = '', data = null)
@ -182,8 +174,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
detach (group)
@ -198,8 +188,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
detachCallback(group)
@ -220,8 +208,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
detachGroup(group)
@ -245,8 +231,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
attach (group, callback, remove = false, reset = false)
@ -265,8 +249,6 @@
*
* @return {int}
*
* @method
*
* @since 1.0.0
*/
count ()

View File

@ -38,8 +38,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
static getInstance (verbose = true, ui = true, remote = false)
@ -60,8 +58,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
interpolate (message, context, level)
@ -86,8 +82,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
createContext (message, context, level)
@ -112,8 +106,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
write (message, context, level)
@ -142,8 +134,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
writeVerbose (message, context, level)
@ -183,8 +173,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
writeRemote (message, context, level)
@ -209,8 +197,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
emergency (message, context = {})
@ -226,8 +212,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
alert (message, context = {})
@ -243,8 +227,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
critical (message, context = {})
@ -260,8 +242,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
error (message, context = {})
@ -277,8 +257,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
warning (message, context = {})
@ -294,8 +272,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
notice (message, context = {})
@ -311,8 +287,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
info (message, context = {})
@ -328,8 +302,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
debug (message, context = {})
@ -346,8 +318,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
log (level, message, context = {})
@ -363,8 +333,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
console (message, context = {})

View File

@ -9,6 +9,15 @@
(function (jsOMS) {
"use strict";
/**
* Evaluate math formula
*
* @param {string} equation Equation
*
* @return {null|float|int}
*
* @since 1.0.0
*/
jsOMS.mathEvaluate = function(equation)
{
const stack = [],
@ -41,11 +50,29 @@
return !isNaN(parseFloat(result)) && isFinite(result) ? result : null;
};
/**
* Parse value
*
* @param {string} value Value to parse
*
* @return {float|int}
*
* @since 1.0.0
*/
jsOMS.parseValue = function(value)
{
return typeof value === 'string' ? (value.indexOf('.') === -1 ? parseInt(value) : parseFloat(value)) : value;
}
/**
* Perform shunting yard
*
* @param {string} value Value to parse
*
* @return {Array}
*
* @since 1.0.0
*/
jsOMS.shuntingYard = function(equation)
{
const stack = [];

View File

@ -14,16 +14,39 @@
jsOMS.Autoloader.defineNamespace('jsOMS.Message.Notification.App');
jsOMS.Message.Notification.App.AppNotification = class {
/**
* @constructor
*
* @since 1.0.0
*/
constructor ()
{
this.status = 0;
};
/**
* Set notification status.
*
* @param {int} status Notification status
*
* @return {void}
*
* @since 1.0.0
*/
setStatus (status)
{
this.status = status;
};
/**
* Create notification
*
* @param {Object} msg Notification
*
* @return {void}
*
* @since 1.0.0
*/
send (msg)
{
const tpl = document.getElementById('app-message');

View File

@ -14,16 +14,37 @@
jsOMS.Autoloader.defineNamespace('jsOMS.Message.Notification.Browser');
jsOMS.Message.Notification.Browser.BrowserNotification = class {
/**
* @constructor
*
* @since 1.0.0
*/
constructor()
{
this.status = 0;
};
/**
* Set notification status.
*
* @param {int} status Notification status
*
* @return {void}
*
* @since 1.0.0
*/
setStatus (status)
{
this.status = status;
};
/**
* Ask for browser permission to create notifications
*
* @return {void}
*
* @since 1.0.0
*/
requestPermission ()
{
const self = this;
@ -40,8 +61,18 @@
}
};
/**
* Create notification
*
* @param {Object} msg Notification
*
* @return {void}
*
* @since 1.0.0
*/
send (msg)
{
// todo: implement
/** global: Notification */
let n = new Notification(/* ... */);
};

View File

@ -1,5 +1,5 @@
/**
* Browser notification.
* Notification manager.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
@ -14,12 +14,27 @@
jsOMS.Autoloader.defineNamespace('jsOMS.Message.Notification');
jsOMS.Message.Notification.NotificationManager = class {
/**
* @constructor
*
* @since 1.0.0
*/
constructor()
{
this.appNotifier = new jsOMS.Message.Notification.App.AppNotification();
this.browserNotifier = new jsOMS.Message.Notification.Browser.BrowserNotification();
};
/**
* Create notification.
*
* @param {Object} message Message object
* @param {int} type Notification type
*
* @return {void}
*
* @since 1.0.0
*/
send (message, type)
{
if (jsOMS.Message.Notification.NotificationType.APP_NOTIFICATION === type) {
@ -29,11 +44,25 @@
}
};
/**
* Get the app notification manager.
*
* @return {Object}
*
* @since 1.0.0
*/
getAppNotifier ()
{
return this.appNotifier;
};
/**
* Get the browser notification manager.
*
* @return {Object}
*
* @since 1.0.0
*/
getBrowserNotifier ()
{
return this.browserNotifier;

View File

@ -13,6 +13,15 @@
jsOMS.Autoloader.defineNamespace('jsOMS.Message.Notification');
jsOMS.Message.Notification.NotificationMessage = class {
/**
* @constructor
*
* @param {string} status Message status
* @param {string} title Message title
* @param {string} message Message content
*
* @since 1.0.0
*/
constructor(status, title, message)
{
this.status = status;

View File

@ -17,6 +17,10 @@
/**
* @constructor
*
* @param {string} uri Request uri
* @param {string} method Request method/verb
* @param {string} type Request content type
*
* @since 1.0.0
*/
constructor (uri = null, method, type)
@ -44,8 +48,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
setContentTypeBasedOnType(type)
@ -67,8 +69,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
static getBrowser()
@ -99,8 +99,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
static getOS()
@ -124,7 +122,7 @@
*
* @param {string} method Method type
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -140,8 +138,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getMethod()
@ -156,7 +152,7 @@
*
* @param {string} type Method type
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -172,8 +168,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getResponseType()
@ -187,7 +181,7 @@
* @param {string} type Request type
* @param {string} header Request header
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -201,8 +195,6 @@
*
* @return {Array}
*
* @method
*
* @since 1.0.0
*/
getRequestHeader()
@ -215,7 +207,7 @@
*
* @param {string} uri Request uri
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -229,8 +221,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getUri()
@ -241,10 +231,9 @@
/**
* Set success callback.
*
* @callback requestCallback
* @param {requestCallback} callback - Success callback
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -259,7 +248,7 @@
* @param {int} status Http response status
* @param {function} callback Callback
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -273,7 +262,7 @@
*
* @param {Array} data Request data
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -287,8 +276,6 @@
*
* @return {Array}
*
* @method
*
* @since 1.0.0
*/
getData()
@ -303,7 +290,7 @@
*
* @param {string} type Method type
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -320,8 +307,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getType()
@ -334,8 +319,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
queryfy(obj)
@ -355,8 +338,6 @@
*
* @return {Array}
*
* @method
*
* @since 1.0.0
*/
send()

View File

@ -16,16 +16,39 @@
jsOMS.Autoloader.defineNamespace('jsOMS.Message.Response');
jsOMS.Message.Response.Response = class {
/**
* @constructor
*
* @param {mixed} data Response data
*
* @since 1.0.0
*/
constructor (data)
{
this.responses = data;
};
/**
* Get response by id.
*
* @param {string} id Response id
*
* @return {mixed}
*
* @since 1.0.0
*/
get (id)
{
return this.responses[id];
};
/**
* Count the amount of responses.
*
* @return {int}
*
* @since 1.0.0
*/
count ()
{
return this.responses.length;

View File

@ -35,7 +35,7 @@
* @param {requestCallback} message Callback for message
* @param {string} [request] Request id in order to only handle a specific request
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -58,7 +58,7 @@
* @param {Array|Object} data Date to use in callback
* @param {jsOMS.Message.Request.Request} [request] Request id for request specific execution
*
* @method
* @return {void}
*
* @since 1.0.0
*/

View File

@ -30,8 +30,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
static getInstance (module, app)

View File

@ -17,6 +17,8 @@
/**
* @constructor
*
* @param {Object} app Application
*
* @since 1.0.0
*/
constructor(app)
@ -32,8 +34,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
get (module)

View File

View File

View File

@ -1,5 +1,5 @@
/**
* Form manager class.
* Action manager class.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
@ -11,18 +11,17 @@
"use strict";
/** @namespace jsOMS.UI */
jsOMS.Autoloader.defineNamespace('jsOMS.UI');
jsOMS.Autoloader.defineNamespace('jsOMS.UI.ActionManager');
jsOMS.UI.ActionManager = class {
/**
* Constructor
* @constructor
*
* @param {Object} app Application
*
* @method
*
* @since 1.0.0
*/
jsOMS.UI.ActionManager = function (app)
constructor(app)
{
this.app = app;
this.actions = {};
@ -35,11 +34,9 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
jsOMS.UI.ActionManager.prototype.bind = function (id)
bind(id)
{
const uiElements = typeof id === 'undefined' ? document.querySelectorAll('[data-action]') : (typeof id.length !== 'undefined' ? id : [id]),
length = uiElements.length;
@ -58,11 +55,9 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
jsOMS.UI.ActionManager.prototype.bindElement = function (e)
bindElement (e)
{
if (!jsOMS.isValidJson(e.getAttribute('data-action'))) {
jsOMS.Log.Logger.instance.error('Invalid json string: \'' + e.getAttribute('data-action') + '\'');
@ -123,11 +118,9 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
jsOMS.UI.ActionManager.prototype.bindListener = function(id, listener, removable = false)
bindListener (id, listener, removable = false)
{
const self = this,
actionLength = listener.action.length;
@ -167,11 +160,9 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
jsOMS.UI.ActionManager.prototype.runAction = function (id, listener, action, data)
runAction (id, listener, action, data)
{
const self = this;
@ -196,12 +187,11 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
jsOMS.UI.ActionManager.prototype.add = function (name, callback)
add (name, callback)
{
this.actions[name] = callback;
};
}
}(window.jsOMS = window.jsOMS || {}));

View File

@ -17,6 +17,8 @@
/**
* @constructor
*
* @param {Object} app Application
*
* @since 1.0.0
*/
constructor (app)
@ -31,6 +33,8 @@
*
* @param {string} id Form Id
*
* @return {void}
*
* @since 1.0.0
*/
get (id)
@ -43,6 +47,8 @@
*
* @param {string} id Form Id
*
* @return {boolean}
*
* @since 1.0.0
*/
isIgnored (id)
@ -55,6 +61,8 @@
*
* @param {string} id Form Id
*
* @return {void}
*
* @since 1.0.0
*/
unbind (id)
@ -67,6 +75,8 @@
*
* @param {string} id Form Id (optional)
*
* @return {void}
*
* @since 1.0.0
*/
bind (id)
@ -91,6 +101,8 @@
*
* @param {string} id Form Id
*
* @return {void}
*
* @since 1.0.0
*/
bindForm (id)
@ -122,6 +134,8 @@
*
* @param {string} id Form Id
*
* @return {boolean}
*
* @since 1.0.0
*/
unbindForm (id)
@ -146,6 +160,8 @@
*
* @param {Object} form Form object
*
* @return {void}
*
* @since 1.0.0
*/
submit (form)
@ -189,6 +205,8 @@
*
* @param {Object} form Form object
*
* @return {void}
*
* @since 1.0.0
*/
submitForm (form)
@ -267,7 +285,7 @@
/**
* Count the bound forms
*
* @return {number}
* @return {int}
*
* @since 1.0.0
*/

View File

@ -19,6 +19,8 @@
*
* @param {Object} input Input element
*
* @return {void}
*
* @since 1.0.0
*/
static unbind = function (input)
@ -29,9 +31,11 @@
};
/**
* Bind input elment
* Bind input element
*
* @param {Object} input Input elment
* @param {Object} input Input element
*
* @return {void}
*
* @since 1.0.0
*/
@ -94,8 +98,10 @@
*
* This only applies for datalists that have remote options
*
* @param {Object} input Input elment
* @param {Object} datalist Datalist elment
* @param {Object} input Input element
* @param {Object} datalist Datalist element
*
* @return {void}
*
* @since 1.0.0
*/
@ -144,7 +150,9 @@
/**
* Remove all datalist options from datalist
*
* @param {Object} datalist Datalist elment
* @param {Object} datalist Datalist element
*
* @return {void}
*
* @since 1.0.0
*/

View File

@ -18,9 +18,8 @@
*
* @since 1.0.0
*/
constructor (responseManager)
constructor ()
{
this.responseManager = responseManager;
};
/**
@ -28,7 +27,7 @@
*
* @param {string} [id] Element id
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -38,7 +37,7 @@
const e = document.getElementById(id);
if (e) {
this.bindElement();
this.bindElement(e);
}
} else {
const tabs = document.querySelectorAll('.tabview'),
@ -53,9 +52,9 @@
/**
* Bind & rebind UI element.
*
* @param {Object} [e] Element id
* @param {Object} e Element id
*
* @method
* @return {void}
*
* @since 1.0.0
*/

View File

@ -16,6 +16,8 @@
/**
* @constructor
*
* @param {Object} app Application
*
* @since 1.0.0
*/
constructor(app)
@ -30,7 +32,7 @@
*
* @param {string} [id] Element id
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -56,6 +58,8 @@
*
* @param {string} id Table Id
*
* @return {void}
*
* @since 1.0.0
*/
unbind (id)
@ -68,7 +72,7 @@
*
* @param {Object} [id] Element id
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -113,6 +117,16 @@
}
};
/**
* Removes the closest row on click.
*
* @param {Element} remove Remove button
* @param {Object} id Element id
*
* @return {void}
*
* @since 1.0.0
*/
bindRemovable(remove, id)
{
remove.addEventListener('click', function (event)
@ -123,6 +137,16 @@
});
};
/**
* Swaps the row on click.
*
* @param {Element} sorting Swap button
* @param {Object} id Element id
*
* @return {void}
*
* @since 1.0.0
*/
bindReorder(sorting, id)
{
sorting.addEventListener('click', function (event)
@ -143,6 +167,16 @@
});
};
/**
* Sorts the table.
*
* @param {Element} sorting Sort button
* @param {Object} id Table id
*
* @return {void}
*
* @since 1.0.0
*/
bindSorting(sorting, id)
{
sorting.addEventListener('click', function (event)
@ -193,6 +227,16 @@
});
};
/**
* Filters the table.
*
* @param {Element} filtering Filter button
* @param {Object} id Table id
*
* @return {void}
*
* @since 1.0.0
*/
bindFiltering(filtering, id)
{
filtering.addEventListener('click', function (event)

View File

@ -31,6 +31,8 @@
*
* @param {Object} element DOM element
*
* @return {void}
*
* @since 1.0.0
*/
unbind (element)
@ -42,6 +44,8 @@
*
* @param {Object} id DOM element
*
* @return {void}
*
* @since 1.0.0
*/
bind (id)
@ -63,7 +67,9 @@
/**
* Bind DOM elment
*
* @param {string} id DOM elment
* @param {string} id DOM element
*
* @return {void}
*
* @since 1.0.0
*/

View File

@ -29,7 +29,7 @@
*
* @param {string} [id] Button id (optional)
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -49,7 +49,7 @@
*
* @param {Object} [e] Element id
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -71,7 +71,7 @@
*
* @param {Object} [e] Element id
*
* @method
* @return {void}
*
* @since 1.0.0
*/

View File

@ -32,6 +32,8 @@
* @param {Array} keys Keyboard keys
* @param {callback} callback Callback
*
* @return {void}
*
* @since 1.0.0
*/
add (element, keys, callback)
@ -50,6 +52,8 @@
*
* @param {string} element Container id
*
* @return {void}
*
* @since 1.0.0
*/
bind (element)
@ -77,6 +81,10 @@
* @param {string} element Container id
* @param {Object} event Key event
*
* @return {void}
*
* @throws {Error}
*
* @since 1.0.0
*/
run (element, event)

View File

@ -34,6 +34,8 @@
* @param {callback} callback Callback
* @param {bool} exact ??? todo: can't remember why this was important oO!!!
*
* @return {void}
*
* @since 1.0.0
*/
add (element, type, button, callback, exact)
@ -52,6 +54,8 @@
* @param {string} element Element id
* @param {int} type Action type
*
* @return {void}
*
* @since 1.0.0
*/
bind (element, type)
@ -98,6 +102,8 @@
* @param {string} element Element id
* @param {Object} event Click event
*
* @return {void}
*
* @since 1.0.0
*/
run (element, event)

View File

@ -33,6 +33,8 @@
*
* This is called in between swipes in order to reset previous swipe data.
*
* @return {void}
*
* @since 1.0.0
*/
resetSwipe ()
@ -43,7 +45,9 @@
/**
* Adding swipe functionality.
*
* Forwarding swipe to arrow keyes.
* Forwarding swipe to arrow keys.
*
* @return {void}
*
* @since 1.0.0
*/

View File

@ -30,6 +30,8 @@
/**
* @constructor
*
* @param {string} lang Localization
*
* @since 1.0.0
*/
constructor (lang = 'en-US')

View File

@ -30,6 +30,10 @@
/**
* @constructor
*
* @param {Object} app Application
* @param {Object} commands Available commands
* @param {string} lang Localization
*
* @since 1.0.0
*/
constructor(app, commands = {}, lang = 'en-US')
@ -49,7 +53,7 @@
/**
* Setup or re-initialize voice manager.
*
* @method
* @return {void}
*
* @since 1.0.0
*/

View File

@ -25,7 +25,7 @@
{
this.app = app;
this.formManager = new jsOMS.UI.Component.Form(this.app);
this.tabManager = new jsOMS.UI.Component.Tab(this.app.responseManager);
this.tabManager = new jsOMS.UI.Component.Tab();
this.tableManager = new jsOMS.UI.Component.Table(this.app);
this.actionManager = new jsOMS.UI.ActionManager(this.app);
this.dragNDrop = new jsOMS.UI.DragNDrop(this.app);
@ -47,7 +47,7 @@
*
* @param {string} [id] Element id
*
* @method
* @return {void}
*
* @since 1.0.0
*/
@ -86,8 +86,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
getFormManager()
@ -100,8 +98,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
getActionManager()
@ -114,8 +110,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
getDragNDrop()
@ -128,8 +122,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
getTabManager()
@ -142,8 +134,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
getTableManager()
@ -156,8 +146,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
getDOMObserver()
@ -170,8 +158,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
getGeneralUI()

View File

@ -1,7 +1,7 @@
/**
* Http Uri.
*
* This class is for creating, modifying and analysing http uris.
* This class is for creating, modifying and analyzing http uris.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
@ -48,8 +48,6 @@
*
* @throws {Error}
*
* @function
*
* @since 1.0.0
*/
static parseUrl (str, mode = 'php')
@ -90,8 +88,6 @@
*
* @return {null|string}
*
* @method
*
* @since 1.0.0
*/
static getUriQueryParameter (query, name)
@ -111,8 +107,6 @@
*
* @return {Object}
*
* @method
*
* @since 1.0.0
*/
static getAllUriQueryParameters (query)
@ -153,8 +147,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
set (uri)
@ -191,8 +183,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
setRootPath(rootPath)
@ -206,8 +196,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getBase()
@ -220,8 +208,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getScheme()
@ -234,8 +220,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getHost()
@ -248,8 +232,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getPort()
@ -262,8 +244,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getUser()
@ -276,8 +256,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getPass()
@ -290,8 +268,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getQuery()
@ -304,8 +280,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getUri()
@ -318,8 +292,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getFragment()
@ -332,8 +304,6 @@
*
* @return {string}
*
* @method
*
* @since 1.0.0
*/
getPath()
@ -346,8 +316,6 @@
*
* @return {int}
*
* @method
*
* @since 1.0.0
*/
getPathOffset()

View File

@ -23,8 +23,6 @@
*
* @return {boolean}
*
* @function
*
* @since 1.0.0
*/
static setQuery (key, value, overwrite)
@ -47,8 +45,6 @@
*
* @return {null|string}
*
* @method
*
* @since 1.0.0
*/
static getQuery (key)
@ -61,8 +57,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
static clearAll ()
@ -79,8 +73,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
static clear (key)
@ -101,8 +93,6 @@
*
* @return {boolean}
*
* @method
*
* @since 1.0.0
*/
static clearLike (pattern)
@ -129,8 +119,6 @@
*
* @return {string}
*
* @function
*
* @since 1.0.0
*/
static unique (url)
@ -177,7 +165,7 @@
* @param {string} uri Raw uri
* @param {Object} [toMatch] Key/value pair to replace in raw
*
* @function
* @return {string}
*
* @since 1.0.0
*/
@ -216,9 +204,7 @@
parsed = parsed.replace('&', '?');
}
parsed = jsOMS.Uri.UriFactory.unique(parsed);
return parsed;
return jsOMS.Uri.UriFactory.unique(parsed);
};
/**
@ -226,8 +212,6 @@
*
* @return {void}
*
* @method
*
* @since 1.0.0
*/
static setupUriBuilder (uri)

View File

@ -19,9 +19,7 @@
* @param {Object} data Object
* @param {string} delim Path delimiter
*
* @return
*
* @function
* @return {mixed}
*
* @since 1.0.0
*/

View File

@ -17,7 +17,7 @@
*
* Used to fire event after delay
*
* @function
* @return {callback}
*
* @since 1.0.0
*/
@ -37,9 +37,7 @@
* @param target Target array
* @param source Source array
*
* @return Array
*
* @function
* @return {Array}
*
* @since 1.0.0
*/
@ -75,6 +73,15 @@
return obj;
};
/**
* Check if a value/variable is set
*
* @param variable Variable to check for existence.
*
* @return {boolean}
*
* @since 1.0.0
*/
jsOMS.isset = function (variable)
{
return typeof variable !== 'undefined' && variable !== null;

View File

@ -20,8 +20,6 @@
*
* @return {string}
*
* @function
*
* @since 1.0.0
*/
jsOMS.trim = function(str, char = ' ')
@ -37,8 +35,6 @@
*
* @return {string}
*
* @function
*
* @since 1.0.0
*/
jsOMS.rtrim = function(str, char = ' ')
@ -54,8 +50,6 @@
*
* @return {string}
*
* @function
*
* @since 1.0.0
*/
jsOMS.ltrim = function(str, char = ' ')
@ -68,7 +62,7 @@
*
* @param {string} jsonString String to validate
*
* @function
* @return {boolean}
*
* @since 1.0.0
*/
@ -90,8 +84,6 @@
*
* @return {int}
*
* @function
*
* @since 1.0.0
*/
jsOMS.substr_count = function(str, substr) {
@ -128,8 +120,6 @@
*
* @return {int}
*
* @function
*
* @since 1.0.0
*/
jsOMS.hash = function (str)
@ -144,6 +134,16 @@
return res;
};
/**
* Get the remaining string after finding a certain char
*
* @param {string} haystack String to to search in
* @param {array} chars Chars to search for
*
* @return {string}
*
* @since 1.0.0
*/
jsOMS.strpbrk = function (haystack, chars)
{
const length = chars.length;
@ -159,6 +159,16 @@
return haystack.slice(min);
};
/**
* Encodes special html characters
*
* @param {string} text String to encode
* @param {boolean} quotes Should quotes be allowed
*
* @return {string}
*
* @since 1.0.0
*/
jsOMS.htmlspecialchars = function (text, quotes) {
let map = {
'&': '&',

View File

@ -22,8 +22,6 @@
*
* @return {boolean}
*
* @function
*
* @since 1.0.0
*/
jsOMS.hasClass = function (ele, cls)
@ -42,7 +40,7 @@
* @param ele DOM Element
* @param cls Class to add
*
* @function
* @return {void}
*
* @since 1.0.0
*/
@ -61,7 +59,7 @@
* @param ele DOM Element
* @param cls Class to remove
*
* @function
* @return {void}
*
* @since 1.0.0
*/
@ -76,11 +74,11 @@
/**
* Action prevent
*
* Preventing event from firering and passing through
* Preventing event from firing and passing through
*
* @param event Event Event to stop
*
* @function
* @return {void}
*
* @since 1.0.0
*/
@ -100,9 +98,9 @@
*
* Invoking a function after page load
*
* @param func Callback function
* @param {callback} func Callback function
*
* @function
* @return {void}
*
* @since 1.0.0
*/
@ -129,7 +127,7 @@
*
* @param ele DOM Element
*
* @function
* @return {void}
*
* @since 1.0.0
*/
@ -149,8 +147,6 @@
*
* @return {boolean}
*
* @function
*
* @since 1.0.0
*/
jsOMS.isNode = function (ele)
@ -170,8 +166,6 @@
*
* @return {boolean}
*
* @function
*
* @since 1.0.0
*/
jsOMS.isElement = function (o)
@ -190,9 +184,7 @@
* @param ele DOM Element
* @param cls Class to find
*
* @return Element
*
* @function
* @return {Element}
*
* @since 1.0.0
*/
@ -216,7 +208,7 @@
* @param {string} event Event name
* @param {function} callback Event callback
*
* @function
* @return {void}
*
* @since 1.0.0
*/

View File

@ -40,6 +40,8 @@
*
* Pulled out since this is used in a cleanup process
*
* @return {void}
*
* @since 1.0.0
*/
initializeMembers ()
@ -73,11 +75,25 @@
return this.action;
};
/**
* Get time of last submit
*
* @return {int}
*
* @since 1.0.0
*/
getLastSubmit ()
{
return this.lastSubmit;
};
/**
* Update last submit time
*
* @return {void}
*
* @since 1.0.0
*/
updateLastSubmit ()
{
this.lastSubmit = Math.floor(Date.now());
@ -116,6 +132,8 @@
*
* @param {callback} callback Callback
*
* @return {void}
*
* @since 1.0.0
*/
setSuccess (callback)
@ -128,6 +146,8 @@
*
* @param {callback} callback Callback
*
* @return {void}
*
* @since 1.0.0
*/
injectSubmit (callback)
@ -321,6 +341,8 @@
/**
* Bind form
*
* @return {void}
*
* @since 1.0.0
*/
bind ()
@ -361,6 +383,8 @@
/**
* Unbind form
*
* @return {void}
*
* @since 1.0.0
*/
unbind ()
@ -390,6 +414,8 @@
/**
* Clean form
*
* @return {void}
*
* @since 1.0.0
*/
clean ()

View File

@ -1,24 +1,44 @@
/**
* Table view.
*
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @since 1.0.0
*/
(function (jsOMS) {
"use strict";
jsOMS.Autoloader.defineNamespace('jsOMS.Views');
jsOMS.Views.TableView = class {
/**
* @constructor
*
* @since 1.0.0
*/
constructor (id) {
this.id = id;
this.bind();
};
/**
* Bind the table
*
* @return {void}
*
* @since 1.0.0
*/
bind ()
{
const e = document.getElementById(this.id);
};
/**
* Get sorting elements
* Get table header elements which provide sorting
*
* @return {Object}
* @return {array}
*
* @since 1.0.0
*/
@ -30,6 +50,27 @@
);
};
/**
* Get table header elements which provide filter functionality
*
* @return {array}
*
* @since 1.0.0
*/
getFilter()
{
return document.querySelectorAll(
'#' + this.id + ' thead .filter'
);
};
/**
* Get row elements which allow to swap the current row with another row
*
* @return {array}
*
* @since 1.0.0
*/
getSortableRows()
{
return document.querySelectorAll(
@ -38,18 +79,18 @@
);
};
/**
* Get row elements which allow to remove a row element
*
* @return {array}
*
* @since 1.0.0
*/
getRemovable()
{
return document.querySelectorAll(
'#' + this.id + ' tbody .remove'
);
};
getFilter()
{
return document.querySelectorAll(
'#' + this.id + ' thead .filter'
);
};
}
}(window.jsOMS = window.jsOMS || {}));

View File

@ -1,34 +0,0 @@
(function (jsOMS) {
"use strict";
jsOMS.ViewAbstract = class {
constructor ()
{
this.element = null;
this.data = [];
};
bind (node)
{
this.element = node;
};
addData(id, data, overwrite)
{
overwrite = typeof overwrite !== 'undefined' ? overwrite : false;
if (typeof this.data[id] === 'undefined' || overwrite) {
this.data[id] = data;
return true;
}
return false;
};
getData(id)
{
return typeof this.data[id] !== 'undefined' ? this.data[id] : undefined;
};
}
}(window.jsOMS = window.jsOMS || {}));