mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-13 16:08:41 +00:00
Firefox fixes
This commit is contained in:
parent
706b59cd5f
commit
981b73e184
|
|
@ -0,0 +1,34 @@
|
||||||
|
/**
|
||||||
|
* App notification.
|
||||||
|
*
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
(function (jsOMS)
|
||||||
|
{
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/** @namespace jsOMS.Message.Notification.App */
|
||||||
|
jsOMS.Autoloader.defineNamespace('jsOMS.Message.Notification.App');
|
||||||
|
|
||||||
|
jsOMS.Message.Notification.App.AppNotification = function()
|
||||||
|
{
|
||||||
|
this.status = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
jsOMS.Message.Notification.App.AppNotification.prototype.setStatus = function(status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
jsOMS.Message.Notification.App.AppNotification.prototype.requestPermission = function()
|
||||||
|
{
|
||||||
|
const self = this;
|
||||||
|
};
|
||||||
|
|
||||||
|
jsOMS.Message.Notification.App.AppNotification.prototype.send = function(msg)
|
||||||
|
{
|
||||||
|
};
|
||||||
|
}(window.jsOMS = window.jsOMS || {}));
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
jsOMS.Autoloader.defineNamespace('jsOMS.UI.Input.Voice');
|
jsOMS.Autoloader.defineNamespace('jsOMS.UI.Input.Voice');
|
||||||
|
|
||||||
// todo: remove once obsolete
|
// todo: remove once obsolete
|
||||||
var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition
|
var SpeechRecognition = typeof SpeechRecognition !== 'undefined' ? SpeechRecognition : typeof webkitSpeechRecognition !== 'undefined' ? webkitSpeechRecognition : null;
|
||||||
var SpeechGrammarList = SpeechGrammarList || webkitSpeechGrammarList
|
var SpeechGrammarList = typeof SpeechGrammarList !== 'undefined' ? SpeechGrammarList : typeof webkitSpeechGrammarList !== 'undefined' ? webkitSpeechGrammarList : null;
|
||||||
var SpeechRecognitionEvent = SpeechRecognitionEvent || webkitSpeechRecognitionEvent
|
var SpeechRecognitionEvent = typeof SpeechRecognitionEvent !== 'undefined' ? SpeechRecognitionEvent : typeof webkitSpeechRecognitionEvent !== 'undefined' ? webkitSpeechRecognitionEvent : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
@ -28,9 +28,13 @@
|
||||||
this.pitch = 1;
|
this.pitch = 1;
|
||||||
this.rate = 1;
|
this.rate = 1;
|
||||||
this.lang = typeof lang === 'undefined' ? 'en-US' : lang;
|
this.lang = typeof lang === 'undefined' ? 'en-US' : lang;
|
||||||
|
this.voices = [];
|
||||||
|
this.voice = null;
|
||||||
|
|
||||||
this.voices = window.speechSynthesis.getVoices();
|
if(SpeechRecognition !== null) {
|
||||||
this.voice = this.voices[0];
|
this.voices = window.speechSynthesis.getVoices();
|
||||||
|
this.voice = this.voices[0];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
jsOMS.Autoloader.defineNamespace('jsOMS.UI.Input.Voice');
|
jsOMS.Autoloader.defineNamespace('jsOMS.UI.Input.Voice');
|
||||||
|
|
||||||
// todo: remove once obsolete
|
// todo: remove once obsolete
|
||||||
var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition
|
var SpeechRecognition = typeof SpeechRecognition !== 'undefined' ? SpeechRecognition : typeof webkitSpeechRecognition !== 'undefined' ? webkitSpeechRecognition : null;
|
||||||
var SpeechGrammarList = SpeechGrammarList || webkitSpeechGrammarList
|
var SpeechGrammarList = typeof SpeechGrammarList !== 'undefined' ? SpeechGrammarList : typeof webkitSpeechGrammarList !== 'undefined' ? webkitSpeechGrammarList : null;
|
||||||
var SpeechRecognitionEvent = SpeechRecognitionEvent || webkitSpeechRecognitionEvent
|
var SpeechRecognitionEvent = typeof SpeechRecognitionEvent !== 'undefined' ? SpeechRecognitionEvent : typeof webkitSpeechRecognitionEvent !== 'undefined' ? webkitSpeechRecognitionEvent : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
|
|
@ -26,10 +26,15 @@
|
||||||
jsOMS.UI.Input.Voice.VoiceManager = function (app, commands, lang)
|
jsOMS.UI.Input.Voice.VoiceManager = function (app, commands, lang)
|
||||||
{
|
{
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.recognition = new SpeechRecognition();
|
|
||||||
this.speechRecognitionList = new SpeechGrammarList();
|
|
||||||
this.commands = typeof commands === 'undefined' ? {} : commands;
|
this.commands = typeof commands === 'undefined' ? {} : commands;
|
||||||
this.lang = typeof lang === 'undefined' ? 'en-US' : lang;
|
this.lang = typeof lang === 'undefined' ? 'en-US' : lang;
|
||||||
|
this.recognition = null;
|
||||||
|
this.speechRecognitionList = null;
|
||||||
|
|
||||||
|
if(SpeechRecognition !== null) {
|
||||||
|
this.recognition = new SpeechRecognition();
|
||||||
|
this.speechRecognitionList = new SpeechGrammarList();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -41,6 +46,10 @@
|
||||||
*/
|
*/
|
||||||
jsOMS.UI.Input.Voice.VoiceManager.prototype.setup = function()
|
jsOMS.UI.Input.Voice.VoiceManager.prototype.setup = function()
|
||||||
{
|
{
|
||||||
|
if(SpeechRecognition === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
this.recognition.lang = this.lang;
|
this.recognition.lang = this.lang;
|
||||||
|
|
@ -127,6 +136,10 @@
|
||||||
*/
|
*/
|
||||||
jsOMS.UI.Input.Voice.VoiceManager.prototype.start = function()
|
jsOMS.UI.Input.Voice.VoiceManager.prototype.start = function()
|
||||||
{
|
{
|
||||||
|
if(SpeechRecognition === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.recognition.start();
|
this.recognition.start();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -139,6 +152,10 @@
|
||||||
*/
|
*/
|
||||||
jsOMS.UI.Input.Voice.VoiceManager.prototype.stop = function()
|
jsOMS.UI.Input.Voice.VoiceManager.prototype.stop = function()
|
||||||
{
|
{
|
||||||
|
if(SpeechRecognition === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.recognition.stop();
|
this.recognition.stop();
|
||||||
};
|
};
|
||||||
}(window.jsOMS = window.jsOMS || {}));
|
}(window.jsOMS = window.jsOMS || {}));
|
||||||
Loading…
Reference in New Issue
Block a user