Spaces:
Runtime error
Runtime error
Miguel Diaz commited on
Commit ·
ec30a97
1
Parent(s): 422e4a7
fix: statics
Browse files- static/js/chatHandler.js +0 -1
- static/js/windowHandler.js +19 -12
static/js/chatHandler.js
CHANGED
|
@@ -89,7 +89,6 @@ class ChatGPT{
|
|
| 89 |
.fail(( jqXHR, status, error ) => {
|
| 90 |
console.log("enviado fallido")
|
| 91 |
console.log(jqXHR)
|
| 92 |
-
console.log(jqXHR.responseJSON.detail)
|
| 93 |
console.log(status)
|
| 94 |
console.log(error)
|
| 95 |
let execTime = performance.now() - this.execStart;
|
|
|
|
| 89 |
.fail(( jqXHR, status, error ) => {
|
| 90 |
console.log("enviado fallido")
|
| 91 |
console.log(jqXHR)
|
|
|
|
| 92 |
console.log(status)
|
| 93 |
console.log(error)
|
| 94 |
let execTime = performance.now() - this.execStart;
|
static/js/windowHandler.js
CHANGED
|
@@ -64,25 +64,32 @@ class WindowHandler{
|
|
| 64 |
let clone = this.template.clone();
|
| 65 |
if(role=="user"){
|
| 66 |
clone.addClass("me");
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
if($(".precarga").length){
|
| 70 |
-
clone = $(".precarga")
|
| 71 |
-
clone.removeClass("precarga")
|
| 72 |
-
}
|
| 73 |
-
if(clone.hasClass("me")){
|
| 74 |
clone.find("div p").text(mensaje);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
}else{
|
| 76 |
clone.find("div p").html(mensaje);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
}
|
| 78 |
-
if(clone.find("div p").html().includes("<pre><code")){
|
| 79 |
-
Prism.highlightAllUnder(clone);
|
| 80 |
-
}
|
| 81 |
-
this.chatbox.append(clone);
|
| 82 |
-
this.chatbox.scrollTop(this.chatbox[0].scrollHeight);
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
$("button").prop("disabled", false);
|
| 85 |
$("textarea").prop("disabled", false);
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
precargaMensaje(mensaje, role){
|
|
|
|
| 64 |
let clone = this.template.clone();
|
| 65 |
if(role=="user"){
|
| 66 |
clone.addClass("me");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
clone.find("div p").text(mensaje);
|
| 68 |
+
this.chatbox.append(clone);
|
| 69 |
+
this.chatbox.scrollTop(this.chatbox[0].scrollHeight);
|
| 70 |
+
$("button").prop("disabled", false);
|
| 71 |
+
$("textarea").prop("disabled", false);
|
| 72 |
+
return;
|
| 73 |
}else{
|
| 74 |
clone.find("div p").html(mensaje);
|
| 75 |
+
|
| 76 |
+
if($(".precarga").length){
|
| 77 |
+
Prism.highlightAllUnder(".precarga");
|
| 78 |
+
clone = $(".precarga")
|
| 79 |
+
clone.removeClass("precarga")
|
| 80 |
+
}else{
|
| 81 |
+
this.chatbox.append(clone);
|
| 82 |
+
}
|
| 83 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
this.chatbox.scrollTop(this.chatbox[0].scrollHeight);
|
| 90 |
$("button").prop("disabled", false);
|
| 91 |
$("textarea").prop("disabled", false);
|
| 92 |
+
|
| 93 |
}
|
| 94 |
|
| 95 |
precargaMensaje(mensaje, role){
|