Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var cachedCalls = []
- function updateCalls(calls) {
- if (calls.length === 1) {
- setCall(calls[0])
- updateInterval = setInterval(function() { nextNews() }, 10000);
- } else {
- clearInterval(updateInterval)
- setCall(calls.pop())
- setTimeout(updateCalls(calls),3000)
- }
- }
- function setCall(call) {
- cachedCalls.append(call)
- for (var call, index in cachedCalls) {
- if (index > 3) {
- cachedCalls.length = 4;
- break;
- }
- if (index === 0) {
- $('#nome' + index).html(call.nomePaciente)
- $('#sala' + index).html(call.idSala)
- $('#nome' + index).addClass('hurry')
- $('#sala' + index).addClass('hurry')
- $('#medico').html(call.nomeMedico)
- $('#especialidade').html(call.especialidade)
- playAudioCall(call.nomePaciente, call.idSala)
- } else {
- $('#nome' + index).removeClass('hurry')
- $('#sala' + index).removeClass('hurry')
- }
- }
- }
- function playAudioCall (nome, sala) {
- utter.text = nome + "Sala" + sala;
- utter.voice = english_voice;
- window.speechSynthesis.speak(utter);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement