Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
🔧 Add integrity checks to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary-H9 committed Jul 22, 2024
1 parent 589e1c6 commit 7a494d0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions templates/includes/conversation.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</form>
</div>

<script src="https://cdn.jsdelivr.net/npm/showdown@1.9.1/dist/showdown.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/showdown@2.1.0/dist/showdown.min.js" integrity="sha384-GP2+CwBlakZSDJUr+E4JvbxpM75i1i8+RKkieQxzuyDZLG+5105E1OfHIjzcXyWH" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha384-1H217gwSVyLSIfaLxHbE7dRb3v4mYCKbpQvzx0cegeju1MVsGrX5xXxAvs/HgeFs" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/highlight.min.js" integrity="sha384-GdEWAbCjn+ghjX0gLx7/N1hyTVmPAjdC2OvoAA0RyNcAOhqwtT8qnbCxWle2+uJX" crossorigin="anonymous"></script>

<script>
$(document).ready(function() {
Expand All @@ -39,7 +39,8 @@

conversationHistory.push({"role": "user", "content": userInput, "time": currentTime});

var newMessage = '<div class="moj-message-item moj-message-item--sent"><div class="moj-message-item__text moj-message-item__text--sent">' + userInput + '</div><div class="moj-message-item__meta"><span class="moj-message-item__meta--sender">You</span> at <time class="moj-message-item__meta--timestamp" datetime="' + currentTime + '">' + currentTime + '</time></div></div>';
var newMessage = $('<div class="moj-message-item moj-message-item--sent"><div class="moj-message-item__text moj-message-item__text--sent"></div><div class="moj-message-item__meta"><span class="moj-message-item__meta--sender">You</span> at <time class="moj-message-item__meta--timestamp" datetime="' + currentTime + '">' + currentTime + '</time></div></div>');
newMessage.find('.moj-message-item__text--sent').text(userInput);
$('#messages .moj-message-list').append(newMessage);

// Create a temporary message with a single dot
Expand Down

0 comments on commit 7a494d0

Please sign in to comment.