diff --git a/3D/Loader/ObjLoader.js b/3D/Loader/ObjLoader.js index 07270e1..ae3f919 100644 --- a/3D/Loader/ObjLoader.js +++ b/3D/Loader/ObjLoader.js @@ -124,7 +124,7 @@ inherited : false, clone : function( index ) { - var cloned = { + const cloned = { index : ( typeof index === 'number' ? index : this.index ), name : this.name, mtllib : this.mtllib, diff --git a/Chart/CalendarChart.js b/Chart/CalendarChart.js index 2c79d6d..df0e8c8 100644 --- a/Chart/CalendarChart.js +++ b/Chart/CalendarChart.js @@ -61,7 +61,7 @@ .datum(format); rect.append("title") - .text(function(d) { return; }); + .text(function(d) { }); svg.selectAll(".month") .data(function(d) { return d3.time.months(new Date(parseInt(d.name), 0, 1), new Date(parseInt(d.name) + 1, 0, 1)); }) diff --git a/Chart/ChartAbstract.js b/Chart/ChartAbstract.js index 474bbc8..5ad589e 100644 --- a/Chart/ChartAbstract.js +++ b/Chart/ChartAbstract.js @@ -221,6 +221,10 @@ jsOMS.Chart.ChartAbstract.prototype.findAxisDomain = function () { for (let id in this.axis) { + if(!this.axis.hasOwnProperty(id)) { + continue; + } + this.axis[id].max = d3.max(this.dataset, function (m) { return d3.max(m.points, function (d) @@ -528,7 +532,7 @@ 0, this.dimension.height - this.margin.top - - this.margin.bottom, + - this.margin.bottom ], 0.3); } else { return d3.scale.linear().range([ @@ -586,7 +590,7 @@ jsOMS.Chart.ChartAbstract.prototype.calculateDimension = function () { - let box = this.chartSelect.node().getBoundingClientRect() + let box = this.chartSelect.node().getBoundingClientRect(); this.dimension = { width: box.width, diff --git a/Config/Options.js b/Config/Options.js index bdecfd0..6d28e44 100644 --- a/Config/Options.js +++ b/Config/Options.js @@ -41,7 +41,7 @@ */ jsOMS.Config.Options.prototype.set = function (key, value, overwrite) { - overwrite = typeof overwrite === 'bool' ? overwrite : false; + overwrite = typeof overwrite === 'undefined' ? overwrite : false; if (overwrite || typeof this.options[key] === 'undefined') { this.options[key] = value; diff --git a/Event/EventManager.js b/Event/EventManager.js index 269757e..7565d7a 100644 --- a/Event/EventManager.js +++ b/Event/EventManager.js @@ -99,7 +99,7 @@ * Executes the callback specified for this group if all events are finished * * @param {string|int} group Group id - * @param {string|int} id Event id + * @param {string|int} [id] Event id * @param {Object} [data] Data for event * * @return {boolean} @@ -153,8 +153,8 @@ * * @param {string|int} group Group id * @param {function} callback Callback - * @param {boolean} remove Should be removed after execution - * @param {boolean} reset Reset after triggering + * @param {boolean} [remove] Should be removed after execution + * @param {boolean} [reset] Reset after triggering * * @return {boolean} * diff --git a/Log/Logger.js b/Log/Logger.js index eb74430..c7a9314 100644 --- a/Log/Logger.js +++ b/Log/Logger.js @@ -337,7 +337,7 @@ { context = typeof context === 'undefined' ? {} : context; - this.write(message, context, context); + this.write(message, context, level); }; /** diff --git a/Math/MathProcessor.js b/Math/MathProcessor.js index b7efe97..bdfda9a 100644 --- a/Math/MathProcessor.js +++ b/Math/MathProcessor.js @@ -132,7 +132,6 @@ with ({p: MathProcessor.prototype}) { } }; p.error = function (s) { - return; //throw new Error("MathProcessor: " + (s || "Wrong expression")); }; } diff --git a/Message/Notification/App/AppNotification.js b/Message/Notification/App/AppNotification.js index d520214..66b9d7a 100644 --- a/Message/Notification/App/AppNotification.js +++ b/Message/Notification/App/AppNotification.js @@ -21,7 +21,7 @@ jsOMS.Message.Notification.App.AppNotification.prototype.setStatus = function(status) { this.status = status; - } + }; jsOMS.Message.Notification.App.AppNotification.prototype.requestPermission = function() { diff --git a/Message/Notification/Browser/BrowserNotification.js b/Message/Notification/Browser/BrowserNotification.js index d2a738d..494dd54 100644 --- a/Message/Notification/Browser/BrowserNotification.js +++ b/Message/Notification/Browser/BrowserNotification.js @@ -21,7 +21,7 @@ jsOMS.Message.Notification.Browser.BrowserNotification.prototype.setStatus = function(status) { this.status = status; - } + }; jsOMS.Message.Notification.Browser.BrowserNotification.prototype.requestPermission = function() { diff --git a/Message/Notification/NotificationType.enum.js b/Message/Notification/NotificationType.enum.js index ae4dbcc..34aa169 100644 --- a/Message/Notification/NotificationType.enum.js +++ b/Message/Notification/NotificationType.enum.js @@ -15,6 +15,6 @@ jsOMS.Message.Notification.NotificationType = Object.freeze({ APP_NOTIFICATION: 1, - BROWSER_NOTIFICATION: 2, + BROWSER_NOTIFICATION: 2 }); }(window.jsOMS = window.jsOMS || {})); diff --git a/Message/Request/BrowserType.enum.js b/Message/Request/BrowserType.enum.js index 7db8c19..9cc7c48 100644 --- a/Message/Request/BrowserType.enum.js +++ b/Message/Request/BrowserType.enum.js @@ -20,6 +20,6 @@ IE: 'msie', EDGE: 'edge', CHROME: 'chrome', - BLINK: 'blink', + BLINK: 'blink' }); }(window.jsOMS = window.jsOMS || {})); diff --git a/Message/Response/ResponseManager.js b/Message/Response/ResponseManager.js index e1efa18..20e6df4 100644 --- a/Message/Response/ResponseManager.js +++ b/Message/Response/ResponseManager.js @@ -55,7 +55,7 @@ * * @param {string} key Response key * @param {Array|Object} data Date to use in callback - * @param {string} [request] Request id for request specific execution + * @param {jsOMS.Message.Request.Request} [request] Request id for request specific execution * * @method * diff --git a/UI/DragNDrop.js b/UI/DragNDrop.js index 8d0e0a4..7f3f165 100644 --- a/UI/DragNDrop.js +++ b/UI/DragNDrop.js @@ -62,7 +62,7 @@ /** * Bind DOM elment * - * @param {Object} id DOM elment + * @param {string} id DOM elment * * @since 1.0.0 */ diff --git a/UI/Input/Touch/TouchManager.js b/UI/Input/Touch/TouchManager.js index 5665915..560d15f 100644 --- a/UI/Input/Touch/TouchManager.js +++ b/UI/Input/Touch/TouchManager.js @@ -83,24 +83,22 @@ jsOMS.preventAll(event); if (elapsedTime > 300 && distY < 3 && distX < 3) { - let rightClick = document.createEvent('MouseEvents'); - - rightClick.initMouseEvent( - 'click', - true, // canBubble - true, // cancelable - window, // view - set to the window object - 1, // detail - # of mouse clicks - touch.pageX, // screenX - the page X coordinate - touch.pageY, // screenY - the page Y coordinate - touch.pageX, // clientX - the window X coordinate - touch.pageY, // clientY - the window Y coordinate - false, // ctrlKey - false, // altKey - false, // shiftKey - false, // metaKey - 2, // button - 1 = left, 2 = right - null // relatedTarget + let rightClick = MouseEvent('click', + { + bubbles: true, + cancelable: true, + view: window, + screenX: touch.pageX, + screenY: touch.pageY, + clientX: touch.pageX, + clientY: touch.pageY, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + button: 2, + relatedTarget: null + } ); document.dispatchEvent(rightClick); diff --git a/UI/Input/Voice/ReadManager.js b/UI/Input/Voice/ReadManager.js index eef9d5c..c154015 100644 --- a/UI/Input/Voice/ReadManager.js +++ b/UI/Input/Voice/ReadManager.js @@ -110,7 +110,7 @@ /** * Get supported voices. * - * @return {array} + * @return {Array} * * @since 1.0.0 */ diff --git a/UI/Input/Voice/VoiceManager.js b/UI/Input/Voice/VoiceManager.js index 5cc7412..736a1f7 100644 --- a/UI/Input/Voice/VoiceManager.js +++ b/UI/Input/Voice/VoiceManager.js @@ -71,7 +71,7 @@ this.recognition.grammars = this.speechRecognitionList; } - this.recognition.onstart = function() {} + this.recognition.onstart = function() {}; this.recognition.onresult = function(event) { let result = jsOMS.trim(event.results[event.resultIndex][0].transcript); @@ -82,18 +82,18 @@ console.log('found'); self.commands[result](); } - } + }; this.recognition.onspeechend = function() { - } + }; this.recognition.onnomatch = function(event) { jsOMS.Log.Logger.instance.warning('Couldn\'t recognize speech'); - } + }; this.recognition.onerror = function(event) { jsOMS.Log.Logger.instance.warning('Error during speech recognition: ' + event.error); - } + }; }; /** @@ -127,7 +127,7 @@ * Add command/grammar and callback. * * @param {string} command Command id - * @param {Callback} callback Callback for command + * @param {callback} callback Callback for command * * @return {void} * diff --git a/Uri/Http.js b/Uri/Http.js index 17c5521..5af0bab 100644 --- a/Uri/Http.js +++ b/Uri/Http.js @@ -126,6 +126,10 @@ keyValPairs = query.split('&'); for (pairNum in keyValPairs) { + if(!keyValPairs.hasOwnProperty(pairNum)) { + continue; + } + const key = keyValPairs[pairNum].split('=')[0]; if (!key.length) { diff --git a/Utils/ArrayUtils.js b/Utils/ArrayUtils.js index c0988d8..32c4eaa 100644 --- a/Utils/ArrayUtils.js +++ b/Utils/ArrayUtils.js @@ -19,7 +19,7 @@ * @param {Object} data Object * @param {string} delim Path delimiter * - * @return {mixed} + * @return * * @function * @@ -31,6 +31,10 @@ let current = data; for(let key in pathParts) { + if(!pathParts.hasOwnProperty(key)) { + continue; + } + if(current === null) { return null; } diff --git a/Utils/oLib.js b/Utils/oLib.js index 9bd175b..d549d27 100644 --- a/Utils/oLib.js +++ b/Utils/oLib.js @@ -19,7 +19,7 @@ * @param {Object} data Object * @param {string} delim Path delimiter * - * @return {mixed} + * @return * * @function * @@ -31,6 +31,10 @@ let current = data; for(let key in pathParts) { + if(!pathParts.hasOwnProperty(key)) { + continue; + } + if(current === null) { return null; }