Izza-shahzad-13 commited on
Commit
5370651
·
verified ·
1 Parent(s): 93e9b9e

Update FYP RAG/summerization-app/templates/mainscreen.html

Browse files
FYP RAG/summerization-app/templates/mainscreen.html CHANGED
@@ -917,7 +917,7 @@ textarea {
917
 
918
 
919
  <!-- Submit Button -->
920
- <button type="submit" class="submit-btn hidden">Summarize</button>
921
  </form>
922
  </div>
923
 
@@ -980,13 +980,13 @@ textarea {
980
  <div class="footer-logo">
981
  <div class="footer-logo-container">
982
  <img src="{{ url_for('static', filename='logo.png') }}" alt="Lawsumm logo">
983
- <h2>LawSumm</h2>
984
  </div>
985
  <div class="social-icons">
986
  <a href="#"><i class="fa-brands fa-twitter"></i></a>
987
- <a href="#"><i class="fa-brands fa-linkedin"></i></a>
988
- <a href="#"><i class="fa-brands fa-youtube"></i></a>
989
- <a href="#"><i class="fa-brands fa-discord"></i></a>
990
  </div>
991
  </div>
992
 
@@ -1203,15 +1203,18 @@ document.addEventListener("DOMContentLoaded", function () {
1203
  });
1204
 
1205
  // Send message function
1206
- // Send message function
1207
- function sendMessage() {
1208
  const userText = userInput.value.trim();
1209
  if (!userText) return;
1210
 
1211
  appendMessage(userText, "user");
1212
  userInput.value = "";
1213
 
1214
-
 
 
 
 
1215
  .then(res => res.json())
1216
  .then(data => {
1217
  const botReply = data.response || "No response received.";
@@ -1279,23 +1282,7 @@ function loadChatHistory() {
1279
  loadChatHistory();
1280
  });
1281
 
1282
- document.getElementById("submitBtn").addEventListener("click", async () => {
1283
- const fileInput = document.getElementById("fileInput");
1284
- const summaryDiv = document.getElementById("summary");
1285
-
1286
- if (fileInput.files.length === 0) {
1287
- alert("Please select a file first.");
1288
- return;
1289
- }
1290
-
1291
- const file = fileInput.files[0];
1292
- const formData = new FormData();
1293
- formData.append("file", file);
1294
-
1295
- summaryDiv.textContent = "Processing...";
1296
-
1297
 
1298
- });
1299
 
1300
  </script>
1301
  </html>
 
917
 
918
 
919
  <!-- Submit Button -->
920
+ <button type="submit" class="submit-btn hidden">Summarize</button>
921
  </form>
922
  </div>
923
 
 
980
  <div class="footer-logo">
981
  <div class="footer-logo-container">
982
  <img src="{{ url_for('static', filename='logo.png') }}" alt="Lawsumm logo">
983
+ <h2>LawSumm</ah2>
984
  </div>
985
  <div class="social-icons">
986
  <a href="#"><i class="fa-brands fa-twitter"></i></a>
987
+ <a href="https://www.linkedin.com/company/lawsumm/?viewAsMember=true"><i class="fa-brands fa-linkedin"></i></a>
988
+ <a href="https://www.youtube.com/watch?v=78KjuKYiF6s"><i class="fa-brands fa-youtube"></i></a>
989
+ <a href="#"><i class="fa-brands fa-facebook-f"></i></a>
990
  </div>
991
  </div>
992
 
 
1203
  });
1204
 
1205
  // Send message function
1206
+ function sendMessage() {
 
1207
  const userText = userInput.value.trim();
1208
  if (!userText) return;
1209
 
1210
  appendMessage(userText, "user");
1211
  userInput.value = "";
1212
 
1213
+ fetch("/ask", {
1214
+ method: "POST",
1215
+ headers: { "Content-Type": "application/json" },
1216
+ body: JSON.stringify({ query: userText })
1217
+ })
1218
  .then(res => res.json())
1219
  .then(data => {
1220
  const botReply = data.response || "No response received.";
 
1282
  loadChatHistory();
1283
  });
1284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1285
 
 
1286
 
1287
  </script>
1288
  </html>