Refactor : chat shape display
Browse files- __pycache__/app.cpython-310.pyc +0 -0
- __pycache__/helper_functions.cpython-310.pyc +0 -0
- static/css/style2.css +86 -0
- static/js/sentence.js +13 -0
- static/uploads/pdfs.txt +0 -1
- templates/sentence.html +5 -5
__pycache__/app.cpython-310.pyc
CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
|
|
__pycache__/helper_functions.cpython-310.pyc
CHANGED
Binary files a/__pycache__/helper_functions.cpython-310.pyc and b/__pycache__/helper_functions.cpython-310.pyc differ
|
|
static/css/style2.css
CHANGED
@@ -7513,6 +7513,92 @@ textarea.form-control-lg {
|
|
7513 |
top: 100% !important;
|
7514 |
}
|
7515 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7516 |
|
7517 |
.bottom-0 {
|
7518 |
bottom: 0 !important;
|
|
|
7513 |
top: 100% !important;
|
7514 |
}
|
7515 |
|
7516 |
+
.top-sm-0 {
|
7517 |
+
top: 0 !important;
|
7518 |
+
}
|
7519 |
+
|
7520 |
+
.top-sm-10 {
|
7521 |
+
top: 10% !important;
|
7522 |
+
}
|
7523 |
+
|
7524 |
+
.top-sm-30 {
|
7525 |
+
top : 30% !important;
|
7526 |
+
}
|
7527 |
+
.top-sm-50 {
|
7528 |
+
top: 50% !important;
|
7529 |
+
}
|
7530 |
+
|
7531 |
+
.top-sm-100 {
|
7532 |
+
top: 100% !important;
|
7533 |
+
}
|
7534 |
+
|
7535 |
+
.top-md-0 {
|
7536 |
+
top: 0 !important;
|
7537 |
+
}
|
7538 |
+
|
7539 |
+
.top-md-10 {
|
7540 |
+
top: 10% !important;
|
7541 |
+
}
|
7542 |
+
|
7543 |
+
.top-md-30 {
|
7544 |
+
top : 30% !important;
|
7545 |
+
}
|
7546 |
+
.top-md-50 {
|
7547 |
+
top: 50% !important;
|
7548 |
+
}
|
7549 |
+
|
7550 |
+
.top-md-100 {
|
7551 |
+
top: 100% !important;
|
7552 |
+
}
|
7553 |
+
@media (min-width: 992px ) {
|
7554 |
+
@media(min-height : 600px) {
|
7555 |
+
.top-lg-0 {
|
7556 |
+
top: 0 !important;
|
7557 |
+
}
|
7558 |
+
}
|
7559 |
+
@media (min-height : 900px) {
|
7560 |
+
|
7561 |
+
.top-lg-10 {
|
7562 |
+
top: 10% !important;
|
7563 |
+
}
|
7564 |
+
|
7565 |
+
.top-lg-30 {
|
7566 |
+
top : 30% !important;
|
7567 |
+
}
|
7568 |
+
.top-lg-50 {
|
7569 |
+
top: 50% !important;
|
7570 |
+
}
|
7571 |
+
|
7572 |
+
.top-lg-100 {
|
7573 |
+
top: 100% !important;
|
7574 |
+
}
|
7575 |
+
}
|
7576 |
+
}
|
7577 |
+
|
7578 |
+
@media (min-width: 1200px) {
|
7579 |
+
|
7580 |
+
@media(min-height : 600px) {
|
7581 |
+
.top-lg-0 {
|
7582 |
+
top: 0% !important;
|
7583 |
+
}
|
7584 |
+
}
|
7585 |
+
@media(min-height : 600px) {
|
7586 |
+
.top-lg-0 {
|
7587 |
+
top: 30% !important;
|
7588 |
+
}
|
7589 |
+
}
|
7590 |
+
@media (min-height : 800px) {
|
7591 |
+
.top-xl-45 {
|
7592 |
+
top : 45% !important;
|
7593 |
+
}
|
7594 |
+
}
|
7595 |
+
}
|
7596 |
+
|
7597 |
+
@media(min-height : 992px) {
|
7598 |
+
.h-lg-100 {
|
7599 |
+
height: 100% !important;
|
7600 |
+
}
|
7601 |
+
}
|
7602 |
|
7603 |
.bottom-0 {
|
7604 |
bottom: 0 !important;
|
static/js/sentence.js
CHANGED
@@ -4,7 +4,20 @@ function generateUniqueId() {
|
|
4 |
}
|
5 |
|
6 |
function submitForm() {
|
|
|
|
|
7 |
var form = document.getElementById('sentenceForm');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
var formData = new FormData(form);
|
9 |
|
10 |
// Hide the presentation div
|
|
|
4 |
}
|
5 |
|
6 |
function submitForm() {
|
7 |
+
event.preventDefault(); // Prevent the default form submission
|
8 |
+
|
9 |
var form = document.getElementById('sentenceForm');
|
10 |
+
var textarea = document.getElementById("ocr-result");
|
11 |
+
|
12 |
+
// Check if the textarea is empty
|
13 |
+
if (textarea.value.trim() === "") {
|
14 |
+
textarea.setCustomValidity("Input is required."); // Set custom validation message
|
15 |
+
textarea.reportValidity(); // Display the validation message
|
16 |
+
return; // Do not proceed with form submission
|
17 |
+
} else {
|
18 |
+
textarea.setCustomValidity(""); // Clear any previous validation message
|
19 |
+
}
|
20 |
+
$
|
21 |
var formData = new FormData(form);
|
22 |
|
23 |
// Hide the presentation div
|
static/uploads/pdfs.txt
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
2304.00746v4.VGTS__Visually_Guided_Text_Spotting_for_Novel_Categories_in_Historical_Manuscripts.pdf
|
|
|
|
templates/sentence.html
CHANGED
@@ -72,7 +72,7 @@
|
|
72 |
style="overflow-y: scroll;">
|
73 |
<div class="os-content" style="padding: 0px; height: 100%; width: 100%;">
|
74 |
<!-- Chat message right -->
|
75 |
-
<div class="d-inline mb-1 align-content-between position-relative top-30" id = "presentation">
|
76 |
<div class="flex-grow-1 row">
|
77 |
<div class="w-100 col-1 text-center">
|
78 |
<div class="d-flex flex-column">
|
@@ -169,14 +169,14 @@
|
|
169 |
</div>
|
170 |
|
171 |
<div class="card-footer" style="background-color: #242525;">
|
172 |
-
<form class="d-flex align-items-center" action="/sentence" method="post" id="sentenceForm">
|
173 |
<textarea class="form-control mb-sm-0 mb-3" id="ocr-result" name="text" data-autoresize=""
|
174 |
placeholder="Type your text" rows="1" style="height: 50px;box-sizing: border-box;
|
175 |
-
|
176 |
-
<button class="btn btn-sm btn-sentence ms-2"><img class="avatar avatar-xs"
|
177 |
src="../static/icons/avignon_universite_blanc_RVB-1.png"></button>
|
178 |
</form>
|
179 |
-
</div>
|
180 |
</div>
|
181 |
<!-- Chat conversation END -->
|
182 |
</div> <!-- Row END -->
|
|
|
72 |
style="overflow-y: scroll;">
|
73 |
<div class="os-content" style="padding: 0px; height: 100%; width: 100%;">
|
74 |
<!-- Chat message right -->
|
75 |
+
<div class="d-inline mb-1 align-content-between position-relative top-xl-45 top-lg-0 top-lg-30" id = "presentation">
|
76 |
<div class="flex-grow-1 row">
|
77 |
<div class="w-100 col-1 text-center">
|
78 |
<div class="d-flex flex-column">
|
|
|
169 |
</div>
|
170 |
|
171 |
<div class="card-footer" style="background-color: #242525;">
|
172 |
+
<form class="d-flex align-items-center" action="/sentence" method="post" id="sentenceForm" onsubmit="submitForm(event)">
|
173 |
<textarea class="form-control mb-sm-0 mb-3" id="ocr-result" name="text" data-autoresize=""
|
174 |
placeholder="Type your text" rows="1" style="height: 50px;box-sizing: border-box;
|
175 |
+
resize: none; max-height: 120px;" onclick="addAutoResize()" onkeydown="handleEnter(event)" required></textarea>
|
176 |
+
<button class="btn btn-sm btn-sentence ms-2" type="submit"><img class="avatar avatar-xs"
|
177 |
src="../static/icons/avignon_universite_blanc_RVB-1.png"></button>
|
178 |
</form>
|
179 |
+
</div>
|
180 |
</div>
|
181 |
<!-- Chat conversation END -->
|
182 |
</div> <!-- Row END -->
|