-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpopup.js
33 lines (27 loc) · 1.12 KB
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { updateUI } from "./scripts/helperFunctions.js";
const authButton = document.querySelector("#authenticate-btn");
const authRequestSection = document.querySelector("#authenticate-request");
const linkRepoButton = document.querySelector("#link-repo-btn");
const linkRepoRequestSection = document.querySelector("#link-repo-request");
const repoConnectedSection = document.querySelector("#repo-connected");
const aTagForRepoUrl = document.querySelector("#repo-url");
const starCodeHubButton = document.querySelector("#star-repo-button");
const globeIcon = document.querySelector("#globe-icon");
authButton.addEventListener("click", () => {
chrome.runtime.sendMessage({ action: "authenticateUser" });
});
linkRepoButton.addEventListener("click", () => {
chrome.tabs.create({ url: "welcome.html" });
});
globeIcon.addEventListener("click", () => {
chrome.tabs.create({ url: "welcome.html" });
});
starCodeHubButton.addEventListener("click", () => {
chrome.tabs.create({ url: "http://www.github.com/febinbellamy/codehub" });
});
updateUI(
authRequestSection,
linkRepoRequestSection,
repoConnectedSection,
aTagForRepoUrl
);