-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b465470
Showing
6 changed files
with
407 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
|
||
body{ | ||
margin: 0; | ||
padding: 10px; | ||
font-family: Arial, Helvetica, sans-serif; | ||
min-width: 400px; | ||
text-align: center; | ||
} | ||
|
||
#input-el { | ||
width: 100%; | ||
box-sizing: border-box; | ||
padding: 10px; | ||
border: 1px solid #5f9341; | ||
} | ||
|
||
button { | ||
margin-top: 5px; | ||
color: white; | ||
background-color: rgb(56, 139, 56); | ||
padding: 12px 25px; | ||
border: 1px solid #5f9341; | ||
font-weight: bold; | ||
font-size: 1.1rem; | ||
border-radius: 3px; | ||
} | ||
|
||
#delete-btn { | ||
margin-top: 5px; | ||
color: #5f9341; | ||
background-color: white; | ||
border: 1px solid #5f9341; | ||
padding: 12px 25px; | ||
font-weight: bold; | ||
font-size: 1.1rem; | ||
border-radius: 3px; | ||
} | ||
|
||
#delete-btn:hover { | ||
background-color: #5f9341; | ||
font-weight: bold; | ||
font-size: 1.1rem; | ||
color: white; | ||
} | ||
|
||
ul{ | ||
margin-top: 20px; | ||
list-style: none; | ||
padding-left: 0; | ||
} | ||
|
||
li{ | ||
margin-top: 5px; | ||
} | ||
|
||
li a { | ||
color: #5f9341; | ||
} | ||
|
||
|
||
/* BOX EXAMPLE */ | ||
|
||
/* html, body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: Arial, Helvetica, sans-serif; | ||
} | ||
#box { | ||
cursor: pointer; | ||
background-color: lightseagreen; | ||
padding: 40px; | ||
width: 200px; | ||
text-align: center; | ||
margin: 20px auto; | ||
color: white; | ||
font-weight: bold; | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="index.css"> | ||
<title>Chrome extension</title> | ||
</head> | ||
<body> | ||
<input type="text" id="input-el"> | ||
<button id="input-btn">SAVE INPUT</button> | ||
<button id="tab-btn">SAVE TAB</button> | ||
<button id="delete-btn">DELETE ALL</button> | ||
<ul id="ul-el"></ul> | ||
|
||
<!-- <button id="button-el">LOG JAMES SCORE</button> --> | ||
|
||
<!-- <div id="box">Open the box</div> --> | ||
|
||
<!-- <div id="buys"></div> --> | ||
|
||
<!-- <p id="welcome-el"></p> --> | ||
|
||
<script src="index.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// chrome://Extensions | ||
|
||
let myLeads = [] | ||
let oldLeads = [] | ||
const inputEl = document.getElementById("input-el") | ||
const inputBtn = document.getElementById("input-btn") | ||
const ulEL = document.getElementById("ul-el") | ||
const deleteBtn = document.getElementById("delete-btn") | ||
const fromLocalStorage = JSON.parse( localStorage.getItem("myLeads") ) | ||
let tabBtn = document.getElementById("tab-btn") | ||
|
||
if (fromLocalStorage) { | ||
myLeads = fromLocalStorage | ||
render(myLeads) | ||
} | ||
|
||
tabBtn.addEventListener("click", function(){ | ||
// console.log(tabs[0].url) | ||
chrome.tabs.query({active: true, currentWindow: true}, function(tabs){ | ||
myLeads.push(tabs[0].url) | ||
localStorage.setItem("myLeads", JSON.stringify(myLeads)) | ||
render(myLeads) | ||
}) | ||
|
||
}) | ||
|
||
function render(Leads) { | ||
let listItems = "" | ||
for (i = 0; i < Leads.length; i++) { | ||
// listItems += "<li><a target='_blank' href='" + myLeads[i] + "'>" + myLeads[i] + "</a></li>" | ||
listItems += ` | ||
<li> | ||
<a target='_blank' href='${Leads[i]}'> | ||
${Leads[i]} | ||
</a> | ||
</li>` | ||
} | ||
ulEL.innerHTML = listItems | ||
} | ||
|
||
deleteBtn.addEventListener("dblclick", function() { | ||
localStorage.clear() | ||
myLeads = [] | ||
render(myLeads) | ||
}) | ||
|
||
inputBtn.addEventListener("click", function() { | ||
myLeads.push(inputEl.value) | ||
inputEl.value = "" | ||
localStorage.setItem("myLeads", JSON.stringify(myLeads)) | ||
render(myLeads) | ||
console.log(localStorage.getItem("myLeads")) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"manifest_version": 3, | ||
"version": "1.0", | ||
"name": "Leads Tracker", | ||
"action": { | ||
"default_popup": "index.html", | ||
"default_icon": "icon.png" | ||
}, | ||
"permissions": [ | ||
"tabs" | ||
] | ||
|
||
} |
Oops, something went wrong.