Scrutinizer fixes

This commit is contained in:
Dennis Eichhorn 2017-10-26 20:20:01 +02:00
parent 7fa81ff321
commit 9970805938
12 changed files with 30 additions and 4 deletions

View File

@ -25,6 +25,8 @@
{
this.canvas = canvas;
this.ctx = canvas.getContext('2d');
/** global: screen */
this.width = screen.width;
this.height = screen.height;

View File

@ -153,7 +153,7 @@
* @param {string|int} group Group id
* @param {function} callback Callback
* @param {boolean} remove Should be removed after execution
* @param {boolean} remove Reset after triggering
* @param {boolean} reset Reset after triggering
*
* @return {void}
*

View File

@ -27,6 +27,7 @@
{
const self = this;
/** global: Notification */
if(Notification.permission !== 'granted' && Notification.permission !== 'denied') {
Notification.requestPermission(function(permission) {
if(permission === 'granted') {
@ -40,6 +41,7 @@
jsOMS.Message.Notification.Browser.BrowserNotification.prototype.send = function(msg)
{
/** global: Notification */
let n = new Notification(/* ... */);
};
}(window.jsOMS = window.jsOMS || {}));

View File

@ -37,6 +37,7 @@
IPAD: 'ipad', /* IPad */
ANDROID: 'android', /* Android */
BLACKBERRY: 'blackberry', /* Blackberry */
MOBILE: 'webos' /* Mobile */
MOBILE: 'webos', /* Mobile */
UNKNOWN: 'UNKNOWN' /* Unknown */
});
}(window.jsOMS = window.jsOMS || {}));

View File

@ -48,6 +48,8 @@
*/
jsOMS.Message.Request.Request.getBrowser = function ()
{
/** global: InstallTrigger */
/** global: navigator */
if ((!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) {
return jsOMS.Message.Request.BrowserType.OPERA;
} else if (typeof InstallTrigger !== 'undefined') {
@ -78,11 +80,14 @@
{
for (let os in jsOMS.Message.Request.OSType) {
if (jsOMS.Message.Request.OSType.hasOwnProperty(os)) {
/** global: navigator */
if (navigator.appVersion.toLowerCase().indexOf(jsOMS.Message.Request.OSType[os]) !== -1) {
return jsOMS.Message.Request.OSType[os];
}
}
}
return jsOMS.Message.Request.OSType.UNKNOWN;
};
/**

View File

@ -23,6 +23,7 @@
jsOMS.UI.Input.unbind = function (input)
{
this.app.inputManager.getKeyboardManager().unbind(input);
/** global: changeBind */
input.removeEventListener('change', changeBind, false);
};
@ -69,6 +70,7 @@
break;
case 'table':
break;
default:
}
}
});
@ -133,7 +135,6 @@
}
} catch (exception) {
jsOMS.Log.Logger.instance.error('Invalid JSON object: ' + xhr, 'FormManager');
return false;
}
});

View File

@ -80,6 +80,7 @@
e = e !== null ? e.querySelectorAll('[data-lazyload]') : document.querySelectorAll('[data-lazyload]');
const length = e.length;
/** global: IntersectionObserver */
if(!this.visObs && window.IntersectionObserver) {
this.visObs = new IntersectionObserver(function(eles, obs) {
eles.forEach(ele => {

View File

@ -94,7 +94,7 @@
touch.pageX, // screenX - the page X coordinate
touch.pageY, // screenY - the page Y coordinate
touch.pageX, // clientX - the window X coordinate
toch.pageY, // clientY - the window Y coordinate
touch.pageY, // clientY - the window Y coordinate
false, // ctrlKey
false, // altKey
false, // shiftKey
@ -105,6 +105,7 @@
document.dispatchEvent(rightClick);
} else if (elapsedTime < 500) {
/** global: Event */
const e = new Event('keyup');
if (distY > 100) {

View File

@ -14,8 +14,16 @@
jsOMS.Autoloader.defineNamespace('jsOMS.UI.Input.Voice');
// todo: remove once obsolete
/** global: webkitSpeechRecognition */
/** global: SpeechRecognition */
var SpeechRecognition = typeof SpeechRecognition !== 'undefined' ? SpeechRecognition : typeof webkitSpeechRecognition !== 'undefined' ? webkitSpeechRecognition : null;
/** global: webkitSpeechGrammarList */
/** global: SpeechGrammarList */
var SpeechGrammarList = typeof SpeechGrammarList !== 'undefined' ? SpeechGrammarList : typeof webkitSpeechGrammarList !== 'undefined' ? webkitSpeechGrammarList : null;
/** global: webkitSpeechRecognitionEvent */
/** global: SpeechRecognitionEvent */
var SpeechRecognitionEvent = typeof SpeechRecognitionEvent !== 'undefined' ? SpeechRecognitionEvent : typeof webkitSpeechRecognitionEvent !== 'undefined' ? webkitSpeechRecognitionEvent : null;
/**
@ -48,6 +56,7 @@
*/
jsOMS.UI.Input.Voice.ReadManager.prototype.read = function(text)
{
/** global: SpeechSynthesisUtterance */
let utter = new SpeechSynthesisUtterance(text);
utter.lang = this.lang;
utter.voice = this.voice;

View File

@ -31,6 +31,7 @@
this.generalUI = new jsOMS.UI.GeneralUI();
const self = this;
/** global: MutationObserver */
this.domObserver = new MutationObserver(function(mutations) {
const length = mutations.length;

View File

@ -13,6 +13,7 @@
"use strict";
window.addEventListener('error', function (e)
{
/** global: jsOMS */
jsOMS.Log.Logger.instance.error(e.error);
return false;

View File

@ -292,6 +292,7 @@
case 'button':
this.bindButton(elements[i]);
break;
default:
}
}
};
@ -320,6 +321,7 @@
case 'button':
this.bindButton(elements[i]);
break;
default:
}
}
};