Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tutor-shot-extension
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramdayal Munda
tutor-shot-extension
Commits
e7571e72
Commit
e7571e72
authored
Nov 11, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pause added
parent
ab33596e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
7 deletions
+34
-7
background.js
background.js
+22
-0
content.js
content.js
+12
-7
No files found.
background.js
View file @
e7571e72
...
...
@@ -58,6 +58,28 @@ var getUserDetails = null
sendMessageToActiveTab
(
"recordingStarted"
)
return
}
if
(
loggedIn
&&
request
.
action
===
'pauseRecording'
)
{
recording
=
false
;
sendResponse
({
userDetails
,
loggedIn
,
recording
,
status
:
tutorShotId
?(
recording
?
"recording"
:
"paused"
):
"stopped"
});
sendMessageToActiveTab
(
"recordingPaused"
)
return
}
if
(
loggedIn
&&
request
.
action
===
'resumeRecording'
)
{
recording
=
true
;
sendResponse
({
userDetails
,
loggedIn
,
recording
,
status
:
tutorShotId
?(
recording
?
"recording"
:
"paused"
):
"stopped"
});
sendMessageToActiveTab
(
"recordingPaused"
)
return
}
if
(
loggedIn
&&
request
.
action
===
'stopRecording'
)
{
recording
=
false
;
tutorShotId
=
null
...
...
content.js
View file @
e7571e72
...
...
@@ -86,6 +86,8 @@ var btn = {}
align-items: center;
overflow: hidden;
width: 420px;
margin-left: 5px;
margin-right: 5px;
}
.tutor-shot .content .item {
...
...
@@ -123,7 +125,7 @@ var btn = {}
<div class="content">
<div class="item" tutor-shot="play-btn">
<img class="img" src="
${
origin
}
/assets/icons/play.svg" width="20">
<span class="item-text" tutor-shot="play-text">
CONTINU
E</span>
<span class="item-text" tutor-shot="play-text">
RESUM
E</span>
</div>
<div class="item" tutor-shot="pause-btn">
<img class="img" src="
${
origin
}
/assets/icons/pause.svg" width="20">
...
...
@@ -191,11 +193,11 @@ function reRenderFloatingBar(data) {
}
if
(
!
btn
.
play
){
btn
.
play
=
document
.
querySelector
(
'[tutor-shot="play-btn"]'
)
btn
.
play
.
addEventListener
(
'click'
,
start
Recording
)
btn
.
play
.
addEventListener
(
'click'
,
resume
Recording
)
}
if
(
!
btn
.
capture
){
btn
.
capture
=
document
.
querySelector
(
'[tutor-shot="capture-btn"]'
)
btn
.
capture
.
addEventListener
(
'click'
,
startRecording
)
console
.
log
(
'take screen shot'
)
}
if
(
!
btn
.
playText
)
btn
.
playText
=
document
.
querySelector
(
'[tutor-shot="play-text"]'
)
if
(
!
btn
.
pause
){
...
...
@@ -204,7 +206,7 @@ function reRenderFloatingBar(data) {
}
if
(
!
btn
.
stop
){
btn
.
stop
=
document
.
querySelector
(
'[tutor-shot="stop-btn"]'
)
btn
.
stop
.
addEventListener
(
'cli
kc
'
,
stopRecording
)
btn
.
stop
.
addEventListener
(
'cli
ck
'
,
stopRecording
)
}
if
(
!
btn
.
restart
){
btn
.
restart
=
document
.
querySelector
(
'[tutor-shot="restart-btn"]'
)
...
...
@@ -224,7 +226,6 @@ function reRenderFloatingBar(data) {
btn
.
stop
.
style
.
display
=
'flex'
btn
.
restart
.
style
.
display
=
'flex'
btn
.
capture
.
style
.
display
=
'flex'
btn
.
playText
.
innerHTML
=
'CONTINUE'
}
else
if
(
data
?.
status
==
'recording'
)
{
btn
.
play
.
style
.
display
=
'none'
...
...
@@ -239,7 +240,6 @@ function reRenderFloatingBar(data) {
btn
.
stop
.
style
.
display
=
'none'
btn
.
capture
.
style
.
display
=
'none'
btn
.
restart
.
style
.
display
=
'none'
btn
.
playText
.
innerHTML
=
'START'
}
// floatingBar.innerHTML = innerHTML
}
...
...
@@ -318,10 +318,15 @@ async function startRecording() {
async
function
pauseRecording
(){
console
.
log
(
'to pause recording'
)
await
chrome
.
runtime
.
sendMessage
({
action
:
"pauseRecording"
})
}
async
function
resumeRecording
(){
await
chrome
.
runtime
.
sendMessage
({
action
:
"resumeRecording"
})
}
async
function
stopRecording
(){
console
.
log
(
'to stop recocrding'
)
console
.
log
(
'stop recording'
)
await
chrome
.
runtime
.
sendMessage
({
action
:
"stopRecording"
})
}
async
function
restartRecording
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment