mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 09:58:39 +00:00
Docblocks
This commit is contained in:
parent
78cfc2a7c9
commit
dc1e671818
191
Log/Logger.js
191
Log/Logger.js
|
|
@ -15,6 +15,10 @@
|
|||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {boolean} verbose Verbose logging
|
||||
* @param {boolean} ui Ui logging
|
||||
* @param {boolean} remote Remote logging
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
|
|
@ -28,6 +32,20 @@
|
|||
|
||||
jsOMS.Log.Logger.instance = null;
|
||||
|
||||
/**
|
||||
* Get logging instance
|
||||
*
|
||||
* @param {boolean} verbose Verbose logging
|
||||
* @param {boolean} ui Ui logging
|
||||
* @param {boolean} remote Remote logging
|
||||
*
|
||||
* @return {Object}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.getInstance = function(verbose, ui, remote)
|
||||
{
|
||||
if(!jsOMS.Log.Logger.instance) {
|
||||
|
|
@ -39,6 +57,20 @@
|
|||
|
||||
jsOMS.Log.Logger.MSG_FULL = '{datetime}; {level}; {version}; {os}; {browser}; {path}; {message}';
|
||||
|
||||
/**
|
||||
* Interpolate message
|
||||
*
|
||||
* @param {string} message Message structure
|
||||
* @param {Object} context Context to put into message
|
||||
* @param {string} level Log level
|
||||
*
|
||||
* @return {string}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.interpolate = function (message, context, level)
|
||||
{
|
||||
let newMessage = jsOMS.Log.Logger.MSG_FULL;
|
||||
|
|
@ -52,6 +84,20 @@
|
|||
return newMessage;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create context
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
* @param {string} level Log level
|
||||
*
|
||||
* @return {Object}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.createContext = function (message, context, level)
|
||||
{
|
||||
context.datetime = (new Date()).toISOString();
|
||||
|
|
@ -65,6 +111,20 @@
|
|||
return context;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
* @param {string} level Log level
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.write = function (message, context, level)
|
||||
{
|
||||
context = this.createContext(message, context, level);
|
||||
|
|
@ -113,6 +173,19 @@
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.emergency = function (message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -120,6 +193,19 @@
|
|||
this.write(message, context, jsOMS.Log.LogLevel.EMERGENCY);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.alert = function (message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -127,6 +213,19 @@
|
|||
this.write(message, context, jsOMS.Log.LogLevel.ALERT);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.critical = function (message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -134,6 +233,19 @@
|
|||
this.write(message, context, jsOMS.Log.LogLevel.CRITICAL);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.error = function (message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -141,6 +253,19 @@
|
|||
this.write(message, context, jsOMS.Log.LogLevel.ERROR);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.warning = function (message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -148,6 +273,19 @@
|
|||
this.write(message, context, jsOMS.Log.LogLevel.WARNING);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.notice = function (message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -155,6 +293,19 @@
|
|||
this.write(message, context, jsOMS.Log.LogLevel.NOTICE);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.info = function (message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -162,6 +313,19 @@
|
|||
this.write(message, context, jsOMS.Log.LogLevel.INFO);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.debug = function (message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -169,6 +333,20 @@
|
|||
this.write(message, context, jsOMS.Log.LogLevel.DEBUG);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} level Log level
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.log = function (level, message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
@ -176,6 +354,19 @@
|
|||
this.write(message, context, context);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create log message
|
||||
*
|
||||
* @param {string} message Message to display
|
||||
* @param {Object} context Context to put into message
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.console = function (level, message, context)
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
|
|
|||
|
|
@ -81,16 +81,31 @@
|
|||
return this.formManager;
|
||||
};
|
||||
|
||||
jsOMS.UI.UIManager.prototype.getButton = function ()
|
||||
{
|
||||
return this.button;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get action manager.
|
||||
*
|
||||
* @return {Object}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.UI.UIManager.prototype.getActionManager = function ()
|
||||
{
|
||||
return this.actionManager;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get drag and drop manager.
|
||||
*
|
||||
* @return {Object}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.UI.UIManager.prototype.getDragNDrop = function ()
|
||||
{
|
||||
return this.dragNDrop;
|
||||
|
|
|
|||
34
Uri/Http.js
34
Uri/Http.js
|
|
@ -106,6 +106,18 @@
|
|||
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
|
||||
};
|
||||
|
||||
/**
|
||||
* Get all uri query parameters.
|
||||
*
|
||||
* @param {string} query Uri query
|
||||
*
|
||||
* @return {Object}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Uri.Http.getAllUriQueryParameters = function (query)
|
||||
{
|
||||
const keyValPairs = [],
|
||||
|
|
@ -133,6 +145,18 @@
|
|||
return params;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set uri.
|
||||
*
|
||||
* @param {string} uri Uri string
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Uri.Http.prototype.set = function (uri)
|
||||
{
|
||||
this.uri = uri;
|
||||
|
|
@ -162,6 +186,16 @@
|
|||
this.setupUriBuilder();
|
||||
};
|
||||
|
||||
/**
|
||||
* Set uri builder components.
|
||||
*
|
||||
* @return {void}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Uri.Http.prototype.setupUriBuilder = function ()
|
||||
{
|
||||
jsOMS.Uri.UriFactory.setQuery('/scheme', this.scheme);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,16 @@
|
|||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear all uri components
|
||||
*
|
||||
* @return {boolean}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Uri.UriFactory.clearAll = function()
|
||||
{
|
||||
jsOMS.Uri.UriFactory.uri = {};
|
||||
|
|
@ -56,6 +66,18 @@
|
|||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear uri component
|
||||
*
|
||||
* @param {string} key Uri key for component
|
||||
*
|
||||
* @return {boolean}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Uri.UriFactory.clear = function(key)
|
||||
{
|
||||
if(jsOMS.Uri.UriFactory.uri.hasOwnProperty(key)) {
|
||||
|
|
@ -67,6 +89,18 @@
|
|||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear uri components that follow a certain pattern
|
||||
*
|
||||
* @param {string} pattern Uri key pattern to remove
|
||||
*
|
||||
* @return {boolean}
|
||||
*
|
||||
* @method
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
jsOMS.Uri.UriFactory.clearLike = function(pattern)
|
||||
{
|
||||
let success = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user