mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-17 01:38:40 +00:00
Scrutinizer fixes
This commit is contained in:
parent
7fa81ff321
commit
9970805938
|
|
@ -25,6 +25,8 @@
|
||||||
{
|
{
|
||||||
this.canvas = canvas;
|
this.canvas = canvas;
|
||||||
this.ctx = canvas.getContext('2d');
|
this.ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
|
/** global: screen */
|
||||||
this.width = screen.width;
|
this.width = screen.width;
|
||||||
this.height = screen.height;
|
this.height = screen.height;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@
|
||||||
* @param {string|int} group Group id
|
* @param {string|int} group Group id
|
||||||
* @param {function} callback Callback
|
* @param {function} callback Callback
|
||||||
* @param {boolean} remove Should be removed after execution
|
* @param {boolean} remove Should be removed after execution
|
||||||
* @param {boolean} remove Reset after triggering
|
* @param {boolean} reset Reset after triggering
|
||||||
*
|
*
|
||||||
* @return {void}
|
* @return {void}
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
{
|
{
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
|
/** global: Notification */
|
||||||
if(Notification.permission !== 'granted' && Notification.permission !== 'denied') {
|
if(Notification.permission !== 'granted' && Notification.permission !== 'denied') {
|
||||||
Notification.requestPermission(function(permission) {
|
Notification.requestPermission(function(permission) {
|
||||||
if(permission === 'granted') {
|
if(permission === 'granted') {
|
||||||
|
|
@ -40,6 +41,7 @@
|
||||||
|
|
||||||
jsOMS.Message.Notification.Browser.BrowserNotification.prototype.send = function(msg)
|
jsOMS.Message.Notification.Browser.BrowserNotification.prototype.send = function(msg)
|
||||||
{
|
{
|
||||||
|
/** global: Notification */
|
||||||
let n = new Notification(/* ... */);
|
let n = new Notification(/* ... */);
|
||||||
};
|
};
|
||||||
}(window.jsOMS = window.jsOMS || {}));
|
}(window.jsOMS = window.jsOMS || {}));
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
IPAD: 'ipad', /* IPad */
|
IPAD: 'ipad', /* IPad */
|
||||||
ANDROID: 'android', /* Android */
|
ANDROID: 'android', /* Android */
|
||||||
BLACKBERRY: 'blackberry', /* Blackberry */
|
BLACKBERRY: 'blackberry', /* Blackberry */
|
||||||
MOBILE: 'webos' /* Mobile */
|
MOBILE: 'webos', /* Mobile */
|
||||||
|
UNKNOWN: 'UNKNOWN' /* Unknown */
|
||||||
});
|
});
|
||||||
}(window.jsOMS = window.jsOMS || {}));
|
}(window.jsOMS = window.jsOMS || {}));
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@
|
||||||
*/
|
*/
|
||||||
jsOMS.Message.Request.Request.getBrowser = function ()
|
jsOMS.Message.Request.Request.getBrowser = function ()
|
||||||
{
|
{
|
||||||
|
/** global: InstallTrigger */
|
||||||
|
/** global: navigator */
|
||||||
if ((!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) {
|
if ((!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) {
|
||||||
return jsOMS.Message.Request.BrowserType.OPERA;
|
return jsOMS.Message.Request.BrowserType.OPERA;
|
||||||
} else if (typeof InstallTrigger !== 'undefined') {
|
} else if (typeof InstallTrigger !== 'undefined') {
|
||||||
|
|
@ -78,11 +80,14 @@
|
||||||
{
|
{
|
||||||
for (let os in jsOMS.Message.Request.OSType) {
|
for (let os in jsOMS.Message.Request.OSType) {
|
||||||
if (jsOMS.Message.Request.OSType.hasOwnProperty(os)) {
|
if (jsOMS.Message.Request.OSType.hasOwnProperty(os)) {
|
||||||
|
/** global: navigator */
|
||||||
if (navigator.appVersion.toLowerCase().indexOf(jsOMS.Message.Request.OSType[os]) !== -1) {
|
if (navigator.appVersion.toLowerCase().indexOf(jsOMS.Message.Request.OSType[os]) !== -1) {
|
||||||
return jsOMS.Message.Request.OSType[os];
|
return jsOMS.Message.Request.OSType[os];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return jsOMS.Message.Request.OSType.UNKNOWN;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
jsOMS.UI.Input.unbind = function (input)
|
jsOMS.UI.Input.unbind = function (input)
|
||||||
{
|
{
|
||||||
this.app.inputManager.getKeyboardManager().unbind(input);
|
this.app.inputManager.getKeyboardManager().unbind(input);
|
||||||
|
/** global: changeBind */
|
||||||
input.removeEventListener('change', changeBind, false);
|
input.removeEventListener('change', changeBind, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -69,6 +70,7 @@
|
||||||
break;
|
break;
|
||||||
case 'table':
|
case 'table':
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -133,7 +135,6 @@
|
||||||
}
|
}
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
jsOMS.Log.Logger.instance.error('Invalid JSON object: ' + xhr, 'FormManager');
|
jsOMS.Log.Logger.instance.error('Invalid JSON object: ' + xhr, 'FormManager');
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@
|
||||||
e = e !== null ? e.querySelectorAll('[data-lazyload]') : document.querySelectorAll('[data-lazyload]');
|
e = e !== null ? e.querySelectorAll('[data-lazyload]') : document.querySelectorAll('[data-lazyload]');
|
||||||
const length = e.length;
|
const length = e.length;
|
||||||
|
|
||||||
|
/** global: IntersectionObserver */
|
||||||
if(!this.visObs && window.IntersectionObserver) {
|
if(!this.visObs && window.IntersectionObserver) {
|
||||||
this.visObs = new IntersectionObserver(function(eles, obs) {
|
this.visObs = new IntersectionObserver(function(eles, obs) {
|
||||||
eles.forEach(ele => {
|
eles.forEach(ele => {
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
touch.pageX, // screenX - the page X coordinate
|
touch.pageX, // screenX - the page X coordinate
|
||||||
touch.pageY, // screenY - the page Y coordinate
|
touch.pageY, // screenY - the page Y coordinate
|
||||||
touch.pageX, // clientX - the window X 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, // ctrlKey
|
||||||
false, // altKey
|
false, // altKey
|
||||||
false, // shiftKey
|
false, // shiftKey
|
||||||
|
|
@ -105,6 +105,7 @@
|
||||||
|
|
||||||
document.dispatchEvent(rightClick);
|
document.dispatchEvent(rightClick);
|
||||||
} else if (elapsedTime < 500) {
|
} else if (elapsedTime < 500) {
|
||||||
|
/** global: Event */
|
||||||
const e = new Event('keyup');
|
const e = new Event('keyup');
|
||||||
|
|
||||||
if (distY > 100) {
|
if (distY > 100) {
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,16 @@
|
||||||
jsOMS.Autoloader.defineNamespace('jsOMS.UI.Input.Voice');
|
jsOMS.Autoloader.defineNamespace('jsOMS.UI.Input.Voice');
|
||||||
|
|
||||||
// todo: remove once obsolete
|
// todo: remove once obsolete
|
||||||
|
/** global: webkitSpeechRecognition */
|
||||||
|
/** global: SpeechRecognition */
|
||||||
var SpeechRecognition = typeof SpeechRecognition !== 'undefined' ? SpeechRecognition : typeof webkitSpeechRecognition !== 'undefined' ? webkitSpeechRecognition : null;
|
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;
|
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;
|
var SpeechRecognitionEvent = typeof SpeechRecognitionEvent !== 'undefined' ? SpeechRecognitionEvent : typeof webkitSpeechRecognitionEvent !== 'undefined' ? webkitSpeechRecognitionEvent : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -48,6 +56,7 @@
|
||||||
*/
|
*/
|
||||||
jsOMS.UI.Input.Voice.ReadManager.prototype.read = function(text)
|
jsOMS.UI.Input.Voice.ReadManager.prototype.read = function(text)
|
||||||
{
|
{
|
||||||
|
/** global: SpeechSynthesisUtterance */
|
||||||
let utter = new SpeechSynthesisUtterance(text);
|
let utter = new SpeechSynthesisUtterance(text);
|
||||||
utter.lang = this.lang;
|
utter.lang = this.lang;
|
||||||
utter.voice = this.voice;
|
utter.voice = this.voice;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
this.generalUI = new jsOMS.UI.GeneralUI();
|
this.generalUI = new jsOMS.UI.GeneralUI();
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
/** global: MutationObserver */
|
||||||
this.domObserver = new MutationObserver(function(mutations) {
|
this.domObserver = new MutationObserver(function(mutations) {
|
||||||
const length = mutations.length;
|
const length = mutations.length;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
window.addEventListener('error', function (e)
|
window.addEventListener('error', function (e)
|
||||||
{
|
{
|
||||||
|
/** global: jsOMS */
|
||||||
jsOMS.Log.Logger.instance.error(e.error);
|
jsOMS.Log.Logger.instance.error(e.error);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -292,6 +292,7 @@
|
||||||
case 'button':
|
case 'button':
|
||||||
this.bindButton(elements[i]);
|
this.bindButton(elements[i]);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -320,6 +321,7 @@
|
||||||
case 'button':
|
case 'button':
|
||||||
this.bindButton(elements[i]);
|
this.bindButton(elements[i]);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user