00:00
Estamos gravando sua linda voz ...
/** ROLAGEM DO SCROLL ATÉ NO FINAL DO CHAT */ const scrollDown = () => { $(".chat-window").animate({scrollTop: 99999 * $(this).height() }, 1); } /** LIMPA O CONTEUDO DO MODAL */ const modalStart = () => { $('#footer-content-left').empty() $('#footer-content-right').empty() $('.modal-content-body').empty() $('.modal-header-title').empty() } /** INICIA COM O HEADER DO CONTATO VAZIO */ const startChannelMessage = () => { $('#typemessagebar').hide() $('#headerbuttonsagent').hide() $("#headermediaagent").hide() $('#chatwindowagent').css({ overflow: 'hidden' }) $('#uploadfiles').hide() } /** CARREGA OS ELEMENTOS DA SESSAO DA CONVERSA */ const startNotification = () => { $('#typemessagebar').show(); $('#headerbuttonsagent').show() $("#headermediaagent").show() $('#welcometomessage').hide() $('#chatwindowagent').css({ overflow: 'scroll' }) } const removeMensagemBody = () => { $('.chat-window .sender').remove() $('.chat-window .receiver').remove() $('.chat-window .events').remove() } const hideButtons = (type) => { if(type){ $('#voicerecorder').css({'pointer-events': 'none'}) $('#imgclip').css({'pointer-events': 'none'}) $('#fieldsendmessage').css({'pointer-events': 'none'}) $('#fieldsendmessage').hide() $('#tranferagent').hide() $('#finalizaratendimento').hide() } else { $('#voicerecorder').css({'pointer-events': 'auto'}) $('#imgclip').css({'pointer-events': 'auto'}) $('#fieldsendmessage').css({'pointer-events': 'auto'}) $('#fieldsendmessage').show() $('#tranferagent').show() $('#finalizaratendimento').show() } } const alertModal = (title, message) => { modalStart() $(this).css({'align-items': 'center'}) $('.modal-content-body').append(() => title ); $('.modal-header-title').append(`${message}`) $('#modalselect').show() } /** * HABILITA O ENVIO DE ARQUIVO DE IMAGENS E APRESENTA UMA MODAL PARA APRESENTAÇÃO DA IMAGEM SELECIONADA */ const startSendImage = () => { modalStart() $("#uploadimage").on('change', function(){ const file = new FileReader(); file.readAsDataURL(this.files[0]); const imgName = this.files[0].name file.onload = function(e) { $('#myImg').remove() $('#footername').remove() $('#footersend').remove() $('.modal-content-body').append(``) $('#footer-content-left').append(``) $('#footer-content-right').append(``) } $('#modalselect').show() }) } const startSendFile = () => { modalStart() $("#uploadfile").on('change', function(){ const file = new FileReader(); file.readAsDataURL(this.files[0]); const filename = this.files[0].name const typefile = this.files[0].name.split('.')[1] $('#myImg').remove() icontypes.forEach(e => { if(typefile.indexOf(e) >= 0){ $('.modal-content-body').append(``) return } }) if(!$('#myImg')[0]){ $('.modal-content-body').append(``) } file.onload = function(e) { $('#footername').remove() $('#footersend').remove() $('#footer-content-left').append(``) $('#footer-content-right').append(``) } $('#modalselect').show() }) } const startPause = () => { $("#entrePause").on('click', function(){ listarPausasAgente(localStorage.getItem('my_uniqueid')).then((pausas) => { modalStart() $("#modalselect").show() $('.modal-content-body').append(() => { let selectPause = '' pausas.data.forEach(e => { if(e.matricula != localStorage.getItem('my_uniqueid')){ selectPause += `` } }) if(selectPause.length > 0){ selectPause = `` } else { selectPause = '