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
ab33596e
Commit
ab33596e
authored
Nov 11, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
half done
parent
886894b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
5 deletions
+47
-5
background.js
background.js
+3
-2
content.js
content.js
+44
-3
No files found.
background.js
View file @
ab33596e
...
@@ -122,7 +122,8 @@ var getUserDetails = null
...
@@ -122,7 +122,8 @@ var getUserDetails = null
function
sendMessageToActiveTab
(
messageObj
){
function
sendMessageToActiveTab
(
messageObj
){
try
{
try
{
chrome
.
tabs
.
query
({
active
:
true
,
currentWindow
:
true
},
function
(
tabs
)
{
chrome
.
tabs
.
query
({
active
:
true
,
currentWindow
:
true
},
function
(
tabs
)
{
if
(
tabs
&&
tabs
.
length
&&
tabs
[
0
].
url
.
slice
(
0
,
6
)
!=
'chrome'
)
{
// if any tab is active
let
activeTab
=
tabs
[
0
]
if
(
activeTab
?.
url
?.
slice
(
0
,
6
)
!=
'chrome'
)
{
// if any tab is active
let
message
=
{
let
message
=
{
userDetails
,
userDetails
,
tutorShotOid
:
tutorShotId
,
tutorShotOid
:
tutorShotId
,
...
@@ -131,7 +132,7 @@ var getUserDetails = null
...
@@ -131,7 +132,7 @@ var getUserDetails = null
message
:
messageObj
message
:
messageObj
}
}
console
.
log
(
'sending message:'
,
message
)
console
.
log
(
'sending message:'
,
message
)
chrome
.
tabs
.
sendMessage
(
tabs
[
0
]
.
id
,
message
);
chrome
.
tabs
.
sendMessage
(
activeTab
.
id
,
message
);
}
}
})
})
}
catch
(
err
){
}
catch
(
err
){
...
...
content.js
View file @
ab33596e
...
@@ -104,6 +104,7 @@ var btn = {}
...
@@ -104,6 +104,7 @@ var btn = {}
.tutor-shot .content .item .item-text {
.tutor-shot .content .item .item-text {
all: unset;
all: unset;
padding-top: 2px;
}
}
`
`
...
@@ -180,14 +181,35 @@ async function getCaptureData() {
...
@@ -180,14 +181,35 @@ async function getCaptureData() {
function
reRenderFloatingBar
(
data
)
{
function
reRenderFloatingBar
(
data
)
{
console
.
log
(
'reRenderFloatingBar'
,
data
)
console
.
log
(
'reRenderFloatingBar'
,
data
)
if
(
data
){
if
(
data
.
status
==
'stopped'
){
floatingBar
.
remove
()
return
}
else
if
(
!
document
.
body
.
contains
(
floatingBar
)){
document
.
body
.
append
(
floatingBar
)
}
}
if
(
!
btn
.
play
){
if
(
!
btn
.
play
){
btn
.
play
=
document
.
querySelector
(
'[tutor-shot="play-btn"]'
)
btn
.
play
=
document
.
querySelector
(
'[tutor-shot="play-btn"]'
)
btn
.
play
.
addEventListener
(
'click'
,
startRecording
)
btn
.
play
.
addEventListener
(
'click'
,
startRecording
)
}
}
if
(
!
btn
.
capture
){
btn
.
capture
=
document
.
querySelector
(
'[tutor-shot="capture-btn"]'
)
btn
.
capture
.
addEventListener
(
'click'
,
startRecording
)
}
if
(
!
btn
.
playText
)
btn
.
playText
=
document
.
querySelector
(
'[tutor-shot="play-text"]'
)
if
(
!
btn
.
playText
)
btn
.
playText
=
document
.
querySelector
(
'[tutor-shot="play-text"]'
)
if
(
!
btn
.
pause
)
btn
.
pause
=
document
.
querySelector
(
'[tutor-shot="pause-btn"]'
)
if
(
!
btn
.
pause
){
if
(
!
btn
.
stop
)
btn
.
stop
=
document
.
querySelector
(
'[tutor-shot="stop-btn"]'
)
btn
.
pause
=
document
.
querySelector
(
'[tutor-shot="pause-btn"]'
)
if
(
!
btn
.
restart
)
btn
.
restart
=
document
.
querySelector
(
'[tutor-shot="restart-btn"]'
)
btn
.
pause
.
addEventListener
(
'click'
,
pauseRecording
)
}
if
(
!
btn
.
stop
){
btn
.
stop
=
document
.
querySelector
(
'[tutor-shot="stop-btn"]'
)
btn
.
stop
.
addEventListener
(
'clikc'
,
stopRecording
)
}
if
(
!
btn
.
restart
){
btn
.
restart
=
document
.
querySelector
(
'[tutor-shot="restart-btn"]'
)
btn
.
restart
.
addEventListener
(
'click'
,
restartRecording
)
}
if
(
!
btn
.
counter
)
btn
.
counter
=
document
.
querySelector
(
'[tutor-shot="counter"]'
)
if
(
!
btn
.
counter
)
btn
.
counter
=
document
.
querySelector
(
'[tutor-shot="counter"]'
)
if
(
data
?.
hasOwnProperty
(
'imageNumber'
)){
if
(
data
?.
hasOwnProperty
(
'imageNumber'
)){
...
@@ -200,17 +222,23 @@ function reRenderFloatingBar(data) {
...
@@ -200,17 +222,23 @@ function reRenderFloatingBar(data) {
btn
.
play
.
style
.
display
=
'flex'
btn
.
play
.
style
.
display
=
'flex'
btn
.
pause
.
style
.
display
=
'none'
btn
.
pause
.
style
.
display
=
'none'
btn
.
stop
.
style
.
display
=
'flex'
btn
.
stop
.
style
.
display
=
'flex'
btn
.
restart
.
style
.
display
=
'flex'
btn
.
capture
.
style
.
display
=
'flex'
btn
.
playText
.
innerHTML
=
'CONTINUE'
btn
.
playText
.
innerHTML
=
'CONTINUE'
}
}
else
if
(
data
?.
status
==
'recording'
)
{
else
if
(
data
?.
status
==
'recording'
)
{
btn
.
play
.
style
.
display
=
'none'
btn
.
play
.
style
.
display
=
'none'
btn
.
pause
.
style
.
display
=
'flex'
btn
.
pause
.
style
.
display
=
'flex'
btn
.
restart
.
style
.
display
=
'flex'
btn
.
capture
.
style
.
display
=
'flex'
btn
.
stop
.
style
.
display
=
'flex'
btn
.
stop
.
style
.
display
=
'flex'
}
}
else
{
// stopped
else
{
// stopped
btn
.
play
.
style
.
display
=
'flex'
btn
.
play
.
style
.
display
=
'flex'
btn
.
pause
.
style
.
display
=
'none'
btn
.
pause
.
style
.
display
=
'none'
btn
.
stop
.
style
.
display
=
'none'
btn
.
stop
.
style
.
display
=
'none'
btn
.
capture
.
style
.
display
=
'none'
btn
.
restart
.
style
.
display
=
'none'
btn
.
playText
.
innerHTML
=
'START'
btn
.
playText
.
innerHTML
=
'START'
}
}
// floatingBar.innerHTML = innerHTML
// floatingBar.innerHTML = innerHTML
...
@@ -287,3 +315,15 @@ async function startRecording() {
...
@@ -287,3 +315,15 @@ async function startRecording() {
inProgress
=
false
inProgress
=
false
}
}
}
}
async
function
pauseRecording
(){
console
.
log
(
'to pause recording'
)
}
async
function
stopRecording
(){
console
.
log
(
'to stop recocrding'
)
}
async
function
restartRecording
(){
console
.
log
(
'remove all the screenshot in current recording'
)
}
\ No newline at end of file
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