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
b409ee53
Commit
b409ee53
authored
Nov 22, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logout button on click capturer
parent
3677ab23
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
5 deletions
+38
-5
background.js
background.js
+24
-1
content.js
content.js
+2
-4
icon-128.png
images/icon-128.png
+0
-0
popup.html
popup.html
+2
-0
popup.js
popup.js
+10
-0
No files found.
background.js
View file @
b409ee53
...
@@ -45,8 +45,9 @@ var getUserDetails = null
...
@@ -45,8 +45,9 @@ var getUserDetails = null
imageNumber
=
imgNum
?
imgNum
:
0
imageNumber
=
imgNum
?
imgNum
:
0
let
rec
=
await
getData
(
'recording'
)
let
rec
=
await
getData
(
'recording'
)
recording
=
rec
?
rec
:
false
recording
=
rec
?
rec
:
false
loggedIn
=
true
userDetails
=
data
userDetails
=
data
loggedIn
=
(
userDetails
.
email
||
userDetails
.
uid
)?
true
:
false
;
}
}
})
})
...
@@ -267,6 +268,28 @@ var getUserDetails = null
...
@@ -267,6 +268,28 @@ var getUserDetails = null
setData
(
"recording"
,
false
)
setData
(
"recording"
,
false
)
setData
(
"imageNumber"
,
0
)
setData
(
"imageNumber"
,
0
)
setData
(
"tutorShotId"
,
tutorShotId
)
setData
(
"tutorShotId"
,
tutorShotId
)
imageNumber
=
0
;
return
}
if
(
request
.
action
===
'logout'
)
{
loggedIn
=
false
;
recording
=
false
;
userDetails
=
{};
tutorShotId
=
null
;
imageNumber
=
0
;
sendResponse
({
userDetails
,
loggedIn
,
recording
,
status
:
"stopped"
});
sendMessageToActiveTab
(
"recordingStopped"
)
setData
(
"recording"
,
false
)
setData
(
"imageNumber"
,
0
)
setData
(
"tutorShotId"
,
null
)
setData
(
"userDetails"
,
{})
setData
(
"loggedIn"
,
false
)
// setData()
return
return
}
}
if
(
loggedIn
&&
request
.
action
===
'restartRecording'
)
{
if
(
loggedIn
&&
request
.
action
===
'restartRecording'
)
{
...
...
content.js
View file @
b409ee53
...
@@ -304,10 +304,8 @@ chrome.runtime.onMessage.addListener(async function (message, sender, sendRespon
...
@@ -304,10 +304,8 @@ chrome.runtime.onMessage.addListener(async function (message, sender, sendRespon
if
(
message
.
action
==
'tabChanged'
)
{
if
(
message
.
action
==
'tabChanged'
)
{
// console.log('tabChanged', message)
// console.log('tabChanged', message)
}
}
if
(
message
.
status
)
{
if
(
message
.
action
==
'loggedOut'
)
{
}
reRenderFloatingBar
(
data
)
if
(
message
.
action
==
'SSCaptured'
)
{
// let data = await api.post("/tutor-shot/screen-shot", message)
}
}
let
data
=
await
getCaptureData
()
let
data
=
await
getCaptureData
()
reRenderFloatingBar
(
data
)
reRenderFloatingBar
(
data
)
...
...
images/icon-128.png
0 → 100644
View file @
b409ee53
14.5 KB
popup.html
View file @
b409ee53
...
@@ -127,6 +127,8 @@
...
@@ -127,6 +127,8 @@
<div
style=
"display: flex;align-items: center;"
>
<div
style=
"display: flex;align-items: center;"
>
<button
id=
"my-captures-btn"
type=
"button"
style=
"background-color: #f36418;background-image: linear-gradient(150deg,#f36418 19%, #fc9c2a 75%);border: none;cursor: pointer;border-radius:6px;font-size: 14px;font-weight: 600;height:30px;padding: 8px 12px;align-items: center;justify-content: center;color: #fff;display: flex; text-decoration: none; margin-left: 40px; margin-top: 10px;"
>
My Captures
<button
id=
"my-captures-btn"
type=
"button"
style=
"background-color: #f36418;background-image: linear-gradient(150deg,#f36418 19%, #fc9c2a 75%);border: none;cursor: pointer;border-radius:6px;font-size: 14px;font-weight: 600;height:30px;padding: 8px 12px;align-items: center;justify-content: center;color: #fff;display: flex; text-decoration: none; margin-left: 40px; margin-top: 10px;"
>
My Captures
</button>
</button>
<button
id=
"logout-btn"
type=
"button"
style=
"background-color: #f36418;background-image: linear-gradient(150deg,#f36418 19%, #fc9c2a 75%);border: none;cursor: pointer;border-radius:6px;font-size: 14px;font-weight: 600;height:30px;padding: 8px 12px;align-items: center;justify-content: center;color: #fff;display: flex; text-decoration: none; margin-left: 40px; margin-top: 10px;"
>
Logout
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
popup.js
View file @
b409ee53
...
@@ -18,10 +18,20 @@
...
@@ -18,10 +18,20 @@
let
userName
=
document
.
getElementById
(
'user-name'
)
let
userName
=
document
.
getElementById
(
'user-name'
)
let
userEmail
=
document
.
getElementById
(
'user-email'
)
let
userEmail
=
document
.
getElementById
(
'user-email'
)
let
myCapturesBtn
=
document
.
getElementById
(
'my-captures-btn'
)
let
myCapturesBtn
=
document
.
getElementById
(
'my-captures-btn'
)
let
logoutBtn
=
document
.
getElementById
(
'logout-btn'
)
myCapturesBtn
.
addEventListener
(
'click'
,(
e
)
=>
{
window
.
open
(
origin
+
'/tutor-shot-list'
)
})
myCapturesBtn
.
addEventListener
(
'click'
,(
e
)
=>
{
window
.
open
(
origin
+
'/tutor-shot-list'
)
})
let
userDetails
=
{};
let
userDetails
=
{};
let
inProgress
=
false
;
let
inProgress
=
false
;
logoutBtn
.
addEventListener
(
'click'
,
()
=>
{
chrome
.
runtime
.
sendMessage
({
action
:
"logout"
},
async
function
(
response
)
{
loggedIn
=
false
userDetails
.
email
=
""
userDetails
.
uid
=
""
modifyPopupUI
()
})
})
let
loginBtn
=
document
.
getElementById
(
'login-btn'
)
let
loginBtn
=
document
.
getElementById
(
'login-btn'
)
loginBtn
.
addEventListener
(
'click'
,
()
=>
{
window
.
open
(
origin
)
})
loginBtn
.
addEventListener
(
'click'
,
()
=>
{
window
.
open
(
origin
)
})
...
...
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