Skip to content

Commit 6339fde

Browse files
committed
Cleanup.
1 parent 1afd2c0 commit 6339fde

File tree

6 files changed

+41
-13
lines changed

6 files changed

+41
-13
lines changed

demo/bb.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
font-family: "Inter", sans-serif;
171171
border-radius: 21px;
172172
box-sizing: border-box;
173-
padding: 8px 15px;
173+
padding: 8px 12px;
174174
width: auto;
175175
margin-top: 5px;
176176
margin-right: 8px;
@@ -1614,6 +1614,10 @@ textarea.bb-feedback-required {
16141614
background-color: rgba(0, 0, 0, 0.5);
16151615
}
16161616

1617+
.bb-capture-editor-recording .bb-capture-dismiss {
1618+
display: none;
1619+
}
1620+
16171621
.bb-capture-editor-item-inactive {
16181622
opacity: 0.3;
16191623
cursor: not-allowed !important;
@@ -1762,7 +1766,7 @@ textarea.bb-feedback-required {
17621766
.bb-capture-preview-buttons {
17631767
display: flex;
17641768
justify-content: space-between;
1765-
padding: 16px;
1769+
padding: 14px;
17661770
}
17671771

17681772
.bb-capture-preview-retrybutton {

src/FeedbackForm.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,13 +660,21 @@ export const hookForm = function (formOptions, submitForm, overrideLanguage) {
660660
manager.clear();
661661
captureItemsContainer.style.display = "flex";
662662
selectedItem.style.display = "none";
663-
664-
// asdf
665663
};
666664
}
667665
});
668666
};
669667
}
668+
669+
// Wire autostart.
670+
if (formItem.autostartDrawing) {
671+
const captureButton = document.querySelector(
672+
'.bb-feedback-capture-item[data-type="screenshot"]'
673+
);
674+
if (captureButton) {
675+
captureButton.click();
676+
}
677+
}
670678
}
671679
if (formItem.type === "upload") {
672680
const formFileUploadInput = document.querySelector(

src/Gleap.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class Gleap {
5151
widgetCallback = null;
5252
overrideLanguage = "";
5353
screenshot = null;
54+
autostartDrawing = false;
5455
actionLog = [];
5556
logArray = [];
5657
customData = {};
@@ -959,6 +960,7 @@ class Gleap {
959960
name: "capture",
960961
type: "capture",
961962
enableScreenshot: true,
963+
autostartDrawing: instance.autostartDrawing,
962964
enableCapture: feedbackOptions.enableUserScreenRecording
963965
? true
964966
: false,
@@ -996,6 +998,10 @@ class Gleap {
996998
}
997999
}
9981000

1001+
// Disable autostart drawing for the next call.
1002+
instance.autostartDrawing = false;
1003+
1004+
// Stop bug analytics.
9991005
instance.stopBugReportingAnalytics();
10001006

10011007
if (instance.silentBugReport) {
@@ -1376,6 +1382,7 @@ class Gleap {
13761382
(char === "i" || char === "I" || char === 73) &&
13771383
self.shortcutsEnabled
13781384
) {
1385+
self.autostartDrawing = true;
13791386
Gleap.startFeedbackFlow();
13801387
}
13811388
};

src/MarkerManager.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export default class MarkerManager {
3636
ScrollStopper.enableScroll();
3737
}
3838

39+
// Stop screenrecording.
40+
if (this.screenRecorder) {
41+
this.screenRecorder.stopScreenRecording();
42+
}
43+
3944
// Unregister ESC listener
4045
this.unregisterListeners();
4146

src/ScreenRecorder.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,14 @@ export class ScreenRecorder {
203203
type: "video/mp4",
204204
});
205205

206-
document.querySelector(".bb-capture-preview video").src =
207-
URL.createObjectURL(completeBlob);
208-
209-
this.audioAvailable = true;
210-
this.isRecording = false;
211-
this.rerender();
206+
const previewVideoElement = document.querySelector(
207+
".bb-capture-preview video"
208+
);
209+
if (previewVideoElement) {
210+
previewVideoElement.src = URL.createObjectURL(completeBlob);
211+
this.audioAvailable = true;
212+
this.isRecording = false;
213+
this.rerender();
214+
}
212215
};
213216
}

src/UI.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ export const injectStyledCSS = (
7171
.bb-capture-preview-retrybutton {
7272
color: ${contrastBackgroundColor};
7373
border-radius: ${buttonBorderRadius}px;
74+
background-color: ${backgroundColorHover};
75+
}
76+
.bb-capture-preview-retrybutton:hover {
77+
background-color: ${hoverHoverColor};
7478
}
7579
.bb-feedback-dialog-success svg {
7680
box-shadow: inset 0px 0px 0px ${primaryColor};
@@ -84,9 +88,6 @@ export const injectStyledCSS = (
8488
.bb-feedback-dialog-success svg circle {
8589
stroke: ${primaryColor};
8690
}
87-
.bb-capture-preview-retrybutton:hover {
88-
background-color: ${backgroundColorHover};
89-
}
9091
.bb-capture-dismiss {
9192
background-color: ${primaryColor};
9293
border-bottom-left-radius: ${formItemSmallBorderRadius}px;

0 commit comments

Comments
 (0)