-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: browser ext progress; most likely be scrapped.
- Loading branch information
1 parent
b404ca2
commit f6ca95f
Showing
5 changed files
with
56 additions
and
36 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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
document.body.style.border = "1px solid red"; | ||
|
||
let tables = document.querySelectorAll("table"); | ||
function getTables() { | ||
return document.querySelectorAll("table"); | ||
} | ||
let tables = getTables(); | ||
console.log("tables", tables); | ||
let tables2 = Array.from(tables).map((table) => { | ||
return table.classList.add("table-sort"); | ||
}); | ||
|
||
|
||
|
||
function addTableSortClass() { | ||
let tablesWithTableSortClass = Array.from(tables).map((table) => { | ||
return table.classList.add("table-sort"); | ||
}); | ||
return tablesWithTableSortClass; | ||
} | ||
addTableSortClass(); |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// let tables = document.querySelectorAll("table").querySelectorAll("th"); | ||
// console.log("tables3", tables); | ||
let headers = document.querySelectorAll("table th"); | ||
console.log("tables3", headers); | ||
|
||
let headerText = headers.map((header)=>header.innerHTML) | ||
console.log(headerText) | ||
function getTableHeaders() { | ||
let headers = document.querySelectorAll("table th"); | ||
let headerNames = Array.from(headers).map((header) => header.innerText); | ||
console.log("test", headerNames); | ||
return headerNames; | ||
} | ||
getTableHeaders(); |
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
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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Popup</title> | ||
</head> | ||
<body> | ||
<div id="popup-content"> | ||
<button>table1</button> | ||
<button>table2</button> | ||
<button>table3</button> | ||
<button>table4</button> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Popup</title> | ||
</head> | ||
<body> | ||
<div id="popup-content"> | ||
<button>table1</button> | ||
<button>table2</button> | ||
<button>table3</button> | ||
<button>table4</button> | ||
</div> | ||
<script src="../setButtons.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,17 @@ | ||
// let tables = window.document.querySelectorAll("table"); | ||
// console.log(getTableHeaders()) | ||
let headers = document.querySelectorAll("table th"); | ||
console.log(headers) | ||
let headerNames = Array.from(headers).map((header) => header.innerText); | ||
console.log("nnnn"); | ||
|
||
|
||
headerNames.forEach((name) => { | ||
const btn = document.createElement("button"); | ||
console.log(name); | ||
btn.innerText = name; | ||
|
||
document.querySelector("#popup-content").appendChild(btn); | ||
let test = document.querySelector("#popup-content"); | ||
console.log(test); | ||
}) |