File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
$ ( document ) . ready ( function ( ) {
2
2
const apiUrl = `${ window . origin } /api/chat` ; // Replace with your API URL
3
- const converter = new showdown . Converter ( ) ;
4
3
5
4
function sendUserMessage ( ) {
6
5
const userMessage = $ ( '#user-message' ) . val ( ) ;
@@ -9,7 +8,6 @@ $(document).ready(function() {
9
8
// Append user message to the chat
10
9
$ ( '#chat-container' ) . append ( `<div class="alert alert-warning"><strong>You:</strong> ${ userMessage } </div>` ) ;
11
10
var el = $ ( `<div class="alert alert-success"></div>` ) . appendTo ( '#chat-container' ) ;
12
- console . log ( el ) ;
13
11
14
12
// Call API and process the response
15
13
callApi ( userMessage , el ) . catch ( error => {
Original file line number Diff line number Diff line change 5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
6
< title > Chatbot</ title >
7
7
< link rel ="stylesheet " href ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css ">
8
+ < link rel ="
stylesheet "
href ="
https://cdn.jsdelivr.net/npm/[email protected] /font/bootstrap-icons.css "
>
8
9
< script src ="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js "> </ script >
9
- < script src ="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js "> </ script >
10
10
< script src ="/app.js "> </ script >
11
11
< style >
12
12
# chat-container {
24
24
</ style >
25
25
</ head >
26
26
< body >
27
- < div id ="chat-container " class ="container ">
27
+ < div id ="chat-container " class ="container-fluid ">
28
28
29
29
< div class ="input-group ">
30
30
< input type ="text " id ="user-message " class ="form-control " placeholder ="Type your message here... ">
31
31
< span class ="input-group-btn ">
32
- < button class ="btn btn-primary " id ="send-message " type ="button "> Send </ button >
32
+ < button class ="btn btn-primary " id ="send-message " type ="button "> < i class =" bi bi-chat-dots " > </ i > </ button >
33
33
</ span >
34
34
</ div >
35
35
</ div >
You can’t perform that action at this time.
0 commit comments