convert speech helpers to modules
This commit is contained in:
parent
ea52890908
commit
04e736eb2e
4 changed files with 153 additions and 157 deletions
|
|
@ -475,8 +475,8 @@
|
|||
integrity="sha384-JUh163oCRItcbPme8pYnROHQMC6fNKTBWtRG3I3I0erJkzNgL7uxKlNwcrcFKeqF"
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer" defer></script>
|
||||
<script defer src="/js/milestonesData.js"></script>
|
||||
<script defer src="/js/audioBackup.js"></script>
|
||||
<script defer src="/js/speechRecognition.js"></script>
|
||||
<script type="module" src="/js/audioBackup.js"></script>
|
||||
<script type="module" src="/js/speechRecognition.js"></script>
|
||||
<script type="module" src="/js/transcriptionSettings.js"></script>
|
||||
<script type="module" src="/js/voicePreferences.js"></script>
|
||||
<script defer src="/js/app.js?v=7.1.3"></script>
|
||||
|
|
|
|||
|
|
@ -4,13 +4,12 @@
|
|||
// Falls back to IndexedDB if server save fails.
|
||||
// ============================================================
|
||||
|
||||
(function() {
|
||||
var DB_NAME = 'PedScribeAudioBackup';
|
||||
var STORE_NAME = 'recordings';
|
||||
var DB_VERSION = 1;
|
||||
var MAX_AGE_MS = 24 * 60 * 60 * 1000;
|
||||
var DB_NAME = 'PedScribeAudioBackup';
|
||||
var STORE_NAME = 'recordings';
|
||||
var DB_VERSION = 1;
|
||||
var MAX_AGE_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
var _db = null;
|
||||
var _db = null;
|
||||
|
||||
function openDB() {
|
||||
if (_db) return Promise.resolve(_db);
|
||||
|
|
@ -293,5 +292,4 @@
|
|||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||
}
|
||||
|
||||
cleanupOldLocalBackups();
|
||||
})();
|
||||
cleanupOldLocalBackups();
|
||||
|
|
|
|||
|
|
@ -5,18 +5,16 @@
|
|||
// Only use if you accept this trade-off for real-time streaming
|
||||
// ============================================================
|
||||
|
||||
(function() {
|
||||
var STORAGE_ENABLED = 'ped_web_speech_enabled';
|
||||
|
||||
var STORAGE_ENABLED = 'ped_web_speech_enabled';
|
||||
var SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
||||
var _recognition = null;
|
||||
var _transcript = '';
|
||||
var _isListening = false;
|
||||
var _onPartialCallback = null;
|
||||
var _onFinalCallback = null;
|
||||
|
||||
var SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
||||
var _recognition = null;
|
||||
var _transcript = '';
|
||||
var _isListening = false;
|
||||
var _onPartialCallback = null;
|
||||
var _onFinalCallback = null;
|
||||
|
||||
window.WebSpeechRecognition = {
|
||||
window.WebSpeechRecognition = {
|
||||
|
||||
isSupported: function() {
|
||||
return typeof SpeechRecognition !== 'undefined';
|
||||
|
|
@ -155,6 +153,4 @@
|
|||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const moduleEntrypoints = [
|
|||
'public/js/clinicalAssistant.js',
|
||||
'public/js/admin.js',
|
||||
'public/js/admin-docs.js',
|
||||
'public/js/audioBackup.js',
|
||||
'public/js/authFetch.js',
|
||||
'public/js/diagrams.js',
|
||||
'public/js/drugs-loader.js',
|
||||
|
|
@ -22,6 +23,7 @@ const moduleEntrypoints = [
|
|||
'public/js/sickVisit.js',
|
||||
'public/js/soap.js',
|
||||
'public/js/secureStorage.js',
|
||||
'public/js/speechRecognition.js',
|
||||
'public/js/transcriptionSettings.js',
|
||||
'public/js/ui-state.js',
|
||||
'public/js/wellVisit.js',
|
||||
|
|
|
|||
Loading…
Reference in a new issue