Browse Source

retirando logs

guilherme
Guilherme Guia 1 year ago
parent
commit
6af4ac0ae4
  1. 9
      public/js/main.js
  2. 50
      public/js/util.js

9
public/js/main.js

@ -27,7 +27,6 @@ $(function () {
filaNotifications();
});
$("#recuperaratendimento").on("click", () => {
recuperarAtendimento(
localStorage.getItem("session_uniqueid"),
@ -35,9 +34,6 @@ $(function () {
);
});
$("#btnAtendimento").on("click", () => {
notifications();
});
@ -48,13 +44,11 @@ $(function () {
// removeMensagemBody();
});
$("#uploadimage").on("change", function () {
startSendImage(this.files);
});
/** FIM VOICE RECORDER */
/** EVENTOS DE CLICK NO BODY */
$("body").mouseup(function () {
@ -73,7 +67,6 @@ $(function () {
exitSystem();
startFooter();
/**
* HABILITA O ENVIO DE MIDIAS CTRL+V
*/
@ -104,7 +97,6 @@ $(function () {
}
})
/** INICIA COM O HEADER DO CONTATO VAZIO */
startChannelMessage();
/** INICIA O CHAT NO FINAL DA CONVERSA */
@ -162,7 +154,6 @@ $(function () {
* @param {*} id
*/
const selectNotification = (id, status, datetime) => {
marcarMensagemVista(id);
listaMensagem(id).then(async () => {

50
public/js/util.js

@ -87,20 +87,11 @@ const hideButtons = (type) => {
$("#voicerecorder").css({ "pointer-events": "none" });
$("#imgclip").css({ "pointer-events": "none" });
$("#fieldsendmessage").css({ "pointer-events": "none" });
// $("#fieldsendmessage").css('opacity', '0');
$("#fieldsendmessage").hide();
$("#tranferagent").hide();
$("#finalizaratendimento").hide();
// $(".chat-window-header-right").hide();
// $("#recuperaratendimento").show();
$(".chat-window-header-right").css('bottom', '-50px');
// $("#chat-window-header-right-icon").hide();
// $(".responsive-icon-header").hide();
} else {
$("#voicerecorder").css({ "pointer-events": "auto" });
$("#imgclip").css({ "pointer-events": "auto" });
@ -126,18 +117,6 @@ const alertModal = (title, message) => {
$("#modalselect").show();
};
/**
* LOG
*/
const log = (message) => {
console.log(message);
}
/**
* HABILITA O ENVIO DE ARQUIVO DE IMAGENS E APRESENTA UMA MODAL PARA APRESENTACAO DA IMAGEM SELECIONADA
*/
@ -166,10 +145,7 @@ const startSendImage = (file) => {
$("#modalselect").show();
}
const startSendImagePrintScreen = (file) => {
modalStart();
const fileReader = new FileReader();
fileReader.readAsDataURL(file);
@ -192,8 +168,6 @@ const startSendImagePrintScreen = (file) => {
$("#modalselect").show();
}
/**
* GERENCIA A RESPONSIVIDADE DO LAYOUT
*/
@ -645,6 +619,7 @@ const buildNotificationFila = (data = {}) => {
</div>
</div>`;
};
const alertNotification = (uniqueid, type = "add") => {
$("#" + uniqueid.replace(".", `\\.`) + " .chat-right-bottom-right").empty();
if (type != "remove") {
@ -660,10 +635,12 @@ const alertNotification = (uniqueid, type = "add") => {
});
}
};
function soundNotification(url) {
const audio = new Audio(url);
audio.play();
}
const notifyMe = (title, content) => {
if (!("Notification" in window)) {
console.log("This browser does not support desktop notification");
@ -796,32 +773,20 @@ const filaNotifications = (obj = {}) => {
);
};
const monitoraStatusTransferenciaAtendimento = (date) => {
let formatedTransferDate = date.slice(0, date.lastIndexOf(':'));
const data_atual = new Date();
let formatedDate = formatDate(data_atual, 'Y-m-d hh:M')
const start = new Date(formatedTransferDate);
const end = new Date(formatedDate);
const diffInTime = Math.abs(end - start) / 1000 / 60 / 60
log(diffInTime)
if(diffInTime > RecuperacaoAtendimentoLimite){
return;
}
$("#recuperaratendimento").show();
}
const formatDate = (date, format) => {
const map = {
m: String(date.getMonth()+1).padStart(2,'0'),
@ -835,14 +800,8 @@ const formatDate = (date, format) => {
}
return(format.replace(/m|d|y|Y|hh|M|ss|ll/gi, matched => map[matched]))
}
const monitorPausaAgente = () => {
statusAgente(
localStorage.getItem("my_uniqueid")
@ -903,7 +862,6 @@ const supervisorAgente = () => {
}, 30000);
};
/** CONNECT TO WS */
const connect = (wsserver) => {
const ws = new WebSocket(wsserver);

Loading…
Cancel
Save