:zap: [Enhance] screenshot right offset, and button padding
Browse files- components/buttons_binder.js +3 -1
- components/messager.js +4 -3
components/buttons_binder.js
CHANGED
@@ -210,12 +210,14 @@ class ScreenshotButtonBinder {
|
|
210 |
// default padding is 0.75em (12px)
|
211 |
// p-1 (4px)(0.25em); p-2 (8px)(0.5em); p-3 (16px)(1em);
|
212 |
let container_padding = 12;
|
|
|
213 |
html2canvas($("#messagers-container")[0], {
|
214 |
x: -(container_padding + screenshot_padding),
|
215 |
width:
|
216 |
$("#messagers-container").width() +
|
217 |
container_padding * 2 +
|
218 |
-
screenshot_padding * 2
|
|
|
219 |
}).then((canvas) => {
|
220 |
var link = document.createElement("a");
|
221 |
let date = new Date();
|
|
|
210 |
// default padding is 0.75em (12px)
|
211 |
// p-1 (4px)(0.25em); p-2 (8px)(0.5em); p-3 (16px)(1em);
|
212 |
let container_padding = 12;
|
213 |
+
let right_offset = 20;
|
214 |
html2canvas($("#messagers-container")[0], {
|
215 |
x: -(container_padding + screenshot_padding),
|
216 |
width:
|
217 |
$("#messagers-container").width() +
|
218 |
container_padding * 2 +
|
219 |
+
screenshot_padding * 2 +
|
220 |
+
right_offset,
|
221 |
}).then((canvas) => {
|
222 |
var link = document.createElement("a");
|
223 |
let date = new Date();
|
components/messager.js
CHANGED
@@ -43,9 +43,10 @@ class MessagerViewer {
|
|
43 |
.css("z-index", "1")
|
44 |
.css("padding", "auto");
|
45 |
|
|
|
46 |
if (this.message.role === "assistant") {
|
47 |
this.regenerate_button = $("<button>")
|
48 |
-
.addClass(
|
49 |
.addClass("regenerate-button")
|
50 |
.attr("title", "Regenerate")
|
51 |
.append($("<span>").addClass("fa fa-small fa-rotate"));
|
@@ -54,14 +55,14 @@ class MessagerViewer {
|
|
54 |
}
|
55 |
|
56 |
this.edit_button = $("<button>")
|
57 |
-
.addClass(
|
58 |
.addClass("edit-button")
|
59 |
.attr("title", "Edit")
|
60 |
.append($("<span>").addClass("fa fa-small fa-edit"));
|
61 |
this.button_group.append(this.edit_button);
|
62 |
|
63 |
this.copy_button = $("<button>")
|
64 |
-
.addClass(
|
65 |
.addClass("copy-button")
|
66 |
.attr("title", "Copy")
|
67 |
.append($("<span>").addClass("fa fa-small fa-copy"));
|
|
|
43 |
.css("z-index", "1")
|
44 |
.css("padding", "auto");
|
45 |
|
46 |
+
let btn_class = "btn pt-0 pl-3";
|
47 |
if (this.message.role === "assistant") {
|
48 |
this.regenerate_button = $("<button>")
|
49 |
+
.addClass(btn_class)
|
50 |
.addClass("regenerate-button")
|
51 |
.attr("title", "Regenerate")
|
52 |
.append($("<span>").addClass("fa fa-small fa-rotate"));
|
|
|
55 |
}
|
56 |
|
57 |
this.edit_button = $("<button>")
|
58 |
+
.addClass(btn_class)
|
59 |
.addClass("edit-button")
|
60 |
.attr("title", "Edit")
|
61 |
.append($("<span>").addClass("fa fa-small fa-edit"));
|
62 |
this.button_group.append(this.edit_button);
|
63 |
|
64 |
this.copy_button = $("<button>")
|
65 |
+
.addClass(btn_class)
|
66 |
.addClass("copy-button")
|
67 |
.attr("title", "Copy")
|
68 |
.append($("<span>").addClass("fa fa-small fa-copy"));
|