Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
8e616d2e
authored
2024-01-11 20:18:25 +0800
by
Jonille Arreglo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
29047_export_pdf
1 parent
4ab6686e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
client/src/ExportButton.jsx
client/src/ExportButton.jsx
View file @
8e616d2
...
...
@@ -6,9 +6,25 @@ export default function ExportButton({
})
{
const
responseToExport
=
()
=>
{
const
response_to_export
=
document
.
querySelector
(
".response-to-export"
);
if
(
!
response_to_export
)
return
;
return
response_to_export
?.
innerHTML
??
""
;
};
if
(
response_to_export
)
{
let
response
=
''
;
for
(
var
i
=
0
;
i
<
response_to_export
.
children
.
length
;
i
++
)
{
if
(
!
response_to_export
.
children
[
i
].
querySelector
(
".message"
))
continue
;
let
img_url
=
window
.
location
.
origin
+
"/assets/images/"
;
let
msg
=
"<div style='float: left; margin-left: 10px; padding-top: 5px; margin-bottom: 5px;'>"
+
response_to_export
.
children
[
i
].
querySelector
(
".message"
).
innerHTML
+
"</div>"
;
if
(
response_to_export
.
children
[
i
].
classList
.
contains
(
"chatgpt"
))
{
let
profile
=
"<div style='width: 36px; height: 36px; background: #4c66ef; border-radius: 5px; float: left;'><img style='width: 24px; height: 24px; margin-top: 6px; margin-left: 6px;' src='"
+
img_url
+
"bot.png'></div>"
;
response
=
response
+
"<div style='background: #ddf1f9; padding: 5px'>"
+
profile
+
msg
+
"</div>"
;
}
else
{
let
profile
=
"<div style='width: 36px; height: 36px; background: #6BA447; border-radius: 5px; float: left;'><img style='width: 24px; height: 24px; margin-top: 6px; margin-left: 6px;' src='"
+
img_url
+
"user.png'></div>"
;
response
=
response
+
"<div style='padding: 5px'>"
+
profile
+
msg
+
"</div>"
;
}
}
return
response
;
}
}
const
generatePDF
=
window
.
generatePDF
;
const
onClickExportToPDF
=
()
=>
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment