mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 01:48:40 +00:00
Fix defalt value
This commit is contained in:
parent
e2555e7b0d
commit
a5474c68cb
|
|
@ -39,10 +39,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Config.Options.prototype.set = function (key, value, overwrite)
|
||||
jsOMS.Config.Options.prototype.set = function (key, value, overwrite = false)
|
||||
{
|
||||
overwrite = typeof overwrite === 'undefined' ? overwrite : false;
|
||||
|
||||
if (overwrite || typeof this.options[key] === 'undefined') {
|
||||
this.options[key] = value;
|
||||
|
||||
|
|
|
|||
|
|
@ -165,15 +165,12 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Event.EventManager.prototype.attach = function (group, callback, remove, reset)
|
||||
jsOMS.Event.EventManager.prototype.attach = function (group, callback, remove = false, reset = false)
|
||||
{
|
||||
if (this.callbacks.hasOwnProperty(group)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
remove = typeof remove === 'undefined' ? false : remove;
|
||||
reset = typeof reset === 'undefined' ? false : reset;
|
||||
|
||||
this.callbacks[group] = {remove: remove, reset: reset, func: callback};
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -180,10 +180,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.emergency = function (message, context)
|
||||
jsOMS.Log.Logger.prototype.emergency = function (message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.EMERGENCY);
|
||||
};
|
||||
|
||||
|
|
@ -199,10 +197,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.alert = function (message, context)
|
||||
jsOMS.Log.Logger.prototype.alert = function (message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.ALERT);
|
||||
};
|
||||
|
||||
|
|
@ -218,10 +214,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.critical = function (message, context)
|
||||
jsOMS.Log.Logger.prototype.critical = function (message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.CRITICAL);
|
||||
};
|
||||
|
||||
|
|
@ -237,10 +231,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.error = function (message, context)
|
||||
jsOMS.Log.Logger.prototype.error = function (message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.ERROR);
|
||||
};
|
||||
|
||||
|
|
@ -256,10 +248,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.warning = function (message, context)
|
||||
jsOMS.Log.Logger.prototype.warning = function (message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.WARNING);
|
||||
};
|
||||
|
||||
|
|
@ -275,10 +265,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.notice = function (message, context)
|
||||
jsOMS.Log.Logger.prototype.notice = function (message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.NOTICE);
|
||||
};
|
||||
|
||||
|
|
@ -294,10 +282,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.info = function (message, context)
|
||||
jsOMS.Log.Logger.prototype.info = function (message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.INFO);
|
||||
};
|
||||
|
||||
|
|
@ -313,10 +299,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.debug = function (message, context)
|
||||
jsOMS.Log.Logger.prototype.debug = function (message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.DEBUG);
|
||||
};
|
||||
|
||||
|
|
@ -333,10 +317,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.log = function (level, message, context)
|
||||
jsOMS.Log.Logger.prototype.log = function (level, message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, level);
|
||||
};
|
||||
|
||||
|
|
@ -353,10 +335,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Log.Logger.prototype.console = function (level, message, context)
|
||||
jsOMS.Log.Logger.prototype.console = function (level, message, context = {})
|
||||
{
|
||||
context = typeof context === 'undefined' ? {} : context;
|
||||
|
||||
this.write(message, context, jsOMS.Log.LogLevel.INFO);
|
||||
};
|
||||
}(window.jsOMS = window.jsOMS || {}));
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.UI.Input.Voice.ReadManager = function (lang)
|
||||
jsOMS.UI.Input.Voice.ReadManager = function (lang = 'en-US')
|
||||
{
|
||||
this.pitch = 1;
|
||||
this.rate = 1;
|
||||
this.lang = typeof lang === 'undefined' ? 'en-US' : lang;
|
||||
this.lang = lang;
|
||||
this.voices = [];
|
||||
this.voice = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.UI.Input.Voice.VoiceManager = function (app, commands, lang)
|
||||
jsOMS.UI.Input.Voice.VoiceManager = function (app, commands = {}, lang = 'en-US')
|
||||
{
|
||||
this.app = app;
|
||||
this.commands = typeof commands === 'undefined' ? {} : commands;
|
||||
this.lang = typeof lang === 'undefined' ? 'en-US' : lang;
|
||||
this.commands = commands;
|
||||
this.lang = lang;
|
||||
this.recognition = null;
|
||||
this.speechRecognitionList = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,10 +51,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.Uri.Http.parseUrl = function (str, mode)
|
||||
jsOMS.Uri.Http.parseUrl = function (str, mode = 'php')
|
||||
{
|
||||
mode = typeof mode === 'undefined' ? 'php' : mode;
|
||||
|
||||
const key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port',
|
||||
'relative', 'path', 'directory', 'file', 'query', 'fragment'
|
||||
],
|
||||
|
|
|
|||
|
|
@ -24,10 +24,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.trim = function(str, char)
|
||||
jsOMS.trim = function(str, char = ' ')
|
||||
{
|
||||
char = typeof char === 'undefined' ? ' ' : char;
|
||||
|
||||
return jsOMS.ltrim(jsOMS.rtrim(str, char), char);
|
||||
};
|
||||
|
||||
|
|
@ -43,10 +41,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.rtrim = function(str, char)
|
||||
jsOMS.rtrim = function(str, char = ' ')
|
||||
{
|
||||
char = typeof char === 'undefined' ? ' ' : char;
|
||||
|
||||
return str.replace(new RegExp("[" + char + "]*$"), '');
|
||||
};
|
||||
|
||||
|
|
@ -62,10 +58,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.ltrim = function(str, char)
|
||||
jsOMS.ltrim = function(str, char = ' ')
|
||||
{
|
||||
char = typeof char === 'undefined' ? ' ' : char;
|
||||
|
||||
return str.replace(new RegExp("^[" + char + "]*"), '');
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -57,10 +57,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.trim = function(str, char)
|
||||
jsOMS.trim = function(str, char = ' ')
|
||||
{
|
||||
char = typeof char === 'undefined' ? ' ' : char;
|
||||
|
||||
return jsOMS.ltrim(jsOMS.rtrim(str, char), char);
|
||||
};
|
||||
|
||||
|
|
@ -76,10 +74,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.rtrim = function(str, char)
|
||||
jsOMS.rtrim = function(str, char = ' ')
|
||||
{
|
||||
char = typeof char === 'undefined' ? ' ' : char;
|
||||
|
||||
return str.replace(new RegExp("[" + char + "]*$"), '');
|
||||
};
|
||||
|
||||
|
|
@ -95,10 +91,8 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
jsOMS.ltrim = function(str, char)
|
||||
jsOMS.ltrim = function(str, char = ' ')
|
||||
{
|
||||
char = typeof char === 'undefined' ? ' ' : char;
|
||||
|
||||
return str.replace(new RegExp("^[" + char + "]*"), '');
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user